diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/javascript/weechat-js-api.cpp | 874 | ||||
-rw-r--r-- | src/plugins/javascript/weechat-js-v8.h | 2 | ||||
-rw-r--r-- | src/plugins/javascript/weechat-js.cpp | 25 | ||||
-rw-r--r-- | src/plugins/javascript/weechat-js.h | 6 |
4 files changed, 454 insertions, 453 deletions
diff --git a/src/plugins/javascript/weechat-js-api.cpp b/src/plugins/javascript/weechat-js-api.cpp index 6ffe55673..b456275bd 100644 --- a/src/plugins/javascript/weechat-js-api.cpp +++ b/src/plugins/javascript/weechat-js-api.cpp @@ -38,21 +38,20 @@ extern "C" #include "weechat-js-v8.h" #include "weechat-js-api.h" -using namespace v8; - #define API_DEF_FUNC(__name) \ - weechat_obj->Set(String::New(#__name), \ - FunctionTemplate::New(weechat_js_api_##__name)); + weechat_obj->Set( \ + v8::String::New(#__name), \ + v8::FunctionTemplate::New(weechat_js_api_##__name)); #define API_DEF_CONST_INT(__name) \ - weechat_obj->Set(String::New(#__name), \ - Integer::New(__name)); + weechat_obj->Set(v8::String::New(#__name), \ + v8::Integer::New(__name)); #define API_DEF_CONST_STR(__name) \ - weechat_obj->Set(String::New(#__name), \ - String::New(__name)); + weechat_obj->Set(v8::String::New(#__name), \ + v8::String::New(__name)); #define API_FUNC(__name) \ - static Handle<Value> \ - weechat_js_api_##__name(const Arguments &args) + static v8::Handle<v8::Value> \ + weechat_js_api_##__name(const v8::Arguments &args) #define API_INIT_FUNC(__init, __name, __args_fmt, __ret) \ std::string js_function_name(__name); \ std::string js_args(__args_fmt); \ @@ -99,23 +98,23 @@ using namespace v8; #define API_RETURN_OK return v8::True(); #define API_RETURN_ERROR return v8::False(); #define API_RETURN_EMPTY \ - return String::New(""); + return v8::String::New(""); #define API_RETURN_STRING(__string) \ if (__string) \ - return String::New(__string); \ - return String::New("") + return v8::String::New(__string); \ + return v8::String::New("") #define API_RETURN_STRING_FREE(__string) \ if (__string) \ { \ - Handle<Value> return_value = String::New(__string); \ + v8::Handle<v8::Value> return_value = v8::String::New(__string); \ free ((void *)__string); \ return return_value; \ } \ - return String::New("") + return v8::String::New("") #define API_RETURN_INT(__int) \ - return Integer::New(__int) + return v8::Integer::New(__int) #define API_RETURN_LONG(__int) \ - return Integer::New(__int) + return v8::Integer::New(__int) /* @@ -140,13 +139,13 @@ API_FUNC(register) js_current_script = NULL; js_registered_script = NULL; - String::Utf8Value name(args[0]); - String::Utf8Value author(args[1]); - String::Utf8Value version(args[2]); - String::Utf8Value license(args[3]); - String::Utf8Value description(args[4]); - String::Utf8Value shutdown_func(args[5]); - String::Utf8Value charset(args[6]); + v8::String::Utf8Value name(args[0]); + v8::String::Utf8Value author(args[1]); + v8::String::Utf8Value version(args[2]); + v8::String::Utf8Value license(args[3]); + v8::String::Utf8Value description(args[4]); + v8::String::Utf8Value shutdown_func(args[5]); + v8::String::Utf8Value charset(args[6]); if (plugin_script_search (weechat_js_plugin, js_scripts, *name)) { @@ -201,7 +200,7 @@ API_FUNC(plugin_get_name) API_INIT_FUNC(1, "plugin_get_name", "s", API_RETURN_EMPTY); - String::Utf8Value plugin(args[0]); + v8::String::Utf8Value plugin(args[0]); result = weechat_plugin_get_name ( (struct t_weechat_plugin *)API_STR2PTR(*plugin)); @@ -213,7 +212,7 @@ API_FUNC(charset_set) { API_INIT_FUNC(1, "charset_set", "s", API_RETURN_ERROR); - String::Utf8Value charset(args[0]); + v8::String::Utf8Value charset(args[0]); plugin_script_api_charset_set (js_current_script, *charset); @@ -226,8 +225,8 @@ API_FUNC(iconv_to_internal) API_INIT_FUNC(1, "iconv_to_internal", "ss", API_RETURN_EMPTY); - String::Utf8Value charset(args[0]); - String::Utf8Value string(args[1]); + v8::String::Utf8Value charset(args[0]); + v8::String::Utf8Value string(args[1]); result = weechat_iconv_to_internal (*charset, *string); @@ -240,8 +239,8 @@ API_FUNC(iconv_from_internal) API_INIT_FUNC(1, "iconv_from_internal", "ss", API_RETURN_EMPTY); - String::Utf8Value charset(args[0]); - String::Utf8Value string(args[1]); + v8::String::Utf8Value charset(args[0]); + v8::String::Utf8Value string(args[1]); result = weechat_iconv_from_internal (*charset, *string); @@ -254,7 +253,7 @@ API_FUNC(gettext) API_INIT_FUNC(1, "gettext", "s", API_RETURN_EMPTY); - String::Utf8Value string(args[0]); + v8::String::Utf8Value string(args[0]); result = weechat_gettext (*string); @@ -267,8 +266,8 @@ API_FUNC(ngettext) API_INIT_FUNC(1, "ngettext", "ssi", API_RETURN_EMPTY); - String::Utf8Value single(args[0]); - String::Utf8Value plural(args[1]); + v8::String::Utf8Value single(args[0]); + v8::String::Utf8Value plural(args[1]); int count = args[2]->IntegerValue(); result = weechat_ngettext (*single, *plural, count); @@ -282,7 +281,7 @@ API_FUNC(strlen_screen) API_INIT_FUNC(1, "strlen_screen", "s", API_RETURN_INT(0)); - String::Utf8Value string(args[0]); + v8::String::Utf8Value string(args[0]); value = weechat_strlen_screen (*string); @@ -295,8 +294,8 @@ API_FUNC(string_match) API_INIT_FUNC(1, "string_match", "ssi", API_RETURN_INT(0)); - String::Utf8Value string(args[0]); - String::Utf8Value mask(args[1]); + v8::String::Utf8Value string(args[0]); + v8::String::Utf8Value mask(args[1]); int case_sensitive = args[2]->IntegerValue(); value = weechat_string_match (*string, *mask, case_sensitive); @@ -310,8 +309,8 @@ API_FUNC(string_has_highlight) API_INIT_FUNC(1, "string_has_highlight", "ss", API_RETURN_INT(0)); - String::Utf8Value string(args[0]); - String::Utf8Value highlight_words(args[1]); + v8::String::Utf8Value string(args[0]); + v8::String::Utf8Value highlight_words(args[1]); value = weechat_string_has_highlight (*string, *highlight_words); @@ -324,8 +323,8 @@ API_FUNC(string_has_highlight_regex) API_INIT_FUNC(1, "string_has_highlight_regex", "ss", API_RETURN_INT(0)); - String::Utf8Value string(args[0]); - String::Utf8Value regex(args[1]); + v8::String::Utf8Value string(args[0]); + v8::String::Utf8Value regex(args[1]); value = weechat_string_has_highlight_regex (*string, *regex); @@ -338,7 +337,7 @@ API_FUNC(string_mask_to_regex) API_INIT_FUNC(1, "string_mask_to_regex", "s", API_RETURN_EMPTY); - String::Utf8Value mask(args[0]); + v8::String::Utf8Value mask(args[0]); result = weechat_string_mask_to_regex (*mask); @@ -351,8 +350,8 @@ API_FUNC(string_remove_color) API_INIT_FUNC(1, "string_remove_color", "ss", API_RETURN_EMPTY); - String::Utf8Value string(args[0]); - String::Utf8Value replacement(args[1]); + v8::String::Utf8Value string(args[0]); + v8::String::Utf8Value replacement(args[1]); result = weechat_string_remove_color (*string, *replacement); @@ -365,7 +364,7 @@ API_FUNC(string_is_command_char) API_INIT_FUNC(1, "string_is_command_char", "s", API_RETURN_INT(0)); - String::Utf8Value string(args[0]); + v8::String::Utf8Value string(args[0]); value = weechat_string_is_command_char (*string); @@ -378,7 +377,7 @@ API_FUNC(string_input_for_buffer) API_INIT_FUNC(1, "string_input_for_buffer", "s", API_RETURN_EMPTY); - String::Utf8Value string(args[0]); + v8::String::Utf8Value string(args[0]); result = weechat_string_input_for_buffer (*string); @@ -392,7 +391,7 @@ API_FUNC(string_eval_expression) API_INIT_FUNC(1, "string_eval_expression", "shhh", API_RETURN_EMPTY); - String::Utf8Value expr(args[0]); + v8::String::Utf8Value expr(args[0]); pointers = weechat_js_object_to_hashtable ( args[1]->ToObject(), WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, @@ -428,7 +427,7 @@ API_FUNC(mkdir_home) API_INIT_FUNC(1, "mkdir_home", "si", API_RETURN_ERROR); - String::Utf8Value directory(args[0]); + v8::String::Utf8Value directory(args[0]); mode = args[1]->IntegerValue(); if (weechat_mkdir_home (*directory, mode)) @@ -443,7 +442,7 @@ API_FUNC(mkdir) API_INIT_FUNC(1, "mkdir", "si", API_RETURN_ERROR); - String::Utf8Value directory(args[0]); + v8::String::Utf8Value directory(args[0]); mode = args[1]->IntegerValue(); if (weechat_mkdir (*directory, mode)) @@ -458,7 +457,7 @@ API_FUNC(mkdir_parents) API_INIT_FUNC(1, "mkdir_parents", "si", API_RETURN_ERROR); - String::Utf8Value directory(args[0]); + v8::String::Utf8Value directory(args[0]); mode = args[1]->IntegerValue(); if (weechat_mkdir_parents (*directory, mode)) @@ -484,10 +483,10 @@ API_FUNC(list_add) API_INIT_FUNC(1, "list_add", "ssss", API_RETURN_EMPTY); - String::Utf8Value weelist(args[0]); - String::Utf8Value data(args[1]); - String::Utf8Value where(args[2]); - String::Utf8Value user_data(args[3]); + v8::String::Utf8Value weelist(args[0]); + v8::String::Utf8Value data(args[1]); + v8::String::Utf8Value where(args[2]); + v8::String::Utf8Value user_data(args[3]); result = API_PTR2STR( weechat_list_add ((struct t_weelist *)API_STR2PTR(*weelist), @@ -504,8 +503,8 @@ API_FUNC(list_search) API_INIT_FUNC(1, "list_search", "ss", API_RETURN_EMPTY); - String::Utf8Value weelist(args[0]); - String::Utf8Value data(args[1]); + v8::String::Utf8Value weelist(args[0]); + v8::String::Utf8Value data(args[1]); result = API_PTR2STR( weechat_list_search ( @@ -520,8 +519,8 @@ API_FUNC(list_search_pos) API_INIT_FUNC(1, "list_search_pos", "ss", API_RETURN_INT(-1)); - String::Utf8Value weelist(args[0]); - String::Utf8Value data(args[1]); + v8::String::Utf8Value weelist(args[0]); + v8::String::Utf8Value data(args[1]); pos = weechat_list_search_pos ( (struct t_weelist *)API_STR2PTR(*weelist), *data); @@ -535,8 +534,8 @@ API_FUNC(list_casesearch) API_INIT_FUNC(1, "list_casesearch", "ss", API_RETURN_EMPTY); - String::Utf8Value weelist(args[0]); - String::Utf8Value data(args[1]); + v8::String::Utf8Value weelist(args[0]); + v8::String::Utf8Value data(args[1]); result = API_PTR2STR( weechat_list_casesearch ( @@ -551,8 +550,8 @@ API_FUNC(list_casesearch_pos) API_INIT_FUNC(1, "list_casesearch_pos", "ss", API_RETURN_INT(-1)); - String::Utf8Value weelist(args[0]); - String::Utf8Value data(args[1]); + v8::String::Utf8Value weelist(args[0]); + v8::String::Utf8Value data(args[1]); pos = weechat_list_casesearch_pos ( (struct t_weelist *)API_STR2PTR(*weelist), *data); @@ -567,7 +566,7 @@ API_FUNC(list_get) API_INIT_FUNC(1, "list_get", "si", API_RETURN_EMPTY); - String::Utf8Value weelist(args[0]); + v8::String::Utf8Value weelist(args[0]); position = args[1]->IntegerValue(); result = API_PTR2STR( @@ -581,8 +580,8 @@ API_FUNC(list_set) { API_INIT_FUNC(1, "list_set", "ss", API_RETURN_ERROR); - String::Utf8Value item(args[0]); - String::Utf8Value new_value(args[1]); + v8::String::Utf8Value item(args[0]); + v8::String::Utf8Value new_value(args[1]); weechat_list_set ((struct t_weelist_item *)API_STR2PTR(*item), *new_value); @@ -595,7 +594,7 @@ API_FUNC(list_next) API_INIT_FUNC(1, "list_next", "s", API_RETURN_EMPTY); - String::Utf8Value item(args[0]); + v8::String::Utf8Value item(args[0]); result = API_PTR2STR( weechat_list_next ((struct t_weelist_item *)API_STR2PTR(*item))); @@ -609,7 +608,7 @@ API_FUNC(list_prev) API_INIT_FUNC(1, "list_prev", "s", API_RETURN_EMPTY); - String::Utf8Value item(args[0]); + v8::String::Utf8Value item(args[0]); result = API_PTR2STR( weechat_list_prev ((struct t_weelist_item *)API_STR2PTR(*item))); @@ -623,7 +622,7 @@ API_FUNC(list_string) API_INIT_FUNC(1, "list_string", "s", API_RETURN_EMPTY); - String::Utf8Value item(args[0]); + v8::String::Utf8Value item(args[0]); result = weechat_list_string ( (struct t_weelist_item *)API_STR2PTR(*item)); @@ -637,7 +636,7 @@ API_FUNC(list_size) API_INIT_FUNC(1, "list_size", "s", API_RETURN_INT(0)); - String::Utf8Value weelist(args[0]); + v8::String::Utf8Value weelist(args[0]); size = weechat_list_size ((struct t_weelist *)API_STR2PTR(*weelist)); @@ -648,8 +647,8 @@ API_FUNC(list_remove) { API_INIT_FUNC(1, "list_remove", "ss", API_RETURN_ERROR); - String::Utf8Value weelist(args[0]); - String::Utf8Value item(args[1]); + v8::String::Utf8Value weelist(args[0]); + v8::String::Utf8Value item(args[1]); weechat_list_remove ((struct t_weelist *)API_STR2PTR(*weelist), (struct t_weelist_item *)API_STR2PTR(*item)); @@ -661,7 +660,7 @@ API_FUNC(list_remove_all) { API_INIT_FUNC(1, "list_remove_all", "s", API_RETURN_ERROR); - String::Utf8Value weelist(args[0]); + v8::String::Utf8Value weelist(args[0]); weechat_list_remove_all ((struct t_weelist *)API_STR2PTR(*weelist)); @@ -674,7 +673,7 @@ API_FUNC(list_free) if (args.Length() < 1) API_WRONG_ARGS(API_RETURN_ERROR); - String::Utf8Value weelist(args[0]); + v8::String::Utf8Value weelist(args[0]); weechat_list_free ((struct t_weelist *)API_STR2PTR(*weelist)); @@ -724,9 +723,9 @@ API_FUNC(config_new) API_INIT_FUNC(1, "config_new", "sss", API_RETURN_EMPTY); - String::Utf8Value name(args[0]); - String::Utf8Value function(args[1]); - String::Utf8Value data(args[2]); + v8::String::Utf8Value name(args[0]); + v8::String::Utf8Value function(args[1]); + v8::String::Utf8Value data(args[2]); result = API_PTR2STR( plugin_script_api_config_new (weechat_js_plugin, @@ -963,20 +962,20 @@ API_FUNC(config_new_section) API_INIT_FUNC(1, "config_new_section", "ssiissssssssss", API_RETURN_EMPTY); - String::Utf8Value config_file(args[0]); - String::Utf8Value name(args[1]); + v8::String::Utf8Value config_file(args[0]); + v8::String::Utf8Value name(args[1]); user_can_add_options = args[2]->IntegerValue(); user_can_delete_options = args[3]->IntegerValue(); - String::Utf8Value function_read(args[4]); - String::Utf8Value data_read(args[5]); - String::Utf8Value function_write(args[6]); - String::Utf8Value data_write(args[7]); - String::Utf8Value function_write_default(args[8]); - String::Utf8Value data_write_default(args[9]); - String::Utf8Value function_create_option(args[10]); - String::Utf8Value data_create_option(args[11]); - String::Utf8Value function_delete_option(args[12]); - String::Utf8Value data_delete_option(args[13]); + v8::String::Utf8Value function_read(args[4]); + v8::String::Utf8Value data_read(args[5]); + v8::String::Utf8Value function_write(args[6]); + v8::String::Utf8Value data_write(args[7]); + v8::String::Utf8Value function_write_default(args[8]); + v8::String::Utf8Value data_write_default(args[9]); + v8::String::Utf8Value function_create_option(args[10]); + v8::String::Utf8Value data_create_option(args[11]); + v8::String::Utf8Value function_delete_option(args[12]); + v8::String::Utf8Value data_delete_option(args[13]); result = API_PTR2STR( plugin_script_api_config_new_section ( @@ -1011,8 +1010,8 @@ API_FUNC(config_search_section) API_INIT_FUNC(1, "config_search_section", "ss", API_RETURN_EMPTY); - String::Utf8Value config_file(args[0]); - String::Utf8Value section_name(args[1]); + v8::String::Utf8Value config_file(args[0]); + v8::String::Utf8Value section_name(args[1]); result = API_PTR2STR( weechat_config_search_section ( @@ -1129,23 +1128,23 @@ API_FUNC(config_new_option) API_INIT_FUNC(1, "config_new_option", "ssssssiississssss", API_RETURN_EMPTY); - String::Utf8Value config_file(args[0]); - String::Utf8Value section(args[1]); - String::Utf8Value name(args[2]); - String::Utf8Value type(args[3]); - String::Utf8Value description(args[4]); - String::Utf8Value string_values(args[5]); + v8::String::Utf8Value config_file(args[0]); + v8::String::Utf8Value section(args[1]); + v8::String::Utf8Value name(args[2]); + v8::String::Utf8Value type(args[3]); + v8::String::Utf8Value description(args[4]); + v8::String::Utf8Value string_values(args[5]); min = args[6]->IntegerValue(); max = args[7]->IntegerValue(); - String::Utf8Value default_value(args[8]); - String::Utf8Value value(args[9]); + v8::String::Utf8Value default_value(args[8]); + v8::String::Utf8Value value(args[9]); null_value_allowed = args[10]->IntegerValue(); - String::Utf8Value function_check_value(args[11]); - String::Utf8Value data_check_value(args[12]); - String::Utf8Value function_change(args[13]); - String::Utf8Value data_change(args[14]); - String::Utf8Value function_delete(args[15]); - String::Utf8Value data_delete(args[16]); + v8::String::Utf8Value function_check_value(args[11]); + v8::String::Utf8Value data_check_value(args[12]); + v8::String::Utf8Value function_change(args[13]); + v8::String::Utf8Value data_change(args[14]); + v8::String::Utf8Value function_delete(args[15]); + v8::String::Utf8Value data_delete(args[16]); result = API_PTR2STR( plugin_script_api_config_new_option ( @@ -1181,9 +1180,9 @@ API_FUNC(config_search_option) API_INIT_FUNC(1, "config_search_option", "sss", API_RETURN_EMPTY); - String::Utf8Value config_file(args[0]); - String::Utf8Value section(args[1]); - String::Utf8Value option_name(args[2]); + v8::String::Utf8Value config_file(args[0]); + v8::String::Utf8Value section(args[1]); + v8::String::Utf8Value option_name(args[2]); result = API_PTR2STR( weechat_config_search_option ( @@ -1200,7 +1199,7 @@ API_FUNC(config_string_to_boolean) API_INIT_FUNC(1, "config_string_to_boolean", "s", API_RETURN_INT(0)); - String::Utf8Value text(args[0]); + v8::String::Utf8Value text(args[0]); value = weechat_config_string_to_boolean (*text); @@ -1213,7 +1212,7 @@ API_FUNC(config_option_reset) API_INIT_FUNC(1, "config_option_reset", "si", API_RETURN_INT(0)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); run_callback = args[1]->IntegerValue(); rc = weechat_config_option_reset ( @@ -1228,8 +1227,8 @@ API_FUNC(config_option_set) API_INIT_FUNC(1, "config_option_set", "ssi", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); - String::Utf8Value option(args[0]); - String::Utf8Value value(args[1]); + v8::String::Utf8Value option(args[0]); + v8::String::Utf8Value value(args[1]); run_callback = args[2]->IntegerValue(); rc = weechat_config_option_set ( @@ -1244,7 +1243,7 @@ API_FUNC(config_option_set_null) API_INIT_FUNC(1, "config_option_set_null", "si", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); run_callback = args[1]->IntegerValue(); rc = weechat_config_option_set_null ( @@ -1259,7 +1258,7 @@ API_FUNC(config_option_unset) API_INIT_FUNC(1, "config_option_unset", "s", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); rc = weechat_config_option_unset ( (struct t_config_option *) API_STR2PTR(*option)); @@ -1271,8 +1270,8 @@ API_FUNC(config_option_rename) { API_INIT_FUNC(1, "config_option_rename", "ss", API_RETURN_ERROR); - String::Utf8Value option(args[0]); - String::Utf8Value new_name(args[1]); + v8::String::Utf8Value option(args[0]); + v8::String::Utf8Value new_name(args[1]); weechat_config_option_rename ( (struct t_config_option *)API_STR2PTR(*option), *new_name); @@ -1286,7 +1285,7 @@ API_FUNC(config_option_is_null) API_INIT_FUNC(1, "config_option_is_null", "s", API_RETURN_INT(1)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); value = weechat_config_option_is_null ( (struct t_config_option *)API_STR2PTR(*option)); @@ -1300,7 +1299,7 @@ API_FUNC(config_option_default_is_null) API_INIT_FUNC(1, "config_option_default_is_null", "s", API_RETURN_INT(1)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); value = weechat_config_option_default_is_null ( (struct t_config_option *)API_STR2PTR(*option)); @@ -1314,7 +1313,7 @@ API_FUNC(config_boolean) API_INIT_FUNC(1, "config_boolean", "s", API_RETURN_INT(0)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); value = weechat_config_boolean ( (struct t_config_option *)API_STR2PTR(*option)); @@ -1328,7 +1327,7 @@ API_FUNC(config_boolean_default) API_INIT_FUNC(1, "config_boolean_default", "s", API_RETURN_INT(0)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); value = weechat_config_boolean_default ( (struct t_config_option *)API_STR2PTR(*option)); @@ -1342,7 +1341,7 @@ API_FUNC(config_integer) API_INIT_FUNC(1, "config_integer", "s", API_RETURN_INT(0)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); value = weechat_config_integer ( (struct t_config_option *)API_STR2PTR(*option)); @@ -1356,7 +1355,7 @@ API_FUNC(config_integer_default) API_INIT_FUNC(1, "config_integer_default", "s", API_RETURN_INT(0)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); value = weechat_config_integer_default ( (struct t_config_option *)API_STR2PTR(*option)); @@ -1370,7 +1369,7 @@ API_FUNC(config_string) API_INIT_FUNC(1, "config_string", "s", API_RETURN_EMPTY); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); result = weechat_config_string ( (struct t_config_option *)API_STR2PTR(*option)); @@ -1384,7 +1383,7 @@ API_FUNC(config_string_default) API_INIT_FUNC(1, "config_string_default", "s", API_RETURN_EMPTY); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); result = weechat_config_string_default ( (struct t_config_option *)API_STR2PTR(*option)); @@ -1398,7 +1397,7 @@ API_FUNC(config_color) API_INIT_FUNC(1, "config_color", "s", API_RETURN_EMPTY); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); result = weechat_config_color ( (struct t_config_option *)API_STR2PTR(*option)); @@ -1412,7 +1411,7 @@ API_FUNC(config_color_default) API_INIT_FUNC(1, "config_color_default", "s", API_RETURN_EMPTY); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); result = weechat_config_color_default ( (struct t_config_option *)API_STR2PTR(*option)); @@ -1424,8 +1423,8 @@ API_FUNC(config_write_option) { API_INIT_FUNC(1, "config_write_option", "ss", API_RETURN_ERROR); - String::Utf8Value config_file(args[0]); - String::Utf8Value option(args[1]); + v8::String::Utf8Value config_file(args[0]); + v8::String::Utf8Value option(args[1]); weechat_config_write_option ( (struct t_config_file *)API_STR2PTR(*config_file), @@ -1438,9 +1437,9 @@ API_FUNC(config_write_line) { API_INIT_FUNC(1, "config_write_line", "sss", API_RETURN_ERROR); - String::Utf8Value config_file(args[0]); - String::Utf8Value option_name(args[1]); - String::Utf8Value value(args[2]); + v8::String::Utf8Value config_file(args[0]); + v8::String::Utf8Value option_name(args[1]); + v8::String::Utf8Value value(args[2]); weechat_config_write_line ( (struct t_config_file *)API_STR2PTR(*config_file), @@ -1457,7 +1456,7 @@ API_FUNC(config_write) API_INIT_FUNC(1, "config_write", "s", API_RETURN_INT(WEECHAT_CONFIG_WRITE_ERROR)); - String::Utf8Value config_file(args[0]); + v8::String::Utf8Value config_file(args[0]); rc = weechat_config_write ( (struct t_config_file *)API_STR2PTR(*config_file)); @@ -1471,7 +1470,7 @@ API_FUNC(config_read) API_INIT_FUNC(1, "config_read", "s", API_RETURN_INT(-1)); - String::Utf8Value config_file(args[0]); + v8::String::Utf8Value config_file(args[0]); rc = weechat_config_read ( (struct t_config_file *)API_STR2PTR(*config_file)); @@ -1485,7 +1484,7 @@ API_FUNC(config_reload) API_INIT_FUNC(1, "config_reload", "s", API_RETURN_INT(-1)); - String::Utf8Value config_file(args[0]); + v8::String::Utf8Value config_file(args[0]); rc = weechat_config_reload ( (struct t_config_file *)API_STR2PTR(*config_file)); @@ -1497,7 +1496,7 @@ API_FUNC(config_option_free) { API_INIT_FUNC(1, "config_option_free", "s", API_RETURN_ERROR); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); plugin_script_api_config_option_free ( weechat_js_plugin, @@ -1511,7 +1510,7 @@ API_FUNC(config_section_free_options) { API_INIT_FUNC(1, "config_section_free_options", "s", API_RETURN_ERROR); - String::Utf8Value section(args[0]); + v8::String::Utf8Value section(args[0]); plugin_script_api_config_section_free_options ( weechat_js_plugin, @@ -1525,7 +1524,7 @@ API_FUNC(config_section_free) { API_INIT_FUNC(1, "config_section_free", "s", API_RETURN_ERROR); - String::Utf8Value section(args[0]); + v8::String::Utf8Value section(args[0]); plugin_script_api_config_section_free ( weechat_js_plugin, @@ -1539,7 +1538,7 @@ API_FUNC(config_free) { API_INIT_FUNC(1, "config_free", "s", API_RETURN_ERROR); - String::Utf8Value config_file(args[0]); + v8::String::Utf8Value config_file(args[0]); plugin_script_api_config_free ( weechat_js_plugin, @@ -1555,7 +1554,7 @@ API_FUNC(config_get) API_INIT_FUNC(1, "config_get", "s", API_RETURN_EMPTY); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); result = API_PTR2STR(weechat_config_get (*option)); @@ -1568,7 +1567,7 @@ API_FUNC(config_get_plugin) API_INIT_FUNC(1, "config_get_plugin", "s", API_RETURN_EMPTY); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); result = plugin_script_api_config_get_plugin (weechat_js_plugin, js_current_script, @@ -1583,7 +1582,7 @@ API_FUNC(config_is_set_plugin) API_INIT_FUNC(1, "config_is_set_plugin", "s", API_RETURN_INT(0)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); rc = plugin_script_api_config_is_set_plugin (weechat_js_plugin, js_current_script, @@ -1598,8 +1597,8 @@ API_FUNC(config_set_plugin) API_INIT_FUNC(1, "config_set_plugin", "ss", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); - String::Utf8Value option(args[0]); - String::Utf8Value value(args[1]); + v8::String::Utf8Value option(args[0]); + v8::String::Utf8Value value(args[1]); rc = plugin_script_api_config_set_plugin (weechat_js_plugin, js_current_script, @@ -1613,8 +1612,8 @@ API_FUNC(config_set_desc_plugin) { API_INIT_FUNC(1, "config_set_desc_plugin", "ss", API_RETURN_ERROR); - String::Utf8Value option(args[0]); - String::Utf8Value description(args[1]); + v8::String::Utf8Value option(args[0]); + v8::String::Utf8Value description(args[1]); plugin_script_api_config_set_desc_plugin (weechat_js_plugin, js_current_script, @@ -1630,7 +1629,7 @@ API_FUNC(config_unset_plugin) API_INIT_FUNC(1, "config_unset_plugin", "s", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); - String::Utf8Value option(args[0]); + v8::String::Utf8Value option(args[0]); rc = plugin_script_api_config_unset_plugin (weechat_js_plugin, js_current_script, @@ -1642,12 +1641,12 @@ API_FUNC(config_unset_plugin) API_FUNC(key_bind) { struct t_hashtable *hashtable; - Handle<Object> obj; + v8::Handle<v8::Object> obj; int num_keys; API_INIT_FUNC(1, "key_bind", "sh", API_RETURN_INT(0)); - String::Utf8Value context(args[0]); + v8::String::Utf8Value context(args[0]); hashtable = weechat_js_object_to_hashtable ( args[1]->ToObject(), WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, @@ -1668,8 +1667,8 @@ API_FUNC(key_unbind) API_INIT_FUNC(1, "key_unbind", "ss", API_RETURN_INT(0)); - String::Utf8Value context(args[0]); - String::Utf8Value key(args[1]); + v8::String::Utf8Value context(args[0]); + v8::String::Utf8Value key(args[1]); num_keys = weechat_key_unbind (*context, *key); @@ -1682,7 +1681,7 @@ API_FUNC(prefix) API_INIT_FUNC(0, "prefix", "s", API_RETURN_EMPTY); - String::Utf8Value prefix(args[0]); + v8::String::Utf8Value prefix(args[0]); result = weechat_prefix (*prefix); @@ -1695,7 +1694,7 @@ API_FUNC(color) API_INIT_FUNC(0, "color", "s", API_RETURN_EMPTY); - String::Utf8Value color(args[0]); + v8::String::Utf8Value color(args[0]); result = weechat_color (*color); @@ -1706,8 +1705,8 @@ API_FUNC(print) { API_INIT_FUNC(0, "print", "ss", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); - String::Utf8Value message(args[1]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value message(args[1]); plugin_script_api_printf (weechat_js_plugin, js_current_script, @@ -1723,10 +1722,10 @@ API_FUNC(print_date_tags) API_INIT_FUNC(1, "print_date_tags", "siss", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); + v8::String::Utf8Value buffer(args[0]); date = args[1]->IntegerValue(); - String::Utf8Value tags(args[2]); - String::Utf8Value message(args[3]); + v8::String::Utf8Value tags(args[2]); + v8::String::Utf8Value message(args[3]); plugin_script_api_printf_date_tags ( weechat_js_plugin, @@ -1745,9 +1744,9 @@ API_FUNC(print_y) API_INIT_FUNC(1, "print_y", "sis", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); + v8::String::Utf8Value buffer(args[0]); y = args[1]->IntegerValue(); - String::Utf8Value message(args[2]); + v8::String::Utf8Value message(args[2]); plugin_script_api_printf_y (weechat_js_plugin, js_current_script, @@ -1762,7 +1761,7 @@ API_FUNC(log_print) { API_INIT_FUNC(1, "log_print", "s", API_RETURN_ERROR); - String::Utf8Value message(args[0]); + v8::String::Utf8Value message(args[0]); plugin_script_api_log_printf (weechat_js_plugin, js_current_script, @@ -1819,13 +1818,13 @@ API_FUNC(hook_command) API_INIT_FUNC(1, "hook_command", "sssssss", API_RETURN_EMPTY); - String::Utf8Value command(args[0]); - String::Utf8Value description(args[1]); - String::Utf8Value arguments(args[2]); - String::Utf8Value args_description(args[3]); - String::Utf8Value completion(args[4]); - String::Utf8Value function(args[5]); - String::Utf8Value data(args[6]); + v8::String::Utf8Value command(args[0]); + v8::String::Utf8Value description(args[1]); + v8::String::Utf8Value arguments(args[2]); + v8::String::Utf8Value args_description(args[3]); + v8::String::Utf8Value completion(args[4]); + v8::String::Utf8Value function(args[5]); + v8::String::Utf8Value data(args[6]); result = API_PTR2STR( plugin_script_api_hook_command (weechat_js_plugin, @@ -1887,9 +1886,9 @@ API_FUNC(hook_command_run) API_INIT_FUNC(1, "hook_command_run", "sss", API_RETURN_EMPTY); - String::Utf8Value command(args[0]); - String::Utf8Value function(args[1]); - String::Utf8Value data(args[2]); + v8::String::Utf8Value command(args[0]); + v8::String::Utf8Value function(args[1]); + v8::String::Utf8Value data(args[2]); result = API_PTR2STR( plugin_script_api_hook_command_run ( @@ -1951,8 +1950,8 @@ API_FUNC(hook_timer) interval = args[0]->IntegerValue(); align_second = args[1]->IntegerValue(); max_calls = args[2]->IntegerValue(); - String::Utf8Value function(args[3]); - String::Utf8Value data(args[4]); + v8::String::Utf8Value function(args[3]); + v8::String::Utf8Value data(args[4]); result = API_PTR2STR( plugin_script_api_hook_timer ( @@ -2016,8 +2015,8 @@ API_FUNC(hook_fd) read = args[1]->IntegerValue(); write = args[2]->IntegerValue(); exception = args[3]->IntegerValue(); - String::Utf8Value function(args[4]); - String::Utf8Value data(args[5]); + v8::String::Utf8Value function(args[4]); + v8::String::Utf8Value data(args[5]); result = API_PTR2STR( plugin_script_api_hook_fd ( @@ -2081,10 +2080,10 @@ API_FUNC(hook_process) API_INIT_FUNC(1, "hook_process", "siss", API_RETURN_EMPTY); - String::Utf8Value command(args[0]); + v8::String::Utf8Value command(args[0]); timeout = args[1]->IntegerValue(); - String::Utf8Value function(args[2]); - String::Utf8Value data(args[3]); + v8::String::Utf8Value function(args[2]); + v8::String::Utf8Value data(args[3]); result = API_PTR2STR( plugin_script_api_hook_process ( @@ -2107,15 +2106,15 @@ API_FUNC(hook_process_hashtable) API_INIT_FUNC(1, "hook_process_hashtable", "shiss", API_RETURN_EMPTY); - String::Utf8Value command(args[0]); + v8::String::Utf8Value command(args[0]); options = weechat_js_object_to_hashtable ( args[1]->ToObject(), WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING); timeout = args[2]->IntegerValue(); - String::Utf8Value function(args[3]); - String::Utf8Value data(args[4]); + v8::String::Utf8Value function(args[3]); + v8::String::Utf8Value data(args[4]); result = API_PTR2STR( plugin_script_api_hook_process_hashtable ( @@ -2187,14 +2186,14 @@ API_FUNC(hook_connect) API_INIT_FUNC(1, "hook_connect", "ssiiisss", API_RETURN_EMPTY); - String::Utf8Value proxy(args[0]); - String::Utf8Value address(args[1]); + v8::String::Utf8Value proxy(args[0]); + v8::String::Utf8Value address(args[1]); port = args[2]->IntegerValue(); ipv6 = args[3]->IntegerValue(); retry = args[4]->IntegerValue(); - String::Utf8Value local_hostname(args[5]); - String::Utf8Value function(args[6]); - String::Utf8Value data(args[7]); + v8::String::Utf8Value local_hostname(args[5]); + v8::String::Utf8Value function(args[6]); + v8::String::Utf8Value data(args[7]); result = API_PTR2STR( plugin_script_api_hook_connect ( @@ -2281,12 +2280,12 @@ API_FUNC(hook_print) API_INIT_FUNC(1, "hook_print", "sssiss", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value tags(args[1]); - String::Utf8Value message(args[2]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value tags(args[1]); + v8::String::Utf8Value message(args[2]); strip_colors = args[3]->IntegerValue(); - String::Utf8Value function(args[4]); - String::Utf8Value data(args[5]); + v8::String::Utf8Value function(args[4]); + v8::String::Utf8Value data(args[5]); result = API_PTR2STR( plugin_script_api_hook_print ( @@ -2370,9 +2369,9 @@ API_FUNC(hook_signal) API_INIT_FUNC(1, "hook_signal", "sss", API_RETURN_EMPTY); - String::Utf8Value signal(args[0]); - String::Utf8Value function(args[1]); - String::Utf8Value data(args[2]); + v8::String::Utf8Value signal(args[0]); + v8::String::Utf8Value function(args[1]); + v8::String::Utf8Value data(args[2]); result = API_PTR2STR( plugin_script_api_hook_signal ( @@ -2393,9 +2392,9 @@ API_FUNC(hook_signal_send) API_INIT_FUNC(1, "hook_signal_send", "sss", API_RETURN_INT(WEECHAT_RC_ERROR)); - String::Utf8Value signal(args[0]); - String::Utf8Value type_data(args[1]); - String::Utf8Value signal_data(args[2]); + v8::String::Utf8Value signal(args[0]); + v8::String::Utf8Value type_data(args[1]); + v8::String::Utf8Value signal_data(args[2]); if (strcmp (*type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0) { @@ -2465,9 +2464,9 @@ API_FUNC(hook_hsignal) API_INIT_FUNC(1, "hook_hsignal", "sss", API_RETURN_EMPTY); - String::Utf8Value signal(args[0]); - String::Utf8Value function(args[1]); - String::Utf8Value data(args[2]); + v8::String::Utf8Value signal(args[0]); + v8::String::Utf8Value function(args[1]); + v8::String::Utf8Value data(args[2]); result = API_PTR2STR( plugin_script_api_hook_hsignal ( @@ -2488,7 +2487,7 @@ API_FUNC(hook_hsignal_send) API_INIT_FUNC(1, "hook_hsignal_send", "sh", API_RETURN_INT(WEECHAT_RC_ERROR)); - String::Utf8Value signal(args[0]); + v8::String::Utf8Value signal(args[0]); hashtable = weechat_js_object_to_hashtable ( args[1]->ToObject(), WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, @@ -2546,9 +2545,9 @@ API_FUNC(hook_config) API_INIT_FUNC(1, "hook_config", "sss", API_RETURN_EMPTY); - String::Utf8Value option(args[0]); - String::Utf8Value function(args[1]); - String::Utf8Value data(args[2]); + v8::String::Utf8Value option(args[0]); + v8::String::Utf8Value function(args[1]); + v8::String::Utf8Value data(args[2]); result = API_PTR2STR( plugin_script_api_hook_config ( @@ -2611,10 +2610,10 @@ API_FUNC(hook_completion) API_INIT_FUNC(1, "hook_completion", "ssss", API_RETURN_EMPTY); - String::Utf8Value completion(args[0]); - String::Utf8Value description(args[1]); - String::Utf8Value function(args[2]); - String::Utf8Value data(args[3]); + v8::String::Utf8Value completion(args[0]); + v8::String::Utf8Value description(args[1]); + v8::String::Utf8Value function(args[2]); + v8::String::Utf8Value data(args[3]); result = API_PTR2STR( plugin_script_api_hook_completion ( @@ -2635,10 +2634,10 @@ API_FUNC(hook_completion_list_add) API_INIT_FUNC(1, "hook_completion_list_add", "ssis", API_RETURN_ERROR); - String::Utf8Value completion(args[0]); - String::Utf8Value word(args[1]); + v8::String::Utf8Value completion(args[0]); + v8::String::Utf8Value word(args[1]); nick_completion = args[2]->IntegerValue(); - String::Utf8Value where(args[3]); + v8::String::Utf8Value where(args[3]); weechat_hook_completion_list_add ( (struct t_gui_completion *)API_STR2PTR(*completion), @@ -2682,9 +2681,9 @@ API_FUNC(hook_modifier) API_INIT_FUNC(1, "hook_modifier", "sss", API_RETURN_EMPTY); - String::Utf8Value modifier(args[0]); - String::Utf8Value function(args[1]); - String::Utf8Value data(args[2]); + v8::String::Utf8Value modifier(args[0]); + v8::String::Utf8Value function(args[1]); + v8::String::Utf8Value data(args[2]); result = API_PTR2STR( plugin_script_api_hook_modifier ( @@ -2704,9 +2703,9 @@ API_FUNC(hook_modifier_exec) API_INIT_FUNC(1, "hook_modifier_exec", "sss", API_RETURN_EMPTY); - String::Utf8Value modifier(args[0]); - String::Utf8Value modifier_data(args[1]); - String::Utf8Value string(args[2]); + v8::String::Utf8Value modifier(args[0]); + v8::String::Utf8Value modifier_data(args[1]); + v8::String::Utf8Value string(args[2]); result = weechat_hook_modifier_exec (*modifier, *modifier_data, *string); @@ -2745,11 +2744,11 @@ API_FUNC(hook_info) API_INIT_FUNC(1, "hook_info", "sssss", API_RETURN_EMPTY); - String::Utf8Value info_name(args[0]); - String::Utf8Value description(args[1]); - String::Utf8Value args_description(args[2]); - String::Utf8Value function(args[3]); - String::Utf8Value data(args[4]); + v8::String::Utf8Value info_name(args[0]); + v8::String::Utf8Value description(args[1]); + v8::String::Utf8Value args_description(args[2]); + v8::String::Utf8Value function(args[3]); + v8::String::Utf8Value data(args[4]); result = API_PTR2STR( plugin_script_api_hook_info ( @@ -2800,12 +2799,12 @@ API_FUNC(hook_info_hashtable) API_INIT_FUNC(1, "hook_info_hashtable", "ssssss", API_RETURN_EMPTY); - String::Utf8Value info_name(args[0]); - String::Utf8Value description(args[1]); - String::Utf8Value args_description(args[2]); - String::Utf8Value output_description(args[3]); - String::Utf8Value function(args[4]); - String::Utf8Value data(args[5]); + v8::String::Utf8Value info_name(args[0]); + v8::String::Utf8Value description(args[1]); + v8::String::Utf8Value args_description(args[2]); + v8::String::Utf8Value output_description(args[3]); + v8::String::Utf8Value function(args[4]); + v8::String::Utf8Value data(args[5]); result = API_PTR2STR( plugin_script_api_hook_info_hashtable ( @@ -2861,12 +2860,12 @@ API_FUNC(hook_infolist) API_INIT_FUNC(1, "hook_infolist", "ssssss", API_RETURN_EMPTY); - String::Utf8Value infolist_name(args[0]); - String::Utf8Value description(args[1]); - String::Utf8Value pointer_description(args[2]); - String::Utf8Value args_description(args[3]); - String::Utf8Value function(args[4]); - String::Utf8Value data(args[5]); + v8::String::Utf8Value infolist_name(args[0]); + v8::String::Utf8Value description(args[1]); + v8::String::Utf8Value pointer_description(args[2]); + v8::String::Utf8Value args_description(args[3]); + v8::String::Utf8Value function(args[4]); + v8::String::Utf8Value data(args[5]); result = API_PTR2STR( plugin_script_api_hook_infolist ( @@ -2917,9 +2916,9 @@ API_FUNC(hook_focus) API_INIT_FUNC(1, "hook_focus", "sss", API_RETURN_EMPTY); - String::Utf8Value area(args[0]); - String::Utf8Value function(args[1]); - String::Utf8Value data(args[2]); + v8::String::Utf8Value area(args[0]); + v8::String::Utf8Value function(args[1]); + v8::String::Utf8Value data(args[2]); result = API_PTR2STR( plugin_script_api_hook_focus ( @@ -2937,9 +2936,9 @@ API_FUNC(hook_set) { API_INIT_FUNC(1, "hook_set", "sss", API_RETURN_ERROR); - String::Utf8Value hook(args[0]); - String::Utf8Value property(args[1]); - String::Utf8Value value(args[2]); + v8::String::Utf8Value hook(args[0]); + v8::String::Utf8Value property(args[1]); + v8::String::Utf8Value value(args[2]); weechat_hook_set ((struct t_hook *)API_STR2PTR(*hook), *property, *value); @@ -2950,7 +2949,7 @@ API_FUNC(unhook) { API_INIT_FUNC(1, "unhook", "s", API_RETURN_ERROR); - String::Utf8Value hook(args[0]); + v8::String::Utf8Value hook(args[0]); plugin_script_api_unhook (weechat_js_plugin, js_current_script, @@ -2963,7 +2962,7 @@ API_FUNC(unhook_all) { API_INIT_FUNC(1, "unhook_all", "", API_RETURN_ERROR); - String::Utf8Value hook(args[0]); + v8::String::Utf8Value hook(args[0]); plugin_script_api_unhook_all (weechat_js_plugin, js_current_script); @@ -3054,11 +3053,11 @@ API_FUNC(buffer_new) API_INIT_FUNC(1, "buffer_new", "sssss", API_RETURN_EMPTY); - String::Utf8Value name(args[0]); - String::Utf8Value function_input(args[1]); - String::Utf8Value data_input(args[2]); - String::Utf8Value function_close(args[3]); - String::Utf8Value data_close(args[4]); + v8::String::Utf8Value name(args[0]); + v8::String::Utf8Value function_input(args[1]); + v8::String::Utf8Value data_input(args[2]); + v8::String::Utf8Value function_close(args[3]); + v8::String::Utf8Value data_close(args[4]); result = API_PTR2STR( plugin_script_api_buffer_new ( @@ -3081,8 +3080,8 @@ API_FUNC(buffer_search) API_INIT_FUNC(1, "buffer_search", "ss", API_RETURN_EMPTY); - String::Utf8Value plugin(args[0]); - String::Utf8Value name(args[1]); + v8::String::Utf8Value plugin(args[0]); + v8::String::Utf8Value name(args[1]); result = API_PTR2STR(weechat_buffer_search (*plugin, *name)); @@ -3115,7 +3114,7 @@ API_FUNC(buffer_clear) { API_INIT_FUNC(1, "buffer_clear", "s", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); + v8::String::Utf8Value buffer(args[0]); weechat_buffer_clear ((struct t_gui_buffer *)API_STR2PTR(*buffer)); @@ -3126,7 +3125,7 @@ API_FUNC(buffer_close) { API_INIT_FUNC(1, "buffer_close", "s", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); + v8::String::Utf8Value buffer(args[0]); plugin_script_api_buffer_close ( weechat_js_plugin, @@ -3140,8 +3139,8 @@ API_FUNC(buffer_merge) { API_INIT_FUNC(1, "buffer_merge", "ss", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); - String::Utf8Value target_buffer(args[1]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value target_buffer(args[1]); weechat_buffer_merge ((struct t_gui_buffer *)API_STR2PTR(*buffer), (struct t_gui_buffer *)API_STR2PTR(*target_buffer)); @@ -3155,7 +3154,7 @@ API_FUNC(buffer_unmerge) API_INIT_FUNC(1, "buffer_merge", "si", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); + v8::String::Utf8Value buffer(args[0]); number = args[1]->IntegerValue(); weechat_buffer_unmerge ((struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3170,8 +3169,8 @@ API_FUNC(buffer_get_integer) API_INIT_FUNC(1, "buffer_get_integer", "ss", API_RETURN_INT(-1)); - String::Utf8Value buffer(args[0]); - String::Utf8Value property(args[1]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value property(args[1]); value = weechat_buffer_get_integer ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3186,8 +3185,8 @@ API_FUNC(buffer_get_string) API_INIT_FUNC(1, "buffer_get_string", "ss", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value property(args[1]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value property(args[1]); result = weechat_buffer_get_string ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3205,8 +3204,8 @@ API_FUNC(buffer_get_pointer) API_INIT_FUNC(1, "buffer_get_pointer", "ss", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value property(args[1]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value property(args[1]); result = API_PTR2STR( weechat_buffer_get_pointer ( @@ -3220,9 +3219,9 @@ API_FUNC(buffer_set) { API_INIT_FUNC(1, "buffer_set", "sss", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); - String::Utf8Value property(args[1]); - String::Utf8Value value(args[2]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value property(args[1]); + v8::String::Utf8Value value(args[2]); weechat_buffer_set ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3238,8 +3237,8 @@ API_FUNC(buffer_string_replace_local_var) API_INIT_FUNC(1, "buffer_string_replace_local_var", "ss", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value string(args[1]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value string(args[1]); result = weechat_buffer_string_replace_local_var ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3254,8 +3253,8 @@ API_FUNC(buffer_match_list) API_INIT_FUNC(1, "buffer_match_list", "ss", API_RETURN_INT(0)); - String::Utf8Value buffer(args[0]); - String::Utf8Value string(args[1]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value string(args[1]); value = weechat_buffer_match_list ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3281,7 +3280,7 @@ API_FUNC(window_search_with_buffer) API_INIT_FUNC(1, "window_search_with_buffer", "s", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); + v8::String::Utf8Value buffer(args[0]); result = API_PTR2STR( weechat_window_search_with_buffer ( @@ -3296,8 +3295,8 @@ API_FUNC(window_get_integer) API_INIT_FUNC(1, "window_get_integer", "ss", API_RETURN_INT(-1)); - String::Utf8Value window(args[0]); - String::Utf8Value property(args[1]); + v8::String::Utf8Value window(args[0]); + v8::String::Utf8Value property(args[1]); value = weechat_window_get_integer ( (struct t_gui_window *)API_STR2PTR(*window), @@ -3312,8 +3311,8 @@ API_FUNC(window_get_string) API_INIT_FUNC(1, "window_get_string", "ss", API_RETURN_EMPTY); - String::Utf8Value window(args[0]); - String::Utf8Value property(args[1]); + v8::String::Utf8Value window(args[0]); + v8::String::Utf8Value property(args[1]); result = weechat_window_get_string ( (struct t_gui_window *)API_STR2PTR(*window), @@ -3328,8 +3327,8 @@ API_FUNC(window_get_pointer) API_INIT_FUNC(1, "window_get_pointer", "ss", API_RETURN_EMPTY); - String::Utf8Value window(args[0]); - String::Utf8Value property(args[1]); + v8::String::Utf8Value window(args[0]); + v8::String::Utf8Value property(args[1]); result = API_PTR2STR( weechat_window_get_pointer ( @@ -3343,7 +3342,7 @@ API_FUNC(window_set_title) { API_INIT_FUNC(1, "window_set_title", "s", API_RETURN_ERROR); - String::Utf8Value title(args[0]); + v8::String::Utf8Value title(args[0]); weechat_window_set_title (*title); @@ -3357,10 +3356,10 @@ API_FUNC(nicklist_add_group) API_INIT_FUNC(1, "nicklist_add_group", "ssssi", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value parent_group(args[1]); - String::Utf8Value name(args[2]); - String::Utf8Value color(args[3]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value parent_group(args[1]); + v8::String::Utf8Value name(args[2]); + v8::String::Utf8Value color(args[3]); visible = args[4]->IntegerValue(); result = API_PTR2STR( @@ -3380,9 +3379,9 @@ API_FUNC(nicklist_search_group) API_INIT_FUNC(1, "nicklist_search_group", "sss", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value from_group(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value from_group(args[1]); + v8::String::Utf8Value name(args[2]); result = API_PTR2STR( weechat_nicklist_search_group ( @@ -3400,12 +3399,12 @@ API_FUNC(nicklist_add_nick) API_INIT_FUNC(1, "nicklist_add_nick", "ssssssi", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value group(args[1]); - String::Utf8Value name(args[2]); - String::Utf8Value color(args[3]); - String::Utf8Value prefix(args[4]); - String::Utf8Value prefix_color(args[5]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value group(args[1]); + v8::String::Utf8Value name(args[2]); + v8::String::Utf8Value color(args[3]); + v8::String::Utf8Value prefix(args[4]); + v8::String::Utf8Value prefix_color(args[5]); visible = args[6]->IntegerValue(); result = API_PTR2STR( @@ -3427,9 +3426,9 @@ API_FUNC(nicklist_search_nick) API_INIT_FUNC(1, "nicklist_search_nick", "sss", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value from_group(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value from_group(args[1]); + v8::String::Utf8Value name(args[2]); result = API_PTR2STR( weechat_nicklist_search_nick ( @@ -3444,8 +3443,8 @@ API_FUNC(nicklist_remove_group) { API_INIT_FUNC(1, "nicklist_remove_group", "ss", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); - String::Utf8Value group(args[1]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value group(args[1]); weechat_nicklist_remove_group ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3458,8 +3457,8 @@ API_FUNC(nicklist_remove_nick) { API_INIT_FUNC(1, "nicklist_remove_nick", "ss", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); - String::Utf8Value nick(args[1]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value nick(args[1]); weechat_nicklist_remove_nick ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3472,7 +3471,7 @@ API_FUNC(nicklist_remove_all) { API_INIT_FUNC(1, "nicklist_remove_all", "s", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); + v8::String::Utf8Value buffer(args[0]); weechat_nicklist_remove_all ((struct t_gui_buffer *)API_STR2PTR(*buffer)); @@ -3485,9 +3484,9 @@ API_FUNC(nicklist_group_get_integer) API_INIT_FUNC(1, "nicklist_group_get_integer", "sss", API_RETURN_INT(-1)); - String::Utf8Value buffer(args[0]); - String::Utf8Value group(args[1]); - String::Utf8Value property(args[2]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value group(args[1]); + v8::String::Utf8Value property(args[2]); value = weechat_nicklist_group_get_integer ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3503,9 +3502,9 @@ API_FUNC(nicklist_group_get_string) API_INIT_FUNC(1, "nicklist_group_get_string", "sss", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value group(args[1]); - String::Utf8Value property(args[2]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value group(args[1]); + v8::String::Utf8Value property(args[2]); result = weechat_nicklist_group_get_string ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3521,9 +3520,9 @@ API_FUNC(nicklist_group_get_pointer) API_INIT_FUNC(1, "nicklist_group_get_pointer", "sss", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value group(args[1]); - String::Utf8Value property(args[2]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value group(args[1]); + v8::String::Utf8Value property(args[2]); result = API_PTR2STR( weechat_nicklist_group_get_pointer ( @@ -3538,10 +3537,10 @@ API_FUNC(nicklist_group_set) { API_INIT_FUNC(1, "nicklist_group_set", "ssss", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); - String::Utf8Value group(args[1]); - String::Utf8Value property(args[2]); - String::Utf8Value value(args[3]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value group(args[1]); + v8::String::Utf8Value property(args[2]); + v8::String::Utf8Value value(args[3]); weechat_nicklist_group_set ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3558,9 +3557,9 @@ API_FUNC(nicklist_nick_get_integer) API_INIT_FUNC(1, "nicklist_nick_get_integer", "sss", API_RETURN_INT(-1)); - String::Utf8Value buffer(args[0]); - String::Utf8Value nick(args[1]); - String::Utf8Value property(args[2]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value nick(args[1]); + v8::String::Utf8Value property(args[2]); value = weechat_nicklist_nick_get_integer ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3576,9 +3575,9 @@ API_FUNC(nicklist_nick_get_string) API_INIT_FUNC(1, "nicklist_nick_get_string", "sss", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value nick(args[1]); - String::Utf8Value property(args[2]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value nick(args[1]); + v8::String::Utf8Value property(args[2]); result = weechat_nicklist_nick_get_string ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3594,9 +3593,9 @@ API_FUNC(nicklist_nick_get_pointer) API_INIT_FUNC(1, "nicklist_nick_get_pointer", "sss", API_RETURN_EMPTY); - String::Utf8Value buffer(args[0]); - String::Utf8Value nick(args[1]); - String::Utf8Value property(args[2]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value nick(args[1]); + v8::String::Utf8Value property(args[2]); result = API_PTR2STR( weechat_nicklist_nick_get_pointer ( @@ -3611,10 +3610,10 @@ API_FUNC(nicklist_nick_set) { API_INIT_FUNC(1, "nicklist_nick_set", "ssss", API_RETURN_ERROR); - String::Utf8Value buffer(args[0]); - String::Utf8Value nick(args[1]); - String::Utf8Value property(args[2]); - String::Utf8Value value(args[3]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value nick(args[1]); + v8::String::Utf8Value property(args[2]); + v8::String::Utf8Value value(args[3]); weechat_nicklist_nick_set ( (struct t_gui_buffer *)API_STR2PTR(*buffer), @@ -3631,7 +3630,7 @@ API_FUNC(bar_item_search) API_INIT_FUNC(1, "bar_item_search", "s", API_RETURN_EMPTY); - String::Utf8Value name(args[0]); + v8::String::Utf8Value name(args[0]); result = API_PTR2STR(weechat_bar_item_search (*name)); @@ -3705,9 +3704,9 @@ API_FUNC(bar_item_new) API_INIT_FUNC(1, "bar_item_new", "sss", API_RETURN_EMPTY); - String::Utf8Value name(args[0]); - String::Utf8Value function(args[1]); - String::Utf8Value data(args[2]); + v8::String::Utf8Value name(args[0]); + v8::String::Utf8Value function(args[1]); + v8::String::Utf8Value data(args[2]); result = API_PTR2STR( plugin_script_api_bar_item_new ( @@ -3725,7 +3724,7 @@ API_FUNC(bar_item_update) { API_INIT_FUNC(1, "bar_item_update", "s", API_RETURN_ERROR); - String::Utf8Value name(args[0]); + v8::String::Utf8Value name(args[0]); weechat_bar_item_update (*name); @@ -3736,7 +3735,7 @@ API_FUNC(bar_item_remove) { API_INIT_FUNC(1, "bar_item_remove", "s", API_RETURN_ERROR); - String::Utf8Value item(args[0]); + v8::String::Utf8Value item(args[0]); plugin_script_api_bar_item_remove ( weechat_js_plugin, @@ -3752,7 +3751,7 @@ API_FUNC(bar_search) API_INIT_FUNC(1, "bar_search", "s", API_RETURN_EMPTY); - String::Utf8Value name(args[0]); + v8::String::Utf8Value name(args[0]); result = API_PTR2STR(weechat_bar_search (*name)); @@ -3765,21 +3764,21 @@ API_FUNC(bar_new) API_INIT_FUNC(1, "bar_new", "sssssssssssssss", API_RETURN_EMPTY); - String::Utf8Value name(args[0]); - String::Utf8Value hidden(args[1]); - String::Utf8Value priority(args[2]); - String::Utf8Value type(args[3]); - String::Utf8Value conditions(args[4]); - String::Utf8Value position(args[5]); - String::Utf8Value filling_top_bottom(args[6]); - String::Utf8Value filling_left_right(args[7]); - String::Utf8Value size(args[8]); - String::Utf8Value size_max(args[9]); - String::Utf8Value color_fg(args[10]); - String::Utf8Value color_delim(args[11]); - String::Utf8Value color_bg(args[12]); - String::Utf8Value separator(args[13]); - String::Utf8Value items(args[14]); + v8::String::Utf8Value name(args[0]); + v8::String::Utf8Value hidden(args[1]); + v8::String::Utf8Value priority(args[2]); + v8::String::Utf8Value type(args[3]); + v8::String::Utf8Value conditions(args[4]); + v8::String::Utf8Value position(args[5]); + v8::String::Utf8Value filling_top_bottom(args[6]); + v8::String::Utf8Value filling_left_right(args[7]); + v8::String::Utf8Value size(args[8]); + v8::String::Utf8Value size_max(args[9]); + v8::String::Utf8Value color_fg(args[10]); + v8::String::Utf8Value color_delim(args[11]); + v8::String::Utf8Value color_bg(args[12]); + v8::String::Utf8Value separator(args[13]); + v8::String::Utf8Value items(args[14]); result = API_PTR2STR(weechat_bar_new (*name, *hidden, @@ -3806,9 +3805,9 @@ API_FUNC(bar_set) API_INIT_FUNC(1, "bar_set", "sss", API_RETURN_INT(0)); - String::Utf8Value bar(args[0]); - String::Utf8Value property(args[1]); - String::Utf8Value value(args[2]); + v8::String::Utf8Value bar(args[0]); + v8::String::Utf8Value property(args[1]); + v8::String::Utf8Value value(args[2]); rc = weechat_bar_set ( (struct t_gui_bar *)API_STR2PTR(*bar), @@ -3822,7 +3821,7 @@ API_FUNC(bar_update) { API_INIT_FUNC(1, "bar_update", "s", API_RETURN_ERROR); - String::Utf8Value name(args[0]); + v8::String::Utf8Value name(args[0]); weechat_bar_update (*name); @@ -3833,7 +3832,7 @@ API_FUNC(bar_remove) { API_INIT_FUNC(1, "bar_remove", "s", API_RETURN_ERROR); - String::Utf8Value bar(args[0]); + v8::String::Utf8Value bar(args[0]); weechat_bar_remove ((struct t_gui_bar *)API_STR2PTR(*bar)); @@ -3846,8 +3845,8 @@ API_FUNC(command) API_INIT_FUNC(1, "command", "ss", API_RETURN_INT(WEECHAT_RC_ERROR)); - String::Utf8Value buffer(args[0]); - String::Utf8Value command(args[1]); + v8::String::Utf8Value buffer(args[0]); + v8::String::Utf8Value command(args[1]); rc = plugin_script_api_command (weechat_js_plugin, js_current_script, @@ -3863,8 +3862,8 @@ API_FUNC(info_get) API_INIT_FUNC(1, "info_get", "ss", API_RETURN_EMPTY); - String::Utf8Value info_name(args[0]); - String::Utf8Value arguments(args[1]); + v8::String::Utf8Value info_name(args[0]); + v8::String::Utf8Value arguments(args[1]); result = weechat_info_get (*info_name, *arguments); @@ -3874,10 +3873,11 @@ API_FUNC(info_get) API_FUNC(info_get_hashtable) { struct t_hashtable *hashtable, *result_hashtable; + v8::Handle<v8::Object> result_obj; API_INIT_FUNC(1, "info_get_hashtable", "sh", API_RETURN_EMPTY); - String::Utf8Value info_name(args[0]); + v8::String::Utf8Value info_name(args[0]); hashtable = weechat_js_object_to_hashtable ( args[1]->ToObject(), WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, @@ -3885,7 +3885,7 @@ API_FUNC(info_get_hashtable) WEECHAT_HASHTABLE_STRING); result_hashtable = weechat_info_get_hashtable (*info_name, hashtable); - Handle<Object> result_obj = weechat_js_hashtable_to_object ( + result_obj = weechat_js_hashtable_to_object ( result_hashtable); if (hashtable) @@ -3913,7 +3913,7 @@ API_FUNC(infolist_new_item) API_INIT_FUNC(1, "infolist_new_item", "s", API_RETURN_EMPTY); - String::Utf8Value infolist(args[0]); + v8::String::Utf8Value infolist(args[0]); result = API_PTR2STR( weechat_infolist_new_item ( @@ -3929,8 +3929,8 @@ API_FUNC(infolist_new_var_integer) API_INIT_FUNC(1, "infolist_new_var_integer", "ssi", API_RETURN_EMPTY); - String::Utf8Value item(args[0]); - String::Utf8Value name(args[1]); + v8::String::Utf8Value item(args[0]); + v8::String::Utf8Value name(args[1]); value = args[2]->IntegerValue(); result = API_PTR2STR( @@ -3948,9 +3948,9 @@ API_FUNC(infolist_new_var_string) API_INIT_FUNC(1, "infolist_new_var_string", "sss", API_RETURN_EMPTY); - String::Utf8Value item(args[0]); - String::Utf8Value name(args[1]); - String::Utf8Value value(args[2]); + v8::String::Utf8Value item(args[0]); + v8::String::Utf8Value name(args[1]); + v8::String::Utf8Value value(args[2]); result = API_PTR2STR( weechat_infolist_new_var_string ( @@ -3967,9 +3967,9 @@ API_FUNC(infolist_new_var_pointer) API_INIT_FUNC(1, "infolist_new_var_pointer", "sss", API_RETURN_EMPTY); - String::Utf8Value item(args[0]); - String::Utf8Value name(args[1]); - String::Utf8Value value(args[2]); + v8::String::Utf8Value item(args[0]); + v8::String::Utf8Value name(args[1]); + v8::String::Utf8Value value(args[2]); result = API_PTR2STR( weechat_infolist_new_var_pointer ( @@ -3987,8 +3987,8 @@ API_FUNC(infolist_new_var_time) API_INIT_FUNC(1, "infolist_new_var_time", "ssi", API_RETURN_EMPTY); - String::Utf8Value item(args[0]); - String::Utf8Value name(args[1]); + v8::String::Utf8Value item(args[0]); + v8::String::Utf8Value name(args[1]); value = args[2]->IntegerValue(); result = API_PTR2STR( @@ -4006,9 +4006,9 @@ API_FUNC(infolist_get) API_INIT_FUNC(1, "infolist_get", "sss", API_RETURN_EMPTY); - String::Utf8Value name(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value arguments(args[2]); + v8::String::Utf8Value name(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value arguments(args[2]); result = API_PTR2STR( weechat_infolist_get ( @@ -4025,7 +4025,7 @@ API_FUNC(infolist_next) API_INIT_FUNC(1, "infolist_next", "s", API_RETURN_INT(0)); - String::Utf8Value infolist(args[0]); + v8::String::Utf8Value infolist(args[0]); value = weechat_infolist_next ( (struct t_infolist *)API_STR2PTR(*infolist)); @@ -4039,7 +4039,7 @@ API_FUNC(infolist_prev) API_INIT_FUNC(1, "infolist_prev", "s", API_RETURN_INT(0)); - String::Utf8Value infolist(args[0]); + v8::String::Utf8Value infolist(args[0]); value = weechat_infolist_prev ( (struct t_infolist *)API_STR2PTR(*infolist)); @@ -4051,7 +4051,7 @@ API_FUNC(infolist_reset_item_cursor) { API_INIT_FUNC(1, "infolist_reset_item_cursor", "s", API_RETURN_ERROR); - String::Utf8Value infolist(args[0]); + v8::String::Utf8Value infolist(args[0]); weechat_infolist_reset_item_cursor ( (struct t_infolist *)API_STR2PTR(*infolist)); @@ -4065,7 +4065,7 @@ API_FUNC(infolist_fields) API_INIT_FUNC(1, "infolist_fields", "s", API_RETURN_EMPTY); - String::Utf8Value infolist(args[0]); + v8::String::Utf8Value infolist(args[0]); result = weechat_infolist_fields ( (struct t_infolist *)API_STR2PTR(*infolist)); @@ -4079,8 +4079,8 @@ API_FUNC(infolist_integer) API_INIT_FUNC(1, "infolist_integer", "ss", API_RETURN_INT(0)); - String::Utf8Value infolist(args[0]); - String::Utf8Value variable(args[1]); + v8::String::Utf8Value infolist(args[0]); + v8::String::Utf8Value variable(args[1]); value = weechat_infolist_integer ( (struct t_infolist *)API_STR2PTR(*infolist), @@ -4095,8 +4095,8 @@ API_FUNC(infolist_string) API_INIT_FUNC(1, "infolist_string", "ss", API_RETURN_EMPTY); - String::Utf8Value infolist(args[0]); - String::Utf8Value variable(args[1]); + v8::String::Utf8Value infolist(args[0]); + v8::String::Utf8Value variable(args[1]); result = weechat_infolist_string ( (struct t_infolist *)API_STR2PTR(*infolist), @@ -4111,8 +4111,8 @@ API_FUNC(infolist_pointer) API_INIT_FUNC(1, "infolist_pointer", "ss", API_RETURN_EMPTY); - String::Utf8Value infolist(args[0]); - String::Utf8Value variable(args[1]); + v8::String::Utf8Value infolist(args[0]); + v8::String::Utf8Value variable(args[1]); result = API_PTR2STR( weechat_infolist_pointer ( @@ -4130,8 +4130,8 @@ API_FUNC(infolist_time) API_INIT_FUNC(1, "infolist_time", "ss", API_RETURN_EMPTY); - String::Utf8Value infolist(args[0]); - String::Utf8Value variable(args[1]); + v8::String::Utf8Value infolist(args[0]); + v8::String::Utf8Value variable(args[1]); time = weechat_infolist_time ( (struct t_infolist *)API_STR2PTR(*infolist), @@ -4148,7 +4148,7 @@ API_FUNC(infolist_free) { API_INIT_FUNC(1, "infolist_free", "s", API_RETURN_ERROR); - String::Utf8Value infolist(args[0]); + v8::String::Utf8Value infolist(args[0]); weechat_infolist_free ((struct t_infolist *)API_STR2PTR(*infolist)); @@ -4161,7 +4161,7 @@ API_FUNC(hdata_get) API_INIT_FUNC(1, "hdata_get", "s", API_RETURN_EMPTY); - String::Utf8Value name(args[0]); + v8::String::Utf8Value name(args[0]); result = API_PTR2STR(weechat_hdata_get (*name)); @@ -4174,8 +4174,8 @@ API_FUNC(hdata_get_var_offset) API_INIT_FUNC(1, "hdata_get_var_offset", "ss", API_RETURN_INT(0)); - String::Utf8Value hdata(args[0]); - String::Utf8Value name(args[1]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value name(args[1]); value = weechat_hdata_get_var_offset ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4190,8 +4190,8 @@ API_FUNC(hdata_get_var_type_string) API_INIT_FUNC(1, "hdata_get_var_type_string", "ss", API_RETURN_EMPTY); - String::Utf8Value hdata(args[0]); - String::Utf8Value name(args[1]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value name(args[1]); result = weechat_hdata_get_var_type_string ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4206,9 +4206,9 @@ API_FUNC(hdata_get_var_array_size) API_INIT_FUNC(1, "hdata_get_var_array_size", "sss", API_RETURN_INT(-1)); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value name(args[2]); value = weechat_hdata_get_var_array_size ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4224,9 +4224,9 @@ API_FUNC(hdata_get_var_array_size_string) API_INIT_FUNC(1, "hdata_get_var_array_size_string", "sss", API_RETURN_EMPTY); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value name(args[2]); result = weechat_hdata_get_var_array_size_string ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4242,8 +4242,8 @@ API_FUNC(hdata_get_var_hdata) API_INIT_FUNC(1, "hdata_get_var_hdata", "ss", API_RETURN_EMPTY); - String::Utf8Value hdata(args[0]); - String::Utf8Value name(args[1]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value name(args[1]); result = weechat_hdata_get_var_hdata ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4258,8 +4258,8 @@ API_FUNC(hdata_get_list) API_INIT_FUNC(1, "hdata_get_list", "s", API_RETURN_EMPTY); - String::Utf8Value hdata(args[0]); - String::Utf8Value name(args[1]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value name(args[1]); result = API_PTR2STR( weechat_hdata_get_list ( @@ -4275,9 +4275,9 @@ API_FUNC(hdata_check_pointer) API_INIT_FUNC(1, "hdata_check_pointer", "sss", API_RETURN_INT(0)); - String::Utf8Value hdata(args[0]); - String::Utf8Value list(args[1]); - String::Utf8Value pointer(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value list(args[1]); + v8::String::Utf8Value pointer(args[2]); value = weechat_hdata_check_pointer ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4294,8 +4294,8 @@ API_FUNC(hdata_move) API_INIT_FUNC(1, "hdata_move", "ssi", API_RETURN_EMPTY); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); count = args[2]->IntegerValue(); result = API_PTR2STR( @@ -4314,9 +4314,9 @@ API_FUNC(hdata_search) API_INIT_FUNC(1, "hdata_search", "sssi", API_RETURN_EMPTY); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value search(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value search(args[2]); move = args[3]->IntegerValue(); result = API_PTR2STR( @@ -4335,9 +4335,9 @@ API_FUNC(hdata_char) API_INIT_FUNC(1, "hdata_char", "sss", API_RETURN_INT(0)); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value name(args[2]); value = (int)weechat_hdata_char ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4353,9 +4353,9 @@ API_FUNC(hdata_integer) API_INIT_FUNC(1, "hdata_integer", "sss", API_RETURN_INT(0)); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value name(args[2]); value = weechat_hdata_integer ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4371,9 +4371,9 @@ API_FUNC(hdata_long) API_INIT_FUNC(1, "hdata_long", "sss", API_RETURN_LONG(0)); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value name(args[2]); value = weechat_hdata_long ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4389,9 +4389,9 @@ API_FUNC(hdata_string) API_INIT_FUNC(1, "hdata_string", "sss", API_RETURN_EMPTY); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value name(args[2]); result = weechat_hdata_string ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4407,9 +4407,9 @@ API_FUNC(hdata_pointer) API_INIT_FUNC(1, "hdata_pointer", "sss", API_RETURN_EMPTY); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value name(args[2]); result = API_PTR2STR( weechat_hdata_pointer ( @@ -4426,9 +4426,9 @@ API_FUNC(hdata_time) API_INIT_FUNC(1, "hdata_time", "sss", API_RETURN_LONG(0)); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value name(args[2]); time = weechat_hdata_time ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4440,13 +4440,15 @@ API_FUNC(hdata_time) API_FUNC(hdata_hashtable) { + v8::Handle<v8::Object> result_obj; + API_INIT_FUNC(1, "hdata_hashtable", "sss", API_RETURN_EMPTY); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); - String::Utf8Value name(args[2]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); + v8::String::Utf8Value name(args[2]); - Handle<Object> result_obj = weechat_js_hashtable_to_object ( + result_obj = weechat_js_hashtable_to_object ( weechat_hdata_hashtable ( (struct t_hdata *)API_STR2PTR(*hdata), API_STR2PTR(*pointer), @@ -4462,8 +4464,8 @@ API_FUNC(hdata_update) API_INIT_FUNC(1, "hdata_update", "ssh", API_RETURN_INT(0)); - String::Utf8Value hdata(args[0]); - String::Utf8Value pointer(args[1]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value pointer(args[1]); hashtable = weechat_js_object_to_hashtable ( args[2]->ToObject(), WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, @@ -4487,8 +4489,8 @@ API_FUNC(hdata_get_string) API_INIT_FUNC(1, "hdata_get_string", "ss", API_RETURN_EMPTY); - String::Utf8Value hdata(args[0]); - String::Utf8Value property(args[1]); + v8::String::Utf8Value hdata(args[0]); + v8::String::Utf8Value property(args[1]); result = weechat_hdata_get_string ( (struct t_hdata *)API_STR2PTR(*hdata), @@ -4504,7 +4506,7 @@ API_FUNC(upgrade_new) API_INIT_FUNC(1, "upgrade_new", "si", API_RETURN_EMPTY); - String::Utf8Value filename(args[0]); + v8::String::Utf8Value filename(args[0]); write = args[1]->IntegerValue(); result = API_PTR2STR(weechat_upgrade_new (*filename, write)); @@ -4518,9 +4520,9 @@ API_FUNC(upgrade_write_object) API_INIT_FUNC(1, "upgrade_write_object", "sis", API_RETURN_INT(0)); - String::Utf8Value upgrade_file(args[0]); + v8::String::Utf8Value upgrade_file(args[0]); object_id = args[1]->IntegerValue(); - String::Utf8Value infolist(args[2]); + v8::String::Utf8Value infolist(args[2]); rc = weechat_upgrade_write_object ( (struct t_upgrade_file *)API_STR2PTR(*upgrade_file), @@ -4582,9 +4584,9 @@ API_FUNC(upgrade_read) API_INIT_FUNC(1, "upgrade_read", "sss", API_RETURN_INT(0)); - String::Utf8Value upgrade_file(args[0]); - String::Utf8Value function(args[1]); - String::Utf8Value data(args[2]); + v8::String::Utf8Value upgrade_file(args[0]); + v8::String::Utf8Value function(args[1]); + v8::String::Utf8Value data(args[2]); rc = plugin_script_api_upgrade_read ( weechat_js_plugin, @@ -4601,7 +4603,7 @@ API_FUNC(upgrade_close) { API_INIT_FUNC(1, "upgrade_close", "sss", API_RETURN_ERROR); - String::Utf8Value upgrade_file(args[0]); + v8::String::Utf8Value upgrade_file(args[0]); weechat_upgrade_close ( (struct t_upgrade_file *)API_STR2PTR(*upgrade_file)); @@ -4612,7 +4614,7 @@ API_FUNC(upgrade_close) void WeechatJsV8::loadLibs() { - Local<ObjectTemplate> weechat_obj = ObjectTemplate::New(); + v8::Local<v8::ObjectTemplate> weechat_obj = v8::ObjectTemplate::New(); /* constants */ API_DEF_CONST_INT(WEECHAT_RC_OK); diff --git a/src/plugins/javascript/weechat-js-v8.h b/src/plugins/javascript/weechat-js-v8.h index d0c94d523..45e4208f9 100644 --- a/src/plugins/javascript/weechat-js-v8.h +++ b/src/plugins/javascript/weechat-js-v8.h @@ -46,7 +46,7 @@ public: private: v8::HandleScope handle_scope; v8::Handle<v8::ObjectTemplate> global; - v8::Persistent<Context> context; + v8::Persistent<v8::Context> context; v8::Handle<v8::String> source; }; diff --git a/src/plugins/javascript/weechat-js.cpp b/src/plugins/javascript/weechat-js.cpp index 1dcfe86b5..8295b7fe2 100644 --- a/src/plugins/javascript/weechat-js.cpp +++ b/src/plugins/javascript/weechat-js.cpp @@ -89,19 +89,19 @@ weechat_js_hashtable_map_cb (void *data, /* make C++ compiler happy */ (void) hashtable; - Handle<Object> *obj = (Handle<Object> *)data; + v8::Handle<v8::Object> *obj = (v8::Handle<v8::Object> *)data; - (*obj)->Set(String::New(key), String::New(value)); + (*obj)->Set(v8::String::New(key), v8::String::New(value)); } /* * Converts a WeeChat hashtable to a javascript hashtable. */ -Handle<Object> +v8::Handle<v8::Object> weechat_js_hashtable_to_object (struct t_hashtable *hashtable) { - Handle<Object> obj = Object::New(); + v8::Handle<v8::Object> obj = v8::Object::New(); weechat_hashtable_map_string (hashtable, &weechat_js_hashtable_map_cb, @@ -116,15 +116,15 @@ weechat_js_hashtable_to_object (struct t_hashtable *hashtable) */ struct t_hashtable * -weechat_js_object_to_hashtable (Handle<Object> obj, +weechat_js_object_to_hashtable (v8::Handle<v8::Object> obj, int size, const char *type_keys, const char *type_values) { struct t_hashtable *hashtable; unsigned int i; - Handle<Array> keys; - Handle<Value> key, value; + v8::Handle<v8::Array> keys; + v8::Handle<v8::Value> key, value; hashtable = weechat_hashtable_new (size, type_keys, type_values, NULL, NULL); @@ -137,8 +137,8 @@ weechat_js_object_to_hashtable (Handle<Object> obj, { key = keys->Get(i); value = obj->Get(key); - String::Utf8Value str_key(key); - String::Utf8Value str_value(value); + v8::String::Utf8Value str_key(key); + v8::String::Utf8Value str_value(value); if (strcmp (type_values, WEECHAT_HASHTABLE_STRING) == 0) { weechat_hashtable_set (hashtable, *str_key, *str_value); @@ -167,7 +167,7 @@ weechat_js_exec (struct t_plugin_script *script, struct t_plugin_script *old_js_current_script; WeechatJsV8 *js_v8; void *ret_value; - Handle<Value> argv2[16], ret_js; + v8::Handle<v8::Value> argv2[16], ret_js; int i, argc, *ret_int; ret_value = NULL; @@ -214,7 +214,7 @@ weechat_js_exec (struct t_plugin_script *script, { if ((ret_type == WEECHAT_SCRIPT_EXEC_STRING) && (ret_js->IsString())) { - String::Utf8Value temp_str(ret_js); + v8::String::Utf8Value temp_str(ret_js); ret_value = *temp_str; } else if ((ret_type == WEECHAT_SCRIPT_EXEC_INT) && (ret_js->IsInt32())) @@ -704,7 +704,8 @@ weechat_js_signal_debug_libs_cb (void *data, const char *signal, (void) type_data; (void) signal_data; - weechat_printf (NULL, " %s (v8): %s", JS_PLUGIN_NAME, V8::GetVersion()); + weechat_printf (NULL, " %s (v8): %s", + JS_PLUGIN_NAME, v8::V8::GetVersion()); return WEECHAT_RC_OK; } diff --git a/src/plugins/javascript/weechat-js.h b/src/plugins/javascript/weechat-js.h index 35529f5da..65874921e 100644 --- a/src/plugins/javascript/weechat-js.h +++ b/src/plugins/javascript/weechat-js.h @@ -38,8 +38,6 @@ #define JS_CURRENT_SCRIPT_NAME ((js_current_script) ? js_current_script->name : "-") -using namespace v8; - class WeechatJsV8; extern struct t_weechat_plugin *weechat_js_plugin; @@ -52,8 +50,8 @@ extern struct t_plugin_script *js_registered_script; extern const char *js_current_script_filename; extern WeechatJsV8 *js_current_interpreter; -extern Handle<Object> weechat_js_hashtable_to_object (struct t_hashtable *hashtable); -extern struct t_hashtable *weechat_js_object_to_hashtable (Handle<Object> obj, +extern v8::Handle<v8::Object> weechat_js_hashtable_to_object (struct t_hashtable *hashtable); +extern struct t_hashtable *weechat_js_object_to_hashtable (v8::Handle<v8::Object> obj, int size, const char *type_keys, const char *type_values); |