svnno****@sourc*****
svnno****@sourc*****
Sun Sep 27 09:28:16 JST 2009
Revision: 3852 http://sourceforge.jp/projects/kazehakase/svn/view?view=rev&revision=3852 Author: kous Date: 2009-09-27 09:28:16 +0900 (Sun, 27 Sep 2009) Log Message: ----------- * ext/ruby/kz-rb-web.c, ext/ruby/kz-rb-ext.[ch]: add KzWeb binding. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/ext/ruby/Makefile.am kazehakase/trunk/ext/ruby/kz-rb-ext.c kazehakase/trunk/ext/ruby/kz-rb-ext.h Added Paths: ----------- kazehakase/trunk/ext/ruby/kz-rb-web.c Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2009-09-27 00:09:41 UTC (rev 3851) +++ kazehakase/trunk/ChangeLog 2009-09-27 00:28:16 UTC (rev 3852) @@ -1,5 +1,7 @@ 2009-09-27 Kouhei Sutou <kou****@cozmi*****> + * ext/ruby/kz-rb-web.c, ext/ruby/kz-rb-ext.[ch]: add KzWeb binding. + * ext/ruby/kz-rb-embed.c: remove nonexistent methods in kz-embed.h. * ext/ruby/kz-rb-embed.c: follow a change that Modified: kazehakase/trunk/ext/ruby/Makefile.am =================================================================== --- kazehakase/trunk/ext/ruby/Makefile.am 2009-09-27 00:09:41 UTC (rev 3851) +++ kazehakase/trunk/ext/ruby/Makefile.am 2009-09-27 00:28:16 UTC (rev 3852) @@ -44,7 +44,8 @@ kz-rb-downloader.c \ kz-rb-downloader-group.c \ kz-rb-bookmark.c \ - kz-rb-sidebar.c + kz-rb-sidebar.c \ + kz-rb-web.c LDFLAGS = \ -rpath $(extdir) \ Modified: kazehakase/trunk/ext/ruby/kz-rb-ext.c =================================================================== --- kazehakase/trunk/ext/ruby/kz-rb-ext.c 2009-09-27 00:09:41 UTC (rev 3851) +++ kazehakase/trunk/ext/ruby/kz-rb-ext.c 2009-09-27 00:28:16 UTC (rev 3852) @@ -1,7 +1,7 @@ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* - * Copyright (C) 2007 Kouhei Sutou <kou****@cozmi*****> + * Copyright (C) 2007-2009 Kouhei Sutou <kou****@cozmi*****> * Copyright (C) 2006 Eriko Sato * * This program is free software; you can redistribute it and/or modify @@ -208,6 +208,7 @@ _kz_rb_downloader_init(mKz); _kz_rb_downloader_group_init(mKz); _kz_rb_bookmark_init(mKz); + _kz_rb_web_init(mKz); _kz_rb_sidebar_init(mKz); rb_funcall(Qnil, rb_intern("require"), 1, rb_str_new2(INIT_RB)); Modified: kazehakase/trunk/ext/ruby/kz-rb-ext.h =================================================================== --- kazehakase/trunk/ext/ruby/kz-rb-ext.h 2009-09-27 00:09:41 UTC (rev 3851) +++ kazehakase/trunk/ext/ruby/kz-rb-ext.h 2009-09-27 00:28:16 UTC (rev 3852) @@ -62,6 +62,7 @@ extern void _kz_rb_downloader_group_init(VALUE mKz); extern void _kz_rb_bookmark_init(VALUE mKz); extern void _kz_rb_sidebar_init(VALUE mKz); +extern void _kz_rb_web_init(VALUE mKz); extern void _kz_rb_setup_sidebar(KzWindow *kz); Added: kazehakase/trunk/ext/ruby/kz-rb-web.c =================================================================== --- kazehakase/trunk/ext/ruby/kz-rb-web.c (rev 0) +++ kazehakase/trunk/ext/ruby/kz-rb-web.c 2009-09-27 00:28:16 UTC (rev 3852) @@ -0,0 +1,729 @@ +/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ + +/* + * Copyright (C) 2009 Kouhei Sutou <kou****@cozmi*****> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "kz-rb-ext.h" + +#include <kz-web.h> + +#define _SELF(obj) (KZ_WEB(RVAL2GOBJ(obj))) +#define RVAL2KZBOOKMARK(obj) (KZ_BOOKMARK(RVAL2GOBJ(obj))) +#define RVAL2KZBOOKMARKFOLDER(obj) (KZ_BOOKMARK_FOLDER(RVAL2GOBJ(obj))) +#define RVAL2KZNAVI(obj) (KZ_NAVI(RVAL2GOBJ(obj))) +#define RVAL2KZNAVLINK(obj) (RVAL2GENUM(obj, KZ_TYPE_WEB_NAV_LINK)) +#define RVAL2KZRF(obj) (RVAL2GENUM(obj, KZ_TYPE_WEB_RELOAD_FLAG)) +#define RVAL2KZCT(obj) (RVAL2GENUM(obj, KZ_TYPE_WEB_COPY_TYPE)) + +static VALUE +rb_kz_web_get_window(VALUE self) +{ + return GOBJ2RVAL(kz_app_get_window_from_web(KZ_RB_GET_APP, + RVAL2GOBJ(self))); +} + +static VALUE +rb_kz_web_load_uri(VALUE self, VALUE url) +{ + kz_web_load_uri(_SELF(self), RVAL2CSTR(url)); + return self; +} + +static VALUE +rb_kz_web_view_source(VALUE self, VALUE url) +{ + kz_web_view_source(_SELF(self), RVAL2CSTR(url)); + return self; +} + +static VALUE +rb_kz_web_is_loading(VALUE self) +{ + gboolean loading; + loading = kz_web_is_loading(_SELF(self)); + return CBOOL2RVAL(loading); +} + +static VALUE +rb_kz_web_get_title(VALUE self) +{ + const gchar *title; + title = kz_web_get_title(_SELF(self)); + return CSTR2RVAL(title); +} + +static VALUE +rb_kz_web_get_location(VALUE self) +{ + const gchar *location; + location = kz_web_get_location(_SELF(self)); + return CSTR2RVAL(location); +} + +static VALUE +rb_kz_web_ensure_title(VALUE self) +{ + gchar *title; + VALUE rb_title; + title = kz_web_ensure_title(_SELF(self)); + rb_title = CSTR2RVAL(title); + g_free(title); + return rb_title; +} + +static VALUE +rb_kz_web_get_progress(VALUE self) +{ + gdouble progress; + progress = kz_web_get_progress(_SELF(self)); + return rb_float_new(progress); +} + +static VALUE +rb_kz_web_can_cut_selection(VALUE self) +{ + gboolean can_cut_selection; + can_cut_selection = kz_web_can_cut_selection(_SELF(self)); + return CBOOL2RVAL(can_cut_selection); +} + +static VALUE +rb_kz_web_can_copy_selection(VALUE self) +{ + gboolean can_copy_selection; + can_copy_selection = kz_web_can_copy_selection(_SELF(self)); + return CBOOL2RVAL(can_copy_selection); +} + +static VALUE +rb_kz_web_can_paste(VALUE self) +{ + gboolean can_paste; + can_paste = kz_web_can_paste(_SELF(self)); + return CBOOL2RVAL(can_paste); +} + +static VALUE +rb_kz_web_cut_selection(VALUE self) +{ + kz_web_cut_selection(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_copy_selection(VALUE self) +{ + kz_web_copy_selection(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_paste(VALUE self) +{ + kz_web_paste(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_select_all(VALUE self) +{ + kz_web_select_all(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_get_selection_string(VALUE self) +{ + gchar *string; + VALUE rb_string; + string = kz_web_get_selection_string(_SELF(self)); + rb_string = CSTR2RVAL(string); + g_free(string); + return rb_string; +} + +static VALUE +rb_kz_web_find(VALUE self, VALUE keyword, VALUE backward) +{ + gboolean find; + find = kz_web_find(_SELF(self), STR2CSTR(keyword), RVAL2CBOOL(backward)); + return CBOOL2RVAL(find); +} + +static VALUE +rb_kz_web_incremental_search(VALUE self, VALUE keyword, VALUE backward) +{ + gboolean search; + search = kz_web_incremental_search(_SELF(self), STR2CSTR(keyword), + RVAL2CBOOL(backward)); + return CBOOL2RVAL(search); +} + +static VALUE +rb_kz_web_selection_is_collapsed(VALUE self) +{ + gboolean collapsed; + collapsed = kz_web_selection_is_collapsed(_SELF(self)); + return CBOOL2RVAL(collapsed); +} + +static VALUE +rb_kz_web_get_links(int arc, VALUE *argv, VALUE self) +{ + VALUE rb_selected_only; + int n; + gboolean selected_only; + GList *list = NULL; + + n = rb_scan_args(arc, argv, "01", &rb_selected_only); + + if (n == 0) + rb_selected_only = Qfalse; + + selected_only = RTEST(rb_selected_only); + + if (kz_web_get_links(_SELF(self), &list, selected_only)) + return GLIST2ARY(list); + else + return rb_ary_new(); +} + +static VALUE +rb_kz_web_get_dest_anchors(VALUE self) +{ + GList *list = NULL; + + if (kz_web_get_dest_anchors(_SELF(self), &list)) + { + VALUE result = GLIST2ARY(list); + g_list_free(list); + return result; + } + else + { + return rb_ary_new(); + } +} + +static VALUE +rb_kz_web_copy_page(VALUE self, VALUE dkzweb) +{ + kz_web_copy_page(_SELF(self), _SELF(dkzweb)); + return self; +} + +static VALUE +rb_kz_web_shistory_get_pos(VALUE self) +{ + gboolean success; + gint pos, count; + success = kz_web_shistory_get_pos(_SELF(self), &pos, &count); + + if (success) + return rb_ary_new3(2, INT2NUM(pos), INT2NUM(count)); + else + return Qnil; +} + +static VALUE +rb_kz_web_shistory_get_nth(VALUE self, VALUE nth, VALUE is_relative) +{ + gchar *url, *title; + kz_web_shistory_get_nth(_SELF(self), NUM2INT(nth), + RVAL2CBOOL(is_relative), &url, &title); + return rb_ary_new3(2, CSTR2RVAL(url), CSTR2RVAL(title)); +} + +static VALUE +rb_kz_web_reload(VALUE self, VALUE flags) +{ + kz_web_reload(_SELF(self), RVAL2KZRF(flags)); + return self; +} + +static VALUE +rb_kz_web_stop_load(VALUE self) +{ + kz_web_stop_load(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_go_back(VALUE self) +{ + kz_web_go_forward(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_go_forward(VALUE self) +{ + kz_web_go_forward(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_go_up(VALUE self) +{ + kz_web_go_up(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_can_go_back(VALUE self) +{ + gboolean can_go_back; + can_go_back = kz_web_can_go_back(_SELF(self)); + return CBOOL2RVAL(can_go_back); +} + +static VALUE +rb_kz_web_can_go_forward(VALUE self) +{ + gboolean can_go_forward; + can_go_forward = kz_web_can_go_forward(_SELF(self)); + return CBOOL2RVAL(can_go_forward); +} + +static VALUE +rb_kz_web_can_go_up(VALUE self) +{ + gboolean can_go_up; + can_go_up = kz_web_can_go_up(_SELF(self)); + return CBOOL2RVAL(can_go_up); +} + +static VALUE +rb_kz_web_can_go_nav_link(VALUE self, VALUE link) +{ + gboolean can_go_nav_link; + can_go_nav_link = kz_web_can_go_nav_link(_SELF(self), + RVAL2KZNAVLINK(link)); + return CBOOL2RVAL(can_go_nav_link); +} + +static VALUE +rb_kz_web_go_nav_link(VALUE self, VALUE link) +{ + kz_web_go_nav_link(_SELF(self), RVAL2KZNAVLINK(link)); + return self; +} + +static VALUE +rb_kz_web_append_nav_link(VALUE self, VALUE link, VALUE navi) +{ + kz_web_append_nav_link(_SELF(self), RVAL2KZNAVLINK(link), + RVAL2KZNAVI(navi)); + return self; +} + +static VALUE +rb_kz_web_set_nav_link(VALUE self, VALUE link, VALUE navi) +{ + kz_web_set_nav_link(_SELF(self), RVAL2KZNAVLINK(link), RVAL2GOBJ(navi)); + return self; +} + +static VALUE +rb_kz_web_set_nth_nav_link(VALUE self, VALUE link, VALUE navi, VALUE n) +{ + kz_web_set_nth_nav_link(_SELF(self), RVAL2KZNAVLINK(link), + RVAL2GOBJ(navi), NUM2UINT(n)); + return self; +} + +static VALUE +rb_kz_web_get_nav_link(VALUE self, VALUE link) +{ + KzNavi *get_nav_link; + get_nav_link = kz_web_get_nav_link(_SELF(self), RVAL2KZNAVLINK(link)); + return GOBJ2RVAL(get_nav_link); +} + +static VALUE +rb_kz_web_get_nth_nav_link(VALUE self, VALUE link, VALUE n) +{ + KzNavi *nth_nav_link; + nth_nav_link = kz_web_get_nth_nav_link(_SELF(self), + RVAL2KZNAVLINK(link), + NUM2UINT(n)); + return GOBJ2RVAL(nth_nav_link); +} + +static VALUE +rb_kz_web_get_nav_links(VALUE self, VALUE link) +{ + GList *nav_links; + nav_links = kz_web_get_nav_links(_SELF(self), RVAL2KZNAVLINK(link)); + return GLIST2ARY(nav_links); +} + +static VALUE +rb_kz_web_go_history_index(VALUE self, VALUE index) +{ + kz_web_go_history_index(_SELF(self), NUM2INT(index)); + return self; +} + +static VALUE +rb_kz_web_get_lock(VALUE self) +{ + gboolean get_lock; + get_lock = kz_web_get_lock(_SELF(self)); + return RVAL2CBOOL(get_lock); +} + +static VALUE +rb_kz_web_set_lock(VALUE self, VALUE lock) +{ + kz_web_set_lock(_SELF(self), CBOOL2RVAL(lock)); + return self; +} + +static VALUE +rb_kz_web_get_body_text(VALUE self) +{ + gchar *text; + VALUE rb_text; + text = kz_web_get_body_text(_SELF(self)); + rb_text = CSTR2RVAL(text); + g_free(text); + return rb_text; +} + +static VALUE +rb_kz_web_set_encoding(VALUE self, VALUE encoding) +{ + kz_web_set_encoding(_SELF(self), STR2CSTR(encoding)); + return self; +} + +static VALUE +rb_kz_web_get_encoding(VALUE self) +{ + gchar *encoding; + gboolean forced; + kz_web_get_encoding(_SELF(self), &encoding, &forced); + return rb_ary_new3(2, CSTR2RVAL(encoding), CBOOL2RVAL(forced)); +} + +static VALUE +rb_kz_web_print(VALUE self) +{ + kz_web_print(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_print_preview(VALUE self) +{ + kz_web_print_preview(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_get_printer_list(VALUE self) +{ + GList *list; + list = kz_web_get_printer_list(_SELF(self)); + return GLIST2ARY(list); +} + +static VALUE +rb_kz_web_create_thumbnail(int argc, VALUE *argv, VALUE self) +{ + EggPixbufThumbnailSize size; + VALUE rb_size; + + rb_scan_args(argc, argv, "01", &rb_size); + if (NIL_P(rb_size)) + size = EGG_PIXBUF_THUMBNAIL_LARGE; + else + size = NUM2INT(rb_size); /* FIXME */ + kz_web_create_thumbnail(_SELF(self), size); + return self; +} + +static VALUE +rb_kz_web_save_with_content(VALUE self, VALUE rawfilename) +{ + gboolean save; + save = kz_web_save_with_content(_SELF(self), STR2CSTR(rawfilename)); + return RVAL2CBOOL(save); +} + +static VALUE +rb_kz_web_zoom(VALUE self, VALUE zoom) +{ + kz_web_zoom(_SELF(self), NUM2DBL(zoom)); + return self; +} + +static VALUE +rb_kz_web_get_zoom_ratio(VALUE self) +{ + gdouble ratio; + ratio = kz_web_get_zoom_ratio(_SELF(self)); + return DBL2NUM(ratio); +} + +static VALUE +rb_kz_web_set_text_size(VALUE self, VALUE zoom) +{ + kz_web_set_text_size(_SELF(self), NUM2DBL(zoom)); + return self; +} + +static VALUE +rb_kz_web_get_text_size(VALUE self) +{ + gdouble size; + size = kz_web_get_text_size(_SELF(self)); + return DBL2NUM(size); +} + +static VALUE +rb_kz_web_get_html_with_contents(VALUE self, VALUE storedir) +{ + gchar *html; + VALUE rb_html; + html = kz_web_get_html_with_contents(_SELF(self), RVAL2CSTR(storedir)); + rb_html = CSTR2RVAL(html); + g_free(html); + return rb_html; +} + + +static VALUE +rb_kz_web_set_history(VALUE self, VALUE rb_history, VALUE current_position) +{ + GList *history = NULL; + gint i, length; + VALUE *rb_history_values; + + length = RARRAY_LEN(rb_history); + rb_history_values = RARRAY_PTR(rb_history); + for (i = 0; i < length; i++) { + history = g_list_append(history, RVAL2GOBJ(rb_history_values[i])); + } + + kz_web_set_history(_SELF(self), history, NUM2UINT(current_position)); + return self; +} + +static VALUE +rb_kz_web_get_history(VALUE self) +{ + GList *history = NULL; + guint current_position = 0; + + kz_web_get_history(_SELF(self), &history, ¤t_position); + return rb_ary_new3(2, + GOBJ2RVAL(history->data), + UINT2NUM(current_position)); +} + +static VALUE +rb_kz_web_get_last_modified(VALUE self) +{ + guint last_modified; + last_modified = kz_web_get_last_modified(_SELF(self)); + return UINT2NUM(last_modified); +} + +static VALUE +rb_kz_web_fine_scroll(VALUE self, VALUE horiz, VALUE vert) +{ + kz_web_fine_scroll(_SELF(self), NUM2INT(horiz), NUM2INT(vert)); + return self; +} + +static VALUE +rb_kz_web_page_up(VALUE self) +{ + kz_web_page_up(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_page_down(VALUE self) +{ + kz_web_page_down(_SELF(self)); + return self; +} + +static VALUE +rb_kz_web_get_allow_javascript(VALUE self) +{ + gboolean allow; + allow = kz_web_get_allow_javascript(_SELF(self)); + return CBOOL2RVAL(allow); +} + +static VALUE +rb_kz_web_set_allow_javascript(VALUE self, VALUE allow) +{ + kz_web_set_allow_javascript(_SELF(self), RVAL2CBOOL(allow)); + return self; +} + +static VALUE +rb_kz_web_get_allow_images(VALUE self) +{ + gboolean allow; + allow = kz_web_get_allow_images(_SELF(self)); + return CBOOL2RVAL(allow); +} + +static VALUE +rb_kz_web_set_allow_images(VALUE self, VALUE allow) +{ + kz_web_set_allow_images(_SELF(self), RVAL2CBOOL(allow)); + return self; +} + +static VALUE +rb_kz_web_show_page_certificate(VALUE self) +{ + kz_web_show_page_certificate(_SELF(self)); + return self; +} + +void +_kz_rb_web_init(VALUE mKz) +{ + VALUE cKzWeb; + + cKzWeb = G_DEF_CLASS(KZ_TYPE_WEB, "Web", mKz); + + G_DEF_CLASS(KZ_TYPE_WEB_LOAD_FLAG, "WebLoadFlag", mKz); + G_DEF_CLASS(KZ_TYPE_WEB_RELOAD_FLAG, "WebReloadFlag", mKz); + G_DEF_CLASS(KZ_TYPE_WEB_GO_ACTION, "WebGoAction", mKz); + G_DEF_CLASS(KZ_TYPE_WEB_NAV_LINK, "WebNavLink", mKz); + + rb_define_method(cKzWeb, "window", rb_kz_web_get_window, 0); + + rb_define_method(cKzWeb, "load_uri", rb_kz_web_load_uri, 1); + rb_define_method(cKzWeb, "view_source", + rb_kz_web_view_source, 1); + rb_define_method(cKzWeb, "loading?", rb_kz_web_is_loading, 0); + rb_define_method(cKzWeb, "title", rb_kz_web_get_title, 0); + rb_define_method(cKzWeb, "location", + rb_kz_web_get_location, 0); + rb_define_method(cKzWeb, "ensure_title", + rb_kz_web_ensure_title, 0); + rb_define_method(cKzWeb, "progress", + rb_kz_web_get_progress, 0); + rb_define_method(cKzWeb, "can_cut_selection?", + rb_kz_web_can_cut_selection, 0); + rb_define_method(cKzWeb, "can_copy_selection?", + rb_kz_web_can_copy_selection, 0); + rb_define_method(cKzWeb, "can_paste?", rb_kz_web_can_paste, 0); + rb_define_method(cKzWeb, "cut_selection", + rb_kz_web_cut_selection, 0); + rb_define_method(cKzWeb, "copy_selection", + rb_kz_web_copy_selection, 0); + rb_define_method(cKzWeb, "paste", rb_kz_web_paste, 0); + rb_define_method(cKzWeb, "select_all", rb_kz_web_select_all, 0); + rb_define_method(cKzWeb, "selection_string", + rb_kz_web_get_selection_string, 0); + rb_define_method(cKzWeb, "find?", rb_kz_web_find, 2); + rb_define_method(cKzWeb, "incremental_search?", + rb_kz_web_incremental_search, 2); + rb_define_method(cKzWeb, "selection_is_collapsed?", + rb_kz_web_selection_is_collapsed, 0); + rb_define_method(cKzWeb, "links", rb_kz_web_get_links, -1); + rb_define_method(cKzWeb, "dest_anchors", rb_kz_web_get_dest_anchors, 0); + rb_define_method(cKzWeb, "copy_page", rb_kz_web_copy_page, 1); + rb_define_method(cKzWeb, "shistory_get_pos", + rb_kz_web_shistory_get_pos, 0); + rb_define_method(cKzWeb, "shistory_get_nth", + rb_kz_web_shistory_get_nth, 2); + rb_define_method(cKzWeb, "reload", rb_kz_web_reload, 1); + rb_define_method(cKzWeb, "stop_load", rb_kz_web_stop_load, 0); + rb_define_method(cKzWeb, "go_back", rb_kz_web_go_back, 0); + rb_define_method(cKzWeb, "go_forward", rb_kz_web_go_forward, 0); + rb_define_method(cKzWeb, "go_up", rb_kz_web_go_up, 0); + rb_define_method(cKzWeb, "can_go_back?", + rb_kz_web_can_go_back, 0); + rb_define_method(cKzWeb, "can_go_forward?", + rb_kz_web_can_go_forward, 0); + rb_define_method(cKzWeb, "can_go_up?", rb_kz_web_can_go_up, 0); + rb_define_method(cKzWeb, "can_go_nav_link?", + rb_kz_web_can_go_nav_link, 1); + rb_define_method(cKzWeb, "go_nav_link", + rb_kz_web_go_nav_link, 1); + rb_define_method(cKzWeb, "append_nav_link", + rb_kz_web_append_nav_link, 1); + rb_define_method(cKzWeb, "set_nav_link", + rb_kz_web_set_nav_link, 2); + rb_define_method(cKzWeb, "set_nth_nav_link", + rb_kz_web_set_nth_nav_link, 3); + rb_define_method(cKzWeb, "get_nav_link", + rb_kz_web_get_nav_link, 1); + rb_define_method(cKzWeb, "get_nth_nav_link", + rb_kz_web_get_nth_nav_link, 2); + rb_define_method(cKzWeb, "get_nav_links", + rb_kz_web_get_nav_links, 1); + rb_define_method(cKzWeb, "go_history_index", + rb_kz_web_go_history_index, 1); + rb_define_method(cKzWeb, "lock?", rb_kz_web_get_lock, 0); + rb_define_method(cKzWeb, "set_lock", rb_kz_web_set_lock, 0); + rb_define_method(cKzWeb, "get_body_text", + rb_kz_web_get_body_text, 0); + rb_define_method(cKzWeb, "set_encoding", + rb_kz_web_set_encoding, 1); + rb_define_method(cKzWeb, "get_encoding", + rb_kz_web_get_encoding, 0); + rb_define_method(cKzWeb, "print", rb_kz_web_print, 0); + rb_define_method(cKzWeb, "print_preview", + rb_kz_web_print_preview, 0); + rb_define_method(cKzWeb, "get_printer_list", + rb_kz_web_get_printer_list, 0); + rb_define_method(cKzWeb, "create_thumbnail", + rb_kz_web_create_thumbnail, -1); + rb_define_method(cKzWeb, "save_with_content", + rb_kz_web_save_with_content, 1); + rb_define_method(cKzWeb, "zoom", rb_kz_web_zoom, 2); + rb_define_method(cKzWeb, "zoom_ratio", rb_kz_web_get_zoom_ratio, 0); + rb_define_method(cKzWeb, "set_text_size", + rb_kz_web_set_text_size, 2); + rb_define_method(cKzWeb, "text_size", + rb_kz_web_get_text_size, 0); + rb_define_method(cKzWeb, "get_html_with_contents", + rb_kz_web_get_html_with_contents, 1); + rb_define_method(cKzWeb, "set_history", rb_kz_web_set_history, 1); + rb_define_method(cKzWeb, "history", rb_kz_web_get_history, 0); + rb_define_method(cKzWeb, "get_last_modified", + rb_kz_web_get_last_modified, 0); + rb_define_method(cKzWeb, "fine_scroll", rb_kz_web_fine_scroll, 2); + rb_define_method(cKzWeb, "page_up", rb_kz_web_page_up, 0); + rb_define_method(cKzWeb, "page_down", rb_kz_web_page_down, 0); + rb_define_method(cKzWeb, "allow_javascript?", + rb_kz_web_get_allow_javascript, 0); + rb_define_method(cKzWeb, "set_allow_javascript", + rb_kz_web_set_allow_javascript, 1); + rb_define_method(cKzWeb, "allow_images?", + rb_kz_web_get_allow_images, 0); + rb_define_method(cKzWeb, "set_allow_images", + rb_kz_web_set_allow_images, 1); + rb_define_method(cKzWeb, "show_page_certificate", + rb_kz_web_show_page_certificate, 0); + + G_DEF_SETTERS(cKzWeb); +} Property changes on: kazehakase/trunk/ext/ruby/kz-rb-web.c ___________________________________________________________________ Added: svn:keywords + Id