diff options
Diffstat (limited to 'lib')
109 files changed, 1519 insertions, 1136 deletions
diff --git a/lib/compiler/src/beam_bsm.erl b/lib/compiler/src/beam_bsm.erl index 286307a4be..ae1b34ba49 100644 --- a/lib/compiler/src/beam_bsm.erl +++ b/lib/compiler/src/beam_bsm.erl @@ -205,8 +205,15 @@ btb_reaches_match_1(Is, Regs, D) -> btb_reaches_match_2([{block,Bl}|Is], Regs0, D) -> Regs = btb_reaches_match_block(Bl, Regs0), btb_reaches_match_1(Is, Regs, D); -btb_reaches_match_2([{call,Arity,{f,Lbl}}|Is], Regs, D) -> - btb_call(Arity, Lbl, Regs, Is, D); +btb_reaches_match_2([{call,Arity,{f,Lbl}}|Is], Regs0, D) -> + case is_tail_call(Is) of + true -> + Regs1 = btb_kill_not_live(Arity, Regs0), + Regs = btb_kill_yregs(Regs1), + btb_tail_call(Lbl, Regs, D); + false -> + btb_call(Arity, Lbl, Regs0, Is, D) + end; btb_reaches_match_2([{apply,Arity}|Is], Regs, D) -> btb_call(Arity+2, apply, Regs, Is, D); btb_reaches_match_2([{call_fun,Live}=I|Is], Regs, D) -> @@ -360,6 +367,10 @@ btb_reaches_match_2([{line,_}|Is], Regs, D) -> btb_reaches_match_2([I|_], Regs, _) -> btb_error({btb_context_regs(Regs),I,not_handled}). +is_tail_call([{deallocate,_}|_]) -> true; +is_tail_call([return|_]) -> true; +is_tail_call(_) -> false. + btb_call(Arity, Lbl, Regs0, Is, D0) -> Regs = btb_kill_not_live(Arity, Regs0), case btb_are_x_registers_empty(Regs) of @@ -369,15 +380,15 @@ btb_call(Arity, Lbl, Regs0, Is, D0) -> D = btb_tail_call(Lbl, Regs, D0), %% No problem so far (the called function can handle a - %% match context). Now we must make sure that the rest - %% of this function following the call does not attempt - %% to use the match context in case there is a copy - %% tucked away in a y register. + %% match context). Now we must make sure that we don't + %% have any copies of the match context tucked away in an + %% y register. RegList = btb_context_regs(Regs), - YRegs = [R || {y,_}=R <- RegList], - case btb_are_all_unused(YRegs, Is, D) of - true -> D; - false -> btb_error({multiple_uses,RegList}) + case [R || {y,_}=R <- RegList] of + [] -> + D; + [_|_] -> + btb_error({multiple_uses,RegList}) end; true -> %% No match context in any x register. It could have been diff --git a/lib/compiler/test/bs_match_SUITE.erl b/lib/compiler/test/bs_match_SUITE.erl index 224abf6c29..a9bee888d9 100644 --- a/lib/compiler/test/bs_match_SUITE.erl +++ b/lib/compiler/test/bs_match_SUITE.erl @@ -38,7 +38,8 @@ no_partition/1,calling_a_binary/1,binary_in_map/1, match_string_opt/1,select_on_integer/1, map_and_binary/1,unsafe_branch_caching/1, - bad_literals/1,good_literals/1,constant_propagation/1]). + bad_literals/1,good_literals/1,constant_propagation/1 + ]). -export([coverage_id/1,coverage_external_ignore/2]). @@ -768,6 +769,11 @@ multiple_uses(Config) when is_list(Config) -> {344,62879,345,<<245,159,1,89>>} = multiple_uses_1(<<1,88,245,159,1,89>>), true = multiple_uses_2(<<0,0,197,18>>), <<42,43>> = multiple_uses_3(<<0,0,42,43>>, fun id/1), + + ok = first_after(<<>>, 42), + <<1>> = first_after(<<1,2,3>>, 0), + <<2>> = first_after(<<1,2,3>>, 1), + ok. multiple_uses_1(<<X:16,Tail/binary>>) -> @@ -789,6 +795,24 @@ multiple_uses_match(<<Y:16,Z:16>>) -> multiple_uses_cmp(<<Y:16>>, <<Y:16>>) -> true; multiple_uses_cmp(<<_:16>>, <<_:16>>) -> false. +first_after(Data, Offset) -> + case byte_size(Data) > Offset of + false -> + {First, Rest} = {ok, ok}, + ok; + true -> + <<_:Offset/binary, Rest/binary>> = Data, + %% 'Rest' saved in y(0) before the call. + {First, _} = match_first(Data, Rest), + %% When beam_bsm sees the code, the following line + %% which uses y(0) has been optimized away. + {First, Rest} = {First, Rest}, + First + end. + +match_first(_, <<First:1/binary, Rest/binary>>) -> + {First, Rest}. + zero_label(Config) when is_list(Config) -> <<"nosemouth">> = read_pols(<<"FACE","nose","mouth">>), <<"CE">> = read_pols(<<"noFACE">>), diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 0e4e85cef7..c100fc8ee2 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -588,7 +588,7 @@ static void error_handler(void* null, const char* errstr) } #endif /* HAVE_DYNAMIC_CRYPTO_LIB */ -static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) +static int initialize(ErlNifEnv* env, ERL_NIF_TERM load_info) { #ifdef OPENSSL_THREADS ErlNifSysInfo sys_info; @@ -603,7 +603,7 @@ static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) char lib_buf[1000]; if (!verify_lib_version()) - return 0; + return __LINE__; /* load_info: {301, <<"/full/path/of/this/library">>} */ if (!enif_get_tuple(env, load_info, &tpl_arity, &tpl_array) @@ -613,7 +613,7 @@ static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) || !enif_inspect_binary(env, tpl_array[1], &lib_bin)) { PRINTF_ERR1("CRYPTO: Invalid load_info '%T'", load_info); - return 0; + return __LINE__; } hmac_context_rtype = enif_open_resource_type(env, NULL, "hmac_context", @@ -622,7 +622,7 @@ static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) NULL); if (!hmac_context_rtype) { PRINTF_ERR0("CRYPTO: Could not open resource type 'hmac_context'"); - return 0; + return __LINE__; } #if OPENSSL_VERSION_NUMBER >= OpenSSL_version_plain(1,0,0) evp_md_ctx_rtype = enif_open_resource_type(env, NULL, "EVP_MD_CTX", @@ -631,7 +631,7 @@ static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) NULL); if (!evp_md_ctx_rtype) { PRINTF_ERR0("CRYPTO: Could not open resource type 'EVP_MD_CTX'"); - return 0; + return __LINE__; } #endif #ifdef HAVE_EVP_AES_CTR @@ -641,14 +641,14 @@ static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) NULL); if (!evp_cipher_ctx_rtype) { PRINTF_ERR0("CRYPTO: Could not open resource type 'EVP_CIPHER_CTX'"); - return 0; + return __LINE__; } #endif if (library_refc > 0) { /* Repeated loading of this library (module upgrade). * Atoms and callbacks are already set, we are done. */ - return 1; + return 0; } atom_true = enif_make_atom(env,"true"); @@ -694,14 +694,14 @@ static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) { void* handle; if (!change_basename(&lib_bin, lib_buf, sizeof(lib_buf), crypto_callback_name)) { - return 0; + return __LINE__; } if (!(handle = enif_dlopen(lib_buf, &error_handler, NULL))) { - return 0; + return __LINE__; } if (!(funcp = (get_crypto_callbacks_t*) enif_dlsym(handle, "get_crypto_callbacks", &error_handler, NULL))) { - return 0; + return __LINE__; } } #else /* !HAVE_DYNAMIC_CRYPTO_LIB */ @@ -720,7 +720,7 @@ static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) if (!ccb || ccb->sizeof_me != sizeof(*ccb)) { PRINTF_ERR0("Invalid 'crypto_callbacks'"); - return 0; + return __LINE__; } CRYPTO_set_mem_functions(ccb->crypto_alloc, ccb->crypto_realloc, ccb->crypto_free); @@ -734,13 +734,14 @@ static int init(ErlNifEnv* env, ERL_NIF_TERM load_info) CRYPTO_set_dynlock_destroy_callback(ccb->dyn_destroy_function); } #endif /* OPENSSL_THREADS */ - return 1; + return 0; } static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info) { - if (!init(env, load_info)) { - return -1; + int errline = initialize(env, load_info); + if (errline) { + return errline; } *priv_data = NULL; @@ -751,14 +752,16 @@ static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info) static int upgrade(ErlNifEnv* env, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info) { + int errline; if (*old_priv_data != NULL) { - return -1; /* Don't know how to do that */ + return __LINE__; /* Don't know how to do that */ } if (*priv_data != NULL) { - return -1; /* Don't know how to do that */ + return __LINE__; /* Don't know how to do that */ } - if (!init(env, load_info)) { - return -1; + errline = initialize(env, load_info); + if (errline) { + return errline; } library_refc++; return 0; diff --git a/lib/dialyzer/doc/src/book.xml b/lib/dialyzer/doc/src/book.xml index aecc0e5bfa..46df8b81b8 100644 --- a/lib/dialyzer/doc/src/book.xml +++ b/lib/dialyzer/doc/src/book.xml @@ -25,7 +25,7 @@ <title>Dialyzer</title> <prepared></prepared> <docno></docno> - <date></date> + <date>2016-09-19</date> <rev></rev> <file>book.xml</file> </header> diff --git a/lib/dialyzer/doc/src/dialyzer.xml b/lib/dialyzer/doc/src/dialyzer.xml index 619db125b1..553bfef41b 100644 --- a/lib/dialyzer/doc/src/dialyzer.xml +++ b/lib/dialyzer/doc/src/dialyzer.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>2006</year><year>2015</year> + <year>2006</year><year>2016</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -25,341 +25,477 @@ <title>dialyzer</title> <prepared></prepared> <docno></docno> - <date></date> + <date>2016-09-20</date> <rev></rev> + <file>dialyzer.xml</file> </header> <module>dialyzer</module> - <modulesummary>The Dialyzer, a DIscrepancy AnalYZer for ERlang programs</modulesummary> + <modulesummary>Dialyzer, a DIscrepancy AnaLYZer for ERlang programs. + </modulesummary> <description> - <p>The Dialyzer is a static analysis tool that identifies software - discrepancies such as definite type errors, code which has become - dead or unreachable due to some programming error, unnecessary - tests, etc. in single Erlang modules or entire (sets of) - applications. Dialyzer starts its analysis from either - debug-compiled BEAM bytecode or from Erlang source code. The file - and line number of a discrepancy is reported along with an - indication of what the discrepancy is about. Dialyzer bases its - analysis on the concept of success typings which allows for sound - warnings (no false positives).</p> - <p>Read more about Dialyzer and about how to use it from the GUI - in <seealso marker="dialyzer_chapter">Dialyzer User's - Guide</seealso>.</p> + <p>Dialyzer is a static analysis tool that identifies software + discrepancies, such as definite type errors, code that has become dead + or unreachable because of programming error, and unnecessary tests, + in single Erlang modules or entire (sets of) applications.</p> + + <p>Dialyzer starts its analysis from either + debug-compiled BEAM bytecode or from Erlang source code. The file + and line number of a discrepancy is reported along with an + indication of what the discrepancy is about. Dialyzer bases its + analysis on the concept of success typings, which allows for sound + warnings (no false positives).</p> </description> <section> - <title>Using the Dialyzer from the command line</title> - <p>Dialyzer also has a command line version for automated use. Below is a - brief description of the list of its options. The same information can - be obtained by writing</p> - <code type="none"> - dialyzer --help</code> - <p>in a shell. Please refer to the GUI description for more details on - the operation of Dialyzer.</p> - <p>The exit status of the command line version is:</p> + <marker id="command_line"></marker> + <title>Using Dialyzer from the Command Line</title> + <p>Dialyzer has a command-line version for automated use. This + section provides a brief description of the options. The same information + can be obtained by writing the following in a shell:</p> + <code type="none"> - 0 - No problems were encountered during the analysis and no - warnings were emitted. - 1 - Problems were encountered during the analysis. - 2 - No problems were encountered, but warnings were emitted.</code> - <p>Usage:</p> +dialyzer --help</code> + + <p>For more details about the operation of Dialyzer, see section + <seealso marker="dialyzer_chapter#dialyzer_gui"> + Using Dialyzer from the GUI</seealso> in the User's Guide.</p> + + <p><em>Exit status of the command-line version:</em></p> + + <taglist> + <tag><c>0</c></tag> + <item> + <p>No problems were found during the analysis and no warnings were + emitted.</p> + </item> + <tag><c>1</c></tag> + <item> + <p>Problems were found during the analysis.</p> + </item> + <tag><c>2</c></tag> + <item> + <p>No problems were found during the analysis, but warnings were + emitted.</p> + </item> + </taglist> + + <p><em>Usage:</em></p> + <code type="none"> - dialyzer [--help] [--version] [--shell] [--quiet] [--verbose] - [-pa dir]* [--plt plt] [--plts plt*] [-Ddefine]* - [-I include_dir]* [--output_plt file] [-Wwarn]* [--raw] - [--src] [--gui] [files_or_dirs] [-r dirs] - [--apps applications] [-o outfile] - [--build_plt] [--add_to_plt] [--remove_from_plt] - [--check_plt] [--no_check_plt] [--plt_info] [--get_warnings] - [--dump_callgraph file] [--no_native] [--fullpath] - [--statistics] [--no_native_cache]</code> - <p>Options:</p> +dialyzer [--add_to_plt] [--apps applications] [--build_plt] + [--check_plt] [-Ddefine]* [-Dname] [--dump_callgraph file] + [files_or_dirs] [--fullpath] [--get_warnings] [--gui] [--help] + [-I include_dir]* [--no_check_plt] [--no_native] + [--no_native_cache] [-o outfile] [--output_plt file] [-pa dir]* + [--plt plt] [--plt_info] [--plts plt*] [--quiet] [-r dirs] + [--raw] [--remove_from_plt] [--shell] [--src] [--statistics] + [--verbose] [--version] [-Wwarn]*</code> + + <note> + <p>* denotes that multiple occurrences of the option are possible.</p> + </note> + + <p><em>Options:</em></p> + <taglist> - <tag><c><![CDATA[files_or_dirs]]></c> (for backwards compatibility also - as: <c><![CDATA[-c files_or_dirs]]></c>)</tag> - <item>Use Dialyzer from the command line to detect defects in the - specified files or directories containing <c><![CDATA[.erl]]></c> or - <c><![CDATA[.beam]]></c> files, depending on the type of the - analysis.</item> - <tag><c><![CDATA[-r dirs]]></c></tag> - <item>Same as the previous but the specified directories are searched - recursively for subdirectories containing <c><![CDATA[.erl]]></c> or - <c><![CDATA[.beam]]></c> files in them, depending on the type of - analysis.</item> - <tag><c><![CDATA[--apps applications]]></c></tag> - <item>Option typically used when building or modifying a plt as in: + <tag><c>--add_to_plt</c></tag> + <item> + <p>The PLT is extended to also include the files specified with + <c>-c</c> and <c>-r</c>. Use + <c>--plt</c> to specify which PLT to start from, + and <c>--output_plt</c> to specify where to put the PLT. + Notice that the analysis possibly can include files from the PLT if + they depend on the new files. This option only works for BEAM + files.</p> + </item> + <tag><c>--apps applications</c></tag> + <item> + <p>This option is typically used when building or modifying a PLT as + in:</p> <code type="none"> - dialyzer --build_plt --apps erts kernel stdlib mnesia ...</code> - to conveniently refer to library applications corresponding to the - Erlang/OTP installation. However, the option is general and can also - be used during analysis in order to refer to Erlang/OTP applications. - In addition, file or directory names can also be included, as in: +dialyzer --build_plt --apps erts kernel stdlib mnesia ...</code> + <p>to refer conveniently to library applications corresponding to the + Erlang/OTP installation. However, this option is general and can also + be used during analysis to refer to Erlang/OTP applications. + File or directory names can also be included, as in:</p> <code type="none"> - dialyzer --apps inets ssl ./ebin ../other_lib/ebin/my_module.beam</code></item> - <tag><c><![CDATA[-o outfile]]></c> (or - <c><![CDATA[--output outfile]]></c>)</tag> - <item>When using Dialyzer from the command line, send the analysis - results to the specified outfile rather than to stdout.</item> - <tag><c><![CDATA[--raw]]></c></tag> - <item>When using Dialyzer from the command line, output the raw analysis - results (Erlang terms) instead of the formatted result. The raw format - is easier to post-process (for instance, to filter warnings or to - output HTML pages).</item> - <tag><c><![CDATA[--src]]></c></tag> - <item>Override the default, which is to analyze BEAM files, and - analyze starting from Erlang source code instead.</item> - <tag><c><![CDATA[-Dname]]></c> (or <c><![CDATA[-Dname=value]]></c>)</tag> - <item>When analyzing from source, pass the define to Dialyzer. (**)</item> - <tag><c><![CDATA[-I include_dir]]></c></tag> - <item>When analyzing from source, pass the <c><![CDATA[include_dir]]></c> - to Dialyzer. (**)</item> - <tag><c><![CDATA[-pa dir]]></c></tag> - <item>Include <c><![CDATA[dir]]></c> in the path for Erlang (useful when - analyzing files that have <c><![CDATA['-include_lib()']]></c> - directives).</item> - <tag><c><![CDATA[--output_plt file]]></c></tag> - <item>Store the plt at the specified file after building it.</item> - <tag><c><![CDATA[--plt plt]]></c></tag> - <item>Use the specified plt as the initial plt (if the plt was built - during setup the files will be checked for consistency).</item> - <tag><c><![CDATA[--plts plt*]]></c></tag> - <item>Merge the specified plts to create the initial plt -- requires - that the plts are disjoint (i.e., do not have any module - appearing in more than one plt). - The plts are created in the usual way: +dialyzer --apps inets ssl ./ebin ../other_lib/ebin/my_module.beam</code> + </item> + <tag><c>--build_plt</c></tag> + <item> + <p>The analysis starts from an empty PLT and creates a new one from + the files specified with <c>-c</c> and + <c>-r</c>. This option only works for BEAM files. + To override the default PLT location, use + <c>--plt</c> or <c>--output_plt</c>.</p> + </item> + <tag><c>--check_plt</c></tag> + <item> + <p>Check the PLT for consistency and rebuild it if it is not + up-to-date.</p> + </item> + <tag><c>-Dname</c> (or <c>-Dname=value</c>)</tag> + <item> + <p>When analyzing from source, pass the define to Dialyzer. + (**)</p> + </item> + <tag><c>--dump_callgraph file</c></tag> + <item> + <p>Dump the call graph into the specified file whose format is + determined by the filename extension. Supported extensions are: + <c>raw</c>, <c>dot</c>, and <c>ps</c>. If something else is used as + filename extension, default format <c>.raw</c> is used.</p> + </item> + <tag><c>files_or_dirs</c> (for backward compatibility also + as <c>-c files_or_dirs</c>)</tag> + <item> + <p>Use Dialyzer from the command line to detect defects in the + specified files or directories containing <c>.erl</c> or + <c>.beam</c> files, depending on the type of the + analysis.</p> + </item> + <tag><c>--fullpath</c></tag> + <item> + <p>Display the full path names of files for which warnings are + emitted.</p> + </item> + <tag><c>--get_warnings</c></tag> + <item> + <p>Make Dialyzer emit warnings even when manipulating the PLT. + Warnings are only emitted for files that are analyzed.</p> + </item> + <tag><c>--gui</c></tag> + <item> + <p>Use the GUI.</p></item> + <tag><c>--help</c> (or <c>-h</c>)</tag> + <item> + <p>Print this message and exit.</p> + </item> + <tag><c>-I include_dir</c></tag> + <item> + <p>When analyzing from source, pass the <c>include_dir</c> + to Dialyzer. (**)</p> + </item> + <tag><c>--no_check_plt</c></tag> + <item> + <p>Skip the PLT check when running Dialyzer. This is useful when + working with installed PLTs that never change.</p> + </item> + <tag><c>--no_native</c> (or <c>-nn</c>)</tag> + <item> + <p>Bypass the native code compilation of some key files that + Dialyzer heuristically performs when dialyzing many files. + This avoids the compilation time, but can result in (much) longer + analysis time.</p> + </item> + <tag><c>--no_native_cache</c></tag> + <item> + <p>By default, Dialyzer caches the results of native compilation + in directory <c>$XDG_CACHE_HOME/erlang/dialyzer_hipe_cache</c>. + <c>XDG_CACHE_HOME</c> defaults to <c>$HOME/.cache</c>. + Use this option to disable caching.</p> + </item> + <tag><c>-o outfile</c> (or + <c>--output outfile</c>)</tag> + <item> + <p>When using Dialyzer from the command line, send the analysis + results to the specified outfile rather than to <c>stdout</c>.</p> + </item> + <tag><c>--output_plt file</c></tag> + <item> + <p>Store the PLT at the specified file after building it.</p> + </item> + <tag><c>-pa dir</c></tag> + <item> + <p>Include <c>dir</c> in the path for Erlang. This is useful + when analyzing files that have <c>-include_lib()</c> + directives.</p> + </item> + <tag><c>--plt plt</c></tag> + <item> + <p>Use the specified PLT as the initial PLT. If the PLT was built + during setup, the files are checked for consistency.</p> + </item> + <tag><c>--plt_info</c></tag> + <item> + <p>Make Dialyzer print information about the PLT and then quit. + The PLT can be specified with <c>--plt(s)</c>.</p> + </item> + <tag><c>--plts plt*</c></tag> + <item> + <p>Merge the specified PLTs to create the initial PLT. This requires + that the PLTs are disjoint (that is, do not have any module + appearing in more than one PLT). + The PLTs are created in the usual way:</p> <code type="none"> - dialyzer --build_plt --output_plt plt_1 files_to_include - ... - dialyzer --build_plt --output_plt plt_n files_to_include</code> - and then can be used in either of the following ways: +dialyzer --build_plt --output_plt plt_1 files_to_include +... +dialyzer --build_plt --output_plt plt_n files_to_include</code> + <p>They can then be used in either of the following ways:</p> <code type="none"> - dialyzer files_to_analyze --plts plt_1 ... plt_n</code> - or: +dialyzer files_to_analyze --plts plt_1 ... plt_n</code> + <p>or</p> <code type="none"> - dialyzer --plts plt_1 ... plt_n -- files_to_analyze</code> - (Note the -- delimiter in the second case)</item> - <tag><c><![CDATA[-Wwarn]]></c></tag> - <item>A family of options which selectively turn on/off warnings - (for help on the names of warnings use - <c><![CDATA[dialyzer -Whelp]]></c>). - Note that the options can also be given in the file with a - <c>-dialyzer()</c> attribute. See <seealso - marker="#suppression">Requesting or Suppressing Warnings in - Source Files</seealso> below for details.</item> - <tag><c><![CDATA[--shell]]></c></tag> - <item>Do not disable the Erlang shell while running the GUI.</item> - <tag><c><![CDATA[--version]]></c> (or <c><![CDATA[-v]]></c>)</tag> - <item>Print the Dialyzer version and some more information and - exit.</item> - <tag><c><![CDATA[--help]]></c> (or <c><![CDATA[-h]]></c>)</tag> - <item>Print this message and exit.</item> - <tag><c><![CDATA[--quiet]]></c> (or <c><![CDATA[-q]]></c>)</tag> - <item>Make Dialyzer a bit more quiet.</item> - <tag><c><![CDATA[--verbose]]></c></tag> - <item>Make Dialyzer a bit more verbose.</item> - <tag><c><![CDATA[--statistics]]></c></tag> - <item>Prints information about the progress of execution (analysis phases, - time spent in each and size of the relative input).</item> - <tag><c><![CDATA[--build_plt]]></c></tag> - <item>The analysis starts from an empty plt and creates a new one from - the files specified with <c><![CDATA[-c]]></c> and - <c><![CDATA[-r]]></c>. Only works for beam files. Use - <c><![CDATA[--plt]]></c> or <c><![CDATA[--output_plt]]></c> to - override the default plt location.</item> - <tag><c><![CDATA[--add_to_plt]]></c></tag> - <item>The plt is extended to also include the files specified with - <c><![CDATA[-c]]></c> and <c><![CDATA[-r]]></c>. Use - <c><![CDATA[--plt]]></c> to specify which plt to start from, - and <c><![CDATA[--output_plt]]></c> to specify where to put the plt. - Note that the analysis might include files from the plt if they depend - on the new files. This option only works with beam files.</item> - <tag><c><![CDATA[--remove_from_plt]]></c></tag> - <item>The information from the files specified with - <c><![CDATA[-c]]></c> and <c><![CDATA[-r]]></c> is removed - from the plt. Note that this may cause a re-analysis of the remaining - dependent files.</item> - <tag><c><![CDATA[--check_plt]]></c></tag> - <item>Check the plt for consistency and rebuild it if it is not - up-to-date.</item> - <tag><c><![CDATA[--no_check_plt]]></c></tag> - <item>Skip the plt check when running Dialyzer. Useful when working with - installed plts that never change.</item> - <tag><c><![CDATA[--plt_info]]></c></tag> - <item>Make Dialyzer print information about the plt and then quit. The - plt can be specified with <c><![CDATA[--plt(s)]]></c>.</item> - <tag><c><![CDATA[--get_warnings]]></c></tag> - <item>Make Dialyzer emit warnings even when manipulating the plt. - Warnings are only emitted for files that are actually analyzed.</item> - <tag><c><![CDATA[--dump_callgraph file]]></c></tag> - <item>Dump the call graph into the specified file whose format is - determined by the file name extension. Supported extensions are: raw, - dot, and ps. If something else is used as file name extension, default - format '.raw' will be used.</item> - <tag><c><![CDATA[--no_native]]></c> (or <c><![CDATA[-nn]]></c>)</tag> - <item>Bypass the native code compilation of some key files that Dialyzer - heuristically performs when dialyzing many files; this avoids the - compilation time but it may result in (much) longer analysis - time.</item> - <tag><c><![CDATA[--no_native_cache]]></c></tag> - <item>By default, Dialyzer caches the results of native compilation in the - <c>$XDG_CACHE_HOME/erlang/dialyzer_hipe_cache</c> directory. - <c>XDG_CACHE_HOME</c> defaults to <c>$HOME/.cache</c>. - Use this option to disable caching.</item> - <tag><c><![CDATA[--fullpath]]></c></tag> - <item>Display the full path names of files for which warnings are emitted.</item> - <tag><c><![CDATA[--gui]]></c></tag> - <item>Use the GUI.</item> +dialyzer --plts plt_1 ... plt_n -- files_to_analyze</code> + <p>Notice the <c>--</c> delimiter in the second case.</p> + </item> + <tag><c>--quiet</c> (or <c>-q</c>)</tag> + <item> + <p>Make Dialyzer a bit more quiet.</p> + </item> + <tag><c>-r dirs</c></tag> + <item> + <p>Same as <c>files_or_dirs</c>, but the specified + directories are searched + recursively for subdirectories containing <c>.erl</c> or + <c>.beam</c> files in them, depending on the type of + analysis.</p> + </item> + <tag><c>--raw</c></tag> + <item> + <p>When using Dialyzer from the command line, output the raw + analysis results (Erlang terms) instead of the formatted result. + The raw format + is easier to post-process (for example, to filter warnings or to + output HTML pages).</p> + </item> + <tag><c>--remove_from_plt</c></tag> + <item> + <p>The information from the files specified with + <c>-c</c> and <c>-r</c> is removed from + the PLT. Notice that this can cause a reanalysis of the remaining + dependent files.</p> + </item> + <tag><c>--shell</c></tag> + <item> + <p>Do not disable the Erlang shell while running the GUI.</p> + </item> + <tag><c>--src</c></tag> + <item> + <p>Override the default, which is to analyze BEAM files, and + analyze starting from Erlang source code instead.</p> + </item> + <tag><c>--statistics</c></tag> + <item> + <p>Print information about the progress of execution (analysis phases, + time spent in each, and size of the relative input).</p> + </item> + <tag><c>--verbose</c></tag> + <item> + <p>Make Dialyzer a bit more verbose.</p> + </item> + <tag><c>--version</c> (or <c>-v</c>)</tag> + <item> + <p>Print the Dialyzer version and some more information and + exit.</p> + </item> + <tag><c>-Wwarn</c></tag> + <item> + <p>A family of options that selectively turn on/off warnings. + (For help on the names of warnings, use + <c>dialyzer -Whelp</c>.) + Notice that the options can also be specified in the file with a + <c>-dialyzer()</c> attribute. For details, see section <seealso + marker="#suppression">Requesting or Suppressing Warnings in + Source Files</seealso>.</p> + </item> </taglist> + <note> - <p>* denotes that multiple occurrences of these options are possible.</p> - <p>** options <c><![CDATA[-D]]></c> and <c><![CDATA[-I]]></c> work both from command-line and in the Dialyzer GUI; - the syntax of defines and includes is the same as that used by <c><![CDATA[erlc]]></c>.</p> + <p>** options <c>-D</c> and <c>-I</c> work both + from the command line and in the Dialyzer GUI; the syntax of + defines and includes is the same as that used by + <seealso marker="erts:erlc">erlc(1)</seealso>.</p> </note> - <p>Warning options:</p> + + <p><em>Warning options:</em></p> + <taglist> - <tag><c><![CDATA[-Wno_return]]></c></tag> - <item>Suppress warnings for functions that will never return a - value.</item> - <tag><c><![CDATA[-Wno_unused]]></c></tag> - <item>Suppress warnings for unused functions.</item> - <tag><c><![CDATA[-Wno_improper_lists]]></c></tag> - <item>Suppress warnings for construction of improper lists.</item> - <tag><c><![CDATA[-Wno_fun_app]]></c></tag> - <item>Suppress warnings for fun applications that will fail.</item> - <tag><c><![CDATA[-Wno_match]]></c></tag> - <item>Suppress warnings for patterns that are unused or cannot - match.</item> - <tag><c><![CDATA[-Wno_opaque]]></c></tag> - <item>Suppress warnings for violations of opaqueness of data types.</item> - <tag><c><![CDATA[-Wno_fail_call]]></c></tag> - <item>Suppress warnings for failing calls.</item> - <tag><c><![CDATA[-Wno_contracts]]></c></tag> - <item>Suppress warnings about invalid contracts.</item> - <tag><c><![CDATA[-Wno_behaviours]]></c></tag> - <item>Suppress warnings about behaviour callbacks which drift from the - published recommended interfaces.</item> - <tag><c><![CDATA[-Wno_missing_calls]]></c></tag> - <item>Suppress warnings about calls to missing functions.</item> - <tag><c><![CDATA[-Wno_undefined_callbacks]]></c></tag> - <item>Suppress warnings about behaviours that have no - <c>-callback</c> attributes for their callbacks.</item> - <tag><c><![CDATA[-Wunmatched_returns]]></c>***</tag> - <item>Include warnings for function calls which ignore a structured return - value or do not match against one of many possible return - value(s).</item> - <tag><c><![CDATA[-Werror_handling]]></c>***</tag> - <item>Include warnings for functions that only return by means of an - exception.</item> - <tag><c><![CDATA[-Wrace_conditions]]></c>***</tag> - <item>Include warnings for possible race conditions. Note that the - analysis that finds data races performs intra-procedural data flow analysis - and can sometimes explode in time. Enable it at your own risk. - </item> - <tag><c><![CDATA[-Wunderspecs]]></c>***</tag> - <item>Warn about underspecified functions - (the -spec is strictly more allowing than the success typing).</item> - <tag><c><![CDATA[-Wunknown]]></c>***</tag> - <item>Let warnings about unknown functions and types affect the - exit status of the command line version. The default is to ignore - warnings about unknown functions and types when setting the exit - status. When using the Dialyzer from Erlang, warnings about unknown - functions and types are returned; the default is not to return - these warnings.</item> + <tag><c>-Werror_handling</c> (***)</tag> + <item> + <p>Include warnings for functions that only return by an exception.</p> + </item> + <tag><c>-Wno_behaviours</c></tag> + <item> + <p>Suppress warnings about behavior callbacks that drift from the + published recommended interfaces.</p> + </item> + <tag><c>-Wno_contracts</c></tag> + <item> + <p>Suppress warnings about invalid contracts.</p> + </item> + <tag><c>-Wno_fail_call</c></tag> + <item> + <p>Suppress warnings for failing calls.</p> + </item> + <tag><c>-Wno_fun_app</c></tag> + <item> + <p>Suppress warnings for fun applications that will fail.</p> + </item> + <tag><c>-Wno_improper_lists</c></tag> + <item> + <p>Suppress warnings for construction of improper lists.</p> + </item> + <tag><c>-Wno_match</c></tag> + <item> + <p>Suppress warnings for patterns that are unused or cannot match.</p> + </item> + <tag><c>-Wno_missing_calls</c></tag> + <item> + <p>Suppress warnings about calls to missing functions.</p> + </item> + <tag><c>-Wno_opaque</c></tag> + <item> + <p>Suppress warnings for violations of opaqueness of data types.</p> + </item> + <tag><c>-Wno_return</c></tag> + <item> + <p>Suppress warnings for functions that will never return a value.</p> + </item> + <tag><c>-Wno_undefined_callbacks</c></tag> + <item> + <p>Suppress warnings about behaviors that have no + <c>-callback</c> attributes for their callbacks.</p> + </item> + <tag><c>-Wno_unused</c></tag> + <item> + <p>Suppress warnings for unused functions.</p> + </item> + <tag><c>-Wrace_conditions</c> (***)</tag> + <item> + <p>Include warnings for possible race conditions. Notice that the + analysis that finds data races performs intra-procedural data flow + analysis and can sometimes explode in time. Enable it at your own + risk.</p> + </item> + <tag><c>-Wunderspecs</c> (***)</tag> + <item> + <p>Warn about underspecified functions (the specification is strictly + more allowing than the success typing).</p> + </item> + <tag><c>-Wunknown</c> (***)</tag> + <item> + <p>Let warnings about unknown functions and types affect the + exit status of the command-line version. The default is to ignore + warnings about unknown functions and types when setting the exit + status. When using Dialyzer from Erlang, warnings about unknown + functions and types are returned; the default is not to return + these warnings.</p> + </item> + <tag><c>-Wunmatched_returns</c> (***)</tag> + <item> + <p>Include warnings for function calls that ignore a structured return + value or do not match against one of many possible return + value(s).</p> + </item> </taglist> - <p>The following options are also available but their use is not - recommended: (they are mostly for Dialyzer developers and internal - debugging)</p> + + <p>The following options are also available, but their use is not + recommended (they are mostly for Dialyzer developers and internal + debugging):</p> + <taglist> - <tag><c><![CDATA[-Woverspecs]]></c>***</tag> - <item>Warn about overspecified functions - (the -spec is strictly less allowing than the success typing).</item> - <tag><c><![CDATA[-Wspecdiffs]]></c>***</tag> - <item>Warn when the -spec is different than the success typing.</item> + <tag><c>-Woverspecs</c> (***)</tag> + <item> + <p>Warn about overspecified functions (the specification is strictly + less allowing than the success typing).</p> + </item> + <tag><c>-Wspecdiffs</c> (***)</tag> + <item> + <p>Warn when the specification is different than the success typing.</p> + </item> </taglist> + <note> - <p>*** Identifies options that turn on warnings rather than - turning them off.</p> + <p>*** denotes options that turn on warnings rather than + turning them off.</p> </note> </section> <section> - <title>Using the Dialyzer from Erlang</title> - <p>You can also use Dialyzer directly from Erlang. Both the GUI and the - command line versions are available. The options are similar to the ones - given from the command line, so please refer to the sections above for - a description of these.</p> + <title>Using Dialyzer from Erlang</title> + <p>Dialyzer can be used directly from Erlang. Both the GUI and the + command-line versions are also available. The options are similar to the + ones given from the command line, see section + <seealso marker="#command_line"> + Using Dialyzer from the Command Line</seealso>.</p> </section> <section> <marker id="suppression"></marker> <title>Requesting or Suppressing Warnings in Source Files</title> - <p> - The <c>-dialyzer()</c> attribute can be used for turning off + <p>Attribute <c>-dialyzer()</c> can be used for turning off warnings in a module by specifying functions or warning options. For example, to turn off all warnings for the function - <c>f/0</c>, include the following line: - </p> -<code type="none"> --dialyzer({nowarn_function, f/0}). -</code> + <c>f/0</c>, include the following line:</p> + + <code type="none"> +-dialyzer({nowarn_function, f/0}).</code> + <p>To turn off warnings for improper lists, add the following line - to the source file: - </p> -<code type="none"> --dialyzer(no_improper_lists). -</code> - <p>The <c>-dialyzer()</c> attribute is allowed after function - declarations. Lists of warning options or functions are allowed: - </p> -<code type="none"> --dialyzer([{nowarn_function, [f/0]}, no_improper_lists]). -</code> - <p> - Warning options can be restricted to functions: - </p> -<code type="none"> --dialyzer({no_improper_lists, g/0}). -</code> -<code type="none"> --dialyzer({[no_return, no_match], [g/0, h/0]}). -</code> - <p> - For help on the warning options use <c>dialyzer -Whelp</c>. The - options are also enumerated <seealso - marker="#gui/1">below</seealso> (<c>WarnOpts</c>). - </p> + to the source file:</p> + + <code type="none"> +-dialyzer(no_improper_lists).</code> + + <p>Attribute <c>-dialyzer()</c> is allowed after function + declarations. Lists of warning options or functions are allowed:</p> + + <code type="none"> +-dialyzer([{nowarn_function, [f/0]}, no_improper_lists]).</code> + + <p>Warning options can be restricted to functions:</p> + + <code type="none"> +-dialyzer({no_improper_lists, g/0}).</code> + + <code type="none"> +-dialyzer({[no_return, no_match], [g/0, h/0]}).</code> + + <p>For help on the warning options, use <c>dialyzer -Whelp</c>. The + options are also enumerated, see function <seealso marker="#gui/1"> + <c>gui/1</c></seealso> below (<c>WarnOpts</c>).</p> + <note> - <p> - The <c>-dialyzer()</c> attribute is not checked by the Erlang - Compiler, but by the Dialyzer itself. - </p> + <p>Attribute <c>-dialyzer()</c> is not checked by the Erlang + compiler, but by Dialyzer itself.</p> </note> + <note> - <p> - The warning option <c>-Wrace_conditions</c> has no effect when - set in source files. - </p> + <p>Warning option <c>-Wrace_conditions</c> has no effect when + set in source files.</p> </note> - <p> - The <c>-dialyzer()</c> attribute can also be used for turning on - warnings. For instance, if a module has been fixed regarding - unmatched returns, adding the line - </p> -<code type="none"> --dialyzer(unmatched_returns). -</code> - <p> - can help in assuring that no new unmatched return warnings are - introduced. - </p> + + <p>Attribute <c>-dialyzer()</c> can also be used for turning on + warnings. For example, if a module has been fixed regarding + unmatched returns, adding the following line can help in assuring + that no new unmatched return warnings are introduced:</p> + + <code type="none"> +-dialyzer(unmatched_returns).</code> </section> <funcs> <func> + <name>format_warning(Msg) -> string()</name> + <fsummary>Get the string version of a warning message.</fsummary> + <type> + <v>Msg = {Tag, Id, msg()}</v> + <d>See <c>run/1</c>.</d> + </type> + <desc> + <p>Get a string from warnings as returned by + <seealso marker="#run/1"><c>run/1</c></seealso>.</p> + </desc> + </func> + + <func> <name>gui() -> ok | {error, Msg}</name> <name>gui(OptList) -> ok | {error, Msg}</name> - <fsummary>Dialyzer GUI version</fsummary> + <fsummary>Dialyzer GUI version.</fsummary> <type> - <v>OptList -- see below</v> + <v>OptList</v> + <d>See below.</d> </type> <desc> <p>Dialyzer GUI version.</p> @@ -368,9 +504,12 @@ OptList :: [Option] Option :: {files, [Filename :: string()]} | {files_rec, [DirName :: string()]} | {defines, [{Macro :: atom(), Value :: term()}]} - | {from, src_code | byte_code} %% Defaults to byte_code - | {init_plt, FileName :: string()} %% If changed from default - | {plts, [FileName :: string()]} %% If changed from default + | {from, src_code | byte_code} + %% Defaults to byte_code + | {init_plt, FileName :: string()} + %% If changed from default + | {plts, [FileName :: string()]} + %% If changed from default | {include_dirs, [DirName :: string()]} | {output_file, FileName :: string()} | {output_plt, FileName :: string()} @@ -383,76 +522,71 @@ Option :: {files, [Filename :: string()]} | {warnings, [WarnOpts]} | {get_warnings, bool()} -WarnOpts :: no_return - | no_unused - | no_improper_lists +WarnOpts :: error_handling + | no_behaviours + | no_contracts + | no_fail_call | no_fun_app + | no_improper_lists | no_match + | no_missing_calls | no_opaque - | no_fail_call - | no_contracts - | no_behaviours + | no_return | no_undefined_callbacks - | unmatched_returns - | error_handling + | no_unused | race_conditions - | overspecs | underspecs - | specdiffs - | unknown</code> + | unknown + | unmatched_returns + | overspecs + | specdiffs</code> </desc> </func> + <func> - <name>run(OptList) -> Warnings</name> - <fsummary>Dialyzer command line version</fsummary> - <type> - <v>OptList -- see gui/0,1</v> - <v>Warnings -- see below </v> - </type> + <name>plt_info(string()) -> {'ok', [{atom(), any()}]} | {'error', atom()}</name> + <fsummary>Return information about the specified PLT.</fsummary> <desc> - <p>Dialyzer command line version.</p> - <code type="none"> -Warnings :: [{Tag, Id, Msg}] -Tag :: 'warn_behaviour' - | 'warn_bin_construction' - | 'warn_callgraph' - | 'warn_contract_not_equal' - | 'warn_contract_range' - | 'warn_contract_subtype' - | 'warn_contract_supertype' - | 'warn_contract_syntax' - | 'warn_contract_types' - | 'warn_failing_call' - | 'warn_fun_app' - | 'warn_matching' - | 'warn_non_proper_list' - | 'warn_not_called' - | 'warn_opaque' - | 'warn_race_condition' - | 'warn_return_no_exit' - | 'warn_return_only_exit' - | 'warn_umatched_return' - | 'warn_undefined_callbacks' - | 'warn_unknown' -Id = {File :: string(), Line :: integer()} -Msg = msg() -- Undefined</code> + <p>Returns information about the specified PLT.</p> </desc> </func> + <func> - <name>format_warning(Msg) -> string()</name> - <fsummary>Get the string version of a warning message.</fsummary> + <name>run(OptList) -> Warnings</name> + <fsummary>Dialyzer command-line version.</fsummary> <type> - <v>Msg = {Tag, Id, msg()} -- See run/1</v> + <v>OptList</v> + <d>See <c>gui/0,1</c>.</d> + <v>Warnings</v> + <d>See below.</d> </type> <desc> - <p>Get a string from warnings as returned by dialyzer:run/1.</p> - </desc> - </func> - <func> - <name>plt_info(string()) -> {'ok', [{atom(), any()}]} | {'error', atom()}</name> - <fsummary>Returns information about the specified plt.</fsummary> - <desc> - <p>Returns information about the specified plt.</p> + <p>Dialyzer command-line version.</p> + <code type="none"> +Warnings :: [{Tag, Id, Msg}] +Tag :: 'warn_behaviour' + | 'warn_bin_construction' + | 'warn_callgraph' + | 'warn_contract_not_equal' + | 'warn_contract_range' + | 'warn_contract_subtype' + | 'warn_contract_supertype' + | 'warn_contract_syntax' + | 'warn_contract_types' + | 'warn_failing_call' + | 'warn_fun_app' + | 'warn_matching' + | 'warn_non_proper_list' + | 'warn_not_called' + | 'warn_opaque' + | 'warn_race_condition' + | 'warn_return_no_exit' + | 'warn_return_only_exit' + | 'warn_umatched_return' + | 'warn_undefined_callbacks' + | 'warn_unknown' +Id = {File :: string(), Line :: integer()} +Msg = msg() -- Undefined</code> </desc> </func> </funcs> diff --git a/lib/dialyzer/doc/src/dialyzer_chapter.xml b/lib/dialyzer/doc/src/dialyzer_chapter.xml index c445f2633f..b5acf3732e 100644 --- a/lib/dialyzer/doc/src/dialyzer_chapter.xml +++ b/lib/dialyzer/doc/src/dialyzer_chapter.xml @@ -25,196 +25,211 @@ <title>Dialyzer</title> <prepared></prepared> <docno></docno> - <date></date> + <date>2016-09-19</date> <rev></rev> <file>dialyzer_chapter.xml</file> </header> <section> <title>Introduction</title> - <p><em>Dialyzer</em> is a static analysis tool that identifies software discrepancies - such as type errors, unreachable code, unnecessary tests, etc in single Erlang modules - or entire (sets of) applications.</p> - </section> - - <section> - <title>Using the Dialyzer from the GUI</title> - <section> - <title>Choosing the applications or modules</title> - <p>In the "File" window you will find a listing of the current directory. - Click your way to the directories/modules you want to add or type the - correct path in the entry.</p> - <p>Mark the directories/modules you want to analyze for discrepancies and - click "Add". You can either add the <c><![CDATA[.beam]]></c> and <c><![CDATA[.erl]]></c>-files directly, or - you can add directories that contain these kinds of files. Note that - you are only allowed to add the type of files that can be analyzed in - the current mode of operation (see below), and that you cannot mix - <c><![CDATA[.beam]]></c> and <c><![CDATA[.erl]]></c>-files.</p> + <title>Scope</title> + <p>Dialyzer is a static analysis tool that identifies software + discrepancies, such as definite type errors, code that has become dead + or unreachable because of programming error, and unnecessary tests, + in single Erlang modules or entire (sets of) applications.</p> + + <p>Dialyzer can be called from the command line, from Erlang, + and from a GUI.</p> </section> <section> - <title>The analysis modes</title> - <p>Dialyzer has two modes of analysis, "Byte Code" or "Source Code". - These are controlled by the buttons in the top-middle part of the - main window, under "Analysis Options".</p> - </section> - - <section> - <title>Controlling the discrepancies reported by the Dialyzer</title> - <p>Under the "Warnings" pull-down menu, there are buttons that control - which discrepancies are reported to the user in the "Warnings" window. - By clicking on these buttons, one can enable/disable a whole class of - warnings. Information about the classes of warnings can be found on - the "Warnings" item under the "Help" menu (at the rightmost top corner).</p> - <p>If modules are compiled with inlining, spurious warnings may be emitted. - In the "Options" menu you can choose to ignore inline-compiled modules - when analyzing byte code. When starting from source code this is not a - problem since the inlining is explicitly turned off by Dialyzer. The - option causes Dialyzer to suppress all warnings from inline-compiled - modules, since there is currently no way for Dialyzer to find what - parts of the code have been produced by inlining. </p> + <title>Prerequisites</title> + <p>It is assumed that the reader is familiar with the Erlang programming + language.</p> </section> + </section> - <section> - <title>Running the analysis</title> - <p>Once you have chosen the modules or directories you want to analyze, - click the "Run" button to start the analysis. If for some reason you - want to stop the analysis while it is running, push the "Stop" button.</p> - <p>The information from the analysis will be displayed in the Log and the - Warnings windows.</p> - </section> + <section> + <marker id="plt"/> + <title>The Persistent Lookup Table</title> + <p>Dialyzer stores the result of an analysis in a Persistent + Lookup Table (PLT). The PLT can then be used as a starting + point for later analyses. It is recommended to build a PLT with the + Erlang/OTP applications that you are using, but also to include your + own applications that you are using frequently.</p> + + <p>The PLT is built using option <c>--build_plt</c> to Dialyzer. + The following command builds the recommended minimal PLT for + Erlang/OTP:</p> - <section> - <title>Include directories and macro definitions</title> - <p>When analyzing from source you might have to supply Dialyzer with a - list of include directories and macro definitions (as you can do with - the <c><![CDATA[erlc]]></c> flags <c><![CDATA[-I]]></c> and <c><![CDATA[-D]]></c>). This can be done either by starting Dialyzer - with these flags from the command line as in:</p> - <code type="none"> + <code type="none"> +dialyzer --build_plt --apps erts kernel stdlib mnesia</code> - dialyzer -I my_includes -DDEBUG -Dvsn=42 -I one_more_dir - </code> - <p>or by adding these explicitly using the "Manage Macro Definitions" or - "Manage Include Directories" sub-menus in the "Options" menu.</p> - </section> + <p>Dialyzer looks if there is an environment variable called + <c>DIALYZER_PLT</c> and places the PLT at this location. If no such + variable is set, Dialyzer places the PLT at + <c>$HOME/.dialyzer_plt</c>. The placement can also be specified using + the options <c>--plt</c> or <c>--output_plt</c>.</p> - <section> - <title>Saving the information on the Log and Warnings windows</title> - <p>In the "File" menu there are options to save the contents of the Log - and the Warnings window. Just choose the options and enter the file to - save the contents in.</p> - <p>There are also buttons to clear the contents of each window.</p> - </section> + <p>Information can be added to an existing PLT using option + <c>--add_to_plt</c>. If you also want to include the Erlang compiler in + the PLT and place it in a new PLT, then use the following command:</p> - <section> - <title>Inspecting the inferred types of the analyzed functions</title> - <p>Dialyzer stores the information of the analyzed functions in a - Persistent Lookup Table (PLT). After an analysis you can inspect this - information. In the PLT menu you can choose to either search the PLT - or inspect the contents of the whole PLT. The information is presented - in edoc format.</p> - </section> - </section> + <code type="none"> +dialyzer --add_to_plt --apps compiler --output_plt my.plt</code> - <section> - <title>Using the Dialyzer from the command line</title> - <p>See <seealso marker="dialyzer">dialyzer(3)</seealso>.</p> - </section> + <p>Then you can add your favorite application my_app to the new + PLT:</p> - <section> - <title>Using the Dialyzer from Erlang</title> - <p>See <seealso marker="dialyzer">dialyzer(3)</seealso>.</p> - </section> + <code type="none"> +dialyzer --add_to_plt --plt my.plt -r my_app/ebin</code> - <section> - <title>More on the Persistent Lookup Table (PLT)</title> + <p>But you realize that it is unnecessary to have the Erlang compiler in this + one:</p> - <p> The persistent lookup table, or PLT, is used to store the - result of an analysis. The PLT can then be used as a starting - point for later analyses. It is recommended to build a PLT with - the otp applications that you are using, but also to include your - own applications that you are using frequently.</p> + <code type="none"> +dialyzer --remove_from_plt --plt my.plt --apps compiler</code> - <p>The PLT is built using the --build_plt option to dialyzer. The - following command builds the recommended minimal PLT for OTP.</p> + <p>Later, when you have fixed a bug in your application my_app, + you want to update the PLT so that it becomes fresh the next time + you run Dialyzer. In this case, run the following command:</p> <code type="none"> +dialyzer --check_plt --plt my.plt</code> - dialyzer --build_plt -r $ERL_TOP/lib/stdlib/ebin\ - $ERL_TOP/lib/kernel/ebin \ - $ERL_TOP/lib/mnesia/ebin - </code> + <p>Dialyzer then reanalyzes the changed files + and the files that depend on these files. Notice that this + consistency check is performed automatically the next time you + run Dialyzer with this PLT. Option <c>--check_plt</c> is only + for doing so without doing any other analysis.</p> - <p>Dialyzer will look if there is an environment variable called - $DIALYZER_PLT and place the PLT at this location. If no such - variable is set, Dialyzer will place the PLT at - $HOME/.dialyzer_plt. The placement can also be specified using the - --plt, or --output_plt options.</p> - - <p>You can also add information to an existing plt using the - --add_to_plt option. Suppose you want to also include the compiler - in the PLT and place it in a new PLT, then give the command</p> + <p>To get information about a PLT, use the following option:</p> <code type="none"> +dialyzer --plt_info</code> - dialyzer --add_to_plt -r $ERL_TOP/lib/compiler/ebin --output_plt my.plt - </code> + <p>To specify which PLT, use option <c>--plt</c>.</p> - <p>Then you would like to add your favorite application my_app to - the new plt.</p> + <p>To get the output printed to a file, use option <c>--output_file</c>.</p> - <code type="none"> + <p>Notice that when manipulating the PLT, no warnings are + emitted. To turn on warnings during (re)analysis of the PLT, use + option <c>--get_warnings</c>.</p> + </section> - dialyzer --add_to_plt --plt my.plt -r my_app/ebin - </code> + <section> + <title>Using Dialyzer from the Command Line</title> + <p>Dialyzer has a command-line version for automated use. + See <seealso marker="dialyzer"><c>dialyzer(3)</c></seealso>.</p> + </section> - <p>But you realize that it is unnecessary to have compiler in this one.</p> + <section> + <title>Using Dialyzer from Erlang</title> + <p>Dialyzer can also be used directly from Erlang. + See <seealso marker="dialyzer"><c>dialyzer(3)</c></seealso>.</p> + </section> - <code type="none"> + <section> + <marker id="dialyzer_gui"/> + <title>Using Dialyzer from the GUI</title> + <section> + <title>Choosing the Applications or Modules</title> + <p>The <em>File</em> window displays a listing of the current directory. + Click your way to the directories/modules you want to add or type the + correct path in the entry.</p> - dialyzer --remove_from_plt --plt my.plt -r $ERL_TOP/lib/compiler/ebin - </code> + <p>Mark the directories/modules you want to analyze for discrepancies and + click <em>Add</em>. You can either add the <c>.beam</c> and + <c>.erl</c> files directly, or add directories that contain + these kind of files. Notice that + you are only allowed to add the type of files that can be analyzed in + the current mode of operation (see below), and that you cannot mix + <c>.beam</c> and <c>.erl</c> files.</p> + </section> - <p> Later, when you have fixed a bug in your application my_app, - you want to update the plt so that it will be fresh the next time - you run Dialyzer, run the command</p> + <section> + <title>Analysis Modes</title> + <p>Dialyzer has two analysis modes: "Byte Code" and "Source Code". + They are controlled by the buttons in the top-middle part of the + main window, under <em>Analysis Options</em>.</p> + </section> - <code type="none"> + <section> + <title>Controlling the Discrepancies Reported by Dialyzer</title> + <p>Under the <em>Warnings</em> pull-down menu, there are buttons that + control which discrepancies are reported to the user in the + <em>Warnings</em> window. By clicking these buttons, you can + enable/disable a whole class of warnings. Information about the classes + of warnings is found on the "Warnings" item under the <em>Help</em> + menu (in the rightmost top corner).</p> + + <p>If modules are compiled with inlining, spurious warnings can be + emitted. In the <em>Options</em> menu you can choose to ignore + inline-compiled modules when analyzing byte code. + When starting from source code, this is not a problem because + inlining is explicitly turned off by Dialyzer. The option causes + Dialyzer to suppress all warnings from inline-compiled + modules, as there is currently no way for Dialyzer to find what + parts of the code have been produced by inlining.</p> + </section> - dialyzer --check_plt --plt my.plt - </code> + <section> + <title>Running the Analysis</title> + <p>Once you have chosen the modules or directories you want to analyze, + click the <em>Run</em> button to start the analysis. If you for some + reason want to stop the analysis while it is running, click the + <em>Stop</em> button.</p> - <p> Dialyzer will then reanalyze the files that have been changed, - and the files that depend on these files. Note that this - consistency check will be performed automatically the next time - you run Dialyzer with this plt. The --check_plt option is merely - for doing so without doing any other analysis.</p> + <p>The information from the analysis is displayed in the <em>Log</em> + window and the <em>Warnings</em> window.</p> + </section> - <p> To get some information about a plt use the option</p> - <code type="none"> + <section> + <title>Include Directories and Macro Definitions</title> + <p>When analyzing from source, you might have to supply Dialyzer + with a list of include directories and macro definitions (as you can do + with the <seealso marker="erts:erlc"><c>erlc</c></seealso> flags + <c>-I</c> and <c>-D</c>). This can be done + either by starting Dialyzer with these flags from the command + line as in:</p> + + <code type="none"> +dialyzer -I my_includes -DDEBUG -Dvsn=42 -I one_more_dir</code> - dialyzer --plt_info - </code> + <p>or by adding these explicitly using submenu + <em>Manage Macro Definitions</em> or + <em>Manage Include Directories</em> in the <em>Options</em> menu.</p> + </section> - <p>You can also specify which plt with the --plt option, and get the - output printed to a file with --output_file</p> + <section> + <title>Saving the Information on the Log and Warnings Windows</title> + <p>The <em>File</em> menu includes options to save the contents of the + <em>Log</em> window and the <em>Warnings</em> window. Simply choose the + options and enter the file to save the contents in.</p> - <p>Note that when manipulating the plt, no warnings are - emitted. To turn on warnings during (re)analysis of the plt, use - the option --get_warnings.</p> + <p>There are also buttons to clear the contents of each window.</p> + </section> + <section> + <title>Inspecting the Inferred Types of the Analyzed Functions</title> + <p>Dialyzer stores the information of the analyzed functions in a + Persistent Lookup Table (PLT), see section + <seealso marker="#plt">The Persistent Lookup Table</seealso>.</p> + + <p>After an analysis, you can inspect this information. + In the <em>PLT</em> menu you can choose to either search the PLT + or inspect the contents of the whole PLT. The information is presented + in <seealso marker="edoc:edoc"><c>EDoc</c></seealso> format.</p> + </section> </section> <section> - <title>Feedback and bug reports</title> - <p>At this point, we very much welcome user feedback (even wish-lists!). - If you notice something weird, especially if the Dialyzer reports any - discrepancy that is a false positive, please send an error report - describing the symptoms and how to reproduce them to:</p> - <code type="none"><![CDATA[ - ]]></code> + <title>Feedback and Bug Reports</title> + <p>We very much welcome user feedback - even wishlists! + If you notice anything weird, especially if Dialyzer reports + any discrepancy that is a false positive, please send an error report + describing the symptoms and how to reproduce them.</p> </section> </chapter> diff --git a/lib/dialyzer/doc/src/part.xml b/lib/dialyzer/doc/src/part.xml index 575f77549a..9bfcf21a66 100644 --- a/lib/dialyzer/doc/src/part.xml +++ b/lib/dialyzer/doc/src/part.xml @@ -25,12 +25,11 @@ <title>Dialyzer User's Guide</title> <prepared></prepared> <docno></docno> - <date></date> + <date>2016-09-19</date> <rev></rev> <file>part.xml</file> </header> <description> - <p><em>Dialyzer</em> is a static analysis tool that identifies software discrepancies such as type errors, unreachable code, unnecessary tests, etc in single Erlang modules or entire (sets of) applications.</p> </description> <xi:include href="dialyzer_chapter.xml"/> </part> diff --git a/lib/dialyzer/doc/src/ref_man.xml b/lib/dialyzer/doc/src/ref_man.xml index 01478cfb40..ddac047f2e 100644 --- a/lib/dialyzer/doc/src/ref_man.xml +++ b/lib/dialyzer/doc/src/ref_man.xml @@ -25,11 +25,10 @@ <title>Dialyzer Reference Manual</title> <prepared></prepared> <docno></docno> - <date></date> + <date>2016-09-19</date> <rev></rev> </header> <description> - <p><em>Dialyzer</em> is a static analysis tool that identifies software discrepancies such as type errors, unreachable code, unnecessary tests, etc in single Erlang modules or entire (sets of) applications.</p> </description> <xi:include href="dialyzer.xml"/> </application> diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml index 13471aab2c..705afec022 100644 --- a/lib/inets/doc/src/httpc.xml +++ b/lib/inets/doc/src/httpc.xml @@ -68,7 +68,7 @@ this module:</p> <p><c>boolean() = true | false</c></p> <p><c>string()</c> = list of ASCII characters</p> - <p><c>request_id() = ref()</c></p> + <p><c>request_id() = reference()</c></p> <p><c>profile() = atom()</c></p> <p><c>path() = string()</c> representing a file path or directory path</p> <p><c>ip_address()</c> = See the diff --git a/lib/inets/doc/src/mod_esi.xml b/lib/inets/doc/src/mod_esi.xml index 006fca1bdf..46cc796c8a 100644 --- a/lib/inets/doc/src/mod_esi.xml +++ b/lib/inets/doc/src/mod_esi.xml @@ -67,7 +67,7 @@ <tag><c>{remote_adress, inet:ip_address()} </c></tag> <item><p>The clients ip address.</p></item> - <tag><c>{peer_cert, undefined | no_peercert | DER:binary()</c></tag> + <tag><c>{peer_cert, undefined | no_peercert | DER:binary()}</c></tag> <item> <p>For TLS connections where client certificates are used this will be an ASN.1 DER-encoded X509-certificate as an Erlang binary. diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index d1c52dcc78..59cb1299e9 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -45,28 +45,30 @@ -record(timers, { - request_timers = [], % [ref()] - queue_timer % ref() + request_timers = [] :: [reference()], + queue_timer :: reference() | 'undefined' }). +-type session_failed() :: {'connect_failed',term()} | {'send_failed',term()}. + -record(state, { - request, % #request{} - session, % #session{} + request :: request() | 'undefined', + session :: session() | session_failed() | 'undefined', status_line, % {Version, StatusCode, ReasonPharse} - headers, % #http_response_h{} - body, % binary() + headers :: http_response_h() | 'undefined', + body :: binary() | 'undefined', mfa, % {Module, Function, Args} - pipeline = queue:new(), % queue:queue() - keep_alive = queue:new(), % queue:queue() + pipeline = queue:new() :: queue:queue(), + keep_alive = queue:new() :: queue:queue(), status, % undefined | new | pipeline | keep_alive | close | {ssl_tunnel, Request} canceled = [], % [RequestId] - max_header_size = nolimit, % nolimit | integer() - max_body_size = nolimit, % nolimit | integer() - options, % #options{} - timers = #timers{}, % #timers{} - profile_name, % atom() - id of httpc_manager process. - once = inactive % inactive | once + max_header_size = nolimit :: nolimit | integer(), + max_body_size = nolimit :: nolimit | integer(), + options :: options(), + timers = #timers{} :: #timers{}, + profile_name :: atom(), % id of httpc_manager process. + once = inactive :: 'inactive' | 'once' }). @@ -113,7 +115,7 @@ send(Request, Pid) -> %%-------------------------------------------------------------------- %% Function: cancel(RequestId, Pid) -> ok -%% RequestId = ref() +%% RequestId = reference() %% Pid = pid() - the pid of the http-request handler process. %% %% Description: Cancels a request. Intended to be called by the httpc @@ -789,47 +791,6 @@ deliver_answer(Request) -> %% Purpose: Convert process state when code is changed %%-------------------------------------------------------------------- -code_change(_, - #state{session = OldSession, - profile_name = ProfileName} = State, - upgrade_from_pre_5_8_1) -> - case OldSession of - {session, - Id, ClientClose, Scheme, Socket, SocketType, QueueLen, Type} -> - NewSession = #session{id = Id, - client_close = ClientClose, - scheme = Scheme, - socket = Socket, - socket_type = SocketType, - queue_length = QueueLen, - type = Type}, - insert_session(NewSession, ProfileName), - {ok, State#state{session = NewSession}}; - _ -> - {ok, State} - end; - -code_change(_, - #state{session = OldSession, - profile_name = ProfileName} = State, - downgrade_to_pre_5_8_1) -> - case OldSession of - #session{id = Id, - client_close = ClientClose, - scheme = Scheme, - socket = Socket, - socket_type = SocketType, - queue_length = QueueLen, - type = Type} -> - NewSession = {session, - Id, ClientClose, Scheme, Socket, SocketType, - QueueLen, Type}, - insert_session(NewSession, ProfileName), - {ok, State#state{session = NewSession}}; - _ -> - {ok, State} - end; - code_change(_, State, _) -> {ok, State}. @@ -934,8 +895,7 @@ connect_and_send_first_request(Address, Request, #state{options = Options} = Sta TmpState = State#state{request = Request, session = Session, mfa = init_mfa(Request, State), - status_line = - init_status_line(Request), + status_line = init_status_line(Request), headers = undefined, body = undefined, status = new}, @@ -947,8 +907,7 @@ connect_and_send_first_request(Address, Request, #state{options = Options} = Sta self() ! {init_error, error_sending, httpc_response:error(Request, Reason)}, {ok, State#state{request = Request, - session = - #session{socket = Socket}}} + session = #session{socket = Socket}}} end; {error, Reason} -> self() ! {init_error, error_connecting, @@ -1796,7 +1755,7 @@ tls_tunnel_request(#request{headers = Headers, URI = Host ++":" ++ integer_to_list(Port), #request{ - id = make_ref(), + id = make_ref(), from = self(), scheme = http, %% Use tcp-first and then upgrade! address = Adress, @@ -1887,10 +1846,13 @@ update_session(ProfileName, #session{id = SessionId} = Session, Pos, Value) -> httpc_manager:update_session(ProfileName, SessionId, Pos, Value) end catch - error:undef -> % This could happen during code upgrade + error:undef -> %% This could happen during code upgrade Session2 = erlang:setelement(Pos, Session, Value), insert_session(Session2, ProfileName); - T:E -> + error:badarg -> + exit(normal); %% Manager has been shutdown + T:E -> + %% Unexpected this must be an error! Stacktrace = erlang:get_stacktrace(), error_logger:error_msg("Failed updating session: " "~n ProfileName: ~p" @@ -1922,8 +1884,8 @@ update_session(ProfileName, #session{id = SessionId} = Session, Pos, Value) -> %% --------------------------------------------------------------------- call(Msg, Pid) -> - Timeout = infinity, - call(Msg, Pid, Timeout). + call(Msg, Pid, infinity). + call(Msg, Pid, Timeout) -> gen_server:call(Pid, Msg, Timeout). diff --git a/lib/inets/src/http_client/httpc_internal.hrl b/lib/inets/src/http_client/httpc_internal.hrl index f4e69cc1fa..5f8c70f28d 100644 --- a/lib/inets/src/http_client/httpc_internal.hrl +++ b/lib/inets/src/http_client/httpc_internal.hrl @@ -43,32 +43,32 @@ %%% HTTP Client per request settings -record(http_options, { - %% string() - "HTTP/1.1" | "HTTP/1.0" | "HTTP/0.9" - version, + %% "HTTP/1.1" | "HTTP/1.0" | "HTTP/0.9" + version :: 'undefined' | string(), - %% integer() | infinity - ms before a request times out - timeout = ?HTTP_REQUEST_TIMEOUT, + %% ms before a request times out + timeout = ?HTTP_REQUEST_TIMEOUT :: timeout(), - %% bool() - true if auto redirect on 30x response - autoredirect = true, + %% true if auto redirect on 30x response + autoredirect = true :: boolean(), %% ssl socket options - ssl = [], + ssl = [], %% {User, Password} = {string(), string()} proxy_auth, - %% bool() - true if not strictly std compliant - relaxed = false, + %% true if not strictly std compliant + relaxed = false :: boolean(), %% integer() - ms before a connect times out - connect_timeout = ?HTTP_REQUEST_CTIMEOUT, - - %% bool() - Use %-encoding rfc 2396 - url_encode + connect_timeout = ?HTTP_REQUEST_CTIMEOUT :: timeout(), + %% Use %-encoding rfc 2396 + url_encode :: 'undefined' | boolean() } ). +-type http_options() :: #http_options{}. %%% HTTP Client per profile setting. -record(options, @@ -82,18 +82,19 @@ keep_alive_timeout = ?HTTP_KEEP_ALIVE_TIMEOUT, % Used when pipeline_timeout = 0 max_sessions = ?HTTP_MAX_TCP_SESSIONS, cookies = disabled, % enabled | disabled | verify - verbose = false, + verbose = false, % boolean(), ipfamily = inet, % inet | inet6 | inet6fb4 ip = default, % specify local interface port = default, % specify local port socket_opts = [] % other socket options } ). +-type options() :: #options{}. %%% All data associated to a specific HTTP request -record(request, { - id, % ref() - Request Id + id :: 'undefined' | reference(), % Request Id from, % pid() - Caller redircount = 0,% Number of redirects made for this request scheme, % http | https @@ -103,7 +104,7 @@ method, % atom() - HTTP request Method headers, % #http_request_h{} content, % {ContentType, Body} - Current HTTP request - settings, % #http_options{} - User defined settings + settings :: http_options(), % User defined settings abs_uri, % string() ex: "http://www.erlang.org" userinfo, % string() - optinal "<userinfo>@<host>:<port>" stream, % boolean() - stream async reply? @@ -112,20 +113,19 @@ % for testing purposes. started, % integer() > 0 - When we started processing the % request - timer, % undefined | ref() + timer :: undefined | reference(), socket_opts, % undefined | [socket_option()] ipv6_host_with_brackets % boolean() } - ). - + ). +-type request() :: #request{}. -record(session, { %% {{Host, Port}, HandlerPid} id, - %% true | false - client_close, + client_close :: 'undefined' | boolean(), %% http (HTTP/TCP) | https (HTTP/SSL/TCP) scheme, @@ -140,14 +140,13 @@ queue_length = 1, %% pipeline | keep_alive (wait for response before sending new request) - type, + type :: 'undefined' | 'pipeline' | 'keep_alive', - %% true | false %% This will be true, when a response has been received for %% the first request. See type above. - available = false + available = false :: boolean() }). - +-type session() :: #session{}. -record(http_cookie, { @@ -162,7 +161,7 @@ secure = false, version = "0" }). - +-type http_cookie() :: #http_cookie{}. %% -record(parsed_uri, %% { diff --git a/lib/inets/src/http_client/httpc_manager.erl b/lib/inets/src/http_client/httpc_manager.erl index 4cb6f005ad..a63864493f 100644 --- a/lib/inets/src/http_client/httpc_manager.erl +++ b/lib/inets/src/http_client/httpc_manager.erl @@ -137,7 +137,7 @@ redirect_request(Request, ProfileName) -> %%-------------------------------------------------------------------- %% Function: cancel_request(RequestId, ProfileName) -> ok -%% RequestId - ref() +%% RequestId - reference() %% ProfileName = atom() %% %% Description: Cancels the request with <RequestId>. @@ -148,7 +148,7 @@ cancel_request(RequestId, ProfileName) -> %%-------------------------------------------------------------------- %% Function: request_done(RequestId, ProfileName) -> ok -%% RequestId - ref() +%% RequestId - reference() %% ProfileName = atom() %% %% Description: Inform tha manager that a request has been completed. diff --git a/lib/inets/src/http_lib/http_internal.hrl b/lib/inets/src/http_lib/http_internal.hrl index ae92b5df8f..991417cb36 100644 --- a/lib/inets/src/http_lib/http_internal.hrl +++ b/lib/inets/src/http_lib/http_internal.hrl @@ -71,7 +71,7 @@ 'last-modified', other=[] % list() - Key/Value list with other headers }). - +-type http_response_h() :: #http_response_h{}. %%% Request headers -record(http_request_h,{ @@ -118,5 +118,6 @@ 'last-modified', other=[] % list() - Key/Value list with other headers }). +-type http_request_h() :: #http_request_h{}. -endif. % -ifdef(http_internal_hrl). diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl index 071fa94ef6..7e20a9ba67 100644 --- a/lib/inets/src/http_server/httpd_request_handler.erl +++ b/lib/inets/src/http_server/httpd_request_handler.erl @@ -37,18 +37,19 @@ -include("httpd_internal.hrl"). -define(HANDSHAKE_TIMEOUT, 5000). + -record(state, {mod, %% #mod{} manager, %% pid() status, %% accept | busy | blocked mfa, %% {Module, Function, Args} max_keep_alive_request = infinity, %% integer() | infinity - response_sent = false, %% true | false - timeout, %% infinity | integer() > 0 - timer, %% ref() - Request timer - headers, %% #http_request_h{} + response_sent = false :: boolean(), + timeout, %% infinity | integer() > 0 + timer :: 'undefined' | reference(), % Request timer + headers, %% #http_request_h{} body, %% binary() data, %% The total data received in bits, checked after 10s - byte_limit %% Bit limit per second before kick out + byte_limit %% Bit limit per second before kick out }). %%==================================================================== diff --git a/lib/mnesia/src/mnesia.erl b/lib/mnesia/src/mnesia.erl index 9586adbf93..5bf2fc2dc3 100644 --- a/lib/mnesia/src/mnesia.erl +++ b/lib/mnesia/src/mnesia.erl @@ -1409,8 +1409,14 @@ select_cont(Tid,_,State=#mnesia_select{tid=Tid,written=[]}) -> select_state(dirty_sel_cont(State),State); select_cont(Tid,_Ts,State=#mnesia_select{tid=Tid}) -> trans_select(dirty_sel_cont(State), State); -select_cont(_Tid2,_,#mnesia_select{tid=_Tid1}) -> % Missmatching tids +select_cont(Tid2,_,#mnesia_select{tid=_Tid1}) + when element(1,Tid2) == tid -> % Mismatching tids abort(wrong_transaction); +select_cont(Tid,Ts,State=#mnesia_select{}) -> + % Repair mismatching tids in non-transactional contexts + RepairedState = State#mnesia_select{tid = Tid, written = [], + spec = undefined, type = undefined}, + select_cont(Tid,Ts,RepairedState); select_cont(_,_,Cont) -> abort({badarg, Cont}). diff --git a/lib/mnesia/test/mnesia_trans_access_test.erl b/lib/mnesia/test/mnesia_trans_access_test.erl index aa50ee4cb1..4ed73ea859 100644 --- a/lib/mnesia/test/mnesia_trans_access_test.erl +++ b/lib/mnesia/test/mnesia_trans_access_test.erl @@ -307,6 +307,7 @@ select14(Config) when is_list(Config) -> %% Some Helpers Trans = fun(Fun) -> mnesia:transaction(Fun) end, + Dirty = fun(Fun) -> mnesia:async_dirty(Fun) end, LoopHelp = fun('$end_of_table',_) -> []; ({Recs,Cont},Fun) -> Sel = mnesia:select(Cont), @@ -334,8 +335,13 @@ select14(Config) when is_list(Config) -> ?match({atomic, [OneRec]}, Trans(fun() -> Loop(Tab, OnePat) end)), ?match({atomic, All}, Trans(fun() -> Loop(Tab, AllPat) end)), - {atomic,{_, Cont}} = Trans(fun() -> mnesia:select(Tab, OnePat, 1, read) end), - ?match({aborted, wrong_transaction}, Trans(fun() -> mnesia:select(Cont) end)), + {atomic,{_, ContOne}} = Trans(fun() -> mnesia:select(Tab, OnePat, 1, read) end), + ?match({aborted, wrong_transaction}, Trans(fun() -> mnesia:select(ContOne) end)), + ?match('$end_of_table', Dirty(fun() -> mnesia:select(ContOne) end)), + + {atomic,{_, ContAll}} = Trans(fun() -> mnesia:select(Tab, AllPat, 1, read) end), + ?match({aborted, wrong_transaction}, Trans(fun() -> mnesia:select(ContAll) end)), + ?match({[_], _}, Dirty(fun() -> mnesia:select(ContAll) end)), ?match({aborted, _}, Trans(fun() -> mnesia:select(Tab, {match, '$1', 2},1,read) end)), ?match({aborted, _}, Trans(fun() -> mnesia:select(Tab, [{'_', [], '$1'}],1,read) end)), diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index a4897668e4..f6ad8d8dea 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -30,6 +30,22 @@ <file>notes.xml</file> </header> +<section><title>Ssh 4.3.4</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + Intermittent ssh ERROR REPORT mentioning + nonblocking_sender</p> + <p> + Own Id: OTP-13953 Aux Id: seq13199 </p> + </item> + </list> + </section> + +</section> + <section><title>Ssh 4.3.3</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index facf6b561a..abfba4baf1 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -339,7 +339,6 @@ renegotiate_data(ConnectionHandler) -> ssh_params :: #ssh{} | undefined, socket :: inet:socket(), - sender :: pid() | undefined, decrypted_data_buffer = <<>> :: binary(), encrypted_data_buffer = <<>> :: binary(), undecrypted_packet_length :: undefined | non_neg_integer(), @@ -368,10 +367,9 @@ init_connection_handler(Role, Socket, Opts) -> {Protocol, Callback, CloseTag} = proplists:get_value(transport, Opts, ?DefaultTransport), S0#data{ssh_params = init_ssh_record(Role, Socket, Opts), - sender = spawn_link(fun() -> nonblocking_sender(Socket, Callback) end), - transport_protocol = Protocol, - transport_cb = Callback, - transport_close_tag = CloseTag + transport_protocol = Protocol, + transport_cb = Callback, + transport_close_tag = CloseTag } of S -> @@ -527,7 +525,7 @@ handle_event(_, _Event, {init_error,Error}, _) -> %% The very first event that is sent when the we are set as controlling process of Socket handle_event(_, socket_control, {hello,_}, D) -> VsnMsg = ssh_transport:hello_version_msg(string_version(D#data.ssh_params)), - send_bytes(VsnMsg, D), + ok = send_bytes(VsnMsg, D), case inet:getopts(Socket=D#data.socket, [recbuf]) of {ok, [{recbuf,Size}]} -> %% Set the socket to the hello text line handling mode: @@ -552,7 +550,7 @@ handle_event(_, {info_line,_Line}, {hello,Role}, D) -> server -> %% But the client may NOT send them to the server. Openssh answers with cleartext, %% and so do we - send_bytes("Protocol mismatch.", D), + ok = send_bytes("Protocol mismatch.", D), {stop, {shutdown,"Protocol mismatch in version exchange. Client sent info lines."}} end; @@ -567,7 +565,7 @@ handle_event(_, {version_exchange,Version}, {hello,Role}, D) -> {active, once}, {recbuf, D#data.inet_initial_recbuf_size}]), {KeyInitMsg, SshPacket, Ssh} = ssh_transport:key_exchange_init_msg(Ssh1), - send_bytes(SshPacket, D), + ok = send_bytes(SshPacket, D), {next_state, {kexinit,Role,init}, D#data{ssh_params = Ssh, key_exchange_init_msg = KeyInitMsg}}; not_supported -> @@ -585,7 +583,7 @@ handle_event(_, {#ssh_msg_kexinit{}=Kex, Payload}, {kexinit,Role,ReNeg}, Ssh1 = ssh_transport:key_init(peer_role(Role), D#data.ssh_params, Payload), Ssh = case ssh_transport:handle_kexinit_msg(Kex, OwnKex, Ssh1) of {ok, NextKexMsg, Ssh2} when Role==client -> - send_bytes(NextKexMsg, D), + ok = send_bytes(NextKexMsg, D), Ssh2; {ok, Ssh2} when Role==server -> Ssh2 @@ -598,43 +596,43 @@ handle_event(_, {#ssh_msg_kexinit{}=Kex, Payload}, {kexinit,Role,ReNeg}, %%%---- diffie-hellman handle_event(_, #ssh_msg_kexdh_init{} = Msg, {key_exchange,server,ReNeg}, D) -> {ok, KexdhReply, Ssh1} = ssh_transport:handle_kexdh_init(Msg, D#data.ssh_params), - send_bytes(KexdhReply, D), + ok = send_bytes(KexdhReply, D), {ok, NewKeys, Ssh} = ssh_transport:new_keys_message(Ssh1), - send_bytes(NewKeys, D), + ok = send_bytes(NewKeys, D), {next_state, {new_keys,server,ReNeg}, D#data{ssh_params=Ssh}}; handle_event(_, #ssh_msg_kexdh_reply{} = Msg, {key_exchange,client,ReNeg}, D) -> {ok, NewKeys, Ssh} = ssh_transport:handle_kexdh_reply(Msg, D#data.ssh_params), - send_bytes(NewKeys, D), + ok = send_bytes(NewKeys, D), {next_state, {new_keys,client,ReNeg}, D#data{ssh_params=Ssh}}; %%%---- diffie-hellman group exchange handle_event(_, #ssh_msg_kex_dh_gex_request{} = Msg, {key_exchange,server,ReNeg}, D) -> {ok, GexGroup, Ssh} = ssh_transport:handle_kex_dh_gex_request(Msg, D#data.ssh_params), - send_bytes(GexGroup, D), + ok = send_bytes(GexGroup, D), {next_state, {key_exchange_dh_gex_init,server,ReNeg}, D#data{ssh_params=Ssh}}; handle_event(_, #ssh_msg_kex_dh_gex_request_old{} = Msg, {key_exchange,server,ReNeg}, D) -> {ok, GexGroup, Ssh} = ssh_transport:handle_kex_dh_gex_request(Msg, D#data.ssh_params), - send_bytes(GexGroup, D), + ok = send_bytes(GexGroup, D), {next_state, {key_exchange_dh_gex_init,server,ReNeg}, D#data{ssh_params=Ssh}}; handle_event(_, #ssh_msg_kex_dh_gex_group{} = Msg, {key_exchange,client,ReNeg}, D) -> {ok, KexGexInit, Ssh} = ssh_transport:handle_kex_dh_gex_group(Msg, D#data.ssh_params), - send_bytes(KexGexInit, D), + ok = send_bytes(KexGexInit, D), {next_state, {key_exchange_dh_gex_reply,client,ReNeg}, D#data{ssh_params=Ssh}}; %%%---- elliptic curve diffie-hellman handle_event(_, #ssh_msg_kex_ecdh_init{} = Msg, {key_exchange,server,ReNeg}, D) -> {ok, KexEcdhReply, Ssh1} = ssh_transport:handle_kex_ecdh_init(Msg, D#data.ssh_params), - send_bytes(KexEcdhReply, D), + ok = send_bytes(KexEcdhReply, D), {ok, NewKeys, Ssh} = ssh_transport:new_keys_message(Ssh1), - send_bytes(NewKeys, D), + ok = send_bytes(NewKeys, D), {next_state, {new_keys,server,ReNeg}, D#data{ssh_params=Ssh}}; handle_event(_, #ssh_msg_kex_ecdh_reply{} = Msg, {key_exchange,client,ReNeg}, D) -> {ok, NewKeys, Ssh} = ssh_transport:handle_kex_ecdh_reply(Msg, D#data.ssh_params), - send_bytes(NewKeys, D), + ok = send_bytes(NewKeys, D), {next_state, {new_keys,client,ReNeg}, D#data{ssh_params=Ssh}}; @@ -642,9 +640,9 @@ handle_event(_, #ssh_msg_kex_ecdh_reply{} = Msg, {key_exchange,client,ReNeg}, D) handle_event(_, #ssh_msg_kex_dh_gex_init{} = Msg, {key_exchange_dh_gex_init,server,ReNeg}, D) -> {ok, KexGexReply, Ssh1} = ssh_transport:handle_kex_dh_gex_init(Msg, D#data.ssh_params), - send_bytes(KexGexReply, D), + ok = send_bytes(KexGexReply, D), {ok, NewKeys, Ssh} = ssh_transport:new_keys_message(Ssh1), - send_bytes(NewKeys, D), + ok = send_bytes(NewKeys, D), {next_state, {new_keys,server,ReNeg}, D#data{ssh_params=Ssh}}; @@ -652,7 +650,7 @@ handle_event(_, #ssh_msg_kex_dh_gex_init{} = Msg, {key_exchange_dh_gex_init,serv handle_event(_, #ssh_msg_kex_dh_gex_reply{} = Msg, {key_exchange_dh_gex_reply,client,ReNeg}, D) -> {ok, NewKeys, Ssh1} = ssh_transport:handle_kex_dh_gex_reply(Msg, D#data.ssh_params), - send_bytes(NewKeys, D), + ok = send_bytes(NewKeys, D), {next_state, {new_keys,client,ReNeg}, D#data{ssh_params=Ssh1}}; @@ -664,7 +662,7 @@ handle_event(_, #ssh_msg_newkeys{} = Msg, {new_keys,Role,init}, D) -> Ssh = case Role of client -> {MsgReq, Ssh2} = ssh_auth:service_request_msg(Ssh1), - send_bytes(MsgReq, D), + ok = send_bytes(MsgReq, D), Ssh2; server -> Ssh1 @@ -682,7 +680,7 @@ handle_event(_, Msg = #ssh_msg_service_request{name=ServiceName}, StateName = {s "ssh-userauth" -> Ssh0 = #ssh{session_id=SessionId} = D#data.ssh_params, {ok, {Reply, Ssh}} = ssh_auth:handle_userauth_request(Msg, SessionId, Ssh0), - send_bytes(Reply, D), + ok = send_bytes(Reply, D), {next_state, {userauth,server}, D#data{ssh_params = Ssh}}; _ -> @@ -694,7 +692,7 @@ handle_event(_, Msg = #ssh_msg_service_request{name=ServiceName}, StateName = {s handle_event(_, #ssh_msg_service_accept{name = "ssh-userauth"}, {service_request,client}, #data{ssh_params = #ssh{service="ssh-userauth"} = Ssh0} = State) -> {Msg, Ssh} = ssh_auth:init_userauth_request_msg(Ssh0), - send_bytes(Msg, State), + ok = send_bytes(Msg, State), {next_state, {userauth,client}, State#data{auth_user = Ssh#ssh.user, ssh_params = Ssh}}; @@ -711,7 +709,7 @@ handle_event(_, %% Probably the very first userauth_request but we deny unauthorized login {not_authorized, _, {Reply,Ssh}} = ssh_auth:handle_userauth_request(Msg, Ssh0#ssh.session_id, Ssh0), - send_bytes(Reply, D), + ok = send_bytes(Reply, D), {keep_state, D#data{ssh_params = Ssh}}; {"ssh-connection", "ssh-connection", Method} -> @@ -721,7 +719,7 @@ handle_event(_, %% Yepp! we support this method case ssh_auth:handle_userauth_request(Msg, Ssh0#ssh.session_id, Ssh0) of {authorized, User, {Reply, Ssh}} -> - send_bytes(Reply, D), + ok = send_bytes(Reply, D), D#data.starter ! ssh_connected, connected_fun(User, Method, D), {next_state, {connected,server}, @@ -729,11 +727,11 @@ handle_event(_, ssh_params = Ssh#ssh{authenticated = true}}}; {not_authorized, {User, Reason}, {Reply, Ssh}} when Method == "keyboard-interactive" -> retry_fun(User, Reason, D), - send_bytes(Reply, D), + ok = send_bytes(Reply, D), {next_state, {userauth_keyboard_interactive,server}, D#data{ssh_params = Ssh}}; {not_authorized, {User, Reason}, {Reply, Ssh}} -> retry_fun(User, Reason, D), - send_bytes(Reply, D), + ok = send_bytes(Reply, D), {keep_state, D#data{ssh_params = Ssh}} end; false -> @@ -1447,15 +1445,18 @@ start_the_connection_child(UserPid, Role, Socket, Options) -> %% Stopping -type finalize_termination_result() :: ok . -finalize_termination(_StateName, D) -> - case D#data.connection_state of +finalize_termination(_StateName, #data{transport_cb = Transport, + connection_state = Connection, + socket = Socket}) -> + case Connection of #connection{system_supervisor = SysSup, sub_system_supervisor = SubSysSup} when is_pid(SubSysSup) -> ssh_system_sup:stop_subsystem(SysSup, SubSysSup); _ -> do_nothing end, - close_transport(D). + (catch Transport:close(Socket)), + ok. %%-------------------------------------------------------------------- %% "Invert" the Role @@ -1510,33 +1511,8 @@ send_msg(Msg, State=#data{ssh_params=Ssh0}) when is_tuple(Msg) -> send_bytes(Bytes, State), State#data{ssh_params=Ssh}. -send_bytes(Bytes, #data{sender = Sender}) -> - Sender ! {send,Bytes}, - ok. - -close_transport(D) -> - D#data.sender ! close, - ok. - - -nonblocking_sender(Socket, Callback) -> - receive - {send, Bytes} -> - case Callback:send(Socket, Bytes) of - ok -> - nonblocking_sender(Socket, Callback); - E = {error,_} -> - exit({shutdown,E}) - end; - - close -> - case Callback:close(Socket) of - ok -> - ok; - E = {error,_} -> - exit({shutdown,E}) - end - end. +send_bytes(Bytes, #data{socket = Socket, transport_cb = Transport}) -> + Transport:send(Socket, Bytes). handle_version({2, 0} = NumVsn, StrVsn, Ssh0) -> Ssh = counterpart_versions(NumVsn, StrVsn, Ssh0), diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk index 09e707ad07..536e559514 100644 --- a/lib/ssh/vsn.mk +++ b/lib/ssh/vsn.mk @@ -1,5 +1,5 @@ #-*-makefile-*- ; force emacs to enter makefile-mode -SSH_VSN = 4.3.3 +SSH_VSN = 4.3.4 APP_VSN = "ssh-$(SSH_VSN)" diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml index abba5aaf59..68f2f97b6e 100644 --- a/lib/ssl/doc/src/ssl.xml +++ b/lib/ssl/doc/src/ssl.xml @@ -155,7 +155,7 @@ <tag><c>cipher() =</c></tag> <item><p><c>rc4_128 | des_cbc | '3des_ede_cbc' - | aes_128_cbc | aes_256_cbc | aes_128_gcm | aes_256_gcm</c></p></item> + | aes_128_cbc | aes_256_cbc | aes_128_gcm | aes_256_gcm | chacha20_poly1305</c></p></item> <tag><c>hash() =</c></tag> <item><p><c>md5 | sha | sha224 | sha256 | sha348 | sha512</c></p></item> diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index 02873ce522..605bbd859a 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -46,9 +46,9 @@ erl_cipher_suite/0, openssl_cipher_suite/0, hash/0, key_algo/0, sign_algo/0]). --type cipher() :: null |rc4_128 | idea_cbc | des40_cbc | des_cbc | '3des_ede_cbc' +-type cipher() :: null |rc4_128 | des_cbc | '3des_ede_cbc' | aes_128_cbc | aes_256_cbc | aes_128_gcm | aes_256_gcm | chacha20_poly1305. --type hash() :: null | sha | md5 | sha224 | sha256 | sha384 | sha512. +-type hash() :: null | md5 | sha | sha224 | sha256 | sha384 | sha512. -type sign_algo() :: rsa | dsa | ecdsa. -type key_algo() :: null | rsa | dhe_rsa | dhe_dss | ecdhe_ecdsa| ecdh_ecdsa | ecdh_rsa| srp_rsa| srp_dss | psk | dhe_psk | rsa_psk | dh_anon | ecdh_anon | srp_anon. @@ -1447,28 +1447,60 @@ filter_suites(Suites) -> is_acceptable_prf(Prf, Hashs) end, Suites). -is_acceptable_keyexchange(KeyExchange, Algos) - when KeyExchange == ecdh_ecdsa; - KeyExchange == ecdhe_ecdsa; - KeyExchange == ecdh_rsa; - KeyExchange == ecdhe_rsa; - KeyExchange == ecdh_anon -> +is_acceptable_keyexchange(KeyExchange, _Algos) when KeyExchange == psk; + KeyExchange == null -> + true; +is_acceptable_keyexchange(KeyExchange, Algos) when KeyExchange == dh_anon; + KeyExchange == dhe_psk -> + proplists:get_bool(dh, Algos); +is_acceptable_keyexchange(dhe_dss, Algos) -> + proplists:get_bool(dh, Algos) andalso + proplists:get_bool(dss, Algos); +is_acceptable_keyexchange(dhe_rsa, Algos) -> + proplists:get_bool(dh, Algos) andalso + proplists:get_bool(rsa, Algos); +is_acceptable_keyexchange(ecdh_anon, Algos) -> proplists:get_bool(ecdh, Algos); -is_acceptable_keyexchange(_, _) -> - true. - +is_acceptable_keyexchange(KeyExchange, Algos) when KeyExchange == ecdh_ecdsa; + KeyExchange == ecdhe_ecdsa -> + proplists:get_bool(ecdh, Algos) andalso + proplists:get_bool(ecdsa, Algos); +is_acceptable_keyexchange(KeyExchange, Algos) when KeyExchange == ecdh_rsa; + KeyExchange == ecdhe_rsa -> + proplists:get_bool(ecdh, Algos) andalso + proplists:get_bool(rsa, Algos); +is_acceptable_keyexchange(KeyExchange, Algos) when KeyExchange == rsa; + KeyExchange == rsa_psk -> + proplists:get_bool(rsa, Algos); +is_acceptable_keyexchange(srp_anon, Algos) -> + proplists:get_bool(srp, Algos); +is_acceptable_keyexchange(srp_dss, Algos) -> + proplists:get_bool(srp, Algos) andalso + proplists:get_bool(dss, Algos); +is_acceptable_keyexchange(srp_rsa, Algos) -> + proplists:get_bool(srp, Algos) andalso + proplists:get_bool(rsa, Algos); +is_acceptable_keyexchange(_KeyExchange, _Algos) -> + false. + +is_acceptable_cipher(null, _Algos) -> + true; +is_acceptable_cipher(rc4_128, Algos) -> + proplists:get_bool(rc4, Algos); +is_acceptable_cipher(des_cbc, Algos) -> + proplists:get_bool(des_cbc, Algos); +is_acceptable_cipher('3des_ede_cbc', Algos) -> + proplists:get_bool(des3_cbc, Algos); +is_acceptable_cipher(aes_128_cbc, Algos) -> + proplists:get_bool(aes_cbc128, Algos); +is_acceptable_cipher(aes_256_cbc, Algos) -> + proplists:get_bool(aes_cbc256, Algos); is_acceptable_cipher(Cipher, Algos) when Cipher == aes_128_gcm; Cipher == aes_256_gcm -> proplists:get_bool(aes_gcm, Algos); -is_acceptable_cipher(Cipher, Algos) - when Cipher == chacha20_poly1305 -> - proplists:get_bool(Cipher, Algos); -is_acceptable_cipher(Cipher, Algos) - when Cipher == rc4_128 -> - proplists:get_bool(rc4, Algos); -is_acceptable_cipher(_, _) -> - true. +is_acceptable_cipher(Cipher, Algos) -> + proplists:get_bool(Cipher, Algos). is_acceptable_hash(null, _Algos) -> true; diff --git a/lib/ssl/test/ssl_crl_SUITE.erl b/lib/ssl/test/ssl_crl_SUITE.erl index bc2822f0c4..e293d183f7 100644 --- a/lib/ssl/test/ssl_crl_SUITE.erl +++ b/lib/ssl/test/ssl_crl_SUITE.erl @@ -99,32 +99,37 @@ init_per_group(check_peer, Config) -> init_per_group(check_best_effort, Config) -> [{crl_check, best_effort} | Config]; init_per_group(Group, Config0) -> - case is_idp(Group) of - true -> - [{idp_crl, true} | Config0]; - false -> - DataDir = proplists:get_value(data_dir, Config0), - CertDir = filename:join(proplists:get_value(priv_dir, Config0), Group), - {CertOpts, Config} = init_certs(CertDir, Group, Config0), - {ok, _} = make_certs:all(DataDir, CertDir, CertOpts), - case Group of - crl_hash_dir -> - CrlDir = filename:join(CertDir, "crls"), - %% Copy CRLs to their hashed filenames. - %% Find the hashes with 'openssl crl -noout -hash -in crl.pem'. - populate_crl_hash_dir(CertDir, CrlDir, - [{"erlangCA", "d6134ed3"}, - {"otpCA", "d4c8d7e5"}], - replace), - CrlCacheOpts = [{crl_cache, - {ssl_crl_hash_dir, - {internal, [{dir, CrlDir}]}}}]; - _ -> - CrlCacheOpts = [] - end, - [{crl_cache_opts, CrlCacheOpts}, - {cert_dir, CertDir}, - {idp_crl, false} | Config] + try + case is_idp(Group) of + true -> + [{idp_crl, true} | Config0]; + false -> + DataDir = proplists:get_value(data_dir, Config0), + CertDir = filename:join(proplists:get_value(priv_dir, Config0), Group), + {CertOpts, Config} = init_certs(CertDir, Group, Config0), + {ok, _} = make_certs:all(DataDir, CertDir, CertOpts), + CrlCacheOpts = case Group of + crl_hash_dir -> + CrlDir = filename:join(CertDir, "crls"), + %% Copy CRLs to their hashed filenames. + %% Find the hashes with 'openssl crl -noout -hash -in crl.pem'. + populate_crl_hash_dir(CertDir, CrlDir, + [{"erlangCA", "d6134ed3"}, + {"otpCA", "d4c8d7e5"}], + replace), + [{crl_cache, + {ssl_crl_hash_dir, + {internal, [{dir, CrlDir}]}}}]; + _ -> + [] + end, + [{crl_cache_opts, CrlCacheOpts}, + {cert_dir, CertDir}, + {idp_crl, false} | Config] + end + catch + _:_ -> + {skip, "Unable to create crls"} end. end_per_group(_GroupName, Config) -> @@ -187,7 +192,7 @@ crl_verify_valid(Config) when is_list(Config) -> {crl_cache, {ssl_crl_cache, {internal, [{http, 5000}]}}}, {verify, verify_peer}]; false -> - ?config(crl_cache_opts, Config) ++ + proplists:get_value(crl_cache_opts, Config) ++ [{cacertfile, filename:join([PrivDir, "server", "cacerts.pem"])}, {crl_check, Check}, {verify, verify_peer}] @@ -220,7 +225,7 @@ crl_verify_revoked(Config) when is_list(Config) -> {crl_check, Check}, {verify, verify_peer}]; false -> - ?config(crl_cache_opts, Config) ++ + proplists:get_value(crl_cache_opts, Config) ++ [{cacertfile, filename:join([PrivDir, "revoked", "cacerts.pem"])}, {crl_check, Check}, {verify, verify_peer}] @@ -279,8 +284,8 @@ crl_verify_no_crl(Config) when is_list(Config) -> crl_hash_dir_collision() -> [{doc,"Verify ssl_crl_hash_dir behaviour with hash collisions"}]. crl_hash_dir_collision(Config) when is_list(Config) -> - PrivDir = ?config(cert_dir, Config), - Check = ?config(crl_check, Config), + PrivDir = proplists:get_value(cert_dir, Config), + Check = proplists:get_value(crl_check, Config), %% Create two CAs whose names hash to the same value CA1 = "hash-collision-0000000000", @@ -307,13 +312,17 @@ crl_hash_dir_collision(Config) when is_list(Config) -> {CA2, "b68fc624"}], replace), - ClientOpts = ?config(crl_cache_opts, Config) ++ - [{cacertfile, filename:join([PrivDir, "erlangCA", "cacerts.pem"])}, + NewCA = new_ca(filename:join([PrivDir, "new_ca"]), + filename:join([PrivDir, "erlangCA", "cacerts.pem"]), + filename:join([PrivDir, "server", "cacerts.pem"])), + + ClientOpts = proplists:get_value(crl_cache_opts, Config) ++ + [{cacertfile, NewCA}, {crl_check, Check}, {verify, verify_peer}], - + {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config), - + %% Neither certificate revoked; both succeed. crl_verify_valid(Hostname, ServerNode, ServerOpts1, ClientNode, ClientOpts), crl_verify_valid(Hostname, ServerNode, ServerOpts2, ClientNode, ClientOpts), @@ -346,8 +355,8 @@ crl_hash_dir_collision(Config) when is_list(Config) -> crl_hash_dir_expired() -> [{doc,"Verify ssl_crl_hash_dir behaviour with expired CRLs"}]. crl_hash_dir_expired(Config) when is_list(Config) -> - PrivDir = ?config(cert_dir, Config), - Check = ?config(crl_check, Config), + PrivDir = proplists:get_value(cert_dir, Config), + Check = proplists:get_value(crl_check, Config), CA = "CRL-maybe-expired-CA", %% Add "issuing distribution point", to ensure that verification @@ -362,7 +371,7 @@ crl_hash_dir_expired(Config) when is_list(Config) -> ServerOpts = [{keyfile, filename:join([PrivDir, EndUser, "key.pem"])}, {certfile, filename:join([PrivDir, EndUser, "cert.pem"])}, {cacertfile, filename:join([PrivDir, EndUser, "cacerts.pem"])}], - ClientOpts = ?config(crl_cache_opts, Config) ++ + ClientOpts = proplists:get_value(crl_cache_opts, Config) ++ [{cacertfile, filename:join([PrivDir, CA, "cacerts.pem"])}, {crl_check, Check}, {verify, verify_peer}], @@ -492,3 +501,12 @@ find_free_name(CrlDir, Hash, N) -> false -> Name end. + +new_ca(FileName, CA1, CA2) -> + {ok, P1} = file:read_file(CA1), + E1 = public_key:pem_decode(P1), + {ok, P2} = file:read_file(CA2), + E2 = public_key:pem_decode(P2), + Pem = public_key:pem_encode(E1 ++E2), + file:write_file(FileName, Pem), + FileName. diff --git a/lib/tools/emacs/Makefile b/lib/tools/emacs/Makefile index 585425e5f1..e1b195ef97 100644 --- a/lib/tools/emacs/Makefile +++ b/lib/tools/emacs/Makefile @@ -43,6 +43,7 @@ EMACS_FILES= \ erlang_appwiz \ erlang-start \ erlang-eunit \ + erlang-edoc \ erlang-flymake \ erlang diff --git a/lib/tools/emacs/erlang-edoc.el b/lib/tools/emacs/erlang-edoc.el new file mode 100644 index 0000000000..034036ad04 --- /dev/null +++ b/lib/tools/emacs/erlang-edoc.el @@ -0,0 +1,172 @@ +;;; erlang-edoc.el --- EDoc support for Erlang mode -*- lexical-binding: t; -*- + +;; %CopyrightBegin% +;; +;; Copyright Ericsson AB 1996-2016. 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. +;; You may obtain a copy of the License at +;; +;; http://www.apache.org/licenses/LICENSE-2.0 +;; +;; Unless required by applicable law or agreed to in writing, software +;; distributed under the License is distributed on an "AS IS" BASIS, +;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +;; See the License for the specific language governing permissions and +;; limitations under the License. +;; +;; %CopyrightEnd% + +;;; Commentary: + +;; Ref: http://www.erlang.org/doc/apps/edoc/users_guide.html +;; +;; To use: (add-hook 'erlang-mode-hook 'erlang-edoc-mode) + +;;; Code: + +(defcustom erlang-edoc-indent-level 2 + "Indentation level of xhtml in Erlang edoc." + :safe 'integerp + :group 'erlang) + +(defvar erlang-edoc-generic-tags + '("clear" "docfile" "end" "headerfile" "todo" "TODO" "type") + "Tags that can be used anywhere within a module.") + +(defvar erlang-edoc-overview-tags + '("author" "copyright" "reference" "see" "since" "title" "version") + "Tags that can be used in an overview file.") + +(defvar erlang-edoc-module-tags + '("author" "copyright" "deprecated" "doc" "hidden" "private" "reference" + "see" "since" "version") + "Tags that can be used before a module declaration.") + +(defvar erlang-edoc-function-tags + '("deprecated" "doc" "equiv" "hidden" "private" "see" "since" "spec" + "throws" "type") + "Tags that can be used before a function definition.") + +(defvar erlang-edoc-predefined-macros + '("date" "docRoot" "link" "module" "package" "section" "time" + "type" "version")) + +(defface erlang-edoc-tag '((t (:inherit font-lock-constant-face))) + "Face used to highlight edoc tags." + :group 'erlang) + +(defface erlang-edoc-macro '((t (:inherit font-lock-preprocessor-face))) + "Face used to highlight edoc macros." + :group 'erlang) + +(defface erlang-edoc-verbatim + '((t (:family "Monospace" :inherit font-lock-keyword-face))) + "Face used to highlight verbatim text." + :group 'erlang) + +(defface erlang-edoc-todo '((t (:inherit font-lock-warning-face))) + "Face used to highlight edoc macros." + :group 'erlang) + +(defface erlang-edoc-heading '((t (:inherit bold))) + "Face used to highlight edoc headings." + :group 'erlang) + +(defvar erlang-edoc-font-lock-keywords + '(("^%+\\s-*\\(@\\w+\\)\\_>" 1 'erlang-edoc-tag prepend) + ("^%+\\s-*" ("{\\(@\\w+\\)\\_>" nil nil (1 'erlang-edoc-macro prepend))) + ("^%+\\s-*" ("\\(?:@@\\)*\\(@[@{}]\\)" nil nil (1 'escape-glyph prepend))) + ("^%+\\s-*@\\(deprecated\\)\\_>" 1 font-lock-warning-face prepend) + ;; http://www.erlang.org/doc/apps/edoc/chapter.html#Wiki_notation + ("^%+\\s-*" ("[^`]`\\([^`]?\\|[^`].*?[^']\\)'" + (forward-char -1) nil (1 'erlang-edoc-verbatim prepend))) + ("^%+\\s-*" ("\\[\\(\\(?:https?\\|file\\|ftp\\)://[^][]+\\)\\]" + nil nil (1 'link prepend))) + ("^%+\\s-*\\(?:\\(?1:@todo\\|@TODO\\)\\_>\\|\\(?1:TODO\\):\\)" + 1 'erlang-edoc-todo prepend) + ("^%+\\s-*\\(\\(=\\{2,4\\}\\)[^=\n].*[^=\n]\\2\\)\\s-*$" + 1 'erlang-edoc-heading prepend))) + +(defun erlang-edoc-xml-context () + "Parse edoc x(ht)ml context at comment start of current line." + (eval-and-compile (require 'xmltok)) + (save-excursion + (beginning-of-line) + (when (looking-at "^%+\\s-*") + (let ((pt (match-end 0)) context) + (forward-comment (- (point))) + (while (< (point) pt) + (xmltok-forward) + (cond ((eq xmltok-type 'start-tag) + (push (cons xmltok-type xmltok-start) context)) + ((eq xmltok-type 'end-tag) + (pop context)))) + (goto-char pt) + (xmltok-forward) + (push (car (memq xmltok-type '(start-tag end-tag))) context) + context)))) + +(defun erlang-edoc-indent-line () + (let ((context (erlang-edoc-xml-context))) + (when context + (save-excursion + (beginning-of-line) + (re-search-forward "^%+\\s-*" (line-end-position)) + (when (or (car context) (cadr context)) + (let ((pad (when (cadr context) + (save-excursion + (goto-char (cdr (cadr context))) + (- (current-column) + (progn + (beginning-of-line) + (skip-chars-forward "%") + (current-column))))))) + (just-one-space (cond ((not pad) 1) + ((eq (car context) 'end-tag) pad) + (t (+ erlang-edoc-indent-level pad))))))) + (when (looking-back "^%*\\s-*" (line-beginning-position)) + (re-search-forward "\\=%*\\s-*"))))) + +(defun erlang-edoc-before-module-declaration-p () + (save-excursion + (beginning-of-line) + (forward-comment (point-max)) + (or (eobp) (re-search-forward "^-module\\s-*(" nil t)))) + +(defun erlang-edoc-completion-at-point () + (when (eq (syntax-ppss-context (syntax-ppss)) 'comment) + (save-excursion + (skip-syntax-backward "w_") + (when (= (preceding-char) ?@) + (let* ((is-tag (looking-back "^%+\\s-*@" (line-beginning-position))) + (beg (point)) + (end (progn (skip-syntax-forward "w_") (point))) + (table (cond + ((not is-tag) + erlang-edoc-predefined-macros) + ((erlang-edoc-before-module-declaration-p) + (append erlang-edoc-module-tags + erlang-edoc-generic-tags)) + (t (append erlang-edoc-function-tags + erlang-edoc-generic-tags))))) + (list beg end table)))))) + +;;;###autoload +(define-minor-mode erlang-edoc-mode nil + :lighter " EDoc" + (cond (erlang-edoc-mode + (add-hook 'erlang-indent-line-hook #'erlang-edoc-indent-line nil t) + (font-lock-add-keywords nil erlang-edoc-font-lock-keywords t) + (add-hook 'completion-at-point-functions + #'erlang-edoc-completion-at-point nil t)) + (t + (remove-hook 'erlang-indent-line-hook #'erlang-edoc-indent-line t) + (font-lock-remove-keywords nil erlang-edoc-font-lock-keywords) + (remove-hook 'completion-at-point-functions + #'erlang-edoc-completion-at-point t))) + (jit-lock-refontify)) + +(provide 'erlang-edoc) +;;; erlang-edoc.el ends here diff --git a/lib/tools/emacs/erlang-start.el b/lib/tools/emacs/erlang-start.el index 76e0575e68..f9a6d24b2c 100644 --- a/lib/tools/emacs/erlang-start.el +++ b/lib/tools/emacs/erlang-start.el @@ -78,6 +78,7 @@ (autoload 'erlang-find-tag-other-window "erlang" "Like `find-tag-other-window'. Capable of retreiving Erlang modules.") +(autoload 'erlang-edoc-mode "erlang-edoc" "Toggle Erlang-Edoc mode on or off." t) ;; ;; Associate files extensions ".erl" and ".hrl" with Erlang mode. diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index 788de75b3a..67e88bac30 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -78,6 +78,10 @@ ;; Variables: +(defgroup erlang nil + "The Erlang programming language." + :group 'languages) + (defconst erlang-version "2.7" "The version number of Erlang mode.") @@ -2444,6 +2448,7 @@ Return the amount the indentation changed by." ;; after the indentation. Else stay at same point in text. (if (> (- (point-max) pos) (point)) (goto-char (- (point-max) pos))) + (run-hooks 'erlang-indent-line-hook) shift-amt)) diff --git a/lib/wx/api_gen/wx_gen_erl.erl b/lib/wx/api_gen/wx_gen_erl.erl index 05dc540a16..e272c08d90 100644 --- a/lib/wx/api_gen/wx_gen_erl.erl +++ b/lib/wx/api_gen/wx_gen_erl.erl @@ -649,7 +649,7 @@ guard_test(#param{def=Def}) when Def =/= none -> skip; guard_test(#param{where=c}) -> skip; guard_test(#param{in=In}) when In == false -> skip; guard_test(#param{name=N, type=#type{base=string}}) -> - "is_list(" ++ erl_arg_name(N) ++")"; + "?is_chardata(" ++ erl_arg_name(N) ++")"; guard_test(#param{name=N, type=#type{name="wxArtClient"}}) -> "is_list(" ++ erl_arg_name(N) ++")"; guard_test(#param{name=N, type=#type{name="wxArrayString"}}) -> diff --git a/lib/wx/src/gen/wxArtProvider.erl b/lib/wx/src/gen/wxArtProvider.erl index da220a90c8..b52c141b1f 100644 --- a/lib/wx/src/gen/wxArtProvider.erl +++ b/lib/wx/src/gen/wxArtProvider.erl @@ -40,7 +40,7 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). Id::unicode:chardata(). getBitmap(Id) - when is_list(Id) -> + when ?is_chardata(Id) -> getBitmap(Id, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxartprovider.html#wxartprovidergetbitmap">external documentation</a>. @@ -49,7 +49,7 @@ getBitmap(Id) Option :: {'client', unicode:chardata()} | {'size', {W::integer(), H::integer()}}. getBitmap(Id, Options) - when is_list(Id),is_list(Options) -> + when ?is_chardata(Id),is_list(Options) -> Id_UC = unicode:characters_to_binary([Id,0]), MOpts = fun({client, Client}, Acc) -> Client_UC = unicode:characters_to_binary([Client, $_, $C,0]),[<<1:32/?UI,(byte_size(Client_UC)):32/?UI,(Client_UC)/binary, 0:(((8- ((0+byte_size(Client_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; ({size, {SizeW,SizeH}}, Acc) -> [<<2:32/?UI,SizeW:32/?UI,SizeH:32/?UI,0:32>>|Acc]; @@ -63,7 +63,7 @@ getBitmap(Id, Options) Id::unicode:chardata(). getIcon(Id) - when is_list(Id) -> + when ?is_chardata(Id) -> getIcon(Id, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxartprovider.html#wxartprovidergeticon">external documentation</a>. @@ -72,7 +72,7 @@ getIcon(Id) Option :: {'client', unicode:chardata()} | {'size', {W::integer(), H::integer()}}. getIcon(Id, Options) - when is_list(Id),is_list(Options) -> + when ?is_chardata(Id),is_list(Options) -> Id_UC = unicode:characters_to_binary([Id,0]), MOpts = fun({client, Client}, Acc) -> Client_UC = unicode:characters_to_binary([Client, $_, $C,0]),[<<1:32/?UI,(byte_size(Client_UC)):32/?UI,(Client_UC)/binary, 0:(((8- ((0+byte_size(Client_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; ({size, {SizeW,SizeH}}, Acc) -> [<<2:32/?UI,SizeW:32/?UI,SizeH:32/?UI,0:32>>|Acc]; diff --git a/lib/wx/src/gen/wxAuiManager.erl b/lib/wx/src/gen/wxAuiManager.erl index 37693060e1..a33e5e9a65 100644 --- a/lib/wx/src/gen/wxAuiManager.erl +++ b/lib/wx/src/gen/wxAuiManager.erl @@ -177,7 +177,7 @@ getManager(#wx_ref{type=WindowT,ref=WindowRef}) -> (This, Window) -> wxAuiPaneInfo:wxAuiPaneInfo() when This::wxAuiManager(), Window::wxWindow:wxWindow(). getPane(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxAuiManager), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxAuiManager_GetPane_1_0, @@ -223,7 +223,7 @@ insertPane(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=WindowT,ref=WindowRef},# -spec loadPaneInfo(This, Pane_part, Pane) -> 'ok' when This::wxAuiManager(), Pane_part::unicode:chardata(), Pane::wxAuiPaneInfo:wxAuiPaneInfo(). loadPaneInfo(#wx_ref{type=ThisT,ref=ThisRef},Pane_part,#wx_ref{type=PaneT,ref=PaneRef}) - when is_list(Pane_part) -> + when ?is_chardata(Pane_part) -> ?CLASS(ThisT,wxAuiManager), Pane_part_UC = unicode:characters_to_binary([Pane_part,0]), ?CLASS(PaneT,wxAuiPaneInfo), @@ -235,7 +235,7 @@ loadPaneInfo(#wx_ref{type=ThisT,ref=ThisRef},Pane_part,#wx_ref{type=PaneT,ref=Pa This::wxAuiManager(), Perspective::unicode:chardata(). loadPerspective(This,Perspective) - when is_record(This, wx_ref),is_list(Perspective) -> + when is_record(This, wx_ref),?is_chardata(Perspective) -> loadPerspective(This,Perspective, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxauimanager.html#wxauimanagerloadperspective">external documentation</a>. @@ -243,7 +243,7 @@ loadPerspective(This,Perspective) This::wxAuiManager(), Perspective::unicode:chardata(), Option :: {'update', boolean()}. loadPerspective(#wx_ref{type=ThisT,ref=ThisRef},Perspective, Options) - when is_list(Perspective),is_list(Options) -> + when ?is_chardata(Perspective),is_list(Options) -> ?CLASS(ThisT,wxAuiManager), Perspective_UC = unicode:characters_to_binary([Perspective,0]), MOpts = fun({update, Update}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Update)):32/?UI>>|Acc]; diff --git a/lib/wx/src/gen/wxAuiNotebook.erl b/lib/wx/src/gen/wxAuiNotebook.erl index 25a1eda0f3..5d47bc8d6c 100644 --- a/lib/wx/src/gen/wxAuiNotebook.erl +++ b/lib/wx/src/gen/wxAuiNotebook.erl @@ -121,7 +121,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options) This::wxAuiNotebook(), Page::wxWindow:wxWindow(), Caption::unicode:chardata(). addPage(This,Page,Caption) - when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Caption) -> + when is_record(This, wx_ref),is_record(Page, wx_ref),?is_chardata(Caption) -> addPage(This,Page,Caption, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxauinotebook.html#wxauinotebookaddpage">external documentation</a>. @@ -130,7 +130,7 @@ addPage(This,Page,Caption) Option :: {'select', boolean()} | {'bitmap', wxBitmap:wxBitmap()}. addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Caption, Options) - when is_list(Caption),is_list(Options) -> + when ?is_chardata(Caption),is_list(Options) -> ?CLASS(ThisT,wxAuiNotebook), ?CLASS(PageT,wxWindow), Caption_UC = unicode:characters_to_binary([Caption,0]), @@ -243,7 +243,7 @@ getSelection(#wx_ref{type=ThisT,ref=ThisRef}) -> This::wxAuiNotebook(), Page_idx::integer(), Page::wxWindow:wxWindow(), Caption::unicode:chardata(). insertPage(This,Page_idx,Page,Caption) - when is_record(This, wx_ref),is_integer(Page_idx),is_record(Page, wx_ref),is_list(Caption) -> + when is_record(This, wx_ref),is_integer(Page_idx),is_record(Page, wx_ref),?is_chardata(Caption) -> insertPage(This,Page_idx,Page,Caption, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxauinotebook.html#wxauinotebookinsertpage">external documentation</a>. @@ -252,7 +252,7 @@ insertPage(This,Page_idx,Page,Caption) Option :: {'select', boolean()} | {'bitmap', wxBitmap:wxBitmap()}. insertPage(#wx_ref{type=ThisT,ref=ThisRef},Page_idx,#wx_ref{type=PageT,ref=PageRef},Caption, Options) - when is_integer(Page_idx),is_list(Caption),is_list(Options) -> + when is_integer(Page_idx),?is_chardata(Caption),is_list(Options) -> ?CLASS(ThisT,wxAuiNotebook), ?CLASS(PageT,wxWindow), Caption_UC = unicode:characters_to_binary([Caption,0]), @@ -304,7 +304,7 @@ setPageBitmap(#wx_ref{type=ThisT,ref=ThisRef},Page,#wx_ref{type=BitmapT,ref=Bitm -spec setPageText(This, Page, Text) -> boolean() when This::wxAuiNotebook(), Page::integer(), Text::unicode:chardata(). setPageText(#wx_ref{type=ThisT,ref=ThisRef},Page,Text) - when is_integer(Page),is_list(Text) -> + when is_integer(Page),?is_chardata(Text) -> ?CLASS(ThisT,wxAuiNotebook), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxAuiNotebook_SetPageText, diff --git a/lib/wx/src/gen/wxAuiPaneInfo.erl b/lib/wx/src/gen/wxAuiPaneInfo.erl index 858da200be..c8273269ac 100644 --- a/lib/wx/src/gen/wxAuiPaneInfo.erl +++ b/lib/wx/src/gen/wxAuiPaneInfo.erl @@ -117,7 +117,7 @@ bottomDockable(#wx_ref{type=ThisT,ref=ThisRef}, Options) -spec caption(This, C) -> wxAuiPaneInfo() when This::wxAuiPaneInfo(), C::unicode:chardata(). caption(#wx_ref{type=ThisT,ref=ThisRef},C) - when is_list(C) -> + when ?is_chardata(C) -> ?CLASS(ThisT,wxAuiPaneInfo), C_UC = unicode:characters_to_binary([C,0]), wxe_util:call(?wxAuiPaneInfo_Caption, @@ -689,7 +689,7 @@ movable(#wx_ref{type=ThisT,ref=ThisRef}, Options) -spec name(This, N) -> wxAuiPaneInfo() when This::wxAuiPaneInfo(), N::unicode:chardata(). name(#wx_ref{type=ThisT,ref=ThisRef},N) - when is_list(N) -> + when ?is_chardata(N) -> ?CLASS(ThisT,wxAuiPaneInfo), N_UC = unicode:characters_to_binary([N,0]), wxe_util:call(?wxAuiPaneInfo_Name, diff --git a/lib/wx/src/gen/wxBitmap.erl b/lib/wx/src/gen/wxBitmap.erl index e7830dae9b..4a6e308d8d 100644 --- a/lib/wx/src/gen/wxBitmap.erl +++ b/lib/wx/src/gen/wxBitmap.erl @@ -56,7 +56,7 @@ new() -> Image::wxImage:wxImage(). new(Filename) - when is_list(Filename) -> + when ?is_chardata(Filename) -> new(Filename, []); new(Image) @@ -86,7 +86,7 @@ new(Width,Height) when is_integer(Width),is_integer(Height) -> new(Width,Height, []); new(Filename, Options) - when is_list(Filename),is_list(Options) -> + when ?is_chardata(Filename),is_list(Options) -> Filename_UC = unicode:characters_to_binary([Filename,0]), MOpts = fun({type, Type}, Acc) -> [<<1:32/?UI,Type:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, @@ -230,7 +230,7 @@ getSubBitmap(#wx_ref{type=ThisT,ref=ThisRef},{RectX,RectY,RectW,RectH}) This::wxBitmap(), Name::unicode:chardata(). loadFile(This,Name) - when is_record(This, wx_ref),is_list(Name) -> + when is_record(This, wx_ref),?is_chardata(Name) -> loadFile(This,Name, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbitmap.html#wxbitmaploadfile">external documentation</a>. @@ -239,7 +239,7 @@ loadFile(This,Name) This::wxBitmap(), Name::unicode:chardata(), Option :: {'type', wx:wx_enum()}. loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name, Options) - when is_list(Name),is_list(Options) -> + when ?is_chardata(Name),is_list(Options) -> ?CLASS(ThisT,wxBitmap), Name_UC = unicode:characters_to_binary([Name,0]), MOpts = fun({type, Type}, Acc) -> [<<1:32/?UI,Type:32/?UI>>|Acc]; @@ -261,7 +261,7 @@ ok(#wx_ref{type=ThisT,ref=ThisRef}) -> This::wxBitmap(), Name::unicode:chardata(), Type::wx:wx_enum(). saveFile(This,Name,Type) - when is_record(This, wx_ref),is_list(Name),is_integer(Type) -> + when is_record(This, wx_ref),?is_chardata(Name),is_integer(Type) -> saveFile(This,Name,Type, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxbitmap.html#wxbitmapsavefile">external documentation</a>. @@ -270,7 +270,7 @@ saveFile(This,Name,Type) This::wxBitmap(), Name::unicode:chardata(), Type::wx:wx_enum(), Option :: {'palette', wxPalette:wxPalette()}. saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Type, Options) - when is_list(Name),is_integer(Type),is_list(Options) -> + when ?is_chardata(Name),is_integer(Type),is_list(Options) -> ?CLASS(ThisT,wxBitmap), Name_UC = unicode:characters_to_binary([Name,0]), MOpts = fun({palette, #wx_ref{type=PaletteT,ref=PaletteRef}}, Acc) -> ?CLASS(PaletteT,wxPalette),[<<1:32/?UI,PaletteRef:32/?UI>>|Acc]; diff --git a/lib/wx/src/gen/wxButton.erl b/lib/wx/src/gen/wxButton.erl index c6686cdf10..f16e1a376e 100644 --- a/lib/wx/src/gen/wxButton.erl +++ b/lib/wx/src/gen/wxButton.erl @@ -163,7 +163,7 @@ setDefault(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setLabel(This, Label) -> 'ok' when This::wxButton(), Label::unicode:chardata(). setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label) - when is_list(Label) -> + when ?is_chardata(Label) -> ?CLASS(ThisT,wxButton), Label_UC = unicode:characters_to_binary([Label,0]), wxe_util:cast(?wxButton_SetLabel, diff --git a/lib/wx/src/gen/wxCheckBox.erl b/lib/wx/src/gen/wxCheckBox.erl index 6a15bec8b7..294831c3a6 100644 --- a/lib/wx/src/gen/wxCheckBox.erl +++ b/lib/wx/src/gen/wxCheckBox.erl @@ -92,7 +92,7 @@ new() -> Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(). new(Parent,Id,Label) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) -> new(Parent,Id,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxcheckbox.html#wxcheckboxwxcheckbox">external documentation</a>. @@ -103,7 +103,7 @@ new(Parent,Id,Label) | {'style', integer()} | {'validator', wx:wx_object()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) - when is_integer(Id),is_list(Label),is_list(Options) -> + when is_integer(Id),?is_chardata(Label),is_list(Options) -> ?CLASS(ParentT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc]; @@ -120,7 +120,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) This::wxCheckBox(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(). create(This,Parent,Id,Label) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) -> create(This,Parent,Id,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxcheckbox.html#wxcheckboxcreate">external documentation</a>. @@ -131,7 +131,7 @@ create(This,Parent,Id,Label) | {'style', integer()} | {'validator', wx:wx_object()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) - when is_integer(Id),is_list(Label),is_list(Options) -> + when is_integer(Id),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxCheckBox), ?CLASS(ParentT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), diff --git a/lib/wx/src/gen/wxChoicebook.erl b/lib/wx/src/gen/wxChoicebook.erl index d1176889bd..61ba0fe47f 100644 --- a/lib/wx/src/gen/wxChoicebook.erl +++ b/lib/wx/src/gen/wxChoicebook.erl @@ -120,7 +120,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) This::wxChoicebook(), Page::wxWindow:wxWindow(), Text::unicode:chardata(). addPage(This,Page,Text) - when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),is_record(Page, wx_ref),?is_chardata(Text) -> addPage(This,Page,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxchoicebook.html#wxchoicebookaddpage">external documentation</a>. @@ -129,7 +129,7 @@ addPage(This,Page,Text) Option :: {'bSelect', boolean()} | {'imageId', integer()}. addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Options) - when is_list(Text),is_list(Options) -> + when ?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxChoicebook), ?CLASS(PageT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), @@ -296,7 +296,7 @@ hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY}) This::wxChoicebook(), N::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata(). insertPage(This,N,Page,Text) - when is_record(This, wx_ref),is_integer(N),is_record(Page, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),is_integer(N),is_record(Page, wx_ref),?is_chardata(Text) -> insertPage(This,N,Page,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxchoicebook.html#wxchoicebookinsertpage">external documentation</a>. @@ -305,7 +305,7 @@ insertPage(This,N,Page,Text) Option :: {'bSelect', boolean()} | {'imageId', integer()}. insertPage(#wx_ref{type=ThisT,ref=ThisRef},N,#wx_ref{type=PageT,ref=PageRef},Text, Options) - when is_integer(N),is_list(Text),is_list(Options) -> + when is_integer(N),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxChoicebook), ?CLASS(PageT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), @@ -347,7 +347,7 @@ setPageImage(#wx_ref{type=ThisT,ref=ThisRef},N,ImageId) -spec setPageText(This, N, StrText) -> boolean() when This::wxChoicebook(), N::integer(), StrText::unicode:chardata(). setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText) - when is_integer(N),is_list(StrText) -> + when is_integer(N),?is_chardata(StrText) -> ?CLASS(ThisT,wxChoicebook), StrText_UC = unicode:characters_to_binary([StrText,0]), wxe_util:call(?wxChoicebook_SetPageText, diff --git a/lib/wx/src/gen/wxColourPickerCtrl.erl b/lib/wx/src/gen/wxColourPickerCtrl.erl index 8ec710d5e3..2fe55018dc 100644 --- a/lib/wx/src/gen/wxColourPickerCtrl.erl +++ b/lib/wx/src/gen/wxColourPickerCtrl.erl @@ -169,7 +169,7 @@ getColour(#wx_ref{type=ThisT,ref=ThisRef}) -> (This, Col) -> 'ok' when This::wxColourPickerCtrl(), Col::wx:wx_colour(). setColour(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxColourPickerCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxColourPickerCtrl_SetColour_1_0, diff --git a/lib/wx/src/gen/wxComboBox.erl b/lib/wx/src/gen/wxComboBox.erl index 1f6e975cd7..3de2721f38 100644 --- a/lib/wx/src/gen/wxComboBox.erl +++ b/lib/wx/src/gen/wxComboBox.erl @@ -130,7 +130,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) This::wxComboBox(), Parent::wxWindow:wxWindow(), Id::integer(), Value::unicode:chardata(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()]. create(This,Parent,Id,Value,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Value),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Value),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) -> create(This,Parent,Id,Value,Pos,Size,Choices, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxcombobox.html#wxcomboboxcreate">external documentation</a>. @@ -139,7 +139,7 @@ create(This,Parent,Id,Value,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) Option :: {'style', integer()} | {'validator', wx:wx_object()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Value,{PosX,PosY},{SizeW,SizeH},Choices, Options) - when is_integer(Id),is_list(Value),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) -> + when is_integer(Id),?is_chardata(Value),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) -> ?CLASS(ThisT,wxComboBox), ?CLASS(ParentT,wxWindow), Value_UC = unicode:characters_to_binary([Value,0]), @@ -252,7 +252,7 @@ redo(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec replace(This, From, To, Value) -> 'ok' when This::wxComboBox(), From::integer(), To::integer(), Value::unicode:chardata(). replace(#wx_ref{type=ThisT,ref=ThisRef},From,To,Value) - when is_integer(From),is_integer(To),is_list(Value) -> + when is_integer(From),is_integer(To),?is_chardata(Value) -> ?CLASS(ThisT,wxComboBox), Value_UC = unicode:characters_to_binary([Value,0]), wxe_util:cast(?wxComboBox_Replace, @@ -306,7 +306,7 @@ setSelection(#wx_ref{type=ThisT,ref=ThisRef},From,To) -spec setValue(This, Value) -> 'ok' when This::wxComboBox(), Value::unicode:chardata(). setValue(#wx_ref{type=ThisT,ref=ThisRef},Value) - when is_list(Value) -> + when ?is_chardata(Value) -> ?CLASS(ThisT,wxComboBox), Value_UC = unicode:characters_to_binary([Value,0]), wxe_util:cast(?wxComboBox_SetValue, diff --git a/lib/wx/src/gen/wxCommandEvent.erl b/lib/wx/src/gen/wxCommandEvent.erl index 781482aebb..18ccbc65f0 100644 --- a/lib/wx/src/gen/wxCommandEvent.erl +++ b/lib/wx/src/gen/wxCommandEvent.erl @@ -114,7 +114,7 @@ setInt(#wx_ref{type=ThisT,ref=ThisRef},I) -spec setString(This, S) -> 'ok' when This::wxCommandEvent(), S::unicode:chardata(). setString(#wx_ref{type=ThisT,ref=ThisRef},S) - when is_list(S) -> + when ?is_chardata(S) -> ?CLASS(ThisT,wxCommandEvent), S_UC = unicode:characters_to_binary([S,0]), wxe_util:cast(?wxCommandEvent_SetString, diff --git a/lib/wx/src/gen/wxControl.erl b/lib/wx/src/gen/wxControl.erl index f0a0fd02f7..df911b0758 100644 --- a/lib/wx/src/gen/wxControl.erl +++ b/lib/wx/src/gen/wxControl.erl @@ -89,7 +89,7 @@ getLabel(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setLabel(This, Label) -> 'ok' when This::wxControl(), Label::unicode:chardata(). setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label) - when is_list(Label) -> + when ?is_chardata(Label) -> ?CLASS(ThisT,wxControl), Label_UC = unicode:characters_to_binary([Label,0]), wxe_util:cast(?wxControl_SetLabel, diff --git a/lib/wx/src/gen/wxControlWithItems.erl b/lib/wx/src/gen/wxControlWithItems.erl index cf6b1fb17e..9c9769b5e3 100644 --- a/lib/wx/src/gen/wxControlWithItems.erl +++ b/lib/wx/src/gen/wxControlWithItems.erl @@ -86,7 +86,7 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). -spec append(This, Item) -> integer() when This::wxControlWithItems(), Item::unicode:chardata(). append(#wx_ref{type=ThisT,ref=ThisRef},Item) - when is_list(Item) -> + when ?is_chardata(Item) -> ?CLASS(ThisT,wxControlWithItems), Item_UC = unicode:characters_to_binary([Item,0]), wxe_util:call(?wxControlWithItems_Append_1, @@ -96,7 +96,7 @@ append(#wx_ref{type=ThisT,ref=ThisRef},Item) -spec append(This, Item, ClientData) -> integer() when This::wxControlWithItems(), Item::unicode:chardata(), ClientData::term(). append(#wx_ref{type=ThisT,ref=ThisRef},Item,ClientData) - when is_list(Item) -> + when ?is_chardata(Item) -> ?CLASS(ThisT,wxControlWithItems), Item_UC = unicode:characters_to_binary([Item,0]), wxe_util:send_bin(term_to_binary(ClientData)), @@ -136,7 +136,7 @@ delete(#wx_ref{type=ThisT,ref=ThisRef},N) This::wxControlWithItems(), S::unicode:chardata(). findString(This,S) - when is_record(This, wx_ref),is_list(S) -> + when is_record(This, wx_ref),?is_chardata(S) -> findString(This,S, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxcontrolwithitems.html#wxcontrolwithitemsfindstring">external documentation</a>. @@ -144,7 +144,7 @@ findString(This,S) This::wxControlWithItems(), S::unicode:chardata(), Option :: {'bCase', boolean()}. findString(#wx_ref{type=ThisT,ref=ThisRef},S, Options) - when is_list(S),is_list(Options) -> + when ?is_chardata(S),is_list(Options) -> ?CLASS(ThisT,wxControlWithItems), S_UC = unicode:characters_to_binary([S,0]), MOpts = fun({bCase, BCase}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(BCase)):32/?UI>>|Acc]; @@ -209,7 +209,7 @@ getStringSelection(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec insert(This, Item, Pos) -> integer() when This::wxControlWithItems(), Item::unicode:chardata(), Pos::integer(). insert(#wx_ref{type=ThisT,ref=ThisRef},Item,Pos) - when is_list(Item),is_integer(Pos) -> + when ?is_chardata(Item),is_integer(Pos) -> ?CLASS(ThisT,wxControlWithItems), Item_UC = unicode:characters_to_binary([Item,0]), wxe_util:call(?wxControlWithItems_Insert_2, @@ -219,7 +219,7 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Item,Pos) -spec insert(This, Item, Pos, ClientData) -> integer() when This::wxControlWithItems(), Item::unicode:chardata(), Pos::integer(), ClientData::term(). insert(#wx_ref{type=ThisT,ref=ThisRef},Item,Pos,ClientData) - when is_list(Item),is_integer(Pos) -> + when ?is_chardata(Item),is_integer(Pos) -> ?CLASS(ThisT,wxControlWithItems), Item_UC = unicode:characters_to_binary([Item,0]), wxe_util:send_bin(term_to_binary(ClientData)), @@ -256,7 +256,7 @@ setSelection(#wx_ref{type=ThisT,ref=ThisRef},N) -spec setString(This, N, S) -> 'ok' when This::wxControlWithItems(), N::integer(), S::unicode:chardata(). setString(#wx_ref{type=ThisT,ref=ThisRef},N,S) - when is_integer(N),is_list(S) -> + when is_integer(N),?is_chardata(S) -> ?CLASS(ThisT,wxControlWithItems), S_UC = unicode:characters_to_binary([S,0]), wxe_util:cast(?wxControlWithItems_SetString, @@ -266,7 +266,7 @@ setString(#wx_ref{type=ThisT,ref=ThisRef},N,S) -spec setStringSelection(This, S) -> boolean() when This::wxControlWithItems(), S::unicode:chardata(). setStringSelection(#wx_ref{type=ThisT,ref=ThisRef},S) - when is_list(S) -> + when ?is_chardata(S) -> ?CLASS(ThisT,wxControlWithItems), S_UC = unicode:characters_to_binary([S,0]), wxe_util:call(?wxControlWithItems_SetStringSelection, diff --git a/lib/wx/src/gen/wxDC.erl b/lib/wx/src/gen/wxDC.erl index ad7a4251ec..16bfcc3463 100644 --- a/lib/wx/src/gen/wxDC.erl +++ b/lib/wx/src/gen/wxDC.erl @@ -253,7 +253,7 @@ drawIcon(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconT,ref=IconRef},{PtX,Pt This::wxDC(), Text::unicode:chardata(), Rect::{X::integer(), Y::integer(), W::integer(), H::integer()}. drawLabel(This,Text,Rect={RectX,RectY,RectW,RectH}) - when is_record(This, wx_ref),is_list(Text),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) -> + when is_record(This, wx_ref),?is_chardata(Text),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH) -> drawLabel(This,Text,Rect, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxdc.html#wxdcdrawlabel">external documentation</a>. @@ -262,7 +262,7 @@ drawLabel(This,Text,Rect={RectX,RectY,RectW,RectH}) Option :: {'alignment', integer()} | {'indexAccel', integer()}. drawLabel(#wx_ref{type=ThisT,ref=ThisRef},Text,{RectX,RectY,RectW,RectH}, Options) - when is_list(Text),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),is_list(Options) -> + when ?is_chardata(Text),is_integer(RectX),is_integer(RectY),is_integer(RectW),is_integer(RectH),is_list(Options) -> ?CLASS(ThisT,wxDC), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({alignment, Alignment}, Acc) -> [<<1:32/?UI,Alignment:32/?UI>>|Acc]; @@ -363,7 +363,7 @@ drawRectangle(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},{SzW,SzH}) -spec drawRotatedText(This, Text, Pt, Angle) -> 'ok' when This::wxDC(), Text::unicode:chardata(), Pt::{X::integer(), Y::integer()}, Angle::number(). drawRotatedText(#wx_ref{type=ThisT,ref=ThisRef},Text,{PtX,PtY},Angle) - when is_list(Text),is_integer(PtX),is_integer(PtY),is_number(Angle) -> + when ?is_chardata(Text),is_integer(PtX),is_integer(PtY),is_number(Angle) -> ?CLASS(ThisT,wxDC), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxDC_DrawRotatedText, @@ -391,7 +391,7 @@ drawRoundedRectangle(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY},{SzW,SzH},Radius) -spec drawText(This, Text, Pt) -> 'ok' when This::wxDC(), Text::unicode:chardata(), Pt::{X::integer(), Y::integer()}. drawText(#wx_ref{type=ThisT,ref=ThisRef},Text,{PtX,PtY}) - when is_list(Text),is_integer(PtX),is_integer(PtY) -> + when ?is_chardata(Text),is_integer(PtX),is_integer(PtY) -> ?CLASS(ThisT,wxDC), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxDC_DrawText, @@ -521,7 +521,7 @@ getMapMode(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec getMultiLineTextExtent(This, String) -> {W::integer(), H::integer()} when This::wxDC(), String::unicode:chardata(). getMultiLineTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String) - when is_list(String) -> + when ?is_chardata(String) -> ?CLASS(ThisT,wxDC), String_UC = unicode:characters_to_binary([String,0]), wxe_util:call(?wxDC_GetMultiLineTextExtent_1, @@ -532,7 +532,7 @@ getMultiLineTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String) This::wxDC(), String::unicode:chardata(), Option :: {'font', wxFont:wxFont()}. getMultiLineTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options) - when is_list(String),is_list(Options) -> + when ?is_chardata(String),is_list(Options) -> ?CLASS(ThisT,wxDC), String_UC = unicode:characters_to_binary([String,0]), MOpts = fun({font, #wx_ref{type=FontT,ref=FontRef}}, Acc) -> ?CLASS(FontT,wxFont),[<<1:32/?UI,FontRef:32/?UI>>|Acc]; @@ -546,7 +546,7 @@ getMultiLineTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options) Result ::{Res ::boolean(), Widths::[integer()]}, This::wxDC(), Text::unicode:chardata(). getPartialTextExtents(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxDC), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxDC_GetPartialTextExtents, @@ -606,7 +606,7 @@ getTextBackground(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec getTextExtent(This, String) -> {W::integer(), H::integer()} when This::wxDC(), String::unicode:chardata(). getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String) - when is_list(String) -> + when ?is_chardata(String) -> ?CLASS(ThisT,wxDC), String_UC = unicode:characters_to_binary([String,0]), wxe_util:call(?wxDC_GetTextExtent_1, @@ -618,7 +618,7 @@ getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String) This::wxDC(), String::unicode:chardata(), Option :: {'theFont', wxFont:wxFont()}. getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options) - when is_list(String),is_list(Options) -> + when ?is_chardata(String),is_list(Options) -> ?CLASS(ThisT,wxDC), String_UC = unicode:characters_to_binary([String,0]), MOpts = fun({theFont, #wx_ref{type=TheFontT,ref=TheFontRef}}, Acc) -> ?CLASS(TheFontT,wxFont),[<<1:32/?UI,TheFontRef:32/?UI>>|Acc]; @@ -929,7 +929,7 @@ setUserScale(#wx_ref{type=ThisT,ref=ThisRef},X,Y) -spec startDoc(This, Message) -> boolean() when This::wxDC(), Message::unicode:chardata(). startDoc(#wx_ref{type=ThisT,ref=ThisRef},Message) - when is_list(Message) -> + when ?is_chardata(Message) -> ?CLASS(ThisT,wxDC), Message_UC = unicode:characters_to_binary([Message,0]), wxe_util:call(?wxDC_StartDoc, diff --git a/lib/wx/src/gen/wxDialog.erl b/lib/wx/src/gen/wxDialog.erl index 6ddf15b193..178efde5c6 100644 --- a/lib/wx/src/gen/wxDialog.erl +++ b/lib/wx/src/gen/wxDialog.erl @@ -97,7 +97,7 @@ new() -> Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(). new(Parent,Id,Title) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Title) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title) -> new(Parent,Id,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxdialog.html#wxdialogwxdialog">external documentation</a>. @@ -107,7 +107,7 @@ new(Parent,Id,Title) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) - when is_integer(Id),is_list(Title),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_list(Options) -> ?CLASS(ParentT,wxWindow), Title_UC = unicode:characters_to_binary([Title,0]), MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc]; @@ -123,7 +123,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) This::wxDialog(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(). create(This,Parent,Id,Title) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title) -> create(This,Parent,Id,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxdialog.html#wxdialogcreate">external documentation</a>. @@ -133,7 +133,7 @@ create(This,Parent,Id,Title) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) - when is_integer(Id),is_list(Title),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_list(Options) -> ?CLASS(ThisT,wxDialog), ?CLASS(ParentT,wxWindow), Title_UC = unicode:characters_to_binary([Title,0]), diff --git a/lib/wx/src/gen/wxDirDialog.erl b/lib/wx/src/gen/wxDirDialog.erl index 638d7663af..c942116fd9 100644 --- a/lib/wx/src/gen/wxDirDialog.erl +++ b/lib/wx/src/gen/wxDirDialog.erl @@ -137,7 +137,7 @@ getMessage(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setMessage(This, Message) -> 'ok' when This::wxDirDialog(), Message::unicode:chardata(). setMessage(#wx_ref{type=ThisT,ref=ThisRef},Message) - when is_list(Message) -> + when ?is_chardata(Message) -> ?CLASS(ThisT,wxDirDialog), Message_UC = unicode:characters_to_binary([Message,0]), wxe_util:cast(?wxDirDialog_SetMessage, @@ -147,7 +147,7 @@ setMessage(#wx_ref{type=ThisT,ref=ThisRef},Message) -spec setPath(This, Path) -> 'ok' when This::wxDirDialog(), Path::unicode:chardata(). setPath(#wx_ref{type=ThisT,ref=ThisRef},Path) - when is_list(Path) -> + when ?is_chardata(Path) -> ?CLASS(ThisT,wxDirDialog), Path_UC = unicode:characters_to_binary([Path,0]), wxe_util:cast(?wxDirDialog_SetPath, diff --git a/lib/wx/src/gen/wxDirPickerCtrl.erl b/lib/wx/src/gen/wxDirPickerCtrl.erl index 28f1d02cf8..014e90c120 100644 --- a/lib/wx/src/gen/wxDirPickerCtrl.erl +++ b/lib/wx/src/gen/wxDirPickerCtrl.erl @@ -167,7 +167,7 @@ getPath(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setPath(This, Str) -> 'ok' when This::wxDirPickerCtrl(), Str::unicode:chardata(). setPath(#wx_ref{type=ThisT,ref=ThisRef},Str) - when is_list(Str) -> + when ?is_chardata(Str) -> ?CLASS(ThisT,wxDirPickerCtrl), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxDirPickerCtrl_SetPath, diff --git a/lib/wx/src/gen/wxFileDataObject.erl b/lib/wx/src/gen/wxFileDataObject.erl index 06d8ceb9cd..d4e9198225 100644 --- a/lib/wx/src/gen/wxFileDataObject.erl +++ b/lib/wx/src/gen/wxFileDataObject.erl @@ -49,7 +49,7 @@ new() -> -spec addFile(This, Filename) -> 'ok' when This::wxFileDataObject(), Filename::unicode:chardata(). addFile(#wx_ref{type=ThisT,ref=ThisRef},Filename) - when is_list(Filename) -> + when ?is_chardata(Filename) -> ?CLASS(ThisT,wxFileDataObject), Filename_UC = unicode:characters_to_binary([Filename,0]), wxe_util:cast(?wxFileDataObject_AddFile, diff --git a/lib/wx/src/gen/wxFileDialog.erl b/lib/wx/src/gen/wxFileDialog.erl index d0dac566a3..de5d436c11 100644 --- a/lib/wx/src/gen/wxFileDialog.erl +++ b/lib/wx/src/gen/wxFileDialog.erl @@ -191,7 +191,7 @@ getWildcard(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setDirectory(This, Dir) -> 'ok' when This::wxFileDialog(), Dir::unicode:chardata(). setDirectory(#wx_ref{type=ThisT,ref=ThisRef},Dir) - when is_list(Dir) -> + when ?is_chardata(Dir) -> ?CLASS(ThisT,wxFileDialog), Dir_UC = unicode:characters_to_binary([Dir,0]), wxe_util:cast(?wxFileDialog_SetDirectory, @@ -201,7 +201,7 @@ setDirectory(#wx_ref{type=ThisT,ref=ThisRef},Dir) -spec setFilename(This, Name) -> 'ok' when This::wxFileDialog(), Name::unicode:chardata(). setFilename(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxFileDialog), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:cast(?wxFileDialog_SetFilename, @@ -220,7 +220,7 @@ setFilterIndex(#wx_ref{type=ThisT,ref=ThisRef},FilterIndex) -spec setMessage(This, Message) -> 'ok' when This::wxFileDialog(), Message::unicode:chardata(). setMessage(#wx_ref{type=ThisT,ref=ThisRef},Message) - when is_list(Message) -> + when ?is_chardata(Message) -> ?CLASS(ThisT,wxFileDialog), Message_UC = unicode:characters_to_binary([Message,0]), wxe_util:cast(?wxFileDialog_SetMessage, @@ -230,7 +230,7 @@ setMessage(#wx_ref{type=ThisT,ref=ThisRef},Message) -spec setPath(This, Path) -> 'ok' when This::wxFileDialog(), Path::unicode:chardata(). setPath(#wx_ref{type=ThisT,ref=ThisRef},Path) - when is_list(Path) -> + when ?is_chardata(Path) -> ?CLASS(ThisT,wxFileDialog), Path_UC = unicode:characters_to_binary([Path,0]), wxe_util:cast(?wxFileDialog_SetPath, @@ -240,7 +240,7 @@ setPath(#wx_ref{type=ThisT,ref=ThisRef},Path) -spec setWildcard(This, WildCard) -> 'ok' when This::wxFileDialog(), WildCard::unicode:chardata(). setWildcard(#wx_ref{type=ThisT,ref=ThisRef},WildCard) - when is_list(WildCard) -> + when ?is_chardata(WildCard) -> ?CLASS(ThisT,wxFileDialog), WildCard_UC = unicode:characters_to_binary([WildCard,0]), wxe_util:cast(?wxFileDialog_SetWildcard, diff --git a/lib/wx/src/gen/wxFilePickerCtrl.erl b/lib/wx/src/gen/wxFilePickerCtrl.erl index 6d9ae85049..24941ad87a 100644 --- a/lib/wx/src/gen/wxFilePickerCtrl.erl +++ b/lib/wx/src/gen/wxFilePickerCtrl.erl @@ -171,7 +171,7 @@ getPath(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setPath(This, Str) -> 'ok' when This::wxFilePickerCtrl(), Str::unicode:chardata(). setPath(#wx_ref{type=ThisT,ref=ThisRef},Str) - when is_list(Str) -> + when ?is_chardata(Str) -> ?CLASS(ThisT,wxFilePickerCtrl), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxFilePickerCtrl_SetPath, diff --git a/lib/wx/src/gen/wxFindReplaceData.erl b/lib/wx/src/gen/wxFindReplaceData.erl index 9b4b910f7e..388bf5f238 100644 --- a/lib/wx/src/gen/wxFindReplaceData.erl +++ b/lib/wx/src/gen/wxFindReplaceData.erl @@ -87,7 +87,7 @@ setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags) -spec setFindString(This, Str) -> 'ok' when This::wxFindReplaceData(), Str::unicode:chardata(). setFindString(#wx_ref{type=ThisT,ref=ThisRef},Str) - when is_list(Str) -> + when ?is_chardata(Str) -> ?CLASS(ThisT,wxFindReplaceData), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxFindReplaceData_SetFindString, @@ -97,7 +97,7 @@ setFindString(#wx_ref{type=ThisT,ref=ThisRef},Str) -spec setReplaceString(This, Str) -> 'ok' when This::wxFindReplaceData(), Str::unicode:chardata(). setReplaceString(#wx_ref{type=ThisT,ref=ThisRef},Str) - when is_list(Str) -> + when ?is_chardata(Str) -> ?CLASS(ThisT,wxFindReplaceData), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxFindReplaceData_SetReplaceString, diff --git a/lib/wx/src/gen/wxFindReplaceDialog.erl b/lib/wx/src/gen/wxFindReplaceDialog.erl index 6cc4943f8d..b5cd3350d2 100644 --- a/lib/wx/src/gen/wxFindReplaceDialog.erl +++ b/lib/wx/src/gen/wxFindReplaceDialog.erl @@ -99,7 +99,7 @@ new() -> Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::unicode:chardata(). new(Parent,Data,Title) - when is_record(Parent, wx_ref),is_record(Data, wx_ref),is_list(Title) -> + when is_record(Parent, wx_ref),is_record(Data, wx_ref),?is_chardata(Title) -> new(Parent,Data,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxfindreplacedialog.html#wxfindreplacedialogwxfindreplacedialog">external documentation</a>. @@ -107,7 +107,7 @@ new(Parent,Data,Title) Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::unicode:chardata(), Option :: {'style', integer()}. new(#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=DataT,ref=DataRef},Title, Options) - when is_list(Title),is_list(Options) -> + when ?is_chardata(Title),is_list(Options) -> ?CLASS(ParentT,wxWindow), ?CLASS(DataT,wxFindReplaceData), Title_UC = unicode:characters_to_binary([Title,0]), @@ -122,7 +122,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=DataT,ref=DataRef},Title, O This::wxFindReplaceDialog(), Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::unicode:chardata(). create(This,Parent,Data,Title) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_record(Data, wx_ref),is_list(Title) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_record(Data, wx_ref),?is_chardata(Title) -> create(This,Parent,Data,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxfindreplacedialog.html#wxfindreplacedialogcreate">external documentation</a>. @@ -130,7 +130,7 @@ create(This,Parent,Data,Title) This::wxFindReplaceDialog(), Parent::wxWindow:wxWindow(), Data::wxFindReplaceData:wxFindReplaceData(), Title::unicode:chardata(), Option :: {'style', integer()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=DataT,ref=DataRef},Title, Options) - when is_list(Title),is_list(Options) -> + when ?is_chardata(Title),is_list(Options) -> ?CLASS(ThisT,wxFindReplaceDialog), ?CLASS(ParentT,wxWindow), ?CLASS(DataT,wxFindReplaceData), diff --git a/lib/wx/src/gen/wxFont.erl b/lib/wx/src/gen/wxFont.erl index 56e6e96b6d..fb0ba8b505 100644 --- a/lib/wx/src/gen/wxFont.erl +++ b/lib/wx/src/gen/wxFont.erl @@ -49,7 +49,7 @@ new() -> -spec new(Fontname) -> wxFont() when Fontname::unicode:chardata(). new(Fontname) - when is_list(Fontname) -> + when ?is_chardata(Fontname) -> Fontname_UC = unicode:characters_to_binary([Fontname,0]), wxe_util:construct(?wxFont_new_1, <<(byte_size(Fontname_UC)):32/?UI,(Fontname_UC)/binary, 0:(((8- ((4+byte_size(Fontname_UC)) band 16#7)) band 16#7))/unit:8>>). @@ -183,7 +183,7 @@ setDefaultEncoding(Encoding) -spec setFaceName(This, FaceName) -> boolean() when This::wxFont(), FaceName::unicode:chardata(). setFaceName(#wx_ref{type=ThisT,ref=ThisRef},FaceName) - when is_list(FaceName) -> + when ?is_chardata(FaceName) -> ?CLASS(ThisT,wxFont), FaceName_UC = unicode:characters_to_binary([FaceName,0]), wxe_util:call(?wxFont_SetFaceName, diff --git a/lib/wx/src/gen/wxFrame.erl b/lib/wx/src/gen/wxFrame.erl index a5529e0612..3e33f650d1 100644 --- a/lib/wx/src/gen/wxFrame.erl +++ b/lib/wx/src/gen/wxFrame.erl @@ -99,7 +99,7 @@ new() -> Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(). new(Parent,Id,Title) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Title) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title) -> new(Parent,Id,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxframe.html#wxframewxframe">external documentation</a>. @@ -109,7 +109,7 @@ new(Parent,Id,Title) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) - when is_integer(Id),is_list(Title),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_list(Options) -> ?CLASS(ParentT,wxWindow), Title_UC = unicode:characters_to_binary([Title,0]), MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc]; @@ -125,7 +125,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) This::wxFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(). create(This,Parent,Id,Title) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title) -> create(This,Parent,Id,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxframe.html#wxframecreate">external documentation</a>. @@ -135,7 +135,7 @@ create(This,Parent,Id,Title) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) - when is_integer(Id),is_list(Title),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_list(Options) -> ?CLASS(ThisT,wxFrame), ?CLASS(ParentT,wxWindow), Title_UC = unicode:characters_to_binary([Title,0]), @@ -284,7 +284,7 @@ setStatusBarPane(#wx_ref{type=ThisT,ref=ThisRef},N) This::wxFrame(), Text::unicode:chardata(). setStatusText(This,Text) - when is_record(This, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),?is_chardata(Text) -> setStatusText(This,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxframe.html#wxframesetstatustext">external documentation</a>. @@ -292,7 +292,7 @@ setStatusText(This,Text) This::wxFrame(), Text::unicode:chardata(), Option :: {'number', integer()}. setStatusText(#wx_ref{type=ThisT,ref=ThisRef},Text, Options) - when is_list(Text),is_list(Options) -> + when ?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxFrame), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({number, Number}, Acc) -> [<<1:32/?UI,Number:32/?UI>>|Acc]; diff --git a/lib/wx/src/gen/wxGenericDirCtrl.erl b/lib/wx/src/gen/wxGenericDirCtrl.erl index d9815a51ba..3c13e09359 100644 --- a/lib/wx/src/gen/wxGenericDirCtrl.erl +++ b/lib/wx/src/gen/wxGenericDirCtrl.erl @@ -175,7 +175,7 @@ collapseTree(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec expandPath(This, Path) -> boolean() when This::wxGenericDirCtrl(), Path::unicode:chardata(). expandPath(#wx_ref{type=ThisT,ref=ThisRef},Path) - when is_list(Path) -> + when ?is_chardata(Path) -> ?CLASS(ThisT,wxGenericDirCtrl), Path_UC = unicode:characters_to_binary([Path,0]), wxe_util:call(?wxGenericDirCtrl_ExpandPath, @@ -249,7 +249,7 @@ reCreateTree(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setDefaultPath(This, Path) -> 'ok' when This::wxGenericDirCtrl(), Path::unicode:chardata(). setDefaultPath(#wx_ref{type=ThisT,ref=ThisRef},Path) - when is_list(Path) -> + when ?is_chardata(Path) -> ?CLASS(ThisT,wxGenericDirCtrl), Path_UC = unicode:characters_to_binary([Path,0]), wxe_util:cast(?wxGenericDirCtrl_SetDefaultPath, @@ -259,7 +259,7 @@ setDefaultPath(#wx_ref{type=ThisT,ref=ThisRef},Path) -spec setFilter(This, Filter) -> 'ok' when This::wxGenericDirCtrl(), Filter::unicode:chardata(). setFilter(#wx_ref{type=ThisT,ref=ThisRef},Filter) - when is_list(Filter) -> + when ?is_chardata(Filter) -> ?CLASS(ThisT,wxGenericDirCtrl), Filter_UC = unicode:characters_to_binary([Filter,0]), wxe_util:cast(?wxGenericDirCtrl_SetFilter, @@ -278,7 +278,7 @@ setFilterIndex(#wx_ref{type=ThisT,ref=ThisRef},N) -spec setPath(This, Path) -> 'ok' when This::wxGenericDirCtrl(), Path::unicode:chardata(). setPath(#wx_ref{type=ThisT,ref=ThisRef},Path) - when is_list(Path) -> + when ?is_chardata(Path) -> ?CLASS(ThisT,wxGenericDirCtrl), Path_UC = unicode:characters_to_binary([Path,0]), wxe_util:cast(?wxGenericDirCtrl_SetPath, diff --git a/lib/wx/src/gen/wxGraphicsContext.erl b/lib/wx/src/gen/wxGraphicsContext.erl index 0aa2119210..2d0271ac48 100644 --- a/lib/wx/src/gen/wxGraphicsContext.erl +++ b/lib/wx/src/gen/wxGraphicsContext.erl @@ -287,7 +287,7 @@ drawRoundedRectangle(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H,Radius) -spec drawText(This, Str, X, Y) -> 'ok' when This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(). drawText(#wx_ref{type=ThisT,ref=ThisRef},Str,X,Y) - when is_list(Str),is_number(X),is_number(Y) -> + when ?is_chardata(Str),is_number(X),is_number(Y) -> ?CLASS(ThisT,wxGraphicsContext), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxGraphicsContext_DrawText_3, @@ -303,13 +303,13 @@ drawText(#wx_ref{type=ThisT,ref=ThisRef},Str,X,Y) (This, Str, X, Y, BackgroundBrush) -> 'ok' when This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(), BackgroundBrush::wxGraphicsBrush:wxGraphicsBrush(). drawText(#wx_ref{type=ThisT,ref=ThisRef},Str,X,Y,Angle) - when is_list(Str),is_number(X),is_number(Y),is_number(Angle) -> + when ?is_chardata(Str),is_number(X),is_number(Y),is_number(Angle) -> ?CLASS(ThisT,wxGraphicsContext), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxGraphicsContext_DrawText_4_0, <<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8,X:64/?F,Y:64/?F,Angle:64/?F>>); drawText(#wx_ref{type=ThisT,ref=ThisRef},Str,X,Y,#wx_ref{type=BackgroundBrushT,ref=BackgroundBrushRef}) - when is_list(Str),is_number(X),is_number(Y) -> + when ?is_chardata(Str),is_number(X),is_number(Y) -> ?CLASS(ThisT,wxGraphicsContext), Str_UC = unicode:characters_to_binary([Str,0]), ?CLASS(BackgroundBrushT,wxGraphicsBrush), @@ -320,7 +320,7 @@ drawText(#wx_ref{type=ThisT,ref=ThisRef},Str,X,Y,#wx_ref{type=BackgroundBrushT,r -spec drawText(This, Str, X, Y, Angle, BackgroundBrush) -> 'ok' when This::wxGraphicsContext(), Str::unicode:chardata(), X::number(), Y::number(), Angle::number(), BackgroundBrush::wxGraphicsBrush:wxGraphicsBrush(). drawText(#wx_ref{type=ThisT,ref=ThisRef},Str,X,Y,Angle,#wx_ref{type=BackgroundBrushT,ref=BackgroundBrushRef}) - when is_list(Str),is_number(X),is_number(Y),is_number(Angle) -> + when ?is_chardata(Str),is_number(X),is_number(Y),is_number(Angle) -> ?CLASS(ThisT,wxGraphicsContext), Str_UC = unicode:characters_to_binary([Str,0]), ?CLASS(BackgroundBrushT,wxGraphicsBrush), @@ -363,7 +363,7 @@ strokePath(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PathT,ref=PathRef}) -> -spec getPartialTextExtents(This, Text) -> [number()] when This::wxGraphicsContext(), Text::unicode:chardata(). getPartialTextExtents(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxGraphicsContext), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxGraphicsContext_GetPartialTextExtents, @@ -374,7 +374,7 @@ getPartialTextExtents(#wx_ref{type=ThisT,ref=ThisRef},Text) Result ::{Width::number(), Height::number(), Descent::number(), ExternalLeading::number()}, This::wxGraphicsContext(), Text::unicode:chardata(). getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxGraphicsContext), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxGraphicsContext_GetTextExtent, diff --git a/lib/wx/src/gen/wxGrid.erl b/lib/wx/src/gen/wxGrid.erl index c929174421..0cdb37e9e4 100644 --- a/lib/wx/src/gen/wxGrid.erl +++ b/lib/wx/src/gen/wxGrid.erl @@ -851,7 +851,7 @@ getDefaultEditorForCell(#wx_ref{type=ThisT,ref=ThisRef},Row,Col) -spec getDefaultEditorForType(This, TypeName) -> wxGridCellEditor:wxGridCellEditor() when This::wxGrid(), TypeName::unicode:chardata(). getDefaultEditorForType(#wx_ref{type=ThisT,ref=ThisRef},TypeName) - when is_list(TypeName) -> + when ?is_chardata(TypeName) -> ?CLASS(ThisT,wxGrid), TypeName_UC = unicode:characters_to_binary([TypeName,0]), wxe_util:call(?wxGrid_GetDefaultEditorForType, @@ -878,7 +878,7 @@ getDefaultRendererForCell(#wx_ref{type=ThisT,ref=ThisRef},Row,Col) -spec getDefaultRendererForType(This, TypeName) -> wxGridCellRenderer:wxGridCellRenderer() when This::wxGrid(), TypeName::unicode:chardata(). getDefaultRendererForType(#wx_ref{type=ThisT,ref=ThisRef},TypeName) - when is_list(TypeName) -> + when ?is_chardata(TypeName) -> ?CLASS(ThisT,wxGrid), TypeName_UC = unicode:characters_to_binary([TypeName,0]), wxe_util:call(?wxGrid_GetDefaultRendererForType, @@ -1407,7 +1407,7 @@ movePageUp(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec registerDataType(This, TypeName, Renderer, Editor) -> 'ok' when This::wxGrid(), TypeName::unicode:chardata(), Renderer::wxGridCellRenderer:wxGridCellRenderer(), Editor::wxGridCellEditor:wxGridCellEditor(). registerDataType(#wx_ref{type=ThisT,ref=ThisRef},TypeName,#wx_ref{type=RendererT,ref=RendererRef},#wx_ref{type=EditorT,ref=EditorRef}) - when is_list(TypeName) -> + when ?is_chardata(TypeName) -> ?CLASS(ThisT,wxGrid), TypeName_UC = unicode:characters_to_binary([TypeName,0]), ?CLASS(RendererT,wxGridCellRenderer), @@ -1634,7 +1634,7 @@ setCellTextColour(#wx_ref{type=ThisT,ref=ThisRef},Val,Row,Col) -spec setCellValue(This, Coords, S) -> 'ok' when This::wxGrid(), Coords::{R::integer(), C::integer()}, S::unicode:chardata(). setCellValue(#wx_ref{type=ThisT,ref=ThisRef},{CoordsR,CoordsC},S) - when is_integer(CoordsR),is_integer(CoordsC),is_list(S) -> + when is_integer(CoordsR),is_integer(CoordsC),?is_chardata(S) -> ?CLASS(ThisT,wxGrid), S_UC = unicode:characters_to_binary([S,0]), wxe_util:cast(?wxGrid_SetCellValue_2, @@ -1650,13 +1650,13 @@ setCellValue(#wx_ref{type=ThisT,ref=ThisRef},{CoordsR,CoordsC},S) (This, Val, Row, Col) -> 'ok' when This::wxGrid(), Val::unicode:chardata(), Row::integer(), Col::integer(). setCellValue(#wx_ref{type=ThisT,ref=ThisRef},Row,Col,S) - when is_integer(Row),is_integer(Col),is_list(S) -> + when is_integer(Row),is_integer(Col),?is_chardata(S) -> ?CLASS(ThisT,wxGrid), S_UC = unicode:characters_to_binary([S,0]), wxe_util:cast(?wxGrid_SetCellValue_3_0, <<ThisRef:32/?UI,Row:32/?UI,Col:32/?UI,(byte_size(S_UC)):32/?UI,(S_UC)/binary, 0:(((8- ((0+byte_size(S_UC)) band 16#7)) band 16#7))/unit:8>>); setCellValue(#wx_ref{type=ThisT,ref=ThisRef},Val,Row,Col) - when is_list(Val),is_integer(Row),is_integer(Col) -> + when ?is_chardata(Val),is_integer(Row),is_integer(Col) -> ?CLASS(ThisT,wxGrid), Val_UC = unicode:characters_to_binary([Val,0]), wxe_util:cast(?wxGrid_SetCellValue_3_1, @@ -1717,7 +1717,7 @@ setColFormatFloat(#wx_ref{type=ThisT,ref=ThisRef},Col, Options) -spec setColFormatCustom(This, Col, TypeName) -> 'ok' when This::wxGrid(), Col::integer(), TypeName::unicode:chardata(). setColFormatCustom(#wx_ref{type=ThisT,ref=ThisRef},Col,TypeName) - when is_integer(Col),is_list(TypeName) -> + when is_integer(Col),?is_chardata(TypeName) -> ?CLASS(ThisT,wxGrid), TypeName_UC = unicode:characters_to_binary([TypeName,0]), wxe_util:cast(?wxGrid_SetColFormatCustom, @@ -1745,7 +1745,7 @@ setColLabelSize(#wx_ref{type=ThisT,ref=ThisRef},Height) -spec setColLabelValue(This, Col, Val) -> 'ok' when This::wxGrid(), Col::integer(), Val::unicode:chardata(). setColLabelValue(#wx_ref{type=ThisT,ref=ThisRef},Col,Val) - when is_integer(Col),is_list(Val) -> + when is_integer(Col),?is_chardata(Val) -> ?CLASS(ThisT,wxGrid), Val_UC = unicode:characters_to_binary([Val,0]), wxe_util:cast(?wxGrid_SetColLabelValue, @@ -1981,7 +1981,7 @@ setRowLabelSize(#wx_ref{type=ThisT,ref=ThisRef},Width) -spec setRowLabelValue(This, Row, Val) -> 'ok' when This::wxGrid(), Row::integer(), Val::unicode:chardata(). setRowLabelValue(#wx_ref{type=ThisT,ref=ThisRef},Row,Val) - when is_integer(Row),is_list(Val) -> + when is_integer(Row),?is_chardata(Val) -> ?CLASS(ThisT,wxGrid), Val_UC = unicode:characters_to_binary([Val,0]), wxe_util:cast(?wxGrid_SetRowLabelValue, diff --git a/lib/wx/src/gen/wxGridCellBoolEditor.erl b/lib/wx/src/gen/wxGridCellBoolEditor.erl index 1d949d54ff..59348f94f8 100644 --- a/lib/wx/src/gen/wxGridCellBoolEditor.erl +++ b/lib/wx/src/gen/wxGridCellBoolEditor.erl @@ -52,7 +52,7 @@ new() -> -spec isTrueValue(Value) -> boolean() when Value::unicode:chardata(). isTrueValue(Value) - when is_list(Value) -> + when ?is_chardata(Value) -> Value_UC = unicode:characters_to_binary([Value,0]), wxe_util:call(?wxGridCellBoolEditor_IsTrueValue, <<(byte_size(Value_UC)):32/?UI,(Value_UC)/binary, 0:(((8- ((4+byte_size(Value_UC)) band 16#7)) band 16#7))/unit:8>>). diff --git a/lib/wx/src/gen/wxGridCellChoiceEditor.erl b/lib/wx/src/gen/wxGridCellChoiceEditor.erl index d5487c3618..8f4a07a0bb 100644 --- a/lib/wx/src/gen/wxGridCellChoiceEditor.erl +++ b/lib/wx/src/gen/wxGridCellChoiceEditor.erl @@ -68,7 +68,7 @@ new(Choices, Options) -spec setParameters(This, Params) -> 'ok' when This::wxGridCellChoiceEditor(), Params::unicode:chardata(). setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params) - when is_list(Params) -> + when ?is_chardata(Params) -> ?CLASS(ThisT,wxGridCellChoiceEditor), Params_UC = unicode:characters_to_binary([Params,0]), wxe_util:cast(?wxGridCellChoiceEditor_SetParameters, diff --git a/lib/wx/src/gen/wxGridCellFloatEditor.erl b/lib/wx/src/gen/wxGridCellFloatEditor.erl index 6e85469ecf..90b9542afc 100644 --- a/lib/wx/src/gen/wxGridCellFloatEditor.erl +++ b/lib/wx/src/gen/wxGridCellFloatEditor.erl @@ -65,7 +65,7 @@ new(Options) -spec setParameters(This, Params) -> 'ok' when This::wxGridCellFloatEditor(), Params::unicode:chardata(). setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params) - when is_list(Params) -> + when ?is_chardata(Params) -> ?CLASS(ThisT,wxGridCellFloatEditor), Params_UC = unicode:characters_to_binary([Params,0]), wxe_util:cast(?wxGridCellFloatEditor_SetParameters, diff --git a/lib/wx/src/gen/wxGridCellFloatRenderer.erl b/lib/wx/src/gen/wxGridCellFloatRenderer.erl index ccb29902b3..72bdc6fc29 100644 --- a/lib/wx/src/gen/wxGridCellFloatRenderer.erl +++ b/lib/wx/src/gen/wxGridCellFloatRenderer.erl @@ -81,7 +81,7 @@ getWidth(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setParameters(This, Params) -> 'ok' when This::wxGridCellFloatRenderer(), Params::unicode:chardata(). setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params) - when is_list(Params) -> + when ?is_chardata(Params) -> ?CLASS(ThisT,wxGridCellFloatRenderer), Params_UC = unicode:characters_to_binary([Params,0]), wxe_util:cast(?wxGridCellFloatRenderer_SetParameters, diff --git a/lib/wx/src/gen/wxGridCellNumberEditor.erl b/lib/wx/src/gen/wxGridCellNumberEditor.erl index 7a47024b2f..22f9a1839c 100644 --- a/lib/wx/src/gen/wxGridCellNumberEditor.erl +++ b/lib/wx/src/gen/wxGridCellNumberEditor.erl @@ -75,7 +75,7 @@ getValue(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setParameters(This, Params) -> 'ok' when This::wxGridCellNumberEditor(), Params::unicode:chardata(). setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params) - when is_list(Params) -> + when ?is_chardata(Params) -> ?CLASS(ThisT,wxGridCellNumberEditor), Params_UC = unicode:characters_to_binary([Params,0]), wxe_util:cast(?wxGridCellNumberEditor_SetParameters, diff --git a/lib/wx/src/gen/wxGridCellTextEditor.erl b/lib/wx/src/gen/wxGridCellTextEditor.erl index 4ddb4a7028..39adda5d8b 100644 --- a/lib/wx/src/gen/wxGridCellTextEditor.erl +++ b/lib/wx/src/gen/wxGridCellTextEditor.erl @@ -52,7 +52,7 @@ new() -> -spec setParameters(This, Params) -> 'ok' when This::wxGridCellTextEditor(), Params::unicode:chardata(). setParameters(#wx_ref{type=ThisT,ref=ThisRef},Params) - when is_list(Params) -> + when ?is_chardata(Params) -> ?CLASS(ThisT,wxGridCellTextEditor), Params_UC = unicode:characters_to_binary([Params,0]), wxe_util:cast(?wxGridCellTextEditor_SetParameters, diff --git a/lib/wx/src/gen/wxHtmlEasyPrinting.erl b/lib/wx/src/gen/wxHtmlEasyPrinting.erl index a2cf46ed8d..dfb9dcfa1c 100644 --- a/lib/wx/src/gen/wxHtmlEasyPrinting.erl +++ b/lib/wx/src/gen/wxHtmlEasyPrinting.erl @@ -77,7 +77,7 @@ getPageSetupData(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec previewFile(This, Htmlfile) -> boolean() when This::wxHtmlEasyPrinting(), Htmlfile::unicode:chardata(). previewFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile) - when is_list(Htmlfile) -> + when ?is_chardata(Htmlfile) -> ?CLASS(ThisT,wxHtmlEasyPrinting), Htmlfile_UC = unicode:characters_to_binary([Htmlfile,0]), wxe_util:call(?wxHtmlEasyPrinting_PreviewFile, @@ -88,7 +88,7 @@ previewFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile) This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata(). previewText(This,Htmltext) - when is_record(This, wx_ref),is_list(Htmltext) -> + when is_record(This, wx_ref),?is_chardata(Htmltext) -> previewText(This,Htmltext, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingpreviewtext">external documentation</a>. @@ -96,7 +96,7 @@ previewText(This,Htmltext) This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata(), Option :: {'basepath', unicode:chardata()}. previewText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options) - when is_list(Htmltext),is_list(Options) -> + when ?is_chardata(Htmltext),is_list(Options) -> ?CLASS(ThisT,wxHtmlEasyPrinting), Htmltext_UC = unicode:characters_to_binary([Htmltext,0]), MOpts = fun({basepath, Basepath}, Acc) -> Basepath_UC = unicode:characters_to_binary([Basepath,0]),[<<1:32/?UI,(byte_size(Basepath_UC)):32/?UI,(Basepath_UC)/binary, 0:(((8- ((0+byte_size(Basepath_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -109,7 +109,7 @@ previewText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options) -spec printFile(This, Htmlfile) -> boolean() when This::wxHtmlEasyPrinting(), Htmlfile::unicode:chardata(). printFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile) - when is_list(Htmlfile) -> + when ?is_chardata(Htmlfile) -> ?CLASS(ThisT,wxHtmlEasyPrinting), Htmlfile_UC = unicode:characters_to_binary([Htmlfile,0]), wxe_util:call(?wxHtmlEasyPrinting_PrintFile, @@ -120,7 +120,7 @@ printFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile) This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata(). printText(This,Htmltext) - when is_record(This, wx_ref),is_list(Htmltext) -> + when is_record(This, wx_ref),?is_chardata(Htmltext) -> printText(This,Htmltext, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingprinttext">external documentation</a>. @@ -128,7 +128,7 @@ printText(This,Htmltext) This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata(), Option :: {'basepath', unicode:chardata()}. printText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options) - when is_list(Htmltext),is_list(Options) -> + when ?is_chardata(Htmltext),is_list(Options) -> ?CLASS(ThisT,wxHtmlEasyPrinting), Htmltext_UC = unicode:characters_to_binary([Htmltext,0]), MOpts = fun({basepath, Basepath}, Acc) -> Basepath_UC = unicode:characters_to_binary([Basepath,0]),[<<1:32/?UI,(byte_size(Basepath_UC)):32/?UI,(Basepath_UC)/binary, 0:(((8- ((0+byte_size(Basepath_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -150,7 +150,7 @@ pageSetup(#wx_ref{type=ThisT,ref=ThisRef}) -> This::wxHtmlEasyPrinting(), Normal_face::unicode:chardata(), Fixed_face::unicode:chardata(). setFonts(This,Normal_face,Fixed_face) - when is_record(This, wx_ref),is_list(Normal_face),is_list(Fixed_face) -> + when is_record(This, wx_ref),?is_chardata(Normal_face),?is_chardata(Fixed_face) -> setFonts(This,Normal_face,Fixed_face, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetfonts">external documentation</a>. @@ -158,7 +158,7 @@ setFonts(This,Normal_face,Fixed_face) This::wxHtmlEasyPrinting(), Normal_face::unicode:chardata(), Fixed_face::unicode:chardata(), Option :: {'sizes', [integer()]}. setFonts(#wx_ref{type=ThisT,ref=ThisRef},Normal_face,Fixed_face, Options) - when is_list(Normal_face),is_list(Fixed_face),is_list(Options) -> + when ?is_chardata(Normal_face),?is_chardata(Fixed_face),is_list(Options) -> ?CLASS(ThisT,wxHtmlEasyPrinting), Normal_face_UC = unicode:characters_to_binary([Normal_face,0]), Fixed_face_UC = unicode:characters_to_binary([Fixed_face,0]), @@ -174,7 +174,7 @@ setFonts(#wx_ref{type=ThisT,ref=ThisRef},Normal_face,Fixed_face, Options) This::wxHtmlEasyPrinting(), Header::unicode:chardata(). setHeader(This,Header) - when is_record(This, wx_ref),is_list(Header) -> + when is_record(This, wx_ref),?is_chardata(Header) -> setHeader(This,Header, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetheader">external documentation</a>. @@ -182,7 +182,7 @@ setHeader(This,Header) This::wxHtmlEasyPrinting(), Header::unicode:chardata(), Option :: {'pg', integer()}. setHeader(#wx_ref{type=ThisT,ref=ThisRef},Header, Options) - when is_list(Header),is_list(Options) -> + when ?is_chardata(Header),is_list(Options) -> ?CLASS(ThisT,wxHtmlEasyPrinting), Header_UC = unicode:characters_to_binary([Header,0]), MOpts = fun({pg, Pg}, Acc) -> [<<1:32/?UI,Pg:32/?UI>>|Acc]; @@ -196,7 +196,7 @@ setHeader(#wx_ref{type=ThisT,ref=ThisRef},Header, Options) This::wxHtmlEasyPrinting(), Footer::unicode:chardata(). setFooter(This,Footer) - when is_record(This, wx_ref),is_list(Footer) -> + when is_record(This, wx_ref),?is_chardata(Footer) -> setFooter(This,Footer, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetfooter">external documentation</a>. @@ -204,7 +204,7 @@ setFooter(This,Footer) This::wxHtmlEasyPrinting(), Footer::unicode:chardata(), Option :: {'pg', integer()}. setFooter(#wx_ref{type=ThisT,ref=ThisRef},Footer, Options) - when is_list(Footer),is_list(Options) -> + when ?is_chardata(Footer),is_list(Options) -> ?CLASS(ThisT,wxHtmlEasyPrinting), Footer_UC = unicode:characters_to_binary([Footer,0]), MOpts = fun({pg, Pg}, Acc) -> [<<1:32/?UI,Pg:32/?UI>>|Acc]; diff --git a/lib/wx/src/gen/wxHtmlWindow.erl b/lib/wx/src/gen/wxHtmlWindow.erl index 8bc317ad73..c8a3ed5188 100644 --- a/lib/wx/src/gen/wxHtmlWindow.erl +++ b/lib/wx/src/gen/wxHtmlWindow.erl @@ -127,7 +127,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options) -spec appendToPage(This, Source) -> boolean() when This::wxHtmlWindow(), Source::unicode:chardata(). appendToPage(#wx_ref{type=ThisT,ref=ThisRef},Source) - when is_list(Source) -> + when ?is_chardata(Source) -> ?CLASS(ThisT,wxHtmlWindow), Source_UC = unicode:characters_to_binary([Source,0]), wxe_util:call(?wxHtmlWindow_AppendToPage, @@ -209,7 +209,7 @@ historyForward(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec loadFile(This, Filename) -> boolean() when This::wxHtmlWindow(), Filename::unicode:chardata(). loadFile(#wx_ref{type=ThisT,ref=ThisRef},Filename) - when is_list(Filename) -> + when ?is_chardata(Filename) -> ?CLASS(ThisT,wxHtmlWindow), Filename_UC = unicode:characters_to_binary([Filename,0]), wxe_util:call(?wxHtmlWindow_LoadFile, @@ -219,7 +219,7 @@ loadFile(#wx_ref{type=ThisT,ref=ThisRef},Filename) -spec loadPage(This, Location) -> boolean() when This::wxHtmlWindow(), Location::unicode:chardata(). loadPage(#wx_ref{type=ThisT,ref=ThisRef},Location) - when is_list(Location) -> + when ?is_chardata(Location) -> ?CLASS(ThisT,wxHtmlWindow), Location_UC = unicode:characters_to_binary([Location,0]), wxe_util:call(?wxHtmlWindow_LoadPage, @@ -273,7 +273,7 @@ setBorders(#wx_ref{type=ThisT,ref=ThisRef},B) This::wxHtmlWindow(), Normal_face::unicode:chardata(), Fixed_face::unicode:chardata(). setFonts(This,Normal_face,Fixed_face) - when is_record(This, wx_ref),is_list(Normal_face),is_list(Fixed_face) -> + when is_record(This, wx_ref),?is_chardata(Normal_face),?is_chardata(Fixed_face) -> setFonts(This,Normal_face,Fixed_face, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmlwindow.html#wxhtmlwindowsetfonts">external documentation</a>. @@ -281,7 +281,7 @@ setFonts(This,Normal_face,Fixed_face) This::wxHtmlWindow(), Normal_face::unicode:chardata(), Fixed_face::unicode:chardata(), Option :: {'sizes', integer()}. setFonts(#wx_ref{type=ThisT,ref=ThisRef},Normal_face,Fixed_face, Options) - when is_list(Normal_face),is_list(Fixed_face),is_list(Options) -> + when ?is_chardata(Normal_face),?is_chardata(Fixed_face),is_list(Options) -> ?CLASS(ThisT,wxHtmlWindow), Normal_face_UC = unicode:characters_to_binary([Normal_face,0]), Fixed_face_UC = unicode:characters_to_binary([Fixed_face,0]), @@ -295,7 +295,7 @@ setFonts(#wx_ref{type=ThisT,ref=ThisRef},Normal_face,Fixed_face, Options) -spec setPage(This, Source) -> boolean() when This::wxHtmlWindow(), Source::unicode:chardata(). setPage(#wx_ref{type=ThisT,ref=ThisRef},Source) - when is_list(Source) -> + when ?is_chardata(Source) -> ?CLASS(ThisT,wxHtmlWindow), Source_UC = unicode:characters_to_binary([Source,0]), wxe_util:call(?wxHtmlWindow_SetPage, @@ -305,7 +305,7 @@ setPage(#wx_ref{type=ThisT,ref=ThisRef},Source) -spec setRelatedFrame(This, Frame, Format) -> 'ok' when This::wxHtmlWindow(), Frame::wxFrame:wxFrame(), Format::unicode:chardata(). setRelatedFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef},Format) - when is_list(Format) -> + when ?is_chardata(Format) -> ?CLASS(ThisT,wxHtmlWindow), ?CLASS(FrameT,wxFrame), Format_UC = unicode:characters_to_binary([Format,0]), diff --git a/lib/wx/src/gen/wxIcon.erl b/lib/wx/src/gen/wxIcon.erl index c9ec32dffc..9739a403ff 100644 --- a/lib/wx/src/gen/wxIcon.erl +++ b/lib/wx/src/gen/wxIcon.erl @@ -60,7 +60,7 @@ new() -> Loc::wx:wx_object(). new(Filename) - when is_list(Filename) -> + when ?is_chardata(Filename) -> new(Filename, []); new(#wx_ref{type=LocT,ref=LocRef}) -> ?CLASS(LocT,wx), @@ -75,7 +75,7 @@ new(#wx_ref{type=LocT,ref=LocRef}) -> | {'desiredWidth', integer()} | {'desiredHeight', integer()}. new(Filename, Options) - when is_list(Filename),is_list(Options) -> + when ?is_chardata(Filename),is_list(Options) -> Filename_UC = unicode:characters_to_binary([Filename,0]), MOpts = fun({type, Type}, Acc) -> [<<1:32/?UI,Type:32/?UI>>|Acc]; ({desiredWidth, DesiredWidth}, Acc) -> [<<2:32/?UI,DesiredWidth:32/?UI>>|Acc]; diff --git a/lib/wx/src/gen/wxIconBundle.erl b/lib/wx/src/gen/wxIconBundle.erl index 47785963e3..aecf382a9f 100644 --- a/lib/wx/src/gen/wxIconBundle.erl +++ b/lib/wx/src/gen/wxIconBundle.erl @@ -58,7 +58,7 @@ new(#wx_ref{type=IcT,ref=IcRef}) -> -spec new(File, Type) -> wxIconBundle() when File::unicode:chardata(), Type::integer(). new(File,Type) - when is_list(File),is_integer(Type) -> + when ?is_chardata(File),is_integer(Type) -> File_UC = unicode:characters_to_binary([File,0]), wxe_util:construct(?wxIconBundle_new_2, <<(byte_size(File_UC)):32/?UI,(File_UC)/binary, 0:(((8- ((4+byte_size(File_UC)) band 16#7)) band 16#7))/unit:8,Type:32/?UI>>). @@ -76,7 +76,7 @@ addIcon(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=IconT,ref=IconRef}) -> -spec addIcon(This, File, Type) -> 'ok' when This::wxIconBundle(), File::unicode:chardata(), Type::integer(). addIcon(#wx_ref{type=ThisT,ref=ThisRef},File,Type) - when is_list(File),is_integer(Type) -> + when ?is_chardata(File),is_integer(Type) -> ?CLASS(ThisT,wxIconBundle), File_UC = unicode:characters_to_binary([File,0]), wxe_util:cast(?wxIconBundle_AddIcon_2, diff --git a/lib/wx/src/gen/wxImage.erl b/lib/wx/src/gen/wxImage.erl index e82f3d609e..f3b3d393d1 100644 --- a/lib/wx/src/gen/wxImage.erl +++ b/lib/wx/src/gen/wxImage.erl @@ -64,7 +64,7 @@ new() -> Name::unicode:chardata(). new(Name) - when is_list(Name) -> + when ?is_chardata(Name) -> new(Name, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wximage.html#wximagewximage">external documentation</a>. @@ -85,7 +85,7 @@ new(Width,Height) when is_integer(Width),is_integer(Height) -> new(Width,Height, []); new(Name, Options) - when is_list(Name),is_list(Options) -> + when ?is_chardata(Name),is_list(Options) -> Name_UC = unicode:characters_to_binary([Name,0]), MOpts = fun({type, Type}, Acc) -> [<<1:32/?UI,Type:32/?UI>>|Acc]; ({index, Index}, Acc) -> [<<2:32/?UI,Index:32/?UI>>|Acc]; @@ -123,7 +123,7 @@ new(Width,Height, Options) wxe_util:construct(?wxImage_new_3_0, <<Width:32/?UI,Height:32/?UI, BinOpt/binary>>); new(Name,Mimetype, Options) - when is_list(Name),is_list(Mimetype),is_list(Options) -> + when ?is_chardata(Name),?is_chardata(Mimetype),is_list(Options) -> Name_UC = unicode:characters_to_binary([Name,0]), Mimetype_UC = unicode:characters_to_binary([Mimetype,0]), MOpts = fun({index, Index}, Acc) -> [<<1:32/?UI,Index:32/?UI>>|Acc]; @@ -421,7 +421,7 @@ getGreen(#wx_ref{type=ThisT,ref=ThisRef},X,Y) Name::unicode:chardata(). getImageCount(Name) - when is_list(Name) -> + when ?is_chardata(Name) -> getImageCount(Name, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wximage.html#wximagegetimagecount">external documentation</a>. @@ -430,7 +430,7 @@ getImageCount(Name) Name::unicode:chardata(), Option :: {'type', wx:wx_enum()}. getImageCount(Name, Options) - when is_list(Name),is_list(Options) -> + when ?is_chardata(Name),is_list(Options) -> Name_UC = unicode:characters_to_binary([Name,0]), MOpts = fun({type, Type}, Acc) -> [<<1:32/?UI,Type:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, @@ -533,7 +533,7 @@ hasMask(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec getOption(This, Name) -> unicode:charlist() when This::wxImage(), Name::unicode:chardata(). getOption(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxImage), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxImage_GetOption, @@ -543,7 +543,7 @@ getOption(#wx_ref{type=ThisT,ref=ThisRef},Name) -spec getOptionInt(This, Name) -> integer() when This::wxImage(), Name::unicode:chardata(). getOptionInt(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxImage), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxImage_GetOptionInt, @@ -553,7 +553,7 @@ getOptionInt(#wx_ref{type=ThisT,ref=ThisRef},Name) -spec hasOption(This, Name) -> boolean() when This::wxImage(), Name::unicode:chardata(). hasOption(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxImage), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxImage_HasOption, @@ -599,7 +599,7 @@ isTransparent(#wx_ref{type=ThisT,ref=ThisRef},X,Y, Options) This::wxImage(), Name::unicode:chardata(). loadFile(This,Name) - when is_record(This, wx_ref),is_list(Name) -> + when is_record(This, wx_ref),?is_chardata(Name) -> loadFile(This,Name, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wximage.html#wximageloadfile">external documentation</a>. @@ -608,7 +608,7 @@ loadFile(This,Name) Option :: {'type', integer()} | {'index', integer()}. loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name, Options) - when is_list(Name),is_list(Options) -> + when ?is_chardata(Name),is_list(Options) -> ?CLASS(ThisT,wxImage), Name_UC = unicode:characters_to_binary([Name,0]), MOpts = fun({type, Type}, Acc) -> [<<1:32/?UI,Type:32/?UI>>|Acc]; @@ -623,7 +623,7 @@ loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name, Options) This::wxImage(), Name::unicode:chardata(), Mimetype::unicode:chardata(), Option :: {'index', integer()}. loadFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Mimetype, Options) - when is_list(Name),is_list(Mimetype),is_list(Options) -> + when ?is_chardata(Name),?is_chardata(Mimetype),is_list(Options) -> ?CLASS(ThisT,wxImage), Name_UC = unicode:characters_to_binary([Name,0]), Mimetype_UC = unicode:characters_to_binary([Mimetype,0]), @@ -645,7 +645,7 @@ ok(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec removeHandler(Name) -> boolean() when Name::unicode:chardata(). removeHandler(Name) - when is_list(Name) -> + when ?is_chardata(Name) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxImage_RemoveHandler, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>). @@ -784,7 +784,7 @@ rotate90(#wx_ref{type=ThisT,ref=ThisRef}, Options) -spec saveFile(This, Name) -> boolean() when This::wxImage(), Name::unicode:chardata(). saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxImage), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxImage_SaveFile_1, @@ -800,13 +800,13 @@ saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name) (This, Name, Mimetype) -> boolean() when This::wxImage(), Name::unicode:chardata(), Mimetype::unicode:chardata(). saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Type) - when is_list(Name),is_integer(Type) -> + when ?is_chardata(Name),is_integer(Type) -> ?CLASS(ThisT,wxImage), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxImage_SaveFile_2_0, <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,Type:32/?UI>>); saveFile(#wx_ref{type=ThisT,ref=ThisRef},Name,Mimetype) - when is_list(Name),is_list(Mimetype) -> + when ?is_chardata(Name),?is_chardata(Mimetype) -> ?CLASS(ThisT,wxImage), Name_UC = unicode:characters_to_binary([Name,0]), Mimetype_UC = unicode:characters_to_binary([Mimetype,0]), @@ -985,13 +985,13 @@ setMaskFromImage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MaskT,ref=MaskRef} (This, Name, Value) -> 'ok' when This::wxImage(), Name::unicode:chardata(), Value::unicode:chardata(). setOption(#wx_ref{type=ThisT,ref=ThisRef},Name,Value) - when is_list(Name),is_integer(Value) -> + when ?is_chardata(Name),is_integer(Value) -> ?CLASS(ThisT,wxImage), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:cast(?wxImage_SetOption_2_0, <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,Value:32/?UI>>); setOption(#wx_ref{type=ThisT,ref=ThisRef},Name,Value) - when is_list(Name),is_list(Value) -> + when ?is_chardata(Name),?is_chardata(Value) -> ?CLASS(ThisT,wxImage), Name_UC = unicode:characters_to_binary([Name,0]), Value_UC = unicode:characters_to_binary([Value,0]), diff --git a/lib/wx/src/gen/wxListBox.erl b/lib/wx/src/gen/wxListBox.erl index a11d81574b..e1c96f2501 100644 --- a/lib/wx/src/gen/wxListBox.erl +++ b/lib/wx/src/gen/wxListBox.erl @@ -220,7 +220,7 @@ setFirstItem(#wx_ref{type=ThisT,ref=ThisRef},N) wxe_util:cast(?wxListBox_SetFirstItem_1_0, <<ThisRef:32/?UI,N:32/?UI>>); setFirstItem(#wx_ref{type=ThisT,ref=ThisRef},S) - when is_list(S) -> + when ?is_chardata(S) -> ?CLASS(ThisT,wxListBox), S_UC = unicode:characters_to_binary([S,0]), wxe_util:cast(?wxListBox_SetFirstItem_1_1, diff --git a/lib/wx/src/gen/wxListCtrl.erl b/lib/wx/src/gen/wxListCtrl.erl index 47d83be3e2..0c2e9d0d0a 100644 --- a/lib/wx/src/gen/wxListCtrl.erl +++ b/lib/wx/src/gen/wxListCtrl.erl @@ -272,7 +272,7 @@ ensureVisible(#wx_ref{type=ThisT,ref=ThisRef},Item) This::wxListCtrl(), Start::integer(), Str::unicode:chardata(). findItem(This,Start,Str) - when is_record(This, wx_ref),is_integer(Start),is_list(Str) -> + when is_record(This, wx_ref),is_integer(Start),?is_chardata(Str) -> findItem(This,Start,Str, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxlistctrl.html#wxlistctrlfinditem">external documentation</a>. @@ -286,7 +286,7 @@ findItem(This,Start,Str) (This, Start, Pt, Direction) -> integer() when This::wxListCtrl(), Start::integer(), Pt::{X::integer(), Y::integer()}, Direction::integer(). findItem(#wx_ref{type=ThisT,ref=ThisRef},Start,Str, Options) - when is_integer(Start),is_list(Str),is_list(Options) -> + when is_integer(Start),?is_chardata(Str),is_list(Options) -> ?CLASS(ThisT,wxListCtrl), Str_UC = unicode:characters_to_binary([Str,0]), MOpts = fun({partial, Partial}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Partial)):32/?UI>>|Acc]; @@ -540,7 +540,7 @@ hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PointX,PointY}) This::wxListCtrl(), Col::integer(), Info::wxListItem:wxListItem(). insertColumn(This,Col,Heading) - when is_record(This, wx_ref),is_integer(Col),is_list(Heading) -> + when is_record(This, wx_ref),is_integer(Col),?is_chardata(Heading) -> insertColumn(This,Col,Heading, []); insertColumn(#wx_ref{type=ThisT,ref=ThisRef},Col,#wx_ref{type=InfoT,ref=InfoRef}) when is_integer(Col) -> @@ -555,7 +555,7 @@ insertColumn(#wx_ref{type=ThisT,ref=ThisRef},Col,#wx_ref{type=InfoT,ref=InfoRef} Option :: {'format', integer()} | {'width', integer()}. insertColumn(#wx_ref{type=ThisT,ref=ThisRef},Col,Heading, Options) - when is_integer(Col),is_list(Heading),is_list(Options) -> + when is_integer(Col),?is_chardata(Heading),is_list(Options) -> ?CLASS(ThisT,wxListCtrl), Heading_UC = unicode:characters_to_binary([Heading,0]), MOpts = fun({format, Format}, Acc) -> [<<1:32/?UI,Format:32/?UI>>|Acc]; @@ -589,7 +589,7 @@ insertItem(#wx_ref{type=ThisT,ref=ThisRef},Index,ImageIndex) wxe_util:call(?wxListCtrl_InsertItem_2_0, <<ThisRef:32/?UI,Index:32/?UI,ImageIndex:32/?UI>>); insertItem(#wx_ref{type=ThisT,ref=ThisRef},Index,Label) - when is_integer(Index),is_list(Label) -> + when is_integer(Index),?is_chardata(Label) -> ?CLASS(ThisT,wxListCtrl), Label_UC = unicode:characters_to_binary([Label,0]), wxe_util:call(?wxListCtrl_InsertItem_2_1, @@ -599,7 +599,7 @@ insertItem(#wx_ref{type=ThisT,ref=ThisRef},Index,Label) -spec insertItem(This, Index, Label, ImageIndex) -> integer() when This::wxListCtrl(), Index::integer(), Label::unicode:chardata(), ImageIndex::integer(). insertItem(#wx_ref{type=ThisT,ref=ThisRef},Index,Label,ImageIndex) - when is_integer(Index),is_list(Label),is_integer(ImageIndex) -> + when is_integer(Index),?is_chardata(Label),is_integer(ImageIndex) -> ?CLASS(ThisT,wxListCtrl), Label_UC = unicode:characters_to_binary([Label,0]), wxe_util:call(?wxListCtrl_InsertItem_3, @@ -684,7 +684,7 @@ setItem(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=InfoT,ref=InfoRef}) -> This::wxListCtrl(), Index::integer(), Col::integer(), Label::unicode:chardata(). setItem(This,Index,Col,Label) - when is_record(This, wx_ref),is_integer(Index),is_integer(Col),is_list(Label) -> + when is_record(This, wx_ref),is_integer(Index),is_integer(Col),?is_chardata(Label) -> setItem(This,Index,Col,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxlistctrl.html#wxlistctrlsetitem">external documentation</a>. @@ -692,7 +692,7 @@ setItem(This,Index,Col,Label) This::wxListCtrl(), Index::integer(), Col::integer(), Label::unicode:chardata(), Option :: {'imageId', integer()}. setItem(#wx_ref{type=ThisT,ref=ThisRef},Index,Col,Label, Options) - when is_integer(Index),is_integer(Col),is_list(Label),is_list(Options) -> + when is_integer(Index),is_integer(Col),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxListCtrl), Label_UC = unicode:characters_to_binary([Label,0]), MOpts = fun({imageId, ImageId}, Acc) -> [<<1:32/?UI,ImageId:32/?UI>>|Acc]; @@ -790,7 +790,7 @@ setItemState(#wx_ref{type=ThisT,ref=ThisRef},Item,State,StateMask) -spec setItemText(This, Item, Str) -> 'ok' when This::wxListCtrl(), Item::integer(), Str::unicode:chardata(). setItemText(#wx_ref{type=ThisT,ref=ThisRef},Item,Str) - when is_integer(Item),is_list(Str) -> + when is_integer(Item),?is_chardata(Str) -> ?CLASS(ThisT,wxListCtrl), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxListCtrl_SetItemText, diff --git a/lib/wx/src/gen/wxListItem.erl b/lib/wx/src/gen/wxListItem.erl index 1530a8c514..56a1719c55 100644 --- a/lib/wx/src/gen/wxListItem.erl +++ b/lib/wx/src/gen/wxListItem.erl @@ -236,7 +236,7 @@ setStateMask(#wx_ref{type=ThisT,ref=ThisRef},StateMask) -spec setText(This, Text) -> 'ok' when This::wxListItem(), Text::unicode:chardata(). setText(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxListItem), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxListItem_SetText, diff --git a/lib/wx/src/gen/wxListbook.erl b/lib/wx/src/gen/wxListbook.erl index f49360cb1d..d27efb2500 100644 --- a/lib/wx/src/gen/wxListbook.erl +++ b/lib/wx/src/gen/wxListbook.erl @@ -120,7 +120,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) This::wxListbook(), Page::wxWindow:wxWindow(), Text::unicode:chardata(). addPage(This,Page,Text) - when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),is_record(Page, wx_ref),?is_chardata(Text) -> addPage(This,Page,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxlistbook.html#wxlistbookaddpage">external documentation</a>. @@ -129,7 +129,7 @@ addPage(This,Page,Text) Option :: {'bSelect', boolean()} | {'imageId', integer()}. addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Options) - when is_list(Text),is_list(Options) -> + when ?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxListbook), ?CLASS(PageT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), @@ -296,7 +296,7 @@ hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY}) This::wxListbook(), N::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata(). insertPage(This,N,Page,Text) - when is_record(This, wx_ref),is_integer(N),is_record(Page, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),is_integer(N),is_record(Page, wx_ref),?is_chardata(Text) -> insertPage(This,N,Page,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxlistbook.html#wxlistbookinsertpage">external documentation</a>. @@ -305,7 +305,7 @@ insertPage(This,N,Page,Text) Option :: {'bSelect', boolean()} | {'imageId', integer()}. insertPage(#wx_ref{type=ThisT,ref=ThisRef},N,#wx_ref{type=PageT,ref=PageRef},Text, Options) - when is_integer(N),is_list(Text),is_list(Options) -> + when is_integer(N),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxListbook), ?CLASS(PageT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), @@ -347,7 +347,7 @@ setPageImage(#wx_ref{type=ThisT,ref=ThisRef},N,ImageId) -spec setPageText(This, N, StrText) -> boolean() when This::wxListbook(), N::integer(), StrText::unicode:chardata(). setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText) - when is_integer(N),is_list(StrText) -> + when is_integer(N),?is_chardata(StrText) -> ?CLASS(ThisT,wxListbook), StrText_UC = unicode:characters_to_binary([StrText,0]), wxe_util:call(?wxListbook_SetPageText, diff --git a/lib/wx/src/gen/wxLocale.erl b/lib/wx/src/gen/wxLocale.erl index d473731bf8..1ce7c3e3e8 100644 --- a/lib/wx/src/gen/wxLocale.erl +++ b/lib/wx/src/gen/wxLocale.erl @@ -92,7 +92,7 @@ init(#wx_ref{type=ThisT,ref=ThisRef}, Options) -spec addCatalog(This, SzDomain) -> boolean() when This::wxLocale(), SzDomain::unicode:chardata(). addCatalog(#wx_ref{type=ThisT,ref=ThisRef},SzDomain) - when is_list(SzDomain) -> + when ?is_chardata(SzDomain) -> ?CLASS(ThisT,wxLocale), SzDomain_UC = unicode:characters_to_binary([SzDomain,0]), wxe_util:call(?wxLocale_AddCatalog_1, @@ -103,7 +103,7 @@ addCatalog(#wx_ref{type=ThisT,ref=ThisRef},SzDomain) -spec addCatalog(This, SzDomain, MsgIdLanguage, MsgIdCharset) -> boolean() when This::wxLocale(), SzDomain::unicode:chardata(), MsgIdLanguage::wx:wx_enum(), MsgIdCharset::unicode:chardata(). addCatalog(#wx_ref{type=ThisT,ref=ThisRef},SzDomain,MsgIdLanguage,MsgIdCharset) - when is_list(SzDomain),is_integer(MsgIdLanguage),is_list(MsgIdCharset) -> + when ?is_chardata(SzDomain),is_integer(MsgIdLanguage),?is_chardata(MsgIdCharset) -> ?CLASS(ThisT,wxLocale), SzDomain_UC = unicode:characters_to_binary([SzDomain,0]), MsgIdCharset_UC = unicode:characters_to_binary([MsgIdCharset,0]), @@ -114,7 +114,7 @@ addCatalog(#wx_ref{type=ThisT,ref=ThisRef},SzDomain,MsgIdLanguage,MsgIdCharset) -spec addCatalogLookupPathPrefix(Prefix) -> 'ok' when Prefix::unicode:chardata(). addCatalogLookupPathPrefix(Prefix) - when is_list(Prefix) -> + when ?is_chardata(Prefix) -> Prefix_UC = unicode:characters_to_binary([Prefix,0]), wxe_util:cast(?wxLocale_AddCatalogLookupPathPrefix, <<(byte_size(Prefix_UC)):32/?UI,(Prefix_UC)/binary, 0:(((8- ((4+byte_size(Prefix_UC)) band 16#7)) band 16#7))/unit:8>>). @@ -164,7 +164,7 @@ getName(#wx_ref{type=ThisT,ref=ThisRef}) -> This::wxLocale(), SzOrigString::unicode:chardata(). getString(This,SzOrigString) - when is_record(This, wx_ref),is_list(SzOrigString) -> + when is_record(This, wx_ref),?is_chardata(SzOrigString) -> getString(This,SzOrigString, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxlocale.html#wxlocalegetstring">external documentation</a>. @@ -172,7 +172,7 @@ getString(This,SzOrigString) This::wxLocale(), SzOrigString::unicode:chardata(), Option :: {'szDomain', unicode:chardata()}. getString(#wx_ref{type=ThisT,ref=ThisRef},SzOrigString, Options) - when is_list(SzOrigString),is_list(Options) -> + when ?is_chardata(SzOrigString),is_list(Options) -> ?CLASS(ThisT,wxLocale), SzOrigString_UC = unicode:characters_to_binary([SzOrigString,0]), MOpts = fun({szDomain, SzDomain}, Acc) -> SzDomain_UC = unicode:characters_to_binary([SzDomain,0]),[<<1:32/?UI,(byte_size(SzDomain_UC)):32/?UI,(SzDomain_UC)/binary, 0:(((8- ((0+byte_size(SzDomain_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -186,7 +186,7 @@ getString(#wx_ref{type=ThisT,ref=ThisRef},SzOrigString, Options) This::wxLocale(), SzOrigString::unicode:chardata(), SzOrigString2::unicode:chardata(), N::integer(). getString(This,SzOrigString,SzOrigString2,N) - when is_record(This, wx_ref),is_list(SzOrigString),is_list(SzOrigString2),is_integer(N) -> + when is_record(This, wx_ref),?is_chardata(SzOrigString),?is_chardata(SzOrigString2),is_integer(N) -> getString(This,SzOrigString,SzOrigString2,N, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxlocale.html#wxlocalegetstring">external documentation</a>. @@ -194,7 +194,7 @@ getString(This,SzOrigString,SzOrigString2,N) This::wxLocale(), SzOrigString::unicode:chardata(), SzOrigString2::unicode:chardata(), N::integer(), Option :: {'szDomain', unicode:chardata()}. getString(#wx_ref{type=ThisT,ref=ThisRef},SzOrigString,SzOrigString2,N, Options) - when is_list(SzOrigString),is_list(SzOrigString2),is_integer(N),is_list(Options) -> + when ?is_chardata(SzOrigString),?is_chardata(SzOrigString2),is_integer(N),is_list(Options) -> ?CLASS(ThisT,wxLocale), SzOrigString_UC = unicode:characters_to_binary([SzOrigString,0]), SzOrigString2_UC = unicode:characters_to_binary([SzOrigString2,0]), @@ -209,7 +209,7 @@ getString(#wx_ref{type=ThisT,ref=ThisRef},SzOrigString,SzOrigString2,N, Options) This::wxLocale(), SzHeader::unicode:chardata(). getHeaderValue(This,SzHeader) - when is_record(This, wx_ref),is_list(SzHeader) -> + when is_record(This, wx_ref),?is_chardata(SzHeader) -> getHeaderValue(This,SzHeader, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxlocale.html#wxlocalegetheadervalue">external documentation</a>. @@ -217,7 +217,7 @@ getHeaderValue(This,SzHeader) This::wxLocale(), SzHeader::unicode:chardata(), Option :: {'szDomain', unicode:chardata()}. getHeaderValue(#wx_ref{type=ThisT,ref=ThisRef},SzHeader, Options) - when is_list(SzHeader),is_list(Options) -> + when ?is_chardata(SzHeader),is_list(Options) -> ?CLASS(ThisT,wxLocale), SzHeader_UC = unicode:characters_to_binary([SzHeader,0]), MOpts = fun({szDomain, SzDomain}, Acc) -> SzDomain_UC = unicode:characters_to_binary([SzDomain,0]),[<<1:32/?UI,(byte_size(SzDomain_UC)):32/?UI,(SzDomain_UC)/binary, 0:(((8- ((0+byte_size(SzDomain_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -257,7 +257,7 @@ getSystemLanguage() -> -spec isLoaded(This, SzDomain) -> boolean() when This::wxLocale(), SzDomain::unicode:chardata(). isLoaded(#wx_ref{type=ThisT,ref=ThisRef},SzDomain) - when is_list(SzDomain) -> + when ?is_chardata(SzDomain) -> ?CLASS(ThisT,wxLocale), SzDomain_UC = unicode:characters_to_binary([SzDomain,0]), wxe_util:call(?wxLocale_IsLoaded, diff --git a/lib/wx/src/gen/wxMDIChildFrame.erl b/lib/wx/src/gen/wxMDIChildFrame.erl index 114c37d830..6ff47259b4 100644 --- a/lib/wx/src/gen/wxMDIChildFrame.erl +++ b/lib/wx/src/gen/wxMDIChildFrame.erl @@ -102,7 +102,7 @@ new() -> Parent::wxMDIParentFrame:wxMDIParentFrame(), Id::integer(), Title::unicode:chardata(). new(Parent,Id,Title) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Title) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title) -> new(Parent,Id,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmdichildframe.html#wxmdichildframewxmdichildframe">external documentation</a>. @@ -112,7 +112,7 @@ new(Parent,Id,Title) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) - when is_integer(Id),is_list(Title),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_list(Options) -> ?CLASS(ParentT,wxMDIParentFrame), Title_UC = unicode:characters_to_binary([Title,0]), MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc]; @@ -136,7 +136,7 @@ activate(#wx_ref{type=ThisT,ref=ThisRef}) -> This::wxMDIChildFrame(), Parent::wxMDIParentFrame:wxMDIParentFrame(), Id::integer(), Title::unicode:chardata(). create(This,Parent,Id,Title) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title) -> create(This,Parent,Id,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmdichildframe.html#wxmdichildframecreate">external documentation</a>. @@ -146,7 +146,7 @@ create(This,Parent,Id,Title) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) - when is_integer(Id),is_list(Title),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_list(Options) -> ?CLASS(ThisT,wxMDIChildFrame), ?CLASS(ParentT,wxMDIParentFrame), Title_UC = unicode:characters_to_binary([Title,0]), diff --git a/lib/wx/src/gen/wxMDIParentFrame.erl b/lib/wx/src/gen/wxMDIParentFrame.erl index d071e05d1b..f4d06a2658 100644 --- a/lib/wx/src/gen/wxMDIParentFrame.erl +++ b/lib/wx/src/gen/wxMDIParentFrame.erl @@ -103,7 +103,7 @@ new() -> Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(). new(Parent,Id,Title) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Title) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title) -> new(Parent,Id,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmdiparentframe.html#wxmdiparentframewxmdiparentframe">external documentation</a>. @@ -113,7 +113,7 @@ new(Parent,Id,Title) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) - when is_integer(Id),is_list(Title),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_list(Options) -> ?CLASS(ParentT,wxWindow), Title_UC = unicode:characters_to_binary([Title,0]), MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc]; @@ -161,7 +161,7 @@ cascade(#wx_ref{type=ThisT,ref=ThisRef}) -> This::wxMDIParentFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(). create(This,Parent,Id,Title) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title) -> create(This,Parent,Id,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmdiparentframe.html#wxmdiparentframecreate">external documentation</a>. @@ -171,7 +171,7 @@ create(This,Parent,Id,Title) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) - when is_integer(Id),is_list(Title),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_list(Options) -> ?CLASS(ThisT,wxMDIParentFrame), ?CLASS(ParentT,wxWindow), Title_UC = unicode:characters_to_binary([Title,0]), diff --git a/lib/wx/src/gen/wxMenu.erl b/lib/wx/src/gen/wxMenu.erl index 317ea38685..26fe23701d 100644 --- a/lib/wx/src/gen/wxMenu.erl +++ b/lib/wx/src/gen/wxMenu.erl @@ -69,7 +69,7 @@ new(Options) Title::unicode:chardata(), Option :: {'style', integer()}. new(Title, Options) - when is_list(Title),is_list(Options) -> + when ?is_chardata(Title),is_list(Options) -> Title_UC = unicode:characters_to_binary([Title,0]), MOpts = fun({style, Style}, Acc) -> [<<1:32/?UI,Style:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, @@ -91,7 +91,7 @@ append(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) -> This::wxMenu(), Itemid::integer(), Text::unicode:chardata(). append(This,Itemid,Text) - when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Itemid),?is_chardata(Text) -> append(This,Itemid,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmenu.html#wxmenuappend">external documentation</a>. @@ -110,10 +110,10 @@ append(This,Itemid,Text) | {'kind', wx:wx_enum()}. append(This,Itemid,Text,Submenu) - when is_record(This, wx_ref),is_integer(Itemid),is_list(Text),is_record(Submenu, wx_ref) -> + when is_record(This, wx_ref),is_integer(Itemid),?is_chardata(Text),is_record(Submenu, wx_ref) -> append(This,Itemid,Text,Submenu, []); append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options) - when is_integer(Itemid),is_list(Text),is_list(Options) -> + when is_integer(Itemid),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -135,14 +135,14 @@ append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options) This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(), Option :: {'help', unicode:chardata()}. append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,Help,IsCheckable) - when is_integer(Itemid),is_list(Text),is_list(Help),is_boolean(IsCheckable) -> + when is_integer(Itemid),?is_chardata(Text),?is_chardata(Help),is_boolean(IsCheckable) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), Help_UC = unicode:characters_to_binary([Help,0]), wxe_util:cast(?wxMenu_Append_4_0, <<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((4+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8,(wxe_util:from_bool(IsCheckable)):32/?UI>>); append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,#wx_ref{type=SubmenuT,ref=SubmenuRef}, Options) - when is_integer(Itemid),is_list(Text),is_list(Options) -> + when is_integer(Itemid),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), ?CLASS(SubmenuT,wxMenu), @@ -157,7 +157,7 @@ append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,#wx_ref{type=SubmenuT,ref=Sub This::wxMenu(), Itemid::integer(), Text::unicode:chardata(). appendCheckItem(This,Itemid,Text) - when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Itemid),?is_chardata(Text) -> appendCheckItem(This,Itemid,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmenu.html#wxmenuappendcheckitem">external documentation</a>. @@ -165,7 +165,7 @@ appendCheckItem(This,Itemid,Text) This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Option :: {'help', unicode:chardata()}. appendCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options) - when is_integer(Itemid),is_list(Text),is_list(Options) -> + when is_integer(Itemid),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -179,7 +179,7 @@ appendCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options) This::wxMenu(), Itemid::integer(), Text::unicode:chardata(). appendRadioItem(This,Itemid,Text) - when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Itemid),?is_chardata(Text) -> appendRadioItem(This,Itemid,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmenu.html#wxmenuappendradioitem">external documentation</a>. @@ -187,7 +187,7 @@ appendRadioItem(This,Itemid,Text) This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Option :: {'help', unicode:chardata()}. appendRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options) - when is_integer(Itemid),is_list(Text),is_list(Options) -> + when is_integer(Itemid),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -285,7 +285,7 @@ findItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid) wxe_util:call(?wxMenu_FindItem_2, <<ThisRef:32/?UI,Itemid:32/?UI>>); findItem(#wx_ref{type=ThisT,ref=ThisRef},Item) - when is_list(Item) -> + when ?is_chardata(Item) -> ?CLASS(ThisT,wxMenu), Item_UC = unicode:characters_to_binary([Item,0]), wxe_util:call(?wxMenu_FindItem_1, @@ -386,7 +386,7 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid, Options) This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(). insert(This,Pos,Itemid,Text,Submenu) - when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),is_list(Text),is_record(Submenu, wx_ref) -> + when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),?is_chardata(Text),is_record(Submenu, wx_ref) -> insert(This,Pos,Itemid,Text,Submenu, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmenu.html#wxmenuinsert">external documentation</a>. @@ -401,14 +401,14 @@ insert(This,Pos,Itemid,Text,Submenu) This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(), Option :: {'help', unicode:chardata()}. insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text,Help,IsCheckable) - when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Help),is_boolean(IsCheckable) -> + when is_integer(Pos),is_integer(Itemid),?is_chardata(Text),?is_chardata(Help),is_boolean(IsCheckable) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), Help_UC = unicode:characters_to_binary([Help,0]), wxe_util:cast(?wxMenu_Insert_5_0, <<ThisRef:32/?UI,Pos:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((4+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8,(wxe_util:from_bool(IsCheckable)):32/?UI>>); insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text,#wx_ref{type=SubmenuT,ref=SubmenuRef}, Options) - when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Options) -> + when is_integer(Pos),is_integer(Itemid),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), ?CLASS(SubmenuT,wxMenu), @@ -423,7 +423,7 @@ insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text,#wx_ref{type=SubmenuT,ref This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(). insertCheckItem(This,Pos,Itemid,Text) - when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),?is_chardata(Text) -> insertCheckItem(This,Pos,Itemid,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmenu.html#wxmenuinsertcheckitem">external documentation</a>. @@ -431,7 +431,7 @@ insertCheckItem(This,Pos,Itemid,Text) This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(), Option :: {'help', unicode:chardata()}. insertCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text, Options) - when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Options) -> + when is_integer(Pos),is_integer(Itemid),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -445,7 +445,7 @@ insertCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text, Options) This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(). insertRadioItem(This,Pos,Itemid,Text) - when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),?is_chardata(Text) -> insertRadioItem(This,Pos,Itemid,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmenu.html#wxmenuinsertradioitem">external documentation</a>. @@ -453,7 +453,7 @@ insertRadioItem(This,Pos,Itemid,Text) This::wxMenu(), Pos::integer(), Itemid::integer(), Text::unicode:chardata(), Option :: {'help', unicode:chardata()}. insertRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text, Options) - when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Options) -> + when is_integer(Pos),is_integer(Itemid),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -532,7 +532,7 @@ prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid, Options) This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(). prepend(This,Itemid,Text,Submenu) - when is_record(This, wx_ref),is_integer(Itemid),is_list(Text),is_record(Submenu, wx_ref) -> + when is_record(This, wx_ref),is_integer(Itemid),?is_chardata(Text),is_record(Submenu, wx_ref) -> prepend(This,Itemid,Text,Submenu, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmenu.html#wxmenuprepend">external documentation</a>. @@ -547,14 +547,14 @@ prepend(This,Itemid,Text,Submenu) This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Submenu::wxMenu(), Option :: {'help', unicode:chardata()}. prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,Help,IsCheckable) - when is_integer(Itemid),is_list(Text),is_list(Help),is_boolean(IsCheckable) -> + when is_integer(Itemid),?is_chardata(Text),?is_chardata(Help),is_boolean(IsCheckable) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), Help_UC = unicode:characters_to_binary([Help,0]), wxe_util:cast(?wxMenu_Prepend_4_0, <<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((4+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8,(wxe_util:from_bool(IsCheckable)):32/?UI>>); prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,#wx_ref{type=SubmenuT,ref=SubmenuRef}, Options) - when is_integer(Itemid),is_list(Text),is_list(Options) -> + when is_integer(Itemid),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), ?CLASS(SubmenuT,wxMenu), @@ -569,7 +569,7 @@ prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,#wx_ref{type=SubmenuT,ref=Su This::wxMenu(), Itemid::integer(), Text::unicode:chardata(). prependCheckItem(This,Itemid,Text) - when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Itemid),?is_chardata(Text) -> prependCheckItem(This,Itemid,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmenu.html#wxmenuprependcheckitem">external documentation</a>. @@ -577,7 +577,7 @@ prependCheckItem(This,Itemid,Text) This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Option :: {'help', unicode:chardata()}. prependCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options) - when is_integer(Itemid),is_list(Text),is_list(Options) -> + when is_integer(Itemid),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -591,7 +591,7 @@ prependCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options) This::wxMenu(), Itemid::integer(), Text::unicode:chardata(). prependRadioItem(This,Itemid,Text) - when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Itemid),?is_chardata(Text) -> prependRadioItem(This,Itemid,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmenu.html#wxmenuprependradioitem">external documentation</a>. @@ -599,7 +599,7 @@ prependRadioItem(This,Itemid,Text) This::wxMenu(), Itemid::integer(), Text::unicode:chardata(), Option :: {'help', unicode:chardata()}. prependRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options) - when is_integer(Itemid),is_list(Text),is_list(Options) -> + when is_integer(Itemid),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxMenu), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -640,7 +640,7 @@ remove(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) -> -spec setHelpString(This, Itemid, HelpString) -> 'ok' when This::wxMenu(), Itemid::integer(), HelpString::unicode:chardata(). setHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid,HelpString) - when is_integer(Itemid),is_list(HelpString) -> + when is_integer(Itemid),?is_chardata(HelpString) -> ?CLASS(ThisT,wxMenu), HelpString_UC = unicode:characters_to_binary([HelpString,0]), wxe_util:cast(?wxMenu_SetHelpString, @@ -650,7 +650,7 @@ setHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid,HelpString) -spec setLabel(This, Itemid, Label) -> 'ok' when This::wxMenu(), Itemid::integer(), Label::unicode:chardata(). setLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Label) - when is_integer(Itemid),is_list(Label) -> + when is_integer(Itemid),?is_chardata(Label) -> ?CLASS(ThisT,wxMenu), Label_UC = unicode:characters_to_binary([Label,0]), wxe_util:cast(?wxMenu_SetLabel, @@ -660,7 +660,7 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Label) -spec setTitle(This, Title) -> 'ok' when This::wxMenu(), Title::unicode:chardata(). setTitle(#wx_ref{type=ThisT,ref=ThisRef},Title) - when is_list(Title) -> + when ?is_chardata(Title) -> ?CLASS(ThisT,wxMenu), Title_UC = unicode:characters_to_binary([Title,0]), wxe_util:cast(?wxMenu_SetTitle, diff --git a/lib/wx/src/gen/wxMenuBar.erl b/lib/wx/src/gen/wxMenuBar.erl index bb5e7c7752..bb976fd0ba 100644 --- a/lib/wx/src/gen/wxMenuBar.erl +++ b/lib/wx/src/gen/wxMenuBar.erl @@ -98,7 +98,7 @@ new(Style) -spec append(This, Menu, Title) -> boolean() when This::wxMenuBar(), Menu::wxMenu:wxMenu(), Title::unicode:chardata(). append(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef},Title) - when is_list(Title) -> + when ?is_chardata(Title) -> ?CLASS(ThisT,wxMenuBar), ?CLASS(MenuT,wxMenu), Title_UC = unicode:characters_to_binary([Title,0]), @@ -157,7 +157,7 @@ enableTop(#wx_ref{type=ThisT,ref=ThisRef},Pos,Flag) -spec findMenu(This, Title) -> integer() when This::wxMenuBar(), Title::unicode:chardata(). findMenu(#wx_ref{type=ThisT,ref=ThisRef},Title) - when is_list(Title) -> + when ?is_chardata(Title) -> ?CLASS(ThisT,wxMenuBar), Title_UC = unicode:characters_to_binary([Title,0]), wxe_util:call(?wxMenuBar_FindMenu, @@ -167,7 +167,7 @@ findMenu(#wx_ref{type=ThisT,ref=ThisRef},Title) -spec findMenuItem(This, MenuString, ItemString) -> integer() when This::wxMenuBar(), MenuString::unicode:chardata(), ItemString::unicode:chardata(). findMenuItem(#wx_ref{type=ThisT,ref=ThisRef},MenuString,ItemString) - when is_list(MenuString),is_list(ItemString) -> + when ?is_chardata(MenuString),?is_chardata(ItemString) -> ?CLASS(ThisT,wxMenuBar), MenuString_UC = unicode:characters_to_binary([MenuString,0]), ItemString_UC = unicode:characters_to_binary([ItemString,0]), @@ -239,7 +239,7 @@ getMenuCount(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec insert(This, Pos, Menu, Title) -> boolean() when This::wxMenuBar(), Pos::integer(), Menu::wxMenu:wxMenu(), Title::unicode:chardata(). insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=MenuT,ref=MenuRef},Title) - when is_integer(Pos),is_list(Title) -> + when is_integer(Pos),?is_chardata(Title) -> ?CLASS(ThisT,wxMenuBar), ?CLASS(MenuT,wxMenu), Title_UC = unicode:characters_to_binary([Title,0]), @@ -285,7 +285,7 @@ remove(#wx_ref{type=ThisT,ref=ThisRef},Pos) -spec replace(This, Pos, Menu, Title) -> wxMenu:wxMenu() when This::wxMenuBar(), Pos::integer(), Menu::wxMenu:wxMenu(), Title::unicode:chardata(). replace(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=MenuT,ref=MenuRef},Title) - when is_integer(Pos),is_list(Title) -> + when is_integer(Pos),?is_chardata(Title) -> ?CLASS(ThisT,wxMenuBar), ?CLASS(MenuT,wxMenu), Title_UC = unicode:characters_to_binary([Title,0]), @@ -296,7 +296,7 @@ replace(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=MenuT,ref=MenuRef},Titl -spec setHelpString(This, Itemid, HelpString) -> 'ok' when This::wxMenuBar(), Itemid::integer(), HelpString::unicode:chardata(). setHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid,HelpString) - when is_integer(Itemid),is_list(HelpString) -> + when is_integer(Itemid),?is_chardata(HelpString) -> ?CLASS(ThisT,wxMenuBar), HelpString_UC = unicode:characters_to_binary([HelpString,0]), wxe_util:cast(?wxMenuBar_SetHelpString, @@ -306,7 +306,7 @@ setHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid,HelpString) -spec setLabel(This, S) -> 'ok' when This::wxMenuBar(), S::unicode:chardata(). setLabel(#wx_ref{type=ThisT,ref=ThisRef},S) - when is_list(S) -> + when ?is_chardata(S) -> ?CLASS(ThisT,wxMenuBar), S_UC = unicode:characters_to_binary([S,0]), wxe_util:cast(?wxMenuBar_SetLabel_1, @@ -316,7 +316,7 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},S) -spec setLabel(This, Itemid, Label) -> 'ok' when This::wxMenuBar(), Itemid::integer(), Label::unicode:chardata(). setLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Label) - when is_integer(Itemid),is_list(Label) -> + when is_integer(Itemid),?is_chardata(Label) -> ?CLASS(ThisT,wxMenuBar), Label_UC = unicode:characters_to_binary([Label,0]), wxe_util:cast(?wxMenuBar_SetLabel_2, @@ -326,7 +326,7 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Label) -spec setLabelTop(This, Pos, Label) -> 'ok' when This::wxMenuBar(), Pos::integer(), Label::unicode:chardata(). setLabelTop(#wx_ref{type=ThisT,ref=ThisRef},Pos,Label) - when is_integer(Pos),is_list(Label) -> + when is_integer(Pos),?is_chardata(Label) -> ?CLASS(ThisT,wxMenuBar), Label_UC = unicode:characters_to_binary([Label,0]), wxe_util:cast(?wxMenuBar_SetLabelTop, diff --git a/lib/wx/src/gen/wxMenuItem.erl b/lib/wx/src/gen/wxMenuItem.erl index 324910d15d..2e0a1c756a 100644 --- a/lib/wx/src/gen/wxMenuItem.erl +++ b/lib/wx/src/gen/wxMenuItem.erl @@ -153,7 +153,7 @@ getLabel(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec getLabelFromText(Text) -> unicode:charlist() when Text::unicode:chardata(). getLabelFromText(Text) - when is_list(Text) -> + when ?is_chardata(Text) -> Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxMenuItem_GetLabelFromText, <<(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>). @@ -235,7 +235,7 @@ setBitmap(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef}) - -spec setHelp(This, Str) -> 'ok' when This::wxMenuItem(), Str::unicode:chardata(). setHelp(#wx_ref{type=ThisT,ref=ThisRef},Str) - when is_list(Str) -> + when ?is_chardata(Str) -> ?CLASS(ThisT,wxMenuItem), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxMenuItem_SetHelp, @@ -263,7 +263,7 @@ setSubMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}) -> -spec setText(This, Str) -> 'ok' when This::wxMenuItem(), Str::unicode:chardata(). setText(#wx_ref{type=ThisT,ref=ThisRef},Str) - when is_list(Str) -> + when ?is_chardata(Str) -> ?CLASS(ThisT,wxMenuItem), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxMenuItem_SetText, diff --git a/lib/wx/src/gen/wxMessageDialog.erl b/lib/wx/src/gen/wxMessageDialog.erl index 2694d07f5e..46a832198c 100644 --- a/lib/wx/src/gen/wxMessageDialog.erl +++ b/lib/wx/src/gen/wxMessageDialog.erl @@ -93,7 +93,7 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). Parent::wxWindow:wxWindow(), Message::unicode:chardata(). new(Parent,Message) - when is_record(Parent, wx_ref),is_list(Message) -> + when is_record(Parent, wx_ref),?is_chardata(Message) -> new(Parent,Message, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmessagedialog.html#wxmessagedialogwxmessagedialog">external documentation</a>. @@ -103,7 +103,7 @@ new(Parent,Message) | {'style', integer()} | {'pos', {X::integer(), Y::integer()}}. new(#wx_ref{type=ParentT,ref=ParentRef},Message, Options) - when is_list(Message),is_list(Options) -> + when ?is_chardata(Message),is_list(Options) -> ?CLASS(ParentT,wxWindow), Message_UC = unicode:characters_to_binary([Message,0]), MOpts = fun({caption, Caption}, Acc) -> Caption_UC = unicode:characters_to_binary([Caption,0]),[<<1:32/?UI,(byte_size(Caption_UC)):32/?UI,(Caption_UC)/binary, 0:(((8- ((0+byte_size(Caption_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; diff --git a/lib/wx/src/gen/wxMiniFrame.erl b/lib/wx/src/gen/wxMiniFrame.erl index 8b428a0980..a13ff18d9e 100644 --- a/lib/wx/src/gen/wxMiniFrame.erl +++ b/lib/wx/src/gen/wxMiniFrame.erl @@ -101,7 +101,7 @@ new() -> Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(). new(Parent,Id,Title) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Title) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title) -> new(Parent,Id,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxminiframe.html#wxminiframewxminiframe">external documentation</a>. @@ -111,7 +111,7 @@ new(Parent,Id,Title) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) - when is_integer(Id),is_list(Title),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_list(Options) -> ?CLASS(ParentT,wxWindow), Title_UC = unicode:characters_to_binary([Title,0]), MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc]; @@ -127,7 +127,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) This::wxMiniFrame(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(). create(This,Parent,Id,Title) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title) -> create(This,Parent,Id,Title, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxminiframe.html#wxminiframecreate">external documentation</a>. @@ -137,7 +137,7 @@ create(This,Parent,Id,Title) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title, Options) - when is_integer(Id),is_list(Title),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_list(Options) -> ?CLASS(ThisT,wxMiniFrame), ?CLASS(ParentT,wxWindow), Title_UC = unicode:characters_to_binary([Title,0]), diff --git a/lib/wx/src/gen/wxMultiChoiceDialog.erl b/lib/wx/src/gen/wxMultiChoiceDialog.erl index 1f67b9dfae..9b3129cf53 100644 --- a/lib/wx/src/gen/wxMultiChoiceDialog.erl +++ b/lib/wx/src/gen/wxMultiChoiceDialog.erl @@ -99,7 +99,7 @@ new() -> Parent::wxWindow:wxWindow(), Message::unicode:chardata(), Caption::unicode:chardata(), Choices::[unicode:chardata()]. new(Parent,Message,Caption,Choices) - when is_record(Parent, wx_ref),is_list(Message),is_list(Caption),is_list(Choices) -> + when is_record(Parent, wx_ref),?is_chardata(Message),?is_chardata(Caption),is_list(Choices) -> new(Parent,Message,Caption,Choices, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxmultichoicedialog.html#wxmultichoicedialogwxmultichoicedialog">external documentation</a>. @@ -108,7 +108,7 @@ new(Parent,Message,Caption,Choices) Option :: {'style', integer()} | {'pos', {X::integer(), Y::integer()}}. new(#wx_ref{type=ParentT,ref=ParentRef},Message,Caption,Choices, Options) - when is_list(Message),is_list(Caption),is_list(Choices),is_list(Options) -> + when ?is_chardata(Message),?is_chardata(Caption),is_list(Choices),is_list(Options) -> ?CLASS(ParentT,wxWindow), Message_UC = unicode:characters_to_binary([Message,0]), Caption_UC = unicode:characters_to_binary([Caption,0]), diff --git a/lib/wx/src/gen/wxNotebook.erl b/lib/wx/src/gen/wxNotebook.erl index 436c712d29..3a65cf54cd 100644 --- a/lib/wx/src/gen/wxNotebook.erl +++ b/lib/wx/src/gen/wxNotebook.erl @@ -120,7 +120,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Winid, Options) This::wxNotebook(), Page::wxWindow:wxWindow(), Text::unicode:chardata(). addPage(This,Page,Text) - when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),is_record(Page, wx_ref),?is_chardata(Text) -> addPage(This,Page,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotebook.html#wxnotebookaddpage">external documentation</a>. @@ -129,7 +129,7 @@ addPage(This,Page,Text) Option :: {'bSelect', boolean()} | {'imageId', integer()}. addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Options) - when is_list(Text),is_list(Options) -> + when ?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxNotebook), ?CLASS(PageT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), @@ -312,7 +312,7 @@ hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY}) This::wxNotebook(), Position::integer(), Win::wxWindow:wxWindow(), StrText::unicode:chardata(). insertPage(This,Position,Win,StrText) - when is_record(This, wx_ref),is_integer(Position),is_record(Win, wx_ref),is_list(StrText) -> + when is_record(This, wx_ref),is_integer(Position),is_record(Win, wx_ref),?is_chardata(StrText) -> insertPage(This,Position,Win,StrText, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotebook.html#wxnotebookinsertpage">external documentation</a>. @@ -321,7 +321,7 @@ insertPage(This,Position,Win,StrText) Option :: {'bSelect', boolean()} | {'imageId', integer()}. insertPage(#wx_ref{type=ThisT,ref=ThisRef},Position,#wx_ref{type=WinT,ref=WinRef},StrText, Options) - when is_integer(Position),is_list(StrText),is_list(Options) -> + when is_integer(Position),?is_chardata(StrText),is_list(Options) -> ?CLASS(ThisT,wxNotebook), ?CLASS(WinT,wxWindow), StrText_UC = unicode:characters_to_binary([StrText,0]), @@ -372,7 +372,7 @@ setPageImage(#wx_ref{type=ThisT,ref=ThisRef},NPage,NImage) -spec setPageText(This, NPage, StrText) -> boolean() when This::wxNotebook(), NPage::integer(), StrText::unicode:chardata(). setPageText(#wx_ref{type=ThisT,ref=ThisRef},NPage,StrText) - when is_integer(NPage),is_list(StrText) -> + when is_integer(NPage),?is_chardata(StrText) -> ?CLASS(ThisT,wxNotebook), StrText_UC = unicode:characters_to_binary([StrText,0]), wxe_util:call(?wxNotebook_SetPageText, diff --git a/lib/wx/src/gen/wxPasswordEntryDialog.erl b/lib/wx/src/gen/wxPasswordEntryDialog.erl index 2aebd9e69e..5913834bb8 100644 --- a/lib/wx/src/gen/wxPasswordEntryDialog.erl +++ b/lib/wx/src/gen/wxPasswordEntryDialog.erl @@ -95,7 +95,7 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). Parent::wxWindow:wxWindow(), Message::unicode:chardata(). new(Parent,Message) - when is_record(Parent, wx_ref),is_list(Message) -> + when is_record(Parent, wx_ref),?is_chardata(Message) -> new(Parent,Message, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxpasswordentrydialog.html#wxpasswordentrydialogwxpasswordentrydialog">external documentation</a>. @@ -106,7 +106,7 @@ new(Parent,Message) | {'style', integer()} | {'pos', {X::integer(), Y::integer()}}. new(#wx_ref{type=ParentT,ref=ParentRef},Message, Options) - when is_list(Message),is_list(Options) -> + when ?is_chardata(Message),is_list(Options) -> ?CLASS(ParentT,wxWindow), Message_UC = unicode:characters_to_binary([Message,0]), MOpts = fun({caption, Caption}, Acc) -> Caption_UC = unicode:characters_to_binary([Caption,0]),[<<1:32/?UI,(byte_size(Caption_UC)):32/?UI,(Caption_UC)/binary, 0:(((8- ((0+byte_size(Caption_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; diff --git a/lib/wx/src/gen/wxPrintData.erl b/lib/wx/src/gen/wxPrintData.erl index 6b6b678adf..b6815da90b 100644 --- a/lib/wx/src/gen/wxPrintData.erl +++ b/lib/wx/src/gen/wxPrintData.erl @@ -205,7 +205,7 @@ setPaperId(#wx_ref{type=ThisT,ref=ThisRef},SizeId) -spec setPrinterName(This, Name) -> 'ok' when This::wxPrintData(), Name::unicode:chardata(). setPrinterName(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxPrintData), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:cast(?wxPrintData_SetPrinterName, diff --git a/lib/wx/src/gen/wxPrinter.erl b/lib/wx/src/gen/wxPrinter.erl index b9fb1c07bd..bdca37b4a8 100644 --- a/lib/wx/src/gen/wxPrinter.erl +++ b/lib/wx/src/gen/wxPrinter.erl @@ -122,7 +122,7 @@ printDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}) -spec reportError(This, Parent, Printout, Message) -> 'ok' when This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout(), Message::unicode:chardata(). reportError(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=PrintoutT,ref=PrintoutRef},Message) - when is_list(Message) -> + when ?is_chardata(Message) -> ?CLASS(ThisT,wxPrinter), ?CLASS(ParentT,wxWindow), ?CLASS(PrintoutT,wxPrintout), diff --git a/lib/wx/src/gen/wxProgressDialog.erl b/lib/wx/src/gen/wxProgressDialog.erl index a05755561e..cadb8497dd 100644 --- a/lib/wx/src/gen/wxProgressDialog.erl +++ b/lib/wx/src/gen/wxProgressDialog.erl @@ -93,7 +93,7 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). Title::unicode:chardata(), Message::unicode:chardata(). new(Title,Message) - when is_list(Title),is_list(Message) -> + when ?is_chardata(Title),?is_chardata(Message) -> new(Title,Message, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxprogressdialog.html#wxprogressdialogwxprogressdialog">external documentation</a>. @@ -103,7 +103,7 @@ new(Title,Message) | {'parent', wxWindow:wxWindow()} | {'style', integer()}. new(Title,Message, Options) - when is_list(Title),is_list(Message),is_list(Options) -> + when ?is_chardata(Title),?is_chardata(Message),is_list(Options) -> Title_UC = unicode:characters_to_binary([Title,0]), Message_UC = unicode:characters_to_binary([Message,0]), MOpts = fun({maximum, Maximum}, Acc) -> [<<1:32/?UI,Maximum:32/?UI>>|Acc]; diff --git a/lib/wx/src/gen/wxRadioBox.erl b/lib/wx/src/gen/wxRadioBox.erl index 772ee00115..34e7f038ec 100644 --- a/lib/wx/src/gen/wxRadioBox.erl +++ b/lib/wx/src/gen/wxRadioBox.erl @@ -87,7 +87,7 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()]. new(Parent,Id,Title,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) -> new(Parent,Id,Title,Pos,Size,Choices, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxradiobox.html#wxradioboxwxradiobox">external documentation</a>. @@ -97,7 +97,7 @@ new(Parent,Id,Title,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) | {'style', integer()} | {'val', wx:wx_object()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title,{PosX,PosY},{SizeW,SizeH},Choices, Options) - when is_integer(Id),is_list(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) -> ?CLASS(ParentT,wxWindow), Title_UC = unicode:characters_to_binary([Title,0]), Choices_UCA = [unicode:characters_to_binary([ChoicesTemp,0]) || @@ -115,7 +115,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Title,{PosX,PosY},{SizeW,SizeH},Choic This::wxRadioBox(), Parent::wxWindow:wxWindow(), Id::integer(), Title::unicode:chardata(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[unicode:chardata()]. create(This,Parent,Id,Title,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) -> create(This,Parent,Id,Title,Pos,Size,Choices, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxradiobox.html#wxradioboxcreate">external documentation</a>. @@ -125,7 +125,7 @@ create(This,Parent,Id,Title,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) | {'style', integer()} | {'val', wx:wx_object()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Title,{PosX,PosY},{SizeW,SizeH},Choices, Options) - when is_integer(Id),is_list(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) -> + when is_integer(Id),?is_chardata(Title),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) -> ?CLASS(ThisT,wxRadioBox), ?CLASS(ParentT,wxWindow), Title_UC = unicode:characters_to_binary([Title,0]), @@ -320,7 +320,7 @@ isItemShown(#wx_ref{type=ThisT,ref=ThisRef},N) -spec setItemHelpText(This, N, HelpText) -> 'ok' when This::wxRadioBox(), N::integer(), HelpText::unicode:chardata(). setItemHelpText(#wx_ref{type=ThisT,ref=ThisRef},N,HelpText) - when is_integer(N),is_list(HelpText) -> + when is_integer(N),?is_chardata(HelpText) -> ?CLASS(ThisT,wxRadioBox), HelpText_UC = unicode:characters_to_binary([HelpText,0]), wxe_util:cast(?wxRadioBox_SetItemHelpText, @@ -330,7 +330,7 @@ setItemHelpText(#wx_ref{type=ThisT,ref=ThisRef},N,HelpText) -spec setItemToolTip(This, Item, Text) -> 'ok' when This::wxRadioBox(), Item::integer(), Text::unicode:chardata(). setItemToolTip(#wx_ref{type=ThisT,ref=ThisRef},Item,Text) - when is_integer(Item),is_list(Text) -> + when is_integer(Item),?is_chardata(Text) -> ?CLASS(ThisT,wxRadioBox), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxRadioBox_SetItemToolTip, diff --git a/lib/wx/src/gen/wxRadioButton.erl b/lib/wx/src/gen/wxRadioButton.erl index 759bb64364..f90afc82a5 100644 --- a/lib/wx/src/gen/wxRadioButton.erl +++ b/lib/wx/src/gen/wxRadioButton.erl @@ -90,7 +90,7 @@ new() -> Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(). new(Parent,Id,Label) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) -> new(Parent,Id,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxradiobutton.html#wxradiobuttonwxradiobutton">external documentation</a>. @@ -101,7 +101,7 @@ new(Parent,Id,Label) | {'style', integer()} | {'validator', wx:wx_object()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) - when is_integer(Id),is_list(Label),is_list(Options) -> + when is_integer(Id),?is_chardata(Label),is_list(Options) -> ?CLASS(ParentT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc]; @@ -118,7 +118,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) This::wxRadioButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(). create(This,Parent,Id,Label) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) -> create(This,Parent,Id,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxradiobutton.html#wxradiobuttoncreate">external documentation</a>. @@ -129,7 +129,7 @@ create(This,Parent,Id,Label) | {'style', integer()} | {'validator', wx:wx_object()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) - when is_integer(Id),is_list(Label),is_list(Options) -> + when is_integer(Id),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxRadioButton), ?CLASS(ParentT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), diff --git a/lib/wx/src/gen/wxSingleChoiceDialog.erl b/lib/wx/src/gen/wxSingleChoiceDialog.erl index eb3d556a47..d5e4977abc 100644 --- a/lib/wx/src/gen/wxSingleChoiceDialog.erl +++ b/lib/wx/src/gen/wxSingleChoiceDialog.erl @@ -99,7 +99,7 @@ new() -> Parent::wxWindow:wxWindow(), Message::unicode:chardata(), Caption::unicode:chardata(), Choices::[unicode:chardata()]. new(Parent,Message,Caption,Choices) - when is_record(Parent, wx_ref),is_list(Message),is_list(Caption),is_list(Choices) -> + when is_record(Parent, wx_ref),?is_chardata(Message),?is_chardata(Caption),is_list(Choices) -> new(Parent,Message,Caption,Choices, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxsinglechoicedialog.html#wxsinglechoicedialogwxsinglechoicedialog">external documentation</a>. @@ -108,7 +108,7 @@ new(Parent,Message,Caption,Choices) Option :: {'style', integer()} | {'pos', {X::integer(), Y::integer()}}. new(#wx_ref{type=ParentT,ref=ParentRef},Message,Caption,Choices, Options) - when is_list(Message),is_list(Caption),is_list(Choices),is_list(Options) -> + when ?is_chardata(Message),?is_chardata(Caption),is_list(Choices),is_list(Options) -> ?CLASS(ParentT,wxWindow), Message_UC = unicode:characters_to_binary([Message,0]), Caption_UC = unicode:characters_to_binary([Caption,0]), diff --git a/lib/wx/src/gen/wxSpinCtrl.erl b/lib/wx/src/gen/wxSpinCtrl.erl index 867787f3e3..a1d359b117 100644 --- a/lib/wx/src/gen/wxSpinCtrl.erl +++ b/lib/wx/src/gen/wxSpinCtrl.erl @@ -172,7 +172,7 @@ setValue(#wx_ref{type=ThisT,ref=ThisRef},Value) wxe_util:cast(?wxSpinCtrl_SetValue_1_0, <<ThisRef:32/?UI,Value:32/?UI>>); setValue(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxSpinCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxSpinCtrl_SetValue_1_1, diff --git a/lib/wx/src/gen/wxStaticBox.erl b/lib/wx/src/gen/wxStaticBox.erl index 9bc4cae9cc..8a789d2d62 100644 --- a/lib/wx/src/gen/wxStaticBox.erl +++ b/lib/wx/src/gen/wxStaticBox.erl @@ -90,7 +90,7 @@ new() -> Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(). new(Parent,Id,Label) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) -> new(Parent,Id,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxstaticbox.html#wxstaticboxwxstaticbox">external documentation</a>. @@ -100,7 +100,7 @@ new(Parent,Id,Label) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) - when is_integer(Id),is_list(Label),is_list(Options) -> + when is_integer(Id),?is_chardata(Label),is_list(Options) -> ?CLASS(ParentT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc]; @@ -116,7 +116,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) This::wxStaticBox(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(). create(This,Parent,Id,Label) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) -> create(This,Parent,Id,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxstaticbox.html#wxstaticboxcreate">external documentation</a>. @@ -126,7 +126,7 @@ create(This,Parent,Id,Label) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) - when is_integer(Id),is_list(Label),is_list(Options) -> + when is_integer(Id),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxStaticBox), ?CLASS(ParentT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), diff --git a/lib/wx/src/gen/wxStaticText.erl b/lib/wx/src/gen/wxStaticText.erl index 0b2452adcb..83e83305fb 100644 --- a/lib/wx/src/gen/wxStaticText.erl +++ b/lib/wx/src/gen/wxStaticText.erl @@ -90,7 +90,7 @@ new() -> Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(). new(Parent,Id,Label) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) -> new(Parent,Id,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxstatictext.html#wxstatictextwxstatictext">external documentation</a>. @@ -100,7 +100,7 @@ new(Parent,Id,Label) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) - when is_integer(Id),is_list(Label),is_list(Options) -> + when is_integer(Id),?is_chardata(Label),is_list(Options) -> ?CLASS(ParentT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc]; @@ -116,7 +116,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) This::wxStaticText(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(). create(This,Parent,Id,Label) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) -> create(This,Parent,Id,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxstatictext.html#wxstatictextcreate">external documentation</a>. @@ -126,7 +126,7 @@ create(This,Parent,Id,Label) | {'size', {W::integer(), H::integer()}} | {'style', integer()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) - when is_integer(Id),is_list(Label),is_list(Options) -> + when is_integer(Id),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxStaticText), ?CLASS(ParentT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), @@ -150,7 +150,7 @@ getLabel(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setLabel(This, Label) -> 'ok' when This::wxStaticText(), Label::unicode:chardata(). setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label) - when is_list(Label) -> + when ?is_chardata(Label) -> ?CLASS(ThisT,wxStaticText), Label_UC = unicode:characters_to_binary([Label,0]), wxe_util:cast(?wxStaticText_SetLabel, diff --git a/lib/wx/src/gen/wxStatusBar.erl b/lib/wx/src/gen/wxStatusBar.erl index 1fbb9c838d..db86136f5a 100644 --- a/lib/wx/src/gen/wxStatusBar.erl +++ b/lib/wx/src/gen/wxStatusBar.erl @@ -198,7 +198,7 @@ popStatusText(#wx_ref{type=ThisT,ref=ThisRef}, Options) This::wxStatusBar(), Text::unicode:chardata(). pushStatusText(This,Text) - when is_record(This, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),?is_chardata(Text) -> pushStatusText(This,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxstatusbar.html#wxstatusbarpushstatustext">external documentation</a>. @@ -206,7 +206,7 @@ pushStatusText(This,Text) This::wxStatusBar(), Text::unicode:chardata(), Option :: {'number', integer()}. pushStatusText(#wx_ref{type=ThisT,ref=ThisRef},Text, Options) - when is_list(Text),is_list(Options) -> + when ?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxStatusBar), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({number, Number}, Acc) -> [<<1:32/?UI,Number:32/?UI>>|Acc]; @@ -251,7 +251,7 @@ setMinHeight(#wx_ref{type=ThisT,ref=ThisRef},Height) This::wxStatusBar(), Text::unicode:chardata(). setStatusText(This,Text) - when is_record(This, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),?is_chardata(Text) -> setStatusText(This,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxstatusbar.html#wxstatusbarsetstatustext">external documentation</a>. @@ -259,7 +259,7 @@ setStatusText(This,Text) This::wxStatusBar(), Text::unicode:chardata(), Option :: {'number', integer()}. setStatusText(#wx_ref{type=ThisT,ref=ThisRef},Text, Options) - when is_list(Text),is_list(Options) -> + when ?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxStatusBar), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({number, Number}, Acc) -> [<<1:32/?UI,Number:32/?UI>>|Acc]; diff --git a/lib/wx/src/gen/wxStyledTextCtrl.erl b/lib/wx/src/gen/wxStyledTextCtrl.erl index e95688ddc6..c684141224 100644 --- a/lib/wx/src/gen/wxStyledTextCtrl.erl +++ b/lib/wx/src/gen/wxStyledTextCtrl.erl @@ -246,7 +246,7 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, Opti -spec addText(This, Text) -> 'ok' when This::wxStyledTextCtrl(), Text::unicode:chardata(). addText(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxStyledTextCtrl_AddText, @@ -265,7 +265,7 @@ addStyledText(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DataT,ref=DataRef}) - -spec insertText(This, Pos, Text) -> 'ok' when This::wxStyledTextCtrl(), Pos::integer(), Text::unicode:chardata(). insertText(#wx_ref{type=ThisT,ref=ThisRef},Pos,Text) - when is_integer(Pos),is_list(Text) -> + when is_integer(Pos),?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxStyledTextCtrl_InsertText, @@ -823,7 +823,7 @@ styleSetSize(#wx_ref{type=ThisT,ref=ThisRef},Style,SizePoints) -spec styleSetFaceName(This, Style, FontName) -> 'ok' when This::wxStyledTextCtrl(), Style::integer(), FontName::unicode:chardata(). styleSetFaceName(#wx_ref{type=ThisT,ref=ThisRef},Style,FontName) - when is_integer(Style),is_list(FontName) -> + when is_integer(Style),?is_chardata(FontName) -> ?CLASS(ThisT,wxStyledTextCtrl), FontName_UC = unicode:characters_to_binary([FontName,0]), wxe_util:cast(?wxStyledTextCtrl_StyleSetFaceName, @@ -982,7 +982,7 @@ setCaretPeriod(#wx_ref{type=ThisT,ref=ThisRef},PeriodMilliseconds) -spec setWordChars(This, Characters) -> 'ok' when This::wxStyledTextCtrl(), Characters::unicode:chardata(). setWordChars(#wx_ref{type=ThisT,ref=ThisRef},Characters) - when is_list(Characters) -> + when ?is_chardata(Characters) -> ?CLASS(ThisT,wxStyledTextCtrl), Characters_UC = unicode:characters_to_binary([Characters,0]), wxe_util:cast(?wxStyledTextCtrl_SetWordChars, @@ -1130,7 +1130,7 @@ setCaretLineBackground(#wx_ref{type=ThisT,ref=ThisRef},Back) -spec autoCompShow(This, LenEntered, ItemList) -> 'ok' when This::wxStyledTextCtrl(), LenEntered::integer(), ItemList::unicode:chardata(). autoCompShow(#wx_ref{type=ThisT,ref=ThisRef},LenEntered,ItemList) - when is_integer(LenEntered),is_list(ItemList) -> + when is_integer(LenEntered),?is_chardata(ItemList) -> ?CLASS(ThisT,wxStyledTextCtrl), ItemList_UC = unicode:characters_to_binary([ItemList,0]), wxe_util:cast(?wxStyledTextCtrl_AutoCompShow, @@ -1172,7 +1172,7 @@ autoCompComplete(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec autoCompStops(This, CharacterSet) -> 'ok' when This::wxStyledTextCtrl(), CharacterSet::unicode:chardata(). autoCompStops(#wx_ref{type=ThisT,ref=ThisRef},CharacterSet) - when is_list(CharacterSet) -> + when ?is_chardata(CharacterSet) -> ?CLASS(ThisT,wxStyledTextCtrl), CharacterSet_UC = unicode:characters_to_binary([CharacterSet,0]), wxe_util:cast(?wxStyledTextCtrl_AutoCompStops, @@ -1199,7 +1199,7 @@ autoCompGetSeparator(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec autoCompSelect(This, Text) -> 'ok' when This::wxStyledTextCtrl(), Text::unicode:chardata(). autoCompSelect(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxStyledTextCtrl_AutoCompSelect, @@ -1226,7 +1226,7 @@ autoCompGetCancelAtStart(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec autoCompSetFillUps(This, CharacterSet) -> 'ok' when This::wxStyledTextCtrl(), CharacterSet::unicode:chardata(). autoCompSetFillUps(#wx_ref{type=ThisT,ref=ThisRef},CharacterSet) - when is_list(CharacterSet) -> + when ?is_chardata(CharacterSet) -> ?CLASS(ThisT,wxStyledTextCtrl), CharacterSet_UC = unicode:characters_to_binary([CharacterSet,0]), wxe_util:cast(?wxStyledTextCtrl_AutoCompSetFillUps, @@ -1270,7 +1270,7 @@ autoCompGetIgnoreCase(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec userListShow(This, ListType, ItemList) -> 'ok' when This::wxStyledTextCtrl(), ListType::integer(), ItemList::unicode:chardata(). userListShow(#wx_ref{type=ThisT,ref=ThisRef},ListType,ItemList) - when is_integer(ListType),is_list(ItemList) -> + when is_integer(ListType),?is_chardata(ItemList) -> ?CLASS(ThisT,wxStyledTextCtrl), ItemList_UC = unicode:characters_to_binary([ItemList,0]), wxe_util:cast(?wxStyledTextCtrl_UserListShow, @@ -1615,7 +1615,7 @@ getPrintColourMode(#wx_ref{type=ThisT,ref=ThisRef}) -> This::wxStyledTextCtrl(), MinPos::integer(), MaxPos::integer(), Text::unicode:chardata(). findText(This,MinPos,MaxPos,Text) - when is_record(This, wx_ref),is_integer(MinPos),is_integer(MaxPos),is_list(Text) -> + when is_record(This, wx_ref),is_integer(MinPos),is_integer(MaxPos),?is_chardata(Text) -> findText(This,MinPos,MaxPos,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxstyledtextctrl.html#wxstyledtextctrlfindtext">external documentation</a>. @@ -1623,7 +1623,7 @@ findText(This,MinPos,MaxPos,Text) This::wxStyledTextCtrl(), MinPos::integer(), MaxPos::integer(), Text::unicode:chardata(), Option :: {'flags', integer()}. findText(#wx_ref{type=ThisT,ref=ThisRef},MinPos,MaxPos,Text, Options) - when is_integer(MinPos),is_integer(MaxPos),is_list(Text),is_list(Options) -> + when is_integer(MinPos),is_integer(MaxPos),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc]; @@ -1784,7 +1784,7 @@ ensureCaretVisible(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec replaceSelection(This, Text) -> 'ok' when This::wxStyledTextCtrl(), Text::unicode:chardata(). replaceSelection(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxStyledTextCtrl_ReplaceSelection, @@ -1867,7 +1867,7 @@ clear(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setText(This, Text) -> 'ok' when This::wxStyledTextCtrl(), Text::unicode:chardata(). setText(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxStyledTextCtrl_SetText, @@ -1952,7 +1952,7 @@ getTargetEnd(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec replaceTarget(This, Text) -> integer() when This::wxStyledTextCtrl(), Text::unicode:chardata(). replaceTarget(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxStyledTextCtrl_ReplaceTarget, @@ -1962,7 +1962,7 @@ replaceTarget(#wx_ref{type=ThisT,ref=ThisRef},Text) -spec searchInTarget(This, Text) -> integer() when This::wxStyledTextCtrl(), Text::unicode:chardata(). searchInTarget(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxStyledTextCtrl_SearchInTarget, @@ -1989,7 +1989,7 @@ getSearchFlags(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec callTipShow(This, Pos, Definition) -> 'ok' when This::wxStyledTextCtrl(), Pos::integer(), Definition::unicode:chardata(). callTipShow(#wx_ref{type=ThisT,ref=ThisRef},Pos,Definition) - when is_integer(Pos),is_list(Definition) -> + when is_integer(Pos),?is_chardata(Definition) -> ?CLASS(ThisT,wxStyledTextCtrl), Definition_UC = unicode:characters_to_binary([Definition,0]), wxe_util:cast(?wxStyledTextCtrl_CallTipShow, @@ -2383,7 +2383,7 @@ getScrollWidth(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec textWidth(This, Style, Text) -> integer() when This::wxStyledTextCtrl(), Style::integer(), Text::unicode:chardata(). textWidth(#wx_ref{type=ThisT,ref=ThisRef},Style,Text) - when is_integer(Style),is_list(Text) -> + when is_integer(Style),?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxStyledTextCtrl_TextWidth, @@ -2427,7 +2427,7 @@ getUseVerticalScrollBar(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec appendText(This, Text) -> 'ok' when This::wxStyledTextCtrl(), Text::unicode:chardata(). appendText(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxStyledTextCtrl_AppendText, @@ -3074,7 +3074,7 @@ searchAnchor(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec searchNext(This, Flags, Text) -> integer() when This::wxStyledTextCtrl(), Flags::integer(), Text::unicode:chardata(). searchNext(#wx_ref{type=ThisT,ref=ThisRef},Flags,Text) - when is_integer(Flags),is_list(Text) -> + when is_integer(Flags),?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxStyledTextCtrl_SearchNext, @@ -3084,7 +3084,7 @@ searchNext(#wx_ref{type=ThisT,ref=ThisRef},Flags,Text) -spec searchPrev(This, Flags, Text) -> integer() when This::wxStyledTextCtrl(), Flags::integer(), Text::unicode:chardata(). searchPrev(#wx_ref{type=ThisT,ref=ThisRef},Flags,Text) - when is_integer(Flags),is_list(Text) -> + when is_integer(Flags),?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxStyledTextCtrl_SearchPrev, @@ -3415,7 +3415,7 @@ copyRange(#wx_ref{type=ThisT,ref=ThisRef},Start,End) -spec copyText(This, Length, Text) -> 'ok' when This::wxStyledTextCtrl(), Length::integer(), Text::unicode:chardata(). copyText(#wx_ref{type=ThisT,ref=ThisRef},Length,Text) - when is_integer(Length),is_list(Text) -> + when is_integer(Length),?is_chardata(Text) -> ?CLASS(ThisT,wxStyledTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxStyledTextCtrl_CopyText, @@ -3578,7 +3578,7 @@ wordRightEndExtend(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setWhitespaceChars(This, Characters) -> 'ok' when This::wxStyledTextCtrl(), Characters::unicode:chardata(). setWhitespaceChars(#wx_ref{type=ThisT,ref=ThisRef},Characters) - when is_list(Characters) -> + when ?is_chardata(Characters) -> ?CLASS(ThisT,wxStyledTextCtrl), Characters_UC = unicode:characters_to_binary([Characters,0]), wxe_util:cast(?wxStyledTextCtrl_SetWhitespaceChars, @@ -3731,7 +3731,7 @@ colourise(#wx_ref{type=ThisT,ref=ThisRef},Start,End) -spec setProperty(This, Key, Value) -> 'ok' when This::wxStyledTextCtrl(), Key::unicode:chardata(), Value::unicode:chardata(). setProperty(#wx_ref{type=ThisT,ref=ThisRef},Key,Value) - when is_list(Key),is_list(Value) -> + when ?is_chardata(Key),?is_chardata(Value) -> ?CLASS(ThisT,wxStyledTextCtrl), Key_UC = unicode:characters_to_binary([Key,0]), Value_UC = unicode:characters_to_binary([Value,0]), @@ -3742,7 +3742,7 @@ setProperty(#wx_ref{type=ThisT,ref=ThisRef},Key,Value) -spec setKeyWords(This, KeywordSet, KeyWords) -> 'ok' when This::wxStyledTextCtrl(), KeywordSet::integer(), KeyWords::unicode:chardata(). setKeyWords(#wx_ref{type=ThisT,ref=ThisRef},KeywordSet,KeyWords) - when is_integer(KeywordSet),is_list(KeyWords) -> + when is_integer(KeywordSet),?is_chardata(KeyWords) -> ?CLASS(ThisT,wxStyledTextCtrl), KeyWords_UC = unicode:characters_to_binary([KeyWords,0]), wxe_util:cast(?wxStyledTextCtrl_SetKeyWords, @@ -3752,7 +3752,7 @@ setKeyWords(#wx_ref{type=ThisT,ref=ThisRef},KeywordSet,KeyWords) -spec setLexerLanguage(This, Language) -> 'ok' when This::wxStyledTextCtrl(), Language::unicode:chardata(). setLexerLanguage(#wx_ref{type=ThisT,ref=ThisRef},Language) - when is_list(Language) -> + when ?is_chardata(Language) -> ?CLASS(ThisT,wxStyledTextCtrl), Language_UC = unicode:characters_to_binary([Language,0]), wxe_util:cast(?wxStyledTextCtrl_SetLexerLanguage, @@ -3762,7 +3762,7 @@ setLexerLanguage(#wx_ref{type=ThisT,ref=ThisRef},Language) -spec getProperty(This, Key) -> unicode:charlist() when This::wxStyledTextCtrl(), Key::unicode:chardata(). getProperty(#wx_ref{type=ThisT,ref=ThisRef},Key) - when is_list(Key) -> + when ?is_chardata(Key) -> ?CLASS(ThisT,wxStyledTextCtrl), Key_UC = unicode:characters_to_binary([Key,0]), wxe_util:call(?wxStyledTextCtrl_GetProperty, @@ -3788,7 +3788,7 @@ getCurrentLine(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec styleSetSpec(This, StyleNum, Spec) -> 'ok' when This::wxStyledTextCtrl(), StyleNum::integer(), Spec::unicode:chardata(). styleSetSpec(#wx_ref{type=ThisT,ref=ThisRef},StyleNum,Spec) - when is_integer(StyleNum),is_list(Spec) -> + when is_integer(StyleNum),?is_chardata(Spec) -> ?CLASS(ThisT,wxStyledTextCtrl), Spec_UC = unicode:characters_to_binary([Spec,0]), wxe_util:cast(?wxStyledTextCtrl_StyleSetSpec, @@ -3809,7 +3809,7 @@ styleSetFont(#wx_ref{type=ThisT,ref=ThisRef},StyleNum,#wx_ref{type=FontT,ref=Fon This::wxStyledTextCtrl(), StyleNum::integer(), Size::integer(), FaceName::unicode:chardata(), Bold::boolean(), Italic::boolean(), Underline::boolean(). styleSetFontAttr(This,StyleNum,Size,FaceName,Bold,Italic,Underline) - when is_record(This, wx_ref),is_integer(StyleNum),is_integer(Size),is_list(FaceName),is_boolean(Bold),is_boolean(Italic),is_boolean(Underline) -> + when is_record(This, wx_ref),is_integer(StyleNum),is_integer(Size),?is_chardata(FaceName),is_boolean(Bold),is_boolean(Italic),is_boolean(Underline) -> styleSetFontAttr(This,StyleNum,Size,FaceName,Bold,Italic,Underline, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxstyledtextctrl.html#wxstyledtextctrlstylesetfontattr">external documentation</a>. @@ -3818,7 +3818,7 @@ styleSetFontAttr(This,StyleNum,Size,FaceName,Bold,Italic,Underline) This::wxStyledTextCtrl(), StyleNum::integer(), Size::integer(), FaceName::unicode:chardata(), Bold::boolean(), Italic::boolean(), Underline::boolean(), Option :: {'encoding', wx:wx_enum()}. styleSetFontAttr(#wx_ref{type=ThisT,ref=ThisRef},StyleNum,Size,FaceName,Bold,Italic,Underline, Options) - when is_integer(StyleNum),is_integer(Size),is_list(FaceName),is_boolean(Bold),is_boolean(Italic),is_boolean(Underline),is_list(Options) -> + when is_integer(StyleNum),is_integer(Size),?is_chardata(FaceName),is_boolean(Bold),is_boolean(Italic),is_boolean(Underline),is_list(Options) -> ?CLASS(ThisT,wxStyledTextCtrl), FaceName_UC = unicode:characters_to_binary([FaceName,0]), MOpts = fun({encoding, Encoding}, Acc) -> [<<1:32/?UI,Encoding:32/?UI>>|Acc]; @@ -3938,7 +3938,7 @@ setLastKeydownProcessed(#wx_ref{type=ThisT,ref=ThisRef},Val) -spec saveFile(This, Filename) -> boolean() when This::wxStyledTextCtrl(), Filename::unicode:chardata(). saveFile(#wx_ref{type=ThisT,ref=ThisRef},Filename) - when is_list(Filename) -> + when ?is_chardata(Filename) -> ?CLASS(ThisT,wxStyledTextCtrl), Filename_UC = unicode:characters_to_binary([Filename,0]), wxe_util:call(?wxStyledTextCtrl_SaveFile, @@ -3948,7 +3948,7 @@ saveFile(#wx_ref{type=ThisT,ref=ThisRef},Filename) -spec loadFile(This, Filename) -> boolean() when This::wxStyledTextCtrl(), Filename::unicode:chardata(). loadFile(#wx_ref{type=ThisT,ref=ThisRef},Filename) - when is_list(Filename) -> + when ?is_chardata(Filename) -> ?CLASS(ThisT,wxStyledTextCtrl), Filename_UC = unicode:characters_to_binary([Filename,0]), wxe_util:call(?wxStyledTextCtrl_LoadFile, @@ -3969,7 +3969,7 @@ doDragOver(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Def) -spec doDropText(This, X, Y, Data) -> boolean() when This::wxStyledTextCtrl(), X::integer(), Y::integer(), Data::unicode:chardata(). doDropText(#wx_ref{type=ThisT,ref=ThisRef},X,Y,Data) - when is_integer(X),is_integer(Y),is_list(Data) -> + when is_integer(X),is_integer(Y),?is_chardata(Data) -> ?CLASS(ThisT,wxStyledTextCtrl), Data_UC = unicode:characters_to_binary([Data,0]), wxe_util:call(?wxStyledTextCtrl_DoDropText, diff --git a/lib/wx/src/gen/wxSystemOptions.erl b/lib/wx/src/gen/wxSystemOptions.erl index 28d77b1e26..c613d66c73 100644 --- a/lib/wx/src/gen/wxSystemOptions.erl +++ b/lib/wx/src/gen/wxSystemOptions.erl @@ -39,7 +39,7 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). -spec getOption(Name) -> unicode:charlist() when Name::unicode:chardata(). getOption(Name) - when is_list(Name) -> + when ?is_chardata(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>>). @@ -48,7 +48,7 @@ getOption(Name) -spec getOptionInt(Name) -> integer() when Name::unicode:chardata(). getOptionInt(Name) - when is_list(Name) -> + when ?is_chardata(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>>). @@ -57,7 +57,7 @@ getOptionInt(Name) -spec hasOption(Name) -> boolean() when Name::unicode:chardata(). hasOption(Name) - when is_list(Name) -> + when ?is_chardata(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>>). @@ -66,7 +66,7 @@ hasOption(Name) -spec isFalse(Name) -> boolean() when Name::unicode:chardata(). isFalse(Name) - when is_list(Name) -> + when ?is_chardata(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>>). @@ -81,12 +81,12 @@ isFalse(Name) (Name, Value) -> 'ok' when Name::unicode:chardata(), Value::unicode:chardata(). setOption(Name,Value) - when is_list(Name),is_integer(Value) -> + when ?is_chardata(Name),is_integer(Value) -> Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:cast(?wxSystemOptions_SetOption_2_0, <<(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((4+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,Value:32/?UI>>); setOption(Name,Value) - when is_list(Name),is_list(Value) -> + when ?is_chardata(Name),?is_chardata(Value) -> Name_UC = unicode:characters_to_binary([Name,0]), Value_UC = unicode:characters_to_binary([Value,0]), wxe_util:cast(?wxSystemOptions_SetOption_2_1, diff --git a/lib/wx/src/gen/wxTextCtrl.erl b/lib/wx/src/gen/wxTextCtrl.erl index 4647b37a07..7ffb161cf5 100644 --- a/lib/wx/src/gen/wxTextCtrl.erl +++ b/lib/wx/src/gen/wxTextCtrl.erl @@ -126,7 +126,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) -spec appendText(This, Text) -> 'ok' when This::wxTextCtrl(), Text::unicode:chardata(). appendText(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxTextCtrl_AppendText, @@ -238,7 +238,7 @@ discardEdits(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec changeValue(This, Value) -> 'ok' when This::wxTextCtrl(), Value::unicode:chardata(). changeValue(#wx_ref{type=ThisT,ref=ThisRef},Value) - when is_list(Value) -> + when ?is_chardata(Value) -> ?CLASS(ThisT,wxTextCtrl), Value_UC = unicode:characters_to_binary([Value,0]), wxe_util:cast(?wxTextCtrl_ChangeValue, @@ -383,7 +383,7 @@ isSingleLine(#wx_ref{type=ThisT,ref=ThisRef}) -> This::wxTextCtrl(), File::unicode:chardata(). loadFile(This,File) - when is_record(This, wx_ref),is_list(File) -> + when is_record(This, wx_ref),?is_chardata(File) -> loadFile(This,File, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtextctrl.html#wxtextctrlloadfile">external documentation</a>. @@ -391,7 +391,7 @@ loadFile(This,File) This::wxTextCtrl(), File::unicode:chardata(), Option :: {'fileType', integer()}. loadFile(#wx_ref{type=ThisT,ref=ThisRef},File, Options) - when is_list(File),is_list(Options) -> + when ?is_chardata(File),is_list(Options) -> ?CLASS(ThisT,wxTextCtrl), File_UC = unicode:characters_to_binary([File,0]), MOpts = fun({fileType, FileType}, Acc) -> [<<1:32/?UI,FileType:32/?UI>>|Acc]; @@ -447,7 +447,7 @@ remove(#wx_ref{type=ThisT,ref=ThisRef},From,To) -spec replace(This, From, To, Value) -> 'ok' when This::wxTextCtrl(), From::integer(), To::integer(), Value::unicode:chardata(). replace(#wx_ref{type=ThisT,ref=ThisRef},From,To,Value) - when is_integer(From),is_integer(To),is_list(Value) -> + when is_integer(From),is_integer(To),?is_chardata(Value) -> ?CLASS(ThisT,wxTextCtrl), Value_UC = unicode:characters_to_binary([Value,0]), wxe_util:cast(?wxTextCtrl_Replace, @@ -543,7 +543,7 @@ setStyle(#wx_ref{type=ThisT,ref=ThisRef},Start,End,#wx_ref{type=StyleT,ref=Style -spec setValue(This, Value) -> 'ok' when This::wxTextCtrl(), Value::unicode:chardata(). setValue(#wx_ref{type=ThisT,ref=ThisRef},Value) - when is_list(Value) -> + when ?is_chardata(Value) -> ?CLASS(ThisT,wxTextCtrl), Value_UC = unicode:characters_to_binary([Value,0]), wxe_util:cast(?wxTextCtrl_SetValue, @@ -570,7 +570,7 @@ undo(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec writeText(This, Text) -> 'ok' when This::wxTextCtrl(), Text::unicode:chardata(). writeText(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxTextCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxTextCtrl_WriteText, diff --git a/lib/wx/src/gen/wxTextDataObject.erl b/lib/wx/src/gen/wxTextDataObject.erl index eb3e1f4bff..5c8a44a879 100644 --- a/lib/wx/src/gen/wxTextDataObject.erl +++ b/lib/wx/src/gen/wxTextDataObject.erl @@ -76,7 +76,7 @@ getText(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setText(This, Text) -> 'ok' when This::wxTextDataObject(), Text::unicode:chardata(). setText(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxTextDataObject), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxTextDataObject_SetText, diff --git a/lib/wx/src/gen/wxTextEntryDialog.erl b/lib/wx/src/gen/wxTextEntryDialog.erl index 6d2016c1ac..d0b55fd769 100644 --- a/lib/wx/src/gen/wxTextEntryDialog.erl +++ b/lib/wx/src/gen/wxTextEntryDialog.erl @@ -93,7 +93,7 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). Parent::wxWindow:wxWindow(), Message::unicode:chardata(). new(Parent,Message) - when is_record(Parent, wx_ref),is_list(Message) -> + when is_record(Parent, wx_ref),?is_chardata(Message) -> new(Parent,Message, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtextentrydialog.html#wxtextentrydialogwxtextentrydialog">external documentation</a>. @@ -104,7 +104,7 @@ new(Parent,Message) | {'style', integer()} | {'pos', {X::integer(), Y::integer()}}. new(#wx_ref{type=ParentT,ref=ParentRef},Message, Options) - when is_list(Message),is_list(Options) -> + when ?is_chardata(Message),is_list(Options) -> ?CLASS(ParentT,wxWindow), Message_UC = unicode:characters_to_binary([Message,0]), MOpts = fun({caption, Caption}, Acc) -> Caption_UC = unicode:characters_to_binary([Caption,0]),[<<1:32/?UI,(byte_size(Caption_UC)):32/?UI,(Caption_UC)/binary, 0:(((8- ((0+byte_size(Caption_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -128,7 +128,7 @@ getValue(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setValue(This, Val) -> 'ok' when This::wxTextEntryDialog(), Val::unicode:chardata(). setValue(#wx_ref{type=ThisT,ref=ThisRef},Val) - when is_list(Val) -> + when ?is_chardata(Val) -> ?CLASS(ThisT,wxTextEntryDialog), Val_UC = unicode:characters_to_binary([Val,0]), wxe_util:cast(?wxTextEntryDialog_SetValue, diff --git a/lib/wx/src/gen/wxToggleButton.erl b/lib/wx/src/gen/wxToggleButton.erl index 9d96527af1..6a41cef9ae 100644 --- a/lib/wx/src/gen/wxToggleButton.erl +++ b/lib/wx/src/gen/wxToggleButton.erl @@ -90,7 +90,7 @@ new() -> Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(). new(Parent,Id,Label) - when is_record(Parent, wx_ref),is_integer(Id),is_list(Label) -> + when is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) -> new(Parent,Id,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtogglebutton.html#wxtogglebuttonwxtogglebutton">external documentation</a>. @@ -101,7 +101,7 @@ new(Parent,Id,Label) | {'style', integer()} | {'validator', wx:wx_object()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) - when is_integer(Id),is_list(Label),is_list(Options) -> + when is_integer(Id),?is_chardata(Label),is_list(Options) -> ?CLASS(ParentT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), MOpts = fun({pos, {PosX,PosY}}, Acc) -> [<<1:32/?UI,PosX:32/?UI,PosY:32/?UI,0:32>>|Acc]; @@ -118,7 +118,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) This::wxToggleButton(), Parent::wxWindow:wxWindow(), Id::integer(), Label::unicode:chardata(). create(This,Parent,Id,Label) - when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_list(Label) -> + when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),?is_chardata(Label) -> create(This,Parent,Id,Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtogglebutton.html#wxtogglebuttoncreate">external documentation</a>. @@ -129,7 +129,7 @@ create(This,Parent,Id,Label) | {'style', integer()} | {'validator', wx:wx_object()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,Label, Options) - when is_integer(Id),is_list(Label),is_list(Options) -> + when is_integer(Id),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxToggleButton), ?CLASS(ParentT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), diff --git a/lib/wx/src/gen/wxToolBar.erl b/lib/wx/src/gen/wxToolBar.erl index be971c345d..a3d337ef59 100644 --- a/lib/wx/src/gen/wxToolBar.erl +++ b/lib/wx/src/gen/wxToolBar.erl @@ -142,7 +142,7 @@ addTool(This,Toolid,Bitmap) | {'longHelpString', unicode:chardata()}. addTool(This,Toolid,Label,Bitmap) - when is_record(This, wx_ref),is_integer(Toolid),is_list(Label),is_record(Bitmap, wx_ref) -> + when is_record(This, wx_ref),is_integer(Toolid),?is_chardata(Label),is_record(Bitmap, wx_ref) -> addTool(This,Toolid,Label,Bitmap, []); addTool(This,Toolid,Bitmap,BmpDisabled) @@ -187,10 +187,10 @@ addTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,#wx_ref{type=BitmapT,ref=BitmapRe | {'longHelpString', unicode:chardata()}. addTool(This,Toolid,Label,Bitmap,BmpDisabled) - when is_record(This, wx_ref),is_integer(Toolid),is_list(Label),is_record(Bitmap, wx_ref),is_record(BmpDisabled, wx_ref) -> + when is_record(This, wx_ref),is_integer(Toolid),?is_chardata(Label),is_record(Bitmap, wx_ref),is_record(BmpDisabled, wx_ref) -> addTool(This,Toolid,Label,Bitmap,BmpDisabled, []); addTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Label,#wx_ref{type=BitmapT,ref=BitmapRef}, Options) - when is_integer(Toolid),is_list(Label),is_list(Options) -> + when is_integer(Toolid),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxToolBar), Label_UC = unicode:characters_to_binary([Label,0]), ?CLASS(BitmapT,wxBitmap), @@ -237,7 +237,7 @@ addTool(This,Toolid,Bitmap,BmpDisabled,Toggle,XPos) when is_record(This, wx_ref),is_integer(Toolid),is_record(Bitmap, wx_ref),is_record(BmpDisabled, wx_ref),is_boolean(Toggle),is_integer(XPos) -> addTool(This,Toolid,Bitmap,BmpDisabled,Toggle,XPos, []); addTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Label,#wx_ref{type=BitmapT,ref=BitmapRef},#wx_ref{type=BmpDisabledT,ref=BmpDisabledRef}, Options) - when is_integer(Toolid),is_list(Label),is_list(Options) -> + when is_integer(Toolid),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxToolBar), Label_UC = unicode:characters_to_binary([Label,0]), ?CLASS(BitmapT,wxBitmap), @@ -277,7 +277,7 @@ addTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,#wx_ref{type=BitmapT,ref=BitmapRe This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap(). addCheckTool(This,Toolid,Label,Bitmap) - when is_record(This, wx_ref),is_integer(Toolid),is_list(Label),is_record(Bitmap, wx_ref) -> + when is_record(This, wx_ref),is_integer(Toolid),?is_chardata(Label),is_record(Bitmap, wx_ref) -> addCheckTool(This,Toolid,Label,Bitmap, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtoolbar.html#wxtoolbaraddchecktool">external documentation</a>. @@ -288,7 +288,7 @@ addCheckTool(This,Toolid,Label,Bitmap) | {'longHelp', unicode:chardata()} | {'data', wx:wx_object()}. addCheckTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Label,#wx_ref{type=BitmapT,ref=BitmapRef}, Options) - when is_integer(Toolid),is_list(Label),is_list(Options) -> + when is_integer(Toolid),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxToolBar), Label_UC = unicode:characters_to_binary([Label,0]), ?CLASS(BitmapT,wxBitmap), @@ -306,7 +306,7 @@ addCheckTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Label,#wx_ref{type=BitmapT,r This::wxToolBar(), Toolid::integer(), Label::unicode:chardata(), Bitmap::wxBitmap:wxBitmap(). addRadioTool(This,Toolid,Label,Bitmap) - when is_record(This, wx_ref),is_integer(Toolid),is_list(Label),is_record(Bitmap, wx_ref) -> + when is_record(This, wx_ref),is_integer(Toolid),?is_chardata(Label),is_record(Bitmap, wx_ref) -> addRadioTool(This,Toolid,Label,Bitmap, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtoolbar.html#wxtoolbaraddradiotool">external documentation</a>. @@ -317,7 +317,7 @@ addRadioTool(This,Toolid,Label,Bitmap) | {'longHelp', unicode:chardata()} | {'data', wx:wx_object()}. addRadioTool(#wx_ref{type=ThisT,ref=ThisRef},Toolid,Label,#wx_ref{type=BitmapT,ref=BitmapRef}, Options) - when is_integer(Toolid),is_list(Label),is_list(Options) -> + when is_integer(Toolid),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxToolBar), Label_UC = unicode:characters_to_binary([Label,0]), ?CLASS(BitmapT,wxBitmap), @@ -545,7 +545,7 @@ insertTool(This,Pos,Toolid,Bitmap) | {'longHelp', unicode:chardata()}. insertTool(This,Pos,Toolid,Label,Bitmap) - when is_record(This, wx_ref),is_integer(Pos),is_integer(Toolid),is_list(Label),is_record(Bitmap, wx_ref) -> + when is_record(This, wx_ref),is_integer(Pos),is_integer(Toolid),?is_chardata(Label),is_record(Bitmap, wx_ref) -> insertTool(This,Pos,Toolid,Label,Bitmap, []); insertTool(#wx_ref{type=ThisT,ref=ThisRef},Pos,Toolid,#wx_ref{type=BitmapT,ref=BitmapRef}, Options) when is_integer(Pos),is_integer(Toolid),is_list(Options) -> @@ -571,7 +571,7 @@ insertTool(#wx_ref{type=ThisT,ref=ThisRef},Pos,Toolid,#wx_ref{type=BitmapT,ref=B | {'longHelp', unicode:chardata()} | {'clientData', wx:wx_object()}. insertTool(#wx_ref{type=ThisT,ref=ThisRef},Pos,Toolid,Label,#wx_ref{type=BitmapT,ref=BitmapRef}, Options) - when is_integer(Pos),is_integer(Toolid),is_list(Label),is_list(Options) -> + when is_integer(Pos),is_integer(Toolid),?is_chardata(Label),is_list(Options) -> ?CLASS(ThisT,wxToolBar), Label_UC = unicode:characters_to_binary([Label,0]), ?CLASS(BitmapT,wxBitmap), @@ -624,7 +624,7 @@ setToolBitmapSize(#wx_ref{type=ThisT,ref=ThisRef},{SizeW,SizeH}) -spec setToolLongHelp(This, Toolid, HelpString) -> 'ok' when This::wxToolBar(), Toolid::integer(), HelpString::unicode:chardata(). setToolLongHelp(#wx_ref{type=ThisT,ref=ThisRef},Toolid,HelpString) - when is_integer(Toolid),is_list(HelpString) -> + when is_integer(Toolid),?is_chardata(HelpString) -> ?CLASS(ThisT,wxToolBar), HelpString_UC = unicode:characters_to_binary([HelpString,0]), wxe_util:cast(?wxToolBar_SetToolLongHelp, @@ -643,7 +643,7 @@ setToolPacking(#wx_ref{type=ThisT,ref=ThisRef},Packing) -spec setToolShortHelp(This, Id, HelpString) -> 'ok' when This::wxToolBar(), Id::integer(), HelpString::unicode:chardata(). setToolShortHelp(#wx_ref{type=ThisT,ref=ThisRef},Id,HelpString) - when is_integer(Id),is_list(HelpString) -> + when is_integer(Id),?is_chardata(HelpString) -> ?CLASS(ThisT,wxToolBar), HelpString_UC = unicode:characters_to_binary([HelpString,0]), wxe_util:cast(?wxToolBar_SetToolShortHelp, diff --git a/lib/wx/src/gen/wxToolTip.erl b/lib/wx/src/gen/wxToolTip.erl index 163e764d8c..0596173ebe 100644 --- a/lib/wx/src/gen/wxToolTip.erl +++ b/lib/wx/src/gen/wxToolTip.erl @@ -55,7 +55,7 @@ setDelay(Msecs) -spec new(Tip) -> wxToolTip() when Tip::unicode:chardata(). new(Tip) - when is_list(Tip) -> + when ?is_chardata(Tip) -> Tip_UC = unicode:characters_to_binary([Tip,0]), wxe_util:construct(?wxToolTip_new, <<(byte_size(Tip_UC)):32/?UI,(Tip_UC)/binary, 0:(((8- ((4+byte_size(Tip_UC)) band 16#7)) band 16#7))/unit:8>>). @@ -64,7 +64,7 @@ new(Tip) -spec setTip(This, Tip) -> 'ok' when This::wxToolTip(), Tip::unicode:chardata(). setTip(#wx_ref{type=ThisT,ref=ThisRef},Tip) - when is_list(Tip) -> + when ?is_chardata(Tip) -> ?CLASS(ThisT,wxToolTip), Tip_UC = unicode:characters_to_binary([Tip,0]), wxe_util:cast(?wxToolTip_SetTip, diff --git a/lib/wx/src/gen/wxToolbook.erl b/lib/wx/src/gen/wxToolbook.erl index c7ff858209..787d4a468e 100644 --- a/lib/wx/src/gen/wxToolbook.erl +++ b/lib/wx/src/gen/wxToolbook.erl @@ -120,7 +120,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) This::wxToolbook(), Page::wxWindow:wxWindow(), Text::unicode:chardata(). addPage(This,Page,Text) - when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),is_record(Page, wx_ref),?is_chardata(Text) -> addPage(This,Page,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtoolbook.html#wxtoolbookaddpage">external documentation</a>. @@ -129,7 +129,7 @@ addPage(This,Page,Text) Option :: {'bSelect', boolean()} | {'imageId', integer()}. addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Options) - when is_list(Text),is_list(Options) -> + when ?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxToolbook), ?CLASS(PageT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), @@ -296,7 +296,7 @@ hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY}) This::wxToolbook(), N::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata(). insertPage(This,N,Page,Text) - when is_record(This, wx_ref),is_integer(N),is_record(Page, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),is_integer(N),is_record(Page, wx_ref),?is_chardata(Text) -> insertPage(This,N,Page,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtoolbook.html#wxtoolbookinsertpage">external documentation</a>. @@ -305,7 +305,7 @@ insertPage(This,N,Page,Text) Option :: {'bSelect', boolean()} | {'imageId', integer()}. insertPage(#wx_ref{type=ThisT,ref=ThisRef},N,#wx_ref{type=PageT,ref=PageRef},Text, Options) - when is_integer(N),is_list(Text),is_list(Options) -> + when is_integer(N),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxToolbook), ?CLASS(PageT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), @@ -347,7 +347,7 @@ setPageImage(#wx_ref{type=ThisT,ref=ThisRef},N,ImageId) -spec setPageText(This, N, StrText) -> boolean() when This::wxToolbook(), N::integer(), StrText::unicode:chardata(). setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText) - when is_integer(N),is_list(StrText) -> + when is_integer(N),?is_chardata(StrText) -> ?CLASS(ThisT,wxToolbook), StrText_UC = unicode:characters_to_binary([StrText,0]), wxe_util:call(?wxToolbook_SetPageText, diff --git a/lib/wx/src/gen/wxTopLevelWindow.erl b/lib/wx/src/gen/wxTopLevelWindow.erl index 428694afc4..96135052bc 100644 --- a/lib/wx/src/gen/wxTopLevelWindow.erl +++ b/lib/wx/src/gen/wxTopLevelWindow.erl @@ -273,7 +273,7 @@ setShape(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=RegionT,ref=RegionRef}) -> -spec setTitle(This, Title) -> 'ok' when This::wxTopLevelWindow(), Title::unicode:chardata(). setTitle(#wx_ref{type=ThisT,ref=ThisRef},Title) - when is_list(Title) -> + when ?is_chardata(Title) -> ?CLASS(ThisT,wxTopLevelWindow), Title_UC = unicode:characters_to_binary([Title,0]), wxe_util:cast(?wxTopLevelWindow_SetTitle, diff --git a/lib/wx/src/gen/wxTreeCtrl.erl b/lib/wx/src/gen/wxTreeCtrl.erl index de42ddd2b4..68ea754bef 100644 --- a/lib/wx/src/gen/wxTreeCtrl.erl +++ b/lib/wx/src/gen/wxTreeCtrl.erl @@ -140,7 +140,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options) This::wxTreeCtrl(), Text::unicode:chardata(). addRoot(This,Text) - when is_record(This, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),?is_chardata(Text) -> addRoot(This,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtreectrl.html#wxtreectrladdroot">external documentation</a>. @@ -150,7 +150,7 @@ addRoot(This,Text) | {'selectedImage', integer()} | {'data', term()}. addRoot(#wx_ref{type=ThisT,ref=ThisRef},Text, Options) - when is_list(Text),is_list(Options) -> + when ?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxTreeCtrl), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({image, Image}, Acc) -> [<<1:32/?UI,Image:32/?UI>>|Acc]; @@ -166,7 +166,7 @@ addRoot(#wx_ref{type=ThisT,ref=ThisRef},Text, Options) This::wxTreeCtrl(), Parent::integer(), Text::unicode:chardata(). appendItem(This,Parent,Text) - when is_record(This, wx_ref),is_integer(Parent),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Parent),?is_chardata(Text) -> appendItem(This,Parent,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtreectrl.html#wxtreectrlappenditem">external documentation</a>. @@ -176,7 +176,7 @@ appendItem(This,Parent,Text) | {'selectedImage', integer()} | {'data', term()}. appendItem(#wx_ref{type=ThisT,ref=ThisRef},Parent,Text, Options) - when is_integer(Parent),is_list(Text),is_list(Options) -> + when is_integer(Parent),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxTreeCtrl), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({image, Image}, Acc) -> [<<1:32/?UI,Image:32/?UI>>|Acc]; @@ -580,7 +580,7 @@ hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PointX,PointY}) This::wxTreeCtrl(), Parent::integer(), Pos::integer(), Text::unicode:chardata(). insertItem(This,Parent,Pos,Text) - when is_record(This, wx_ref),is_integer(Parent),is_integer(Pos),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Parent),is_integer(Pos),?is_chardata(Text) -> insertItem(This,Parent,Pos,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtreectrl.html#wxtreectrlinsertitem">external documentation</a>. @@ -590,7 +590,7 @@ insertItem(This,Parent,Pos,Text) | {'selImage', integer()} | {'data', term()}. insertItem(#wx_ref{type=ThisT,ref=ThisRef},Parent,Pos,Text, Options) - when is_integer(Parent),is_integer(Pos),is_list(Text),is_list(Options) -> + when is_integer(Parent),is_integer(Pos),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxTreeCtrl), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({image, Image}, Acc) -> [<<1:32/?UI,Image:32/?UI>>|Acc]; @@ -659,7 +659,7 @@ isTreeItemIdOk(Id) This::wxTreeCtrl(), Parent::integer(), Text::unicode:chardata(). prependItem(This,Parent,Text) - when is_record(This, wx_ref),is_integer(Parent),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Parent),?is_chardata(Text) -> prependItem(This,Parent,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtreectrl.html#wxtreectrlprependitem">external documentation</a>. @@ -669,7 +669,7 @@ prependItem(This,Parent,Text) | {'selectedImage', integer()} | {'data', term()}. prependItem(#wx_ref{type=ThisT,ref=ThisRef},Parent,Text, Options) - when is_integer(Parent),is_list(Text),is_list(Options) -> + when is_integer(Parent),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxTreeCtrl), Text_UC = unicode:characters_to_binary([Text,0]), MOpts = fun({image, Image}, Acc) -> [<<1:32/?UI,Image:32/?UI>>|Acc]; @@ -848,7 +848,7 @@ setItemImage(#wx_ref{type=ThisT,ref=ThisRef},Item,Image, Options) -spec setItemText(This, Item, Text) -> 'ok' when This::wxTreeCtrl(), Item::integer(), Text::unicode:chardata(). setItemText(#wx_ref{type=ThisT,ref=ThisRef},Item,Text) - when is_integer(Item),is_list(Text) -> + when is_integer(Item),?is_chardata(Text) -> ?CLASS(ThisT,wxTreeCtrl), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxTreeCtrl_SetItemText, diff --git a/lib/wx/src/gen/wxTreeEvent.erl b/lib/wx/src/gen/wxTreeEvent.erl index 41e86fe41f..368f32a386 100644 --- a/lib/wx/src/gen/wxTreeEvent.erl +++ b/lib/wx/src/gen/wxTreeEvent.erl @@ -111,7 +111,7 @@ isEditCancelled(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec setToolTip(This, ToolTip) -> 'ok' when This::wxTreeEvent(), ToolTip::unicode:chardata(). setToolTip(#wx_ref{type=ThisT,ref=ThisRef},ToolTip) - when is_list(ToolTip) -> + when ?is_chardata(ToolTip) -> ?CLASS(ThisT,wxTreeEvent), ToolTip_UC = unicode:characters_to_binary([ToolTip,0]), wxe_util:cast(?wxTreeEvent_SetToolTip, diff --git a/lib/wx/src/gen/wxTreebook.erl b/lib/wx/src/gen/wxTreebook.erl index e30297a298..956652f221 100644 --- a/lib/wx/src/gen/wxTreebook.erl +++ b/lib/wx/src/gen/wxTreebook.erl @@ -121,7 +121,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) This::wxTreebook(), Page::wxWindow:wxWindow(), Text::unicode:chardata(). addPage(This,Page,Text) - when is_record(This, wx_ref),is_record(Page, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),is_record(Page, wx_ref),?is_chardata(Text) -> addPage(This,Page,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtreebook.html#wxtreebookaddpage">external documentation</a>. @@ -130,7 +130,7 @@ addPage(This,Page,Text) Option :: {'bSelect', boolean()} | {'imageId', integer()}. addPage(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PageT,ref=PageRef},Text, Options) - when is_list(Text),is_list(Options) -> + when ?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxTreebook), ?CLASS(PageT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), @@ -327,7 +327,7 @@ hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PtX,PtY}) This::wxTreebook(), Pos::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata(). insertPage(This,Pos,Page,Text) - when is_record(This, wx_ref),is_integer(Pos),is_record(Page, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Pos),is_record(Page, wx_ref),?is_chardata(Text) -> insertPage(This,Pos,Page,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtreebook.html#wxtreebookinsertpage">external documentation</a>. @@ -336,7 +336,7 @@ insertPage(This,Pos,Page,Text) Option :: {'bSelect', boolean()} | {'imageId', integer()}. insertPage(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=PageT,ref=PageRef},Text, Options) - when is_integer(Pos),is_list(Text),is_list(Options) -> + when is_integer(Pos),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxTreebook), ?CLASS(PageT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), @@ -352,7 +352,7 @@ insertPage(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=PageT,ref=PageRef},T This::wxTreebook(), Pos::integer(), Page::wxWindow:wxWindow(), Text::unicode:chardata(). insertSubPage(This,Pos,Page,Text) - when is_record(This, wx_ref),is_integer(Pos),is_record(Page, wx_ref),is_list(Text) -> + when is_record(This, wx_ref),is_integer(Pos),is_record(Page, wx_ref),?is_chardata(Text) -> insertSubPage(This,Pos,Page,Text, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxtreebook.html#wxtreebookinsertsubpage">external documentation</a>. @@ -361,7 +361,7 @@ insertSubPage(This,Pos,Page,Text) Option :: {'bSelect', boolean()} | {'imageId', integer()}. insertSubPage(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=PageT,ref=PageRef},Text, Options) - when is_integer(Pos),is_list(Text),is_list(Options) -> + when is_integer(Pos),?is_chardata(Text),is_list(Options) -> ?CLASS(ThisT,wxTreebook), ?CLASS(PageT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), @@ -403,7 +403,7 @@ setPageImage(#wx_ref{type=ThisT,ref=ThisRef},N,ImageId) -spec setPageText(This, N, StrText) -> boolean() when This::wxTreebook(), N::integer(), StrText::unicode:chardata(). setPageText(#wx_ref{type=ThisT,ref=ThisRef},N,StrText) - when is_integer(N),is_list(StrText) -> + when is_integer(N),?is_chardata(StrText) -> ?CLASS(ThisT,wxTreebook), StrText_UC = unicode:characters_to_binary([StrText,0]), wxe_util:call(?wxTreebook_SetPageText, diff --git a/lib/wx/src/gen/wxUpdateUIEvent.erl b/lib/wx/src/gen/wxUpdateUIEvent.erl index fec42ed8eb..e7bda40a7a 100644 --- a/lib/wx/src/gen/wxUpdateUIEvent.erl +++ b/lib/wx/src/gen/wxUpdateUIEvent.erl @@ -181,7 +181,7 @@ setMode(Mode) -spec setText(This, Text) -> 'ok' when This::wxUpdateUIEvent(), Text::unicode:chardata(). setText(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxUpdateUIEvent), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxUpdateUIEvent_SetText, diff --git a/lib/wx/src/gen/wxWindow.erl b/lib/wx/src/gen/wxWindow.erl index 7f706c84b1..be847861b1 100644 --- a/lib/wx/src/gen/wxWindow.erl +++ b/lib/wx/src/gen/wxWindow.erl @@ -348,7 +348,7 @@ findWindow(#wx_ref{type=ThisT,ref=ThisRef},Winid) wxe_util:call(?wxWindow_FindWindow_1_0, <<ThisRef:32/?UI,Winid:32/?UI>>); findWindow(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxWindow_FindWindow_1_1, @@ -379,7 +379,7 @@ findWindowById(Winid, Options) Name::unicode:chardata(). findWindowByName(Name) - when is_list(Name) -> + when ?is_chardata(Name) -> findWindowByName(Name, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxwindow.html#wxwindowfindwindowbyname">external documentation</a>. @@ -387,7 +387,7 @@ findWindowByName(Name) Name::unicode:chardata(), Option :: {'parent', wxWindow()}. findWindowByName(Name, Options) - when is_list(Name),is_list(Options) -> + when ?is_chardata(Name),is_list(Options) -> Name_UC = unicode:characters_to_binary([Name,0]), MOpts = fun({parent, #wx_ref{type=ParentT,ref=ParentRef}}, Acc) -> ?CLASS(ParentT,wxWindow),[<<1:32/?UI,ParentRef:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, @@ -400,7 +400,7 @@ findWindowByName(Name, Options) Label::unicode:chardata(). findWindowByLabel(Label) - when is_list(Label) -> + when ?is_chardata(Label) -> findWindowByLabel(Label, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxwindow.html#wxwindowfindwindowbylabel">external documentation</a>. @@ -408,7 +408,7 @@ findWindowByLabel(Label) Label::unicode:chardata(), Option :: {'parent', wxWindow()}. findWindowByLabel(Label, Options) - when is_list(Label),is_list(Options) -> + when ?is_chardata(Label),is_list(Options) -> Label_UC = unicode:characters_to_binary([Label,0]), MOpts = fun({parent, #wx_ref{type=ParentT,ref=ParentRef}}, Acc) -> ?CLASS(ParentT,wxWindow),[<<1:32/?UI,ParentRef:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, @@ -728,7 +728,7 @@ getSizer(#wx_ref{type=ThisT,ref=ThisRef}) -> This::wxWindow(), String::unicode:chardata(). getTextExtent(This,String) - when is_record(This, wx_ref),is_list(String) -> + when is_record(This, wx_ref),?is_chardata(String) -> getTextExtent(This,String, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxwindow.html#wxwindowgettextextent">external documentation</a>. @@ -737,7 +737,7 @@ getTextExtent(This,String) This::wxWindow(), String::unicode:chardata(), Option :: {'theFont', wxFont:wxFont()}. getTextExtent(#wx_ref{type=ThisT,ref=ThisRef},String, Options) - when is_list(String),is_list(Options) -> + when ?is_chardata(String),is_list(Options) -> ?CLASS(ThisT,wxWindow), String_UC = unicode:characters_to_binary([String,0]), MOpts = fun({theFont, #wx_ref{type=TheFontT,ref=TheFontRef}}, Acc) -> ?CLASS(TheFontT,wxFont),[<<1:32/?UI,TheFontRef:32/?UI>>|Acc]; @@ -1448,7 +1448,7 @@ setForegroundColour(#wx_ref{type=ThisT,ref=ThisRef},Colour) -spec setHelpText(This, Text) -> 'ok' when This::wxWindow(), Text::unicode:chardata(). setHelpText(#wx_ref{type=ThisT,ref=ThisRef},Text) - when is_list(Text) -> + when ?is_chardata(Text) -> ?CLASS(ThisT,wxWindow), Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:cast(?wxWindow_SetHelpText, @@ -1467,7 +1467,7 @@ setId(#wx_ref{type=ThisT,ref=ThisRef},Winid) -spec setLabel(This, Label) -> 'ok' when This::wxWindow(), Label::unicode:chardata(). setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label) - when is_list(Label) -> + when ?is_chardata(Label) -> ?CLASS(ThisT,wxWindow), Label_UC = unicode:characters_to_binary([Label,0]), wxe_util:cast(?wxWindow_SetLabel, @@ -1477,7 +1477,7 @@ setLabel(#wx_ref{type=ThisT,ref=ThisRef},Label) -spec setName(This, Name) -> 'ok' when This::wxWindow(), Name::unicode:chardata(). setName(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:cast(?wxWindow_SetName, @@ -1716,7 +1716,7 @@ setThemeEnabled(#wx_ref{type=ThisT,ref=ThisRef},EnableTheme) (This, Tip) -> 'ok' when This::wxWindow(), Tip::wxToolTip:wxToolTip(). setToolTip(#wx_ref{type=ThisT,ref=ThisRef},Tip) - when is_list(Tip) -> + when ?is_chardata(Tip) -> ?CLASS(ThisT,wxWindow), Tip_UC = unicode:characters_to_binary([Tip,0]), wxe_util:cast(?wxWindow_SetToolTip_1_0, diff --git a/lib/wx/src/gen/wxXmlResource.erl b/lib/wx/src/gen/wxXmlResource.erl index aa65b8b04e..51f6231f48 100644 --- a/lib/wx/src/gen/wxXmlResource.erl +++ b/lib/wx/src/gen/wxXmlResource.erl @@ -65,7 +65,7 @@ new(Options) Option :: {'flags', integer()} | {'domain', unicode:chardata()}. new(Filemask, Options) - when is_list(Filemask),is_list(Options) -> + when ?is_chardata(Filemask),is_list(Options) -> Filemask_UC = unicode:characters_to_binary([Filemask,0]), MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc]; ({domain, Domain}, Acc) -> Domain_UC = unicode:characters_to_binary([Domain,0]),[<<2:32/?UI,(byte_size(Domain_UC)):32/?UI,(Domain_UC)/binary, 0:(((8- ((0+byte_size(Domain_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -79,7 +79,7 @@ new(Filemask, Options) This::wxXmlResource(), Name::unicode:chardata(), Control::wxWindow:wxWindow(). attachUnknownControl(This,Name,Control) - when is_record(This, wx_ref),is_list(Name),is_record(Control, wx_ref) -> + when is_record(This, wx_ref),?is_chardata(Name),is_record(Control, wx_ref) -> attachUnknownControl(This,Name,Control, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxxmlresource.html#wxxmlresourceattachunknowncontrol">external documentation</a>. @@ -87,7 +87,7 @@ attachUnknownControl(This,Name,Control) This::wxXmlResource(), Name::unicode:chardata(), Control::wxWindow:wxWindow(), Option :: {'parent', wxWindow:wxWindow()}. attachUnknownControl(#wx_ref{type=ThisT,ref=ThisRef},Name,#wx_ref{type=ControlT,ref=ControlRef}, Options) - when is_list(Name),is_list(Options) -> + when ?is_chardata(Name),is_list(Options) -> ?CLASS(ThisT,wxXmlResource), Name_UC = unicode:characters_to_binary([Name,0]), ?CLASS(ControlT,wxWindow), @@ -169,7 +169,7 @@ initAllHandlers(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec load(This, Filemask) -> boolean() when This::wxXmlResource(), Filemask::unicode:chardata(). load(#wx_ref{type=ThisT,ref=ThisRef},Filemask) - when is_list(Filemask) -> + when ?is_chardata(Filemask) -> ?CLASS(ThisT,wxXmlResource), Filemask_UC = unicode:characters_to_binary([Filemask,0]), wxe_util:call(?wxXmlResource_Load, @@ -179,7 +179,7 @@ load(#wx_ref{type=ThisT,ref=ThisRef},Filemask) -spec loadBitmap(This, Name) -> wxBitmap:wxBitmap() when This::wxXmlResource(), Name::unicode:chardata(). loadBitmap(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxXmlResource_LoadBitmap, @@ -189,7 +189,7 @@ loadBitmap(#wx_ref{type=ThisT,ref=ThisRef},Name) -spec loadDialog(This, Parent, Name) -> wxDialog:wxDialog() when This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(ParentT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), @@ -200,7 +200,7 @@ loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},N -spec loadDialog(This, Dlg, Parent, Name) -> boolean() when This::wxXmlResource(), Dlg::wxDialog:wxDialog(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DlgT,ref=DlgRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(DlgT,wxDialog), ?CLASS(ParentT,wxWindow), @@ -212,7 +212,7 @@ loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DlgT,ref=DlgRef},#wx_ref -spec loadFrame(This, Parent, Name) -> wxFrame:wxFrame() when This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(ParentT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), @@ -223,7 +223,7 @@ loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Na -spec loadFrame(This, Frame, Parent, Name) -> boolean() when This::wxXmlResource(), Frame::wxFrame:wxFrame(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(FrameT,wxFrame), ?CLASS(ParentT,wxWindow), @@ -235,7 +235,7 @@ loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef},#wx_ -spec loadIcon(This, Name) -> wxIcon:wxIcon() when This::wxXmlResource(), Name::unicode:chardata(). loadIcon(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxXmlResource_LoadIcon, @@ -245,7 +245,7 @@ loadIcon(#wx_ref{type=ThisT,ref=ThisRef},Name) -spec loadMenu(This, Name) -> wxMenu:wxMenu() when This::wxXmlResource(), Name::unicode:chardata(). loadMenu(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxXmlResource_LoadMenu, @@ -255,7 +255,7 @@ loadMenu(#wx_ref{type=ThisT,ref=ThisRef},Name) -spec loadMenuBar(This, Name) -> wxMenuBar:wxMenuBar() when This::wxXmlResource(), Name::unicode:chardata(). loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxXmlResource_LoadMenuBar_1, @@ -265,7 +265,7 @@ loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},Name) -spec loadMenuBar(This, Parent, Name) -> wxMenuBar:wxMenuBar() when This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(ParentT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), @@ -276,7 +276,7 @@ loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, -spec loadPanel(This, Parent, Name) -> wxPanel:wxPanel() when This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(ParentT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), @@ -287,7 +287,7 @@ loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Na -spec loadPanel(This, Panel, Parent, Name) -> boolean() when This::wxXmlResource(), Panel::wxPanel:wxPanel(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PanelT,ref=PanelRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(PanelT,wxPanel), ?CLASS(ParentT,wxWindow), @@ -299,7 +299,7 @@ loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PanelT,ref=PanelRef},#wx_ -spec loadToolBar(This, Parent, Name) -> wxToolBar:wxToolBar() when This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadToolBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(ParentT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), @@ -327,7 +327,7 @@ setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags) -spec unload(This, Filename) -> boolean() when This::wxXmlResource(), Filename::unicode:chardata(). unload(#wx_ref{type=ThisT,ref=ThisRef},Filename) - when is_list(Filename) -> + when ?is_chardata(Filename) -> ?CLASS(ThisT,wxXmlResource), Filename_UC = unicode:characters_to_binary([Filename,0]), wxe_util:call(?wxXmlResource_Unload, diff --git a/lib/wx/src/gen/wx_misc.erl b/lib/wx/src/gen/wx_misc.erl index ce5d917136..66b1756a2f 100644 --- a/lib/wx/src/gen/wx_misc.erl +++ b/lib/wx/src/gen/wx_misc.erl @@ -72,7 +72,7 @@ bell() -> -spec findMenuItemId(Frame, MenuString, ItemString) -> integer() when Frame::wxFrame:wxFrame(), MenuString::unicode:chardata(), ItemString::unicode:chardata(). findMenuItemId(#wx_ref{type=FrameT,ref=FrameRef},MenuString,ItemString) - when is_list(MenuString),is_list(ItemString) -> + when ?is_chardata(MenuString),?is_chardata(ItemString) -> ?CLASS(FrameT,wxFrame), MenuString_UC = unicode:characters_to_binary([MenuString,0]), ItemString_UC = unicode:characters_to_binary([ItemString,0]), @@ -155,7 +155,7 @@ shell(Options) Url::unicode:chardata(). launchDefaultBrowser(Url) - when is_list(Url) -> + when ?is_chardata(Url) -> launchDefaultBrowser(Url, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_miscellany.html#wxlaunchdefaultbrowser">external documentation</a>. @@ -163,7 +163,7 @@ launchDefaultBrowser(Url) Url::unicode:chardata(), Option :: {'flags', integer()}. launchDefaultBrowser(Url, Options) - when is_list(Url),is_list(Options) -> + when ?is_chardata(Url),is_list(Options) -> Url_UC = unicode:characters_to_binary([Url,0]), MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, diff --git a/lib/wx/src/wxe.hrl b/lib/wx/src/wxe.hrl index da65cb939d..0f42d7e82e 100644 --- a/lib/wx/src/wxe.hrl +++ b/lib/wx/src/wxe.hrl @@ -44,6 +44,8 @@ -define(I, signed-native). -define(F, float-native). +-define(is_chardata(String), (is_list(String) orelse is_binary(String))). + -define(WXE_IDENTIFIER, wx_env). -define(BATCH_BEGIN, 0). -define(BATCH_END, 1). |