platform/shared/ruby/ext/webview/webview_wrap.c in rhodes-3.4.2 vs platform/shared/ruby/ext/webview/webview_wrap.c in rhodes-3.5.1.12

- old
+ new

@@ -1823,15 +1823,15 @@ #define SWIG_as_voidptr(a) (void *)((const void *)(a)) #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) -extern void rho_webview_refresh(int index); +extern void rho_webview_refresh(int tab_index); #define refresh rho_webview_refresh extern void rho_webview_navigate(const char* url, int tab_index); #define navigate rho_webview_navigate -extern char* rho_webview_current_location(int index); +extern char* rho_webview_current_location(int tab_index); #define current_location rho_webview_current_location extern char* rho_webview_execute_js(const char* js, int tab_index); #define execute_js rho_webview_execute_js extern void rho_webview_set_menu_items(VALUE argv); #define set_menu_items rho_webview_set_menu_items @@ -1845,12 +1845,19 @@ #define set_cookie rho_webview_set_cookie extern void rho_webview_navigate_back(); #define navigate_back rho_webview_navigate_back +extern void rho_webview_save(const char* format, const char* path, int tab_index); +#define save rho_webview_save +extern VALUE rho_webview_get_current_url(int tab_index); +#define get_current_url rho_webview_get_current_url + + + #include <limits.h> #if !defined(SWIG_NO_LLONG_MAX) # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) # define LLONG_MAX __LONG_LONG_MAX__ # define LLONG_MIN (-LLONG_MAX - 1LL) @@ -2234,11 +2241,88 @@ fail: return Qnil; } +SWIGINTERN VALUE +_wrap_save(int argc, VALUE *argv, VALUE self) { + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; + + { + arg3 = -1; + } + if ((argc < 2) || (argc > 3)) { + rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail; + } + res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","save", 1, argv[0] )); + } + arg1 = (char *)(buf1); + res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","save", 2, argv[1] )); + } + arg2 = (char *)(buf2); + if (argc > 2) { + ecode3 = SWIG_AsVal_int(argv[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","save", 3, argv[2] )); + } + arg3 = (int)(val3); + } + save((char const *)arg1,(char const *)arg2,arg3); + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return Qnil; +fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return Qnil; +} + +SWIGINTERN VALUE +_wrap_get_current_url(int argc, VALUE *argv, VALUE self) { + int arg1 ; + int val1 ; + int ecode1 = 0 ; + VALUE result; + VALUE vresult = Qnil; + + { + arg1 = -1; + } + if ((argc < 0) || (argc > 1)) { + rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail; + } + if (argc > 0) { + ecode1 = SWIG_AsVal_int(argv[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","get_current_url", 1, argv[0] )); + } + arg1 = (int)(val1); + } + result = (VALUE)get_current_url(arg1); + vresult = result; + return vresult; +fail: + return Qnil; +} + + + /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { @@ -2549,7 +2633,9 @@ rb_define_module_function(mWebView, "set_menu_items", _wrap_set_menu_items, -1); rb_define_module_function(mWebView, "active_tab", _wrap_active_tab, -1); rb_define_module_function(mWebView, "full_screen_mode", _wrap_full_screen_mode, -1); rb_define_module_function(mWebView, "set_cookie", _wrap_set_cookie, -1); rb_define_module_function(mWebView, "navigate_back", _wrap_navigate_back, -1); + rb_define_module_function(mWebView, "save", _wrap_save, -1); + rb_define_module_function(mWebView, "get_current_url", _wrap_get_current_url, -1); }