void Init_gtk_recent_chooser() { #if GTK_CHECK_VERSION(2,10,0) VALUE gRecentChooser = G_DEF_CLASS(GTK_TYPE_RECENT_CHOOSER, "RecentChooser", mGtk); rb_define_method(gRecentChooser, "set_show_numbers", rc_set_show_numbers, 1); G_DEF_SETTER(gRecentChooser, "show_numbers"); rb_define_method(gRecentChooser, "show_numbers", rc_get_show_numbers, 0); rb_define_method(gRecentChooser, "set_sort_func", rc_set_sort_func, 0); rb_define_method(gRecentChooser, "set_current_uri", rc_set_current_uri, 1); G_DEF_SETTER(gRecentChooser, "current_uri"); rb_define_method(gRecentChooser, "current_uri", rc_get_current_uri, 0); rb_define_method(gRecentChooser, "current_item", rc_get_current_item, 0); rb_define_method(gRecentChooser, "select_uri", rc_select_uri, 1); rb_define_method(gRecentChooser, "unselect_uri", rc_unselect_uri, 1); rb_define_method(gRecentChooser, "select_all", rc_select_all, 0); rb_define_method(gRecentChooser, "unselect_all", rc_unselect_all, 0); rb_define_method(gRecentChooser, "items", rc_get_items, 0); rb_define_method(gRecentChooser, "uris", rc_get_uris, 0); rb_define_method(gRecentChooser, "add_filter", rc_add_filter, 1); rb_define_method(gRecentChooser, "remove_filter", rc_remove_filter, 1); rb_define_method(gRecentChooser, "filters", rc_list_filters, 0); /* GtkRecentChooserError */ G_DEF_ERROR(GTK_RECENT_CHOOSER_ERROR, "RecentChooserError", mGtk, rb_eRuntimeError, GTK_TYPE_RECENT_CHOOSER_ERROR); /* GtkRecentSortType */ G_DEF_CLASS(GTK_TYPE_RECENT_SORT_TYPE, "SortType", gRecentChooser); G_DEF_CONSTANTS(gRecentChooser, GTK_TYPE_RECENT_SORT_TYPE, "GTK_RECENT_"); #endif }
void Init_gtk_actiongroup(void) { #if GTK_CHECK_VERSION(2,4,0) VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_GC_FUNC(GTK_TYPE_ACTION_GROUP, "ActionGroup", mGtk, action_group_mark, NULL); id_action_procs = rb_intern("@action_procs"); id_toggle_action_procs = rb_intern("@toggle_action_procs"); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(get_action, 1); RG_DEF_METHOD(actions, 0); RG_DEF_METHOD(add_action, -1); RG_DEF_METHOD(remove_action, 1); RG_DEF_METHOD(add_actions, 1); RG_DEF_METHOD(add_toggle_actions, 1); RG_DEF_METHOD(add_radio_actions, -1); RG_DEF_METHOD(set_translate_func, 0); RG_DEF_METHOD(set_translation_domain, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "translation_domain"); #if GTK_CHECK_VERSION(2,6,0) RG_DEF_METHOD(translate_string, 1); #endif #endif }
void Init_gtk_actiongroup() { #if GTK_CHECK_VERSION(2,4,0) VALUE gActionGroup; gActionGroup = G_DEF_CLASS_WITH_GC_FUNC(GTK_TYPE_ACTION_GROUP, "ActionGroup", mGtk, action_group_mark, NULL); id_action_procs = rb_intern("@action_procs"); id_toggle_action_procs = rb_intern("@toggle_action_procs"); rb_define_method(gActionGroup, "initialize", actiongroup_initialize, 1); rb_define_method(gActionGroup, "get_action", actiongroup_get_action, 1); rb_define_method(gActionGroup, "actions", actiongroup_list_actions, 0); rb_define_method(gActionGroup, "add_action", actiongroup_add_action, -1); rb_define_method(gActionGroup, "remove_action", actiongroup_remove_action, 1); rb_define_method(gActionGroup, "add_actions", actiongroup_add_actions, 1); rb_define_method(gActionGroup, "add_toggle_actions", actiongroup_add_toggle_actions, 1); rb_define_method(gActionGroup, "add_radio_actions", actiongroup_add_radio_actions, -1); rb_define_method(gActionGroup, "set_translate_func", actiongroup_set_translate_func, 0); rb_define_method(gActionGroup, "set_translation_domain", actiongroup_set_translation_domain, 1); G_DEF_SETTER(gActionGroup, "translation_domain"); #if GTK_CHECK_VERSION(2,6,0) rb_define_method(gActionGroup, "translate_string", actiongroup_translate_string, 1); #endif #endif }
void Init_gtk_action() { #if GTK_CHECK_VERSION(2,4,0) VALUE gAction; gAction = G_DEF_CLASS_WITH_GC_FUNC(GTK_TYPE_ACTION, "Action", mGtk, action_mark, NULL); rb_define_method(gAction, "initialize", action_initialize, -1); /* (NOTICE) Gtk::Action#is_sensitive?, #is_visible are special. Because there are also Gtk::Action#sensitive?, #visible? as property accessors. Gtk::Action#is_sensitive?, #is_visible? check its associated action group. Gtk::Action#sensitive?, #visible? returns the value of the properties. */ rb_define_method(gAction, "is_sensitive?", action_is_sensitive, 0); rb_define_method(gAction, "is_visible?", action_is_visible, 0); rb_define_method(gAction, "activate", action_activate, 0); rb_define_method(gAction, "create_icon", action_create_icon, 1); rb_define_method(gAction, "create_menu_item", action_create_menu_item, 0); #if GTK_CHECK_VERSION(2, 12, 0) rb_define_method(gAction, "create_menu", action_create_menu, 0); #endif rb_define_method(gAction, "create_tool_item", action_create_tool_item, 0); rb_define_method(gAction, "connect_proxy", action_connect_proxy, 1); rb_define_method(gAction, "disconnect_proxy", action_disconnect_proxy, 1); rb_define_method(gAction, "proxies", action_get_proxies, 0); rb_define_method(gAction, "connect_accelerator", action_connect_accelerator, 0); rb_define_method(gAction, "disconnect_accelerator", action_disconnect_accelerator, 0); rb_define_method(gAction, "block_activate_from", action_block_activate_from, 1); rb_define_method(gAction, "unblock_activate_from", action_unblock_activate_from, 1); rb_define_method(gAction, "set_accel_path", action_set_accel_path, 1); G_DEF_SETTER(gAction, "accel_path"); rb_define_method(gAction, "set_accel_group", action_set_accel_group, 1); G_DEF_SETTER(gAction, "accel_group"); #if GTK_CHECK_VERSION(2,6,0) rb_define_method(gAction, "accel_path", action_get_accel_path, 0); #endif #if GTK_CHECK_VERSION(2,8,0) rb_define_method(gAction, "accel_closure", action_get_accel_closure, 0); #endif #endif }
void Init_gtk_action(VALUE mGtk) { #if GTK_CHECK_VERSION(2,4,0) VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_GC_FUNC(GTK_TYPE_ACTION, "Action", mGtk, action_mark, NULL); RG_DEF_METHOD(initialize, -1); /* (NOTICE) Gtk::Action#is_sensitive?, #is_visible are special. Because there are also Gtk::Action#sensitive?, #visible? as property accessors. Gtk::Action#is_sensitive?, #is_visible? check its associated action group. Gtk::Action#sensitive?, #visible? returns the value of the properties. */ RG_DEF_METHOD_P(is_sensitive, 0); RG_DEF_METHOD_P(is_visible, 0); RG_DEF_METHOD(activate, 0); RG_DEF_METHOD(create_icon, 1); RG_DEF_METHOD(create_menu_item, 0); #if GTK_CHECK_VERSION(2, 12, 0) RG_DEF_METHOD(create_menu, 0); #endif RG_DEF_METHOD(create_tool_item, 0); RG_DEF_METHOD(connect_proxy, 1); RG_DEF_METHOD(disconnect_proxy, 1); RG_DEF_METHOD(proxies, 0); RG_DEF_METHOD(connect_accelerator, 0); RG_DEF_METHOD(disconnect_accelerator, 0); RG_DEF_METHOD(block_activate_from, 1); RG_DEF_METHOD(unblock_activate_from, 1); RG_DEF_METHOD(set_accel_path, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "accel_path"); RG_DEF_METHOD(set_accel_group, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "accel_group"); #if GTK_CHECK_VERSION(2,6,0) RG_DEF_METHOD(accel_path, 0); #endif #if GTK_CHECK_VERSION(2,8,0) RG_DEF_METHOD(accel_closure, 0); #endif #endif }
void Init_gsimpleasyncresult(VALUE glib) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SIMPLE_ASYNC_RESULT, "SimpleAsyncResult", glib); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(set_op_res_gssize, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "op_res_gssize"); RG_DEF_METHOD(op_res_gssize, 0); RG_DEF_METHOD(set_op_res_gboolean, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "op_res_gboolean"); RG_DEF_METHOD(op_res_gboolean, 0); RG_DEF_METHOD(source_tag, 0); RG_DEF_METHOD_P(valid, 2); RG_DEF_METHOD(set_handle_cancellation, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "handle_cancellation"); RG_DEF_METHOD(complete, 0); RG_DEF_METHOD(complete_in_idle, 0); }
void Init_gtk_ruler(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RULER, "Ruler", mGtk); RG_DEF_METHOD(set_range, 4); G_DEF_SETTER(RG_TARGET_NAMESPACE, "range"); RG_DEF_METHOD(range, 0); RG_DEF_METHOD(draw_ticks, 0); RG_DEF_METHOD(draw_pos, 0); }
void Init_gunixmountmonitor(G_GNUC_UNUSED VALUE glib) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_MOUNT_MONITOR, "UnixMountMonitor", glib); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_rate_limit, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "rate_limit"); #endif }
void Init_gfilenamecompleter(VALUE glib) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILENAME_COMPLETER, "FilenameCompleter", glib); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(get_completion_suffix, 1); RG_DEF_METHOD(get_completions, 1); RG_DEF_METHOD(set_dirs_only, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "dirs_only"); }
void Init_gtk_ruler() { VALUE gRuler = G_DEF_CLASS(GTK_TYPE_RULER, "Ruler", mGtk); rb_define_method(gRuler, "set_range", ruler_set_range, 4); G_DEF_SETTER(gRuler, "range"); rb_define_method(gRuler, "range", ruler_get_range, 0); rb_define_method(gRuler, "draw_ticks", ruler_draw_ticks, 0); rb_define_method(gRuler, "draw_pos", ruler_draw_pos, 0); }
void Init_gtk_toggle_button() { VALUE gTButton = G_DEF_CLASS(GTK_TYPE_TOGGLE_BUTTON, "ToggleButton", mGtk); rb_define_method(gTButton, "initialize", tbtn_initialize, -1); rb_define_method(gTButton, "set_mode", tbtn_set_mode, 1); G_DEF_SETTER(gTButton, "mode"); rb_define_method(gTButton, "mode?", tbtn_get_mode, 0); rb_define_method(gTButton, "toggled", tbtn_toggled, 0); }
void Init_gmountoperation(VALUE glib) { VALUE mountoperation = G_DEF_CLASS(G_TYPE_MOUNT_OPERATION, "MountOperation", glib); /* TODO: Are these necessary? */ G_DEF_CLASS(G_TYPE_MOUNT_OPERATION_RESULT, "Result", mountoperation); G_DEF_CONSTANTS(mountoperation, G_TYPE_MOUNT_OPERATION_RESULT, "G_MOUNT_OPERATION_"); G_DEF_CLASS(G_TYPE_ASK_PASSWORD_FLAGS, "AskPasswordFlags", glib); G_DEF_CONSTANTS(glib, G_TYPE_ASK_PASSWORD_FLAGS, "G_"); G_DEF_CLASS(G_TYPE_PASSWORD_SAVE, "PasswordSave", glib); G_DEF_CONSTANTS(glib, G_TYPE_PASSWORD_SAVE, "G_"); rb_define_method(mountoperation, "initialize", mountoperation_initialize, 0); rb_define_method(mountoperation, "username", mountoperation_username, 0); rb_define_method(mountoperation, "set_username", mountoperation_set_username, 1); G_DEF_SETTER(mountoperation, "username"); rb_define_method(mountoperation, "password", mountoperation_password, 0); rb_define_method(mountoperation, "set_password", mountoperation_set_password, 1); G_DEF_SETTER(mountoperation, "password"); rb_define_method(mountoperation, "anonymous", mountoperation_anonymous, 0); rb_define_method(mountoperation, "set_anonymous", mountoperation_set_anonymous, 1); G_DEF_SETTER(mountoperation, "anonymous"); rb_define_method(mountoperation, "domain", mountoperation_domain, 0); rb_define_method(mountoperation, "set_domain", mountoperation_set_domain, 1); G_DEF_SETTER(mountoperation, "domain"); rb_define_method(mountoperation, "password_save", mountoperation_password_save, 0); rb_define_method(mountoperation, "set_password_save", mountoperation_set_password_save, 1); G_DEF_SETTER(mountoperation, "password_save"); rb_define_method(mountoperation, "choice", mountoperation_choice, 0); rb_define_method(mountoperation, "set_choice", mountoperation_set_choice, 1); G_DEF_SETTER(mountoperation, "choice"); rb_define_method(mountoperation, "reply", mountoperation_reply, 1); }
void Init_gtk_textmark() { VALUE gTextMark = G_DEF_CLASS(GTK_TYPE_TEXT_MARK, "TextMark", mGtk); #if GTK_CHECK_VERSION(2,12,0) rb_define_method(gTextMark, "initialize", initialize, 2); #endif rb_define_method(gTextMark, "set_visible", set_visible, 1); G_DEF_SETTER(gTextMark, "visible"); rb_define_method(gTextMark, "visible?", get_visible, 0); rb_define_method(gTextMark, "deleted?", get_deleted, 0); rb_define_method(gTextMark, "buffer", get_buffer, 0); }
void Init_gtk_entry(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ENTRY, "Entry", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(layout, 0); RG_DEF_METHOD(layout_offsets, 0); #if GTK_CHECK_VERSION(2,4,0) RG_DEF_METHOD(set_completion, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "completion"); RG_DEF_METHOD(completion, 0); #endif RG_DEF_METHOD(layout_index_to_text_index, 1); RG_DEF_METHOD(text_index_to_layout_index, 1); #if GTK_CHECK_VERSION(2, 12, 0) RG_DEF_METHOD(cursor_hadjustment, 0); RG_DEF_METHOD(set_cursor_hadjustment, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "cursor_hadjustment"); #endif }
void Init_gtk_status_icon() { #if GTK_CHECK_VERSION(2,10,0) VALUE si = G_DEF_CLASS(GTK_TYPE_STATUS_ICON, "StatusIcon", mGtk); rb_define_method(si, "initialize", si_initialize, 0); rb_define_method(si, "set_tooltip", si_set_tooltip, 1); G_DEF_SETTER(si, "tooltip"); rb_define_method(si, "position_menu", si_position_menu, 1); rb_define_method(si, "geometry", si_get_geometry, 0); #endif }
void Init_gtk_option_menu(void) { #ifndef GTK_DISABLE_DEPRECATED /* Since 2.4 */ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_OPTION_MENU, "OptionMenu", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(remove_menu, 0); RG_DEF_METHOD(set_history, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "history"); RG_DEF_METHOD(history, 0); #endif }
void Init_gtk_textmark(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_MARK, "TextMark", mGtk); #if GTK_CHECK_VERSION(2,12,0) RG_DEF_METHOD(initialize, 2); #endif RG_DEF_METHOD(set_visible, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "visible"); RG_DEF_METHOD_P(visible, 0); RG_DEF_METHOD_P(deleted, 0); RG_DEF_METHOD(buffer, 0); }
void Init_giostream(VALUE glib) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IO_STREAM, "IOStream", glib); RG_DEF_METHOD(close, 1); RG_DEF_METHOD(close_async, -1); RG_DEF_METHOD(close_finish, 1); RG_DEF_METHOD_P(has_pending, 0); RG_DEF_METHOD(set_pending, 0); G_DEF_SETTER(RG_TARGET_NAMESPACE, "pending"); RG_DEF_METHOD(clear_pending, 0); }
void Init_gtk_texttag() { VALUE gTextTag = G_DEF_CLASS(GTK_TYPE_TEXT_TAG, "TextTag", mGtk); rb_define_method(gTextTag, "initialize", initialize, -1); rb_define_method(gTextTag, "priority", get_priority, 0); rb_define_method(gTextTag, "set_priority", set_priority, 1); G_DEF_SETTER(gTextTag, "priority"); rb_define_method(gTextTag, "event", event, 3); /* GtkWrapMode */ G_DEF_CLASS(GTK_TYPE_WRAP_MODE, "WrapMode", gTextTag); G_DEF_CONSTANTS(gTextTag, GTK_TYPE_WRAP_MODE, "GTK_"); }
static VALUE put_value(int argc, VALUE *argv, VALUE self) { VALUE value, cancellable; gboolean success; GError *error = NULL; rb_scan_args(argc, argv, "11", &value, &cancellable); /* TODO: How do we convert from a Number to uint64 through byte in a * reliable manner? Is it even sane to do so? */ switch (TYPE(value)) { case T_STRING: success = g_data_output_stream_put_string(_SELF(self), RVAL2CSTR(value), cancellable, &error); break; if (!success) rbgio_raise_io_error(error); return self; } #endif void Init_gdataoutputstream(VALUE glib) { VALUE dataoutputstream = G_DEF_CLASS(G_TYPE_DATA_OUTPUT_STREAM, "DataOutputStream", glib); rb_define_method(dataoutputstream, "initialize", stream_initialize, -1); rb_define_method(dataoutputstream, "byte_order", stream_byte_order, 0); rb_define_method(dataoutputstream, "set_byte_order", stream_set_byte_order, 1); G_DEF_SETTER(dataoutputstream, "byte_order"); rb_define_method(dataoutputstream, "put_byte", stream_put_byte, -1); rb_define_method(dataoutputstream, "put_int16", stream_put_int16, -1); rb_define_method(dataoutputstream, "put_uint16", stream_put_uint16, -1); rb_define_method(dataoutputstream, "put_int32", stream_put_int32, -1); rb_define_method(dataoutputstream, "put_uint32", stream_put_uint32, -1); rb_define_method(dataoutputstream, "put_int64", stream_put_int64, -1); rb_define_method(dataoutputstream, "put_uint64", stream_put_uint64, -1); rb_define_method(dataoutputstream, "put_string", stream_put_string, -1); rb_define_alias(dataoutputstream, "<<", "put_string"); rb_define_alias(dataoutputstream, "write", "put_string"); /* TODO: Should we add #put_value/#put? */ }
void Init_gtk_cellview(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_VIEW, "CellView", mGtk); id_model = rb_intern("model"); id_text = rb_intern("text"); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_displayed_row, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "displayed_row"); RG_DEF_METHOD(displayed_row, 0); RG_DEF_METHOD(get_size_of_row, 1); RG_DEF_METHOD(cell_renderers, 0); }
void Init_gtk_entry() { VALUE gEntry = G_DEF_CLASS(GTK_TYPE_ENTRY, "Entry", mGtk); rb_define_method(gEntry, "initialize", entry_initialize, 0); rb_define_method(gEntry, "layout", entry_get_layout, 0); rb_define_method(gEntry, "layout_offsets", entry_get_layout_offsets, 0); #if GTK_CHECK_VERSION(2,4,0) rb_define_method(gEntry, "set_completion", entry_set_completion, 1); G_DEF_SETTER(gEntry, "completion"); rb_define_method(gEntry, "completion", entry_get_completion, 0); #endif rb_define_method(gEntry, "layout_index_to_text_index", entry_layout_index_to_text_index, 1); rb_define_method(gEntry, "text_index_to_layout_index", entry_text_index_to_layout_index, 1); #if GTK_CHECK_VERSION(2, 12, 0) rb_define_method(gEntry, "cursor_hadjustment", entry_get_cursor_hadjustment, 0); rb_define_method(gEntry, "set_cursor_hadjustment", entry_set_cursor_hadjustment, 1); G_DEF_SETTER(gEntry, "cursor_hadjustment"); #endif }
void Init_gtk_textview() { VALUE cTextView = G_DEF_CLASS(GTK_TYPE_TEXT_VIEW, "TextView", mGtk); id_buffer = rb_intern("buffer"); rb_define_method(cTextView, "initialize", textview_initialize, -1); G_REPLACE_SET_PROPERTY(cTextView, "buffer", textview_set_buffer, 1); G_REPLACE_GET_PROPERTY(cTextView, "buffer", textview_get_buffer, 0); rb_define_method(cTextView, "scroll_to_mark", textview_scroll_to_mark, 5); rb_define_method(cTextView, "scroll_to_iter", textview_scroll_to_iter, 5); rb_define_method(cTextView, "scroll_mark_onscreen", textview_scroll_mark_onscreen, 1); rb_define_method(cTextView, "move_mark_onscreen", textview_move_mark_onscreen, 1); rb_define_method(cTextView, "place_cursor_onscreen", textview_place_cursor_onscreen, 0); rb_define_method(cTextView, "visible_rect", textview_get_visible_rect, 0); rb_define_method(cTextView, "get_iter_location", textview_get_iter_location, 1); rb_define_method(cTextView, "get_line_at_y", textview_get_line_at_y, 1); rb_define_method(cTextView, "get_line_yrange", textview_get_line_yrange, 1); rb_define_method(cTextView, "get_iter_at_location", textview_get_iter_at_location, 2); #if GTK_CHECK_VERSION(2,6,0) rb_define_method(cTextView, "get_iter_at_position", textview_get_iter_at_position, 2); #endif rb_define_method(cTextView, "buffer_to_window_coords", textview_buffer_to_window_coords, 3); rb_define_method(cTextView, "window_to_buffer_coords", textview_window_to_buffer_coords, 3); rb_define_method(cTextView, "get_window", textview_get_window, 1); rb_define_method(cTextView, "get_window_type", textview_get_window_type, 1); rb_define_method(cTextView, "set_border_window_size", textview_set_border_window_size, 2); G_DEF_SETTER(cTextView, "border_window_size"); rb_define_method(cTextView, "get_border_window_size", textview_get_border_window_size, 1); rb_define_method(cTextView, "forward_display_line", textview_forward_display_line, 1); rb_define_method(cTextView, "backward_display_line", textview_backward_display_line, 1); rb_define_method(cTextView, "forward_display_line_end", textview_forward_display_line_end, 1); rb_define_method(cTextView, "backward_display_line_start", textview_backward_display_line_start, 1); rb_define_method(cTextView, "starts_display_line", textview_starts_display_line, 1); rb_define_method(cTextView, "move_visually", textview_move_visually, 2); rb_define_method(cTextView, "add_child_at_anchor", textview_add_child_at_anchor, 2); rb_define_method(cTextView, "add_child_in_window", textview_add_child_in_window, 4); rb_define_method(cTextView, "move_child", textview_move_child, 3); rb_define_method(cTextView, "default_attributes", textview_get_default_attributes, 0); /* GtkTextWindowType */ G_DEF_CLASS(GTK_TYPE_TEXT_WINDOW_TYPE, "WindowType", cTextView); G_DEF_CONSTANTS(cTextView, GTK_TYPE_TEXT_WINDOW_TYPE, "GTK_TEXT_"); rb_define_const(cTextView, "PRIORITY_VALIDATE", INT2FIX(GTK_TEXT_VIEW_PRIORITY_VALIDATE)); }
void Init_gtk_range(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RANGE, "Range", mGtk); RG_DEF_METHOD(value, 0); RG_DEF_METHOD(set_increments, 2); RG_DEF_METHOD(set_range, 2); RG_DEF_METHOD(set_value, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "value"); #if GTK_CHECK_VERSION(2,10,0) /* GtkSensitivityType */ G_DEF_CLASS(GTK_TYPE_SENSITIVITY_TYPE, "SensitivityType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_SENSITIVITY_TYPE, "GTK_"); #endif }
void Init_gtk_cellview() { #if GTK_CHECK_VERSION(2,6,0) VALUE cview = G_DEF_CLASS(GTK_TYPE_CELL_VIEW, "CellView", mGtk); id_model = rb_intern("model"); id_text = rb_intern("text"); rb_define_method(cview, "initialize", cview_initialize, -1); rb_define_method(cview, "set_displayed_row", cview_set_displayed_row, 1); G_DEF_SETTER(cview, "displayed_row"); rb_define_method(cview, "displayed_row", cview_get_displayed_row, 0); rb_define_method(cview, "get_size_of_row", cview_get_size_of_row, 1); rb_define_method(cview, "cell_renderers", cview_get_cell_renderers, 0); #endif }
void Init_gtk_combobox(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_COMBO_BOX, "ComboBox", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(active_iter, 0); RG_DEF_METHOD(set_active_iter, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "active_iter"); RG_DEF_METHOD(append_text, 1); RG_DEF_METHOD(insert_text, 2); RG_DEF_METHOD(prepend_text, 1); RG_DEF_METHOD(remove_text, 1); RG_DEF_METHOD(active_text, 0); RG_DEF_METHOD(popup_accessible, 0); RG_DEF_METHOD(set_row_separator_func, 0); }
void Init_gfileenumerator(VALUE glib) { VALUE fileenumerator = G_DEF_CLASS(G_TYPE_FILE_ENUMERATOR, "FileEnumerator", glib); rb_define_method(fileenumerator, "next_file", fileenumerator_next_file, -1); rb_define_method(fileenumerator, "close", fileenumerator_close, -1); rb_define_method(fileenumerator, "next_files_async", fileenumerator_next_files_async, -1); rb_define_method(fileenumerator, "next_files_finish", fileenumerator_next_files_finish, 1); rb_define_method(fileenumerator, "close_async", fileenumerator_close_async, -1); rb_define_method(fileenumerator, "close_finish", fileenumerator_close_finish, 1); rb_define_method(fileenumerator, "closed?", fileenumerator_is_closed, 0); rb_define_method(fileenumerator, "has_pending?", fileenumerator_has_pending, 0); rb_define_method(fileenumerator, "set_pending", fileenumerator_set_pending, 1); G_DEF_SETTER(fileenumerator, "pending"); rb_define_method(fileenumerator, "container", fileenumerator_get_container, 0); }
void Init_gtk_gdk_pango() { VALUE klass; PangoAttribute* tmpattr; GdkColor color; VALUE mGdkPango = rb_define_module_under(mGdk, "Pango"); VALUE context = GTYPE2CLASS(PANGO_TYPE_CONTEXT); VALUE layout = GTYPE2CLASS(PANGO_TYPE_LAYOUT); VALUE layoutline = GTYPE2CLASS(PANGO_TYPE_LAYOUT_LINE); VALUE pattr = ATTRTYPE2CLASS(CSTR2RVAL("Attribute")); VALUE pattrbool = ATTRTYPE2CLASS(CSTR2RVAL("AttrBool")); VALUE pattr_color = ATTRTYPE2CLASS(CSTR2RVAL("AttrColor")); rb_define_module_function(mGdkPango, "context", gdkpango_s_context_get, -1); rb_define_method(context, "set_colormap", gdkpango_context_set_colormap, 1); G_DEF_SETTER(context, "colormap"); rb_define_method(layout, "get_clip_region", gdkpango_layout_get_clip_region, 3); rb_define_method(layoutline, "get_clip_region", gdkpango_layout_line_get_clip_region, 3); klass = rb_define_class_under(mGdk, "PangoAttrEmbossed", pattrbool); rb_define_method(klass, "initialize", gdkpango_attr_embossed_initialize, 1); tmpattr = gdk_pango_attr_embossed_new(TRUE); rb_define_method(klass, "value", gdkpango_attr_embossed_value, 0); RBPANGO_ADD_ATTRIBUTE(tmpattr->klass->type, klass); pango_attribute_destroy(tmpattr); klass = rb_define_class_under(mGdk, "PangoAttrStipple", pattr); rb_define_method(klass, "initialize", gdkpango_attr_stipple_initialize, 1); rb_define_method(klass, "value", gdkpango_attr_stipple_value, 0); tmpattr = gdk_pango_attr_stipple_new(NULL); RBPANGO_ADD_ATTRIBUTE(tmpattr->klass->type, klass); pango_attribute_destroy(tmpattr); #if GTK_CHECK_VERSION(2, 12, 0) klass = rb_define_class_under(mGdk, "PangoAttrEmbossColor", pattr_color); rb_define_method(klass, "initialize", gdkpango_attr_emboss_color_initialize, 1); rb_define_method(klass, "value", gdkpango_attr_emboss_color_value, 0); tmpattr = gdk_pango_attr_emboss_color_new(&color); RBPANGO_ADD_ATTRIBUTE(tmpattr->klass->type, klass); pango_attribute_destroy(tmpattr); #endif }
void Init_gtk_button() { VALUE gButton = G_DEF_CLASS(GTK_TYPE_BUTTON, "Button", mGtk); rb_define_method(gButton, "initialize", button_initialize, -1); rb_define_method(gButton, "pressed", button_pressed, 0); rb_define_method(gButton, "released", button_released, 0); rb_define_method(gButton, "enter", button_enter, 0); rb_define_method(gButton, "leave", button_leave, 0); #if GTK_CHECK_VERSION(2,4,0) rb_define_method(gButton, "set_alignment", button_set_alignment, 2); G_DEF_SETTER(gButton, "alignment"); rb_define_method(gButton, "alignment", button_get_alignment, 0); #endif }
void Init_gtk_range() { VALUE gRange = G_DEF_CLASS(GTK_TYPE_RANGE, "Range", mGtk); rb_define_method(gRange, "value", range_get_value, 0); rb_define_method(gRange, "set_increments", range_set_increments, 2); rb_define_method(gRange, "set_range", range_set_range, 2); rb_define_method(gRange, "set_value", range_set_value, 1); G_DEF_SETTER(gRange, "value"); #if GTK_CHECK_VERSION(2,10,0) /* GtkSensitivityType */ G_DEF_CLASS(GTK_TYPE_SENSITIVITY_TYPE, "SensitivityType", gRange); G_DEF_CONSTANTS(gRange, GTK_TYPE_SENSITIVITY_TYPE, "GTK_"); #endif }