ruby-gnome2-all-2.1.0/0000755000175000017500000000000012257665512012617 5ustar koukouruby-gnome2-all-2.1.0/gtksourceview3/0000755000175000017500000000000012257665514015605 5ustar koukouruby-gnome2-all-2.1.0/gtksourceview3/ext/0000755000175000017500000000000011701304107016362 5ustar koukouruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/0000755000175000017500000000000012257552170021362 5ustar koukouruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcegutterrendererpixbuf.c0000644000175000017500000000260312002536277030257 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" #define RG_TARGET_NAMESPACE cGutterRendererPixbuf #define _SELF(self) (RVAL2GTKSOURCEGUTTERRENDERERPIXBUF(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_source_gutter_renderer_pixbuf_new()); return Qnil; } void Init_gtksource_gutterrendererpixbuf(VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_SOURCE_TYPE_GUTTER_RENDERER_PIXBUF, "GutterRendererPixbuf", mGtkSource); RG_DEF_METHOD(initialize, 0); RG_REG_GLIBID_SETTER("stock-id"); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourceprintcompositor.c0000644000175000017500000001266211701304107027247 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" /* Module: Gtk::SourcePrintCompositor */ #define RG_TARGET_NAMESPACE cPrintCompositor #define _SELF(self) (RVAL2GTKSOURCEPRINTCOMPOSITOR(self)) /* * Class method: new(buffer) * buffer: a Gtk::SourceBuffer or Gtk::SourceView object. * * Creates a new print compositor to print buffer. * * Returns: the new print compositor object. */ static VALUE rg_initialize(VALUE self, VALUE val) { if (rb_obj_is_kind_of (val, GTYPE2CLASS (GTK_SOURCE_TYPE_BUFFER))) { G_INITIALIZE(self, gtk_source_print_compositor_new (RVAL2GTKSOURCEBUFFER(val))); } else if (rb_obj_is_kind_of (val, GTYPE2CLASS (GTK_SOURCE_TYPE_VIEW))) { G_INITIALIZE(self, gtk_source_print_compositor_new_from_view (RVAL2GTKSOURCEVIEW(val))); } else { rb_raise (rb_eArgError, "invalid argument %s (expect Gtk::SourceBuffer or Gtk::SourceView)", rb_class2name (CLASS_OF (val))); } return Qnil; } static VALUE rg_get_top_margin(VALUE self, VALUE unit) { return DBL2NUM(gtk_source_print_compositor_get_top_margin(_SELF(self), RVAL2GTKUNIT (unit))); } static VALUE rg_set_top_margin(VALUE self, VALUE top, VALUE unit) { gtk_source_print_compositor_set_top_margin(_SELF(self), NUM2DBL(top), RVAL2GTKUNIT (unit)); return self; } static VALUE rg_get_bottom_margin(VALUE self, VALUE unit) { return DBL2NUM(gtk_source_print_compositor_get_bottom_margin(_SELF(self), RVAL2GTKUNIT (unit))); } static VALUE rg_set_bottom_margin(VALUE self, VALUE bottom, VALUE unit) { gtk_source_print_compositor_set_bottom_margin(_SELF(self), NUM2DBL(bottom), RVAL2GTKUNIT (unit)); return self; } static VALUE rg_get_left_margin(VALUE self, VALUE unit) { return DBL2NUM(gtk_source_print_compositor_get_left_margin(_SELF(self), RVAL2GTKUNIT (unit))); } static VALUE rg_set_left_margin(VALUE self, VALUE left, VALUE unit) { gtk_source_print_compositor_set_left_margin(_SELF(self), NUM2DBL(left), RVAL2GTKUNIT (unit)); return self; } static VALUE rg_get_right_margin(VALUE self, VALUE unit) { return DBL2NUM(gtk_source_print_compositor_get_right_margin(_SELF(self), RVAL2GTKUNIT (unit))); } static VALUE rg_set_right_margin(VALUE self, VALUE right, VALUE unit) { gtk_source_print_compositor_set_right_margin(_SELF(self), NUM2DBL(right), RVAL2GTKUNIT (unit)); return self; } static VALUE rg_set_header_format(VALUE self, VALUE separator, VALUE left, VALUE center, VALUE right) { gtk_source_print_compositor_set_header_format(_SELF(self), RVAL2CBOOL(separator), RVAL2CSTR(left), RVAL2CSTR(center), RVAL2CSTR(right)); return self; } static VALUE rg_set_footer_format(VALUE self, VALUE separator, VALUE left, VALUE center, VALUE right) { gtk_source_print_compositor_set_footer_format(_SELF(self), RVAL2CBOOL(separator), RVAL2CSTR(left), RVAL2CSTR(center), RVAL2CSTR(right)); return self; } static VALUE rg_paginate(VALUE self, VALUE context) { return CBOOL2RVAL (gtk_source_print_compositor_paginate (_SELF (self), RVAL2GTKPRINTCONTEXT(context))); } static VALUE rg_pagination_progress(VALUE self) { return DBL2NUM (gtk_source_print_compositor_get_pagination_progress (_SELF (self))); } static VALUE rg_draw_page(VALUE self, VALUE context, VALUE page_nr) { gtk_source_print_compositor_draw_page (_SELF (self), RVAL2GTKPRINTCONTEXT(context), NUM2INT (page_nr)); return self; } void Init_gtksource_printcompositor(VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_SOURCE_TYPE_PRINT_COMPOSITOR, "PrintCompositor", mGtkSource); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(get_top_margin, 1); RG_DEF_METHOD(set_top_margin, 2); RG_DEF_METHOD(get_bottom_margin, 1); RG_DEF_METHOD(set_bottom_margin, 2); RG_DEF_METHOD(get_left_margin, 1); RG_DEF_METHOD(set_left_margin, 2); RG_DEF_METHOD(get_right_margin, 1); RG_DEF_METHOD(set_right_margin, 2); RG_DEF_METHOD(set_header_format, 4); RG_DEF_METHOD(set_footer_format, 4); RG_DEF_METHOD(paginate, 1); RG_DEF_METHOD(pagination_progress, 0); RG_DEF_METHOD(draw_page, 2); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourceundomanager.c0000644000175000017500000000423611701304107026272 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" #define RG_TARGET_NAMESPACE mUndoManager #define _SELF(self) (RVAL2GTKSOURCEUNDOMANAGER(self)) static VALUE rg_end_not_undoable_action(VALUE self) { gtk_source_undo_manager_end_not_undoable_action(_SELF(self)); return self; } static VALUE rg_begin_not_undoable_action(VALUE self) { gtk_source_undo_manager_begin_not_undoable_action(_SELF(self)); if (rb_block_given_p()) rb_ensure(rb_yield, self, rg_end_not_undoable_action, self); return self; } static VALUE rg_can_redo_p(VALUE self) { return CBOOL2RVAL(gtk_source_undo_manager_can_redo(_SELF(self))); } static VALUE rg_can_undo_p(VALUE self) { return CBOOL2RVAL(gtk_source_undo_manager_can_undo(_SELF(self))); } static VALUE rg_redo(VALUE self) { gtk_source_undo_manager_redo(_SELF(self)); return self; } static VALUE rg_undo(VALUE self) { gtk_source_undo_manager_undo(_SELF(self)); return self; } void Init_gtksource_undomanager(VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_SOURCE_TYPE_UNDO_MANAGER, "UndoManager", mGtkSource); RG_DEF_METHOD(begin_not_undoable_action, 0); RG_DEF_METHOD_P(can_redo, 0); RG_DEF_METHOD_P(can_undo, 0); RG_DEF_METHOD(end_not_undoable_action, 0); RG_DEF_METHOD(redo, 0); RG_DEF_METHOD(undo, 0); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcestyle.c0000644000175000017500000000246411701304107025133 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" /* Module: Gtk::SourceStyle */ #define RG_TARGET_NAMESPACE cStyle #define _SELF(self) (RVAL2GTKSOURCESTYLE(self)) static VALUE rg_copy(VALUE self) { return GOBJ2RVAL (gtk_source_style_copy (_SELF (self))); } void Init_gtksource_style (VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_SOURCE_TYPE_STYLE, "Style", mGtkSource); RG_DEF_METHOD(copy, 0); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/gtksourceview3.def0000644000175000017500000000003511701304107025010 0ustar koukouEXPORTS Init_gtksourceview3 ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcemark.c0000644000175000017500000000473311701304107024726 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" /* Class: Gtk::SourceMark * A source mark. */ #define RG_TARGET_NAMESPACE cMark #define _SELF(self) (RVAL2GTKSOURCEMARK(self)) /* Class method: new(name, category) * name: mark name (string) * category: marker category (string) * * Returns: a newly created Gtk::SourceMark object. */ static VALUE rg_initialize(VALUE self, VALUE name, VALUE category) { G_INITIALIZE (self, gtk_source_mark_new (RVAL2CSTR(name), RVAL2CSTR_ACCEPT_SYMBOL(category))); return Qnil; } /* Method: next(category=nil) * category: the category (string), or nil. * * Returns: the next Gtk::SourceMark after the mark. */ static VALUE rg_next(int argc, VALUE *argv, VALUE self) { VALUE category; rb_scan_args (argc, argv, "01", &category); return GOBJ2RVAL (gtk_source_mark_next (_SELF (self), RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(category))); } /* Method: prev(category=nil) * category: the category (string), or nil. * * Returns: the previous Gtk::SourceMark before the mark. */ static VALUE rg_prev(int argc, VALUE *argv, VALUE self) { VALUE category; rb_scan_args (argc, argv, "01", &category); return GOBJ2RVAL (gtk_source_mark_prev (_SELF (self), RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(category))); } void Init_gtksource_mark (VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_SOURCE_TYPE_MARK, "Mark", mGtkSource); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(next, -1); RG_DEF_METHOD(prev, -1); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcegutterrenderer.c0000644000175000017500000001014411701304107027026 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" #define RG_TARGET_NAMESPACE cGutterRenderer #define _SELF(self) (RVAL2GTKSOURCEGUTTERRENDERER(self)) static VALUE rg_end(VALUE self) { gtk_source_gutter_renderer_end(_SELF(self)); return self; } static VALUE rg_begin(VALUE self, VALUE cr, VALUE background_area, VALUE cell_area, VALUE start, VALUE end) { gtk_source_gutter_renderer_begin(_SELF(self), RVAL2CRCONTEXT(cr), RVAL2GDKRECTANGLE(background_area), RVAL2GDKRECTANGLE(cell_area), RVAL2GTKTEXTITER(start), RVAL2GTKTEXTITER(end)); if (rb_block_given_p()) rb_ensure(rb_yield, self, rg_end, self); return self; } static VALUE rg_draw(VALUE self, VALUE cr, VALUE background_area, VALUE cell_area, VALUE start, VALUE end, VALUE state) { gtk_source_gutter_renderer_draw(_SELF(self), RVAL2CRCONTEXT(cr), RVAL2GDKRECTANGLE(background_area), RVAL2GDKRECTANGLE(cell_area), RVAL2GTKTEXTITER(start), RVAL2GTKTEXTITER(end), RVAL2GTKSOURCEGUTTERRENDERERSTATE(state)); return self; } static VALUE rg_alignment(VALUE self) { gfloat xalign, yalign; gtk_source_gutter_renderer_get_alignment(_SELF(self), &xalign, &yalign); return rb_ary_new3(2, xalign, yalign); } static VALUE rg_background(VALUE self) { GdkRGBA color; gboolean result; result = gtk_source_gutter_renderer_get_background(_SELF(self), &color); return result ? GDKRGBA2RVAL(&color) : Qnil; } static VALUE rg_padding(VALUE self) { gint xpad, ypad; gtk_source_gutter_renderer_get_padding(_SELF(self), &xpad, &ypad); return rb_ary_new3(2, INT2NUM(xpad), INT2NUM(ypad)); } static VALUE rg_queue_draw(VALUE self) { gtk_source_gutter_renderer_queue_draw(_SELF(self)); return self; } static VALUE rg_set_alignment(VALUE self, VALUE xalign, VALUE yalign) { gtk_source_gutter_renderer_set_alignment(_SELF(self), NUM2DBL(xalign), NUM2DBL(yalign)); return self; } static VALUE rg_set_background(VALUE self, VALUE color) { gtk_source_gutter_renderer_set_background(_SELF(self), RVAL2GDKRGBA(color)); return self; } static VALUE rg_set_padding(VALUE self, VALUE xpad, VALUE ypad) { gtk_source_gutter_renderer_set_padding(_SELF(self), NUM2INT(xpad), NUM2INT(ypad)); return self; } void Init_gtksource_gutterrenderer(VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_SOURCE_TYPE_GUTTER_RENDERER, "GutterRenderer", mGtkSource); G_DEF_CLASS(GTK_SOURCE_TYPE_GUTTER_RENDERER_ALIGNMENT_MODE, "AlignmentMode", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_SOURCE_TYPE_GUTTER_RENDERER_STATE, "State", RG_TARGET_NAMESPACE); RG_DEF_METHOD(alignment, 0); RG_DEF_METHOD(background, 0); RG_DEF_METHOD(begin, 5); RG_DEF_METHOD(draw, 6); RG_DEF_METHOD(end, 0); RG_DEF_METHOD(padding, 0); RG_DEF_METHOD(queue_draw, 0); RG_DEF_METHOD(set_alignment, 2); RG_DEF_METHOD(set_background, 1); RG_DEF_METHOD(set_padding, 2); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourceview3conversions.h0000644000175000017500000000475111701304107027327 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGTKSOURCEVIEW3CONVERSIONS_H__ #define __RBGTKSOURCEVIEW3CONVERSIONS_H__ #define RVAL2GTKSOURCEBUFFER(o) (GTK_SOURCE_BUFFER(RVAL2GOBJ(o))) #define RVAL2GTKSOURCEGUTTER(o) (GTK_SOURCE_GUTTER(RVAL2GOBJ(o))) #define RVAL2GTKSOURCEGUTTERRENDERER(o) (GTK_SOURCE_GUTTER_RENDERER(RVAL2GOBJ(o))) #define RVAL2GTKSOURCEGUTTERRENDERERPIXBUF(o) (GTK_SOURCE_GUTTER_RENDERER_PIXBUF(RVAL2GOBJ(o))) #define RVAL2GTKSOURCEGUTTERRENDERERTEXT(o) (GTK_SOURCE_GUTTER_RENDERER_TEXT(RVAL2GOBJ(o))) #define RVAL2GTKSOURCELANGUAGE(o) (GTK_SOURCE_LANGUAGE(RVAL2GOBJ(o))) #define RVAL2GTKSOURCELANGUAGEMANAGER(o) (GTK_SOURCE_LANGUAGE_MANAGER(RVAL2GOBJ(o))) #define RVAL2GTKSOURCEMARK(o) (GTK_SOURCE_MARK(RVAL2GOBJ(o))) #define RVAL2GTKSOURCEMARKATTRIBUTES(o) (GTK_SOURCE_MARK_ATTRIBUTES(RVAL2GOBJ(o))) #define RVAL2GTKSOURCEPRINTCOMPOSITOR(o) (GTK_SOURCE_PRINT_COMPOSITOR(RVAL2GOBJ(o))) #define RVAL2GTKSOURCESTYLE(o) (GTK_SOURCE_STYLE(RVAL2GOBJ(o))) #define RVAL2GTKSOURCESTYLESCHEME(o) (GTK_SOURCE_STYLE_SCHEME(RVAL2GOBJ(o))) #define RVAL2GTKSOURCESTYLESCHEMEMANAGER(o) (GTK_SOURCE_STYLE_SCHEME_MANAGER(RVAL2GOBJ(o))) #define RVAL2GTKSOURCEUNDOMANAGER(o) (GTK_SOURCE_UNDO_MANAGER(RVAL2GOBJ(o))) #define RVAL2GTKSOURCEVIEW(o) (GTK_SOURCE_VIEW(RVAL2GOBJ(o))) #define RVAL2GTKSOURCEGUTTERRENDERERSTATE(o) (RVAL2GFLAGS(o, GTK_SOURCE_TYPE_GUTTER_RENDERER_STATE)) #define GTKSOURCEGUTTERRENDERERSTATE2RVAL(o) (GFLAGS2RVAL(o, GTK_SOURCE_TYPE_GUTTER_RENDERER_STATE)) #endif /* __RBGTKSOURCEVIEW3CONVERSIONS_H__ */ ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourceview.c0000644000175000017500000000575611701304107024754 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" /* Class: Gtk::SourceView * A view on a source. */ #define RG_TARGET_NAMESPACE cView #define _SELF(self) (RVAL2GTKSOURCEVIEW(self)) /* * Class method: new(buffer=nil) * buffer: a Gtk::SourceBuffer object. * * Creates a new Gtk::SourceView. If buffer is not provided or nil, an empty * buffer will be created for you. Note that one buffer can be shared among * many widgets. * * Returns: a newly created Gtk::SourceView object. */ static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE buffer; GtkWidget *widget; rb_scan_args(argc, argv, "01", &buffer); if (NIL_P(buffer)) widget = gtk_source_view_new(); else widget = gtk_source_view_new_with_buffer(RVAL2GTKSOURCEBUFFER(buffer)); RBGTK_INITIALIZE(self, widget); return self; } static VALUE rg_get_gutter(VALUE self, VALUE window_type) { VALUE gutter; gutter = GOBJ2RVAL(gtk_source_view_get_gutter(_SELF(self), RVAL2GTKTEXTWINDOWTYPE(window_type))); G_CHILD_ADD(self, gutter); return gutter; } static VALUE rg_set_mark_attributes(VALUE self, VALUE category, VALUE attributes, VALUE priority) { gtk_source_view_set_mark_attributes(_SELF(self), RVAL2CSTR_ACCEPT_SYMBOL(category), RVAL2GTKSOURCEMARKATTRIBUTES(attributes), NUM2INT(priority)); return self; } void Init_gtksource_view (VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_SOURCE_TYPE_VIEW, "View", mGtkSource); G_DEF_CLASS(GTK_SOURCE_TYPE_VIEW_GUTTER_POSITION, "GutterPosition", RG_TARGET_NAMESPACE); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(get_gutter, 1); RG_DEF_METHOD(set_mark_attributes, 3); G_DEF_CLASS(GTK_SOURCE_TYPE_SMART_HOME_END_TYPE, "SmartHomeEndType", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_SOURCE_TYPE_DRAW_SPACES_FLAGS, "DrawSpacesFlags", RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcegutterrenderertext.c0000644000175000017500000000372611701304107027743 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" #define RG_TARGET_NAMESPACE cGutterRendererText #define _SELF(self) (RVAL2GTKSOURCEGUTTERRENDERERTEXT(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_source_gutter_renderer_text_new()); return Qnil; } static VALUE rg_set_markup(VALUE self, VALUE markup) { StringValue(markup); gtk_source_gutter_renderer_text_set_markup(_SELF(self), RSTRING_PTR(markup), RSTRING_LEN(markup)); return self; } static VALUE rg_set_text(VALUE self, VALUE text) { StringValue(text); gtk_source_gutter_renderer_text_set_text(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text)); return self; } void Init_gtksource_gutterrenderertext(VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_SOURCE_TYPE_GUTTER_RENDERER_TEXT, "GutterRendererText", mGtkSource); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_markup, 1); RG_DEF_METHOD(set_text, 1); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/extconf.rb0000644000175000017500000000443712257552170023365 0ustar koukou=begin extconf.rb for Ruby/GtkSourceView3 extension library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "gtksourceview3" package_id = "gtksourceview-3.0" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end ["glib2", "atk", "pango", "gdk_pixbuf2", "gdk3", "gtk3"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end rcairo_options = {} rcairo_source_dir_names = ["rcairo"] if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM rcairo_source_dir_names.unshift("rcairo.win32") end rcairo_source_dir_names.each do |rcairo_source_dir_name| rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name if rcairo_source_dir.exist? rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s break end end unless check_cairo(rcairo_options) exit(false) end setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id, :debian => "libgtksourceview-3.0-dev", :fedora => "gtksourceview3-devel", :homebrew => "gtksourceview3", :macports => "gtksourceview3") exit(false) end make_version_header("GTKSOURCEVIEW3", package_id, ".") create_pkg_config_file("Ruby/GtkSourceView3", package_id) $defs << "-DRUBY_GTKSOURCEVIEW3_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcelanguage.c0000644000175000017500000000627211701304107025557 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" /* Class: Gtk::SourceLanguage * Source language. */ #define RG_TARGET_NAMESPACE cLanguage #define _SELF(self) (RVAL2GTKSOURCELANGUAGE(self)) /* Method: get_metadata(name) * name: the metadata property name (string) * Returns: the localized metadata for the given name. */ static VALUE rg_get_metadata(VALUE self, VALUE name) { return CSTR2RVAL (gtk_source_language_get_metadata (_SELF (self), RVAL2CSTR(name))); } /* Method: mime_types * Returns: a list of mime types for the given language, as an array of strings. */ static VALUE rg_mime_types(VALUE self) { VALUE ary; char **types = gtk_source_language_get_mime_types (_SELF (self)); if (!types) return Qnil; ary = rb_ary_new(); while (*types){ rb_ary_push(ary, CSTR2RVAL(*types)); types++; } return ary; } /* Method: globs * Returns: a list of globs for the given language, as an array of strings. */ static VALUE rg_globs(VALUE self) { VALUE ary; char **globs = gtk_source_language_get_globs (_SELF (self)); if (!globs) return Qnil; ary = rb_ary_new(); while (*globs){ rb_ary_push(ary, CSTR2RVAL(*globs)); globs++; } return ary; } /* Method: get_style_name(style_id) * style_id: the style id (string) * Returns: the localized style name of the given id. */ static VALUE rg_get_style_name(VALUE self, VALUE style_id) { return CSTR2RVAL (gtk_source_language_get_style_name (_SELF (self), RVAL2CSTR(style_id))); } /* Method: style_id * Returns: the styles defined by the language. */ static VALUE rg_style_ids(VALUE self) { VALUE ary; gchar **ids = gtk_source_language_get_style_ids (_SELF (self)); if (!ids) return Qnil; ary = rb_ary_new(); while (*ids){ rb_ary_push(ary, CSTR2RVAL(*ids)); ids++; } return ary; } void Init_gtksource_language (VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_SOURCE_TYPE_LANGUAGE, "Language", mGtkSource); RG_DEF_METHOD(get_metadata, 1); RG_DEF_METHOD(mime_types, 0); RG_DEF_METHOD(globs, 0); RG_DEF_METHOD(get_style_name, 1); RG_DEF_METHOD(style_ids, 0); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcestylescheme.c0000644000175000017500000000407511701304107026320 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" /* Module: Gtk::SourceStyleScheme */ #define RG_TARGET_NAMESPACE cStyleScheme #define _SELF(self) (RVAL2GTKSOURCESTYLESCHEME(self)) /* Method: authors * * Returns: a list of authors for the given style scheme. */ static VALUE rg_authors(VALUE self) { VALUE ary; const gchar * const * authors = gtk_source_style_scheme_get_authors (_SELF (self)); if (!authors) return Qnil; ary = rb_ary_new(); while (*authors){ rb_ary_push(ary, CSTR2RVAL(*authors)); authors++; } return ary; } /* Method: get_style(style_id) * style_name: the name of a style. * * Gets the tag associated with the given style_name in the style scheme. * * Returns: Gtk::SourceStyle */ static VALUE rg_get_style(VALUE self, VALUE style_name) { return GOBJ2RVAL(gtk_source_style_scheme_get_style(_SELF(self), RVAL2CSTR(style_name))); } void Init_gtksource_stylescheme (VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_SOURCE_TYPE_STYLE_SCHEME, "StyleScheme", mGtkSource); RG_DEF_METHOD(authors, 0); RG_DEF_METHOD(get_style, 1); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcelanguagemanager.c0000664000175000017500000000670411740310343027116 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" /* Class: Gtk::SourceLanguageManager * A class to manage source language. */ #define RG_TARGET_NAMESPACE cLanguageManager #define _SELF(self) (RVAL2GTKSOURCELANGUAGEMANAGER(self)) static VALUE rb_mGtkSource; /* Class method: new * Returns: a newly created Gtk::SourceLanguageManager object. */ static VALUE rg_initialize(VALUE self) { G_INITIALIZE (self, gtk_source_language_manager_new ()); return Qnil; } /* Class method: default * * Gets the default language manager. * * Returns: a Gtk::SourceLanguageManager */ static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { GtkSourceLanguageManager* slm = gtk_source_language_manager_get_default(); GType gtype = G_TYPE_FROM_INSTANCE(slm); gchar *gtypename = (gchar *) g_type_name (gtype); if (strncmp (gtypename, "GtkSource", 9) == 0) gtypename += 9; if (!rb_const_defined_at (rb_mGtkSource, rb_intern (gtypename))) G_DEF_CLASS (gtype, gtypename, rb_mGtkSource); return GOBJ2RVAL(slm); } /* * Method: get_language(id) * id: a language id (as a string). * * Gets the Gtk::SourceLanguage which is associated with the given id * in the language manager. * * Returns: a Gtk::SourceLanguage, or nil if there is no language associated * with the given id. */ static VALUE rg_get_language(VALUE self, VALUE id) { return GOBJ2RVAL (gtk_source_language_manager_get_language (_SELF (self), RVAL2CSTR (id))); } /* * Method: guess_language(filename, content_type) * filename: a file name (as a string), or nil. * content_type: content type (as a string), or nil. * * Guesses the Gtk::SourceLanguage for the given file name and content type. * * Returns: a Gtk::SourceLanguage, or nil if there is no language associated * with the given filename or content_type. */ static VALUE rg_guess_language(VALUE self, VALUE filename, VALUE content_type) { return GOBJ2RVAL (gtk_source_language_manager_guess_language (_SELF (self), RVAL2CSTR_ACCEPT_NIL (filename), RVAL2CSTR_ACCEPT_NIL (content_type))); } void Init_gtksource_languagemanager (VALUE mGtkSource) { rb_mGtkSource = mGtkSource; VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_SOURCE_TYPE_LANGUAGE_MANAGER, "LanguageManager", mGtkSource); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(get_language, 1); RG_DEF_METHOD(guess_language, 2); RG_DEF_SMETHOD(default, 0); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksource.c0000644000175000017500000000437211701304107024052 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" #define RG_TARGET_NAMESPACE mGtkSource void Init_gtksourceview3 (void) { VALUE RG_TARGET_NAMESPACE = rb_define_module("GtkSource"); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(GTKSOURCEVIEW3_MAJOR_VERSION), INT2FIX(GTKSOURCEVIEW3_MINOR_VERSION), INT2FIX(GTKSOURCEVIEW3_MICRO_VERSION))); Init_gtksource_view (RG_TARGET_NAMESPACE); Init_gtksource_buffer (RG_TARGET_NAMESPACE); Init_gtksource_language (RG_TARGET_NAMESPACE); Init_gtksource_languagemanager (RG_TARGET_NAMESPACE); Init_gtksource_mark (RG_TARGET_NAMESPACE); Init_gtksource_printcompositor (RG_TARGET_NAMESPACE); Init_gtksource_style (RG_TARGET_NAMESPACE); Init_gtksource_stylescheme (RG_TARGET_NAMESPACE); Init_gtksource_styleschememanager (RG_TARGET_NAMESPACE); Init_gtksource_gutter(RG_TARGET_NAMESPACE); Init_gtksource_gutterrenderer(RG_TARGET_NAMESPACE); Init_gtksource_gutterrendererpixbuf(RG_TARGET_NAMESPACE); Init_gtksource_gutterrenderertext(RG_TARGET_NAMESPACE); Init_gtksource_markattributes(RG_TARGET_NAMESPACE); Init_gtksource_undomanager(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcemarkattributes.c0000644000175000017500000000441611701304107027033 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" #define RG_TARGET_NAMESPACE cMarkAttributes #define _SELF(self) (RVAL2GTKSOURCEMARKATTRIBUTES(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_source_mark_attributes_new()); return Qnil; } static VALUE rg_get_tooltip_markup(VALUE self, VALUE mark) { gchar *markup; markup = gtk_source_mark_attributes_get_tooltip_markup(_SELF(self), RVAL2GTKSOURCEMARK(mark)); return CSTR2RVAL_FREE(markup); } static VALUE rg_get_tooltip_text(VALUE self, VALUE mark) { gchar *text; text = gtk_source_mark_attributes_get_tooltip_text(_SELF(self), RVAL2GTKSOURCEMARK(mark)); return CSTR2RVAL_FREE(text); } static VALUE rg_render_icon(VALUE self, VALUE widget, VALUE size) { GdkPixbuf *icon; icon = gtk_source_mark_attributes_render_icon(_SELF(self), RVAL2GTKWIDGET(widget), NUM2INT(size)); return GOBJ2RVAL(icon); } void Init_gtksource_markattributes(VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_SOURCE_TYPE_MARK_ATTRIBUTES, "MarkAttributes", mGtkSource); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(get_tooltip_markup, 1); RG_DEF_METHOD(get_tooltip_text, 1); RG_DEF_METHOD(render_icon, 2); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcestyleschememanager.c0000664000175000017500000000773311740310343027663 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" /* Class: Gtk::SourceStyleSchemeManager * A class to manage source style scheme. */ #define RG_TARGET_NAMESPACE cStyleSchemeManager #define _SELF(self) (RVAL2GTKSOURCESTYLESCHEMEMANAGER(self)) static VALUE rb_mGtkSource; /* Class method: new * Returns: a newly created Gtk::SourceStyleSchemeManager object. */ static VALUE rg_initialize(VALUE self) { G_INITIALIZE (self, gtk_source_style_scheme_manager_new ()); return Qnil; } /* Class method: default * * Gets the default style scheme manager. * * Returns: a Gtk::SourceStyleSchemeManager */ static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { GtkSourceStyleSchemeManager* sssm = gtk_source_style_scheme_manager_get_default(); GType gtype = G_TYPE_FROM_INSTANCE(sssm); gchar *gtypename = (gchar *) g_type_name (gtype); if (strncmp (gtypename, "GtkSource", 9) == 0) gtypename += 9; if (!rb_const_defined_at (rb_mGtkSource, rb_intern (gtypename))) G_DEF_CLASS (gtype, gtypename, rb_mGtkSource); return GOBJ2RVAL(sssm); } /* Method: append_search_path(path) * path: additional style scheme file directory path (string) * * Appends the style scheme files directory for the given style scheme manager. * * Returns: self. */ static VALUE rg_append_search_path(VALUE self, VALUE path) { gtk_source_style_scheme_manager_append_search_path (_SELF (self), RVAL2CSTR(path)); return self; } /* Method: prepend_search_path(path) * path: additional style scheme file directory path (string) * * Prepend the style scheme files directory for the given style scheme manager. * * Returns: self. */ static VALUE rg_prepend_search_path(VALUE self, VALUE path) { gtk_source_style_scheme_manager_prepend_search_path (_SELF (self), RVAL2CSTR(path)); return self; } /* * Method: scheme(scheme_id) * scheme_id: a style scheme id (as a string). * * Gets the Gtk::SourceStyleScheme which is associated with the given id * in the style scheme manager. * * Returns: a Gtk::SourceStyleScheme, or nil if there is no style scheme * associated with the given id. */ static VALUE rg_get_scheme(VALUE self, VALUE scheme_id) { return GOBJ2RVAL (gtk_source_style_scheme_manager_get_scheme (_SELF (self), RVAL2CSTR (scheme_id))); } /* * Method: force_rescan * * Forces all style schemes to be reloaded the next time the * Gtk::SourceStyleSchemeManager is accessed. * * Returns: self. */ static VALUE rg_force_rescan(VALUE self) { gtk_source_style_scheme_manager_force_rescan(_SELF (self)); return self; } void Init_gtksource_styleschememanager (VALUE mGtkSource) { rb_mGtkSource = mGtkSource; VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_SOURCE_TYPE_STYLE_SCHEME_MANAGER, "StyleSchemeManager", mGtkSource); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(append_search_path, 1); RG_DEF_METHOD(prepend_search_path, 1); RG_DEF_METHOD(get_scheme, 1); RG_DEF_METHOD(force_rescan, 0); RG_DEF_SMETHOD(default, 0); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcegutter.c0000644000175000017500000000437511701304107025310 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" #define RG_TARGET_NAMESPACE cGutter #define _SELF(self) (RVAL2GTKSOURCEGUTTER(self)) static VALUE rg_window(VALUE self) { return GOBJ2RVAL(gtk_source_gutter_get_window(_SELF(self))); } static VALUE rg_insert(VALUE self, VALUE renderer, VALUE position) { gboolean result; result = gtk_source_gutter_insert(_SELF(self), RVAL2GTKSOURCEGUTTERRENDERER(renderer), NUM2INT(position)); G_CHILD_ADD(self, renderer); return CBOOL2RVAL(result); } static VALUE rg_queue_draw(VALUE self) { gtk_source_gutter_queue_draw(_SELF(self)); return self; } static VALUE rg_remove(VALUE self, VALUE renderer) { gtk_source_gutter_remove(_SELF(self), RVAL2GTKSOURCEGUTTERRENDERER(renderer)); G_CHILD_REMOVE(self, renderer); return self; } static VALUE rg_reorder(VALUE self, VALUE renderer, VALUE position) { gtk_source_gutter_reorder(_SELF(self), RVAL2GTKSOURCEGUTTERRENDERER(renderer), NUM2INT(position)); return self; } void Init_gtksource_gutter(VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_SOURCE_TYPE_GUTTER, "Gutter", mGtkSource); RG_DEF_METHOD(window, 0); RG_DEF_METHOD(insert, 2); RG_DEF_METHOD(queue_draw, 0); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(reorder, 2); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/depend0000644000175000017500000000026012064346475022547 0ustar koukouinstall: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-gtksourceview3.pc $(pkgconfigdir); \ fi ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourcebuffer.c0000644000175000017500000002451212002536277025254 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourceview3private.h" /* Class: Gtk::SourceBuffer * Text buffer object for Gtk::SourceView. */ #define RG_TARGET_NAMESPACE cBuffer #define _SELF(self) (RVAL2GTKSOURCEBUFFER(self)) #define RVAL2ITER(self, position) rval2iter(self, position) #define RVAL2STARTITER(self, iter, out) \ rval2iter_with_default(&(self), &(iter), &(out), gtk_text_buffer_get_start_iter) #define RVAL2ENDITER(self, iter, out) \ rval2iter_with_default(&(self), &(iter), &(out), gtk_text_buffer_get_end_iter) static GtkTextIter * rval2iter(VALUE self, VALUE position) { if (!g_type_is_a(RVAL2GTYPE(position), GTK_TYPE_TEXT_ITER)) position = rb_funcall(self, rb_intern("get_iter_at"), 1, position); return RVAL2GTKTEXTITER(position); } static GtkTextIter * rval2iter_with_default(VALUE *self, VALUE *iter, GtkTextIter *out, void (*default_func)(GtkTextBuffer *, GtkTextIter *)) { if (NIL_P(*iter)) { default_func(RVAL2GTKTEXTBUFFER(*self), out); return out; } else { return RVAL2ITER(*self, *iter); } } /* * Class method: new(obj=nil) * obj: either a Gtk::TextTagTable, a Gtk::SourceLanguage, or nil. * * Creates a new source buffer. If a Gtk::SourceTagTable is provided, the * buffer will use it, otherwise it will create a new one. * * If a Gtk::SourceLanguage object is given, the buffer will be created * using highlightings patterns in this language. This is equivalent to * creating a new source buffer with the default tag table and then setting * the 'language' property. * * Returns: a newly created Gtk::SourceBuffer object. */ static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE val; rb_scan_args (argc, argv, "01", &val); if (NIL_P (val)) { G_INITIALIZE (self, gtk_source_buffer_new (NULL)); } else if (rb_obj_is_kind_of (val, GTYPE2CLASS (GTK_TYPE_TEXT_TAG_TABLE))) { G_INITIALIZE (self, gtk_source_buffer_new(RVAL2GTKTEXTTAGTABLE(val))); } else if (rb_obj_is_kind_of (val, GTYPE2CLASS (GTK_SOURCE_TYPE_LANGUAGE))) { G_INITIALIZE (self, gtk_source_buffer_new_with_language(RVAL2GTKSOURCELANGUAGE(val))); } else { rb_raise (rb_eArgError, "invalid argument %s (expect nil, Gtk::TextTagTable or Gtk::SourceLanguage)", rb_class2name (CLASS_OF (val))); } return Qnil; } /* * Method: redo! * * Redoes the last undo operation. Use Gtk::SourceBuffer#can_redo? to check * whether a call to this function will have any effect. * * Returns: self. */ static VALUE rg_redo_bang(VALUE self) { gtk_source_buffer_redo (_SELF (self)); return self; } /* * Method: undo! * * Undoes the last user action which modified the buffer. * Use Gtk::SourceBuffer#can_undo? to check whether a call to this function * will have any effect. * * Actions are defined as groups of operations between a call to * Gtk::TextBuffer#begin_user_action and Gtk::TextBuffer#end_user_action, * or sequences of similar edits (inserts or deletes) on the same line. * * Returns: self. */ static VALUE rg_undo_bang(VALUE self) { gtk_source_buffer_undo (_SELF (self)); return self; } /* * Method: begin_not_undoable_action * Method: begin_not_undoable_action { ... } * * Marks the beginning of a not undoable action on the buffer, disabling the * undo manager. * * If a block is given, the block is called after marking the beginning * of a not undoable action on the buffer. * At the end of the block, marks the end of a not undoable action on the * buffer. When the last not undoable block is finished, the list of undo * actions is cleared and the undo manager is re-enabled. * * Returns: self */ static VALUE rg_begin_not_undoable_action(VALUE self) { gtk_source_buffer_begin_not_undoable_action (_SELF (self)); if (rb_block_given_p()) { VALUE block = rb_block_proc (); rb_funcall (block, rb_intern ("call"), 0); gtk_source_buffer_end_not_undoable_action (_SELF (self)); } return self; } /* * Method: end_not_undoable_action * * Marks the end of a not undoable action on the buffer. * When the last not undoable block is finished, the list of undo * actions is cleared and the undo manager is re-enabled. * * Returns: self */ static VALUE rg_end_not_undoable_action(VALUE self) { gtk_source_buffer_end_not_undoable_action (_SELF (self)); return self; } /* * Method: create_source_mark(name=nil, category, where) * name: the name of the mark. * type: a string defining the mark type. * where: a location to place the mark, as a Gtk::TreeIter object. * * Creates a mark in the buffer of the given type. A mark is semantically * very similar to a Gtk::TextMark, except it has a type which is used by the * Gtk::SourceView object displaying the buffer to show a pixmap on the left * margin, at the line the mark is in. Because of this, a mark is generally * associated to a line and not a character position. Marks are also * accessible through a position or range in the buffer. * * Marks are implemented using Gtk::TextMark, so all characteristics and * restrictions to marks apply to marks too. These includes life cycle issues * and "mark-set" and "mark-deleted" signal emissions. * * Like a Gtk::TextMark, a Gtk::SourceMark can be anonymous if the passed * name is nil. * * Marks always have left gravity and are moved to the beginning of the line * when the user deletes the line they were in. Also, if the user deletes a * region of text which contained lines with marks, those are deleted. * * Typical uses for a mark are bookmarks, breakpoints, current executing * instruction indication in a source file, etc.. * * Returns: a new Gtk::SourceMark object, owned by the buffer. */ static VALUE rg_create_source_mark(int argc, VALUE *argv, VALUE self) { VALUE name, category, where; if (argc == 2) rb_scan_args (argc, argv, "21", &where, &category, &name); else rb_scan_args (argc, argv, "30", &name, &category, &where); return GOBJ2RVAL (gtk_source_buffer_create_source_mark (_SELF (self), RVAL2CSTR (name), RVAL2CSTR_ACCEPT_SYMBOL (category), RVAL2ITER (self, where))); } static VALUE rg_get_source_marks_at_line(int argc, VALUE *argv, VALUE self) { VALUE line, category; rb_scan_args (argc, argv, "11", &line, &category); /* TODO: need free? */ return GOBJGSLIST2RVAL_FREE(gtk_source_buffer_get_source_marks_at_line(_SELF(self), NUM2INT(line), RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(category)), g_slist_free, NULL); } static VALUE rg_get_source_marks_at_iter(int argc, VALUE *argv, VALUE self) { VALUE iter, category; rb_scan_args (argc, argv, "11", &iter, &category); /* TODO: need free? */ return GOBJGSLIST2RVAL_FREE(gtk_source_buffer_get_source_marks_at_iter(_SELF(self), RVAL2ITER(self, iter), RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(category)), g_slist_free, NULL); } static VALUE rg_remove_source_marks(int argc, VALUE *argv, VALUE self) { VALUE start, end, category; GtkTextIter start_iter, end_iter; rb_scan_args (argc, argv, "03", &start, &end, &category); gtk_source_buffer_remove_source_marks (_SELF (self), RVAL2STARTITER(self, start, start_iter), RVAL2ENDITER(self, end, end_iter), RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL (category)); return self; } static VALUE rg_forward_iter_to_source_mark(int argc, VALUE *argv, VALUE self) { VALUE iter, category; rb_scan_args (argc, argv, "11", &iter, &category); return CBOOL2RVAL (gtk_source_buffer_forward_iter_to_source_mark (_SELF (self), RVAL2ITER (self, iter), RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL (category))); } static VALUE rg_backward_iter_to_source_mark(int argc, VALUE *argv, VALUE self) { VALUE iter, category; rb_scan_args (argc, argv, "11", &iter, &category); return CBOOL2RVAL (gtk_source_buffer_backward_iter_to_source_mark (_SELF (self), RVAL2ITER (self, iter), RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL (category))); } static VALUE rg_ensure_highlight(VALUE self, VALUE start, VALUE end) { gtk_source_buffer_ensure_highlight (_SELF (self), RVAL2ITER (self, start), RVAL2ITER (self, end)); return self; } void Init_gtksource_buffer (VALUE mGtkSource) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_SOURCE_TYPE_BUFFER, "Buffer", mGtkSource); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD_BANG(redo, 0); RG_DEF_METHOD_BANG(undo, 0); RG_DEF_METHOD(begin_not_undoable_action, 0); RG_DEF_METHOD(end_not_undoable_action, 0); RG_DEF_METHOD(create_source_mark, -1); RG_DEF_METHOD(get_source_marks_at_line, -1); RG_DEF_METHOD(get_source_marks_at_iter, -1); RG_DEF_METHOD(remove_source_marks, -1); RG_DEF_METHOD(forward_iter_to_source_mark, -1); RG_DEF_METHOD(backward_iter_to_source_mark, -1); RG_DEF_METHOD(ensure_highlight, 2); } ruby-gnome2-all-2.1.0/gtksourceview3/ext/gtksourceview3/rbgtksourceview3private.h0000664000175000017500000000453211740310343026432 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGTKSOURCEVIEW3PRIVATE_H__ #define __RBGTKSOURCEVIEW3PRIVATE_H__ #include #include #include #include #include #include #include "rbgtksourceview3conversions.h" #include "rbgtksourceview3version.h" extern void Init_gtksourceview3(void); G_GNUC_INTERNAL void Init_gtksource_view (VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_buffer (VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_language (VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_languagemanager (VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_mark (VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_printcompositor (VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_style (VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_stylescheme (VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_styleschememanager (VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_gutter(VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_gutterrenderer(VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_gutterrendererpixbuf(VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_gutterrenderertext(VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_markattributes(VALUE mGtkSource); G_GNUC_INTERNAL void Init_gtksource_undomanager(VALUE mGtkSource); #endif /* __RBGTKSOURCEVIEW3PRIVATE_H__ */ ruby-gnome2-all-2.1.0/gtksourceview3/COPYING.LIB0000644000175000017500000006364212257552170017251 0ustar koukou GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ruby-gnome2-all-2.1.0/gtksourceview3/lib/0000755000175000017500000000000012137115065016337 5ustar koukouruby-gnome2-all-2.1.0/gtksourceview3/lib/gtksourceview3/0000755000175000017500000000000012002536277021326 5ustar koukouruby-gnome2-all-2.1.0/gtksourceview3/lib/gtksourceview3/deprecated.rb0000644000175000017500000000464112002536277023760 0ustar koukoumodule Gtk extend GLib::Deprecatable define_deprecated_const :SourceBuffer, 'GtkSource::Buffer' define_deprecated_const :SourceLanguage, 'GtkSource::Language' define_deprecated_const :SourceLanguageManager, 'GtkSource::LanguageManager' define_deprecated_const :SourceMark, 'GtkSource::Mark' define_deprecated_const :SourcePrintCompositor, 'GtkSource::PrintCompositor' define_deprecated_const :SourceStyle, 'GtkSource::Style' define_deprecated_const :SourceStyleScheme, 'GtkSource::StyleScheme' define_deprecated_const :SourceStyleSchemeManager, 'GtkSource::StyleSchemeManager' define_deprecated_const :SourceView, 'GtkSource::View' end module GtkSource class Buffer extend GLib::Deprecatable define_deprecated_method :not_undoable_action, :begin_not_undoable_action define_deprecated_method :non_undoable_action, :begin_not_undoable_action end class View extend GLib::Deprecatable define_deprecated_flags :DrawSpacesFlags, 'DRAW_SPACES' define_deprecated_enums :SmartHomeEndType, 'SMART_HOME_END' define_deprecated_const :BUILD_VERSION, 'GtkSource::BUILD_VERSION' define_deprecated_method :set_mark_category_background, :warn => "Use 'GtkSource::MarkAttributes#set_background'." do |_self, category, background| _self.get_mark_attributes(category).first.set_background(background) # TODO end define_deprecated_method :get_mark_category_background, :warn => "Use 'GtkSource::MarkAttributes#background'." do |_self, category| _self.get_mark_attributes(category).first.background # TODO end define_deprecated_method :set_mark_category_pixbuf, :warn => "Use 'GtkSource::MarkAttributes#set_pixbuf'." do |_self, category, pixbuf| _self.get_mark_attributes(category).first.set_pixbuf(pixbuf) # TODO end define_deprecated_method :get_mark_category_pixbuf, :warn => "Use 'GtkSource::MarkAttributes#pixbuf'." do |_self, category| _self.get_mark_attributes(category).first.pixbuf # TODO end define_deprecated_method :set_mark_category_priority, :warn => "Use '#{self}#set_mark_attributes'." do |_self, category, priority| attributes = _self.get_mark_attributes(category).first # TODO _self.set_mark_attributes(category, attributes, priority) end define_deprecated_method :get_mark_category_priority, :warn => "Use '#{self}#get_mark_attributes'." do |_self, category| _self.get_mark_attributes(category).last # TODO end end end ruby-gnome2-all-2.1.0/gtksourceview3/lib/gtksourceview3.rb0000644000175000017500000000100612137115065021645 0ustar koukou=begin Copyright (c) 2008-2011 Ruby-GNOME2 Project Team This program is licensed under the same licence as Ruby-GNOME2. =end require 'gtk3' base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, micro, = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/gtksourceview3.so" rescue LoadError require "gtksourceview3.so" end require 'gtksourceview3/deprecated' ruby-gnome2-all-2.1.0/gtksourceview3/sample/0000755000175000017500000000000011701304107017043 5ustar koukouruby-gnome2-all-2.1.0/gtksourceview3/sample/sourcelanguagemanager.rb0000644000175000017500000000071011701304107023725 0ustar koukou#!/usr/bin/env ruby =begin sourcelanguagesmanager.rb - Ruby/GtkSourceView sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: sourcelanguagesmanager.rb,v 1.3 2007/06/03 02:11:07 mutoh Exp $ =end require 'gtksourceview3' s = Gtk::SourceLanguageManager.new s.language_ids.each do |v| puts v end s.search_path.each do |v| puts v end puts s.get_language("html").name ruby-gnome2-all-2.1.0/gtksourceview3/sample/test.rb0000644000175000017500000000142411701304107020350 0ustar koukou#!/usr/bin/env ruby =begin test.rb - Ruby/GtkSourceView2 sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: test.rb,v 1.4 2007/06/03 02:11:07 mutoh Exp $ =end require 'gtksourceview3' w = Gtk::Window.new w.signal_connect("delete-event"){Gtk::main_quit} view = Gtk::SourceView.new w.add(Gtk::ScrolledWindow.new.add(view)) view.show_line_numbers = true view.insert_spaces_instead_of_tabs = true view.indent_width = 4 view.show_right_margin = true view.right_margin_position = 80 lang = Gtk::SourceLanguageManager.new.get_language('ruby') view.buffer.language = lang view.buffer.highlight_syntax = true view.buffer.highlight_matching_brackets = true w.set_default_size(450,300) w.show_all Gtk.main ruby-gnome2-all-2.1.0/gtksourceview3/README.md0000644000175000017500000000104212257552170017052 0ustar koukou# Ruby/GtkSourceView3 Ruby/GtkSourceView3 is a Ruby binding of gtksourceview-3.x. ## Requirements * Ruby/GTK3 in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [GtkSourceView](http://projects.gnome.org/gtksourceview/) 3.4.2 or later ## Install gem install gtksourceview3 ## License Copyright (c) 2008-2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ## Project Website http://ruby-gnome2.sourceforge.jp/ ruby-gnome2-all-2.1.0/gtksourceview3/extconf.rb0000644000175000017500000000223511701304107017557 0ustar koukou#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "gtksourceview3" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ruby-gnome2-all-2.1.0/gtksourceview3/Rakefile0000644000175000017500000000351012257552170017242 0ustar koukou# -*- ruby -*- # # Copyright (C) 2012-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $LOAD_PATH.unshift("./../glib2/lib") require "gnome2/rake/package-task" package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/GtkSourceView3 is a Ruby binding of gtksourceview-3.x." package.description = "Ruby/GtkSourceView3 is a Ruby binding of gtksourceview-3.x." package.dependency.gem.runtime = ["gtk3"] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = [ "glib2", "atk", "pango", "gdk_pixbuf2", "gdk3", "gobject-introspection", ] package.windows.gobject_introspection_dependencies = [ "atk", "pango", "gdk_pixbuf2", "gdk3", ] package.external_packages = [ { :name => "gtksourceview", :download_site => :gnome, :label => "GtkSourceView", :version => "3.10.1", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :built_file => "bin/libgtksourceview-3.0-1.dll", }, } ] end package_task.define ruby-gnome2-all-2.1.0/gtksourceview3/test/0000755000175000017500000000000011701304107016541 5ustar koukouruby-gnome2-all-2.1.0/gtksourceview3/test/test_source_view.rb0000644000175000017500000000104611701304107022460 0ustar koukou# -*- coding: utf-8 -*- class TestSourceView < Test::Unit::TestCase def test_mark_category_background view = Gtk::SourceView.new red_rgb = [65535, 0, 0] red_color = Gdk::Color.parse("red") assert_not_equal(red_rgb, view.get_mark_category_background("XXX").to_a) view.set_mark_category_background("XXX", red_color) assert_equal(red_rgb, view.get_mark_category_background("XXX").to_a) view.set_mark_category_background("XXX", nil) assert_not_equal(red_rgb, view.get_mark_category_background("XXX").to_a) end end ruby-gnome2-all-2.1.0/gtksourceview3/test/run-test.rb0000755000175000017500000000214511701304107020654 0ustar koukou#!/usr/bin/env ruby ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") atk_base = File.join(ruby_gnome2_base, "atk") pango_base = File.join(ruby_gnome2_base, "pango") gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2") gtk_base = File.join(ruby_gnome2_base, "gtk2") gtk_source_view2_base = File.join(ruby_gnome2_base, "gtksourceview2") $LOAD_PATH.unshift(glib_base) require 'test/glib-test-init' [glib_base, atk_base, pango_base, gdk_pixbuf_base, gtk_base, gtk_source_view2_base].each do |target| if system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(1) end $LOAD_PATH.unshift(File.join(target, "ext", File.basename(target))) $LOAD_PATH.unshift(File.join(target, "src")) $LOAD_PATH.unshift(File.join(target, "src", "lib")) $LOAD_PATH.unshift(File.join(target)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(gtk_base, "test")) require 'gtk-test-utils' require 'gtksourceview2' exit Test::Unit::AutoRunner.run(true) ruby-gnome2-all-2.1.0/webkit-gtk2/0000755000175000017500000000000012257665514014753 5ustar koukouruby-gnome2-all-2.1.0/webkit-gtk2/COPYING.LIB0000644000175000017500000006364212123512153016404 0ustar koukou GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ruby-gnome2-all-2.1.0/webkit-gtk2/lib/0000755000175000017500000000000012147676243015520 5ustar koukouruby-gnome2-all-2.1.0/webkit-gtk2/lib/webkit-gtk2.rb0000644000175000017500000000260312147676243020200 0ustar koukou# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gobject-introspection" require "gtk2" base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) module WebKitGtk2 class << self def const_missing(name) init if const_defined?(name) const_get(name) else super end end def init Loader.load("WebKit", self, :version => "1.0") class << self remove_method(:init) remove_method(:const_missing) end end end class Loader < GObjectIntrospection::Loader end end ruby-gnome2-all-2.1.0/webkit-gtk2/sample/0000755000175000017500000000000012147676243016233 5ustar koukouruby-gnome2-all-2.1.0/webkit-gtk2/sample/brower.rb0000644000175000017500000000206612147676243020064 0ustar koukou# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "webkit-gtk2" window = Gtk::Window.new window.signal_connect("destroy") do Gtk.main_quit end scrolled_window = Gtk::ScrolledWindow.new view = WebKitGtk2::WebView.new view.load_uri("http://webkitgtk.org/") scrolled_window.add(view) window.add(scrolled_window) window.show_all Gtk.main ruby-gnome2-all-2.1.0/webkit-gtk2/README.md0000644000175000017500000000101712123512153016207 0ustar koukou# Ruby/WebKitGTK2 Ruby/WebKitGTK2 is a Ruby binding of WebKitGTK+ for GTK+ 2. ## Requirements * Ruby/GObjectIntrospection and Ruby/GTK2 in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [WebKitGTK+](http://webkitgtk.org/) ## Install gem install webkit-gtk2 ## License Copyright (c) 2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ## Project Website http://ruby-gnome2.sourceforge.jp/ ruby-gnome2-all-2.1.0/webkit-gtk2/Rakefile0000644000175000017500000000307012123512153016376 0ustar koukou# -*- ruby -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $LOAD_PATH.unshift("./../glib2/lib") require "gnome2-raketask" package = GNOME2Package.new do |_package| _package.summary = "Ruby/WebKitGtk2 is a Ruby binding of WebKitGTK+ for Gtk 2.0 Toolkit" _package.description = "Ruby/WebKitGtk2 is a Ruby binding of WebKitGTK+ for Gtk 2.0 Toolkit" _package.dependency.gem.runtime = ["gobject-introspection", "gtk2"] _package.dependency.gem.development = ["test-unit-notify"] _package.win32.packages = [] _package.win32.dependencies = [] _package.win32.build_dependencies = ["glib2", "gobject-introspection"] _package.win32.build_packages = [] end package.define_tasks namespace :dependency do desc "Install dependencies" task :install do # TODO: Install gir1.2-webkit-1.0 on Debian. end end task :build => "dependency:install" ruby-gnome2-all-2.1.0/webkit-gtk2/test/0000755000175000017500000000000012257552170015723 5ustar koukouruby-gnome2-all-2.1.0/webkit-gtk2/test/run-test.rb0000755000175000017500000000427612257552170020045 0ustar koukou#!/usr/bin/env ruby # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") gio_base = File.join(ruby_gnome2_base, "gio2") atk_base = File.join(ruby_gnome2_base, "atk") pango_base = File.join(ruby_gnome2_base, "pango") gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2") gtk2_base = File.join(ruby_gnome2_base, "gtk2") gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection") webkit_gtk2_base = File.join(ruby_gnome2_base, "webkit-gtk2") modules = [ [glib_base, "glib2"], [gio_base, "gio2"], [atk_base, "atk"], [pango_base, "pango"], [gdk_pixbuf_base, "gdk_pixbuf2"], [gtk2_base, "gtk2"], [gobject_introspection_base, "gobject-introspection"], [webkit_gtk2_base, "webkit-gtk2"], ] modules.each do |target, module_name| if File.exist?("Makefile") and system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require "glib-test-init" $LOAD_PATH.unshift(File.join(gobject_introspection_base, "test")) require "gobject-introspection-test-utils" $LOAD_PATH.unshift(File.join(webkit_gtk2_base, "test")) require "webkit-gtk-test-utils" require "webkit-gtk2" exit Test::Unit::AutoRunner.run(true) ruby-gnome2-all-2.1.0/webkit-gtk2/test/webkit-gtk-test-utils.rb0000644000175000017500000000153012123512153022417 0ustar koukou# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "test-unit" require "test/unit/notify" module WebKitGtkTestUtils end ruby-gnome2-all-2.1.0/glib2/0000755000175000017500000000000012257665516013622 5ustar koukouruby-gnome2-all-2.1.0/glib2/patches/0000755000175000017500000000000012257552167015246 5ustar koukouruby-gnome2-all-2.1.0/glib2/patches/glib-2.38.2-add-missing-exeext.diff0000644000175000017500000000200212257552167023234 0ustar koukoudiff -ru glib-2.38.2.orig/gio/tests/Makefile.am glib-2.38.2/gio/tests/Makefile.am --- glib-2.38.2.orig/gio/tests/Makefile.am 2013-11-12 14:30:22.000000000 +0900 +++ glib-2.38.2/gio/tests/Makefile.am 2013-12-23 15:13:59.328468099 +0900 @@ -431,7 +431,7 @@ if CROSS_COMPILING glib_compile_resources=$(GLIB_COMPILE_RESOURCES) else - glib_compile_resources=$(top_builddir)/gio/glib-compile-resources + glib_compile_resources=$(top_builddir)/gio/glib-compile-resources$(EXEEXT) endif resources.o: test_resources2.h diff -ru glib-2.38.2.orig/tests/gobject/Makefile.am glib-2.38.2/tests/gobject/Makefile.am --- glib-2.38.2.orig/tests/gobject/Makefile.am 2013-11-08 00:29:13.000000000 +0900 +++ glib-2.38.2/tests/gobject/Makefile.am 2013-12-23 15:12:21.190876890 +0900 @@ -51,7 +51,7 @@ if CROSS_COMPILING glib_genmarshal=$(GLIB_GENMARSHAL) else - glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal + glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal$(EXEEXT) endif testmarshal.h: stamp-testmarshal.h ruby-gnome2-all-2.1.0/glib2/ext/0000755000175000017500000000000011701304107014375 5ustar koukouruby-gnome2-all-2.1.0/glib2/ext/glib2/0000755000175000017500000000000012257664725015422 5ustar koukouruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_timer.c0000644000175000017500000000554512257552167020234 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #ifdef G_OS_WIN32 #include #endif /*****************************************/ /* This is stolen from gtimer.c of glib-2.6.2. */ struct _GTimer { #ifdef G_OS_WIN32 DWORD start; DWORD end; #else /* !G_OS_WIN32 */ struct timeval start; struct timeval end; #endif /* !G_OS_WIN32 */ guint active : 1; }; static GTimer* timer_copy(GTimer *timer) { GTimer* new_timer; g_return_val_if_fail (timer != NULL, NULL); new_timer = g_new(struct _GTimer, 1); *new_timer = *timer; return new_timer; } static GType g_timer_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GTimer", (GBoxedCopyFunc)timer_copy, (GBoxedFreeFunc)g_timer_destroy); return our_type; } /*****************************************/ #define G_TYPE_TIMER (g_timer_get_type()) #define RG_TARGET_NAMESPACE cTimer #define _SELF(s) ((GTimer*)RVAL2BOXED(s, G_TYPE_TIMER)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_timer_new()); return Qnil; } static VALUE rg_start(VALUE self) { g_timer_start(_SELF(self)); return self; } static VALUE rg_stop(VALUE self) { g_timer_stop(_SELF(self)); return self; } static VALUE rg_continue(VALUE self) { g_timer_continue(_SELF(self)); return self; } static VALUE rg_elapsed(VALUE self) { gulong microseconds; gdouble ret = g_timer_elapsed(_SELF(self), µseconds); return rb_assoc_new(rb_float_new(ret), ULONG2NUM(microseconds)); } static VALUE rg_reset(VALUE self) { g_timer_reset(_SELF(self)); return self; } void Init_glib_timer(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_TIMER, "Timer", mGLib); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(start, 0); RG_DEF_METHOD(stop, 0); RG_DEF_METHOD(continue, 0); RG_DEF_METHOD(elapsed, 0); RG_DEF_METHOD(reset, 0); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_iochannel_win32_socket.c0000644000175000017500000000317211704226436023431 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #ifdef G_OS_WIN32 #define RG_TARGET_NAMESPACE cIOChannelWin32Socket static VALUE rg_initialize(VALUE self, VALUE socket) { GIOChannel *io = NULL; int fd; rb_secure(4); /* TODO: support IO object */ fd = NUM2INT(socket); io = g_io_channel_win32_new_socket(rb_w32_get_osfhandle(fd)); G_INITIALIZE(self, io); return Qnil; } #endif void Init_glib_io_channel_win32_socket(void) { #ifdef G_OS_WIN32 /* GIOWin32Channel */ VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = rb_define_class_under(mGLib, "IOChannelWin32Socket", rb_const_get(mGLib, rb_intern("IOChannel"))); RG_DEF_METHOD(initialize, 1); #endif } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_param.c0000664000175000017500000002460011740310343020173 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE rbgobj_cParam VALUE RG_TARGET_NAMESPACE; static GQuark qparamspec; static VALUE pspec_s_allocate(VALUE klass); typedef struct { GParamSpec* instance; const RGObjClassInfo* cinfo; } pspec_holder; static void pspec_mark(pspec_holder *holder) { if (holder->instance) rbgobj_instance_call_cinfo_mark(holder->instance); } static void pspec_free(pspec_holder *holder) { if (holder->instance){ rbgobj_instance_call_cinfo_free(holder->instance); g_param_spec_set_qdata(holder->instance, qparamspec, NULL); g_param_spec_unref(holder->instance); } free(holder); } GParamSpec* rbgobj_get_param_spec(VALUE obj) { pspec_holder* holder; Data_Get_Struct(obj, pspec_holder, holder); return G_PARAM_SPEC(holder->instance); } void rbgobj_param_spec_initialize(VALUE self, GParamSpec *pspec) { pspec_holder* holder; Data_Get_Struct(self, pspec_holder, holder); pspec = g_param_spec_ref(pspec); g_param_spec_sink(pspec); holder->instance = pspec; holder->cinfo = GTYPE2CINFO(G_PARAM_SPEC_TYPE(pspec)); g_param_spec_set_qdata(pspec, qparamspec, (gpointer)self); } VALUE rbgobj_get_ruby_object_from_param_spec(GParamSpec* pspec, gboolean alloc) { gpointer data = g_param_spec_get_qdata(pspec, qparamspec); if (data) return (VALUE)data; else if (alloc) { VALUE result = pspec_s_allocate(GTYPE2CLASS(G_PARAM_SPEC_TYPE(pspec))); rbgobj_param_spec_initialize(result, pspec); return result; } else return Qnil; } /**********************************************************************/ static VALUE pspec_s_allocate(VALUE klass) { const RGObjClassInfo* cinfo = rbgobj_lookup_class(klass); if (G_TYPE_IS_ABSTRACT(cinfo->gtype)) rb_raise(rb_eTypeError, "abstract class"); { pspec_holder* holder; VALUE result; result = Data_Make_Struct(klass, pspec_holder, pspec_mark, pspec_free, holder); holder->instance = NULL; holder->cinfo = NULL; return result; } } static VALUE rg_inspect(VALUE self) { GParamSpec* pspec = rbgobj_get_param_spec(self); VALUE v = rb_inspect(GTYPE2CLASS(pspec->owner_type)); gchar* str = g_strdup_printf("#<%s: %s#%s>", rb_class2name(CLASS_OF(self)), StringValuePtr(v), g_param_spec_get_name(pspec)); VALUE result = rb_str_new2(str); g_free(str); return result; } static VALUE rg_name(VALUE self) { return rb_str_new2(g_param_spec_get_name(rbgobj_get_param_spec(self))); } static VALUE rg_nick(VALUE self) { const gchar* str = g_param_spec_get_nick(rbgobj_get_param_spec(self)); return str ? rb_str_new2(str) : Qnil; } static VALUE rg_blurb(VALUE self) { const gchar* str = g_param_spec_get_blurb(rbgobj_get_param_spec(self)); return str ? rb_str_new2(str) : Qnil; } static VALUE rg_flags(VALUE self) { return INT2NUM(rbgobj_get_param_spec(self)->flags); } static VALUE rg_value_type(VALUE self) { return rbgobj_gtype_new(G_PARAM_SPEC_VALUE_TYPE(rbgobj_get_param_spec(self))); } static VALUE rg_owner_type(VALUE self) { return rbgobj_gtype_new(rbgobj_get_param_spec(self)->owner_type); } static VALUE rg_owner(VALUE self) { return GTYPE2CLASS(rbgobj_get_param_spec(self)->owner_type); } static VALUE rg_value_default(VALUE self) { GValue tmp = G_VALUE_INIT; VALUE result; g_value_init(&tmp, G_PARAM_SPEC_VALUE_TYPE(rbgobj_get_param_spec(self))); g_param_value_set_default(rbgobj_get_param_spec(self), &tmp); result = rbgobj_gvalue_to_rvalue(&tmp); g_value_unset(&tmp); return result; } #if 0 static VALUE rg_value_defaults_p(VALUE self, VALUE val) { GValue tmp = {0,}; gboolean result; /* FIXME: use rb_ensure to ensure following g_value_unset() call*/ g_value_init(&tmp, G_PARAM_SPEC_VALUE_TYPE(rbgobj_get_param_spec(self))); rbgobj_rvalue_to_gvalue(val, &tmp); result = g_param_value_defaults(rbgobj_get_param_spec(self), &tmp); g_value_unset(&tmp); return CBOOL2RVAL(result); } #endif struct validate_arg{ GParamSpec* pspec; GValue* value; VALUE obj; }; static VALUE value_validate_body(struct validate_arg* arg) { VALUE ret; gboolean b; rbgobj_rvalue_to_gvalue(arg->obj, arg->value); b = g_param_value_validate(arg->pspec, arg->value); ret = rbgobj_gvalue_to_rvalue(arg->value); return rb_ary_new3(2, CBOOL2RVAL(b), ret); } static VALUE value_validate_ensure(struct validate_arg* arg) { g_value_unset(arg->value); return Qnil; } static VALUE rg_value_validate(VALUE self, VALUE obj) { struct validate_arg arg; GValue value = G_VALUE_INIT; arg.pspec = rbgobj_get_param_spec(self); arg.value = &value; arg.obj = obj; g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE(arg.pspec)); return rb_ensure(value_validate_body, (VALUE)&arg, value_validate_ensure, (VALUE)&arg); } static VALUE rg_value_convert(int argc, VALUE* argv, VALUE self) { GParamSpec* pspec = rbgobj_get_param_spec(self); VALUE src, strict_validation; VALUE src_type; VALUE result = Qnil; GValue src_value = G_VALUE_INIT; GValue dest_value = G_VALUE_INIT; gboolean b; rb_scan_args(argc, argv, "21", &src, &src_type, &strict_validation); /* FIXME: use rb_ensure to ensure following g_value_unset() call*/ g_value_init(&src_value, rbgobj_gtype_get(src_type)); g_value_init(&dest_value, G_PARAM_SPEC_VALUE_TYPE(pspec)); rbgobj_rvalue_to_gvalue(src, &src_value); b = g_param_value_convert(rbgobj_get_param_spec(self), &src_value, &dest_value, RVAL2CBOOL(strict_validation)); if (b) result = rbgobj_gvalue_to_rvalue(&dest_value); g_value_unset(&src_value); g_value_unset(&dest_value); if (b) return result; else rb_raise(rb_eTypeError, "can't convert"); } static VALUE rg_value_compare(VALUE self, VALUE a, VALUE b) { GParamSpec* pspec = rbgobj_get_param_spec(self); GType type = G_PARAM_SPEC_VALUE_TYPE(pspec); GValue v1 = G_VALUE_INIT; GValue v2 = G_VALUE_INIT; gint result; g_value_init(&v1, type); g_value_init(&v2, type); /* FIXME: use rb_ensure to ensure following g_value_unset() call*/ rbgobj_rvalue_to_gvalue(a, &v1); rbgobj_rvalue_to_gvalue(b, &v2); result = g_param_values_cmp(pspec, &v1, &v2); g_value_unset(&v1); g_value_unset(&v2); return INT2NUM(result); } static VALUE rg_ref_count(VALUE self) { return INT2NUM(G_PARAM_SPEC(rbgobj_get_param_spec(self))->ref_count); } #define param_is_flag(flag) \ static VALUE \ param_is_##flag(VALUE self) \ { \ GParamSpec* pspec = G_PARAM_SPEC(rbgobj_get_param_spec(self)); \ return CBOOL2RVAL(pspec->flags & flag); \ } param_is_flag(G_PARAM_READABLE) param_is_flag(G_PARAM_WRITABLE) param_is_flag(G_PARAM_CONSTRUCT) param_is_flag(G_PARAM_CONSTRUCT_ONLY) param_is_flag(G_PARAM_LAX_VALIDATION) param_is_flag(G_PARAM_PRIVATE) param_is_flag(G_PARAM_READWRITE) /**********************************************************************/ void Init_gobject_gparam(void) { qparamspec = g_quark_from_static_string("__ruby_gobject_param_spec__"); RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_PARAM, "Param", mGLib); /* GParamFlags */ rb_define_const(RG_TARGET_NAMESPACE, "READABLE", INT2FIX(G_PARAM_READABLE)); rb_define_const(RG_TARGET_NAMESPACE, "WRITABLE", INT2FIX(G_PARAM_WRITABLE)); rb_define_const(RG_TARGET_NAMESPACE, "CONSTRUCT", INT2FIX(G_PARAM_CONSTRUCT)); rb_define_const(RG_TARGET_NAMESPACE, "CONSTRUCT_ONLY", INT2FIX(G_PARAM_CONSTRUCT_ONLY)); rb_define_const(RG_TARGET_NAMESPACE, "LAX_VALIDATION", INT2FIX(G_PARAM_LAX_VALIDATION)); rb_define_const(RG_TARGET_NAMESPACE, "PRIVATE", INT2FIX(G_PARAM_PRIVATE)); rb_define_const(RG_TARGET_NAMESPACE, "READWRITE", INT2FIX(G_PARAM_READWRITE)); rb_define_const(RG_TARGET_NAMESPACE, "MASK", INT2FIX(G_PARAM_MASK)); rb_define_const(RG_TARGET_NAMESPACE, "USER_SHIFT", INT2FIX(G_PARAM_USER_SHIFT)); rb_define_alloc_func(RG_TARGET_NAMESPACE, pspec_s_allocate); RG_DEF_METHOD(inspect, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(nick, 0); RG_DEF_METHOD(blurb, 0); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(value_type, 0); RG_DEF_METHOD(owner_type, 0); RG_DEF_METHOD(owner, 0); RG_DEF_METHOD(value_default, 0); RG_DEF_ALIAS("default", "value_default"); // FIXME: better name #if 0 RG_DEF_METHOD_P(value_defaults, 1); #endif RG_DEF_METHOD(value_validate, 1); RG_DEF_METHOD(value_convert, -1); RG_DEF_METHOD(value_compare, 2); /* for debugging */ RG_DEF_METHOD(ref_count, 0); rbg_define_method(RG_TARGET_NAMESPACE, "readable?", param_is_G_PARAM_READABLE, 0); rbg_define_method(RG_TARGET_NAMESPACE, "writable?", param_is_G_PARAM_WRITABLE, 0); rbg_define_method(RG_TARGET_NAMESPACE, "construct?", param_is_G_PARAM_CONSTRUCT, 0); rbg_define_method(RG_TARGET_NAMESPACE, "construct_only?", param_is_G_PARAM_CONSTRUCT_ONLY, 0); rbg_define_method(RG_TARGET_NAMESPACE, "lax_validation?", param_is_G_PARAM_LAX_VALIDATION, 0); rbg_define_method(RG_TARGET_NAMESPACE, "private?", param_is_G_PARAM_PRIVATE, 0); rbg_define_method(RG_TARGET_NAMESPACE, "readwrite?", param_is_G_PARAM_READWRITE, 0); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_valuearray.c0000644000175000017500000000520711701304107021244 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" static VALUE value_array_to_ruby(const GValue *from) { VALUE ary; guint i; GValueArray *array = (GValueArray *)g_value_get_boxed(from); if (array == NULL) return Qnil; ary = rb_ary_new(); for (i = 0; i < array->n_values; i++) rb_ary_push(ary, GVAL2RVAL(g_value_array_get_nth(array, i))); return ary; } struct value_array_from_ruby_args { VALUE ary; long n; GValueArray *result; }; static VALUE value_array_from_ruby_body(VALUE value) { long i; struct value_array_from_ruby_args *args = (struct value_array_from_ruby_args *)value; for (i = 0; i < args->n; i++) { GValue v = G_VALUE_INIT; g_value_init(&v, RVAL2GTYPE(RARRAY_PTR(args->ary)[i])); rbgobj_rvalue_to_gvalue(RARRAY_PTR(args->ary)[i], &v); g_value_array_append(args->result, &v); } return Qnil; } static G_GNUC_NORETURN VALUE value_array_from_ruby_rescue(VALUE value) { g_value_array_free(((struct value_array_from_ruby_args *)value)->result); rb_exc_raise(rb_errinfo()); } static void value_array_from_ruby(const VALUE from, GValue *to) { struct value_array_from_ruby_args args; if (NIL_P(from)) { g_value_set_boxed(to, NULL); return; } args.ary = rb_ary_to_ary(from); args.n = RARRAY_LEN(args.ary); args.result = g_value_array_new(args.n); rb_rescue(value_array_from_ruby_body, (VALUE)&args, value_array_from_ruby_rescue, (VALUE)&args); g_value_set_boxed(to, args.result); } void Init_gobject_value_array(void) { /* ValueArray is treated as Array */ rbgobj_register_g2r_func(G_TYPE_VALUE_ARRAY, value_array_to_ruby); rbgobj_register_r2g_func(G_TYPE_VALUE_ARRAY, value_array_from_ruby); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgutildeprecated.h0000644000175000017500000000546411701304107021247 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGUTILDEPRECATED_H__ #define __RBGUTILDEPRECATED_H__ G_BEGIN_DECLS #define G_DEF_SETTER(klass, name) \ rb_funcall(klass, rbgutil_id_module_eval, 1, rb_str_new2( \ "def " name "=(val); set_" name "(val); val; end\n")) #define G_DEF_SETTERS(klass) rbgutil_def_setters(klass) #define GLIST2ARY(list) (rbgutil_glist2ary(list)) #define GLIST2ARY_FREE(list) (rbgutil_glist2ary_and_free(list)) #define GLIST2ARYF(list) (GLIST2ARY_FREE(list)) #define GLIST2ARY2(list, gtype) (rbgutil_glist2ary_boxed(list, gtype)) #define GLIST2ARY2F(list, gtype) (rbgutil_glist2ary_boxed_and_free(list, gtype)) #define GLIST2ARY_STR(list) (rbgutil_glist2ary_string(list)) #define GLIST2ARY_STR_FREE(list) (rbgutil_glist2ary_string_and_free(list)) #define GSLIST2ARY(list) (rbgutil_gslist2ary(list)) #define GSLIST2ARY_FREE(list) (rbgutil_gslist2ary_and_free(list)) #define GSLIST2ARYF(list) (GSLIST2ARY_FREE(list)) #define GSLIST2ARY2(list, gtype) (rbgutil_gslist2ary_boxed(list, gtype)) #define GSLIST2ARY2F(list, gtype) (rbgutil_gslist2ary_boxed_and_free(list, gtype)) #define G_SET_SYMBOL_PROPERTY(gtype, name) \ rbgobj_register_property_getter(gtype, name, rbgutil_sym_g2r_func) #define G_BLOCK_PROC rb_block_proc extern VALUE rbgutil_glist2ary(const GList *list); extern VALUE rbgutil_glist2ary_and_free(GList* list); extern VALUE rbgutil_glist2ary_boxed(const GList *list, GType gtype); extern VALUE rbgutil_glist2ary_boxed_and_free(GList *list, GType gtype); extern VALUE rbgutil_glist2ary_string(const GList *list); extern VALUE rbgutil_glist2ary_string_and_free(GList *list); extern VALUE rbgutil_gslist2ary(const GSList *list); extern VALUE rbgutil_gslist2ary_and_free(GSList *list); extern VALUE rbgutil_gslist2ary_boxed(const GSList *list, GType gtype); extern VALUE rbgutil_gslist2ary_boxed_and_free(GSList *list, GType gtype); G_END_DECLS #endif /* __RBGUTILDEPRECATED_H__ */ ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_threads.c0000644000175000017500000000302111701304107020507 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE cThread static VALUE RG_TARGET_NAMESPACE; static VALUE rg_s_init(VALUE self) { #ifdef HAVE_G_THREAD_INIT #ifdef G_THREADS_ENABLED g_thread_init(NULL); #endif #endif return self; } static VALUE rg_s_supported_p(G_GNUC_UNUSED VALUE self) { #ifdef HAVE_G_THREAD_INIT #ifdef G_THREADS_ENABLED return CBOOL2RVAL(g_thread_supported()); #else return Qfalse; #endif #else return Qfalse; #endif } void Init_glib_threads(void) { RG_TARGET_NAMESPACE = rb_define_class_under(mGLib, "Thread", rb_cObject); RG_DEF_SMETHOD(init, 0); RG_DEF_SMETHOD_P(supported, 0); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_value.c0000644000175000017500000002566512257552167020241 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" /**********************************************************************/ #define RG_TARGET_NAMESPACE rbgobj_cValue #define _SELF(self) RVAL2GVALUE(self) static ID id_to_s; static GQuark qRValueToGValueFunc; static GQuark qGValueToRValueFunc; void rbgobj_register_r2g_func(GType gtype, RValueToGValueFunc func) { g_type_set_qdata(gtype, qRValueToGValueFunc, func); } void rbgobj_register_g2r_func(GType gtype, GValueToRValueFunc func) { g_type_set_qdata(gtype, qGValueToRValueFunc, func); } /**********************************************************************/ VALUE rbgobj_gvalue_to_rvalue(const GValue* value) { GType type, fundamental_type; VALUE rvalue; if (!value) return Qnil; type = G_VALUE_TYPE(value); if (rbgobj_convert_gvalue2rvalue(type, value, &rvalue)) return rvalue; fundamental_type = G_TYPE_FUNDAMENTAL(type); switch (fundamental_type) { case G_TYPE_NONE: return Qnil; case G_TYPE_CHAR: return CHR2FIX(g_value_get_char(value)); case G_TYPE_UCHAR: return INT2FIX(g_value_get_uchar(value)); case G_TYPE_BOOLEAN: return CBOOL2RVAL(g_value_get_boolean(value)); case G_TYPE_INT: return INT2NUM(g_value_get_int(value)); case G_TYPE_UINT: return UINT2NUM(g_value_get_uint(value)); case G_TYPE_LONG: return LONG2NUM(g_value_get_long(value)); case G_TYPE_ULONG: return ULONG2NUM(g_value_get_ulong(value)); case G_TYPE_INT64: return rbglib_int64_to_num(g_value_get_int64(value)); case G_TYPE_UINT64: return rbglib_uint64_to_num(g_value_get_uint64(value)); case G_TYPE_FLOAT: return rb_float_new(g_value_get_float(value)); case G_TYPE_DOUBLE: return rb_float_new(g_value_get_double(value)); case G_TYPE_STRING: return CSTR2RVAL(g_value_get_string(value)); case G_TYPE_ENUM: return rbgobj_make_enum(g_value_get_enum(value), type); case G_TYPE_FLAGS: return rbgobj_make_flags(g_value_get_flags(value), type); case G_TYPE_OBJECT: case G_TYPE_INTERFACE: { GObject* gobj = g_value_get_object(value); return gobj ? GOBJ2RVAL(gobj) : Qnil; } case G_TYPE_PARAM: { GParamSpec* pspec = g_value_get_param(value); return pspec ? rbgobj_ruby_object_from_instance(pspec) : Qnil; } case G_TYPE_POINTER: { gpointer ptr = g_value_get_pointer(value); if (!ptr) return Qnil; else return rbgobj_ptr_new(type, ptr); } case G_TYPE_BOXED: { GType gtype; for (gtype = type; gtype != G_TYPE_INVALID; gtype = g_type_parent(gtype)) { GValueToRValueFunc func = g_type_get_qdata(gtype, qGValueToRValueFunc); if (!func) continue; return func(value); } } default: if (!rbgobj_convert_gvalue2rvalue(fundamental_type, value, &rvalue)) { GValueToRValueFunc func; func = g_type_get_qdata(type, qGValueToRValueFunc); if (!func) { g_warning("rbgobj_gvalue_to_rvalue: unsupported type: %s\n", g_type_name(type)); } else { rvalue = func(value); } } return rvalue; } } static VALUE rbgobj_gvalue_to_rvalue_unset_body(VALUE value) { return GVAL2RVAL((GValue *)value); } static VALUE rbgobj_gvalue_to_rvalue_unset_ensure(VALUE value) { g_value_unset((GValue *)value); return Qnil; } VALUE rbgobj_gvalue_to_rvalue_unset(GValue *value) { return rb_ensure(rbgobj_gvalue_to_rvalue_unset_body, (VALUE)value, rbgobj_gvalue_to_rvalue_unset_ensure, (VALUE)value); } void rbgobj_initialize_gvalue(GValue *result, VALUE value) { GType type; type = rbgobj_convert_rvalue2gtype(value); if (type == 0) { switch (TYPE(value)) { case T_NONE: case T_NIL: type = G_TYPE_NONE; break; case T_FLOAT: type = G_TYPE_DOUBLE; break; case T_STRING: case T_SYMBOL: type = G_TYPE_STRING; break; case T_FIXNUM: type = G_TYPE_INT; break; case T_BIGNUM: type = G_TYPE_INT64; break; case T_TRUE: case T_FALSE: type = G_TYPE_BOOLEAN; break; default: if (RVAL2CBOOL(rb_obj_is_kind_of(value, rbgobj_cEnum))) { type = G_TYPE_ENUM; } else if (RVAL2CBOOL(rb_obj_is_kind_of(value, rbgobj_cFlags))) { type = G_TYPE_FLAGS; } else if (RVAL2CBOOL(rb_obj_is_kind_of(value, rbgobj_cBoxed))) { type = G_TYPE_BOXED; } else if (RVAL2CBOOL(rb_obj_is_kind_of(value, rbgobj_cParam))) { type = G_TYPE_PARAM; } else if (RVAL2CBOOL(rb_obj_is_kind_of(value, rbgobj_cObject))) { type = G_TYPE_OBJECT; } else if (RVAL2CBOOL(rb_obj_is_kind_of(value, rbgobj_mInterface))) { /* should use rbgobj_mMetaInterface? */ type = G_TYPE_INTERFACE; } else { VALUE inspected_value; inspected_value = rb_funcall(value, rb_intern("inspect"), 0); rb_raise(rb_eArgError, "unsupported value type: %s", RSTRING_PTR(inspected_value)); } break; } } g_value_init(result, type); rbgobj_rvalue_to_gvalue(value, result); } void rbgobj_rvalue_to_gvalue(VALUE val, GValue* result) { GType type, fundamental_type; type = G_VALUE_TYPE(result); if (rbgobj_convert_rvalue2gvalue(type, val, result)) return; fundamental_type = G_TYPE_FUNDAMENTAL(type); switch (fundamental_type) { case G_TYPE_NONE: return; case G_TYPE_CHAR: g_value_set_char(result, NUM2INT(val)); return; case G_TYPE_UCHAR: g_value_set_uchar(result, NUM2UINT(val)); return; case G_TYPE_BOOLEAN: g_value_set_boolean(result, RVAL2CBOOL(val)); return; case G_TYPE_INT: g_value_set_int(result, NUM2INT(val)); return; case G_TYPE_UINT: g_value_set_uint(result, NUM2UINT(val)); return; case G_TYPE_LONG: g_value_set_long(result, NUM2LONG(val)); return; case G_TYPE_ULONG: g_value_set_ulong(result, NUM2ULONG(val)); return; case G_TYPE_INT64: g_value_set_int64(result, rbglib_num_to_int64(val)); return; case G_TYPE_UINT64: g_value_set_uint64(result, rbglib_num_to_uint64(val)); return; case G_TYPE_ENUM: g_value_set_enum(result, rbgobj_get_enum(val, G_VALUE_TYPE(result))); return; case G_TYPE_FLAGS: g_value_set_flags(result, rbgobj_get_flags(val, G_VALUE_TYPE(result))); return; case G_TYPE_FLOAT: g_value_set_float(result, NUM2DBL(val)); return; case G_TYPE_DOUBLE: g_value_set_double(result, NUM2DBL(val)); return; case G_TYPE_STRING: { if (SYMBOL_P(val)) val = rb_funcall(val, id_to_s, 0); g_value_set_string(result, RVAL2CSTR_ACCEPT_NIL(val)); return; } case G_TYPE_OBJECT: case G_TYPE_INTERFACE: g_value_set_object(result, NIL_P(val) ? NULL : RVAL2GOBJ(val)); return; case G_TYPE_PARAM: g_value_set_param(result, NIL_P(val) ? NULL : RVAL2GOBJ(val)); return; case G_TYPE_POINTER: g_value_set_pointer(result, NIL_P(val) ? NULL : rbgobj_ptr2cptr(val)); return; case G_TYPE_BOXED: { GType gtype; for (gtype = type; gtype != G_TYPE_INVALID; gtype = g_type_parent(gtype)) { RValueToGValueFunc func = g_type_get_qdata(gtype, qRValueToGValueFunc); if (!func) continue; func(val, result); return; } } default: if (!rbgobj_convert_rvalue2gvalue(fundamental_type, val, result)) { RValueToGValueFunc func = g_type_get_qdata(type, qRValueToGValueFunc); if (!func){ g_warning("rbgobj_rvalue_to_gvalue: unsupported type: %s\n", g_type_name(type)); } else { func(val, result); } } } } /**********************************************************************/ void rbgobj_gc_mark_gvalue(GValue* value) { GType gtype = G_VALUE_TYPE(value); /* FIXME */ if (G_TYPE_FUNDAMENTAL(gtype) == G_TYPE_OBJECT) rbgobj_gc_mark_instance(g_value_get_object(value)); } /**********************************************************************/ static VALUE rg_initialize(VALUE self, VALUE rb_gtype, VALUE rb_value) { GValue value = G_VALUE_INIT; g_value_init(&value, NUM2INT(rb_to_int(rb_gtype))); rbgobj_rvalue_to_gvalue(rb_value, &value); G_INITIALIZE(self, g_boxed_copy(G_TYPE_VALUE, &value)); g_value_unset(&value); return Qnil; } static VALUE rg_type(VALUE self) { GValue *value; value = _SELF(self); return rbgobj_gtype_new(value->g_type); } static VALUE rg_value(VALUE self) { GValue *value; value = _SELF(self); return GVAL2RVAL(value); } static VALUE rg_to_s(VALUE self) { GValue *value; gchar *string_value; value = _SELF(self); string_value = g_strdup_value_contents(value); return CSTR2RVAL_FREE(string_value); } void Init_gobject_gvalue(void) { VALUE RG_TARGET_NAMESPACE; id_to_s = rb_intern("to_s"); qRValueToGValueFunc = g_quark_from_static_string("__ruby_r2g_func__"); qGValueToRValueFunc = g_quark_from_static_string("__ruby_g2r_func__"); RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_VALUE, "Value", mGLib); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(type, 0); RG_DEF_METHOD(value, 0); RG_DEF_METHOD(to_s, 0); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_fileutils.c0000664000175000017500000001105011740310343021062 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #define RG_TARGET_NAMESPACE cFileError /* Use Ruby standard libraries. enum GFileTest; GFileError g_file_error_from_errno (gint err_no); gboolean g_file_get_contents (const gchar *filename, gchar **contents, gsize *length, GError **error); gboolean g_file_test (const gchar *filename, GFileTest test); gint g_mkstemp (gchar *tmpl); gint g_file_open_tmp (const gchar *tmpl, gchar **name_used, GError **error); gchar* g_file_read_link (const gchar *filename, GError **error); struct GDir; GDir* g_dir_open (const gchar *path, guint flags, GError **error); G_CONST_RETURN gchar* g_dir_read_name (GDir *dir); void g_dir_rewind (GDir *dir); void g_dir_close (GDir *dir); */ #if GLIB_CHECK_VERSION(2, 16, 0) static VALUE rbglib_m_format_size_for_display(G_GNUC_UNUSED VALUE self, VALUE size) { return CSTR2RVAL_FREE(g_format_size_for_display(NUM2INT(size))); } #endif void Init_glib_fileutils(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_ERROR2(G_FILE_ERROR, "FileError", mGLib, rb_eIOError); rb_define_const(RG_TARGET_NAMESPACE, "EXIST", INT2NUM(G_FILE_ERROR_EXIST)); rb_define_const(RG_TARGET_NAMESPACE, "ISDIR", INT2NUM(G_FILE_ERROR_ISDIR)); rb_define_const(RG_TARGET_NAMESPACE, "ACCES", INT2NUM(G_FILE_ERROR_ACCES)); rb_define_const(RG_TARGET_NAMESPACE, "NAMETOOLONG", INT2NUM(G_FILE_ERROR_NAMETOOLONG)); rb_define_const(RG_TARGET_NAMESPACE, "NOENT", INT2NUM(G_FILE_ERROR_NOENT)); rb_define_const(RG_TARGET_NAMESPACE, "NOTDIR", INT2NUM(G_FILE_ERROR_NOTDIR)); rb_define_const(RG_TARGET_NAMESPACE, "NXIO", INT2NUM(G_FILE_ERROR_NXIO)); rb_define_const(RG_TARGET_NAMESPACE, "NODEV", INT2NUM(G_FILE_ERROR_NODEV)); rb_define_const(RG_TARGET_NAMESPACE, "ROFS", INT2NUM(G_FILE_ERROR_ROFS)); rb_define_const(RG_TARGET_NAMESPACE, "TXTBSY", INT2NUM(G_FILE_ERROR_TXTBSY)); rb_define_const(RG_TARGET_NAMESPACE, "FAULT", INT2NUM(G_FILE_ERROR_FAULT)); rb_define_const(RG_TARGET_NAMESPACE, "LOOP", INT2NUM(G_FILE_ERROR_LOOP)); rb_define_const(RG_TARGET_NAMESPACE, "NOSPC", INT2NUM(G_FILE_ERROR_NOSPC)); rb_define_const(RG_TARGET_NAMESPACE, "NOMEM", INT2NUM(G_FILE_ERROR_NOMEM)); rb_define_const(RG_TARGET_NAMESPACE, "MFILE", INT2NUM(G_FILE_ERROR_MFILE)); rb_define_const(RG_TARGET_NAMESPACE, "NFILE", INT2NUM(G_FILE_ERROR_NFILE)); rb_define_const(RG_TARGET_NAMESPACE, "BADF", INT2NUM(G_FILE_ERROR_BADF)); rb_define_const(RG_TARGET_NAMESPACE, "INVAL", INT2NUM(G_FILE_ERROR_INVAL)); rb_define_const(RG_TARGET_NAMESPACE, "PIPE", INT2NUM(G_FILE_ERROR_PIPE)); rb_define_const(RG_TARGET_NAMESPACE, "AGAIN", INT2NUM(G_FILE_ERROR_AGAIN)); rb_define_const(RG_TARGET_NAMESPACE, "INTR", INT2NUM(G_FILE_ERROR_INTR)); rb_define_const(RG_TARGET_NAMESPACE, "IO", INT2NUM(G_FILE_ERROR_IO)); rb_define_const(RG_TARGET_NAMESPACE, "PERM", INT2NUM(G_FILE_ERROR_PERM)); rb_define_const(RG_TARGET_NAMESPACE, "FAILED", INT2NUM(G_FILE_ERROR_FAILED)); #if GLIB_CHECK_VERSION(2, 16, 0) rbg_define_singleton_method(mGLib, "format_size_for_display", rbglib_m_format_size_for_display, 1); #endif } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib.c0000644000175000017500000006730512257552167017036 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #include "rbgprivate.h" #include "rbglib.h" #define RG_TARGET_NAMESPACE mGLib static ID id_inspect; VALUE RG_TARGET_NAMESPACE; const gchar * rbg_rval2cstr(VALUE *str) { StringValue(*str); #ifdef HAVE_RUBY_ENCODING_H if (rb_enc_get(*str) != rb_utf8_encoding()) *str = rb_str_export_to_enc(*str, rb_utf8_encoding()); #endif return RSTRING_PTR(*str); } const gchar * rbg_rval_inspect(VALUE object) { VALUE inspected = rb_funcall(object, id_inspect, 0); return RVAL2CSTR(inspected); } char * rbg_string_value_ptr(volatile VALUE *ptr) { return rb_string_value_ptr(ptr); } const gchar * rbg_rval2cstr_accept_nil(VALUE *str) { return NIL_P(*str) ? NULL : RVAL2CSTR(*str); } /* TODO: How do we deal with encodings? */ const gchar * rbg_rval2cstr_accept_symbol(volatile VALUE *value) { if (!SYMBOL_P(*value)) return rbg_rval2cstr((VALUE *)value); return rb_id2name(SYM2ID(*value)); } const gchar * rbg_rval2cstr_accept_symbol_accept_nil(volatile VALUE *value) { return NIL_P(*value) ? NULL : rbg_rval2cstr_accept_symbol(value); } const gchar * rbg_rval2glibid(volatile VALUE *value, volatile VALUE *buf, gboolean accept_nil) { gchar *id, *p; if (accept_nil && NIL_P(*value)) return NULL; if (SYMBOL_P(*value)) { *buf = rb_String(*value); } else { StringValue(*value); *buf = rb_str_dup(*value); } RB_GC_GUARD(*buf); id = RSTRING_PTR(*buf); for (p = id; *p; p++) if (*p == '_') *p = '-'; return id; } VALUE rbg_cstr2rval(const gchar *str) { return str != NULL ? CSTR2RVAL_LEN(str, strlen(str)) : Qnil; } VALUE rbg_cstr2rval_len(const gchar *str, gsize len) { if (str == NULL) return Qnil; #ifdef HAVE_RUBY_ENCODING_H return rb_external_str_new_with_enc(str, len, rb_utf8_encoding()); #else return rb_str_new(str, len); #endif } struct rbg_cstr2rval_len_free_args { gchar *str; gsize len; }; static VALUE rbg_cstr2rval_len_free_body(VALUE value) { struct rbg_cstr2rval_len_free_args *args = (struct rbg_cstr2rval_len_free_args *)value; return CSTR2RVAL_LEN(args->str, args->len); } static VALUE rbg_cstr2rval_len_free_ensure(VALUE str) { g_free((gchar *)str); return Qnil; } VALUE rbg_cstr2rval_len_free(gchar *str, gsize len) { struct rbg_cstr2rval_len_free_args args = { str, len }; return str != NULL ? rb_ensure(rbg_cstr2rval_len_free_body, (VALUE)&args, rbg_cstr2rval_len_free_ensure, (VALUE)str) : Qnil; } VALUE rbg_cstr2rval_with_encoding(const gchar *str, const gchar *encoding) { return str != NULL ? CSTR2RVAL_LEN_ENC(str, strlen(str), encoding) : Qnil; } #ifdef HAVE_RUBY_ENCODING_H VALUE rbg_cstr2rval_len_with_encoding(const gchar *str, gsize len, const gchar *encoding) { if (str == NULL) return Qnil; return rb_external_str_new_with_enc(str, len, encoding != NULL ? rb_enc_find(encoding) : rb_utf8_encoding()); } #else VALUE rbg_cstr2rval_len_with_encoding(const gchar *str, gsize len, G_GNUC_UNUSED const gchar *encoding) { if (str == NULL) return Qnil; return rb_str_new(str, len); } #endif static VALUE rbg_cstr2rval_free_body(VALUE str) { return CSTR2RVAL((const gchar *)str); } static VALUE rbg_cstr2rval_free_ensure(VALUE str) { g_free((gchar *)str); return Qnil; } VALUE rbg_cstr2rval_free(gchar *str) { return str != NULL? rb_ensure(rbg_cstr2rval_free_body, (VALUE)str, rbg_cstr2rval_free_ensure, (VALUE)str) : Qnil; } /* just for backward compatibility. */ VALUE rbg_cstr2rval_with_free(gchar *str) { return rbg_cstr2rval_free(str); } #ifdef HAVE_RUBY_ENCODING_H static rb_encoding *filename_encoding_if_not_utf8; #endif #ifdef HAVE_RUBY_ENCODING_H static VALUE rbg_filename_to_ruby_body(VALUE filename) { const gchar *filename_utf8 = (const gchar *)filename; VALUE rb_filename; rb_filename = rb_external_str_new_with_enc(filename_utf8, strlen(filename_utf8), rb_utf8_encoding()); /* if needed, change encoding of Ruby String to filename encoding, so that upcoming File operations will work properly */ return filename_encoding_if_not_utf8 != NULL ? rb_str_export_to_enc(rb_filename, filename_encoding_if_not_utf8) : rb_filename; } static VALUE rbg_filename_to_ruby_ensure(VALUE filename) { g_free((gchar *)filename); return Qnil; } #endif VALUE rbg_filename_to_ruby(const gchar *filename) { #ifdef HAVE_RUBY_ENCODING_H gchar *filename_utf8; gsize written; GError *error = NULL; if (filename == NULL) return Qnil; if (filename_encoding_if_not_utf8 == NULL) return CSTR2RVAL(filename); filename_utf8 = g_filename_to_utf8(filename, -1, NULL, &written, &error); if (error != NULL) RAISE_GERROR(error); return rb_ensure(rbg_filename_to_ruby_body, (VALUE)filename_utf8, rbg_filename_to_ruby_ensure, (VALUE)filename_utf8); #else return CSTR2RVAL(filename); #endif } VALUE rbg_filename_to_ruby_free(gchar *filename) { #ifdef HAVE_RUBY_ENCODING_H gchar *filename_utf8; gsize written; if (filename == NULL) return Qnil; /* convert filename to UTF-8 if needed */ if (filename_encoding_if_not_utf8 != NULL) { GError *error = NULL; filename_utf8 = g_filename_to_utf8(filename, -1, NULL, &written, &error); g_free(filename); if (error != NULL) RAISE_GERROR(error); } else { filename_utf8 = filename; } return rb_ensure(rbg_filename_to_ruby_body, (VALUE)filename_utf8, rbg_filename_to_ruby_ensure, (VALUE)filename_utf8); #else return CSTR2RVAL_FREE(filename); #endif } gchar * rbg_filename_from_ruby(VALUE filename) { #ifdef HAVE_RUBY_ENCODING_H gchar *retval; gsize written; GError *error = NULL; /* if needed, change encoding of Ruby String to UTF-8 */ StringValue(filename); if (rb_enc_get(filename) != rb_utf8_encoding()) filename = rb_str_export_to_enc(filename, rb_utf8_encoding()); /* convert it to filename encoding if needed */ if (filename_encoding_if_not_utf8 == NULL) return g_strdup(RSTRING_PTR(filename)); retval = g_filename_from_utf8(RSTRING_PTR(filename), -1, NULL, &written, &error); if (error != NULL) RAISE_GERROR(error); return retval; #else return g_strdup(RVAL2CSTR(filename)); #endif } struct rval2strv_args { VALUE ary; long n; const gchar **result; }; static VALUE rbg_rval2strv_body(VALUE value) { long i; struct rval2strv_args *args = (struct rval2strv_args *)value; for (i = 0; i < args->n; i++) args->result[i] = RVAL2CSTR(RARRAY_PTR(args->ary)[i]); args->result[args->n] = NULL; return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2strv_rescue(VALUE value) { g_free(((struct rval2strv_args *)value)->result); rb_exc_raise(rb_errinfo()); } const gchar ** rbg_rval2strv(volatile VALUE *value, long *n) { struct rval2strv_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new(const gchar *, args.n + 1); rb_rescue(rbg_rval2strv_body, (VALUE)&args, rbg_rval2strv_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } const gchar ** rbg_rval2strv_accept_nil(volatile VALUE *value, long *n) { if (!NIL_P(*value)) return rbg_rval2strv(value, n); if (n != NULL) *n = 0; return NULL; } struct rval2strv_dup_args { VALUE ary; long n; gchar **result; }; static VALUE rbg_rval2strv_dup_body(VALUE value) { long i; struct rval2strv_dup_args *args = (struct rval2strv_dup_args *)value; for (i = 0; i < args->n; i++) args->result[i] = g_strdup(RVAL2CSTR(RARRAY_PTR(args->ary)[i])); args->result[args->n] = NULL; return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2strv_dup_rescue(VALUE value) { g_free(((struct rval2strv_dup_args *)value)->result); rb_exc_raise(rb_errinfo()); } gchar ** rbg_rval2strv_dup(volatile VALUE *value, long *n) { struct rval2strv_dup_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new(gchar *, args.n + 1); rb_rescue(rbg_rval2strv_dup_body, (VALUE)&args, rbg_rval2strv_dup_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } gchar ** rbg_rval2strv_dup_accept_nil(volatile VALUE *value, long *n) { if (!NIL_P(*value)) rbg_rval2strv_dup(value, n); if (n != NULL) *n = 0; return NULL; } VALUE rbg_strv2rval(const gchar **strings) { VALUE ary; const gchar **p; if (strings == NULL) return Qnil; ary = rb_ary_new(); for (p = strings; *p != NULL; p++) rb_ary_push(ary, CSTR2RVAL(*p)); return ary; } static VALUE rbg_strv2rval_free_body(VALUE strings) { return STRV2RVAL((const gchar **)strings); } static VALUE rbg_strv2rval_free_ensure(VALUE strings) { g_strfreev((gchar **)strings); return Qnil; } VALUE rbg_strv2rval_free(gchar **strings) { return rb_ensure(rbg_strv2rval_free_body, (VALUE)strings, rbg_strv2rval_free_ensure, (VALUE)strings); } struct rbg_rval2gbooleans_args { VALUE ary; long n; gboolean *result; }; static VALUE rbg_rval2gbooleans_body(VALUE value) { long i; struct rbg_rval2gbooleans_args *args = (struct rbg_rval2gbooleans_args *)value; for (i = 0; i < args->n; i++) args->result[i] = RVAL2CBOOL(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gbooleans_rescue(VALUE value) { g_free(((struct rbg_rval2gbooleans_args *)value)->result); rb_exc_raise(rb_errinfo()); } gboolean * rbg_rval2gbooleans(volatile VALUE *value, long *n) { struct rbg_rval2gbooleans_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new(gboolean, args.n + 1); rb_rescue(rbg_rval2gbooleans_body, (VALUE)&args, rbg_rval2gbooleans_rescue, (VALUE)&args); *n = args.n; return args.result; } struct rbg_rval2gints_args { VALUE ary; long n; gint *result; }; static VALUE rbg_rval2gints_body(VALUE value) { long i; struct rbg_rval2gints_args *args = (struct rbg_rval2gints_args *)value; for (i = 0; i < args->n; i++) args->result[i] = NUM2INT(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gints_rescue(VALUE value) { g_free(((struct rbg_rval2gints_args *)value)->result); rb_exc_raise(rb_errinfo()); } gint * rbg_rval2gints(volatile VALUE *value, long *n) { struct rbg_rval2gints_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new(gint, args.n + 1); rb_rescue(rbg_rval2gints_body, (VALUE)&args, rbg_rval2gints_rescue, (VALUE)&args); *n = args.n; return args.result; } struct rbg_rval2gint8s_args { VALUE ary; long n; gint8 *result; }; static VALUE rbg_rval2gint8s_body(VALUE value) { long i; struct rbg_rval2gint8s_args *args = (struct rbg_rval2gint8s_args *)value; for (i = 0; i < args->n; i++) args->result[i] = NUM2CHR(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gint8s_rescue(VALUE value) { g_free(((struct rbg_rval2gint8s_args *)value)->result); rb_exc_raise(rb_errinfo()); } gint8 * rbg_rval2gint8s(volatile VALUE *value, long *n) { struct rbg_rval2gint8s_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new(gint8, args.n + 1); rb_rescue(rbg_rval2gint8s_body, (VALUE)&args, rbg_rval2gint8s_rescue, (VALUE)&args); *n = args.n; return args.result; } struct rbg_rval2guint8s_args { VALUE ary; long n; guint8 *result; }; static VALUE rbg_rval2guint8s_body(VALUE value) { long i; struct rbg_rval2guint8s_args *args = (struct rbg_rval2guint8s_args *)value; for (i = 0; i < args->n; i++) args->result[i] = NUM2UINT(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2guint8s_rescue(VALUE value) { g_free(((struct rbg_rval2guint8s_args *)value)->result); rb_exc_raise(rb_errinfo()); } guint8 * rbg_rval2guint8s(volatile VALUE *value, long *n) { struct rbg_rval2guint8s_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new(guint8, args.n + 1); rb_rescue(rbg_rval2guint8s_body, (VALUE)&args, rbg_rval2guint8s_rescue, (VALUE)&args); *n = args.n; return args.result; } struct rbg_rval2guint16s_args { VALUE ary; long n; guint16 *result; }; static VALUE rbg_rval2guint16s_body(VALUE value) { long i; struct rbg_rval2guint16s_args *args = (struct rbg_rval2guint16s_args *)value; for (i = 0; i < args->n; i++) args->result[i] = NUM2UINT(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2guint16s_rescue(VALUE value) { g_free(((struct rbg_rval2guint16s_args *)value)->result); rb_exc_raise(rb_errinfo()); } guint16 * rbg_rval2guint16s(volatile VALUE *value, long *n) { struct rbg_rval2guint16s_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new(guint16, args.n + 1); rb_rescue(rbg_rval2guint16s_body, (VALUE)&args, rbg_rval2guint16s_rescue, (VALUE)&args); *n = args.n; return args.result; } struct rbg_rval2guint32s_args { VALUE ary; long n; guint32 *result; }; static VALUE rbg_rval2guint32s_body(VALUE value) { long i; struct rbg_rval2guint32s_args *args = (struct rbg_rval2guint32s_args *)value; for (i = 0; i < args->n; i++) args->result[i] = NUM2UINT(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2guint32s_rescue(VALUE value) { g_free(((struct rbg_rval2guint32s_args *)value)->result); rb_exc_raise(rb_errinfo()); } guint32 * rbg_rval2guint32s(volatile VALUE *value, long *n) { struct rbg_rval2guint32s_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new(guint32, args.n + 1); rb_rescue(rbg_rval2guint32s_body, (VALUE)&args, rbg_rval2guint32s_rescue, (VALUE)&args); *n = args.n; return args.result; } struct rbg_rval2gdoubles_args { VALUE ary; long n; gdouble *result; }; static VALUE rbg_rval2gdoubles_body(VALUE value) { long i; struct rbg_rval2gdoubles_args *args = (struct rbg_rval2gdoubles_args *)value; for (i = 0; i < args->n; i++) args->result[i] = NUM2DBL(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gdoubles_rescue(VALUE value) { g_free(((struct rbg_rval2gdoubles_args *)value)->result); rb_exc_raise(rb_errinfo()); } gdouble * rbg_rval2gdoubles(volatile VALUE *value, long *n) { struct rbg_rval2gdoubles_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new(gdouble, args.n + 1); rb_rescue(rbg_rval2gdoubles_body, (VALUE)&args, rbg_rval2gdoubles_rescue, (VALUE)&args); *n = args.n; return args.result; } VALUE rbg_gints2rval(const gint *gints, long n) { long i; VALUE ary = rb_ary_new(); for (i = 0; i < n; i++) rb_ary_push(ary, INT2NUM(gints[i])); return ary; } struct rbg_gints2rval_free_args { gint *gints; long n; }; static VALUE rbg_gints2rval_free_body(VALUE value) { struct rbg_gints2rval_free_args *args = (struct rbg_gints2rval_free_args *)value; return rbg_gints2rval(args->gints, args->n); } static VALUE rbg_gints2rval_free_ensure(VALUE value) { g_free(((struct rbg_gints2rval_free_args *)value)->gints); return Qnil; } VALUE rbg_gints2rval_free(gint *gints, long n) { struct rbg_gints2rval_free_args args = { gints, n }; return rb_ensure(rbg_gints2rval_free_body, (VALUE)&args, rbg_gints2rval_free_ensure, (VALUE)&args); } static const char * rbg_inspect (VALUE object) { VALUE inspected; inspected = rb_funcall(object, rb_intern("inspect"), 0); return StringValueCStr(inspected); } VALUE rbg_to_array (VALUE object) { return rb_convert_type(object, RUBY_T_ARRAY, "Array", "to_ary"); } VALUE rbg_to_hash (VALUE object) { return rb_convert_type(object, RUBY_T_HASH, "Hash", "to_hash"); } VALUE rbg_check_array_type (VALUE object) { #ifdef HAVE_RB_CHECK_ARRAY_TYPE return rb_check_array_type(object); #else return rb_check_convert_type(object, RUBY_T_ARRAY, "Array", "to_ary"); #endif } VALUE rbg_check_hash_type (VALUE object) { #ifdef HAVE_RB_CHECK_HASH_TYPE return rb_check_hash_type(object); #else return rb_check_convert_type(object, RUBY_T_HASH, "Hash", "to_hash"); #endif } void rbg_scan_options (VALUE options, ...) { VALUE original_options = options; VALUE available_keys; const char *key; VALUE *value; va_list args; options = rbg_check_hash_type(options); if (NIL_P(options)) { options = rb_hash_new(); } else if (options == original_options) { options = rb_funcall(options, rb_intern("dup"), 0); } available_keys = rb_ary_new(); va_start(args, options); key = va_arg(args, const char *); while (key) { VALUE rb_key; value = va_arg(args, VALUE *); rb_key = ID2SYM(rb_intern(key)); rb_ary_push(available_keys, rb_key); *value = rb_funcall(options, rb_intern("delete"), 1, rb_key); key = va_arg(args, const char *); } va_end(args); if (RVAL2CBOOL(rb_funcall(options, rb_intern("empty?"), 0))) return; rb_raise(rb_eArgError, "unexpected key(s) exist: %s: available keys: %s", rbg_inspect(rb_funcall(options, rb_intern("keys"), 0)), rbg_inspect(available_keys)); } #if 0 /* 2004-04-15 Commented out by Masao. These functions replace g_malloc/g_realloc/g_free of GLib. When g_malloc is called and the memory area can not reserved, rb_gc() will be called. It makes Ruby-GNOME2 uses memory efficiently. But rb_gc() does not work under multithread. So they occur "cross-thread violation". */ static gpointer my_malloc(gsize n_bytes) { /* Should we rescue NoMemoryError? */ return ruby_xmalloc(n_bytes); } static gpointer my_realloc(gpointer mem, gsize n_bytes) { /* Should we rescue NoMemoryError? */ return ruby_xrealloc(mem, n_bytes); } static void my_free(gpointer mem) { return ruby_xfree(mem); } static void Init_mem() { GMemVTable mem_table = { my_malloc, my_realloc, my_free, NULL, NULL, NULL, }; g_mem_set_vtable(&mem_table); } #endif static VALUE rg_s_os_win32_p(G_GNUC_UNUSED VALUE self) { #ifdef G_OS_WIN32 return Qtrue; #else return Qfalse; #endif } static VALUE rg_s_os_beos_p(G_GNUC_UNUSED VALUE self) { #ifdef G_OS_BEOS return Qtrue; #else return Qfalse; #endif } static VALUE rg_s_os_unix_p(G_GNUC_UNUSED VALUE self) { #ifdef G_OS_UNIX return Qtrue; #else return Qfalse; #endif } extern void Init_glib2(void); void Init_glib2(void) { #ifdef HAVE_RUBY_ENCODING_H const gchar **filename_charsets; #endif id_inspect = rb_intern("inspect"); RG_TARGET_NAMESPACE = rb_define_module("GLib"); setlocale (LC_CTYPE, ""); #ifdef LC_MESSAGES setlocale (LC_MESSAGES, ""); #endif /* Version Information */ rb_define_const(RG_TARGET_NAMESPACE, "VERSION", rb_ary_new3(3, INT2FIX(glib_major_version), INT2FIX(glib_minor_version), INT2FIX(glib_micro_version))); rb_define_const(RG_TARGET_NAMESPACE, "MAJOR_VERSION", INT2FIX(glib_major_version)); rb_define_const(RG_TARGET_NAMESPACE, "MINOR_VERSION", INT2FIX(glib_minor_version)); rb_define_const(RG_TARGET_NAMESPACE, "MICRO_VERSION", INT2FIX(glib_micro_version)); rb_define_const(RG_TARGET_NAMESPACE, "INTERFACE_AGE", INT2FIX(glib_interface_age)); rb_define_const(RG_TARGET_NAMESPACE, "BINARY_AGE", INT2FIX(glib_binary_age)); rb_define_const(RG_TARGET_NAMESPACE, "BINDING_VERSION", rb_ary_new3(3, INT2FIX(RBGLIB_MAJOR_VERSION), INT2FIX(RBGLIB_MINOR_VERSION), INT2FIX(RBGLIB_MICRO_VERSION))); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(GLIB_MAJOR_VERSION), INT2FIX(GLIB_MINOR_VERSION), INT2FIX(GLIB_MICRO_VERSION))); /* Limits of Basic Types */ rb_define_const(RG_TARGET_NAMESPACE, "MININT", INT2FIX(G_MININT)); rb_define_const(RG_TARGET_NAMESPACE, "MAXINT", INT2NUM(G_MAXINT)); rb_define_const(RG_TARGET_NAMESPACE, "MAXUINT", UINT2NUM(G_MAXUINT)); rb_define_const(RG_TARGET_NAMESPACE, "MINSHORT", INT2FIX(G_MINSHORT)); rb_define_const(RG_TARGET_NAMESPACE, "MAXSHORT", INT2FIX(G_MAXSHORT)); rb_define_const(RG_TARGET_NAMESPACE, "MAXUSHORT", UINT2NUM(G_MAXUSHORT)); rb_define_const(RG_TARGET_NAMESPACE, "MINLONG", INT2FIX(G_MINLONG)); rb_define_const(RG_TARGET_NAMESPACE, "MAXLONG", INT2NUM(G_MAXLONG)); rb_define_const(RG_TARGET_NAMESPACE, "MAXULONG", UINT2NUM(G_MAXULONG)); rb_define_const(RG_TARGET_NAMESPACE, "MININT8", INT2FIX(G_MININT8)); rb_define_const(RG_TARGET_NAMESPACE, "MAXINT8", INT2FIX(G_MAXINT8)); rb_define_const(RG_TARGET_NAMESPACE, "MAXUINT8", UINT2NUM(G_MAXUINT8)); rb_define_const(RG_TARGET_NAMESPACE, "MININT16", INT2FIX(G_MININT16)); rb_define_const(RG_TARGET_NAMESPACE, "MAXINT16", INT2FIX(G_MAXINT16)); rb_define_const(RG_TARGET_NAMESPACE, "MAXUINT16", UINT2NUM(G_MAXUINT16)); rb_define_const(RG_TARGET_NAMESPACE, "MININT32", INT2FIX(G_MININT32)); rb_define_const(RG_TARGET_NAMESPACE, "MAXINT32", INT2NUM(G_MAXINT32)); rb_define_const(RG_TARGET_NAMESPACE, "MAXUINT32", UINT2NUM(G_MAXUINT32)); rb_define_const(RG_TARGET_NAMESPACE, "MININT64", INT2FIX(G_MININT64)); rb_define_const(RG_TARGET_NAMESPACE, "MAXINT64", LL2NUM(G_MAXINT64)); rb_define_const(RG_TARGET_NAMESPACE, "MAXUINT64", ULL2NUM(G_MAXUINT64)); rb_define_const(RG_TARGET_NAMESPACE, "MAXSIZE", UINT2NUM(G_MAXSIZE)); rb_define_const(RG_TARGET_NAMESPACE, "MINFLOAT", INT2FIX(G_MINFLOAT)); rb_define_const(RG_TARGET_NAMESPACE, "MAXFLOAT", DBL2NUM(G_MAXFLOAT)); rb_define_const(RG_TARGET_NAMESPACE, "MINDOUBLE", INT2FIX(G_MINDOUBLE)); rb_define_const(RG_TARGET_NAMESPACE, "MAXDOUBLE", DBL2NUM(G_MAXDOUBLE)); /* Standard Macros */ RG_DEF_SMETHOD_P(os_win32, 0); RG_DEF_SMETHOD_P(os_beos, 0); RG_DEF_SMETHOD_P(os_unix, 0); rb_define_const(RG_TARGET_NAMESPACE, "DIR_SEPARATOR", CSTR2RVAL(G_DIR_SEPARATOR_S)); rb_define_const(RG_TARGET_NAMESPACE, "SEARCHPATH_SEPARATOR", CSTR2RVAL(G_SEARCHPATH_SEPARATOR_S)); /* discover and store glib filename encoding */ #ifdef HAVE_RUBY_ENCODING_H if (g_get_filename_charsets(&filename_charsets) || filename_charsets == NULL || filename_charsets[0] == NULL || !strcmp(filename_charsets[0], "UTF-8") || rb_enc_find(filename_charsets[0]) == rb_enc_find("ASCII-8BIT")) { /* set to NULL, mean do not perform transcoding, either filename encoding is unknown, UTF-8, or unsupported */ filename_encoding_if_not_utf8 = NULL; } else { filename_encoding_if_not_utf8 = rb_enc_find(filename_charsets[0]); } #endif /* Don't implement them. #define G_DIR_SEPARATOR_S #define G_IS_DIR_SEPARATOR (c) #define G_SEARCHPATH_SEPARATOR #define TRUE #define FALSE #define NULL #define MIN (a, b) #define MAX (a, b) #define ABS (a) #define CLAMP (x, low, high) #define G_STRUCT_MEMBER (member_type, struct_p, struct_offset) #define G_STRUCT_MEMBER_P (struct_p, struct_offset) #define G_STRUCT_OFFSET (struct_type, member) #define G_MEM_ALIGN #define G_CONST_RETURN */ /* Numerical Definitions */ /* Don't implement them. #define G_IEEE754_FLOAT_BIAS #define G_IEEE754_DOUBLE_BIAS union GFloatIEEE754; union GDoubleIEEE754; */ rb_define_const(RG_TARGET_NAMESPACE, "E", CSTR2RVAL(G_STRINGIFY(G_E))); rb_define_const(RG_TARGET_NAMESPACE, "LN2", CSTR2RVAL(G_STRINGIFY(G_LN2))); rb_define_const(RG_TARGET_NAMESPACE, "LN10", CSTR2RVAL(G_STRINGIFY(G_LN10))); rb_define_const(RG_TARGET_NAMESPACE, "PI", CSTR2RVAL(G_STRINGIFY(G_PI))); rb_define_const(RG_TARGET_NAMESPACE, "PI_2", CSTR2RVAL(G_STRINGIFY(G_PI_2))); rb_define_const(RG_TARGET_NAMESPACE, "PI_4", CSTR2RVAL(G_STRINGIFY(G_PI_4))); rb_define_const(RG_TARGET_NAMESPACE, "SQRT2", CSTR2RVAL(G_STRINGIFY(G_SQRT2))); rb_define_const(RG_TARGET_NAMESPACE, "LOG_2_BASE_10", CSTR2RVAL(G_STRINGIFY(G_LOG_2_BASE_10))); /* From "The Main Event Loop" */ rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_HIGH", INT2FIX(G_PRIORITY_HIGH)); rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_DEFAULT", INT2FIX(G_PRIORITY_DEFAULT)); rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_HIGH_IDLE", INT2FIX(G_PRIORITY_HIGH_IDLE)); rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_DEFAULT_IDLE", INT2FIX(G_PRIORITY_DEFAULT_IDLE)); rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_LOW", INT2FIX(G_PRIORITY_LOW)); /* Init_mem(); */ Init_gutil(); Init_gutil_callback(); Init_glib_gettext(); Init_glib_int64(); Init_glib_error(); Init_glib_threads(); Init_glib_convert(); Init_glib_messages(); Init_glib_fileutils(); Init_glib_i18n(); Init_glib_win32(); Init_gobject(); /* Require GBoxed/GObject */ Init_glib_utils(); Init_glib_spawn(); Init_glib_spawnerror(); Init_glib_main_loop(); Init_glib_source(); Init_glib_main_context(); Init_glib_poll_fd(); Init_glib_io_constants(); Init_glib_io_channel(); Init_glib_io_channelerror(); Init_glib_io_channel_win32_socket(); Init_glib_shell(); Init_glib_shellerror(); Init_glib_timer(); Init_glib_unicode(); Init_glib_utf8(); Init_glib_utf16(); Init_glib_ucs4(); Init_glib_unichar(); Init_glib_keyfile(); Init_glib_bookmark_file(); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_iochannel.c0000644000175000017500000005225212142464343021040 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" static ID id_call; static ID id_puts; static ID id_unpack; static VALUE default_rs; #define RG_TARGET_NAMESPACE cIOChannel #define _SELF(s) ((GIOChannel*)RVAL2BOXED(s, G_TYPE_IO_CHANNEL)) static void ioc_error(GIOStatus status, GError *err) { if (err != NULL) RAISE_GERROR(err); if (status == G_IO_STATUS_EOF){ rb_raise(rb_eEOFError, "End of file reached"); } else if (status == G_IO_STATUS_AGAIN){ rb_raise(rb_eRuntimeError, "G_IO_STATUS_AGAIN"); } else if (status == G_IO_STATUS_NORMAL){ /* Do nothing */ } else { rb_raise(rb_eRuntimeError, "An error occured. status = %d\n", status); } } static VALUE rg_initialize(gint argc, VALUE *argv, VALUE self) { VALUE arg1, arg2; GIOChannel* io = NULL; rb_secure(4); rb_scan_args(argc, argv, "11", &arg1, &arg2); if (TYPE(arg1) != T_STRING){ gint fd; if (TYPE(arg1) == T_FIXNUM){ fd = NUM2INT(arg1); } else { fd = NUM2INT(rb_funcall(arg1, rb_intern("to_i"), 0)); } #ifdef G_OS_UNIX io = g_io_channel_unix_new(fd); #elif defined(G_OS_WIN32) io = g_io_channel_win32_new_fd(fd); #else rb_raise(rb_eRuntimeError, "GLib::IOChannel.new(fd) is supported on UNIX environment only"); #endif } else { GError* err = NULL; io = g_io_channel_new_file(RVAL2CSTR(arg1), NIL_P(arg2) ? "r" : RVAL2CSTR(arg2), &err); if (err != NULL) RAISE_GERROR(err); } G_INITIALIZE(self, io); return Qnil; } static VALUE ioc_close(VALUE self) { GError* err = NULL; GIOStatus status = g_io_channel_shutdown(_SELF(self), TRUE, &err); ioc_error(status, err); return self; } static VALUE rg_s_open(gint argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE arg1, arg2; VALUE rio; GIOChannel* io = NULL; rb_scan_args(argc, argv, "11", &arg1, &arg2); if (TYPE(arg1) == T_FIXNUM){ #ifdef G_OS_UNIX io = g_io_channel_unix_new(NUM2INT(arg1)); #elif defined(G_OS_WIN32) io = g_io_channel_win32_new_fd(NUM2INT(arg1)); #else rb_raise(rb_eRuntimeError, "GLib::IOChannel.new(fd) is supported on " "UNIX and Windows environment only"); #endif } else { GError* err = NULL; io = g_io_channel_new_file(RVAL2CSTR(arg1), NIL_P(arg2) ? "r" : RVAL2CSTR(arg2), &err); if (err != NULL) RAISE_GERROR(err); } rio = BOXED2RVAL(io, G_TYPE_IO_CHANNEL); if (rb_block_given_p()) { return rb_ensure(rb_yield, rio, ioc_close, rio); } return rio; } static VALUE rg_fileno(VALUE self) { #ifdef G_OS_UNIX return INT2NUM(g_io_channel_unix_get_fd(_SELF(self))); #elif defined(G_OS_WIN32) return INT2NUM(g_io_channel_win32_get_fd(_SELF(self))); #else rb_warn("GLib::IOChannel#fd is supported on " "UNIX and Windows environment only."); return Qnil; #endif } /* Don't need this void g_io_channel_init (GIOChannel *channel); */ static VALUE rg_read(gint argc, VALUE *argv, VALUE self) { VALUE rbcount; gsize count; gchar *buffer; gsize bytes_read; GIOChannel *channel = _SELF(self); GError *error = NULL; GIOStatus status; rb_scan_args(argc, argv, "01", &rbcount); if (NIL_P(rbcount)) { status = g_io_channel_read_to_end(channel, &buffer, &bytes_read, &error); ioc_error(status, error); return buffer != NULL ? CSTR2RVAL_LEN_FREE(buffer, bytes_read) : CSTR2RVAL(""); } count = NUM2UINT(rbcount); buffer = g_new(gchar, count); memset(buffer, '\0', count); status = g_io_channel_read_chars(channel, buffer, count, &bytes_read, &error); if (status == G_IO_STATUS_NORMAL) return CSTR2RVAL_LEN_FREE(buffer, bytes_read); else if (status == G_IO_STATUS_EOF) return CSTR2RVAL(""); ioc_error(status, error); /* Not reached. */ return Qnil; } static VALUE rg_readchar(VALUE self) { gunichar thechar; GError* err = NULL; GIOStatus status = g_io_channel_read_unichar(_SELF(self), &thechar, &err); ioc_error(status, err); return UINT2NUM(thechar); } static VALUE rg_getc(VALUE self) { gunichar thechar; GError* err = NULL; VALUE ret; GIOStatus status = g_io_channel_read_unichar(_SELF(self), &thechar, &err); if (status == G_IO_STATUS_EOF){ ret = Qnil; } else { ioc_error(status, err); ret = UINT2NUM(thechar); } return ret; } static VALUE rg_each_char(VALUE self) { if (!rb_block_given_p()) { rb_raise(rb_eArgError, "called without a block"); } while (TRUE){ gunichar thechar; GError* err = NULL; GIOStatus status = g_io_channel_read_unichar(_SELF(self), &thechar, &err); if (status == G_IO_STATUS_EOF){ break; } else { ioc_error(status, err); rb_yield(UINT2NUM(thechar)); } } return self; } static VALUE rg_readline(gint argc, VALUE *argv, VALUE self) { gchar* str; VALUE line_term, ret; GIOStatus status; GError* err = NULL; const gchar* old_line_term = NULL; gint old_line_term_len; rb_scan_args(argc, argv, "01", &line_term); if (! NIL_P(line_term)){ StringValue(line_term); old_line_term = g_io_channel_get_line_term(_SELF(self), &old_line_term_len); g_io_channel_set_line_term(_SELF(self), RVAL2CSTR(line_term), RSTRING_LEN(line_term)); } status = g_io_channel_read_line(_SELF(self), &str, NULL, NULL, &err); if (! NIL_P(line_term)){ g_io_channel_set_line_term(_SELF(self), old_line_term, old_line_term_len); } ioc_error(status, err); ret = str ? CSTR2RVAL(str) : CSTR2RVAL(""); g_free(str); return ret; } static VALUE rg_gets(gint argc, VALUE *argv, VALUE self) { gchar* str; VALUE line_term, ret; GIOStatus status; GError* err = NULL; const gchar* old_line_term = NULL; gint old_line_term_len; rb_scan_args(argc, argv, "01", &line_term); if (! NIL_P(line_term)){ StringValue(line_term); old_line_term = g_io_channel_get_line_term(_SELF(self), &old_line_term_len); g_io_channel_set_line_term(_SELF(self), RVAL2CSTR(line_term), RSTRING_LEN(line_term)); } status = g_io_channel_read_line(_SELF(self), &str, NULL, NULL, &err); if (! NIL_P(line_term)){ g_io_channel_set_line_term(_SELF(self), old_line_term, old_line_term_len); } if (status == G_IO_STATUS_EOF){ ret = Qnil; } else { ioc_error(status, err); ret = str ? CSTR2RVAL(str) : CSTR2RVAL(""); } g_free(str); return ret; } /* Internal use only */ static VALUE ioc_set_line_term(VALUE args) { VALUE self = RARRAY_PTR(args)[0]; VALUE doit = RARRAY_PTR(args)[1]; VALUE line_term = RARRAY_PTR(args)[2]; if (doit == Qtrue){ StringValue(line_term); g_io_channel_set_line_term(_SELF(self), RVAL2CSTR(line_term), RSTRING_LEN(line_term)); } return self; } static VALUE rg_each(gint argc, VALUE *argv, VALUE self) { gchar* str; VALUE line_term; GIOStatus status; GError* err = NULL; GIOChannel *channel; const gchar* old_line_term = NULL; gint old_line_term_len; if (!rb_block_given_p()) { rb_raise(rb_eArgError, "called without a block"); } rb_scan_args(argc, argv, "01", &line_term); channel = _SELF(self); if (!NIL_P(line_term)) { StringValue(line_term); old_line_term = g_io_channel_get_line_term(channel, &old_line_term_len); g_io_channel_set_line_term(channel, RVAL2CSTR(line_term), RSTRING_LEN(line_term)); } while (TRUE) { status = g_io_channel_read_line(channel, &str, NULL, NULL, &err); if (status == G_IO_STATUS_EOF) { break; } else { VALUE rstr; ioc_error(status, err); if (str) { rstr = CSTR2RVAL(str); } else { rstr = CSTR2RVAL(""); } g_free(str); rb_ensure(rb_yield, rstr, ioc_set_line_term, rb_ary_new3(3, self, NIL_P(line_term) ? Qfalse : Qtrue, CSTR2RVAL(old_line_term))); } } return self; } /* Don't need this. GIOStatus g_io_channel_read_line_string (GIOChannel *channel, GString *buffer, gsize *terminator_pos, GError **error); */ /* Use GLib::IOChannel#read instead. static VALUE ioc_read_to_end(VALUE self) { gchar* str; gsize length; VALUE ret; GError* err = NULL; GIOStatus status = g_io_channel_read_to_end(_SELF(self), &str, &length, &err); ioc_error(status, err); ret = str ? rb_str_new(str, length) : CSTR2RVAL(""); g_free(str); return ret; } */ static VALUE rg_write(VALUE self, VALUE buf) { gssize count; gsize bytes_written; GIOStatus status; GError* err = NULL; rb_secure(4); buf = rb_obj_as_string(buf); StringValue(buf); count = RSTRING_LEN(buf); status = g_io_channel_write_chars(_SELF(self), RVAL2CSTR(buf), count, &bytes_written, &err); ioc_error(status, err); return UINT2NUM(bytes_written); } static VALUE rg_putc(VALUE self, VALUE thechar) { GError* err = NULL; GIOStatus status; gunichar unichar; rb_secure(4); if (TYPE(thechar) == T_FIXNUM) { unichar = NUM2UINT(thechar); } else { VALUE ary = rb_funcall(thechar, id_unpack, 1, CSTR2RVAL("U")); unichar = NUM2UINT(RARRAY_PTR(ary)[0]); } status = g_io_channel_write_unichar(_SELF(self), unichar, &err); ioc_error(status, err); return self; } static VALUE rg_flush(VALUE self) { GError* err = NULL; GIOStatus status = g_io_channel_flush(_SELF(self), &err); ioc_error(status, err); return self; } static VALUE rg_seek(gint argc, VALUE *argv, VALUE self) { VALUE ofs, type; GIOStatus status; GError* err = NULL; GSeekType gtype = G_SEEK_SET; rb_scan_args(argc, argv, "11", &ofs, &type); if (!NIL_P(type)) gtype = NUM2INT(type); status = g_io_channel_seek_position(_SELF(self), NUM2INT(ofs), gtype, &err); ioc_error(status, err); return self; } static VALUE rg_set_pos(VALUE self, VALUE pos) { GError* err = NULL; GIOStatus status = g_io_channel_seek_position(_SELF(self), NUM2INT(pos), G_SEEK_SET, &err); ioc_error(status, err); return self; } static VALUE rg_close(gint argc, VALUE *argv, VALUE self) { VALUE flush; GError* err = NULL; gboolean gflush = TRUE; GIOStatus status; rb_scan_args(argc, argv, "01", &flush); if (!NIL_P(flush)){ gflush = RVAL2CBOOL(flush); } status = g_io_channel_shutdown(_SELF(self), gflush, &err); ioc_error(status, err); return self; } static VALUE rg_create_watch(VALUE self, VALUE condition) { return BOXED2RVAL(g_io_create_watch(_SELF(self), NUM2INT(condition)), G_TYPE_SOURCE); } static gboolean io_func(GIOChannel *source, GIOCondition condition, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 2, BOXED2RVAL(source, G_TYPE_IO_CHANNEL), INT2NUM(condition))); } static VALUE rg_add_watch(VALUE self, VALUE condition) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); return UINT2NUM(g_io_add_watch(_SELF(self), NUM2INT(condition), (GIOFunc)io_func, (gpointer)func)); } /* Don't need this guint g_io_add_watch_full (GIOChannel *channel, gint priority, GIOCondition condition, GIOFunc func, gpointer user_data, GDestroyNotify notify); */ static VALUE rg_buffer_size(VALUE self) { return UINT2NUM(g_io_channel_get_buffer_size(_SELF(self))); } static VALUE rg_set_buffer_size(VALUE self, VALUE buffer_size) { g_io_channel_set_buffer_size(_SELF(self), NUM2UINT(buffer_size)); return self; } static VALUE rg_buffer_condition(VALUE self) { return INT2NUM(g_io_channel_get_buffer_condition(_SELF(self))); } static VALUE rg_flags(VALUE self) { return INT2NUM(g_io_channel_get_flags(_SELF(self))); } static VALUE rg_set_flags(VALUE self, VALUE flags) { GError* err = NULL; GIOStatus status = g_io_channel_set_flags(_SELF(self), NUM2INT(flags), &err); ioc_error(status, err); return self; } /* Use them with GLib::IOChannel#gets, #readline, #readlines static VALUE ioc_get_line_term(VALUE self) { gint length; const gchar* ret = g_io_channel_get_line_term(_SELF(self), &length); if (ret) { if (length < 0) { return CSTR2RVAL(ret); } else { return rb_str_new(ret, length); } } return Qnil; } static VALUE ioc_set_line_term(VALUE self, VALUE line_term) { StringValue(line_term); g_io_channel_set_line_term(_SELF(self), RVAL2CSTR(line_term), RSTRING_LEN(line_term)); return self; } */ static VALUE rg_buffered(VALUE self) { return CBOOL2RVAL(g_io_channel_get_buffered(_SELF(self))); } static VALUE rg_set_buffered(VALUE self, VALUE buffered) { g_io_channel_set_buffered(_SELF(self), RVAL2CBOOL(buffered)); return self; } static VALUE rg_encoding(VALUE self) { return CSTR2RVAL(g_io_channel_get_encoding(_SELF(self))); } static VALUE rg_set_encoding(VALUE self, VALUE encoding) { GError* err = NULL; GIOStatus status; status = g_io_channel_set_encoding(_SELF(self), RVAL2CSTR_ACCEPT_NIL(encoding), &err); ioc_error(status, err); return self; } /* Don't we need them ? gboolean g_io_channel_get_close_on_unref (GIOChannel *channel); void g_io_channel_set_close_on_unref (GIOChannel *channel, gboolean do_close); */ /* Deprecated GIOError g_io_channel_read (GIOChannel *channel, gchar *buf, gsize count, gsize *bytes_read); enum GIOError; GIOError g_io_channel_write (GIOChannel *channel, const gchar *buf, gsize count, gsize *bytes_written); GIOError g_io_channel_seek (GIOChannel *channel, gint64 offset, GSeekType type); void g_io_channel_close (GIOChannel *channel); */ /* * Stolen some convenient methods from io.c */ static VALUE rg_printf(int argc, VALUE *argv, VALUE self) { rg_write(self, rb_f_sprintf(argc, argv)); return Qnil; } static VALUE ioc_puts_ary(VALUE ary, VALUE out, int recur) { VALUE tmp; long i; for (i=0; i0) { rg_write(out, output_field_separator); } switch (TYPE(argv[i])) { case T_NIL: rg_write(out, rb_str_new2("nil")); break; default: rg_write(out, argv[i]); break; } } if (!NIL_P(output_field_separator)) { rg_write(out, output_field_separator); } return Qnil; } void Init_glib_io_channel(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IO_CHANNEL, "IOChannel", mGLib); rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable); id_call = rb_intern("call"); id_puts = rb_intern("puts"); id_unpack = rb_intern("unpack"); default_rs = rb_str_new_cstr("\n"); #ifdef HAVE_RB_GC_REGISTER_MARK_OBJECT rb_gc_register_mark_object(default_rs); #else rb_global_variable(&default_rs); #endif RG_DEF_METHOD(initialize, -1); RG_DEF_SMETHOD(open, -1); RG_DEF_METHOD(fileno, 0); RG_DEF_ALIAS("to_i", "fileno"); RG_DEF_METHOD(read, -1); RG_DEF_METHOD(readchar, 0); RG_DEF_METHOD(getc, 0); RG_DEF_METHOD(readline, -1); RG_DEF_METHOD(gets, -1); RG_DEF_METHOD(each, -1); RG_DEF_ALIAS("each_line", "each"); RG_DEF_METHOD(each_char, 0); RG_DEF_METHOD(write, 1); RG_DEF_METHOD(printf, -1); RG_DEF_METHOD(print, -1); RG_DEF_METHOD(puts, -1); RG_DEF_METHOD(putc, 1); RG_DEF_METHOD(flush, 0); RG_DEF_METHOD(seek, -1); RG_DEF_METHOD(set_pos, 1); RG_DEF_METHOD(close, -1); RG_DEF_METHOD(create_watch, 1); RG_DEF_METHOD(add_watch, 1); RG_DEF_METHOD(buffer_size, 0); RG_DEF_METHOD(set_buffer_size, 1); RG_DEF_METHOD(buffer_condition, 0); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(set_flags, 1); RG_DEF_METHOD(buffered, 0); RG_DEF_METHOD(set_buffered, 1); RG_DEF_METHOD(encoding, 0); RG_DEF_METHOD(set_encoding, 1); /* GSeekType */ rb_define_const(RG_TARGET_NAMESPACE, "SEEK_CUR", INT2NUM(G_SEEK_CUR)); rb_define_const(RG_TARGET_NAMESPACE, "SEEK_SET", INT2NUM(G_SEEK_SET)); rb_define_const(RG_TARGET_NAMESPACE, "SEEK_END", INT2NUM(G_SEEK_END)); /* GIOStatus */ rb_define_const(RG_TARGET_NAMESPACE, "STATUS_ERROR", INT2NUM(G_IO_STATUS_ERROR)); rb_define_const(RG_TARGET_NAMESPACE, "STATUS_NORMAL", INT2NUM(G_IO_STATUS_NORMAL)); rb_define_const(RG_TARGET_NAMESPACE, "STATUS_EOF", INT2NUM(G_IO_STATUS_EOF)); rb_define_const(RG_TARGET_NAMESPACE, "STATUS_AGAIN", INT2NUM(G_IO_STATUS_AGAIN)); /* GIOCondition */ /* Deprecated. Just for bacakward compatibility. Use * GLib::IOCondition::* instead. */ G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_IO_CONDITION, "G_IO_"); /* GIOFlags */ rb_define_const(RG_TARGET_NAMESPACE, "FLAG_APPEND", INT2NUM(G_IO_FLAG_APPEND)); rb_define_const(RG_TARGET_NAMESPACE, "FLAG_NONBLOCK", INT2NUM(G_IO_FLAG_NONBLOCK)); rb_define_const(RG_TARGET_NAMESPACE, "FLAG_READABLE", INT2NUM(G_IO_FLAG_IS_READABLE)); rb_define_const(RG_TARGET_NAMESPACE, "FLAG_WRITEABLE", INT2NUM(G_IO_FLAG_IS_WRITEABLE)); rb_define_const(RG_TARGET_NAMESPACE, "FLAG_IS_SEEKABLE", INT2NUM(G_IO_FLAG_IS_SEEKABLE)); rb_define_const(RG_TARGET_NAMESPACE, "FLAG_MASK", INT2NUM(G_IO_FLAG_MASK)); rb_define_const(RG_TARGET_NAMESPACE, "FLAG_GET_MASK", INT2NUM(G_IO_FLAG_GET_MASK)); rb_define_const(RG_TARGET_NAMESPACE, "FLAG_SET_MASK", INT2NUM(G_IO_FLAG_SET_MASK)); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_type.c0000644000175000017500000005707412147676243020105 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2002-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE rbgobj_cType /**********************************************************************/ /* Type Mapping */ static VALUE rb_cMutex; static VALUE lookup_class_mutex; static ID id_new; static ID id_superclass; static ID id_lock; static ID id_unlock; static GHashTable *gtype_to_cinfo; static VALUE klass_to_cinfo; static GHashTable* dynamic_gtype_list; typedef struct { const gchar* name; VALUE module; RGMarkFunc mark; RGFreeFunc free; int flags; /* RGObjClassFlag */ } RGObjClassInfoDynamic; typedef struct { VALUE parent; GType gtype; gboolean create_class; } RGObjClassByGtypeData; static void cinfo_mark(RGObjClassInfo* cinfo) { rb_gc_mark(cinfo->klass); } const RGObjClassInfo * rbgobj_lookup_class(VALUE klass) { VALUE data = rb_hash_aref(klass_to_cinfo, klass); if (!NIL_P(data)){ RGObjClassInfo* cinfo; Data_Get_Struct(data, RGObjClassInfo, cinfo); return cinfo; } if (TYPE(klass) == T_CLASS) { VALUE super; if (FL_TEST(klass, FL_SINGLETON)) { super = rb_class_real(klass); } else { super = rb_funcall(klass, id_superclass, 0); } return rbgobj_lookup_class(super); } rb_raise(rb_eRuntimeError, "can't get gobject class information"); } static const RGObjClassInfo *rbgobj_lookup_class_by_gtype_without_lock(GType gtype, VALUE parent, gboolean create_class); static VALUE get_superclass(GType gtype) { VALUE super_class; if (rbgobj_convert_get_superclass(gtype, &super_class)) return super_class; switch (gtype) { case G_TYPE_PARAM: case G_TYPE_OBJECT: return cInstantiatable; case G_TYPE_BOXED: return rb_cObject; case G_TYPE_POINTER: return rb_cData; case G_TYPE_ENUM: case G_TYPE_FLAGS: return rb_cObject; default: { GType parent_type; parent_type = g_type_parent(gtype); if (parent_type == G_TYPE_INVALID) { return cInstantiatable; } else { const RGObjClassInfo *cinfo_super; cinfo_super = rbgobj_lookup_class_by_gtype_without_lock(parent_type, Qnil, TRUE); return cinfo_super->klass; } } } } static const RGObjClassInfo * rbgobj_lookup_class_by_gtype_without_lock(GType gtype, VALUE parent, gboolean create_class) { GType fundamental_type; RGObjClassInfo* cinfo; RGObjClassInfoDynamic* cinfod; void* gclass = NULL; VALUE c; if (gtype == G_TYPE_INVALID) return NULL; cinfo = g_hash_table_lookup(gtype_to_cinfo, GUINT_TO_POINTER(gtype)); if (cinfo) return cinfo; if (!create_class) return NULL; c = Data_Make_Struct(rb_cData, RGObjClassInfo, cinfo_mark, NULL, cinfo); cinfo->gtype = gtype; cinfo->mark = NULL; cinfo->free = NULL; cinfo->flags = 0; fundamental_type = G_TYPE_FUNDAMENTAL(gtype); switch (fundamental_type){ case G_TYPE_POINTER: case G_TYPE_BOXED: case G_TYPE_PARAM: case G_TYPE_OBJECT: case G_TYPE_ENUM: case G_TYPE_FLAGS: if (NIL_P(parent)) parent = get_superclass(gtype); cinfo->klass = rb_funcall(rb_cClass, id_new, 1, parent); break; case G_TYPE_INTERFACE: cinfo->klass = rb_module_new(); break; default: if (NIL_P(parent)) parent = get_superclass(gtype); if (NIL_P(parent)) { fprintf(stderr, "%s: %s's fundamental type %s isn't supported\n", "rbgobj_lookup_class_by_gtype", g_type_name(gtype), g_type_name(fundamental_type)); return NULL; } cinfo->klass = rb_funcall(rb_cClass, id_new, 1, parent); } cinfod = (RGObjClassInfoDynamic *)g_hash_table_lookup(dynamic_gtype_list, g_type_name(gtype)); if (cinfod){ cinfo->mark = cinfod->mark; cinfo->free = cinfod->free; rb_define_const(cinfod->module, cinfod->name, cinfo->klass); } rb_hash_aset(klass_to_cinfo, cinfo->klass, c); g_hash_table_insert(gtype_to_cinfo, GUINT_TO_POINTER(gtype), cinfo); if (G_TYPE_IS_CLASSED(gtype)) gclass = g_type_class_ref(gtype); if (G_TYPE_IS_INSTANTIATABLE(gtype) || G_TYPE_IS_INTERFACE(gtype)) rbgobj_define_action_methods(cinfo->klass); if (G_TYPE_IS_INSTANTIATABLE(gtype)){ GType* interfaces = NULL; guint n_interfaces = 0; guint i; interfaces = g_type_interfaces(gtype, &n_interfaces); for (i = 0; i < n_interfaces; i++){ const RGObjClassInfo *iface_cinfo; iface_cinfo = rbgobj_lookup_class_by_gtype_without_lock(interfaces[i], Qnil, TRUE); rb_include_module(cinfo->klass, iface_cinfo->klass); } g_free(interfaces); } if (!rbgobj_convert_type_init_hook(gtype, cinfo->klass)) { switch (fundamental_type) { case G_TYPE_OBJECT: rbgobj_init_object_class(cinfo->klass); break; case G_TYPE_ENUM: rbgobj_init_enum_class(cinfo->klass); break; case G_TYPE_FLAGS: rbgobj_init_flags_class(cinfo->klass); break; case G_TYPE_INTERFACE: rbgobj_init_interface(cinfo->klass); break; default: rbgobj_convert_type_init_hook(fundamental_type, cinfo->klass); break; } } if (gclass) g_type_class_unref(gclass); return cinfo; } static VALUE rbgobj_lookup_class_by_gtype_body(VALUE data) { RGObjClassByGtypeData *cdata = (RGObjClassByGtypeData *)data; const RGObjClassInfo *cinfo; cinfo = rbgobj_lookup_class_by_gtype_without_lock(cdata->gtype, cdata->parent, cdata->create_class); return (VALUE)cinfo; } static VALUE rbgobj_lookup_class_by_gtype_ensure(G_GNUC_UNUSED VALUE data) { rb_funcall(lookup_class_mutex, id_unlock, 0); return Qundef; } const RGObjClassInfo * rbgobj_lookup_class_by_gtype(GType gtype, VALUE parent) { return rbgobj_lookup_class_by_gtype_full(gtype, parent, TRUE); } const RGObjClassInfo * rbgobj_lookup_class_by_gtype_full(GType gtype, VALUE parent, gboolean create_class) { RGObjClassByGtypeData data; data.gtype = gtype; data.parent = parent; data.create_class = create_class; if (create_class) { rb_funcall(lookup_class_mutex, id_lock, 0); return (RGObjClassInfo *)rb_ensure(rbgobj_lookup_class_by_gtype_body, (VALUE)&data, rbgobj_lookup_class_by_gtype_ensure, (VALUE)&data); } else { return rbgobj_lookup_class_by_gtype_without_lock(gtype, parent, create_class); } } VALUE rbgobj_gtype_to_ruby_class(GType gtype) { const RGObjClassInfo *cinfo; cinfo = GTYPE2CINFO(gtype); return cinfo ? cinfo->klass : Qnil; } VALUE rbgobj_define_class(GType gtype, const gchar *name, VALUE module, RGMarkFunc mark, RGFreeFunc free, VALUE parent) { RGObjClassInfo* cinfo; if (gtype == 0) rb_bug("rbgobj_define_class: Invalid gtype [%s]\n", name); cinfo = (RGObjClassInfo*)rbgobj_lookup_class_by_gtype(gtype, parent); cinfo->mark = mark; cinfo->free = free; rb_define_const(module, name, cinfo->klass); return cinfo->klass; } void rbgobj_register_mark_func(GType gtype, RGMarkFunc mark) { RGObjClassInfo *cinfo; cinfo = (RGObjClassInfo *)rbgobj_lookup_class_by_gtype_full(gtype, Qnil, FALSE); if (!cinfo) { rb_raise(rb_eArgError, "rbgobj_register_free_func(): no class is defined: <%s>", g_type_name(gtype)); } cinfo->mark = mark; } void rbgobj_register_free_func(GType gtype, RGFreeFunc free) { RGObjClassInfo *cinfo; cinfo = (RGObjClassInfo *)rbgobj_lookup_class_by_gtype_full(gtype, Qnil, FALSE); if (!cinfo) { rb_raise(rb_eArgError, "rbgobj_register_free_func(): no class is defined: <%s>", g_type_name(gtype)); } cinfo->free = free; } VALUE rbgobj_define_class_dynamic(const gchar *gtype_name, const gchar *name, VALUE module, RGMarkFunc mark, RGFreeFunc free) { RGObjClassInfoDynamic* cinfo; cinfo = (RGObjClassInfoDynamic*)g_new(RGObjClassInfoDynamic, 1); cinfo->name = name; cinfo->module = module; cinfo->mark = mark; cinfo->free = free; g_hash_table_insert(dynamic_gtype_list, (void*)gtype_name, (void*)cinfo); return Qnil; } void rbgobj_register_class(VALUE klass, GType gtype, gboolean klass2gtype, gboolean gtype2klass) { RGObjClassInfo* cinfo = NULL; VALUE c = Qnil; if (klass2gtype) c = Data_Make_Struct(rb_cData, RGObjClassInfo, cinfo_mark, NULL, cinfo); if (gtype2klass && !cinfo) cinfo = g_new(RGObjClassInfo, 1); if (cinfo) { cinfo->klass = klass; cinfo->gtype = gtype; cinfo->mark = NULL; cinfo->free = NULL; cinfo->flags = 0; } if (klass2gtype) rb_hash_aset(klass_to_cinfo, cinfo->klass, c); if (gtype2klass) g_hash_table_insert(gtype_to_cinfo, GUINT_TO_POINTER(gtype), cinfo); } #define _register_fundamental_klass_to_gtype(klass, gtype) \ rbgobj_register_class(klass, gtype, TRUE, FALSE) #define _register_fundamental_gtype_to_klass(gtype,klass) \ rbgobj_register_class(klass, gtype, FALSE, TRUE) static void init_typemap(void) { id_new = rb_intern("new"); id_superclass = rb_intern("superclass"); gtype_to_cinfo = g_hash_table_new(g_direct_hash, g_direct_equal); rb_global_variable(&klass_to_cinfo); klass_to_cinfo = rb_hash_new(); _register_fundamental_klass_to_gtype(rb_cFixnum, G_TYPE_LONG); _register_fundamental_klass_to_gtype(rb_cFloat, G_TYPE_DOUBLE); _register_fundamental_klass_to_gtype(rb_cInteger, G_TYPE_LONG); _register_fundamental_klass_to_gtype(rb_cString, G_TYPE_STRING); _register_fundamental_klass_to_gtype(rb_cSymbol, G_TYPE_STRING); _register_fundamental_klass_to_gtype(Qnil, G_TYPE_NONE); _register_fundamental_klass_to_gtype(rb_cNilClass, G_TYPE_NONE); _register_fundamental_klass_to_gtype(rb_cTrueClass, G_TYPE_BOOLEAN); _register_fundamental_klass_to_gtype(rb_cFalseClass, G_TYPE_BOOLEAN); _register_fundamental_klass_to_gtype(Qtrue, G_TYPE_BOOLEAN); _register_fundamental_klass_to_gtype(Qfalse, G_TYPE_BOOLEAN); _register_fundamental_klass_to_gtype(rb_cObject, RBGOBJ_TYPE_RUBY_VALUE); _register_fundamental_gtype_to_klass(G_TYPE_UINT, rb_cInteger); _register_fundamental_gtype_to_klass(G_TYPE_FLOAT, rb_cFloat); _register_fundamental_gtype_to_klass(G_TYPE_DOUBLE, rb_cFloat); _register_fundamental_gtype_to_klass(G_TYPE_INT64, rb_cInteger); _register_fundamental_gtype_to_klass(G_TYPE_UINT64, rb_cInteger); _register_fundamental_gtype_to_klass(G_TYPE_INT, rb_cInteger); _register_fundamental_gtype_to_klass(G_TYPE_LONG, rb_cInteger); _register_fundamental_gtype_to_klass(G_TYPE_CHAR, rb_cFixnum); _register_fundamental_gtype_to_klass(G_TYPE_UCHAR, rb_cFixnum); _register_fundamental_gtype_to_klass(G_TYPE_STRING, rb_cString); _register_fundamental_gtype_to_klass(G_TYPE_ULONG, rb_cInteger); _register_fundamental_gtype_to_klass(G_TYPE_NONE, rb_cNilClass); _register_fundamental_gtype_to_klass(G_TYPE_BOOLEAN, rb_cTrueClass); } /**********************************************************************/ /* GLib::Type */ VALUE RG_TARGET_NAMESPACE; static ID id_gtype; VALUE rbgobj_gtype_new(GType gtype) { VALUE result = rb_obj_alloc(RG_TARGET_NAMESPACE); VALUE arg = ULONG2NUM(gtype); rb_obj_call_init(result, 1, &arg); return result; } GType rbgobj_gtype_get(VALUE self) { if (RVAL2CBOOL(rb_obj_is_kind_of(self, RG_TARGET_NAMESPACE))) { return NUM2ULONG(rb_ivar_get(self, id_gtype)); } else { return CLASS2GTYPE(self); } rb_raise(rb_eTypeError, "Not a GLib::Type"); } static VALUE rg_initialize(VALUE self, VALUE type) { GType gtype; if (RVAL2CBOOL(rb_obj_is_kind_of(type, rb_cInteger))) { gtype = NUM2ULONG(type); if (!g_type_name(gtype)) gtype = G_TYPE_INVALID; } else { gtype = g_type_from_name(StringValuePtr(type)); } if (G_TYPE_INVALID == gtype) rb_raise(rb_eArgError, "invalid type"); rb_ivar_set(self, id_gtype, ULONG2NUM(gtype)); return Qnil; } static VALUE rg_inspect(VALUE self) { GType gtype = rbgobj_gtype_get(self); gchar* str; VALUE result; str = g_strdup_printf("GLib::Type[\"%s\"]", g_type_name(gtype)); result = rb_str_new2(str); g_free(str); return result; } static VALUE rg_operator_type_compare(VALUE self, VALUE other) { if (!RVAL2CBOOL(rb_obj_is_kind_of(other, RG_TARGET_NAMESPACE))) return Qnil; else { GType a = rbgobj_gtype_get(self); GType b = rbgobj_gtype_get(other); if (a==b) return INT2FIX(0); else if (g_type_is_a(a,b)) return INT2FIX(-1); else if (g_type_is_a(b,a)) return INT2FIX(1); else return Qnil; } } static VALUE rg_operator_type_eq(VALUE self, VALUE other) { if (!RVAL2CBOOL(rb_obj_is_kind_of(other, RG_TARGET_NAMESPACE))) return Qnil; else { GType a = rbgobj_gtype_get(self); GType b = rbgobj_gtype_get(other); return CBOOL2RVAL(a == b); } } static VALUE rg_operator_type_lt_eq(VALUE self, VALUE other) { if (!RVAL2CBOOL(rb_obj_is_kind_of(other, RG_TARGET_NAMESPACE))) return Qnil; else { GType a = rbgobj_gtype_get(self); GType b = rbgobj_gtype_get(other); return CBOOL2RVAL(g_type_is_a(a, b)); } } static VALUE rg_operator_type_gt_eq(VALUE self, VALUE other) { if (!RVAL2CBOOL(rb_obj_is_kind_of(other, RG_TARGET_NAMESPACE))) return Qnil; else { GType a = rbgobj_gtype_get(self); GType b = rbgobj_gtype_get(other); return CBOOL2RVAL(g_type_is_a(b, a)); } } static VALUE rg_operator_type_lt(VALUE self, VALUE other) { if (!RVAL2CBOOL(rb_obj_is_kind_of(other, RG_TARGET_NAMESPACE))) return Qnil; else { GType a = rbgobj_gtype_get(self); GType b = rbgobj_gtype_get(other); return CBOOL2RVAL(g_type_is_a(a, b) && a != b); } } static VALUE rg_operator_type_gt(VALUE self, VALUE other) { if (!RVAL2CBOOL(rb_obj_is_kind_of(other, RG_TARGET_NAMESPACE))) return Qnil; else { GType a = rbgobj_gtype_get(self); GType b = rbgobj_gtype_get(other); return CBOOL2RVAL(g_type_is_a(b, a) && a != b); } } static VALUE rg_hash(VALUE self) { return rb_ivar_get(self, id_gtype); } static VALUE rg_to_class(VALUE self) { return GTYPE2CLASS(rbgobj_gtype_get(self)); } static VALUE rg_fundamental(VALUE self) { return rbgobj_gtype_new(G_TYPE_FUNDAMENTAL(rbgobj_gtype_get(self))); } static VALUE rg_fundamental_p(VALUE self) { return CBOOL2RVAL(G_TYPE_IS_FUNDAMENTAL(rbgobj_gtype_get(self))); } static VALUE rg_derived_p(VALUE self) { return CBOOL2RVAL(G_TYPE_IS_DERIVED(rbgobj_gtype_get(self))); } static VALUE rg_interface_p(VALUE self) { return CBOOL2RVAL(G_TYPE_IS_INTERFACE(rbgobj_gtype_get(self))); } static VALUE rg_classed_p(VALUE self) { return CBOOL2RVAL(G_TYPE_IS_CLASSED(rbgobj_gtype_get(self))); } static VALUE rg_instantiatable_p(VALUE self) { return CBOOL2RVAL(G_TYPE_IS_INSTANTIATABLE(rbgobj_gtype_get(self))); } static VALUE rg_derivable_p(VALUE self) { return CBOOL2RVAL(G_TYPE_IS_DERIVABLE(rbgobj_gtype_get(self))); } static VALUE rg_deep_derivable_p(VALUE self) { return CBOOL2RVAL(G_TYPE_IS_DEEP_DERIVABLE(rbgobj_gtype_get(self))); } static VALUE rg_abstract_p(VALUE self) { return CBOOL2RVAL(G_TYPE_IS_ABSTRACT(rbgobj_gtype_get(self))); } static VALUE rg_value_abstract_p(VALUE self) { return CBOOL2RVAL(G_TYPE_IS_VALUE_ABSTRACT(rbgobj_gtype_get(self))); } static VALUE rg_value_type_p(VALUE self) { return CBOOL2RVAL(G_TYPE_IS_VALUE_TYPE(rbgobj_gtype_get(self))); } static VALUE rg_has_value_table(VALUE self) { return CBOOL2RVAL(G_TYPE_HAS_VALUE_TABLE(rbgobj_gtype_get(self))); } static VALUE rg_name(VALUE self) { return rb_str_new2(g_type_name(rbgobj_gtype_get(self))); } static VALUE rg_parent(VALUE self) { GType parent = g_type_parent(rbgobj_gtype_get(self)); return parent ? rbgobj_gtype_new(parent) : Qnil; } static VALUE rg_depth(VALUE self) { return UINT2NUM(g_type_depth(rbgobj_gtype_get(self))); } static VALUE rg_next_base(VALUE leaf_type, VALUE root_type) { GType ret = g_type_next_base(rbgobj_gtype_get(leaf_type), rbgobj_gtype_get(root_type)); return ret ? rbgobj_gtype_new(ret) : Qnil; } static VALUE rg_type_is_a_p(VALUE self, VALUE is_a_type) { return CBOOL2RVAL(g_type_is_a(rbgobj_gtype_get(self), rbgobj_gtype_get(is_a_type))); } #if 0 gpointer g_type_class_ref (GType type); gpointer g_type_class_peek (GType type); void g_type_class_unref (gpointer g_class); gpointer g_type_class_peek_parent (gpointer g_class); gpointer g_type_interface_peek (gpointer instance_class, GType iface_type); gpointer g_type_interface_peek_parent (gpointer g_iface); #endif static VALUE rg_children(VALUE self) { guint n_children; GType* types; VALUE result; guint i; types = g_type_children(rbgobj_gtype_get(self), &n_children); result = rb_ary_new2(n_children); for (i = 0; i < n_children; i++) rb_ary_store(result, i, rbgobj_gtype_new(types[i])); g_free(types); return result; } static VALUE rg_interfaces(VALUE self) { guint n_interfaces; GType* types; VALUE result; guint i; types = g_type_interfaces(rbgobj_gtype_get(self), &n_interfaces); result = rb_ary_new2(n_interfaces); for (i = 0; i < n_interfaces; i++) rb_ary_store(result, i, rbgobj_gtype_new(types[i])); g_free(types); return result; } static VALUE rg_class_size(VALUE self) { GTypeQuery query; g_type_query(rbgobj_gtype_get(self), &query); return UINT2NUM(query.class_size); } static VALUE rg_instance_size(VALUE self) { GTypeQuery query; g_type_query(rbgobj_gtype_get(self), &query); return UINT2NUM(query.instance_size); } static inline void _def_fundamental_type(VALUE ary, GType gtype, const char* name) { VALUE c = rbgobj_gtype_new(gtype); rb_define_const(RG_TARGET_NAMESPACE, name, c); rb_ary_push(ary, c); } /**********************************************************************/ void Init_gobject_gtype(void) { #if !GLIB_CHECK_VERSION(2, 35, 1) g_type_init(); #endif init_typemap(); /* type */ rb_cMutex = rb_const_get(rb_cObject, rb_intern("Mutex")); id_lock = rb_intern("lock"); id_unlock = rb_intern("unlock"); lookup_class_mutex = rb_funcall(rb_cMutex, id_new, 0); rb_iv_set(mGLib, "lookup_class_mutex", lookup_class_mutex); dynamic_gtype_list = g_hash_table_new(g_str_hash, g_str_equal); id_gtype = rb_intern("__gobject_gtype__"); RG_TARGET_NAMESPACE = rb_define_class_under(mGLib, "Type", rb_cObject); rb_define_alias(CLASS_OF(RG_TARGET_NAMESPACE), "[]", "new"); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(inspect, 0); RG_DEF_METHOD_OPERATOR("<=>", type_compare, 1); RG_DEF_METHOD_OPERATOR("==", type_eq, 1); RG_DEF_METHOD_OPERATOR("<=", type_lt_eq, 1); RG_DEF_METHOD_OPERATOR(">=", type_gt_eq, 1); RG_DEF_METHOD_OPERATOR("<", type_lt, 1); RG_DEF_METHOD_OPERATOR(">", type_gt, 1); RG_DEF_ALIAS("eql?", "=="); RG_DEF_METHOD(hash, 0); RG_DEF_ALIAS("to_i", "hash"); RG_DEF_ALIAS("to_int", "hash"); RG_DEF_METHOD(to_class, 0); RG_DEF_METHOD(fundamental, 0); RG_DEF_METHOD_P(fundamental, 0); RG_DEF_METHOD_P(derived, 0); RG_DEF_METHOD_P(interface, 0); RG_DEF_METHOD_P(classed, 0); RG_DEF_METHOD_P(instantiatable, 0); RG_DEF_METHOD_P(derivable, 0); RG_DEF_METHOD_P(deep_derivable, 0); RG_DEF_METHOD_P(abstract, 0); RG_DEF_METHOD_P(value_abstract, 0); RG_DEF_METHOD_P(value_type, 0); RG_DEF_METHOD(has_value_table, 0); RG_DEF_METHOD(name, 0); RG_DEF_ALIAS("to_s", "name"); RG_DEF_METHOD(parent, 0); RG_DEF_METHOD(depth, 0); RG_DEF_METHOD(next_base, 1); RG_DEF_METHOD_P(type_is_a, 1); RG_DEF_METHOD(children, 0); RG_DEF_METHOD(interfaces, 0); RG_DEF_METHOD(class_size, 0); RG_DEF_METHOD(instance_size, 0); { VALUE ary = rb_ary_new(); rb_define_const(RG_TARGET_NAMESPACE, "FUNDAMENTAL_MAX", INT2FIX(G_TYPE_FUNDAMENTAL_MAX)); _def_fundamental_type(ary, G_TYPE_NONE, "NONE"); _def_fundamental_type(ary, G_TYPE_INTERFACE, "INTERFACE"); _def_fundamental_type(ary, G_TYPE_CHAR, "CHAR"); _def_fundamental_type(ary, G_TYPE_UCHAR, "UCHAR"); _def_fundamental_type(ary, G_TYPE_BOOLEAN, "BOOLEAN"); _def_fundamental_type(ary, G_TYPE_INT, "INT"); _def_fundamental_type(ary, G_TYPE_UINT, "UINT"); _def_fundamental_type(ary, G_TYPE_LONG, "LONG"); _def_fundamental_type(ary, G_TYPE_ULONG, "ULONG"); _def_fundamental_type(ary, G_TYPE_INT64, "INT64"); _def_fundamental_type(ary, G_TYPE_UINT64, "UINT64"); _def_fundamental_type(ary, G_TYPE_ENUM, "ENUM"); _def_fundamental_type(ary, G_TYPE_FLAGS, "FLAGS"); _def_fundamental_type(ary, G_TYPE_FLOAT, "FLOAT"); _def_fundamental_type(ary, G_TYPE_DOUBLE, "DOUBLE"); _def_fundamental_type(ary, G_TYPE_STRING, "STRING"); _def_fundamental_type(ary, G_TYPE_POINTER, "POINTER"); _def_fundamental_type(ary, G_TYPE_BOXED, "BOXED"); _def_fundamental_type(ary, G_TYPE_PARAM, "PARAM"); _def_fundamental_type(ary, G_TYPE_OBJECT, "OBJECT"); rb_define_const(RG_TARGET_NAMESPACE, "FUNDAMENTAL_TYPES", ary); /* FIXME: better name */ } } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_typeplugin.c0000644000175000017500000000351111701304107021265 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE mTypePlugin static VALUE rg_use(VALUE self) { g_type_plugin_use(G_TYPE_PLUGIN(RVAL2GOBJ(self))); return self; } static VALUE rg_unuse(VALUE self) { g_type_plugin_unuse(G_TYPE_PLUGIN(RVAL2GOBJ(self))); return self; } #if 0 void g_type_plugin_complete_type_info (GTypePlugin *plugin, GType g_type, GTypeInfo *info, GTypeValueTable *value_table); void g_type_plugin_complete_interface_info (GTypePlugin *plugin, GType interface_type, GType instance_type, GInterfaceInfo *info); #endif void Init_gobject_gtypeplugin(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_TYPE_PLUGIN, "TypePlugin", mGLib); RG_DEF_METHOD(use, 0); RG_DEF_METHOD(unuse, 0); }ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib.h0000644000175000017500000001743112257664725017042 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #include "ruby.h" #include "rbglibdeprecated.h" #include "rbglib2conversions.h" #ifndef __RBGLIB_H__ #define __RBGLIB_H__ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define RBGLIB_MAJOR_VERSION 2 #define RBGLIB_MINOR_VERSION 1 #define RBGLIB_MICRO_VERSION 0 #ifndef RSTRING_PTR # define RSTRING_PTR(s) (RSTRING(s)->ptr) # define RSTRING_LEN(s) (RSTRING(s)->len) #endif #ifndef RARRAY_PTR # define RARRAY_PTR(s) (RARRAY(s)->ptr) # define RARRAY_LEN(s) (RARRAY(s)->len) #endif #ifndef DBL2NUM # define DBL2NUM(v) (rb_float_new(v)) #endif #ifndef RBASIC_CLASS # define RBASIC_CLASS(obj) (RBASIC(obj)->klass) #endif #ifndef G_SOURCE_REMOVE # define G_SOURCE_REMOVE FALSE #endif #ifndef G_SOURCE_CONTINUE # define G_SOURCE_CONTINUE TRUE #endif #define RBG_INSPECT(object) (rbg_rval_inspect(object)) #define RVAL2CSTR(v) (rbg_rval2cstr(&(v))) #define RVAL2CSTR_ACCEPT_NIL(v) (rbg_rval2cstr_accept_nil(&(v))) #define RVAL2CSTR2(v) (RVAL2CSTR_ACCEPT_NIL(v)) #define RVAL2CSTR_ACCEPT_SYMBOL(v) (rbg_rval2cstr_accept_symbol(&(v))) #define RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(v) (rbg_rval2cstr_accept_symbol_accept_nil(&(v))) #define RVAL2GLIBID(v, buf) (rbg_rval2glibid(&(v), &(buf), FALSE)) #define RVAL2GLIBID_ACCEPT_NIL(v, buf) (rbg_rval2glibid(&(v), &(buf), TRUE)) #define CSTR2RVAL(s) (rbg_cstr2rval(s)) #define CSTR2RVAL_LEN(s, l) (rbg_cstr2rval_len(s, l)) #define CSTR2RVAL_LEN_FREE(s, l) (rbg_cstr2rval_len_free(s, l)) #define CSTR2RVAL_ENC(s, e) (rbg_cstr2rval_with_encoding(s, e)) #define CSTR2RVAL_LEN_ENC(s, l, e) (rbg_cstr2rval_len_with_encoding(s, l, e)) #define CSTR2RVAL_FREE(s) (rbg_cstr2rval_free(s)) #define CSTR2RVAL2(s) (CSTR2RVAL_FREE(s)) #if G_BYTE_ORDER == G_LITTLE_ENDIAN # define CSTR2RVAL_LEN_UCS4(s, l) (CSTR2RVAL_LEN_ENC(s, l, "UTF-32LE")) # define CSTR2RVAL_LEN_UTF16(s, l) (CSTR2RVAL_LEN_ENC(s, l, "UTF-16LE")) #else # define CSTR2RVAL_LEN_UCS4(s, l) (CSTR2RVAL_LEN_ENC(s, l, "UTF-32BE")) # define CSTR2RVAL_LEN_UTF16(s, l) (CSTR2RVAL_LEN_ENC(s, l, "UTF-16BE")) #endif #define RVAL2CSTRFILENAME(v) (rbg_filename_from_ruby(v)) #define CSTRFILENAME2RVAL(s) (rbg_filename_to_ruby(s)) #define CSTRFILENAME2RVAL_FREE(s) (rbg_filename_to_ruby_free(s)) #define RVAL2STRS(ary, n) rbg_rval2strv(&(ary), &(n)) #define RVAL2STRS_ACCEPT_NIL(ary, n) rbg_rval2strv_accept_nil(&(ary), &(n)) #define RVAL2STRV(ary) rbg_rval2strv(&(ary), NULL) #define RVAL2STRV_ACCEPT_NIL(ary) rbg_rval2strv_accept_nil(&(ary), NULL) #define RVAL2STRS_DUP(ary, n) rbg_rval2strv_dup(&(ary), &(n)) #define RVAL2STRS_DUP_ACCEPT_NIL(ary, n) rbg_rval2strv_dup_accept_nil(&(ary), &(n)) #define RVAL2STRV_DUP(ary) rbg_rval2strv_dup(&(ary), NULL) #define RVAL2STRV_DUP_ACCEPT_NIL(ary) rbg_rval2strv_dup_accept_nil(&(ary), NULL) #define STRV2RVAL(strings) rbg_strv2rval(strings) #define STRV2RVAL_FREE(strings) rbg_strv2rval_free(strings) #define RVAL2GBOOLEANS(ary, n) rbg_rval2gbooleans(&(ary), &(n)) #define RVAL2GINTS(ary, n) rbg_rval2gints(&(ary), &(n)) #define RVAL2GINT8S(ary, n) rbg_rval2gint8s(&(ary), &(n)) #define RVAL2GUINT8S(ary, n) rbg_rval2guint8s(&(ary), &(n)) #define RVAL2GUINT16S(ary, n) rbg_rval2guint16s(&(ary), &(n)) #define RVAL2GUINT32S(ary, n) rbg_rval2guint32s(&(ary), &(n)) #define RVAL2GDOUBLES(ary, n) rbg_rval2gdoubles(&(ary), &(n)) #define GINTS2RVAL(ary, n) rbg_gints2rval(ary, n) #define GINTS2RVAL_FREE(ary, n) rbg_gints2rval(ary, n) #define CBOOL2RVAL(b) ((b) ? Qtrue : Qfalse) #define RVAL2CBOOL(b) (RTEST(b)) #define GERROR2RVAL(error) (rbgerr_gerror2exception(error)) #define RG_RAISE_ERROR(error) rb_exc_raise(GERROR2RVAL(error)) #define RAISE_GERROR(error) RG_RAISE_ERROR(error) /* deprecated */ #define G_DEF_ERROR(domain, name, module, parent, gtype) \ rbgerr_define_gerror(domain, name, module, parent, gtype) #define G_DEF_ERROR2(domain, name, module, parent) \ rbgerr_define_gerror(domain, name, module, parent, Qnil) #if defined(G_PLATFORM_WIN32) && !defined(RUBY_GLIB2_STATIC_COMPILATION) # ifdef RUBY_GLIB2_COMPILATION # define RUBY_GLIB2_VAR __declspec(dllexport) # else # define RUBY_GLIB2_VAR extern __declspec(dllimport) # endif #else # define RUBY_GLIB2_VAR extern #endif RUBY_GLIB2_VAR VALUE mGLib; extern const gchar *rbg_rval_inspect(VALUE object); extern gchar* rbg_string_value_ptr(volatile VALUE* ptr); /* no longer used */ extern const gchar *rbg_rval2cstr(VALUE *str); extern const gchar *rbg_rval2cstr_accept_nil(VALUE *str); extern const gchar *rbg_rval2cstr_accept_symbol(volatile VALUE *value); extern const gchar *rbg_rval2cstr_accept_symbol_accept_nil(volatile VALUE *value); extern const gchar *rbg_rval2glibid(volatile VALUE *value, volatile VALUE *buf, gboolean accept_nil); extern VALUE rbg_cstr2rval(const gchar* str); extern VALUE rbg_cstr2rval_len(const gchar* str, gsize len); extern VALUE rbg_cstr2rval_len_free(gchar *str, gsize len); extern VALUE rbg_cstr2rval_with_encoding(const gchar* str, const gchar *encoding); extern VALUE rbg_cstr2rval_len_with_encoding(const gchar* str, gsize len, const gchar *encoding); extern VALUE rbg_cstr2rval_free(gchar *str); /* just for backward compatibility. */ extern VALUE rbg_cstr2rval_with_free(gchar *str); VALUE rbg_filename_to_ruby(const gchar *filename); extern VALUE rbg_filename_to_ruby_free(gchar *filename); extern gchar *rbg_filename_from_ruby(VALUE filename); const gchar **rbg_rval2strv(volatile VALUE *value, long *n); const gchar **rbg_rval2strv_accept_nil(volatile VALUE *value, long *n); gchar **rbg_rval2strv_dup(volatile VALUE *value, long *n); gchar **rbg_rval2strv_dup_accept_nil(volatile VALUE *value, long *n); VALUE rbg_strv2rval(const gchar **strings); VALUE rbg_strv2rval_free(gchar **strings); gboolean *rbg_rval2gbooleans(volatile VALUE *value, long *n); gint *rbg_rval2gints(volatile VALUE *value, long *n); gint8 *rbg_rval2gint8s(volatile VALUE *value, long *n); guint8 *rbg_rval2guint8s(volatile VALUE *value, long *n); guint16 *rbg_rval2guint16s(volatile VALUE *value, long *n); guint32 *rbg_rval2guint32s(volatile VALUE *value, long *n); gdouble *rbg_rval2gdoubles(volatile VALUE *value, long *n); VALUE rbg_gints2rval(const gint *gints, long n); VALUE rbg_gints2rval_free(gint *gints, long n); extern VALUE rbg_to_array(VALUE object); extern VALUE rbg_to_hash(VALUE object); extern VALUE rbg_check_array_type(VALUE object); extern VALUE rbg_check_hash_type(VALUE object); extern void rbg_scan_options(VALUE options, ...); /* rbgerror.h */ extern VALUE rbgerr_gerror2exception(GError *error); extern VALUE rbgerr_define_gerror(GQuark domain, const gchar* name, VALUE module, VALUE parent, VALUE gtype); extern VALUE rbglib_int64_to_num(guint64 val); extern VALUE rbglib_uint64_to_num(guint64 val); extern gint64 rbglib_num_to_int64(VALUE val); extern guint64 rbglib_num_to_uint64(VALUE val); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __RBGLIB_H__ */ ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_convert.c0000644000175000017500000001111312077252561020557 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2006 Sjoerd Simons, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgobject.h" #include "rbgprivate.h" static GHashTable *tables, *class_to_g_type_map; static void rg_convert_table_free(gpointer data) { RGConvertTable *table = data; if (table->notify) { table->notify(table->user_data); } g_free(table); } void Init_gobject_convert(void) { /* TODO: unref the below tables on exit. */ tables = g_hash_table_new_full(g_int_hash, g_int_equal, NULL, rg_convert_table_free); class_to_g_type_map = g_hash_table_new(g_int_hash, g_int_equal); } void rbgobj_convert_define(const RGConvertTable *table) { RGConvertTable *copied_table; copied_table = g_memdup(table, sizeof(RGConvertTable)); g_hash_table_insert(tables, &(copied_table->type), copied_table); if (copied_table->klass != Qfalse && !NIL_P(copied_table->klass)) { g_hash_table_insert(class_to_g_type_map, &(copied_table->klass), &(copied_table->type)); } } RGConvertTable * rbgobj_convert_lookup(GType type) { return g_hash_table_lookup(tables, &type); } gboolean rbgobj_convert_has_type(GType type) { return rbgobj_convert_lookup(type) != NULL; } gboolean rbgobj_convert_get_superclass(GType type, VALUE *result) { RGConvertTable *table; table = rbgobj_convert_lookup(type); if (table && table->get_superclass) { *result = table->get_superclass(table->user_data); return TRUE; } return FALSE; } gboolean rbgobj_convert_type_init_hook(GType type, VALUE klass) { RGConvertTable *table; table = rbgobj_convert_lookup(type); if (table && table->type_init_hook) { table->type_init_hook(klass, table->user_data); return TRUE; } return FALSE; } gboolean rbgobj_convert_rvalue2gvalue(GType type, VALUE value, GValue *result) { RGConvertTable *table; table = rbgobj_convert_lookup(type); if (table && table->rvalue2gvalue) { table->rvalue2gvalue(value, result, table->user_data); return TRUE; } return FALSE; } gboolean rbgobj_convert_gvalue2rvalue(GType type, const GValue *value, VALUE *result) { RGConvertTable *table; table = rbgobj_convert_lookup(type); if (table && table->gvalue2rvalue) { *result = table->gvalue2rvalue(value, table->user_data); return TRUE; } return FALSE; } GType rbgobj_convert_rvalue2gtype(VALUE value) { VALUE klass; GType *result; klass = rb_class_of(value); result = g_hash_table_lookup(class_to_g_type_map, &klass); return result ? *result : 0; } gboolean rbgobj_convert_initialize(GType type, VALUE obj, gpointer cobj) { RGConvertTable *table; table = rbgobj_convert_lookup(type); if (table && table->initialize) { table->initialize(obj, cobj, table->user_data); return TRUE; } return FALSE; } gboolean rbgobj_convert_robj2instance(GType type, VALUE obj, gpointer *result) { RGConvertTable *table; table = rbgobj_convert_lookup(type); if (table && table->robj2instance) { *result = table->robj2instance(obj, table->user_data); return TRUE; } return FALSE; } gboolean rbgobj_convert_instance2robj(GType type, gpointer instance, VALUE *result) { RGConvertTable *table; table = rbgobj_convert_lookup(type); if (table && table->instance2robj) { *result = table->instance2robj(instance, table->user_data); return TRUE; } return FALSE; } gboolean rbgobj_convert_unref(GType type, gpointer instance) { RGConvertTable *table; table = rbgobj_convert_lookup(type); if (table && table->unref) { table->unref(instance, table->user_data); return TRUE; } return FALSE; } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_strv.c0000644000175000017500000000256112257552167020111 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" static VALUE strv_to_ruby(const GValue *from) { return STRV2RVAL((const gchar **)g_value_get_boxed(from)); } static void strv_from_ruby(VALUE from, GValue *to) { const gchar **strings = RVAL2STRV(from); g_value_set_boxed(to, strings); g_free(strings); } void Init_gobject_gstrv(void) { /* GStrv is treated as Array */ rbgobj_register_g2r_func(G_TYPE_STRV, strv_to_ruby); rbgobj_register_r2g_func(G_TYPE_STRV, strv_from_ruby); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_unichar.c0000644000175000017500000001423712257552167020543 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #define RG_TARGET_NAMESPACE mUniChar #define DEF_IS_UNICHAR(name) \ static VALUE \ rbglib_m_unichar_is ## name(G_GNUC_UNUSED VALUE self, VALUE unichar) \ { \ return CBOOL2RVAL(g_unichar_is ## name(NUM2UINT(unichar))); \ } DEF_IS_UNICHAR(alnum) DEF_IS_UNICHAR(alpha) DEF_IS_UNICHAR(cntrl) DEF_IS_UNICHAR(digit) DEF_IS_UNICHAR(graph) DEF_IS_UNICHAR(lower) DEF_IS_UNICHAR(print) DEF_IS_UNICHAR(punct) DEF_IS_UNICHAR(space) DEF_IS_UNICHAR(upper) DEF_IS_UNICHAR(xdigit) DEF_IS_UNICHAR(title) DEF_IS_UNICHAR(defined) DEF_IS_UNICHAR(wide) DEF_IS_UNICHAR(wide_cjk) #undef DEF_IS_UNICHAR static VALUE rg_s_to_upper(G_GNUC_UNUSED VALUE self, VALUE unichar) { return UINT2NUM(g_unichar_toupper(NUM2UINT(unichar))); } static VALUE rg_s_to_lower(G_GNUC_UNUSED VALUE self, VALUE unichar) { return UINT2NUM(g_unichar_tolower(NUM2UINT(unichar))); } static VALUE rg_s_to_title(G_GNUC_UNUSED VALUE self, VALUE unichar) { return UINT2NUM(g_unichar_totitle(NUM2UINT(unichar))); } static VALUE rg_s_digit_value(G_GNUC_UNUSED VALUE self, VALUE unichar) { return INT2NUM(g_unichar_digit_value(NUM2UINT(unichar))); } static VALUE rg_s_xdigit_value(G_GNUC_UNUSED VALUE self, VALUE unichar) { return INT2NUM(g_unichar_xdigit_value(NUM2UINT(unichar))); } static VALUE rg_s_type(G_GNUC_UNUSED VALUE self, VALUE unichar) { return GENUM2RVAL(g_unichar_type(NUM2UINT(unichar)), G_TYPE_UNICODE_TYPE); } static VALUE rg_s_break_type(G_GNUC_UNUSED VALUE self, VALUE unichar) { return GENUM2RVAL(g_unichar_break_type(NUM2UINT(unichar)), G_TYPE_UNICODE_BREAK_TYPE); } static VALUE rg_s_get_mirror_char(G_GNUC_UNUSED VALUE self, VALUE unichar) { gunichar mirrored_char; if (g_unichar_get_mirror_char(NUM2UINT(unichar), &mirrored_char)) { return UINT2NUM(mirrored_char); } else { return unichar; } } #if GLIB_CHECK_VERSION(2,14,0) static VALUE rg_s_combining_class(G_GNUC_UNUSED VALUE self, VALUE unichar) { return INT2NUM(g_unichar_combining_class(NUM2UINT(unichar))); } static VALUE rg_s_get_script(G_GNUC_UNUSED VALUE self, VALUE unichar) { return GENUM2RVAL(g_unichar_get_script(NUM2UINT(unichar)), G_TYPE_UNICODE_SCRIPT); } static VALUE rg_s_mark_p(G_GNUC_UNUSED VALUE self, VALUE unichar) { return CBOOL2RVAL(g_unichar_ismark(NUM2UINT(unichar))); } static VALUE rg_s_zero_width_p(G_GNUC_UNUSED VALUE self, VALUE unichar) { return CBOOL2RVAL(g_unichar_iszerowidth(NUM2UINT(unichar))); } #endif static VALUE rg_s_to_utf8(G_GNUC_UNUSED VALUE self, VALUE unichar) { gchar utf8[6]; gint len; len = g_unichar_to_utf8(NUM2UINT(unichar), utf8); return CSTR2RVAL_LEN(utf8, len); } void Init_glib_unichar(void) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "UniChar"); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "alnum?", rbglib_m_unichar_isalnum, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "alpha?", rbglib_m_unichar_isalpha, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "cntrl?", rbglib_m_unichar_iscntrl, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "digit?", rbglib_m_unichar_isdigit, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "graph?", rbglib_m_unichar_isgraph, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "lower?", rbglib_m_unichar_islower, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "print?", rbglib_m_unichar_isprint, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "punct?", rbglib_m_unichar_ispunct, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "space?", rbglib_m_unichar_isspace, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "upper?", rbglib_m_unichar_isupper, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "xdigit?", rbglib_m_unichar_isxdigit, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "title?", rbglib_m_unichar_istitle, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "defined?", rbglib_m_unichar_isdefined, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "wide?", rbglib_m_unichar_iswide, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "wide_cjk?", rbglib_m_unichar_iswide_cjk, 1); RG_DEF_SMETHOD(to_upper, 1); RG_DEF_SMETHOD(to_lower, 1); RG_DEF_SMETHOD(to_title, 1); RG_DEF_SMETHOD(digit_value, 1); RG_DEF_SMETHOD(xdigit_value, 1); RG_DEF_SMETHOD(type, 1); RG_DEF_SMETHOD(break_type, 1); RG_DEF_SMETHOD(get_mirror_char, 1); #if GLIB_CHECK_VERSION(2,14,0) RG_DEF_SMETHOD(combining_class, 1); RG_DEF_SMETHOD(get_script, 1); RG_DEF_SMETHOD_P(mark, 1); RG_DEF_SMETHOD_P(zero_width, 1); #endif RG_DEF_SMETHOD(to_utf8, 1); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_messages.c0000664000175000017500000001164711740310343020705 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #ifndef HAVE_RB_SOURCEFILE #define rb_sourcefile() (ruby_sourcefile) #endif #ifndef HAVE_RB_SOURCELINE #define rb_sourceline() (ruby_sourceline) #endif #define RG_TARGET_NAMESPACE mLog static VALUE rbglib_log_handler_procs; static gboolean log_canceled; static const gchar * logmessage(GLogLevelFlags level) { if (level & G_LOG_LEVEL_ERROR){ return "ERROR"; } else if (level & G_LOG_LEVEL_CRITICAL){ return "CRITICAL"; } else if (level & G_LOG_LEVEL_WARNING){ return "WARNING"; } else if (level & G_LOG_LEVEL_MESSAGE){ return "MESSAGE"; } else if (level & G_LOG_LEVEL_INFO){ return "INFO"; } else if (level & G_LOG_LEVEL_DEBUG){ return "DEBUG"; } return "UNKNOWN"; } static void rbglib_log_handler(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) { if (! log_canceled){ #ifdef HAVE_RUBY_SET_CURRENT_SOURCE ruby_set_current_source(); #endif g_printerr("%s: line %d\n", rb_sourcefile(), rb_sourceline()); g_printerr(" %s-%s **:%s\n", log_domain, logmessage(log_level), message); } else { g_log_default_handler(log_domain, log_level, message, user_data); } } /* Use Internal only */ static VALUE rg_s_cancel_handler(G_GNUC_UNUSED VALUE self) { log_canceled = TRUE; return Qnil; } static VALUE rg_s_set_handler(VALUE self, VALUE domain, VALUE levels) { guint handler_id = g_log_set_handler(RVAL2CSTR_ACCEPT_NIL(domain), NUM2INT(levels), (GLogFunc)rbglib_log_handler, (gpointer)self); return UINT2NUM(handler_id); } static VALUE rg_s_remove_handler(VALUE self, VALUE domain, VALUE handler_id) { g_log_remove_handler(RVAL2CSTR_ACCEPT_NIL(domain), NUM2UINT(handler_id)); G_REMOVE_RELATIVE(self, handler_id, rbglib_log_handler_procs); return Qnil; } static VALUE rg_s_set_always_fatal(G_GNUC_UNUSED VALUE self, VALUE fatal_mask) { return INT2NUM(g_log_set_always_fatal(NUM2INT(fatal_mask))); } static VALUE rg_s_set_fatal_mask(G_GNUC_UNUSED VALUE self, VALUE domain, VALUE fatal_mask) { return INT2NUM(g_log_set_fatal_mask(RVAL2CSTR_ACCEPT_NIL(domain), NUM2INT(fatal_mask))); } static VALUE rg_s_log(G_GNUC_UNUSED VALUE self, VALUE domain, VALUE level, VALUE str) { g_log(RVAL2CSTR_ACCEPT_NIL(domain), NUM2INT(level), "%s", RVAL2CSTR(str)); return Qnil; } void Init_glib_messages(void) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "Log"); log_canceled = FALSE; rb_global_variable(&rbglib_log_handler_procs); rbglib_log_handler_procs = rb_hash_new(); RG_DEF_SMETHOD(set_handler, 2); RG_DEF_SMETHOD(remove_handler, 2); RG_DEF_SMETHOD(cancel_handler, 0); RG_DEF_SMETHOD(set_always_fatal, 1); RG_DEF_SMETHOD(set_fatal_mask, 2); RG_DEF_SMETHOD(log, 3); rb_define_const(RG_TARGET_NAMESPACE, "FATAL_MASK", INT2NUM(G_LOG_FATAL_MASK)); rb_define_const(RG_TARGET_NAMESPACE, "LEVEL_USER_SHIFT", INT2NUM(G_LOG_LEVEL_USER_SHIFT)); /* GLogLevelFlags */ rb_define_const(RG_TARGET_NAMESPACE, "FLAG_RECURSION", INT2NUM(G_LOG_FLAG_RECURSION)); rb_define_const(RG_TARGET_NAMESPACE, "FLAG_FATAL", INT2NUM(G_LOG_FLAG_FATAL)); rb_define_const(RG_TARGET_NAMESPACE, "LEVEL_ERROR", INT2NUM(G_LOG_LEVEL_ERROR)); rb_define_const(RG_TARGET_NAMESPACE, "LEVEL_CRITICAL", INT2NUM(G_LOG_LEVEL_CRITICAL)); rb_define_const(RG_TARGET_NAMESPACE, "LEVEL_WARNING", INT2NUM(G_LOG_LEVEL_WARNING)); rb_define_const(RG_TARGET_NAMESPACE, "LEVEL_MESSAGE", INT2NUM(G_LOG_LEVEL_MESSAGE)); rb_define_const(RG_TARGET_NAMESPACE, "LEVEL_INFO", INT2NUM(G_LOG_LEVEL_INFO)); rb_define_const(RG_TARGET_NAMESPACE, "LEVEL_DEBUG", INT2NUM(G_LOG_LEVEL_DEBUG)); rb_define_const(RG_TARGET_NAMESPACE, "LEVEL_MASK", INT2NUM(G_LOG_LEVEL_MASK)); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgutil.c0000644000175000017500000000740112150300275017213 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" ID rbgutil_id_module_eval; static ID id_add_one_arg_setter; static ID id_set_property; static ID id_to_a; static ID id_allocate; static ID id_equal; void rbg_define_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc) { rb_define_method(klass, name, func, argc); if ((argc != 1) || strncmp(name, "set_", 4)) return; name += 4; rb_funcall(klass, rbgutil_id_module_eval, 1, CSTR2RVAL_FREE(g_strdup_printf("def %s=(val); set_%s(val); val; end\n", name, name))); } void rbg_define_singleton_method(VALUE obj, const char *name, VALUE (*func)(ANYARGS), int argc) { rb_define_singleton_method(obj, name, func, argc); if ((argc != 1) || strncmp(name, "set_", 4)) return; name += 4; rb_funcall(obj, rbgutil_id_module_eval, 1, CSTR2RVAL_FREE(g_strdup_printf("def self.%s=(val); set_%s(val); val; end\n", name, name))); } void rbgutil_set_properties(VALUE self, VALUE hash) { int i; VALUE ary; GObject* obj; Check_Type(hash, RUBY_T_HASH); ary = rb_funcall(hash, id_to_a, 0); obj = RVAL2GOBJ(self); g_object_freeze_notify(obj); for (i = 0; i < RARRAY_LEN(ary); i++) { rb_funcall(self, id_set_property, 2, RARRAY_PTR(RARRAY_PTR(ary)[i])[0], RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); } g_object_thaw_notify(obj); } VALUE rbgutil_def_setters(VALUE klass) { return rb_funcall(mGLib, id_add_one_arg_setter, 1, klass); } void rbgutil_glibid_r2g_func(VALUE from, GValue* to) { VALUE buffer; g_value_set_string(to, RVAL2GLIBID(from, buffer)); } VALUE rbgutil_sym_g2r_func(const GValue *from) { const gchar *str = g_value_get_string(from); return str ? ID2SYM(rb_intern(str)) : Qnil; } VALUE rbgutil_generic_s_gtype(VALUE klass) { return rbgobj_gtype_new(CLASS2GTYPE(klass)); } VALUE rbgutil_generic_gtype(VALUE self) { return generic_s_gtype(CLASS_OF(self)); } VALUE rbgutil_string_set_utf8_encoding(VALUE string) { #ifdef HAVE_RUBY_ENCODING_H if (!NIL_P(string)) rb_enc_associate(string, rb_utf8_encoding()); #endif return string; } gboolean rbgutil_key_equal(VALUE rb_key, const char *key) { switch (TYPE(rb_key)) { case RUBY_T_STRING: return RVAL2CBOOL(rb_funcall(rb_key, id_equal, 1, rb_str_new_cstr(key))); break; case RUBY_T_SYMBOL: return SYM2ID(rb_key) == rb_intern(key); break; default: return FALSE; break; } } void Init_gutil(void) { rbgutil_id_module_eval = rb_intern("module_eval"); id_set_property = rb_intern("set_property"); id_to_a = rb_intern("to_a"); id_add_one_arg_setter = rb_intern("__add_one_arg_setter"); id_allocate = rb_intern("allocate"); id_equal = rb_intern("=="); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_maincontext.c0000644000175000017500000005660412257552167021447 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #ifndef HAVE_RB_THREAD_BLOCKING_REGION # include # include # include # include # ifdef HAVE_CURR_THREAD # define rb_curr_thread curr_thread # endif #endif GStaticPrivate rg_polling_key = G_STATIC_PRIVATE_INIT; /* static ID id_poll_func; */ static ID id_call; static VALUE mGLibSource; static ID id__callbacks__; static GHashTable *callbacks_table; typedef struct _callback_info_t { VALUE callback; guint id; } callback_info_t; /*****************************************/ static GPollFunc default_poll_func; #ifdef HAVE_RB_THREAD_BLOCKING_REGION /* just for ruby-1.9.0. */ #if !defined(RUBY_UBF_IO) && defined(RB_UBF_DFL) # define RUBY_UBF_IO RB_UBF_DFL #endif typedef struct _PollInfo { GPollFD *ufds; guint nfsd; gint timeout; gint result; } PollInfo; static VALUE rg_poll_in_blocking(void *data) { PollInfo *info = data; info->result = default_poll_func(info->ufds, info->nfsd, info->timeout); return Qnil; } static gint rg_poll(GPollFD *ufds, guint nfsd, gint timeout) { PollInfo info; info.ufds = ufds; info.nfsd = nfsd; info.timeout = timeout; info.result = 0; g_static_private_set(&rg_polling_key, GINT_TO_POINTER(TRUE), NULL); rb_thread_blocking_region(rg_poll_in_blocking, &info, RUBY_UBF_IO, NULL); g_static_private_set(&rg_polling_key, GINT_TO_POINTER(FALSE), NULL); return info.result; } static VALUE ruby_source_set_priority (G_GNUC_UNUSED VALUE self, G_GNUC_UNUSED VALUE priority) { return Qnil; } #else static gint rg_poll(GPollFD *ufds, guint nfsd, gint timeout) { gint result; TRAP_BEG; result = default_poll_func(ufds, nfsd, timeout); TRAP_END; return result; } #endif static void restore_poll_func(G_GNUC_UNUSED VALUE data) { if (g_main_context_get_poll_func(NULL) == (GPollFunc)rg_poll) { g_main_context_set_poll_func(NULL, default_poll_func); } } #ifndef HAVE_RB_THREAD_BLOCKING_REGION static guint ruby_source_id = 0; /* from eval.c */ #define WAIT_FD (1<<0) #define WAIT_SELECT (1<<1) #define WAIT_TIME (1<<2) #define WAIT_JOIN (1<<3) #define WAIT_PID (1<<4) #define DELAY_INFTY 1E30 #ifdef RUBY_RELEASE_YEAR # define CHECK_RUBY_RELEASE_DATE(year, month, day) \ (RUBY_RELEASE_YEAR >= (year) && \ RUBY_RELEASE_MONTH >= (month) && \ RUBY_RELEASE_DAY >= (day)) #else # define CHECK_RUBY_RELEASE_DATE(year, month, day) 0 #endif static double timeofday(void) { struct timeval tv; #if CHECK_RUBY_RELEASE_DATE(2009, 1, 7) /* The following CLOCK_MONOTONIC change was introduced into * Ruby 1.8.6 and 1.8.7 at 2009-01-07. * * 1.8.6: * Wed Jan 7 10:06:12 2009 Nobuyoshi Nakada * * * eval.c (timeofday): use monotonic clock. based on a patch * from zimbatm in [ruby-core:16627]. * * 1.8.7: * Wed Jan 7 10:09:46 2009 Nobuyoshi Nakada * * * eval.c (timeofday): use monotonic clock. based on a patch * from zimbatm in [ruby-core:16627]. */ # ifdef CLOCK_MONOTONIC struct timespec tp; if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) { return (double)tp.tv_sec + (double)tp.tv_nsec * 1e-9; } # endif #endif gettimeofday(&tv, NULL); return (double)tv.tv_sec + (double)tv.tv_usec * 1e-6; } /*****************************************/ typedef struct _RGSource { GSource source; GList *poll_fds; GList *old_poll_fds; gboolean ready; } RGSource; static void source_cleanup_poll_fds(GSource *source) { RGSource *rg_source = (RGSource *)source; GList *node; for (node = rg_source->old_poll_fds; node; node = g_list_next(node)) { GPollFD *poll_fd = node->data; g_source_remove_poll(source, poll_fd); g_slice_free(GPollFD, poll_fd); } g_list_free(rg_source->old_poll_fds); rg_source->old_poll_fds = NULL; } static inline void source_prepare_add_poll_fd(GSource *source, gint fd, guchar events) { GPollFD *poll_fd; GList *node; RGSource *rg_source = (RGSource *)source; for (node = rg_source->old_poll_fds; node; node = g_list_next(node)) { poll_fd = node->data; if (poll_fd->fd == fd && poll_fd->events == events) { rg_source->old_poll_fds = g_list_remove_link(rg_source->old_poll_fds, node); rg_source->poll_fds = g_list_concat(rg_source->poll_fds, node); return; } } poll_fd = g_slice_new0(GPollFD); poll_fd->fd = fd; poll_fd->events = events; g_source_add_poll(source, poll_fd); rg_source->poll_fds = g_list_prepend(rg_source->poll_fds, poll_fd); } static inline void source_prepare_add_poll(GSource *source, rb_thread_t thread) { if (thread->wait_for == WAIT_FD) { /* The thread is blocked on thread->fd for read. */ source_prepare_add_poll_fd(source, thread->fd, G_IO_IN); return; } if (thread->wait_for & WAIT_SELECT) { /* thread->fd is the maximum fd of the fds in the various sets. Need to * check the sets to see which fd's to wait for */ int fd; for (fd = 0; fd < thread->fd; fd++) { gushort events = 0; if (FD_ISSET(fd, &thread->readfds)) events |= G_IO_IN; if (FD_ISSET(fd, &thread->writefds)) events |= G_IO_OUT; if (FD_ISSET(fd, &thread->exceptfds)) events |= G_IO_PRI | G_IO_ERR | G_IO_HUP; if (events != 0) source_prepare_add_poll_fd(source, fd, events); } } } static inline gboolean source_prepare_setup_poll_fd(GSource *source, gint *timeout) { RGSource *rg_source = (RGSource *)source; rb_thread_t thread; gdouble now; g_assert(rg_source->old_poll_fds == NULL); rg_source->old_poll_fds = rg_source->poll_fds; rg_source->poll_fds = NULL; now = timeofday(); thread = rb_curr_thread; do { thread = thread->next; if ((thread->wait_for == 0 && thread->status == THREAD_RUNNABLE && thread != rb_curr_thread) || (thread->wait_for & WAIT_JOIN && thread->join->status == THREAD_KILLED)) { rg_source->poll_fds = g_list_concat(rg_source->poll_fds, rg_source->old_poll_fds); rg_source->old_poll_fds = NULL; return TRUE; } if (thread->wait_for & WAIT_TIME && thread->delay != DELAY_INFTY) { gint delay; delay = (thread->delay - now) * 1000; if (delay <= 0) { rg_source->poll_fds = g_list_concat(rg_source->poll_fds, rg_source->old_poll_fds); rg_source->old_poll_fds = NULL; return TRUE; } if (*timeout == -1 || delay < *timeout) *timeout = delay; } if (thread->wait_for == WAIT_FD || thread->wait_for & WAIT_SELECT) source_prepare_add_poll(source, thread); } while (thread != rb_curr_thread); source_cleanup_poll_fds(source); return FALSE; } static gboolean source_prepare(GSource *source, gint *timeout) { RGSource *rg_source = (RGSource *)source; *timeout = -1; rg_source->ready = source_prepare_setup_poll_fd(source, timeout); return rg_source->ready; } static gboolean source_check(GSource *source) { RGSource *rg_source = (RGSource *)source; GList *node; if (rg_source->ready) return TRUE; for (node = rg_source->poll_fds; node; node = g_list_next(node)) { GPollFD *poll_fd = node->data; if (poll_fd->revents) return TRUE; } return FALSE; } static gboolean source_dispatch(G_GNUC_UNUSED GSource *source, G_GNUC_UNUSED GSourceFunc callback, G_GNUC_UNUSED gpointer user_data) { TRAP_BEG; rb_thread_schedule(); TRAP_END; return TRUE; } static void source_finalize(GSource *source) { RGSource *rg_source = (RGSource *)source; GList *node; for (node = rg_source->old_poll_fds; node; node = g_list_next(node)) { GPollFD *poll_fd = node->data; g_slice_free(GPollFD, poll_fd); } for (node = rg_source->poll_fds; node; node = g_list_next(node)) { GPollFD *poll_fd = node->data; g_slice_free(GPollFD, poll_fd); } g_list_free(rg_source->old_poll_fds); rg_source->old_poll_fds = NULL; g_list_free(rg_source->poll_fds); rg_source->poll_fds = NULL; } static GSourceFuncs source_funcs = { source_prepare, source_check, source_dispatch, source_finalize, NULL, NULL }; static GSource * ruby_source_new(void) { GSource *source; RGSource *rg_source; source = g_source_new(&source_funcs, sizeof(RGSource)); g_source_set_can_recurse(source, TRUE); rg_source = (RGSource *)source; rg_source->poll_fds = NULL; rg_source->old_poll_fds = NULL; return source; } static VALUE ruby_source_set_priority(G_GNUC_UNUSED VALUE self, VALUE priority) { GSource *ruby_source = NULL; if (ruby_source_id != 0) ruby_source = g_main_context_find_source_by_id(NULL, ruby_source_id); if (ruby_source) g_source_set_priority(ruby_source, NUM2INT(priority)); return Qnil; } #endif static VALUE source_remove(G_GNUC_UNUSED VALUE self, VALUE tag) { VALUE callback; callback = G_GET_RELATIVE(mGLibSource, id__callbacks__, tag); G_REMOVE_RELATIVE(mGLibSource, id__callbacks__, tag); g_hash_table_remove(callbacks_table, (gpointer)callback); return CBOOL2RVAL(g_source_remove(NUM2UINT(tag))); } static VALUE source_current_source(G_GNUC_UNUSED VALUE self) { return BOXED2RVAL(g_main_current_source, G_TYPE_SOURCE); } static gboolean invoke_source_func(gpointer data) { callback_info_t *info = (callback_info_t *)data; gboolean ret; ret = RVAL2CBOOL(rb_funcall(info->callback, id_call, 0)); if (!ret) G_REMOVE_RELATIVE(mGLibSource, id__callbacks__, UINT2NUM(info->id)); return ret; } /*****************************************/ #if !GLIB_CHECK_VERSION(2,30,0) GType g_main_context_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GMainContext", (GBoxedCopyFunc)g_main_context_ref, (GBoxedFreeFunc)g_main_context_unref); return our_type; } #endif /*****************************************/ #define RG_TARGET_NAMESPACE cMainContext #define _SELF(s) ((GMainContext*)RVAL2BOXED(s, G_TYPE_MAIN_CONTEXT)) static VALUE rg_initialize(VALUE self) { GMainContext *context; context = g_main_context_new(); g_main_context_set_poll_func(context, rg_poll); #ifndef HAVE_RB_THREAD_BLOCKING_REGION { GSource *source; source = ruby_source_new(); g_source_attach(source, context); g_source_unref(source); } #endif G_INITIALIZE(self, context); return Qnil; } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return BOXED2RVAL(g_main_context_default(), G_TYPE_MAIN_CONTEXT); } static VALUE rg_iteration(VALUE self, VALUE may_block) { return CBOOL2RVAL(g_main_context_iteration(_SELF(self), RVAL2CBOOL(may_block))); } static VALUE rg_pending_p(VALUE self) { return CBOOL2RVAL(g_main_context_pending(_SELF(self))); } static VALUE rg_find_source(VALUE self, VALUE source_id) { GSource* src = g_main_context_find_source_by_id(_SELF(self), NUM2UINT(source_id)); return BOXED2RVAL(src, G_TYPE_SOURCE); } /* GSource* g_main_context_find_source_by_user_data (GMainContext *context, gpointer user_data); GSource* g_main_context_find_source_by_funcs_user_data (GMainContext *context, GSourceFuncs *funcs, gpointer user_data); */ static VALUE rg_wakeup(VALUE self) { g_main_context_wakeup(_SELF(self)); return self; } static VALUE rg_acquire(VALUE self) { return CBOOL2RVAL(g_main_context_acquire(_SELF(self))); } static VALUE rg_release(VALUE self) { g_main_context_release(_SELF(self)); return self; } static VALUE rg_owner_p(VALUE self) { return CBOOL2RVAL(g_main_context_is_owner(_SELF(self))); } /* gboolean g_main_context_wait (GMainContext *context, GCond *cond, GMutex *mutex); */ static VALUE rg_prepare(VALUE self) { gint priority; gboolean ret = g_main_context_prepare(_SELF(self), &priority); return rb_assoc_new(CBOOL2RVAL(ret), INT2NUM(priority)); } struct mc_query_body_args { gint timeout_; GPollFD *fds; gint n_fds; }; static VALUE mc_query_body(VALUE value) { struct mc_query_body_args *args = (struct mc_query_body_args *)value; gint i; VALUE ary = rb_ary_new(); for (i = 0; i < args->n_fds; i++) rb_ary_push(ary, BOXED2RVAL(&args->fds[i], G_TYPE_POLL_FD)); return rb_assoc_new(INT2NUM(args->timeout_), ary); } static VALUE mc_query_ensure(VALUE value) { g_free((GPollFD *)value); return Qnil; } #define QUERY_DEFAULT_FDS 100 static VALUE rg_query(VALUE self, VALUE rbmax_priority) { GMainContext *context = _SELF(self); gint max_priority = NUM2INT(rbmax_priority); gint timeout_; GPollFD *fds; gint n_fds; struct mc_query_body_args args; fds = g_new(GPollFD, QUERY_DEFAULT_FDS); n_fds = g_main_context_query(context, max_priority, &timeout_, fds, QUERY_DEFAULT_FDS); if (n_fds > QUERY_DEFAULT_FDS) { g_free(fds); fds = g_new(GPollFD, n_fds); g_main_context_query(context, max_priority, &timeout_, fds, n_fds); } args.timeout_ = timeout_; args.fds = fds; args.n_fds = n_fds; return rb_ensure(mc_query_body, (VALUE)&args, mc_query_ensure, (VALUE)fds); } /* How can I implement this? static VALUE rg_check(VALUE self, VALUE max_priority) { gint i, timeout_; VALUE ary; GPollFD* fds; gint ret, n_fds; fds = g_new (GPollFD, 10); n_fds = g_main_context_query(_SELF(self), NUM2INT(max_priority), &timeout_, fds, 10); printf("n_fds = %d\n", n_fds); g_free(fds); fds = g_new (GPollFD, n_fds); ret = g_main_context_check(_SELF(self), NUM2INT(max_priority), fds, n_fds); printf("ret = %d\n", ret); ary = rb_ary_new(); for (i = 0; i < ret; i++) rb_ary_push(ary, BOXED2RVAL(&fds[i], G_TYPE_POLL_FD)); g_free(fds); return ary; } */ static VALUE rg_dispatch(VALUE self) { g_main_context_dispatch(_SELF(self)); return self; } /* How can I get "self" or something like it as key .... static gint poll_func(GPollFD *ufds, guint nfsd, gint timeout_) { VALUE func = rb_ivar_get(self, id_poll_func); if (NIL_P(func)) return -1; return INT2NUM(rb_funcall(func, 3, BOXED2RVAL(ufds, G_TYPE_POLL_FD), UINT2NUM(nfsd), INT2NUM(timeout_))); } static VALUE rg_set_poll_func(VALUE self) { rb_ivar_set(self, id_poll_func, rb_block_proc()); g_main_context_set_poll_func(_SELF(self), (GPollFunc)poll_func); return self; } */ /* GPollFunc g_main_context_get_poll_func (GMainContext *context); */ static VALUE rg_add_poll(VALUE self, VALUE fd, VALUE priority) { g_main_context_add_poll(_SELF(self), RVAL2BOXED(fd, G_TYPE_POLL_FD), NUM2INT(priority)); return self; } static VALUE rg_remove_poll(VALUE self, VALUE fd) { g_main_context_remove_poll(_SELF(self), RVAL2BOXED(fd, G_TYPE_POLL_FD)); return self; } #ifdef HAVE_G_MAIN_DEPTH static VALUE rg_s_depth(G_GNUC_UNUSED VALUE self) { return INT2NUM(g_main_depth()); } #endif static VALUE timeout_source_new(G_GNUC_UNUSED VALUE self, VALUE interval) { return BOXED2RVAL(g_timeout_source_new(NUM2UINT(interval)), G_TYPE_SOURCE); } #if GLIB_CHECK_VERSION(2,14,0) static VALUE timeout_source_new_seconds(G_GNUC_UNUSED VALUE self, VALUE interval) { return BOXED2RVAL(g_timeout_source_new_seconds(NUM2UINT(interval)), G_TYPE_SOURCE); } #endif static VALUE timeout_add(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE interval, rb_priority, func, rb_id; gint priority; callback_info_t *info; guint id; rb_scan_args(argc, argv, "11&", &interval, &rb_priority, &func); priority = NIL_P(rb_priority) ? G_PRIORITY_DEFAULT : NUM2INT(rb_priority); info = ALLOC(callback_info_t); info->callback = func; id = g_timeout_add_full(priority, NUM2UINT(interval), (GSourceFunc)invoke_source_func, (gpointer)info, g_free); info->id = id; rb_id = UINT2NUM(id); G_RELATIVE2(mGLibSource, func, id__callbacks__, rb_id); g_hash_table_insert(callbacks_table, (gpointer)func, info); return rb_id; } #if GLIB_CHECK_VERSION(2,14,0) static VALUE timeout_add_seconds(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE interval, rb_priority, func, rb_id; gint priority; callback_info_t *info; guint id; rb_scan_args(argc, argv, "11&", &interval, &rb_priority, &func); priority = NIL_P(rb_priority) ? G_PRIORITY_DEFAULT : NUM2INT(rb_priority); info = ALLOC(callback_info_t); info->callback = func; id = g_timeout_add_seconds_full(priority, NUM2UINT(interval), (GSourceFunc)invoke_source_func, (gpointer)info, g_free); info->id = id; rb_id = UINT2NUM(id); G_RELATIVE2(mGLibSource, func, id__callbacks__, rb_id); g_hash_table_insert(callbacks_table, (gpointer)func, info); return rb_id; } #endif static VALUE idle_source_new(G_GNUC_UNUSED VALUE self) { return BOXED2RVAL(g_idle_source_new(), G_TYPE_SOURCE); } static VALUE idle_add(gint argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE arg1, arg2, func, rb_id; callback_info_t *info; guint id; gint priority = G_PRIORITY_DEFAULT_IDLE; rb_scan_args(argc, argv, "02", &arg1, &arg2); if (RVAL2CBOOL(rb_obj_is_kind_of(arg1, rb_cProc))) { func = arg1; } else if (RVAL2CBOOL(rb_obj_is_kind_of(arg1, rb_cInteger))) { priority = NUM2INT(arg1); func = rb_block_proc(); } else { func = rb_block_proc(); } info = ALLOC(callback_info_t); info->callback = func; id = g_idle_add_full(priority, (GSourceFunc)invoke_source_func, (gpointer)info, g_free); info->id = id; rb_id = UINT2NUM(id); G_RELATIVE2(mGLibSource, func, id__callbacks__, rb_id); g_hash_table_insert(callbacks_table, (gpointer)func, info); return rb_id; } static VALUE idle_remove(G_GNUC_UNUSED VALUE self, VALUE func) { callback_info_t *info; info = g_hash_table_lookup(callbacks_table, (gpointer)func); G_REMOVE_RELATIVE(mGLibSource, id__callbacks__, UINT2NUM(info->id)); g_hash_table_remove(callbacks_table, (gpointer)func); return CBOOL2RVAL(g_idle_remove_by_data((gpointer)info)); } static VALUE child_watch_source_new(G_GNUC_UNUSED VALUE self, VALUE pid) { return BOXED2RVAL(g_child_watch_source_new((GPid)NUM2INT(pid)), G_TYPE_SOURCE); } static void child_watch_func(GPid pid, gint status, gpointer func) { rb_funcall((VALUE)func, id_call, 2, INT2NUM((long)pid), INT2NUM(status)); } static VALUE child_watch_add(VALUE self, VALUE pid) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); return UINT2NUM(g_child_watch_add((GPid)NUM2INT(pid), (GChildWatchFunc)child_watch_func, (gpointer)func)); } #ifndef HAVE_RB_THREAD_BLOCKING_REGION static void ruby_source_remove(G_GNUC_UNUSED VALUE data) { if (ruby_source_id != 0) { g_source_remove(ruby_source_id); ruby_source_id = 0; } } #endif void Init_glib_main_context(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MAIN_CONTEXT, "MainContext", mGLib); VALUE timeout = rb_define_module_under(mGLib, "Timeout"); VALUE idle = rb_define_module_under(mGLib, "Idle"); VALUE child_watch = rb_define_module_under(mGLib, "ChildWatch"); id_call = rb_intern("call"); id__callbacks__ = rb_intern("__callbacks__"); callbacks_table = g_hash_table_new(NULL, NULL); rbg_define_singleton_method(mGLib, "set_ruby_thread_priority", ruby_source_set_priority, 1); mGLibSource = rb_const_get(mGLib, rb_intern("Source")); rbg_define_singleton_method(mGLibSource, "remove", source_remove, 1); rbg_define_singleton_method(mGLibSource, "current", source_current_source, 0); /* id_poll_func = rb_intern("__poll_func__"); */ RG_DEF_METHOD(initialize, 0); RG_DEF_SMETHOD(default, 0); RG_DEF_METHOD(iteration, 1); RG_DEF_METHOD_P(pending, 0); RG_DEF_METHOD(find_source, 1); RG_DEF_METHOD(wakeup, 0); RG_DEF_METHOD(acquire, 0); RG_DEF_METHOD(release, 0); RG_DEF_METHOD_P(owner, 0); RG_DEF_METHOD(prepare, 0); RG_DEF_METHOD(query, 1); /* RG_DEF_METHOD(check, 1); */ RG_DEF_METHOD(dispatch, 0); /* RG_DEF_METHOD(set_poll_func, 0); */ RG_DEF_METHOD(add_poll, 2); RG_DEF_METHOD(remove_poll, 1); #ifdef HAVE_G_MAIN_DEPTH RG_DEF_SMETHOD(depth, 0); #endif rbg_define_singleton_method(timeout, "source_new", timeout_source_new, 1); #if GLIB_CHECK_VERSION(2,14,0) rbg_define_singleton_method(timeout, "source_new_seconds", timeout_source_new_seconds, 1); #endif rbg_define_singleton_method(timeout, "add", timeout_add, -1); #if GLIB_CHECK_VERSION(2,14,0) rbg_define_singleton_method(timeout, "add_seconds", timeout_add_seconds, -1); #endif rbg_define_singleton_method(idle, "source_new", idle_source_new, 0); rbg_define_singleton_method(idle, "add", idle_add, -1); rbg_define_singleton_method(idle, "remove", idle_remove, 1); rbg_define_singleton_method(child_watch, "source_new", child_watch_source_new, 1); rbg_define_singleton_method(child_watch, "add", child_watch_add, 1); default_poll_func = g_main_context_get_poll_func(NULL); g_main_context_set_poll_func(NULL, rg_poll); rb_set_end_proc(restore_poll_func, Qnil); #ifndef HAVE_RB_THREAD_BLOCKING_REGION { GSource *source; source = ruby_source_new(); g_source_set_priority(source, G_PRIORITY_DEFAULT_IDLE); ruby_source_id = g_source_attach(source, NULL); g_source_unref(source); rb_set_end_proc(ruby_source_remove, Qnil); } #endif } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_utf16.c0000664000175000017500000000422011740310343020030 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #define RG_TARGET_NAMESPACE mUTF16 static VALUE rg_s_to_ucs4(G_GNUC_UNUSED VALUE self, VALUE rb_utf16) { VALUE result; gunichar *ucs4; gunichar2 *utf16; glong len, items_written; GError *error = NULL; utf16 = (gunichar2 *)StringValueCStr(rb_utf16); len = RSTRING_LEN(rb_utf16) / sizeof(*utf16); ucs4 = g_utf16_to_ucs4(utf16, len, NULL, &items_written, &error); if (error) RAISE_GERROR(error); result = CSTR2RVAL_LEN_UCS4((char *)ucs4, items_written * sizeof(*ucs4)); g_free(ucs4); return result; } static VALUE rg_s_to_utf8(G_GNUC_UNUSED VALUE self, VALUE rb_utf16) { VALUE result; gchar *utf8; gunichar2 *utf16; glong len, items_written; GError *error = NULL; utf16 = (gunichar2 *)StringValueCStr(rb_utf16); len = RSTRING_LEN(rb_utf16) / sizeof(*utf16); utf8 = g_utf16_to_utf8(utf16, len, NULL, &items_written, &error); if (error) RAISE_GERROR(error); result = CSTR2RVAL_LEN(utf8, items_written * sizeof(*utf8)); g_free(utf8); return result; } void Init_glib_utf16(void) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "UTF16"); RG_DEF_SMETHOD(to_ucs4, 1); RG_DEF_SMETHOD(to_utf8, 1); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_gettext.c0000644000175000017500000000303512257552167020570 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #include #define RG_TARGET_NAMESPACE mGetText static VALUE rg_s_bindtextdomain(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE domain_name; VALUE directory; const char *current_directory = NULL; rb_scan_args(argc, argv, "11", &domain_name, &directory); current_directory = bindtextdomain(RVAL2CSTR(domain_name), RVAL2CSTR_ACCEPT_NIL(directory)); return CSTR2RVAL(current_directory); } void Init_glib_gettext(void) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "GetText"); RG_DEF_SMETHOD(bindtextdomain, -1); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_object.c0000644000175000017500000005703612257552167020370 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 2002-2003 Masahiro Sakai * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE rbgobj_cObject VALUE RG_TARGET_NAMESPACE; static VALUE eNoPropertyError; static GQuark RUBY_GOBJECT_OBJ_KEY; /* deperecated */ void rbgobj_add_abstract_but_create_instance_class(G_GNUC_UNUSED GType gtype) { } static void weak_notify(gpointer data, G_GNUC_UNUSED GObject *where_the_object_was) { gobj_holder *holder = data; rbgobj_instance_call_cinfo_free(holder->gobj); rbgobj_invalidate_relatives(holder->self); holder->destroyed = TRUE; g_object_unref(holder->gobj); holder->gobj = NULL; } static void holder_mark(gobj_holder *holder) { if (holder->gobj && !holder->destroyed) rbgobj_instance_call_cinfo_mark(holder->gobj); } static void holder_free(gobj_holder *holder) { if (holder->gobj) { if (!holder->destroyed) { g_object_set_qdata(holder->gobj, RUBY_GOBJECT_OBJ_KEY, NULL); g_object_weak_unref(holder->gobj, (GWeakNotify)weak_notify, holder); weak_notify(holder, holder->gobj); } holder->gobj = NULL; } xfree(holder); } static VALUE gobj_s_allocate(VALUE klass) { gobj_holder* holder; VALUE result; result = Data_Make_Struct(klass, gobj_holder, holder_mark, holder_free, holder); holder->self = result; holder->gobj = NULL; holder->cinfo = NULL; holder->destroyed = FALSE; return result; } /* deprecated */ VALUE rbgobj_create_object(VALUE klass) { return gobj_s_allocate(klass); } void rbgobj_gobject_initialize(VALUE obj, gpointer cobj) { gobj_holder* holder = g_object_get_qdata((GObject*)cobj, RUBY_GOBJECT_OBJ_KEY); if (holder) rb_raise(rb_eRuntimeError, "ruby wrapper for this GObject* already exists."); Data_Get_Struct(obj, gobj_holder, holder); holder->cinfo = RVAL2CINFO(obj); holder->gobj = (GObject*)cobj; holder->destroyed = FALSE; g_object_set_qdata((GObject*)cobj, RUBY_GOBJECT_OBJ_KEY, (gpointer)holder); g_object_weak_ref((GObject*)cobj, (GWeakNotify)weak_notify, holder); { GType t1 = G_TYPE_FROM_INSTANCE(cobj); GType t2 = CLASS2GTYPE(CLASS_OF(obj)); if (t1 != t2) { if (!g_type_is_a(t1, t2)) rb_raise(rb_eTypeError, "%s is not subtype of %s", g_type_name(t1), g_type_name(t2)); } } } VALUE rbgobj_get_ruby_object_from_gobject(GObject* gobj, gboolean alloc) { gobj_holder *holder; holder = g_object_get_qdata(gobj, RUBY_GOBJECT_OBJ_KEY); if (holder) { return holder->self; } else if (alloc) { VALUE obj; obj = gobj_s_allocate(GTYPE2CLASS(G_OBJECT_TYPE(gobj))); gobj = g_object_ref(gobj); rbgobj_gobject_initialize(obj, (gpointer)gobj); return obj; } else { return Qnil; } } GObject* rbgobj_get_gobject(VALUE obj) { gobj_holder* holder; if (!RVAL2CBOOL(rb_obj_is_kind_of(obj, GTYPE2CLASS(G_TYPE_OBJECT)))) rb_raise(rb_eTypeError, "not a GLib::Object"); Data_Get_Struct(obj, gobj_holder, holder); if (holder->destroyed) rb_raise(rb_eTypeError, "destroyed GLib::Object"); if (!holder->gobj) rb_raise(rb_eTypeError, "uninitialize GLib::Object"); return holder->gobj; } void rbgobj_init_object_class(VALUE klass) { rbgobj_define_property_accessors(klass); } /**********************************************************************/ static gboolean is_gtkobject(GObject *gobj) { static GType gtype_gtkobject = G_TYPE_INVALID; if (!gtype_gtkobject) gtype_gtkobject = g_type_from_name("GtkObject"); return gtype_gtkobject && g_type_is_a(G_OBJECT_TYPE(gobj), gtype_gtkobject); } static void gobj_mark(gpointer ptr) { GObject* gobj = ptr; guint n_properties; GParamSpec** properties; GValue gval = G_VALUE_INIT; guint i; properties = g_object_class_list_properties(G_OBJECT_GET_CLASS(gobj), &n_properties); for (i = 0; i < n_properties; i++) { GParamSpec* pspec = properties[i]; GType value_type = G_PARAM_SPEC_VALUE_TYPE(pspec); if (G_TYPE_FUNDAMENTAL(value_type) != G_TYPE_OBJECT) continue; if (!(pspec->flags & G_PARAM_READABLE)) continue; /* FIXME: exclude types that doesn't have identity. */ { g_value_init(&gval, value_type); g_object_get_property(gobj, pspec->name, &gval); rbgobj_gc_mark_gvalue(&gval); g_value_unset(&gval); } } g_free(properties); } static VALUE rg_s_new_bang(int argc, VALUE *argv, VALUE self) { const RGObjClassInfo* cinfo = rbgobj_lookup_class(self); VALUE params_hash; GObject* gobj; VALUE result; rb_scan_args(argc, argv, "01", ¶ms_hash); if (!NIL_P(params_hash)) Check_Type(params_hash, RUBY_T_HASH); if (cinfo->klass != self) rb_raise(rb_eTypeError, "%s isn't registered class", rb_class2name(self)); gobj = rbgobj_gobject_new(cinfo->gtype, params_hash); result = GOBJ2RVAL(gobj); // XXX: Ughhhhh if (is_gtkobject(gobj)){ // We can't call gtk_object_sink() here. // But hopefully someone will call it in the future. //gtk_object_sink(gobj); } else { g_object_unref(gobj); } return result; } struct param_setup_arg { GObjectClass* gclass; GParameter* params; guint param_size; VALUE params_hash; guint index; }; static VALUE _params_setup(VALUE arg, struct param_setup_arg *param_setup_arg) { guint index; VALUE name, val; GParamSpec* pspec; index = param_setup_arg->index; if (index >= param_setup_arg->param_size) rb_raise(rb_eArgError, "too many parameters"); name = rb_ary_entry(arg, 0); val = rb_ary_entry(arg, 1); if (SYMBOL_P(name)) param_setup_arg->params[index].name = rb_id2name(SYM2ID(name)); else param_setup_arg->params[index].name = StringValuePtr(name); pspec = g_object_class_find_property( param_setup_arg->gclass, param_setup_arg->params[index].name); if (!pspec) rb_raise(rb_eArgError, "No such property: %s", param_setup_arg->params[index].name); g_value_init(&(param_setup_arg->params[index].value), G_PARAM_SPEC_VALUE_TYPE(pspec)); rbgobj_rvalue_to_gvalue(val, &(param_setup_arg->params[index].value)); param_setup_arg->index++; return Qnil; } static VALUE gobj_new_body(struct param_setup_arg* arg) { rb_iterate(rb_each, (VALUE)arg->params_hash, _params_setup, (VALUE)arg); return (VALUE)g_object_newv(G_TYPE_FROM_CLASS(arg->gclass), arg->param_size, arg->params); } static VALUE gobj_new_ensure(struct param_setup_arg* arg) { guint i; g_type_class_unref(arg->gclass); for (i = 0; i < arg->param_size; i++) { if (G_IS_VALUE(&arg->params[i].value)) g_value_unset(&arg->params[i].value); } return Qnil; } GObject* rbgobj_gobject_new(GType gtype, VALUE params_hash) { GObject* result; if (!g_type_is_a(gtype, G_TYPE_OBJECT)) rb_raise(rb_eArgError, "type \"%s\" is not descendant of GObject", g_type_name(gtype)); if (NIL_P(params_hash)) { result = g_object_newv(gtype, 0, NULL); } else { size_t param_size; struct param_setup_arg arg; param_size = NUM2INT(rb_funcall(params_hash, rb_intern("length"), 0)); arg.param_size = param_size; arg.gclass = G_OBJECT_CLASS(g_type_class_ref(gtype)); arg.params = ALLOCA_N(GParameter, param_size); memset(arg.params, 0, sizeof(GParameter) * param_size); arg.params_hash = params_hash; arg.index = 0; result = (GObject*)rb_ensure(&gobj_new_body, (VALUE)&arg, &gobj_new_ensure, (VALUE)&arg); } if (!result) rb_raise(rb_eRuntimeError, "g_object_newv failed"); return result; } static VALUE rg_s_install_property(int argc, VALUE* argv, VALUE self) { const RGObjClassInfo* cinfo = rbgobj_lookup_class(self); gpointer gclass; GParamSpec* pspec; VALUE pspec_obj, prop_id; if (cinfo->klass != self) rb_raise(rb_eTypeError, "%s isn't registered class", rb_class2name(self)); rb_scan_args(argc, argv, "11", &pspec_obj, &prop_id); pspec = G_PARAM_SPEC(RVAL2GOBJ(pspec_obj)); gclass = g_type_class_ref(cinfo->gtype); g_object_class_install_property(gclass, NIL_P(prop_id) ? 1 : NUM2UINT(prop_id), pspec); g_type_class_unref(gclass); /* FIXME: define accessor methods */ return Qnil; } static VALUE gobj_s_property(VALUE self, VALUE property_name) { GObjectClass* oclass; const char* name; GParamSpec* prop; VALUE result; if (SYMBOL_P(property_name)) name = rb_id2name(SYM2ID(property_name)); else name = StringValuePtr(property_name); oclass = g_type_class_ref(CLASS2GTYPE(self)); prop = g_object_class_find_property(oclass, name); if (!prop){ g_type_class_unref(oclass); rb_raise(eNoPropertyError, "No such property: %s", name); } result = GOBJ2RVAL(prop); g_type_class_unref(oclass); return result; } static VALUE gobj_s_properties(int argc, VALUE* argv, VALUE self) { GObjectClass* oclass = g_type_class_ref(CLASS2GTYPE(self)); guint n_properties; GParamSpec** props; VALUE inherited_too; VALUE ary; guint i; if (rb_scan_args(argc, argv, "01", &inherited_too) == 0) inherited_too = Qtrue; props = g_object_class_list_properties(oclass, &n_properties); ary = rb_ary_new(); for (i = 0; i < n_properties; i++){ if (RVAL2CBOOL(inherited_too) || GTYPE2CLASS(props[i]->owner_type) == self) rb_ary_push(ary, rb_str_new2(props[i]->name)); } g_free(props); g_type_class_unref(oclass); return ary; } static VALUE type_to_prop_setter_table; static VALUE type_to_prop_getter_table; void rbgobj_register_property_setter(GType gtype, const char *name, RValueToGValueFunc func) { GObjectClass* oclass; GParamSpec* pspec; VALUE table = rb_hash_aref(type_to_prop_setter_table, INT2FIX(gtype)); if (NIL_P(table)){ table = rb_hash_new(); rb_hash_aset(type_to_prop_setter_table, INT2FIX(gtype), table); } oclass = g_type_class_ref(gtype); pspec = g_object_class_find_property(oclass, name); rb_hash_aset(table, CSTR2RVAL(g_param_spec_get_name(pspec)), Data_Wrap_Struct(rb_cData, NULL, NULL, func)); g_type_class_unref(oclass); } void rbgobj_register_property_getter(GType gtype, const char *name, GValueToRValueFunc func) { GObjectClass* oclass; GParamSpec* pspec; VALUE table = rb_hash_aref(type_to_prop_getter_table, INT2FIX(gtype)); if (NIL_P(table)){ table = rb_hash_new(); rb_hash_aset(type_to_prop_getter_table, INT2FIX(gtype), table); } oclass = g_type_class_ref(gtype); pspec = g_object_class_find_property(oclass, name); rb_hash_aset(table, CSTR2RVAL(g_param_spec_get_name(pspec)), Data_Wrap_Struct(rb_cData, NULL, NULL, func)); g_type_class_unref(oclass); } static VALUE rg_set_property(VALUE self, VALUE prop_name, VALUE val) { GParamSpec* pspec; const char* name; if (SYMBOL_P(prop_name)) name = rb_id2name(SYM2ID(prop_name)); else name = StringValuePtr(prop_name); pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(RVAL2GOBJ(self)), name); if (!pspec) rb_raise(eNoPropertyError, "No such property: %s", name); else { // FIXME: use rb_ensure to call g_value_unset() RValueToGValueFunc setter = NULL; GValue gval = G_VALUE_INIT; g_value_init(&gval, G_PARAM_SPEC_VALUE_TYPE(pspec)); { VALUE table = rb_hash_aref(type_to_prop_setter_table, INT2FIX(pspec->owner_type)); if (!NIL_P(table)){ VALUE obj = rb_hash_aref(table, CSTR2RVAL(g_param_spec_get_name(pspec))); if (!NIL_P(obj)) Data_Get_Struct(obj, void, setter); } } if (setter) { setter(val, &gval); } else { rbgobj_rvalue_to_gvalue(val, &gval); } g_object_set_property(RVAL2GOBJ(self), name, &gval); g_value_unset(&gval); G_CHILD_SET(self, rb_intern(name), val); return self; } } static VALUE rg_get_property(VALUE self, VALUE prop_name) { GParamSpec* pspec; const char* name; if (SYMBOL_P(prop_name)) name = rb_id2name(SYM2ID(prop_name)); else name = StringValuePtr(prop_name); pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(RVAL2GOBJ(self)), name); if (!pspec) rb_raise(eNoPropertyError, "No such property: %s", name); else { // FIXME: use rb_ensure to call g_value_unset() GValueToRValueFunc getter = NULL; GValue gval = G_VALUE_INIT; VALUE ret; { VALUE table = rb_hash_aref(type_to_prop_getter_table, INT2FIX(pspec->owner_type)); if (!NIL_P(table)){ VALUE obj = rb_hash_aref(table, CSTR2RVAL(g_param_spec_get_name(pspec))); if (!NIL_P(obj)) Data_Get_Struct(obj, void, getter); } } g_value_init(&gval, G_PARAM_SPEC_VALUE_TYPE(pspec)); g_object_get_property(RVAL2GOBJ(self), name, &gval); ret = getter ? getter(&gval) : GVAL2RVAL(&gval); g_value_unset(&gval); G_CHILD_SET(self, rb_intern(name), ret); return ret; } } static VALUE rg_thaw_notify(VALUE self); static VALUE rg_freeze_notify(VALUE self) { g_object_freeze_notify(RVAL2GOBJ(self)); if (rb_block_given_p()) { return rb_ensure(rb_yield, self, rg_thaw_notify, self); } return self; } static VALUE rg_notify(VALUE self, VALUE property_name) { g_object_notify(RVAL2GOBJ(self), StringValuePtr(property_name)); return self; } static VALUE rg_thaw_notify(VALUE self) { g_object_thaw_notify(RVAL2GOBJ(self)); return self; } static VALUE rg_destroyed_p(VALUE self) { gobj_holder* holder; if (!RVAL2CBOOL(rb_obj_is_kind_of(self, GTYPE2CLASS(G_TYPE_OBJECT)))) rb_raise(rb_eTypeError, "not a GLib::Object"); Data_Get_Struct(self, gobj_holder, holder); return CBOOL2RVAL(holder->destroyed); } static VALUE rg_inspect(VALUE self) { gobj_holder* holder; const char *class_name; char *s; VALUE result; Data_Get_Struct(self, gobj_holder, holder); class_name = rb_class2name(CLASS_OF(self)); if (!holder->destroyed) s = g_strdup_printf("#<%s:%p ptr=%p>", class_name, (void *)self, holder->gobj); else s = g_strdup_printf("#<%s:%p destroyed>", class_name, (void *)self); result = rb_str_new2(s); g_free(s); return result; } static VALUE rg_type_name(VALUE self) { return CSTR2RVAL(G_OBJECT_TYPE_NAME(RVAL2GOBJ(self))); } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GType gtype; VALUE params_hash; GObject* gobj; gtype = CLASS2GTYPE(CLASS_OF(self)); if (G_TYPE_IS_ABSTRACT(gtype)) { rb_raise(rb_eTypeError, "initializing abstract class: %s", RBG_INSPECT(CLASS_OF(self))); } rb_scan_args(argc, argv, "01", ¶ms_hash); if (!NIL_P(params_hash)) Check_Type(params_hash, RUBY_T_HASH); gobj = rbgobj_gobject_new(RVAL2GTYPE(self), params_hash); if (is_gtkobject(gobj)){ gobj = g_object_ref(gobj); // We can't call gtk_object_sink() here. // But hopefully someone will call it in the future. //gtk_object_sink(gobj); } G_INITIALIZE(self, gobj); return Qnil; } static VALUE gobj_ref_count(VALUE self) { gobj_holder* holder; Data_Get_Struct(self, gobj_holder, holder); return INT2NUM(holder->gobj ? holder->gobj->ref_count : 0); } /**********************************************************************/ static VALUE proc_mod_eval; static GQuark q_ruby_setter; static GQuark q_ruby_getter; // FIXME: use rb_protect static void get_prop_func(GObject* object, G_GNUC_UNUSED guint property_id, GValue* value, GParamSpec* pspec) { ID ruby_getter = (ID)g_param_spec_get_qdata(pspec, q_ruby_getter); if (!ruby_getter) { gchar* name = g_strdup(g_param_spec_get_name(pspec)); gchar* p; for (p = name; *p; p++) { if (*p == '-') *p = '_'; } ruby_getter = rb_intern(name); g_param_spec_set_qdata(pspec, q_ruby_getter, (gpointer)ruby_getter); g_free(name); } { VALUE ret = rb_funcall(GOBJ2RVAL(object), ruby_getter, 0); rbgobj_rvalue_to_gvalue(ret, value); } } // FIXME: use rb_protect static void set_prop_func(GObject* object, G_GNUC_UNUSED guint property_id, const GValue* value, GParamSpec* pspec) { ID ruby_setter = (ID)g_param_spec_get_qdata(pspec, q_ruby_setter); if (!ruby_setter) { gchar* name = g_strconcat(g_param_spec_get_name(pspec), "=", NULL); gchar* p; for (p = name; *p; p++) { if (*p == '-') *p = '_'; } ruby_setter = rb_intern(name); g_param_spec_set_qdata(pspec, q_ruby_setter, (gpointer)ruby_setter); g_free(name); } rb_funcall(GOBJ2RVAL(object), ruby_setter, 1, GVAL2RVAL(value)); } // FIXME: use rb_protect static void class_init_func(gpointer g_class_, G_GNUC_UNUSED gpointer class_data) { GObjectClass* g_class = G_OBJECT_CLASS(g_class_); g_class->set_property = set_prop_func; g_class->get_property = get_prop_func; #if 0 VALUE class_init_proc = (VALUE)class_data; rb_funcall(proc_mod_eval, rb_intern("call"), 2, GTYPE2CLASS(G_TYPE_FROM_CLASS(g_class)), class_init_proc); #endif } static VALUE rg_s_type_register(int argc, VALUE* argv, VALUE self) { VALUE type_name, flags; volatile VALUE class_init_proc = Qnil; GType parent_type; GTypeInfo* info; rb_scan_args(argc, argv, "03", &type_name, &info, &flags); { const RGObjClassInfo* cinfo = rbgobj_lookup_class(self); if (cinfo->klass == self) rb_raise(rb_eTypeError, "already registered"); } { VALUE superclass = rb_funcall(self, rb_intern("superclass"), 0); const RGObjClassInfo* cinfo = rbgobj_lookup_class(superclass); if (cinfo->klass != superclass) rb_raise(rb_eTypeError, "super class must be registered to GLib"); parent_type = cinfo->gtype; } if (NIL_P(type_name)) { VALUE s = rb_funcall(self, rb_intern("name"), 0); if (strlen(StringValuePtr(s)) == 0) rb_raise(rb_eTypeError, "can't determine type name"); type_name = rb_funcall( rb_eval_string("lambda{|x| x.gsub(/::/,'') }"), rb_intern("call"), 1, s); } { GTypeQuery query; g_type_query(parent_type, &query); /* TODO: Why new? g_type_register_static() doesn’t retain a copy, so * this should be allocated on the stack. */ info = g_new0(GTypeInfo, 1); info->class_size = query.class_size; info->base_init = NULL; info->base_finalize = NULL; info->class_init = class_init_func; info->class_finalize = NULL; info->class_data = (gpointer)class_init_proc; info->instance_size = query.instance_size; info->n_preallocs = 0; info->instance_init = NULL; info->value_table = NULL; } { GType type = g_type_register_static(parent_type, StringValuePtr(type_name), info, NIL_P(flags) ? 0 : NUM2INT(flags)); G_RELATIVE(self, class_init_proc); rbgobj_register_class(self, type, TRUE, TRUE); { RGObjClassInfo* cinfo = (RGObjClassInfo*)rbgobj_lookup_class(self); cinfo->flags |= RBGOBJ_DEFINED_BY_RUBY; } { GType parent = g_type_parent(type); const RGObjClassInfo* cinfo = GTYPE2CINFO(parent); VALUE m = rb_define_module_under(self, RubyGObjectHookModule); if (! (cinfo->flags & RBGOBJ_DEFINED_BY_RUBY)) { rbg_define_method(m, "initialize", rg_initialize, -1); } rb_include_module(self, m); } return Qnil; } } /**********************************************************************/ void Init_gobject_gobject(void) { RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_GC_FUNC(G_TYPE_OBJECT, "Object", mGLib, gobj_mark, NULL); #ifdef G_TYPE_INITIALLY_UNOWNED G_DEF_CLASS(G_TYPE_INITIALLY_UNOWNED, "InitiallyUnowned", mGLib); #endif RUBY_GOBJECT_OBJ_KEY = g_quark_from_static_string("__ruby_gobject_object__"); rb_define_alloc_func(RG_TARGET_NAMESPACE, (VALUE(*)_((VALUE)))gobj_s_allocate); RG_DEF_SMETHOD_BANG(new, -1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "property", &gobj_s_property, 1); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "properties", &gobj_s_properties, -1); RG_DEF_SMETHOD(install_property, -1); q_ruby_getter = g_quark_from_static_string("__ruby_getter"); q_ruby_setter = g_quark_from_static_string("__ruby_setter"); RG_DEF_METHOD(set_property, 2); RG_DEF_METHOD(get_property, 1); RG_DEF_METHOD(freeze_notify, 0); rb_undef_method(RG_TARGET_NAMESPACE, "notify"); RG_DEF_METHOD(notify, 1); RG_DEF_METHOD(thaw_notify, 0); RG_DEF_METHOD_P(destroyed, 0); RG_DEF_METHOD(initialize, -1); rbg_define_method(RG_TARGET_NAMESPACE, "ref_count", gobj_ref_count, 0); /* for debugging */ RG_DEF_METHOD(inspect, 0); RG_DEF_METHOD(type_name, 0); eNoPropertyError = rb_define_class_under(mGLib, "NoPropertyError", rb_eNameError); rb_global_variable(&type_to_prop_setter_table); rb_global_variable(&type_to_prop_getter_table); type_to_prop_setter_table = rb_hash_new(); type_to_prop_getter_table = rb_hash_new(); /* subclass */ RG_DEF_SMETHOD(type_register, -1); rb_global_variable(&proc_mod_eval); proc_mod_eval = rb_eval_string("lambda{|obj,proc| obj.module_eval(&proc)}"); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_typeinstance.c0000644000175000017500000000715711701304107021605 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE cInstantiatable VALUE RG_TARGET_NAMESPACE; typedef void (*ClassInfoCallbackFunc) (gpointer instance, const RGObjClassInfo *class_info, gpointer user_data); static G_GNUC_NORETURN VALUE instantiatable_s_allocate(G_GNUC_UNUSED VALUE klass) { rb_raise(rb_eTypeError, "abstract class"); } static VALUE rg_gtype(VALUE self) { return rbgobj_gtype_new(G_TYPE_FROM_INSTANCE(rbgobj_instance_from_ruby_object(self))); } static G_GNUC_NORETURN VALUE rg_clone(VALUE self) { rb_raise(rb_eTypeError, "can't clone %s", rb_class2name(CLASS_OF(self))); } /**********************************************************************/ static void each_cinfo(gpointer instance, ClassInfoCallbackFunc func, gpointer user_data) { const GType gtype = G_TYPE_FROM_INSTANCE(instance); GType* interfaces; guint n_interfaces = 0; interfaces = g_type_interfaces(gtype, &n_interfaces); { guint i; for (i = 0; i < n_interfaces; i++) { const RGObjClassInfo *info; info = GTYPE2CINFO_NO_CREATE(interfaces[i]); if (info) func(instance, info, user_data); } } g_free(interfaces); { GType type; for (type = gtype; type != G_TYPE_INVALID; type = g_type_parent(type)) { const RGObjClassInfo *info; info = GTYPE2CINFO_NO_CREATE(type); if (info) func(instance, info, user_data); } } } static void call_cinfo_free(gpointer instance, const RGObjClassInfo *cinfo, G_GNUC_UNUSED gpointer user_data) { if (cinfo->free) cinfo->free(instance); } static void call_cinfo_mark(gpointer instance, const RGObjClassInfo *cinfo, G_GNUC_UNUSED gpointer user_data) { if (cinfo->mark) cinfo->mark(instance); } void rbgobj_instance_call_cinfo_mark(gpointer instance) { each_cinfo(instance, call_cinfo_mark, NULL); } void rbgobj_instance_call_cinfo_free(gpointer instance) { each_cinfo(instance, call_cinfo_free, NULL); } void rbgobj_gc_mark_instance(gpointer instance) { VALUE obj = rbgobj_ruby_object_from_instance2(instance, FALSE); rb_gc_mark(obj); } /**********************************************************************/ void Init_gobject_typeinstance(void) { /* should be renamed to GLib::Instance? */ RG_TARGET_NAMESPACE = rb_define_class_under(mGLib, "Instantiatable", rb_cObject); rb_extend_object(RG_TARGET_NAMESPACE, mMetaInterface); rb_define_alloc_func(RG_TARGET_NAMESPACE, (VALUE(*)_((VALUE)))instantiatable_s_allocate); RG_DEF_METHOD(gtype, 0); RG_DEF_METHOD(clone, 0); }ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_error.c0000644000175000017500000000613512257552167020241 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include static ID id_code; static ID id_domain; static VALUE gerror_table; static VALUE generic_error; VALUE rbgerr_gerror2exception(GError *error) { VALUE exc = Qnil; VALUE exception_klass = Qnil; if (!error) { return rb_exc_new2(rb_eRuntimeError, "GError parameter doesn't have a value."); } exception_klass = rb_hash_aref(gerror_table, UINT2NUM(error->domain)); if (NIL_P(exception_klass)) { exception_klass = generic_error; } exc = rb_exc_new_str(exception_klass, CSTR2RVAL(error->message)); rb_ivar_set(exc, id_domain, CSTR2RVAL(g_quark_to_string(error->domain))); rb_ivar_set(exc, id_code, INT2NUM(error->code)); g_error_free(error); return exc; } VALUE rbgerr_define_gerror(GQuark domain, const gchar *name, VALUE module, VALUE parent, VALUE gtype) { VALUE klass = rb_define_class_under(module, name, parent); rb_funcall(klass, rbgutil_id_module_eval, 1, CSTR2RVAL("def code; @code; end\n")); rb_funcall(klass, rbgutil_id_module_eval, 1, CSTR2RVAL("def domain; @domain; end\n")); rb_hash_aset(gerror_table, UINT2NUM(domain), klass); if (! NIL_P(gtype)){ GEnumClass* gclass = g_type_class_ref(gtype); guint i; for (i = 0; i < gclass->n_values; i++) { GEnumValue* entry = &(gclass->values[i]); gchar* nick = g_strdup(entry->value_nick); gchar* p; for (p = nick; *p; p++) { if (*p == '-') *p = '_'; else *p = g_ascii_toupper(*p); } rbgobj_define_const(klass, nick, INT2NUM(i)); g_free(nick); } g_type_class_unref(gclass); } return klass; } void Init_glib_error(void) { id_code = rb_intern("@code"); id_domain = rb_intern("@domain"); gerror_table = rb_hash_new(); rb_global_variable(&gerror_table); generic_error = rb_define_class_under(mGLib, "Error", rb_eRuntimeError); rb_funcall(generic_error, rbgutil_id_module_eval, 1, CSTR2RVAL("def code; @code; end\n")); rb_funcall(generic_error, rbgutil_id_module_eval, 1, CSTR2RVAL("def domain; @domain; end\n")); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_paramspecs.c0000664000175000017500000003123511740310343021233 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define DEF_NUMERIC_PSPEC_METHODS_FUNC(pspec_type, typename, from_ruby, to_ruby, pspec_cast) \ static VALUE \ typename##_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, \ VALUE minimum, VALUE maximum, VALUE default_value, \ VALUE flags) \ { \ GParamSpec* pspec; \ pspec = g_param_spec_##typename(StringValuePtr(name), \ StringValuePtr(nick), \ StringValuePtr(blurb), \ from_ruby(minimum), \ from_ruby(maximum), \ from_ruby(default_value), \ NUM2UINT(flags)); \ rbgobj_param_spec_initialize(self, pspec); \ return Qnil; \ } \ \ static VALUE \ typename##_minimum(VALUE self) \ { \ return to_ruby(pspec_cast(RVAL2GOBJ(self))->minimum); \ } \ \ static VALUE \ typename##_maximum(VALUE self) \ { \ return to_ruby(pspec_cast(RVAL2GOBJ(self))->maximum); \ } \ \ static VALUE \ typename##_range(VALUE self) \ { \ pspec_type* pspec = pspec_cast(RVAL2GOBJ(self)); \ return rb_range_new(pspec->minimum, pspec->maximum, 0); \ } DEF_NUMERIC_PSPEC_METHODS_FUNC(GParamSpecChar, char, NUM2INT, INT2FIX, G_PARAM_SPEC_CHAR) DEF_NUMERIC_PSPEC_METHODS_FUNC(GParamSpecUChar, uchar, NUM2UINT, INT2FIX, G_PARAM_SPEC_UCHAR) DEF_NUMERIC_PSPEC_METHODS_FUNC(GParamSpecInt, int, NUM2INT, INT2NUM, G_PARAM_SPEC_INT) DEF_NUMERIC_PSPEC_METHODS_FUNC(GParamSpecUInt, uint, NUM2UINT, UINT2NUM, G_PARAM_SPEC_UINT) DEF_NUMERIC_PSPEC_METHODS_FUNC(GParamSpecLong, long, NUM2LONG, INT2NUM, G_PARAM_SPEC_LONG) DEF_NUMERIC_PSPEC_METHODS_FUNC(GParamSpecULong, ulong, NUM2ULONG, UINT2NUM, G_PARAM_SPEC_ULONG) DEF_NUMERIC_PSPEC_METHODS_FUNC(GParamSpecInt64, int64, rbglib_num_to_int64, rbglib_int64_to_num, G_PARAM_SPEC_INT64) DEF_NUMERIC_PSPEC_METHODS_FUNC(GParamSpecUInt64, uint64, rbglib_num_to_uint64, rbglib_uint64_to_num, G_PARAM_SPEC_UINT64) DEF_NUMERIC_PSPEC_METHODS_FUNC(GParamSpecFloat, float, NUM2DBL, rb_float_new, G_PARAM_SPEC_FLOAT) DEF_NUMERIC_PSPEC_METHODS_FUNC(GParamSpecDouble, double, NUM2DBL, rb_float_new, G_PARAM_SPEC_DOUBLE) static VALUE float_epsilon(VALUE self) { return rb_float_new(G_PARAM_SPEC_FLOAT(RVAL2GOBJ(self))->epsilon); } static VALUE double_epsilon(VALUE self) { return rb_float_new(G_PARAM_SPEC_DOUBLE(RVAL2GOBJ(self))->epsilon); } static VALUE boolean_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, VALUE default_value, VALUE flags) { GParamSpec* pspec; pspec = g_param_spec_boolean(StringValuePtr(name), StringValuePtr(nick), StringValuePtr(blurb), RVAL2CBOOL(default_value), NUM2UINT(flags)); rbgobj_param_spec_initialize(self, pspec); return Qnil; } static VALUE unichar_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, VALUE default_value, VALUE flags) { GParamSpec* pspec; pspec = g_param_spec_unichar(StringValuePtr(name), StringValuePtr(nick), StringValuePtr(blurb), NUM2UINT(default_value), NUM2UINT(flags)); rbgobj_param_spec_initialize(self, pspec); return Qnil; } static VALUE enum_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, VALUE enum_type, VALUE default_value, VALUE flags) { GParamSpec* pspec; GType gtype = rbgobj_gtype_get(enum_type); pspec = g_param_spec_enum(StringValuePtr(name), StringValuePtr(nick), StringValuePtr(blurb), gtype, RVAL2GENUM(default_value, gtype), NUM2UINT(flags)); rbgobj_param_spec_initialize(self, pspec); return Qnil; } static VALUE flags_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, VALUE flags_type, VALUE default_value, VALUE flags) { GParamSpec* pspec; GType gtype = rbgobj_gtype_get(flags_type); pspec = g_param_spec_flags(StringValuePtr(name), StringValuePtr(nick), StringValuePtr(blurb), gtype, RVAL2GFLAGS(default_value, gtype), NUM2UINT(flags)); rbgobj_param_spec_initialize(self, pspec); return Qnil; } static VALUE string_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, VALUE default_value, VALUE flags) { GParamSpec* pspec; pspec = g_param_spec_string(StringValuePtr(name), StringValuePtr(nick), StringValuePtr(blurb), NIL_P(default_value) ? NULL : StringValuePtr(default_value), NUM2UINT(flags)); rbgobj_param_spec_initialize(self, pspec); return Qnil; } static VALUE param_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, VALUE param_type, VALUE flags) { GParamSpec* pspec; pspec = g_param_spec_param(StringValuePtr(name), StringValuePtr(nick), StringValuePtr(blurb), rbgobj_gtype_get(param_type), NUM2UINT(flags)); rbgobj_param_spec_initialize(self, pspec); return Qnil; } static VALUE boxed_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, VALUE boxed_type, VALUE flags) { GParamSpec* pspec; pspec = g_param_spec_boxed(StringValuePtr(name), StringValuePtr(nick), StringValuePtr(blurb), rbgobj_gtype_get(boxed_type), NUM2UINT(flags)); rbgobj_param_spec_initialize(self, pspec); return Qnil; } static VALUE pointer_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, VALUE flags) { GParamSpec* pspec; pspec = g_param_spec_pointer(StringValuePtr(name), StringValuePtr(nick), StringValuePtr(blurb), NUM2UINT(flags)); rbgobj_param_spec_initialize(self, pspec); return Qnil; } static VALUE value_array_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, VALUE element_spec, VALUE flags) { GParamSpec* pspec; pspec = g_param_spec_value_array(StringValuePtr(name), StringValuePtr(nick), StringValuePtr(blurb), RVAL2GOBJ(element_spec), NUM2UINT(flags)); rbgobj_param_spec_initialize(self, pspec); return Qnil; } static VALUE object_initialize(VALUE self, VALUE name, VALUE nick, VALUE blurb, VALUE object_type, VALUE flags) { GParamSpec* pspec; pspec = g_param_spec_object(StringValuePtr(name), StringValuePtr(nick), StringValuePtr(blurb), rbgobj_gtype_get(object_type), NUM2UINT(flags)); rbgobj_param_spec_initialize(self, pspec); return Qnil; } void Init_gobject_gparamspecs(void) { VALUE cParamSpec = GTYPE2CLASS(G_TYPE_PARAM); VALUE c; #define DEF_NUMERIC_PSPEC_METHODS(c, typename) \ G_STMT_START {\ rbg_define_method(c, "initialize", typename##_initialize, 7); \ rbg_define_method(c, "minimum", typename##_minimum, 0); \ rbg_define_method(c, "maximum", typename##_maximum, 0); \ rbg_define_method(c, "range", typename##_range, 0); \ } G_STMT_END #if 0 rbg_define_method(c, "default_value", typename##_default_value, 0); \ rb_define_alias(c, "default", "default_value"); \ #endif c = G_DEF_CLASS(G_TYPE_PARAM_CHAR, "Char", cParamSpec); DEF_NUMERIC_PSPEC_METHODS(c, char); c = G_DEF_CLASS(G_TYPE_PARAM_UCHAR, "UChar", cParamSpec); DEF_NUMERIC_PSPEC_METHODS(c, uchar); c = G_DEF_CLASS(G_TYPE_PARAM_INT, "Int", cParamSpec); DEF_NUMERIC_PSPEC_METHODS(c, int); c = G_DEF_CLASS(G_TYPE_PARAM_UINT, "UInt", cParamSpec); DEF_NUMERIC_PSPEC_METHODS(c, uint); c = G_DEF_CLASS(G_TYPE_PARAM_LONG, "Long", cParamSpec); DEF_NUMERIC_PSPEC_METHODS(c, long); c = G_DEF_CLASS(G_TYPE_PARAM_ULONG, "ULong", cParamSpec); DEF_NUMERIC_PSPEC_METHODS(c, ulong); c = G_DEF_CLASS(G_TYPE_PARAM_INT64, "Int64", cParamSpec); DEF_NUMERIC_PSPEC_METHODS(c, int64); c = G_DEF_CLASS(G_TYPE_PARAM_UINT64, "UInt64", cParamSpec); DEF_NUMERIC_PSPEC_METHODS(c, uint64); c = G_DEF_CLASS(G_TYPE_PARAM_FLOAT, "Float", cParamSpec); DEF_NUMERIC_PSPEC_METHODS(c, float); rbg_define_method(c, "epsilon", float_epsilon, 0); c = G_DEF_CLASS(G_TYPE_PARAM_DOUBLE, "Double", cParamSpec); DEF_NUMERIC_PSPEC_METHODS(c, double); rbg_define_method(c, "epsilon", double_epsilon, 0); c = G_DEF_CLASS(G_TYPE_PARAM_BOOLEAN, "Boolean", cParamSpec); rbg_define_method(c, "initialize", boolean_initialize, 5); c = G_DEF_CLASS(G_TYPE_PARAM_UNICHAR, "UniChar", cParamSpec); rbg_define_method(c, "initialize", unichar_initialize, 5); c = G_DEF_CLASS(G_TYPE_PARAM_ENUM, "Enum", cParamSpec); rbg_define_method(c, "initialize", enum_initialize, 6); c = G_DEF_CLASS(G_TYPE_PARAM_FLAGS, "Flags", cParamSpec); rbg_define_method(c, "initialize", flags_initialize, 6); c = G_DEF_CLASS(G_TYPE_PARAM_STRING, "String", cParamSpec); rbg_define_method(c, "initialize", string_initialize, 5); c = G_DEF_CLASS(G_TYPE_PARAM_PARAM, "Param", cParamSpec); rbg_define_method(c, "initialize", param_initialize, 5); c = G_DEF_CLASS(G_TYPE_PARAM_BOXED, "Boxed", cParamSpec); rbg_define_method(c, "initialize", boxed_initialize, 5); c = G_DEF_CLASS(G_TYPE_PARAM_POINTER, "Pointer", cParamSpec); rbg_define_method(c, "initialize", pointer_initialize, 4); c = G_DEF_CLASS(G_TYPE_PARAM_VALUE_ARRAY, "ValueArray", cParamSpec); rbg_define_method(c, "initialize", value_array_initialize, 5); c = G_DEF_CLASS(G_TYPE_PARAM_OBJECT, "Object", cParamSpec); rbg_define_method(c, "initialize", object_initialize, 5); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib2conversions.h0000644000175000017500000000613712126557022021400 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __GLIB2CONVERSIONS_H__ #define __GLIB2CONVERSIONS_H__ #define RVAL2GPARAMSPEC(o) (G_PARAM_SPEC(RVAL2GOBJ(o))) #define RVAL2GCLOSURE(o) ((GClosure*)RVAL2BOXED(o, G_TYPE_CLOSURE)) #define GCLOSURE2RVAL(o) (BOXED2RVAL(o, G_TYPE_CLOSURE)) #define RVAL2GIOCHANNEL(o) ((GIOChannel*)RVAL2BOXED(o, G_TYPE_IO_CHANNEL)) #define GIOCHANNEL2RVAL(o) (BOXED2RVAL(o, G_TYPE_IO_CHANNEL)) #define RVAL2GKEYFILE(o) ((GKeyFile*)RVAL2BOXED(o, G_TYPE_KEY_FILE)) #define GKEYFILE2RVAL(o) (BOXED2RVAL(o, G_TYPE_KEY_FILE)) #define RVAL2GMAINCONTEXT(o) ((GMainContext*)RVAL2BOXED(o, G_TYPE_MAIN_CONTEXT)) #define GMAINCONTEXT2RVAL(o) (BOXED2RVAL(o, G_TYPE_MAIN_CONTEXT)) #define RVAL2GMAINLOOP(o) ((GMainLoop*)RVAL2BOXED(o, G_TYPE_MAIN_LOOP)) #define GMAINLOOP2RVAL(o) (BOXED2RVAL(o, G_TYPE_MAIN_LOOP)) #define RVAL2GPOLLFD(o) ((GPollFD*)RVAL2BOXED(o, G_TYPE_POLL_FD)) #define GPOLLFD2RVAL(o) (BOXED2RVAL(o, G_TYPE_POLL_FD)) #define RVAL2GSOURCE(o) ((GSource*)RVAL2BOXED(o, G_TYPE_SOURCE)) #define GSOURCE2RVAL(o) (BOXED2RVAL(o, G_TYPE_SOURCE)) #define RVAL2GTIMER(o) ((GTimer*)RVAL2BOXED(o, G_TYPE_TIMER)) #define GTIMER2RVAL(o) (BOXED2RVAL(o, G_TYPE_TIMER)) #define RVAL2GVALUE(o) ((GValue*)RVAL2BOXED(o, G_TYPE_VALUE)) #define GVALUE2RVAL(o) (BOXED2RVAL(o, G_TYPE_VALUE)) #define RVAL2GIOCONDITION(o) (RVAL2GFLAGS(o, G_TYPE_IO_CONDITION)) #define GIOCONDITION2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_IO_CONDITION)) #define RVAL2GNORMALIZEMODE(o) (RVAL2GENUM(o, G_TYPE_NORMALIZE_MODE)) #define GNORMALIZEMODE2RVAL(o) (GENUM2RVAL(o, G_TYPE_NORMALIZE_MODE)) #define RVAL2GCONNECTFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_CONNECT_FLAGS)) #define GCONNECTFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_CONNECT_FLAGS)) #define RVAL2GKEYFILEFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_KEY_FILE_FLAGS)) #define GKEYFILEFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_KEY_FILE_FLAGS)) #endif /* __GLIB2CONVERSIONS_H__ */ ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_shellerror.c0000644000175000017500000000255011701304107021244 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE cShellError void Init_glib_shellerror(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_ERROR2(G_SHELL_ERROR, "ShellError", mGLib, rb_eRuntimeError); rb_define_const(RG_TARGET_NAMESPACE, "BAD_QUOTING", INT2FIX(G_SHELL_ERROR_BAD_QUOTING)); rb_define_const(RG_TARGET_NAMESPACE, "EMPTY_STRING", INT2FIX(G_SHELL_ERROR_EMPTY_STRING)); rb_define_const(RG_TARGET_NAMESPACE, "FAILED", INT2FIX(G_SHELL_ERROR_FAILED)); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgutil_callback.c0000644000175000017500000001735611701304107021040 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2007 Ruby-GNOME2 Project * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #ifdef G_OS_WIN32 # ifdef HAVE_IO_H # include # define pipe(phandles) _pipe(phandles, 128, _O_BINARY) # endif #else # ifdef HAVE_UNISTD_H # include # endif #endif #include #include #ifndef HAVE_RUBY_NATIVE_THREAD_P # define ruby_native_thread_p() is_ruby_native_thread() #endif static VALUE rbgutil_eGLibCallbackNotInitializedError; static ID id_exit_application; /**********************************************************************/ VALUE rbgutil_protect(VALUE (*func) (VALUE), VALUE data) { int state = 0; VALUE ret = rb_protect(func, data, &state); VALUE e = rb_errinfo(); if (state && !NIL_P(e)) rb_funcall(mGLib, id_exit_application, 2, e, INT2NUM(EXIT_FAILURE)); return ret; } /**********************************************************************/ #ifdef HAVE_NATIVETHREAD typedef struct _CallbackRequest { VALUE (*function)(VALUE); VALUE argument; VALUE result; GMutex *done_mutex; GCond *done_cond; } CallbackRequest; static GMutex *callback_dispatch_thread_mutex = NULL; static GAsyncQueue *callback_request_queue = NULL; static ID id_callback_dispatch_thread; static gint callback_pipe_fds[2] = {-1, -1}; #define CALLBACK_PIPE_READY_MESSAGE "R" #define CALLBACK_PIPE_READY_MESSAGE_SIZE 1 static VALUE exec_callback(VALUE data) { CallbackRequest *request = (CallbackRequest *)data; return request->function(request->argument); } static VALUE process_request(CallbackRequest *request) { g_mutex_lock(request->done_mutex); request->result = rbgutil_protect(exec_callback, (VALUE)request); g_cond_signal(request->done_cond); g_mutex_unlock(request->done_mutex); return Qnil; } static VALUE mainloop(void) { for (;;) { CallbackRequest *request; gchar ready_message_buffer[CALLBACK_PIPE_READY_MESSAGE_SIZE]; rb_thread_wait_fd(callback_pipe_fds[0]); if (read(callback_pipe_fds[0], ready_message_buffer, CALLBACK_PIPE_READY_MESSAGE_SIZE ) != CALLBACK_PIPE_READY_MESSAGE_SIZE || strncmp(ready_message_buffer, CALLBACK_PIPE_READY_MESSAGE, CALLBACK_PIPE_READY_MESSAGE_SIZE) != 0) { g_error("failed to read valid callback dispatcher message"); continue; } request = g_async_queue_pop(callback_request_queue); if (!request) break; rb_thread_create(process_request, request); } close(callback_pipe_fds[0]); callback_pipe_fds[0] = -1; close(callback_pipe_fds[1]); callback_pipe_fds[1] = -1; return Qnil; } static void queue_callback_request(CallbackRequest *request) { ssize_t written; g_async_queue_push(callback_request_queue, request); written = write(callback_pipe_fds[1], CALLBACK_PIPE_READY_MESSAGE, CALLBACK_PIPE_READY_MESSAGE_SIZE); if (written != CALLBACK_PIPE_READY_MESSAGE_SIZE) { rb_warn("couldn't write all callback pipe ready message: " "message-size: %d, written: %" G_GSSIZE_FORMAT, CALLBACK_PIPE_READY_MESSAGE_SIZE, written); } } static VALUE invoke_callback_in_ruby_thread(VALUE (*func)(VALUE), VALUE arg) { CallbackRequest request; g_mutex_lock(callback_dispatch_thread_mutex); if (callback_pipe_fds[0] == -1) { g_error("Please call rbgutil_start_callback_dispatch_thread() " "to dispatch a callback from non-ruby thread before " "callbacks are requested from non-ruby thread."); g_mutex_unlock(callback_dispatch_thread_mutex); return Qnil; } request.function = func; request.argument = arg; request.result = Qnil; request.done_mutex = g_mutex_new(); request.done_cond = g_cond_new(); g_mutex_lock(request.done_mutex); queue_callback_request(&request); g_mutex_unlock(callback_dispatch_thread_mutex); g_cond_wait(request.done_cond, request.done_mutex); g_mutex_unlock(request.done_mutex); g_cond_free(request.done_cond); g_mutex_free(request.done_mutex); return request.result; } #ifdef HAVE_RB_THREAD_CALL_WITH_GVL extern void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1); static void * invoke_callback_with_gvl(void *arg) { CallbackRequest *req = (CallbackRequest*)arg; return (void *)rbgutil_protect(req->function, req->argument); } #endif #endif /**********************************************************************/ VALUE rbgutil_invoke_callback(VALUE (*func)(VALUE), VALUE arg) { #ifdef HAVE_NATIVETHREAD if (ruby_native_thread_p()) { # ifdef HAVE_RB_THREAD_BLOCKING_REGION if (!GPOINTER_TO_INT(g_static_private_get(&rg_polling_key))) { return rbgutil_protect(func, arg); } # endif # ifdef HAVE_RB_THREAD_CALL_WITH_GVL { CallbackRequest req; req.function = func; req.argument = arg; return (VALUE)rb_thread_call_with_gvl(invoke_callback_with_gvl, &req); } # endif } else { return invoke_callback_in_ruby_thread(func, arg); } #endif return rbgutil_protect(func, arg); } /**********************************************************************/ void rbgutil_start_callback_dispatch_thread(void) { #ifdef HAVE_NATIVETHREAD VALUE callback_dispatch_thread; g_mutex_lock(callback_dispatch_thread_mutex); callback_dispatch_thread = rb_ivar_get(mGLib, id_callback_dispatch_thread); if (NIL_P(callback_dispatch_thread)) { if (pipe(callback_pipe_fds) == -1) rb_sys_fail("pipe()"); callback_dispatch_thread = rb_thread_create(mainloop, NULL); rb_ivar_set(mGLib, id_callback_dispatch_thread, callback_dispatch_thread); } g_mutex_unlock(callback_dispatch_thread_mutex); #endif } void rbgutil_stop_callback_dispatch_thread(void) { #ifdef HAVE_NATIVETHREAD VALUE callback_dispatch_thread; g_mutex_lock(callback_dispatch_thread_mutex); callback_dispatch_thread = rb_ivar_get(mGLib, id_callback_dispatch_thread); if (!NIL_P(callback_dispatch_thread)) { queue_callback_request(NULL); rb_ivar_set(mGLib, id_callback_dispatch_thread, Qnil); } g_mutex_unlock(callback_dispatch_thread_mutex); #endif } void Init_gutil_callback(void) { id_exit_application = rb_intern("exit_application"); rbgutil_eGLibCallbackNotInitializedError = rb_define_class_under(mGLib, "CallbackNotInitializedError", rb_eRuntimeError); #ifdef HAVE_NATIVETHREAD if (!g_thread_supported()) g_thread_init(NULL); id_callback_dispatch_thread = rb_intern("callback_dispatch_thread"); rb_ivar_set(mGLib, id_callback_dispatch_thread, Qnil); callback_request_queue = g_async_queue_new(); callback_dispatch_thread_mutex = g_mutex_new(); #endif } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_typemodule.c0000644000175000017500000000432111701304107021254 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE cTypeModule static VALUE rg_use(VALUE self) { return CBOOL2RVAL(g_type_module_use(G_TYPE_MODULE(RVAL2GOBJ(self)))); } static VALUE rg_unuse(VALUE self) { g_type_module_unuse(G_TYPE_MODULE(RVAL2GOBJ(self))); return self; } static VALUE rg_name(VALUE self) { return rb_str_new2(G_TYPE_MODULE(RVAL2GOBJ(self))->name); } static VALUE rg_operator_set_name(VALUE self, VALUE name) { g_type_module_set_name(G_TYPE_MODULE(RVAL2GOBJ(self)), StringValuePtr(name)); return name; } #if 0 GType g_type_module_register_type (GTypeModule *module, GType parent_type, const gchar *type_name, const GTypeInfo *type_info, GTypeFlags flags); void g_type_module_add_interface (GTypeModule *module, GType instance_type, GType interface_type, const GInterfaceInfo *interface_info); #endif void Init_gobject_gtypemodule(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_TYPE_MODULE, "TypeModule", mGLib); RG_DEF_METHOD(use, 0); RG_DEF_METHOD(unuse, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD_OPERATOR("name=", set_name, 1); }ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_utils.c0000644000175000017500000002135012257552167020244 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Ruby-GNOME2 Project Team * Copyright (C) 2004 Pascal Terjan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE mGLib static VALUE rg_s_application_name(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(g_get_application_name()); } static VALUE rg_s_set_application_name(VALUE self, VALUE application_name) { g_set_prgname(RVAL2CSTR_ACCEPT_NIL(application_name)); return self; } static VALUE rg_s_prgname(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(g_get_prgname()); } static VALUE rg_s_set_prgname(VALUE self, VALUE prgname) { g_set_prgname(RVAL2CSTR_ACCEPT_NIL(prgname)); return self; } static VALUE rg_s_getenv(G_GNUC_UNUSED VALUE self, VALUE variable) { return CSTR2RVAL(g_getenv(RVAL2CSTR(variable))); } static VALUE rg_s_setenv(G_GNUC_UNUSED VALUE self, VALUE variable, VALUE value, VALUE overwrite) { return CBOOL2RVAL(g_setenv(RVAL2CSTR(variable), RVAL2CSTR_ACCEPT_NIL(value), RVAL2CBOOL(overwrite))); } static VALUE rg_s_unsetenv(VALUE self, VALUE variable) { g_unsetenv(RVAL2CSTR(variable)); return self; } #ifdef HAVE_G_LISTENV static VALUE rg_s_listenv(G_GNUC_UNUSED VALUE self) { gchar** c_list; gchar** c_var; VALUE r_list = rb_ary_new(); c_list = g_listenv(); c_var = c_list; while(*c_var) { rb_ary_push(r_list, CSTR2RVAL(*(c_var++))); } g_strfreev(c_list); return r_list; } #endif static VALUE rg_s_host_name(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(g_get_host_name()); } static VALUE rg_s_user_name(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(g_get_user_name()); } static VALUE rg_s_real_name(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(g_get_real_name()); } static VALUE rg_s_user_cache_dir(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(g_get_user_cache_dir()); } static VALUE rg_s_user_data_dir(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(g_get_user_data_dir()); } static VALUE rg_s_user_config_dir(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(g_get_user_config_dir()); } static VALUE rg_s_system_data_dirs(G_GNUC_UNUSED VALUE self) { return STRV2RVAL((const gchar **)g_get_system_data_dirs()); } static VALUE rg_s_system_config_dirs(G_GNUC_UNUSED VALUE self) { return STRV2RVAL((const gchar **)g_get_system_config_dirs()); } #if GLIB_CHECK_VERSION(2, 14, 0) static VALUE rg_s_get_user_special_dir(G_GNUC_UNUSED VALUE self, VALUE directory) { return CSTR2RVAL(g_get_user_special_dir(RVAL2GENUM(directory, G_TYPE_USER_DIRECTORY))); } #endif static VALUE rg_s_home_dir(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(g_get_home_dir()); } static VALUE rg_s_tmp_dir(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(g_get_tmp_dir()); } static VALUE rg_s_current_dir(G_GNUC_UNUSED VALUE self) { gchar* dir = g_get_current_dir(); VALUE ret = CSTR2RVAL(dir); g_free(dir); return ret; } static VALUE rg_s_path_is_absolute_p(G_GNUC_UNUSED VALUE self, VALUE fname) { return CBOOL2RVAL(g_path_is_absolute(RVAL2CSTR(fname))); } static VALUE rg_s_path_skip_root(G_GNUC_UNUSED VALUE self, VALUE fname) { return CSTR2RVAL(g_path_skip_root(RVAL2CSTR(fname))); } static VALUE rg_s_path_get_basename(G_GNUC_UNUSED VALUE self, VALUE fname) { return CSTR2RVAL(g_path_get_basename(RVAL2CSTR(fname))); } static VALUE rg_s_path_get_dirname(G_GNUC_UNUSED VALUE self, VALUE fname) { return CSTR2RVAL(g_path_get_dirname(RVAL2CSTR(fname))); } /* Use File.join() gchar* g_build_filename (const gchar *first_element, ...); gchar* g_build_filenamev (gchar **args); gchar* g_build_path (const gchar *separator, const gchar *first_element, ...); gchar* g_build_pathv (const gchar *separator, gchar **args); */ static VALUE rg_s_find_program_in_path(G_GNUC_UNUSED VALUE self, VALUE program) { gchar* path = g_find_program_in_path(RVAL2CSTR(program)); VALUE ret = CSTR2RVAL(path); g_free(path); return ret; } static VALUE rg_s_bit_nth_lsf(G_GNUC_UNUSED VALUE self, VALUE mask, VALUE nth_bit) { return INT2NUM(g_bit_nth_lsf(NUM2ULONG(mask), NUM2INT(nth_bit))); } static VALUE rg_s_bit_nth_msf(G_GNUC_UNUSED VALUE self, VALUE mask, VALUE nth_bit) { return INT2NUM(g_bit_nth_msf(NUM2ULONG(mask), NUM2INT(nth_bit))); } static VALUE rg_s_bit_storage(G_GNUC_UNUSED VALUE self, VALUE number) { return UINT2NUM(g_bit_storage(NUM2ULONG(number))); } static VALUE rg_s_spaced_primes_closest(G_GNUC_UNUSED VALUE self, VALUE num) { return UINT2NUM(g_spaced_primes_closest(NUM2UINT(num))); } /* Use at_exit of ruby instead. void g_atexit (GVoidFunc func); */ static VALUE rg_s_parse_debug_string(G_GNUC_UNUSED VALUE self, VALUE string, VALUE keys) { gint i, nkeys; VALUE ary; GDebugKey* gkeys; Check_Type(keys, RUBY_T_HASH); ary = rb_funcall(keys, rb_intern("to_a"), 0); nkeys = RARRAY_LEN(ary); gkeys = ALLOCA_N(GDebugKey, nkeys); for (i = 0; i < nkeys; i++) { gkeys[i].key = RVAL2CSTR(RARRAY_PTR(RARRAY_PTR(ary)[i])[0]); gkeys[i].value = NUM2UINT(RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); } return UINT2NUM(g_parse_debug_string(RVAL2CSTR(string), gkeys, nkeys)); } /* void (*GVoidFunc) (void); void (*GFreeFunc) (gpointer data); Don't need them. void g_qsort_with_data (gconstpointer pbase, gint total_elems, gsize size, GCompareDataFunc compare_func, gpointer user_data); void g_nullify_pointer (gpointer *nullify_location); */ static VALUE rg_s_check_version_p(G_GNUC_UNUSED VALUE self, VALUE major, VALUE minor, VALUE micro) { return CBOOL2RVAL(glib_major_version > NUM2UINT(major) || (glib_major_version == NUM2UINT(major) && glib_minor_version > NUM2UINT(minor)) || (glib_major_version == NUM2UINT(major) && glib_minor_version == NUM2UINT(minor) && glib_micro_version >= NUM2UINT(micro))); } void Init_glib_utils(void) { /* glib/gutils.h */ #if GLIB_CHECK_VERSION(2, 14, 0) G_DEF_CLASS(G_TYPE_USER_DIRECTORY, "UserDirectory", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_USER_DIRECTORY, "G_"); #endif RG_DEF_SMETHOD(application_name, 0); RG_DEF_SMETHOD(set_application_name, 1); RG_DEF_SMETHOD(prgname, 0); RG_DEF_SMETHOD(set_prgname, 1); RG_DEF_SMETHOD(getenv, 1); RG_DEF_SMETHOD(setenv, 2); RG_DEF_SMETHOD(unsetenv, 1); #ifdef HAVE_G_LISTENV RG_DEF_SMETHOD(listenv, 0); #endif RG_DEF_SMETHOD(host_name, 0); RG_DEF_SMETHOD(user_name, 0); RG_DEF_SMETHOD(real_name, 0); RG_DEF_SMETHOD(user_cache_dir, 0); RG_DEF_SMETHOD(user_data_dir, 0); RG_DEF_SMETHOD(user_config_dir, 0); RG_DEF_SMETHOD(system_data_dirs, 0); RG_DEF_SMETHOD(system_config_dirs, 0); #if GLIB_CHECK_VERSION(2, 14, 0) RG_DEF_SMETHOD(get_user_special_dir, 1); #endif RG_DEF_SMETHOD(home_dir, 0); RG_DEF_SMETHOD(tmp_dir, 0); RG_DEF_SMETHOD(current_dir, 0); RG_DEF_SMETHOD_P(path_is_absolute, 1); RG_DEF_SMETHOD(path_skip_root, 1); RG_DEF_SMETHOD(path_get_basename, 1); RG_DEF_SMETHOD(path_get_dirname, 1); RG_DEF_SMETHOD(find_program_in_path, 1); RG_DEF_SMETHOD(bit_nth_lsf, 2); RG_DEF_SMETHOD(bit_nth_msf, 2); RG_DEF_SMETHOD(bit_storage, 1); RG_DEF_SMETHOD(spaced_primes_closest, 1); RG_DEF_SMETHOD(parse_debug_string, 2); RG_DEF_SMETHOD_P(check_version, 3); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_mainloop.c0000644000175000017500000000503111701304107020676 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005,2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" /*****************************************/ #if !GLIB_CHECK_VERSION(2,30,0) GType g_main_loop_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GMainLoop", (GBoxedCopyFunc)g_main_loop_ref, (GBoxedFreeFunc)g_main_loop_unref); return our_type; } #endif /*****************************************/ #define RG_TARGET_NAMESPACE cMainLoop #define _SELF(s) ((GMainLoop*)RVAL2BOXED(s, G_TYPE_MAIN_LOOP)) /*****************************************/ static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE context, is_running; GMainLoop *loop; GMainContext *main_context = NULL; rb_scan_args(argc, argv, "02", &context, &is_running); if (!NIL_P(context)) main_context = RVAL2BOXED(context, G_TYPE_MAIN_CONTEXT); loop = g_main_loop_new(main_context, RVAL2CBOOL(is_running)); G_INITIALIZE(self, loop); return Qnil; } static VALUE rg_run(VALUE self) { g_main_loop_run(_SELF(self)); return self; } static VALUE rg_quit(VALUE self) { g_main_loop_quit(_SELF(self)); return Qnil; } static VALUE rg_running_p(VALUE self) { return CBOOL2RVAL(g_main_loop_is_running(_SELF(self))); } static VALUE rg_context(VALUE self) { return BOXED2RVAL(g_main_loop_get_context(_SELF(self)), G_TYPE_MAIN_CONTEXT); } void Init_glib_main_loop(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MAIN_LOOP, "MainLoop", mGLib); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(run, 0); RG_DEF_METHOD(quit, 0); RG_DEF_METHOD_P(running, 0); RG_DEF_METHOD(context, 0); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/extconf.rb0000644000175000017500000000467612257552167017426 0ustar koukou=begin extconf.rb for Ruby/GLib extention library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path mkmf_gnome2_dir = base_dir + 'lib' $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "glib2" package_id = "gobject-2.0" require 'mkmf-gnome2' setup_win32(module_name, base_dir) unless required_pkg_config_package([package_id, 2, 12, 0], :debian => "libglib2.0-dev", :redhat => "glib2-devel", :homebrew => "glib", :macports => "glib2") exit(false) end PKGConfig.have_package('gthread-2.0') have_header("unistd.h") have_header("io.h") glib_header = "glib.h" have_func("g_spawn_close_pid", glib_header) have_func("g_thread_init", glib_header) have_func("g_main_depth", glib_header) have_func("g_listenv", glib_header) ruby_header = "ruby.h" have_func("rb_check_array_type", ruby_header) have_func("rb_check_hash_type", ruby_header) have_func("rb_exec_recursive", ruby_header) have_func("rb_errinfo", ruby_header) have_func("rb_sourcefile", ruby_header) have_func("rb_sourceline", ruby_header) have_func("ruby_set_current_source", ruby_header) have_func("rb_thread_blocking_region", ruby_header) have_func("ruby_native_thread_p", ruby_header) have_func("rb_thread_call_with_gvl", ruby_header) have_func("rb_str_new_cstr", ruby_header) have_func("rb_gc_register_mark_object", ruby_header) have_func("rb_exc_new_str", ruby_header) have_var("curr_thread", [ruby_header, "node.h"]) have_var("rb_curr_thread", [ruby_header, "node.h"]) create_pkg_config_file("Ruby/GLib2", package_id) enum_types_prefix = "glib-enum-types" include_paths = PKGConfig.cflags_only_I("glib-2.0") headers = include_paths.split.inject([]) do |result, path| result + Dir.glob(File.join(path.sub(/^-I/, ""), "glib", "*.h")) end.reject do |file| /g(iochannel|main|scanner)\.h/ =~ file end include_paths = PKGConfig.cflags_only_I("gobject-2.0") headers = include_paths.split.inject(headers) do |result, path| result + Dir.glob(File.join(path.sub(/^-I/, ""), "gobject", "gsignal.h")) end glib_mkenums(enum_types_prefix, headers, "G_TYPE_", ["glib-object.h"]) $defs << "-DRUBY_GLIB2_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgutil_list.h0000644000175000017500000000775311701304107020264 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGUTIL_LIST_H__ #define __RBGUTIL_LIST_H__ G_BEGIN_DECLS #define CSTRGLIST2RVAL(list) \ CSTRGLIST2RVAL_FREE(list, NULL, NULL) #define CSTRGLIST2RVAL_FREE(list, free_list, free_elem) \ rbg_glist2rval(list, (RBGRValueFunc)rbg_cstr2rval, \ (GFreeFunc)free_list, (GFreeFunc)free_elem) #define CSTRGSLIST2RVAL(list) \ CSTRGSLIST2RVAL_FREE(list, NULL, NULL) #define CSTRGSLIST2RVAL_FREE(list, free_list, free_elem) \ rbg_gslist2rval(list, (RBGRValueFunc)rbg_cstr2rval, \ (GFreeFunc)free_list, (GFreeFunc)free_elem) #define FILENAMEGLIST2RVAL(list) \ FILENAMEGLIST2RVAL_FREE(list, NULL, NULL) #define FILENAMEGLIST2RVAL_FREE(list, free_list, free_elem) \ rbg_glist2rval(list, (RBGRValueFunc)rbg_filename_to_ruby, \ (GFreeFunc)free_list, (GFreeFunc)free_elem) #define FILENAMEGSLIST2RVAL(list) \ FILENAMEGSLIST2RVAL_FREE(list, NULL, NULL) #define FILENAMEGSLIST2RVAL_FREE(list, free_list, free_elem) \ rbg_gslist2rval(list, (RBGRValueFunc)rbg_filename_to_ruby, \ (GFreeFunc)free_list, (GFreeFunc)free_elem) #define GOBJGLIST2RVAL(list) \ GOBJGLIST2RVAL_FREE(list, NULL, NULL) #define GOBJGLIST2RVAL_FREE(list, free_list, free_elem) \ rbg_glist2rval(list, (RBGRValueFunc)rbgobj_ruby_object_from_instance, \ (GFreeFunc)free_list, (GFreeFunc)free_elem) #define GOBJGSLIST2RVAL(list) \ GOBJGSLIST2RVAL_FREE(list, NULL, NULL) #define GOBJGSLIST2RVAL_FREE(list, free_list, free_elem) \ rbg_gslist2rval(list, (RBGRValueFunc)rbgobj_ruby_object_from_instance, \ (GFreeFunc)free_list, (GFreeFunc)free_elem) #define BOXEDGLIST2RVAL(list, gtype) \ BOXEDGLIST2RVAL_FREE(list, gtype, NULL, NULL) #define BOXEDGLIST2RVAL_FREE(list, gtype, free_list, free_elem) \ rbg_glist2rval_with_type(list, (RBGRValueFuncWithType)rbgobj_make_boxed, gtype, \ (GFreeFunc)free_list, (GFreeFunc)free_elem) #define BOXEDGSLIST2RVAL(list, gtype) \ BOXEDGSLIST2RVAL_FREE(list, gtype, NULL, NULL) #define BOXEDGSLIST2RVAL_FREE(list, gtype, free_list, free_elem) \ rbg_gslist2rval_with_type(list, (RBGRValueFuncWithType)rbgobj_make_boxed, gtype, \ (GFreeFunc)free_list, (GFreeFunc)free_elem) typedef VALUE (*RBGRValueFunc)(gpointer obj); typedef VALUE (*RBGRValueFuncWithType)(gpointer obj, GType gtype); extern VALUE rbg_glist2rval(GList *const list, RBGRValueFunc conv, GFreeFunc free_list, GFreeFunc free_elem); extern VALUE rbg_gslist2rval(GSList *const list, RBGRValueFunc conv, GFreeFunc free_list, GFreeFunc free_elem); extern VALUE rbg_glist2rval_with_type(GList *const list, RBGRValueFuncWithType conv, GType gtype, GFreeFunc free_list, GFreeFunc free_elem); extern VALUE rbg_gslist2rval_with_type(GSList *const list, RBGRValueFuncWithType conv, GType gtype, GFreeFunc free_list, GFreeFunc free_elem); G_END_DECLS #endif /* __RBGUTIL_LIST_H__ */ ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_enums.c0000664000175000017500000002326611740310343020231 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include #define RG_TARGET_NAMESPACE rbgobj_cEnum VALUE RG_TARGET_NAMESPACE; static ID id_new; static ID id_to_s; /**********************************************************************/ static gchar * nick_to_const_name(const gchar *nick) { gchar *const_name; gchar *p; if (!nick) return NULL; const_name = g_strdup(nick); for (p = const_name; *p; p++) { if (*p == '-' || *p == ' ') *p = '_'; else *p = g_ascii_toupper(*p); } return const_name; } VALUE rg_enum_resolve_value(VALUE klass, VALUE nick) { VALUE value = Qnil; gchar *const_nick; ID const_nick_id; if (RVAL2CBOOL(rb_obj_is_kind_of(nick, klass))) return nick; nick = rb_funcall(nick, id_to_s, 0); const_nick = nick_to_const_name(RVAL2CSTR(nick)); const_nick_id = rb_intern(const_nick); if (rb_const_defined(klass, const_nick_id)) { value = rb_const_get(klass, const_nick_id); } g_free(const_nick); return value; } void rg_enum_add_constants(VALUE mod, GType enum_type, const gchar *strip_prefix) { GEnumClass *gclass; guint i; int prefix_len = strlen(strip_prefix); gclass = G_ENUM_CLASS(g_type_class_ref(enum_type)); for (i = 0; i < gclass->n_values; i++) { const GEnumValue* value = &gclass->values[i]; if (strncmp(value->value_name, strip_prefix, prefix_len)) { g_warning("\"%s\" doesn't have prefix \"%s\"", value->value_name, strip_prefix); } else { const char* name = value->value_name + prefix_len; rbgobj_define_const(mod, name, rbgobj_make_enum(value->value, enum_type)); } } g_type_class_unref(gclass); } /**********************************************************************/ typedef struct { GEnumClass* gclass; gint value; GEnumValue* info; } enum_holder; static void enum_free(enum_holder* p) { g_type_class_unref(p->gclass); free(p); } static enum_holder* enum_get_holder(VALUE obj) { enum_holder* p; Data_Get_Struct(obj, enum_holder, p); return p; } static VALUE make_enum(gint n, VALUE klass) { return rb_funcall(klass, id_new, 1, INT2NUM(n)); } VALUE rbgobj_make_enum(gint n, GType gtype) { return make_enum(n, GTYPE2CLASS(gtype)); } gint rbgobj_get_enum(VALUE obj, GType gtype) { VALUE klass; if (!g_type_is_a(gtype, G_TYPE_ENUM)) rb_raise(rb_eTypeError, "%s is not a %s: %s", g_type_name(gtype), g_type_name(G_TYPE_ENUM), RBG_INSPECT(obj)); /* for compatibility */ if (rb_obj_is_kind_of(obj, rb_cInteger)) obj = rbgobj_make_enum(NUM2INT(obj), gtype); klass = GTYPE2CLASS(gtype); if (!rb_obj_is_kind_of(obj, klass)) { VALUE enum_value; enum_value = rg_enum_resolve_value(klass, obj); if (!NIL_P(enum_value)) obj = enum_value; } if (rb_obj_is_kind_of(obj, klass)) return enum_get_holder(obj)->value; else rb_raise(rb_eTypeError, "not a %s: %s", rb_class2name(klass), RBG_INSPECT(obj)); } /**********************************************************************/ void rbgobj_init_enum_class(VALUE klass) { GEnumClass* gclass = g_type_class_ref(CLASS2GTYPE(klass)); guint i; for (i = 0; i < gclass->n_values; i++) { GEnumValue* entry = &(gclass->values[i]); gchar *const_nick_name; const_nick_name = nick_to_const_name(entry->value_nick); #if 0 { ID id = rb_intern(const_nick_name); if (rb_is_const_id(id)) { VALUE value; value = make_enum(entry->value, klass); rb_define_const(klass, const_nick_name, value); } } #else { if (const_nick_name) { VALUE value; value = make_enum(entry->value, klass); rbgobj_define_const(klass, const_nick_name, value); } } #endif g_free(const_nick_name); } g_type_class_unref(gclass); } static VALUE rg_s_range(VALUE self) { GEnumClass* gclass = g_type_class_ref(CLASS2GTYPE(self)); VALUE result = rb_range_new(INT2NUM(gclass->minimum), INT2NUM(gclass->maximum), FALSE); g_type_class_unref(gclass); return result; } struct enum_s_values_body_args { GEnumClass *gclass; VALUE self; }; static VALUE enum_s_values_body(VALUE value) { struct enum_s_values_body_args *args = (struct enum_s_values_body_args *)value; VALUE result = rb_ary_new(); guint i; for (i = 0; i < args->gclass->n_values; i++) rb_ary_push(result, make_enum(args->gclass->values[i].value, args->self)); return result; } static VALUE enum_s_values_ensure(VALUE gclass) { g_type_class_unref((GEnumClass *)gclass); return Qnil; } static VALUE rg_s_values(VALUE self) { struct enum_s_values_body_args args = { g_type_class_ref(CLASS2GTYPE(self)), self }; return rb_ensure(enum_s_values_body, (VALUE)&args, enum_s_values_ensure, (VALUE)args.gclass); } static VALUE enum_s_allocate(VALUE self) { GType gtype = CLASS2GTYPE(self); if (G_TYPE_IS_ABSTRACT(gtype)) { rb_raise(rb_eTypeError, "abstract class"); } else { enum_holder* p; VALUE result = Data_Make_Struct(self, enum_holder, NULL, enum_free, p); p->gclass = g_type_class_ref(gtype); p->info = NULL; return result; } } static VALUE rg_initialize(VALUE self, VALUE arg) { enum_holder* p = enum_get_holder(self); if (rb_respond_to(arg, rb_intern("to_str"))) { const char* str = StringValuePtr(arg); p->info = g_enum_get_value_by_name(p->gclass, str); if (! p->info) p->info = g_enum_get_value_by_nick(p->gclass, str); if (! p->info) rb_raise(rb_eArgError, "invalid argument"); } else { p->value = NUM2INT(arg); p->info = g_enum_get_value(p->gclass, p->value); } return Qnil; } static VALUE rg_to_i(VALUE self) { enum_holder* p = enum_get_holder(self); return INT2NUM(p->value); } static VALUE rg_name(VALUE self) { enum_holder* p = enum_get_holder(self); return p->info ? rb_str_new2(p->info->value_name) : Qnil; } static VALUE rg_nick(VALUE self) { enum_holder* p = enum_get_holder(self); return p->info ? rb_str_new2(p->info->value_nick) : Qnil; } static VALUE rg_inspect(VALUE self) { const char* cname = rb_class2name(CLASS_OF(self)); enum_holder* p = enum_get_holder(self); gchar* str; VALUE result; if (p->info) str = g_strdup_printf("#<%s %s>", cname, p->info->value_nick); else str = g_strdup_printf("#<%s %d>", cname, p->value); result = rb_str_new2(str); g_free(str); return result; } static VALUE rg_operator_enum_eqv(VALUE self, VALUE rhs) { enum_holder* p = enum_get_holder(self); GType gtype = G_TYPE_FROM_CLASS(p->gclass); VALUE klass = GTYPE2CLASS(gtype); if (!rb_obj_is_kind_of(rhs, rb_cInteger)) { rhs = rg_enum_resolve_value(klass, rhs); if (CLASS_OF(rhs) != CLASS_OF(self)) return Qnil; } return CBOOL2RVAL(rbgobj_get_enum(self, gtype) == rbgobj_get_enum(rhs, gtype)); } static VALUE rg_hash(VALUE self) { enum_holder* p = enum_get_holder(self); return UINT2NUM(p->value ^ G_TYPE_FROM_CLASS(p->gclass)); } static VALUE rg_coerce(VALUE self, VALUE other) { enum_holder *holder; GType gtype; if (!rb_obj_is_kind_of(other, rb_cInteger)) rb_raise(rb_eTypeError, "can't coerce"); holder = enum_get_holder(self); gtype = G_TYPE_FROM_CLASS(holder->gclass); other = rbgobj_make_enum(NUM2INT(other), gtype); return rb_ary_new3(2, other, self); } /**********************************************************************/ void Init_gobject_genums(void) { id_new = rb_intern("new"); id_to_s = rb_intern("to_s"); RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_ENUM, "Enum", mGLib); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0); rbg_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0); RG_DEF_SMETHOD(range, 0); RG_DEF_SMETHOD(values, 0); rb_define_alloc_func(RG_TARGET_NAMESPACE, enum_s_allocate); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(to_i, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(nick, 0); RG_DEF_METHOD(inspect, 0); RG_DEF_METHOD_OPERATOR("==", enum_eqv, 1); RG_DEF_METHOD(hash, 0); RG_DEF_ALIAS("eql?", "=="); /* for compatibility */ RG_DEF_METHOD(coerce, 1); RG_DEF_ALIAS("to_int", "to_i"); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_win32.c0000644000175000017500000000633012257552167020047 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #ifdef G_OS_WIN32 #define RG_TARGET_NAMESPACE mWin32 static VALUE rg_s_error_message(VALUE self, VALUE error) { return CSTR2RVAL_FREE(g_win32_error_message(NUM2INT(error))); } static VALUE rg_s_locale(VALUE self) { return CSTR2RVAL_FREE(g_win32_getlocale()); } static VALUE rbglib_m_win32_locale_deprecated(VALUE self) { rb_warn("GLib.win32_locale() is deprecated. Use GLib::Win32.locale instead"); return rg_s_locale(self); } static VALUE rg_s_version(VALUE self) { return UINT2NUM(g_win32_get_windows_version()); } static VALUE rg_s_locale_filename_from_utf8(VALUE self, VALUE utf8_filename) { return CSTR2RVAL_FREE(g_win32_locale_filename_from_utf8(RVAL2CSTR(utf8_filename))); } static VALUE rbglib_m_win32_locale_filename_from_utf8_deprecated(VALUE self, VALUE utf8_filename) { rb_warn("GLib.win32_locale_filename_from_utf8() is deprecated. Use GLib::Win32.locale_filename_from_utf8 instead"); return rg_s_locale_filename_from_utf8(self, utf8_filename); } # if GLIB_CHECK_VERSION(2, 16, 0) static VALUE rg_s_get_package_installation_directory_of_module(int argc, VALUE *argv, VALUE self) { VALUE rb_module; gchar *directory; gpointer hmodule; rb_scan_args(argc, argv, "01", &rb_module); if (NIL_P(rb_module)) hmodule = NULL; else hmodule = GINT_TO_POINTER(NUM2INT(rb_module)); directory = g_win32_get_package_installation_directory_of_module(hmodule); return CSTR2RVAL_FREE(directory); } # endif #endif void Init_glib_win32(void) { #ifdef G_OS_WIN32 /* glib/gwin32.h */ VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "Win32"); RG_DEF_SMETHOD(error_message, 1); RG_DEF_SMETHOD(locale, 0); RG_DEF_SMETHOD(version, 0); /* Deprecated */ rbg_define_singleton_method(mGLib, "win32_locale", rbglib_m_win32_locale_deprecated, 0); RG_DEF_SMETHOD(locale_filename_from_utf8, 1); /* Deprecated */ rbg_define_singleton_method(mGLib, "win32_locale_filename_from_utf8", rbglib_m_win32_locale_filename_from_utf8_deprecated, 1); # if GLIB_CHECK_VERSION(2, 16, 0) RG_DEF_SMETHOD(get_package_installation_directory_of_module, -1); # endif #endif } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_int64.c0000644000175000017500000001004111701304107020021 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masahiro Sakai * Copyright (C) 2002 Masahiro Sakai * Kenichi Komiya * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" static ID id_and; static ID id_rshift; static ID id_lshift; static ID id_lt; static ID id_plus; static ID id_uminus; static ID id_abs; static VALUE max_PRUint32; typedef guint64 PRUint64; typedef gint64 PRInt64; #define LL_ZERO G_GINT64_CONSTANT(0) #define LL_UI2L(lhs,rhs) ((lhs)=(rhs)) #define LL_L2UI(lhs,rhs) ((lhs)=(guint32)(rhs)) #define LL_SHL(lhs,v1,v2) ((lhs)=(v1)<<(v2)) #define LL_SHR(lhs,v1,v2) ((lhs)=(v1)>>(v2)) #define LL_ADD(lhs,v1,v2) ((lhs)=(v1)+(v2)) #define LL_NEG(lhs,rhs) ((lhs)=-(rhs)) #define LL_CMP(v1,op,v2) ((v1) op (v2)) /**********************************************************************/ /* following is ripped from rbXPCOM-0.0.3 http://www.ruby-lang.org/en/raa-list.rhtml?name=rbXPCOM Copyright (C) 2001 Kenichi Komiya */ static PRUint64 RubyTo64BitInt(VALUE aRuby) { VALUE bitMask = max_PRUint32; VALUE lo = rb_funcall(aRuby, id_and, 1, bitMask); VALUE hi = rb_funcall(aRuby, id_rshift, 1, INT2FIX(32)); PRUint64 result, hi64, lo64; LL_UI2L(hi64, NUM2UINT(hi)); LL_UI2L(lo64, NUM2UINT(lo)); LL_SHL(result, hi64, 32); LL_ADD(result, result, lo64); return result; } static inline PRUint64 RubyToPRUint64(VALUE aRuby) { return RubyTo64BitInt(aRuby); } static PRInt64 RubyToPRInt64(VALUE aRuby) { if(RVAL2CBOOL(rb_funcall(aRuby, id_lt, 1, INT2FIX(0)))) { VALUE absRuby = rb_funcall(aRuby, id_abs, 0); PRInt64 result; LL_NEG(result, RubyTo64BitInt(absRuby)); return result; } else return (PRInt64)RubyTo64BitInt(aRuby); } static VALUE RubyFrom64BitInt(PRUint64 aNative) { PRUint64 lo64, hi64; LL_L2UI(lo64, aNative); LL_SHR(hi64, aNative, 32); { VALUE lo = UINT2NUM(lo64); VALUE hi = UINT2NUM(hi64); VALUE hiRuby = rb_funcall(hi, id_lshift, 1, INT2FIX(32)); return rb_funcall(hiRuby, id_plus, 1, lo); } } static inline VALUE PRUint64ToRuby(PRUint64 aNative) { return RubyFrom64BitInt(aNative); } static VALUE PRInt64ToRuby(PRInt64 aNative) { if(LL_CMP(aNative, <, LL_ZERO)) { PRUint64 abs64; LL_NEG(abs64, aNative); return rb_funcall(RubyFrom64BitInt(abs64), id_uminus, 0); } else return RubyFrom64BitInt((PRUint64)aNative); } /* end of ripping */ /**********************************************************************/ VALUE rbglib_int64_to_num(guint64 val) { return PRInt64ToRuby(val); } VALUE rbglib_uint64_to_num(guint64 val) { return PRUint64ToRuby(val); } gint64 rbglib_num_to_int64(VALUE val) { return RubyToPRInt64(val); } guint64 rbglib_num_to_uint64(VALUE val) { return RubyToPRUint64(val); } /**********************************************************************/ void Init_glib_int64(void) { id_and = rb_intern("&"); id_rshift = rb_intern(">>"); id_lshift = rb_intern("<<"); id_lt = rb_intern("<"); id_plus = rb_intern("+"); id_uminus = rb_intern("-@"); id_abs = rb_intern("abs"); rb_global_variable(&max_PRUint32); max_PRUint32 = UINT2NUM(0xffffffffL); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_io_constants.c0000644000175000017500000000206712002536277021603 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" void Init_glib_io_constants(void) { VALUE RG_TARGET_NAMESPACE = mGLib; /* GIOCondition */ G_DEF_CLASS(G_TYPE_IO_CONDITION, "IOCondition", RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/glib2.def0000644000175000017500000000704212257552167017100 0ustar koukouEXPORTS Init_glib2 mGLib DATA rbgobj_cType DATA rbgobj_id_children DATA rbgobj_add_relative rbgobj_invalidate_relatives rbgobj_add_relative_removable rbgobj_get_relative_removable rbgobj_remove_relative rbgobj_remove_relative_all rbgobj_define_class rbgobj_define_class_dynamic rbgobj_register_mark_func rbgobj_register_free_func rbgobj_instance_from_ruby_object rbgobj_ruby_object_from_instance rbgobj_ruby_object_from_instance2 rbgobj_ruby_object_from_instance_with_unref rbgobj_instance_unref rbgobj_get_ruby_object_from_gobject rbgobj_create_object rbgobj_gobject_new rbgobj_gobject_initialize rbgobj_boxed_create rbgobj_boxed_get rbgobj_boxed_get_default rbgobj_boxed_not_copy_obj rbgobj_boxed_unown rbgobj_make_boxed rbgobj_make_boxed_raw rbgobj_make_boxed_default rbgobj_add_abstract_but_create_instance_class rbgobj_gtype_get rbgobj_gtype_new rbgobj_gvalue_to_rvalue rbgobj_gvalue_to_rvalue_unset rbgobj_rvalue_to_gvalue rbgobj_initialize_gvalue rbgobj_initialize_object rbgobj_lookup_class rbgobj_lookup_class_by_gtype rbgobj_gtype_to_ruby_class rbgobj_ptr2cptr rbgobj_ptr_new rbgobj_make_enum rbgobj_get_enum rbgobj_make_flags rbgobj_get_flags rbgobj_register_g2r_func rbgobj_register_r2g_func rbgobj_register_class rbgobj_register_property_getter rbgobj_register_property_setter rbgobj_set_signal_func rbgobj_get_signal_func rbgobj_add_constants rbgobj_constant_remap rbgobj_signal_wrap g_rclosure_new g_rclosure_attach g_rclosure_set_tag rbgobj_ruby_value_get_type g_value_get_ruby_value g_value_set_ruby_value g_key_file_get_type rbg_rval_inspect rbg_string_value_ptr rbg_rval2cstr rbg_rval2cstr_accept_nil rbg_rval2cstr_accept_symbol rbg_rval2cstr_accept_symbol_accept_nil rbg_rval2glibid rbg_cstr2rval rbg_cstr2rval_len rbg_cstr2rval_len_free rbg_cstr2rval_with_encoding rbg_cstr2rval_len_with_encoding rbg_cstr2rval_free rbg_cstr2rval_with_free rbg_filename_to_ruby rbg_filename_to_ruby_free rbg_filename_from_ruby rbg_filename_gslist_to_array_free rbg_rval2strv rbg_rval2strv_accept_nil rbg_rval2strv_dup rbg_rval2strv_dup_accept_nil rbg_strv2rval rbg_strv2rval_free rbg_rval2gbooleans rbg_rval2gints rbg_rval2gint8s rbg_rval2guint8s rbg_rval2guint16s rbg_rval2guint32s rbg_rval2gdoubles rbg_gints2rval rbg_gints2rval_free rbg_glist2rval rbg_gslist2rval rbg_glist2rval_with_type rbg_gslist2rval_with_type rbg_define_method rbg_define_singleton_method rbg_to_array rbg_to_hash rbg_check_array_type rbg_check_hash_type rbg_scan_options rbgutil_id_module_eval DATA rbgutil_def_setters rbgutil_glist2ary rbgutil_glist2ary_boxed rbgutil_glist2ary_string rbgutil_glist2ary_and_free rbgutil_glist2ary_boxed_and_free rbgutil_glist2ary_string_and_free rbgutil_gslist2ary rbgutil_gslist2ary_boxed rbgutil_gslist2ary_and_free rbgutil_gslist2ary_boxed_and_free rbgutil_set_properties rbgutil_glibid_r2g_func rbgutil_sym_g2r_func rbgutil_protect rbgutil_invoke_callback rbgutil_start_callback_dispatch_thread rbgutil_stop_callback_dispatch_thread rbgutil_string_set_utf8_encoding rbgutil_key_equal rbgerr_define_gerror rbgerr_gerror2exception rbgobj_convert_define rbgobj_gc_mark_gvalue rbgobj_gc_mark_instance rbglib_num_to_uint64 rbglib_uint64_to_num rbglib_num_to_int64 rbglib_int64_to_num g_source_get_type g_connect_flags_get_type g_poll_fd_get_type g_signal_flags_get_type ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgcompat.h0000644000175000017500000000175712077252561017552 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2007 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGCOMPAT_H__ #define __RBGCOMPAT_H__ G_BEGIN_DECLS G_END_DECLS #endif ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_closure.c0000644000175000017500000002210012126557022020544 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE cClosure static ID id_call, id_closures; static gboolean rclosure_initialized = FALSE; #define TAG_SIZE 64 typedef struct _GRClosure GRClosure; struct _GRClosure { GClosure closure; VALUE callback; VALUE extra_args; VALUE rb_holder; gint count; GList *objects; GValToRValSignalFunc g2r_func; gchar tag[TAG_SIZE]; }; static VALUE rclosure_default_g2r_func(guint num, const GValue *values) { guint i; VALUE args = rb_ary_new2(num); for (i = 0; i < num; i++) rb_ary_store(args, i, GVAL2RVAL(&values[i])); return args; } struct marshal_arg { GClosure* closure; GValue* return_value; guint n_param_values; const GValue* param_values; gpointer invocation_hint; gpointer marshal_data; }; static int rclosure_alive_p(GRClosure *rclosure) { return (rclosure->count > 0 && !NIL_P(rclosure->rb_holder)); } static VALUE rclosure_marshal_do(VALUE arg_) { struct marshal_arg *arg; GRClosure* rclosure; GValue* return_value; guint n_param_values; const GValue* param_values; /* gpointer invocation_hint;*/ /* gpointer marshal_data; */ VALUE ret = Qnil; VALUE args; GValToRValSignalFunc func; arg = (struct marshal_arg*)arg_; rclosure = (GRClosure *)(arg->closure); return_value = arg->return_value; n_param_values = arg->n_param_values; param_values = arg->param_values; /* invocation_hint = arg->invocation_hint; */ /* marshal_data = arg->marshal_data; */ if (rclosure->g2r_func){ func = (GValToRValSignalFunc)rclosure->g2r_func; } else { func = (GValToRValSignalFunc)rclosure_default_g2r_func; } args = (*func)(n_param_values, param_values); if (rclosure_alive_p(rclosure)) { VALUE callback, extra_args; callback = rclosure->callback; extra_args = rclosure->extra_args; if (!NIL_P(extra_args)) { args = rb_ary_concat(args, extra_args); } ret = rb_apply(callback, id_call, args); } else { rb_warn("GRClosure invoking callback: already destroyed: %s", rclosure->tag[0] ? rclosure->tag : "(anonymous)"); } if (return_value && G_VALUE_TYPE(return_value)) rbgobj_rvalue_to_gvalue(ret, return_value); return Qnil; } static void rclosure_marshal(GClosure* closure, GValue* return_value, guint n_param_values, const GValue* param_values, gpointer invocation_hint, gpointer marshal_data) { struct marshal_arg arg; if (!rclosure_initialized) { g_closure_invalidate(closure); return; } arg.closure = closure; arg.return_value = return_value; arg.n_param_values = n_param_values; arg.param_values = param_values; arg.invocation_hint = invocation_hint; arg.marshal_data = marshal_data; G_PROTECT_CALLBACK(rclosure_marshal_do, &arg); } static void rclosure_weak_notify(gpointer data, GObject* where_the_object_was); static void rclosure_unref(GRClosure *rclosure) { rclosure->count--; if (!rclosure_alive_p(rclosure)) { GList *next; for (next = rclosure->objects; next; next = next->next) { GObject *object = G_OBJECT(next->data); g_object_weak_unref(object, rclosure_weak_notify, rclosure); } g_list_free(rclosure->objects); rclosure->objects = NULL; if (!NIL_P(rclosure->rb_holder)) { DATA_PTR(rclosure->rb_holder) = NULL; rclosure->rb_holder = Qnil; } } } static void rclosure_invalidate(G_GNUC_UNUSED gpointer data, GClosure *closure) { GRClosure *rclosure = (GRClosure*)closure; if (rclosure->count > 0) { GList *next; rclosure->count = 1; for (next = rclosure->objects; next; next = next->next) { GObject *object = G_OBJECT(next->data); VALUE obj = rbgobj_ruby_object_from_instance2(object, FALSE); if (!NIL_P(rclosure->rb_holder) && !NIL_P(obj)) G_REMOVE_RELATIVE(obj, id_closures, rclosure->rb_holder); } rclosure_unref(rclosure); } } static void gr_closure_holder_mark(GRClosure *rclosure) { if (!rclosure) return; rb_gc_mark(rclosure->callback); rb_gc_mark(rclosure->extra_args); } static void gr_closure_holder_free(GRClosure *rclosure) { if (!rclosure) return; if (rclosure->count > 0) { rclosure->count = 1; /* No need to remove us from the relatives hash of our objects, as * those aren't alive anymore anyway */ rclosure_unref(rclosure); } } GClosure* g_rclosure_new(VALUE callback_proc, VALUE extra_args, GValToRValSignalFunc g2r_func) { GRClosure* closure; closure = (GRClosure*)g_closure_new_simple(sizeof(GRClosure), NULL); closure->count = 1; closure->g2r_func = g2r_func; closure->objects = NULL; closure->callback = callback_proc; closure->extra_args = extra_args; closure->rb_holder = Data_Wrap_Struct(rb_cData, gr_closure_holder_mark, gr_closure_holder_free, closure); closure->tag[0] = '\0'; g_closure_set_marshal((GClosure*)closure, &rclosure_marshal); g_closure_add_invalidate_notifier((GClosure*)closure, NULL, &rclosure_invalidate); return (GClosure*)closure; } static void rclosure_weak_notify(gpointer data, GObject* where_the_object_was) { GRClosure *rclosure = data; if (rclosure_alive_p(rclosure)) { rclosure->objects = g_list_remove(rclosure->objects, where_the_object_was); rclosure_unref(rclosure); } } void g_rclosure_attach(GClosure *closure, VALUE object) { static VALUE mGLibObject = (VALUE)NULL; GRClosure *rclosure = (GRClosure *)closure; G_RELATIVE2(object, Qnil, id_closures, rclosure->rb_holder); if (!mGLibObject) { mGLibObject = rb_const_get(mGLib, rb_intern("Object")); } if (rb_obj_is_kind_of(object, mGLibObject)) { GObject *gobject; gobject = RVAL2GOBJ(object); rclosure->count++; g_object_weak_ref(gobject, rclosure_weak_notify, rclosure); rclosure->objects = g_list_prepend(rclosure->objects, gobject); } } void g_rclosure_set_tag(GClosure *closure, const gchar *tag) { GRClosure *rclosure = (GRClosure *)closure; if (tag) { strncpy(rclosure->tag, tag, TAG_SIZE); rclosure->tag[TAG_SIZE - 1] = '\0'; } else { rclosure->tag[0] = '\0'; } } static void rclosure_end_proc(G_GNUC_UNUSED VALUE _) { rclosure_initialized = FALSE; } static void init_rclosure(void) { id_call = rb_intern("call"); id_closures = rb_intern("closures"); rclosure_initialized = TRUE; rb_set_end_proc(rclosure_end_proc, Qnil); } /**********************************************************************/ static VALUE rg_initialize(VALUE self) { GClosure* closure = g_rclosure_new(rb_block_proc(), Qnil, NULL); G_INITIALIZE(self, closure); g_closure_sink(closure); return self; } static VALUE rg_in_marshal_p(VALUE self) { GClosure* closure = RVAL2BOXED(self, G_TYPE_CLOSURE); return CBOOL2RVAL(closure->in_marshal); } static VALUE rg_invalid_p(VALUE self) { GClosure* closure = RVAL2BOXED(self, G_TYPE_CLOSURE); return CBOOL2RVAL(closure->is_invalid); } static VALUE rg_invalidate(VALUE self) { GClosure* closure = RVAL2BOXED(self, G_TYPE_CLOSURE); g_closure_invalidate(closure); return self; } /**********************************************************************/ void Init_gobject_gclosure(void) { VALUE RG_TARGET_NAMESPACE; init_rclosure(); RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CLOSURE, "Closure", mGLib); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD_P(in_marshal, 0); RG_DEF_METHOD_P(invalid, 0); RG_DEF_METHOD(invalidate, 0); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobject.c0000644000175000017500000002540012257552167017524 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2006 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "ruby.h" #include "rbgprivate.h" #include #include "rbgprivate.h" static ID id_relatives; static ID id_delete; static ID id_module_eval; ID rbgobj_id_children; /**********************************************************************/ void rbgobj_initialize_object(VALUE obj, gpointer cobj) { GType type; GType parent_type; if (!cobj) rb_raise(rb_eRuntimeError, "failed to initialize"); type = RVAL2GTYPE(obj); for (parent_type = type; parent_type != G_TYPE_INVALID; parent_type = g_type_parent(parent_type)) { if (rbgobj_convert_initialize(parent_type, obj, cobj)) return; } type = G_TYPE_FUNDAMENTAL(type); switch (type){ case G_TYPE_OBJECT: rbgobj_gobject_initialize(obj, cobj); break; case G_TYPE_PARAM: rbgobj_param_spec_initialize(obj, cobj); break; case G_TYPE_BOXED: rbgobj_boxed_initialize(obj, cobj); break; default: rbgobj_convert_initialize(type, obj, cobj); break; } } gpointer rbgobj_instance_from_ruby_object(VALUE obj) { GType type; GType fundamental_type; if (NIL_P(obj)) return NULL; type = RVAL2GTYPE(obj); if (rbgobj_convert_has_type(type)) { gpointer instance; if (rbgobj_convert_robj2instance(type, obj, &instance)) return instance; } fundamental_type = G_TYPE_FUNDAMENTAL(type); switch (fundamental_type) { case G_TYPE_OBJECT: return rbgobj_get_gobject(obj); case G_TYPE_BOXED: return rbgobj_boxed_get(obj, type); case G_TYPE_PARAM: return rbgobj_get_param_spec(obj); default: { gpointer instance; if (!rbgobj_convert_robj2instance(fundamental_type, obj, &instance)) { rb_raise(rb_eTypeError, "%s isn't supported", rb_class2name(CLASS_OF(obj))); } return instance; } } } VALUE rbgobj_ruby_object_from_instance(gpointer instance) { return rbgobj_ruby_object_from_instance2(instance, TRUE); } VALUE rbgobj_ruby_object_from_instance2(gpointer instance, gboolean alloc) { VALUE object; GType type; if (!instance) return Qnil; type = G_TYPE_FROM_INSTANCE(instance); if (alloc) { GType parent_type; for (parent_type = type; parent_type != G_TYPE_INVALID; parent_type = g_type_parent(parent_type)) { if (rbgobj_convert_instance2robj(parent_type, instance, &object)) return object; } } switch (G_TYPE_FUNDAMENTAL(type)) { case G_TYPE_OBJECT: return rbgobj_get_ruby_object_from_gobject(instance, alloc); case G_TYPE_PARAM: return rbgobj_get_ruby_object_from_param_spec(instance, alloc); default: if (alloc) { rb_raise(rb_eTypeError, "%s isn't supported", g_type_name(type)); } else { return Qnil; } } } void rbgobj_instance_unref(gpointer instance) { GType type; type = G_TYPE_FROM_INSTANCE(instance); if (!rbgobj_convert_unref(type, instance)) { type = G_TYPE_FUNDAMENTAL(type); switch (type) { case G_TYPE_OBJECT: g_object_unref(instance); break; default: rbgobj_convert_unref(type, instance); break; } } } VALUE rbgobj_ruby_object_from_instance_with_unref(gpointer instance) { VALUE result = rbgobj_ruby_object_from_instance(instance); if (!NIL_P(result)) { rbgobj_instance_unref(instance); } return result; } /**********************************************************************/ void rbgobj_add_relative(VALUE obj, VALUE relative) { VALUE hash = Qnil; if (RVAL2CBOOL(rb_ivar_defined(obj, id_relatives))) hash = rb_ivar_get(obj, id_relatives); if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) { hash = rb_hash_new(); rb_ivar_set(obj, id_relatives, hash); } rb_hash_aset(hash, relative, Qnil); } void rbgobj_invalidate_relatives(VALUE obj) { if (RVAL2CBOOL(rb_ivar_defined(obj, id_relatives))) rb_ivar_set(obj, id_relatives, Qnil); if (RVAL2CBOOL(rb_ivar_defined(obj, rbgobj_id_children))) rb_ivar_set(obj, rbgobj_id_children, Qnil); } void rbgobj_add_relative_removable(VALUE obj, VALUE relative, ID obj_ivar_id, VALUE hash_key) { VALUE hash = Qnil; if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id))) hash = rb_ivar_get(obj, obj_ivar_id); if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) { hash = rb_hash_new(); rb_ivar_set(obj, obj_ivar_id, hash); } rb_hash_aset(hash, hash_key, relative); } VALUE rbgobj_get_relative_removable(VALUE obj, ID obj_ivar_id, VALUE hash_key) { VALUE hash = Qnil; if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id))) hash = rb_ivar_get(obj, obj_ivar_id); if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) { return Qnil; } return rb_hash_aref(hash, hash_key); } void rbgobj_remove_relative(VALUE obj, ID obj_ivar_id, VALUE hash_key) { VALUE hash = Qnil; if (RVAL2CBOOL(rb_ivar_defined(obj, obj_ivar_id))) hash = rb_ivar_get(obj, obj_ivar_id); if (NIL_P(hash) || TYPE(hash) != RUBY_T_HASH) { /* should not happen. */ } else { rb_funcall(hash, id_delete, 1, hash_key); } } void rbgobj_remove_relative_all(VALUE obj, ID obj_ivar_id) { rb_ivar_set(obj, obj_ivar_id, Qnil); } /**********************************************************************/ static GHashTable* prop_exclude_list; #define IS_FLAG(bitmask, flag) (((bitmask) & (flag)) == (flag)) void rbgobj_define_property_accessors(VALUE klass) { GType gtype; GParamSpec** pspecs = NULL; guint i; GString* source; guint n_properties = 0; gtype = CLASS2GTYPE(klass); if (G_TYPE_IS_INTERFACE(gtype)){ gpointer iface = g_type_default_interface_ref(gtype); pspecs = g_object_interface_list_properties(iface, &n_properties); g_type_default_interface_unref(iface); } else { GObjectClass* oclass = G_OBJECT_CLASS(g_type_class_ref(gtype)); pspecs = g_object_class_list_properties(oclass, &n_properties); g_type_class_unref(oclass); } if (n_properties == 0) return; source = g_string_new(NULL); for (i = 0; i < n_properties; i++){ GParamSpec* pspec = pspecs[i]; char* buf; char* prop_name; char* p; if (pspec->owner_type != gtype) continue; buf = g_strdup(pspec->name); for (p = buf; *p; p++) if (*p == '-') *p = '_'; if (!strncmp(buf, "is_", 3)) prop_name = buf + 3; else prop_name = buf; if (g_hash_table_lookup(prop_exclude_list, prop_name)){ g_free(buf); continue; } if (pspec->flags & G_PARAM_READABLE){ g_string_append_printf( source, "def %s%s; get_property('%s'); end\n", prop_name, (G_PARAM_SPEC_VALUE_TYPE(pspec) == G_TYPE_BOOLEAN) ? "?" : "", pspec->name); } if (IS_FLAG(pspec->flags, G_PARAM_WRITABLE) && !IS_FLAG(pspec->flags, G_PARAM_CONSTRUCT_ONLY)){ g_string_append_printf(source, "def set_%s(val); set_property('%s', val); end\n", prop_name, pspec->name); #ifdef HAVE_NODE_ATTRASGN g_string_append_printf(source, "alias %s= set_%s\n", prop_name, prop_name); #else g_string_append_printf(source, "def %s=(val); set_property('%s', val); val; end\n", prop_name, pspec->name); #endif } g_free(buf); } if (source->len > 0) rb_funcall(klass, id_module_eval, 1, rb_str_new2(source->str)); g_string_free(source, TRUE); } /**********************************************************************/ void Init_gobject(void) { /* Not defined properties. They are already used as methods of Object */ prop_exclude_list = g_hash_table_new(g_str_hash, g_str_equal); g_hash_table_insert(prop_exclude_list, (gpointer)"class", (gpointer)"class"); g_hash_table_insert(prop_exclude_list, (gpointer)"clone", (gpointer)"clone"); g_hash_table_insert(prop_exclude_list, (gpointer)"dup", (gpointer)"dup"); g_hash_table_insert(prop_exclude_list, (gpointer)"extend", (gpointer)"extend"); g_hash_table_insert(prop_exclude_list, (gpointer)"freeze", (gpointer)"freeze"); g_hash_table_insert(prop_exclude_list, (gpointer)"hash", (gpointer)"hash"); g_hash_table_insert(prop_exclude_list, (gpointer)"method", (gpointer)"method"); g_hash_table_insert(prop_exclude_list, (gpointer)"methods", (gpointer)"methods"); g_hash_table_insert(prop_exclude_list, (gpointer)"object_id", (gpointer)"object_id"); g_hash_table_insert(prop_exclude_list, (gpointer)"taint", (gpointer)"taint"); g_hash_table_insert(prop_exclude_list, (gpointer)"untaint", (gpointer)"untaint"); /* IDs */ id_relatives = rb_intern("__relatives__"); id_delete = rb_intern("delete"); id_module_eval = rb_intern("module_eval"); rbgobj_id_children = rb_intern("__stored_children__"); Init_gobject_convert(); Init_gobject_gtype(); Init_gobject_typeinterface(); Init_gobject_typeinstance(); Init_gobject_gvalue(); Init_gobject_gvaluetypes(); Init_gobject_gboxed(); Init_gobject_gstrv(); Init_gobject_value_array(); Init_gobject_genumflags(); Init_gobject_gparam(); Init_gobject_gparamspecs(); Init_gobject_gclosure(); Init_gobject_gobject(); Init_gobject_gsignal(); Init_gobject_gtypeplugin(); Init_gobject_gtypemodule(); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_boxed.c0000644000175000017500000001522412142464343020203 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE rbgobj_cBoxed VALUE RG_TARGET_NAMESPACE; static void boxed_mark(boxed_holder *holder) { const RGObjClassInfo *cinfo; cinfo = GTYPE2CINFO_NO_CREATE(holder->type); if (cinfo && cinfo->mark) cinfo->mark(holder->boxed); } static void boxed_free(boxed_holder *holder) { const RGObjClassInfo *cinfo; cinfo = GTYPE2CINFO_NO_CREATE(holder->type); if (cinfo && cinfo->free) cinfo->free(holder->boxed); if (holder->own && holder->boxed) g_boxed_free(holder->type, holder->boxed); free(holder); } /**********************************************************************/ static VALUE rbgobj_boxed_s_allocate(VALUE klass) { const RGObjClassInfo *cinfo = rbgobj_lookup_class(klass); boxed_holder *holder; VALUE result; if (cinfo->gtype == G_TYPE_BOXED) rb_raise(rb_eTypeError, "abstract class"); result = Data_Make_Struct(klass, boxed_holder, boxed_mark, boxed_free, holder); holder->type = cinfo->gtype; holder->boxed = NULL; holder->own = FALSE; return result; } static G_GNUC_NORETURN VALUE rg_initialize(VALUE self) { rb_raise(rb_eTypeError, "can't initialize %s", rb_class2name(CLASS_OF(self))); } static VALUE rg_inspect(VALUE self) { boxed_holder *holder; gchar *s; VALUE result; Data_Get_Struct(self, boxed_holder, holder); s = g_strdup_printf("#<%s:%p ptr=%p own=%s>", rb_class2name(CLASS_OF(self)), (void *)self, holder->boxed, holder->own ? "true" : "false"); result = rb_str_new2(s); g_free(s); return result; } static VALUE rg_initialize_copy(VALUE self, VALUE orig) { boxed_holder *holder1; boxed_holder *holder2; if (self == orig) return self; if (!rb_obj_is_instance_of(orig, rb_obj_class(self))) { rb_raise(rb_eTypeError, "wrong argument class"); } Data_Get_Struct(self, boxed_holder, holder1); Data_Get_Struct(orig, boxed_holder, holder2); holder1->boxed = g_boxed_copy(holder2->type, holder2->boxed); holder1->own = TRUE; if (!holder1->boxed) rb_raise(rb_eRuntimeError, "g_boxed_copy() failed"); return self; } /* deprecated */ VALUE rbgobj_boxed_create(VALUE klass) { return rbgobj_boxed_s_allocate(klass); } /**********************************************************************/ void rbgobj_boxed_initialize(VALUE obj, gpointer boxed) { boxed_holder *holder; Data_Get_Struct(obj, boxed_holder, holder); holder->boxed = boxed; holder->own = TRUE; } gpointer rbgobj_boxed_get_default(VALUE obj, GType gtype) { boxed_holder *holder; if (!RVAL2CBOOL(rb_obj_is_kind_of(obj, GTYPE2CLASS(gtype)))) rb_raise(rb_eArgError, "invalid argument %s (expect %s)", rb_class2name(CLASS_OF(obj)), rb_class2name(GTYPE2CLASS(gtype))); Data_Get_Struct(obj, boxed_holder, holder); if (!holder->boxed) rb_raise(rb_eArgError, "uninitialize %s", rb_class2name(CLASS_OF(obj))); return holder->boxed; } gpointer rbgobj_boxed_get(VALUE obj, GType gtype) { gpointer boxed = NULL; if (NIL_P(obj)) return NULL; if (rbgobj_convert_robj2instance(gtype, obj, &boxed)) { return boxed; } return rbgobj_boxed_get_default(obj, gtype); } VALUE rbgobj_make_boxed_raw(gpointer p, GType gtype, VALUE klass, gint flags) { VALUE result; boxed_holder *holder; result = rbgobj_boxed_s_allocate(klass); Data_Get_Struct(result, boxed_holder, holder); if (flags & RBGOBJ_BOXED_NOT_COPY) { holder->boxed = p; holder->own = FALSE; } else { holder->boxed = g_boxed_copy(gtype, p); holder->own = TRUE; } return result; } VALUE rbgobj_make_boxed_default(gpointer p, GType gtype) { const RGObjClassInfo *cinfo; cinfo = GTYPE2CINFO(gtype); return rbgobj_make_boxed_raw(p, gtype, cinfo->klass, cinfo->flags); } VALUE rbgobj_make_boxed(gpointer p, GType gtype) { VALUE result; if (!p) return Qnil; if (rbgobj_convert_instance2robj(gtype, p, &result)) { return result; } return rbgobj_make_boxed_default(p, gtype); } void rbgobj_boxed_not_copy_obj(GType gtype) { RGObjClassInfo *cinfo = (RGObjClassInfo *)GTYPE2CINFO(gtype); cinfo->flags |= RBGOBJ_BOXED_NOT_COPY; } void rbgobj_boxed_unown(VALUE boxed) { boxed_holder *holder; Data_Get_Struct(boxed, boxed_holder, holder); if (!holder->own) { rb_raise(rb_eArgError, "The boxed is already unowned: %p", boxed); } holder->own = FALSE; } /**********************************************************************/ static VALUE boxed_to_ruby(const GValue *from) { gpointer boxed; boxed = g_value_get_boxed(from); return rbgobj_make_boxed(boxed, G_VALUE_TYPE(from)); } static void boxed_from_ruby(VALUE from, GValue *to) { gpointer boxed; boxed = rbgobj_boxed_get(from, G_VALUE_TYPE(to)); g_value_set_boxed(to, boxed); } /**********************************************************************/ void Init_gobject_gboxed(void) { RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_BOXED, "Boxed", mGLib); rbgobj_register_g2r_func(G_TYPE_BOXED, boxed_to_ruby); rbgobj_register_r2g_func(G_TYPE_BOXED, boxed_from_ruby); rb_define_alloc_func(RG_TARGET_NAMESPACE, (VALUE(*)_((VALUE)))rbgobj_boxed_s_allocate); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0); rbg_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(inspect, 0); RG_DEF_METHOD(initialize_copy, 1); RG_DEF_ALIAS("copy", "dup"); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_shell.c0000664000175000017500000000346411740310343020203 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE mShell static VALUE rg_s_parse(G_GNUC_UNUSED VALUE self, VALUE command_line) { gint argc; gchar **argv; GError *error = NULL; if (!g_shell_parse_argv(RVAL2CSTR(command_line), &argc, &argv, &error)) RAISE_GERROR(error); return STRV2RVAL_FREE(argv); } static VALUE rg_s_quote(G_GNUC_UNUSED VALUE self, VALUE unquoted_string) { return CSTR2RVAL_FREE(g_shell_quote(RVAL2CSTR(unquoted_string))); } static VALUE rg_s_unquote(G_GNUC_UNUSED VALUE self, VALUE quoted_string) { GError *error = NULL; gchar *str = g_shell_unquote(RVAL2CSTR(quoted_string), &error); if (str == NULL) RAISE_GERROR(error); return CSTR2RVAL_FREE(str); } void Init_glib_shell(void) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "Shell"); RG_DEF_SMETHOD(parse, 1); RG_DEF_SMETHOD(quote, 1); RG_DEF_SMETHOD(unquote, 1); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobject.h0000644000175000017500000003014712257552167017535 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2006 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGOBJECT_H__ #define __RBGOBJECT_H__ #include #include "ruby.h" #include "rbglib.h" #include "rbgutil.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* macros */ #define G_INITIALIZE(obj, cobj)\ (rbgobj_initialize_object(obj, (gpointer)cobj)) #define G_DEF_CLASS(gtype, name, module)\ (rbgobj_define_class(gtype, name, module, 0, 0, Qnil)) #define G_DEF_CLASS_WITH_GC_FUNC(gtype, name, module, mark, free) \ (rbgobj_define_class(gtype, name, module, mark, free, Qnil)) #define G_DEF_CLASS2(gtype, name, module, mark, free) \ G_DEF_CLASS_WITH_GC_FUNC(gtype, name, module, mark, free) #define G_DEF_CLASS3(gtype_name, name, module)\ (rbgobj_define_class_dynamic(gtype_name, name, module, 0, 0)) #define G_DEF_CLASS_WITH_PARENT(gtype, name, module, parent) \ (rbgobj_define_class(gtype, name, module, 0, 0, parent)) #define G_DEF_CLASS4(gtype, name, module, parent) \ G_DEF_CLASS_WITH_PARENT(gtype, name, module, parent) #define G_DEF_INTERFACE(gtype, name, module)\ (rbgobj_define_class(gtype, name, module, 0, 0, Qnil)) #define G_DEF_INTERFACE2(gtype, name, module, mark, free)\ (rbgobj_define_class(gtype, name, module, mark, free, Qnil)) #define RG_DEF_CONVERSION(table) (rbgobj_convert_define(table)) #define G_RELATIVE(obj, rel) (rbgobj_add_relative(obj, rel)) /* G_RELATIVE2 is useless now. Try G_CHILD_ADD/REMOVE first. */ #define G_RELATIVE2(obj, rel, id, hash_key)\ (rbgobj_add_relative_removable(obj, rel, id, hash_key)) #define G_GET_RELATIVE(obj, id, hash_key)\ (rbgobj_get_relative_removable(obj, id, hash_key)) #define G_REMOVE_RELATIVE(obj, id, hash_key)\ (rbgobj_remove_relative(obj, id, hash_key)) RUBY_GLIB2_VAR ID rbgobj_id_children; #define G_CHILD_SET(self, id, child) (rb_ivar_set(self, id, child)) #define G_CHILD_UNSET(self, id) (rb_ivar_set(self, id, Qnil)) /* G_CHILD_ADD is same as G_RELATIVE, but the macro name is more obviously to use than G_RELATIVE, and also support "remove" operation with the key which is the object itself. */ #define G_CHILD_ADD(self, child) \ (rbgobj_add_relative_removable(self, Qnil, rbgobj_id_children, child)) #define G_CHILD_REMOVE(self, child) \ (rbgobj_remove_relative(self, rbgobj_id_children, child)) #define G_CHILD_REMOVE_ALL(self) \ (rbgobj_remove_relative_all(self, rbgobj_id_children)) #define G_DEF_SIGNAL_FUNC(klass, sig_name, func)\ (rbgobj_set_signal_func(klass, sig_name, func)) #define CLASS2CINFO(klass) (rbgobj_lookup_class(klass)) #define GTYPE2CINFO(gtype) (rbgobj_lookup_class_by_gtype(gtype, Qnil)) #define GTYPE2CINFO_NO_CREATE(gtype) (rbgobj_lookup_class_by_gtype_full(gtype, Qnil, FALSE)) #define RVAL2CINFO(obj) (rbgobj_lookup_class(CLASS_OF(obj))) #define GTYPE2CLASS(gtype) (rbgobj_gtype_to_ruby_class(gtype)) #define CLASS2GTYPE(klass) (rbgobj_lookup_class(klass)->gtype) #define RVAL2GTYPE(obj) (CLASS2GTYPE(CLASS_OF(obj))) #define RVAL2GOBJ(obj) (rbgobj_instance_from_ruby_object(obj)) #define GOBJ2RVAL(gobj) (rbgobj_ruby_object_from_instance(gobj)) #define GOBJ2RVAL_UNREF(gobj) (rbgobj_ruby_object_from_instance_with_unref(gobj)) #define GOBJ2RVALU(gobj) GOBJ2RVAL_UNREF(gobj) #define GVAL2RVAL(v) (rbgobj_gvalue_to_rvalue(v)) #define GVAL2RVAL_UNSET(v) (rbgobj_gvalue_to_rvalue(v)) #define RVAL2BOXED(obj, gtype) (rbgobj_boxed_get(obj, gtype)) #define BOXED2RVAL(cobj, gtype) (rbgobj_make_boxed(cobj, gtype)) #define RVAL2GENUM(obj, gtype) (rbgobj_get_enum(obj, gtype)) #define RVAL2GFLAGS(obj, gtype) (rbgobj_get_flags(obj, gtype)) #define GENUM2RVAL(n, gtype) (rbgobj_make_enum(n, gtype)) #define GFLAGS2RVAL(n, gtype) (rbgobj_make_flags(n, gtype)) #define RVAL2GPTR(object) (rbgobj_ptr2cptr(object)) #define GPTR2RVAL(ptr, gtype) (rbgobj_ptr_new(gtype, ptr)) #define G_DEF_CONSTANTS(mod, type, strip_prefix) \ rbgobj_add_constants(mod, type, strip_prefix) #define G_RENAME_CONSTANT(orig, alt) \ rbgobj_constant_remap(orig, alt) #define G_RENAME_NICK(orig, alt) \ rbgobj_constant_remap(orig, alt) typedef enum { RBGOBJ_ABSTRACT_BUT_CREATABLE = 1 << 0, /* deprecated */ RBGOBJ_BOXED_NOT_COPY = 1 << 1, RBGOBJ_DEFINED_BY_RUBY = 1 << 2, } RGObjClassFlag; typedef void (*RGMarkFunc)(gpointer object); typedef void (*RGFreeFunc)(gpointer object); typedef struct { VALUE klass; GType gtype; RGMarkFunc mark; RGFreeFunc free; int flags; /* RGObjClassFlag */ } RGObjClassInfo; /* rbgobject.c */ extern void rbgobj_initialize_object(VALUE obj, gpointer cobj); extern gpointer rbgobj_instance_from_ruby_object(VALUE obj); extern VALUE rbgobj_ruby_object_from_instance(gpointer instance); extern VALUE rbgobj_ruby_object_from_instance2(gpointer instance, gboolean alloc); extern VALUE rbgobj_ruby_object_from_instance_with_unref(gpointer instance); extern void rbgobj_instance_unref(gpointer instance); extern void rbgobj_add_relative(VALUE obj, VALUE relative); extern void rbgobj_invalidate_relatives(VALUE obj); extern void rbgobj_add_relative_removable(VALUE obj, VALUE relative, ID obj_ivar_id, VALUE hash_key); extern VALUE rbgobj_get_relative_removable(VALUE obj, ID obj_ivar_id, VALUE hash_key); extern void rbgobj_remove_relative(VALUE obj, ID obj_ivar_id, VALUE hash_key); extern void rbgobj_remove_relative_all(VALUE obj, ID obj_ivar_id); extern GObject* rbgobj_gobject_new(GType type, VALUE params_hash); extern VALUE rbgobj_create_object(VALUE klass); /* deprecated */ extern VALUE rbgobj_get_ruby_object_from_gobject(GObject* gobj, gboolean alloc); /* For Ruby/Gstreamer */ extern void rbgobj_gobject_initialize(VALUE obj, gpointer cobj); /* deprecated */ extern void rbgobj_add_abstract_but_create_instance_class(GType gtype); /* rbgobj_typeinstance.c */ extern void rbgobj_gc_mark_instance(gpointer instance); /* rbgobj_type.c */ extern const RGObjClassInfo *rbgobj_lookup_class(VALUE klass); extern const RGObjClassInfo *rbgobj_lookup_class_by_gtype(GType gtype, VALUE parent); extern const RGObjClassInfo *rbgobj_lookup_class_by_gtype_full(GType gtype, VALUE parent, gboolean create_object); extern VALUE rbgobj_gtype_to_ruby_class(GType gtype); extern VALUE rbgobj_define_class(GType gtype, const gchar* name, VALUE module, RGMarkFunc mark, RGFreeFunc free, VALUE parent); extern VALUE rbgobj_define_class_dynamic(const gchar* gtype_name, const gchar* name, VALUE module, RGMarkFunc mark, RGFreeFunc free); extern void rbgobj_register_class(VALUE klass, GType gtype, gboolean klass2gtype, gboolean gtype2klass); extern void rbgobj_register_mark_func(GType gtype, RGMarkFunc mark); extern void rbgobj_register_free_func(GType gtype, RGFreeFunc free); extern VALUE rbgobj_cType; extern VALUE rbgobj_gtype_new(GType gtype); extern GType rbgobj_gtype_get(VALUE obj); /* rbgobj_signal.c */ typedef VALUE (*GValToRValSignalFunc)(guint num,const GValue* values); extern void rbgobj_set_signal_func(VALUE klass, const gchar *sig_name, GValToRValSignalFunc func); extern GValToRValSignalFunc rbgobj_get_signal_func(guint signal_id); extern VALUE rbgobj_signal_wrap(guint sig_id); /* rbgobj_closure.c */ extern GClosure* g_rclosure_new(VALUE callback_proc, VALUE extra_args, GValToRValSignalFunc func); extern void g_rclosure_attach(GClosure *closure, VALUE object); extern void g_rclosure_set_tag(GClosure *closure, const gchar *tag); /* rbgobj_value.c */ extern VALUE rbgobj_gvalue_to_rvalue(const GValue* value); extern VALUE rbgobj_gvalue_to_rvalue_unset(GValue *value); extern void rbgobj_rvalue_to_gvalue(VALUE val, GValue* result); extern void rbgobj_initialize_gvalue(GValue *result, VALUE value); typedef void (*RValueToGValueFunc)(VALUE from, GValue* to); typedef VALUE (*GValueToRValueFunc)(const GValue* from); extern void rbgobj_register_r2g_func(GType gtype, RValueToGValueFunc func); extern void rbgobj_register_g2r_func(GType gtype, GValueToRValueFunc func); extern void rbgobj_gc_mark_gvalue(GValue* value); /* rbgobj_valuetypes.c */ extern VALUE rbgobj_ptr_new(GType type, gpointer ptr); extern gpointer rbgobj_ptr2cptr(VALUE ptr); #define RBGOBJ_TYPE_RUBY_VALUE (rbgobj_ruby_value_get_type()) extern GType rbgobj_ruby_value_get_type(void); extern VALUE g_value_get_ruby_value(const GValue* value); extern void g_value_set_ruby_value(GValue* value, VALUE ruby); /* rbgobj_object.c */ extern void rbgobj_register_property_setter(GType gtype, const char* prop_name, RValueToGValueFunc func); extern void rbgobj_register_property_getter(GType gtype, const char* prop_name, GValueToRValueFunc func); /* rbgobj_boxed.c */ extern VALUE rbgobj_boxed_create(VALUE klass); /* deprecated */ extern gpointer rbgobj_boxed_get(VALUE obj, GType gtype); extern gpointer rbgobj_boxed_get_default(VALUE obj, GType gtype); extern VALUE rbgobj_make_boxed(gpointer data, GType gtype); extern VALUE rbgobj_make_boxed_raw(gpointer p, GType gtype, VALUE klass, gint flags); extern VALUE rbgobj_make_boxed_default(gpointer data, GType gtype); extern void rbgobj_boxed_not_copy_obj(GType gtype); extern void rbgobj_boxed_unown(VALUE boxed); /* rbgobj_enums.c */ extern void rbgobj_constant_remap(const char *original, const char *replacement); extern void rbgobj_add_constants(VALUE mod, GType type, const gchar *strip_prefix); extern VALUE rbgobj_make_enum(gint n, GType gtype); extern gint rbgobj_get_enum(VALUE obj, GType gtype); extern VALUE rbgobj_make_flags(guint n, GType gtype); extern guint rbgobj_get_flags(VALUE obj, GType gtype); extern void rbgobj_define_const(VALUE mod, const char *name, VALUE value); /* rbglib_mainloop.c */ #if !GLIB_CHECK_VERSION(2,30,0) #define G_TYPE_MAIN_LOOP (g_main_loop_get_type()) extern GType g_main_loop_get_type(void); #endif /* rbglib_maincontext.c */ #if !GLIB_CHECK_VERSION(2,30,0) #define G_TYPE_MAIN_CONTEXT (g_main_context_get_type()) #define G_TYPE_SOURCE (g_source_get_type()) extern GType g_main_context_get_type(void); extern GType g_source_get_type(void); #endif #define G_TYPE_POLL_FD (g_poll_fd_get_type()) extern GType g_poll_fd_get_type(void); /* rbglib_keyfile.c */ #if !GLIB_CHECK_VERSION(2,31,2) #define G_TYPE_KEY_FILE (g_key_file_get_type()) extern GType g_key_file_get_type(void); #endif /* rbgobj_convert.c */ typedef struct { GType type; VALUE klass; gpointer user_data; GDestroyNotify notify; VALUE (*get_superclass)(gpointer user_data); void (*type_init_hook)(VALUE klass, gpointer user_data); void (*rvalue2gvalue)(VALUE value, GValue *result, gpointer user_data); VALUE (*gvalue2rvalue)(const GValue *value, gpointer user_data); void (*initialize)(VALUE rb_instance, gpointer insntance, gpointer user_data); gpointer (*robj2instance)(VALUE rb_instance, gpointer user_data); VALUE (*instance2robj)(gpointer instance, gpointer user_data); void (*unref)(gpointer instance, gpointer user_data); } RGConvertTable; extern void rbgobj_convert_define(const RGConvertTable *table); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __RBGOBJECT_H__ */ #include "rbgcompat.h" ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_utf8.c0000644000175000017500000001467212257552167020003 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #define RG_TARGET_NAMESPACE mUTF8 static VALUE rg_s_get_char(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE utf8, validate; gunichar result; rb_scan_args(argc, argv, "11", &utf8, &validate); if (RVAL2CBOOL(validate)) { StringValue(utf8); result = g_utf8_get_char_validated(RSTRING_PTR(utf8), RSTRING_LEN(utf8)); if (result == (gunichar)-1) { return INT2NUM(-1); } else if (result == (gunichar)-2) { return INT2NUM(-2); } } else { result = g_utf8_get_char(StringValueCStr(utf8)); } return UINT2NUM(result); } static VALUE rg_s_size(G_GNUC_UNUSED VALUE self, VALUE rb_utf8) { gchar *utf8; utf8 = StringValueCStr(rb_utf8); return INT2NUM(g_utf8_strlen(utf8, RSTRING_LEN(rb_utf8))); } static VALUE rg_s_reverse(G_GNUC_UNUSED VALUE self, VALUE rb_utf8) { VALUE result; gchar *utf8, *reversed_utf8; utf8 = StringValueCStr(rb_utf8); reversed_utf8 = g_utf8_strreverse(utf8, RSTRING_LEN(rb_utf8)); result = CSTR2RVAL(reversed_utf8); g_free(reversed_utf8); return result; } static VALUE rg_s_validate(G_GNUC_UNUSED VALUE self, VALUE str) { StringValue(str); return CBOOL2RVAL(g_utf8_validate(RSTRING_PTR(str), RSTRING_LEN(str), NULL)); } static VALUE rg_s_upcase(G_GNUC_UNUSED VALUE self, VALUE rb_utf8) { VALUE result; gchar *utf8, *upcased_utf8; utf8 = StringValueCStr(rb_utf8); upcased_utf8 = g_utf8_strup(utf8, RSTRING_LEN(rb_utf8)); result = CSTR2RVAL(upcased_utf8); g_free(upcased_utf8); return result; } static VALUE rg_s_downcase(G_GNUC_UNUSED VALUE self, VALUE rb_utf8) { VALUE result; gchar *utf8, *downcased_utf8; utf8 = StringValueCStr(rb_utf8); downcased_utf8 = g_utf8_strdown(utf8, RSTRING_LEN(rb_utf8)); result = CSTR2RVAL(downcased_utf8); g_free(downcased_utf8); return result; } static VALUE rg_s_casefold(G_GNUC_UNUSED VALUE self, VALUE rb_utf8) { VALUE result; gchar *utf8, *casefolded_utf8; utf8 = StringValueCStr(rb_utf8); casefolded_utf8 = g_utf8_casefold(utf8, RSTRING_LEN(rb_utf8)); result = CSTR2RVAL(casefolded_utf8); g_free(casefolded_utf8); return result; } static VALUE rg_s_normalize(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE rb_utf8, rb_mode, result; gchar *utf8, *normalized_utf8; GNormalizeMode mode = G_NORMALIZE_DEFAULT; rb_scan_args(argc, argv, "11", &rb_utf8, &rb_mode); if (!NIL_P(rb_mode)) mode = RVAL2GENUM(rb_mode, G_TYPE_NORMALIZE_MODE); utf8 = StringValueCStr(rb_utf8); normalized_utf8 = g_utf8_normalize(utf8, RSTRING_LEN(rb_utf8), mode); result = CSTR2RVAL(normalized_utf8); g_free(normalized_utf8); return result; } static VALUE rg_s_collate(G_GNUC_UNUSED VALUE self, VALUE utf8a, VALUE utf8b) { return INT2NUM(g_utf8_collate(StringValueCStr(utf8a), StringValueCStr(utf8b))); } static VALUE rg_s_collate_key(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE result, rb_utf8, for_filename; gchar *key, *utf8; gssize len; rb_scan_args(argc, argv, "11", &rb_utf8, &for_filename); utf8 = StringValueCStr(rb_utf8); len = RSTRING_LEN(rb_utf8); if (RVAL2CBOOL(for_filename)) key = g_utf8_collate_key_for_filename(utf8, len); else key = g_utf8_collate_key(utf8, len); result = CSTR2RVAL(key); g_free(key); return result; } static VALUE rg_s_to_utf16(G_GNUC_UNUSED VALUE self, VALUE rb_utf8) { VALUE result; gchar *utf8; gunichar2 *utf16; glong len, items_written; GError *error = NULL; utf8 = StringValueCStr(rb_utf8); len = RSTRING_LEN(rb_utf8); utf16 = g_utf8_to_utf16(utf8, len, NULL, &items_written, &error); if (error) RAISE_GERROR(error); result = CSTR2RVAL_LEN_UTF16((char *)utf16, items_written * sizeof(*utf16)); g_free(utf16); return result; } static VALUE rg_s_to_ucs4(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE result, rb_utf8, is_fast; gchar *utf8; gunichar *ucs4; glong len, items_written; rb_scan_args(argc, argv, "11", &rb_utf8, &is_fast); utf8 = StringValueCStr(rb_utf8); len = RSTRING_LEN(rb_utf8); if (RVAL2CBOOL(is_fast)) { ucs4 = g_utf8_to_ucs4_fast(utf8, len, &items_written); } else { GError *error = NULL; ucs4 = g_utf8_to_ucs4(utf8, len, NULL, &items_written, &error); if (error) RAISE_GERROR(error); } result = CSTR2RVAL_LEN_UCS4((char *)ucs4, items_written * sizeof(*ucs4)); g_free(ucs4); return result; } void Init_glib_utf8(void) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "UTF8"); /* Not implemented. g_utf8_next_char */ RG_DEF_SMETHOD(get_char, -1); /* Not implemented. g_utf8_offset_to_pointer g_utf8_pointer_to_offset g_utf8_prev_char g_utf8_find_next_char g_utf8_find_prev_char g_utf8_prev_char */ RG_DEF_SMETHOD(size, 1); /* Not implemented. g_utf8_strncpy g_utf8_strrchr */ RG_DEF_SMETHOD(reverse, 1); RG_DEF_SMETHOD(validate, 1); RG_DEF_SMETHOD(upcase, 1); RG_DEF_SMETHOD(downcase, 1); RG_DEF_SMETHOD(casefold, 1); RG_DEF_SMETHOD(normalize, -1); RG_DEF_SMETHOD(collate, 2); RG_DEF_SMETHOD(collate_key, -1); RG_DEF_SMETHOD(to_utf16, 1); RG_DEF_SMETHOD(to_ucs4, -1); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_typeinterface.c0000644000175000017500000001126712257552167021760 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE mMetaInterface VALUE rbgobj_mInterface; VALUE RG_TARGET_NAMESPACE; static VALUE rg_append_features(G_GNUC_UNUSED VALUE self, VALUE klass) { if (!rb_obj_is_kind_of(klass, cInstantiatable)) rb_raise(rb_eTypeError, "Not a subclass of GLib::Instantiatable"); return rb_call_super(1, &klass); } static VALUE rg_install_property(VALUE self, VALUE pspec_obj) { const RGObjClassInfo* cinfo = rbgobj_lookup_class(self); gpointer ginterface; GParamSpec* pspec; if (cinfo->klass != self) rb_raise(rb_eTypeError, "%s isn't registered class", rb_class2name(self)); pspec = G_PARAM_SPEC(RVAL2GOBJ(pspec_obj)); ginterface = g_type_default_interface_ref(cinfo->gtype); g_object_interface_install_property(ginterface, pspec); g_type_default_interface_unref(ginterface); /* FIXME: define accessor methods */ return Qnil; } static VALUE rg_property(VALUE self, VALUE property_name) { gpointer ginterface; const char* name; GParamSpec* prop; VALUE result; GType gtype = CLASS2GTYPE(self); if (SYMBOL_P(property_name)) name = rb_id2name(SYM2ID(property_name)); else name = StringValuePtr(property_name); if (!G_TYPE_IS_INTERFACE(gtype)) rb_raise(rb_eTypeError, "%s isn't interface module", rb_class2name(self)); /* XXX: g_type_default_interface_ref(G_TYPE_INTERFACE) causes SEGV. */ if (gtype == G_TYPE_INTERFACE) { rb_raise(rb_const_get(mGLib, rb_intern("NoPropertyError")), "No such property: %s", name); } ginterface = g_type_default_interface_ref(gtype); prop = g_object_interface_find_property(ginterface, name); if (!prop){ g_type_default_interface_unref(ginterface); rb_raise(rb_const_get(mGLib, rb_intern("NoPropertyError")), "No such property: %s", name); } result = GOBJ2RVAL(prop); g_type_default_interface_unref(ginterface); return result; } static VALUE rg_properties(int argc, VALUE* argv, VALUE self) { guint n_properties; GParamSpec** props; VALUE inherited_too; VALUE ary = rb_ary_new(); guint i; gpointer ginterface; GType gtype = CLASS2GTYPE(self); if (rb_scan_args(argc, argv, "01", &inherited_too) == 0) inherited_too = Qtrue; if (!G_TYPE_IS_INTERFACE(gtype)) rb_raise(rb_eTypeError, "%s isn't interface module", rb_class2name(self)); /* XXX: g_type_default_interface_ref(G_TYPE_INTERFACE) causes SEGV. */ if (gtype == G_TYPE_INTERFACE) return ary; ginterface = g_type_default_interface_ref(gtype); props = g_object_interface_list_properties(ginterface, &n_properties); for (i = 0; i < n_properties; i++){ if (RVAL2CBOOL(inherited_too) || GTYPE2CLASS(props[i]->owner_type) == self) rb_ary_push(ary, rb_str_new2(props[i]->name)); } g_free(props); g_type_default_interface_unref(ginterface); return ary; } void rbgobj_init_interface(VALUE interf) { static VALUE rb_mGLibInterface = Qnil; rb_extend_object(interf, RG_TARGET_NAMESPACE); if (CLASS2GTYPE(interf) == G_TYPE_INTERFACE) { rb_mGLibInterface = interf; } else { rb_extend_object(interf, rb_mGLibInterface); rb_include_module(interf, rb_mGLibInterface); rbgobj_define_property_accessors(interf); } } void Init_gobject_typeinterface(void) { RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "MetaInterface"); rbg_define_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0); RG_DEF_METHOD(append_features, 1); RG_DEF_METHOD(install_property, 1); RG_DEF_METHOD(property, 1); RG_DEF_METHOD(properties, -1); rbgobj_mInterface = G_DEF_INTERFACE(G_TYPE_INTERFACE, "Interface", mGLib); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_convert.c0000664000175000017500000001252011740310343020545 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2009 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 KUBO Takehiro * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #define RG_TARGET_NAMESPACE mGLib static VALUE rg_s_convert(G_GNUC_UNUSED VALUE self, VALUE str, VALUE to, VALUE from) { GError *err = NULL; gchar* ret; gsize written; VALUE s = Qnil; StringValue(str); ret = g_convert(RSTRING_PTR(str), RSTRING_LEN(str), StringValuePtr(to), StringValuePtr(from), NULL, &written, &err); if (err != NULL) RAISE_GERROR(err); s = rb_str_new(ret, written); g_free(ret); return s; } static VALUE rg_s_locale_to_utf8(G_GNUC_UNUSED VALUE self, VALUE str) { GError *err = NULL; VALUE s = Qnil; gchar* ret; gsize written; StringValue(str); ret = g_locale_to_utf8(RSTRING_PTR(str), RSTRING_LEN(str), NULL, &written, &err); if (err != NULL) RAISE_GERROR(err); s = rb_str_new(ret, written); g_free(ret); return s; } static VALUE rg_s_locale_from_utf8(G_GNUC_UNUSED VALUE self, VALUE str) { GError *err = NULL; VALUE s = Qnil; gchar* ret; gsize written; StringValue(str); ret = g_locale_from_utf8(RSTRING_PTR(str), RSTRING_LEN(str), NULL, &written, &err); if (err != NULL) RAISE_GERROR(err); s = rb_str_new(ret, written); g_free(ret); return s; } static VALUE rg_s_filename_to_utf8(G_GNUC_UNUSED VALUE self, VALUE str) { GError *err = NULL; VALUE s = Qnil; gchar* ret; gsize written; StringValue(str); ret = g_filename_to_utf8(RSTRING_PTR(str), RSTRING_LEN(str), NULL, &written, &err); if (err != NULL) RAISE_GERROR(err); s = rb_str_new(ret, written); g_free(ret); return s; } static VALUE rg_s_filename_from_utf8(G_GNUC_UNUSED VALUE self, VALUE str) { GError *err = NULL; VALUE s = Qnil; gchar* ret; gsize written; StringValue(str); ret = g_filename_from_utf8(RSTRING_PTR(str), RSTRING_LEN(str), NULL, &written, &err); if (err != NULL) RAISE_GERROR(err); s = rb_str_new(ret, written); g_free(ret); return s; } static VALUE rg_s_filename_to_uri(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE filename, hostname, s; GError *err = NULL; gchar* ret; rb_scan_args(argc, argv, "11", &filename, &hostname); ret = g_filename_to_uri(StringValuePtr(filename), NIL_P(hostname) ? NULL : StringValuePtr(hostname), &err); if (err) RAISE_GERROR(err); s = rb_str_new2(ret); g_free(ret); return s; } static VALUE rg_s_filename_from_uri(G_GNUC_UNUSED VALUE self, VALUE str) { GError *err = NULL; VALUE s; gchar* filename; char* hostname; filename = g_filename_from_uri(StringValuePtr(str), &hostname, &err); if (err) RAISE_GERROR(err); s = rb_ary_new3(2, rb_str_new2(filename), hostname ? rb_str_new2(hostname) : Qnil); g_free(filename); g_free(hostname); return s; } static VALUE rg_s_utf8_validate(G_GNUC_UNUSED VALUE self, VALUE str) { rb_warning("GLib.utf8_validate is deprecated. Use GLib::UTF8.validate instead."); StringValue(str); return CBOOL2RVAL(g_utf8_validate(RSTRING_PTR(str), RSTRING_LEN(str), NULL)); } void Init_glib_convert(void) { VALUE cCharError = G_DEF_ERROR2(G_CONVERT_ERROR, "ConvertError", RG_TARGET_NAMESPACE, rb_eIOError); rb_define_const(cCharError, "NO_CONVERSION", INT2NUM(G_CONVERT_ERROR_NO_CONVERSION)); rb_define_const(cCharError, "ILLEGAL_SEQUENCE", INT2NUM(G_CONVERT_ERROR_ILLEGAL_SEQUENCE)); rb_define_const(cCharError, "FAILED", INT2NUM(G_CONVERT_ERROR_FAILED)); rb_define_const(cCharError, "PARTIAL_INPUT", INT2NUM(G_CONVERT_ERROR_PARTIAL_INPUT)); rb_define_const(cCharError, "BAD_URI", INT2NUM(G_CONVERT_ERROR_BAD_URI)); rb_define_const(cCharError, "NOT_ABSOLUTE_PATH", INT2NUM(G_CONVERT_ERROR_NOT_ABSOLUTE_PATH)); /* glib/gunicode.h */ /* just for backward compatibility. Use GLib::UTF8.validate instead. */ RG_DEF_SMETHOD(utf8_validate, 1); /* glib/gconvert.h */ RG_DEF_SMETHOD(convert, 3); RG_DEF_SMETHOD(locale_to_utf8, 1); RG_DEF_SMETHOD(locale_from_utf8, 1); RG_DEF_SMETHOD(filename_to_utf8, 1); RG_DEF_SMETHOD(filename_from_utf8, 1); RG_DEF_SMETHOD(filename_to_uri, -1); RG_DEF_SMETHOD(filename_from_uri, 1); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_keyfile.c0000644000175000017500000005477412257552167020554 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #if !GLIB_CHECK_VERSION(2,31,2) /************************************************/ static GKeyFile* keyfile_copy(const GKeyFile* keyfile) { // GKeyFile* new_keyfile; g_return_val_if_fail (keyfile != NULL, NULL); /* new_keyfile = g_key_file_new(); *new_keyfile = (GKeyFile*)*keyfile; return new_keyfile; */ return (GKeyFile*)keyfile; } GType g_key_file_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static("GKeyFile", (GBoxedCopyFunc)keyfile_copy, (GBoxedFreeFunc)g_key_file_free); return our_type; } /************************************************/ #endif #define RG_TARGET_NAMESPACE cKeyFile #define _SELF(self) ((GKeyFile*)(RVAL2BOXED(self, G_TYPE_KEY_FILE))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_key_file_new()); return Qnil; } static VALUE rg_set_list_separator(VALUE self, VALUE sep) { g_key_file_set_list_separator(_SELF(self), NUM2INT(sep)); return self; } static VALUE rg_load_from_file(int argc, VALUE *argv, VALUE self) { VALUE file, flags; GError* error = NULL; gboolean ret; GKeyFileFlags gflags = G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS; rb_scan_args(argc, argv, "11", &file, &flags); if (!NIL_P(flags)){ gflags = RVAL2GFLAGS(flags, G_TYPE_KEY_FILE_FLAGS); } ret = g_key_file_load_from_file(_SELF(self), RVAL2CSTR(file), gflags, &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_load_from_data(int argc, VALUE *argv, VALUE self) { VALUE data, flags; GError* error = NULL; gboolean ret; GKeyFileFlags gflags = G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS; rb_scan_args(argc, argv, "11", &data, &flags); if (!NIL_P(flags)){ gflags = RVAL2GFLAGS(flags, G_TYPE_KEY_FILE_FLAGS); } StringValue(data); ret = g_key_file_load_from_data(_SELF(self), (const gchar*)RVAL2CSTR(data), (gsize)RSTRING_LEN(data), gflags, &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_load_from_data_dirs(int argc, VALUE *argv, VALUE self) { VALUE file, flags; GError* error = NULL; gboolean ret; gchar* full_path; GKeyFileFlags gflags = G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS; rb_scan_args(argc, argv, "11", &file, &flags); if (!NIL_P(flags)){ gflags = RVAL2GFLAGS(flags, G_TYPE_KEY_FILE_FLAGS); } StringValue(file); ret = g_key_file_load_from_data_dirs(_SELF(self), (const gchar*)RVAL2CSTR(file), &full_path, gflags, &error); if (! ret) RAISE_GERROR(error); return full_path ? CSTR2RVAL(full_path) : Qnil; } #if GLIB_CHECK_VERSION(2, 14, 0) static VALUE rg_load_from_dirs(int argc, VALUE *argv, VALUE self) { VALUE rb_file, rb_search_dirs, rb_flags; GError* error = NULL; gboolean success; const gchar *file; const gchar **search_dirs; gchar* full_path; GKeyFileFlags flags; rb_scan_args(argc, argv, "12", &rb_file, &rb_search_dirs, &rb_flags); file = RVAL2CSTR(rb_file); search_dirs = RVAL2STRV_ACCEPT_NIL(rb_search_dirs); flags = G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS; if (!NIL_P(rb_flags)) flags = RVAL2GFLAGS(rb_flags, G_TYPE_KEY_FILE_FLAGS); if (search_dirs != NULL) success = g_key_file_load_from_dirs(_SELF(self), file, search_dirs, &full_path, flags, &error); else success = g_key_file_load_from_data_dirs(_SELF(self), file, &full_path, flags, &error); g_free(search_dirs); if (!success) RAISE_GERROR(error); return CSTR2RVAL(full_path); } #endif static VALUE rg_to_data(VALUE self) { GError* error = NULL; gchar* data = g_key_file_to_data(_SELF(self), NULL, &error); if (error) RAISE_GERROR(error); return CSTR2RVAL_FREE(data); } static VALUE rg_start_group(VALUE self) { return CSTR2RVAL(g_key_file_get_start_group(_SELF(self))); } static VALUE rg_groups(VALUE self) { return STRV2RVAL_FREE(g_key_file_get_groups(_SELF(self), NULL)); } static VALUE rg_get_keys(VALUE self, VALUE group_name) { GError *error = NULL; gchar **keys = g_key_file_get_keys(_SELF(self), RVAL2CSTR(group_name), NULL, &error); if (error != NULL) RAISE_GERROR(error); return STRV2RVAL_FREE(keys); } static VALUE rg_has_group_p(VALUE self, VALUE group_name) { return CBOOL2RVAL(g_key_file_has_group(_SELF(self), (const gchar*)RVAL2CSTR(group_name))); } static VALUE rg_has_key_p(VALUE self, VALUE group_name, VALUE key) { GError* error = NULL; gboolean ret = g_key_file_has_key(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &error); if (error) RAISE_GERROR(error); return CBOOL2RVAL(ret); } static VALUE rg_get_value(VALUE self, VALUE group_name, VALUE key) { GError* error = NULL; gchar* ret = g_key_file_get_value(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &error); if (error) RAISE_GERROR(error); return CSTR2RVAL_FREE(ret); } static VALUE rg_get_string(VALUE self, VALUE group_name, VALUE key) { GError* error = NULL; gchar* ret = g_key_file_get_string(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &error); if (error) RAISE_GERROR(error); return CSTR2RVAL_FREE(ret); } static VALUE rg_get_locale_string(int argc, VALUE *argv, VALUE self) { VALUE group_name, key, locale; GError* error = NULL; gchar* ret; rb_scan_args(argc, argv, "21", &group_name, &key, &locale); ret = g_key_file_get_locale_string(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), (const gchar*)RVAL2CSTR_ACCEPT_NIL(locale), &error); if (error) RAISE_GERROR(error); return CSTR2RVAL_FREE(ret); } static VALUE rg_get_boolean(VALUE self, VALUE group_name, VALUE key) { GError* error = NULL; gboolean ret = g_key_file_get_boolean(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &error); if (error) RAISE_GERROR(error); return CBOOL2RVAL(ret); } static VALUE rg_get_integer(VALUE self, VALUE group_name, VALUE key) { GError* error = NULL; gint ret = g_key_file_get_integer(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &error); if (error) RAISE_GERROR(error); return INT2NUM(ret); } static VALUE rg_get_double(VALUE self, VALUE group_name, VALUE key) { GError* error = NULL; gdouble ret = g_key_file_get_double(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &error); if (error) RAISE_GERROR(error); return rb_float_new(ret); } static VALUE rg_get_string_list(VALUE self, VALUE group_name, VALUE key) { VALUE ary; gsize i; gsize length; GError* error = NULL; gchar** ret = g_key_file_get_string_list(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &length, &error); if (error) RAISE_GERROR(error); ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, CSTR2RVAL(ret[i])); } g_strfreev(ret); return ary; } static VALUE rg_get_locale_string_list(int argc, VALUE *argv, VALUE self) { VALUE group_name, key, locale; GError* error = NULL; VALUE ary; gsize i; gsize length; gchar** ret; rb_scan_args(argc, argv, "21", &group_name, &key, &locale); ret = g_key_file_get_locale_string_list(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), (const gchar*)RVAL2CSTR_ACCEPT_NIL(locale), &length, &error); if (error) RAISE_GERROR(error); ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, CSTR2RVAL(ret[i])); } g_strfreev(ret); return ary; } static VALUE rg_get_boolean_list(VALUE self, VALUE group_name, VALUE key) { VALUE ary; gsize i; gsize length; GError* error = NULL; gboolean* ret = g_key_file_get_boolean_list(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &length, &error); if (error) RAISE_GERROR(error); ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, CBOOL2RVAL(ret[i])); } return ary; } static VALUE rg_get_integer_list(VALUE self, VALUE group_name, VALUE key) { VALUE ary; gsize i; gsize length; GError* error = NULL; gint* ret = g_key_file_get_integer_list(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &length, &error); if (error) RAISE_GERROR(error); ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, INT2NUM(ret[i])); } return ary; } static VALUE rg_get_double_list(VALUE self, VALUE group_name, VALUE key) { VALUE ary; gsize i; gsize length; GError* error = NULL; gdouble* ret = g_key_file_get_double_list(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &length, &error); if (error) RAISE_GERROR(error); ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, rb_float_new(ret[i])); } return ary; } static VALUE rg_get_comment(VALUE self, VALUE group_name, VALUE key) { GError* error = NULL; gchar* ret = g_key_file_get_comment(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), &error); if (error) RAISE_GERROR(error); return CSTR2RVAL_FREE(ret); } static VALUE rg_set_value(VALUE self, VALUE group_name, VALUE key, VALUE value) { g_key_file_set_value(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), (const gchar*)RVAL2CSTR(value)); return self; } static VALUE rg_set_string(VALUE self, VALUE group_name, VALUE key, VALUE string) { g_key_file_set_string(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), (const gchar*)RVAL2CSTR(string)); return self; } static VALUE rg_set_locale_string(VALUE self, VALUE group_name, VALUE key, VALUE locale, VALUE locale_string) { g_key_file_set_locale_string(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), (const gchar*)RVAL2CSTR(locale), (const gchar*)RVAL2CSTR(locale_string)); return self; } static VALUE rg_set_boolean(VALUE self, VALUE group_name, VALUE key, VALUE value) { g_key_file_set_boolean(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), RVAL2CBOOL(value)); return self; } static VALUE rg_set_integer(VALUE self, VALUE group_name, VALUE key, VALUE value) { g_key_file_set_integer(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), NUM2INT(value)); return self; } static VALUE rg_set_double(VALUE self, VALUE group_name, VALUE key, VALUE value) { g_key_file_set_double(_SELF(self), (const gchar*)RVAL2CSTR(group_name), (const gchar*)RVAL2CSTR(key), NUM2DBL(value)); return self; } static VALUE rg_set_string_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist) { GKeyFile *key_file = _SELF(self); const gchar *group_name = RVAL2CSTR(rbgroup_name); const gchar *key = RVAL2CSTR(rbkey); long n; const gchar **list = RVAL2STRS(rblist, n); g_key_file_set_string_list(key_file, group_name, key, list, n); g_free(list); return self; } static VALUE rg_set_locale_string_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblocale, VALUE rblist) { GKeyFile *key_file = _SELF(self); const gchar *group_name = RVAL2CSTR(rbgroup_name); const gchar *key = RVAL2CSTR(rbkey); const gchar *locale = RVAL2CSTR(rblocale); long n; const gchar **list = RVAL2STRS(rblist, n); g_key_file_set_locale_string_list(key_file, group_name, key, locale, list, n); g_free(list); return self; } static VALUE rg_set_boolean_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist) { GKeyFile *key_file = _SELF(self); const gchar *group_name = RVAL2CSTR(rbgroup_name); const gchar *key = RVAL2CSTR(rbkey); long n; gboolean *list = RVAL2GBOOLEANS(rblist, n); g_key_file_set_boolean_list(key_file, group_name, key, list, n); g_free(list); return self; } static VALUE rg_set_integer_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist) { GKeyFile *key_file = _SELF(self); const gchar *group_name = RVAL2CSTR(rbgroup_name); const gchar *key = RVAL2CSTR(rbkey); long n; gint *list = RVAL2GINTS(rblist, n); g_key_file_set_integer_list(key_file, group_name, key, list, n); g_free(list); return self; } static VALUE rg_set_double_list(VALUE self, VALUE rbgroup_name, VALUE rbkey, VALUE rblist) { GKeyFile *key_file = _SELF(self); const gchar *group_name = RVAL2CSTR(rbgroup_name); const gchar *key = RVAL2CSTR(rbkey); long n; gdouble *list = RVAL2GDOUBLES(rblist, n); g_key_file_set_double_list(key_file, group_name, key, list, n); return self; } static VALUE rg_set_comment(VALUE self, VALUE group_name, VALUE key, VALUE comment) { GError* error = NULL; g_key_file_set_comment(_SELF(self), RVAL2CSTR(group_name), RVAL2CSTR_ACCEPT_NIL(key), RVAL2CSTR(comment), &error); if (error != NULL) RAISE_GERROR(error); return self; } static VALUE rg_remove_group(VALUE self, VALUE group_name) { GError* error = NULL; g_key_file_remove_group(_SELF(self), RVAL2CSTR(group_name), &error); if (error != NULL) RAISE_GERROR(error); return self; } static VALUE rg_remove_key(VALUE self, VALUE group_name, VALUE key) { GError* error = NULL; g_key_file_remove_key(_SELF(self), RVAL2CSTR(group_name), RVAL2CSTR(key), &error); if (error != NULL) RAISE_GERROR(error); return self; } static VALUE rg_remove_comment(VALUE self, VALUE group_name, VALUE key) { GError* error = NULL; g_key_file_remove_comment(_SELF(self), RVAL2CSTR(group_name), RVAL2CSTR(key), &error); if (error != NULL) RAISE_GERROR(error); return self; } void Init_glib_keyfile(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_KEY_FILE, "KeyFile", mGLib); G_DEF_ERROR(G_KEY_FILE_ERROR, "KeyFileError", mGLib, rb_eRuntimeError, G_TYPE_KEY_FILE_ERROR); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_list_separator, 1); RG_DEF_METHOD(load_from_file, -1); RG_DEF_METHOD(load_from_data, -1); RG_DEF_METHOD(load_from_data_dirs, -1); #if GLIB_CHECK_VERSION(2, 14, 0) RG_DEF_METHOD(load_from_dirs, -1); #endif RG_DEF_METHOD(to_data, 0); RG_DEF_METHOD(start_group, 0); RG_DEF_METHOD(groups, 0); RG_DEF_METHOD(get_keys, 1); RG_DEF_METHOD_P(has_group, 1); RG_DEF_METHOD_P(has_key, 2); RG_DEF_METHOD(get_value, 2); RG_DEF_METHOD(get_string, 2); RG_DEF_METHOD(get_locale_string, -1); RG_DEF_METHOD(get_boolean, 2); RG_DEF_METHOD(get_integer, 2); RG_DEF_METHOD(get_double, 2); RG_DEF_METHOD(get_string_list, 2); RG_DEF_METHOD(get_locale_string_list, -1); RG_DEF_METHOD(get_boolean_list, 2); RG_DEF_METHOD(get_integer_list, 2); RG_DEF_METHOD(get_double_list, 2); RG_DEF_METHOD(get_comment, 2); RG_DEF_METHOD(set_value, 3); RG_DEF_METHOD(set_string, 3); RG_DEF_METHOD(set_locale_string, 4); RG_DEF_METHOD(set_boolean, 3); RG_DEF_METHOD(set_integer, 3); RG_DEF_METHOD(set_double, 3); RG_DEF_METHOD(set_string_list, 3); RG_DEF_METHOD(set_locale_string_list, 4); RG_DEF_METHOD(set_boolean_list, 3); RG_DEF_METHOD(set_integer_list, 3); RG_DEF_METHOD(set_double_list, 3); RG_DEF_METHOD(set_comment, 3); RG_DEF_METHOD(remove_group, 1); RG_DEF_METHOD(remove_key, 2); RG_DEF_METHOD(remove_comment, 2); /* GKeyFileFlags */ G_DEF_CLASS(G_TYPE_KEY_FILE_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_KEY_FILE_FLAGS, "G_KEY_FILE_"); #if GLIB_CHECK_VERSION(2, 14, 0) /* Defines for handling freedesktop.org Desktop files */ rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_GROUP", CSTR2RVAL(G_KEY_FILE_DESKTOP_GROUP)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_TYPE", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_TYPE)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_VERSION", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_VERSION)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_NAME", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_NAME)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_GENERIC_NAME", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_NO_DISPLAY", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_COMMENT", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_COMMENT)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_ICON", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_ICON)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_HIDDEN", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_HIDDEN)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_ONLY_SHOW_IN", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_NOT_SHOW_IN", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_TRY_EXEC", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_TRY_EXEC)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_EXEC", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_EXEC)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_PATH", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_PATH)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_TERMINAL", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_TERMINAL)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_MIME_TYPE", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_MIME_TYPE)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_CATEGORIES", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_CATEGORIES)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_STARTUP_NOTIFY", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_STARTUP_WM_CLASS", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_KEY_URL", CSTR2RVAL(G_KEY_FILE_DESKTOP_KEY_URL)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_TYPE_APPLICATION", CSTR2RVAL(G_KEY_FILE_DESKTOP_TYPE_APPLICATION)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_TYPE_LINK", CSTR2RVAL(G_KEY_FILE_DESKTOP_TYPE_LINK)); rb_define_const(RG_TARGET_NAMESPACE, "DESKTOP_TYPE_DIRECTORY", CSTR2RVAL(G_KEY_FILE_DESKTOP_TYPE_DIRECTORY)); #endif } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_ucs4.c0000664000175000017500000000422411740310343017745 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #define RG_TARGET_NAMESPACE mUCS4 static VALUE rg_s_to_utf16(G_GNUC_UNUSED VALUE self, VALUE rb_ucs4) { VALUE result; gunichar *ucs4; gunichar2 *utf16; glong len, items_written; GError *error = NULL; ucs4 = (gunichar *)StringValuePtr(rb_ucs4); len = RSTRING_LEN(rb_ucs4) / sizeof(*ucs4); utf16 = g_ucs4_to_utf16(ucs4, len, NULL, &items_written, &error); if (error) RAISE_GERROR(error); result = CSTR2RVAL_LEN_UTF16((char *)utf16, items_written * sizeof(*utf16)); g_free(utf16); return result; } static VALUE rg_s_to_utf8(G_GNUC_UNUSED VALUE self, VALUE rb_ucs4) { VALUE result; gunichar *ucs4; gchar *utf8; glong len, items_written; GError *error = NULL; ucs4 = (gunichar *)StringValuePtr(rb_ucs4); len = RSTRING_LEN(rb_ucs4) / sizeof(*ucs4); utf8 = g_ucs4_to_utf8(ucs4, len, NULL, &items_written, &error); if (error) RAISE_GERROR(error); result = CSTR2RVAL_LEN(utf8, items_written); g_free(utf8); return result; } void Init_glib_ucs4(void) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "UCS4"); RG_DEF_SMETHOD(to_utf16, 1); RG_DEF_SMETHOD(to_utf8, 1); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_valuetypes.c0000644000175000017500000001426712102213526021300 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbgobject.h" VALUE rbgobj_ptr_new(GType type, gpointer ptr) { return Data_Wrap_Struct(GTYPE2CLASS(type), NULL, NULL, ptr); } gpointer rbgobj_ptr2cptr(VALUE ptr) { gpointer dest; if (rb_obj_is_kind_of(ptr, GTYPE2CLASS(G_TYPE_POINTER))){ Data_Get_Struct(ptr, void, dest); } else if (rb_obj_is_kind_of(ptr, rb_cObject)){ dest = (gpointer)ptr; } else{ rb_raise(rb_eTypeError, "not a pointer object"); } return dest; } static VALUE ptr_s_gtype(VALUE klass) { return rbgobj_gtype_new(rbgobj_lookup_class(klass)->gtype); } static VALUE ptr_gtype(VALUE self) { return ptr_s_gtype(CLASS_OF(self)); } static void Init_gtype_pointer(void) { VALUE cPtr = G_DEF_CLASS(G_TYPE_POINTER, "Pointer", mGLib); rbg_define_singleton_method(cPtr, "gtype", ptr_s_gtype, 1); rbg_define_method(cPtr, "gtype", ptr_gtype, 1); } /**********************************************************************/ static GHashTable* boxed_ruby_value_table; static VALUE boxed_ruby_value_table_wrapper; typedef struct { VALUE obj; guint ref_count; } boxed_ruby_value_counter; static void boxed_ruby_value_counter_mark(G_GNUC_UNUSED gpointer key, gpointer value, G_GNUC_UNUSED gpointer user_data) { boxed_ruby_value_counter* counter = value; if (counter->ref_count) rb_gc_mark(counter->obj); } static void boxed_ruby_value_table_mark(GHashTable* table) { g_hash_table_foreach(table, boxed_ruby_value_counter_mark, NULL); } static VALUE boxed_ruby_value_ref(VALUE val) { if (!SPECIAL_CONST_P(val)){ boxed_ruby_value_counter* counter; counter = g_hash_table_lookup(boxed_ruby_value_table, (gpointer)val); if (!counter){ counter = g_new(boxed_ruby_value_counter, 1); counter->obj = val; counter->ref_count = 1; g_hash_table_insert(boxed_ruby_value_table, (gpointer)val, counter); } else { counter->ref_count += 1; } } return val; } static void boxed_ruby_value_unref(VALUE val) { if (!SPECIAL_CONST_P(val)){ boxed_ruby_value_counter* counter; counter = g_hash_table_lookup(boxed_ruby_value_table, (gpointer)val); counter->ref_count -= 1; if (!counter->ref_count) g_hash_table_remove(boxed_ruby_value_table, (gpointer)val); } } struct transform_arg { const GValue *src_value; GValue *dest_value; }; static VALUE value_transform_ruby_any_impl(VALUE arg_) { struct transform_arg* arg = (struct transform_arg*)arg_; rbgobj_rvalue_to_gvalue(g_value_get_ruby_value(arg->src_value), arg->dest_value); return Qnil; } static void value_transform_ruby_any(const GValue *src_value, GValue *dest_value) { int state; struct transform_arg arg; arg.src_value = src_value; arg.dest_value = dest_value; rb_protect(&value_transform_ruby_any_impl, (VALUE)&arg, &state); } static void value_transform_any_ruby(const GValue *src_value, GValue *dest_value) { g_value_set_ruby_value(dest_value, GVAL2RVAL(src_value)); } GType rbgobj_ruby_value_get_type(void) { static GType our_type = 0; if (!our_type){ const GType table[] = { G_TYPE_CHAR, G_TYPE_UCHAR, G_TYPE_BOOLEAN, G_TYPE_INT, G_TYPE_UINT, G_TYPE_LONG, G_TYPE_ULONG, G_TYPE_INT64, G_TYPE_UINT64, G_TYPE_ENUM, G_TYPE_FLAGS, G_TYPE_FLOAT, G_TYPE_DOUBLE, G_TYPE_STRING, G_TYPE_POINTER, //G_TYPE_BOXED, G_TYPE_PARAM, G_TYPE_OBJECT, }; size_t i; our_type = g_boxed_type_register_static( "VALUE", (GBoxedCopyFunc)boxed_ruby_value_ref, (GBoxedFreeFunc)boxed_ruby_value_unref); for (i = 0; i < sizeof(table)/sizeof(table[0]); i++){ g_value_register_transform_func(table[i], our_type, value_transform_any_ruby); } g_value_register_transform_func(our_type, G_TYPE_BOOLEAN, value_transform_ruby_any); } return our_type; } VALUE g_value_get_ruby_value(const GValue* value) { return (VALUE)g_value_get_boxed(value); } void g_value_set_ruby_value(GValue* value, VALUE ruby) { g_value_set_boxed(value, (gconstpointer)ruby); } static void ruby_value_r2g(VALUE from, GValue* to) { g_value_set_ruby_value(to, from); } static void Init_boxed_ruby_value(void) { boxed_ruby_value_table = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, g_free); boxed_ruby_value_table_wrapper = Data_Wrap_Struct(rb_cData, boxed_ruby_value_table_mark, NULL, boxed_ruby_value_table); rb_global_variable(&boxed_ruby_value_table_wrapper); rbgobj_register_g2r_func(RBGOBJ_TYPE_RUBY_VALUE, g_value_get_ruby_value); rbgobj_register_r2g_func(RBGOBJ_TYPE_RUBY_VALUE, ruby_value_r2g); } /**********************************************************************/ void Init_gobject_gvaluetypes(void) { Init_gtype_pointer(); Init_boxed_ruby_value(); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_i18n.c0000644000175000017500000000233212257552167017662 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #undef _ #include #define RG_TARGET_NAMESPACE mGLib static VALUE rg_s_language_names(G_GNUC_UNUSED VALUE self) { return STRV2RVAL((const gchar **)g_get_language_names()); } void Init_glib_i18n(void) { /* glib/gi18n.h */ RG_DEF_SMETHOD(language_names, 0); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_spawnerror.c0000644000175000017500000000537711701304107021277 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * Copyright (C) 2004 Kazuhiro NISHIYAMA * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #define RG_TARGET_NAMESPACE cSpawnError void Init_glib_spawnerror(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_ERROR2(G_SPAWN_ERROR, "SpawnError", mGLib, rb_eIOError); rb_define_const(RG_TARGET_NAMESPACE, "FORK", INT2NUM(G_SPAWN_ERROR_FORK)); rb_define_const(RG_TARGET_NAMESPACE, "READ", INT2NUM(G_SPAWN_ERROR_READ)); rb_define_const(RG_TARGET_NAMESPACE, "CHDIR", INT2NUM(G_SPAWN_ERROR_CHDIR)); rb_define_const(RG_TARGET_NAMESPACE, "EACCES", INT2NUM(G_SPAWN_ERROR_ACCES)); rb_define_const(RG_TARGET_NAMESPACE, "EPERM", INT2NUM(G_SPAWN_ERROR_PERM)); rb_define_const(RG_TARGET_NAMESPACE, "E2BIG", INT2NUM(G_SPAWN_ERROR_2BIG)); rb_define_const(RG_TARGET_NAMESPACE, "ENOEXEC", INT2NUM(G_SPAWN_ERROR_NOEXEC)); rb_define_const(RG_TARGET_NAMESPACE, "ENAMETOOLONG", INT2NUM(G_SPAWN_ERROR_NAMETOOLONG)); rb_define_const(RG_TARGET_NAMESPACE, "ENOENT", INT2NUM(G_SPAWN_ERROR_NOENT)); rb_define_const(RG_TARGET_NAMESPACE, "ENOMEM", INT2NUM(G_SPAWN_ERROR_NOMEM)); rb_define_const(RG_TARGET_NAMESPACE, "ENOTDIR", INT2NUM(G_SPAWN_ERROR_NOTDIR)); rb_define_const(RG_TARGET_NAMESPACE, "ELOOP", INT2NUM(G_SPAWN_ERROR_LOOP)); rb_define_const(RG_TARGET_NAMESPACE, "ETXTBUSY", INT2NUM(G_SPAWN_ERROR_TXTBUSY)); rb_define_const(RG_TARGET_NAMESPACE, "EIO", INT2NUM(G_SPAWN_ERROR_IO)); rb_define_const(RG_TARGET_NAMESPACE, "ENFILE", INT2NUM(G_SPAWN_ERROR_NFILE)); rb_define_const(RG_TARGET_NAMESPACE, "EMFILE", INT2NUM(G_SPAWN_ERROR_MFILE)); rb_define_const(RG_TARGET_NAMESPACE, "EINVAL", INT2NUM(G_SPAWN_ERROR_INVAL)); rb_define_const(RG_TARGET_NAMESPACE, "EISDIR", INT2NUM(G_SPAWN_ERROR_ISDIR)); rb_define_const(RG_TARGET_NAMESPACE, "ELIBBAD", INT2NUM(G_SPAWN_ERROR_LIBBAD)); rb_define_const(RG_TARGET_NAMESPACE, "FAILED", INT2NUM(G_SPAWN_ERROR_FAILED)); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_unicode.c0000664000175000017500000000551111740310343020515 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #define RG_TARGET_NAMESPACE mUnicode static VALUE rbglib_m_charset(G_GNUC_UNUSED VALUE self) { const char *charset; g_get_charset(&charset); return CSTR2RVAL(charset); } static VALUE rg_s_canonical_ordering(G_GNUC_UNUSED VALUE self, VALUE rb_ucs4) { VALUE normalized_ucs4; gchar *original_str; gunichar *ucs4; gint len; original_str = StringValuePtr(rb_ucs4); len = RSTRING_LEN(rb_ucs4); ucs4 = g_memdup(original_str, len); g_unicode_canonical_ordering(ucs4, len); normalized_ucs4 = CSTR2RVAL_LEN_UCS4((const char *)ucs4, len); g_free(ucs4); return normalized_ucs4; } static VALUE rg_s_canonical_decomposition(G_GNUC_UNUSED VALUE self, VALUE unichar) { VALUE normalized_ucs4; gunichar *ucs4; gsize len; ucs4 = g_unicode_canonical_decomposition(NUM2UINT(unichar), &len); normalized_ucs4 = CSTR2RVAL_LEN_UCS4((const char *)ucs4, len * sizeof(gunichar)); g_free(ucs4); return normalized_ucs4; } void Init_glib_unicode(void) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "Unicode"); /* GUnicodeType */ G_DEF_CLASS(G_TYPE_UNICODE_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_UNICODE_TYPE, "G_UNICODE_"); /* GUnicodeBreakType */ G_DEF_CLASS(G_TYPE_UNICODE_BREAK_TYPE, "BreakType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_UNICODE_BREAK_TYPE, "G_UNICODE_"); #if GLIB_CHECK_VERSION(2,14,0) /* GUnicodeScript */ G_DEF_CLASS(G_TYPE_UNICODE_SCRIPT, "Script", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_UNICODE_SCRIPT, "G_UNICODE_"); #endif G_DEF_CLASS(G_TYPE_NORMALIZE_MODE, "NormalizeMode", mGLib); rbg_define_singleton_method(mGLib, "charset", rbglib_m_charset, 0); RG_DEF_SMETHOD(canonical_ordering, 1); RG_DEF_SMETHOD(canonical_decomposition, 1); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_flags.c0000664000175000017500000003223611740310343020173 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include #define RG_TARGET_NAMESPACE rbgobj_cFlags VALUE RG_TARGET_NAMESPACE; static ID id_new; static ID id_module_eval; static ID id_or; /**********************************************************************/ static VALUE resolve_flags_value(VALUE klass, VALUE nick_or_nicks) { int i, len; VALUE flags_value; if (!RVAL2CBOOL(rb_obj_is_kind_of(nick_or_nicks, rb_cArray))) return rg_enum_resolve_value(klass, nick_or_nicks); len = RARRAY_LEN(nick_or_nicks); flags_value = rb_funcall(klass, id_new, 0); for (i = 0; i < len; i++) { VALUE value; value = rg_enum_resolve_value(klass, RARRAY_PTR(nick_or_nicks)[i]); if (NIL_P(value)) return Qnil; flags_value = rb_funcall(flags_value, id_or, 1, value); } return flags_value; } void rg_flags_add_constants(VALUE mod, GType flags_type, const gchar *strip_prefix) { GFlagsClass *gclass; guint i; int prefix_len = strlen(strip_prefix); gclass = G_FLAGS_CLASS(g_type_class_ref(flags_type)); for (i = 0; i < gclass->n_values; i++) { const GFlagsValue* value = &gclass->values[i]; if (strncmp(value->value_name, strip_prefix, prefix_len)) { g_warning("\"%s\" doesn't have prefix \"%s\"", value->value_name, strip_prefix); } else { const char* name = value->value_name + prefix_len; rbgobj_define_const(mod, name, rbgobj_make_flags(value->value, flags_type)); } } g_type_class_unref(gclass); } /**********************************************************************/ typedef struct { GFlagsClass* gclass; guint value; GFlagsValue* info; } flags_holder; static void flags_free(flags_holder* p) { g_type_class_unref(p->gclass); free(p); } static flags_holder* flags_get_holder(VALUE obj) { flags_holder* p; Data_Get_Struct(obj, flags_holder, p); return p; } static VALUE make_flags(guint n, VALUE klass) { return rb_funcall(klass, id_new, 1, UINT2NUM(n)); } VALUE rbgobj_make_flags(guint n, GType gtype) { return make_flags(n, GTYPE2CLASS(gtype)); } guint rbgobj_get_flags(VALUE obj, GType gtype) { VALUE klass; if (!g_type_is_a(gtype, G_TYPE_FLAGS)) rb_raise(rb_eTypeError, "%s is not a %s", g_type_name(gtype), g_type_name(G_TYPE_FLAGS)); /* for compatibility */ if (rb_obj_is_kind_of(obj, rb_cInteger)) obj = rbgobj_make_flags(NUM2UINT(obj), gtype); klass = GTYPE2CLASS(gtype); if (!rb_obj_is_kind_of(obj, klass)) { VALUE flags_value = Qnil; flags_value = resolve_flags_value(klass, obj); if (!NIL_P(flags_value)) obj = flags_value; } if (rb_obj_is_kind_of(obj, klass)) return flags_get_holder(obj)->value; else rb_raise(rb_eTypeError, "not a %s: %s", rb_class2name(klass), RBG_INSPECT(obj)); } /**********************************************************************/ void rbgobj_init_flags_class(VALUE klass) { GFlagsClass* gclass = g_type_class_ref(CLASS2GTYPE(klass)); GString* source = g_string_new(NULL); guint i; for (i = 0; i < gclass->n_values; i++) { GFlagsValue* entry = &(gclass->values[i]); gchar* nick; gchar* p; gchar* replace_nick; replace_nick = rg_obj_constant_lookup(entry->value_nick); if (replace_nick){ nick = g_strdup(replace_nick); } else { nick = g_strdup(entry->value_nick); } for (p = nick; *p; p++) if (*p == '-' || *p == ' ') *p = '_'; else *p = tolower(*p); g_string_append_printf( source, "def %s%s?; self >= self.class.new(%d); end\n", g_ascii_isdigit(nick[0]) ? "_" : "", nick, entry->value); for (p = nick; *p; p++) *p = g_ascii_toupper(*p); #if 0 { ID id = rb_intern(nick); if (rb_is_const_id(id)) { rb_define_const(klass, nick, make_flags(entry->value, klass)); } } #else { rbgobj_define_const(klass, nick, make_flags(entry->value, klass)); } #endif g_free(nick); } rb_funcall(klass, id_module_eval, 1, rb_str_new2(source->str)); g_string_free(source, TRUE); g_type_class_unref(gclass); } static VALUE rg_s_mask(VALUE klass) { GFlagsClass* gclass = g_type_class_ref(CLASS2GTYPE(klass)); VALUE result = UINT2NUM(gclass->mask); g_type_class_unref(gclass); return result; } static VALUE rg_s_values(VALUE klass) { GFlagsClass *gclass; VALUE result; guint i; gclass = g_type_class_ref(CLASS2GTYPE(klass)); result = rb_ary_new(); for (i = 0; i < gclass->n_values; i++) { GFlagsValue *p = &(gclass->values[i]); rb_ary_push(result, make_flags(p->value, klass)); } g_type_class_unref(gclass); return result; } static VALUE flags_s_allocate(VALUE self) { GType gtype = CLASS2GTYPE(self); if (G_TYPE_IS_ABSTRACT(gtype)) { rb_raise(rb_eTypeError, "abstract class"); } else { flags_holder* p; VALUE result = Data_Make_Struct(self, flags_holder, NULL, flags_free, p); p->gclass = g_type_class_ref(gtype); p->value = 0; p->info = NULL; return result; } } static VALUE rg_initialize(int argc, VALUE* argv, VALUE self) { flags_holder* p = flags_get_holder(self); VALUE arg; rb_scan_args(argc, argv, "01", &arg); if (argc == 0) { p->value = 0; } else { if (rb_respond_to(arg, rb_intern("to_str"))) { const char* str = StringValuePtr(arg); p->info = g_flags_get_value_by_name(p->gclass, str); if (!p->info) p->info = g_flags_get_value_by_nick(p->gclass, str); if (!p->info) rb_raise(rb_eArgError, "invalid argument"); p->value = p->info->value; } else { p->value = NUM2UINT(arg); } } if (!p->info) { guint i; for (i = 0; i < p->gclass->n_values; i++){ GFlagsValue* val = &(p->gclass->values[i]); if (val->value == p->value){ p->info = val; break; } } } return Qnil; } static VALUE rg_to_i(VALUE self) { flags_holder* p = flags_get_holder(self); return UINT2NUM(p->value); } static VALUE rg_name(VALUE self) { flags_holder* p = flags_get_holder(self); return p->info ? rb_str_new2(p->info->value_name) : Qnil; } static VALUE rg_nick(VALUE self) { flags_holder* p = flags_get_holder(self); return p->info ? rb_str_new2(p->info->value_nick) : Qnil; } #define FLAGS_COMP_EQUAL 0 #define FLAGS_COMP_GREATER 1 #define FLAGS_COMP_LESS -1 #define FLAGS_COMP_ELSE -2 #define FLAGS_COMP_INCOMPARABLE -3 static gint flags_compare(VALUE self, VALUE rhs) { flags_holder* p = flags_get_holder(self); GType gtype = G_TYPE_FROM_CLASS(p->gclass); VALUE klass = GTYPE2CLASS(gtype); guint rhs_val; if (!rb_obj_is_kind_of(rhs, rb_cInteger)) { rhs = resolve_flags_value(klass, rhs); if (CLASS_OF(rhs) != CLASS_OF(self)) return FLAGS_COMP_INCOMPARABLE; } rhs_val = rbgobj_get_flags(rhs, gtype); if (p->value == rhs_val) return FLAGS_COMP_EQUAL; else if ((p->value & rhs_val) == rhs_val) return FLAGS_COMP_GREATER; else if ((p->value & rhs_val) == p->value) return FLAGS_COMP_LESS; else return FLAGS_COMP_ELSE; } static VALUE rg_operator_flags_compare(VALUE self, VALUE rhs) { gint ret = flags_compare(self, rhs); switch (ret) { case FLAGS_COMP_EQUAL: case FLAGS_COMP_GREATER: case FLAGS_COMP_LESS: return INT2FIX(ret); default: return Qnil; } } static VALUE rg_operator_flags_eqv(VALUE self, VALUE rhs) { gint ret = flags_compare(self, rhs); if (ret == FLAGS_COMP_INCOMPARABLE) return Qnil; return CBOOL2RVAL(ret == FLAGS_COMP_EQUAL); } static VALUE rg_operator_flags_gt_eq(VALUE self, VALUE rhs) { gint ret = flags_compare(self, rhs); if (ret == FLAGS_COMP_INCOMPARABLE) return Qnil; return CBOOL2RVAL(ret == FLAGS_COMP_GREATER || ret == FLAGS_COMP_EQUAL); } static VALUE rg_operator_flags_lt_eq(VALUE self, VALUE rhs) { gint ret = flags_compare(self, rhs); if (ret == FLAGS_COMP_INCOMPARABLE) return Qnil; return CBOOL2RVAL(ret == FLAGS_COMP_LESS || ret == FLAGS_COMP_EQUAL); } static VALUE rg_operator_flags_gt(VALUE self, VALUE rhs) { gint ret = flags_compare(self, rhs); if (ret == FLAGS_COMP_INCOMPARABLE) return Qnil; return CBOOL2RVAL(ret == FLAGS_COMP_GREATER); } static VALUE rg_operator_flags_lt(VALUE self, VALUE rhs) { gint ret = flags_compare(self, rhs); if (ret == FLAGS_COMP_INCOMPARABLE) return Qnil; return CBOOL2RVAL(ret == FLAGS_COMP_LESS); } static VALUE rg_operator_flags_not(VALUE self, G_GNUC_UNUSED VALUE rhs) { flags_holder* p = flags_get_holder(self); return rbgobj_make_flags((~ p->value) & p->gclass->mask, G_TYPE_FROM_CLASS(p->gclass)); } #define LIFT_BINARY_OP(funcname, op) \ static VALUE \ funcname(VALUE self, VALUE rhs) \ { \ flags_holder* p = flags_get_holder(self); \ GType gtype = G_TYPE_FROM_CLASS(p->gclass); \ return rbgobj_make_flags(p->value op rbgobj_get_flags(rhs, gtype), \ gtype); \ } LIFT_BINARY_OP(flags_and, &) LIFT_BINARY_OP(flags_or, |) LIFT_BINARY_OP(flags_xor, ^) static VALUE rg_operator_flags_minus(VALUE self, VALUE rhs) { flags_holder* p = flags_get_holder(self); GType gtype = G_TYPE_FROM_CLASS(p->gclass); return rbgobj_make_flags(p->value & ~rbgobj_get_flags(rhs, gtype), gtype); } static VALUE rg_empty_p(VALUE self) { flags_holder* p = flags_get_holder(self); return CBOOL2RVAL(p->value == 0); } static VALUE rg_hash(VALUE self) { flags_holder* p = flags_get_holder(self); return UINT2NUM(p->value ^ G_TYPE_FROM_CLASS(p->gclass)); } static VALUE rg_coerce(VALUE self, VALUE other) { flags_holder *holder; GType gtype; if (rb_obj_is_kind_of(other, rb_cInteger)) rb_raise(rb_eTypeError, "can't coerce"); holder = flags_get_holder(self); gtype = G_TYPE_FROM_CLASS(holder->gclass); other = rbgobj_make_flags(NUM2UINT(other), gtype); return rb_ary_new3(2, other, self); } static VALUE rg_nonzero_p(VALUE self) { flags_holder* p = flags_get_holder(self); return CBOOL2RVAL(p->value != 0); } /**********************************************************************/ void Init_gobject_gflags(void) { id_module_eval = rb_intern("module_eval"); id_new = rb_intern("new"); id_or = rb_intern("|"); RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FLAGS, "Flags", mGLib); rbg_define_singleton_method(RG_TARGET_NAMESPACE, "gtype", generic_s_gtype, 0); rbg_define_method(RG_TARGET_NAMESPACE, "gtype", generic_gtype, 0); RG_DEF_SMETHOD(mask, 0); RG_DEF_SMETHOD(values, 0); rb_define_alloc_func(RG_TARGET_NAMESPACE, flags_s_allocate); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(to_i, 0); RG_DEF_ALIAS("to_int", "to_i"); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(nick, 0); /* rbg_define_method(RG_TARGET_NAMESPACE, "inspect", flags_inspect, 0); */ RG_DEF_METHOD_OPERATOR("<=>", flags_compare, 1); RG_DEF_METHOD_OPERATOR("==", flags_eqv, 1); RG_DEF_METHOD_OPERATOR(">=", flags_gt_eq, 1); RG_DEF_METHOD_OPERATOR("<=", flags_lt_eq, 1); RG_DEF_METHOD_OPERATOR(">", flags_gt, 1); RG_DEF_METHOD_OPERATOR("<", flags_lt, 1); RG_DEF_METHOD_OPERATOR("~", flags_not, 0); rbg_define_method(RG_TARGET_NAMESPACE, "&", flags_and, 1); rbg_define_method(RG_TARGET_NAMESPACE, "|", flags_or, 1); rbg_define_method(RG_TARGET_NAMESPACE, "^", flags_xor, 1); RG_DEF_METHOD_OPERATOR("-", flags_minus, 1); RG_DEF_METHOD_P(empty, 0); RG_DEF_METHOD(hash, 0); RG_DEF_ALIAS("eql?", "=="); /* for compatibility */ RG_DEF_METHOD(coerce, 1); RG_DEF_ALIAS("zero?", "empty?"); RG_DEF_METHOD_P(nonzero, 0); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgutildeprecated.c0000644000175000017500000001315211701304107021233 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" VALUE rbgutil_glist2ary(const GList *const list) { VALUE ary; const GList *i; ary = rb_ary_new(); for (i = list; i != NULL; i = i->next) rb_ary_push(ary, GOBJ2RVAL(i->data)); return ary; } static VALUE rbgutil_glist2ary_and_free_body(VALUE data) { VALUE ary; GList *i; ary = rb_ary_new(); for (i = (GList *)data; i != NULL; i = i->next) rb_ary_push(ary, GOBJ2RVAL(i->data)); return ary; } static VALUE rbgutil_glist2ary_and_free_ensure(VALUE data) { g_list_free((GList *)data); return Qnil; } VALUE rbgutil_glist2ary_and_free(GList *const list) { return rb_ensure(rbgutil_glist2ary_and_free_body, (VALUE)list, rbgutil_glist2ary_and_free_ensure, (VALUE)list); } VALUE rbgutil_glist2ary_boxed(const GList *const list, GType gtype) { VALUE ary; const GList *i; ary = rb_ary_new(); for (i = list; i != NULL; i = i->next) rb_ary_push(ary, BOXED2RVAL(i->data, gtype)); return ary; } struct rbgutil_glist2ary_boxed_and_free_data { GList *const list; GType gtype; }; static VALUE rbgutil_glist2ary_boxed_and_free_body(VALUE data) { struct rbgutil_glist2ary_boxed_and_free_data *real; VALUE ary; GList *i; real = (struct rbgutil_glist2ary_boxed_and_free_data *)data; ary = rb_ary_new(); for (i = real->list; i != NULL; i = i->next) rb_ary_push(ary, BOXED2RVAL(i->data, real->gtype)); return ary; } static VALUE rbgutil_glist2ary_boxed_and_free_ensure(VALUE data) { g_list_free(((struct rbgutil_glist2ary_boxed_and_free_data *)data)->list); return Qnil; } VALUE rbgutil_glist2ary_boxed_and_free(GList *const list, GType gtype) { struct rbgutil_glist2ary_boxed_and_free_data data = { list, gtype }; return rb_ensure(rbgutil_glist2ary_boxed_and_free_body, (VALUE)&data, rbgutil_glist2ary_boxed_and_free_ensure, (VALUE)&data); } VALUE rbgutil_glist2ary_string(const GList *const list) { VALUE ary; const GList *i; ary = rb_ary_new(); for (i = list; i != NULL; i = i->next) rb_ary_push(ary, CSTR2RVAL(i->data)); return ary; } static VALUE rbgutil_glist2ary_string_and_free_body(VALUE data) { VALUE ary; GList *i; ary = rb_ary_new(); for (i = (GList *)data; i != NULL; i = i->next) rb_ary_push(ary, CSTR2RVAL(i->data)); return ary; } static VALUE rbgutil_glist2ary_string_and_free_ensure(VALUE data) { GList *i; for (i = (GList *)data; i != NULL; i = i->next) g_free(i->data); g_list_free((GList *)data); return Qnil; } VALUE rbgutil_glist2ary_string_and_free(GList *const list) { return rb_ensure(rbgutil_glist2ary_string_and_free_body, (VALUE)list, rbgutil_glist2ary_string_and_free_ensure, (VALUE)list); } VALUE rbgutil_gslist2ary(const GSList *const list) { VALUE ary; const GSList *i; ary = rb_ary_new(); for (i = list; i != NULL; i = i->next) rb_ary_push(ary, GOBJ2RVAL(i->data)); return ary; } static VALUE rbgutil_gslist2ary_and_free_body(VALUE data) { VALUE ary; GSList *i; ary = rb_ary_new(); for (i = (GSList *)data; i != NULL; i = i->next) rb_ary_push(ary, GOBJ2RVAL(i->data)); return ary; } static VALUE rbgutil_gslist2ary_and_free_ensure(VALUE data) { g_slist_free((GSList *)data); return Qnil; } VALUE rbgutil_gslist2ary_and_free(GSList *const list) { return rb_ensure(rbgutil_gslist2ary_and_free_body, (VALUE)list, rbgutil_gslist2ary_and_free_ensure, (VALUE)list); } VALUE rbgutil_gslist2ary_boxed(const GSList *const list, GType gtype) { VALUE ary; const GSList *i; ary = rb_ary_new(); for (i = list; i != NULL; i = i->next) rb_ary_push(ary, BOXED2RVAL(i->data, gtype)); return ary; } struct rbgutil_gslist2ary_boxed_and_free_data { GSList *const list; GType gtype; }; static VALUE rbgutil_gslist2ary_boxed_and_free_body(VALUE data) { struct rbgutil_gslist2ary_boxed_and_free_data *real; VALUE ary; GSList *i; real = (struct rbgutil_gslist2ary_boxed_and_free_data *)data; ary = rb_ary_new(); for (i = real->list; i != NULL; i = i->next) rb_ary_push(ary, BOXED2RVAL(i->data, real->gtype)); return ary; } static VALUE rbgutil_gslist2ary_boxed_and_free_ensure(VALUE data) { g_slist_free(((struct rbgutil_gslist2ary_boxed_and_free_data *)data)->list); return Qnil; } VALUE rbgutil_gslist2ary_boxed_and_free(GSList *const list, GType gtype) { struct rbgutil_gslist2ary_boxed_and_free_data data = { list, gtype }; return rb_ensure(rbgutil_gslist2ary_boxed_and_free_body, (VALUE)&data, rbgutil_gslist2ary_boxed_and_free_ensure, (VALUE)&data); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglibdeprecated.c0000644000175000017500000000316011701304107021022 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" static VALUE rbg_filename_gslist_to_array_free_body(VALUE list) { VALUE ary = rb_ary_new(); GSList *p; for (p = (GSList *)list; p != NULL; p = g_slist_next(p)) rb_ary_push(ary, CSTRFILENAME2RVAL(p->data)); return ary; } static VALUE rbg_filename_gslist_to_array_free_ensure(VALUE val) { GSList *list = (GSList *)val; GSList *p; for (p = list; p != NULL; p = g_slist_next(p)) g_free((gchar *)p->data); g_slist_free(list); return Qnil; } VALUE rbg_filename_gslist_to_array_free(GSList *list) { return rb_ensure(rbg_filename_gslist_to_array_free_body, (VALUE)list, rbg_filename_gslist_to_array_free_ensure, (VALUE)list); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgutil_list.c0000644000175000017500000001153011701304107020243 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" struct list2rval_args { gpointer list; RBGRValueFunc conv; GFreeFunc free_list; GFreeFunc free_elem; }; struct list2rval_with_type_args { struct list2rval_args args; RBGRValueFuncWithType conv_with_type; GType gtype; }; static VALUE glist2rval_body(VALUE data) { struct list2rval_args *args = (struct list2rval_args *)data; RBGRValueFunc conv = args->conv; GList *node; VALUE ary; ary = rb_ary_new(); if (conv) for (node = args->list; node; node = g_list_next(node)) rb_ary_push(ary, conv(node->data)); return ary; } static VALUE gslist2rval_body(VALUE data) { struct list2rval_args *args = (struct list2rval_args *)data; RBGRValueFunc conv = args->conv; GSList *node; VALUE ary; ary = rb_ary_new(); if (conv) for (node = args->list; node; node = g_slist_next(node)) rb_ary_push(ary, conv(node->data)); return ary; } static VALUE glist2rval_with_type_body(VALUE data) { struct list2rval_with_type_args *args_with_type = (struct list2rval_with_type_args *)data; struct list2rval_args *args = (struct list2rval_args *)data; RBGRValueFuncWithType conv = args_with_type->conv_with_type; GType gtype = args_with_type->gtype; GList *node; VALUE ary; ary = rb_ary_new(); if (conv) for (node = args->list; node; node = g_list_next(node)) rb_ary_push(ary, conv(node->data, gtype)); return ary; } static VALUE gslist2rval_with_type_body(VALUE data) { struct list2rval_with_type_args *args_with_type = (struct list2rval_with_type_args *)data; struct list2rval_args *args = (struct list2rval_args *)data; RBGRValueFuncWithType conv = args_with_type->conv_with_type; GType gtype = args_with_type->gtype; GSList *node; VALUE ary; ary = rb_ary_new(); if (conv) for (node = args->list; node; node = g_slist_next(node)) rb_ary_push(ary, conv(node->data, gtype)); return ary; } static VALUE glist2rval_ensure(VALUE data) { struct list2rval_args *args = (struct list2rval_args *)data; GList *node; if (args->free_elem) for (node = args->list; node; node = g_list_next(node)) args->free_elem(node->data); if (args->free_list) args->free_list(args->list); return Qnil; } static VALUE gslist2rval_ensure(VALUE data) { struct list2rval_args *args = (struct list2rval_args *)data; GSList *node; if (args->free_elem) for (node = args->list; node; node = g_slist_next(node)) args->free_elem(node->data); if (args->free_list) args->free_list(args->list); return Qnil; } VALUE rbg_glist2rval(GList *const list, RBGRValueFunc conv, GFreeFunc free_list, GFreeFunc free_elem) { struct list2rval_args args = {list, conv, free_list, free_elem}; return rb_ensure(glist2rval_body, (VALUE)&args, glist2rval_ensure, (VALUE)&args); } VALUE rbg_gslist2rval(GSList *const list, RBGRValueFunc conv, GFreeFunc free_list, GFreeFunc free_elem) { struct list2rval_args args = {list, conv, free_list, free_elem}; return rb_ensure(gslist2rval_body, (VALUE)&args, gslist2rval_ensure, (VALUE)&args); } VALUE rbg_glist2rval_with_type(GList *const list, RBGRValueFuncWithType conv, GType gtype, GFreeFunc free_list, GFreeFunc free_elem) { struct list2rval_with_type_args args = {{list, NULL, free_list, free_elem}, conv, gtype}; return rb_ensure(glist2rval_with_type_body, (VALUE)&args, glist2rval_ensure, (VALUE)&args); } VALUE rbg_gslist2rval_with_type(GSList *const list, RBGRValueFuncWithType conv, GType gtype, GFreeFunc free_list, GFreeFunc free_elem) { struct list2rval_with_type_args args = {{list, NULL, free_list, free_elem}, conv, gtype}; return rb_ensure(gslist2rval_with_type_body, (VALUE)&args, gslist2rval_ensure, (VALUE)&args); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/depend0000644000175000017500000000131312064346475016575 0ustar koukouinstall-so: install-headers install-headers: $(INSTALL_DATA) $(srcdir)/rbglib.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbglibdeprecated.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbglib2conversions.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgutil.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgutil_list.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgutildeprecated.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgobject.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgcompat.h $(RUBYARCHDIR) $(INSTALL_DATA) glib-enum-types.h $(RUBYARCHDIR) install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-glib2.pc $(pkgconfigdir); \ fi ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgprivate.h0000644000175000017500000001542012257552167017736 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2007 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGPRIVATE_H__ #define __RBGPRIVATE_H__ #include "rbgobject.h" #include "glib-enum-types.h" #ifndef HAVE_RB_ERRINFO # define rb_errinfo() (ruby_errinfo) #endif #ifndef HAVE_RB_STR_NEW_CSTR # define rb_str_new_cstr(c_string) rb_str_new2(c_string) #endif #ifndef HAVE_RB_EXC_NEW_STR # define rb_exc_new_str(klass, message) rb_exc_new3(klass, message) #endif #ifndef G_VALUE_INIT # define G_VALUE_INIT { 0, { { 0 } } } #endif G_BEGIN_DECLS typedef struct { VALUE self; GObject* gobj; const RGObjClassInfo* cinfo; gboolean destroyed; } gobj_holder; typedef struct { gpointer boxed; gboolean own; GType type; } boxed_holder; #ifdef HAVE_RB_THREAD_BLOCKING_REGION G_GNUC_INTERNAL extern GStaticPrivate rg_polling_key; #endif extern VALUE rbgobj_cEnum; extern VALUE rbgobj_cFlags; extern VALUE rbgobj_cBoxed; extern VALUE rbgobj_cParam; extern VALUE rbgobj_mInterface; extern VALUE rbgobj_cObject; extern VALUE rbgobj_cInstantiatable; extern VALUE rbgobj_mMetaInterface; #define cInstantiatable rbgobj_cInstantiatable #define mMetaInterface rbgobj_mMetaInterface extern void rbgobj_define_property_accessors(VALUE klass); extern void rbgobj_define_action_methods(VALUE klass); extern void rbgobj_param_spec_initialize(VALUE self, GParamSpec* pspec); extern void rbgobj_boxed_initialize(VALUE obj, gpointer boxed); extern GParamSpec* rbgobj_get_param_spec(VALUE obj); extern GObject* rbgobj_get_gobject(VALUE obj); extern VALUE rbgobj_get_ruby_object_from_param_spec(GParamSpec* pspec, gboolean alloc); extern void rbgobj_init_object_class(VALUE klass); extern void rbgobj_init_flags_class(VALUE klass); extern void rbgobj_init_enum_class(VALUE klass); extern void rbgobj_init_interface(VALUE interf); /* FIXME: should have better name */ extern void rbgobj_instance_call_cinfo_mark(gpointer instance); extern void rbgobj_instance_call_cinfo_free(gpointer instance); VALUE rbgutil_generic_s_gtype(VALUE klass); VALUE rbgutil_generic_gtype(VALUE self); #define generic_s_gtype rbgutil_generic_s_gtype #define generic_gtype rbgutil_generic_gtype extern gboolean rbgobj_convert_has_type(GType type); extern RGConvertTable *rbgobj_convert_lookup(GType type); extern gboolean rbgobj_convert_get_superclass(GType type, VALUE *result); extern gboolean rbgobj_convert_type_init_hook(GType type, VALUE klass); extern gboolean rbgobj_convert_gvalue2rvalue(GType type, const GValue *value, VALUE *result); extern gboolean rbgobj_convert_rvalue2gvalue(GType type, VALUE val, GValue *result); extern GType rbgobj_convert_rvalue2gtype(VALUE val); extern gboolean rbgobj_convert_initialize(GType type, VALUE obj, gpointer cobj); extern gboolean rbgobj_convert_robj2instance(GType type, VALUE obj, gpointer *result); extern gboolean rbgobj_convert_instance2robj(GType type, gpointer instance, VALUE *result); extern gboolean rbgobj_convert_unref(GType type, gpointer instance); #define RubyGObjectHookModule "RubyGObjectHook__" G_GNUC_INTERNAL VALUE rg_enum_resolve_value(VALUE klass, VALUE nick); G_GNUC_INTERNAL void rg_enum_add_constants(VALUE mod, GType enum_type, const gchar *strip_prefix); G_GNUC_INTERNAL void rg_flags_add_constants(VALUE mod, GType flags_type, const gchar *strip_prefix); G_GNUC_INTERNAL char *rg_obj_constant_lookup(const char *name); G_GNUC_INTERNAL void Init_gutil(void); G_GNUC_INTERNAL void Init_gutil_callback(void); G_GNUC_INTERNAL void Init_glib_gettext(void); G_GNUC_INTERNAL void Init_glib_int64(void); G_GNUC_INTERNAL void Init_glib_error(void); G_GNUC_INTERNAL void Init_glib_threads(void); G_GNUC_INTERNAL void Init_glib_convert(void); G_GNUC_INTERNAL void Init_glib_messages(void); G_GNUC_INTERNAL void Init_glib_spawn(void); G_GNUC_INTERNAL void Init_glib_spawnerror(void); G_GNUC_INTERNAL void Init_glib_fileutils(void); G_GNUC_INTERNAL void Init_glib_utils(void); G_GNUC_INTERNAL void Init_glib_i18n(void); G_GNUC_INTERNAL void Init_glib_win32(void); G_GNUC_INTERNAL void Init_gobject(void); G_GNUC_INTERNAL void Init_glib_main_loop(void); G_GNUC_INTERNAL void Init_glib_main_context(void); G_GNUC_INTERNAL void Init_glib_source(void); G_GNUC_INTERNAL void Init_glib_poll_fd(void); G_GNUC_INTERNAL void Init_glib_io_constants(void); G_GNUC_INTERNAL void Init_glib_io_channel(void); G_GNUC_INTERNAL void Init_glib_io_channelerror(void); G_GNUC_INTERNAL void Init_glib_io_channel_win32_socket(void); G_GNUC_INTERNAL void Init_glib_shell(void); G_GNUC_INTERNAL void Init_glib_shellerror(void); G_GNUC_INTERNAL void Init_glib_timer(void); G_GNUC_INTERNAL void Init_glib_unicode(void); G_GNUC_INTERNAL void Init_glib_utf8(void); G_GNUC_INTERNAL void Init_glib_utf16(void); G_GNUC_INTERNAL void Init_glib_ucs4(void); G_GNUC_INTERNAL void Init_glib_unichar(void); G_GNUC_INTERNAL void Init_glib_keyfile(void); G_GNUC_INTERNAL void Init_glib_bookmark_file(void); G_GNUC_INTERNAL void Init_gobject_convert(void); G_GNUC_INTERNAL void Init_gobject_gtype(void); G_GNUC_INTERNAL void Init_gobject_typeinterface(void); G_GNUC_INTERNAL void Init_gobject_typeinstance(void); G_GNUC_INTERNAL void Init_gobject_gvalue(void); G_GNUC_INTERNAL void Init_gobject_gvaluetypes(void); G_GNUC_INTERNAL void Init_gobject_gboxed(void); G_GNUC_INTERNAL void Init_gobject_gstrv(void); G_GNUC_INTERNAL void Init_gobject_value_array(void); G_GNUC_INTERNAL void Init_gobject_genumflags(void); G_GNUC_INTERNAL void Init_gobject_genums(void); G_GNUC_INTERNAL void Init_gobject_gflags(void); G_GNUC_INTERNAL void Init_gobject_gparam(void); G_GNUC_INTERNAL void Init_gobject_gparamspecs(void); G_GNUC_INTERNAL void Init_gobject_gclosure(void); G_GNUC_INTERNAL void Init_gobject_gobject(void); G_GNUC_INTERNAL void Init_gobject_gsignal(void); G_GNUC_INTERNAL void Init_gobject_gtypeplugin(void); G_GNUC_INTERNAL void Init_gobject_gtypemodule(void); G_END_DECLS #endif ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_pollfd.c0000644000175000017500000000526212124610262020350 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" /*****************************************/ static GPollFD* pollfd_copy(const GPollFD* pollfd) { GPollFD* new_pollfd; g_return_val_if_fail (pollfd != NULL, NULL); new_pollfd = g_new(GPollFD, 1); *new_pollfd = *pollfd; return new_pollfd; } GType g_poll_fd_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GPollFD", (GBoxedCopyFunc)pollfd_copy, (GBoxedFreeFunc)g_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cPollFD #define _SELF(s) ((GPollFD*)RVAL2BOXED(s, G_TYPE_POLL_FD)) static VALUE rg_initialize(VALUE self, VALUE fd, VALUE events, VALUE revents) { GPollFD gfd; gfd.fd = NUM2INT(fd); gfd.events = NUM2INT(events); gfd.revents = NUM2INT(revents); G_INITIALIZE(self, g_boxed_copy(G_TYPE_POLL_FD, &gfd)); return Qnil; } static VALUE rg_set_fd(VALUE self, VALUE fd) { _SELF(self)->fd = fd; return self; } static VALUE rg_fd(VALUE self) { return INT2NUM(_SELF(self)->fd); } static VALUE rg_set_events(VALUE self, VALUE events) { _SELF(self)->events = events; return self; } static VALUE rg_events(VALUE self) { return INT2NUM(_SELF(self)->events); } static VALUE rg_set_revents(VALUE self, VALUE revents) { _SELF(self)->revents = revents; return self; } static VALUE rg_revents(VALUE self) { return INT2NUM(_SELF(self)->revents); } void Init_glib_poll_fd(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_POLL_FD, "PollFD", mGLib); RG_DEF_METHOD(initialize, 3); RG_DEF_METHOD(set_fd, 1); RG_DEF_METHOD(fd, 0); RG_DEF_METHOD(set_events, 1); RG_DEF_METHOD(events, 0); RG_DEF_METHOD(set_revents, 1); RG_DEF_METHOD(revents, 0); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgutil.h0000644000175000017500000001142012150300275017214 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGUTIL_H__ #define __RBGUTIL_H__ #include #include "ruby.h" #ifdef HAVE_RUBY_ENCODING_H # include #endif #include "rbglib.h" #include "rbgutil_list.h" #include "rbgutildeprecated.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define RG_DEF_MODFUNC(method, argc) \ rb_define_module_function(RG_TARGET_NAMESPACE, #method, rg_m_ ## method, argc) #define RG_DEF_MODFUNC_P(method, argc) \ rb_define_module_function(RG_TARGET_NAMESPACE, #method"?", rg_m_ ## method ## _p, argc) #define RG_DEF_MODFUNC_OPERATOR(ope, func, argc) \ rb_define_module_function(RG_TARGET_NAMESPACE, ope, rg_m_operator_ ## func, argc) #define RG_DEF_SMETHOD(method, argc) \ rbg_define_singleton_method(RG_TARGET_NAMESPACE, #method, rg_s_ ## method, argc) #define RG_DEF_SMETHOD_P(method, argc) \ rb_define_singleton_method(RG_TARGET_NAMESPACE, #method"?", rg_s_ ## method ## _p, argc) #define RG_DEF_SMETHOD_BANG(method, argc) \ rb_define_singleton_method(RG_TARGET_NAMESPACE, #method"!", rg_s_ ## method ## _bang, argc) #define RG_DEF_SMETHOD_OPERATOR(ope, func, argc) \ rb_define_singleton_method(RG_TARGET_NAMESPACE, ope, rg_s_operator_ ## func, argc) #define RG_DEF_METHOD(method, argc) \ rbg_define_method(RG_TARGET_NAMESPACE, #method, rg_ ## method, argc) #define RG_DEF_METHOD_P(method, argc) \ rb_define_method(RG_TARGET_NAMESPACE, #method"?", rg_ ## method ## _p, argc) #define RG_DEF_METHOD_BANG(method, argc) \ rb_define_method(RG_TARGET_NAMESPACE, #method"!", rg_ ## method ## _bang, argc) #define RG_DEF_METHOD_OPERATOR(ope, func, argc) \ rb_define_method(RG_TARGET_NAMESPACE, ope, rg_operator_ ## func, argc) #define RG_DEF_ATTR(attr, read, write, ex) \ rb_attr(RG_TARGET_NAMESPACE, rb_intern(attr), read, write, ex) #define RG_DEF_ALIAS(new, old) rb_define_alias(RG_TARGET_NAMESPACE, new, old) #define RG_REG_GLIBID_SETTER(name) \ rbgobj_register_property_setter(CLASS2GTYPE(RG_TARGET_NAMESPACE), name, rbgutil_glibid_r2g_func) #define RG_REG_SYMBOL_GETTER(name) \ rbgobj_register_property_getter(CLASS2GTYPE(RG_TARGET_NAMESPACE), name, rbgutil_sym_g2r_func) #define G_REPLACE_SET_PROPERTY(klass, name, function, args) \ rb_undef_method(klass, "set_" name); \ rb_define_method(klass, "set_" name, function, args); \ rb_undef_method(klass, name "="); \ G_DEF_SETTER(klass, name) #define G_REPLACE_GET_PROPERTY(klass, name, function, args) \ rb_undef_method(klass, name); \ rb_define_method(klass, name, function, args) #define G_REPLACE_ACTION(klass, name, function, args) \ rb_undef_method(klass, name); \ rb_define_method(klass, name, function, args) #define G_SET_PROPERTIES(self, hash) (rbgutil_set_properties(self, hash)) #define G_PROTECT_CALLBACK(func, data) (rbgutil_invoke_callback((VALUE(*)(VALUE))func, (VALUE)data)) #define RBG_STRING_SET_UTF8_ENCODING(string) \ (rbgutil_string_set_utf8_encoding(string)) extern void rbg_define_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc); extern void rbg_define_singleton_method(VALUE obj, const char *name, VALUE (*func)(ANYARGS), int argc); extern VALUE rbgutil_def_setters(VALUE klass); extern void rbgutil_set_properties(VALUE self, VALUE hash); extern VALUE rbgutil_protect(VALUE (*proc) (VALUE), VALUE data); extern VALUE rbgutil_invoke_callback(VALUE (*func)(VALUE), VALUE arg); extern void rbgutil_start_callback_dispatch_thread(void); extern void rbgutil_stop_callback_dispatch_thread(void); extern VALUE rbgutil_string_set_utf8_encoding(VALUE string); extern gboolean rbgutil_key_equal(VALUE rb_string, const char *key); /*< protected >*/ RUBY_GLIB2_VAR ID rbgutil_id_module_eval; extern void rbgutil_glibid_r2g_func(VALUE from, GValue* to); extern VALUE rbgutil_sym_g2r_func(const GValue *from); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __RBGUTIL_H__ */ ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_bookmarkfile.c0000644000175000017500000003641512257552167021561 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" /************************************************/ static GBookmarkFile* bookmarkfile_copy(const GBookmarkFile* file) { /* GBookmarkFile* new_file; g_return_val_if_fail (file != NULL, NULL); new_file = g_key_file_new(); *new_file = (GBookmarkFile*)*file; return new_file; */ return (GBookmarkFile*)file; } static GType g_bookmark_file_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static("GBookmarkFile", (GBoxedCopyFunc)bookmarkfile_copy, (GBoxedFreeFunc)g_bookmark_file_free); return our_type; } /************************************************/ #define G_TYPE_BOOKMARK_FILE (g_bookmark_file_get_type()) #define RG_TARGET_NAMESPACE cBookmarkFile #define _SELF(self) ((GBookmarkFile*)(RVAL2BOXED(self, G_TYPE_BOOKMARK_FILE))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_bookmark_file_new()); return Qnil; } static VALUE rg_load_from_file(VALUE self, VALUE rbfilename) { gchar *filename = RVAL2CSTRFILENAME(rbfilename); GError* error = NULL; gboolean ret = g_bookmark_file_load_from_file(_SELF(self), filename, &error); g_free(filename); if (!ret) RAISE_GERROR(error); return self; } static VALUE rg_load_from_data(VALUE self, VALUE data) { GError *error = NULL; StringValue(data); if (!g_bookmark_file_load_from_data(_SELF(self), RSTRING_PTR(data), RSTRING_LEN(data), &error)) RAISE_GERROR(error); return Qnil; } static VALUE rg_load_from_data_dirs(VALUE self, VALUE file) { GError* error = NULL; gboolean ret; gchar* full_path; ret = g_bookmark_file_load_from_data_dirs(_SELF(self), RVAL2CSTR(file), &full_path, &error); if (! ret) RAISE_GERROR(error); return full_path ? CSTR2RVAL(full_path) : Qnil; } static VALUE rg_to_data(VALUE self) { GError* error = NULL; gchar* data = g_bookmark_file_to_data(_SELF(self), NULL, &error); if (error) RAISE_GERROR(error); return CSTR2RVAL_FREE(data); } static VALUE rg_to_file(VALUE self, VALUE rbfilename) { gchar *filename = RVAL2CSTRFILENAME(rbfilename); GError* error = NULL; gboolean ret = g_bookmark_file_to_file(_SELF(self), filename, &error); g_free(filename); if (!ret) RAISE_GERROR(error); return self; } static VALUE rg_has_item_p(VALUE self, VALUE uri) { return CBOOL2RVAL(g_bookmark_file_has_item(_SELF(self), RVAL2CSTR(uri))); } static VALUE rg_has_group_p(VALUE self, VALUE uri, VALUE group) { GError* error = NULL; return CBOOL2RVAL(g_bookmark_file_has_group(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(group), &error)); } static VALUE rg_has_application_p(VALUE self, VALUE uri, VALUE name) { GError* error = NULL; return CBOOL2RVAL(g_bookmark_file_has_application(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(name), &error)); } static VALUE rg_size(VALUE self) { return INT2NUM(g_bookmark_file_get_size(_SELF(self))); } static VALUE rg_uris(VALUE self) { return STRV2RVAL_FREE(g_bookmark_file_get_uris(_SELF(self), NULL)); } static VALUE rg_get_title(VALUE self, VALUE uri) { GError *error = NULL; gchar* ret = g_bookmark_file_get_title(_SELF(self), RVAL2CSTR(uri), &error); if (error) RAISE_GERROR(error); return CSTR2RVAL_FREE(ret); } static VALUE rg_get_description(VALUE self, VALUE uri) { GError *error = NULL; gchar* ret = g_bookmark_file_get_description(_SELF(self), RVAL2CSTR(uri), &error); if (error) RAISE_GERROR(error); return CSTR2RVAL_FREE(ret); } static VALUE rg_get_mime_type(VALUE self, VALUE uri) { GError *error = NULL; gchar* ret = g_bookmark_file_get_mime_type(_SELF(self), RVAL2CSTR(uri), &error); if (error) RAISE_GERROR(error); return CSTR2RVAL_FREE(ret); } static VALUE rg_private_p(VALUE self, VALUE uri) { GError *error = NULL; gboolean ret = g_bookmark_file_get_is_private(_SELF(self), RVAL2CSTR(uri), &error); if (error) RAISE_GERROR(error); return CBOOL2RVAL(ret); } static VALUE rg_get_icon(VALUE self, VALUE uri) { gchar* href; gchar* mime_type; GError *error = NULL; gboolean ret = g_bookmark_file_get_icon(_SELF(self), RVAL2CSTR(uri), &href, &mime_type, &error); if (!ret){ if (error) RAISE_GERROR(error); return Qnil; } return rb_assoc_new(CSTR2RVAL_FREE(href), CSTR2RVAL_FREE(mime_type)); } static VALUE rg_get_added(VALUE self, VALUE uri) { GError *error = NULL; time_t ret = g_bookmark_file_get_added(_SELF(self), RVAL2CSTR(uri), &error); if (!ret) RAISE_GERROR(error); return rb_time_new(ret, 0); } static VALUE rg_get_modified(VALUE self, VALUE uri) { GError *error = NULL; time_t ret = g_bookmark_file_get_modified(_SELF(self), RVAL2CSTR(uri), &error); if (!ret) RAISE_GERROR(error); return rb_time_new(ret, 0); } static VALUE rg_get_visited(VALUE self, VALUE uri) { GError *error = NULL; time_t ret = g_bookmark_file_get_visited(_SELF(self), RVAL2CSTR(uri), &error); if (!ret) RAISE_GERROR(error); return rb_time_new(ret, 0); } static VALUE rg_get_groups(VALUE self, VALUE uri) { gsize length; VALUE ary; gsize i; GError* error = NULL; gchar** ret = g_bookmark_file_get_groups(_SELF(self), RVAL2CSTR(uri), &length, &error); if (error) RAISE_GERROR(error); ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, CSTR2RVAL(ret[i])); } g_strfreev(ret); return ary; } static VALUE rg_get_applications(VALUE self, VALUE uri) { gsize length; VALUE ary; gsize i; GError* error = NULL; gchar** ret = g_bookmark_file_get_applications(_SELF(self), RVAL2CSTR(uri), &length, &error); if (error) RAISE_GERROR(error); ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, CSTR2RVAL(ret[i])); } g_strfreev(ret); return ary; } static VALUE rg_get_app_info(VALUE self, VALUE uri, VALUE name) { gchar* exec; guint count; time_t stamp; GError* error = NULL; gboolean ret = g_bookmark_file_get_app_info(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(name), &exec, &count, &stamp, &error); if (!ret) RAISE_GERROR(error); return rb_ary_new3(3, CSTR2RVAL(exec), UINT2NUM(count), rb_time_new(stamp, 0)); } static VALUE rg_set_title(VALUE self, VALUE uri, VALUE title) { g_bookmark_file_set_title(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(title)); return self; } static VALUE rg_set_description(VALUE self, VALUE uri, VALUE description) { g_bookmark_file_set_description(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(description)); return self; } static VALUE rg_set_mime_type(VALUE self, VALUE uri, VALUE mime_type) { g_bookmark_file_set_mime_type(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(mime_type)); return self; } static VALUE rg_set_private(VALUE self, VALUE uri, VALUE is_private) { g_bookmark_file_set_is_private(_SELF(self), RVAL2CSTR(uri), RVAL2CBOOL(is_private)); return self; } static VALUE rg_set_icon(VALUE self, VALUE uri, VALUE href, VALUE mime_type) { g_bookmark_file_set_icon(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(href), RVAL2CSTR(mime_type)); return self; } static VALUE rg_set_added(VALUE self, VALUE uri, VALUE time) { g_bookmark_file_set_added(_SELF(self), RVAL2CSTR(uri), (time_t)NUM2LONG(rb_Integer(time))); return self; } static VALUE rg_set_groups(VALUE self, VALUE rburi, VALUE rbgroups) { GBookmarkFile *bookmark = _SELF(self); const gchar *uri = RVAL2CSTR(rburi); long n; const gchar **groups = RVAL2STRS(rbgroups, n); g_bookmark_file_set_groups(bookmark, uri, groups, n); g_free(groups); return self; } static VALUE rg_set_modified(VALUE self, VALUE uri, VALUE time) { g_bookmark_file_set_modified(_SELF(self), RVAL2CSTR(uri), (time_t)NUM2LONG(rb_Integer(time))); return self; } static VALUE rg_set_visited(VALUE self, VALUE uri, VALUE time) { g_bookmark_file_set_visited(_SELF(self), RVAL2CSTR(uri), (time_t)NUM2LONG(rb_Integer(time))); return self; } static VALUE rg_set_app_info(VALUE self, VALUE uri, VALUE name, VALUE exec, VALUE count, VALUE stamp) { GError* error = NULL; gboolean ret = g_bookmark_file_set_app_info(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(name), RVAL2CSTR(exec), NUM2INT(count), (time_t)NUM2LONG(rb_Integer(stamp)), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_add_group(VALUE self, VALUE uri, VALUE group) { g_bookmark_file_add_group(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(group)); return self; } static VALUE rg_add_application(VALUE self, VALUE uri, VALUE name, VALUE exec) { g_bookmark_file_add_application(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(name), RVAL2CSTR(exec)); return self; } static VALUE rg_remove_group(VALUE self, VALUE uri, VALUE group) { GError* error = NULL; gboolean ret = g_bookmark_file_remove_group(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(group), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_remove_application(VALUE self, VALUE uri, VALUE name) { GError *error = NULL; gboolean ret = g_bookmark_file_remove_application(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(name), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_remove_item(VALUE self, VALUE uri) { GError *error = NULL; gboolean ret = g_bookmark_file_remove_item(_SELF(self), RVAL2CSTR(uri), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_move_item(VALUE self, VALUE old_uri, VALUE new_uri) { GError *error = NULL; gboolean ret = g_bookmark_file_move_item(_SELF(self), RVAL2CSTR(old_uri), RVAL2CSTR(new_uri), &error); if (! ret) RAISE_GERROR(error); return self; } void Init_glib_bookmark_file(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_BOOKMARK_FILE, "BookmarkFile", mGLib); G_DEF_ERROR(G_BOOKMARK_FILE_ERROR, "BookmarkFileError", mGLib, rb_eRuntimeError, G_TYPE_BOOKMARK_FILE_ERROR); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(load_from_file, 1); RG_DEF_METHOD(load_from_data, 1); RG_DEF_METHOD(load_from_data_dirs, 1); RG_DEF_METHOD(to_data, 0); RG_DEF_METHOD(to_file, 1); RG_DEF_METHOD_P(has_item, 1); RG_DEF_METHOD_P(has_group, 2); RG_DEF_METHOD_P(has_application, 2); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(uris, 0); RG_DEF_METHOD(get_title, 1); RG_DEF_METHOD(get_description, 1); RG_DEF_METHOD(get_mime_type, 1); RG_DEF_METHOD_P(private, 1); RG_DEF_METHOD(get_icon, 1); RG_DEF_METHOD(get_added, 1); RG_DEF_METHOD(get_modified, 1); RG_DEF_METHOD(get_visited, 1); RG_DEF_METHOD(get_groups, 1); RG_DEF_METHOD(get_applications, 1); RG_DEF_METHOD(get_app_info, 2); RG_DEF_METHOD(set_title, 2); RG_DEF_METHOD(set_description, 2); RG_DEF_METHOD(set_mime_type, 2); RG_DEF_METHOD(set_private, 2); RG_DEF_METHOD(set_icon, 3); RG_DEF_METHOD(set_added, 2); RG_DEF_METHOD(set_groups, 2); RG_DEF_METHOD(set_modified, 2); RG_DEF_METHOD(set_visited, 2); RG_DEF_METHOD(set_app_info, 5); RG_DEF_METHOD(add_group, 2); RG_DEF_METHOD(add_application, 3); RG_DEF_METHOD(remove_group, 2); RG_DEF_METHOD(remove_application, 2); RG_DEF_METHOD(remove_item, 1); RG_DEF_METHOD(move_item, 2); }ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_iochannelerror.c0000644000175000017500000000406411701304107022077 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE cIOChannelError static VALUE rg_s_from_errno(G_GNUC_UNUSED VALUE self, VALUE errno_) { return INT2NUM(g_io_channel_error_from_errno(NUM2INT(errno_))); } void Init_glib_io_channelerror(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_ERROR2(G_IO_CHANNEL_ERROR, "IOChannelError", mGLib, rb_eIOError); /* GIOChannelError */ RG_DEF_SMETHOD(from_errno, 1); rb_define_const(RG_TARGET_NAMESPACE, "FBIG", INT2NUM(G_IO_CHANNEL_ERROR_FBIG)); rb_define_const(RG_TARGET_NAMESPACE, "INVAL", INT2NUM(G_IO_CHANNEL_ERROR_INVAL)); rb_define_const(RG_TARGET_NAMESPACE, "IO", INT2NUM(G_IO_CHANNEL_ERROR_IO)); rb_define_const(RG_TARGET_NAMESPACE, "ISDIR", INT2NUM(G_IO_CHANNEL_ERROR_ISDIR)); rb_define_const(RG_TARGET_NAMESPACE, "NOSPC", INT2NUM(G_IO_CHANNEL_ERROR_NOSPC)); rb_define_const(RG_TARGET_NAMESPACE, "NXIO", INT2NUM(G_IO_CHANNEL_ERROR_NXIO)); rb_define_const(RG_TARGET_NAMESPACE, "OVERFLOW", INT2NUM(G_IO_CHANNEL_ERROR_OVERFLOW)); rb_define_const(RG_TARGET_NAMESPACE, "PIPE", INT2NUM(G_IO_CHANNEL_ERROR_PIPE)); rb_define_const(RG_TARGET_NAMESPACE, "FAILED", INT2NUM(G_IO_CHANNEL_ERROR_FAILED)); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_source.c0000644000175000017500000001162112257552167020404 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" static ID id_call; /*****************************************/ #if !GLIB_CHECK_VERSION(2,30,0) static void source_free(GSource *source) { g_source_unref(source); g_source_destroy(source); } GType g_source_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GSource", (GBoxedCopyFunc)g_source_ref, (GBoxedFreeFunc)source_free); return our_type; } #endif /*****************************************/ #define RG_TARGET_NAMESPACE cSource #define _SELF(s) ((GSource*)RVAL2BOXED(s, G_TYPE_SOURCE)) /* GSource* g_source_new (GSourceFuncs *source_funcs, guint struct_size); */ static VALUE rg_attach(int argc, VALUE *argv, VALUE self) { VALUE context; rb_scan_args(argc, argv, "01", &context); return UINT2NUM(g_source_attach(_SELF(self), RVAL2BOXED(context, G_TYPE_MAIN_CONTEXT))); } static VALUE rg_destroyed_p(VALUE self) { return CBOOL2RVAL(g_source_is_destroyed(_SELF(self))); } static VALUE rg_set_priority(VALUE self, VALUE priority) { g_source_set_priority(_SELF(self), NUM2INT(priority)); return self; } static VALUE rg_priority(VALUE self) { return INT2NUM(g_source_get_priority(_SELF(self))); } static VALUE rg_set_can_recurse(VALUE self, VALUE can_recurse) { g_source_set_can_recurse(_SELF(self), RVAL2CBOOL(can_recurse)); return self; } static VALUE rg_can_recurse_p(VALUE self) { return CBOOL2RVAL(g_source_get_can_recurse(_SELF(self))); } static VALUE rg_id(VALUE self) { return UINT2NUM(g_source_get_id(_SELF(self))); } static VALUE rg_context(VALUE self) { GMainContext* context = g_source_get_context(_SELF(self)); return BOXED2RVAL(context, G_TYPE_MAIN_CONTEXT); } static gboolean source_func(gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 0)); } static VALUE rg_set_callback(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); g_source_set_callback(_SELF(self), (GSourceFunc)source_func, (gpointer)func, (GDestroyNotify)NULL); return self; } /* void g_source_set_callback_indirect (GSource *source, gpointer callback_data, GSourceCallbackFuncs *callback_funcs); */ static VALUE rg_add_poll(VALUE self, VALUE fd) { g_source_add_poll(_SELF(self), RVAL2BOXED(fd, G_TYPE_POLL_FD)); return self; } static VALUE rg_remove_poll(VALUE self, VALUE fd) { g_source_remove_poll(_SELF(self), RVAL2BOXED(fd, G_TYPE_POLL_FD)); return self; } #if GLIB_CHECK_VERSION(2, 28, 0) static VALUE rg_time(VALUE self) { gint64 time; time = g_source_get_time(_SELF(self)); return LL2NUM(time); } #endif /* How can I implement them ? gboolean g_source_remove_by_funcs_user_data (GSourceFuncs *funcs, gpointer user_data); gboolean g_source_remove_by_user_data (gpointer user_data); */ void Init_glib_source(void) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOURCE, "Source", mGLib); id_call = rb_intern("call"); rb_define_const(RG_TARGET_NAMESPACE, "REMOVE", CBOOL2RVAL(G_SOURCE_REMOVE)); rb_define_const(RG_TARGET_NAMESPACE, "CONTINUE", CBOOL2RVAL(G_SOURCE_CONTINUE)); RG_DEF_METHOD(attach, -1); RG_DEF_METHOD_P(destroyed, 0); RG_DEF_METHOD(set_priority, 1); RG_DEF_METHOD(priority, 0); RG_DEF_METHOD(set_can_recurse, 1); RG_DEF_METHOD_P(can_recurse, 0); RG_DEF_METHOD(id, 0); RG_DEF_METHOD(context, 0); RG_DEF_METHOD(set_callback, 0); RG_DEF_METHOD(add_poll, 1); RG_DEF_METHOD(remove_poll, 1); #if GLIB_CHECK_VERSION(2, 28, 0) RG_DEF_METHOD(time, 0); #endif /* GLib::Source.remove is moved to rbglib_maincontext.c */ } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_signal.c0000664000175000017500000007107411740310343020357 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #define RG_TARGET_NAMESPACE cSignal static VALUE RG_TARGET_NAMESPACE; VALUE rbgobj_signal_wrap(guint sig_id); #define default_handler_method_prefix "signal_do_" /**********************************************************************/ static VALUE signal_func_table; void rbgobj_set_signal_func(VALUE klass, const gchar *sig_name, GValToRValSignalFunc func) { VALUE obj = Data_Wrap_Struct(rb_cData, NULL, NULL, func); guint signal_id = g_signal_lookup(sig_name, CLASS2GTYPE(klass)); rb_hash_aset(signal_func_table, UINT2NUM(signal_id), obj); } GValToRValSignalFunc rbgobj_get_signal_func(guint signal_id) { GValToRValSignalFunc func = NULL; VALUE func_obj = rb_hash_aref(signal_func_table, UINT2NUM(signal_id)); if (!NIL_P(func_obj)) Data_Get_Struct(func_obj, void, func); return func; } /**********************************************************************/ static VALUE eNoSignalError; // FIXME: use rb_protect static gboolean accumulator_func(G_GNUC_UNUSED GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer data) { VALUE proc = (VALUE)data; VALUE val = GVAL2RVAL(return_accu); VALUE new = GVAL2RVAL(handler_return); VALUE hint = Qnil; // FIXME VALUE tmp; gboolean continue_emission = TRUE; tmp = rb_funcall(proc, rb_intern("call"), 3, hint, val, new); /* FIXME */ if (TYPE(tmp) == T_ARRAY) { continue_emission = RVAL2CBOOL(rb_ary_entry(tmp, 0)); val = rb_ary_entry(tmp, 1); } else { val = tmp; } rbgobj_rvalue_to_gvalue(val, return_accu); return continue_emission; } struct rval2gtypes_args { VALUE ary; long n; GType *result; }; static VALUE rbg_rval2gtypes_body(VALUE value) { long i; struct rval2gtypes_args *args = (struct rval2gtypes_args *)value; for (i = 0; i < args->n; i++) args->result[i] = rbgobj_gtype_get(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gtypes_rescue(VALUE value) { g_free(((struct rval2gtypes_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GType * rbg_rval2gtypes(volatile VALUE *value, long *n) { struct rval2gtypes_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new(GType, args.n + 1); rb_rescue(rbg_rval2gtypes_body, (VALUE)&args, rbg_rval2gtypes_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } static GType * rbg_rval2gtypes_accept_nil(volatile VALUE *value, long *n) { if (!NIL_P(*value)) return rbg_rval2gtypes(value, n); if (n != NULL) *n = 0; return NULL; } #define RVAL2GTYPES(value, n) rbg_rval2gtypes(&(value), &(n)) #define RVAL2GTYPES_ACCEPT_NIL(value, n) rbg_rval2gtypes_accept_nil(&(value), &(n)) static VALUE gobj_s_signal_new(int argc, VALUE* argv, VALUE self) { const RGObjClassInfo *cinfo = rbgobj_lookup_class(self); VALUE rbsignal_name, rbsignal_flags, accumulator, rbreturn_type, params; const gchar *signal_name; GSignalFlags signal_flags; GClosure *class_closure; GType return_type; GType *param_types; long n_params; guint signal; rb_scan_args(argc, argv, "4*", &rbsignal_name, &rbsignal_flags, &accumulator, &rbreturn_type, ¶ms); if (cinfo->klass != self) rb_raise(rb_eTypeError, "not a registered class: %s", rb_class2name(self)); if (SYMBOL_P(rbsignal_name)) rbsignal_name = rb_str_new2(rb_id2name(SYM2ID(rbsignal_name))); signal_name = RVAL2CSTR(rbsignal_name); signal_flags = NUM2INT(rbsignal_flags); { VALUE factory; VALUE proc; ID method_id; method_id = rb_to_id(rb_str_concat(rb_str_new2(default_handler_method_prefix), rbsignal_name)); factory = rb_eval_string( "lambda{|klass, id|\n" " lambda{|instance,*args|\n" " klass.instance_method(id).bind(instance).call(*args)\n" " }\n" "}\n"); proc = rb_funcall(factory, rb_intern("call"), 2, self, ID2SYM(method_id)); class_closure = g_rclosure_new(proc, Qnil, NULL); /* TODO: Should this be done even if something below it fails? */ g_rclosure_attach(class_closure, self); } return_type = rbgobj_gtype_get(rbreturn_type); param_types = RVAL2GTYPES_ACCEPT_NIL(params, n_params); signal = g_signal_newv(signal_name, cinfo->gtype, signal_flags, class_closure, NIL_P(accumulator) ? NULL : accumulator_func, NIL_P(accumulator) ? NULL : (gpointer)accumulator, NULL, /* c_marshaller */ return_type, n_params, param_types); g_free(param_types); if (!signal) rb_raise(rb_eRuntimeError, "g_signal_newv failed"); if (!NIL_P(accumulator)) G_RELATIVE(self, accumulator); /* FIXME */ return rbgobj_signal_wrap(signal); } static void _signal_list(VALUE result, GType gtype) { guint n_ids, i; guint* ids = g_signal_list_ids(gtype, &n_ids); for (i = 0; i < n_ids; i++) rb_ary_push(result, rb_str_new2(g_signal_name(ids[i]))); g_free(ids); } static VALUE gobj_s_signals(int argc, VALUE* argv, VALUE self) { GType gtype; VALUE inherited_too, result; if (rb_scan_args(argc, argv, "01", &inherited_too) == 0) inherited_too = Qtrue; gtype = CLASS2GTYPE(self); result = rb_ary_new(); if (RVAL2CBOOL(inherited_too)){ guint n_interfaces, i; GType* interfaces = g_type_interfaces(gtype, &n_interfaces); for (i = 0; i < n_interfaces; i++) _signal_list(result, interfaces[i]); g_free(interfaces); for (; gtype; gtype = g_type_parent(gtype)) _signal_list(result, gtype); } else if (GTYPE2CLASS(gtype) == self) { _signal_list(result, gtype); } return result; } static VALUE gobj_s_signal(VALUE self, VALUE name) { const char* sig_name; guint sig_id; if (SYMBOL_P(name)) sig_name = rb_id2name(SYM2ID(name)); else sig_name = StringValuePtr(name); sig_id = g_signal_lookup(sig_name, CLASS2GTYPE(self)); if (!sig_id) rb_raise(eNoSignalError, "no such signal: %s", sig_name); return rbgobj_signal_wrap(sig_id); } static VALUE gobj_sig_has_handler_pending(int argc, VALUE *argv, VALUE self) { VALUE sig, may_be_blocked; const char* sig_name; guint signal_id; GQuark detail; rb_scan_args(argc, argv, "11", &sig, &may_be_blocked); if (SYMBOL_P(sig)) sig_name = rb_id2name(SYM2ID(sig)); else sig_name = StringValuePtr(sig); if (!g_signal_parse_name(sig_name, CLASS2GTYPE(CLASS_OF(self)), &signal_id, &detail, TRUE)) rb_raise(eNoSignalError, "no such signal: %s", sig_name); return CBOOL2RVAL(g_signal_has_handler_pending(RVAL2GOBJ(self), signal_id, detail, RVAL2CBOOL(may_be_blocked))); } static VALUE gobj_sig_connect_impl(gboolean after, int argc, VALUE *argv, VALUE self) { VALUE sig, rest; gulong handler_id; GClosure* rclosure; const char* sig_name; guint signal_id; GQuark detail; VALUE func; GObject *g_object; gchar *tag; rb_scan_args(argc, argv, "1*", &sig, &rest); if (NIL_P(rest)) rest = rb_ary_new(); if (SYMBOL_P(sig)) sig_name = rb_id2name(SYM2ID(sig)); else sig_name = StringValuePtr(sig); if (!g_signal_parse_name(sig_name, CLASS2GTYPE(CLASS_OF(self)), &signal_id, &detail, TRUE)) rb_raise(eNoSignalError, "no such signal: %s", sig_name); func = rb_block_proc(); rclosure = g_rclosure_new(func, rest, rbgobj_get_signal_func(signal_id)); g_rclosure_attach((GClosure *)rclosure, self); g_object = RVAL2GOBJ(self); tag = g_strdup_printf("%s::%s", G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(g_object)), sig_name); g_rclosure_set_tag((GClosure *)rclosure, tag); g_free(tag); handler_id = g_signal_connect_closure_by_id(g_object, signal_id, detail, rclosure, after); return ULONG2NUM(handler_id); } static VALUE gobj_sig_connect(int argc, VALUE *argv, VALUE self) { return gobj_sig_connect_impl(FALSE, argc, argv, self); } static VALUE gobj_sig_connect_after(int argc, VALUE *argv, VALUE self) { return gobj_sig_connect_impl(TRUE, argc, argv, self); } #if 0 static VALUE gobj_sig_get_invocation_hint(VALUE self) { GSignalInvocationHint* hint; hint = g_signal_get_invocation_hint(RVAL2GOBJ(self)); return rb_ary_new3(3, rbgobj_signal_wrap(hint->signal_id), hint->detail ? rb_str_new2(g_quark_to_string(hint->detail)) : Qnil, INT2NUM(hint->run_type)); } #endif struct emit_arg { VALUE self; VALUE args; GSignalQuery query; GQuark detail; GValueArray* instance_and_params; }; static VALUE emit_body(struct emit_arg* arg) { GValue param = G_VALUE_INIT; g_value_init(¶m, G_TYPE_FROM_INSTANCE(RVAL2GOBJ(arg->self))); rbgobj_rvalue_to_gvalue(arg->self, ¶m); g_value_array_append(arg->instance_and_params, ¶m); g_value_unset(¶m); { guint i; for (i = 0; i < arg->query.n_params; i++){ GType gtype = arg->query.param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE; g_value_init(¶m, gtype); rbgobj_rvalue_to_gvalue(rb_ary_entry(arg->args, i), ¶m); g_value_array_append(arg->instance_and_params, ¶m); g_value_unset(¶m); } } { gboolean use_ret = (arg->query.return_type != G_TYPE_NONE); GValue return_value = G_VALUE_INIT; if (use_ret) g_value_init(&return_value, arg->query.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE); g_signal_emitv(arg->instance_and_params->values, arg->query.signal_id, arg->detail, (use_ret) ? &return_value : NULL); if (use_ret) { VALUE ret = GVAL2RVAL(&return_value); g_value_unset(&return_value); return ret; } else { return Qnil; } } } static VALUE emit_ensure(struct emit_arg* arg) { g_value_array_free(arg->instance_and_params); return Qnil; } static VALUE gobj_sig_emit(int argc, VALUE *argv, VALUE self) { VALUE sig; const char* sig_name; guint signal_id; struct emit_arg arg; rb_scan_args(argc, argv, "1*", &sig, &arg.args); if (SYMBOL_P(sig)) sig_name = rb_id2name(SYM2ID(sig)); else sig_name = StringValuePtr(sig); if (!g_signal_parse_name(sig_name, CLASS2GTYPE(CLASS_OF(self)), &signal_id, &arg.detail, FALSE)) rb_raise(eNoSignalError, "invalid signal \"%s\"", sig_name); g_signal_query(signal_id, &arg.query); if (arg.query.n_params != (guint)RARRAY_LEN(arg.args)) rb_raise(rb_eArgError, "wrong number of arguments(%ld for %d)", RARRAY_LEN(arg.args) + 1, arg.query.n_params + 1); arg.self = self; arg.instance_and_params = g_value_array_new(1 + arg.query.n_params); return rb_ensure(emit_body, (VALUE)&arg, emit_ensure, (VALUE)&arg); } static VALUE gobj_sig_emit_stop(VALUE self, VALUE sig) { gpointer instance = RVAL2GOBJ(self); const char* sig_name; guint signal_id; GQuark detail; if (SYMBOL_P(sig)) sig_name = rb_id2name(SYM2ID(sig)); else sig_name = StringValuePtr(sig); if (!g_signal_parse_name(sig_name, CLASS2GTYPE(CLASS_OF(self)), &signal_id, &detail, FALSE)) rb_raise(eNoSignalError, "invalid signal \"%s\"", sig_name); g_signal_stop_emission(instance, signal_id, detail); return self; } static VALUE gobj_sig_handler_unblock(VALUE self, VALUE id); static VALUE _sig_handler_block_ensure(VALUE arg) { VALUE self = RARRAY_PTR(arg)[0]; VALUE id = RARRAY_PTR(arg)[1]; gobj_sig_handler_unblock(self, id); return Qnil; } static VALUE gobj_sig_handler_block(VALUE self, VALUE id) { g_signal_handler_block(RVAL2GOBJ(self), NUM2ULONG(id)); if (rb_block_given_p()) rb_ensure(rb_yield, self, _sig_handler_block_ensure, rb_ary_new3(2, self, id)); return self; } static VALUE gobj_sig_handler_unblock(VALUE self, VALUE id) { g_signal_handler_unblock(RVAL2GOBJ(self), NUM2ULONG(id)); return self; } static VALUE gobj_sig_handler_disconnect(VALUE self, VALUE id) { g_signal_handler_disconnect(RVAL2GOBJ(self), NUM2ULONG(id)); return self; } static VALUE gobj_sig_handler_is_connected(VALUE self, VALUE id) { return CBOOL2RVAL(g_signal_handler_is_connected(RVAL2GOBJ(self), NUM2ULONG(id))); } #if 0 gulong g_signal_handler_find (gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data); guint g_signal_handlers_block_matched (gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data); guint g_signal_handlers_unblock_matched (gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data); guint g_signal_handlers_disconnect_matched (gpointer instance, GSignalMatchType mask, guint signal_id, GQuark detail, GClosure *closure, gpointer func, gpointer data); #endif static VALUE chain_from_overridden_body(struct emit_arg* arg) { g_value_init(arg->instance_and_params->values, G_TYPE_FROM_INSTANCE(RVAL2GOBJ(arg->self))); rbgobj_rvalue_to_gvalue(arg->self, arg->instance_and_params->values); { GValue* params = arg->instance_and_params->values + 1; guint i; for (i = 0; i < arg->query.n_params; i++) { GType gtype = arg->query.param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE; g_value_init(params + i, gtype); rbgobj_rvalue_to_gvalue(rb_ary_entry(arg->args, i), params + i); } } { gboolean use_ret = (arg->query.return_type != G_TYPE_NONE); GValue return_value = G_VALUE_INIT; if (use_ret) g_value_init(&return_value, arg->query.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE); g_signal_chain_from_overridden(arg->instance_and_params->values, (use_ret) ? &return_value : NULL); if (use_ret) { VALUE ret = GVAL2RVAL(&return_value); g_value_unset(&return_value); return ret; } else { return Qnil; } } } static VALUE gobj_sig_chain_from_overridden(int argc, VALUE *argv, VALUE self) { struct emit_arg arg; { GSignalInvocationHint* hint; hint = g_signal_get_invocation_hint(RVAL2GOBJ(self)); if (!hint) rb_raise(rb_eRuntimeError, "can't get signal invocation hint"); g_signal_query(hint->signal_id, &arg.query); } if (arg.query.n_params != (guint)argc) rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)", argc, arg.query.n_params); arg.self = self; arg.args = rb_ary_new4(argc, argv); arg.instance_and_params = g_value_array_new(1 + argc); return rb_ensure(chain_from_overridden_body, (VALUE)&arg, emit_ensure, (VALUE)&arg); } static VALUE gobj_s_method_added(VALUE klass, VALUE id) { const RGObjClassInfo* cinfo = rbgobj_lookup_class(klass); const char* name = rb_id2name(SYM2ID(id)); const int prefix_len = strlen(default_handler_method_prefix); guint signal_id; if (cinfo->klass != klass) return Qnil; if (strncmp(default_handler_method_prefix, name, prefix_len)) return Qnil; signal_id = g_signal_lookup(name + prefix_len, cinfo->gtype); if (!signal_id) return Qnil; { GSignalQuery query; g_signal_query(signal_id, &query); if (query.itype == cinfo->gtype) return Qnil; } { VALUE f = rb_eval_string( "lambda{|klass, id|\n" " lambda{|instance,*args|\n" " klass.instance_method(id).bind(instance).call(*args)\n" " }\n" "}\n"); VALUE proc = rb_funcall(f, rb_intern("call"), 2, klass, id); GClosure* rclosure = g_rclosure_new(proc, Qnil, rbgobj_get_signal_func(signal_id)); g_rclosure_attach((GClosure *)rclosure, klass); g_signal_override_class_closure(signal_id, cinfo->gtype, rclosure); } { VALUE mod = rb_define_module_under(klass, RubyGObjectHookModule); rb_include_module(klass, mod); rbg_define_method(mod, name, gobj_sig_chain_from_overridden, -1); } return Qnil; } /**********************************************************************/ VALUE rbgobj_signal_wrap(guint sig_id) { VALUE result; GSignalQuery* query; result = Data_Make_Struct(RG_TARGET_NAMESPACE, GSignalQuery, NULL, free, query); g_signal_query(sig_id, query); return result; } static VALUE rg_id(VALUE self) { GSignalQuery* query; Data_Get_Struct(self, GSignalQuery, query); return UINT2NUM(query->signal_id); } static VALUE rg_name(VALUE self) { GSignalQuery* query; Data_Get_Struct(self, GSignalQuery, query); return rb_str_new2(query->signal_name); } static VALUE rg_itype(VALUE self) { GSignalQuery* query; Data_Get_Struct(self, GSignalQuery, query); return rbgobj_gtype_new(query->itype); } static VALUE rg_owner(VALUE self) { GSignalQuery* query; Data_Get_Struct(self, GSignalQuery, query); return GTYPE2CLASS(query->itype); } static VALUE rg_return_type(VALUE self) { GSignalQuery* query; Data_Get_Struct(self, GSignalQuery, query); return rbgobj_gtype_new(query->return_type); } static VALUE rg_flags(VALUE self) { GSignalQuery* query; Data_Get_Struct(self, GSignalQuery, query); return UINT2NUM(query->signal_flags); } static VALUE rg_param_types(VALUE self) { GSignalQuery* query; VALUE result; guint i; Data_Get_Struct(self, GSignalQuery, query); result = rb_ary_new2(query->n_params); for (i = 0; i < query->n_params; i++) rb_ary_store(result, i, rbgobj_gtype_new(query->param_types[i])); return result; } static VALUE rg_inspect(VALUE self) { GSignalQuery* query; gchar* s; VALUE result, v; Data_Get_Struct(self, GSignalQuery, query); v = rb_inspect(GTYPE2CLASS(query->itype)); s = g_strdup_printf("#<%s: %s#%s>", rb_class2name(CLASS_OF(self)), StringValuePtr(v), query->signal_name); result = rb_str_new2(s); g_free(s); return result; } #define query_is_flag(flag) \ static VALUE \ query_is_##flag(VALUE self) \ { \ GSignalQuery* query; \ Data_Get_Struct(self, GSignalQuery, query); \ return CBOOL2RVAL(query->signal_flags & flag); \ } query_is_flag(G_SIGNAL_RUN_FIRST) query_is_flag(G_SIGNAL_RUN_LAST) query_is_flag(G_SIGNAL_RUN_CLEANUP) query_is_flag(G_SIGNAL_NO_RECURSE) query_is_flag(G_SIGNAL_DETAILED) query_is_flag(G_SIGNAL_ACTION) query_is_flag(G_SIGNAL_NO_HOOKS) static gboolean hook_func(GSignalInvocationHint* ihint, guint n_param_values, const GValue* param_values, gpointer data) { GClosure* closure = data; GValue ret_val =G_VALUE_INIT; gboolean ret; g_value_init(&ret_val, G_TYPE_BOOLEAN); g_closure_invoke(closure, &ret_val, n_param_values, param_values, ihint); ret = g_value_get_boolean(&ret_val); g_value_unset(&ret_val); return ret; } static gulong g_signal_add_emission_hook_closure (guint signal_id, GQuark detail, GClosure* closure) { guint hook_id; g_closure_ref(closure); g_closure_sink(closure); hook_id = g_signal_add_emission_hook(signal_id, detail, &hook_func, closure, (GDestroyNotify)&g_closure_unref); return hook_id; } static VALUE rg_add_emission_hook(int argc, VALUE* argv, VALUE self) { GSignalQuery* query; VALUE proc; guint hook_id; GQuark detail = 0; GClosure* closure; Data_Get_Struct(self, GSignalQuery, query); if (query->signal_flags & G_SIGNAL_DETAILED) { VALUE detail_obj; if (rb_scan_args(argc, argv, "01&", &detail_obj, &proc) == 1) { if (SYMBOL_P(detail_obj)) detail = g_quark_from_string(rb_id2name(SYM2ID(detail_obj))); else detail = g_quark_from_string(StringValuePtr(detail_obj)); } } else { rb_scan_args(argc, argv, "00&", &proc); } closure = g_rclosure_new(proc, Qnil, rbgobj_get_signal_func(query->signal_id)); g_rclosure_attach(closure, self); hook_id = g_signal_add_emission_hook_closure(query->signal_id, detail, closure); return ULONG2NUM(hook_id); } static VALUE rg_remove_emission_hook(VALUE self, VALUE hook_id) { GSignalQuery* query; Data_Get_Struct(self, GSignalQuery, query); g_signal_remove_emission_hook(query->signal_id, NUM2ULONG(hook_id)); return Qnil; } /**********************************************************************/ void rbgobj_define_action_methods(VALUE klass) { GType gtype = CLASS2GTYPE(klass); GString* source; guint n_ids; guint* ids; guint i; if (gtype == G_TYPE_INTERFACE) return; ids = g_signal_list_ids(gtype, &n_ids); if (n_ids == 0) return; source = g_string_new(NULL); for (i = 0; i < n_ids; i++){ GSignalQuery query; g_signal_query(ids[i], &query); if (query.signal_flags & G_SIGNAL_ACTION) { gchar* method_name = g_strdup(query.signal_name); gchar* p; GString* args; guint j; for (p = method_name; *p; p++) if (*p == '-') *p = '_'; args = g_string_new(NULL); for (j = 0; j < query.n_params; j++) g_string_append_printf(args, ",x%d", j); g_string_append_printf( source, "def %s(%s)\n signal_emit('%s'%s)\nend\n", method_name, (query.n_params > 0) ? args->str + 1 : "", // Skip initial ',' query.signal_name, args->str); g_free(method_name); g_string_free(args, TRUE); } } if (source->len > 0) rb_funcall(klass, rb_intern("module_eval"), 1, rb_str_new2(source->str)); g_string_free(source, TRUE); } /**********************************************************************/ void Init_gobject_gsignal(void) { VALUE cSignalFlags, cSignalMatchType; RG_TARGET_NAMESPACE = rb_define_class_under(mGLib, "Signal", rb_cData); RG_DEF_METHOD(id, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(itype, 0); RG_DEF_METHOD(owner, 0); RG_DEF_METHOD(return_type, 0); RG_DEF_METHOD(param_types, 0); RG_DEF_METHOD(inspect, 0); RG_DEF_METHOD(add_emission_hook, -1); RG_DEF_METHOD(remove_emission_hook, 1); /* GSignalFlags */ cSignalFlags = G_DEF_CLASS(G_TYPE_SIGNAL_FLAGS, "SignalFlags", mGLib); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_SIGNAL_FLAGS, "G_SIGNAL_"); rb_define_const(cSignalFlags, "MASK", INT2NUM(G_SIGNAL_FLAGS_MASK)); rb_define_const(RG_TARGET_NAMESPACE, "FLAGS_MASK", INT2NUM(G_SIGNAL_FLAGS_MASK)); rbg_define_method(RG_TARGET_NAMESPACE, "run_first?", query_is_G_SIGNAL_RUN_FIRST, 0); rbg_define_method(RG_TARGET_NAMESPACE, "run_last?", query_is_G_SIGNAL_RUN_LAST, 0); rbg_define_method(RG_TARGET_NAMESPACE, "run_cleanup?", query_is_G_SIGNAL_RUN_CLEANUP, 0); rbg_define_method(RG_TARGET_NAMESPACE, "no_recurse?", query_is_G_SIGNAL_NO_RECURSE, 0); rbg_define_method(RG_TARGET_NAMESPACE, "detailed?", query_is_G_SIGNAL_DETAILED, 0); rbg_define_method(RG_TARGET_NAMESPACE, "action?", query_is_G_SIGNAL_ACTION, 0); rbg_define_method(RG_TARGET_NAMESPACE, "no_hooks?", query_is_G_SIGNAL_NO_HOOKS, 0); /* GConnectFlags */ G_DEF_CLASS(G_TYPE_CONNECT_FLAGS, "ConnectFlags", mGLib); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_CONNECT_FLAGS, "G_"); /* GSignalMatchType */ cSignalMatchType = G_DEF_CLASS(G_TYPE_SIGNAL_MATCH_TYPE, "SignalMatchType", mGLib); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_SIGNAL_MATCH_TYPE, "G_SIGNAL_"); rb_define_const(cSignalMatchType, "MASK", INT2NUM(G_SIGNAL_MATCH_MASK)); rb_define_const(RG_TARGET_NAMESPACE, "MATCH_MASK", INT2NUM(G_SIGNAL_MATCH_MASK)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STATIC_SCOPE", INT2FIX(G_SIGNAL_TYPE_STATIC_SCOPE)); eNoSignalError = rb_define_class_under(mGLib, "NoSignalError", rb_eNameError); signal_func_table = rb_hash_new(); rb_global_variable(&signal_func_table); rbg_define_method(mMetaInterface, "signal_new", gobj_s_signal_new, -1); rbg_define_method(mMetaInterface, "signals", gobj_s_signals, -1); rbg_define_method(mMetaInterface, "signal", gobj_s_signal, 1); rbg_define_method(cInstantiatable, "signal_has_handler_pending?", gobj_sig_has_handler_pending, -1); rbg_define_method(cInstantiatable, "signal_connect", gobj_sig_connect, -1); rbg_define_method(cInstantiatable, "signal_connect_after", gobj_sig_connect_after, -1); #if 0 rbg_define_method(cInstantiatable, "signal_invocation_hint", gobj_sig_get_invocation_hint, 0); #endif rbg_define_method(cInstantiatable, "signal_emit", gobj_sig_emit, -1); rbg_define_method(cInstantiatable, "signal_emit_stop", gobj_sig_emit_stop, 1); rbg_define_method(cInstantiatable, "signal_handler_block", gobj_sig_handler_block, 1); rbg_define_method(cInstantiatable, "signal_handler_unblock", gobj_sig_handler_unblock, 1); rbg_define_method(cInstantiatable, "signal_handler_disconnect", gobj_sig_handler_disconnect, 1); rbg_define_method(cInstantiatable, "signal_handler_is_connected?", gobj_sig_handler_is_connected, 1); rbg_define_singleton_method(cInstantiatable, "method_added", gobj_s_method_added, 1); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglibdeprecated.h0000644000175000017500000000232411701304107021030 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGLIBDEPRECATED_H__ #define __RBGLIBDEPRECATED_H__ G_BEGIN_DECLS #define CSTRFILENAMEARRAY2RVAL_FREE(s) (rbg_filename_gslist_to_array_free(s)) extern VALUE rbg_filename_gslist_to_array_free(GSList *list); G_END_DECLS #endif /* __RBGLIBDEPRECATED_H__ */ ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbgobj_enumflags.c0000644000175000017500000000553211701304107021053 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include typedef struct { char *original; char *replacement; } constant_map; static GSList *rbgobj_cmap = NULL; static gint rbgobj_constant_find(constant_map *a, char *name) { return strcmp(a->original, name); } void rbgobj_constant_remap(const char *original, const char *replacement) { constant_map *map = g_new(constant_map,1); map->original = g_strdup(original); map->replacement = g_strdup(replacement); rbgobj_cmap = g_slist_append(rbgobj_cmap, map); } char * rg_obj_constant_lookup(const char *name) { GSList *p = rbgobj_cmap; p = g_slist_find_custom(rbgobj_cmap, name, (GCompareFunc)rbgobj_constant_find); if (p) { char *replacement; constant_map *map; map = (constant_map *)p->data; rbgobj_cmap = g_slist_delete_link(rbgobj_cmap, p); replacement = map->replacement; g_free(map->original); g_free(map); return replacement; } return NULL; } void rbgobj_define_const(VALUE mod, const char *name, VALUE value) { if (name[0] >= 'A' && name[0] <= 'Z') { rb_define_const(mod, name, value); } else { char *new_name = rg_obj_constant_lookup(name); if (new_name) { rb_define_const(mod, new_name, value); g_free(new_name); } else { rb_warn("Invalid constant name '%s' - skipped", name); } } } void rbgobj_add_constants(VALUE mod, GType type, const gchar *strip_prefix) { if (G_TYPE_IS_ENUM(type)) { rg_enum_add_constants(mod, type, strip_prefix); } else if (G_TYPE_IS_FLAGS(type)) { rg_flags_add_constants(mod, type, strip_prefix); } else { g_warning("`%s' is not an enum/flags type", g_type_name(type)); } } void Init_gobject_genumflags(void) { Init_gobject_genums(); Init_gobject_gflags(); } ruby-gnome2-all-2.1.0/glib2/ext/glib2/rbglib_spawn.c0000664000175000017500000001627411740310343020227 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * Copyright (C) 2004 Kazuhiro NISHIYAMA * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgprivate.h" #include "rbglib.h" #define RG_TARGET_NAMESPACE mSpawn static ID id_call; static ID id_new; static void child_setup(gpointer func) { if (! NIL_P(func)){ rb_funcall((VALUE)func, id_call, 0); } } static VALUE rg_s_async_with_pipes(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags) { GError *err = NULL; gboolean ret; GPid child_pid; VALUE func = Qnil; gchar **gargv; gchar **genvp; gint standard_input, standard_output, standard_error; if (rb_block_given_p()) { func = rb_block_proc(); G_RELATIVE(self, func); } gargv = (gchar **)RVAL2STRV(argv); genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp); ret = g_spawn_async_with_pipes(RVAL2CSTR_ACCEPT_NIL(working_directory), gargv, genvp, NUM2INT(flags), (GSpawnChildSetupFunc)child_setup, (gpointer)func, &child_pid, &standard_input, &standard_output, &standard_error, &err); g_free(gargv); g_free(genvp); if (!ret) RAISE_GERROR(err); return rb_ary_new3(4, INT2NUM((gint)child_pid), rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_input)), rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_output)), rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_error))); } static VALUE rg_s_async(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags) { GError *err = NULL; gboolean ret; GPid child_pid; VALUE func = Qnil; gchar **gargv; gchar **genvp; if (rb_block_given_p()) { func = rb_block_proc(); G_RELATIVE(self, func); } gargv = (gchar **)RVAL2STRV(argv); genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp); ret = g_spawn_async(RVAL2CSTR_ACCEPT_NIL(working_directory), gargv, genvp, NUM2INT(flags), (GSpawnChildSetupFunc)child_setup, (gpointer)func, &child_pid, &err); g_free(gargv); g_free(genvp); if (!ret) RAISE_GERROR(err); return INT2NUM((int)child_pid); } static VALUE rg_s_sync(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags) { GError *err = NULL; gboolean ret; VALUE func = Qnil; gchar** gargv; gchar** genvp; gchar *standard_output = NULL, *standard_error = NULL; gint exit_status; VALUE std_out, std_err; if (rb_block_given_p()) { func = rb_block_proc(); G_RELATIVE(self, func); } gargv = (gchar **)RVAL2STRV(argv); genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp); ret = g_spawn_sync(RVAL2CSTR_ACCEPT_NIL(working_directory), gargv, genvp, NUM2INT(flags), (GSpawnChildSetupFunc)child_setup, (gpointer)func, &standard_output, &standard_error, &exit_status, &err); g_free(gargv); g_free(genvp); if (!ret) RAISE_GERROR(err); if (standard_output) { std_out = CSTR2RVAL(standard_output); g_free(standard_output); } else { std_out = Qnil; standard_output = NULL; } if (standard_error) { std_err = CSTR2RVAL(standard_error); g_free(standard_error); standard_error = NULL; } else { std_err = Qnil; } if (! ret) RAISE_GERROR(err); return rb_ary_new3(3, std_out, std_err, INT2FIX(exit_status)); } static VALUE rg_s_command_line_sync(G_GNUC_UNUSED VALUE self, VALUE str) { GError *err = NULL; const gchar *command_line; gchar *standard_output = NULL, *standard_error = NULL; gint exit_status; VALUE std_out, std_err; gboolean ret; command_line = RVAL2CSTR(str); ret = g_spawn_command_line_sync(command_line, &standard_output, &standard_error, &exit_status, &err); if (standard_output) { std_out = CSTR2RVAL(standard_output); g_free(standard_output); } else { std_out = Qnil; standard_output = NULL; } if (standard_error) { std_err = CSTR2RVAL(standard_error); g_free(standard_error); standard_error = NULL; } else { std_err = Qnil; } if (! ret) RAISE_GERROR(err); return rb_ary_new3(3, std_out, std_err, INT2FIX(exit_status)); } static VALUE rg_s_command_line_async(G_GNUC_UNUSED VALUE self, VALUE str) { GError *err = NULL; const gchar *command_line; VALUE ret; command_line = StringValuePtr(str); ret = CBOOL2RVAL(g_spawn_command_line_async(command_line, &err)); if (err != NULL) RAISE_GERROR(err); return ret; } #ifdef HAVE_G_SPAWN_CLOSE_PID #define RVAL2GPID(value) ((GPid)NUM2INT(pid)) static VALUE rg_s_close_pid(G_GNUC_UNUSED VALUE self, VALUE pid) { g_spawn_close_pid(RVAL2GPID(pid)); return Qnil; } #endif void Init_glib_spawn(void) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGLib, "Spawn"); id_call = rb_intern("call"); id_new = rb_intern("new"); /* glib/gspawn.h */ RG_DEF_SMETHOD(async_with_pipes, 4); RG_DEF_SMETHOD(async, 4); RG_DEF_SMETHOD(sync, 4); RG_DEF_SMETHOD(command_line_sync, 1); RG_DEF_SMETHOD(command_line_async, 1); #ifdef HAVE_G_SPAWN_CLOSE_PID RG_DEF_SMETHOD(close_pid, 1); #endif rb_define_const(RG_TARGET_NAMESPACE, "LEAVE_DESCRIPTORS_OPEN", INT2NUM(G_SPAWN_LEAVE_DESCRIPTORS_OPEN)); rb_define_const(RG_TARGET_NAMESPACE, "DO_NOT_REAP_CHILD", INT2NUM(G_SPAWN_DO_NOT_REAP_CHILD)); rb_define_const(RG_TARGET_NAMESPACE, "SEARCH_PATH", INT2NUM(G_SPAWN_SEARCH_PATH)); rb_define_const(RG_TARGET_NAMESPACE, "STDOUT_TO_DEV_NULL", INT2NUM(G_SPAWN_STDOUT_TO_DEV_NULL)); rb_define_const(RG_TARGET_NAMESPACE, "STDERR_TO_DEV_NULL", INT2NUM(G_SPAWN_STDERR_TO_DEV_NULL)); rb_define_const(RG_TARGET_NAMESPACE, "CHILD_INHERITS_STDIN", INT2NUM(G_SPAWN_CHILD_INHERITS_STDIN)); rb_define_const(RG_TARGET_NAMESPACE, "FILE_AND_ARGV_ZERO", INT2NUM(G_SPAWN_FILE_AND_ARGV_ZERO)); } ruby-gnome2-all-2.1.0/glib2/TODO0000644000175000017500000000015411701304107014265 0ustar koukou* GIO support * inspect include readable properties. * make log message handler set by Ruby/GLib removable. ruby-gnome2-all-2.1.0/glib2/README0000644000175000017500000000144012257552167014476 0ustar koukouRuby/GLib2 ========== Ruby/GLib2 is a Ruby binding of GLib-2.12.x. Requirements ------------ Ruby >= 1.9.x: http://www.ruby-lang.org/ pkg-config.rb: http://github.com/rcairo/pkg-config GLib >= 2.12.x: http://www.gtk.org/ Install (RubyGems) ------------------ % sudo gem install glib2 Windows: > gem install glib2 --platform x86-mingw32 Install (traditional) --------------------- Install ruby-1.9.x or later, pkg-config.rb and GLib-2.12.x. % ruby extconf.rb % make % sudo make install Copying ------- Copyright (c) 2002-2010 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ ruby-gnome2-all-2.1.0/glib2/COPYING.LIB0000644000175000017500000006364212257552167015272 0ustar koukou GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ruby-gnome2-all-2.1.0/glib2/lib/0000755000175000017500000000000012257552167014365 5ustar koukouruby-gnome2-all-2.1.0/glib2/lib/glib2/0000755000175000017500000000000011701304107015342 5ustar koukouruby-gnome2-all-2.1.0/glib2/lib/glib2/deprecatable.rb0000644000175000017500000001260211701304107020303 0ustar koukoumodule GLib module Deprecatable unless respond_to?(:define_singleton_method) def define_singleton_method(name, &block) singleton_class = class << self; self; end singleton_class.__send__(:define_method, name, &block) end end @@deprecated_const = {} def define_deprecated_const(deprecated_const, new_const = {}) @@deprecated_const[self] ||= {} @@deprecated_const[self][deprecated_const.to_sym] = new_const end def define_deprecated_enums(enums, prefix = nil) enums = module_eval(enums.to_s) rescue return enums.constants.each do |const| deprecated_const = prefix ? "#{prefix}_#{const}" : const new_const = [enums, const].join('::') define_deprecated_const(deprecated_const, new_const) end end alias :define_deprecated_flags :define_deprecated_enums def define_deprecated_singleton_method(deprecated_method, new_method = {}, &block) __define_deprecated_method__(:singleton, deprecated_method, new_method, &block) end def define_deprecated_method(deprecated_method, new_method = {}, &block) __define_deprecated_method__(:instance, deprecated_method, new_method, &block) end def define_deprecated_method_by_hash_args(deprecated_method, old_args, new_args, req_argc = 0, &block) klass = self alias_name = "__deprecatable_#{deprecated_method}__" alias_method alias_name, deprecated_method private alias_name define_method(deprecated_method) do |*margs, &mblock| if (margs.size == req_argc) || (margs.size == (req_argc + 1) && margs.last.is_a?(Hash)) else margs = block.call(self, *margs, &mblock) msg = "#{caller[0]}: '#{klass}##{deprecated_method}(#{old_args})' style has been deprecated." warn "#{msg} Use '#{klass}##{deprecated_method}(#{new_args})' style." end __send__(alias_name, *margs, &mblock) end end @@deprecated_signal = {} def define_deprecated_signal(deprecated_signal, new_signal = {}) @@deprecated_signal[self] ||= {} @@deprecated_signal[self][deprecated_signal.to_s.gsub('_', '-').to_sym] = new_signal end def self.extended(class_or_module) GLib::Instantiatable.class_eval do %w(signal_connect signal_connect_after).each do |connect_method| alias_name = "__deprecatable_#{connect_method}__" next if private_method_defined?(alias_name) alias_method alias_name, connect_method private alias_name define_method(connect_method) do |signal, *margs, &mblock| signal = signal.to_s.gsub('_', '-').to_sym signals = @@deprecated_signal[self] if new_signal = (signals || {})[signal] msg = "#{caller[0]}: '#{signal}' signal has been deprecated." case new_signal when String, Symbol warn "#{msg} Use '#{new_signal}' signal." signal = new_signal when Hash if new_signal[:raise] raise DeprecatedError.new("#{msg} #{new_signal[:raise]}") elsif new_signal[:warn] warn "#{msg} #{new_signal[:warn]}" else warn "#{msg} Don't use this signal anymore." end return end end __send__(alias_name, signal, *margs, &mblock) end end end end private def const_missing(deprecated_const) if new_const = (@@deprecated_const[self] || {})[deprecated_const.to_sym] msg = "#{caller[0]}: '#{[name, deprecated_const].join('::')}' has been deprecated." case new_const when String, Symbol new_const_val = constant_get(new_const) case new_const_val when GLib::Enum, GLib::Flags alt = " or ':#{new_const_val.nick.gsub('-', '_')}'" end warn "#{msg} Use '#{new_const}'#{alt}." return const_set(deprecated_const, new_const_val) when Hash if new_const[:raise] raise DeprecatedError.new("#{msg} #{new_const[:raise]}") elsif new_const[:warn] warn "#{msg} #{new_const[:warn]}" else warn "#{msg} Don't use this constant anymore." end return end end raise NameError.new("uninitialized constant #{[self, deprecated_const].join('::')}") end def constant_get(const) const.split('::').inject(Object){|r, c| r.const_get(c)} end def __define_deprecated_method__(type, deprecated_method, new_method = {}, &block) def_method = type == :singleton ? :define_singleton_method : :define_method sep = type == :singleton ? '.' : '#' klass = self __send__(def_method, deprecated_method) do |*margs, &mblock| msg = "#{caller[0]}: '#{klass}#{sep}#{deprecated_method}' has been deprecated." case new_method when String, Symbol warn "#{msg} Use '#{klass}#{sep}#{new_method}'." __send__(new_method, *margs, &mblock) when Hash if new_method[:raise] raise DeprecatedError.new("#{msg} #{new_method[:raise]}") elsif new_method[:warn] warn "#{msg} #{new_method[:warn]}" block.call(self, *margs, &mblock) if block end end end end end class DeprecatedError < RuntimeError end end ruby-gnome2-all-2.1.0/glib2/lib/gnome2-raketask.rb0000644000175000017500000000033712137115064017673 0ustar koukou# Copyright(C) 2013 Ruby-GNOME2 Project. # # This program is licenced under the same license of Ruby-GNOME2. # Just for backward compatibility. require "gnome2/rake/package-task" GNOME2Package = GNOME2::Rake::PackageTask ruby-gnome2-all-2.1.0/glib2/lib/glib2.rb0000644000175000017500000001274412257552167015721 0ustar koukou# # glib2.rb # Copyright(C) 2005-2010 Ruby-GNOME2 Project. # # This program is licenced under the same license of Ruby-GNOME2. require 'pathname' require 'English' require 'thread' require 'glib2/deprecatable' module GLib module_function def check_binding_version?(major, minor, micro) BINDING_VERSION[0] > major || (BINDING_VERSION[0] == major && BINDING_VERSION[1] > minor) || (BINDING_VERSION[0] == major && BINDING_VERSION[1] == minor && BINDING_VERSION[2] >= micro) end def exit_application(exception, status) msg = exception.message || exception.to_s msg = exception.class.to_s if msg == "" backtrace = exception.backtrace $stderr.puts backtrace.shift + ": #{msg}" backtrace.each do |v| $stderr.puts "\t from #{v}" end exit(status) end def __add_one_arg_setter(klass) # for Instance methods. method_names = klass.instance_methods(false) method_names.each do |method_name| next if /\Aset_/ !~ method_name property_name = $POSTMATCH next if klass.method_defined?("#{property_name}=") next if klass.instance_method(method_name).arity != 1 begin klass.module_eval("def #{property_name}=(val); set_#{property_name}(val); val; end\n") rescue SyntaxError if $DEBUG $stderr.puts "Couldn't create #{klass}\##{property_name}=(v)." end end end # for Class methods/Module functions. if klass.method(:methods).arity == -1 method_names = klass.methods(false) else method_names = klass.methods end singleton_klass = (class << klass; self; end) method_names.each do |method_name| next if /\Aset_/ !~ method_name property_name = $POSTMATCH next if singleton_klass.method_defined?("#{property_name}=") next if klass.method(method_name).arity != 1 begin klass.module_eval("def self.#{property_name}=(val); set_#{property_name}(val); val; end\n") rescue SyntaxError if $DEBUG $stderr.puts "Couldn't create #{klass}.#{property_name}=(v)." end end end end def prepend_path_to_environment_variable(path, environment_name) path = Pathname(path) unless path.is_a?(Pathname) if path.exist? separator = ::File::PATH_SEPARATOR paths = (ENV[environment_name] || '').split(/#{Regexp.escape(separator)}/) dir = path.to_s dir = dir.gsub(/\//, ::File::ALT_SEPARATOR) if ::File::ALT_SEPARATOR unless paths.include?(dir) paths = [dir] + paths ENV[environment_name] = paths.join(separator) end end end def prepend_dll_path(path) prepend_path_to_environment_variable(path, "PATH") end end base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" if vendor_dir.exist? require "cairo" end GLib.prepend_dll_path(vendor_dir + "bin") begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/glib2.so" rescue LoadError require 'glib2.so' end module GLib class Type def decendants [self] + children.map{|t| t.decendants }.flatten end def ancestors # ([self] + interfaces + (parent ? parent.ancestors : [])).reverse.uniq.reverse [self] + (parent ? parent.ancestors : []) end end class Enum def _dump(limit) Marshal.dump(to_i, limit) end def self._load(obj) new(Marshal.load(obj)) end end class Flags def _dump(limit) Marshal.dump(to_i, limit) end def self._load(obj) new(Marshal.load(obj)) end # FIXME def inspect values = self.class.values if values.find{|x| x == self } body = nick else a = values.select{|x| self >= x } a = a.reject{|x| a.find{|y| y > x } } body = a.empty? ? '{}' : a.map{|x| x.nick }.join('|') end format('#<%s %s>', self.class.inspect, body) end end module Log DOMAIN = "Ruby/GLib" LEVELS = { LEVEL_ERROR => "ERROR", LEVEL_CRITICAL => "CRITICAL", LEVEL_WARNING => "WARNING", LEVEL_MESSAGE => "MESSAGE", LEVEL_INFO => "INFO", LEVEL_DEBUG => "DEBUG" } module_function def error(str) log(DOMAIN, LEVEL_ERROR, caller(1)[0] << ": " << str) end def message(str) log(DOMAIN, LEVEL_MESSAGE, caller(1)[0] << ": " << str) end def critical(str) log(DOMAIN, LEVEL_CRITICAL, caller(1)[0] << ": " << str) end def warning(str) log(DOMAIN, LEVEL_WARNING, caller(1)[0] << ": " << str) end def set_log_domain(domain) level = GLib::Log::LEVEL_MASK if $DEBUG level = 255 elsif $VERBOSE level = 127 end GLib::Log.set_handler(domain, level) end end if const_defined?(:UserDirectory) class UserDirectory constants.each do |name| if /\ADIRECTORY_/ =~ name const_set($POSTMATCH, const_get(name)) end end end end LOG_DOMAIN = "GLib" class Object LOG_DOMAIN = "GLib-GObject" end class Thread LOG_DOMAIN = "GThread" end module Module LOG_DOMAIN = "GModule" end end GLib::Log.set_log_domain(nil) GLib::Log.set_log_domain(GLib::LOG_DOMAIN) GLib::Log.set_log_domain(GLib::Object::LOG_DOMAIN) GLib::Log.set_log_domain(GLib::Thread::LOG_DOMAIN) GLib::Log.set_log_domain(GLib::Module::LOG_DOMAIN) =begin Don't we need this? ObjectSpace.define_finalizer(GLib) { GLib::Log.cancel_handler puts "GLib::Log.cancel_handler was called." if $DEBUG } =end ruby-gnome2-all-2.1.0/glib2/lib/1.8/0000755000175000017500000000000012257665514014674 5ustar koukouruby-gnome2-all-2.1.0/glib2/lib/gnome2/0000755000175000017500000000000012137115064015540 5ustar koukouruby-gnome2-all-2.1.0/glib2/lib/gnome2/rake/0000755000175000017500000000000012257664725016502 5ustar koukouruby-gnome2-all-2.1.0/glib2/lib/gnome2/rake/win32-binary-download-task.rb0000644000175000017500000001165512137115064024010 0ustar koukou# Copyright(C) 2010-2012 Ruby-GNOME2 Project. # # This program is licenced under the same license of Ruby-GNOME2. require 'open-uri' require 'rubygems' require 'mechanize' class GNOME2Win32BinaryDownloadTask include Rake::DSL URL_BASE = "http://ftp.gnome.org/pub/gnome/binaries/win32" def initialize(package) @package = package define end private def define namespace :win32 do namespace :downloader do task :before download_tasks = [] namespace :download do directory dist_dir.to_s task :prepare => [dist_dir.to_s] packages.each do |package| desc "download #{package}" task package => [:prepare] do download_package(package) end download_tasks << package end dependencies.each do |dependency| name, version = dependency desc "download #{name}" task name => [:prepare] do download_dependency(dependency) end download_tasks << name end end download_tasks = download_tasks.collect do |task| "win32:downloader:download:#{task}" end desc "download Windows binaries into #{dist_dir}" task :download => download_tasks task :after end desc "download Windows binaries" task :download => ["win32:downloader:before", "win32:downloader:download", "win32:downloader:after"] end end def dist_dir @package.windows.absolute_binary_dir end def packages @package.windows.packages end def dependencies @package.windows.dependencies end def download_package(package) version_page_url = "#{URL_BASE}/#{package}" version_page = agent.get(version_page_url) latest_version_link = version_page.links.sort_by do |link| if /\A(\d+\.\d+)\/\z/ =~ link.href $1.split(/\./).collect {|component| component.to_i} else [-1] end end.last escaped_package = Regexp.escape(package) latest_version_page = latest_version_link.click latest_version = latest_version_page.links.collect do |link| case link.href when /#{escaped_package}_([\d\.\-]+)_win32\.zip\z/, /#{escaped_package}-([\d\.\-]+)-win32\.zip\z/, # old /#{escaped_package}-([\d\.\-]+)\.zip\z/ # old version = $1 normalized_version = version.split(/[\.\-]/).collect do |component| component.to_i end [normalized_version, version] else [[-1], nil] end end.sort_by do |normalized_version, version| normalized_version end.last[1] if latest_version.nil? raise "can't find package: <#{package}>:<#{version_page_url}>" end escaped_latest_version = Regexp.escape(latest_version) latest_version_page.links.each do |link| case link.href when /#{escaped_package}(?:-dev)?_#{escaped_latest_version}_win32\.zip\z/, /#{escaped_package}(?:-dev)?-#{escaped_latest_version}-win32\.zip\z/, # old /#{escaped_package}(?:-dev)?-#{escaped_latest_version}\.zip\z/ # old click_zip_link(link) end end end def download_dependency(dependency) dependency_version = "any" dependency_version_re = /[\d\.\-]+/ if dependency.is_a?(Array) dependency, dependency_version = dependency dependency_version_re = /#{Regexp.escape(dependency_version)}/ end escaped_dependency = Regexp.escape(dependency) dependencies_url = "#{URL_BASE}/dependencies" dependencies_page = agent.get(dependencies_url) latest_version = dependencies_page.links.collect do |link| case link.href when /\A#{escaped_dependency}_(#{dependency_version_re})_win32\.zip\z/ version = $1 [version.split(/[\.\-]/).collect {|component| component.to_i}, version] else [[-1], nil] end end.sort_by do |normalized_version, version| normalized_version end.last[1] if latest_version.nil? message = "can't find dependency package: " + "<#{dependency}>(#{dependency_version}):<#{dependencies_url}>" raise message end escaped_latest_version = Regexp.escape(latest_version) dependencies_page.links.each do |link| case link.href when /\A#{escaped_dependency}(?:-dev)?_#{escaped_latest_version}_win32\.zip\z/ click_zip_link(link) end end end private def agent @agent ||= Mechanize.new end def click_zip_link(link) zip = link.click Dir.chdir(dist_dir) do open(zip.filename, "wb") do |file| file.print(zip.body) end system("unzip", "-o", zip.filename) Dir.glob("lib/pkgconfig/*.pc") do |pc_path| pc = File.read(pc_path) pc = pc.gsub(/\Aprefix=.+$/) {"prefix=#{dist_dir}"} File.open(pc_path, "w") do |pc_file| pc_file.print(pc) end end end end end ruby-gnome2-all-2.1.0/glib2/lib/gnome2/rake/native-binary-build-task.rb0000644000175000017500000001007212257552167023630 0ustar koukou# -*- ruby -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "rake" module GNOME2 module Rake class NativeBinaryBuildTask include ::Rake::DSL def initialize(package) @package = package end def define namespace :native do namespace :builder do task :before define_build_tasks build_tasks = build_packages.collect do |package| "native:builder:build:#{package.name}" end task :build => build_tasks task :after end desc "Build binaries for build environment" task :build => [ "native:builder:before", "native:builder:build", "native:builder:after", ] end end private def define_build_tasks namespace :build do build_packages.each do |package| namespace package.name do download_task = "source:downloader:download:#{package.name}" built_file = package.native.built_file if built_file built_file = dist_dir + built_file file built_file.to_s do ::Rake::Task[download_task].invoke build_package_task_body(package) end task :build => built_file.to_s else task :build => [download_task] do build_patckage_task_body(package) end end end desc "Build #{package.label} and install it into #{dist_dir}." task package.name => "native:builder:build:#{package.name}:build" end end end def build_package_task_body(package) package_tmp_dir = @package.tmp_dir + package.name rm_rf(package_tmp_dir) mkdir_p(package_tmp_dir) tar_full_path = @package.download_dir + package.archive_base_name Dir.chdir(package_tmp_dir.to_s) do sh("tar", "xf", tar_full_path.to_s) or exit(false) end Dir.chdir((package_tmp_dir + package.base_name).to_s) do package.native.patches.each do |patch| sh("patch -p1 < #{@package.patches_dir}/#{patch}") end sh("./autogen.sh") if package.native.need_autogen? sh("autoreconf --install") if package.native.need_autoreconf? sh("./configure", "PKG_CONFIG_PATH=#{pkg_config_path}", "--prefix=#{dist_dir}", *package.native.configure_args) or exit(false) common_make_args = [] common_make_args << "GLIB_COMPILE_SCHEMAS=glib-compile-schemas" build_make_args = common_make_args.dup install_make_args = common_make_args.dup if package.native.build_concurrently? make_n_jobs = ENV["MAKE_N_JOBS"] build_make_args << "-j#{make_n_jobs}" if make_n_jobs end sh("nice", "make", *build_make_args) or exit(false) sh("make", "install", *install_make_args) or exit(false) end end def build_packages @package.external_packages.select do |package| package.native.build? end end def dist_dir @package.native.absolute_binary_dir end def pkg_config_path dist_dir + "lib/pkgconfig" end end end end ruby-gnome2-all-2.1.0/glib2/lib/gnome2/rake/source-download-task.rb0000644000175000017500000000507412257552167023076 0ustar koukou# -*- ruby -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "open-uri" require "pathname" require "rake" module GNOME2 module Rake class SourceDownloadTask include ::Rake::DSL def initialize(package) @package = package end def define namespace :source do namespace :downloader do task :before define_download_tasks download_tasks = @package.external_packages.collect do |package| "source:downloader:download:#{package.name}" end task :download => download_tasks task :after end desc "Dowanload sources" task :download => [ "source:downloader:before", "source:downloader:download", "source:downloader:after", ] end end def define_download_tasks namespace :download do @package.external_packages.each do |package| download_dir = @package.download_dir tar_full_path = download_dir + package.archive_base_name task :before task :after desc "Download #{package.label} into #{download_dir}." # task package[:name] => [:before, tar_full_path.to_s, :after] task package[:name] => tar_full_path.to_s directory_path = tar_full_path.dirname directory directory_path.to_s file tar_full_path.to_s => directory_path.to_s do archive_url = package.archive_url rake_output_message "Downloading... #{archive_url}" open(archive_url) do |downloaded_tar| tar_full_path.open("wb") do |tar_file| tar_file.print(downloaded_tar.read) end end end end end end end end end ruby-gnome2-all-2.1.0/glib2/lib/gnome2/rake/external-package.rb0000644000175000017500000001344112257566556022250 0ustar koukou# -*- ruby -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module GNOME2 module Rake class ExternalPackage < Struct.new(:name, :base_name, :archive_base_name, :label, :version, :download_site, :download_base_url, :compression_method, :windows, :native, :patches, :need_autogen, :need_autoreconf, :build_concurrently, :bundled_packages) def initialize(properties) super() properties.each do |key, value| send("#{key}=", value) end end def compression_method super || "gz" end def base_name super || "#{name}-#{version}" end def archive_base_name super || "#{base_name}.tar.#{compression_method}" end def archive_url "#{download_base_url}/#{archive_base_name}" end def download_base_url super || download_site_base_url end def patches super || [] end def need_autogen? need_autogen end def need_autoreconf? need_autoreconf end def windows super || WindowsConfiguration.new({}) end def windows=(properties) super(WindowsConfiguration.new(properties)) end def native super || NativeConfiguration.new({}) end def native=(properties) super(NativeConfiguration.new(properties)) end def bundled_packages super || [] end private def download_site_base_url case download_site when :gnome base_url = "http://ftp.gnome.org/pub/gnome/sources" release_series = version.gsub(/\A(\d+\.\d+)(?:[^\d].*)?\z/, '\1') base_url << "/#{name}/#{release_series}" else base_url = nil end base_url end class WindowsConfiguration < Struct.new(:build, :include_paths, :library_paths, :configure_args, :cc_args, :patches, :built_file, :need_autogen, :need_autoreconf, :build_concurrently, :use_cc_environment_variable) def initialize(properties) super() properties.each do |key, value| send("#{key}=", value) end end def build? build.nil? ? true : build end def include_paths super || [] end def library_paths super || [] end def configure_args super || [] end def cc_args super || [] end def patches super || [] end def built_file super || nil end def need_autogen? need_autogen.nil? ? false : need_autogen end def need_autoreconf? need_autoreconf.nil? ? false : need_autoreconf end def build_concurrently? build_concurrently.nil? ? true : build_concurrently end def use_cc_environment_variable? use_cc_environment_variable.nil? ? true : use_cc_environment_variable end end class NativeConfiguration < Struct.new(:build, :configure_args, :patches, :built_file, :need_autogen, :need_autoreconf, :build_concurrently) def initialize(properties) super() properties.each do |key, value| send("#{key}=", value) end end def build? build.nil? ? false : build end def configure_args super || [] end def patches super || [] end def built_file super || nil end def need_autogen? need_autogen.nil? ? false : need_autogen end def need_autoreconf? need_autoreconf.nil? ? false : need_autoreconf end def build_concurrently? build_concurrently.nil? ? true : build_concurrently end end end end end ruby-gnome2-all-2.1.0/glib2/lib/gnome2/rake/package.rb0000644000175000017500000000701512137115064020405 0ustar koukou# -*- ruby -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "pathname" module GNOME2 module Rake class Package attr_reader :name attr_reader :root_dir attr_reader :windows attr_reader :native attr_writer :external_packages def initialize(root_dir) @root_dir = Pathname.new(root_dir).expand_path @name = @root_dir.basename.to_s @windows = WindowsConfiguration.new @native = NativeConfiguration.new @external_packages = [] end def project_root_dir @root_dir.parent end def glib2_root_dir project_root_dir + "glib2" end def tmp_dir @root_dir + "tmp" end def download_dir tmp_dir + "download" end def patches_dir @root_dir + "patches" end def external_packages @external_packages.collect do |package| ExternalPackage.new(package) end end class WindowsConfiguration < Struct.new(:packages, :dependencies, :build_dependencies, :gobject_introspection_dependencies, :build_packages, :build_host) attr_reader :relative_binary_dir, :absolute_binary_dir def initialize super @relative_binary_dir = Pathname.new("vendor/local") @absolute_binary_dir = @relative_binary_dir.expand_path end def packages super || [] end def dependencies super || [] end def build_dependencies super || [] end def gobject_introspection_dependencies super || [] end def build_packages (super || []).collect do |package| package = package.dup package[:windows] = { :include_paths => package.delete(:include_paths), :library_paths => package.delete(:library_paths), :configure_args => package.delete(:configure_args), :patches => package.delete(:patches), :need_autogen => package.delete(:need_autogen), :need_autoreconf => package.delete(:need_autoreconf), } ExternalPackage.new(package) end end def build_host super || "i686-w64-mingw32" end end class NativeConfiguration attr_reader :relative_binary_dir, :absolute_binary_dir def initialize @relative_binary_dir = Pathname.new("tmp/native/local") @absolute_binary_dir = @relative_binary_dir.expand_path end end end end end ruby-gnome2-all-2.1.0/glib2/lib/gnome2/rake/win32-binary-build-task.rb0000644000175000017500000001640512257552167023312 0ustar koukou# Copyright(C) 2012 Ruby-GNOME2 Project. # # This program is licenced under the same license of Ruby-GNOME2. require "open-uri" require "pathname" class GNOME2Win32BinaryBuildTask include Rake::DSL def initialize(package) @package = package define end private def define namespace :win32 do namespace :builder do task :before define_build_tasks build_tasks = build_packages.collect do |package| "win32:builder:build:#{package.name}" end task :build => build_tasks task :after end desc "Build Windows binaries" task :build => ["win32:builder:before", "win32:builder:build", "win32:builder:after"] end end def define_build_tasks namespace :build do prepare_task_names = [] namespace :prepare do prepare_task_names << "pkg_config" task :pkg_config do depended_packages = @package.windows.build_dependencies use_packages = [@package.name] + depended_packages pkg_config_path = use_packages.collect do |package| "../#{package}/#{@package.windows.relative_binary_dir}/lib/pkgconfig" end ENV["PKG_CONFIG_PATH"] = pkg_config_path.collect do |path| File.expand_path(path) end.join(":") ENV["PKG_CONFIG_LIBDIR"] = rcairo_win32_pkgconfig_path end prepare_task_names << "pkg_config_for_build" task :pkg_config_for_build do ENV["PKG_CONFIG_FOR_BUILD"] = "env - pkg-config" end end full_prepare_task_names = prepare_task_names.collect do |name| "win32:builder:build:prepare:#{name}" end task :prepare => full_prepare_task_names build_packages.each do |package| namespace package.name do task :before download_task = "source:downloader:download:#{package.name}" built_file = package.windows.built_file if built_file built_file = dist_dir + built_file file built_file.to_s do Rake::Task["win32:builder:build:prepare"].invoke Rake::Task[download_task].invoke build_package_task_body(package) end task :build => built_file.to_s else task :build => [:prepare, download_task] do build_package_task_body(package) end end task :after end prefix = "win32:builder:build:#{package.name}" desc "Build #{package.label} and install it into #{dist_dir}." task package.name => [ "#{prefix}:before", "#{prefix}:build", "#{prefix}:after", ] end end end def build_package_task_body(package) package_tmp_dir = @package.tmp_dir + package.name rm_rf(package_tmp_dir) mkdir_p(package_tmp_dir) tar_full_path = @package.download_dir + package.archive_base_name Dir.chdir(package_tmp_dir.to_s) do sh("tar", "xf", tar_full_path.to_s) end Dir.chdir((package_tmp_dir + package.base_name).to_s) do package.windows.patches.each do |patch| sh("patch -p1 < #{@package.patches_dir}/#{patch}") end sh("./autogen.sh") if package.windows.need_autogen? sh("autoreconf --install") if package.windows.need_autoreconf? cc_env = "CC=#{cc(package)}" sh("./configure", cc_env, "CPPFLAGS=#{cppflags(package)}", "LDFLAGS=#{ldflags(package)}", "--prefix=#{dist_dir}", "--host=#{@package.windows.build_host}", *package.windows.configure_args) or exit(false) common_make_args = [] common_make_args << "MAKE=make" common_make_args << "GLIB_COMPILE_SCHEMAS=glib-compile-schemas" if package.windows.use_cc_environment_variable? common_make_args << cc_env end add_gobject_introspection_make_args(common_make_args) build_make_args = common_make_args.dup install_make_args = common_make_args.dup if package.windows.build_concurrently? make_n_jobs = ENV["MAKE_N_JOBS"] build_make_args << "-j#{make_n_jobs}" if make_n_jobs end ENV["GREP_OPTIONS"] = "--text" sh("nice", "make", *build_make_args) or exit(false) sh("make", "install", *install_make_args) or exit(false) package_license_dir = license_dir + package.name mkdir_p(package_license_dir) package_license_files = ["AUTHORS", "COPYING", "COPYING.LIB"] package_license_files = package_license_files.reject do |file| not File.exist?(file) end cp(package_license_files, package_license_dir) bundled_packages = package.bundled_packages bundled_packages.each do |bundled_package| bundled_package_license_dir = license_dir + bundled_package[:name] mkdir_p(bundled_package_license_dir) license_files = bundled_package[:license_files].collect do |file| File.join(bundled_package[:path], file) end cp(license_files, bundled_package_license_dir) end end end def build_packages packages = @package.external_packages.select do |package| package.windows.build? end # For backward compatibility packages + @package.windows.build_packages end def dist_dir @package.windows.absolute_binary_dir end def license_dir dist_dir + "share" + "license" end def glib2_include_path "#{@package.glib2_root_dir}/vendor/local/include" end def glib2_lib_path "#{@package.glib2_root_dir}/vendor/local/lib" end def rcairo_win32_dir @package.project_root_dir.parent + "rcairo.win32" end def rcairo_win32_pkgconfig_path "#{rcairo_win32_dir}/vendor/local/lib/pkgconfig" end def rcairo_win32_include_path "#{rcairo_win32_dir}/vendor/local/include" end def rcairo_win32_lib_path "#{rcairo_win32_dir}/vendor/local/lib" end def cc(package) cc_command_line = [ "#{@package.windows.build_host}-gcc", *package.windows.cc_args, ] cc_command_line.compact.join(" ") end def cppflags(package) include_paths = package.windows.include_paths if @package.windows.build_dependencies.include?("glib2") include_paths += [glib2_include_path] end include_paths += [ rcairo_win32_include_path, dist_dir + 'include', ] cppflags = include_paths.collect do |path| "-I#{path}" end cppflags.join(" ") end def ldflags(package) library_paths = package.windows.library_paths if @package.windows.build_dependencies.include?("glib2") library_paths += [glib2_lib_path] end library_paths += [ rcairo_win32_lib_path, dist_dir + 'lib', ] ldflags = library_paths.collect do |path| "-L#{path}" end ldflags.join(" ") end def add_gobject_introspection_make_args(common_make_args) unless @package.windows.build_dependencies.include?("gobject-introspection") return end dependencies = [ "gobject-introspection", @package.name, ] dependencies += @package.windows.gobject_introspection_dependencies data_dirs = dependencies.collect do |package| "#{@package.project_root_dir}/#{package}/vendor/local/share" end common_make_args << "XDG_DATA_DIRS=#{data_dirs.join(File::PATH_SEPARATOR)}" end end ruby-gnome2-all-2.1.0/glib2/lib/gnome2/rake/package-task.rb0000644000175000017500000001655312257664725021374 0ustar koukou# coding: utf-8 # Copyright(C) 2011 Ruby-GNOME2 Project. # # This program is licenced under the same license of Ruby-GNOME2. require "find" require "pathname" require "rubygems" require "rubygems/package_task" require "rake/extensiontask" require "gnome2/rake/package" require "gnome2/rake/external-package" require "gnome2/rake/source-download-task" require "gnome2/rake/native-binary-build-task" require "gnome2/rake/win32-binary-download-task" require "gnome2/rake/win32-binary-build-task" module GNOME2 module Rake class PackageTask include ::Rake::DSL attr_accessor :name, :summary, :description, :author, :email, :homepage, :required_ruby_version, :post_install_message attr_reader :root_dir def initialize initialize_variables initialize_configurations file, line, method = caller[1].scan(/^(.*):(\d+)(?::.*`(.*)')?\Z/).first @package = Package.new(File.dirname(file)) @packages = FileList["#{@package.root_dir.parent}/*"].map{|f| File.directory?(f) ? File.basename(f) : nil}.compact @name = @package.name @cross_compiling_hooks = [] yield(self) if block_given? end def cross_compiling(&block) @cross_compiling_hooks << block end def define task :default => :build define_spec define_source_tasks define_native_tasks define_win32_tasks define_package_tasks end # Deprecated. Use #define instead. def define_tasks define end def ruby_gnome2_package?(name) @packages.include?(name) end def dependency @dependency_configuration end def package @package end def windows @package.windows end # For backward compatibility def win32 windows end def native @package.native end def version ENV["VERSION"] || guess_version end def guess_version versions = {} File.open("#{@package.glib2_root_dir}/ext/glib2/rbglib.h") do |rbglib_h| rbglib_h.each_line do |line| if /#define\s+RBGLIB_([A-Z]+)_VERSION\s+(\d+)/ =~ line versions[$1.downcase] = $2.to_i end end end ["major", "minor", "micro"].collect {|type| versions[type]}.compact.join(".") end def external_packages=(packages) @package.external_packages = packages end private def initialize_variables @summary = "" @description = "" @author = "The Ruby-GNOME2 Project Team" @email = "ruby-gnome2-devel-en@lists.sourceforge.net" @homepage = "http://ruby-gnome2.sourceforge.jp/" @external_packages = [] end def initialize_configurations @dependency_configuration = DependencyConfiguration.new(self) end def define_spec @spec = Gem::Specification.new do |s| s.name = @name s.summary = @summary s.description = @description s.author = @author s.email = @email s.homepage = @homepage s.licenses = ["LGPLv2.1 or later"] s.version = version extensions = FileList["ext/#{@name}/extconf.rb"] extensions.existing! s.extensions = extensions s.require_paths = ["lib"] files = FileList["ChangeLog", "README", "Rakefile", "extconf.rb", "lib/**/*.rb", "{ext,sample,test,test-unit}/**/*"] files.existing! s.files = files s.required_ruby_version = @required_ruby_version || ">= 1.9.3" s.post_install_message = @post_install_message @dependency_configuration.apply(s) end end def define_source_tasks define_source_download_tasks end def define_source_download_tasks task = SourceDownloadTask.new(@package) task.define end def define_native_tasks define_native_build_tasks end def define_native_build_tasks task = NativeBinaryBuildTask.new(@package) task.define end def define_win32_tasks define_win32_extension_task define_win32_download_task define_win32_build_task end def so_base_name @name.gsub(/-/, "_") end def define_win32_extension_task ::Rake::ExtensionTask.new(so_base_name, @spec) do |ext| ext.ext_dir = "ext/#{@name}" ext.cross_compile = true ext.cross_compiling do |spec| if /mingw|mswin/ =~ spec.platform.to_s win32_binary_dir = @package.windows.relative_binary_dir win32_files = [] if win32_binary_dir.exist? Find.find(win32_binary_dir.to_s) do |path| next unless File.file?(path) next if /\.zip\z/ =~ path win32_files << path end end spec.files += win32_files stage_path = "#{ext.tmp_dir}/#{ext.cross_platform}/stage" win32_files.each do |win32_file| stage_win32_file = "#{stage_path}/#{win32_file}" stage_win32_binary_dir = File.dirname(stage_win32_file) directory stage_win32_binary_dir file stage_win32_file => [stage_win32_binary_dir, win32_file] do cp win32_file, stage_win32_file end end end @cross_compiling_hooks.each do |hook| hook.call(spec) end end end def define_win32_download_task GNOME2Win32BinaryDownloadTask.new(@package) end def define_win32_build_task GNOME2Win32BinaryBuildTask.new(@package) end end def define_package_tasks Gem::PackageTask.new(@spec) do |pkg| end end class DependencyConfiguration attr_accessor :platform, :ruby def initialize(package) @package = package @platform = Gem::Platform::RUBY @gem_configuration = GemConfiguration.new(@package) end def gem @gem_configuration end def apply(spec) spec.platform = @platform @gem_configuration.apply(spec) end class GemConfiguration attr_accessor :runtime, :development def initialize(package) @package = package @runtime = [] @development = [] end def apply(spec) @runtime.each do |dependency| spec.add_runtime_dependency(*append_version(dependency)) end @development.each do |dependency| spec.add_development_dependency(*append_version(dependency)) end end def append_version(dependency) name, *ver = dependency.is_a?(Array) ? dependency : [dependency] ver << "= #{@package.version}" if @package.ruby_gnome2_package?(name) [name, *ver] end end end end end end ruby-gnome2-all-2.1.0/glib2/lib/mkmf-gnome2.rb0000644000175000017500000003712412257552167017040 0ustar koukou# # mkmf-gnome2.rb # # Extended mkmf for Ruby-GNOME2 and Ruby/GLib based libraries. # # Copyright(C) 2003-2013 Ruby-GNOME2 Project. # # This program is licenced under the same # license of Ruby-GNOME2. # require 'English' require 'mkmf' require 'pkg-config' require 'glib-mkenums' $CFLAGS += " #{ENV['CFLAGS']}" if ENV['CFLAGS'] def try_compiler_option(opt, &block) checking_for "#{opt} option to compiler" do $CFLAGS += " #{opt}" if try_compile '', opt, &block end end try_compiler_option '-Wall' try_compiler_option '-Waggregate-return' try_compiler_option '-Wcast-align' # NOTE: Generates way too many false positives. # try_compiler_option '-Wconversion' try_compiler_option '-Wextra' try_compiler_option '-Wformat=2' try_compiler_option '-Winit-self' # NOTE: This generates warnings for functions defined in ruby.h. # try_compiler_option '-Winline' try_compiler_option '-Wlarger-than-65500' try_compiler_option '-Wmissing-declarations' try_compiler_option '-Wmissing-format-attribute' try_compiler_option '-Wmissing-include-dirs' try_compiler_option '-Wmissing-noreturn' try_compiler_option '-Wmissing-prototypes' try_compiler_option '-Wnested-externs' try_compiler_option '-Wold-style-definition' try_compiler_option '-Wpacked' try_compiler_option '-Wp,-D_FORTIFY_SOURCE=2' try_compiler_option '-Wpointer-arith' # NOTE: ruby.h and intern.h have too many of these. # try_compiler_option '-Wredundant-decls' # NOTE: Complains about index, for example. # try_compiler_option '-Wshadow' try_compiler_option '-Wswitch-default' try_compiler_option '-Wswitch-enum' try_compiler_option '-Wundef' # NOTE: Incredible amounts of false positives. #try_compiler_option '-Wunreachable-code' try_compiler_option '-Wunsafe-loop-optimizations' try_compiler_option '-Wwrite-strings' if /-Wl,--no-undefined/ =~ $LDFLAGS.to_s $LDFLAGS.gsub!(/-Wl,--no-undefined/, '') end include_path = nil if ENV['GTK_BASEPATH'] and /cygwin/ !~ RUBY_PLATFORM include_path = (ENV['GTK_BASEPATH'] + "\\INCLUDE").gsub("\\", "/") # $hdrdir += " -I#{include_path} " $CFLAGS += " -I#{include_path} " end def setup_win32(target_name, base_dir=nil) checking_for(checking_message("Win32 OS")) do case RUBY_PLATFORM when /cygwin|mingw|mswin/ import_library_name = "libruby-#{target_name}.a" $DLDFLAGS << " -Wl,--out-implib=#{import_library_name}" $cleanfiles << import_library_name base_dir ||= Pathname($0).dirname.parent.parent.expand_path base_dir = Pathname(base_dir) if base_dir.is_a?(String) binary_base_dir = base_dir + "vendor" + "local" if binary_base_dir.exist? $CFLAGS += " -I#{binary_base_dir}/include" pkg_config_dir = binary_base_dir + "lib" + "pkgconfig" PKGConfig.add_path(pkg_config_dir.to_s) end true else false end end end def find_gem_spec(package) begin require 'rubygems' if Gem::Specification.respond_to?(:find_by_name) Gem::Specification.find_by_name(package) else Gem.source_index.find_name(package).last end rescue LoadError nil end end #add_depend_package("glib2", "ext/glib2", "/...../ruby-gnome2") def add_depend_package(target_name, target_srcdir, top_srcdir, options={}) gem_spec = find_gem_spec(target_name) if gem_spec target_source_dir = File.join(gem_spec.full_gem_path, "ext/#{target_name}") target_build_dir = target_source_dir add_depend_package_path(target_name, target_source_dir, target_build_dir) end [top_srcdir, File.join(top_srcdir, target_name), $configure_args['--topdir'], File.join($configure_args['--topdir'], target_name)].each do |topdir| topdir = File.expand_path(topdir) target_source_dir_full_path = File.join(topdir, target_srcdir) top_build_dir = options[:top_build_dir] || topdir target_build_dir = options[:target_build_dir] || target_srcdir target_build_dir_full_path = File.join(top_build_dir, target_build_dir) unless File.exist?(target_build_dir_full_path) target_build_dir_full_path = File.join(top_build_dir, target_srcdir) end unless File.exist?(target_build_dir_full_path) target_build_dir_full_path = File.join(topdir, target_build_dir) end unless File.exist?(target_build_dir_full_path) target_build_dir_full_path = File.join(topdir, target_srcdir) end add_depend_package_path(target_name, target_source_dir_full_path, target_build_dir_full_path) end end def add_depend_package_path(target_name, target_source_dir, target_build_dir) if File.exist?(target_source_dir) $INCFLAGS = "-I#{target_source_dir} #{$INCFLAGS}" end return unless File.exist?(target_build_dir) if target_source_dir != target_build_dir $INCFLAGS = "-I#{target_build_dir} #{$INCFLAGS}" end case RUBY_PLATFORM when /cygwin|mingw|mswin/ library_base_name = "ruby-#{target_name.gsub(/-/, '_')}" case RUBY_PLATFORM when /cygwin|mingw/ $LDFLAGS << " -L#{target_build_dir}" $libs << " -l#{library_base_name}" when /mswin/ $DLDFLAGS << " /libpath:#{target_build_dir}" $libs << " lib#{library_base_name}.lib" end target_base_dir = Pathname.new(target_source_dir).parent.parent target_binary_base_dir = target_base_dir + "vendor" + "local" if target_binary_base_dir.exist? $INCFLAGS = "-I#{target_binary_base_dir}/include #{$INCFLAGS}" target_pkg_config_dir = target_binary_base_dir + "lib" + "pkgconfig" PKGConfig.add_path(target_pkg_config_dir.to_s) end end end def add_distcleanfile(file) $distcleanfiles ||= [] $distcleanfiles << file end def create_pkg_config_file(package_name, c_package, version=nil, pc_file_name=nil) pc_file_name ||= "#{package_name.downcase.sub(/\//, '-')}.pc" version ||= ruby_gnome2_version || PKGConfig.modversion(c_package) puts "creating #{pc_file_name}" File.open(pc_file_name, 'w') do |pc_file| if package_name.nil? c_module_name = PKGConfig.name(c_package) package_name = "Ruby/#{c_module_name}" if c_module_name end pc_file.puts("Name: #{package_name}") if package_name description = PKGConfig.description(c_package) pc_file.puts("Description: Ruby bindings for #{description}") if description pc_file.printf("Version: #{version}") end add_distcleanfile(pc_file_name) end def ruby_gnome2_version(glib_source_directory=nil) glib_source_directory ||= File.join(File.dirname(__FILE__), "..", "ext", "glib2") rbglib_h = File.join(glib_source_directory, "rbglib.h") return nil unless File.exist?(rbglib_h) version = nil File.open(rbglib_h) do |h_file| version_info = {} h_file.each_line do |line| case line when /\A#define RBGLIB_(MAJOR|MINOR|MICRO)_VERSION\s+(\d+)/ version_info[$1] = $2 end end version_info = [version_info["MAJOR"], version_info["MINOR"], version_info["MICRO"]].compact version = version_info.join(".") if version_info.size == 3 end version end def ensure_objs return unless $objs.nil? source_dir = '$(srcdir)' RbConfig.expand(source_dir) pattern = "*.{#{SRC_EXT.join(',')}}" srcs = Dir[File.join(source_dir, pattern)] srcs |= Dir[File.join(".", pattern)] $objs = srcs.collect do |f| File.basename(f, ".*") + ".o" end.uniq end def create_makefile_at_srcdir(pkg_name, srcdir, defs = nil) base_dir = File.basename(Dir.pwd) last_common_index = srcdir.rindex(base_dir) if last_common_index builddir = srcdir[(last_common_index + base_dir.size + 1)..-1] end builddir ||= "." FileUtils.mkdir_p(builddir) Dir.chdir(builddir) do yield if block_given? $defs << defs if defs ensure_objs create_makefile(pkg_name, srcdir) end end def run_make_in_sub_dirs_command(command, sub_dirs) if /mswin/ =~ RUBY_PLATFORM sub_dirs.collect do |dir| <<-EOM.chmop @cd #{dir} @nmake -nologo DESTDIR=$(DESTDIR) #{command} @cd .. EOM end.join("\n") else sub_dirs.collect do |dir| "\t@cd #{dir}; $(MAKE) #{command}" end.join("\n") end end def create_top_makefile(sub_dirs=["src"]) File.open("Makefile", "w") do |makefile| makefile.print(<<-EOM) all: #{run_make_in_sub_dirs_command("all", sub_dirs)} install: #{run_make_in_sub_dirs_command("install", sub_dirs)} site-install: #{run_make_in_sub_dirs_command("site-install", sub_dirs)} clean: #{run_make_in_sub_dirs_command("clean", sub_dirs)} EOM if /mswin/ =~ RUBY_PLATFORM makefile.print(<<-EOM) @if exist extconf.h del extconf.h @if exist conftest.* del conftest.* @if exist *.lib del *.lib @if exist *~ del *~ @if exist mkmf.log del mkmf.log EOM else makefile.print(<<-EOM) distclean: clean #{run_make_in_sub_dirs_command("distclean", sub_dirs)} @rm -f Makefile extconf.h conftest.* @rm -f core *~ mkmf.log EOM end end end # This is used for the library which doesn't support version info. def make_version_header(app_name, pkgname, dir = "src") version = PKGConfig.modversion(pkgname).split(/\./) (0..2).each do |v| version[v] = "0" unless version[v] if /\A(\d+)/ =~ version[v] number = $1 tag = $POSTMATCH unless tag.empty? version[v] = number version[3] = tag end end end filename = "rb#{app_name.downcase}version.h" puts "creating #{filename}" add_distcleanfile(filename) FileUtils.mkdir_p(dir) out = File.open(File.join(dir, filename), "w") version_definitions = [] ["MAJOR", "MINOR", "MICRO", "TAG"].each_with_index do |type, i| _version = version[i] next if _version.nil? version_definitions << "#define #{app_name}_#{type}_VERSION (#{_version})" end out.print %Q[/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /************************************************ #{filename} - This file was generated by mkmf-gnome2.rb. ************************************************/ #ifndef __RB#{app_name}_VERSION_H__ #define __RB#{app_name}_VERSION_H__ #{version_definitions.join("\n")} #define #{app_name}_CHECK_VERSION(major,minor,micro) \\ (#{app_name}_MAJOR_VERSION > (major) || \\ (#{app_name}_MAJOR_VERSION == (major) && #{app_name}_MINOR_VERSION > (minor)) || \\ (#{app_name}_MAJOR_VERSION == (major) && #{app_name}_MINOR_VERSION == (minor) && \\ #{app_name}_MICRO_VERSION >= (micro))) #endif /* __RB#{app_name}_VERSION_H__ */ ] out.close end def check_ruby_func #Other options ruby_header = "ruby.h" have_func("rb_define_alloc_func", ruby_header) # for ruby-1.8 have_func("rb_block_proc", ruby_header) # for ruby-1.8 STDOUT.print("checking for new allocation framework... ") # for ruby-1.7 if Object.respond_to? :allocate STDOUT.print "yes\n" $defs << "-DHAVE_OBJECT_ALLOCATE" else STDOUT.print "no\n" end STDOUT.print("checking for attribute assignment... ") # for ruby-1.7 STDOUT.flush if defined? try_compile and try_compile <\*\/)?\s* \{?\s*(.*?) \}\s*(\w+);/mx) do |force_flags, constants, name| enum_options = {} enum_options[:force_flags] = !force_flags.nil? force_flags_patterns = [(options[:force_flags] || [])].flatten if force_flags_patterns.any? {|pattern| pattern === name} enum_options[:force_flags] = true end enum = new(name, constants, g_type_prefix, enum_options) enums << enum end enums end end class MkEnums # Create target_filename.c and target_filename.h from files # with g_type_prefix and include_files. # * target_filename: the target file name. This creates #{target_filename.c} and #{target_filename.h}. # * files: header files to parse # * g_type_prefix: the gtype prefix such as GTK_TYPE_ # * include_files: define #include lines into target_filename.c def self.create(target_filename, files, g_type_prefix, include_files, options) puts "creating #{target_filename}.c" mkenums = MkEnums.new(target_filename, files, g_type_prefix, include_files, options) open("#{target_filename}.c", "w") do |out| out.write(mkenums.create_c) end puts "creating #{target_filename}.h" open("#{target_filename}.h", "w") do |out| out.write(mkenums.create_h) end end # Initialize GLib::MkEnums # # * target_filename: the target file name. This creates #{target_filename.c} and #{target_filename.h}. # * files: header files to parse # * g_type_prefix: the gtype prefix such as GTK_TYPE_ # * include_files: define #include lines into target_filename.c def initialize(target_filename, files, g_type_prefix, include_files, options) @target_filename = target_filename @include_files = include_files @targets = [] files.each do |path| data = "" File.open(path) do |i| data = i.read end @targets << [path, EnumDefinition.parse(data, g_type_prefix, options)] end end def create_enums(meth) # :nodoc: ret = "" @targets.each do |target| if target[1].size > 0 ret << %Q[\n\n/* enumerations from "#{target[0]}" */] target[1].each{|enum| ret << enum.__send__(meth) } end end ret end # Create a C source as a String. def create_c ret = "\n/* Generated by glib-mkenums.rb ($Id$) */ \n\n" ret << %Q[#include "#{@target_filename}.h"\n] @include_files.each do |file| ret << "#include <#{file}>\n" end ret << "\n" ret << create_enums(:create_c) ret << "\n\n/* Generated data ends here */\n\n" ret end # Create a C header as a String. def create_h header = "#{@target_filename}.h" const = "__#{File.basename(header).upcase.gsub(/-|\./, '_')}__" ret = "\n/* Generated by glib-mkenums.rb ($Id$) */ \n\n" ret << "#ifndef #{const}\n" ret << "#define #{const}\n\n" ret << "#include \n\n" ret << "G_BEGIN_DECLS" ret << create_enums(:create_h) ret << "\n\nG_END_DECLS\n\n" ret << "#endif /* #{const} */\n" ret << "\n/* Generated data ends here */\n\n" ret end end end ruby-gnome2-all-2.1.0/glib2/lib/1.9/0000755000175000017500000000000012257665514014675 5ustar koukouruby-gnome2-all-2.1.0/glib2/sample/0000755000175000017500000000000012126557022015066 5ustar koukouruby-gnome2-all-2.1.0/glib2/sample/timeout2.rb0000644000175000017500000000115711701304107017157 0ustar koukou=begin timeout2.rb - Sample for GLib::Timeout, GLib::MainLoop. Copyright (C) 2005 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Date: 2005/03/13 15:43:32 $ $Id: timeout2.rb,v 1.2 2005/03/13 15:43:32 mutoh Exp $ =end require 'glib2' context = GLib::MainContext.new mainloop = GLib::MainLoop.new(context, true) source = GLib::Timeout.source_new(1000) i = 0 source.set_callback { i += 1 p "timeout2-#{i}" if i > 9 mainloop.quit false # the source is removed. else true # continue ... end } source.attach(context) mainloop.run p "quit..." ruby-gnome2-all-2.1.0/glib2/sample/utils.rb0000644000175000017500000000370711701304107016552 0ustar koukou=begin utils.rb - Sample for GLib module function produced by rbglib_utils.c Copyright (C) 2004 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Date: 2004/10/21 15:50:21 $ $Id: utils.rb,v 1.2 2004/10/21 15:50:21 mutoh Exp $ =end require 'glib2' if GLib.check_version?(2, 2, 0) GLib.application_name = "application name" puts "GLib.application_name = #{GLib.application_name}" end GLib.prgname = "program name" puts "GLib.prgname = #{GLib.prgname}" puts "GLib.getenv('HOME') = #{GLib.getenv('HOME')}" if GLib.check_version?(2, 4, 0) GLib.setenv("FOO", "foo") puts "GLib.getenv('FOO') = #{GLib.getenv('FOO')}" GLib.unsetenv("FOO") puts "GLib.getenv('FOO') = #{GLib.getenv('FOO')}" end puts "GLib.user_name = #{GLib.user_name}" puts "GLib.real_name = #{GLib.real_name}" puts "GLib.home_dir = #{GLib.home_dir}" puts "GLib.tmp_dir = #{GLib.tmp_dir}" puts "GLib.current_dir = #{GLib.current_dir}" puts "GLib.path_is_absolute?('./') = #{GLib.path_is_absolute?("./")}" puts "GLib.path_skip_root('/usr/local/bin/ruby') = #{GLib.path_skip_root('/usr/local/bin/ruby')}" puts "GLib.path_get_basename(GLib.home_dir) = #{GLib.path_get_basename(GLib.home_dir)}" puts "GLib.path_get_dirname(GLib.home_dir) = #{GLib.path_get_dirname(GLib.home_dir)}" puts "GLib.find_program_in_path(GLib.prgname) = #{GLib.find_program_in_path(GLib.prgname)}" puts "GLib.bit_nth_lsf(3, 1) = #{GLib.bit_nth_lsf(3, 1)}" puts "GLib.bit_nth_msf(3, 1) = #{GLib.bit_nth_msf(3, 1)}" puts "GLib.bit_storage(3) = #{GLib.bit_storage(3)}" puts "GLib.spaced_primes_closest(10) = #{GLib.spaced_primes_closest(10)}" keys = { "foo" => 1 << 0, "bar" => 1 << 1, "hoge" => 1 << 2, "fuga" => 1 << 3 } puts GLib.parse_debug_string("foo", keys) puts GLib.parse_debug_string("bar", keys) puts GLib.parse_debug_string("foo:bar:hoge", keys) puts GLib.parse_debug_string("foo:bar:hoge:fuga", keys) ruby-gnome2-all-2.1.0/glib2/sample/timeout.rb0000644000175000017500000000075311701304107017076 0ustar koukou=begin timeout.rb - Sample for GLib::Timeout, GLib::MainLoop. Copyright (C) 2005 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: timeout.rb,v 1.2 2005/07/14 17:05:22 mutoh Exp $ =end require 'glib2' mainloop = GLib::MainLoop.new(nil, true) i = 0 GLib::Timeout.add(1000) { i += 1 p "timeout-#{i}" if i > 9 mainloop.quit false # the source is removed. else true # continue ... end } mainloop.run p "quit..." ruby-gnome2-all-2.1.0/glib2/sample/idle.rb0000644000175000017500000000122711701304107016322 0ustar koukou=begin idle.rb - Sample for GLib::Idle, GLib::MainLoop. Copyright (C) 2005 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Date: 2005/03/13 14:39:58 $ $Id: idle.rb,v 1.1 2005/03/13 14:39:58 mutoh Exp $ =end require 'glib2' mainloop = GLib::MainLoop.new(nil, true) i = 0 GLib::Idle.add { i += 1 p "timeout1-#{i}" if i > 9 mainloop.quit false # the source is removed. else true # continue ... end } j = 0 GLib::Idle.add { j += 1 p "timeout2-#{i}" if j > 9 mainloop.quit false # the source is removed. else true # continue ... end } mainloop.run p "quit..." ruby-gnome2-all-2.1.0/glib2/sample/bookmarkfile.rb0000644000175000017500000000356511701304107020061 0ustar koukou=begin bookmarkfile.rb - Sample for GLib::BookmarkFile Copyright (C) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: bookmarkfile.rb,v 1.1 2006/12/26 09:59:51 mutoh Exp $ =end require 'glib2' $KCODE = "U" # # Create bookmarkfile data. # URI = "http://ruby-gnome2.sourceforge.jp/" bf = GLib::BookmarkFile.new bf.set_title(URI, "Ruby-GNOME2 sample") bf.set_description(URI, "Ruby-GNOME2 Sampe for GLib::BookmarkFile") bf.set_mime_type(URI, "text/html") bf.set_private(URI, false) bf.set_icon(URI, "http://ruby-gnome2.sourceforge.jp/logo-gy.png", "image/png") bf.set_added(URI, Time.now) bf.set_modified(URI, Time.now) bf.set_visited(URI, Time.now) bf.set_groups(URI, ["Ruby", "GTK+"]) bf.set_app_info(URI, "WWW Browser", "firefox %u", 1, Time.now) bf.add_group(URI, "GNOME") bf.add_application(URI, "Ruby VM", "ruby %u") #bf.remove_group(URI, "GTK+") #bf.remove_application(URI, "Ruby VM") #bf.remove_item(URI) #bf.move_item(URI, "http://gtk.org/") # Save as "bookmarkfile.xml" bf.to_file("bookmarkfile.xml") # # Load from "bookmarkfile.xml" # bf2 = GLib::BookmarkFile.new bf2.load_from_file("bookmarkfile.xml") puts "size = #{bf2.size}" puts "uris = #{bf2.uris.inspect}" bf2.uris.each do |uri| puts "uri: [#{uri}]" puts " * title: [#{bf2.get_title(uri)}]" puts " * description: [#{bf2.get_description(uri)}]" puts " * mime_type: [#{bf2.get_mime_type(uri)}]" puts " * private?: [#{bf2.private?(uri)}]" puts " * icon: [#{bf2.get_icon(uri).inspect}]" puts " * added: [#{bf2.get_added(uri)}]" puts " * modified: [#{bf2.get_modified(uri)}]" puts " * visited: [#{bf2.get_visited(uri)}]" puts " * groups: #{bf2.get_groups(uri).inspect}" puts " * applications: #{bf2.get_applications(uri).inspect}" begin puts " * app_info: #{bf2.get_app_info(uri, "WWW Browser").inspect}" rescue puts $! end puts end ruby-gnome2-all-2.1.0/glib2/sample/keyfile.rb0000644000175000017500000000524611701304107017042 0ustar koukou=begin keyfile.rb - Sample for GLib::KeyFile Copyright (C) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: keyfile.rb,v 1.2 2006/12/23 17:43:03 mutoh Exp $ =end require 'glib2' $KCODE = "U" # # Create a GLib::KeyFile # kf = GLib::KeyFile.new kf.set_value("Group 1", "value", "Hello World") kf.set_comment("Group 1", nil, "This file is generated by keyfile.rb") kf.set_string("Group 1", "string", "Hello World\nRuby-GNOME2") kf.set_locale_string("Group 1", "locale_string", "ja", "ã“ã‚“ã«ã¡ã‚世界") kf.set_locale_string("Group 1", "locale_string", "en", "Hello World") kf.set_boolean("Group 1", "boolean", true) kf.set_integer("Group 1", "integer", 1) kf.set_double("Group 1", "double", 1.0) kf.set_string_list("Group 2", "string_list", ["foo", "bar"]) kf.set_locale_string_list("Group 2", "locale_string_list", "ja", ["ã“ã‚“ã«ã¡ã‚", "世界"]) kf.set_locale_string_list("Group 2", "locale_string_list", "en", ["Hellow", "World"]) kf.set_boolean_list("Group 2", "boolean_list", [true, false]) kf.set_integer_list("Group 2", "integer_list", [1, 2, 3]) kf.set_double_list("Group 2", "double_list", [1.2, 1.3, 1.45]) kf.set_comment("Group 2", "string_list", "comment of string_list") # Save as "keyfile.ini" File.open("keyfile.ini", "w") do |out| out.write kf.to_data end #kf.remove_comment("Group 2", "string_list") #kf.remove_key("Group 2", "string_list") #kf.remove_group("Group 2") # # Load from "keyfile.ini" # kf2 = GLib::KeyFile.new kf2.load_from_file("keyfile.ini") puts "Group 1: value = #{kf2.get_value("Group 1", "value")}" puts "Group 1: string = #{kf2.get_string("Group 1", "string")}" puts "Group 1: locale_string[ja] = #{kf2.get_locale_string("Group 1", "locale_string", "ja")}" puts "Group 1: locale_string[en] = #{kf2.get_locale_string("Group 1", "locale_string", "en")}" puts "Group 1: boolean = #{kf2.get_boolean("Group 1", "boolean")}" puts "Group 1: integer = #{kf2.get_integer("Group 1", "integer")}" puts "Group 1: double = #{kf2.get_double("Group 1", "double")}" puts "Group 2: string_list = #{kf2.get_string_list("Group 2", "string_list").inspect}" puts "Group 2: locale_string_list[ja] = #{kf2.get_locale_string_list("Group 2", "locale_string_list", "ja").inspect}" puts "Group 2: locale_string_list[en] = #{kf2.get_locale_string_list("Group 2", "locale_string_list", "en").inspect}" puts "Group 2: boolean_list = #{kf2.get_boolean_list("Group 2", "boolean_list").inspect}" puts "Group 2: integer_list = #{kf2.get_integer_list("Group 2", "integer_list").inspect}" puts "Group 2: double_list = #{kf2.get_double_list("Group 2", "double_list").inspect}" puts "Group 2: comment = #{kf2.get_comment("Group 2", "string_list")}" ruby-gnome2-all-2.1.0/glib2/sample/shell.rb0000644000175000017500000000132711701304107016515 0ustar koukou=begin shell.rb - Sample for GLib::Shell Copyright (C) 2005 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: shell.rb,v 1.1 2005/10/14 19:10:07 mutoh Exp $ =end require 'glib2' cmd = "ls *.c *.o" p GLib::Shell.parse(cmd) puts quote = GLib::Shell.quote(cmd) puts GLib::Shell.unquote(quote) puts "----" #Samples to catch an Exception begin GLib::Shell.parse('foooo "bar') rescue GLib::ShellError => e puts "domain = #{e.domain}" puts "code = #{e.code}" puts "message = #{e.message}" end begin GLib::Shell.unquote('foooo "bar') rescue GLib::ShellError => e puts "domain = #{e.domain}" puts "code = #{e.code}" puts "message = #{e.message}" end ruby-gnome2-all-2.1.0/glib2/sample/timer.rb0000644000175000017500000000152411701304107016525 0ustar koukou=begin timer.rb - Sample for GLib::Timer Copyright (C) 2005 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: timer.rb,v 1.1 2005/10/14 19:48:41 mutoh Exp $ =end require 'glib2' timer = GLib::Timer.new timer.start puts "start (status = running) : #{timer.elapsed}" sleep(3) puts "after 3 sec (status = running) : #{timer.elapsed}" sleep(3) puts "after 3 sec (status = running) : #{timer.elapsed}" timer.stop puts "stop (status = stoped) : #{timer.elapsed}" sleep(3) puts "after 3 sec (status = stoped) : #{timer.elapsed}" timer.continue puts "continue (status = running) : #{timer.elapsed}" sleep(3) puts "after 3 sec (status = running) : #{timer.elapsed}" timer.reset puts "reset (status = running) : #{timer.elapsed}" sleep(3) puts "after 3 sec (status = running) : #{timer.elapsed}" ruby-gnome2-all-2.1.0/glib2/sample/iochannel.rb0000644000175000017500000000134311701304107017344 0ustar koukou=begin iochannel.rb - Sample for GLib::IOChannel. Copyright (C) 2005 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: iochannel.rb,v 1.3 2006/12/20 18:08:20 mutoh Exp $ =end require 'glib2' path = ARGV[0] || __FILE__ GLib::IOChannel.open(path) {|io| puts io.read } stdout = GLib::IOChannel.new(path, "r") stdout.add_watch(GLib::IOChannel::IN ) {|io, condition| puts "condition = #{condition}" false } context = GLib::MainContext.default mainloop = GLib::MainLoop.new(context, true) Thread.new{ num = 0 loop { num += 1 str = stdout.gets puts "line #{num}: #{str}" unless str mainloop.quit break end } } mainloop.run stdout.close ruby-gnome2-all-2.1.0/glib2/sample/type-register2.rb0000755000175000017500000000520111701304107020271 0ustar koukou=begin type-register2.rb - Sample for GLib::Object You also need Ruby/GTK. Copyright (C) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 14:31:22 $ $Id: type-register2.rb,v 1.3 2006/06/17 14:31:22 mutoh Exp $ =end require 'gtk2' class MyButton < Gtk::Button type_register def initialize(label = nil) # XXX: # When type_register() is used. # super is equivalent to GLib::Object#initialize. super("label" => label) @fuga = 0 end # override existing default handler of "clicked" signal. def signal_do_clicked(*args) puts "MyButton#signal_do_clicked enter" #p caller super puts "MyButton#signal_do_clicked leave" end # define new signal "hoge" signal_new("hoge", # name GLib::Signal::RUN_FIRST, # flags nil, # accumulator (XXX: not supported yet) GLib::Type["void"], # return type GLib::Type["gint"], GLib::Type["gint"] # parameter types ) # define default handler of "hoge" signal def signal_do_hoge(a, b) puts "MyButton#signal_do_hoge enter" #p caller puts "MyButton#signal_do_hoge leave" end # define new property "fuga" install_property(GLib::Param::Int.new("fuga", # name "Fuga", # nick "fuga hoge", # blurb 0, # min 10000, # max 0, # default GLib::Param::READABLE | GLib::Param::WRITABLE)) # implementation of the property "fuga" def fuga puts "MyButton#fuga is called" @fuga end def fuga=(arg) puts "MyButton#fuga= is called" @fuga = arg notify("fuga") end end class MyButton2 < MyButton type_register("MyButton2") # override default handler of "clicked" signal def signal_do_clicked(*args) puts "MyButton2#signal_do_clicked enter" super(*args) puts "MyButton2#signal_do_clicked leave" end # override default handler of "hoge" signal def signal_do_hoge(a, b) puts "MyButton2#signal_do_hoge enter" puts "a, b = #{a}, #{b}" #p caller super puts "MyButton2#signal_do_hoge leave" end end b = MyButton2.new("Hello") p b p b.label p b.gtype b.clicked b.signal_emit("hoge", 1, 2) b.signal_connect("notify"){|obj, pspec| puts "#{b} notify #{pspec}" } p b.get_property("fuga") b.set_property("fuga", 1) p b.get_property("fuga") p MyButton2.ancestors ruby-gnome2-all-2.1.0/glib2/sample/spawn.rb0000644000175000017500000000105311701304107016532 0ustar koukou=begin spawn.rb - Sample for GLib::Spawn Copyright (C) 2005 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Date: 2005/10/14 19:10:07 $ $Id: spawn.rb,v 1.3 2005/10/14 19:10:07 mutoh Exp $ =end require 'glib2' p GLib::Spawn.command_line_sync("ls") puts "---" #Here is an example to catch GLib::SpawnError. begin p GLib::Spawn.command_line_sync("nonexist_app") rescue => e puts "class = #{e.class}" puts "domain = #{e.domain}" puts "code = #{e.code}" puts "message = #{e.message}" end ruby-gnome2-all-2.1.0/glib2/sample/type-register.rb0000755000175000017500000000515211701304107020214 0ustar koukou=begin type-register.rb - Sample for GLib::Object You also need Ruby/GTK. Copyright (C) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 14:31:22 $ $Id: type-register.rb,v 1.9 2006/06/17 14:31:22 mutoh Exp $ =end require 'gtk2' class MyButton < Gtk::Button type_register def initialize(label = nil) # XXX: # When type_register() is used. # super is equivalent to GLib::Object#initialize. super("label" => label) @fuga = 0 end # override existing default handler of "clicked" signal. def signal_do_clicked(*args) puts "MyButton#signal_do_clicked enter" #p caller super puts "MyButton#signal_do_clicked leave" end # define new signal "hoge" signal_new("hoge", # name GLib::Signal::RUN_FIRST, # flags nil, # accumulator (XXX: not supported yet) nil, # return type (void == nil) Integer, Integer # parameter types ) # define default handler of "hoge" signal def signal_do_hoge(a, b) puts "MyButton#signal_do_hoge enter" #p caller puts "MyButton#signal_do_hoge leave" end # define new property "fuga" install_property(GLib::Param::Int.new("fuga", # name "Fuga", # nick "fuga hoge", # blurb 0, # min 10000, # max 0, # default GLib::Param::READABLE | GLib::Param::WRITABLE)) # implementation of the property "fuga" def fuga puts "MyButton#fuga is called" @fuga end def fuga=(arg) puts "MyButton#fuga= is called" @fuga = arg notify("fuga") end end class MyButton2 < MyButton type_register("MyButton2") # override default handler of "clicked" signal def signal_do_clicked(*args) puts "MyButton2#signal_do_clicked enter" super(*args) puts "MyButton2#signal_do_clicked leave" end # override default handler of "hoge" signal def signal_do_hoge(a, b) puts "MyButton2#signal_do_hoge enter" puts "a, b = #{a}, #{b}" super puts "MyButton2#signal_do_hoge leave" end end b = MyButton2.new("Hello") p b p b.label p b.gtype b.clicked b.signal_emit("hoge", 1, 2) b.signal_connect("notify"){|obj, pspec| puts "#{b} notify #{pspec}" } p b.get_property("fuga") b.set_property("fuga", 1) p b.get_property("fuga") p MyButton2.ancestors ruby-gnome2-all-2.1.0/glib2/extconf.rb0000755000175000017500000000222411701304107015573 0ustar koukou#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "glib2" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ruby-gnome2-all-2.1.0/glib2/Rakefile0000644000175000017500000000761612257552167015276 0ustar koukou# -*- ruby -*- $LOAD_PATH.unshift("./lib") require 'gnome2-raketask' bin_dir = nil include_dir = nil glib2_include_dir = nil libffi_lib_dir = nil build_host = nil package = GNOME2Package.new do |_package| bin_dir = (_package.windows.absolute_binary_dir + "bin").to_s include_dir = (_package.windows.absolute_binary_dir + "include").to_s glib2_include_dir = File.join(include_dir, "glib-2.0") libffi_lib_dir = (_package.windows.absolute_binary_dir + "lib").to_s build_host = _package.windows.build_host _package.summary = "Ruby/GLib2 is a Ruby binding of GLib-2.x." _package.description = "Ruby/GLib2 is a Ruby binding of GLib-2.x." _package.dependency.gem.runtime = [["pkg-config", ">= 0"]] _package.dependency.gem.development = [["test-unit", ">= 2"]] _package.win32.packages = [] _package.win32.dependencies = ["libffi", "gettext-runtime"] _package.external_packages = [ { :name => "glib", :download_site => :gnome, :label => "GLib", :version => "2.38.2", :compression_method => "xz", :windows => { :configure_args => [ "LIBFFI_CFLAGS=-I#{include_dir}", "LIBFFI_LIBS=-L#{libffi_lib_dir} -lffi", "--disable-modular-tests", ], :need_autoreconf => true, :patches => [ "glib-2.38.2-add-missing-exeext.diff", ], :built_file => "bin/libglib-2.0-0.dll", }, }, { :name => "gmp", :download_base_url => "ftp://ftp.gmplib.org/pub/gmp-5.1.3", :label => "GNU MP", :version => "5.1.3", :compression_method => "xz", :windows => { :configure_args => [ "--disable-static", "--enable-shared", ], :built_file => "bin/libgmp-10.dll", }, }, { :name => "nettle", :download_base_url => "http://www.lysator.liu.se/~nisse/archive", :label => "Nettle", :version => "2.7.1", :windows => { :configure_args => [], :built_file => "bin/libnettle-4-7.dll", }, }, { :name => "gnutls", :download_base_url => "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2", :label => "GnuTLS", :version => "3.2.7", :compression_method => "xz", :windows => { :configure_args => [ "--disable-cxx", ], :use_cc_environment_variable => false, :patches => [ ], :built_file => "bin/libgnutls-28.dll", }, }, { :name => "glib-networking", :download_site => :gnome, :label => "glib-networking", :version => "2.38.2", :compression_method => "xz", :windows => { :configure_args => [ "--without-libproxy", "--without-gnome-proxy", "--without-ca-certificates", ], :built_file => "lib/gio/modules/libgiognutls.dll", }, }, ] _package.cross_compiling do |spec| if /mingw|mswin/ =~ spec.platform.to_s spec.add_runtime_dependency("cairo", ">= 1.12.8") end end end package.define_tasks namespace :win32 do namespace :libffi do namespace :header do desc "Move libffi headers to include/" task :fix do libffi_version = "libffi-3.0.6" mv(Dir.glob(File.join(libffi_lib_dir, libffi_version, "include", "*.h")), include_dir) rm_rf(File.join(libffi_lib_dir, libffi_version)) end end end namespace :downloader do task :after => [ "win32:libffi:header:fix", ] end namespace :gettext do namespace :header do desc "Copy gettext headers to include/glib-2.0/" task :fix do cp(File.join(include_dir, "libintl.h"), glib2_include_dir) end end end namespace :builder do namespace :build do namespace :glib do task :after => [ "win32:gettext:header:fix", ] end end end end ruby-gnome2-all-2.1.0/glib2/test/0000755000175000017500000000000012126557022014564 5ustar koukouruby-gnome2-all-2.1.0/glib2/test/test_mkenums.rb0000644000175000017500000000143411701304107017621 0ustar koukou# -*- coding: utf-8 -*- require 'glib-mkenums' class TestGLibMkEnums < Test::Unit::TestCase def test_parse_flags source = <<-EOS G_MARKUP_COLLECT_INVALID, G_MARKUP_COLLECT_STRING, G_MARKUP_COLLECT_STRDUP, G_MARKUP_COLLECT_BOOLEAN, G_MARKUP_COLLECT_TRISTATE, G_MARKUP_COLLECT_OPTIONAL = (1 << 16) EOS enum = GLib::EnumDefinition.new("GMarkupCollectType", source, 'G_TYPE_') assert_equal([["G_MARKUP_COLLECT_INVALID", "invalid"], ["G_MARKUP_COLLECT_STRING", "string"], ["G_MARKUP_COLLECT_STRDUP", "strdup"], ["G_MARKUP_COLLECT_BOOLEAN", "boolean"], ["G_MARKUP_COLLECT_TRISTATE", "tristate"], ["G_MARKUP_COLLECT_OPTIONAL", "optional"]], enum.constants) end end ruby-gnome2-all-2.1.0/glib2/test/test_spawn.rb0000644000175000017500000000144511701304107017274 0ustar koukou# -*- coding: utf-8 -*- require 'rbconfig' class TestGLibSpawn < Test::Unit::TestCase include GLibTestUtils def setup end def teardown end def test_async_keep_environment if File.exist?('/bin/true') assert_nothing_raised do GLib::Spawn.async(Dir.pwd, ['/bin/true'], nil, 0) end end end def test_async_clear_environment if RbConfig.respond_to?(:ruby) ruby = RbConfig.ruby else ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['RUBY_INSTALL_NAME'] + RbConfig::CONFIG['EXEEXT']) end pid = GLib::Spawn.async(Dir.pwd, [ruby, '-e', 'exit 1 unless ENV.empty?'], [], GLib::Spawn::DO_NOT_REAP_CHILD) _, status = *Process.waitpid2(pid) assert status.success? end end ruby-gnome2-all-2.1.0/glib2/test/test_enum.rb0000644000175000017500000000651111701304107017107 0ustar koukou# -*- coding: utf-8 -*- require 'test/unit' require 'glib2' class TestEnum < Test::Unit::TestCase def test_enum_by_symbol original = [0x00c1].pack("U*") # A with acute assert_equal(GLib::UTF8.normalize(original, GLib::NormalizeMode::NFD), GLib::UTF8.normalize(original, :nfd)) assert_equal(GLib::UTF8.normalize(original, GLib::NormalizeMode::NFD), GLib::UTF8.normalize(original, :NFD)) assert_raise(TypeError) do GLib::UTF8.normalize(original, :unknown) end end def test_enum_by_string original = [0x00c1].pack("U*") # A with acute assert_equal(GLib::UTF8.normalize(original, GLib::NormalizeMode::NFD), GLib::UTF8.normalize(original, "nfd")) assert_equal(GLib::UTF8.normalize(original, GLib::NormalizeMode::NFD), GLib::UTF8.normalize(original, "NFD")) assert_raise(TypeError) do GLib::UTF8.normalize(original, "unknown") end end def test_flags_simple assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, :keep_comments) assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, :KEEP_COMMENTS) assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, "keep_comments") assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, "KEEP_COMMENTS") assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, "keep COMMENTS") assert_raise(TypeError) do assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, :unknown) end assert_raise(TypeError) do assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, "UNKNOWN") end end def test_flags_by_array assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS | GLib::KeyFile::KEEP_TRANSLATIONS, [:keep_comments, :keep_translations]) assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS | GLib::KeyFile::KEEP_TRANSLATIONS, [:keep_COMMENTS, "KEEP_TRANSLATIONS"]) assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS | GLib::KeyFile::KEEP_TRANSLATIONS, ["keep_comments", "KEEP_translations"]) assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS | GLib::KeyFile::KEEP_TRANSLATIONS, [:keep_comments, GLib::KeyFile::KEEP_TRANSLATIONS]) assert_raise(TypeError) do assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS | GLib::KeyFile::KEEP_TRANSLATIONS, [:keep_comments, nil, :keep_translations]) end end def test_flags_or assert_equal(GLib::KeyFile::KEEP_COMMENTS, GLib::KeyFile::KEEP_COMMENTS | []) assert_equal(GLib::KeyFile::KEEP_COMMENTS | GLib::KeyFile::KEEP_TRANSLATIONS , GLib::KeyFile::KEEP_COMMENTS | [:keep_translations]) end private def assert_key_file_load(flags, convenience_flags) data = <<-EOD [SECTION] KEY=VALUE # comment KEY[ja]=値 EOD expected_key_file = GLib::KeyFile.new expected_key_file.load_from_data(data, flags) actual_key_file = GLib::KeyFile.new actual_key_file.load_from_data(data, convenience_flags) assert_equal(expected_key_file.get_value("SECTION", "KEY"), actual_key_file.get_value("SECTION", "KEY")) assert_equal(expected_key_file.to_data, actual_key_file.to_data) end end ruby-gnome2-all-2.1.0/glib2/test/test_file_utils.rb0000644000175000017500000000102211701304107020272 0ustar koukou# -*- coding: utf-8 -*- class TestGLibFileUtils < Test::Unit::TestCase include GLibTestUtils def test_format_size_for_display only_glib_version(2, 16, 0) assert_equal("1.0 KB", GLib.format_size_for_display(1024)) assert_equal("10.0 KB", GLib.format_size_for_display(1024 * 10)) assert_equal("1.0 MB", GLib.format_size_for_display(1024 * 1024)) assert_equal("1.5 MB", GLib.format_size_for_display(1024 * 1024 * 1.5)) assert_equal("1.0 GB", GLib.format_size_for_display(1024 * 1024 * 1024)) end end ruby-gnome2-all-2.1.0/glib2/test/test_flags.rb0000644000175000017500000000672611701304107017247 0ustar koukou# -*- coding: utf-8 -*- require 'test/unit' require 'glib2' class TestFlags < Test::Unit::TestCase { '<=>' => [ [0b0000, 0.0, nil], [0b0000, 0b0000, 0], [0b0000, 0b0110, -1], [0b0000, 0b1111, -1], [0b0110, 0b0000, 1], [0b0110, 0b0011, nil], [0b0110, 0b0110, 0], [0b0110, 0b0111, -1], [0b0110, 0b1001, nil], [0b0110, 0b1100, nil], [0b0110, 0b1110, -1], [0b0110, 0b1111, -1], [0b1111, 0b0000, 1], [0b1111, 0b0110, 1], [0b1111, 0b1111, 0], ], '==' => [ [0b0000, 0.0, nil], [0b0000, 0b0000, true], [0b0000, 0b0110, false], [0b0000, 0b1111, false], [0b0110, 0b0000, false], [0b0110, 0b0011, false], [0b0110, 0b0110, true], [0b0110, 0b0111, false], [0b0110, 0b1001, false], [0b0110, 0b1100, false], [0b0110, 0b1110, false], [0b0110, 0b1111, false], [0b1111, 0b0000, false], [0b1111, 0b0110, false], [0b1111, 0b1111, true], ], '>=' => [ [0b0000, 0.0, nil], [0b0000, 0b0000, true], [0b0000, 0b0110, false], [0b0000, 0b1111, false], [0b0110, 0b0000, true], [0b0110, 0b0011, false], [0b0110, 0b0110, true], [0b0110, 0b0111, false], [0b0110, 0b1001, false], [0b0110, 0b1100, false], [0b0110, 0b1110, false], [0b0110, 0b1111, false], [0b1111, 0b0000, true], [0b1111, 0b0110, true], [0b1111, 0b1111, true], ], '<=' => [ [0b0000, 0.0, nil], [0b0000, 0b0000, true], [0b0000, 0b0110, true], [0b0000, 0b1111, true], [0b0110, 0b0000, false], [0b0110, 0b0011, false], [0b0110, 0b0110, true], [0b0110, 0b0111, true], [0b0110, 0b1001, false], [0b0110, 0b1100, false], [0b0110, 0b1110, true], [0b0110, 0b1111, true], [0b1111, 0b0000, false], [0b1111, 0b0110, false], [0b1111, 0b1111, true], ], '>' => [ [0b0000, 0.0, nil], [0b0000, 0b0000, false], [0b0000, 0b0110, false], [0b0000, 0b1111, false], [0b0110, 0b0000, true], [0b0110, 0b0011, false], [0b0110, 0b0110, false], [0b0110, 0b0111, false], [0b0110, 0b1001, false], [0b0110, 0b1100, false], [0b0110, 0b1110, false], [0b0110, 0b1111, false], [0b1111, 0b0000, true], [0b1111, 0b0110, true], [0b1111, 0b1111, false], ], '<' => [ [0b0000, 0.0, nil], [0b0000, 0b0000, false], [0b0000, 0b0110, true], [0b0000, 0b1111, true], [0b0110, 0b0000, false], [0b0110, 0b0011, false], [0b0110, 0b0110, false], [0b0110, 0b0111, true], [0b0110, 0b1001, false], [0b0110, 0b1100, false], [0b0110, 0b1110, true], [0b0110, 0b1111, true], [0b1111, 0b0000, false], [0b1111, 0b0110, false], [0b1111, 0b1111, false], ], }.each do |operator, values| values.each do |a, b, expected| a_format = a.is_a?(Float) ? "%f" : "0b%04b" b_format = b.is_a?(Float) ? "%f" : "0b%04b" label_format = "#{a_format} %s #{b_format} == %s" data((label_format % [a, operator, b, expected.inspect]), { :a => a, :operator => operator, :b => b, :expected => expected, }) end end def test_flags_compare(data) flags = GLib::KeyFile::Flags.new(data[:a]) assert_equal(data[:expected], flags.send(data[:operator], data[:b])) end end ruby-gnome2-all-2.1.0/glib2/test/test_key_file.rb0000644000175000017500000000212511701304107017727 0ustar koukou# -*- coding: utf-8 -*- require 'tempfile' class TestGLibKeyFile < Test::Unit::TestCase include GLibTestUtils def test_load_from_dirs only_glib_version(2, 14, 0) key_file = GLib::KeyFile.new assert_raise(GLib::KeyFileError) do key_file.load_from_dirs("non-existent") end temp = Tempfile.new("key-file") base_name = File.basename(temp.path) search_dirs = [File.dirname(temp.path)] assert_raise(GLib::KeyFileError) do key_file.load_from_dirs("non-existent", search_dirs) end if GLib.check_version?(2, 31, 2) assert_equal(temp.path, key_file.load_from_dirs(base_name, search_dirs)) else assert_raise(GLib::KeyFileError) do key_file.load_from_dirs(base_name, search_dirs) end end temp.puts(<<-EOK) [General] key = value EOK temp.close assert_equal(temp.path, key_file.load_from_dirs(base_name, search_dirs)) end def test_desktop_constants only_glib_version(2, 14, 0) assert_equal("Desktop Entry", GLib::KeyFile::DESKTOP_GROUP) assert_equal("URL", GLib::KeyFile::DESKTOP_KEY_URL) end end ruby-gnome2-all-2.1.0/glib2/test/glib-test-utils.rb0000644000175000017500000000043511701304107020133 0ustar koukoumodule GLibTestUtils private def only_glib_version(major, minor, micro) unless GLib.check_version?(major, minor, micro) omit("Require GLib >= #{major}.#{minor}.#{micro}") end end def only_win32 omit("Only for Win32 platform") unless GLib.os_win32? end end ruby-gnome2-all-2.1.0/glib2/test/run-test.rb0000755000175000017500000000075011701304107016667 0ustar koukou#!/usr/bin/env ruby base = File.expand_path(File.join(File.dirname(__FILE__))) top = File.expand_path(File.join(base, "..")) $LOAD_PATH.unshift(top) require 'test/glib-test-init' if system("which make > /dev/null") system("cd #{top.dump} && make > /dev/null") or exit(1) end $LOAD_PATH.unshift(File.join(top, "ext", "glib2")) $LOAD_PATH.unshift(File.join(top, "lib")) $LOAD_PATH.unshift(base) require 'glib-test-utils' require 'glib2' exit Test::Unit::AutoRunner.run(true, base) ruby-gnome2-all-2.1.0/glib2/test/test_win32.rb0000644000175000017500000000045711701304107017110 0ustar koukou# -*- coding: utf-8 -*- class TestGLibWin32 < Test::Unit::TestCase include GLibTestUtils def test_get_package_install_directory_of_module only_win32 only_glib_version(2, 16, 0) assert_equal("FIXME", GLib::Win32.get_package_installation_directory_of_module) end end ruby-gnome2-all-2.1.0/glib2/test/test_signal.rb0000644000175000017500000000120411701304107017412 0ustar koukou# -*- coding: utf-8 -*- class TestSignal < Test::Unit::TestCase def test_signal_flags assert_const_defined(GLib, :SignalFlags) assert_kind_of(GLib::SignalFlags, GLib::Signal::RUN_FIRST) assert_equal(GLib::SignalFlags::MASK, GLib::Signal::FLAGS_MASK) end def test_connect_flags assert_const_defined(GLib, :ConnectFlags) assert_kind_of(GLib::ConnectFlags, GLib::Signal::CONNECT_AFTER) end def test_signal_match_type assert_const_defined(GLib, :SignalMatchType) assert_kind_of(GLib::SignalMatchType, GLib::Signal::MATCH_ID) assert_equal(GLib::SignalMatchType::MASK, GLib::Signal::MATCH_MASK) end end ruby-gnome2-all-2.1.0/glib2/test/test_glib2.rb0000755000175000017500000000763712121311640017154 0ustar koukou# coding: binary require 'test/unit' require 'glib2' class TestGLib < Test::Unit::TestCase def test_version assert_kind_of(Array, GLib::VERSION) assert_equal(GLib::VERSION.length, 3) assert(GLib::VERSION.all?{|i| i.is_a? Integer }) assert_kind_of(Integer, GLib::MAJOR_VERSION) assert_kind_of(Integer, GLib::MINOR_VERSION) assert_kind_of(Integer, GLib::MICRO_VERSION) assert_kind_of(Array, GLib::BINDING_VERSION) assert_equal(GLib::BINDING_VERSION.length, 3) assert(GLib::BINDING_VERSION.all?{|i| i.is_a? Integer }) end def test_priority assert_kind_of(Integer, GLib::PRIORITY_HIGH) assert_kind_of(Integer, GLib::PRIORITY_DEFAULT) assert_kind_of(Integer, GLib::PRIORITY_HIGH_IDLE) assert_kind_of(Integer, GLib::PRIORITY_DEFAULT_IDLE) assert_kind_of(Integer, GLib::PRIORITY_LOW) end def test_int64 end def test_convert assert_kind_of(String, GLib.charset) sjis = "\202\261\202\361\202\311\202\277\202\315\220\242\212E" euc = "\244\263\244\363\244\313\244\301\244\317\300\244\263\246" utf8 = "\343\201\223\343\202\223\343\201\253\343\201\241\343\201\257\344\270\226\347\225\214" assert_equal(GLib.convert(sjis, "UTF-8", "SHIFT_JIS"), utf8) assert_equal(GLib.convert(sjis, "EUC-JP", "SHIFT_JIS"), euc) assert_equal(GLib.convert(sjis, "SHIFT_JIS", "SHIFT_JIS"), sjis) assert_equal(GLib.convert(euc, "UTF-8", "EUC-JP"), utf8) assert_equal(GLib.convert(euc, "EUC-JP", "EUC-JP"), euc) assert_equal(GLib.convert(euc, "SHIFT_JIS", "EUC-JP"), sjis) assert_equal(GLib.convert(utf8, "UTF-8", "UTF-8"), utf8) assert_equal(GLib.convert(utf8, "EUC-JP", "UTF-8"), euc) assert_equal(GLib.convert(utf8, "SHIFT_JIS", "UTF-8"), sjis) # rb_define_module_function(mGLib, "locale_to_utf8", rbglib_m_locale_to_utf8, 1); # rb_define_module_function(mGLib, "locale_from_utf8", rbglib_m_locale_from_utf8, 1); # rb_define_module_function(mGLib, "filename_to_utf8", rbglib_m_filename_to_utf8, 1); # rb_define_module_function(mGLib, "filename_from_utf8", rbglib_m_filename_from_utf8, 1); # # rb_define_module_function(mGLib, "filename_to_uri", rbglib_m_filename_to_uri, -1); # rb_define_module_function(mGLib, "filename_from_uri", rbglib_m_filename_from_uri, 1); end def test_messages #rb_define_module_function(mGLog, "set_handler", rbglib_m_log_set_handler, 2); #rb_define_module_function(mGLog, "remove_handler", rbglib_m_log_remove_handler, 2); end def test_object assert_raises(GLib::NoPropertyError) { GLib::Object.property("foo") } assert_raises(GLib::NoSignalError) { GLib::Object.signal("foo") } end def test_interface_extend assert_raises(TypeError){ Object.__send__(:include, GLib::TypePlugin) } end def test_signal_has_handler_pending obj = GLib::Object.new signal_name = "notify" assert(!obj.signal_has_handler_pending?(signal_name)) h = obj.signal_connect(signal_name){} assert(obj.signal_has_handler_pending?(signal_name)) obj.signal_handler_block(h) { assert(obj.signal_has_handler_pending?(signal_name, true)) assert(!obj.signal_has_handler_pending?(signal_name, false)) } assert(obj.signal_has_handler_pending?(signal_name, false)) obj.signal_handler_disconnect(h) assert(!obj.signal_has_handler_pending?(signal_name)) obj = nil end def test_signal_handler_disconnect_and_gc obj = GLib::Object.new klass = Class.new 1000.times { a = klass.new id = obj.signal_connect("notify") { p a } obj.signal_handler_disconnect(id) } GC.start ary = [] ObjectSpace.each_object(klass) { |a| ary.push(a) } assert_operator(ary.size, :<, 1000) end def test_gtype assert_equal(GLib::Object.gtype, GLib::Type["GObject"]) assert_equal(GLib::Interface.gtype, GLib::Type["GInterface"]) obj = GLib::Object.new assert_equal(obj.gtype, GLib::Object.gtype) end end ruby-gnome2-all-2.1.0/glib2/test/test_value.rb0000644000175000017500000000211712124610262017257 0ustar koukou# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGLibValue < Test::Unit::TestCase include GLibTestUtils def test_type value = GLib::Value.new(GLib::Type::UINT, 29) assert_equal(GLib::Type::UINT, value.type) end def test_value value = GLib::Value.new(GLib::Type::UINT, 29) assert_equal(29, value.value) end end ruby-gnome2-all-2.1.0/glib2/test/test_timeout.rb0000644000175000017500000000123511701304107017627 0ustar koukou# -*- coding: utf-8 -*- class TestGLibTimeout < Test::Unit::TestCase include GLibTestUtils def setup @id = nil end def teardown GLib::Source.remove(@id) if @id end def test_timeout_add_priority priority = GLib::PRIORITY_HIGH @id = GLib::Timeout.add(10, priority) source = GLib::MainContext.default.find_source(@id) assert_equal(priority, source.priority) end def test_timeout_add_seconds_priority only_glib_version(2, 14, 0) priority = GLib::PRIORITY_HIGH @id = GLib::Timeout.add_seconds(10, priority) source = GLib::MainContext.default.find_source(@id) assert_equal(priority, source.priority) end end ruby-gnome2-all-2.1.0/glib2/test/test_utils.rb0000644000175000017500000000150411701304107017300 0ustar koukou# -*- coding: utf-8 -*- class TestGLibUtils < Test::Unit::TestCase include GLibTestUtils def test_user_cache_dir only_glib_version(2, 6, 0) assert_kind_of(String, GLib.user_cache_dir) end def test_user_data_dir only_glib_version(2, 6, 0) assert_kind_of(String, GLib.user_data_dir) end def test_user_config_dir only_glib_version(2, 6, 0) assert_kind_of(String, GLib.user_config_dir) end def test_system_data_dirs only_glib_version(2, 6, 0) assert_kind_of(Array, GLib.system_data_dirs) end def test_system_config_dirs only_glib_version(2, 6, 0) assert_kind_of(Array, GLib.system_config_dirs) end def test_get_user_special_dir only_glib_version(2, 14, 0) assert_nothing_raised do GLib.get_user_special_dir(GLib::UserDirectory::DESKTOP) end end end ruby-gnome2-all-2.1.0/glib2/test/test_poll_fd.rb0000644000175000017500000000173312124610262017565 0ustar koukou# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGLibPollFD < Test::Unit::TestCase include GLibTestUtils def test_fd poll_fd = GLib::PollFD.new(0, GLib::IOChannel::IN, 0) assert_equal(0, poll_fd.fd) end end ruby-gnome2-all-2.1.0/glib2/test/test_source.rb0000644000175000017500000000204112126557022017445 0ustar koukou# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGLibSource < Test::Unit::TestCase include GLibTestUtils def test_time context = GLib::MainContext.default source = GLib::Idle.source_new source.attach(context) time = source.time assert_operator(0, :<, time) end end ruby-gnome2-all-2.1.0/glib2/test/test_unicode.rb0000664000175000017500000002714311740310343017601 0ustar koukou# -*- coding: utf-8 -*- class TestGLibUnicode < Test::Unit::TestCase include GLibTestUtils def test_gunicode_type assert_nothing_raised do GLib::Unicode::CONTROL end end def test_gunicode_break_type assert_nothing_raised do GLib::Unicode::BREAK_MANDATORY end end def test_unichar_alnum? assert(GLib::UniChar.alnum?(unichar("a"))) assert(GLib::UniChar.alnum?(unichar("1"))) assert(!GLib::UniChar.alnum?(unichar("!"))) end def test_unichar_alpha? assert(GLib::UniChar.alpha?(unichar("a"))) assert(GLib::UniChar.alpha?(unichar("A"))) assert(!GLib::UniChar.alpha?(unichar("1"))) end def test_unichar_cntrl? assert(GLib::UniChar.cntrl?(unichar("\t"))) assert(!GLib::UniChar.cntrl?(unichar("\h"))) assert(!GLib::UniChar.cntrl?(unichar("a"))) assert(!GLib::UniChar.cntrl?(unichar("1"))) end def test_unichar_digit? assert(GLib::UniChar.digit?(unichar("1"))) assert(!GLib::UniChar.digit?(unichar("a"))) end def test_unichar_graph? assert(GLib::UniChar.graph?(unichar("a"))) assert(!GLib::UniChar.graph?(unichar(" "))) assert(!GLib::UniChar.graph?(unichar("\t"))) end def test_unichar_lower? assert(GLib::UniChar.lower?(unichar("a"))) assert(!GLib::UniChar.lower?(unichar("A"))) assert(!GLib::UniChar.lower?(unichar("1"))) end def test_unichar_print? assert(GLib::UniChar.print?(unichar("a"))) assert(GLib::UniChar.print?(unichar(" "))) assert(!GLib::UniChar.print?(unichar("\t"))) end def test_unichar_punct? assert(GLib::UniChar.punct?(unichar(","))) assert(GLib::UniChar.punct?(unichar("."))) assert(!GLib::UniChar.punct?(unichar("a"))) assert(!GLib::UniChar.punct?(unichar("\t"))) end def test_unichar_space? assert(GLib::UniChar.space?(unichar(" "))) assert(GLib::UniChar.space?(unichar("\t"))) assert(GLib::UniChar.space?(unichar("\r"))) assert(GLib::UniChar.space?(unichar("\n"))) assert(!GLib::UniChar.space?(unichar("a"))) end def test_unichar_upper? assert(GLib::UniChar.upper?(unichar("A"))) assert(!GLib::UniChar.upper?(unichar("a"))) assert(!GLib::UniChar.upper?(unichar("1"))) end def test_unichar_xdigit? assert(GLib::UniChar.xdigit?(unichar("1"))) assert(GLib::UniChar.xdigit?(unichar("a"))) assert(GLib::UniChar.xdigit?(unichar("A"))) assert(GLib::UniChar.xdigit?(unichar("F"))) assert(!GLib::UniChar.xdigit?(unichar("X"))) end def test_unichar_title? end def test_unichar_defined? end def test_unichar_wide? assert(GLib::UniChar.wide?(unichar("ã‚"))) assert(GLib::UniChar.wide?(unichar("A"))) assert(!GLib::UniChar.wide?(unichar("a"))) end def test_unichar_wide_cjk? only_glib_version(2, 12, 0) assert(GLib::UniChar.wide_cjk?(unichar("ã‚"))) assert(GLib::UniChar.wide_cjk?(0xD55C)) # HANGUL SYLLABLE HAN assert(!GLib::UniChar.wide_cjk?(unichar("a"))) end def test_unichar_to_upper assert_equal(unichar("A"), GLib::UniChar.to_upper(unichar("a"))) assert_equal(unichar("A"), GLib::UniChar.to_upper(unichar("A"))) assert_equal(unichar("*"), GLib::UniChar.to_title(unichar("*"))) end def test_unichar_to_lower assert_equal(unichar("a"), GLib::UniChar.to_lower(unichar("A"))) assert_equal(unichar("a"), GLib::UniChar.to_lower(unichar("a"))) assert_equal(unichar("*"), GLib::UniChar.to_title(unichar("*"))) end def test_unichar_to_title assert_equal(unichar("A"), GLib::UniChar.to_title(unichar("a"))) assert_equal(unichar("A"), GLib::UniChar.to_title(unichar("A"))) assert_equal(unichar("*"), GLib::UniChar.to_title(unichar("*"))) end def test_unichar_digit_value assert_equal(0, GLib::UniChar.digit_value(unichar("0"))) assert_equal(9, GLib::UniChar.digit_value(unichar("9"))) assert_equal(-1, GLib::UniChar.digit_value(unichar("a"))) end def test_unichar_xdigit_value assert_equal(0, GLib::UniChar.xdigit_value(unichar("0"))) assert_equal(9, GLib::UniChar.xdigit_value(unichar("9"))) assert_equal(10, GLib::UniChar.xdigit_value(unichar("a"))) assert_equal(15, GLib::UniChar.xdigit_value(unichar("F"))) assert_equal(-1, GLib::UniChar.xdigit_value(unichar("g"))) end def test_unichar_type assert_equal(GLib::Unicode::DECIMAL_NUMBER, GLib::UniChar.type(unichar("0"))) assert_equal(GLib::Unicode::LOWERCASE_LETTER, GLib::UniChar.type(unichar("a"))) assert_equal(GLib::Unicode::UPPERCASE_LETTER, GLib::UniChar.type(unichar("A"))) end def test_unichar_break_type assert_equal(GLib::Unicode::BREAK_HYPHEN, GLib::UniChar.break_type(unichar("-"))) assert_equal(GLib::Unicode::BREAK_NUMERIC, GLib::UniChar.break_type(unichar("0"))) end def test_unicode_canonical_ordering original = [unichar("a"), 0x0308, 0x0323, unichar("e"), 0x0304, 0x0301, 0x0323].pack("U*") expected = [unichar("a"), 0x0323, 0x0308, unichar("e"), 0x0323, 0x0304, 0x0301].pack("U*") assert_equal(utf8_to_utf32(expected), GLib::Unicode.canonical_ordering(utf8_to_utf32(original))) end def test_unicode_canonical_decomposition a_with_acute = 0x00E1 expected = [unichar("a"), 0x0301].pack("U*") assert_equal(utf8_to_utf32(expected), GLib::Unicode.canonical_decomposition(a_with_acute)) hiragana_ga = 0x304C hiragana_ka = 0x304B expected = [hiragana_ka, 0x3099].pack("U*") assert_equal(utf8_to_utf32(expected), GLib::Unicode.canonical_decomposition(hiragana_ga)) end def test_unichar_get_mirror_char assert_equal(unichar("("), GLib::UniChar.get_mirror_char(unichar(")"))) assert_equal(unichar(")"), GLib::UniChar.get_mirror_char(unichar("("))) assert_equal(unichar("x"), GLib::UniChar.get_mirror_char(unichar("x"))) end def test_unichar_get_script only_glib_version(2, 14, 0) assert_equal(GLib::Unicode::SCRIPT_HIRAGANA, GLib::UniChar.get_script(unichar("ã‚"))) end def test_utf8_get_char assert_equal(utf8_to_utf32("ã‚").unpack("L*")[0], GLib::UTF8.get_char("ã‚")) assert_equal(utf8_to_utf32("ã‚").unpack("L*")[0], GLib::UTF8.get_char("ã‚", true)) partial_input = "ã‚".unpack("c*")[0..-2].pack("c*") assert_equal(-2, GLib::UTF8.get_char(partial_input, true)) invalid_input = "ã‚".unpack("c*")[2..-1].pack("c*") assert_equal(-1, GLib::UTF8.get_char(invalid_input, true)) end def test_utf8_size assert_equal(1, GLib::UTF8.size("ã‚")) assert_equal(2, GLib::UTF8.size("ã‚ã„")) end def test_utf8_reverse assert_equal("ãŠãˆã†ã„ã‚", GLib::UTF8.reverse("ã‚ã„ã†ãˆãŠ")) end def test_utf8_validate assert(GLib::UTF8.validate("ã‚")) assert(!GLib::UTF8.validate(binary("ã‚")[1..-1])) end def test_utf8_upcase assert_equal("ABCã‚ã„ã†", GLib::UTF8.upcase("aBcã‚ã„ã†")) end def test_utf8_downcase assert_equal("abcã‚ã„ã†", GLib::UTF8.downcase("aBcã‚ã„ã†")) end def test_utf8_casefold assert_equal(GLib::UTF8.casefold("AbCã‚ã„ã†"), GLib::UTF8.casefold("aBcã‚ã„ã†")) end def test_utf8_normalize original = [0x00c1].pack("U*") # A with acute nfd = [0x0041, 0x0301].pack("U*") assert_equal(nfd, GLib::UTF8.normalize(original, GLib::NormalizeMode::NFD)) nfc = [0x00c1].pack("U*") assert_equal(nfc, GLib::UTF8.normalize(original, GLib::NormalizeMode::NFC)) nfkd = [0x0041, 0x0301].pack("U*") assert_equal(nfkd, GLib::UTF8.normalize(original, GLib::NormalizeMode::NFKD)) nfkc = [0x00c1].pack("U*") assert_equal(nfkc, GLib::UTF8.normalize(original, GLib::NormalizeMode::NFKC)) end def test_utf8_collate only_glib_version(2, 16, 0) assert_operator(0, :>, GLib::UTF8.collate("ã‚", "ã„")) assert_operator(0, :<, GLib::UTF8.collate("ã„", "ã‚")) assert_equal(0, GLib::UTF8.collate("ã‚", "ã‚")) end def test_utf8_collate_key only_glib_version(2, 16, 0) assert_operator(0, :>, GLib::UTF8.collate_key("ã‚") <=> GLib::UTF8.collate_key("ã„")) assert_operator(0, :<, GLib::UTF8.collate_key("ã„") <=> GLib::UTF8.collate_key("ã‚")) assert_equal(0, GLib::UTF8.collate_key("ã‚") <=> GLib::UTF8.collate_key("ã‚")) end def test_utf8_collate_key_for_filename assert_equal(["event.c", "event.h", "eventgenerator.c"], ["event.c", "eventgenerator.c", "event.h"].sort_by do |f| GLib::UTF8.collate_key(f, true) end) assert_equal(["file1", "file5", "file10"], ["file1", "file10", "file5"].sort_by do |f| GLib::UTF8.collate_key(f, true) end) end def test_utf8_to_utf16 assert_equal(utf8_to_utf16("ã‚ã„ã†ãˆãŠ"), GLib::UTF8.to_utf16("ã‚ã„ã†ãˆãŠ")) end def test_utf8_to_ucs4 assert_equal(utf8_to_utf32("ã‚ã„ã†ãˆãŠ"), GLib::UTF8.to_ucs4("ã‚ã„ã†ãˆãŠ")) assert_raise(GLib::ConvertError) do GLib::UTF8.to_ucs4(binary("ã‚ã„ã†ãˆãŠ")[1..-1]) end assert_nothing_raised do GLib::UTF8.to_ucs4(binary("ã‚ã„ã†ãˆãŠ")[1..-1], true) end end def test_utf16_to_ucs4 assert_equal(utf8_to_utf32("ã‚ã„ã†ãˆãŠ"), GLib::UTF16.to_ucs4(utf8_to_utf16("ã‚ã„ã†ãˆãŠ"))) end def test_utf16_to_utf8 assert_equal("ã‚ã„ã†ãˆãŠ", GLib::UTF16.to_utf8(utf8_to_utf16("ã‚ã„ã†ãˆãŠ"))) end def test_ucs4_to_utf16 assert_equal(utf8_to_utf16("ã‚ã„ã†ãˆãŠ"), GLib::UCS4.to_utf16(utf8_to_utf32("ã‚ã„ã†ãˆãŠ"))) assert_raise(GLib::ConvertError) do GLib::UCS4.to_utf16(binary(utf8_to_utf32("ã‚ã„ã†ãˆãŠ"))[1..-1]) end end def test_ucs4_to_utf8 assert_equal("ã‚ã„ã†ãˆãŠ", GLib::UCS4.to_utf8(utf8_to_utf32("ã‚ã„ã†ãˆãŠ"))) end def test_unichar_to_utf8 assert_equal("ã‚", GLib::UniChar.to_utf8(utf8_to_utf32("ã‚").unpack("L*")[0])) end def test_unichar_combining_class only_glib_version(2, 14, 0) assert_equal(0, GLib::UniChar.combining_class(unichar("a"))) assert_equal(230, GLib::UniChar.combining_class(unichar("Ì"))) end def test_unichar_mark? only_glib_version(2, 14, 0) assert(!GLib::UniChar.mark?(unichar("a"))) assert(!GLib::UniChar.mark?(0x200E)) # LEFT-TO-RIGHT MARK assert(GLib::UniChar.mark?(0x1DC3)) # COMBINING SUSPENSION MARK end def test_unichar_zero_width? only_glib_version(2, 14, 0) assert(!GLib::UniChar.zero_width?(unichar("a"))) assert(GLib::UniChar.zero_width?(0x200B)) # ZERO WIDTH SPACE end private def unichar(char) GLib::UTF8.get_char(char) end def utf8_to_utf32(string) if string.respond_to?(:encode) if little_endian? string.encode("UTF-32LE") else string.encode("UTF-32BE") end else require_uconv Uconv.u8tou4(string) end end def utf8_to_utf16(string) if string.respond_to?(:encode) if little_endian? string.encode("UTF-16LE") else string.encode("UTF-16BE") end else require_uconv Uconv.u8tou16(string) end end def require_uconv require 'uconv' rescue LoadError omit("Need uconv to run this test.") end def binary(string) if string.respond_to?(:force_encoding) string.force_encoding("ascii-8bit") end string end def little_endian? [1].pack("v") == [1].pack("S") end end ruby-gnome2-all-2.1.0/glib2/test/test_iochannel.rb0000755000175000017500000001454511701304107020114 0ustar koukou# -*- coding: utf-8 -*- require 'test/unit' require 'glib2' require 'tempfile' require 'nkf' $KCODE = "U" unless defined?(:Encoding) class TestGIOChannel < Test::Unit::TestCase def setup @content = "aaa\nbbb\nccc\nã‚ã‚ã‚\n" @sjis_content = NKF.nkf("-sW", @content) @file = Tempfile.new("glib2-content") @file.open @file.print(@content) @file.close @sjis_file = Tempfile.new("glib2-sjis-content") @sjis_file.open @sjis_file.print(@sjis_content) @sjis_file.close end def test_open write_test_file = Tempfile.new("glib2-write-test") io = GLib::IOChannel.open(@file.path) io.close io = GLib::IOChannel.open(@file.path, "r") assert_equal(@content, io.read) io.close io = GLib::IOChannel.open(write_test_file.path, "w") assert_raises(RuntimeError){ assert_equal(@content, io.read) } io.close GLib::IOChannel.open(@file.path) do |_io| assert_equal(@content, _io.read) end GLib::IOChannel.open(@file.path, "r") do |_io| assert_equal(@content, _io.read) end GLib::IOChannel.open(write_test_file.path, "w") do |_io| io = _io assert_raises(RuntimeError) do assert_equal(@content, io.read) end end assert_raises(GLib::IOChannelError) do io.close end assert_raises(GLib::FileError) do GLib::IOChannel.new("foo") end end def test_getc io = GLib::IOChannel.new(@file.path) ["a", "b", "c", "ã‚"].each do |v| 3.times do assert_equal(v.unpack("U")[0], io.getc) end assert_equal("\n".unpack("U")[0], io.getc) end assert_equal(nil, io.getc) io.close end def test_each_char text = @content.split(//u) io = GLib::IOChannel.new(@file.path) i = 0 io.each_char {|ch| assert_equal(text[i].unpack("U")[0], ch) i += 1 } io.close end def test_readchar io = GLib::IOChannel.new(@file.path) text = @content.split(//u) text.each do |v| assert_equal(v.unpack("U")[0], io.readchar) end assert_raises(EOFError) { io.readchar } io.close end def test_gets io = GLib::IOChannel.new(@file.path) assert_equal("aaa\n", io.gets) assert_equal("bbb\n", io.gets) assert_equal("ccc\n", io.gets) assert_equal("ã‚ã‚ã‚\n", io.gets) assert_equal(nil, io.gets) io.close io = GLib::IOChannel.new(@file.path) assert_equal("aaa\nbbb\n", io.gets("bbb\n")) assert_equal("ccc\nã‚ã‚ã‚\n", io.gets("bbb\n")) assert_equal(nil, io.gets("bbb\n")) io.close end def test_readline io = GLib::IOChannel.new(@file.path) assert_equal("aaa\n", io.readline) assert_equal("bbb\n", io.readline) assert_equal("ccc\n", io.readline) assert_equal("ã‚ã‚ã‚\n", io.readline) assert_raises(EOFError) { io.readline } io.close io = GLib::IOChannel.new(@file.path) assert_equal("aaa\nbbb\n", io.readline("bbb\n")) assert_equal("ccc\nã‚ã‚ã‚\n", io.readline("bbb\n")) assert_raises(EOFError) { io.readline("bbb\n") } io.close end def test_each_line lines = ["aaa\n", "bbb\n", "ccc\n", "ã‚ã‚ã‚\n"] io = GLib::IOChannel.new(@file.path) i = 0 io.each {|line| assert_equal(lines[i], line) i += 1 } io.close io = GLib::IOChannel.new(@file.path) assert_raises(RuntimeError) { io.each {|line| raise "test" } } io.close io = GLib::IOChannel.new(@file.path) i = 0 io.each_line {|line| assert_equal(lines[i], line) i += 1 } io.close #Test for Enumerable GLib::IOChannel.open(@file.path) do |_io| io = _io io.each_with_index do |line, _i| assert_equal(lines[_i], line) end end assert_raises(ArgumentError) do io.each end end def test_read io = GLib::IOChannel.new(@file.path) assert_equal(@content, io.read) io.close io = GLib::IOChannel.new(@file.path) assert_equal(@content, io.read(100)) io.close io = GLib::IOChannel.new(@file.path) assert_equal("aaa\nbbb\n", io.read(8)) assert_equal("ccc\n", io.read(4)) assert_equal("ã‚ã‚ã‚\n", io.read(10)) assert_equal("", io.read(10)) assert_equal("", io.read(10)) io.close end def test_seek text = @content io = GLib::IOChannel.new(@file.path) io.seek(5) assert_equal(text.unpack("U*")[5], io.getc) io.seek(6, GLib::IOChannel::SEEK_SET) assert_equal(text.unpack("U*")[6], io.getc) io.seek(1, GLib::IOChannel::SEEK_CUR) assert_equal(text.unpack("U*")[8], io.getc) io.pos = 0 assert_equal(text.unpack("U*")[0], io.getc) io.set_pos(2) assert_equal(text.unpack("U*")[2], io.getc) io.close end def test_write write_test_file = Tempfile.new("glib2-write-test") io = GLib::IOChannel.new(write_test_file.path, "w") io.write("a\n") io.write("ã‚ã„ã†\n") io.printf("a%sa\n", "a") io.print("a", 100, "a\n") io.puts("b", 200, "b") io.putc("c") io.putc("c".unpack("U")[0]) io.putc("cc".unpack("U")[0]) io.putc("ã‚".unpack("U")[0]) io.putc("ã‚") io.putc("ã‚ã„") #Ignore 2nd char io.putc("aã‚") #Ignore 2nd char io.close # check them io = GLib::IOChannel.new(write_test_file.path, "r") assert_equal("a\n", io.gets) assert_equal("ã‚ã„ã†\n", io.gets) assert_equal("aaa\n", io.gets) assert_equal("a100a\n", io.gets) assert_equal("b\n", io.gets) assert_equal("200\n", io.gets) assert_equal("b\n", io.gets) assert_equal("c".unpack("U")[0], io.getc) assert_equal("c".unpack("U")[0], io.getc) assert_equal("c".unpack("U")[0], io.getc) assert_equal("ã‚".unpack("U")[0], io.getc) assert_equal("ã‚".unpack("U")[0], io.getc) assert_equal("ã‚".unpack("U")[0], io.getc) assert_equal("a".unpack("U")[0], io.getc) io.close end def test_encoding io = GLib::IOChannel.new(@file.path) assert_equal("UTF-8", io.encoding) io.encoding = "Shift_JIS" assert_equal("Shift_JIS", io.encoding) assert_raises(GLib::ConvertError) { io.read } io.close io = GLib::IOChannel.new(@sjis_file.path) io.encoding = "Shift_JIS" assert_equal("Shift_JIS", io.encoding) assert_equal(@content, io.read) io.close end def test_error assert_raises(GLib::FileError) { # No such file or directory GLib::IOChannel.new("foo") } end end ruby-gnome2-all-2.1.0/glib2/test/glib-test-init.rb0000644000175000017500000000011011701304107017724 0ustar koukou$VERBOSE = true require "rubygems" gem 'test-unit' require 'test/unit' ruby-gnome2-all-2.1.0/rsvg2/0000755000175000017500000000000012257665516013666 5ustar koukouruby-gnome2-all-2.1.0/rsvg2/patches/0000755000175000017500000000000012257552170015304 5ustar koukouruby-gnome2-all-2.1.0/rsvg2/patches/librsvg-2.40.1-replace-canonicalize-file-name.diff0000644000175000017500000000362112257552170026231 0ustar koukouhttps://bugzilla.gnome.org/attachment.cgi?id=258810 --- a/rsvg-base.c 2013-05-11 05:19:07.000000000 -0400 +++ b/rsvg-base.c 2013-11-02 13:01:46.446835464 -0400 @@ -2151,9 +2151,8 @@ GError **error) { RsvgHandlePrivate *priv = handle->priv; - GFile *base; - char *path, *dir; - char *scheme = NULL, *cpath = NULL, *cdir = NULL; + GFile *base = NULL, *urifile = NULL; + char *scheme = NULL; g_assert (handle->priv->load_policy == RSVG_LOAD_POLICY_STRICT); @@ -2183,47 +2182,35 @@ if (!g_str_equal (scheme, "file")) goto deny; + /* Ensure that uri is under the file's base directory */ base = g_file_get_parent (priv->base_gfile); if (base == NULL) goto deny; - dir = g_file_get_path (base); - g_object_unref (base); - - /* FIXME portability */ - cdir = canonicalize_file_name (dir); - g_free (dir); - if (cdir == NULL) + urifile = g_file_new_for_uri (uri); + if (urifile == NULL) goto deny; - path = g_filename_from_uri (uri, NULL, NULL); - if (path == NULL) - goto deny; - - /* FIXME portability */ - cpath = canonicalize_file_name (path); - g_free (path); - - if (cpath == NULL) + if (!g_file_has_prefix (urifile, base)) goto deny; - /* Now check that @cpath is below @cdir */ - if (!g_str_has_prefix (cpath, cdir) || - cpath[strlen (cdir)] != G_DIR_SEPARATOR) - goto deny; + g_object_unref (urifile); + g_object_unref (base); /* Allow load! */ allow: g_free (scheme); - free (cpath); - free (cdir); return TRUE; deny: g_free (scheme); - free (cpath); - free (cdir); + + if (urifile) + g_object_unref (urifile); + + if (base) + g_object_unref (base); g_set_error (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, "File may not link to URI \"%s\"", uri); ruby-gnome2-all-2.1.0/rsvg2/ext/0000755000175000017500000000000011701304107014441 5ustar koukouruby-gnome2-all-2.1.0/rsvg2/ext/rsvg2/0000755000175000017500000000000012257552170015520 5ustar koukouruby-gnome2-all-2.1.0/rsvg2/ext/rsvg2/rbrsvghandle.c0000664000175000017500000003005111740310343020334 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005-2006 Ruby-GNOME2 Project Team * Copyright (C) 2004 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rsvg2.h" #define RG_TARGET_NAMESPACE cHandle #ifdef RSVG_TYPE_HANDLE # define _SELF(self) (RSVG_HANDLE(RVAL2GOBJ(self))) #else # define _SELF(self) ((RsvgHandle *)DATA_PTR(self)) #endif static VALUE RG_TARGET_NAMESPACE; static ID id_call; static ID id_callback; static ID id_closed; static void exec_callback(gint *width, gint *height, gpointer self) { VALUE result; result = rb_funcall(rb_ivar_get((VALUE)self, id_callback), id_call, 2, INT2NUM(*width), INT2NUM(*height)); if (T_ARRAY == TYPE(result)) { VALUE w, h; w = rb_ary_entry(result, 0); h = rb_ary_entry(result, 1); if (!NIL_P(w)) { *width = NUM2INT(w); } if (!NIL_P(h)) { *height = NUM2INT(h); } } } static VALUE rg_set_dpi(VALUE self, VALUE dpi) { #ifdef HAVE_RSVG_HANDLE_SET_DPI rsvg_handle_set_dpi(_SELF(self), NUM2DBL(dpi)); #else rb_warning("rsvg_handle_set_dpi isn't supported in your librsvg"); #endif return self; } static VALUE rg_set_dpi_x_y(VALUE self, VALUE dpi_x, VALUE dpi_y) { #ifdef HAVE_RSVG_HANDLE_SET_DPI_X_Y rsvg_handle_set_dpi_x_y(_SELF(self), NUM2DBL(dpi_x), NUM2DBL(dpi_y)); #else rb_warning("rsvg_handle_set_dpi_x_y isn't supported in your librsvg"); #endif return self; } #ifndef RSVG_TYPE_HANDLE static void rb_rsvg_handle_free(RsvgHandle *handle) { if (handle) { rsvg_handle_free(handle); } } static VALUE rb_rsvg_handle_alloc(VALUE klass) { return Data_Wrap_Struct(klass, 0, rb_rsvg_handle_free, 0); } #endif #if LIBRSVG_CHECK_VERSION(2, 14, 0) static VALUE rg_s_new_from_data(G_GNUC_UNUSED VALUE self, VALUE data) { GError *error = NULL; RsvgHandle *handle; handle = rsvg_handle_new_from_data((const guint8 *)RVAL2CSTR(data), RSTRING_LEN(data), &error); if (error) RAISE_GERROR(error); return GOBJ2RVAL(handle); } static VALUE rg_s_new_from_file(G_GNUC_UNUSED VALUE self, VALUE file) { GError *error = NULL; RsvgHandle *handle; handle = rsvg_handle_new_from_file((const gchar *)RVAL2CSTR(file), &error); if (error) RAISE_GERROR(error); return GOBJ2RVAL(handle); } #endif static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { RsvgHandle *handle; VALUE gz; rb_scan_args(argc, argv, "01", &gz); #if LIBRSVG_CHECK_VERSION(2, 11, 0) handle = rsvg_handle_new(); #else if (RVAL2CBOOL(gz)) { # ifdef HAVE_LIBRSVG_RSVG_GZ_H handle = rsvg_handle_new_gz(); # else rb_warning("gz handling is not supported in your librsvg"); handle = rsvg_handle_new(); # endif } else { handle = rsvg_handle_new(); } #endif #ifdef RSVG_TYPE_HANDLE G_INITIALIZE(self, handle); #else DATA_PTR(self) = handle; #endif rb_ivar_set(self, id_closed, Qfalse); return Qnil; } static VALUE rg_set_size_callback(VALUE self) { rb_ivar_set(self, id_callback, rb_block_proc()); rsvg_handle_set_size_callback(_SELF(self), exec_callback, (gpointer)self, NULL); return self; } static VALUE rg_write(VALUE self, VALUE buf) { gboolean result; GError *error = NULL; result = rsvg_handle_write(_SELF(self), (const guchar*)RVAL2CSTR(buf), RSTRING_LEN(buf), &error); if (!result) RAISE_GERROR(error); return CBOOL2RVAL(result); } static VALUE rg_close(VALUE self) { gboolean result; GError *error = NULL; if (RVAL2CBOOL(rb_ivar_get(self, id_closed))) { return Qnil; } result = rsvg_handle_close(_SELF(self), &error); if (result) { rb_ivar_set(self, id_closed, Qtrue); } else { RAISE_GERROR(error); } return CBOOL2RVAL(result); } static VALUE rg_closed_p(VALUE self) { return rb_ivar_get(self, id_closed); } static VALUE rg_pixbuf(int argc, VALUE *argv, VALUE self) { VALUE id; VALUE rb_pixbuf; GdkPixbuf *pixbuf = NULL; rb_scan_args(argc, argv, "01", &id); if (NIL_P(id)) { pixbuf = rsvg_handle_get_pixbuf(_SELF(self)); } else { #ifdef HAVE_RSVG_HANDLE_GET_PIXBUF_SUB pixbuf = rsvg_handle_get_pixbuf_sub(_SELF(self), (const char *)RVAL2CSTR(id)); #else rb_warning("rsvg_handle_get_pixbuf_sub isn't " "supported in your librsvg"); #endif } rb_pixbuf = GOBJ2RVAL(pixbuf); if (pixbuf) g_object_unref(pixbuf); return rb_pixbuf; } #if LIBRSVG_CHECK_VERSION(2, 9, 0) static VALUE rg_base_uri(VALUE self) { return CSTR2RVAL(rsvg_handle_get_base_uri(_SELF(self))); } static VALUE rg_set_base_uri(VALUE self, VALUE base_uri) { rsvg_handle_set_base_uri(_SELF(self), RVAL2CSTR(base_uri)); return self; } #endif #ifdef HAVE_TYPE_RSVGDIMENSIONDATA static VALUE rg_dimensions(VALUE self) { RsvgDimensionData dim; VALUE args[4]; VALUE cDimensionData = rb_const_get(rb_const_get(rb_cObject, rb_intern("RSVG")), rb_intern("DimensionData")); rsvg_handle_get_dimensions(_SELF(self), &dim); args[0] = INT2NUM(dim.width); args[1] = INT2NUM(dim.height); args[2] = rb_float_new(dim.em); args[3] = rb_float_new(dim.ex); return rb_class_new_instance(sizeof(args) / sizeof(VALUE), args, cDimensionData); } #endif /* Accessibility API */ static VALUE rg_title(VALUE self) { return CSTR2RVAL(rsvg_handle_get_title(_SELF(self))); } static VALUE rg_desc(VALUE self) { return CSTR2RVAL(rsvg_handle_get_desc(_SELF(self))); } #ifdef HAVE_RSVG_HANDLE_GET_METADATA static VALUE rg_metadata(VALUE self) { return CSTR2RVAL(rsvg_handle_get_metadata(_SELF(self))); } #endif #if !LIBRSVG_CHECK_VERSION(2, 11, 0) /* Extended Convenience API */ static VALUE rg_pixbuf_from_file_at_size(VALUE self, VALUE file_name, VALUE width, VALUE height) { VALUE rb_pixbuf; GdkPixbuf *pixbuf; GError *error = NULL; pixbuf = rsvg_pixbuf_from_file_at_size_ex(_SELF(self), RVAL2CSTR(file_name), NUM2INT(width), NUM2INT(height), &error); if (error) RAISE_GERROR(error); rb_pixbuf = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return rb_pixbuf; } static VALUE rg_pixbuf_from_file(VALUE self, VALUE file_name) { VALUE rb_pixbuf; GdkPixbuf *pixbuf; GError *error = NULL; pixbuf = rsvg_pixbuf_from_file_ex(_SELF(self), RVAL2CSTR(file_name), &error); if (error) RAISE_GERROR(error); rb_pixbuf = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return rb_pixbuf; } static VALUE rg_pixbuf_from_file_at_zoom(VALUE self, VALUE file_name, VALUE x_zoom, VALUE y_zoom) { VALUE rb_pixbuf; GdkPixbuf *pixbuf; GError *error = NULL; pixbuf = rsvg_pixbuf_from_file_at_zoom_ex(_SELF(self), RVAL2CSTR(file_name), NUM2DBL(x_zoom), NUM2DBL(y_zoom), &error); if (error) RAISE_GERROR(error); rb_pixbuf = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return rb_pixbuf; } static VALUE rg_pixbuf_from_file_at_max_size(VALUE self, VALUE file_name, VALUE max_width, VALUE max_height) { VALUE rb_pixbuf; GdkPixbuf *pixbuf; GError *error = NULL; pixbuf = rsvg_pixbuf_from_file_at_max_size_ex(_SELF(self), RVAL2CSTR(file_name), NUM2INT(max_width), NUM2INT(max_height), &error); if (error) RAISE_GERROR(error); rb_pixbuf = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return rb_pixbuf; } static VALUE rg_pixbuf_from_file_at_zoom_with_max(VALUE self, VALUE file_name, VALUE x_zoom, VALUE y_zoom, VALUE max_width, VALUE max_height) { VALUE rb_pixbuf; GdkPixbuf *pixbuf; GError *error = NULL; pixbuf = rsvg_pixbuf_from_file_at_zoom_with_max_ex(_SELF(self), RVAL2CSTR(file_name), NUM2DBL(x_zoom), NUM2DBL(y_zoom), NUM2INT(max_width), NUM2INT(max_height), &error); if (error) RAISE_GERROR(error); rb_pixbuf = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return rb_pixbuf; } #endif #ifdef HAVE_LIBRSVG_RSVG_CAIRO_H static VALUE rg_render_cairo(int argc, VALUE *argv, VALUE self) { VALUE cr, id; rb_scan_args(argc, argv, "11", &cr, &id); if (NIL_P(id)) { rsvg_handle_render_cairo( _SELF(self), RVAL2CRCONTEXT(cr)); } else { rsvg_handle_render_cairo_sub( _SELF(self), RVAL2CRCONTEXT(cr), (const char *)RVAL2CSTR(id)); } return Qnil; } #endif void Init_rsvg_handle(VALUE mRSVG) { id_call = rb_intern("call"); id_callback = rb_intern("callback"); id_closed = rb_intern("closed"); #ifdef RSVG_TYPE_HANDLE RG_TARGET_NAMESPACE = G_DEF_CLASS(RSVG_TYPE_HANDLE, "Handle", mRSVG); #else RG_TARGET_NAMESPACE = rb_define_class_under(mRSVG, "Handle", rb_cObject); rb_define_alloc_func(RG_TARGET_NAMESPACE, rb_rsvg_handle_alloc); #endif #if LIBRSVG_CHECK_VERSION(2, 14, 0) RG_DEF_SMETHOD(new_from_data, 1); RG_DEF_SMETHOD(new_from_file, 1); #endif RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_size_callback, 0); RG_DEF_METHOD(set_dpi, 1); RG_DEF_METHOD(set_dpi_x_y, 2); RG_DEF_METHOD(write, 1); RG_DEF_METHOD(close, 0); RG_DEF_METHOD_P(closed, 0); RG_DEF_METHOD(pixbuf, -1); #if LIBRSVG_CHECK_VERSION(2, 9, 0) RG_DEF_METHOD(base_uri, 0); RG_DEF_METHOD(set_base_uri, 1); #endif #ifdef HAVE_TYPE_RSVGDIMENSIONDATA RG_DEF_METHOD(dimensions, 0); #endif /* Accessibility API */ RG_DEF_METHOD(title, 0); RG_DEF_METHOD(desc, 0); #ifdef HAVE_RSVG_HANDLE_GET_METADATA RG_DEF_METHOD(metadata, 0); #endif #if !LIBRSVG_CHECK_VERSION(2, 11, 0) /* Extended Convenience API */ RG_DEF_METHOD(pixbuf_from_file_at_size, 3); RG_DEF_METHOD(pixbuf_from_file, 1); RG_DEF_METHOD(pixbuf_from_file_at_zoom, 3); RG_DEF_METHOD(pixbuf_from_file_at_max_size, 3); RG_DEF_METHOD(pixbuf_from_file_at_zoom_with_max, 5); #endif #ifdef HAVE_LIBRSVG_RSVG_CAIRO_H RG_DEF_METHOD(render_cairo, -1); #endif } ruby-gnome2-all-2.1.0/rsvg2/ext/rsvg2/rsvg2.h0000644000175000017500000000373211701304107016725 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005-2006 Ruby-GNOME2 Project Team * Copyright (C) 2004 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef RSVG2_H #define RSVG2_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include #include #include #ifdef HAVE_LIBRSVG_RSVG_GZ_H # include #else # include #endif #ifdef HAVE_RB_CAIRO_H # include # include #endif #ifdef HAVE_LIBRSVG_LIBRSVG_ENUM_TYPES_H # include #else # include "librsvg-enum-types.h" #endif #include #define LIBRSVG_CHECK_VERSION(major, minor, micro) \ (LIBRSVG_MAJOR_VERSION > (major) || \ (LIBRSVG_MAJOR_VERSION == (major) && LIBRSVG_MINOR_VERSION > (minor)) || \ (LIBRSVG_MAJOR_VERSION == (major) && LIBRSVG_MINOR_VERSION == (minor) && \ LIBRSVG_MICRO_VERSION >= (micro))) G_GNUC_INTERNAL void Init_rsvg_handle(VALUE mRSVG); G_GNUC_INTERNAL void Init_rsvg_dimensiondata(VALUE mRSVG); #ifdef __cplusplus } #endif #endif ruby-gnome2-all-2.1.0/rsvg2/ext/rsvg2/extconf.rb0000644000175000017500000000601312257552170017513 0ustar koukou=begin extconf.rb for Ruby/RSVG extention library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "rsvg2" package_id = "librsvg-2.0" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end ["glib2", "gdk_pixbuf2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end rcairo_options = {} rcairo_source_dir_names = ["rcairo"] if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM rcairo_source_dir_names.unshift("rcairo.win32") end rcairo_source_dir_names.each do |rcairo_source_dir_name| rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name if rcairo_source_dir.exist? rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s break end end unless check_cairo(rcairo_options) exit(false) end setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id, :debian => "librsvg2-dev", :redhat => "librsvg2-devel", :homebrew => "librsvg", :macports => "librsvg") exit(false) end rsvg_header = "librsvg/rsvg.h" have_func("rsvg_set_default_dpi", rsvg_header) have_func("rsvg_set_default_dpi_x_y", rsvg_header) have_func("rsvg_handle_set_dpi", rsvg_header) have_func("rsvg_handle_set_dpi_x_y", rsvg_header) have_func("rsvg_handle_get_metadata", rsvg_header) have_func("rsvg_handle_free", rsvg_header) have_func("rsvg_handle_get_pixbuf_sub", rsvg_header) have_header("librsvg/rsvg-gz.h") have_type("RsvgDimensionData", "librsvg/rsvg.h") have_header("librsvg/rsvg-cairo.h") create_pkg_config_file("Ruby/RSVG", package_id, nil, "ruby-rsvg2.pc") $defs << " -DRUBY_RSVG2_COMPILATION" enum_type_prefix = "librsvg-enum-types" unless have_header("librsvg/#{enum_type_prefix}.h") include_paths = PKGConfig.cflags_only_I("librsvg-2.0") include_path = include_paths.split.find do |x| /librsvg/.match(x) end.sub(/^-I/, "") headers = Dir.glob(File.join(include_path, "librsvg", "*.h")) glib_mkenums(enum_type_prefix, headers, "RSVG_TYPE_", ["librsvg/rsvg.h"]) end create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ruby-gnome2-all-2.1.0/rsvg2/ext/rsvg2/rsvg2.def0000644000175000017500000000002711701304107017226 0ustar koukouEXPORTS Init_rsvg2 ruby-gnome2-all-2.1.0/rsvg2/ext/rsvg2/depend0000644000175000017500000000024512064346475016710 0ustar koukouinstall: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-rsvg2.pc $(pkgconfigdir); \ fi ruby-gnome2-all-2.1.0/rsvg2/ext/rsvg2/rbrsvg.c0000664000175000017500000001432511740310343017166 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005-2006 Ruby-GNOME2 Project Team * Copyright (C) 2004 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rsvg2.h" #define RG_TARGET_NAMESPACE mRSVG #define RBRSVG_MAJOR_VERSION RBGLIB_MAJOR_VERSION #define RBRSVG_MINOR_VERSION RBGLIB_MINOR_VERSION #define RBRSVG_MICRO_VERSION RBGLIB_MICRO_VERSION void Init_rsvg2(void); static VALUE rg_s_set_default_dpi(VALUE self, VALUE dpi) { #ifdef HAVE_RSVG_SET_DEFAULT_DPI rsvg_set_default_dpi(NUM2DBL(dpi)); #else rb_warning("rsvg_set_default_dpi isn't supported in your librsvg"); #endif return self; } static VALUE rg_s_set_default_dpi_x_y(VALUE self, VALUE dpi_x, VALUE dpi_y) { #ifdef HAVE_RSVG_SET_DEFAULT_DPI_X_Y rsvg_set_default_dpi_x_y(NUM2DBL(dpi_x), NUM2DBL(dpi_y)); #else rb_warning("rsvg_set_default_dpi_x_y isn't supported in your librsvg"); #endif return self; } /* Convenience API */ static VALUE rg_s_pixbuf_from_file(G_GNUC_UNUSED VALUE self, VALUE file_name) { VALUE rb_pixbuf; GdkPixbuf *pixbuf; GError *error = NULL; pixbuf = rsvg_pixbuf_from_file(RVAL2CSTR(file_name), &error); if (error) RAISE_GERROR(error); rb_pixbuf = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return rb_pixbuf; } static VALUE rg_s_pixbuf_from_file_at_zoom(G_GNUC_UNUSED VALUE self, VALUE file_name, VALUE x_zoom, VALUE y_zoom) { VALUE rb_pixbuf; GdkPixbuf *pixbuf; GError *error = NULL; pixbuf = rsvg_pixbuf_from_file_at_zoom(RVAL2CSTR(file_name), NUM2DBL(x_zoom), NUM2DBL(y_zoom), &error); if (error) RAISE_GERROR(error); rb_pixbuf = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return rb_pixbuf; } static VALUE rg_s_pixbuf_from_file_at_size(G_GNUC_UNUSED VALUE self, VALUE file_name, VALUE width, VALUE height) { VALUE rb_pixbuf; GdkPixbuf *pixbuf; GError *error = NULL; pixbuf = rsvg_pixbuf_from_file_at_size(RVAL2CSTR(file_name), NUM2INT(width), NUM2INT(height), &error); if (error) RAISE_GERROR(error); rb_pixbuf = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return rb_pixbuf; } static VALUE rg_s_pixbuf_from_file_at_max_size(G_GNUC_UNUSED VALUE self, VALUE file_name, VALUE max_width, VALUE max_height) { VALUE rb_pixbuf; GdkPixbuf *pixbuf; GError *error = NULL; pixbuf = rsvg_pixbuf_from_file_at_max_size(RVAL2CSTR(file_name), NUM2INT(max_width), NUM2INT(max_height), &error); if (error) RAISE_GERROR(error); rb_pixbuf = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return rb_pixbuf; } static VALUE rg_s_pixbuf_from_file_at_zoom_with_max(G_GNUC_UNUSED VALUE self, VALUE file_name, VALUE x_zoom, VALUE y_zoom, VALUE max_width, VALUE max_height) { VALUE rb_pixbuf; GdkPixbuf *pixbuf; GError *error = NULL; pixbuf = rsvg_pixbuf_from_file_at_zoom_with_max(RVAL2CSTR(file_name), NUM2DBL(x_zoom), NUM2DBL(y_zoom), NUM2INT(max_width), NUM2INT(max_height), &error); if (error) RAISE_GERROR(error); rb_pixbuf = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return rb_pixbuf; } static VALUE rg_s_cairo_available_p(G_GNUC_UNUSED VALUE self) { #ifdef HAVE_LIBRSVG_RSVG_CAIRO_H return Qtrue; #else return Qfalse; #endif } void Init_rsvg2(void) { VALUE RG_TARGET_NAMESPACE = rb_define_module("RSVG"); #if LIBRSVG_CHECK_VERSION(2, 9, 0) rsvg_init(); atexit(rsvg_term); #endif G_DEF_ERROR(RSVG_ERROR, "Error", RG_TARGET_NAMESPACE, rb_eRuntimeError, RSVG_TYPE_ERROR); rb_define_const(RG_TARGET_NAMESPACE, "BINDING_VERSION", rb_ary_new3(3, INT2FIX(RBRSVG_MAJOR_VERSION), INT2FIX(RBRSVG_MINOR_VERSION), INT2FIX(RBRSVG_MICRO_VERSION))); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(LIBRSVG_MAJOR_VERSION), INT2FIX(LIBRSVG_MINOR_VERSION), INT2FIX(LIBRSVG_MICRO_VERSION))); RG_DEF_SMETHOD(set_default_dpi, 1); RG_DEF_SMETHOD(set_default_dpi_x_y, 2); /* Convenience API */ RG_DEF_SMETHOD(pixbuf_from_file, 1); RG_DEF_SMETHOD(pixbuf_from_file_at_zoom, 3); RG_DEF_SMETHOD(pixbuf_from_file_at_size, 3); RG_DEF_SMETHOD(pixbuf_from_file_at_max_size, 3); RG_DEF_SMETHOD(pixbuf_from_file_at_zoom_with_max, 5); RG_DEF_SMETHOD_P(cairo_available, 0); Init_rsvg_handle(RG_TARGET_NAMESPACE); Init_rsvg_dimensiondata(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/rsvg2/ext/rsvg2/rbrsvgdimensiondata.c0000664000175000017500000001046411740310343021726 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005-2006 Ruby-GNOME2 Project Team * Copyright (C) 2004 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rsvg2.h" #ifdef HAVE_TYPE_RSVGDIMENSIONDATA #define RG_TARGET_NAMESPACE cDimensionData #define RVAL2DIM(obj) ((RsvgDimensionData *)DATA_PTR(obj)) static VALUE RG_TARGET_NAMESPACE; static ID id_closed; static ID id_to_s; static VALUE to_s(VALUE obj) { return rb_funcall(obj, id_to_s, 0); } static void rb_rsvg_dim_free(RsvgDimensionData *dimp) { if (dimp) { free(dimp); } } static VALUE rb_rsvg_dim_alloc(VALUE klass) { RsvgDimensionData *dimp; return Data_Make_Struct(klass, RsvgDimensionData, 0, rb_rsvg_dim_free, dimp); } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE width, height, em, ex; RsvgDimensionData *dimp; dimp = RVAL2DIM(self); rb_scan_args(argc, argv, "04", &width, &height, &em, &ex); if (!NIL_P(width)) dimp->width = NUM2INT(width); if (!NIL_P(height)) dimp->height = NUM2INT(height); if (!NIL_P(em)) dimp->em = NUM2DBL(em); if (!NIL_P(ex)) dimp->ex = NUM2DBL(ex); return Qnil; } static VALUE rg_width(VALUE self) { return INT2NUM(RVAL2DIM(self)->width); } static VALUE rg_set_width(VALUE self, VALUE width) { RVAL2DIM(self)->width = NUM2INT(width); return Qnil; } static VALUE rg_height(VALUE self) { return INT2NUM(RVAL2DIM(self)->height); } static VALUE rg_set_height(VALUE self, VALUE height) { RVAL2DIM(self)->height = NUM2INT(height); return Qnil; } static VALUE rg_em(VALUE self) { return rb_float_new(RVAL2DIM(self)->em); } static VALUE rg_set_em(VALUE self, VALUE em) { RVAL2DIM(self)->em = NUM2DBL(em); return Qnil; } static VALUE rg_ex(VALUE self) { return rb_float_new(RVAL2DIM(self)->ex); } static VALUE rg_set_ex(VALUE self, VALUE ex) { RVAL2DIM(self)->ex = NUM2DBL(ex); return Qnil; } static VALUE rg_to_a(VALUE self) { return rb_ary_new3(4, rg_width(self), rg_height(self), rg_em(self), rg_ex(self)); } static VALUE rg_to_s(VALUE self) { VALUE ret; ret = rb_str_new2("#<"); rb_str_cat2(ret, rb_obj_classname(self)); rb_str_cat2(ret, ":"); rb_str_concat(ret, rb_funcall(INT2NUM(self), id_to_s, 0)); rb_str_cat2(ret, " "); rb_str_cat2(ret, "width="); rb_str_concat(ret, to_s(rg_width(self))); rb_str_cat2(ret, ", "); rb_str_cat2(ret, "height="); rb_str_concat(ret, to_s(rg_height(self))); rb_str_cat2(ret, ", "); rb_str_cat2(ret, "em="); rb_str_concat(ret, to_s(rg_em(self))); rb_str_cat2(ret, ", "); rb_str_cat2(ret, "ex="); rb_str_concat(ret, to_s(rg_ex(self))); rb_str_cat2(ret, ">"); return ret; } #endif void Init_rsvg_dimensiondata(VALUE mRSVG) { #ifdef HAVE_TYPE_RSVGDIMENSIONDATA id_closed = rb_intern("closed"); id_to_s = rb_intern("to_s"); RG_TARGET_NAMESPACE = rb_define_class_under(mRSVG, "DimensionData", rb_cObject); rb_define_alloc_func(RG_TARGET_NAMESPACE, rb_rsvg_dim_alloc); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(set_width, 1); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(set_height, 1); RG_DEF_METHOD(em, 0); RG_DEF_METHOD(set_em, 1); RG_DEF_METHOD(ex, 0); RG_DEF_METHOD(set_ex, 1); RG_DEF_METHOD(to_s, 0); RG_DEF_METHOD(to_a, 0); RG_DEF_ALIAS("to_ary", "to_a"); #endif } ruby-gnome2-all-2.1.0/rsvg2/README0000644000175000017500000000136511701304107014526 0ustar koukouRuby/RSVG ========= Ruby/RSVG is a Ruby binding of librsvg. Requirements ------------ Ruby: http://www.ruby-lang.org/ librsvg [*]: http://librsvg.sourceforge.net/ Ruby/GLib2: http://ruby-gnome2.sourceforge.net/ Ruby/GdkPixbuf2: http://ruby-gnome2.sourceforge.net/ [*]: 2.8 or later is requried. Install ------- 0. install ruby and librsvg. 1. ruby extconf.rb 2. make 3. su 4. make install Copying ------- Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ ruby-gnome2-all-2.1.0/rsvg2/COPYING.LIB0000644000175000017500000006364212257552170015330 0ustar koukou GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ruby-gnome2-all-2.1.0/rsvg2/lib/0000755000175000017500000000000012137115065014416 5ustar koukouruby-gnome2-all-2.1.0/rsvg2/lib/rsvg2.rb0000644000175000017500000000124212137115065016005 0ustar koukourequire "glib2" require "gdk_pixbuf2" begin require "cairo" rescue LoadError end base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, micro, = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/rsvg2.so" rescue LoadError require "rsvg2.so" end module RSVG LOG_DOMAIN = "librsvg" end if RSVG.cairo_available? module Cairo class Context def render_rsvg_handle(handle, *args, &block) handle.render_cairo(self, *args, &block) end end end end GLib::Log.set_log_domain(RSVG::LOG_DOMAIN) ruby-gnome2-all-2.1.0/rsvg2/sample/0000755000175000017500000000000011701304107015122 5ustar koukouruby-gnome2-all-2.1.0/rsvg2/sample/svg2.rb0000644000175000017500000000263511701304107016336 0ustar koukou#!/usr/bin/env ruby =begin svg2.rb - Ruby/RSVG sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: svg2.rb,v 1.5 2006/06/17 13:30:25 mutoh Exp $ =end require 'tempfile' require "rsvg2" if ARGV.size < 2 puts "usage: #{$0} input.svg output [scale_ratio]" exit(-1) end input, output, ratio = ARGV ratio ||= 1.0 ratio = ratio.to_f output_type = File.extname(output)[1..-1].downcase output_type = "jpeg" if /jpg/ =~ output_type def to_pixbuf_with_cairo(input, ratio) handle = nil Dir.chdir(File.dirname(File.expand_path(input))) do handle = RSVG::Handle.new_from_file(input) end dim = handle.dimensions width = dim.width * ratio height = dim.height * ratio surface = Cairo::ImageSurface.new(Cairo::FORMAT_ARGB32, width, height) cr = Cairo::Context.new(surface) cr.scale(ratio, ratio) cr.render_rsvg_handle(handle) temp = Tempfile.new("svg2") cr.target.write_to_png(temp.path) cr.target.finish Gdk::Pixbuf.new(temp.path) end def to_pixbuf(input, ratio) RSVG.pixbuf_from_file_at_zoom(input, ratio, ratio) end if RSVG.cairo_available? puts "using cairo..." pixbuf = to_pixbuf_with_cairo(input, ratio) else pixbuf = to_pixbuf(input, ratio) end if pixbuf.nil? puts "Is it a SVG file?: #{input}" exit(-1) end puts "saving to #{output}(#{pixbuf.width}x#{pixbuf.height})..." pixbuf.save(output, output_type) ruby-gnome2-all-2.1.0/rsvg2/sample/svg-viewer.rb0000755000175000017500000000155011701304107017551 0ustar koukou#!/usr/bin/env ruby require 'gtk2' require 'rsvg2' unless RSVG.cairo_available? puts "this sample needs RSVG with cairo support" exit(-1) end unless Gdk.cairo_available? puts "this sample needs GDK with cairo support" exit(-1) end if ARGV.size != 1 puts "usage: #{$0} input.svg" exit(-1) end input = ARGV.shift handle = RSVG::Handle.new_from_file(input) width, height = handle.dimensions.to_a window = Gtk::Window.new window.set_default_size(width, height) area = Gtk::DrawingArea.new window.signal_connect("destroy") do Gtk.main_quit end area.signal_connect("expose_event") do |widget, event| context = widget.window.create_cairo_context window_width, window_height = widget.window.size context.scale(window_width.to_f / width, window_height.to_f / height) context.render_rsvg_handle(handle) end window.add(area) window.show_all Gtk.main ruby-gnome2-all-2.1.0/rsvg2/extconf.rb0000644000175000017500000000222411701304107015634 0ustar koukou#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "rsvg2" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ruby-gnome2-all-2.1.0/rsvg2/Rakefile0000644000175000017500000000421212257552170015321 0ustar koukou# -*- ruby -*- # # Copyright (C) 2010-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $LOAD_PATH.unshift("./../glib2/lib") require 'gnome2-raketask' package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/RSVG is a Ruby binding of librsvg-2.x." package.description = "Ruby/RSVG is a Ruby binding of librsvg-2.x." package.dependency.gem.runtime = [["cairo", ">= 1.12.8"], "gdk_pixbuf2"] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = [ "glib2", "gobject-introspection", "pango", "gdk_pixbuf2", ] package.windows.gobject_introspection_dependencies = [ "gdk_pixbuf2", ] package.external_packages = [ { :name => "libcroco", :download_site => :gnome, :label => "libcroco", :version => "0.6.8", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :built_file => "bin/libcroco-0.6-3.dll", }, }, { :name => "librsvg", :download_site => :gnome, :label => "librsvg", :version => "2.40.1", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :patches => [ "librsvg-2.40.1-replace-canonicalize-file-name.diff", ], :built_file => "bin/librsvg-2-2.dll", }, }, ] end package_task.define ruby-gnome2-all-2.1.0/README0000644000175000017500000001150612257552167013503 0ustar koukou# -*- RD -*- = README == Ruby-GNOME2 -- Ruby bindings for GNOME-2.x This is a set of bindings for the GNOME-2.x and GNOME-3.x libraries to use from Ruby 1.9.x and 2.0.0. == Release packages === ruby-gtk2 * Ruby/GLib2: GLib 2.12.x or later * Ruby/ATK: ATK 1.12.x or later * Ruby/Pango: Pango 1.14.x or later * Ruby/GdkPixbuf2: GTK+ 2.0.x or later * Ruby/GTK2: GTK+ 2.10.x or later * Ruby/GObjectIntrospection: GObject Introspection 1.32.1 or later === ruby-gtk3 * ruby-gtk2 - Ruby/GTK2 * Ruby/GDK3: GTK+ 3.4.2 or later * Ruby/GTK3: GTK+ 3.4.2 or later === ruby-gnome2-all * ruby-gtk2 + ruby-gtk3 - duplicated libraries * Ruby/RSVG: librsvg 2.8.0 or later * Ruby/Poppler: poppler-glib 0.8.0 or later * Ruby/VTE VTE 0.12.1 or later * Ruby/GtkSourceView2: GtkSourceView 2.0.0 or later * Ruby/GIO2: GIO 2.16.x or later * Ruby/CairoGObject: cairo-gobject 1.12.10 or later * Ruby/Clutter: Clutter 1.12.0 or later * Ruby/ClutterGTK: Clutter-GTK 1.2.0 or later * Ruby/ClutterGStreamer:Clutter-GStreamer 2.0.0 or later * Ruby/GtkSourceView3: GtkSourceView 3.4.2 or later * Ruby/VTE3: VTE 0.32.2 or later * Ruby/WebKitGTK: WebKitGTK+ 1.8.1 or later (for GTK+ 3) * Ruby/WebKitGTK2: WebKitGTK+ 1.8.1 or later (for GTK+ 2) * Ruby/GStreamer: GStreamer 1.0.0 or later * Ruby/GooCanvas: GooCanvas 0.8.0 or later === Experimental / Incomplete: * ... === Deprecated * Ruby/PanelApplet: gnome-panel 2.6.0 or later (deprecated since 0.16.0) * Ruby/GConf2: GConf 2.0.x or later * Ruby/GNOME2: libgnome-2.0.x, libgnomeui-2.0.x or later * Ruby/GnomeCanvas2: libgnomecanvas-2.0.x or later * Ruby/GnomePrint: libgnomeprint-2.8.x or later * Ruby/GnomePrintUI: libgnomeprintui-2.6.x or later * Ruby/GnomeVFS: GnomeVFS 2.0.x or later * Ruby/GtkHtml2: GtkHtml2 2.0.x or later * Ruby/GtkGLExt: GtkGLExt 1.0.3 or later * Ruby/Libart2: libart_lgpl 2.3.12 or later * Ruby/GtkSourceView: GtkSourceView 1.0.1 or later * Ruby/Libglade2: Libglade 2.0.x or later * Ruby/GtkMozEmbed: GtkMozEmbed (Mozilla 1.7.x or FireFox-1.0.x or later) == Install % ruby extconf.rb % make % sudo make install To compile and install a particular sub-binding, you can add arguments: % ruby extconf.rb [subdir]... e.g.) ruby extconf.rb glib2 pango atk gdk_pixbuf2 gtk2 Or you can compile each sub-binding: % cd % ruby extconf.rb % make % sudo make install === extconf.rb options : --ruby ruby directory : --topsrcdir top source directory : --topdir top directory : --strict if some libraries fail to compile/install, "make" command returns 1(exit 1) === Environment Variables : CAIRO_PATH rcairo path (for Win32). === Dependencies You should install a sub-binding with its dependencies. The current dependencies are: : Ruby/GLib none. : Ruby/ATK depends on Ruby/GLib. : Ruby/Pango depends on Ruby/GLib, rcairo(optional). : Ruby/GdkPixbuf depends on Ruby/GLib. : Ruby/GTK depends on Ruby/GLib, Ruby/ATK, Ruby/Pango, Ruby/GdkPixbuf, rcairo(optional) : Ruby/RSVG depends on Ruby/GLib, Ruby/GdkPixbuf2. : Ruby/Poppler depends on Ruby/GLib, Ruby/GdkPixbuf(optional), rcairo(optional). : Ruby/VTE depends on Ruby/GTK. : Ruby/GtkSourceView2 depends on Ruby/GTK. : Ruby/GIO2 depends on Ruby/GLib. === Experimental : Ruby/GStreamer depends on Ruby/GLib. : Ruby/GooCanvas depends on Ruby/GTK. === Deprecated : Ruby/PanelApplet depends on Ruby/GTK (since libpanel-applet 2.25) or Ruby/GNOME (before libpanel-applet 2.25). : Ruby/Libart depends on Ruby/GLib(Use mkmf-gnome2.rb only). : Ruby/GConf depends on Ruby/GLib. : Ruby/GNOME depends on Ruby/GnomeCanvas. : Ruby/GnomeCanvas depends on Ruby/GTK, Ruby/Libart. : Ruby/GnomeVFS depends on Ruby/GLib. : Ruby/GnomePrint depends on Ruby/GLib, Ruby/Pango, Ruby/Libart2. : Ruby/GnomePrintUI depends on Ruby/GTK, Ruby/GnomePrint. : Ruby/GtkHtml2 depends on Ruby/GTK. : Ruby/GtkGLExt depends on Ruby/GTK, rbogl. : Ruby/GtkSourceView depends on Ruby/GTK. : Ruby/Libglade depends on Ruby/GTK, Ruby/GNOME(optional), REXML(optional). == Bugs Please report bugs either in our bug tracker (()) or on the ruby-gnome2-devel-en / ruby-gnome2-devel-ja mailing list (()) == Copying Copyright (c) 2002-2009 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. == Project Website (()) ruby-gnome2-all-2.1.0/atk/0000755000175000017500000000000012257665516013402 5ustar koukouruby-gnome2-all-2.1.0/atk/ext/0000755000175000017500000000000011701304107014155 5ustar koukouruby-gnome2-all-2.1.0/atk/ext/atk/0000755000175000017500000000000012257552167014756 5ustar koukouruby-gnome2-all-2.1.0/atk/ext/atk/rbatkutil.c0000644000175000017500000000727012257552167017131 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cUtil static ID id_call; /* How can I implement them? guint atk_add_focus_tracker (AtkEventListener focus_tracker); void atk_remove_focus_tracker (guint tracker_id); void atk_focus_tracker_init (AtkEventListenerInit add_function); void (*AtkEventListener) (AtkObject*); void (*AtkEventListenerInit) (void); guint atk_add_global_event_listener (GSignalEmissionHook listener, const gchar *event_type); void atk_remove_global_event_listener (guint listener_id); */ static VALUE rg_s_focus_tracker_notify(VALUE self, VALUE obj) { atk_focus_tracker_notify(RVAL2ATKOBJECT(obj)); return self; } static gint key_snoop_func(AtkKeyEventStruct* event, gpointer func) { VALUE ret = rb_funcall((VALUE)func, id_call, 7, INT2NUM(event->type), UINT2NUM(event->state), UINT2NUM(event->keyval), INT2NUM(event->length), CSTR2RVAL(event->string), UINT2NUM(event->keycode), UINT2NUM(event->timestamp)); return NUM2INT(ret); } static VALUE rg_s_add_key_event_listener(VALUE self) { guint ret; VALUE func = rb_block_proc(); G_RELATIVE(self, func); ret = atk_add_key_event_listener((AtkKeySnoopFunc)key_snoop_func, (gpointer)func); return UINT2NUM(ret); } static VALUE rg_s_remove_key_event_listener(VALUE self, VALUE id) { atk_remove_key_event_listener(NUM2UINT(id)); return self; } static VALUE rg_s_root(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(atk_get_root()); } static VALUE rg_s_focus_object(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(atk_get_focus_object()); } static VALUE rg_s_toolkit_name(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(atk_get_toolkit_name()); } static VALUE rg_s_toolkit_version(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(atk_get_toolkit_version()); } void Init_atk_util(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_UTIL, "Util", mAtk); id_call = rb_intern("call"); RG_DEF_SMETHOD(focus_tracker_notify, 1); RG_DEF_SMETHOD(add_key_event_listener, 0); RG_DEF_SMETHOD(remove_key_event_listener, 1); RG_DEF_SMETHOD(root, 0); RG_DEF_SMETHOD(focus_object, 0); RG_DEF_SMETHOD(toolkit_name, 0); RG_DEF_SMETHOD(toolkit_version, 0); /* AtkCoordType */ G_DEF_CLASS(ATK_TYPE_COORD_TYPE, "CoordType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, ATK_TYPE_COORD_TYPE, "ATK_"); /* AtkKeyEventType */ G_DEF_CLASS(ATK_TYPE_KEY_EVENT_TYPE, "KeyEventType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, ATK_TYPE_KEY_EVENT_TYPE, "ATK_"); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatknoopobject.c0000644000175000017500000000244711701304107020275 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cNoOpObject #define _SELF(s) (RVAL2ATKNOOPOBJECT(s)) static VALUE rg_initialize(VALUE self, VALUE gobj) { G_INITIALIZE(self, atk_no_op_object_new(RVAL2GOBJ(gobj))); return Qnil; } void Init_atk_noopobject(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_NO_OP_OBJECT, "NoOpObject", mAtk); RG_DEF_METHOD(initialize, 1); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkgobjectaccessible.c0000644000175000017500000000273611701304107021567 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cGObjectAccessible #define _SELF(s) (RVAL2ATKGOBJECTACCESSIBLE(s)) static VALUE rg_s_for_object(G_GNUC_UNUSED VALUE self, VALUE obj) { return GOBJ2RVAL(atk_gobject_accessible_for_object(RVAL2GOBJ(obj))); } static VALUE rg_object(VALUE self) { return GOBJ2RVAL(atk_gobject_accessible_get_object(_SELF(self))); } void Init_atk_gobjectaccessible(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_GOBJECT_ACCESSIBLE, "GObjectAccessible", mAtk); RG_DEF_SMETHOD(for_object, 1); RG_DEF_METHOD(object, 0); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkhyperlink.c0000644000175000017500000000363411701304107020137 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cHyperlink #define _SELF(s) (RVAL2ATKHYPERLINK(s)) static VALUE rg_get_uri(VALUE self, VALUE i) { return CSTR2RVAL(atk_hyperlink_get_uri(_SELF(self), NUM2INT(i))); } static VALUE rg_get_object(VALUE self, VALUE i) { return GOBJ2RVAL(atk_hyperlink_get_object(_SELF(self), NUM2INT(i))); } static VALUE rg_valid_p(VALUE self) { return CBOOL2RVAL(atk_hyperlink_is_valid(_SELF(self))); } #ifdef HAVE_ATK_HYPERLINK_IS_INLINE static VALUE rg_inline_p(VALUE self) { return CBOOL2RVAL(atk_hyperlink_is_inline(_SELF(self))); } #endif static VALUE rg_n_anchors(VALUE self) { return INT2NUM(atk_hyperlink_get_n_anchors(_SELF(self))); } void Init_atk_hyperlink(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_HYPERLINK, "Hyperlink", mAtk); RG_DEF_METHOD(get_uri, 1); RG_DEF_METHOD(get_object, 1); RG_DEF_METHOD_P(valid, 0); #ifdef HAVE_ATK_HYPERLINK_IS_INLINE RG_DEF_METHOD_P(inline, 0); #endif RG_DEF_METHOD(n_anchors, 0); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkcomponent.c0000644000175000017500000001214312257552167020151 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mComponent #define _SELF(s) (RVAL2ATKCOMPONENT(s)) /* static void focus_handler(AtkObject *aobj, gboolean bool) { VALUE ret = rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(aobj), CBOOL2RVAL(bool)); } static VALUE rg_add_focus_handler(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); return UINT2NUM(atk_component_add_focus_handler(_SELF(self), focus_handler)); } */ static VALUE rg_contains_p(VALUE self, VALUE x, VALUE y, VALUE coord_type) { return CBOOL2RVAL(atk_component_contains(_SELF(self), NUM2INT(x), NUM2INT(y), RVAL2ATKCOORDTYPE(coord_type))); } static VALUE rg_get_extents(VALUE self, VALUE coord_type) { gint x, y, width, height; atk_component_get_extents(_SELF(self), &x, &y, &width, &height, RVAL2ATKCOORDTYPE(coord_type)); return rb_ary_new3(4, INT2NUM(x), INT2NUM(y), INT2NUM(width), INT2NUM(height)); } #ifdef HAVE_ATK_COMPONENT_GET_LAYER static VALUE rg_layer(VALUE self) { return ATKLAYER2RVAL(atk_component_get_layer(_SELF(self))); } #endif #ifdef HAVE_ATK_COMPONENT_GET_MDI_ZORDER static VALUE rg_mdi_zorder(VALUE self) { return INT2NUM(atk_component_get_mdi_zorder(_SELF(self))); } #endif static VALUE rg_position(VALUE self, VALUE coord_type) { gint x, y; atk_component_get_position(_SELF(self), &x, &y, RVAL2ATKCOORDTYPE(coord_type)); return rb_assoc_new(INT2NUM(x), INT2NUM(y)); } static VALUE rg_size(VALUE self) { gint width, height; atk_component_get_size(_SELF(self), &width, &height); return rb_assoc_new(INT2NUM(width), INT2NUM(height)); } static VALUE rg_grab_focus(VALUE self) { return CBOOL2RVAL(atk_component_grab_focus(_SELF(self))); } static VALUE rg_ref_accessible_at_point(VALUE self, VALUE x, VALUE y, VALUE coord_type) { return GOBJ2RVAL(atk_component_ref_accessible_at_point( _SELF(self), NUM2INT(x), NUM2INT(y), RVAL2ATKCOORDTYPE(coord_type))); } static VALUE rg_remove_focus_handler(VALUE self, VALUE handler_id) { atk_component_remove_focus_handler(_SELF(self), NUM2UINT(handler_id)); return self; } static VALUE rg_set_extents(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height, VALUE coord_type) { gboolean ret = atk_component_set_extents(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height), RVAL2ATKCOORDTYPE(coord_type)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set extents"); return self; } static VALUE rg_set_position(VALUE self, VALUE x, VALUE y, VALUE coord_type) { gboolean ret = atk_component_set_position(_SELF(self), NUM2INT(x), NUM2INT(y), RVAL2ATKCOORDTYPE(coord_type)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set the position"); return self; } static VALUE rg_set_size(VALUE self, VALUE width, VALUE height) { gboolean ret = atk_component_set_size(_SELF(self), NUM2INT(width), NUM2INT(height)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set the size"); return self; } static VALUE rg_alpha(VALUE self) { return rb_float_new(atk_component_get_alpha(_SELF(self))); } void Init_atk_component(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_COMPONENT, "Component", mAtk); /* RG_DEF_METHOD(add_focus_handler, 0); */ RG_DEF_METHOD_P(contains, 3); RG_DEF_METHOD(get_extents, 1); #ifdef HAVE_ATK_COMPONENT_GET_LAYER RG_DEF_METHOD(layer, 0); #endif #ifdef HAVE_ATK_COMPONENT_GET_MDI_ZORDER RG_DEF_METHOD(mdi_zorder, 0); #endif RG_DEF_METHOD(position, 1); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(grab_focus, 0); RG_DEF_METHOD(ref_accessible_at_point, 3); RG_DEF_METHOD(remove_focus_handler, 1); RG_DEF_METHOD(set_extents, 5); RG_DEF_METHOD(set_position, 2); RG_DEF_METHOD(set_size, 2); RG_DEF_METHOD(alpha, 0); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatktext.c0000664000175000017500000002304411740310343017117 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mText #define _SELF(s) (RVAL2ATKTEXT(s)) static VALUE rg_get_text(VALUE self, VALUE start_offset, VALUE end_offset) { VALUE ret; gchar* text = atk_text_get_text(_SELF(self), NUM2INT(start_offset), NUM2INT(end_offset)); ret = CSTR2RVAL(text); g_free(text); return ret; } static VALUE rg_get_character_at_offset(VALUE self, VALUE offset) { gchar buf[10]; gint len = g_unichar_to_utf8(atk_text_get_character_at_offset (_SELF(self), NUM2INT(offset)), buf); buf[len] = '\0'; return rb_str_new2(buf); } static VALUE rg_get_text_after_offset(VALUE self, VALUE offset, VALUE boundary_type) { gchar* ret; VALUE result; gint start_offset, end_offset; ret = atk_text_get_text_after_offset(_SELF(self), NUM2INT(offset), RVAL2ATKTEXTBOUNDARY(boundary_type), &start_offset, &end_offset); result = rb_ary_new3(3, CSTR2RVAL(ret), INT2NUM(start_offset), INT2NUM(end_offset)); g_free(ret); return result; } static VALUE rg_get_text_at_offset(VALUE self, VALUE offset, VALUE boundary_type) { gchar* ret; VALUE result; gint start_offset, end_offset; ret = atk_text_get_text_at_offset(_SELF(self), NUM2INT(offset), RVAL2ATKTEXTBOUNDARY(boundary_type), &start_offset, &end_offset); result = rb_ary_new3(3, CSTR2RVAL(ret), INT2NUM(start_offset), INT2NUM(end_offset)); g_free(ret); return result; } static VALUE rg_get_text_before_offset(VALUE self, VALUE offset, VALUE boundary_type) { gchar* ret; VALUE result; gint start_offset, end_offset; ret = atk_text_get_text_before_offset(_SELF(self), NUM2INT(offset), RVAL2ATKTEXTBOUNDARY(boundary_type), &start_offset, &end_offset); result = rb_ary_new3(3, CSTR2RVAL(ret), INT2NUM(start_offset), INT2NUM(end_offset)); g_free(ret); return result; } static VALUE rg_caret_offset(VALUE self) { return INT2NUM(atk_text_get_caret_offset(_SELF(self))); } static VALUE rg_get_character_extents(VALUE self, VALUE offset, VALUE coords) { gint x, y, width, height; atk_text_get_character_extents(_SELF(self), NUM2INT(offset), &x, &y, &width, &height, RVAL2ATKCOORDTYPE(coords)); return rb_ary_new3(4, INT2NUM(x), INT2NUM(y), INT2NUM(width), INT2NUM(height)); } static VALUE rg_get_run_attributes(VALUE self, VALUE offset) { gint start_offset, end_offset; AtkAttributeSet* list; VALUE ary; list = atk_text_get_run_attributes(_SELF(self), NUM2INT(offset), &start_offset, &end_offset); ary = rb_ary_new(); while (list) { AtkAttribute* data = (AtkAttribute*)list->data; rb_ary_push(ary, rb_assoc_new(CSTR2RVAL(data->name), CSTR2RVAL(data->value))); list = list->next; } atk_attribute_set_free(list); return ary; } static VALUE rg_default_attributes(VALUE self) { AtkAttributeSet* list; VALUE ary; list = atk_text_get_default_attributes(_SELF(self)); ary = rb_ary_new(); while (list) { AtkAttribute* data = (AtkAttribute*)list->data; rb_ary_push(ary, rb_assoc_new(CSTR2RVAL(data->name), CSTR2RVAL(data->value))); list = list->next; } atk_attribute_set_free(list); return ary; } static VALUE rg_character_count(VALUE self) { return INT2NUM(atk_text_get_character_count(_SELF(self))); } static VALUE rg_get_offset_at_point(VALUE self, VALUE x, VALUE y, VALUE coords) { return INT2NUM(atk_text_get_offset_at_point(_SELF(self), NUM2INT(x), NUM2INT(y), RVAL2ATKCOORDTYPE(coords))); } #ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES #ifdef HAVE_ATK_TEXT_CLIP_TYPE_GET_TYPE static VALUE rg_get_bounded_ranges(VALUE self, VALUE rect, VALUE coord_type, VALUE x_clip_type, VALUE y_clip_type) { AtkTextRange** ranges; int i = 0; VALUE ary; ranges = atk_text_get_bounded_ranges(_SELF(self), RVAL2ATKTEXTRECTANGLE(rect), RVAL2ATKCOORDTYPE(coord_type), RVAL2ATKTEXTCLIPTYPE(x_clip_type), RVAL2ATKTEXTCLIPTYPE(y_clip_type)); ary = rb_ary_new(); while(ranges[i]){ rb_ary_push(ary, ATKTEXTRANGE2RVAL(ranges[i])); i++; } #ifdef HAVE_ATK_TEXT_FREE_RANGES atk_text_free_ranges(ranges); #endif return ary; } #endif static VALUE rg_get_range_extents(VALUE self, VALUE start_offset, VALUE end_offset, VALUE coord_type) { AtkTextRectangle rect; atk_text_get_range_extents(_SELF(self), NUM2INT(start_offset), NUM2INT(end_offset), RVAL2ATKCOORDTYPE(coord_type), &rect); return ATKTEXTRECTANGLE2RVAL(&rect); } /* Don't need this void atk_text_free_ranges (AtkTextRange **ranges); */ #endif static VALUE rg_n_selections(VALUE self) { return INT2NUM(atk_text_get_n_selections(_SELF(self))); } static VALUE rg_get_selection(VALUE self, VALUE selection_num) { gint start_offset, end_offset; VALUE ret; gchar* text = atk_text_get_selection(_SELF(self), NUM2INT(selection_num), &start_offset, &end_offset); ret = CSTR2RVAL(text); g_free(text); return ret; } static VALUE rg_add_selection(VALUE self, VALUE start_offset, VALUE end_offset) { gboolean ret = atk_text_add_selection(_SELF(self), NUM2INT(start_offset), NUM2INT(end_offset)); if (! ret) rb_raise(rb_eRuntimeError, "Can't add selection"); return self; } static VALUE rg_remove_selection(VALUE self, VALUE selection_num) { gint num; gboolean ret; num = NUM2INT(selection_num); ret = atk_text_remove_selection(_SELF(self), num); if (! ret) rb_raise(rb_eRuntimeError, "Can't remove selection. num = %d", num); return self; } static VALUE rg_set_selection(VALUE self, VALUE selection_num, VALUE start_offset, VALUE end_offset) { gboolean ret = atk_text_set_selection(_SELF(self), NUM2INT(selection_num), NUM2INT(start_offset), NUM2INT(end_offset)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set selection"); return self; } static VALUE rg_set_caret_offset(VALUE self, VALUE offset) { gboolean ret = atk_text_set_caret_offset(_SELF(self), NUM2INT(offset)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set caret offset"); return self; } /* We don't need them. void atk_attribute_set_free (AtkAttributeSet *attrib_set); */ void Init_atk_text(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_TEXT, "Text", mAtk); RG_DEF_METHOD(get_text, 2); RG_DEF_METHOD(get_character_at_offset, 1); RG_DEF_METHOD(get_text_after_offset, 2); RG_DEF_METHOD(get_text_at_offset, 2); RG_DEF_METHOD(get_text_before_offset, 2); RG_DEF_METHOD(caret_offset, 0); RG_DEF_METHOD(get_character_extents, 2); RG_DEF_METHOD(get_run_attributes, 1); RG_DEF_METHOD(default_attributes, 0); RG_DEF_METHOD(character_count, 0); RG_DEF_METHOD(get_offset_at_point, 3); #ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES #ifdef HAVE_ATK_TEXT_CLIP_TYPE_GET_TYPE RG_DEF_METHOD(get_bounded_ranges, 4); RG_DEF_METHOD(get_range_extents, 3); #endif #endif RG_DEF_METHOD(n_selections, 0); RG_DEF_METHOD(get_selection, 1); RG_DEF_METHOD(add_selection, 2); RG_DEF_METHOD(remove_selection, 1); RG_DEF_METHOD(set_selection, 3); RG_DEF_METHOD(set_caret_offset, 1); /* AtkTextBoundary */ #ifdef ATK_TYPE_TEXT_BOUNDARY G_DEF_CLASS(ATK_TYPE_TEXT_BOUNDARY, "Boundary", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, ATK_TYPE_TEXT_BOUNDARY, "ATK_TEXT_"); #endif /* AtkTextClipType */ #ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES #ifdef HAVE_ATK_TEXT_CLIP_TYPE_GET_TYPE G_DEF_CLASS(ATK_TYPE_TEXT_CLIP_TYPE, "ClipType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, ATK_TYPE_TEXT_CLIP_TYPE, "ATK_TEXT_"); #endif #endif Init_atk_text_attribute(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkstateset.c0000644000175000017500000001054411701304107017764 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cStateSet #define _SELF(s) (RVAL2ATKSTATESET(s)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, atk_state_set_new()); return Qnil; } static VALUE rg_empty_p(VALUE self) { return CBOOL2RVAL(atk_state_set_is_empty(_SELF(self))); } static VALUE rg_add_state(VALUE self, VALUE type) { return CBOOL2RVAL(atk_state_set_add_state(_SELF(self), RVAL2ATKSTATETYPE(type))); } struct rval2atkstatetype_args { VALUE ary; long n; AtkStateType *result; }; static VALUE rval2atkstatetype_body(VALUE value) { long i; struct rval2atkstatetype_args *args = (struct rval2atkstatetype_args *)value; for (i = 0; i < args->n; i++) args->result[i] = RVAL2ATKSTATETYPE(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rval2atkstatetype_rescue(VALUE value) { g_free(((struct rval2atkstatetype_args *)value)->result); rb_exc_raise(rb_errinfo()); } static AtkStateType * rval2atkstatetype(VALUE value, long *n) { struct rval2atkstatetype_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(AtkStateType, args.n + 1); rb_rescue(rval2atkstatetype_body, (VALUE)&args, rval2atkstatetype_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } #define RVAL2ATKSTATETYPES(value, n) rval2atkstatetype(value, n) static VALUE rg_add_states(VALUE self, VALUE rbtypes) { AtkStateSet *set = _SELF(self); long n; AtkStateType *types = RVAL2ATKSTATETYPES(rbtypes, &n); atk_state_set_add_states(set, types, n); g_free(types); return self; } static VALUE rg_clear_states(VALUE self) { atk_state_set_clear_states(_SELF(self)); return self; } static VALUE rg_contains_state(VALUE self, VALUE type) { return CBOOL2RVAL(atk_state_set_contains_state(_SELF(self), RVAL2ATKSTATETYPE(type))); } static VALUE rg_contains_states(VALUE self, VALUE rbtypes) { AtkStateSet *set = _SELF(self); long n; AtkStateType *types = RVAL2ATKSTATETYPES(rbtypes, &n); gboolean result; result = atk_state_set_contains_states(set, types, n); g_free(types); return CBOOL2RVAL(result); } static VALUE rg_remove_state(VALUE self, VALUE type) { return CBOOL2RVAL(atk_state_set_remove_state(_SELF(self), RVAL2ATKSTATETYPE(type))); } static VALUE rg_and(VALUE self, VALUE compare_set) { return GOBJ2RVAL(atk_state_set_and_sets(_SELF(self), _SELF(compare_set))); } static VALUE rg_or(VALUE self, VALUE compare_set) { return GOBJ2RVAL(atk_state_set_or_sets(_SELF(self), _SELF(compare_set))); } static VALUE rg_xor(VALUE self, VALUE compare_set) { return GOBJ2RVAL(atk_state_set_xor_sets(_SELF(self), _SELF(compare_set))); } void Init_atk_state_set(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_STATE_SET, "StateSet", mAtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD_P(empty, 0); RG_DEF_METHOD(add_state, 1); RG_DEF_METHOD(add_states, 1); RG_DEF_METHOD(clear_states, 0); RG_DEF_METHOD(contains_state, 1); RG_DEF_METHOD(contains_states, 1); RG_DEF_METHOD(remove_state, 1); RG_DEF_METHOD(and, 1); RG_DEF_ALIAS("&", "and"); RG_DEF_METHOD(or, 1); RG_DEF_ALIAS("|", "or"); RG_DEF_METHOD(xor, 1); RG_DEF_ALIAS("^", "xor"); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkregistry.c0000644000175000017500000000372111701304107017777 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cRegistry #define _SELF(s) (RVAL2ATKREGISTRY(s)) static VALUE rg_set_factory_type(VALUE self, VALUE type, VALUE factory_type) { atk_registry_set_factory_type(_SELF(self), CLASS2GTYPE(type), CLASS2GTYPE(factory_type)); return self; } static VALUE rg_get_factory_type(VALUE self, VALUE type) { return GTYPE2CLASS(atk_registry_get_factory_type(_SELF(self), CLASS2GTYPE(type))); } static VALUE rg_get_factory(VALUE self, VALUE type) { return GOBJ2RVAL(atk_registry_get_factory(_SELF(self), CLASS2GTYPE(type))); } static VALUE rg_s_default_registry(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(atk_get_default_registry()); } void Init_atk_registry(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_REGISTRY, "Registry", mAtk); RG_DEF_METHOD(set_factory_type, 2); RG_DEF_METHOD(get_factory_type, 1); RG_DEF_METHOD(get_factory, 1); RG_DEF_SMETHOD(default_registry, 0); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkconversions.h0000644000175000017500000001033511701304107020503 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBATKCONVERSIONS_H__ #define __RBATKCONVERSIONS_H__ #define RVAL2ATKACTION(o) (ATK_ACTION(RVAL2GOBJ(o))) #define RVAL2ATKCOMPONENT(o) (ATK_COMPONENT(RVAL2GOBJ(o))) #define RVAL2ATKDOCUMENT(o) (ATK_DOCUMENT(RVAL2GOBJ(o))) #define RVAL2ATKEDITABLETEXT(o) (ATK_EDITABLE_TEXT(RVAL2GOBJ(o))) #define RVAL2ATKGOBJECTACCESSIBLE(o) (ATK_GOBJECT_ACCESSIBLE(RVAL2GOBJ(o))) #define RVAL2ATKHYPERLINK(o) (ATK_HYPERLINK(RVAL2GOBJ(o))) #define RVAL2ATKHYPERTEXT(o) (ATK_HYPERTEXT(RVAL2GOBJ(o))) #define RVAL2ATKIMAGE(o) (ATK_IMAGE(RVAL2GOBJ(o))) #define RVAL2ATKIMPLEMENTOR(o) (ATK_IMPLEMENTOR(RVAL2GOBJ(o))) #define RVAL2ATKNOOPOBJECT(o) (ATK_NOOPOBJECT(RVAL2GOBJ(o))) #define RVAL2ATKNOOPOBJECTFACTORY(o) (ATK_NO_OP_OBJECT_FACTORY(RVAL2GOBJ(o))) #define RVAL2ATKOBJECT(o) (ATK_OBJECT(RVAL2GOBJ(o))) #define RVAL2ATKOBJECTFACTORY(o) (ATK_OBJECT_FACTORY(RVAL2GOBJ(o))) #define RVAL2ATKREGISTRY(o) (ATK_REGISTRY(RVAL2GOBJ(o))) #define RVAL2ATKRELATION(o) (ATK_RELATION(RVAL2GOBJ(o))) #define RVAL2ATKRELATIONSET(o) (ATK_RELATION_SET(RVAL2GOBJ(o))) #define RVAL2ATKSELECTION(o) (ATK_SELECTION(RVAL2GOBJ(o))) #define RVAL2ATKSTATE(o) (ATK_STATE(RVAL2GOBJ(o))) #define RVAL2ATKSTATESET(o) (ATK_STATE_SET(RVAL2GOBJ(o))) #define RVAL2ATKSTREAMABLECONTENT(o) (ATK_STREAMABLE_CONTENT(RVAL2GOBJ(o))) #define RVAL2ATKTABLE(o) (ATK_TABLE(RVAL2GOBJ(o))) #define RVAL2ATKTEXT(o) (ATK_TEXT(RVAL2GOBJ(o))) #define RVAL2ATKVALUE(o) (ATK_VALUE(RVAL2GOBJ(o))) #define RVAL2ATKTEXTRANGE(o) ((AtkTextRange*)RVAL2BOXED(o, ATK_TYPE_TEXT_RANGE)) #define ATKTEXTRANGE2RVAL(o) (BOXED2RVAL(o, ATK_TYPE_TEXT_RANGE)) #define RVAL2ATKTEXTRECTANGLE(o) ((AtkTextRectangle*)RVAL2BOXED(o, ATK_TYPE_TEXT_RECTANGLE)) #define ATKTEXTRECTANGLE2RVAL(o) (BOXED2RVAL(o, ATK_TYPE_TEXT_RECTANGLE)) #define RVAL2ATKCOORDTYPE(o) (RVAL2GENUM(o, ATK_TYPE_COORD_TYPE)) #define ATKCOORDTYPE2RVAL(o) (GENUM2RVAL(o, ATK_TYPE_COORD_TYPE)) #define RVAL2ATKLAYER(o) (RVAL2GENUM(o, ATK_TYPE_LAYER)) #define ATKLAYER2RVAL(o) (GENUM2RVAL(o, ATK_TYPE_LAYER)) #define RVAL2ATKRELATIONTYPE(o) (RVAL2GENUM(o, ATK_TYPE_RELATION_TYPE)) #define ATKRELATIONTYPE2RVAL(o) (GENUM2RVAL(o, ATK_TYPE_RELATION_TYPE)) #define RVAL2ATKROLE(o) (RVAL2GENUM(o, ATK_TYPE_ROLE)) #define ATKROLE2RVAL(o) (GENUM2RVAL(o, ATK_TYPE_ROLE)) #define RVAL2ATKSTATETYPE(o) (RVAL2GENUM(o, ATK_TYPE_STATE_TYPE)) #define ATKSTATETYPE2RVAL(o) (GENUM2RVAL(o, ATK_TYPE_STATE_TYPE)) #define RVAL2ATKTEXTATTRIBUTE(o) (RVAL2GENUM(o, ATK_TYPE_TEXT_ATTRIBUTE)) #define ATKTEXTATTRIBUTE2RVAL(o) (GENUM2RVAL(o, ATK_TYPE_TEXT_ATTRIBUTE)) #define RVAL2ATKTEXTBOUNDARY(o) (RVAL2GENUM(o, ATK_TYPE_TEXT_BOUNDARY)) #define ATKTEXTBOUNDARY2RVAL(o) (GENUM2RVAL(o, ATK_TYPE_TEXT_BOUNDARY)) #define RVAL2ATKTEXTCLIPTYPE(o) (RVAL2GENUM(o, ATK_TYPE_TEXT_CLIP_TYPE)) #define ATKTEXTCLIPTYPE2RVAL(o) (GENUM2RVAL(o, ATK_TYPE_TEXT_CLIP_TYPE)) #endif /* __RBATKCONVERSIONS_H__ */ ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkimage.c0000664000175000017500000000414011740310343017211 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mImage #define _SELF(s) (RVAL2ATKIMAGE(s)) static VALUE rg_image_position(VALUE self, VALUE coord_type) { gint x, y; atk_image_get_image_position(_SELF(self), &x, &y, RVAL2ATKCOORDTYPE(coord_type)); return rb_assoc_new(INT2NUM(x), INT2NUM(y)); } static VALUE rg_image_description(VALUE self) { return CSTR2RVAL(atk_image_get_image_description(_SELF(self))); } static VALUE rg_set_image_description(VALUE self, VALUE description) { gboolean ret = atk_image_set_image_description(_SELF(self), RVAL2CSTR(description)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set image description"); return self; } static VALUE rg_image_size(VALUE self) { gint width, height; atk_image_get_image_size(_SELF(self), &width, &height); return rb_assoc_new(INT2NUM(width), INT2NUM(height)); } void Init_atk_image(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_IMAGE, "Image", mAtk); RG_DEF_METHOD(image_position, 1); RG_DEF_METHOD(image_description, 0); RG_DEF_METHOD(set_image_description, 1); RG_DEF_METHOD(image_size, 0); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkdocument.c0000644000175000017500000000535712257552167017776 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mDocument #define _SELF(s) (RVAL2ATKDOCUMENT(s)) static VALUE rg_document_type(VALUE self) { return CSTR2RVAL(atk_document_get_document_type(_SELF(self))); } /* How can I implement this? static VALUE rg_document(VALUE self) { return GOBJ2RVAL(atk_document_get_document(_SELF(self))); } */ static VALUE rg_get_attribute_value(VALUE self, VALUE name) { return CSTR2RVAL(atk_document_get_attribute_value(_SELF(self), RVAL2CSTR(name))); } static VALUE rg_set_attribute_value(VALUE self, VALUE name, VALUE value) { gboolean ret = atk_document_set_attribute_value(_SELF(self), RVAL2CSTR(name), RVAL2CSTR(value)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set attribute value: %s, %s", RVAL2CSTR(name), RVAL2CSTR(value)); return self; } static VALUE rg_attributes(VALUE self) { AtkAttributeSet* list = atk_document_get_attributes(_SELF(self)); VALUE ary = rb_ary_new(); while (list) { AtkAttribute* attr = list->data; rb_ary_push(ary, rb_assoc_new(CSTR2RVAL(attr->name), CSTR2RVAL(attr->value))); list = list->next; } return ary; } static VALUE rg_locale(VALUE self) { return CSTR2RVAL(atk_document_get_locale(_SELF(self))); } void Init_atk_document(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_DOCUMENT, "Document", mAtk); RG_DEF_METHOD(document_type, 0); /* RG_DEF_METHOD(document, 0); */ RG_DEF_METHOD(get_attribute_value, 1); RG_DEF_ALIAS("[]", "get_attribute_value"); RG_DEF_METHOD(set_attribute_value, 2); RG_DEF_ALIAS("[]=", "set_attribute_value"); RG_DEF_METHOD(attributes, 0); RG_DEF_METHOD(locale, 0); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkrelationset.c0000644000175000017500000000533612257552167020506 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cRelationSet #define _SELF(s) (RVAL2ATKRELATIONSET(s)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, atk_relation_set_new()); return Qnil; } static VALUE rg_contains_p(VALUE self, VALUE relationship) { return CBOOL2RVAL(atk_relation_set_contains( _SELF(self), RVAL2ATKRELATIONTYPE(relationship))); } static VALUE rg_remove(VALUE self, VALUE relation) { atk_relation_set_remove(_SELF(self), RVAL2ATKRELATION(relation)); return self; } static VALUE rg_add(VALUE self, VALUE relation) { atk_relation_set_add(_SELF(self), RVAL2ATKRELATION(relation)); return self; } static VALUE rg_n_relations(VALUE self) { return INT2NUM(atk_relation_set_get_n_relations(_SELF(self))); } static VALUE rg_get_relation(VALUE self, VALUE i) { if (rb_obj_is_kind_of(i, GTYPE2CLASS(ATK_TYPE_RELATION_TYPE))){ return GOBJ2RVAL(atk_relation_set_get_relation_by_type( _SELF(self), RVAL2ATKRELATIONTYPE(i))); } else { return GOBJ2RVAL(atk_relation_set_get_relation(_SELF(self), NUM2INT(i))); } } static VALUE rg_add_relation(VALUE self, VALUE relationship, VALUE obj) { atk_relation_set_add_relation_by_type(_SELF(self), RVAL2ATKRELATIONTYPE(relationship), RVAL2ATKOBJECT(obj)); return self; } void Init_atk_relation_set(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_RELATION_SET, "RelationSet", mAtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD_P(contains, 1); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(add, 1); RG_DEF_METHOD(n_relations, 0); RG_DEF_METHOD(get_relation, 1); RG_DEF_METHOD(add_relation, 2); } ruby-gnome2-all-2.1.0/atk/ext/atk/atk.def0000644000175000017500000000002211701304107016165 0ustar koukouEXPORTS Init_atk ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkobjectfactory.c0000644000175000017500000000317611701304107020771 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cObjectFactory #define _SELF(s) (RVAL2ATKOBJECTFACTORY(s)) static VALUE rg_create_accessible(VALUE self, VALUE obj) { return GOBJ2RVAL(atk_object_factory_create_accessible(_SELF(self), RVAL2GOBJ(obj))); } static VALUE rg_accessible_type(VALUE self) { return GTYPE2CLASS(atk_object_factory_get_accessible_type(_SELF(self))); } static VALUE rg_invalidate(VALUE self) { atk_object_factory_invalidate(_SELF(self)); return self; } void Init_atk_objectfactory(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_OBJECT_FACTORY, "ObjectFactory", mAtk); RG_DEF_METHOD(create_accessible, 0); RG_DEF_METHOD(accessible_type, 0); RG_DEF_METHOD(invalidate, 0); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatk.c0000644000175000017500000000476311701304107016215 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mAtk VALUE mAtk; extern void Init_atk(void); void Init_atk(void) { RG_TARGET_NAMESPACE = rb_define_module("Atk"); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(ATK_MAJOR_VERSION), INT2FIX(ATK_MINOR_VERSION), INT2FIX(ATK_MICRO_VERSION))); Init_atk_action(RG_TARGET_NAMESPACE); Init_atk_component(RG_TARGET_NAMESPACE); Init_atk_document(RG_TARGET_NAMESPACE); Init_atk_editabletext(RG_TARGET_NAMESPACE); Init_atk_gobjectaccessible(RG_TARGET_NAMESPACE); Init_atk_hyperlink(RG_TARGET_NAMESPACE); Init_atk_hypertext(RG_TARGET_NAMESPACE); Init_atk_image(RG_TARGET_NAMESPACE); Init_atk_implementor(RG_TARGET_NAMESPACE); Init_atk_noopobject(RG_TARGET_NAMESPACE); Init_atk_noopobjectfactory(RG_TARGET_NAMESPACE); Init_atk_object(RG_TARGET_NAMESPACE); Init_atk_objectfactory(RG_TARGET_NAMESPACE); Init_atk_registry(RG_TARGET_NAMESPACE); Init_atk_relation(RG_TARGET_NAMESPACE); Init_atk_relation_set(RG_TARGET_NAMESPACE); Init_atk_selection(RG_TARGET_NAMESPACE); Init_atk_state(RG_TARGET_NAMESPACE); Init_atk_state_set(RG_TARGET_NAMESPACE); Init_atk_streamable_content(RG_TARGET_NAMESPACE); Init_atk_table(RG_TARGET_NAMESPACE); Init_atk_text(RG_TARGET_NAMESPACE); Init_atk_text_range(RG_TARGET_NAMESPACE); Init_atk_text_rectangle(RG_TARGET_NAMESPACE); Init_atk_util(RG_TARGET_NAMESPACE); Init_atk_value(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkstreamablecontent.c0000644000175000017500000000342211701304107021637 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mStreamableContent #define _SELF(s) (RVAL2ATKSTREAMABLECONTENT(s)) static VALUE rg_n_mime_types(VALUE self) { return INT2NUM(atk_streamable_content_get_n_mime_types(_SELF(self))); } static VALUE rg_mime_type(VALUE self, VALUE i) { return CSTR2RVAL(atk_streamable_content_get_mime_type(_SELF(self), NUM2INT(i))); } static VALUE rg_get_stream(VALUE self, VALUE mime_type) { GIOChannel* io = atk_streamable_content_get_stream(_SELF(self), RVAL2CSTR(mime_type)); if (!io) rb_raise(rb_eRuntimeError, "Couldn't get the stream."); return GIOCHANNEL2RVAL(io); } void Init_atk_streamable_content(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_STREAMABLE_CONTENT, "StreamableContent", mAtk); RG_DEF_METHOD(n_mime_types, 0); RG_DEF_METHOD(mime_type, 1); RG_DEF_METHOD(get_stream, 1); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkimplementor.c0000644000175000017500000000243411701304107020462 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mImplementor #define _SELF(s) (RVAL2ATKIMPLEMENTOR(s)) static VALUE rg_ref_accessible(VALUE self) { return GOBJ2RVAL(atk_implementor_ref_accessible(_SELF(self))); } void Init_atk_implementor(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_IMPLEMENTOR, "Implementor", mAtk); RG_DEF_METHOD(ref_accessible, 0); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkvalue.c0000664000175000017500000000376511740310343017257 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mValue #define _SELF(s) (RVAL2ATKVALUE(s)) static VALUE rg_current(VALUE self) { GValue gval = G_VALUE_INIT; atk_value_get_current_value(_SELF(self), &gval); return GVAL2RVAL(&gval); } static VALUE rg_max(VALUE self) { GValue gval = G_VALUE_INIT; atk_value_get_maximum_value(_SELF(self), &gval); return GVAL2RVAL(&gval); } static VALUE rg_min(VALUE self) { GValue gval = G_VALUE_INIT; atk_value_get_minimum_value(_SELF(self), &gval); return GVAL2RVAL(&gval); } static VALUE rg_set_current(VALUE self, VALUE value) { GValue gval = G_VALUE_INIT; g_value_init(&gval, RVAL2GTYPE(value)); rbgobj_rvalue_to_gvalue(value, &gval); if (! atk_value_set_current_value(_SELF(self), &gval)){ rb_raise(rb_eRuntimeError, "Can't set the current value."); } return self; } void Init_atk_value(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_VALUE, "Value", mAtk); RG_DEF_METHOD(current, 0); RG_DEF_METHOD(max, 0); RG_DEF_METHOD(min, 0); RG_DEF_METHOD(set_current, 1); } ruby-gnome2-all-2.1.0/atk/ext/atk/extconf.rb0000644000175000017500000000455212257552167016757 0ustar koukou=begin extconf.rb for Ruby/Atk extention library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "atk" package_id = "atk" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end ruby_header = 'ruby.h' have_func 'rb_errinfo', ruby_header ["glib2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end setup_win32(module_name, base_dir) unless required_pkg_config_package([package_id, 1, 12, 0], :debian => "libatk1.0-dev", :redhat => "atk-devel", :homebrew => "atk", :macports => "atk") exit(false) end atk_header = "atk/atk.h" have_func('atk_action_get_localized_name', atk_header) have_func('atk_hyperlink_is_inline', atk_header) have_func('atk_object_add_relationship', atk_header) have_func('atk_object_remove_relationship', atk_header) have_func('atk_component_get_layer', atk_header) have_func('atk_component_get_mdi_zorder', atk_header) have_func('atk_hyperlink_is_selected_link', atk_header) have_func('atk_text_get_bounded_ranges', atk_header) have_func('atk_role_get_localized_name', atk_header) have_func('atk_text_clip_type_get_type', atk_header) have_func('atk_text_free_ranges', atk_header) make_version_header("ATK", package_id, ".") create_pkg_config_file("Ruby/ATK", package_id) $defs << " -DRUBY_ATK_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkrelation.c0000644000175000017500000000520312257552167017763 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cRelation #define _SELF(s) (RVAL2ATKRELATION(s)) static VALUE rg_s_type_register(G_GNUC_UNUSED VALUE self, VALUE name) { return ATKRELATIONTYPE2RVAL(atk_relation_type_register(RVAL2CSTR(name))); } struct rval2atkobjects_args { VALUE ary; long n; AtkObject **result; }; static VALUE rval2atkobjects_body(VALUE value) { long i; struct rval2atkobjects_args *args = (struct rval2atkobjects_args *)value; for (i = 0; i < args->n; i++) args->result[i] = RVAL2ATKOBJECT(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rval2atkobjects_rescue(VALUE value) { g_free(((struct rval2atkobjects_args *)value)->result); rb_exc_raise(rb_errinfo()); } static VALUE rg_initialize(VALUE self, VALUE targets, VALUE rbrelationship) { AtkRelationType relationship = RVAL2ATKRELATIONTYPE(rbrelationship); struct rval2atkobjects_args args; AtkRelation *relation; args.ary = rb_ary_to_ary(targets); args.n = RARRAY_LEN(args.ary); args.result = g_new(AtkObject *, args.n + 1); rb_rescue(rval2atkobjects_body, (VALUE)&args, rval2atkobjects_rescue, (VALUE)&args); relation = atk_relation_new(args.result, args.n, relationship); g_free(args.result); G_INITIALIZE(self, relation); return Qnil; } static VALUE rg_add_target(VALUE self, VALUE obj) { atk_relation_add_target(_SELF(self), RVAL2ATKOBJECT(obj)); return self; } void Init_atk_relation(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_RELATION, "Relation", mAtk); RG_DEF_SMETHOD(type_register, 1); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(add_target, 1); Init_atk_relation_type(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkaction.c0000644000175000017500000000453311701304107017406 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mAction #define _SELF(s) (RVAL2ATKACTION(s)) static VALUE rg_do_action(VALUE self, VALUE i) { return CBOOL2RVAL(atk_action_do_action(_SELF(self), NUM2INT(i))); } static VALUE rg_n_actions(VALUE self) { return INT2NUM(atk_action_get_n_actions(_SELF(self))); } static VALUE rg_get_description(VALUE self, VALUE i) { return CSTR2RVAL(atk_action_get_description(_SELF(self), NUM2INT(i))); } static VALUE rg_get_name(VALUE self, VALUE i) { return CSTR2RVAL(atk_action_get_name(_SELF(self), NUM2INT(i))); } #ifdef HAVE_ATK_ACTION_GET_LOCALIZED_NAME static VALUE rg_get_localized_name(VALUE self, VALUE i) { return CSTR2RVAL(atk_action_get_localized_name(_SELF(self), NUM2INT(i))); } #endif static VALUE rg_get_keybinding(VALUE self, VALUE i) { return CSTR2RVAL(atk_action_get_keybinding(_SELF(self), NUM2INT(i))); } static VALUE rg_set_description(VALUE self, VALUE i, VALUE desc) { return CBOOL2RVAL(atk_action_set_description(_SELF(self), NUM2INT(i), RVAL2CSTR(desc))); } void Init_atk_action(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_ACTION, "Action", mAtk); RG_DEF_METHOD(do_action, 1); RG_DEF_METHOD(n_actions, 0); RG_DEF_METHOD(get_description, 1); RG_DEF_METHOD(get_name, 1); #ifdef HAVE_ATK_ACTION_GET_LOCALIZED_NAME RG_DEF_METHOD(get_localized_name, 1); #endif RG_DEF_METHOD(get_keybinding, 1); RG_DEF_METHOD(set_description, 2); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatktable.c0000664000175000017500000001624411740310343017226 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mTable #define _SELF(s) (RVAL2ATKTABLE(s)) static VALUE rg_ref_at(VALUE self, VALUE row, VALUE column) { return GOBJ2RVAL(atk_table_ref_at(_SELF(self), NUM2INT(row), NUM2INT(column))); } static VALUE rg_get_index_at(VALUE self, VALUE row, VALUE column) { return INT2NUM(atk_table_get_index_at(_SELF(self), NUM2INT(row), NUM2INT(column))); } static VALUE rg_get_column_at_index(VALUE self, VALUE index_) { return INT2NUM(atk_table_get_column_at_index(_SELF(self), NUM2INT(index_))); } static VALUE rg_get_row_at_index(VALUE self, VALUE index_) { return INT2NUM(atk_table_get_row_at_index(_SELF(self), NUM2INT(index_))); } static VALUE rg_n_columns(VALUE self) { return INT2NUM(atk_table_get_n_columns(_SELF(self))); } static VALUE rg_n_rows(VALUE self) { return INT2NUM(atk_table_get_n_rows(_SELF(self))); } static VALUE rg_get_column_extent_at(VALUE self, VALUE row, VALUE column) { return INT2NUM(atk_table_get_column_extent_at(_SELF(self), NUM2INT(row), NUM2INT(column))); } static VALUE rg_get_row_extent_at(VALUE self, VALUE row, VALUE column) { return INT2NUM(atk_table_get_row_extent_at(_SELF(self), NUM2INT(row), NUM2INT(column))); } static VALUE rg_caption(VALUE self) { return GOBJ2RVAL(atk_table_get_caption(_SELF(self))); } static VALUE rg_get_column_description(VALUE self, VALUE column) { return CSTR2RVAL(atk_table_get_column_description(_SELF(self), NUM2INT(column))); } static VALUE rg_get_row_description(VALUE self, VALUE row) { return CSTR2RVAL(atk_table_get_row_description(_SELF(self), NUM2INT(row))); } static VALUE rg_get_column_header(VALUE self, VALUE column) { return GOBJ2RVAL(atk_table_get_column_header(_SELF(self), NUM2INT(column))); } static VALUE rg_get_row_header(VALUE self, VALUE row) { return GOBJ2RVAL(atk_table_get_row_header(_SELF(self), NUM2INT(row))); } static VALUE rg_summary(VALUE self) { return GOBJ2RVAL(atk_table_get_summary(_SELF(self))); } static VALUE rg_set_caption(VALUE self, VALUE caption) { atk_table_set_caption(_SELF(self), RVAL2ATKOBJECT(caption)); return self; } static VALUE rg_set_row_description(VALUE self, VALUE row, VALUE description) { atk_table_set_row_description(_SELF(self), NUM2INT(row), RVAL2CSTR(description)); return self; } static VALUE rg_set_column_description(VALUE self, VALUE column, VALUE description) { atk_table_set_column_description(_SELF(self), NUM2INT(column), RVAL2CSTR(description)); return self; } static VALUE rg_set_row_header(VALUE self, VALUE row, VALUE header) { atk_table_set_row_header(_SELF(self), NUM2INT(row), RVAL2ATKOBJECT(header)); return self; } static VALUE rg_set_column_header(VALUE self, VALUE column, VALUE header) { atk_table_set_column_header(_SELF(self), NUM2INT(column), RVAL2ATKOBJECT(header)); return self; } static VALUE rg_set_summary(VALUE self, VALUE accessible) { atk_table_set_summary(_SELF(self), RVAL2ATKOBJECT(accessible)); return self; } static VALUE rg_selected_columns(VALUE self) { gint ret; gint* selected; VALUE result = Qnil; ret = atk_table_get_selected_columns(_SELF(self), &selected); if (ret > 0){ gint i; result = rb_ary_new2(ret); for (i = 0; i < ret; i++){ rb_ary_push(result, INT2NUM(selected[i])); } } return result; } static VALUE rg_selected_rows(VALUE self) { gint ret; gint* selected; VALUE result = Qnil; ret = atk_table_get_selected_rows(_SELF(self), &selected); if (ret > 0){ gint i; result = rb_ary_new2(ret); for (i = 0; i < ret; i++){ rb_ary_push(result, INT2NUM(selected[i])); } } return result; } static VALUE rg_column_selected_p(VALUE self, VALUE column) { return CBOOL2RVAL(atk_table_is_column_selected(_SELF(self), NUM2INT(column))); } static VALUE rg_row_selected_p(VALUE self, VALUE row) { return CBOOL2RVAL(atk_table_is_row_selected(_SELF(self), NUM2INT(row))); } static VALUE rg_selected_p(VALUE self, VALUE row, VALUE column) { return CBOOL2RVAL(atk_table_is_selected(_SELF(self), NUM2INT(row), NUM2INT(column))); } static VALUE rg_add_column_selection(VALUE self, VALUE column) { gboolean ret = atk_table_add_column_selection(_SELF(self), NUM2INT(column)); if (! ret) rb_raise(rb_eRuntimeError, "not implement this interface"); return self; } static VALUE rg_add_row_selection(VALUE self, VALUE row) { gboolean ret = atk_table_add_row_selection(_SELF(self), NUM2INT(row)); if (! ret) rb_raise(rb_eRuntimeError, "not implement this interface"); return self; } static VALUE rg_remove_column_selection(VALUE self, VALUE column) { gboolean ret = atk_table_remove_column_selection(_SELF(self), NUM2INT(column)); if (! ret) rb_raise(rb_eRuntimeError, "not implement this interface"); return self; } static VALUE rg_remove_row_selection(VALUE self, VALUE row) { gboolean ret = atk_table_remove_row_selection(_SELF(self), NUM2INT(row)); if (! ret) rb_raise(rb_eRuntimeError, "not implement this interface"); return self; } void Init_atk_table(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_TABLE, "Table", mAtk); RG_DEF_METHOD(ref_at, 2); RG_DEF_METHOD(get_index_at, 2); RG_DEF_METHOD(get_column_at_index, 1); RG_DEF_METHOD(get_row_at_index, 1); RG_DEF_METHOD(n_columns, 0); RG_DEF_METHOD(n_rows, 0); RG_DEF_METHOD(get_column_extent_at, 2); RG_DEF_METHOD(get_row_extent_at, 2); RG_DEF_METHOD(caption, 0); RG_DEF_METHOD(get_column_description, 1); RG_DEF_METHOD(get_row_description, 1); RG_DEF_METHOD(get_column_header, 1); RG_DEF_METHOD(get_row_header, 1); RG_DEF_METHOD(summary, 0); RG_DEF_METHOD(set_caption, 1); RG_DEF_METHOD(set_row_description, 2); RG_DEF_METHOD(set_column_description, 2); RG_DEF_METHOD(set_row_header, 2); RG_DEF_METHOD(set_column_header, 2); RG_DEF_METHOD(set_summary, 1); RG_DEF_METHOD(selected_columns, 0); RG_DEF_METHOD(selected_rows, 0); RG_DEF_METHOD_P(column_selected, 1); RG_DEF_METHOD_P(row_selected, 1); RG_DEF_METHOD_P(selected, 2); RG_DEF_METHOD(add_column_selection, 1); RG_DEF_METHOD(add_row_selection, 1); RG_DEF_METHOD(remove_column_selection, 1); RG_DEF_METHOD(remove_row_selection, 1); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatktextrange.c0000644000175000017500000000472011701304107020130 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES #define RG_TARGET_NAMESPACE cTextRange #define _SELF(r) (RVAL2ATKTEXTRANGE(r)) /**********************************/ static AtkTextRange* atk_text_range_copy(const AtkTextRange* val) { AtkTextRange* new_val; g_return_val_if_fail (val != NULL, NULL); new_val = g_new(AtkTextRange, 1); *new_val = *val; return new_val; } GType atk_text_range_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("AtkTextRange", (GBoxedCopyFunc)atk_text_range_copy, (GBoxedFreeFunc)g_free); return our_type; } /**********************************/ /* Struct accessors */ static VALUE rg_bounds(VALUE self) { return ATKTEXTRECTANGLE2RVAL(&_SELF(self)->bounds); } static VALUE rg_start_offset(VALUE self) { return INT2NUM(_SELF(self)->start_offset); } static VALUE rg_end_offset(VALUE self) { return INT2NUM(_SELF(self)->end_offset); } static VALUE rg_content(VALUE self) { return CSTR2RVAL(_SELF(self)->content); } #endif void Init_atk_text_range(VALUE mAtk) { #ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_TEXT_RANGE, "TextRange", mAtk); RG_DEF_METHOD(bounds, 0); RG_DEF_METHOD(start_offset, 0); RG_DEF_METHOD(end_offset, 0); RG_DEF_METHOD(content, 0); #endif } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkprivate.h0000644000175000017500000000345311701304107017610 0ustar koukou#ifndef RB_ATK_PRIVATE_H #define RB_ATK_PRIVATE_H #include "rbatk.h" #ifndef HAVE_RB_ERRINFO # define rb_errinfo() (ruby_errinfo) #endif #ifndef G_VALUE_INIT # define G_VALUE_INIT { 0, { { 0 } } } #endif G_BEGIN_DECLS G_GNUC_INTERNAL void Init_atk_action(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_component(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_document(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_editabletext(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_gobjectaccessible(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_hyperlink(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_hypertext(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_image(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_implementor(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_noopobject(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_noopobjectfactory(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_object(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_object_role(VALUE cObject); G_GNUC_INTERNAL void Init_atk_objectfactory(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_registry(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_relation(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_relation_type(VALUE cRelation); G_GNUC_INTERNAL void Init_atk_relation_set(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_selection(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_state(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_state_set(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_streamable_content(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_table(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_text(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_text_attribute(VALUE mText); G_GNUC_INTERNAL void Init_atk_text_range(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_text_rectangle(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_util(VALUE mAtk); G_GNUC_INTERNAL void Init_atk_value(VALUE mAtk); G_END_DECLS #endif /* RB_ATK_PRIVATE_H */ ruby-gnome2-all-2.1.0/atk/ext/atk/rbatktextrectangle.c0000644000175000017500000000706712124610262021011 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES #define RG_TARGET_NAMESPACE cTextRectangle #define _SELF(r) (RVAL2ATKTEXTRECTANGLE(r)) /**********************************/ static AtkTextRectangle* atk_text_rectangle_copy(const AtkTextRectangle* val) { AtkTextRectangle* new_val; g_return_val_if_fail (val != NULL, NULL); new_val = g_new(AtkTextRectangle, 1); *new_val = *val; return new_val; } GType atk_text_rectangle_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("AtkTextRectangle", (GBoxedCopyFunc)atk_text_rectangle_copy, (GBoxedFreeFunc)g_free); return our_type; } /**********************************/ static VALUE rg_initialize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { AtkTextRectangle rectangle; rectangle.x = NUM2INT(x); rectangle.y = NUM2INT(y); rectangle.width = NUM2INT(width); rectangle.height = NUM2INT(height); G_INITIALIZE(self, g_boxed_copy(ATK_TYPE_TEXT_RECTANGLE, &rectangle)); return Qnil; } /* Struct accessors */ static VALUE rg_x(VALUE self) { return INT2NUM(_SELF(self)->x); } static VALUE rg_y(VALUE self) { return INT2NUM(_SELF(self)->y); } static VALUE rg_width(VALUE self) { return INT2NUM(_SELF(self)->width); } static VALUE rg_height(VALUE self) { return INT2NUM(_SELF(self)->height); } static VALUE rg_set_x(VALUE self, VALUE x) { _SELF(self)->x = NUM2INT(x); return self; } static VALUE rg_set_y(VALUE self, VALUE y) { _SELF(self)->y = NUM2INT(y); return self; } static VALUE rg_set_width(VALUE self, VALUE width) { _SELF(self)->width = NUM2INT(width); return self; } static VALUE rg_set_height(VALUE self, VALUE height) { _SELF(self)->height = NUM2INT(height); return self; } static VALUE rg_to_a(VALUE self) { AtkTextRectangle* a = _SELF(self); return rb_ary_new3(4, INT2FIX(a->x), INT2FIX(a->y), INT2FIX(a->width), INT2FIX(a->height)); } #endif void Init_atk_text_rectangle(VALUE mAtk) { #ifdef HAVE_ATK_TEXT_GET_BOUNDED_RANGES VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_TEXT_RECTANGLE, "TextRectangle", mAtk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(x, 0); RG_DEF_METHOD(y, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(set_x, 1); RG_DEF_METHOD(set_y, 1); RG_DEF_METHOD(set_width, 1); RG_DEF_METHOD(set_height, 1); RG_DEF_METHOD(to_a, 0); #endif } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkrelationtype.c0000644000175000017500000000251211701304107020643 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cType static VALUE rg_s_for_name(G_GNUC_UNUSED VALUE self, VALUE name) { return ATKRELATIONTYPE2RVAL(atk_relation_type_for_name(RVAL2CSTR(name))); } void Init_atk_relation_type(VALUE cRelation) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_RELATION_TYPE, "Type", cRelation); RG_DEF_SMETHOD(for_name, 1); G_DEF_CONSTANTS(cRelation, ATK_TYPE_RELATION_TYPE, "ATK_"); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkselection.c0000644000175000017500000000500711701304107020113 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mSelection #define _SELF(s) (RVAL2ATKSELECTION(s)) static VALUE rg_add_selection(VALUE self, VALUE i) { gboolean ret = atk_selection_add_selection(_SELF(self), NUM2INT(i)); if (! ret) rb_raise(rb_eRuntimeError, "Can't add selection"); return self; } static VALUE rg_clear_selection(VALUE self) { gboolean ret = atk_selection_clear_selection(_SELF(self)); if (! ret) rb_raise(rb_eRuntimeError, "Can't clear selection"); return self; } static VALUE rg_ref_selection(VALUE self, VALUE i) { return GOBJ2RVAL(atk_selection_ref_selection(_SELF(self), NUM2INT(i))); } static VALUE rg_selection_count(VALUE self) { return INT2NUM(atk_selection_get_selection_count(_SELF(self))); } static VALUE rg_child_selected_p(VALUE self, VALUE i) { return CBOOL2RVAL(atk_selection_is_child_selected(_SELF(self), NUM2INT(i))); } static VALUE rg_remove_selection(VALUE self, VALUE i) { gboolean ret = atk_selection_remove_selection(_SELF(self), NUM2INT(i)); if (! ret) rb_raise(rb_eRuntimeError, "Can't remove selection"); return self; } static VALUE rg_select_all_selection(VALUE self) { return CBOOL2RVAL(atk_selection_select_all_selection(_SELF(self))); } void Init_atk_selection(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_SELECTION, "Selection", mAtk); RG_DEF_METHOD(add_selection, 1); RG_DEF_METHOD(clear_selection, 0); RG_DEF_METHOD(ref_selection, 1); RG_DEF_METHOD(selection_count, 0); RG_DEF_METHOD_P(child_selected, 1); RG_DEF_METHOD(remove_selection, 1); RG_DEF_METHOD(select_all_selection, 0); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatk.h0000644000175000017500000000314511701304107016213 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "ruby.h" #include #include #include #include #include "rbgobject.h" #include "rbatkversion.h" #include "rbatkconversions.h" #if defined(G_PLATFORM_WIN32) && !defined(RUBY_ATK_STATIC_COMPILATION) # ifdef RUBY_ATK_COMPILATION # define RUBY_ATK_VAR __declspec(dllexport) # else # define RUBY_ATK_VAR extern __declspec(dllimport) # endif #else # define RUBY_ATK_VAR extern #endif extern GType atk_text_rectangle_get_type(void); extern GType atk_text_range_get_type(void); RUBY_ATK_VAR VALUE mAtk; #define ATK_TYPE_TEXT_RECTANGLE (atk_text_rectangle_get_type()) #define ATK_TYPE_TEXT_RANGE (atk_text_range_get_type()) ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkhypertext.c0000644000175000017500000000313611701304107020163 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mHypertext #define _SELF(s) (RVAL2ATKHYPERTEXT(s)) static VALUE rg_get_link(VALUE self, VALUE link_index) { return GOBJ2RVAL(atk_hypertext_get_link(_SELF(self), NUM2INT(link_index))); } static VALUE rg_n_links(VALUE self) { return INT2NUM(atk_hypertext_get_n_links(_SELF(self))); } static VALUE rg_link_index(VALUE self, VALUE char_index) { return INT2NUM(atk_hypertext_get_link_index(_SELF(self), NUM2INT(char_index))); } void Init_atk_hypertext(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_HYPERTEXT, "Hypertext", mAtk); RG_DEF_METHOD(get_link, 1); RG_DEF_METHOD(n_links, 0); RG_DEF_METHOD(link_index, 1); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatktextattribute.c0000644000175000017500000000340411701304107021035 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cAttribute static VALUE rg_s_type_register(G_GNUC_UNUSED VALUE self, VALUE name) { return ATKTEXTATTRIBUTE2RVAL(atk_text_attribute_register(RVAL2CSTR(name))); } static VALUE rg_s_for_name(G_GNUC_UNUSED VALUE self, VALUE name) { return ATKTEXTATTRIBUTE2RVAL(atk_text_attribute_for_name(RVAL2CSTR(name))); } static VALUE rg_get_value(VALUE self, VALUE index) { return CSTR2RVAL(atk_text_attribute_get_value(RVAL2ATKTEXTATTRIBUTE(self), NUM2INT(index))); } void Init_atk_text_attribute(VALUE mText) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_TEXT_ATTRIBUTE, "Attribute", mText); G_DEF_CONSTANTS(mText, ATK_TYPE_TEXT_ATTRIBUTE, "ATK_TEXT_"); RG_DEF_SMETHOD(type_register, 1); RG_DEF_SMETHOD(for_name, 1); RG_DEF_METHOD(get_value, 1); } ruby-gnome2-all-2.1.0/atk/ext/atk/depend0000644000175000017500000000046312064346475016142 0ustar koukouinstall-so: install-headers install-headers: $(INSTALL_DATA) $(srcdir)/rbatk.h $(RUBYARCHDIR) $(INSTALL_DATA) rbatkversion.h $(RUBYARCHDIR) install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-atk.pc $(pkgconfigdir); \ fi ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkstate.c0000644000175000017500000000322411701304107017245 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cState #define _SELF(s) (RVAL2ATKSTATE(s)) static VALUE rg_s_type_register(G_GNUC_UNUSED VALUE self, VALUE name) { return ATKSTATETYPE2RVAL(atk_state_type_register(RVAL2CSTR(name))); } /* We don't need this. G_CONST_RETURN gchar* atk_state_type_get_name (AtkStateType type); */ static VALUE rg_s_for_name(G_GNUC_UNUSED VALUE self, VALUE name) { return ATKSTATETYPE2RVAL(atk_state_type_for_name(RVAL2CSTR(name))); } void Init_atk_state(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_STATE_TYPE, "State", mAtk); RG_DEF_SMETHOD(type_register, 1); RG_DEF_SMETHOD(for_name, 1); G_DEF_CONSTANTS(mAtk, ATK_TYPE_STATE_TYPE, "ATK_"); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkobjectrole.c0000644000175000017500000000311511701304107020254 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cRole static VALUE rg_localized_name(G_GNUC_UNUSED VALUE self) { #ifdef HAVE_ATK_ROLE_GET_LOCALIZED_NAME return CSTR2RVAL(atk_role_get_localized_name(RVAL2ATKROLE(self))); #else rb_warning("not supported in this version of ATK."); return Qnil; #endif } static VALUE rg_s_for_name(G_GNUC_UNUSED VALUE self, VALUE name) { return ATKROLE2RVAL(atk_role_for_name(RVAL2CSTR(name))); } void Init_atk_object_role(VALUE cObject) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_ROLE, "Role", cObject); RG_DEF_METHOD(localized_name, 0); RG_DEF_SMETHOD(for_name, 1); G_DEF_CONSTANTS(cObject, ATK_TYPE_ROLE, "ATK_"); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkeditabletext.c0000664000175000017500000001145711740310343020616 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE mEditableText #define _SELF(s) (RVAL2ATKEDITABLETEXT(s)) struct rval2atkattributegslist_args { VALUE ary; long n; GSList *result; }; static VALUE rbatk_rval2atkattributegslist_body(VALUE value) { long i; struct rval2atkattributegslist_args *args = (struct rval2atkattributegslist_args *)value; for (i = 0; i < args->n; i++) { VALUE ary = rb_ary_to_ary(RARRAY_PTR(args->ary)[i]); AtkAttribute *attribute; if (RARRAY_LEN(ary) != 2) rb_raise(rb_eArgError, "attribute %ld should be an array of length 2", i); attribute = g_new(AtkAttribute, 1); args->result = g_slist_append(args->result, attribute); attribute->name = g_strdup(RVAL2CSTR(RARRAY_PTR(ary)[0])); attribute->value = g_strdup(RVAL2CSTR(RARRAY_PTR(ary)[1])); } return Qnil; } static void rbatk_atkattributegslist_free(GSList *list) { GSList *p; for (p = list; p != NULL; p = g_slist_next(p)) { AtkAttribute *attribute = (AtkAttribute *)p->data; g_free(attribute->value); g_free(attribute->name); g_free(attribute); } g_slist_free(list); } static G_GNUC_NORETURN VALUE rbatk_rval2atkattributegslist_rescue(VALUE value) { rbatk_atkattributegslist_free(((struct rval2atkattributegslist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GSList * rbatk_rval2atkattributegslist(VALUE value) { struct rval2atkattributegslist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbatk_rval2atkattributegslist_body, (VALUE)&args, rbatk_rval2atkattributegslist_rescue, (VALUE)&args); return args.result; } #define RVAL2ATKATTRIBUTEGSLIST(value) rbatk_rval2atkattributegslist(value) static VALUE rg_set_run_attributes(VALUE self, VALUE attributes, VALUE rbstart_offset, VALUE rbend_offset) { AtkEditableText *editable; gint start_offset, end_offset; AtkAttributeSet *list; gboolean result; if (NIL_P(attributes)) return Qfalse; editable = _SELF(self); start_offset = NUM2INT(rbstart_offset); end_offset = NUM2INT(rbend_offset); list = RVAL2ATKATTRIBUTEGSLIST(attributes); result = atk_editable_text_set_run_attributes(editable, list, start_offset, end_offset); rbatk_atkattributegslist_free(list); return CBOOL2RVAL(result); } static VALUE rg_set_text_contents(VALUE self, VALUE str) { atk_editable_text_set_text_contents(_SELF(self), RVAL2CSTR(str)); return self; } static VALUE rg_insert_text(VALUE self, VALUE str, VALUE position) { gint pos = NUM2INT(position); StringValue(str); atk_editable_text_insert_text(_SELF(self), RVAL2CSTR(str), RSTRING_LEN(str), &pos); return INT2NUM(pos); } static VALUE rg_copy_text(VALUE self, VALUE start_pos, VALUE end_pos) { atk_editable_text_copy_text(_SELF(self), NUM2INT(start_pos), NUM2INT(end_pos)); return self; } static VALUE rg_cut_text(VALUE self, VALUE start_pos, VALUE end_pos) { atk_editable_text_cut_text(_SELF(self), NUM2INT(start_pos), NUM2INT(end_pos)); return self; } static VALUE rg_delete_text(VALUE self, VALUE start_pos, VALUE end_pos) { atk_editable_text_delete_text(_SELF(self), NUM2INT(start_pos), NUM2INT(end_pos)); return self; } static VALUE rg_paste_text(VALUE self, VALUE position) { atk_editable_text_paste_text(_SELF(self), NUM2INT(position)); return self; } void Init_atk_editabletext(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(ATK_TYPE_EDITABLE_TEXT, "EditableText", mAtk); RG_DEF_METHOD(set_run_attributes, 3); RG_DEF_METHOD(set_text_contents, 1); RG_DEF_METHOD(insert_text, 2); RG_DEF_METHOD(copy_text, 2); RG_DEF_METHOD(cut_text, 2); RG_DEF_METHOD(delete_text, 2); RG_DEF_METHOD(paste_text, 1); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatknoopobjectfactory.c0000644000175000017500000000247011701304107021661 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cNoOpObjectFactory #define _SELF(s) (RVAL2ATKNOOPOBJECTFACTORY(s)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, atk_no_op_object_factory_new()); return Qnil; } void Init_atk_noopobjectfactory(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_NO_OP_OBJECT_FACTORY, "NoOpObjectFactory", mAtk); RG_DEF_METHOD(initialize, 0); } ruby-gnome2-all-2.1.0/atk/ext/atk/rbatkobject.c0000644000175000017500000001206511701304107017376 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbatkprivate.h" #define RG_TARGET_NAMESPACE cObject #define _SELF(s) RVAL2ATKOBJECT(s) /* How can I implement this? Since 1.10 AtkObject* atk_implementor_ref_accessible (AtkImplementor *implementor); */ /* Use properties accessible_* G_CONST_RETURN gchar* atk_object_get_name (AtkObject *accessible); G_CONST_RETURN gchar* atk_object_get_description (AtkObject *accessible); AtkObject* atk_object_get_parent (AtkObject *accessible); (AtkObject *accessible); */ static VALUE rg_n_accessible_children(VALUE self) { return INT2NUM(atk_object_get_n_accessible_children(_SELF(self))); } static VALUE rg_ref_accessible_child(VALUE self, VALUE i) { return GOBJ2RVAL(atk_object_ref_accessible_child(_SELF(self), NUM2INT(i))); } static VALUE rg_ref_relation_set(VALUE self) { return GOBJ2RVAL(atk_object_ref_relation_set(_SELF(self))); } /* Use properties accessible_* AtkLayer atk_object_get_layer (AtkObject *accessible); gint atk_object_get_mdi_zorder (AtkObject *accessible); AtkRole atk_object_get_role (AtkObject *accessible); */ static VALUE rg_ref_state_set(VALUE self) { return GOBJ2RVAL(atk_object_ref_state_set(_SELF(self))); } static VALUE rg_index_in_parent(VALUE self) { return INT2NUM(atk_object_get_index_in_parent(_SELF(self))); } /* Use properties accessible_* void atk_object_set_name (AtkObject *accessible, const gchar *name); void atk_object_set_description (AtkObject *accessible, const gchar *description); void atk_object_set_parent (AtkObject *accessible, AtkObject *parent); void atk_object_set_role (AtkObject *accessible, AtkRole role); */ /* guint atk_object_connect_property_change_handler (AtkObject *accessible, AtkPropertyChangeHandler *handler); void atk_object_remove_property_change_handler (AtkObject *accessible, guint handler_id); */ static VALUE rg_notify_state_change(VALUE self, VALUE state, VALUE value) { atk_object_notify_state_change(_SELF(self), RVAL2ATKSTATETYPE(state), RVAL2CBOOL(value)); return self; } /* I don't have a good idea to implement this method. Any idea? void atk_object_initialize (AtkObject *accessible, gpointer data); */ #ifdef HAVE_ATK_OBJECT_ADD_RELATIONSHIP static VALUE rg_add_relationship(VALUE self, VALUE relationship, VALUE target) { return CBOOL2RVAL(atk_object_add_relationship( _SELF(self), RVAL2ATKRELATIONTYPE(relationship), _SELF(target))); } #endif #ifdef HAVE_ATK_OBJECT_REMOVE_RELATIONSHIP static VALUE rg_remove_relationship(VALUE self, VALUE relationship, VALUE target) { return CBOOL2RVAL(atk_object_remove_relationship( _SELF(self), RVAL2ATKRELATIONTYPE(relationship), _SELF(target))); } #endif void Init_atk_object(VALUE mAtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(ATK_TYPE_OBJECT, "Object", mAtk); RG_DEF_METHOD(n_accessible_children, 0); RG_DEF_METHOD(ref_accessible_child, 1); RG_DEF_METHOD(ref_relation_set, 0); RG_DEF_METHOD(ref_state_set, 0); RG_DEF_METHOD(index_in_parent, 0); RG_DEF_METHOD(notify_state_change, 2); #ifdef HAVE_ATK_OBJECT_ADD_RELATIONSHIP RG_DEF_METHOD(add_relationship, 2); #endif #ifdef HAVE_ATK_OBJECT_REMOVE_RELATIONSHIP RG_DEF_METHOD(remove_relationship, 2); #endif Init_atk_object_role(RG_TARGET_NAMESPACE); /* AtkLayer */ G_DEF_CLASS(ATK_TYPE_LAYER, "Layer", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, ATK_TYPE_LAYER, "ATK_"); } ruby-gnome2-all-2.1.0/atk/README0000644000175000017500000000126412257552167014262 0ustar koukouRuby/ATK =============== Ruby/ATK is a Ruby binding of ATK-1.12.x or later. Requirements ------------ Ruby: http://www.ruby-lang.org/ GLib: http://www.gtk.org/ ATK: http://developer.gnome.org/projects/gap Ruby/GLib2: http://ruby-gnome2.sourceforge.net/ Install ------- 0. install ruby-1.9.x or later, GLib, ATK, Ruby/GLib2. 1. ruby extconf.rb 2. make 3. su 4. make install Copying ------- Copyright (c) 2003-2005 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ ruby-gnome2-all-2.1.0/atk/COPYING.LIB0000644000175000017500000006364212257552167015052 0ustar koukou GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ruby-gnome2-all-2.1.0/atk/lib/0000755000175000017500000000000012137115064014131 5ustar koukouruby-gnome2-all-2.1.0/atk/lib/1.8/0000755000175000017500000000000012257665514014454 5ustar koukouruby-gnome2-all-2.1.0/atk/lib/atk.rb0000644000175000017500000000106012137115064015232 0ustar koukourequire 'glib2' base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/atk.so" rescue LoadError require 'atk.so' end if vendor_dir.exist? begin require "gobject-introspection" vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) rescue LoadError end end ruby-gnome2-all-2.1.0/atk/lib/1.9/0000755000175000017500000000000012257665514014455 5ustar koukouruby-gnome2-all-2.1.0/atk/extconf.rb0000644000175000017500000000222211701304107015346 0ustar koukou#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "atk" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ruby-gnome2-all-2.1.0/atk/Rakefile0000644000175000017500000000154312257552167015047 0ustar koukou# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require "gnome2/rake/package-task" package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/ATK is a Ruby binding of ATK-1.0.x." package.description = "Ruby/ATK is a Ruby binding of ATK-1.0.x." package.dependency.gem.runtime = ["glib2"] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = ["glib2", "gobject-introspection"] package.external_packages = [ { :name => "atk", :download_site => :gnome, :label => "atk", :version => "2.10.0", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :build_concurrently => false, :built_file => "bin/libatk-1.0-0.dll", }, } ] end package_task.define ruby-gnome2-all-2.1.0/atk/test/0000755000175000017500000000000012124610262014336 5ustar koukouruby-gnome2-all-2.1.0/atk/test/run-test.rb0000755000175000017500000000276612124610262016462 0ustar koukou#!/usr/bin/env ruby # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") atk_base = File.join(ruby_gnome2_base, "atk") modules = [ [glib_base, "glib2"], [atk_base, "atk"] ] modules.each do |target, module_name| if system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require "glib-test-init" $LOAD_PATH.unshift(File.join(atk_base, "test")) require "atk-test-utils" require "atk" exit Test::Unit::AutoRunner.run(true) ruby-gnome2-all-2.1.0/atk/test/test-text-rectangle.rb0000644000175000017500000000174112124610262020571 0ustar koukou# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestAtkRectangle < Test::Unit::TestCase include AtkTestUtils def test_width rectangle = Atk::TextRectangle.new(0, 10, 20, 30) assert_equal(20, rectangle.width) end end ruby-gnome2-all-2.1.0/atk/test/atk-test-utils.rb0000644000175000017500000000152212124610262017555 0ustar koukou# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "test-unit" require "test/unit/notify" module AtkTestUtils end ruby-gnome2-all-2.1.0/pango/0000755000175000017500000000000012257665516013727 5ustar koukouruby-gnome2-all-2.1.0/pango/patches/0000755000175000017500000000000012257552167015353 5ustar koukouruby-gnome2-all-2.1.0/pango/patches/pango-1.34.0-enable-fc-font.diff0000644000175000017500000000110212147676243022602 0ustar koukoudiff -ru pango-1.34.0.orig/pango/pangocairo.def pango-1.34.0/pango/pangocairo.def --- pango-1.34.0.orig/pango/pangocairo.def 2013-01-24 12:39:14.000000000 +0900 +++ pango-1.34.0/pango/pangocairo.def 2013-05-18 20:28:04.017761164 +0900 @@ -8,8 +8,8 @@ pango_cairo_create_context pango_cairo_create_layout pango_cairo_error_underline_path -; pango_cairo_fc_font_get_type -; pango_cairo_fc_font_map_get_type + pango_cairo_fc_font_get_type + pango_cairo_fc_font_map_get_type pango_cairo_font_get_type pango_cairo_font_get_scaled_font pango_cairo_font_map_create_context ruby-gnome2-all-2.1.0/pango/ext/0000755000175000017500000000000011701304107014502 5ustar koukouruby-gnome2-all-2.1.0/pango/ext/pango/0000755000175000017500000000000012257552170015622 5ustar koukouruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoglyphstring.c0000644000175000017500000001146312257552170021716 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cGlyphString #define _SELF(self) (RVAL2PANGOGLYPHSTRING(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, pango_glyph_string_new()); return Qnil; } static VALUE rg_set_size(VALUE self, VALUE len) { pango_glyph_string_set_size(_SELF(self), NUM2INT(len)); return self; } static VALUE rg_extents(int argc, VALUE *argv, VALUE self) { VALUE font, start_index, end_index; PangoRectangle ink_rect; PangoRectangle logical_rect; rb_scan_args(argc, argv, "12", &font, &start_index, &end_index); if (NIL_P(start_index)){ pango_glyph_string_extents(_SELF(self), RVAL2PANGOFONT(font), &ink_rect, &logical_rect); } else { pango_glyph_string_extents_range(_SELF(self), NUM2INT(start_index), NUM2INT(end_index), RVAL2PANGOFONT(font), &ink_rect, &logical_rect); } return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect), PANGORECTANGLE2RVAL(&logical_rect)); } static VALUE rg_width(VALUE self) { return INT2NUM(pango_glyph_string_get_width(_SELF(self))); } static VALUE rg_index_to_x(VALUE self, VALUE text, VALUE analysis, VALUE index, VALUE trailing) { int x_pos; StringValue(text); pango_glyph_string_index_to_x(_SELF(self), /* NOTE: This is a bug in the signature of * pango_glyph_string_index_to_x */ (char *)RSTRING_PTR(text), RSTRING_LEN(text), RVAL2PANGOANALYSIS(analysis), NUM2INT(index), RVAL2CBOOL(trailing), &x_pos); return INT2NUM(x_pos); } static VALUE rg_x_to_index(VALUE self, VALUE text, VALUE analysis, VALUE x_pos) { int index; int trailing; StringValue(text); pango_glyph_string_x_to_index(_SELF(self), /* NOTE: This is a bug in the signature of * pango_glyph_string_index_to_x */ (char *)RSTRING_PTR(text), RSTRING_LEN(text), RVAL2PANGOANALYSIS(analysis), NUM2INT(x_pos), &index, &trailing); return rb_assoc_new(INT2NUM(index), CBOOL2RVAL(trailing)); } static VALUE rg_get_logical_widths(VALUE self, VALUE rbtext, VALUE rbembedding_level) { PangoGlyphString *glyphs = _SELF(self); const char *text = RVAL2CSTR(rbtext); long length = RSTRING_LEN(rbtext); int embedding_level = NUM2INT(rbembedding_level); glong n = g_utf8_strlen(text, length); int *logical_widths = g_new(int, n); pango_glyph_string_get_logical_widths(glyphs, text, length, embedding_level, logical_widths); return GINTS2RVAL_FREE(logical_widths, n); } static VALUE rg_glyphs(VALUE self) { int i; PangoGlyphInfo *glyphs = _SELF(self)->glyphs; gint* log_clusters = _SELF(self)->log_clusters; VALUE ret = rb_ary_new(); for (i = 0; i < _SELF(self)->num_glyphs; i++) { rb_ary_push(ret, rb_assoc_new(PANGOGLYPHINFO2RVAL(glyphs + i), INT2NUM(log_clusters[i]))); } return ret; } void Init_pango_glyph_string(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_GLYPH_STRING, "GlyphString", mPango); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_size, 1); RG_DEF_METHOD(extents, -1); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(index_to_x, 4); RG_DEF_METHOD(x_to_index, 3); RG_DEF_METHOD(get_logical_widths, 2); RG_DEF_METHOD(glyphs, 0); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpango.c0000644000175000017500000002264312257552170017425 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE mPango VALUE RG_TARGET_NAMESPACE; extern void Init_pango(void); /* * Rendering */ struct rpango_reorder_items_args { PangoItem *item; VALUE ary; long n; GList *result; }; static VALUE rpango_reorder_items_body(VALUE value) { struct rpango_reorder_items_args *args = (struct rpango_reorder_items_args *)value; long i; GList *result; for (i = 0; i < args->n; i++) args->result = g_list_append(args->result, RVAL2PANGOITEM(RARRAY_PTR(args->ary)[i])); result = pango_reorder_items(args->result); g_list_free(args->result); return GLIST2ARY2(result, PANGO_TYPE_ITEM); } static VALUE rpango_reorder_items_ensure(VALUE value) { g_list_free(((struct rpango_reorder_items_args *)value)->result); return Qnil; } static VALUE rg_s_reorder_items(G_GNUC_UNUSED VALUE self, VALUE attrs) { struct rpango_reorder_items_args args; args.ary = rb_ary_to_ary(attrs); args.n = RARRAY_LEN(args.ary); args.result = NULL; return rb_ensure(rpango_reorder_items_body, (VALUE)&args, rpango_reorder_items_ensure, (VALUE)&args); } static VALUE rg_s_unichar_direction(G_GNUC_UNUSED VALUE self, VALUE ch) { return PANGODIRECTION2RVAL(pango_unichar_direction(NUM2UINT(ch))); } static VALUE rg_s_find_base_dir(G_GNUC_UNUSED VALUE self, VALUE text) { StringValue(text); return PANGODIRECTION2RVAL(pango_find_base_dir(RSTRING_PTR(text), RSTRING_LEN(text))); } struct rbg_pangologattrs2rval_free_args { PangoLogAttr *attrs; long n; }; static VALUE rbg_pangologattrs2rval_free_body(VALUE value) { struct rbg_pangologattrs2rval_free_args *args = (struct rbg_pangologattrs2rval_free_args *)value; long i; VALUE ary = rb_ary_new(); for (i = 0; i < args->n; i++) rb_ary_push(ary, PANGOLOGATTR2RVAL(&args->attrs[i])); return ary; } static VALUE rbg_pangologattrs2rval_free_ensure(VALUE value) { g_free(((struct rbg_pangologattrs2rval_free_args *)value)->attrs); return Qnil; } static VALUE rbg_pangologattrs2rval_free(PangoLogAttr *attrs, long n) { struct rbg_pangologattrs2rval_free_args args = { attrs, n }; return rb_ensure(rbg_pangologattrs2rval_free_body, (VALUE)&args, rbg_pangologattrs2rval_free_ensure, (VALUE)&args); } #define PANGOLOGATTRS2RVAL_FREE(attrs, n) rbg_pangologattrs2rval_free(attrs, n) static VALUE rg_s_break(G_GNUC_UNUSED VALUE self, VALUE rbtext, VALUE rbanalysis) { const gchar *text = RVAL2CSTR(rbtext); long length = RSTRING_LEN(rbtext); PangoAnalysis *analysis = RVAL2PANGOANALYSIS(rbanalysis); long n = g_utf8_strlen(text, length) + 1; PangoLogAttr *attrs = g_new(PangoLogAttr, n); pango_break(text, length, analysis, attrs, n); return PANGOLOGATTRS2RVAL_FREE(attrs, n); } static VALUE rg_s_get_log_attrs(G_GNUC_UNUSED VALUE self, VALUE rbtext, VALUE rblevel, VALUE rblanguage) { const gchar *text = RVAL2CSTR(rbtext); long length = RSTRING_LEN(rbtext); int level = NUM2INT(rblevel); PangoLanguage *language = RVAL2PANGOLANGUAGE(rblanguage); long n = g_utf8_strlen(text, length) + 1; PangoLogAttr *attrs = g_new(PangoLogAttr, n); pango_get_log_attrs(text, length, level, language, attrs, n); return PANGOLOGATTRS2RVAL_FREE(attrs, n); } static VALUE rg_s_find_paragraph_boundary(G_GNUC_UNUSED VALUE self, VALUE text) { gint paragraph_delimiter_index, next_paragraph_start; StringValue(text); pango_find_paragraph_boundary(RSTRING_PTR(text), RSTRING_LEN(text), ¶graph_delimiter_index, &next_paragraph_start); return rb_ary_new3(2, INT2NUM(paragraph_delimiter_index), INT2NUM(next_paragraph_start)); } /* Don't need to implement this. Use pango_break instead. void pango_default_break (const gchar *text, int length, PangoAnalysis *analysis, PangoLogAttr *attrs, int attrs_len); */ static VALUE rpango_shape_result(VALUE value) { return PANGOGLYPHSTRING2RVAL((PangoGlyphString *)value); } static VALUE rpango_shape_ensure(VALUE value) { pango_glyph_string_free((PangoGlyphString *)value); return Qnil; } static VALUE rg_s_shape(G_GNUC_UNUSED VALUE self, VALUE rbtext, VALUE rbanalysis) { const gchar *text = RVAL2CSTR(rbtext); long length = RSTRING_LEN(rbtext); PangoAnalysis *analysis = RVAL2PANGOANALYSIS(rbanalysis); PangoGlyphString *glyphs = pango_glyph_string_new(); pango_shape(text, length, analysis, glyphs); return rb_ensure(rpango_shape_result, (VALUE)glyphs, rpango_shape_ensure, (VALUE)glyphs); } /* This method is from rbpangoattribute.c */ static VALUE rg_s_parse_markup(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE markup_text, accel_marker; PangoAttrList *pattr_list; gchar* gtext; gunichar accel_char; GError *error = NULL; gboolean ret; char c; VALUE text = Qnil; VALUE attr_list = Qnil; rb_scan_args(argc, argv, "11", &markup_text, &accel_marker); if (NIL_P(markup_text)) rb_raise(rb_eRuntimeError, "1st argument can't accept nil"); StringValue(markup_text); ret = pango_parse_markup(RSTRING_PTR(markup_text), RSTRING_LEN(markup_text), NIL_P(accel_marker) ? 0 : NUM2CHR(accel_marker), &pattr_list, >ext, &accel_char, &error); if (!ret) RAISE_GERROR(error); if (pattr_list){ attr_list = PANGOATTRLIST2RVAL(pattr_list); pango_attr_list_unref(pattr_list); } c = (char)accel_char; if (text){ text = CSTR2RVAL(gtext); g_free(gtext); } return rb_ary_new3(3, attr_list, text, accel_char ? rb_str_new(&c, 1) : Qnil); } static VALUE rg_s_pixels(G_GNUC_UNUSED VALUE self, VALUE pixels) { return rb_float_new(PANGO_PIXELS(NUM2DBL(pixels))); } static VALUE rg_s_cairo_available_p(G_GNUC_UNUSED VALUE self) { return Qtrue; } void Init_pango(void) { RG_TARGET_NAMESPACE = rb_define_module("Pango"); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(PANGO_MAJOR_VERSION), INT2FIX(PANGO_MINOR_VERSION), INT2FIX(PANGO_MICRO_VERSION))); RG_DEF_SMETHOD(reorder_items, 1); RG_DEF_SMETHOD(unichar_direction, 1); RG_DEF_SMETHOD(find_base_dir, 1); RG_DEF_SMETHOD(break, 2); RG_DEF_SMETHOD(get_log_attrs, 3); RG_DEF_SMETHOD(find_paragraph_boundary, 1); RG_DEF_SMETHOD(shape, 2); RG_DEF_SMETHOD(parse_markup, -1); RG_DEF_SMETHOD(pixels, 1); rb_define_const(RG_TARGET_NAMESPACE, "SCALE", INT2FIX(PANGO_SCALE)); RG_DEF_SMETHOD_P(cairo_available, 0); Init_pango_analysis(RG_TARGET_NAMESPACE); Init_pango_attribute(RG_TARGET_NAMESPACE); Init_pango_attriterator(RG_TARGET_NAMESPACE); Init_pango_attrlist(RG_TARGET_NAMESPACE); Init_pango_cairo(RG_TARGET_NAMESPACE); Init_pango_cairo_context(RG_TARGET_NAMESPACE); Init_pango_color(RG_TARGET_NAMESPACE); Init_pango_context(RG_TARGET_NAMESPACE); Init_pango_coverage(RG_TARGET_NAMESPACE); Init_pango_engine(RG_TARGET_NAMESPACE); Init_pango_font(RG_TARGET_NAMESPACE); Init_pango_font_description(RG_TARGET_NAMESPACE); Init_pango_font_face(RG_TARGET_NAMESPACE); Init_pango_font_family(RG_TARGET_NAMESPACE); Init_pango_font_map(RG_TARGET_NAMESPACE); Init_pango_font_metrics(RG_TARGET_NAMESPACE); Init_pango_fontset(RG_TARGET_NAMESPACE); Init_pango_fontset_simple(RG_TARGET_NAMESPACE); Init_pango_glyph_info(RG_TARGET_NAMESPACE); Init_pango_glyph_item(RG_TARGET_NAMESPACE); Init_pango_glyph_string(RG_TARGET_NAMESPACE); Init_pango_gravity(RG_TARGET_NAMESPACE); Init_pango_item(RG_TARGET_NAMESPACE); Init_pango_language(RG_TARGET_NAMESPACE); Init_pango_layout(RG_TARGET_NAMESPACE); Init_pango_layout_iter(RG_TARGET_NAMESPACE); Init_pango_layout_line(RG_TARGET_NAMESPACE); Init_pango_logattr(RG_TARGET_NAMESPACE); Init_pango_matrix(RG_TARGET_NAMESPACE); Init_pango_rectangle(RG_TARGET_NAMESPACE); Init_pangorenderer(RG_TARGET_NAMESPACE); Init_pango_script(RG_TARGET_NAMESPACE); Init_pango_script_iter(RG_TARGET_NAMESPACE); Init_pango_array(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangofontmetrics.c0000644000175000017500000000473112257552170021701 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cFontMetrics #define _SELF(self) (RVAL2PANGOFONTMETRICS(self)) static VALUE rg_ascent(VALUE self) { return INT2NUM(pango_font_metrics_get_ascent(_SELF(self))); } static VALUE rg_descent(VALUE self) { return INT2NUM(pango_font_metrics_get_descent(_SELF(self))); } static VALUE rg_approximate_char_width(VALUE self) { return INT2NUM(pango_font_metrics_get_approximate_char_width(_SELF(self))); } static VALUE rg_approximate_digit_width(VALUE self) { return INT2NUM(pango_font_metrics_get_approximate_digit_width(_SELF(self))); } static VALUE rg_underline_thickness(VALUE self) { return INT2NUM(pango_font_metrics_get_underline_thickness(_SELF(self))); } static VALUE rg_underline_position(VALUE self) { return INT2NUM(pango_font_metrics_get_underline_position(_SELF(self))); } static VALUE rg_strikethrough_thickness(VALUE self) { return INT2NUM(pango_font_metrics_get_strikethrough_thickness(_SELF(self))); } static VALUE rg_strikethrough_position(VALUE self) { return INT2NUM(pango_font_metrics_get_strikethrough_position(_SELF(self))); } void Init_pango_font_metrics(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_METRICS, "FontMetrics", mPango); RG_DEF_METHOD(ascent, 0); RG_DEF_METHOD(descent, 0); RG_DEF_METHOD(approximate_char_width, 0); RG_DEF_METHOD(approximate_digit_width, 0); RG_DEF_METHOD(underline_thickness, 0); RG_DEF_METHOD(underline_position, 0); RG_DEF_METHOD(strikethrough_thickness, 0); RG_DEF_METHOD(strikethrough_position, 0); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangocairocontext.c0000644000175000017500000000765012257552170022051 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * Copyright (C) 2005 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE rb_cCairo_Context static VALUE rg_update_pango_context(VALUE self, VALUE context) { pango_cairo_update_context(RVAL2CRCONTEXT(self), RVAL2PANGOCONTEXT(context)); return self; } /* Convenience */ static VALUE rg_create_pango_layout(VALUE self) { return GOBJ2RVAL_UNREF(pango_cairo_create_layout(RVAL2CRCONTEXT(self))); } static VALUE rg_update_pango_layout(VALUE self, VALUE layout) { pango_cairo_update_layout(RVAL2CRCONTEXT(self), RVAL2PANGOLAYOUT(layout)); return self; } /* Rendering */ static VALUE rg_show_pango_glyph_string(VALUE self, VALUE font, VALUE glyphs) { pango_cairo_show_glyph_string(RVAL2CRCONTEXT(self), RVAL2PANGOFONT(font), RVAL2PANGOGLYPHSTRING(glyphs)); return self; } static VALUE rg_show_pango_layout_line(VALUE self, VALUE line) { pango_cairo_show_layout_line(RVAL2CRCONTEXT(self), RVAL2PANGOLAYOUTLINE(line)); return self; } static VALUE rg_show_pango_layout(VALUE self, VALUE layout) { pango_cairo_show_layout(RVAL2CRCONTEXT(self), RVAL2PANGOLAYOUT(layout)); return self; } static VALUE rg_show_pango_error_underline(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { pango_cairo_show_error_underline(RVAL2CRCONTEXT(self), NUM2DBL(x), NUM2DBL(y), NUM2DBL(width), NUM2DBL(height)); return self; } /* Rendering to a path */ static VALUE rg_pango_glyph_string_path(VALUE self, VALUE font, VALUE glyphs) { pango_cairo_glyph_string_path(RVAL2CRCONTEXT(self), RVAL2PANGOFONT(font), RVAL2PANGOGLYPHSTRING(glyphs)); return self; } static VALUE rg_pango_layout_line_path(VALUE self, VALUE line) { pango_cairo_layout_line_path(RVAL2CRCONTEXT(self), RVAL2PANGOLAYOUTLINE(line)); return self; } static VALUE rg_pango_layout_path(VALUE self, VALUE layout) { pango_cairo_layout_path(RVAL2CRCONTEXT(self), RVAL2PANGOLAYOUT(layout)); return self; } static VALUE rg_pango_error_underline_path(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { pango_cairo_error_underline_path(RVAL2CRCONTEXT(self), NUM2DBL(x), NUM2DBL(y), NUM2DBL(width), NUM2DBL(height)); return self; } void Init_pango_cairo_context(G_GNUC_UNUSED VALUE mPango) { /* Cairo::Context */ RG_DEF_METHOD(update_pango_context, 1); /* Convenience */ RG_DEF_METHOD(create_pango_layout, 0); RG_DEF_METHOD(update_pango_layout, 1); /* Rendering */ RG_DEF_METHOD(show_pango_glyph_string, 2); RG_DEF_METHOD(show_pango_layout_line, 1); RG_DEF_METHOD(show_pango_layout, 1); RG_DEF_METHOD(show_pango_error_underline, 4); /* Rendering to a path */ RG_DEF_METHOD(pango_glyph_string_path, 2); RG_DEF_METHOD(pango_layout_line_path, 1); RG_DEF_METHOD(pango_layout_path, 1); RG_DEF_METHOD(pango_error_underline_path, 4); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangogravity.c0000644000175000017500000000344011701304107021011 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #if PANGO_CHECK_VERSION(1,16,0) #define RG_TARGET_NAMESPACE mGravity static VALUE rg_s_to_rotation(G_GNUC_UNUSED VALUE self, VALUE gravity) { return rb_float_new(pango_gravity_to_rotation(RVAL2PANGOGRAVITY(gravity))); } static VALUE rg_s_vertical_p(G_GNUC_UNUSED VALUE self, VALUE gravity) { return CBOOL2RVAL(PANGO_GRAVITY_IS_VERTICAL(RVAL2PANGOGRAVITY(gravity))); } #endif void Init_pango_gravity(VALUE mPango) { #if PANGO_CHECK_VERSION(1,16,0) VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mPango, "Gravity"); RG_DEF_SMETHOD(to_rotation, 1); RG_DEF_SMETHOD_P(vertical, 1); G_DEF_CLASS(PANGO_TYPE_GRAVITY, "Gravity", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_GRAVITY, "PANGO_GRAVITY_"); G_DEF_CLASS(PANGO_TYPE_GRAVITY_HINT, "Hint", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_GRAVITY_HINT, "PANGO_GRAVITY_"); #endif } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoattribute.c0000644000175000017500000004006612257552170021350 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE pattr VALUE RG_TARGET_NAMESPACE, attrstring, pattrint, pattrfloat, pattrcolor, pattrbool; static VALUE type_to_klass; /***********************************************/ void pango_add_attribute(int attr_type, VALUE klass) { rb_hash_aset(type_to_klass, INT2FIX(attr_type), klass); } /* This is for Attributes which has PangoAttrType. */ VALUE pango_get_attribute_klass(VALUE attr_type) { VALUE type = Qnil; if (TYPE(attr_type) == T_STRING){ const char *strtype = RVAL2CSTR(attr_type); if (strcmp(strtype, "Attribute") == 0){ type = RG_TARGET_NAMESPACE; } else if (strcmp(strtype, "AttrString") == 0){ type = attrstring; } else if (strcmp(strtype, "AttrInt") == 0){ type = pattrint; } else if (strcmp(strtype, "AttrFloat") == 0){ type = pattrfloat; } else if (strcmp(strtype, "AttrColor") == 0){ type = pattrcolor; } else if (strcmp(strtype, "AttrBool") == 0){ type = pattrbool; } } else { type = rb_hash_aref(type_to_klass, INT2FIX(attr_type)); } return type; } VALUE pango_make_attribute(PangoAttribute *attr) { if (attr == NULL) return Qnil; return Data_Wrap_Struct(rb_hash_aref(type_to_klass, INT2FIX(attr->klass->type)), 0, pango_attribute_destroy, pango_attribute_copy(attr)); } PangoAttribute* pango_get_attribute(VALUE attr) { PangoAttribute *gattr; if (NIL_P(attr)) return NULL; if (!rb_obj_is_kind_of(attr, RG_TARGET_NAMESPACE)) { rb_raise(rb_eTypeError, "not a Pango::Attribute..."); } Data_Get_Struct(attr, PangoAttribute, gattr); return gattr; } /***********************************************/ static VALUE rg_s_allocate(VALUE klass) { /* Don't define destroy method here. return Data_Wrap_Struct(klass, 0, pango_attribute_destroy, 0); */ return Data_Wrap_Struct(klass, NULL, NULL, 0); } #ifdef HAVE_OBJECT_ALLOCATE #define attr_s_new rb_class_new_instance #else static VALUE rg_s_new(int argc, VALUE *argv, VALUE klass) { VALUE obj = rg_s_allocate(klass); rb_obj_call_init(obj, argc, argv); return obj; } #endif /***********************************************/ /* This method implemented at rbpangomain.c gboolean pango_parse_markup (const char *markup_text, int length, gunichar accel_marker, PangoAttrList **attr_list, char **text, gunichar *accel_char, GError **error); */ static VALUE rg_s_type_register(G_GNUC_UNUSED VALUE self, VALUE name) { return INT2NUM(pango_attr_type_register(RVAL2CSTR(name))); } static VALUE rg_operator_attr_equal(VALUE self, VALUE other) { return CBOOL2RVAL(pango_attribute_equal(RVAL2ATTR(self), RVAL2ATTR(other))); } /* * Structure accessors */ /* PangoAttribute */ static VALUE rg_start_index(VALUE self) { return UINT2NUM(RVAL2ATTR(self)->start_index); } static VALUE rg_set_start_index(VALUE self, VALUE value) { RVAL2ATTR(self)->start_index = NUM2UINT(value); return Qnil; } static VALUE rg_end_index(VALUE self) { return UINT2NUM(RVAL2ATTR(self)->end_index); } static VALUE rg_set_end_index(VALUE self, VALUE value) { RVAL2ATTR(self)->end_index = NUM2UINT(value); return Qnil; } /* PangoAttrString */ static VALUE attr_string_value(VALUE self) { return CSTR2RVAL(((PangoAttrString*)RVAL2ATTR(self))->value); } /* PangoAttrLanguage */ static VALUE attr_language_value(VALUE self) { return PANGOLANGUAGE2RVAL(((PangoAttrLanguage*)RVAL2ATTR(self))->value); } /* PangoAttrColor */ static VALUE attr_color_value(VALUE self) { PangoColor color = ((PangoAttrColor*)RVAL2ATTR(self))->color; return PANGOCOLOR2RVAL(&color); } /* PangoAttrInt */ static VALUE attr_int_value(VALUE self) { return INT2NUM(((PangoAttrInt*)RVAL2ATTR(self))->value); } /* PangoAttrFloat */ static VALUE attr_float_value(VALUE self) { return rb_float_new(((PangoAttrFloat*)RVAL2ATTR(self))->value); } /* PangoAttrBool(This is Ruby/Pango's original class) */ static VALUE attr_bool_value(VALUE self) { return CBOOL2RVAL(((PangoAttrInt*)RVAL2ATTR(self))->value); } /* PangoAttrFontDesc */ static VALUE attr_fontdesc_value(VALUE self) { return PANGOFONTDESCRIPTION2RVAL(((PangoAttrFontDesc*)RVAL2ATTR(self))->desc); } /* PangoAttrShape */ static VALUE attr_shape_ink_rect(VALUE self) { PangoRectangle rect = ((PangoAttrShape*)RVAL2ATTR(self))->ink_rect; return PANGORECTANGLE2RVAL(&rect); } static VALUE attr_shape_logical_rect(VALUE self) { PangoRectangle rect = ((PangoAttrShape*)RVAL2ATTR(self))->logical_rect; return PANGORECTANGLE2RVAL(&rect); } static VALUE attr_shape_value(VALUE self) { return rb_ary_new3(2, attr_shape_ink_rect(self), attr_shape_logical_rect(self)); } /* * Initialize methods */ #define MAKE_ATTRINT_INIT(klassname, funcname)\ static VALUE \ attr_ ## klassname ## _initialize(VALUE self, VALUE val)\ {\ DATA_PTR(self) = pango_attr_ ## funcname ## _new(NUM2INT(val));\ return Qnil;\ } #define MAKE_ATTRENUM_INIT(klassname, funcname, type)\ static VALUE \ attr_ ## klassname ## _initialize(VALUE self, VALUE val)\ {\ DATA_PTR(self) = pango_attr_ ## funcname ## _new(RVAL2GENUM(val, type));\ return Qnil;\ } static VALUE attr_AttrLanguage_initialize(VALUE self, VALUE lang) { DATA_PTR(self) = pango_attr_language_new( RVAL2PANGOLANGUAGE(lang)); return Qnil; } static VALUE attr_AttrFamily_initialize(VALUE self, VALUE family) { DATA_PTR(self) = pango_attr_family_new(RVAL2CSTR(family)); return Qnil; } MAKE_ATTRENUM_INIT(AttrStyle, style, PANGO_TYPE_STYLE); MAKE_ATTRENUM_INIT(AttrVariant, variant, PANGO_TYPE_VARIANT); MAKE_ATTRENUM_INIT(AttrStretch, stretch, PANGO_TYPE_STRETCH); MAKE_ATTRENUM_INIT(AttrWeight, weight, PANGO_TYPE_WEIGHT); static VALUE attr_AttrSize_initialize(VALUE self, VALUE size) { DATA_PTR(self) = pango_attr_size_new(NUM2INT(size)); return Qnil; } static VALUE attr_AttrAbsoluteSize_initialize(VALUE self, VALUE size) { DATA_PTR(self) = pango_attr_size_new_absolute(NUM2INT(size)); return Qnil; } #if PANGO_CHECK_VERSION(1,16,0) static VALUE attr_AttrGravity_initialize(VALUE self, VALUE gravity) { DATA_PTR(self) = pango_attr_gravity_new(RVAL2PANGOGRAVITY(gravity)); return Qnil; } static VALUE attr_AttrGravityHint_initialize(VALUE self, VALUE gravity_hint) { DATA_PTR(self) = pango_attr_gravity_hint_new(RVAL2PANGOGRAVITYHINT(gravity_hint)); return Qnil; } #endif static VALUE attr_AttrFontDescription_initialize(VALUE self, VALUE fontdescription) { DATA_PTR(self) = pango_attr_font_desc_new(RVAL2PANGOFONTDESCRIPTION(fontdescription)); return Qnil; } static VALUE attr_AttrForeground_initialize(VALUE self, VALUE r, VALUE g, VALUE b) { DATA_PTR(self) = pango_attr_foreground_new(FIX2UINT(r), FIX2UINT(g), FIX2UINT(b)); return Qnil; } static VALUE attr_AttrBackground_initialize(VALUE self, VALUE r, VALUE g, VALUE b) { DATA_PTR(self) = pango_attr_background_new(FIX2UINT(r), FIX2UINT(g), FIX2UINT(b)); return Qnil; } static VALUE attr_AttrStrikethrough_initialize(VALUE self, VALUE strikethrough) { DATA_PTR(self) = pango_attr_strikethrough_new(RVAL2CBOOL(strikethrough)); return Qnil; } #ifdef HAVE_PANGO_ATTR_STRIKETHROUGH_COLOR_NEW static VALUE attr_AttrStrikethroughColor_initialize(VALUE self, VALUE r, VALUE g, VALUE b) { DATA_PTR(self) = pango_attr_strikethrough_color_new(FIX2UINT(r), FIX2UINT(g), FIX2UINT(b)); return Qnil; } #endif MAKE_ATTRENUM_INIT(AttrUnderline, underline, PANGO_TYPE_UNDERLINE); #ifdef HAVE_PANGO_ATTR_UNDERLINE_COLOR_NEW static VALUE attr_AttrUnderlineColor_initialize(VALUE self, VALUE r, VALUE g, VALUE b) { DATA_PTR(self) = pango_attr_underline_color_new(FIX2UINT(r), FIX2UINT(g), FIX2UINT(b)); return Qnil; } #endif static VALUE attr_AttrShape_initialize(int argc, VALUE *argv, VALUE self) { VALUE ink_rect, logical_rect, data; rb_scan_args(argc, argv, "21", &ink_rect, &logical_rect, &data); if (NIL_P(data)){ DATA_PTR(self) = pango_attr_shape_new( RVAL2PANGORECTANGLE(ink_rect), RVAL2PANGORECTANGLE(logical_rect)); } else { G_RELATIVE(self, data); DATA_PTR(self) = pango_attr_shape_new_with_data( RVAL2PANGORECTANGLE(ink_rect), RVAL2PANGORECTANGLE(logical_rect), (gpointer)data, NULL, NULL); } return Qnil; } static VALUE attr_AttrScale_initialize(VALUE self, VALUE scale) { DATA_PTR(self) = pango_attr_scale_new(NUM2DBL(scale)); return Qnil; } static VALUE attr_AttrFallback_initialize(VALUE self, VALUE enable_fallback) { DATA_PTR(self) = pango_attr_fallback_new(RVAL2CBOOL(enable_fallback)); return Qnil; } MAKE_ATTRINT_INIT(AttrRise, rise); MAKE_ATTRINT_INIT(AttrLetterSpacing, letter_spacing); #define MAKE_ATTR(gtype, name, parent, num)\ tmpklass = rb_define_class_under(mPango, #name, parent);\ rb_hash_aset(type_to_klass, INT2FIX(gtype), tmpklass);\ rbg_define_method(tmpklass, "initialize", attr_## name ## _initialize , num); void Init_pango_attribute(VALUE mPango) { VALUE tmpklass; RG_TARGET_NAMESPACE = rb_define_class_under(mPango, "Attribute", rb_cData); RG_DEF_SMETHOD(type_register, 1); RG_DEF_METHOD_OPERATOR("==", attr_equal, 1); RG_DEF_METHOD(start_index, 0); RG_DEF_METHOD(set_start_index, 1); RG_DEF_METHOD(end_index, 0); RG_DEF_METHOD(set_end_index, 1); #ifndef HAVE_RB_DEFINE_ALLOC_FUNC RG_DEF_SMETHOD(allocate, 0); #else rb_define_alloc_func(RG_TARGET_NAMESPACE, (VALUE(*)_((VALUE)))rg_s_allocate); #endif #ifndef HAVE_OBJECT_ALLOCATE RG_DEF_SMETHOD(new, -1); #endif attrstring = rb_define_class_under(mPango, "AttrString", RG_TARGET_NAMESPACE); rbg_define_method(attrstring, "value", attr_string_value, 0); pattrint = rb_define_class_under(mPango, "AttrInt", RG_TARGET_NAMESPACE); rbg_define_method(pattrint, "value", attr_int_value, 0); pattrfloat = rb_define_class_under(mPango, "AttrFloat", RG_TARGET_NAMESPACE); rbg_define_method(pattrfloat, "value", attr_float_value, 0); pattrcolor = rb_define_class_under(mPango, "AttrColor", RG_TARGET_NAMESPACE); rbg_define_method(pattrcolor, "value", attr_color_value, 0); pattrbool = rb_define_class_under(mPango, "AttrBool", RG_TARGET_NAMESPACE); rbg_define_method(pattrbool, "value", attr_bool_value, 0); rb_global_variable(&type_to_klass); type_to_klass = rb_hash_new(); MAKE_ATTR(PANGO_ATTR_LANGUAGE, AttrLanguage, RG_TARGET_NAMESPACE, 1); rbg_define_method(tmpklass, "value", attr_language_value, 0); MAKE_ATTR(PANGO_ATTR_FAMILY, AttrFamily, attrstring, 1); MAKE_ATTR(PANGO_ATTR_STYLE, AttrStyle, pattrint, 1); MAKE_ATTR(PANGO_ATTR_WEIGHT, AttrWeight, pattrint, 1); MAKE_ATTR(PANGO_ATTR_VARIANT, AttrVariant, pattrint, 1); MAKE_ATTR(PANGO_ATTR_STRETCH, AttrStretch, pattrint, 1); MAKE_ATTR(PANGO_ATTR_SIZE, AttrSize, pattrint, 1); MAKE_ATTR(PANGO_ATTR_ABSOLUTE_SIZE, AttrAbsoluteSize, pattrint, 1); #if PANGO_CHECK_VERSION(1,16,0) MAKE_ATTR(PANGO_ATTR_GRAVITY, AttrGravity, pattrint, 1); MAKE_ATTR(PANGO_ATTR_GRAVITY_HINT, AttrGravityHint, pattrint, 1); #endif MAKE_ATTR(PANGO_ATTR_FONT_DESC, AttrFontDescription, RG_TARGET_NAMESPACE, 1); rbg_define_method(tmpklass, "value", attr_fontdesc_value, 0); MAKE_ATTR(PANGO_ATTR_FOREGROUND, AttrForeground, pattrcolor, 3); MAKE_ATTR(PANGO_ATTR_BACKGROUND, AttrBackground, pattrcolor, 3); MAKE_ATTR(PANGO_ATTR_UNDERLINE, AttrUnderline, pattrint, 1); /* PangoUnderline */ G_DEF_CLASS(PANGO_TYPE_UNDERLINE, "Underline", tmpklass); G_DEF_CONSTANTS(tmpklass, PANGO_TYPE_UNDERLINE, "PANGO_UNDERLINE_"); #ifdef HAVE_PANGO_ATTR_UNDERLINE_COLOR_NEW MAKE_ATTR(PANGO_ATTR_UNDERLINE_COLOR, AttrUnderlineColor, pattrcolor, 3); #endif MAKE_ATTR(PANGO_ATTR_STRIKETHROUGH, AttrStrikethrough, pattrbool, 1); #ifdef HAVE_PANGO_ATTR_STRIKETHROUGH_COLOR_NEW MAKE_ATTR(PANGO_ATTR_STRIKETHROUGH_COLOR, AttrStrikethroughColor, pattrcolor, 3); #endif MAKE_ATTR(PANGO_ATTR_RISE, AttrRise, pattrint, 1); MAKE_ATTR(PANGO_ATTR_LETTER_SPACING, AttrLetterSpacing, pattrint, 1); MAKE_ATTR(PANGO_ATTR_SHAPE, AttrShape, RG_TARGET_NAMESPACE, -1); rbg_define_method(tmpklass, "ink_rect", attr_shape_ink_rect, 0); rbg_define_method(tmpklass, "logical_rect", attr_shape_logical_rect, 0); rbg_define_method(tmpklass, "value", attr_shape_value, 0); MAKE_ATTR(PANGO_ATTR_SCALE, AttrScale, pattrfloat, 1); /* PangoScale */ rb_define_const(tmpklass, "XX_SMALL", rb_float_new(PANGO_SCALE_XX_SMALL)); rb_define_const(tmpklass, "X_SMALL", rb_float_new(PANGO_SCALE_X_SMALL)); rb_define_const(tmpklass, "SMALL", rb_float_new(PANGO_SCALE_SMALL)); rb_define_const(tmpklass, "MEDIUM", rb_float_new(PANGO_SCALE_MEDIUM)); rb_define_const(tmpklass, "LARGE", rb_float_new(PANGO_SCALE_LARGE)); rb_define_const(tmpklass, "X_LARGE", rb_float_new(PANGO_SCALE_X_LARGE)); rb_define_const(tmpklass, "XX_LARGE", rb_float_new(PANGO_SCALE_XX_LARGE)); MAKE_ATTR(PANGO_ATTR_FALLBACK, AttrFallback, pattrbool, 1); /* PangoAttrType */ G_DEF_CLASS(PANGO_TYPE_ATTR_TYPE, "Type", RG_TARGET_NAMESPACE); #define INT2ATTRTYPE(x) rbgobj_make_enum((x), PANGO_TYPE_ATTR_TYPE) rb_define_const(RG_TARGET_NAMESPACE, "TYPE_INVALID", INT2ATTRTYPE(PANGO_ATTR_INVALID)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_LANGUAGE", INT2ATTRTYPE(PANGO_ATTR_LANGUAGE)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_FAMILY", INT2ATTRTYPE(PANGO_ATTR_FAMILY)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STYLE", INT2ATTRTYPE(PANGO_ATTR_STYLE)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_WEIGHT", INT2ATTRTYPE(PANGO_ATTR_WEIGHT)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_VARIANT", INT2ATTRTYPE(PANGO_ATTR_VARIANT)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRETCH", INT2ATTRTYPE(PANGO_ATTR_STRETCH)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_SIZE", INT2ATTRTYPE(PANGO_ATTR_SIZE)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_FONT_DESC", INT2ATTRTYPE(PANGO_ATTR_FONT_DESC)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_FOREGROUND", INT2ATTRTYPE(PANGO_ATTR_FOREGROUND)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_BACKGROUND", INT2ATTRTYPE(PANGO_ATTR_BACKGROUND)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_UNDERLINE", INT2ATTRTYPE(PANGO_ATTR_UNDERLINE)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRIKETHROUGH", INT2ATTRTYPE(PANGO_ATTR_STRIKETHROUGH)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRIKETHROUGH_COLOR", INT2ATTRTYPE(PANGO_ATTR_STRIKETHROUGH_COLOR)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_RISE", INT2ATTRTYPE(PANGO_ATTR_RISE)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_SHAPE", INT2ATTRTYPE(PANGO_ATTR_SHAPE)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_SCALE", INT2ATTRTYPE(PANGO_ATTR_SCALE)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_FALLBACK", INT2ATTRTYPE(PANGO_ATTR_FALLBACK)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_LETTER_SPACING", INT2ATTRTYPE(PANGO_ATTR_LETTER_SPACING)); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoglyphinfo.c0000664000175000017500000000603311740310343021330 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cGlyphInfo #define _SELF(self) (RVAL2PANGOGLYPHINFO(self)) /**********************************/ static PangoGlyphInfo * pango_glyph_info_copy(const PangoGlyphInfo *info) { PangoGlyphInfo *data; g_return_val_if_fail(info != NULL, NULL); data = g_new(PangoGlyphInfo, 1); *data = *info; return data; } GType pango_glyph_info_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("PangoGlyphInfo", (GBoxedCopyFunc)pango_glyph_info_copy, (GBoxedFreeFunc)g_free); return our_type; } /**********************************/ static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_new0(PangoGlyphInfo, 1)); return Qnil; } static VALUE rg_glyph(VALUE self) { return UINT2NUM(_SELF(self)->glyph); } static VALUE rg_set_glyph(VALUE self, VALUE val) { _SELF(self)->glyph = NUM2UINT(val); return self; } static VALUE rg_geometry(VALUE self) { PangoGlyphGeometry geo = _SELF(self)->geometry; return rb_ary_new3(3, INT2NUM(geo.width), INT2NUM(geo.x_offset), INT2NUM(geo.y_offset)); } static VALUE rg_set_geometry(VALUE self, VALUE width, VALUE x_offset, VALUE y_offset) { PangoGlyphGeometry geo = _SELF(self)->geometry; geo.width = NUM2INT(width); geo.x_offset = NUM2INT(x_offset); geo.y_offset = NUM2INT(y_offset); return self; } /* This method may be changed in the future following Pango implementation. */ static VALUE rg_cluster_start_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->attr.is_cluster_start); } static VALUE rg_set_cluster_start(VALUE self, VALUE val) { _SELF(self)->attr.is_cluster_start = RVAL2CBOOL(val); return self; } void Init_pango_glyph_info(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_GLYPH_INFO, "GlyphInfo", mPango); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(glyph, 0); RG_DEF_METHOD(set_glyph, 1); RG_DEF_METHOD(geometry, 0); RG_DEF_METHOD(set_geometry, 3); RG_DEF_METHOD_P(cluster_start, 0); RG_DEF_METHOD(set_cluster_start, 1); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoglyphitem.c0000644000175000017500000000661212257552170021346 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cGlyphItem #define _SELF(r) (RVAL2PANGOGLYPHITEM(r)) /**********************************/ #ifndef HAVE_PANGO_GLYPH_ITEM_GET_TYPE static PangoGlyphItem* glyph_item_copy(const PangoGlyphItem *ref) { PangoGlyphItem* new_ref; g_return_val_if_fail (ref != NULL, NULL); new_ref = g_new(PangoGlyphItem, 1); *new_ref = *ref; return new_ref; } # ifndef HAVE_PANGO_GLYPH_ITEM_FREE void pango_glyph_item_free(PangoGlyphItem* glyph_item) { if (glyph_item->item) pango_item_free(glyph_item->item); if (glyph_item->glyphs) pango_glyph_string_free(glyph_item->glyphs); g_free(glyph_item); } # endif GType pango_glyph_item_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("PangoGlyphItem", (GBoxedCopyFunc)glyph_item_copy, (GBoxedFreeFunc)pango_glyph_item_free); return our_type; } #endif /**********************************/ static VALUE rg_item(VALUE self) { PangoItem* item = _SELF(self)->item; return PANGOITEM2RVAL(item); } static VALUE rg_glyphs(VALUE self) { PangoGlyphString* glyphs = _SELF(self)->glyphs; return PANGOGLYPHSTRING2RVAL(glyphs); } static VALUE rg_split(VALUE self, VALUE text, VALUE split_index) { return PANGOGLYPHITEM2RVAL(pango_glyph_item_split(_SELF(self), RVAL2CSTR(text), NUM2INT(split_index))); } static VALUE rg_appy_attrs(VALUE self, VALUE text, VALUE attrs) { GSList* list = pango_glyph_item_apply_attrs(_SELF(self), RVAL2CSTR(text), RVAL2PANGOATTRLIST(attrs)); VALUE ret = rb_ary_new(); while (list) { rb_ary_push(ret, PANGOGLYPHITEM2RVAL(list->data)); pango_glyph_item_free(list->data); list = list->next; } g_slist_free(list); return ret; } static VALUE rg_letter_space(VALUE self, VALUE text, VALUE log_attrs, VALUE letter_spacing) { pango_glyph_item_letter_space(_SELF(self), RVAL2CSTR(text), RVAL2PANGOLOGATTR(log_attrs), NUM2INT(letter_spacing)); return self; } void Init_pango_glyph_item(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_GLYPH_ITEM, "GlyphItem", mPango); RG_DEF_METHOD(item, 0); RG_DEF_METHOD(glyphs, 0); RG_DEF_METHOD(split, 2); RG_DEF_METHOD(appy_attrs, 2); RG_DEF_METHOD(letter_space, 3); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangolayout.c0000644000175000017500000003410212257552170020654 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cLayout #define _SELF(self) (RVAL2PANGOLAYOUT(self)) static VALUE rg_initialize(VALUE self, VALUE context) { G_INITIALIZE(self, pango_layout_new(RVAL2PANGOCONTEXT(context))); return Qnil; } static VALUE rg_copy(VALUE self) { return GOBJ2RVAL_UNREF(pango_layout_copy(_SELF(self))); } static VALUE rg_context(VALUE self) { return GOBJ2RVAL(pango_layout_get_context(_SELF(self))); } static VALUE rg_context_changed(VALUE self) { pango_layout_context_changed(_SELF(self)); return Qnil; } static VALUE rg_set_text(VALUE self, VALUE text) { StringValue(text); pango_layout_set_text(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text)); return self; } static VALUE rg_text(VALUE self) { return CSTR2RVAL(pango_layout_get_text(_SELF(self))); } static VALUE rg_set_markup(int argc, VALUE *argv, VALUE self) { VALUE markup, accel_marker; gunichar accel_char = 0; rb_scan_args(argc, argv, "11", &markup, &accel_marker); StringValue(markup); if (NIL_P(accel_marker)){ pango_layout_set_markup(_SELF(self), RSTRING_PTR(markup), RSTRING_LEN(markup)); } else { pango_layout_set_markup_with_accel(_SELF(self), RSTRING_PTR(markup), RSTRING_LEN(markup), NUM2CHR(accel_marker), &accel_char); } return CHR2FIX(accel_char); } static VALUE rg_operator_layout_set_markup_eq(VALUE self, VALUE markup) { StringValue(markup); pango_layout_set_markup(_SELF(self), RSTRING_PTR(markup), RSTRING_LEN(markup)); return markup; } static VALUE rg_set_attributes(VALUE self, VALUE attrs) { pango_layout_set_attributes(_SELF(self), RVAL2PANGOATTRLIST(attrs)); return self; } static VALUE rg_attributes(VALUE self) { return PANGOATTRLIST2RVAL(pango_layout_get_attributes(_SELF(self))); } static VALUE rg_set_font_description(VALUE self, VALUE rb_desc) { PangoFontDescription *desc; gboolean desc_created = FALSE; if (RVAL2CBOOL(rb_obj_is_kind_of(rb_desc, rb_cString))) { desc = pango_font_description_from_string(RVAL2CSTR(rb_desc)); desc_created = TRUE; } else { desc = RVAL2PANGOFONTDESCRIPTION(rb_desc); } pango_layout_set_font_description(_SELF(self), desc); if (desc_created) pango_font_description_free(desc); return self; } static VALUE rg_font_description(VALUE self) { const PangoFontDescription* desc = pango_layout_get_font_description(_SELF(self)); return PANGOFONTDESCRIPTION2RVAL((gpointer)desc); } static VALUE rg_set_width(VALUE self, VALUE width) { pango_layout_set_width(_SELF(self), NUM2INT(width)); return self; } static VALUE rg_width(VALUE self) { return INT2NUM(pango_layout_get_width(_SELF(self))); } #if PANGO_CHECK_VERSION(1, 20, 0) static VALUE rg_set_height(VALUE self, VALUE width) { pango_layout_set_height(_SELF(self), NUM2INT(width)); return self; } static VALUE rg_height(VALUE self) { return INT2NUM(pango_layout_get_height(_SELF(self))); } #endif static VALUE rg_set_wrap(VALUE self, VALUE wrap) { pango_layout_set_wrap(_SELF(self), RVAL2PANGOWRAPMODE(wrap)); return self; } static VALUE rg_wrap(VALUE self) { return PANGOWRAPMODE2RVAL(pango_layout_get_wrap(_SELF(self))); } static VALUE rg_set_ellipsize(VALUE self, VALUE ellipsize) { pango_layout_set_ellipsize(_SELF(self), RVAL2PANGOELLIPSIZEMODE(ellipsize)); return self; } static VALUE rg_ellipsize(VALUE self) { return PANGOELLIPSIZEMODE2RVAL(pango_layout_get_ellipsize(_SELF(self))); } #if PANGO_CHECK_VERSION(1, 16, 0) static VALUE rg_ellipsized_p(VALUE self) { return CBOOL2RVAL(pango_layout_is_ellipsized(_SELF(self))); } #endif static VALUE rg_set_indent(VALUE self, VALUE indent) { pango_layout_set_indent(_SELF(self), NUM2INT(indent)); return self; } static VALUE rg_indent(VALUE self) { return INT2NUM(pango_layout_get_indent(_SELF(self))); } static VALUE rg_spacing(VALUE self) { return INT2NUM(pango_layout_get_spacing(_SELF(self))); } static VALUE rg_set_spacing(VALUE self, VALUE spacing) { pango_layout_set_spacing(_SELF(self), NUM2INT(spacing)); return self; } static VALUE rg_set_justify(VALUE self, VALUE justify) { pango_layout_set_justify(_SELF(self), RVAL2CBOOL(justify)); return self; } static VALUE rg_justify_p(VALUE self) { return CBOOL2RVAL(pango_layout_get_justify(_SELF(self))); } static VALUE rg_set_auto_dir(VALUE self, VALUE auto_dir) { pango_layout_set_auto_dir(_SELF(self), RVAL2CBOOL(auto_dir)); return self; } static VALUE rg_auto_dir_p(VALUE self) { return CBOOL2RVAL(pango_layout_get_auto_dir(_SELF(self))); } static VALUE rg_set_alignment(VALUE self, VALUE align) { pango_layout_set_alignment(_SELF(self), RVAL2PANGOALIGNMENT(align)); return self; } static VALUE rg_alignment(VALUE self) { return PANGOALIGNMENT2RVAL(pango_layout_get_alignment(_SELF(self))); } static VALUE rg_set_tabs(VALUE self, VALUE tabs) { pango_layout_set_tabs(_SELF(self), RVAL2PANGOTABARRAY(tabs)); return self; } static VALUE rg_tabs(VALUE self) { VALUE ret = Qnil; PangoTabArray* tabs = pango_layout_get_tabs(_SELF(self)); if (tabs) { ret = PANGOTABARRAY2RVAL(tabs); pango_tab_array_free(tabs); } return ret; } static VALUE rg_set_single_paragraph_mode(VALUE self, VALUE setting) { pango_layout_set_single_paragraph_mode(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_single_paragraph_mode_p(VALUE self) { return CBOOL2RVAL(pango_layout_get_single_paragraph_mode(_SELF(self))); } static VALUE rg_log_attrs(VALUE self) { PangoLogAttr* attrs; gint i, n_attrs; VALUE ary; pango_layout_get_log_attrs(_SELF(self), &attrs, &n_attrs); ary = rb_ary_new(); for (i = 0; i < n_attrs; i++) { rb_ary_assoc(ary, PANGOLOGATTR2RVAL(&attrs[i])); } g_free(attrs); return ary; } static VALUE rg_xy_to_index(VALUE self, VALUE x, VALUE y) { int index, trailing; gboolean ret = pango_layout_xy_to_index(_SELF(self), NUM2INT(x), NUM2INT(y), &index, &trailing); return rb_ary_new3(3, CBOOL2RVAL(ret), INT2NUM(index), INT2NUM(trailing)); } static VALUE rg_index_to_pos(VALUE self, VALUE index) { PangoRectangle pos; pango_layout_index_to_pos(_SELF(self), NUM2INT(index), &pos); return PANGORECTANGLE2RVAL(&pos); } static VALUE rg_get_cursor_pos(VALUE self, VALUE index) { PangoRectangle strong_pos, weak_pos; pango_layout_get_cursor_pos(_SELF(self), NUM2INT(index), &strong_pos, &weak_pos); return rb_ary_new3(2, PANGORECTANGLE2RVAL(&strong_pos), PANGORECTANGLE2RVAL(&weak_pos)); } static VALUE rg_move_cursor_visually(VALUE self, VALUE strong, VALUE old_index, VALUE old_trailing, VALUE direction) { int new_index, new_trailing; pango_layout_move_cursor_visually(_SELF(self), RVAL2CBOOL(strong), NUM2INT(old_index), NUM2INT(old_trailing), NUM2INT(direction), &new_index, &new_trailing); return rb_ary_new3(2, INT2NUM(new_index), INT2NUM(new_trailing)); } static VALUE rg_get_extents(int argc, VALUE *argv, VALUE self) { VALUE ink_rect, logical_rect; PangoRectangle rink, rlog; rb_scan_args(argc, argv, "02", &ink_rect, &logical_rect); if (NIL_P(ink_rect)){ rink.x = 0; rink.y = 0; rink.width = 0; rink.height = 0; } else { PangoRectangle* rect = RVAL2PANGORECTANGLE(ink_rect); rink.x = rect->x; rink.y = rect->y; rink.width = rect->width; rink.height = rect->height; } if (NIL_P(logical_rect)){ rlog.x = 0; rlog.y = 0; rlog.width = 0; rlog.height = 0; } else { PangoRectangle* rect = RVAL2PANGORECTANGLE(logical_rect); rlog.x = rect->x; rlog.y = rect->y; rlog.width = rect->width; rlog.height = rect->height; } pango_layout_get_extents(_SELF(self), &rink, &rlog); return rb_assoc_new(PANGORECTANGLE2RVAL(&rink), PANGORECTANGLE2RVAL(&rlog)); } static VALUE rg_extents(VALUE self) { PangoRectangle rink = {0, 0, 0, 0}; PangoRectangle rlog = {0, 0, 0, 0}; pango_layout_get_extents(_SELF(self), &rink, &rlog); return rb_assoc_new(PANGORECTANGLE2RVAL(&rink), PANGORECTANGLE2RVAL(&rlog)); } static VALUE rg_get_pixel_extents(int argc, VALUE *argv, VALUE self) { VALUE ink_rect, logical_rect; PangoRectangle rink, rlog; rb_scan_args(argc, argv, "02", &ink_rect, &logical_rect); if (NIL_P(ink_rect)){ rink.x = 0; rink.y = 0; rink.width = 0; rink.height = 0; } else { PangoRectangle* rect = RVAL2PANGORECTANGLE(ink_rect); rink.x = rect->x; rink.y = rect->y; rink.width = rect->width; rink.height = rect->height; } if (NIL_P(logical_rect)){ rlog.x = 0; rlog.y = 0; rlog.width = 0; rlog.height = 0; } else { PangoRectangle* rect = RVAL2PANGORECTANGLE(logical_rect); rlog.x = rect->x; rlog.y = rect->y; rlog.width = rect->width; rlog.height = rect->height; } pango_layout_get_pixel_extents(_SELF(self), &rink, &rlog); return rb_assoc_new(PANGORECTANGLE2RVAL(&rink), PANGORECTANGLE2RVAL(&rlog)); } static VALUE rg_pixel_extents(VALUE self) { PangoRectangle rink = {0, 0, 0, 0}; PangoRectangle rlog = {0, 0, 0, 0}; pango_layout_get_pixel_extents(_SELF(self), &rink, &rlog); return rb_assoc_new(PANGORECTANGLE2RVAL(&rink), PANGORECTANGLE2RVAL(&rlog)); } static VALUE rg_size(VALUE self) { int width, height; pango_layout_get_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_pixel_size(VALUE self) { int width, height; pango_layout_get_pixel_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_line_count(VALUE self) { return INT2NUM(pango_layout_get_line_count(_SELF(self))); } static VALUE rg_get_line(VALUE self, VALUE line) { return PANGOLAYOUTLINE2RVAL(pango_layout_get_line(_SELF(self), NUM2INT(line))); } static VALUE rg_lines(VALUE self) { return GSLIST2ARY2(pango_layout_get_lines(_SELF(self)), PANGO_TYPE_LAYOUT_LINE); } static VALUE rg_iter(VALUE self) { return PANGOLAYOUTITER2RVAL(pango_layout_get_iter(_SELF(self))); } void Init_pango_layout(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_LAYOUT, "Layout", mPango); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(copy, 0); RG_DEF_METHOD(context, 0); RG_DEF_METHOD(context_changed, 0); RG_DEF_METHOD(set_text, 1); RG_DEF_METHOD(text, 0); RG_DEF_METHOD(set_markup, -1); RG_DEF_METHOD_OPERATOR("markup=", layout_set_markup_eq, 1); RG_DEF_METHOD(set_attributes, 1); RG_DEF_METHOD(attributes, 0); RG_DEF_METHOD(set_font_description, 1); RG_DEF_METHOD(font_description, 0); RG_DEF_METHOD(set_width, 1); RG_DEF_METHOD(width, 0); #if PANGO_CHECK_VERSION(1, 20, 0) RG_DEF_METHOD(set_height, 1); RG_DEF_METHOD(height, 0); #endif RG_DEF_METHOD(set_wrap, 1); RG_DEF_METHOD(wrap, 0); RG_DEF_METHOD(set_ellipsize, 1); RG_DEF_METHOD(ellipsize, 0); #if PANGO_CHECK_VERSION(1, 16, 0) RG_DEF_METHOD_P(ellipsized, 0); #endif RG_DEF_METHOD(set_indent, 1); RG_DEF_METHOD(indent, 0); RG_DEF_METHOD(spacing, 0); RG_DEF_METHOD(set_spacing, 1); RG_DEF_METHOD(set_justify, 1); RG_DEF_METHOD_P(justify, 0); RG_DEF_METHOD(set_auto_dir, 1); RG_DEF_METHOD_P(auto_dir, 0); RG_DEF_METHOD(set_alignment, 1); RG_DEF_METHOD(alignment, 0); RG_DEF_METHOD(set_tabs, 1); RG_DEF_METHOD(tabs, 0); RG_DEF_METHOD(set_single_paragraph_mode, 1); RG_DEF_METHOD_P(single_paragraph_mode, 0); RG_DEF_METHOD(log_attrs, 0); RG_DEF_METHOD(xy_to_index, 2); RG_DEF_METHOD(index_to_pos, 1); RG_DEF_METHOD(get_cursor_pos, 1); RG_DEF_METHOD(move_cursor_visually, 4); RG_DEF_METHOD(get_extents, -1); RG_DEF_METHOD(extents, 0); RG_DEF_METHOD(get_pixel_extents, -1); RG_DEF_METHOD(pixel_extents, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(pixel_size, 0); RG_DEF_METHOD(line_count, 0); RG_DEF_METHOD(get_line, 1); RG_DEF_METHOD(lines, 0); RG_DEF_METHOD(iter, 0); /* PangoWrapMode */ G_DEF_CLASS(PANGO_TYPE_WRAP_MODE, "WrapMode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_WRAP_MODE, "PANGO_"); /* PangoAlignment */ G_DEF_CLASS(PANGO_TYPE_ALIGNMENT, "Alignment", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_ALIGNMENT, "PANGO_"); /* PangoEllipsizeMode */ G_DEF_CLASS(PANGO_TYPE_ELLIPSIZE_MODE, "EllipsizeMode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_ELLIPSIZE_MODE, "PANGO_"); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoattriterator.c0000644000175000017500000000723311701304107022054 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cAttrIterator #define _SELF(self) (RVAL2PANGOATTRITERATOR(self)) /**********************************/ GType pango_attr_iter_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("PangoAttrIterator", (GBoxedCopyFunc)pango_attr_iterator_copy, (GBoxedFreeFunc)pango_attr_iterator_destroy); return our_type; } /**********************************/ static VALUE rg_next_bang(VALUE self) { return CBOOL2RVAL(pango_attr_iterator_next(_SELF(self))); } static VALUE rg_range(VALUE self) { gint start = 0; gint end = 0; pango_attr_iterator_range(_SELF(self), &start, &end); return rb_ary_new3(2, INT2NUM(start), INT2NUM(end)); } static VALUE rg_get(int argc, VALUE *argv, VALUE self) { VALUE type, ret; PangoAttribute* attr; int i; rb_scan_args(argc, argv, "01", &type); if (NIL_P(type)){ PangoAttrIterator* iter = _SELF(self); ret = rb_ary_new(); for (i = 0; i < PANGO_ATTR_SCALE + 1; i++){ attr = pango_attr_iterator_get(iter, i); if (attr) rb_ary_push(ret, ATTR2RVAL(attr)); } } else { attr = pango_attr_iterator_get(_SELF(self), FIX2INT(type)); ret = attr ? ATTR2RVAL(attr) : Qnil; } return ret; } static VALUE rg_font(VALUE self) { PangoFontDescription* desc; PangoLanguage* lang; GSList* extra_attrs; VALUE ary, ret; desc = pango_font_description_new(); pango_attr_iterator_get_font(_SELF(self), desc, &lang, &extra_attrs); ary = rb_ary_new(); while(extra_attrs) { rb_ary_push(ary, ATTR2RVAL(extra_attrs->data)); extra_attrs = extra_attrs->next; } ret = rb_ary_new3(3, PANGOFONTDESCRIPTION2RVAL(desc), PANGOLANGUAGE2RVAL(lang), ary); pango_font_description_free(desc); return ret; } #ifdef HAVE_PANGO_ATTR_ITERATOR_GET_ATTRS static VALUE rg_attrs(VALUE self) { GSList* list = pango_attr_iterator_get_attrs(_SELF(self)); GSList* base = list; GSList* old = list; VALUE ary = rb_ary_new(); while (list) { rb_ary_push(ary, ATTR2RVAL(list->data)); list = list->next; } while (old) { pango_attribute_destroy((PangoAttribute*)old); old = old->next; } g_slist_free(base); return ary; } #endif void Init_pango_attriterator(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_ATTR_ITERATOR, "AttrIterator", mPango); RG_DEF_METHOD_BANG(next, 0); RG_DEF_METHOD(range, 0); RG_DEF_METHOD(get, -1); RG_DEF_METHOD(font, 0); #ifdef HAVE_PANGO_ATTR_ITERATOR_GET_ATTRS RG_DEF_METHOD(attrs, 0); #endif } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoattrlist.c0000644000175000017500000000521012257552170021203 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" static ID id_call; #define RG_TARGET_NAMESPACE cAttrList #define _SELF(self) (RVAL2PANGOATTRLIST(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, pango_attr_list_new()); return Qnil; } static VALUE rg_insert(VALUE self, VALUE attr) { pango_attr_list_insert(_SELF(self), RVAL2ATTR(attr)); return self; } static VALUE rg_insert_before(VALUE self, VALUE attr) { pango_attr_list_insert_before(_SELF(self), RVAL2ATTR(attr)); return self; } static VALUE rg_change(VALUE self, VALUE attr) { pango_attr_list_change(_SELF(self), RVAL2ATTR(attr)); return self; } static VALUE rg_splice(VALUE self, VALUE other, VALUE pos, VALUE len) { pango_attr_list_splice(_SELF(self), _SELF(other), NUM2INT(pos), NUM2INT(len)); return self; } static gboolean filter_func(PangoAttribute *attr, gpointer data) { return CBOOL2RVAL(rb_funcall((VALUE)data, id_call, 1, ATTR2RVAL(attr))); } static VALUE rg_filter(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); return PANGOATTRLIST2RVAL(pango_attr_list_filter(_SELF(self), (PangoAttrFilterFunc)filter_func, (gpointer)func)); } static VALUE rg_iterator(VALUE self) { return PANGOATTRITERATOR2RVAL(pango_attr_list_get_iterator(_SELF(self))); } void Init_pango_attrlist(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_ATTR_LIST, "AttrList", mPango); id_call = rb_intern("call"); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(insert, 1); RG_DEF_METHOD(insert_before, 1); RG_DEF_METHOD(change, 1); RG_DEF_METHOD(splice, 3); RG_DEF_METHOD(filter, 0); RG_DEF_METHOD(iterator, 0); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangofontsetsimple.c0000644000175000017500000000330511701304107022220 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #ifdef PANGO_ENABLE_BACKEND #define RG_TARGET_NAMESPACE cFontsetSimple #define _SELF(self) (RVAL2PANGOFONTSETSIMPLE(self)) static VALUE rg_initialize(VALUE self, VALUE lang) { G_INITIALIZE(self, pango_fontset_simple_new(RVAL2PANGOLANGUAGE(lang))); return Qnil; } static VALUE rg_append(VALUE self, VALUE font) { pango_fontset_simple_append(_SELF(self), RVAL2PANGOFONT(font)); return self; } static VALUE rg_size(VALUE self) { return INT2NUM(pango_fontset_simple_size(_SELF(self))); } #endif void Init_pango_fontset_simple(VALUE mPango) { #ifdef PANGO_ENABLE_BACKEND VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONTSET_SIMPLE, "FontsetSimple", mPango); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(append, 1); RG_DEF_METHOD(size, 0); #endif } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoscript.c0000644000175000017500000000525112257552170020646 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cScript #define _SELF(r) (RVAL2PANGOSCRIPT(r)) static VALUE rg_s_for_unichar(G_GNUC_UNUSED VALUE self, VALUE ch) { return PANGOSCRIPT2RVAL(pango_script_for_unichar(NUM2UINT(ch))); } static VALUE rg_sample_language(VALUE self) { PangoLanguage* lang = pango_script_get_sample_language(_SELF(self)); return PANGOLANGUAGE2RVAL(lang); } #if PANGO_CHECK_VERSION(1,16,0) static VALUE rg_get_gravity(int argc, VALUE *argv, VALUE self) { VALUE wide, gravity, gravity_hint; int n; PangoGravity g; n = rb_scan_args(argc, argv, "21", &gravity, &gravity_hint, &wide); if (n == 2) { g = pango_gravity_get_for_script(_SELF(self), RVAL2PANGOGRAVITY(gravity), RVAL2PANGOGRAVITYHINT(gravity_hint)); } else { # if PANGO_CHECK_VERSION(1,26,0) g = pango_gravity_get_for_script_and_width(_SELF(self), RVAL2CBOOL(wide), RVAL2PANGOGRAVITY(gravity), RVAL2PANGOGRAVITYHINT(gravity_hint)); # else rb_raise(rb_eArgError, "the 3rd 'wide' argument requires Pango >= 1.26"); # endif } return PANGOGRAVITY2RVAL(g); } #endif /* Move to Pango::Language gboolean pango_language_includes_script (PangoLanguage *language, PangoScript script); */ void Init_pango_script(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_SCRIPT, "Script", mPango); RG_DEF_SMETHOD(for_unichar, 1); RG_DEF_METHOD(sample_language, 0); #if PANGO_CHECK_VERSION(1,16,0) RG_DEF_METHOD(get_gravity, -1); #endif } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangolanguage.c0000644000175000017500000000470512257552170021130 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2009 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cLanguage #define _SELF(self) (RVAL2PANGOLANGUAGE(self)) static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return PANGOLANGUAGE2RVAL(pango_language_get_default()); } static VALUE rg_initialize(VALUE self, VALUE language) { G_INITIALIZE(self, pango_language_from_string(RVAL2CSTR(language))); return Qnil; } static VALUE rg_s_to_string(G_GNUC_UNUSED VALUE self, VALUE language) { return CSTR2RVAL(pango_language_to_string(RVAL2CSTR(language))); } static VALUE rg_matches(int argc, VALUE *argv, VALUE self) { VALUE range_list; rb_scan_args(argc, argv, "01", &range_list); return CBOOL2RVAL(pango_language_matches(_SELF(self), RVAL2CSTR_ACCEPT_NIL(range_list))); } static VALUE rg_to_str(VALUE self) { return CSTR2RVAL(pango_language_to_string(_SELF(self))); } /* Moved from Pango::Script */ static VALUE rg_includes_script(VALUE self, VALUE script) { return CBOOL2RVAL(pango_language_includes_script(_SELF(self), RVAL2PANGOSCRIPT(script))); } void Init_pango_language(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_LANGUAGE, "Language", mPango); RG_DEF_SMETHOD(default, 0); RG_DEF_METHOD(initialize, 1); RG_DEF_SMETHOD(to_string, 1); RG_DEF_METHOD(matches, -1); RG_DEF_METHOD(to_str, 0); RG_DEF_ALIAS("to_s", "to_str"); RG_DEF_METHOD(includes_script, 1); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangofont.c0000644000175000017500000000666712257552170020324 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cFont #define _SELF(self) (RVAL2PANGOFONT(self)) static VALUE rg_find_shaper(VALUE self, VALUE language, VALUE ch) { return GOBJ2RVAL(pango_font_find_shaper(_SELF(self), RVAL2PANGOLANGUAGE(language), NUM2UINT(ch))); } static VALUE rg_describe(int argc, VALUE *argv, VALUE self) { VALUE desc, absolute_size; rb_scan_args(argc, argv, "01", &absolute_size); if (NIL_P(absolute_size) || ! RVAL2CBOOL(absolute_size)){ desc = PANGOFONTDESCRIPTION2RVAL(pango_font_describe(_SELF(self))); } else { desc = PANGOFONTDESCRIPTION2RVAL(pango_font_describe_with_absolute_size(_SELF(self))); } return desc; } static VALUE rg_get_coverage(VALUE self, VALUE language) { PangoCoverage* c = pango_font_get_coverage(_SELF(self), RVAL2PANGOLANGUAGE(language)); return PANGOCOVERAGE2RVAL(c); } static VALUE rg_get_glyph_extents(VALUE self, VALUE glyph) { PangoRectangle ink_rect, logical_rect; pango_font_get_glyph_extents(_SELF(self), NUM2UINT(glyph), &ink_rect, &logical_rect); return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect), PANGORECTANGLE2RVAL(&logical_rect)); } static VALUE rg_metrics(int argc, VALUE *argv, VALUE self) { VALUE language; PangoLanguage* lang = NULL; rb_scan_args(argc, argv, "01", &language); if (!NIL_P(language)) lang = RVAL2PANGOLANGUAGE(language); return PANGOFONTMETRICS2RVAL(pango_font_get_metrics(_SELF(self), lang)); } static VALUE rg_font_map(VALUE self) { return GOBJ2RVAL(pango_font_get_font_map(_SELF(self))); } void Init_pango_font(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT, "Font", mPango); RG_DEF_METHOD(find_shaper, 2); RG_DEF_METHOD(describe, -1); RG_DEF_METHOD(get_coverage, 1); RG_DEF_METHOD(get_glyph_extents, 1); RG_DEF_METHOD(metrics, -1); RG_DEF_METHOD(font_map, 0); G_DEF_CLASS3("PangoXFont", "XFont", mPango); G_DEF_CLASS3("PangoFT2Font", "FT2Font", mPango); G_DEF_CLASS3("PangoFcFont", "FcFont", mPango); G_DEF_CLASS3("PangoXftFont", "XftFont", mPango); G_DEF_CLASS3("PangoCairoFcFont", "CairoFcFont", mPango); G_DEF_CLASS3("PangoCairoFont", "CairoFont", mPango); G_DEF_CLASS3("PangoCairoWin32Font", "CairoWin32Font", mPango); G_DEF_CLASS3("PangoATSUIFont", "ATSUIFont", mPango); } ruby-gnome2-all-2.1.0/pango/ext/pango/extconf.rb0000644000175000017500000000566312257552170017627 0ustar koukou=begin extconf.rb for Ruby/Pango extention library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "pango" package_id = "pango" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end ruby_header = "ruby.h" have_func("rb_errinfo", ruby_header) ["glib2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end rcairo_options = {} rcairo_source_dir_names = ["rcairo"] if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM rcairo_source_dir_names.unshift("rcairo.win32") end rcairo_source_dir_names.each do |rcairo_source_dir_name| rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name if rcairo_source_dir.exist? rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s break end end unless check_cairo(rcairo_options) exit(false) end setup_win32(module_name, base_dir) unless required_pkg_config_package([package_id, 1, 14, 0], :debian => "libpango1.0-dev", :redhat => "pango-devel", :homebrew => "pango", :macports => "pango") exit(false) end PKGConfig.have_package('pangocairo') if PKGConfig.have_package("pangowin32") $defs << " -DHAVE_PANGO_WIN32" end if PKGConfig.have_package("pangoft2") $defs << " -DHAVE_PANGO_FT2" end pango_header = "pango/pango.h" have_func("pango_layout_iter_get_type", pango_header) have_func("pango_render_part_get_type", pango_header) have_func("pango_attr_strikethrough_color_new", pango_header) have_func("pango_attr_underline_color_new", pango_header) have_func("pango_glyph_item_free", pango_header) have_func("pango_glyph_item_get_type", pango_header) have_func("pango_attr_iterator_get_attrs", pango_header) have_func("pango_itemize_with_base_dir", pango_header) have_func("pango_font_family_is_monospace", pango_header) make_version_header("PANGO", "pango", ".") create_pkg_config_file("Ruby/Pango", package_id) $defs << " -DRUBY_PANGO_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ruby-gnome2-all-2.1.0/pango/ext/pango/pango.def0000644000175000017500000000063211701304107017373 0ustar koukouEXPORTS Init_pango mPango DATA attrstring DATA pattr DATA pattrbool DATA pattrcolor DATA pattrfloat DATA pattrint DATA pango_add_attribute pango_attr_iter_get_type pango_get_attribute pango_get_attribute_klass pango_item_get_type pango_layout_iter_get_type pango_layout_line_get_type pango_make_attribute pango_rectangle_get_type ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangofontdescription.c0000644000175000017500000001720012257552170022551 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cFontDescription #define _SELF(self) (RVAL2PANGOFONTDESCRIPTION(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE str; PangoFontDescription *description; rb_scan_args(argc, argv, "01", &str); if (NIL_P(str)) { description = pango_font_description_new(); } else { description = pango_font_description_from_string(RVAL2CSTR(str)); } G_INITIALIZE(self, description); return Qnil; } /* PangoFontDescription* pango_font_description_copy (const PangoFontDescription *desc); PangoFontDescription* pango_font_description_copy_static (const PangoFontDescription *desc); */ static VALUE rg_hash(VALUE self) { return UINT2NUM(pango_font_description_hash(_SELF(self))); } static VALUE rg_operator_font_desc_equal(VALUE self, VALUE other) { return CBOOL2RVAL(pango_font_description_equal(_SELF(self), _SELF(other))); } /* Don't we need this? void pango_font_descriptions_free (PangoFontDescription **descs, int n_descs); */ static VALUE rg_set_family(VALUE self, VALUE family) { pango_font_description_set_family(_SELF(self), RVAL2CSTR(family)); return self; } /* Don't we need this? void pango_font_description_set_family_static (PangoFontDescription *desc, const char *family); */ static VALUE rg_family(VALUE self) { return CSTR2RVAL(pango_font_description_get_family(_SELF(self))); } static VALUE rg_set_style(VALUE self, VALUE style) { pango_font_description_set_style(_SELF(self), RVAL2PANGOSTYLE(style)); return self; } static VALUE rg_style(VALUE self) { return PANGOSTYLE2RVAL(pango_font_description_get_style(_SELF(self))); } static VALUE rg_set_variant(VALUE self, VALUE variant) { pango_font_description_set_variant(_SELF(self), RVAL2PANGOVARIANT(variant)); return self; } static VALUE rg_variant(VALUE self) { return PANGOVARIANT2RVAL(pango_font_description_get_variant(_SELF(self))); } static VALUE rg_set_weight(VALUE self, VALUE weight) { pango_font_description_set_weight(_SELF(self), RVAL2PANGOWEIGHT(weight)); return self; } static VALUE rg_weight(VALUE self) { return PANGOWEIGHT2RVAL(pango_font_description_get_weight(_SELF(self))); } static VALUE rg_set_stretch(VALUE self, VALUE stretch) { pango_font_description_set_stretch(_SELF(self), RVAL2PANGOSTRETCH(stretch)); return self; } static VALUE rg_stretch(VALUE self) { return PANGOSTRETCH2RVAL(pango_font_description_get_stretch(_SELF(self))); } static VALUE rg_set_size(VALUE self, VALUE size) { pango_font_description_set_size(_SELF(self), NUM2INT(size)); return self; } static VALUE rg_size(VALUE self) { return INT2NUM(pango_font_description_get_size(_SELF(self))); } static VALUE rg_set_absolute_size(VALUE self, VALUE size) { pango_font_description_set_absolute_size(_SELF(self), NUM2INT(size)); return self; } static VALUE rg_size_is_absolute_p(VALUE self) { return CBOOL2RVAL(pango_font_description_get_size_is_absolute(_SELF(self))); } #if PANGO_CHECK_VERSION(1,16,0) static VALUE rg_gravity(VALUE self) { return PANGOGRAVITY2RVAL(pango_font_description_get_gravity(_SELF(self))); } static VALUE rg_set_gravity(VALUE self, VALUE gravity) { pango_font_description_set_gravity(_SELF(self), RVAL2PANGOGRAVITY(gravity)); return self; } #endif static VALUE rg_set_fields(VALUE self) { return PANGOFONTMASK2RVAL(pango_font_description_get_set_fields(_SELF(self))); } static VALUE rg_unset_fields(VALUE self, VALUE to_unset) { pango_font_description_unset_fields(_SELF(self), RVAL2PANGOFONTMASK(to_unset)); return self; } static VALUE rg_merge(VALUE self, VALUE desc_to_merge, VALUE replace_existing) { pango_font_description_merge(_SELF(self), _SELF(desc_to_merge), RVAL2CBOOL(replace_existing)); return self; } /* Don't we need this? void pango_font_description_merge_static (PangoFontDescription *desc, const PangoFontDescription *desc_to_merge, gboolean replace_existing); */ static VALUE rg_better_match(VALUE self, VALUE old_match, VALUE new_match) { return CBOOL2RVAL(pango_font_description_better_match(_SELF(self), _SELF(old_match), _SELF(new_match))); } static VALUE rg_to_str(VALUE self) { return CSTR2RVAL(pango_font_description_to_string(_SELF(self))); } static VALUE rg_to_filename(VALUE self) { return CSTR2RVAL(pango_font_description_to_filename(_SELF(self))); } void Init_pango_font_description(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_DESCRIPTION, "FontDescription", mPango); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(hash, 0); RG_DEF_METHOD_OPERATOR("==", font_desc_equal, 1); RG_DEF_METHOD(set_family, 1); RG_DEF_METHOD(family, 0); RG_DEF_METHOD(set_style, 1); RG_DEF_METHOD(style, 0); RG_DEF_METHOD(set_variant, 1); RG_DEF_METHOD(variant, 0); RG_DEF_METHOD(set_weight, 1); RG_DEF_METHOD(weight, 0); RG_DEF_METHOD(set_stretch, 1); RG_DEF_METHOD(stretch, 0); RG_DEF_METHOD(set_size, 1); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(set_absolute_size, 1); RG_DEF_METHOD_P(size_is_absolute, 0); #if PANGO_CHECK_VERSION(1,16,0) RG_DEF_METHOD(set_gravity, 1); RG_DEF_METHOD(gravity, 0); #endif RG_DEF_METHOD(set_fields, 0); RG_DEF_METHOD(unset_fields, 1); RG_DEF_METHOD(merge, 2); RG_DEF_METHOD(better_match, 2); RG_DEF_METHOD(to_str, 0); RG_DEF_ALIAS("to_s", "to_str"); RG_DEF_METHOD(to_filename, 0); /* PangoStyle */ G_DEF_CLASS(PANGO_TYPE_STYLE, "Style", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_STYLE, "PANGO_"); /* PangoWeight */ G_DEF_CLASS(PANGO_TYPE_WEIGHT, "Weight", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_WEIGHT, "PANGO_"); /* PangoVariant */ G_DEF_CLASS(PANGO_TYPE_VARIANT, "Variant", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_VARIANT, "PANGO_"); /* PangoStretch */ G_DEF_CLASS(PANGO_TYPE_STRETCH, "Stretch", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_STRETCH, "PANGO_"); /* PangoFontMask */ G_DEF_CLASS(PANGO_TYPE_FONT_MASK, "FontMask", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_FONT_MASK, "PANGO_"); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangofontmap.c0000644000175000017500000000631712257552170021012 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cFontMap #define _SELF(self) (RVAL2PANGOFONTMAP(self)) /* static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, pango_ft2_font_map_new()); return Qnil; } */ static VALUE rg_load_font(VALUE self, VALUE context, VALUE desc) { return GOBJ2RVAL(pango_font_map_load_font(_SELF(self), RVAL2PANGOCONTEXT(context), RVAL2PANGOFONTDESCRIPTION(desc))); } static VALUE rg_load_fontset(VALUE self, VALUE context, VALUE desc, VALUE lang) { return GOBJ2RVAL(pango_font_map_load_fontset(_SELF(self), RVAL2PANGOCONTEXT(context), RVAL2PANGOFONTDESCRIPTION(desc), RVAL2PANGOLANGUAGE(lang))); } static VALUE rg_families(VALUE self) { int n_families; PangoFontFamily** families; int i; VALUE result; pango_font_map_list_families(_SELF(self), &families, &n_families); result = rb_ary_new2(n_families); for (i = 0; i < n_families; i++) rb_ary_store(result, i, GOBJ2RVAL(families[i])); g_free(families); return result; } static VALUE rg_shape_engine_type(VALUE self) { return CSTR2RVAL(pango_font_map_get_shape_engine_type(_SELF(self))); } void Init_pango_font_map(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_MAP, "FontMap", mPango); /* RG_DEF_METHOD(initialize, 0); */ RG_DEF_METHOD(load_font, 2); RG_DEF_METHOD(load_fontset, 3); RG_DEF_METHOD(families, 0); RG_DEF_METHOD(shape_engine_type, 0); G_DEF_CLASS3("PangoFcFontMap", "FcFontMap", mPango); G_DEF_CLASS3("PangoXftFontMap", "XftFontMap", mPango); G_DEF_CLASS3("PangoFT2FontMap", "FT2FontMap", mPango); G_DEF_CLASS3("PangoXFontMap", "XFontMap", mPango); G_DEF_CLASS3("PangoWin32FontMap", "Win32FontMap", mPango); G_DEF_CLASS3("PangoCoreTextFontMap", "CoreTextFontMap", mPango); G_DEF_CLASS3("PangoCairoFcFontMap", "CairoFcFontMap", mPango); G_DEF_CLASS3("PangoCairoWin32FontMap", "CairoWin32FontMap", mPango); G_DEF_CLASS3("PangoCairoCoreTextFontMap", "CairoCoreTextFontMap", mPango); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangologattr.c0000644000175000017500000000666012257552170021023 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cLogAttr #define _SELF(s) (RVAL2PANGOLOGATTR(s)) /**********************************/ static PangoLogAttr* log_copy(const PangoLogAttr* val) { PangoLogAttr* new_val; g_return_val_if_fail (val != NULL, NULL); new_val = g_new(PangoLogAttr, 1); *new_val = *val; return new_val; } GType pango_log_attr_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("PangoLogAttr", (GBoxedCopyFunc)log_copy, (GBoxedFreeFunc)g_free); return our_type; } /**********************************/ #define ATTR_BOOL(name)\ static VALUE \ log_get_ ## name (VALUE self)\ {\ return CBOOL2RVAL(_SELF(self)->name);\ }\ static VALUE \ log_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = RVAL2CBOOL(val);\ return self;\ } static VALUE rg_initialize(VALUE self) { PangoLogAttr attribute; memset(&attribute, 0, sizeof(PangoLogAttr)); G_INITIALIZE(self, g_boxed_copy(PANGO_TYPE_LOG_ATTR, &attribute)); return Qnil; } #define DEFINE_ACCESSOR(logattr, name) \ rbg_define_method(logattr, G_STRINGIFY(name?), log_get_is_ ## name, 0);\ rbg_define_method(logattr, G_STRINGIFY(set_ ## name), log_set_is_ ## name, 1); ATTR_BOOL(is_line_break); ATTR_BOOL(is_mandatory_break); ATTR_BOOL(is_char_break); ATTR_BOOL(is_white); ATTR_BOOL(is_cursor_position); ATTR_BOOL(is_word_start); ATTR_BOOL(is_word_end); ATTR_BOOL(is_sentence_boundary); ATTR_BOOL(is_sentence_start); ATTR_BOOL(is_sentence_end); ATTR_BOOL(backspace_deletes_character); void Init_pango_logattr(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_LOG_ATTR, "LogAttr", mPango); RG_DEF_METHOD(initialize, 0); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, line_break); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, mandatory_break); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, char_break); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, white); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, cursor_position); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, word_start); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, word_end); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, sentence_boundary); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, sentence_start); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, sentence_end); rbg_define_method(RG_TARGET_NAMESPACE, "backspace_deletes_character?", log_get_backspace_deletes_character, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_backspace_deletes_character", log_set_backspace_deletes_character, 1); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpango.h0000644000175000017500000000650712257552170017433 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "ruby.h" #define PANGO_ENABLE_ENGINE #define PANGO_ENABLE_BACKEND #include #ifdef HAVE_FREETYPE2 #include #endif #include "rbgobject.h" #include "rbpangoversion.h" #include "rbpangoconversions.h" #include #ifdef HAVE_RB_CAIRO_H #include #endif #if defined(G_PLATFORM_WIN32) && !defined(RUBY_PANGO_STATIC_COMPILATION) # ifdef RUBY_PANGO_COMPILATION # define RUBY_PANGO_VAR __declspec(dllexport) # else # define RUBY_PANGO_VAR extern __declspec(dllimport) # endif #else # define RUBY_PANGO_VAR extern #endif extern void Init_pango_inits(); RUBY_PANGO_VAR VALUE mPango; #ifndef PANGO_TYPE_ITEM #define PANGO_TYPE_ITEM (pango_item_get_type()) #endif #define PANGO_TYPE_ANALYSIS (pango_analysis_get_type()) #define PANGO_TYPE_LOG_ATTR (pango_log_attr_get_type()) #ifndef PANGO_TYPE_LAYOUT_ITER #define PANGO_TYPE_LAYOUT_ITER (pango_layout_iter_get_type()) #endif #ifndef PANGO_TYPE_LAYOUT_LINE #define PANGO_TYPE_LAYOUT_LINE (pango_layout_line_get_type()) #endif #define PANGO_TYPE_RECTANGLE (pango_rectangle_get_type()) #define PANGO_TYPE_ATTR_ITERATOR (pango_attr_iter_get_type()) #define PANGO_TYPE_COVERAGE (pango_coverage_get_type()) #define PANGO_TYPE_GLYPH_INFO (pango_glyph_info_get_type()) #ifndef PANGO_TYPE_GLYPH_ITEM # define PANGO_TYPE_GLYPH_ITEM (pango_glyph_item_get_type()) #endif #define PANGO_TYPE_SCRIPT_ITER (pango_script_iter_get_type()) #define ATTR2RVAL(attr) (pango_make_attribute(attr)) #define RVAL2ATTR(attr) (pango_get_attribute(attr)) #define ATTRTYPE2CLASS(attr_type) (pango_get_attribute_klass(attr_type)) #define RBPANGO_ADD_ATTRIBUTE(type, klass) (pango_add_attribute(type, klass)) extern VALUE pango_make_attribute(PangoAttribute* attr); extern PangoAttribute* pango_get_attribute(VALUE attr); extern GType pango_item_get_type(void); extern GType pango_analysis_get_type(void); extern GType pango_log_attr_get_type(void); extern GType pango_layout_iter_get_type(void); extern GType pango_layout_line_get_type(void); extern GType pango_rectangle_get_type(void); extern GType pango_attr_iter_get_type(void); extern GType pango_coverage_get_type(void); extern GType pango_glyph_info_get_type(void); #ifndef HAVE_PANGO_GLYPH_ITEM_GET_TYPE extern GType pango_glyph_item_get_type(void); #endif extern GType pango_script_iter_get_type(void); extern VALUE pango_get_attribute_klass(VALUE attr_type); extern void pango_add_attribute(int attr_type, VALUE klass); ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangolayoutiter.c0000644000175000017500000001150211701304107021523 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cLayoutIter #define _SELF(r) (RVAL2PANGOLAYOUTITER(r)) /**********************************/ #ifndef HAVE_PANGO_LAYOUT_ITER_GET_TYPE static PangoLayoutIter * layout_iter_copy(const PangoLayoutIter *ref) { return (PangoLayoutIter *)ref; } GType pango_layout_iter_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("PangoLayoutIter", (GBoxedCopyFunc)layout_iter_copy, (GBoxedFreeFunc)pango_layout_iter_free); return our_type; } #endif /**********************************/ static VALUE rg_next_run_bang(VALUE self) { return CBOOL2RVAL(pango_layout_iter_next_run(_SELF(self))); } static VALUE rg_next_char_bang(VALUE self) { return CBOOL2RVAL(pango_layout_iter_next_char(_SELF(self))); } static VALUE rg_next_cluster_bang(VALUE self) { return CBOOL2RVAL(pango_layout_iter_next_cluster(_SELF(self))); } static VALUE rg_next_line_bang(VALUE self) { return CBOOL2RVAL(pango_layout_iter_next_line(_SELF(self))); } static VALUE rg_at_last_line_p(VALUE self) { return CBOOL2RVAL(pango_layout_iter_at_last_line(_SELF(self))); } static VALUE rg_index(VALUE self) { return INT2NUM(pango_layout_iter_get_index(_SELF(self))); } static VALUE rg_baseline(VALUE self) { return INT2NUM(pango_layout_iter_get_baseline(_SELF(self))); } static VALUE rg_run(VALUE self) { PangoLayoutRun* run = pango_layout_iter_get_run(_SELF(self)); return PANGOGLYPHITEM2RVAL(run); } static VALUE rg_line(VALUE self) { return PANGOLAYOUTLINE2RVAL(pango_layout_iter_get_line(_SELF(self))); } static VALUE rg_char_extents(VALUE self) { PangoRectangle logical_rect; pango_layout_iter_get_char_extents(_SELF(self), &logical_rect); return PANGORECTANGLE2RVAL(&logical_rect); } static VALUE rg_cluster_extents(VALUE self) { PangoRectangle ink_rect, logical_rect; pango_layout_iter_get_cluster_extents(_SELF(self), &ink_rect, &logical_rect); return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect), PANGORECTANGLE2RVAL(&logical_rect)); } static VALUE rg_run_extents(VALUE self) { PangoRectangle ink_rect, logical_rect; pango_layout_iter_get_run_extents(_SELF(self), &ink_rect, &logical_rect); return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect), PANGORECTANGLE2RVAL(&logical_rect)); } static VALUE rg_line_yrange(VALUE self) { int y0, y1; pango_layout_iter_get_line_yrange(_SELF(self), &y0, &y1); return rb_assoc_new(INT2NUM(y0), INT2NUM(y1)); } static VALUE rg_line_extents(VALUE self) { PangoRectangle ink_rect, logical_rect; pango_layout_iter_get_line_extents(_SELF(self), &ink_rect, &logical_rect); return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect), PANGORECTANGLE2RVAL(&logical_rect)); } static VALUE rg_layout_extents(VALUE self) { PangoRectangle ink_rect, logical_rect; pango_layout_iter_get_layout_extents(_SELF(self), &ink_rect, &logical_rect); return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect), PANGORECTANGLE2RVAL(&logical_rect)); } void Init_pango_layout_iter(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_LAYOUT_ITER, "LayoutIter", mPango); rbgobj_boxed_not_copy_obj(PANGO_TYPE_LAYOUT_ITER); RG_DEF_METHOD_BANG(next_run, 0); RG_DEF_METHOD_BANG(next_char, 0); RG_DEF_METHOD_BANG(next_cluster, 0); RG_DEF_METHOD_BANG(next_line, 0); RG_DEF_METHOD_P(at_last_line, 0); /* for backword compatibility. :< */ RG_DEF_ALIAS("at_last_line!", "at_last_line?"); RG_DEF_METHOD(index, 0); RG_DEF_METHOD(baseline, 0); RG_DEF_METHOD(run, 0); RG_DEF_METHOD(line, 0); RG_DEF_METHOD(char_extents, 0); RG_DEF_METHOD(cluster_extents, 0); RG_DEF_METHOD(run_extents, 0); RG_DEF_METHOD(line_yrange, 0); RG_DEF_METHOD(line_extents, 0); RG_DEF_METHOD(layout_extents, 0); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangofontfamily.c0000644000175000017500000000443112257552170021511 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cFontFamily #define _SELF(self) (RVAL2PANGOFONTFAMILY(self)) static VALUE rg_name(VALUE self) { return CSTR2RVAL(pango_font_family_get_name(_SELF(self))); } #ifdef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE static VALUE rg_monospace_p(VALUE self) { return CBOOL2RVAL(pango_font_family_is_monospace(_SELF(self))); } #endif static VALUE rg_faces(VALUE self) { int n_faces; PangoFontFace** faces; int i; VALUE result; pango_font_family_list_faces(_SELF(self), &faces, &n_faces); result = rb_ary_new2(n_faces); for (i = 0; i < n_faces; i++) rb_ary_store(result, i, GOBJ2RVAL(faces[i])); g_free(faces); return result; } void Init_pango_font_family(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_FAMILY, "FontFamily", mPango); RG_DEF_METHOD(name, 0); #ifdef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE RG_DEF_METHOD_P(monospace, 0); #endif RG_DEF_METHOD(faces, 0); G_DEF_CLASS3("PangoFcFamily", "FcFamily", mPango); G_DEF_CLASS3("PangoFT2Family", "FT2Family", mPango); G_DEF_CLASS3("PangoXftFamily", "XftFamily", mPango); G_DEF_CLASS3("PangoXFamily", "XFamily", mPango); G_DEF_CLASS3("PangoWin32Family", "Win32Family", mPango); G_DEF_CLASS3("PangoATSUIFamily", "ATSUIFamily", mPango); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangofontface.c0000644000175000017500000000422012257552170021122 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cFontFace #define _SELF(self) (RVAL2PANGOFONTFACE(self)) static VALUE rg_name(VALUE self) { return CSTR2RVAL(pango_font_face_get_face_name(_SELF(self))); } static VALUE rg_describe(VALUE self) { return PANGOFONTDESCRIPTION2RVAL(pango_font_face_describe(_SELF(self))); } static VALUE rg_sizes(VALUE self) { int n_sizes; int* sizes; int i; VALUE result; pango_font_face_list_sizes(_SELF(self), &sizes, &n_sizes); result = rb_ary_new(); for (i = 0; i < n_sizes; i++) rb_ary_push(result, GOBJ2RVAL(&sizes[i])); g_free(sizes); return result; } void Init_pango_font_face(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_FACE, "FontFace", mPango); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(describe, 0); RG_DEF_METHOD(sizes, 0); G_DEF_CLASS3("PangoFcFace", "FcFace", mPango); G_DEF_CLASS3("PangoFT2Face", "FT2Face", mPango); G_DEF_CLASS3("PangoXftFace", "XftFace", mPango); G_DEF_CLASS3("PangoXFace", "XFace", mPango); G_DEF_CLASS3("PangoWin32Face", "Win32Face", mPango); G_DEF_CLASS3("PangoATSUIFace", "ATSUIFace", mPango); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangotabarray.c0000664000175000017500000000767611740310343021154 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cTabArray #define _SELF(self) (RVAL2PANGOTABARRAY(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE size, positions_in_pixels, attr_ary; PangoTabArray *array; int i; rb_scan_args(argc, argv, "2*", &size, &positions_in_pixels, &attr_ary); array = pango_tab_array_new(NUM2INT(size), RVAL2CBOOL(positions_in_pixels)); G_INITIALIZE(self, array); if (! NIL_P(attr_ary)){ for (i = 0; i < RARRAY_LEN(attr_ary); i++) { pango_tab_array_set_tab(array, i, RVAL2PANGOTABALIGN(RARRAY_PTR(RARRAY_PTR(attr_ary)[i])[0]), FIX2INT(RARRAY_PTR(RARRAY_PTR(attr_ary)[i])[1])); } } return Qnil; } /* This is implemented in rtab_initialize. PangoTabArray* pango_tab_array_new_with_positions (gint size, gboolean positions_in_pixels, PangoTabAlign first_alignment, gint first_position, ...); */ static VALUE rg_size(VALUE self) { return INT2NUM(pango_tab_array_get_size(_SELF(self))); } static VALUE rg_resize(VALUE self, VALUE size) { pango_tab_array_resize(_SELF(self), NUM2INT(size)); return self; } static VALUE rg_set_tab(VALUE self, VALUE tab_index, VALUE align, VALUE location) { pango_tab_array_set_tab(_SELF(self), NUM2INT(tab_index), RVAL2PANGOTABALIGN(align), NUM2INT(location)); return self; } static VALUE rg_get_tab(VALUE self, VALUE tab_index) { PangoTabAlign align; gint location; pango_tab_array_get_tab(_SELF(self), NUM2INT(tab_index), &align, &location); return rb_ary_new3(2, PANGOTABALIGN2RVAL(align), INT2NUM(location)); } static VALUE rg_tabs(VALUE self) { PangoTabAlign* aligns; gint* locations; VALUE ary = rb_ary_new(); PangoTabArray* tab_array = _SELF(self); gint i; pango_tab_array_get_tabs(tab_array, &aligns, &locations); for (i = 0; i < pango_tab_array_get_size(tab_array); i++){ rb_ary_push(ary, rb_ary_new3(2, PANGOTABALIGN2RVAL(aligns[i]), INT2NUM(locations[i]))); } return ary; } static VALUE rg_positions_in_pixels_p(VALUE self) { return CBOOL2RVAL(pango_tab_array_get_positions_in_pixels(_SELF(self))); } void Init_pango_array(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_TAB_ARRAY, "TabArray", mPango); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(resize, 1); RG_DEF_METHOD(set_tab, 3); RG_DEF_METHOD(get_tab, 1); RG_DEF_METHOD(tabs, 0); RG_DEF_METHOD_P(positions_in_pixels, 0); /* PangoTabAlign */ G_DEF_CLASS(PANGO_TYPE_TAB_ALIGN, "TabAlign", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_TAB_ALIGN, "PANGO_"); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoengine.c0000644000175000017500000000402411701304107020570 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #ifdef PANGO_TYPE_ENGINE #define _SELF(self) (RVAL2PANGOENGINE(self)) /* FIXME static VALUE rbpango_s_engine_list(VALUE self) { PangoEngineInfo* engines = g_new(PangoEngineInfo, 1); int i, n; VALUE ary; script_engine_list(&engines, &n); ary = rb_ary_new(); for(i = 0; i < n; i++){ rb_ary_push(ary, GOBJ2RVAL(&engines[i])); } return ary; } static VALUE rbpango_s_engine_create(VALUE self, VALUE id) { return GOBJ2RVAL(script_engine_create(RVAL2CSTR(id))); } */ /* void script_engine_init (GTypeModule *module); void script_engine_exit (void); PangoEngine* script_engine_create (const char *id); */ #endif void Init_pango_engine(VALUE mPango) { #ifdef PANGO_TYPE_ENGINE G_DEF_CLASS(PANGO_TYPE_ENGINE, "Engine", mPango); /* FIXME rb_define_singleton_method(engine, "engines", rbpango_s_engine_list, 0); rb_define_singleton_method(engine, "create", rbpango_s_engine_create, 1); */ G_DEF_CLASS(PANGO_TYPE_ENGINE_LANG, "EngineLang", mPango); G_DEF_CLASS(PANGO_TYPE_ENGINE_SHAPE, "EngineShape", mPango); #endif } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangocolor.c0000644000175000017500000000555212124610262020452 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cColor #define _SELF(self) (RVAL2PANGOCOLOR(self)) static VALUE rg_initialize(VALUE self, VALUE red, VALUE green, VALUE blue) { PangoColor color; color.red = NUM2UINT(red); color.green = NUM2UINT(green); color.blue = NUM2UINT(blue); G_INITIALIZE(self, g_boxed_copy(PANGO_TYPE_COLOR, &color)); return Qnil; } static VALUE rg_parse(VALUE self, VALUE spec) { return CBOOL2RVAL(pango_color_parse(_SELF(self), RVAL2CSTR(spec))); } static VALUE rg_red(VALUE self) { return UINT2NUM(_SELF(self)->red); } static VALUE rg_set_red(VALUE self, VALUE red) { _SELF(self)->red = NUM2UINT(red); return self; } static VALUE rg_green(VALUE self) { return UINT2NUM(_SELF(self)->green); } static VALUE rg_set_green(VALUE self, VALUE green) { _SELF(self)->green = NUM2UINT(green); return self; } static VALUE rg_blue(VALUE self) { return UINT2NUM(_SELF(self)->blue); } static VALUE rg_set_blue(VALUE self, VALUE blue) { _SELF(self)->blue = NUM2UINT(blue); return self; } static VALUE rg_to_a(VALUE self) { PangoColor *c = _SELF(self); return rb_ary_new3(3, UINT2NUM(c->red), UINT2NUM(c->green), UINT2NUM(c->blue)); } static VALUE rg_operator_color_equal(VALUE self, VALUE other) { PangoColor* c1 = _SELF(self); PangoColor* c2 = _SELF(other); return CBOOL2RVAL((c1->red == c2->red) && (c1->green == c2->green) && (c1->blue == c2->blue)); } void Init_pango_color(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_COLOR, "Color", mPango); RG_DEF_METHOD(initialize, 3); RG_DEF_METHOD(parse, 1); RG_DEF_METHOD(red, 0); RG_DEF_METHOD(set_red, 1); RG_DEF_METHOD(green, 0); RG_DEF_METHOD(set_green, 1); RG_DEF_METHOD(blue, 0); RG_DEF_METHOD(set_blue, 1); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD_OPERATOR("==", color_equal, 1); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoanalysis.c0000644000175000017500000001230412257552170021162 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cAnalysis #define _SELF(s) (RVAL2PANGOANALYSIS(s)) /**********************************/ static PangoAnalysis* ana_copy(const PangoAnalysis* val) { PangoAnalysis* new_val; g_return_val_if_fail (val != NULL, NULL); new_val = g_new(PangoAnalysis, 1); *new_val = *val; return new_val; } GType pango_analysis_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("PangoAnalysis", (GBoxedCopyFunc)ana_copy, (GBoxedFreeFunc)g_free); return our_type; } /**********************************/ static VALUE rg_initialize(VALUE self) { PangoAnalysis analysis = { NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL }; G_INITIALIZE(self, g_boxed_copy(PANGO_TYPE_ANALYSIS, &analysis)); return Qnil; } static VALUE rg_set_shape_engine(VALUE self, VALUE engine) { _SELF(self)->shape_engine = RVAL2PANGOENGINESHAPE(engine); return self; } static VALUE rg_shape_engine(VALUE self) { VALUE ret; if (_SELF(self)->shape_engine){ const gchar* gname = G_OBJECT_TYPE_NAME(_SELF(self)->shape_engine); gchar* name = g_strdup(gname); name[0] = g_ascii_toupper(name[0]); G_DEF_CLASS3(gname, name, mPango); ret = GOBJ2RVAL(_SELF(self)->shape_engine); } else { ret = Qnil; } return ret; } static VALUE rg_set_lang_engine(VALUE self, VALUE engine) { _SELF(self)->lang_engine = RVAL2PANGOENGINELANG(engine); return self; } static VALUE rg_lang_engine(VALUE self) { VALUE ret; if (_SELF(self)->lang_engine){ const gchar* gname = G_OBJECT_TYPE_NAME(_SELF(self)->lang_engine); gchar* name = g_strdup(gname); name[0] = g_ascii_toupper(name[0]); G_DEF_CLASS3(name, name, mPango); ret = GOBJ2RVAL(_SELF(self)->lang_engine); } else { ret = Qnil; } return ret; } static VALUE rg_set_font(VALUE self, VALUE font) { _SELF(self)->font = RVAL2PANGOFONT(font); return self; } static VALUE rg_font(VALUE self) { return GOBJ2RVAL(_SELF(self)->font); } static VALUE rg_set_level(VALUE self, VALUE level) { _SELF(self)->level = NUM2UINT(level); return self; } static VALUE rg_level(VALUE self) { return UINT2NUM(_SELF(self)->level); } static VALUE rg_set_language(VALUE self, VALUE lang) { _SELF(self)->language = RVAL2PANGOLANGUAGE(lang); return self; } static VALUE rg_language(VALUE self) { return PANGOLANGUAGE2RVAL(_SELF(self)->language); } struct ana_set_extra_attrs_args { PangoAnalysis *analysis; VALUE ary; long n; GSList *result; }; static VALUE ana_set_extra_attrs_body(VALUE value) { struct ana_set_extra_attrs_args *args = (struct ana_set_extra_attrs_args *)value; long i; for (i = 0; i < args->n; i++) args->result = g_slist_append(args->result, RVAL2ATTR(RARRAY_PTR(args->ary)[i])); args->analysis->extra_attrs = args->result; return Qnil; } static G_GNUC_NORETURN VALUE ana_set_extra_attrs_rescue(VALUE value) { g_slist_free(((struct ana_set_extra_attrs_args *)value)->result); rb_exc_raise(rb_errinfo()); } static VALUE rg_set_extra_attrs(VALUE self, VALUE attrs) { struct ana_set_extra_attrs_args args; args.analysis = _SELF(self); args.ary = rb_ary_to_ary(attrs); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(ana_set_extra_attrs_body, (VALUE)&args, ana_set_extra_attrs_rescue, (VALUE)&args); return self; } static VALUE rg_extra_attrs(VALUE self) { VALUE ary = rb_ary_new(); GSList* list = _SELF(self)->extra_attrs; while (list) { rb_ary_push(ary, ATTR2RVAL(list->data)); list = list->next; } return ary; } void Init_pango_analysis(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_ANALYSIS, "Analysis", mPango); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_shape_engine, 1); RG_DEF_METHOD(shape_engine, 0); RG_DEF_METHOD(set_lang_engine, 1); RG_DEF_METHOD(lang_engine, 0); RG_DEF_METHOD(set_font, 1); RG_DEF_METHOD(font, 0); RG_DEF_METHOD(set_level, 1); RG_DEF_METHOD(level, 0); RG_DEF_METHOD(set_language, 1); RG_DEF_METHOD(language, 0); RG_DEF_METHOD(set_extra_attrs, 1); RG_DEF_METHOD(extra_attrs, 0); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangomatrix.c0000644000175000017500000000734112257552170020650 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cMatrix #define _SELF(self) (RVAL2PANGOMATRIX(self)) #define ATTR_FLOAT(name)\ static VALUE \ matrix_get_ ## name (VALUE self)\ {\ return rb_float_new(_SELF(self)->name);\ }\ static VALUE \ matrix_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = NUM2DBL(val);\ return self;\ } #define DEFINE_ACCESSOR(name) \ rbg_define_method(RG_TARGET_NAMESPACE, G_STRINGIFY(name), matrix_get_ ## name, 0);\ rbg_define_method(RG_TARGET_NAMESPACE, G_STRINGIFY(set_ ## name), matrix_set_## name, 1); static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { PangoMatrix matrix = PANGO_MATRIX_INIT; VALUE xx, xy, yx, yy, x0, y0; rb_scan_args(argc, argv, "06", &xx, &xy, &yx, &yy, &x0, &y0); if (argc > 0){ matrix.xx = NUM2DBL(xx); matrix.xy = NUM2DBL(xy); matrix.yx = NUM2DBL(yx); matrix.yy = NUM2DBL(yy); matrix.x0 = NUM2DBL(x0); matrix.y0 = NUM2DBL(y0); } G_INITIALIZE(self, g_boxed_copy(PANGO_TYPE_MATRIX, &matrix)); return Qnil; } static VALUE rg_translate_bang(VALUE self, VALUE tx, VALUE ty) { pango_matrix_translate(_SELF(self), NUM2DBL(tx), NUM2DBL(ty)); return self; } static VALUE rg_scale_bang(VALUE self, VALUE scale_x, VALUE scale_y) { pango_matrix_scale(_SELF(self), NUM2DBL(scale_x), NUM2DBL(scale_y)); return self; } static VALUE rg_rotate_bang(VALUE self, VALUE degrees) { pango_matrix_rotate(_SELF(self), NUM2DBL(degrees)); return self; } #if PANGO_CHECK_VERSION(1,16,0) static VALUE rg_gravity(VALUE self) { return PANGOGRAVITY2RVAL(pango_gravity_get_for_matrix(_SELF(self))); } #endif static VALUE rg_concat_bang(VALUE self, VALUE new_matrix) { pango_matrix_concat(_SELF(self), _SELF(new_matrix)); return self; } static VALUE rg_font_scale_factor(VALUE self) { return rb_float_new(pango_matrix_get_font_scale_factor(_SELF(self))); } ATTR_FLOAT(xx); ATTR_FLOAT(xy); ATTR_FLOAT(yx); ATTR_FLOAT(yy); ATTR_FLOAT(x0); ATTR_FLOAT(y0); static VALUE rg_to_a(VALUE self) { PangoMatrix* matrix = _SELF(self); return rb_ary_new3(6, INT2NUM(matrix->xx), INT2NUM(matrix->xy), INT2NUM(matrix->yx), INT2NUM(matrix->yy), INT2NUM(matrix->x0), INT2NUM(matrix->y0)); } void Init_pango_matrix(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_MATRIX, "Matrix", mPango); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD_BANG(translate, 2); RG_DEF_METHOD_BANG(scale, 2); RG_DEF_METHOD_BANG(rotate, 1); RG_DEF_METHOD_BANG(concat, 1); RG_DEF_METHOD(font_scale_factor, 0); #if PANGO_CHECK_VERSION(1,16,0) RG_DEF_METHOD(gravity, 0); #endif RG_DEF_METHOD(to_a, 0); DEFINE_ACCESSOR(xx); DEFINE_ACCESSOR(xy); DEFINE_ACCESSOR(yx); DEFINE_ACCESSOR(yy); DEFINE_ACCESSOR(x0); DEFINE_ACCESSOR(y0); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangocoverage.c0000644000175000017500000000564411701304107021127 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cCoverage #define _SELF(self) (RVAL2PANGOCOVERAGE(self)) /**********************************/ GType pango_coverage_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("PangoCoverage", (GBoxedCopyFunc)pango_coverage_copy, (GBoxedFreeFunc)pango_coverage_unref); return our_type; } /**********************************/ static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, pango_coverage_new()); return Qnil; } static VALUE rg_get_level(VALUE self, VALUE index_) { return PANGOCOVERAGELEVEL2RVAL(pango_coverage_get(_SELF(self), NUM2INT(index_))); } static VALUE rg_max_bang(VALUE self, VALUE other) { pango_coverage_max(_SELF(self), _SELF(other)); return self; } static VALUE rg_set(VALUE self, VALUE index_, VALUE level) { pango_coverage_set(_SELF(self), NUM2INT(index_), RVAL2PANGOCOVERAGELEVEL(level)); return self; } static VALUE rg_to_bytes(VALUE self) { guchar* bytes; int n_bytes; VALUE ret; pango_coverage_to_bytes(_SELF(self), &bytes, &n_bytes); ret = rb_str_new((const char*)bytes, n_bytes); g_free(bytes); return ret; } static VALUE rg_s_from_bytes(G_GNUC_UNUSED VALUE self, VALUE bytes) { StringValue(bytes); return PANGOCOVERAGE2RVAL(pango_coverage_from_bytes((guchar *)RSTRING_PTR(bytes), RSTRING_LEN(bytes))); } void Init_pango_coverage(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_COVERAGE, "Coverage", mPango); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(get_level, 0); RG_DEF_METHOD_BANG(max, 1); RG_DEF_METHOD(set, 2); RG_DEF_METHOD(to_bytes, 0); RG_DEF_SMETHOD(from_bytes, 1); /* PangoCoverageLevel */ G_DEF_CLASS(PANGO_TYPE_COVERAGE_LEVEL, "Level", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_COVERAGE_LEVEL, "PANGO_COVERAGE_"); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangorectangle.c0000644000175000017500000000746512124610262021305 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cRectangle #define _SELF(s) (RVAL2PANGORECTANGLE(s)) /**********************************/ static PangoRectangle* pango_rectangle_copy(const PangoRectangle *ref) { PangoRectangle* new_ref; g_return_val_if_fail (ref != NULL, NULL); new_ref = g_new(PangoRectangle, 1); *new_ref = *ref; return new_ref; } GType pango_rectangle_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("PangoRectangle", (GBoxedCopyFunc)pango_rectangle_copy, (GBoxedFreeFunc)g_free); return our_type; } /**********************************/ static VALUE rg_initialize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { PangoRectangle rectangle; rectangle.x = NUM2INT(x); rectangle.y = NUM2INT(y); rectangle.width = NUM2INT(width); rectangle.height = NUM2INT(height); G_INITIALIZE(self, g_boxed_copy(PANGO_TYPE_RECTANGLE, &rectangle)); return Qnil; } static VALUE rg_x(VALUE self) { return INT2NUM(_SELF(self)->x); } static VALUE rg_y(VALUE self) { return INT2NUM(_SELF(self)->y); } static VALUE rg_width(VALUE self) { return INT2NUM(_SELF(self)->width); } static VALUE rg_height(VALUE self) { return INT2NUM(_SELF(self)->height); } static VALUE rg_set_x(VALUE self, VALUE x) { _SELF(self)->x = NUM2INT(x); return self; } static VALUE rg_set_y(VALUE self, VALUE y) { _SELF(self)->y = NUM2INT(y); return self; } static VALUE rg_set_width(VALUE self, VALUE width) { _SELF(self)->width = NUM2INT(width); return self; } static VALUE rg_set_height(VALUE self, VALUE height) { _SELF(self)->height = NUM2INT(height); return self; } static VALUE rg_to_a(VALUE self) { PangoRectangle* a = _SELF(self); return rb_ary_new3(4, INT2FIX(a->x), INT2FIX(a->y), INT2FIX(a->width), INT2FIX(a->height)); } static VALUE rg_ascent(VALUE self) { PangoRectangle* r =_SELF(self); return INT2NUM(PANGO_ASCENT(*r)); } static VALUE rg_descent(VALUE self) { PangoRectangle* r =_SELF(self); return INT2NUM(PANGO_DESCENT(*r)); } static VALUE rg_lbearing(VALUE self) { PangoRectangle* r =_SELF(self); return INT2NUM(PANGO_LBEARING(*r)); } static VALUE rg_rbearing(VALUE self) { PangoRectangle* r =_SELF(self); return INT2NUM(PANGO_RBEARING(*r)); } void Init_pango_rectangle(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_RECTANGLE, "Rectangle", mPango); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(x, 0); RG_DEF_METHOD(y, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(set_x, 1); RG_DEF_METHOD(set_y, 1); RG_DEF_METHOD(set_width, 1); RG_DEF_METHOD(set_height, 1); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD(ascent, 0); RG_DEF_METHOD(descent, 0); RG_DEF_METHOD(lbearing, 0); RG_DEF_METHOD(rbearing, 0); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoscriptiter.c0000644000175000017500000000477312257552170021542 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" /**********************************/ static PangoScriptIter* rbpango_script_iter_copy(PangoScriptIter *ref) { /* PangoScriptIter* new_ref = pango_script_iter_new("", 0); g_return_val_if_fail (ref != NULL, NULL); new_ref = g_new(PangoScriptIter, 1); *new_ref = *ref; return new_ref; */ return ref; } GType pango_script_iter_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("PangoScriptIter", (GBoxedCopyFunc)rbpango_script_iter_copy, (GBoxedFreeFunc)pango_script_iter_free); return our_type; } /**********************************/ #define RG_TARGET_NAMESPACE cScriptIter #define _SELF(r) (RVAL2PANGOSCRIPTITER(r)) static VALUE rg_initialize(VALUE self, VALUE text) { PangoScriptIter* iter; StringValue(text); iter = pango_script_iter_new(RSTRING_PTR(text), RSTRING_LEN(text)); G_INITIALIZE(self, iter); return Qnil; } static VALUE rg_range(VALUE self) { G_CONST_RETURN char* start; G_CONST_RETURN char* end; PangoScript script; pango_script_iter_get_range(_SELF(self), &start, &end, &script); return rb_ary_new3(3, CSTR2RVAL(start), CSTR2RVAL(end), PANGOSCRIPT2RVAL(script)); } static VALUE rg_next_bang(VALUE self) { return CBOOL2RVAL(pango_script_iter_next(_SELF(self))); } void Init_pango_script_iter(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_SCRIPT_ITER, "ScriptIter", mPango); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(range, 0); RG_DEF_METHOD_BANG(next, 0); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangorenderer.c0000644000175000017500000001371112257552170021150 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cRenderer #define _SELF(self) (RVAL2PANGORENDERER(self)) static VALUE rg_draw_layout(VALUE self, VALUE layout, VALUE x, VALUE y) { pango_renderer_draw_layout(_SELF(self), RVAL2PANGOLAYOUT(layout), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_draw_layout_line(VALUE self, VALUE line, VALUE x, VALUE y) { pango_renderer_draw_layout_line(_SELF(self), RVAL2PANGOLAYOUTLINE(line), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_draw_glyphs(VALUE self, VALUE font, VALUE glyphs, VALUE x, VALUE y) { pango_renderer_draw_glyphs(_SELF(self), RVAL2PANGOFONT(font), RVAL2PANGOGLYPHSTRING(glyphs), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_draw_rectangle(VALUE self, VALUE part, VALUE x, VALUE y, VALUE width, VALUE height) { #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE pango_renderer_draw_rectangle(_SELF(self), RVAL2PANGORENDERPART(part), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); #else pango_renderer_draw_rectangle(_SELF(self), NUM2INT(part), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); #endif return self; } static VALUE rg_draw_error_underline(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { pango_renderer_draw_error_underline(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_draw_trapezoid(VALUE self, VALUE part, VALUE y1, VALUE x11, VALUE x21, VALUE y2, VALUE x12, VALUE x22) { #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE pango_renderer_draw_trapezoid(_SELF(self), RVAL2PANGORENDERPART(part), NUM2DBL(y1), NUM2DBL(x11), NUM2DBL(x21), NUM2DBL(y2), NUM2DBL(x12), NUM2DBL(x22)); #else pango_renderer_draw_trapezoid(_SELF(self), NUM2INT(part), NUM2DBL(y1), NUM2DBL(x11), NUM2DBL(x21), NUM2DBL(y2), NUM2DBL(x12), NUM2DBL(x22)); #endif return self; } static VALUE rg_draw_glyph(VALUE self, VALUE font, VALUE glyph, VALUE x, VALUE y) { pango_renderer_draw_glyph(_SELF(self), RVAL2PANGOFONT(font), NUM2INT(glyph), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_deactivate(VALUE self) { pango_renderer_deactivate(_SELF(self)); return self; } static VALUE rg_activate(VALUE self) { pango_renderer_activate(_SELF(self)); if (rb_block_given_p()) { rb_ensure(rb_yield, self, rg_deactivate, self); } return self; } static VALUE rg_part_changed(VALUE self, VALUE part) { #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE pango_renderer_part_changed(_SELF(self), RVAL2PANGORENDERPART(part)); #else pango_renderer_part_changed(_SELF(self), NUM2INT(part)); #endif return self; } static VALUE rg_set_color(VALUE self, VALUE part, VALUE color) { #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE pango_renderer_set_color(_SELF(self), RVAL2PANGORENDERPART(part), NIL_P(color) ? NULL : RVAL2PANGOCOLOR(color)); #else pango_renderer_set_color(_SELF(self), NUM2INT(part), NIL_P(color) ? NULL : RVAL2PANGOCOLOR(color)); #endif return self; } static VALUE rg_get_color(VALUE self, VALUE part) { #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE PangoColor* color = pango_renderer_get_color(_SELF(self), RVAL2PANGORENDERPART(part)); #else PangoColor* color = pango_renderer_get_color(_SELF(self),NUM2INT(part)); #endif return PANGOCOLOR2RVAL(color); } static VALUE rg_set_matrix(VALUE self, VALUE matrix) { pango_renderer_set_matrix(_SELF(self), NIL_P(matrix) ? NULL : RVAL2PANGOMATRIX(matrix)); return self; } static VALUE rg_matrix(VALUE self) { const PangoMatrix* matrix = pango_renderer_get_matrix(_SELF(self)); return PANGOMATRIX2RVAL((PangoMatrix*)matrix); } void Init_pangorenderer(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_RENDERER, "Renderer", mPango); RG_DEF_METHOD(draw_layout, 3); RG_DEF_METHOD(draw_layout_line, 3); RG_DEF_METHOD(draw_glyphs, 4); RG_DEF_METHOD(draw_rectangle, 5); RG_DEF_METHOD(draw_error_underline, 4); RG_DEF_METHOD(draw_trapezoid, 7); RG_DEF_METHOD(draw_glyph, 4); RG_DEF_METHOD(activate, 0); RG_DEF_METHOD(deactivate, 0); RG_DEF_METHOD(part_changed, 1); RG_DEF_METHOD(set_color, 2); RG_DEF_METHOD(get_color, 1); RG_DEF_METHOD(set_matrix, 1); RG_DEF_METHOD(matrix, 0); /* PangoRenderPart */ #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE G_DEF_CLASS(PANGO_TYPE_RENDER_PART, "Part", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_RENDER_PART, "PANGO_RENDER_"); #endif } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoconversions.h0000644000175000017500000001743011701304107021705 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __PANGOCONVERSIONS_H__ #define __PANGOCONVERSIONS_H__ #define RVAL2PANGOCAIROFONTMAP(o) (PANGO_CAIRO_FONT_MAP(RVAL2GOBJ(o))) #define RVAL2PANGOCONTEXT(o) (PANGO_CONTEXT(RVAL2GOBJ(o))) #define RVAL2PANGOENGINE(o) (PANGO_ENGINE(RVAL2GOBJ(o))) #define RVAL2PANGOENGINELANG(o) (PANGO_ENGINE_LANG(RVAL2GOBJ(o))) #define RVAL2PANGOENGINESHAPE(o) (PANGO_ENGINE_SHAPE(RVAL2GOBJ(o))) #define RVAL2PANGOFONT(o) (PANGO_FONT(RVAL2GOBJ(o))) #define RVAL2PANGOFONTSET(o) (PANGO_FONTSET(RVAL2GOBJ(o))) #define RVAL2PANGOFONTSETSIMPLE(o) (PANGO_FONTSET_SIMPLE(RVAL2GOBJ(o))) #define RVAL2PANGOFONTFACE(o) (PANGO_FONT_FACE(RVAL2GOBJ(o))) #define RVAL2PANGOFONTFAMILY(o) (PANGO_FONT_FAMILY(RVAL2GOBJ(o))) #define RVAL2PANGOFONTMAP(o) (PANGO_FONT_MAP(RVAL2GOBJ(o))) #define RVAL2PANGOLAYOUT(o) (PANGO_LAYOUT(RVAL2GOBJ(o))) #define RVAL2PANGORENDERER(o) (PANGO_RENDERER(RVAL2GOBJ(o))) #define RVAL2PANGOANALYSIS(o) ((PangoAnalysis*)RVAL2BOXED(o, PANGO_TYPE_ANALYSIS)) #define PANGOANALYSIS2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ANALYSIS)) #define RVAL2PANGOATTRITERATOR(o) ((PangoAttrIterator*)RVAL2BOXED(o, PANGO_TYPE_ATTR_ITERATOR)) #define PANGOATTRITERATOR2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ATTR_ITERATOR)) #define RVAL2PANGOATTRLIST(o) ((PangoAttrList*)RVAL2BOXED(o, PANGO_TYPE_ATTR_LIST)) #define PANGOATTRLIST2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ATTR_LIST)) #define RVAL2PANGOCOLOR(o) ((PangoColor*)RVAL2BOXED(o, PANGO_TYPE_COLOR)) #define PANGOCOLOR2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_COLOR)) #define RVAL2PANGOCOVERAGE(o) ((PangoCoverage*)RVAL2BOXED(o, PANGO_TYPE_COVERAGE)) #define PANGOCOVERAGE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_COVERAGE)) #define RVAL2PANGOFONTDESCRIPTION(o) ((PangoFontDescription*)RVAL2BOXED(o, PANGO_TYPE_FONT_DESCRIPTION)) #define PANGOFONTDESCRIPTION2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_FONT_DESCRIPTION)) #define RVAL2PANGOFONTMETRICS(o) ((PangoFontMetrics*)RVAL2BOXED(o, PANGO_TYPE_FONT_METRICS)) #define PANGOFONTMETRICS2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_FONT_METRICS)) #define RVAL2PANGOGLYPHINFO(o) ((PangoGlyphInfo*)RVAL2BOXED(o, PANGO_TYPE_GLYPH_INFO)) #define PANGOGLYPHINFO2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_GLYPH_INFO)) #define RVAL2PANGOGLYPHITEM(o) ((PangoGlyphItem*)RVAL2BOXED(o, PANGO_TYPE_GLYPH_ITEM)) #define PANGOGLYPHITEM2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_GLYPH_ITEM)) #define RVAL2PANGOGLYPHSTRING(o) ((PangoGlyphString*)RVAL2BOXED(o, PANGO_TYPE_GLYPH_STRING)) #define PANGOGLYPHSTRING2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_GLYPH_STRING)) #define RVAL2PANGOITEM(o) ((PangoItem*)RVAL2BOXED(o, PANGO_TYPE_ITEM)) #define PANGOITEM2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_ITEM)) #define RVAL2PANGOLANGUAGE(o) ((PangoLanguage*)RVAL2BOXED(o, PANGO_TYPE_LANGUAGE)) #define PANGOLANGUAGE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LANGUAGE)) #define RVAL2PANGOLAYOUTITER(o) ((PangoLayoutIter*)RVAL2BOXED(o, PANGO_TYPE_LAYOUT_ITER)) #define PANGOLAYOUTITER2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LAYOUT_ITER)) #define RVAL2PANGOLAYOUTLINE(o) ((PangoLayoutLine*)RVAL2BOXED(o, PANGO_TYPE_LAYOUT_LINE)) #define PANGOLAYOUTLINE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LAYOUT_LINE)) #define RVAL2PANGOLOGATTR(o) ((PangoLogAttr*)RVAL2BOXED(o, PANGO_TYPE_LOG_ATTR)) #define PANGOLOGATTR2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_LOG_ATTR)) #define RVAL2PANGOMATRIX(o) ((PangoMatrix*)RVAL2BOXED(o, PANGO_TYPE_MATRIX)) #define PANGOMATRIX2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_MATRIX)) #define RVAL2PANGORECTANGLE(o) ((PangoRectangle*)RVAL2BOXED(o, PANGO_TYPE_RECTANGLE)) #define PANGORECTANGLE2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_RECTANGLE)) #define RVAL2PANGOSCRIPTITER(o) ((PangoScriptIter*)RVAL2BOXED(o, PANGO_TYPE_SCRIPT_ITER)) #define PANGOSCRIPTITER2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_SCRIPT_ITER)) #define RVAL2PANGOTABARRAY(o) ((PangoTabArray*)RVAL2BOXED(o, PANGO_TYPE_TAB_ARRAY)) #define PANGOTABARRAY2RVAL(o) (BOXED2RVAL(o, PANGO_TYPE_TAB_ARRAY)) #define RVAL2PANGOALIGNMENT(o) (RVAL2GENUM(o, PANGO_TYPE_ALIGNMENT)) #define PANGOALIGNMENT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_ALIGNMENT)) #define RVAL2PANGOCOVERAGELEVEL(o) (RVAL2GENUM(o, PANGO_TYPE_COVERAGE_LEVEL)) #define PANGOCOVERAGELEVEL2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_COVERAGE_LEVEL)) #define RVAL2PANGODIRECTION(o) (RVAL2GENUM(o, PANGO_TYPE_DIRECTION)) #define PANGODIRECTION2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_DIRECTION)) #define RVAL2PANGOELLIPSIZEMODE(o) (RVAL2GENUM(o, PANGO_TYPE_ELLIPSIZE_MODE)) #define PANGOELLIPSIZEMODE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_ELLIPSIZE_MODE)) #define RVAL2PANGOGRAVITY(o) (RVAL2GENUM(o, PANGO_TYPE_GRAVITY)) #define PANGOGRAVITY2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_GRAVITY)) #define RVAL2PANGOGRAVITYHINT(o) (RVAL2GENUM(o, PANGO_TYPE_GRAVITY_HINT)) #define PANGOGRAVITYHINT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_GRAVITY_HINT)) #define RVAL2PANGORENDERPART(o) (RVAL2GENUM(o, PANGO_TYPE_RENDER_PART)) #define PANGORENDERPART2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_RENDER_PART)) #define RVAL2PANGOSCRIPT(o) (RVAL2GENUM(o, PANGO_TYPE_SCRIPT)) #define PANGOSCRIPT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_SCRIPT)) #define RVAL2PANGOSTRETCH(o) (RVAL2GENUM(o, PANGO_TYPE_STRETCH)) #define PANGOSTRETCH2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_STRETCH)) #define RVAL2PANGOSTYLE(o) (RVAL2GENUM(o, PANGO_TYPE_STYLE)) #define PANGOSTYLE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_STYLE)) #define RVAL2PANGOTABALIGN(o) (RVAL2GENUM(o, PANGO_TYPE_TAB_ALIGN)) #define PANGOTABALIGN2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_TAB_ALIGN)) #define RVAL2PANGOUNDERLINE(o) (RVAL2GENUM(o, PANGO_TYPE_UNDERLINE)) #define PANGOUNDERLINE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_UNDERLINE)) #define RVAL2PANGOVARIANT(o) (RVAL2GENUM(o, PANGO_TYPE_VARIANT)) #define PANGOVARIANT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_VARIANT)) #define RVAL2PANGOWEIGHT(o) (RVAL2GENUM(o, PANGO_TYPE_WEIGHT)) #define PANGOWEIGHT2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_WEIGHT)) #define RVAL2PANGOWRAPMODE(o) (RVAL2GENUM(o, PANGO_TYPE_WRAP_MODE)) #define PANGOWRAPMODE2RVAL(o) (GENUM2RVAL(o, PANGO_TYPE_WRAP_MODE)) #define RVAL2PANGOFONTMASK(o) (RVAL2GFLAGS(o, PANGO_TYPE_FONT_MASK)) #define PANGOFONTMASK2RVAL(o) (GFLAGS2RVAL(o, PANGO_TYPE_FONT_MASK)) #endif /* __PANGOCONVERSIONS_H__ */ ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangocairo.c0000644000175000017500000000653312257552170020443 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * Copyright (C) 2005 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cCairoFontMap #define _SELF(self) (RVAL2PANGOCAIROFONTMAP(self)) static VALUE rg_s_create(int argc, VALUE *argv, G_GNUC_UNUSED VALUE klass) { VALUE rb_font_type; PangoFontMap *font_map = NULL; rb_scan_args(argc, argv, "01", &rb_font_type); if (NIL_P(rb_font_type)) { font_map = pango_cairo_font_map_new(); } else { cairo_font_type_t font_type = CAIRO_FONT_TYPE_USER; if (rbgutil_key_equal(rb_font_type, "ft") || rbgutil_key_equal(rb_font_type, "freetype")) { font_type = CAIRO_FONT_TYPE_FT; } else if (rbgutil_key_equal(rb_font_type, "win32")) { font_type = CAIRO_FONT_TYPE_WIN32; } else if (rbgutil_key_equal(rb_font_type, "quartz")) { font_type = CAIRO_FONT_TYPE_QUARTZ; } else { rb_raise(rb_eArgError, "font type must be one of " ":ft, :freetype, :win32 or :quartz: %s", RBG_INSPECT(rb_font_type)); } font_map = pango_cairo_font_map_new_for_font_type(font_type); } return GOBJ2RVAL(font_map); } static VALUE rg_s_default(G_GNUC_UNUSED VALUE klass) { return GOBJ2RVAL(pango_cairo_font_map_get_default()); } #if PANGO_CHECK_VERSION(1, 22, 0) static VALUE rg_s_set_default(VALUE klass, VALUE font_map) { pango_cairo_font_map_set_default(RVAL2GOBJ(font_map)); return klass; } #endif static VALUE rg_set_resolution(VALUE self, VALUE dpi) { pango_cairo_font_map_set_resolution(_SELF(self), NUM2DBL(dpi)); return self; } static VALUE rg_resolution(VALUE self) { return rb_float_new(pango_cairo_font_map_get_resolution(_SELF(self))); } static VALUE rg_create_context(VALUE self) { PangoContext *pango_context; #if PANGO_CHECK_VERSION(1, 22, 0) pango_context = pango_font_map_create_context(PANGO_FONT_MAP(_SELF(self))); #else pango_context = pango_cairo_font_map_create_context(_SELF(self)); #endif return GOBJ2RVAL_UNREF(pango_context); } void Init_pango_cairo(VALUE mPango) { VALUE RG_TARGET_NAMESPACE; /* Pango::CairoFontMap */ RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_CAIRO_FONT_MAP, "CairoFontMap", mPango); RG_DEF_SMETHOD(create, -1); RG_DEF_SMETHOD(default, 0); #if PANGO_CHECK_VERSION(1, 22, 0) RG_DEF_SMETHOD(set_default, 1); #endif RG_DEF_METHOD(set_resolution, 1); RG_DEF_METHOD(resolution, 0); RG_DEF_METHOD(create_context, 0); } ruby-gnome2-all-2.1.0/pango/ext/pango/depend0000644000175000017500000000056712064346475017021 0ustar koukouinstall-so: install-headers install-headers: $(INSTALL_DATA) $(srcdir)/rbpango.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbpangoconversions.h $(RUBYARCHDIR) $(INSTALL_DATA) rbpangoversion.h $(RUBYARCHDIR) install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-pango.pc $(pkgconfigdir); \ fi ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoprivate.h0000644000175000017500000000412412257552170021017 0ustar koukou#ifndef RB_PANGO_PRIVATE_H #define RB_PANGO_PRIVATE_H #include "rbpango.h" #ifndef HAVE_RB_ERRINFO # define rb_errinfo() (ruby_errinfo) #endif G_BEGIN_DECLS G_GNUC_INTERNAL void Init_pango_analysis(VALUE mPango); G_GNUC_INTERNAL void Init_pango_attribute(VALUE mPango); G_GNUC_INTERNAL void Init_pango_attriterator(VALUE mPango); G_GNUC_INTERNAL void Init_pango_attrlist(VALUE mPango); G_GNUC_INTERNAL void Init_pango_cairo(VALUE mPango); G_GNUC_INTERNAL void Init_pango_cairo_context(VALUE mPango); G_GNUC_INTERNAL void Init_pango_color(VALUE mPango); G_GNUC_INTERNAL void Init_pango_context(VALUE mPango); G_GNUC_INTERNAL void Init_pango_coverage(VALUE mPango); G_GNUC_INTERNAL void Init_pango_engine(VALUE mPango); G_GNUC_INTERNAL void Init_pango_font(VALUE mPango); G_GNUC_INTERNAL void Init_pango_font_description(VALUE mPango); G_GNUC_INTERNAL void Init_pango_font_face(VALUE mPango); G_GNUC_INTERNAL void Init_pango_font_family(VALUE mPango); G_GNUC_INTERNAL void Init_pango_font_map(VALUE mPango); G_GNUC_INTERNAL void Init_pango_font_metrics(VALUE mPango); G_GNUC_INTERNAL void Init_pango_fontset(VALUE mPango); G_GNUC_INTERNAL void Init_pango_fontset_simple(VALUE mPango); G_GNUC_INTERNAL void Init_pango_glyph_info(VALUE mPango); G_GNUC_INTERNAL void Init_pango_glyph_item(VALUE mPango); G_GNUC_INTERNAL void Init_pango_glyph_string(VALUE mPango); G_GNUC_INTERNAL void Init_pango_gravity(VALUE mPango); G_GNUC_INTERNAL void Init_pango_item(VALUE mPango); G_GNUC_INTERNAL void Init_pango_language(VALUE mPango); G_GNUC_INTERNAL void Init_pango_layout(VALUE mPango); G_GNUC_INTERNAL void Init_pango_layout_iter(VALUE mPango); G_GNUC_INTERNAL void Init_pango_layout_line(VALUE mPango); G_GNUC_INTERNAL void Init_pango_logattr(VALUE mPango); G_GNUC_INTERNAL void Init_pango_matrix(VALUE mPango); G_GNUC_INTERNAL void Init_pango_rectangle(VALUE mPango); G_GNUC_INTERNAL void Init_pangorenderer(VALUE mPango); G_GNUC_INTERNAL void Init_pango_script(VALUE mPango); G_GNUC_INTERNAL void Init_pango_script_iter(VALUE mPango); G_GNUC_INTERNAL void Init_pango_array(VALUE mPango); G_END_DECLS #endif /* RB_PANGO_PRIVATE_H */ ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangolayoutline.c0000644000175000017500000001346512257552170021535 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cLayoutLine #define _SELF(r) (RVAL2PANGOLAYOUTLINE(r)) static VALUE rg_extents(VALUE self) { PangoRectangle ink_rect, logical_rect; pango_layout_line_get_extents(_SELF(self), &ink_rect, &logical_rect); return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect), PANGORECTANGLE2RVAL(&logical_rect)); } static VALUE rg_pixel_extents(VALUE self) { PangoRectangle ink_rect, logical_rect; pango_layout_line_get_pixel_extents(_SELF(self), &ink_rect, &logical_rect); return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect), PANGORECTANGLE2RVAL(&logical_rect)); } static VALUE rg_index_to_x(VALUE self, VALUE index, VALUE trailing) { int x_pos; pango_layout_line_index_to_x(_SELF(self), NUM2INT(index), RVAL2CBOOL(trailing), &x_pos); return INT2NUM(x_pos); } static VALUE rg_x_to_index(VALUE self, VALUE x_pos) { int index, trailing; gboolean ret = pango_layout_line_x_to_index(_SELF(self), NUM2INT(x_pos), &index, &trailing); return rb_ary_new3(CBOOL2RVAL(ret), INT2NUM(index), INT2NUM(trailing)); } static VALUE rg_get_x_ranges(VALUE self, VALUE start_index, VALUE end_index) { int* ranges; int i, n_ranges; VALUE ary; pango_layout_line_get_x_ranges(_SELF(self), NUM2INT(start_index), NUM2INT(end_index), &ranges, &n_ranges); ary = rb_ary_new(); for (i = 0; i < n_ranges; i++) { rb_ary_push(ary, INT2NUM(ranges[i])); } g_free(ranges); return ary; } /* Structure members */ static VALUE rg_layout(VALUE self) { return GOBJ2RVAL(_SELF(self)->layout); } static VALUE rg_set_layout(VALUE self, VALUE val) { _SELF(self)->layout = RVAL2PANGOLAYOUT(val); return self; } static VALUE rg_start_index(VALUE self) { return INT2NUM(_SELF(self)->start_index); } static VALUE rg_set_start_index(VALUE self, VALUE val) { _SELF(self)->start_index = NUM2INT(val); return self; } static VALUE rg_length(VALUE self) { return INT2NUM(_SELF(self)->length); } static VALUE rg_set_length(VALUE self, VALUE val) { _SELF(self)->length = NUM2INT(val); return self; } static VALUE rg_runs(VALUE self) { GSList* list = _SELF(self)->runs; VALUE ary = rb_ary_new(); while (list) { PangoGlyphItem* old_item = (PangoGlyphItem*)list->data; PangoGlyphItem new_item; new_item.item = pango_item_copy(old_item->item); new_item.glyphs = pango_glyph_string_copy(old_item->glyphs); rb_ary_push(ary, PANGOGLYPHITEM2RVAL(&new_item)); list = list->next; } return ary; } struct layout_line_set_runs_args { PangoLayoutLine *line; VALUE ary; long n; GSList *result; }; static VALUE layout_line_set_runs_body(VALUE value) { struct layout_line_set_runs_args *args = (struct layout_line_set_runs_args *)value; long i; for (i = 0; i < args->n; i++) args->result = g_slist_append(args->result, RVAL2PANGOGLYPHITEM(RARRAY_PTR(args->ary)[i])); g_slist_free(args->line->runs); args->line->runs = args->result; return Qnil; } static G_GNUC_NORETURN VALUE layout_line_set_runs_rescue(VALUE value) { g_slist_free(((struct layout_line_set_runs_args *)value)->result); rb_exc_raise(rb_errinfo()); } static VALUE rg_set_runs(VALUE self, VALUE attrs) { struct layout_line_set_runs_args args; args.line = _SELF(self); args.ary = rb_ary_to_ary(attrs); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(layout_line_set_runs_body, (VALUE)&args, layout_line_set_runs_rescue, (VALUE)&args); return self; } static VALUE rg_paragraph_start_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->is_paragraph_start); } static VALUE rg_set_paragraph_start(VALUE self, VALUE val) { _SELF(self)->is_paragraph_start = RVAL2CBOOL(val); return self; } static VALUE rg_resolved_dir(VALUE self) { return UINT2NUM(_SELF(self)->resolved_dir); } static VALUE rg_set_resolved_dir(VALUE self, VALUE val) { _SELF(self)->resolved_dir = NUM2UINT(val); return self; } void Init_pango_layout_line(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_LAYOUT_LINE, "LayoutLine", mPango); RG_DEF_METHOD(extents, 0); RG_DEF_METHOD(pixel_extents, 0); RG_DEF_METHOD(index_to_x, 2); RG_DEF_METHOD(x_to_index, 1); RG_DEF_METHOD(get_x_ranges, 2); RG_DEF_METHOD(layout, 0); RG_DEF_METHOD(set_layout, 1); RG_DEF_METHOD(start_index, 0); RG_DEF_METHOD(set_start_index, 1); RG_DEF_METHOD(length, 0); RG_DEF_METHOD(set_length, 1); RG_DEF_METHOD(runs, 0); RG_DEF_METHOD(set_runs, 1); RG_DEF_METHOD_P(paragraph_start, 0); RG_DEF_METHOD(set_paragraph_start, 1); RG_DEF_METHOD(resolved_dir, 0); RG_DEF_METHOD(set_resolved_dir, 1); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangocontext.c0000644000175000017500000002142212257552170021024 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cContext #define _SELF(self) (RVAL2PANGOCONTEXT(self)) static VALUE rg_itemize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2, arg3, arg4, arg5, arg6; GList* list; rb_scan_args(argc, argv, "42", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6); if (TYPE(arg1) == T_STRING) { list = pango_itemize(_SELF(self), RVAL2CSTR(arg1), /* text */ NUM2INT(arg2), /* start_index */ NUM2INT(arg3), /* length */ RVAL2PANGOATTRLIST(arg4), /* attrs */ NIL_P(arg5) ? NULL : RVAL2PANGOATTRITERATOR(arg5)); /* cached_iter */ } else { #ifdef HAVE_PANGO_ITEMIZE_WITH_BASE_DIR list = pango_itemize_with_base_dir(_SELF(self), RVAL2PANGODIRECTION(arg1), /* base_dir */ RVAL2CSTR(arg2), /* text */ NUM2INT(arg3), /* start_index */ NUM2INT(arg4), /* length */ RVAL2PANGOATTRLIST(arg5), /* attrs */ NIL_P(arg6) ? NULL : RVAL2PANGOATTRITERATOR(arg6)); /* cached_iter */ #else rb_warn("Pango::Context#itemize(base_dir, text, start_index, length, attrs, cached_iter) isn't supported on this environment."); list = pango_itemize(_SELF(self), RVAL2CSTR(arg1), /* text */ NUM2INT(arg2), /* start_index */ NUM2INT(arg3), /* length */ RVAL2PANGOATTRLIST(arg4), /* attrs */ NIL_P(arg5) ? NULL : RVAL2PANGOATTRITERATOR(arg5)); /* cached_iter */ #endif } return GLIST2ARY2F(list, PANGO_TYPE_ITEM); } /* Move to Pango module (rbpangomain.c) GList* pango_reorder_items (GList *logical_items); */ #ifdef PANGO_ENABLE_BACKEND static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, pango_context_new()); return Qnil; } static VALUE rg_set_font_map(VALUE self, VALUE font_map) { pango_context_set_font_map(_SELF(self), RVAL2PANGOFONTMAP(font_map)); return self; } static VALUE rg_font_map(VALUE self) { return GOBJ2RVAL(pango_context_get_font_map(_SELF(self))); } #endif /* PANGO_ENABLE_BACKEND */ static VALUE rg_font_description(VALUE self) { PangoFontDescription* ret = pango_context_get_font_description(_SELF(self)); return PANGOFONTDESCRIPTION2RVAL(ret); } static VALUE rg_set_font_description(VALUE self, VALUE desc) { pango_context_set_font_description(_SELF(self), RVAL2PANGOFONTDESCRIPTION(desc)); return self; } static VALUE rg_language(VALUE self) { PangoLanguage* ret = pango_context_get_language(_SELF(self)); return PANGOLANGUAGE2RVAL(ret); } static VALUE rg_set_language(VALUE self, VALUE lang) { pango_context_set_language(_SELF(self), RVAL2PANGOLANGUAGE(lang)); return self; } static VALUE rg_base_dir(VALUE self) { return PANGODIRECTION2RVAL(pango_context_get_base_dir(_SELF(self))); } static VALUE rg_set_base_dir(VALUE self, VALUE direction) { pango_context_set_base_dir(_SELF(self), RVAL2PANGODIRECTION(direction)); return self; } #if PANGO_CHECK_VERSION(1,16,0) static VALUE rg_base_gravity(VALUE self) { return PANGOGRAVITY2RVAL(pango_context_get_base_gravity(_SELF(self))); } static VALUE rg_set_base_gravity(VALUE self, VALUE gravity) { pango_context_set_base_gravity(_SELF(self), RVAL2PANGOGRAVITY(gravity)); return self; } static VALUE rg_gravity_hint(VALUE self) { return PANGOGRAVITYHINT2RVAL(pango_context_get_gravity_hint(_SELF(self))); } static VALUE rg_set_gravity_hint(VALUE self, VALUE gravity_hint) { pango_context_set_gravity_hint(_SELF(self), RVAL2PANGOGRAVITYHINT(gravity_hint)); return self; } #endif static VALUE rg_matrix(VALUE self) { const PangoMatrix* matrix = pango_context_get_matrix(_SELF(self)); return PANGOMATRIX2RVAL((PangoMatrix*)matrix); } static VALUE rg_set_matrix(VALUE self, VALUE matrix) { pango_context_set_matrix(_SELF(self), RVAL2PANGOMATRIX(matrix)); return self; } static VALUE rg_load_font(VALUE self, VALUE desc) { return GOBJ2RVAL(pango_context_load_font(_SELF(self), RVAL2PANGOFONTDESCRIPTION(desc))); } static VALUE rg_load_fontset(VALUE self, VALUE desc, VALUE lang) { return GOBJ2RVAL(pango_context_load_fontset(_SELF(self), RVAL2PANGOFONTDESCRIPTION(desc), RVAL2PANGOLANGUAGE(lang))); } static VALUE rg_get_metrics(int argc, VALUE *argv, VALUE self) { VALUE desc, lang; rb_scan_args(argc, argv, "11", &desc, &lang); return PANGOFONTMETRICS2RVAL(pango_context_get_metrics(_SELF(self), RVAL2PANGOFONTDESCRIPTION(desc), NIL_P(lang) ? NULL : RVAL2PANGOLANGUAGE(lang))); } static VALUE rg_families(VALUE self) { int n_families; PangoFontFamily** families; int i; VALUE result; pango_context_list_families(_SELF(self), &families, &n_families); result = rb_ary_new2(n_families); for (i = 0; i < n_families; i++) rb_ary_store(result, i, GOBJ2RVAL(families[i])); g_free(families); return result; } #ifdef HAVE_RB_CAIRO_H static VALUE rg_set_font_options(VALUE self, VALUE options) { if (NIL_P(options)) pango_cairo_context_set_font_options(_SELF(self), NULL); else pango_cairo_context_set_font_options(_SELF(self), RVAL2CRFONTOPTIONS(options)); return self; } static VALUE rg_font_options(VALUE self) { const cairo_font_options_t *options; options = pango_cairo_context_get_font_options(_SELF(self)); if (options) return CRFONTOPTIONS2RVAL(cairo_font_options_copy(options)); else return Qnil; } static VALUE rg_set_resolution(VALUE self, VALUE dpi) { pango_cairo_context_set_resolution(_SELF(self), NUM2DBL(dpi)); return self; } static VALUE rg_resolution(VALUE self) { return rb_float_new(pango_cairo_context_get_resolution(_SELF(self))); } #endif static VALUE rg_list_families(VALUE self) { rb_warn("Deprecated. Use Pango::Context#families instead."); return rg_families(self); } void Init_pango_context(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_CONTEXT, "Context", mPango); RG_DEF_METHOD(itemize, -1); #ifdef PANGO_ENABLE_BACKEND RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_font_map, 1); RG_DEF_METHOD(font_map, 0); #endif /* PANGO_ENABLE_BACKEND */ RG_DEF_METHOD(font_description, 0); RG_DEF_METHOD(set_font_description, 1); RG_DEF_METHOD(language, 0); RG_DEF_METHOD(set_language, 1); RG_DEF_METHOD(base_dir, 0); RG_DEF_METHOD(set_base_dir, 1); #if PANGO_CHECK_VERSION(1,16,0) RG_DEF_METHOD(base_gravity, 0); RG_DEF_METHOD(set_base_gravity, 1); RG_DEF_METHOD(gravity_hint, 0); RG_DEF_METHOD(set_gravity_hint, 1); #endif RG_DEF_METHOD(matrix, 0); RG_DEF_METHOD(set_matrix, 1); RG_DEF_METHOD(load_font, 1); RG_DEF_METHOD(load_fontset, 2); RG_DEF_METHOD(get_metrics, -1); RG_DEF_METHOD(families, 0); #ifdef HAVE_RB_CAIRO_H RG_DEF_METHOD(set_font_options, 1); RG_DEF_METHOD(font_options, 0); RG_DEF_METHOD(set_resolution, 1); RG_DEF_METHOD(resolution, 0); #endif /* This will remove 2 or 3 releases later since 0.14.0. */ RG_DEF_METHOD(list_families, 0); /* PangoDirection */ G_DEF_CLASS(PANGO_TYPE_DIRECTION, "Direction", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_DIRECTION, "PANGO_"); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangofontset.c0000644000175000017500000000374512257552170021032 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cFontset #define _SELF(self) (RVAL2PANGOFONTSET(self)) static ID id_call; static VALUE rg_get_font(VALUE self, VALUE wc) { return GOBJ2RVAL(pango_fontset_get_font(_SELF(self), NUM2UINT(wc))); } static VALUE rg_metrics(VALUE self) { return PANGOFONTMETRICS2RVAL(pango_fontset_get_metrics(_SELF(self))); } static gboolean fontset_each(PangoFontset *fontset, PangoFont *font, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(fontset), GOBJ2RVAL(font))); } static VALUE rg_each(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); pango_fontset_foreach(_SELF(self), (PangoFontsetForeachFunc)fontset_each, (gpointer)func); return self; } void Init_pango_fontset(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONTSET, "Fontset", mPango); id_call = rb_intern("call"); RG_DEF_METHOD(get_font, 1); RG_DEF_METHOD(metrics, 0); RG_DEF_METHOD(each, 0); } ruby-gnome2-all-2.1.0/pango/ext/pango/rbpangoitem.c0000644000175000017500000000517312257552170020303 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpangoprivate.h" #define RG_TARGET_NAMESPACE cItem #define _SELF(self) (RVAL2PANGOITEM(self)) #define ATTR_INT(name)\ static VALUE \ item_int_ ## name (VALUE self)\ {\ return INT2NUM(_SELF(self)->name);\ }\ static VALUE \ item_int_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = NUM2INT(val); \ return self;\ } #define DEF_INT_ACCESSOR(name) \ rbg_define_method(RG_TARGET_NAMESPACE, G_STRINGIFY(name), item_int_ ## name, 0);\ rbg_define_method(RG_TARGET_NAMESPACE, G_STRINGIFY(set_ ## name), item_int_set_ ## name, 1); static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, pango_item_new()); return Qnil; } static VALUE rg_split(VALUE self, VALUE split_index, VALUE split_offset) { return PANGOITEM2RVAL(pango_item_split(_SELF(self), NUM2INT(split_index), NUM2INT(split_offset))); } /* Move to Pango module (rbpangomain.c) GList* pango_reorder_items (GList *logical_items); */ ATTR_INT(offset); ATTR_INT(length); ATTR_INT(num_chars); static VALUE rg_analysis(VALUE self) { PangoAnalysis ana = _SELF(self)->analysis; return PANGOANALYSIS2RVAL(&ana); } static VALUE rg_set_analysis(VALUE self, VALUE val) { PangoAnalysis* ana = RVAL2PANGOANALYSIS(val); _SELF(self)->analysis = *ana; return self; } void Init_pango_item(VALUE mPango) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_ITEM, "Item", mPango); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(split, 2); DEF_INT_ACCESSOR(offset); DEF_INT_ACCESSOR(length); DEF_INT_ACCESSOR(num_chars); RG_DEF_METHOD(analysis, 0); RG_DEF_METHOD(set_analysis, 1); } ruby-gnome2-all-2.1.0/pango/README0000644000175000017500000000152712257552170014603 0ustar koukouRuby/Pango ========== Ruby/Pango is a Ruby binding of pango-1.14.x. Requirements ------------ Ruby: http://www.ruby-lang.org/ GLib: http://www.gtk.org/ Pango: http://www.pango.org/ cairo/rcairo: http://cairographics.org/ (optional) Ruby/GLib2: http://ruby-gnome2.sourceforge.net/ Install ------- 0. install ruby-1.9.x or later, GLib, Pango-1.14.x or later, Ruby/GLib2, Ruby/GTK2 (and cairo/rcairo). 1. ruby extconf.rb (To use rcairo on Win32, set CAIRO_PATH as a environment variable first) 2. make 3. su 4. make install Copying ------- Copyright (c) 2002-2005 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ ruby-gnome2-all-2.1.0/pango/COPYING.LIB0000644000175000017500000006364212257552170015371 0ustar koukou GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ruby-gnome2-all-2.1.0/pango/lib/0000755000175000017500000000000012137115065014457 5ustar koukouruby-gnome2-all-2.1.0/pango/lib/1.8/0000755000175000017500000000000012257665514015001 5ustar koukouruby-gnome2-all-2.1.0/pango/lib/pango.rb0000644000175000017500000000403712137115065016114 0ustar koukou# # pango.rb # Copyright(C) 2005, 2009 Ruby-GNOME2 Project. # # This program is licenced under the same # license of Ruby-GNOME2. # require 'glib2' begin begin require 'cairo' rescue LoadError require 'rubygems' require 'cairo' end rescue LoadError end base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/pango.so" rescue LoadError require "pango.so" end if vendor_dir.exist? begin require "gobject-introspection" vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) rescue LoadError end end module Pango LOG_DOMAIN = "Pango" class AttrList def each(text = nil) iter = iterator begin if text s, e = iter.range yield(iter, text[s, e - s], s, e) else yield(iter) end end while iter.next! end end # [[klass, prefix], ....]] targets = [[Layout::Alignment, "ALIGN_"], [AttrScale, "SCALE_"], [Coverage::Level, "COVERAGE_"], [Context::Direction, "DIRECTION_"], [Layout::WrapMode, "WRAP_"], [FontDescription::FontMask, "FONT_MASK_"], [FontDescription::Stretch, "STRETCH_"], [FontDescription::Style, "STYLE_"], [FontDescription::Variant, "VARIANT_"], [FontDescription::Weight, "WEIGHT_"], [TabArray::TabAlign, "TAB_"], [AttrUnderline::Underline, "UNDERLINE_"]] targets << [Script, "SCRIPT_"] if defined? Script targets << [Layout::EllipsizeMode, "ELLIPSIZE_"] if defined? Layout::EllipsizeMode targets << [Renderer::Part, "PART_"] if defined? Renderer::Part targets.each do |klass, prefix| (klass.constants - klass.superclass.constants).each do |name| unless klass.const_get(name).is_a? Class const_set("#{prefix}#{name}", klass.const_get(name)) end end end end GLib::Log.set_log_domain(Pango::LOG_DOMAIN) ruby-gnome2-all-2.1.0/pango/lib/1.9/0000755000175000017500000000000012257665514015002 5ustar koukouruby-gnome2-all-2.1.0/pango/sample/0000755000175000017500000000000012150300275015164 5ustar koukouruby-gnome2-all-2.1.0/pango/sample/attribute.rb0000644000175000017500000000342211701304107017514 0ustar koukou=begin attribute.rb - Ruby/Pango sample script. Copyright (c) 2002,2003 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: attribute.rb,v 1.6 2006/06/17 13:37:01 mutoh Exp $ =end require 'pango' p a = Pango::AttrSize.new(1) puts "value = #{a.value}" puts "start_index = #{a.start_index}" puts "end_index = #{a.end_index}" p a = Pango::AttrStyle.new(Pango::FontDescription::STYLE_NORMAL) puts "value = #{a.value}" p a = Pango::AttrVariant.new(Pango::FontDescription::VARIANT_SMALL_CAPS) puts "value = #{a.value}" p a = Pango::AttrStretch.new(Pango::FontDescription::STRETCH_EXPANDED) puts "value = #{a.value}" p a = Pango::AttrWeight.new(Pango::FontDescription::WEIGHT_BOLD) puts "value = #{a.value}" p a = Pango::AttrRise.new(10) puts "value = #{a.value}" p a = Pango::AttrLanguage.new(Pango::Language.new("ja")) p a.value p a.value.to_str p a = Pango::AttrFamily.new("family") p a.value p b = Pango::FontDescription.new p b.to_str p a = Pango::AttrFontDescription.new(b) p a.value p a.value.to_str p a = Pango::AttrForeground.new(10, 20, 30) p a.value p a.value.to_a p a = Pango::AttrBackground.new(20, 30, 40) p a.value p a.value.to_a p a = Pango::AttrStrikethrough.new(true) p a.value p Pango::AttrUnderline::SINGLE p a = Pango::AttrUnderline.new(Pango::AttrUnderline::SINGLE) p a.value p ink = Pango::Rectangle.new(1, 2, 3, 4) p log = Pango::Rectangle.new(5, 6, 7, 8) p a = Pango::AttrShape.new(ink, log) p a.value[0].to_a p a.value[1].to_a p a = Pango::AttrScale.new(2.3) p a.value begin require 'gtk2' rescue p "Ruby/GTK2 is not existed." exit 0 end p a = Gdk::PangoAttrEmbossed.new(true) p a.value mask = Gdk::Pixmap.new(Gtk::Window.new.realize.window, 100, 100, 1) p a = Gdk::PangoAttrStipple.new(mask) p a.value ruby-gnome2-all-2.1.0/pango/sample/gdk_layout.rb0000644000175000017500000000116412150300275017655 0ustar koukou=begin gdk_layout.rb - Ruby/Pango sample script. Copyright (c) 2003-2006 Ruby-GNOME2 Project This program is licenced under the same licence as Ruby-GNOME2. $Id: gdk_layout.rb,v 1.7 2006/06/17 13:36:11 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Ruby/Pango sample") window.signal_connect("destroy"){Gtk.main_quit} window.realize gdkwin = window.window gc = Gdk::GC.new(gdkwin) layout = window.create_pango_layout layout.set_markup(File.read("sample.txt"), "$") window.signal_connect("expose_event") do gdkwin.draw_layout(gc, 10, 10, layout) end window.set_default_size(500,400).show_all Gtk.main ruby-gnome2-all-2.1.0/pango/sample/parse.rb0000644000175000017500000000132712150300275016626 0ustar koukou#!/usr/bin/env ruby =begin parse.rb - Ruby/Pango sample script. Copyright (c) 2002,2003 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: parse.rb,v 1.4 2005/03/22 17:41:29 silicio Exp $ =end require 'pango' str = File.read("sample.txt") puts str puts "------" attr_list, text, accel_char = Pango.parse_markup(str, '$') puts "attr_list = #{attr_list}" puts "text = #{text}" puts "accel_char = #{accel_char}" puts "------" iterator = attr_list.iterator attr_list.each(text) do |iterator, text, start_pos, end_pos| puts "range = #{start_pos}, #{end_pos}" puts "text = #{text}" iterator.get.each do |attr| puts "#{attr} = #{attr.value}" end puts "---" end ruby-gnome2-all-2.1.0/pango/sample/label.rb0000644000175000017500000000101412150300275016564 0ustar koukou=begin label.rb - Ruby/Pango sample script. Copyright (c) 2002,2003 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: label.rb,v 1.4 2006/06/17 13:36:11 mutoh Exp $ =end require 'gtk2' str = File.read("sample.txt") attrs, text, accel_char = Pango.parse_markup(str, '$') #This is same as Gtk::Label#set_markup() label = Gtk::Label.new(text) label.attributes = attrs win = Gtk::Window.new win.signal_connect("destroy"){Gtk.main_quit} win.add(label).show_all Gtk.main ruby-gnome2-all-2.1.0/pango/sample/break.rb0000644000175000017500000000143412150300275016577 0ustar koukou# -*- coding: utf-8 -*- =begin break.rb - Ruby/Pango sample script. Copyright (c) 2005 Ruby-GNOME2 Project This program is licenced under the same licence as Ruby-GNOME2. $Id: break.rb,v 1.1 2005/09/17 17:09:12 mutoh Exp $ =end require 'pango' attr = Pango.break("Hello Worldã§ã™\n2nd line", Pango::Analysis.new) p attr.length attr.each do |v| print "line_break:#{v.line_break?}" print ", mandatory_break:#{v.mandatory_break?}" print ", char_break:#{v.char_break?}" print ", white:#{v.white?}" print ", cursor_position:#{v.cursor_position?}" print ", word_start:#{v.word_start?}" print ", word_end:#{v.word_end?}" print ", sentence_boundary:#{v.sentence_boundary?}" print ", sentence_start:#{v.sentence_start?}" print ", sentence_end:#{v.sentence_end?}\n" end ruby-gnome2-all-2.1.0/pango/sample/pango_cairo.rb0000644000175000017500000000325111701304107017772 0ustar koukou=begin cairo.rb - Ruby/Pango with cairo sample script. Copyright (c) 2005 Ruby-GNOME2 Project This program is licenced under the same licence as Ruby-GNOME2. $Id: pango_cairo.rb,v 1.1 2005/10/15 07:57:52 mutoh Exp $ =end require 'pango' unless Pango.cairo_available? STDERR.puts "This sample requires Pango 1.0.0 or later and cairo support" exit 1 end filename = ARGV.shift filename ||= "cairo.png" RADIUS = 150 N_WORDS = 10 FONT = "Sans Bold 27" def draw_text(cr) # Center coordinates on the middle of the region we are drawing cr.translate(RADIUS, RADIUS); # Create a PangoLayout, set the font and text layout = cr.create_pango_layout layout.set_text("Text") desc = Pango::FontDescription.new(FONT) layout.set_font_description(desc) # Draw the layout N_WORDS times in a circle N_WORDS.times do |i| angle = (360.0 * i) / N_WORDS; cr.save do # Gradient from red at angle == 60 to blue at angle == 300 red = (1 + Math.cos((angle - 60) * Math::PI / 180.0)) / 2 cr.set_source_rgb(red, 0, 1.0 - red) cr.rotate(angle * Math::PI / 180.0) # Inform Pango to re-layout the text with the new transformation cr.update_pango_layout(layout) width, height = layout.size cr.move_to(-(width.to_f / Pango::SCALE) / 2, -RADIUS) cr.show_pango_layout(layout) end end end diameter = 2 * RADIUS surface = Cairo::ImageSurface.new(Cairo::FORMAT_ARGB32, diameter, diameter) cr = Cairo::Context.new(surface) cr.set_source_rgb(1.0, 1.0, 1.0) cr.rectangle(0, 0, diameter, diameter); cr.fill draw_text(cr) File.open(filename, "wb") do |f| cr.target.write_to_png(f) end # or # cr.target.write_to_png(filename) ruby-gnome2-all-2.1.0/pango/sample/sample.txt0000644000175000017500000000101411701304107017201 0ustar koukouHello World! ã“ã‚“ã«ã¡ã‚ä¸–ç•Œï¼ Ruby/Pango $Ruby-GNOME2 ABCDEF ruby-gnome2-all-2.1.0/pango/sample/layout.rb0000644000175000017500000000462612150300275017036 0ustar koukou#!/usr/local/bin/ruby =begin layout.rb - Ruby/Pango sample script. Copyright (c) 2005 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: layout.rb,v 1.2 2006/06/17 13:36:11 mutoh Exp $ =end require 'gtk2' require 'pp' puts puts "Start----------" puts str = File.read("sample.txt") context = Gdk::Pango.context context.base_dir = Pango::Context::DIRECTION_LTR context.language = Pango::Language.new("ja_JP") fd = Pango::FontDescription.new("Sans 18") font = context.load_font(fd) font_map = context.font_map p "context: #{context}" p "font_desc: #{fd}" p "font: #{font}" p "font_map: #{font_map}" puts puts "Pango::Layout----------" puts p layout = Pango::Layout.new(context) layout.set_markup(str) layout.font_description = fd layout.auto_dir = true layout.alignment = Pango::Layout::ALIGN_LEFT p "attributes: #{layout.attributes}" p "font_description: #{layout.font_description}" p "width: #{layout.width}" p "wrap: #{layout.wrap}" p "ellipsize: #{layout.ellipsize}" p "indent: #{layout.indent}" p "spacing: #{layout.spacing}" p "justify?: #{layout.justify?}" p "auto_dir?: #{layout.auto_dir?}" p "alignment: #{layout.alignment.inspect}" p "tabs: #{layout.tabs}" p "single_paragraph_mode?: #{layout.single_paragraph_mode?}" p "size: #{layout.size}" p "pixel_size: #{layout.pixel_size}" p "line_count: #{layout.line_count}" puts "lines:" pp layout.lines puts puts "Pango::LayoutIter--------" puts iter = layout.iter p "iter: #{iter}" p "index: #{iter.index}" p "baseline: #{iter.baseline}" p "line: #{iter.line}" p "char_extents: #{iter.char_extents}" p "cluster_extents: #{iter.cluster_extents}" p "run_extents: #{iter.run_extents}" p "layout_extents: #{iter.layout_extents}" p "line_extents: #{iter.line_extents}" p "line_yrange: #{iter.line_yrange}" puts puts "Pango::GlyphItem-------" puts glyph = iter.run p "glyph: #{glyph}" p "item: #{glyph.item}" p "glyphs: #{glyph.glyphs}" puts puts "Pango::LayoutLine ----------" puts line = iter.line p "line = #{line}" p "extents: #{line.extents}" p "pixel_extents: #{line.pixel_extents}" p "index_to_x: #{line.index_to_x(1, true)}" p "x_to_index: #{line.x_to_index(1)}" p "x_ranges: #{line.get_x_ranges(0, 2)}" p "layout: #{line.layout}" p "start_index: #{line.start_index}" p "length: #{line.length}" p "paragraph_start?: #{line.paragraph_start?}" p "resolved_dir: #{line.resolved_dir}" puts "runs:" pp line.runs puts puts "End----------" ruby-gnome2-all-2.1.0/pango/sample/item.rb0000644000175000017500000000200112150300275016440 0ustar koukou# -*- coding: utf-8 -*- =begin item.rb - Ruby/Pango sample script. Copyright (c) 2005 Ruby-GNOME2 Project This program is licenced under the same licence as Ruby-GNOME2. $Id: item.rb,v 1.3 2006/06/17 13:37:01 mutoh Exp $ =end require 'gtk2' str = "Ruby-GNOME2ã“ã‚“ã«ã¡ã‚" win = Gtk::Window.new("Ruby/Pango sample") win.realize p screen = Gdk::Screen.default p context = Gdk::Pango.context(screen) p attrlist = Pango::AttrList.new p a = Pango::AttrBackground.new(65535, 0, 0) attrlist.insert(Pango::AttrBackground.new(65535, 0,0)) attrs = [Pango::AttrBackground.new(65535, 0,0), Pango::AttrForeground.new(65535, 0,0)] items = context.itemize(Pango::Context::DIRECTION_RTL, str, 0, 40, attrlist) items.each do |v| ana = v.analysis puts "shape_engine = #{ana.shape_engine}, lang_engine = #{ana.lang_engine}, font = #{ana.font}, level = #{ana.level}" puts "language = #{ana.language}" p ana.font.get_glyph_extents("a".codepoints.first)[0].to_a ana.set_extra_attrs(attrs) p ana.extra_attrs end ruby-gnome2-all-2.1.0/pango/sample/glyphstring.rb0000755000175000017500000000263412150300275020073 0ustar koukou#!/usr/bin/env ruby =begin glyphstring.rb - Ruby/Pango sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: glyphstring.rb,v 1.3 2006/06/17 14:16:53 ktou Exp $ =end require 'gtk2' str = "Hello World" lang = Pango::Language.new("ja_JP") fd = Pango::FontDescription.new("Sans 18") context = Gdk::Pango.context context.language = lang context.base_dir = Pango::DIRECTION_LTR context.font_description = fd p font = context.load_font(fd) family = context.families[10] puts "#{family.class}, #{family.name}" family.faces.each do |face| puts face.name end p fmap = font.font_map p fset = fmap.load_fontset(context, fd, lang) gs = Pango::GlyphString.new ink_rect, logical_rect = gs.extents(font) p ink_rect.to_a p logical_rect.to_a item = Pango::Item.new item.analysis.font = font item.analysis.shape_engine = font.find_shaper(lang, str.codepoints.first) gs = Pango.shape(str, item.analysis) ink_rect, logical_rect = gs.extents(font, 0, 11) p ink_rect.to_a p logical_rect.to_a gs.glyphs.each do |info, log_clusters| puts "Pango::GlyphInfo: log_clusters = #{log_clusters}, glyph = #{info.glyph}, geometry = #{info.geometry.inspect}, cluster_start? = #{info.cluster_start?}" end p gs.index_to_x(str, item.analysis, 3, false) p gs.x_to_index(str, item.analysis, 103) p logical_widths = gs.get_logical_widths(str, item.analysis.level) ruby-gnome2-all-2.1.0/pango/sample/script.rb0000644000175000017500000000117212150300275017016 0ustar koukou# -*- coding: utf-8 -*- =begin script.rb - Ruby/Pango sample script. Copyright (c) 2005 Ruby-GNOME2 Project This program is licenced under the same licence as Ruby-GNOME2. $Id: script.rb,v 1.1 2005/09/17 17:09:12 mutoh Exp $ =end require 'pango' iter = Pango::ScriptIter.new("Helloã“ã‚“ã«ã¡ã¯ã‚³ãƒ³ãƒ‹ãƒãƒì•ˆë…•하세요السلام عليكمΕλληνικάவணகà¯à®•à®®à¯") begin start_pos, end_pos, script = iter.range puts "-----" puts "start : #{start_pos}" puts "end : #{end_pos}" puts "script: #{script.nick}" puts "sample_language: #{script.sample_language.to_s}" end while iter.next! ruby-gnome2-all-2.1.0/pango/extconf.rb0000644000175000017500000000222411701304107015675 0ustar koukou#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "pango" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ruby-gnome2-all-2.1.0/pango/Rakefile0000644000175000017500000000335612257552170015372 0ustar koukou# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require "gnome2/rake/package-task" package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/Pango is a Ruby binding of pango-1.x." package.description = "Ruby/Pango is a Ruby binding of pango-1.x." package.dependency.gem.runtime = [["cairo", ">= 1.12.5"], "glib2"] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = ["glib2", "gobject-introspection"] package.external_packages = [ { :name => "harfbuzz", :download_base_url => "http://www.freedesktop.org/software/harfbuzz/release", :label => "HarfBuzz", :version => "0.9.25", :compression_method => "bz2", :windows => { :configure_args => [ ], :patches => [ ], :built_file => "bin/libharfbuzz-0.dll", }, }, { :name => "pango", :download_site => :gnome, :label => "pango", :version => "1.36.1", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :patches => [ "pango-1.34.0-enable-fc-font.diff", ], :built_file => "bin/libpango-1.0-0.dll", }, }, ] end package_task.define namespace :gcc do namespace :dll do desc "Bundle GCC related DLLs" task(:bundle) do dlls = ["libstdc++-6.dll"] dlls.each do |dll| host = package_task.windows.build_host binary_dir = package_task.windows.absolute_binary_dir full_path = `#{host}-g++ -print-file-name=#{dll}`.strip cp(full_path, (binary_dir + "bin").to_s) end end end end task "win32:builder:build:harfbuzz:after" => "gcc:dll:bundle" ruby-gnome2-all-2.1.0/pango/test/0000755000175000017500000000000012257552170014675 5ustar koukouruby-gnome2-all-2.1.0/pango/test/pango-test-utils.rb0000644000175000017500000000034311701304107020425 0ustar koukoumodule PangoTestUtils private def only_pango_version(major, minor, micro=nil) micro ||= 0 unless Pango.check_version?(major, minor, micro) omit("Require Pango >= #{major}.#{minor}.#{micro}") end end end ruby-gnome2-all-2.1.0/pango/test/test-matrix.rb0000644000175000017500000000170312124610262017472 0ustar koukou# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestPangoMatrix < Test::Unit::TestCase include PangoTestUtils def test_xx matrix = Pango::Matrix.new assert_equal(1.0, matrix.xx) end end ruby-gnome2-all-2.1.0/pango/test/test-log-attr.rb0000644000175000017500000000173012124610262017717 0ustar koukou# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestPangoLogAttr < Test::Unit::TestCase include PangoTestUtils def test_line_break? attribute = Pango::LogAttr.new assert_false(attribute.line_break?) end end ruby-gnome2-all-2.1.0/pango/test/test-attribute.rb0000644000175000017500000000071311701304107020167 0ustar koukouclass TestAttribute < Test::Unit::TestCase include PangoTestUtils def setup @attribute = Pango::AttrLanguage.new(Pango::Language.default) end def test_start_index assert_equal(0, @attribute.start_index) @attribute.start_index = 5 assert_equal(5, @attribute.start_index) end def test_end_index assert_equal(GLib::MAXUINT, @attribute.end_index) @attribute.end_index = 5 assert_equal(5, @attribute.end_index) end end ruby-gnome2-all-2.1.0/pango/test/test-rectangle.rb0000644000175000017500000000174312124610262020136 0ustar koukou# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestPangoRectangle < Test::Unit::TestCase include PangoTestUtils def test_width rectangle = Pango::Rectangle.new(0, 10, 20, 30) assert_equal(20, rectangle.width) end end ruby-gnome2-all-2.1.0/pango/test/run-test.rb0000755000175000017500000000135711701304107017000 0ustar koukou#!/usr/bin/env ruby $VERBOSE = true ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") pango_base = File.join(ruby_gnome2_base, "pango") $LOAD_PATH.unshift(File.join(glib_base, "test")) require 'glib-test-init' [[glib_base, "glib2"], [pango_base, "pango"]].each do |target, module_name| if system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(1) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(pango_base, "test")) require 'pango-test-utils' require 'pango' exit Test::Unit::AutoRunner.run(true) ruby-gnome2-all-2.1.0/pango/test/test-analysis.rb0000644000175000017500000000171712124610262020016 0ustar koukou# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestPangoAnalysis < Test::Unit::TestCase include PangoTestUtils def test_level analysis = Pango::Analysis.new assert_equal(0, analysis.level) end end ruby-gnome2-all-2.1.0/pango/test/test-language.rb0000644000175000017500000000025111701304107017744 0ustar koukouclass TestLanguage < Test::Unit::TestCase include PangoTestUtils def test_default assert_match(/\A[a-z]{2}-[a-z]{2}\z/, Pango::Language.default.to_s) end end ruby-gnome2-all-2.1.0/pango/test/test-color.rb0000644000175000017500000000265212124610262017310 0ustar koukou# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestPangoColor < Test::Unit::TestCase include PangoTestUtils def test_red color = Pango::Color.new(0, 0, 0) assert_equal(0, color.red) color.red = 32768 assert_equal(32768, color.red) end def test_blue color = Pango::Color.new(0, 0, 0) assert_equal(0, color.blue) color.blue = 32768 assert_equal(32768, color.blue) end def test_green color = Pango::Color.new(0, 0, 0) assert_equal(0, color.green) color.green = 32768 assert_equal(32768, color.green) end def test_to_a color = Pango::Color.new(65535, 32768, 0) assert_equal([65535, 32768, 0], color.to_a) end end ruby-gnome2-all-2.1.0/pango/test/test-layout.rb0000644000175000017500000000146712257552170017524 0ustar koukouclass TestLayout < Test::Unit::TestCase include PangoTestUtils def setup @context = Pango::Context.new @layout = Pango::Layout.new(@context) end def test_set_font_description assert_nil(@layout.font_description) @layout.font_description = "sans 14" assert_equal("sans 14", @layout.font_description.to_s) description = Pango::FontDescription.new("monospace") description.size = 10 * Pango::SCALE @layout.font_description = description assert_equal("monospace 10", @layout.font_description.to_s) end def test_height assert_equal(-1, @layout.height) end def test_set_height new_height = 29 * Pango::SCALE @layout.height = new_height assert_equal(new_height, @layout.height) end def test_ellipsized? assert_false(@layout.ellipsized?) end end ruby-gnome2-all-2.1.0/vte/0000755000175000017500000000000012257665515013420 5ustar koukouruby-gnome2-all-2.1.0/vte/ext/0000755000175000017500000000000011701304107014174 5ustar koukouruby-gnome2-all-2.1.0/vte/ext/vte/0000755000175000017500000000000012064346475015013 5ustar koukouruby-gnome2-all-2.1.0/vte/ext/vte/rbvte-charattributes.c0000644000175000017500000000453211701304107021306 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte.h" #define RG_TARGET_NAMESPACE cCharAttributes static ID id_row, id_column, id_fore, id_back, id_underline, id_strikethrough; static VALUE rg_initialize(VALUE self, VALUE row, VALUE column, VALUE fore, VALUE back, VALUE underline, VALUE strikethrough) { rb_ivar_set(self, id_row, row); rb_ivar_set(self, id_column, column); rb_ivar_set(self, id_fore, fore); rb_ivar_set(self, id_back, back); rb_ivar_set(self, id_underline, underline); rb_ivar_set(self, id_strikethrough, strikethrough); return Qnil; } static VALUE rg_underline_p(VALUE self) { return rb_ivar_get(self, id_underline); } static VALUE rg_strikethrough_p(VALUE self) { return rb_ivar_get(self, id_strikethrough); } void Init_vte_charattributes(VALUE mVte) { VALUE RG_TARGET_NAMESPACE; id_row = rb_intern("@row"); id_column = rb_intern("@column"); id_fore = rb_intern("@fore"); id_back = rb_intern("@back"); id_underline = rb_intern("@underline"); id_strikethrough = rb_intern("@strikethrough"); RG_TARGET_NAMESPACE = rb_define_class_under(mVte, "CharAttributes", rb_cObject); RG_DEF_METHOD(initialize, 6); RG_DEF_ATTR("row", TRUE, FALSE, TRUE); RG_DEF_ATTR("column", TRUE, FALSE, TRUE); RG_DEF_ATTR("fore", TRUE, FALSE, TRUE); RG_DEF_ATTR("back", TRUE, FALSE, TRUE); RG_DEF_ALIAS("foreground", "fore"); RG_DEF_ALIAS("background", "back"); RG_DEF_METHOD_P(underline, 0); RG_DEF_METHOD_P(strikethrough, 0); } ruby-gnome2-all-2.1.0/vte/ext/vte/rbvte-terminal.c0000664000175000017500000007351111740310343020104 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte.h" #include #include #define RG_TARGET_NAMESPACE cTerminal #define _SELF(s) (VTE_TERMINAL(RVAL2GOBJ(s))) static ID id_new, id_call; static char ** rval2cstrary(VALUE ary) { long i, len; char **result; if (NIL_P(ary)) return NULL; len = RARRAY_LEN(ary); result = ALLOC_N(char *, len + 1); for (i = 0; i < len; i++) { result[i] = g_strdup(RVAL2CSTR(RARRAY_PTR(ary)[i])); } result[i] = NULL; return result; } static void free_cstrary(char **ary) { long i; if (!ary) return; for (i = 0; ary[i] != NULL; i++) { g_free(ary[i]); } g_free(ary); } static VALUE attrary2rval(GArray *attrs) { long i, len; VALUE rb_attrs, rb_class; len = attrs->len; rb_attrs = rb_ary_new2(len); rb_class = rb_const_get(rb_const_get(rb_cObject, rb_intern("Vte")), rb_intern("CharAttributes")); for (i = 0; i < len; i++) { VteCharAttributes *attr; attr = &g_array_index(attrs, VteCharAttributes, i); rb_ary_push(rb_attrs, rb_funcall(rb_class, id_new, 6, LONG2NUM(attr->row), LONG2NUM(attr->column), COLOR2RVAL(&(attr->fore)), COLOR2RVAL(&(attr->back)), CBOOL2RVAL(attr->underline), CBOOL2RVAL(attr->strikethrough))); } return rb_attrs; } static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, vte_terminal_new()); return Qnil; } #if VTE_CHECK_VERSION(0, 26, 0) static VALUE fork_command_default_argv(void) { struct passwd *pwd; const char *shell = NULL; pwd = getpwuid(getuid()); if (pwd != NULL) shell = pwd->pw_shell; if (shell == NULL) shell = g_getenv("SHELL") ? g_getenv("SHELL") : "/bin/sh"; return rb_ary_new3(1, CSTR2RVAL(shell)); } static VALUE fork_command_full(int argc, VALUE *argv, VALUE self) { VALUE options, rb_pty_flags, rb_working_directory, rb_command_argv, rb_envv, rb_spawn_flags; int pty_flags, spawn_flags; char *working_directory; char **command_argv; char **envv; GPid child_pid; gboolean result; GError *error = NULL; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "pty_flags", &rb_pty_flags, "working_directory", &rb_working_directory, "argv", &rb_command_argv, "envv", &rb_envv, "spawn_flags", &rb_spawn_flags, NULL); pty_flags = NIL_P(rb_pty_flags) ? VTE_PTY_DEFAULT : RVAL2GFLAGS(rb_pty_flags, VTE_TYPE_PTY_FLAGS); working_directory = NIL_P(rb_working_directory) ? NULL : RVAL2CSTR(rb_working_directory); command_argv = rval2cstrary(NIL_P(rb_command_argv) ? fork_command_default_argv() : rb_command_argv); envv = rval2cstrary(rb_envv); spawn_flags = NIL_P(rb_spawn_flags) ? G_SPAWN_CHILD_INHERITS_STDIN | G_SPAWN_SEARCH_PATH : NUM2INT(rb_spawn_flags); result = vte_terminal_fork_command_full(_SELF(self), pty_flags, working_directory, command_argv, envv, spawn_flags, NULL, NULL, &child_pid, &error); free_cstrary(command_argv); free_cstrary(envv); if (error) RAISE_GERROR(error); return INT2NUM(child_pid); } #endif static VALUE rg_fork_command(int argc, VALUE *argv, VALUE self) { VALUE rb_command, rb_command_argv, rb_envv, rb_directory; VALUE lastlog, utmp, wtmp; char *command; char **command_argv; char **envv; char *directory; pid_t pid; rb_scan_args(argc, argv, "07", &rb_command, &rb_command_argv, &rb_envv, &rb_directory, &lastlog, &utmp, &wtmp); #if VTE_CHECK_VERSION(0, 26, 0) if (argc == 0 || TYPE(rb_command) == T_HASH) return fork_command_full(1, &rb_command, self); rb_warn("'fork_commad(command, argv, envv, directory, lastlog, utmp, wtmp)' style" " has been deprecated since version 0.26." " Use 'fork_commad(options = {})' style."); #endif command = NIL_P(rb_command) ? NULL : RVAL2CSTR(rb_command); command_argv = rval2cstrary(rb_command_argv); envv = rval2cstrary(rb_envv); directory = NIL_P(rb_directory) ? NULL : RVAL2CSTR(rb_directory); pid = vte_terminal_fork_command(RVAL2TERM(self), command, command_argv, envv, directory, NIL_P(lastlog) ? TRUE : RVAL2CBOOL(lastlog), NIL_P(utmp) ? TRUE : RVAL2CBOOL(utmp), NIL_P(wtmp) ? TRUE : RVAL2CBOOL(wtmp)); free_cstrary(command_argv); free_cstrary(envv); return INT2NUM(pid); } static VALUE rg_fork_pty(int argc, VALUE *argv, VALUE self) { VALUE rb_envv, rb_directory, lastlog, utmp, wtmp; char **envv; char *directory; pid_t pid; rb_scan_args(argc, argv, "05", &rb_envv, &rb_directory, &lastlog, &utmp, &wtmp); envv = rval2cstrary(rb_envv); directory = NIL_P(rb_directory) ? NULL : RVAL2CSTR(rb_directory); pid = vte_terminal_forkpty(RVAL2TERM(self), envv, directory, NIL_P(lastlog) ? TRUE : RVAL2CBOOL(lastlog), NIL_P(utmp) ? TRUE : RVAL2CBOOL(utmp), NIL_P(wtmp) ? TRUE : RVAL2CBOOL(wtmp)); free_cstrary(envv); return INT2NUM(pid); } static VALUE rg_feed(VALUE self, VALUE data) { glong length; length = RSTRING_LEN(data); if (length > 0) { vte_terminal_feed(RVAL2TERM(self), RSTRING_PTR(data), length); } return self; } static VALUE rg_feed_child(VALUE self, VALUE data) { glong length; length = RSTRING_LEN(data); if (length > 0) { vte_terminal_feed_child(RVAL2TERM(self), RSTRING_PTR(data), length); } return self; } static VALUE rg_feed_child_binary(VALUE self, VALUE data) { glong length; length = RSTRING_LEN(data); if (length > 0) { vte_terminal_feed_child_binary(RVAL2TERM(self), RSTRING_PTR(data), length); } return self; } static VALUE rg_copy_clipboard(VALUE self) { vte_terminal_copy_clipboard(RVAL2TERM(self)); return self; } static VALUE rg_paste_clipboard(VALUE self) { vte_terminal_paste_clipboard(RVAL2TERM(self)); return self; } static VALUE rg_copy_primary(VALUE self) { vte_terminal_copy_primary(RVAL2TERM(self)); return self; } static VALUE rg_paste_primary(VALUE self) { vte_terminal_paste_primary(RVAL2TERM(self)); return self; } static VALUE rg_set_size(VALUE self, VALUE columns, VALUE rows) { vte_terminal_set_size(RVAL2TERM(self), NUM2LONG(columns), NUM2LONG(rows)); return self; } static VALUE rg_set_audible_bell(VALUE self, VALUE is_audible) { vte_terminal_set_audible_bell(RVAL2TERM(self), RVAL2CBOOL(is_audible)); return self; } static VALUE rg_audible_bell_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_audible_bell(RVAL2TERM(self))); } static VALUE rg_set_visible_bell(VALUE self, VALUE is_visible) { vte_terminal_set_visible_bell(RVAL2TERM(self), RVAL2CBOOL(is_visible)); return self; } static VALUE rg_visible_bell_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_visible_bell(RVAL2TERM(self))); } static VALUE rg_set_scroll_background(VALUE self, VALUE scroll) { vte_terminal_set_scroll_background(RVAL2TERM(self), RVAL2CBOOL(scroll)); return self; } static VALUE rg_set_scroll_on_output(VALUE self, VALUE scroll) { vte_terminal_set_scroll_on_output(RVAL2TERM(self), RVAL2CBOOL(scroll)); return self; } static VALUE rg_set_scroll_on_keystroke(VALUE self, VALUE scroll) { vte_terminal_set_scroll_on_keystroke(RVAL2TERM(self), RVAL2CBOOL(scroll)); return self; } static VALUE rg_set_color_dim(VALUE self, VALUE dim) { vte_terminal_set_color_dim(RVAL2TERM(self), RVAL2COLOR(dim)); return self; } static VALUE rg_set_color_bold(VALUE self, VALUE bold) { vte_terminal_set_color_bold(RVAL2TERM(self), RVAL2COLOR(bold)); return self; } static VALUE rg_set_color_foreground(VALUE self, VALUE foreground) { vte_terminal_set_color_foreground(RVAL2TERM(self), RVAL2COLOR(foreground)); return self; } static VALUE rg_set_color_background(VALUE self, VALUE background) { vte_terminal_set_color_background(RVAL2TERM(self), RVAL2COLOR(background)); return self; } static VALUE rg_set_color_cursor(VALUE self, VALUE cursor) { vte_terminal_set_color_cursor(RVAL2TERM(self), NIL_P(cursor) ? NULL : RVAL2COLOR(cursor)); return self; } static VALUE rg_set_color_highlight(VALUE self, VALUE highlight) { vte_terminal_set_color_highlight(RVAL2TERM(self), NIL_P(highlight) ? NULL : RVAL2COLOR(highlight)); return self; } static VALUE rg_set_colors(VALUE self, VALUE foreground, VALUE background, VALUE rb_palette) { glong i, len; GdkColor *palette; len = RARRAY_LEN(rb_palette); if (!(len == 0 || len == 8 || len == 16 || len == 24)) { char *inspect; inspect = RVAL2CSTR(rb_palette); rb_raise(rb_eArgError, "palette size must be 0, 8, 16 or 24: %s", inspect); } palette = ALLOCA_N(GdkColor, len); for (i = 0; i < len; i++) { GdkColor *color; color = RVAL2COLOR(RARRAY_PTR(rb_palette)[i]); palette[i] = *color; } vte_terminal_set_colors(RVAL2TERM(self), RVAL2COLOR(foreground), RVAL2COLOR(background), palette, len); return self; } static VALUE rg_set_default_colors(VALUE self) { vte_terminal_set_default_colors(RVAL2TERM(self)); return self; } static VALUE rg_set_background_image(VALUE self, VALUE image_or_path) { if (RVAL2CBOOL(rb_obj_is_kind_of(image_or_path, rb_cString))) { vte_terminal_set_background_image_file(RVAL2TERM(self), RVAL2CSTR(image_or_path)); } else { vte_terminal_set_background_image(RVAL2TERM(self), RVAL2GOBJ(image_or_path)); } return self; } static VALUE rg_set_background_tint_color(VALUE self, VALUE color) { vte_terminal_set_background_tint_color(RVAL2TERM(self), RVAL2COLOR(color)); return self; } static VALUE rg_set_background_saturation(VALUE self, VALUE saturation) { vte_terminal_set_background_saturation(RVAL2TERM(self), NUM2DBL(saturation)); return self; } static VALUE rg_set_background_transparent(VALUE self, VALUE transparent) { vte_terminal_set_background_transparent(RVAL2TERM(self), RVAL2CBOOL(transparent)); return self; } static VALUE rg_set_cursor_blinks(VALUE self, VALUE blink) { #if VTE_CHECK_VERSION(0, 18, 0) VteTerminalCursorBlinkMode mode; mode = RVAL2CBOOL(blink) ? VTE_CURSOR_BLINK_ON : VTE_CURSOR_BLINK_OFF; vte_terminal_set_cursor_blink_mode(RVAL2TERM(self), mode); #else vte_terminal_set_cursor_blinks(RVAL2TERM(self), RVAL2CBOOL(blink)); #endif return self; } #if VTE_CHECK_VERSION(0, 18, 0) static VALUE rg_set_cursor_blink_mode(VALUE self, VALUE rb_mode) { VteTerminalCursorBlinkMode mode; mode = RVAL2GENUM(rb_mode, VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE); vte_terminal_set_cursor_blink_mode(RVAL2TERM(self), mode); return self; } static VALUE rg_cursor_blink_mode(VALUE self) { VteTerminalCursorBlinkMode mode; mode = vte_terminal_get_cursor_blink_mode(RVAL2TERM(self)); return GENUM2RVAL(mode, VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE); } #endif #if VTE_CHECK_VERSION(0, 19, 1) static VALUE rg_set_cursor_shape(VALUE self, VALUE rb_shape) { VteTerminalCursorShape shape; shape = RVAL2GENUM(rb_shape, VTE_TYPE_TERMINAL_CURSOR_SHAPE); vte_terminal_set_cursor_shape(RVAL2TERM(self), shape); return self; } static VALUE rg_cursor_shape(VALUE self) { VteTerminalCursorShape shape; shape = vte_terminal_get_cursor_shape(RVAL2TERM(self)); return GENUM2RVAL(shape, VTE_TYPE_TERMINAL_CURSOR_SHAPE); } #if !VTE_CHECK_VERSION(0, 20, 0) static VALUE rg_pty(VALUE self) { return INT2NUM(vte_terminal_get_pty(RVAL2TERM(self))); } #endif static VALUE rg_child_exit_status(VALUE self) { return INT2NUM(vte_terminal_get_child_exit_status(RVAL2TERM(self))); } #endif static VALUE rg_set_scrollback_lines(VALUE self, VALUE lines) { vte_terminal_set_scrollback_lines(RVAL2TERM(self), NUM2LONG(lines)); return self; } static VALUE rg_im_append_menuitems(VALUE self, VALUE menushell) { vte_terminal_im_append_menuitems(RVAL2TERM(self), RVAL2GOBJ(menushell)); return self; } static VALUE rg_set_font(int argc, VALUE *argv, VALUE self) { VALUE font_desc_or_name, rb_antialias; VteTerminalAntiAlias antialias = VTE_ANTI_ALIAS_USE_DEFAULT; VteTerminal *term; rb_scan_args(argc, argv, "11", &font_desc_or_name, &rb_antialias); term = RVAL2TERM(self); if (!NIL_P(rb_antialias)) antialias = RVAL2AA(rb_antialias); if (rb_obj_is_kind_of(font_desc_or_name, rb_cString)) { char *name; name = RVAL2CSTR(font_desc_or_name); if (NIL_P(rb_antialias)) vte_terminal_set_font_from_string(term, name); else vte_terminal_set_font_from_string_full(term, name, antialias); } else { PangoFontDescription *font_desc; font_desc = RVAL2PFD(font_desc_or_name); if (NIL_P(rb_antialias)) vte_terminal_set_font(term, font_desc); else vte_terminal_set_font_full(term, font_desc, antialias); } return self; } static VALUE rg_font(VALUE self) { PangoFontDescription *font_desc; font_desc = (PangoFontDescription *)vte_terminal_get_font(RVAL2TERM(self)); return PFD2RVAL(font_desc); } static VALUE rg_using_xft_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_using_xft(RVAL2TERM(self))); } static VALUE rg_set_allow_bold(VALUE self, VALUE allow_bold) { vte_terminal_set_allow_bold(RVAL2TERM(self), RVAL2CBOOL(allow_bold)); return self; } static VALUE rg_allow_bold_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_allow_bold(RVAL2TERM(self))); } static VALUE rg_has_selection_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_has_selection(RVAL2TERM(self))); } static VALUE rg_set_word_chars(VALUE self, VALUE word_chars) { vte_terminal_set_word_chars(RVAL2TERM(self), NIL_P(word_chars) ? NULL : RVAL2CSTR(word_chars)); return self; } static VALUE rg_word_char_p(VALUE self, VALUE c) { return CBOOL2RVAL(vte_terminal_is_word_char(RVAL2TERM(self), NUM2UINT(c))); } static VALUE rg_set_backspace_binding(VALUE self, VALUE binding) { vte_terminal_set_backspace_binding(RVAL2TERM(self), RVAL2EB(binding)); return self; } static VALUE rg_set_delete_binding(VALUE self, VALUE binding) { vte_terminal_set_delete_binding(RVAL2TERM(self), RVAL2EB(binding)); return self; } static VALUE rg_mouse_autohide_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_mouse_autohide(RVAL2TERM(self))); } static VALUE rg_set_mouse_autohide(VALUE self, VALUE setting) { vte_terminal_set_mouse_autohide(RVAL2TERM(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_reset(VALUE self, VALUE full, VALUE clear_history) { vte_terminal_reset(RVAL2TERM(self), RVAL2CBOOL(full), RVAL2CBOOL(clear_history)); return self; } static gboolean term_is_selected_cb(VteTerminal *terminal, glong column, glong row, gpointer data) { gboolean result = TRUE; VALUE callback = (VALUE)data; if (!NIL_P(callback)) { VALUE rb_result; rb_result = rb_funcall(callback, id_call, 3, GOBJ2RVAL(terminal), LONG2NUM(column), LONG2NUM(row)); result = RVAL2CBOOL(rb_result); } return result; } static VALUE rg_get_text(int argc, VALUE *argv, VALUE self) { VALUE get_attrs, include_trailing_spaces, proc, rb_text; GArray *attrs = NULL; char *text; rb_scan_args(argc, argv, "02&", &get_attrs, &include_trailing_spaces, &proc); if (get_attrs != Qfalse) attrs = g_array_new(FALSE, TRUE, sizeof(VteCharAttributes)); if (RVAL2CBOOL(include_trailing_spaces)) { text = vte_terminal_get_text_include_trailing_spaces( RVAL2TERM(self), term_is_selected_cb, (gpointer)proc, attrs); } else { text = vte_terminal_get_text(RVAL2TERM(self), term_is_selected_cb, (gpointer)proc, attrs); } rb_text = CSTR2RVAL(text); free(text); if (attrs) { VALUE rb_attrs; rb_attrs = attrary2rval(attrs); g_array_free(attrs, TRUE); return rb_ary_new3(2, rb_text, rb_attrs); } else { return rb_text; } } static VALUE rg_get_text_range(int argc, VALUE *argv, VALUE self) { VALUE start_row, start_col, end_row, end_col, get_attrs, proc, rb_text; GArray *attrs = NULL; char *text; rb_scan_args(argc, argv, "41&", &start_row, &start_col, &end_row, &end_col, &get_attrs, &proc); if (get_attrs != Qfalse) attrs = g_array_new(FALSE, TRUE, sizeof(VteCharAttributes)); text = vte_terminal_get_text_range(RVAL2TERM(self), NUM2LONG(start_row), NUM2LONG(start_col), NUM2LONG(end_row), NUM2LONG(end_col), term_is_selected_cb, (gpointer)proc, attrs); rb_text = CSTR2RVAL(text); free(text); if (attrs) { VALUE rb_attrs; rb_attrs = attrary2rval(attrs); g_array_free(attrs, TRUE); return rb_ary_new3(2, rb_text, rb_attrs); } else { return rb_text; } } static VALUE rg_cursor_position(VALUE self) { glong column, row; vte_terminal_get_cursor_position(RVAL2TERM(self), &column, &row); return rb_ary_new3(2, LONG2NUM(column), LONG2NUM(row)); } static VALUE rg_match_clear_all(VALUE self) { vte_terminal_match_clear_all(RVAL2TERM(self)); return self; } static VALUE rg_match_add(VALUE self, VALUE match) { return INT2NUM(vte_terminal_match_add(RVAL2TERM(self), RVAL2CSTR(match))); } static VALUE rg_match_set_cursor(VALUE self, VALUE tag, VALUE cursor) { if (NIL_P(cursor) || RVAL2GTYPE(cursor) == GDK_TYPE_CURSOR) { vte_terminal_match_set_cursor(RVAL2TERM(self), NUM2INT(tag), RVAL2GOBJ(cursor)); } else if (RVAL2GTYPE(cursor) == GDK_TYPE_CURSOR_TYPE) { vte_terminal_match_set_cursor_type(RVAL2TERM(self), NUM2INT(tag), RVAL2CT(cursor)); #if VTE_CHECK_VERSION(0, 17, 1) } else { vte_terminal_match_set_cursor_name(_SELF(self), NUM2INT(tag), RVAL2CSTR(cursor)); #endif } return self; } static VALUE rg_match_remove(VALUE self, VALUE tag) { vte_terminal_match_remove(RVAL2TERM(self), NUM2INT(tag)); return self; } static VALUE rg_match_check(VALUE self, VALUE column, VALUE row) { char *string; int tag; string = vte_terminal_match_check(RVAL2TERM(self), NUM2LONG(column), NUM2LONG(row), &tag); if (string) { VALUE rb_string; rb_string = CSTR2RVAL(string); free(string); return rb_ary_new3(2, rb_string, INT2NUM(tag)); } else { return Qnil; } } #if !VTE_CHECK_VERSION(0, 20, 0) static VALUE rg_set_emulation(VALUE self, VALUE emulation) { vte_terminal_set_emulation(RVAL2TERM(self), RVAL2CSTR(emulation)); return self; } static VALUE rg_emulation(VALUE self) { return CSTR2RVAL(vte_terminal_get_emulation(RVAL2TERM(self))); } #endif static VALUE rg_default_emulation(VALUE self) { return CSTR2RVAL(vte_terminal_get_default_emulation(RVAL2TERM(self))); } #if !VTE_CHECK_VERSION(0, 20, 0) static VALUE rg_set_encoding(VALUE self, VALUE encoding) { vte_terminal_set_encoding(RVAL2TERM(self), RVAL2CSTR(encoding)); return self; } static VALUE rg_encoding(VALUE self) { return CSTR2RVAL(vte_terminal_get_encoding(RVAL2TERM(self))); } #endif static VALUE rg_status_line(VALUE self) { return CSTR2RVAL(vte_terminal_get_status_line(RVAL2TERM(self))); } static VALUE rg_padding(VALUE self) { int xpad, ypad; vte_terminal_get_padding(RVAL2TERM(self), &xpad, &ypad); return rb_ary_new3(2, INT2NUM(xpad), INT2NUM(ypad)); } #if !VTE_CHECK_VERSION(0, 20, 0) static VALUE rg_set_pty(VALUE self, VALUE pty_master) { vte_terminal_set_pty(RVAL2TERM(self), NUM2INT(pty_master)); return self; } #endif static VALUE rg_adjustment(VALUE self) { return GOBJ2RVAL(vte_terminal_get_adjustment(RVAL2TERM(self))); } static VALUE rg_char_width(VALUE self) { return LONG2NUM(vte_terminal_get_char_width(RVAL2TERM(self))); } static VALUE rg_char_height(VALUE self) { return LONG2NUM(vte_terminal_get_char_height(RVAL2TERM(self))); } static VALUE rg_char_descent(VALUE self) { return LONG2NUM(vte_terminal_get_char_descent(RVAL2TERM(self))); } static VALUE rg_char_ascent(VALUE self) { return LONG2NUM(vte_terminal_get_char_ascent(RVAL2TERM(self))); } static VALUE rg_row_count(VALUE self) { return LONG2NUM(vte_terminal_get_row_count(RVAL2TERM(self))); } static VALUE rg_column_count(VALUE self) { return LONG2NUM(vte_terminal_get_column_count(RVAL2TERM(self))); } static VALUE rg_window_title(VALUE self) { return CSTR2RVAL(vte_terminal_get_window_title(RVAL2TERM(self))); } static VALUE rg_icon_title(VALUE self) { return CSTR2RVAL(vte_terminal_get_icon_title(RVAL2TERM(self))); } #if VTE_CHECK_VERSION(0, 26, 0) static VALUE rg_pty_new(VALUE self, VALUE flags) { VtePty *result; GError *error = NULL; result = vte_terminal_pty_new(_SELF(self), RVAL2GFLAGS(flags, VTE_TYPE_PTY_FLAGS), &error); if (error) RAISE_GERROR(error); return GOBJ2RVAL(result); } #endif #if VTE_CHECK_VERSION(0, 26, 0) static VALUE rg_search_find_next(VALUE self) { gboolean result; result = vte_terminal_search_find_next(_SELF(self)); return CBOOL2RVAL(result); } #endif #if VTE_CHECK_VERSION(0, 26, 0) static VALUE rg_search_find_previous(VALUE self) { gboolean result; result = vte_terminal_search_find_previous(_SELF(self)); return CBOOL2RVAL(result); } #endif #if VTE_CHECK_VERSION(0, 26, 0) static VALUE rg_search_get_wrap_around_p(VALUE self) { gboolean result; result = vte_terminal_search_get_wrap_around(_SELF(self)); return CBOOL2RVAL(result); } #endif #if VTE_CHECK_VERSION(0, 26, 0) static VALUE rg_search_set_wrap_around(VALUE self, VALUE wrap_around) { vte_terminal_search_set_wrap_around(_SELF(self), RVAL2CBOOL(wrap_around)); return self; } #endif #if VTE_CHECK_VERSION(0, 16, 0) static VALUE rg_select_all(VALUE self) { vte_terminal_select_all(_SELF(self)); return self; } #endif #if VTE_CHECK_VERSION(0, 16, 0) static VALUE rg_select_none(VALUE self) { vte_terminal_select_none(_SELF(self)); return self; } #endif static VALUE rg_set_opacity(VALUE self, VALUE opacity) { vte_terminal_set_opacity(_SELF(self), NUM2UINT(opacity)); return self; } #if VTE_CHECK_VERSION(0, 26, 0) static VALUE rg_watch_child(VALUE self, VALUE child_pid) { vte_terminal_watch_child(_SELF(self), NUM2INT(child_pid)); return self; } #endif #if VTE_CHECK_VERSION(0, 24, 0) static VALUE rg_write_contents(int argc, VALUE *argv, VALUE self) { VALUE stream, flags, rb_cancellable; GCancellable *cancellable; gboolean result; GError *error = NULL; rb_scan_args(argc, argv, "21", &stream, &flags, &rb_cancellable); cancellable = NIL_P(rb_cancellable) ? NULL : RVAL2GOBJ(rb_cancellable); result = vte_terminal_write_contents(_SELF(self), RVAL2GOBJ(stream), RVAL2GENUM(flags, VTE_TYPE_TERMINAL_WRITE_FLAGS), cancellable, &error); if (error) RAISE_GERROR(error); return CBOOL2RVAL(result); } #endif void Init_vte_terminal(VALUE mVte) { VALUE RG_TARGET_NAMESPACE; id_new = rb_intern("new"); id_call = rb_intern("call"); RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_TERMINAL, "Terminal", mVte); G_DEF_CLASS(VTE_TYPE_TERMINAL_ERASE_BINDING, "EraseBinding", RG_TARGET_NAMESPACE); #if VTE_CHECK_VERSION(0, 18, 0) G_DEF_CLASS(VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE, "CursorBlinkMode", RG_TARGET_NAMESPACE); #endif #if VTE_CHECK_VERSION(0, 19, 1) G_DEF_CLASS(VTE_TYPE_TERMINAL_CURSOR_SHAPE, "CursorShape", RG_TARGET_NAMESPACE); #endif #if VTE_CHECK_VERSION(0, 24, 0) G_DEF_CLASS(VTE_TYPE_TERMINAL_WRITE_FLAGS, "WriteFlags", RG_TARGET_NAMESPACE); #endif RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(fork_command, -1); RG_DEF_METHOD(fork_pty, -1); RG_DEF_METHOD(feed, 1); RG_DEF_METHOD(feed_child, 1); RG_DEF_METHOD(feed_child_binary, 1); RG_DEF_METHOD(copy_clipboard, 0); RG_DEF_METHOD(paste_clipboard, 0); RG_DEF_METHOD(copy_primary, 0); RG_DEF_METHOD(paste_primary, 0); RG_DEF_METHOD(set_size, 2); RG_DEF_METHOD(set_audible_bell, 1); RG_DEF_METHOD_P(audible_bell, 0); RG_DEF_METHOD(set_visible_bell, 1); RG_DEF_METHOD_P(visible_bell, 0); RG_DEF_METHOD(set_scroll_background, 1); RG_DEF_METHOD(set_scroll_on_output, 1); RG_DEF_METHOD(set_scroll_on_keystroke, 1); RG_DEF_METHOD(set_color_dim, 1); RG_DEF_METHOD(set_color_bold, 1); RG_DEF_METHOD(set_color_foreground, 1); RG_DEF_METHOD(set_color_background, 1); RG_DEF_METHOD(set_color_cursor, 1); RG_DEF_METHOD(set_color_highlight, 1); RG_DEF_METHOD(set_colors, 3); RG_DEF_METHOD(set_default_colors, 0); RG_DEF_METHOD(set_background_image, 1); RG_DEF_METHOD(set_background_tint_color, 1); RG_DEF_METHOD(set_background_saturation, 1); RG_DEF_METHOD(set_background_transparent, 1); RG_DEF_METHOD(set_cursor_blinks, 1); #if VTE_CHECK_VERSION(0, 18, 0) RG_DEF_METHOD(set_cursor_blink_mode, 1); RG_DEF_METHOD(cursor_blink_mode, 0); #endif #if VTE_CHECK_VERSION(0, 19, 1) RG_DEF_METHOD(set_cursor_shape, 1); RG_DEF_METHOD(cursor_shape, 0); #if !VTE_CHECK_VERSION(0, 20, 0) RG_DEF_METHOD(pty, 0); #endif RG_DEF_METHOD(child_exit_status, 0); #endif RG_DEF_METHOD(set_scrollback_lines, 1); RG_DEF_METHOD(im_append_menuitems, 1); RG_DEF_METHOD(set_font, -1); RG_DEF_METHOD(font, 0); RG_DEF_METHOD_P(using_xft, 0); RG_DEF_METHOD(set_allow_bold, 1); RG_DEF_METHOD_P(allow_bold, 0); RG_DEF_METHOD_P(has_selection, 0); RG_DEF_ALIAS("have_selection?", "has_selection?"); RG_DEF_METHOD(set_word_chars, 1); RG_DEF_METHOD_P(word_char, 1); RG_DEF_METHOD(set_backspace_binding, 1); RG_DEF_METHOD(set_delete_binding, 1); RG_DEF_METHOD_P(mouse_autohide, 0); RG_DEF_METHOD(set_mouse_autohide, 1); RG_DEF_METHOD(reset, 2); RG_DEF_METHOD(get_text, -1); RG_DEF_METHOD(get_text_range, -1); RG_DEF_METHOD(cursor_position, 0); RG_DEF_METHOD(match_clear_all, 0); RG_DEF_METHOD(match_add, 1); RG_DEF_METHOD(match_set_cursor, 2); RG_DEF_METHOD(match_remove, 1); RG_DEF_METHOD(match_check, 2); #if !VTE_CHECK_VERSION(0, 20, 0) RG_DEF_METHOD(set_emulation, 1); RG_DEF_METHOD(emulation, 0); #endif RG_DEF_METHOD(default_emulation, 0); #if !VTE_CHECK_VERSION(0, 20, 0) RG_DEF_METHOD(set_encoding, 1); RG_DEF_METHOD(encoding, 0); #endif RG_DEF_METHOD(status_line, 0); RG_DEF_METHOD(padding, 0); #if !VTE_CHECK_VERSION(0, 20, 0) RG_DEF_METHOD(set_pty, 1); #endif RG_DEF_METHOD(adjustment, 0); RG_DEF_METHOD(char_width, 0); RG_DEF_METHOD(char_height, 0); RG_DEF_METHOD(char_descent, 0); RG_DEF_METHOD(char_ascent, 0); RG_DEF_METHOD(row_count, 0); RG_DEF_METHOD(column_count, 0); RG_DEF_METHOD(window_title, 0); RG_DEF_METHOD(icon_title, 0); #if VTE_CHECK_VERSION(0, 26, 0) RG_DEF_METHOD(pty_new, 1); RG_DEF_METHOD(search_find_next, 0); RG_DEF_METHOD(search_find_previous, 0); RG_DEF_METHOD_P(search_get_wrap_around, 0); RG_DEF_METHOD(search_set_wrap_around, 1); RG_DEF_ALIAS("search_wrap_around=", "search_set_wrap_around"); #endif #if VTE_CHECK_VERSION(0, 16, 0) RG_DEF_METHOD(select_all, 0); RG_DEF_METHOD(select_none, 0); #endif RG_DEF_METHOD(set_opacity, 1); #if VTE_CHECK_VERSION(0, 26, 0) RG_DEF_METHOD(watch_child, 1); #endif #if VTE_CHECK_VERSION(0, 24, 0) RG_DEF_METHOD(write_contents, -1); #endif G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/vte/ext/vte/rbvte-reaper.c0000644000175000017500000000231211701304107017532 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte.h" #define RG_TARGET_NAMESPACE cReaper static VALUE rg_m_get(VALUE self) { return GOBJ2RVAL(vte_reaper_get()); } void Init_vte_reaper(VALUE mVte) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_REAPER, "Reaper", mVte); RG_DEF_MODFUNC(get, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/vte/ext/vte/rbvte.h0000664000175000017500000000242111740310343016270 0ustar koukou#ifndef __RBVTE_H__ #define __RBVTE_H__ #include #include #include #include #include #ifndef VTE_CHECK_VERSION # include "rbvteversion.h" #endif #undef RG_DEF_METHOD #define RG_DEF_METHOD(method, argc) \ rb_define_method(RG_TARGET_NAMESPACE, #method, rg_ ## method, argc) #undef RG_DEF_SMETHOD #define RG_DEF_SMETHOD(method, argc) \ rb_define_singleton_method(RG_TARGET_NAMESPACE, #method, rg_s_ ## method, argc) #define RVAL2TERM(obj) (RVAL2GOBJ(obj)) #define RVAL2COLOR(obj) ((GdkColor *)RVAL2BOXED(obj, GDK_TYPE_COLOR)) #define COLOR2RVAL(obj) (BOXED2RVAL(obj, GDK_TYPE_COLOR)) #define RVAL2AA(obj) (RVAL2GENUM(obj, VTE_TYPE_TERMINAL_ANTI_ALIAS)) #define RVAL2EB(obj) (RVAL2GENUM(obj, VTE_TYPE_TERMINAL_ERASE_BINDING)) #define RVAL2CT(obj) (RVAL2GENUM(obj, GDK_TYPE_CURSOR_TYPE)) #define RVAL2PFD(obj) ((PangoFontDescription*)RVAL2BOXED(self, PANGO_TYPE_FONT_DESCRIPTION)) #define PFD2RVAL(obj) (BOXED2RVAL(obj, PANGO_TYPE_FONT_DESCRIPTION)) G_GNUC_INTERNAL void Init_vte_access(VALUE mVte); G_GNUC_INTERNAL void Init_vte_reaper(VALUE mVte); G_GNUC_INTERNAL void Init_vte_terminal(VALUE mVte); G_GNUC_INTERNAL void Init_vte_charattributes(VALUE mVte); G_GNUC_INTERNAL void Init_vte_pty(VALUE mVte); #endif ruby-gnome2-all-2.1.0/vte/ext/vte/rbvte-terminalaccessible.c0000644000175000017500000000254311701304107022113 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte.h" #define RG_TARGET_NAMESPACE cTerminalAccessible static VALUE rg_initialize(VALUE self, VALUE terminal) { G_INITIALIZE(self, vte_terminal_accessible_new(RVAL2TERM(terminal))); return Qnil; } void Init_vte_access(VALUE mVte) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_TERMINAL_ACCESSIBLE, "TerminalAccessible", mVte); RG_DEF_METHOD(initialize, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/vte/ext/vte/extconf.rb0000644000175000017500000000353512002536277017005 0ustar koukou=begin extconf.rb for Ruby/VTE extention library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "vte" package_id = "vte" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id, :debian => "libvte-dev", :redhat => "vte-devel", :homebrew => "vte", :macports => "vte") exit(false) end ["glib2", "atk", "gtk2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end vte_headers = ["vte/vte.h"] have_type("VteTerminalCursorBlinkMode", vte_headers) unless have_macro("VTE_CHECK_VERSION", vte_headers) make_version_header("VTE", package_id, ".") end create_pkg_config_file("Ruby/VTE", package_id) $defs << "-DRUBY_VTE_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ruby-gnome2-all-2.1.0/vte/ext/vte/rbvte-pty.c0000644000175000017500000000552611701304107017102 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte.h" #define RG_TARGET_NAMESPACE cPty #define _SELF(s) (VTE_PTY(RVAL2GOBJ(s))) #if VTE_CHECK_VERSION(0, 26, 0) static VALUE rg_initialize(VALUE self, VALUE flags_or_fd) { VtePty *pty = NULL; GError *error = NULL; if (TYPE(flags_or_fd) == T_FIXNUM) { pty = vte_pty_new_foreign(NUM2INT(flags_or_fd), &error); } else { pty = vte_pty_new(RVAL2GFLAGS(flags_or_fd, VTE_TYPE_PTY_FLAGS), &error); } if (error) RAISE_GERROR(error); G_INITIALIZE(self, pty); return Qnil; } static VALUE rg_child_setup(VALUE self) { vte_pty_child_setup(_SELF(self)); return self; } static VALUE rg_close(VALUE self) { vte_pty_close(_SELF(self)); return self; } static VALUE rg_size(VALUE self) { int rows, columns; gboolean result; GError *error = NULL; result = vte_pty_get_size(_SELF(self), &rows, &columns, &error); if (error) RAISE_GERROR(error); return rb_ary_new3(2, INT2NUM(rows), INT2NUM(columns)); } static VALUE rg_set_size(VALUE self, VALUE rows, VALUE columns) { gboolean result; GError *error = NULL; result = vte_pty_set_size(_SELF(self), NUM2INT(rows), NUM2INT(columns), &error); if (error) RAISE_GERROR(error); return self; } static VALUE rg_set_utf8(VALUE self, VALUE utf8) { gboolean result; GError *error = NULL; result = vte_pty_set_utf8(_SELF(self), RVAL2CBOOL(utf8), &error); if (error) RAISE_GERROR(error); return self; } #endif void Init_vte_pty(VALUE mVte) { #if VTE_CHECK_VERSION(0, 26, 0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_PTY, "Pty", mVte); G_DEF_CLASS(VTE_TYPE_PTY_ERROR, "Error", RG_TARGET_NAMESPACE); G_DEF_CLASS(VTE_TYPE_PTY_FLAGS, "Flags", RG_TARGET_NAMESPACE); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(child_setup, 0); RG_DEF_METHOD(close, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(set_size, 2); RG_DEF_METHOD(set_utf8, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); #endif } ruby-gnome2-all-2.1.0/vte/ext/vte/rbvte.c0000644000175000017500000000313011701304107016255 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte.h" #define RG_TARGET_NAMESPACE mVte void Init_vte(void) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = rb_define_module("Vte"); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(VTE_MAJOR_VERSION), INT2FIX(VTE_MINOR_VERSION), INT2FIX(VTE_MICRO_VERSION))); G_DEF_CLASS(VTE_TYPE_TERMINAL_ANTI_ALIAS, "TerminalAntiAlias", RG_TARGET_NAMESPACE); Init_vte_access(RG_TARGET_NAMESPACE); Init_vte_reaper(RG_TARGET_NAMESPACE); Init_vte_terminal(RG_TARGET_NAMESPACE); Init_vte_charattributes(RG_TARGET_NAMESPACE); Init_vte_pty(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/vte/ext/vte/depend0000644000175000017500000000024412064346475016175 0ustar koukouinstall: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-vte.pc $(pkgconfigdir); \ fi ruby-gnome2-all-2.1.0/vte/README0000644000175000017500000000124711701304107014260 0ustar koukouRuby/VTE ======== Ruby/VTE is a Ruby binding of VTE. Requirements ------------ Ruby: http://www.ruby-lang.org/ VTE [*]: http://www.gnome.org/ Ruby/GTK2: http://ruby-gnome2.sourceforge.net/ [*]: 0.12.1 or later is required. Install ------- 0. install ruby and VTE. 1. ruby extconf.rb 2. make 3. su 4. make install Copying ------- Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ ruby-gnome2-all-2.1.0/vte/COPYING.LIB0000644000175000017500000006364212257552170015063 0ustar koukou GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ruby-gnome2-all-2.1.0/vte/lib/0000755000175000017500000000000011701304107014142 5ustar koukouruby-gnome2-all-2.1.0/vte/lib/vte/0000755000175000017500000000000011701304107014740 5ustar koukouruby-gnome2-all-2.1.0/vte/lib/vte/deprecated.rb0000644000175000017500000000063711701304107017373 0ustar koukoumodule Vte extend GLib::Deprecatable define_deprecated_const 'TerminalEraseBinding', 'Vte::Terminal::EraseBinding' define_deprecated_const 'TerminalCursorBlinkMode', 'Vte::Terminal::CursorBlinkMode' define_deprecated_const 'TerminalCursorShape', 'Vte::Terminal::CursorShape' class Terminal extend GLib::Deprecatable define_deprecated_method 'match_set_cursor_type', 'match_set_cursor' end end ruby-gnome2-all-2.1.0/vte/lib/vte.rb0000644000175000017500000000007211701304107015264 0ustar koukourequire "gtk2" require "vte.so" require "vte/deprecated" ruby-gnome2-all-2.1.0/vte/sample/0000755000175000017500000000000011701304107014655 5ustar koukouruby-gnome2-all-2.1.0/vte/sample/multiterm.rb0000755000175000017500000000511711701304107017233 0ustar koukou#!/usr/bin/env ruby =begin multiterm.rb - Ruby/VTE sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: multiterm.rb,v 1.2 2006/06/17 13:27:51 mutoh Exp $ =end require "vte" class MultiTerm def initialize @terminals = [] init_window add_terminal end def run @window.show_all @notebook.get_nth_page(@notebook.page).grab_focus end private def init_window @window = Gtk::Window.new("MultiTerm sample") @window.signal_connect("destroy") do |widget| Gtk.main_quit end init_notebook @window.add(@notebook) end def init_notebook @notebook = Gtk::Notebook.new @last_page_index = nil @notebook.signal_connect_after("switch-page") do |widget, page, i| max_page_index = widget.n_pages - 1 if max_page_index > 0 and i == max_page_index widget.page = @last_page_index end end @notebook.signal_connect("switch-page") do |widget, page, i| @last_page_index ||= i terminal = widget.get_nth_page(i) if terminal.respond_to?(:window_title) @last_page_index = i update_window_title(terminal.window_title) end end @notebook.tab_reorderable = true if @notebook.respond_to?(:tab_reorderable=) @notebook.scrollable = true init_new_tab_label dummy = Gtk::EventBox.new @notebook.append_page(dummy, @new_tab_label) end def init_new_tab_label @new_tab_label = Gtk::EventBox.new @new_tab_label.signal_connect("button-press-event") do |widget, event| add_terminal @notebook.page = @last_page_index true end # @new_tab_label.set_size_request(30, -1) image = Gtk::Image.new(Gtk::Stock::NEW, Gtk::IconSize::MENU) image.show @new_tab_label.add(image) @new_tab_label end def destroy @window.destroy end def add_terminal terminal = Vte::Terminal.new terminal.signal_connect("child-exited") do |widget| @notebook.remove_page(@notebook.page_num(widget)) @terminals.delete(widget) destroy if @terminals.empty? end terminal.signal_connect("window-title-changed") do |widget| @notebook.set_tab_label_text(widget, widget.window_title) update_window_title(widget.window_title) end terminal.set_font("Monospace 14") terminal.fork_command terminal.show last = @notebook.n_pages @notebook.insert_page(last - 1, terminal) @terminals << terminal end def update_window_title(title) @window.title = title if title end end multi_term = MultiTerm.new multi_term.run Gtk.main ruby-gnome2-all-2.1.0/vte/sample/terminal.rb0000755000175000017500000000127111701304107017021 0ustar koukou#!/usr/bin/env ruby =begin terminal.rb - Ruby/VTE sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: terminal.rb,v 1.2 2006/06/17 13:27:51 mutoh Exp $ =end require "vte" window = Gtk::Window.new("Terminal sample") window.signal_connect("destroy"){Gtk.main_quit} terminal = Vte::Terminal.new terminal.set_font("Monospace 16", Vte::TerminalAntiAlias::FORCE_ENABLE) terminal.signal_connect("child-exited") do |widget| Gtk.main_quit end terminal.signal_connect("window-title-changed") do |widget| window.title = terminal.window_title end terminal.fork_command window.add(terminal) window.show_all Gtk.main ruby-gnome2-all-2.1.0/vte/extconf.rb0000644000175000017500000000222211701304107015365 0ustar koukou#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "vte" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ruby-gnome2-all-2.1.0/vte/Rakefile0000644000175000017500000000057312017142000015037 0ustar koukou# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require 'gnome2-raketask' package = GNOME2Package.new do |_package| _package.summary = "Ruby/VTE is a Ruby binding of VTE." _package.description = "Ruby/VTE is a Ruby binding of VTE." _package.dependency.gem.runtime = ["gtk2"] _package.win32.packages = [] _package.win32.dependencies = [] end package.define_tasks ruby-gnome2-all-2.1.0/webkit-gtk/0000755000175000017500000000000012257665515014672 5ustar koukouruby-gnome2-all-2.1.0/webkit-gtk/patches/0000755000175000017500000000000012257552170016311 5ustar koukouruby-gnome2-all-2.1.0/webkit-gtk/patches/libxslt-1.1.28-add-mkdir-fallback.diff0000644000175000017500000000062712257552170024745 0ustar koukoudiff -ru libxslt-1.1.28.orig/libxslt/security.c libxslt-1.1.28/libxslt/security.c --- libxslt-1.1.28.orig/libxslt/security.c 2012-09-12 14:58:14.000000000 +0900 +++ libxslt-1.1.28/libxslt/security.c 2013-12-28 19:25:13.615751850 +0900 @@ -39,6 +39,7 @@ #ifndef INVALID_FILE_ATTRIBUTES #define INVALID_FILE_ATTRIBUTES ((DWORD)-1) #endif +#define mkdir(path, mode) mkdir(path) #endif #ifndef HAVE_STAT ruby-gnome2-all-2.1.0/webkit-gtk/patches/webkitgtk-2.2.3-buildable.diff0000644000175000017500000000445012257552170023522 0ustar koukoudiff -ru webkitgtk-2.2.3.orig/Source/WTF/wtf/Atomics.h webkitgtk-2.2.3/Source/WTF/wtf/Atomics.h --- webkitgtk-2.2.3.orig/Source/WTF/wtf/Atomics.h 2013-12-02 17:11:56.000000000 +0900 +++ webkitgtk-2.2.3/Source/WTF/wtf/Atomics.h 2013-12-28 21:57:07.695695396 +0900 @@ -66,7 +66,7 @@ #if OS(WINCE) #include #else -extern "C" void _ReadWriteBarrier(void); +#include #pragma intrinsic(_ReadWriteBarrier) #endif #include @@ -288,7 +288,7 @@ : "memory" ); return result; -#elif OS(WINDOWS) && CPU(X86) +#elif OS(WINDOWS) && CPU(X86) && 0 // FIXME: We need a 64-bit ASM implementation, but this cannot be inline due to // Microsoft's decision to exclude it from the compiler. bool result = false; diff -ru webkitgtk-2.2.3.orig/Source/WTF/wtf/Platform.h webkitgtk-2.2.3/Source/WTF/wtf/Platform.h --- webkitgtk-2.2.3.orig/Source/WTF/wtf/Platform.h 2013-12-02 17:11:56.000000000 +0900 +++ webkitgtk-2.2.3/Source/WTF/wtf/Platform.h 2013-12-28 19:43:58.588605855 +0900 @@ -629,7 +629,7 @@ #define HAVE_ISDEBUGGERPRESENT 1 #if !PLATFORM(QT) -#include +/* #include */ #endif #endif diff -ru webkitgtk-2.2.3.orig/Source/WTF/wtf/threads/BinarySemaphore.cpp webkitgtk-2.2.3/Source/WTF/wtf/threads/BinarySemaphore.cpp --- webkitgtk-2.2.3.orig/Source/WTF/wtf/threads/BinarySemaphore.cpp 2013-08-04 01:10:38.000000000 +0900 +++ webkitgtk-2.2.3/Source/WTF/wtf/threads/BinarySemaphore.cpp 2013-12-28 21:59:06.784816965 +0900 @@ -26,7 +26,7 @@ #include "config.h" #include "BinarySemaphore.h" -#if !PLATFORM(WIN) +#if !OS(WINDOWS) namespace WTF { @@ -65,4 +65,4 @@ } // namespace WTF -#endif // !PLATFORM(WIN) +#endif // !OS(WINDOWS) diff -ru webkitgtk-2.2.3.orig/Source/autotools/FindDependencies.m4 webkitgtk-2.2.3/Source/autotools/FindDependencies.m4 --- webkitgtk-2.2.3.orig/Source/autotools/FindDependencies.m4 2013-12-02 17:11:58.000000000 +0900 +++ webkitgtk-2.2.3/Source/autotools/FindDependencies.m4 2013-12-28 22:17:46.537935727 +0900 @@ -110,7 +110,7 @@ ;; *-*-mingw*) UNICODE_CFLAGS="" - UNICODE_LIBS="-licui18n -licuuc" + UNICODE_LIBS="-licuuc" AC_CHECK_HEADERS([unicode/uchar.h], [], [AC_MSG_ERROR([Could not find ICU headers.])]) ;; *) ruby-gnome2-all-2.1.0/webkit-gtk/COPYING.LIB0000644000175000017500000006364212102213527016322 0ustar koukou GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ruby-gnome2-all-2.1.0/webkit-gtk/lib/0000755000175000017500000000000012147676243015436 5ustar koukouruby-gnome2-all-2.1.0/webkit-gtk/lib/webkit-gtk.rb0000644000175000017500000000261112147676243020033 0ustar koukou# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gobject-introspection" require "gtk3" base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) module WebKitGtk class << self def const_missing(name) init if const_defined?(name) const_get(name) else super end end def init loader = Loader.new(self) loader.load("WebKit") class << self remove_method(:init) remove_method(:const_missing) end end end class Loader < GObjectIntrospection::Loader end end ruby-gnome2-all-2.1.0/webkit-gtk/sample/0000755000175000017500000000000012147676243016151 5ustar koukouruby-gnome2-all-2.1.0/webkit-gtk/sample/brower.rb0000644000175000017500000000174312147676243020003 0ustar koukou# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "webkit-gtk" window = Gtk::Window.new window.signal_connect("destroy") do Gtk.main_quit end view = WebKitGtk::WebView.new view.load_uri("http://webkitgtk.org/") window.add(view) window.show_all Gtk.main ruby-gnome2-all-2.1.0/webkit-gtk/README.md0000644000175000017500000000100112102213527016116 0ustar koukou# Ruby/WebKitGTK Ruby/WebKitGTK is a Ruby binding of WebKitGTK+. ## Requirements * Ruby/GObjectIntrospection and Ruby/GTK3 in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [WebKitGTK+](http://webkitgtk.org/) ## Install gem install webkit-gtk ## License Copyright (c) 2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ## Project Website http://ruby-gnome2.sourceforge.jp/ ruby-gnome2-all-2.1.0/webkit-gtk/Rakefile0000644000175000017500000001047312257552170016334 0ustar koukou# -*- ruby -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $LOAD_PATH.unshift("./../glib2/lib") require "gnome2/rake/package-task" package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/WebKitGTK is a Ruby binding of WebKitGTK+." package.description = "Ruby/WebKitGTK is a Ruby binding of WebKitGTK+." package.dependency.gem.runtime = ["gobject-introspection", "gtk3"] package.dependency.gem.development = ["test-unit-notify"] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = [ "glib2", "gobject-introspection", "atk", "pango", "gdk_pixbuf2", "gtk2", "gdk3", "gstreamer", ] package.windows.gobject_introspection_dependencies = [ "atk", "gdk_pixbuf2", "pango", "gdk3", "gstreamer", ] package.external_packages = [ # { # :name => "libjpeg", # :base_name => "jpeg-9", # :archive_base_name => "jpegsrc.v9.tar.gz", # :download_base_url => "http://www.ijg.org/files", # :label => "libjpeg", # :windows => { # :configure_args => [], # :built_file => "bin/libjpeg-9.dll", # }, # }, # { # :name => "libwebp", # :download_base_url => "https://webp.googlecode.com/files", # :label => "WebP", # :version => "0.3.1", # :windows => { # :built_file => "bin/libwebp-4.dll", # }, # }, # { # :name => "sqlite-autoconf", # :download_base_url => "http://www.sqlite.org/2013", # :label => "SQLite", # :version => "3080200", # :compression_method => "gz", # :windows => { # :configure_args => [], # :built_file => "bin/libsqlite3-0.dll", # }, # }, # { # :name => "libsoup", # :download_site => :gnome, # :label => "libsoup", # :version => "2.45.3", # :compression_method => "xz", # :windows => { # :configure_args => [ # "--enable-introspection", # "--without-apache-httpd", # ], # :build_concurrently => false, # :built_file => "bin/libsoup-2.4-1.dll", # }, # }, # { # :name => "libiconv", # :label => "iconv", # :version => "1.14", # :download_base_url => "http://ftp.gnu.org/pub/gnu/libiconv", # :compression_method => "gz", # :windows => { # :built_file => "bin/libiconv-2.dll", # }, # }, # { # :name => "libxslt", # :version => "1.1.28", # :download_base_url => "ftp://xmlsoft.org/libxslt", # :compression_method => "gz", # :windows => { # :built_file => "bin/libxslt-1.dll", # :configure_args => [ # "--without-python", # ], # :patches => [ # "libxslt-1.1.28-add-mkdir-fallback.diff", # ], # }, # }, # { # :name => "webkitgtk", # :download_base_url => "http://webkitgtk.org/releases", # :label => "WebKitGTK+", # :version => "2.2.3", # :compression_method => "xz", # :windows => { # :configure_args => [ # "--enable-introspection", # "--with-target=win32", # "--disable-credential-storage", # "--disable-geolocation", # "--disable-webkit2", # ], # :patches => [ # "webkitgtk-2.2.3-buildable.diff", # ], # :need_autoreconf => true, # }, # }, ] end package_task.define namespace :dependency do desc "Install depenencies" task :install do # TODO: Install gir1.2-webkit-3.0 on Debian. end end task :build => "dependency:install" ruby-gnome2-all-2.1.0/webkit-gtk/test/0000755000175000017500000000000012257552170015641 5ustar koukouruby-gnome2-all-2.1.0/webkit-gtk/test/run-test.rb0000755000175000017500000000437712257552170017765 0ustar koukou#!/usr/bin/env ruby # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") gio_base = File.join(ruby_gnome2_base, "gio2") atk_base = File.join(ruby_gnome2_base, "atk") pango_base = File.join(ruby_gnome2_base, "pango") gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2") gdk3_base = File.join(ruby_gnome2_base, "gdk3") gtk3_base = File.join(ruby_gnome2_base, "gtk3") gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection") webkit_gtk_base = File.join(ruby_gnome2_base, "webkit-gtk") modules = [ [glib_base, "glib2"], [gio_base, "gio2"], [atk_base, "atk"], [pango_base, "pango"], [gdk_pixbuf_base, "gdk_pixbuf2"], [gdk3_base, "gdk3"], [gtk3_base, "gtk3"], [gobject_introspection_base, "gobject-introspection"], [webkit_gtk_base, "webkit-gtk"], ] modules.each do |target, module_name| if File.exist?("Makefile") and system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require "glib-test-init" $LOAD_PATH.unshift(File.join(gobject_introspection_base, "test")) require "gobject-introspection-test-utils" $LOAD_PATH.unshift(File.join(webkit_gtk_base, "test")) require "webkit-gtk-test-utils" require "webkit-gtk" exit Test::Unit::AutoRunner.run(true) ruby-gnome2-all-2.1.0/webkit-gtk/test/webkit-gtk-test-utils.rb0000644000175000017500000000153012102213527022335 0ustar koukou# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "test-unit" require "test/unit/notify" module WebKitGtkTestUtils end ruby-gnome2-all-2.1.0/gtk2/0000755000175000017500000000000012257665517013473 5ustar koukouruby-gnome2-all-2.1.0/gtk2/patches/0000755000175000017500000000000012257552167015116 5ustar koukouruby-gnome2-all-2.1.0/gtk2/patches/gtk+-2.24.22-add-missing-exeext.diff0000644000175000017500000000343612257552167023120 0ustar koukoudiff -ru gtk+-2.24.22.orig/gtk/Makefile.am gtk+-2.24.22/gtk/Makefile.am --- gtk+-2.24.22.orig/gtk/Makefile.am 2013-10-05 07:02:29.000000000 +0900 +++ gtk+-2.24.22/gtk/Makefile.am 2013-12-25 00:42:56.220065167 +0900 @@ -1388,7 +1388,7 @@ gtk_update_icon_cache_program = $(GTK_UPDATE_ICON_CACHE) else gtk_update_icon_cache_program = \ - ./gtk-update-icon-cache + ./gtk-update-icon-cache$(EXEEXT) endif gtkbuiltincache.h: @REBUILD@ stamp-icons diff -ru gtk+-2.24.22.orig/modules/input/Makefile.am gtk+-2.24.22/modules/input/Makefile.am --- gtk+-2.24.22.orig/modules/input/Makefile.am 2013-10-05 07:02:29.000000000 +0900 +++ gtk+-2.24.22/modules/input/Makefile.am 2013-12-25 00:55:21.430362022 +0900 @@ -202,8 +202,8 @@ @if $(RUN_QUERY_IMMODULES_TEST) ; then \ echo $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \ $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \ - echo "$(DESTDOR)$(bindir)/gtk-query-immodules-2.0 > $(DESTDIR)$(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/immodules.cache" ; \ - $(DESTDIR)/$(bindir)/gtk-query-immodules-2.0 > $(DESTDIR)$(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/immodules.cache ; \ + echo "$(DESTDOR)$(bindir)/gtk-query-immodules-2.0$(EXEEXT) > $(DESTDIR)$(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/immodules.cache" ; \ + $(DESTDIR)$(bindir)/gtk-query-immodules-2.0$(EXEEXT) > $(DESTDIR)$(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/immodules.cache ; \ else \ echo "***" ; \ echo "*** Warning: immodules.cache not built" ; \ @@ -253,7 +253,7 @@ included-modules: $(noinst_LTLIBRARIES) immodules.cache: Makefile.am $(module_LTLIBRARIES) - $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > immodules.cache + $(top_builddir)/gtk/gtk-query-immodules-2.0$(EXEEXT) $(module_LTLIBRARIES) > immodules.cache CLEANFILES = immodules.cache ruby-gnome2-all-2.1.0/gtk2/ext/0000755000175000017500000000000011701304107014245 5ustar koukouruby-gnome2-all-2.1.0/gtk2/ext/gtk2/0000755000175000017500000000000012257552167015136 5ustar koukouruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrecentmanager.c0000644000175000017500000001045312257552167021152 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRecentManager #define _SELF(self) (GTK_RECENT_MANAGER(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_recent_manager_new()); return Qnil; } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_recent_manager_get_default()); } static VALUE rg_s_get_for_screen(G_GNUC_UNUSED VALUE self, VALUE screen) { return GOBJ2RVAL(gtk_recent_manager_get_for_screen(GDK_SCREEN(RVAL2GOBJ(screen)))); } static VALUE rg_set_screen(VALUE self, VALUE screen) { gtk_recent_manager_set_screen(_SELF(self), GDK_SCREEN(RVAL2GOBJ(screen))); return self; } static VALUE rg_add_item(int argc, VALUE *argv, VALUE self) { VALUE uri, data; gboolean ret; rb_scan_args(argc, argv, "11", &uri, &data); if (NIL_P(data)){ ret = gtk_recent_manager_add_item(_SELF(self), RVAL2CSTR(uri)); if (! ret) rb_raise(rb_eRuntimeError, "Can't add the uri"); } else { ret = gtk_recent_manager_add_full(_SELF(self), RVAL2CSTR(uri), RVAL2BOXED(data, GTK_TYPE_RECENT_DATA)); if (! ret) rb_raise(rb_eRuntimeError, "Can't add the uri or data"); } return self; } static VALUE rg_remove_item(VALUE self, VALUE uri) { GError* error = NULL; gboolean ret = gtk_recent_manager_remove_item(_SELF(self), RVAL2CSTR(uri), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_lookup_item(VALUE self, VALUE uri) { GError* error = NULL; GtkRecentInfo* info = gtk_recent_manager_lookup_item(_SELF(self), RVAL2CSTR(uri), &error); if (error) RAISE_GERROR(error); return BOXED2RVAL(info, GTK_TYPE_RECENT_INFO); } static VALUE rg_has_item_p(VALUE self, VALUE uri) { return CBOOL2RVAL(gtk_recent_manager_has_item(_SELF(self), RVAL2CSTR(uri))); } static VALUE rg_move_item(VALUE self, VALUE uri, VALUE new_uri) { GError* error = NULL; gboolean ret = gtk_recent_manager_move_item(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(new_uri), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_items(VALUE self) { return GLIST2ARY2F(gtk_recent_manager_get_items(_SELF(self)), GTK_TYPE_RECENT_INFO); } static VALUE rg_purge_items(VALUE self) { GError* error = NULL; gint ret = gtk_recent_manager_purge_items(_SELF(self), &error); if (error) RAISE_GERROR(error); return INT2NUM(ret); } void Init_gtk_recent_manager(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_MANAGER, "RecentManager", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_SMETHOD(default, 0); RG_DEF_SMETHOD(get_for_screen, 1); RG_DEF_METHOD(set_screen, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "set_screen"); RG_DEF_METHOD(add_item, -1); RG_DEF_METHOD(remove_item, 1); RG_DEF_METHOD(lookup_item, 1); RG_DEF_METHOD_P(has_item, 1); RG_DEF_METHOD(move_item, 2); RG_DEF_METHOD(items, 0); RG_DEF_METHOD(purge_items, 0); /* GtkRecentManagerError */ G_DEF_ERROR(GTK_RECENT_MANAGER_ERROR, "RecentManagerError", mGtk, rb_eRuntimeError, GTK_TYPE_RECENT_MANAGER_ERROR); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkradiotoolbutton.c0000644000175000017500000001000212257552167021555 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRadioToolButton #define _SELF(self) (GTK_RADIO_TOOL_BUTTON(RVAL2GOBJ(self))) static VALUE RG_TARGET_NAMESPACE; struct rbgtk_rval2gtkradiotoolbuttongslist_args { VALUE ary; long n; GSList *result; }; static VALUE rbgtk_rval2gtkradiotoolbuttongslist_body(VALUE value) { long i; struct rbgtk_rval2gtkradiotoolbuttongslist_args *args = (struct rbgtk_rval2gtkradiotoolbuttongslist_args *)value; for (i = 0; i < args->n; i++) args->result = g_slist_append(args->result, GTK_RADIO_MENU_ITEM(RVAL2GOBJ(RARRAY_PTR(args->ary)[i]))); return Qnil; } static G_GNUC_NORETURN VALUE rbgtk_rval2gtkradiotoolbuttongslist_rescue(VALUE value) { g_slist_free(((struct rbgtk_rval2gtkradiotoolbuttongslist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GSList * rbgtk_rval2gtkradiotoolbuttongslist(VALUE value) { struct rbgtk_rval2gtkradiotoolbuttongslist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgtk_rval2gtkradiotoolbuttongslist_body, (VALUE)&args, rbgtk_rval2gtkradiotoolbuttongslist_rescue, (VALUE)&args); return args.result; } #define RVAL2GTKRADIOTOOLBUTTONGSLIST(value) rbgtk_rval2gtkradiotoolbuttongslist(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE group_or_stock_id, rbstock_id; GtkToolItem *widget; if (rb_scan_args(argc, argv, "02", &group_or_stock_id, &rbstock_id) > 0) { GSList *group = NULL; const gchar *stock_id = TYPE(rbstock_id) == T_SYMBOL ? rb_id2name(SYM2ID(rbstock_id)) : RVAL2CSTR_ACCEPT_NIL(rbstock_id); if (TYPE(group_or_stock_id) == T_ARRAY) /* TODO: This has a potential for leaking. */ group = RVAL2GTKRADIOTOOLBUTTONGSLIST(group_or_stock_id); else if (rb_obj_is_kind_of(group_or_stock_id, RG_TARGET_NAMESPACE)) group = gtk_radio_tool_button_get_group(_SELF(group_or_stock_id)); if (stock_id == NULL) widget = gtk_radio_tool_button_new(group); else widget = gtk_radio_tool_button_new_from_stock(group, stock_id); } else { widget = gtk_radio_tool_button_new(NULL); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rbtn_get_group(VALUE self) { /* Owned by GTK+ */ return GSLIST2ARY(gtk_radio_tool_button_get_group(_SELF(self))); } static VALUE rbtn_set_group(VALUE self, VALUE rbgroup) { GtkRadioToolButton *button = _SELF(self); GSList *group = TYPE(rbgroup) == T_ARRAY ? /* TODO: This might leak. */ RVAL2GTKRADIOTOOLBUTTONGSLIST(rbgroup) : gtk_radio_tool_button_get_group(_SELF(rbgroup)); gtk_radio_tool_button_set_group(button, group); return self; } void Init_gtk_radiotoolbutton(VALUE mGtk) { RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RADIO_TOOL_BUTTON, "RadioToolButton", mGtk); RG_DEF_METHOD(initialize, -1); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "group", rbtn_get_group, 0); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "group", rbtn_set_group, 1); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkselectiondata.c0000644000175000017500000001627212257552167021163 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cSelectionData #define _SELF(d) ((GtkSelectionData*)RVAL2BOXED(d, GTK_TYPE_SELECTION_DATA)) static GdkAtom compound_text; /************************************************************************/ void rbgtk_atom2selectiondata(VALUE type, VALUE size, VALUE src, GdkAtom *gtype, void **data, gint *format, gint *length) { void* dat = NULL; gint fmt, len; GdkAtom ntype = RVAL2ATOM(type); if(ntype == GDK_SELECTION_TYPE_INTEGER){ int *i; i = ALLOC(int); *i = NUM2INT(src); dat = i; fmt = sizeof(int) * 8; len = 1; } else if(ntype == GDK_SELECTION_TYPE_STRING) { dat = (void *)RVAL2CSTR(src); if (NIL_P(size)) { fmt = sizeof(char) * 8; len = RSTRING_LEN(src); } else { len = NUM2UINT(size); fmt = (RSTRING_LEN(src) / len) * 8; } } else if(ntype == compound_text){ guchar* str = (guchar*)dat; gdk_string_to_compound_text(RVAL2CSTR(src), &ntype, &fmt, &str, &len); } else if(type != Qnil && size != Qnil && src != Qnil) { dat = (void *)RVAL2CSTR(src); fmt = NUM2INT(size); len = (RSTRING_LEN(src) * sizeof(char) / fmt); } else { rb_raise(rb_eArgError, "no supported type."); } *gtype = ntype; *data = dat; *format = fmt; *length = len; } void rbgtk_atom2selectiondata_free(GdkAtom type, void *dat) { if (type == GDK_SELECTION_TYPE_INTEGER || type == GDK_SELECTION_TYPE_ATOM) { xfree(dat); } else if(type == compound_text) { gdk_free_compound_text(dat); } } /************************************************************************/ static VALUE rg_selection(VALUE self) { GdkAtom selection = _SELF(self)->selection; return BOXED2RVAL(&selection, GDK_TYPE_ATOM); } static VALUE rg_target(VALUE self) { return BOXED2RVAL(_SELF(self)->target, GDK_TYPE_ATOM); } static VALUE rg_type(VALUE self) { return BOXED2RVAL(_SELF(self)->type, GDK_TYPE_ATOM); } static VALUE rg_format(VALUE self) { return INT2NUM(_SELF(self)->format); } static VALUE rg_data(VALUE self) { return RBG_STRING_SET_UTF8_ENCODING(rb_str_new((const char*)_SELF(self)->data, _SELF(self)->length)); } static VALUE rg_display(VALUE self) { return BOXED2RVAL(_SELF(self)->display, GDK_TYPE_DISPLAY); } /* Instance Methods */ static VALUE rg_set(int argc, VALUE *argv, VALUE self) { void* dat; VALUE type, src; gint fmt, len; GdkAtom ntype; VALUE size = Qnil; if(3 == argc) rb_scan_args(argc, argv, "30", &type, &size, &src); else rb_scan_args(argc, argv, "20", &type, &src); rbgtk_atom2selectiondata(type, size, src, &ntype, &dat, &fmt, &len); gtk_selection_data_set(_SELF(self), ntype, fmt, dat, len); rbgtk_atom2selectiondata_free(ntype, dat); return self; } static VALUE rg_set_text(VALUE self, VALUE str) { StringValue(str); if (!gtk_selection_data_set_text(_SELF(self), RSTRING_PTR(str), RSTRING_LEN(str))) rb_raise(rb_eRuntimeError, "the selection wasn't successfully set"); return self; } static VALUE rg_text(VALUE self) { return CSTR2RVAL_FREE((gchar *)gtk_selection_data_get_text(_SELF(self))); } static VALUE rg_set_pixbuf(VALUE self, VALUE pixbuf) { if (!gtk_selection_data_set_pixbuf(_SELF(self), GDK_PIXBUF(RVAL2GOBJ(pixbuf)))) rb_raise(rb_eRuntimeError, "the selection wasn't successfully set"); return self; } static VALUE rg_pixbuf(VALUE self) { return GOBJ2RVAL(gtk_selection_data_get_pixbuf(_SELF(self))); } static VALUE rg_set_uris(VALUE self, VALUE uris) { gboolean ret; gchar **guris; guris = (gchar **)RVAL2STRV(uris); ret = gtk_selection_data_set_uris(_SELF(self), guris); g_free(guris); if (!ret) rb_raise(rb_eRuntimeError, "the selection wasn't successfully."); return self; } static VALUE rg_uris(VALUE self) { VALUE ary = rb_ary_new(); gchar** uris = gtk_selection_data_get_uris(_SELF(self)); if (uris) { gchar **uri = uris; while (*uri) { rb_ary_push(ary, CSTR2RVAL(*uri)); uri++; } g_strfreev(uris); } return ary; } static VALUE rg_targets(VALUE self) { GdkAtom* targets; gint n_atoms; VALUE result = Qnil; gboolean ret = gtk_selection_data_get_targets(_SELF(self), &targets, &n_atoms); if (ret) { int i; result = rb_ary_new2(n_atoms); for (i = 0; i < n_atoms; i++){ rb_ary_push(result, BOXED2RVAL(targets[i], GDK_TYPE_ATOM)); } } g_free(targets); return result; } static VALUE rg_targets_include_image(VALUE self, VALUE writable) { return CBOOL2RVAL(gtk_selection_data_targets_include_image(_SELF(self), RVAL2CBOOL(writable))); } static VALUE rg_targets_include_text(VALUE self) { return CBOOL2RVAL(gtk_selection_data_targets_include_text(_SELF(self))); } static VALUE rg_targets_include_uri(VALUE self) { return CBOOL2RVAL(gtk_selection_data_targets_include_uri(_SELF(self))); } static VALUE rg_targets_include_rich_text(VALUE self, VALUE buffer) { return CBOOL2RVAL(gtk_selection_data_targets_include_rich_text(_SELF(self), GTK_TEXT_BUFFER(RVAL2GOBJ(buffer)))); } void Init_gtk_selectiondata(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SELECTION_DATA, "SelectionData", mGtk); rbgobj_boxed_not_copy_obj(GTK_TYPE_SELECTION_DATA); compound_text = gdk_atom_intern("COMPOUND_TEXT", FALSE); RG_DEF_METHOD(selection, 0); RG_DEF_METHOD(target, 0); RG_DEF_METHOD(type, 0); RG_DEF_METHOD(format, 0); RG_DEF_METHOD(data, 0); RG_DEF_METHOD(display, 0); RG_DEF_METHOD(set, -1); RG_DEF_METHOD(text, 0); RG_DEF_METHOD(set_text, 1); RG_DEF_METHOD(pixbuf, 0); RG_DEF_METHOD(set_pixbuf, 1); RG_DEF_METHOD(uris, 0); RG_DEF_METHOD(set_uris, 1); RG_DEF_METHOD(targets_include_image, 1); RG_DEF_METHOD(targets, 0); RG_DEF_METHOD(targets_include_text, 0); RG_DEF_METHOD(targets_include_uri, 0); RG_DEF_METHOD(targets_include_rich_text, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkobject.c0000644000175000017500000001015311701304107017560 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cObject /* We shouldn't implement it. void gtk_object_sink (GtkObject *object); #define GTK_OBJECT_FLOATING (obj) gtk_object_new is deprecated. Use g_object_new instead. GtkObject* gtk_object_new (GtkType type, const gchar *first_property_name, ...); */ static VALUE rg_type_name(VALUE self) { return CSTR2RVAL(GTK_OBJECT_TYPE_NAME(RVAL2GOBJ(self))); } static VALUE rg_destroy(VALUE self) { gtk_object_destroy(GTK_OBJECT(RVAL2GOBJ(self))); return Qnil; } static VALUE rg_flags(VALUE self) { /* _GtkObject.flags is int32 */ return(INT2FIX(GTK_OBJECT_FLAGS(RVAL2GOBJ(self)))); } static VALUE rg_set_flags(VALUE self, VALUE flags) { GTK_OBJECT_SET_FLAGS(RVAL2GOBJ(self), NUM2INT(flags)); return self; } static VALUE rg_unset_flags(VALUE self, VALUE flags) { GTK_OBJECT_UNSET_FLAGS(RVAL2GOBJ(self), NUM2INT(flags)); return self; } /* Move from Bindings */ static VALUE rg_bindings_activate(VALUE self, VALUE keyval, VALUE modifiers) { return CBOOL2RVAL(gtk_bindings_activate(GTK_OBJECT(RVAL2GOBJ(self)), NUM2UINT(keyval), NUM2UINT(modifiers))); } /* Move from Bindings */ static VALUE rg_s_binding_set(VALUE self) { GType gtype; gpointer gclass; GtkBindingSet* binding_set; Check_Type(self, T_CLASS); gtype = CLASS2GTYPE(self); if (!G_TYPE_IS_CLASSED(gtype)) { rb_raise(rb_eTypeError, "%s is not a classed GType", rb_class2name(self)); } gclass = g_type_class_ref(gtype); if (!gclass) { rb_raise(rb_eRuntimeError, "couldn't get class reference"); } if (!GTK_IS_OBJECT_CLASS(gclass)) { g_type_class_unref(gclass); rb_raise(rb_eTypeError, "%s is not a Gtk Object class", rb_class2name(self)); } binding_set = gtk_binding_set_by_class(gclass); if (!binding_set) { g_type_class_unref(gclass); rb_raise(rb_eRuntimeError, "couldn't get BindingSet from %s", rb_class2name(self)); } g_type_class_unref(gclass); return BOXED2RVAL(binding_set, GTK_TYPE_BINDING_SET); } void Init_gtk_object(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_OBJECT, "Object", mGtk); RG_DEF_SMETHOD(binding_set, 0); RG_DEF_METHOD(type_name, 0); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(set_flags, 1); RG_DEF_METHOD(unset_flags, 1); RG_DEF_METHOD(destroy, 0); RG_DEF_METHOD(bindings_activate, 2); /* GtkObjectFlags */ G_DEF_CLASS(GTK_TYPE_OBJECT_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_OBJECT_FLAGS, "GTK_"); /* undef deprecated properties */ rb_undef_method(RG_TARGET_NAMESPACE, "user_data"); rb_undef_method(RG_TARGET_NAMESPACE, "user_data="); rb_undef_method(RG_TARGET_NAMESPACE, "set_user_data"); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkvscrollbar.c0000644000175000017500000000305211701304107020463 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cVScrollbar static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1; GtkAdjustment *adj = NULL; rb_scan_args(argc, argv, "01", &arg1); if (!NIL_P(arg1)) adj = GTK_ADJUSTMENT(RVAL2GOBJ(arg1)); RBGTK_INITIALIZE(self, gtk_vscrollbar_new(adj)); return Qnil; } void Init_gtk_vscrollbar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VSCROLLBAR, "VScrollbar", mGtk); RG_DEF_METHOD(initialize, -1); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkdrawingarea.c0000644000175000017500000000257711701304107020611 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cDrawingArea static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_drawing_area_new()); return Qnil; } void Init_gtk_drawing_area(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_DRAWING_AREA, "DrawingArea", mGtk); RG_DEF_METHOD(initialize, 0); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkconst.c0000644000175000017500000000240011701304107017414 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" /* * Gdk module constants */ void Init_gtk_gdk_const(VALUE mGdk) { /* GdkStatus */ G_DEF_CLASS(GDK_TYPE_STATUS, "Status", mGdk); G_DEF_CONSTANTS(mGdk, GDK_TYPE_STATUS, "GDK_"); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcelllayout.c0000644000175000017500000000775512257552167020527 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mCellLayout #define _SELF(s) (GTK_CELL_LAYOUT(RVAL2GOBJ(s))) #define RVAL2RENDERER(s) (GTK_CELL_RENDERER(RVAL2GOBJ(s))) static VALUE rg_pack_start(VALUE self, VALUE cell, VALUE expand) { gtk_cell_layout_pack_start(_SELF(self), RVAL2RENDERER(cell), RVAL2CBOOL(expand)); return self; } static VALUE rg_pack_end(VALUE self, VALUE cell, VALUE expand) { gtk_cell_layout_pack_end(_SELF(self), RVAL2RENDERER(cell), RVAL2CBOOL(expand)); return self; } static VALUE rg_reorder(VALUE self, VALUE cell, VALUE position) { gtk_cell_layout_reorder(_SELF(self), RVAL2RENDERER(cell), NUM2INT(position)); return self; } static VALUE rg_clear(VALUE self) { gtk_cell_layout_clear(_SELF(self)); return self; } static VALUE rg_add_attribute(VALUE self, VALUE cell, VALUE attribute, VALUE column) { const gchar *name; if (SYMBOL_P(attribute)) { name = rb_id2name(SYM2ID(attribute)); } else { name = RVAL2CSTR(attribute); } gtk_cell_layout_add_attribute(_SELF(self), RVAL2RENDERER(cell), name, NUM2INT(column)); return self; } static void layout_data_func(GtkCellLayout *layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer func) { iter->user_data3 = tree_model; rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(layout), GOBJ2RVAL(cell), GOBJ2RVAL(tree_model), GTKTREEITER2RVAL(iter)); } static VALUE rg_set_cell_data_func(VALUE self, VALUE cell) { if (rb_block_given_p()) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_cell_layout_set_cell_data_func(_SELF(self), RVAL2RENDERER(cell), (GtkCellLayoutDataFunc)layout_data_func, (gpointer)func, NULL); } else { gtk_cell_layout_set_cell_data_func(_SELF(self), RVAL2RENDERER(cell), NULL, (gpointer)NULL, NULL); } return self; } static VALUE rg_clear_attributes(VALUE self, VALUE cell) { gtk_cell_layout_clear_attributes(_SELF(self), RVAL2RENDERER(cell)); return self; } static VALUE rg_set_attributes(VALUE self, VALUE cell, VALUE attrs) { gint i; VALUE ary; Check_Type(attrs, T_HASH); rg_clear_attributes(self, cell); ary = rb_funcall(attrs, rb_intern("to_a"), 0); for (i = 0; i < RARRAY_LEN(ary); i++){ rg_add_attribute(self, cell, RARRAY_PTR(RARRAY_PTR(ary)[i])[0], RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); } return self; } void Init_gtk_celllayout(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_CELL_LAYOUT, "CellLayout", mGtk); RG_DEF_METHOD(pack_start, 2); RG_DEF_METHOD(pack_end, 2); RG_DEF_METHOD(reorder, 2); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD(add_attribute, 3); RG_DEF_METHOD(set_cell_data_func, 1); RG_DEF_METHOD(clear_attributes, 1); RG_DEF_METHOD(set_attributes, 2); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfilefilter.c0000644000175000017500000000753412257552167020472 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Ruby-GNOME2 Project Team * Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFileFilter #define _SELF(self) GTK_FILE_FILTER(RVAL2GOBJ(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_file_filter_new()); return Qnil; } static VALUE rg_set_name(VALUE self, VALUE name) { gtk_file_filter_set_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_name(VALUE self) { return CSTR2RVAL(gtk_file_filter_get_name(_SELF(self))); } static VALUE rg_add_mime_type(VALUE self, VALUE mime) { gtk_file_filter_add_mime_type(_SELF(self), RVAL2CSTR(mime)); return self; } static VALUE rg_add_pattern(VALUE self, VALUE pattern) { gtk_file_filter_add_pattern(_SELF(self), RVAL2CSTR(pattern)); return self; } /* Should return true/false */ static gboolean filter_func(const GtkFileFilterInfo *info, gpointer func) { return CBOOL2RVAL(rb_funcall((VALUE)func, id_call, 5, GFLAGS2RVAL(info->contains, GTK_TYPE_FILE_FILTER_FLAGS), CSTR2RVAL(info->filename), CSTR2RVAL(info->uri), CSTR2RVAL(info->display_name), CSTR2RVAL(info->mime_type))); } static VALUE rg_add_pixbuf_formats(VALUE self) { gtk_file_filter_add_pixbuf_formats(_SELF(self)); return self; } static VALUE rg_add_custom(VALUE self, VALUE needed) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_file_filter_add_custom(_SELF(self), RVAL2GFLAGS(needed, GTK_TYPE_FILE_FILTER_FLAGS), (GtkFileFilterFunc)filter_func, (gpointer)func, NULL); return self; } static VALUE rg_needed(VALUE self) { return GFLAGS2RVAL(gtk_file_filter_get_needed(_SELF(self)), GTK_TYPE_FILE_FILTER_FLAGS); } static VALUE rg_filter_p(VALUE self, VALUE contains, VALUE filename, VALUE uri, VALUE display_name, VALUE mime_type) { GtkFileFilterInfo info; info.contains = RVAL2GFLAGS(contains, GTK_TYPE_FILE_FILTER_FLAGS); info.filename = RVAL2CSTR(filename); info.uri = RVAL2CSTR(uri); info.display_name = RVAL2CSTR(display_name); info.mime_type = RVAL2CSTR(mime_type); return CBOOL2RVAL(gtk_file_filter_filter(_SELF(self), &info)); } void Init_gtk_file_filter(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FILE_FILTER, "FileFilter", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_name, 1); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(add_mime_type, 1); RG_DEF_METHOD(add_pattern, 1); RG_DEF_METHOD(add_pixbuf_formats, 0); RG_DEF_METHOD(add_custom, 1); RG_DEF_METHOD(needed, 0); RG_DEF_METHOD_P(filter, 5); G_DEF_SETTERS(RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_FILE_FILTER_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_FILE_FILTER_FLAGS, "GTK_FILE_FILTER_"); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkspinbutton.c0000644000175000017500000001004511701304107020517 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cSpinButton #define _SELF(self) (GTK_SPIN_BUTTON(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2, arg3; GtkAdjustment *adj = NULL; gfloat climb_rate; gint digits; GtkWidget *widget; rb_scan_args(argc, argv, "03", &arg1, &arg2, &arg3); if (NIL_P(arg1) || RVAL2GTYPE(arg1) == GTK_TYPE_ADJUSTMENT){ if (!NIL_P(arg1)) adj = GTK_ADJUSTMENT(RVAL2GOBJ(arg1)); climb_rate = (NIL_P(arg2))? 0.0: NUM2DBL(arg2); digits = (NIL_P(arg3))? 0: NUM2UINT(arg3); widget = gtk_spin_button_new(adj, climb_rate, digits); } else { widget = gtk_spin_button_new_with_range(NUM2DBL(arg1), NUM2DBL(arg2), NUM2DBL(arg3)); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_configure(VALUE self, VALUE adj, VALUE climb_rate, VALUE digits) { gtk_spin_button_configure(_SELF(self), GTK_ADJUSTMENT(RVAL2GOBJ(adj)), NUM2DBL(climb_rate), NUM2UINT(digits)); return self; } static VALUE rg_set_increments(VALUE self, VALUE step, VALUE page) { gtk_spin_button_set_increments(_SELF(self), NUM2DBL(step), NUM2DBL(page)); return self; } static VALUE rg_set_range(VALUE self, VALUE min, VALUE max) { gtk_spin_button_set_range(_SELF(self), NUM2DBL(min), NUM2DBL(max)); return self; } static VALUE rg_value_as_int(VALUE self) { return INT2NUM(gtk_spin_button_get_value_as_int(_SELF(self))); } static VALUE rg_spin(VALUE self, VALUE direction, VALUE increment) { gtk_spin_button_spin(_SELF(self), RVAL2GENUM(direction, GTK_TYPE_SPIN_TYPE), NUM2DBL(increment)); return self; } static VALUE rg_update(VALUE self) { gtk_spin_button_update(_SELF(self)); return self; } static VALUE rg_increments(VALUE self) { gdouble step, page; gtk_spin_button_get_increments(_SELF(self), &step, &page); return rb_ary_new3(2, rb_float_new(step), rb_float_new(page)); } static VALUE rg_range(VALUE self) { gdouble min, max; gtk_spin_button_get_range(_SELF(self), &min, &max); return rb_ary_new3(2, rb_float_new(min), rb_float_new(max)); } void Init_gtk_spin_button(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SPIN_BUTTON, "SpinButton", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(configure, 3); RG_DEF_METHOD(set_increments, 2); RG_DEF_METHOD(set_range, 2); RG_DEF_METHOD(value_as_int, 0); RG_DEF_METHOD(spin, 2); RG_DEF_METHOD(update, 0); RG_DEF_METHOD(increments, 0); RG_DEF_METHOD(range, 0); /* GtkSpinType */ G_DEF_CLASS(GTK_TYPE_SPIN_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_SPIN_TYPE, "GTK_SPIN_"); /* GtkSpinButtonUpdatePolicy */ G_DEF_CLASS(GTK_TYPE_SPIN_BUTTON_UPDATE_POLICY, "UpdatePolicy", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_SPIN_BUTTON_UPDATE_POLICY, "GTK_"); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcellrenderercombo.c0000644000175000017500000000240312257552167022021 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCellRendererCombo static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_combo_new()); return Qnil; } void Init_gtk_cellrenderercombo(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_COMBO, "CellRendererCombo", mGtk); RG_DEF_METHOD(initialize, 0); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreesortable.c0000644000175000017500000000736611701304107021021 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mTreeSortable #define _SELF(s) (GTK_TREE_SORTABLE(RVAL2GOBJ(s))) static VALUE rg_sort_column_changed(VALUE self) { gtk_tree_sortable_sort_column_changed(_SELF(self)); return self; } static VALUE rg_sort_column_id(VALUE self) { gint sort_column_id; GtkSortType order; if (gtk_tree_sortable_get_sort_column_id(_SELF(self), &sort_column_id, &order)) { VALUE ary; ary = rb_ary_new2(2); rb_ary_push(ary, INT2NUM(sort_column_id)); rb_ary_push(ary, GENUM2RVAL(order, GTK_TYPE_SORT_TYPE)); return ary; } else { return Qnil; /* XXX: or something else? exception? */ } } static VALUE rg_set_sort_column_id(int argc, VALUE *argv, VALUE self) { gint sort_column_id; GtkSortType order; if (argc == 1 || argc == 2) { sort_column_id = NUM2INT(argv[0]); order = (argc == 2) ? RVAL2GENUM(argv[1], GTK_TYPE_SORT_TYPE) : GTK_SORT_ASCENDING; } else { rb_raise(rb_eArgError, "need 1 or 2 arguments."); } gtk_tree_sortable_set_sort_column_id(_SELF(self), sort_column_id, order); return self; } static gint sort_func(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer func) { a->user_data3 = model; b->user_data3 = model; return NUM2INT(rb_funcall((VALUE)func, id_call, 2, GTKTREEITER2RVAL(a), GTKTREEITER2RVAL(b))); } static VALUE rg_set_sort_func(VALUE self, VALUE sort_column_id) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_sortable_set_sort_func(_SELF(self), NUM2INT(sort_column_id), (GtkTreeIterCompareFunc)sort_func, (gpointer)func, NULL); return self; } static VALUE rg_set_default_sort_func(VALUE self) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_sortable_set_default_sort_func(_SELF(self), (GtkTreeIterCompareFunc)sort_func, (gpointer)func, NULL); return self; } static VALUE rg_has_default_sort_func_p(VALUE self) { return RVAL2CBOOL(gtk_tree_sortable_has_default_sort_func(_SELF(self))); } void Init_gtk_treesortable(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_TREE_SORTABLE, "TreeSortable", mGtk); RG_DEF_METHOD(sort_column_changed, 0); RG_DEF_METHOD(sort_column_id, 0); RG_DEF_METHOD(set_sort_column_id, -1); RG_DEF_METHOD(set_sort_func, 1); RG_DEF_METHOD(set_default_sort_func, 0); RG_DEF_METHOD_P(has_default_sort_func, 0); rb_define_const(RG_TARGET_NAMESPACE, "DEFAULT_SORT_COLUMN_ID", GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID); } /* vim: set sts=4 sw=4 ts=8: */ ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkhbbox.c0000644000175000017500000000257211701304107017422 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cHButtonBox static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_hbutton_box_new()); return Qnil; } void Init_gtk_hbutton_box(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HBUTTON_BOX, "HButtonBox", mGtk); RG_DEF_METHOD(initialize, 0); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkexpander.c0000644000175000017500000000313012257552167020137 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cExpander #define _SELF(self) (GTK_EXPANDER(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, with_mnemonic; GtkWidget* widget = NULL; rb_scan_args(argc, argv, "11", &label, &with_mnemonic); if (NIL_P(with_mnemonic) || ! RVAL2CBOOL(with_mnemonic)){ widget = gtk_expander_new(RVAL2CSTR(label)); } else { widget = gtk_expander_new_with_mnemonic(RVAL2CSTR(label)); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_expander(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_EXPANDER, "Expander", mGtk); RG_DEF_METHOD(initialize, -1); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkspinner.c0000644000175000017500000000302311701304107017766 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #if GTK_CHECK_VERSION(2,20,0) #define RG_TARGET_NAMESPACE cSpinner #define _SELF(s) (GTK_SPINNER(RVAL2GOBJ(s))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_spinner_new()); return Qnil; } static VALUE rg_start(VALUE self) { gtk_spinner_start(_SELF(self)); return self; } static VALUE rg_stop(VALUE self) { gtk_spinner_stop(_SELF(self)); return self; } #endif void Init_gtk_spinner(VALUE mGtk) { #if GTK_CHECK_VERSION(2,20,0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SPINNER, "Spinner", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(start, 0); RG_DEF_METHOD(stop, 0); #endif } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkprinter.c0000644000175000017500000001004411701304107017774 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef HAVE_GTK_UNIX_PRINT #include #ifndef GTK_TYPE_PRINT_BACKEND #define GTK_TYPE_PRINT_BACKEND (gtk_print_backend_get_type ()) #define GTK_PRINT_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_BACKEND, GtkPrintBackend)) GType gtk_print_backend_get_type (void) G_GNUC_CONST; #endif #define RG_TARGET_NAMESPACE cPrinter #define _SELF(s) (GTK_PRINTER(RVAL2GOBJ(s))) static VALUE rg_initialize(VALUE self, VALUE name, VALUE backend, VALUE rb_virtual) { GtkPrinter *printer; printer = gtk_printer_new(RVAL2CSTR(name), GTK_PRINT_BACKEND(RVAL2GOBJ(backend)), RVAL2CBOOL(rb_virtual)); G_INITIALIZE(self, printer); return Qnil; } static VALUE rg_description(VALUE self) { return CSTR2RVAL(gtk_printer_get_description(_SELF(self))); } static VALUE rg_active_p(VALUE self) { return CBOOL2RVAL(gtk_printer_is_default(_SELF(self))); } static VALUE rg_default_p(VALUE self) { return CBOOL2RVAL(gtk_printer_is_default(_SELF(self))); } static VALUE rg_operator_p_compare(VALUE self, VALUE other) { if (rb_obj_is_kind_of(other, GTYPE2CLASS(GTK_TYPE_PRINTER))){ return INT2NUM(gtk_printer_compare(_SELF(self), _SELF(other))); } else { rb_raise(rb_eTypeError, "%s isn't a kind of Gtk::Printer", rb_class2name(other)); } } struct callback_arg { VALUE callback; int argc; VALUE *argv; }; static VALUE invoke_callback(VALUE data) { struct callback_arg *arg = (struct callback_arg *)data; return rb_funcall2(arg->callback, id_call, arg->argc, arg->argv); } static gboolean each_printer(GtkPrinter *printer, gpointer data) { VALUE result; VALUE argv[1]; struct callback_arg arg; argv[0] = GOBJ2RVAL(printer); arg.callback = (VALUE)data; arg.argc = 1; arg.argv = argv; result = G_PROTECT_CALLBACK(invoke_callback, &arg); return NIL_P(rb_errinfo()) ? TRUE : RVAL2CBOOL(result); } static void remove_callback_reference(gpointer data) { VALUE callback = (VALUE)data; G_CHILD_REMOVE(mGtk, callback); } static VALUE rg_s_each(int argc, VALUE *argv, VALUE self) { VALUE wait, block; rb_scan_args(argc, argv, "01", &wait); block = rb_block_proc(); G_CHILD_ADD(mGtk, block); gtk_enumerate_printers(each_printer, (gpointer)block, remove_callback_reference, RVAL2CBOOL(wait)); return self; } #endif void Init_gtk_printer(VALUE mGtk) { #ifdef HAVE_GTK_UNIX_PRINT VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINTER, "Printer", mGtk); rb_include_module(RG_TARGET_NAMESPACE, rb_mComparable); G_DEF_CLASS(GTK_TYPE_PRINT_BACKEND, "PrintBackend", mGtk); RG_DEF_SMETHOD(each, -1); RG_DEF_METHOD(initialize, 3); RG_DEF_METHOD(description, 0); RG_DEF_METHOD_P(active, 0); RG_DEF_METHOD_P(default, 0); RG_DEF_METHOD_OPERATOR("<=>", p_compare, 1); G_DEF_CLASS3("GtkPrintBackendCups", "PrintBackendCups", mGtk); G_DEF_CLASS3("GtkPrintBackendFile", "PrintBackendFile", mGtk); G_DEF_CLASS3("GtkPrintBackendLpr", "PrintBackendLpr", mGtk); G_DEF_SETTERS(RG_TARGET_NAMESPACE); #endif } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkactiongroup.c0000644000175000017500000003300512257552167020667 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" static ID id_action_procs; static ID id_toggle_action_procs; #define RG_TARGET_NAMESPACE cActionGroup #define _SELF(self) (GTK_ACTION_GROUP(RVAL2GOBJ(self))) #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) static VALUE rg_initialize(VALUE self, VALUE name) { G_INITIALIZE(self, gtk_action_group_new(RVAL2CSTR(name))); return Qnil; } static VALUE rg_get_action(VALUE self, VALUE action_name) { return GOBJ2RVAL(gtk_action_group_get_action(_SELF(self), RVAL2CSTR(action_name))); } static VALUE rg_actions(VALUE self) { return GLIST2ARYF(gtk_action_group_list_actions(_SELF(self))); } static VALUE rg_add_action(int argc, VALUE *argv, VALUE self) { VALUE action, accelerator; rb_scan_args(argc, argv, "11", &action, &accelerator); gtk_action_group_add_action_with_accel(_SELF(self), GTK_ACTION(RVAL2GOBJ(action)), NIL_P(accelerator) ? NULL : RVAL2CSTR(accelerator)); G_CHILD_ADD(self, action); return self; } static VALUE rg_remove_action(VALUE self, VALUE action) { gtk_action_group_remove_action(_SELF(self), GTK_ACTION(RVAL2GOBJ(action))); G_CHILD_REMOVE(self, action); return self; } static void activate_action(GtkAction *action, VALUE self) { VALUE proc = rb_hash_aref(rb_ivar_get(self, id_action_procs), CSTR2RVAL(gtk_action_get_name(action))); if (!NIL_P(proc)) rb_funcall(proc, id_call, 2, self, GOBJ2RVAL(action)); } struct rbg_rval2gtkactionentries_args { VALUE ary; long n; GtkActionEntry *result; VALUE procs; }; static VALUE rbg_rval2gtkactionentries_body(VALUE value) { long i; struct rbg_rval2gtkactionentries_args *args = (struct rbg_rval2gtkactionentries_args *)value; for (i = 0; i < args->n; i++) { VALUE entry; long n; RARRAY_PTR(args->ary)[i] = rb_ary_dup(rb_ary_to_ary(RARRAY_PTR(args->ary)[i])); entry = RARRAY_PTR(args->ary)[i]; n = RARRAY_LEN(entry); args->result[i].callback = G_CALLBACK(activate_action); if (n < 1 || n > 6) rb_raise(rb_eArgError, "entry does not contain right number of entries %ld (1..6)", n); args->result[i].name = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[0]); switch (n) { case 6: /* TODO: Call #to_proc on entry 5? */ rb_hash_aset(args->procs, RARRAY_PTR(entry)[0], RARRAY_PTR(entry)[5]); case 5: args->result[i].tooltip = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[4]); case 4: args->result[i].accelerator = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[3]); case 3: args->result[i].label = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[2]); case 2: args->result[i].stock_id = RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(RARRAY_PTR(entry)[1]); break; default: break; } } return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gtkactionentries_rescue(VALUE value) { g_free(((struct rbg_rval2gtkactionentries_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GtkActionEntry * rbg_rval2gtkactionentries(volatile VALUE *value, long *n, VALUE procs) { struct rbg_rval2gtkactionentries_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new0(GtkActionEntry, args.n + 1); args.procs = procs; rb_rescue(rbg_rval2gtkactionentries_body, (VALUE)&args, rbg_rval2gtkactionentries_rescue, (VALUE)&args); *n = args.n; return args.result; } #define RVAL2GTKACTIONENTRIES(value, n, procs) rbg_rval2gtkactionentries(&(value), &(n), procs) static VALUE rg_add_actions(VALUE self, VALUE rbentries) { GtkActionGroup *group = _SELF(self); VALUE action_procs = rb_ivar_defined(self, id_action_procs) == Qtrue ? rb_ivar_get(self, id_action_procs) : rb_hash_new(); long n; GtkActionEntry *entries = RVAL2GTKACTIONENTRIES(rbentries, n, action_procs); rb_ivar_set(self, id_action_procs, action_procs); gtk_action_group_add_actions(group, entries, n, (gpointer)self); g_free(entries); return self; } static void activate_toggle_action(GtkAction *action, VALUE self) { VALUE proc = rb_hash_aref(rb_ivar_get(self, id_toggle_action_procs), CSTR2RVAL(gtk_action_get_name(action))); if (!NIL_P(proc)) rb_funcall(proc, id_call, 2, self, GOBJ2RVAL(action)); } struct rbg_rval2gtktoggleactionentries_args { VALUE ary; long n; GtkToggleActionEntry *result; VALUE procs; }; static VALUE rbg_rval2gtktoggleactionentries_body(VALUE value) { long i; struct rbg_rval2gtktoggleactionentries_args *args = (struct rbg_rval2gtktoggleactionentries_args *)value; for (i = 0; i < args->n; i++) { VALUE entry; long n; RARRAY_PTR(args->ary)[i] = rb_ary_dup(rb_ary_to_ary(RARRAY_PTR(args->ary)[i])); entry = RARRAY_PTR(args->ary)[i]; n = RARRAY_LEN(entry); args->result[i].callback = G_CALLBACK(activate_toggle_action); if (n < 1 || n > 7) rb_raise(rb_eArgError, "entry does not contain right number of entries %ld (1..7)", n); args->result[i].name = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[0]); switch (n) { case 7: args->result[i].is_active = RVAL2CBOOL(RARRAY_PTR(entry)[6]); case 6: /* TODO: Call #to_proc on entry 5? */ rb_hash_aset(args->procs, RARRAY_PTR(entry)[0], RARRAY_PTR(entry)[5]); case 5: args->result[i].tooltip = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[4]); case 4: args->result[i].accelerator = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[3]); case 3: args->result[i].label = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[2]); case 2: args->result[i].stock_id = RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(RARRAY_PTR(entry)[1]); break; default: break; } } return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gtktoggleactionentries_rescue(VALUE value) { g_free(((struct rbg_rval2gtktoggleactionentries_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GtkToggleActionEntry * rbg_rval2gtktoggleactionentries(volatile VALUE *value, long *n, VALUE procs) { struct rbg_rval2gtktoggleactionentries_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new0(GtkToggleActionEntry, args.n + 1); args.procs = procs; rb_rescue(rbg_rval2gtktoggleactionentries_body, (VALUE)&args, rbg_rval2gtktoggleactionentries_rescue, (VALUE)&args); *n = args.n; return args.result; } #define RVAL2GTKTOGGLEACTIONENTRIES(value, n, procs) rbg_rval2gtktoggleactionentries(&(value), &(n), procs) static VALUE rg_add_toggle_actions(VALUE self, VALUE rbentries) { GtkActionGroup *group = _SELF(self); VALUE toggle_action_procs = rb_ivar_defined(self, id_toggle_action_procs) == Qtrue ? rb_ivar_get(self, id_toggle_action_procs) : rb_hash_new(); long n; GtkToggleActionEntry *entries = RVAL2GTKTOGGLEACTIONENTRIES(rbentries, n, toggle_action_procs); rb_ivar_set(self, id_toggle_action_procs, toggle_action_procs); gtk_action_group_add_toggle_actions(group, entries, n, (gpointer)self); g_free(entries); return self; } static void activate_radio_action(GtkAction *action, GtkRadioAction *current, VALUE proc) { if (!NIL_P(proc)) rb_funcall(proc, id_call, 2, GOBJ2RVAL(action), GOBJ2RVAL(current)); } struct rbg_rval2gtkradioactionentries_args { VALUE ary; long n; GtkRadioActionEntry *result; }; static VALUE rbg_rval2gtkradioactionentries_body(VALUE value) { long i; struct rbg_rval2gtkradioactionentries_args *args = (struct rbg_rval2gtkradioactionentries_args *)value; for (i = 0; i < args->n; i++) { VALUE entry; long n; RARRAY_PTR(args->ary)[i] = rb_ary_dup(rb_ary_to_ary(RARRAY_PTR(args->ary)[i])); entry = RARRAY_PTR(args->ary)[i]; n = RARRAY_LEN(entry); switch (n) { case 6: args->result[i].value = NUM2INT(RARRAY_PTR(entry)[5]); case 5: args->result[i].tooltip = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[4]); case 4: args->result[i].accelerator = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[3]); case 3: args->result[i].label = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[2]); case 2: args->result[i].stock_id = RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(RARRAY_PTR(entry)[1]); case 1: args->result[i].name = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[0]); break; default: rb_raise(rb_eArgError, "entry does not contain right number of entries %ld (1..6)", n); break; } } return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gtkradioactionentries_rescue(VALUE value) { g_free(((struct rbg_rval2gtkradioactionentries_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GtkRadioActionEntry * rbg_rval2gtkradioactionentries(volatile VALUE *value, long *n) { struct rbg_rval2gtkradioactionentries_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new0(GtkRadioActionEntry, args.n + 1); rb_rescue(rbg_rval2gtkradioactionentries_body, (VALUE)&args, rbg_rval2gtkradioactionentries_rescue, (VALUE)&args); *n = args.n; return args.result; } #define RVAL2GTKRADIOACTIONENTRIES(value, n) rbg_rval2gtkradioactionentries(&(value), &(n)) static VALUE rg_add_radio_actions(int argc, VALUE *argv, VALUE self) { GtkActionGroup *group = _SELF(self); VALUE rbentries, rbvalue, proc; long n; GtkRadioActionEntry *entries; gint value; rb_scan_args(argc, argv, "12", &rbentries, &rbvalue, &proc); value = NIL_P(rbvalue) ? -1 : NUM2INT(rbvalue); if (NIL_P(proc) && rb_block_given_p()) { proc = rb_block_proc(); /* TODO: How do we remove this proc when all the radio actions passed * have been removed? */ G_RELATIVE(self, proc); } entries = RVAL2GTKRADIOACTIONENTRIES(rbentries, n); gtk_action_group_add_radio_actions(group, entries, n, value, G_CALLBACK(activate_radio_action), (gpointer)proc); g_free(entries); return self; } static gchar * translate_func(const gchar *path, gpointer func) { VALUE ret = rb_funcall((VALUE)func, id_call, 1, CSTR2RVAL(path)); return (gchar *)RVAL2CSTR(ret); } static VALUE rg_set_translate_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_action_group_set_translate_func(_SELF(self), (GtkTranslateFunc)translate_func, (gpointer)func, NULL); return self; } static VALUE rg_set_translation_domain(VALUE self, VALUE domain) { gtk_action_group_set_translation_domain(_SELF(self), NIL_P(domain) ? (const gchar*)NULL : RVAL2CSTR(domain)); return self; } static VALUE rg_translate_string(VALUE self, VALUE str) { return CSTR2RVAL(gtk_action_group_translate_string(_SELF(self), RVAL2CSTR(str))); } static void action_group_mark(void *p) { GtkActionGroup *group; GList *actions, *node; group = GTK_ACTION_GROUP(p); actions = gtk_action_group_list_actions(group); for (node = actions; node; node = g_list_next(node)) { GtkWidget *action = node->data; rbgobj_gc_mark_instance(action); } g_list_free(actions); } void Init_gtk_actiongroup(VALUE mGtk) { 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"); RG_DEF_METHOD(translate_string, 1); } ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkitemfactory.c0000644000175000017500000002434011701304107020643 0ustar koukou/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Hiroshi Igarashi, * dellin, * MUTOH Masao * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #include #define RG_TARGET_NAMESPACE cItemFactory #define _SELF(self) (GTK_ITEM_FACTORY(RVAL2GOBJ(self))) #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) #define RVAL2ACCEL(a) (GTK_ACCEL_GROUP(RVAL2GOBJ(a))) static VALUE action_table; static guint action_id = 0; static VALUE rg_initialize(VALUE self, VALUE type, VALUE path, VALUE accel) { VALUE obj = rb_eval_string("eval('self', binding)"); G_RELATIVE(obj, self); RBGTK_INITIALIZE(self, gtk_item_factory_new(NUM2ULONG(type), RVAL2CSTR(path), RVAL2ACCEL(accel))); return Qnil; } static VALUE rg_construct(int argc, VALUE *argv, VALUE self) { VALUE type, path, accel; GtkItemFactory* ifact = _SELF(self); ifact->accel_group = NULL; rb_scan_args(argc, argv, "21", &type, &path, &accel); gtk_item_factory_construct(ifact, FIX2INT(type), RVAL2CSTR(path), RVAL2ACCEL(accel)); return self; } static VALUE rg_s_from_widget(VALUE self, VALUE widget) { VALUE obj = GOBJ2RVAL(gtk_item_factory_from_widget(RVAL2WIDGET(widget))); G_RELATIVE(obj, self); return obj; } static VALUE rg_s_path_from_widget(G_GNUC_UNUSED VALUE self, VALUE widget) { return CSTR2RVAL(gtk_item_factory_path_from_widget(RVAL2WIDGET(widget))); } static VALUE rg_get_item(VALUE self, VALUE path) { VALUE obj = Qnil; GtkWidget* widget = gtk_item_factory_get_item(_SELF(self), RVAL2CSTR(path)); if (widget){ obj = GOBJ2RVAL(widget); G_RELATIVE(obj, self); } return obj; } static VALUE rg_get_widget(VALUE self, VALUE path) { VALUE obj = Qnil; GtkWidget* widget = gtk_item_factory_get_widget(_SELF(self), RVAL2CSTR(path)); if (widget){ obj = GOBJ2RVAL(widget); G_RELATIVE(obj, self); } return obj; } /* We can't implement them because actions are always 1. GtkWidget* gtk_item_factory_get_widget_by_action (GtkItemFactory *ifactory, guint action); GtkWidget* gtk_item_factory_get_item_by_action (GtkItemFactory *ifactory, guint action); */ static int menuitem_type_check(char *item_type) { if (item_type == NULL || strcmp(item_type, "") == 0 || (strcmp(item_type, "") == 0) || (strcmp(item_type, "") == 0)) return 0; else return -1; } static void items_exec_callback_wrap(G_GNUC_UNUSED VALUE callback_data, guint action_id, GtkWidget *widget) { VALUE iter, data; VALUE action = rb_hash_aref(action_table, UINT2NUM(action_id)); iter = RARRAY_PTR(action)[0]; data = RARRAY_PTR(action)[1]; if (!NIL_P(iter)) { rb_funcall(iter, id_call, 2, data, GOBJ2RVAL(widget)); } } static void create_factory_entry(GtkItemFactoryEntry *entry, VALUE self, VALUE path, VALUE item_type, VALUE accel, VALUE extdata, VALUE func, VALUE data) { VALUE action; entry->path = (gchar *)(NIL_P(path) ? NULL : RVAL2CSTR(path)); entry->item_type = (gchar *)(NIL_P(item_type) ? "" : RVAL2CSTR(item_type)); entry->accelerator = (gchar *)(NIL_P(accel) ? NULL : RVAL2CSTR(accel)); if (menuitem_type_check(entry->item_type) == 0) { entry->callback = NULL; } else { if (NIL_P(func)) { entry->callback = NULL; } else { entry->callback = items_exec_callback_wrap; } } action = rb_ary_new3(2, func, data); G_RELATIVE(self, action); rb_hash_aset(action_table, UINT2NUM(action_id), action); entry->callback_action = action_id; action_id++; if (NIL_P(extdata)){ entry->extra_data = NULL; } else if (TYPE(extdata) == T_STRING){ entry->extra_data = RVAL2CSTR(extdata); } else if (TYPE(extdata) == T_SYMBOL){ entry->extra_data = rb_id2name(SYM2ID(extdata)); } else if (RVAL2GTYPE(extdata) == GDK_TYPE_PIXBUF){ GdkPixdata pixdata; guint stream_length_p; gdk_pixdata_from_pixbuf(&pixdata, GDK_PIXBUF(RVAL2GOBJ(extdata)), TRUE); entry->extra_data = gdk_pixdata_serialize(&pixdata, &stream_length_p); } else { entry->extra_data = NULL; } } static VALUE rg_create_item(int argc, VALUE *argv, VALUE self) { VALUE path, type, accel, extdata, data, func; GtkItemFactoryEntry *entry; rb_scan_args(argc, argv, "14", &path, &type, &accel, &extdata, &data); entry = ALLOC(GtkItemFactoryEntry); func = rb_rescue((VALUE(*)())rb_block_proc, 0, NULL, 0); create_factory_entry(entry, self, path, type, accel, extdata, func, data); gtk_item_factory_create_item(_SELF(self), entry, (gpointer)self, 1); g_free(entry); return self; } static VALUE rg_create_items(VALUE self, VALUE ary) { VALUE entry, path, accel, type, func, data, extdata; GtkItemFactoryEntry *entries; guint i, len, n_menu_entries; n_menu_entries = RARRAY_LEN(ary); entries = ALLOC_N(GtkItemFactoryEntry, n_menu_entries); for (i = 0; i < n_menu_entries; i++) { entry = RARRAY_PTR(ary)[i]; len = RARRAY_LEN(entry); Check_Type(entry, T_ARRAY); path = RARRAY_PTR(entry)[0]; type = ((len > 1) ? RARRAY_PTR(entry)[1] : Qnil); accel = ((len > 2) ? RARRAY_PTR(entry)[2] : Qnil); extdata = ((len > 3) ? RARRAY_PTR(entry)[3] : Qnil); func = ((len > 4) ? RARRAY_PTR(entry)[4] : Qnil); data = ((len > 5) ? RARRAY_PTR(entry)[5] : Qnil); create_factory_entry(&entries[i], self, path, type, accel, extdata, func, data); } gtk_item_factory_create_items (_SELF(self), n_menu_entries, entries, NULL); g_free(entries); return self; } static VALUE rg_delete_item(VALUE self, VALUE path) { gtk_item_factory_delete_item(_SELF(self), RVAL2CSTR(path)); return self; } /* Don't implement. Use Gtk::ItemFactory#delete_item instead. void gtk_item_factory_delete_entry (GtkItemFactory *ifactory, GtkItemFactoryEntry *entry); void gtk_item_factory_delete_entries (GtkItemFactory *ifactory, guint n_entries, GtkItemFactoryEntry *entries); */ static VALUE rg_popup(VALUE self, VALUE x, VALUE y, VALUE mouse_button, VALUE time) { gtk_item_factory_popup(_SELF(self), NUM2UINT(x), NUM2UINT(y), NUM2UINT(mouse_button), NUM2UINT(time)); return self; } /* Do we need these methods? void gtk_item_factory_popup_with_data (GtkItemFactory *ifactory, gpointer popup_data, GtkDestroyNotify destroy, guint x, guint y, guint mouse_button, guint32 time); gpointer gtk_item_factory_popup_data (GtkItemFactory *ifactory); gpointer gtk_item_factory_popup_data_from_widget (GtkWidget *widget); void gtk_item_factory_set_translate_func (GtkItemFactory *ifactory, GtkTranslateFunc func, gpointer data, GtkDestroyNotify notify); */ void Init_gtk_itemfactory(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ITEM_FACTORY, "ItemFactory", mGtk); RG_DEF_SMETHOD(from_widget, 1); RG_DEF_SMETHOD(path_from_widget, 1); RG_DEF_METHOD(initialize, 3); RG_DEF_METHOD(construct, -1); RG_DEF_METHOD(get_item, 1); RG_DEF_METHOD(get_widget, 1); RG_DEF_METHOD(create_item, -1); RG_DEF_METHOD(create_items, 1); RG_DEF_METHOD(delete_item, 1); RG_DEF_METHOD(popup, 4); /* Ruby/GTK Original constants */ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_MENU_BAR", INT2FIX(GTK_TYPE_MENU_BAR)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_MENU", INT2FIX(GTK_TYPE_MENU)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_OPTION_MENU", INT2FIX(GTK_TYPE_OPTION_MENU)); rb_define_const(RG_TARGET_NAMESPACE, "TITLE", CSTR2RVAL("")); rb_define_const(RG_TARGET_NAMESPACE, "ITEM", CSTR2RVAL("<Item>")); rb_define_const(RG_TARGET_NAMESPACE, "CHECK_ITEM", CSTR2RVAL("<CheckItem>")); rb_define_const(RG_TARGET_NAMESPACE, "TOGGLE_ITEM", CSTR2RVAL("<ToggleItem>")); rb_define_const(RG_TARGET_NAMESPACE, "RADIO_ITEM", CSTR2RVAL("<RadioItem>")); rb_define_const(RG_TARGET_NAMESPACE, "IMAGE_ITEM", CSTR2RVAL("<ImageItem>")); rb_define_const(RG_TARGET_NAMESPACE, "STOCK_ITEM", CSTR2RVAL("<StockItem>")); rb_define_const(RG_TARGET_NAMESPACE, "SEPARATOR", CSTR2RVAL("<Separator>")); rb_define_const(RG_TARGET_NAMESPACE, "BRANCH", CSTR2RVAL("<Branch>")); rb_define_const(RG_TARGET_NAMESPACE, "LAST_BRANCH", CSTR2RVAL("<LastBranch>")); rb_define_const(RG_TARGET_NAMESPACE, "TEAROFF", CSTR2RVAL("<Tearoff>")); action_table = rb_hash_new(); rb_global_variable(&action_table); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkrectangle.c������������������������������������������������0000644�0001750�0001750�00000006606�12124610262�020250� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRectangle #define _SELF(r) ((GdkRectangle*)RVAL2BOXED(r, GDK_TYPE_RECTANGLE)) static VALUE rg_initialize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { GdkRectangle rectangle; rectangle.x = NUM2INT(x); rectangle.y = NUM2INT(y); rectangle.width = NUM2INT(width); rectangle.height = NUM2INT(height); G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_RECTANGLE, &rectangle)); return Qnil; } static VALUE rg_intersect(VALUE self, VALUE other) { GdkRectangle dest; gboolean ret = gdk_rectangle_intersect(_SELF(self), _SELF(other), &dest); return ret ? BOXED2RVAL(&dest, GDK_TYPE_RECTANGLE) : Qnil; } static VALUE rg_union(VALUE self, VALUE other) { GdkRectangle dest; gdk_rectangle_union(_SELF(self), _SELF(other), &dest); return BOXED2RVAL(&dest, GDK_TYPE_RECTANGLE); } /* Struct accessors */ static VALUE rg_x(VALUE self) { return INT2NUM(_SELF(self)->x); } static VALUE rg_y(VALUE self) { return INT2NUM(_SELF(self)->y); } static VALUE rg_width(VALUE self) { return INT2NUM(_SELF(self)->width); } static VALUE rg_height(VALUE self) { return INT2NUM(_SELF(self)->height); } static VALUE rg_set_x(VALUE self, VALUE x) { _SELF(self)->x = NUM2INT(x); return self; } static VALUE rg_set_y(VALUE self, VALUE y) { _SELF(self)->y = NUM2INT(y); return self; } static VALUE rg_set_width(VALUE self, VALUE width) { _SELF(self)->width = NUM2INT(width); return self; } static VALUE rg_set_height(VALUE self, VALUE height) { _SELF(self)->height = NUM2INT(height); return self; } static VALUE rg_to_a(VALUE self) { GdkRectangle* a = _SELF(self); return rb_ary_new3(4, INT2FIX(a->x), INT2FIX(a->y), INT2FIX(a->width), INT2FIX(a->height)); } void Init_gtk_gdk_rectangle(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_RECTANGLE, "Rectangle", mGdk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(intersect, 1); RG_DEF_ALIAS("&", "intersect"); RG_DEF_METHOD(union, 1); RG_DEF_ALIAS("|", "union"); RG_DEF_METHOD(x, 0); RG_DEF_METHOD(y, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(set_x, 1); RG_DEF_METHOD(set_y, 1); RG_DEF_METHOD(set_width, 1); RG_DEF_METHOD(set_height, 1); RG_DEF_METHOD(to_a, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktexttagtable.c���������������������������������������������0000644�0001750�0001750�00000005103�11701304107�021001� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTextTagTable #define _SELF(self) (GTK_TEXT_TAG_TABLE(RVAL2GOBJ(self))) #define RVAL2TAG(t) (GTK_TEXT_TAG(RVAL2GOBJ(t))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_text_tag_table_new()); return Qnil; } static VALUE rg_add(VALUE self, VALUE tag) { G_CHILD_ADD(self, tag); gtk_text_tag_table_add(_SELF(self), RVAL2TAG(tag)); return self; } static VALUE rg_remove(VALUE self, VALUE tag) { G_CHILD_REMOVE(self, tag); gtk_text_tag_table_remove(_SELF(self), RVAL2TAG(tag)); return self; } static VALUE rg_lookup(VALUE self, VALUE name) { VALUE ret = Qnil; GtkTextTag* tag = gtk_text_tag_table_lookup(_SELF(self), RVAL2CSTR(name)); if (tag){ ret = GOBJ2RVAL(tag); G_CHILD_ADD(self, ret); } return ret; } static gboolean txt_tt_foreach_func(GtkTextTag *tag, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 1, GOBJ2RVAL(tag))); } static VALUE rg_each(VALUE self) { volatile VALUE func = rb_block_proc(); gtk_text_tag_table_foreach(_SELF(self), (GtkTextTagTableForeach)txt_tt_foreach_func, (gpointer)func); return self; } static VALUE rg_size(VALUE self) { return INT2NUM(gtk_text_tag_table_get_size(_SELF(self))); } void Init_gtk_text_tag_table(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_TAG_TABLE, "TextTagTable", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add, 1); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(lookup, 1); RG_DEF_ALIAS("[]", "lookup"); RG_DEF_METHOD(each, 0); RG_DEF_METHOD(size, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkimagemenuitem.c��������������������������������������������0000644�0001750�0001750�00000004477�11701304107�021154� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cImageMenuItem static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, use_underline_or_accel_group; GtkWidget *widget = NULL; if (rb_scan_args(argc, argv, "02", &label, &use_underline_or_accel_group) > 0) { if (TYPE(label) == T_STRING){ if (NIL_P(use_underline_or_accel_group) || RVAL2CBOOL(use_underline_or_accel_group)){ widget = gtk_image_menu_item_new_with_mnemonic(RVAL2CSTR(label)); } else { widget = gtk_image_menu_item_new_with_label(RVAL2CSTR(label)); } } else if (TYPE(label) == T_SYMBOL){ widget = gtk_image_menu_item_new_from_stock(rb_id2name(SYM2ID(label)), NIL_P(use_underline_or_accel_group) ? NULL : GTK_ACCEL_GROUP(RVAL2GOBJ(use_underline_or_accel_group))); } else { rb_raise(rb_eArgError, "invalid argument %s (expect Symbol(Gtk::Stock constants) or String)", rb_class2name(CLASS_OF(label))); } } else { widget = gtk_image_menu_item_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_image_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_IMAGE_MENU_ITEM, "ImageMenuItem", mGtk); RG_DEF_METHOD(initialize, -1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrecentchooser.c��������������������������������������������0000644�0001750�0001750�00000013200�12257552167�021173� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRecentChooser #define _SELF(self) (GTK_RECENT_CHOOSER(RVAL2GOBJ(self))) static VALUE rg_set_show_numbers(VALUE self, VALUE val) { gtk_recent_chooser_set_show_numbers(_SELF(self), RVAL2CBOOL(val)); return self; } static VALUE rg_show_numbers(VALUE self) { return CBOOL2RVAL(gtk_recent_chooser_get_show_numbers(_SELF(self))); } struct callback_arg { VALUE callback; VALUE a, b; }; static VALUE invoke_callback(VALUE data) { struct callback_arg *arg = (struct callback_arg *)data; return rb_funcall(arg->callback, id_call, 1, arg->a, arg->b); } static void remove_callback_reference(gpointer callback) { G_CHILD_REMOVE(mGtk, (VALUE)callback); } static gint sort_func(GtkRecentInfo *a, GtkRecentInfo *b, gpointer func) { struct callback_arg arg; arg.callback = (VALUE)func; arg.a = BOXED2RVAL(a, GTK_TYPE_RECENT_INFO); arg.b = BOXED2RVAL(b, GTK_TYPE_RECENT_INFO); return NUM2INT(G_PROTECT_CALLBACK(invoke_callback, &arg)); } static VALUE rg_set_sort_func(VALUE self) { VALUE func = rb_block_proc(); G_CHILD_ADD(mGtk, func); gtk_recent_chooser_set_sort_func(_SELF(self), (GtkRecentSortFunc)sort_func, (gpointer)func, (GDestroyNotify)remove_callback_reference); return self; } static VALUE rg_set_current_uri(VALUE self, VALUE uri) { GError *error = NULL; gboolean ret = gtk_recent_chooser_set_current_uri(_SELF(self), RVAL2CSTR(uri), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_current_uri(VALUE self) { return CSTR2RVAL(gtk_recent_chooser_get_current_uri(_SELF(self))); } static VALUE rg_current_item(VALUE self) { return BOXED2RVAL(gtk_recent_chooser_get_current_item(_SELF(self)), GTK_TYPE_RECENT_INFO); } static VALUE rg_select_uri(VALUE self, VALUE uri) { GError *error = NULL; gboolean ret = gtk_recent_chooser_select_uri(_SELF(self), RVAL2CSTR(uri), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_unselect_uri(VALUE self, VALUE uri) { gtk_recent_chooser_unselect_uri(_SELF(self), RVAL2CSTR(uri)); return self; } static VALUE rg_select_all(VALUE self) { gtk_recent_chooser_select_all(_SELF(self)); return self; } static VALUE rg_unselect_all(VALUE self) { gtk_recent_chooser_unselect_all(_SELF(self)); return self; } static VALUE rg_items(VALUE self) { GList* list = gtk_recent_chooser_get_items(_SELF(self)); VALUE ary = rb_ary_new(); while (list) { rb_ary_push(ary, BOXED2RVAL(list->data, GTK_TYPE_RECENT_INFO)); gtk_recent_info_unref(list->data); list = list->next; } g_list_free(list); return ary; } static VALUE rg_uris(VALUE self) { gsize i; gsize size; gchar** uris = gtk_recent_chooser_get_uris(_SELF(self), &size); VALUE ary = rb_ary_new(); for (i = 0; i < size; i++){ rb_ary_push(ary, CSTR2RVAL(uris[i])); } g_strfreev(uris); return ary; } static VALUE rg_add_filter(VALUE self, VALUE filter) { gtk_recent_chooser_add_filter(_SELF(self), GTK_RECENT_FILTER(RVAL2GOBJ(filter))); return self; } static VALUE rg_remove_filter(VALUE self, VALUE filter) { gtk_recent_chooser_remove_filter(_SELF(self), GTK_RECENT_FILTER(RVAL2GOBJ(filter))); return self; } static VALUE rg_filters(VALUE self) { return GSLIST2ARYF(gtk_recent_chooser_list_filters(_SELF(self))); } void Init_gtk_recent_chooser(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_CHOOSER, "RecentChooser", mGtk); RG_DEF_METHOD(set_show_numbers, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "show_numbers"); RG_DEF_METHOD(show_numbers, 0); RG_DEF_METHOD(set_sort_func, 0); RG_DEF_METHOD(set_current_uri, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "current_uri"); RG_DEF_METHOD(current_uri, 0); RG_DEF_METHOD(current_item, 0); RG_DEF_METHOD(select_uri, 1); RG_DEF_METHOD(unselect_uri, 1); RG_DEF_METHOD(select_all, 0); RG_DEF_METHOD(unselect_all, 0); RG_DEF_METHOD(items, 0); RG_DEF_METHOD(uris, 0); RG_DEF_METHOD(add_filter, 1); RG_DEF_METHOD(remove_filter, 1); RG_DEF_METHOD(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", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_RECENT_SORT_TYPE, "GTK_RECENT_"); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrecentaction.c���������������������������������������������0000644�0001750�0001750�00000004577�11701304107�021005� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #if GTK_CHECK_VERSION(2,12,0) #define RG_TARGET_NAMESPACE cRecentAction static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE name, label, tooltip, stock_id, manager; rb_scan_args(argc, argv, "23", &name, &label, &tooltip, &stock_id, &manager); if (NIL_P(manager)) { G_INITIALIZE(self, gtk_recent_action_new(RVAL2CSTR(name), RVAL2CSTR(label), NIL_P(tooltip) ? NULL : RVAL2CSTR(tooltip), NIL_P(stock_id) ? NULL : RVAL2CSTR(stock_id))); } else { G_INITIALIZE(self, gtk_recent_action_new_for_manager(RVAL2CSTR(name), RVAL2CSTR(label), NIL_P(tooltip) ? NULL : RVAL2CSTR(tooltip), NIL_P(stock_id) ? NULL : RVAL2CSTR(stock_id), GTK_RECENT_MANAGER(RVAL2GOBJ(manager)))); } return Qnil; } #endif void Init_gtk_recentaction(VALUE mGtk) { #if GTK_CHECK_VERSION(2,12,0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_ACTION, "RecentAction", mGtk); RG_DEF_METHOD(initialize, -1); #endif } ���������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkselection.c������������������������������������������������0000644�0001750�0001750�00000014070�12257552167�020303� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mSelection #define GATOM2RVAL(g) (BOXED2RVAL(g, GDK_TYPE_ATOM)) static VALUE rg_m_owner_set(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE owner, selection, time, send_event; int ret; if (argc == 4){ rb_scan_args(argc, argv, "40", &owner, &selection, &time, &send_event); ret = gdk_selection_owner_set(GDK_WINDOW(RVAL2GOBJ(owner)), RVAL2ATOM(selection), NUM2UINT(time), RVAL2CBOOL(send_event)); } else { VALUE display = Qnil; rb_scan_args(argc, argv, "50", &display, &owner, &selection, &time, &send_event); ret = gdk_selection_owner_set_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), GDK_WINDOW(RVAL2GOBJ(owner)), RVAL2ATOM(selection), NUM2UINT(time), RVAL2CBOOL(send_event)); } return CBOOL2RVAL(ret); } static VALUE rg_m_owner_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE selection; if (argc == 1) { rb_scan_args(argc, argv, "10", &selection); return GOBJ2RVAL(gdk_selection_owner_get(RVAL2ATOM(selection))); } else { VALUE display = Qnil; rb_scan_args(argc, argv, "20", &display, &selection); return GOBJ2RVAL(gdk_selection_owner_get_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2ATOM(selection))); } } static VALUE rg_m_convert(VALUE self, VALUE requestor, VALUE selection, VALUE target, VALUE time) { gdk_selection_convert(GDK_WINDOW(RVAL2GOBJ(requestor)), RVAL2ATOM(selection), RVAL2ATOM(target), NUM2INT(time)); return self; } static VALUE rg_m_property_get(G_GNUC_UNUSED VALUE self, VALUE requestor) { guchar *data; GdkAtom prop_type; gint prop_format; VALUE ary; gdk_selection_property_get(GDK_WINDOW(RVAL2GOBJ(requestor)), &data, &prop_type, &prop_format); ary = rb_ary_new3(3, CSTR2RVAL((const char*)data), GATOM2RVAL(prop_type), INT2NUM(prop_format)); g_free(data); return ary; } static VALUE rg_m_send_notify(int argc, VALUE *argv, VALUE self) { VALUE requestor, selection, target, property, time; if (argc == 5) { rb_scan_args(argc, argv, "50", &requestor, &selection, &target, &property, &time); gdk_selection_send_notify(RVAL2GDKNATIVEWINDOW(requestor), RVAL2ATOM(selection), RVAL2ATOM(target), NIL_P(property) ? GDK_NONE : RVAL2ATOM(property), NUM2INT(time)); } else { VALUE display = Qnil; rb_scan_args(argc, argv, "60", &display, &requestor, &selection, &target, &property, &time); gdk_selection_send_notify_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2GDKNATIVEWINDOW(requestor), RVAL2ATOM(selection), RVAL2ATOM(target), NIL_P(property) ? GDK_NONE : RVAL2ATOM(property), NUM2INT(time)); } return self; } void Init_gtk_gdk_selection(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Selection"); RG_DEF_MODFUNC(owner_set, -1); RG_DEF_MODFUNC(owner_get, -1); RG_DEF_MODFUNC(convert, 4); RG_DEF_MODFUNC(property_get, 1); RG_DEF_MODFUNC(send_notify, -1); /* Constants */ rb_define_const(RG_TARGET_NAMESPACE, "PRIMARY", GATOM2RVAL(GDK_SELECTION_PRIMARY)); rb_define_const(RG_TARGET_NAMESPACE, "SECONDARY", GATOM2RVAL(GDK_SELECTION_SECONDARY)); rb_define_const(RG_TARGET_NAMESPACE, "CLIPBOARD", GATOM2RVAL(GDK_SELECTION_CLIPBOARD)); /* GdkSelectionType */ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_ATOM", GATOM2RVAL(GDK_SELECTION_TYPE_ATOM)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_BITMAP", GATOM2RVAL(GDK_SELECTION_TYPE_BITMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_COLORMAP", GATOM2RVAL(GDK_SELECTION_TYPE_COLORMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_DRAWABLE", GATOM2RVAL(GDK_SELECTION_TYPE_DRAWABLE)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_INTEGER", GATOM2RVAL(GDK_SELECTION_TYPE_INTEGER)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_PIXMAP", GATOM2RVAL(GDK_SELECTION_TYPE_PIXMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_WINDOW", GATOM2RVAL(GDK_SELECTION_TYPE_WINDOW)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRING", GATOM2RVAL(GDK_SELECTION_TYPE_STRING)); /* GdkTarget */ rb_define_const(RG_TARGET_NAMESPACE, "TARGET_BITMAP", GATOM2RVAL(GDK_TARGET_BITMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TARGET_COLORMAP", GATOM2RVAL(GDK_TARGET_COLORMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TARGET_DRAWABLE", GATOM2RVAL(GDK_TARGET_DRAWABLE)); rb_define_const(RG_TARGET_NAMESPACE, "TARGET_PIXMAP", GATOM2RVAL(GDK_TARGET_PIXMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TARGET_STRING", GATOM2RVAL(GDK_TARGET_STRING)); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkmenuitem.c�������������������������������������������������0000644�0001750�0001750�00000006126�11701304107�020142� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cMenuItem #define _SELF(s) (GTK_MENU_ITEM(RVAL2GOBJ(s))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { const gchar *label = NULL; VALUE rb_label, use_underline; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "02", &rb_label, &use_underline); if (!NIL_P(rb_label)) label = RVAL2CSTR(rb_label); if (label) { if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)) { widget = gtk_menu_item_new_with_mnemonic(label); } else { widget = gtk_menu_item_new_with_label(label); } } else { widget = gtk_menu_item_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE mitem_set_submenu(VALUE self, VALUE child) { GtkMenuItem *item; GtkWidget *submenu; item = _SELF(self); submenu = gtk_menu_item_get_submenu(item); if (submenu) G_CHILD_REMOVE(self, GOBJ2RVAL(submenu)); gtk_menu_item_set_submenu(item, GTK_WIDGET(RVAL2GOBJ(child))); G_CHILD_ADD(self, child); return self; } static VALUE rg_remove_submenu(VALUE self) { GtkMenuItem *item; GtkWidget *submenu; item = _SELF(self); submenu = gtk_menu_item_get_submenu(item); gtk_menu_item_remove_submenu(item); if (submenu) G_CHILD_REMOVE(self, GOBJ2RVAL(submenu)); return self; } static VALUE rg_toggle_size_request(VALUE self) { gint requisition; gtk_menu_item_toggle_size_request(_SELF(self), &requisition); return INT2NUM(requisition); } static VALUE rg_toggle_size_allocate(VALUE self, VALUE allocation) { gtk_menu_item_toggle_size_allocate(_SELF(self), NUM2INT(allocation)); return self; } void Init_gtk_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU_ITEM, "MenuItem", mGtk); RG_DEF_METHOD(initialize, -1); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "submenu", mitem_set_submenu, 1); RG_DEF_METHOD(remove_submenu, 0); RG_DEF_METHOD(toggle_size_request, 0); RG_DEF_METHOD(toggle_size_allocate, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkaboutdialog.c����������������������������������������������0000644�0001750�0001750�00000011212�12257552167�020623� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAboutDialog #define _SELF(self) (GTK_ABOUT_DIALOG(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_about_dialog_new()); return Qnil; } static void activate_link_func(GtkAboutDialog *about, const gchar *link, gpointer func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(about), CSTR2RVAL(link)); } static VALUE rg_s_set_email_hook(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_about_dialog_set_email_hook((GtkAboutDialogActivateLinkFunc)activate_link_func, (gpointer)func, (GDestroyNotify)NULL); return self; } static VALUE rg_s_set_url_hook(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_about_dialog_set_url_hook((GtkAboutDialogActivateLinkFunc)activate_link_func, (gpointer)func, (GDestroyNotify)NULL); return self; } typedef struct { const char *name; gpointer value; } prop_data; #define ABOUT_PROP_NUM (15) static VALUE rg_s_show(VALUE self, VALUE parent, VALUE props) { int i; VALUE ary; prop_data pd[ABOUT_PROP_NUM]; Check_Type(props, T_HASH); ary = rb_funcall(props, rb_intern("to_a"), 0); if (RARRAY_LEN(ary) > ABOUT_PROP_NUM) rb_raise(rb_eArgError, "Too many args."); for (i = 0; i < ABOUT_PROP_NUM; i++){ pd[i].name = (const char*)NULL; pd[i].value = (gpointer)NULL; } for (i = 0; i < RARRAY_LEN(ary); i++){ if (TYPE(RARRAY_PTR(RARRAY_PTR(ary)[i])[0]) == T_SYMBOL){ pd[i].name = rb_id2name(SYM2ID(RARRAY_PTR(RARRAY_PTR(ary)[i])[0])); } else { pd[i].name = RVAL2CSTR(RARRAY_PTR(RARRAY_PTR(ary)[i])[0]); } if (strncmp(pd[i].name, "artists", strlen("artists")) == 0|| strncmp(pd[i].name, "authors", strlen("authors")) == 0|| strncmp(pd[i].name, "documenters", strlen("documenters")) == 0){ GValue gval = G_VALUE_INIT; g_value_init(&gval, G_TYPE_STRV); rbgobj_rvalue_to_gvalue(RARRAY_PTR(RARRAY_PTR(ary)[i])[1], &gval); pd[i].value = g_boxed_copy(G_TYPE_STRV, g_value_get_boxed(&gval)); } else if (strncmp(pd[i].name, "logo", strlen("logo")) == 0 && strlen(pd[i].name) == strlen("logo")){ pd[i].value = g_object_ref(RVAL2GOBJ(RARRAY_PTR(RARRAY_PTR(ary)[i])[1])); } else if (strncmp(pd[i].name, "wrap_license", strlen("wrap_license")) == 0){ pd[i].value = GINT_TO_POINTER(RVAL2CBOOL(RARRAY_PTR(ary)[i])); } else { pd[i].value = g_strdup(RVAL2CSTR(RARRAY_PTR(RARRAY_PTR(ary)[i])[1])); } } gtk_show_about_dialog(GTK_WINDOW(RVAL2GOBJ(parent)), pd[0].name, pd[0].value, pd[1].name, pd[1].value, pd[2].name, pd[2].value, pd[3].name, pd[3].value, pd[4].name, pd[4].value, pd[5].name, pd[5].value, pd[6].name, pd[6].value, pd[7].name, pd[7].value, pd[8].name, pd[8].value, pd[9].name, pd[9].value, pd[10].name, pd[10].value, pd[11].name, pd[11].value, pd[12].name, pd[12].value, pd[13].name, pd[13].value, pd[14].name, pd[14].value, NULL); return self; } void Init_gtk_aboutdialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ABOUT_DIALOG, "AboutDialog", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_SMETHOD(set_email_hook, 0); RG_DEF_SMETHOD(set_url_hook, 0); RG_DEF_SMETHOD(show, 2); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcolorselectiondialog.c�������������������������������������0000664�0001750�0001750�00000003400�11740310343�022517� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cColorSelectionDialog #define _SELF(s) (GTK_COLOR_SELECTION_DIALOG(RVAL2GOBJ(s))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE title; rb_scan_args(argc, argv, "01", &title); RBGTK_INITIALIZE(self, gtk_color_selection_dialog_new(NIL_P(title) ? NULL : RVAL2CSTR(title))); return Qnil; } void Init_gtk_color_selection_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_COLOR_SELECTION_DIALOG, "ColorSelectionDialog", mGtk); RG_DEF_METHOD(initialize, -1); #if GTK_CHECK_VERSION(2, 14, 0) /* NOTE: Backward compatibility */ RG_DEF_ALIAS("colorsel", "color_selection"); #endif } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkmenu.c�����������������������������������������������������0000644�0001750�0001750�00000011525�12257552167�017304� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cMenu #define _SELF(self) (GTK_MENU(RVAL2GOBJ(self))) #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_menu_new()); return Qnil; } static VALUE rg_set_screen(VALUE self, VALUE screen) { gtk_menu_set_screen(_SELF(self), GDK_SCREEN(RVAL2GOBJ(screen))); return self; } static VALUE rg_reorder_child(VALUE self, VALUE child, VALUE position) { gtk_menu_reorder_child(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)), NUM2INT(position)); return self; } static VALUE rg_attach(VALUE self, VALUE child, VALUE left_attach, VALUE right_attach, VALUE top_attach, VALUE bottom_attach) { gtk_menu_attach(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)), NUM2UINT(left_attach), NUM2UINT(right_attach), NUM2UINT(top_attach), NUM2UINT(bottom_attach)); return self; } static void menu_pos_func(GtkMenu *menu, gint *px, gint *py, gboolean *push_in, gpointer data) { VALUE arr = rb_funcall((VALUE)data, id_call, 4, GOBJ2RVAL(menu), INT2FIX(*px), INT2FIX(*py), CBOOL2RVAL(*push_in)); if (TYPE(arr) == T_ARRAY && (RARRAY_LEN(arr) == 2 || RARRAY_LEN(arr) == 3)){ *px = NUM2INT(RARRAY_PTR(arr)[0]); *py = NUM2INT(RARRAY_PTR(arr)[1]); if (RARRAY_LEN(arr) == 3) *push_in = RVAL2CBOOL(RARRAY_PTR(arr)[2]); } else { rb_raise(rb_eArgError, "block should return [x, y, push_in]"); } } /* the proc should return [x, y, push_in] */ static VALUE rg_popup(VALUE self, VALUE pshell, VALUE pitem, VALUE button, VALUE activate_time) { GtkWidget *gpshell = NULL; GtkWidget *gpitem = NULL; GtkMenuPositionFunc pfunc = NULL; gpointer data = NULL; VALUE func; if (rb_block_given_p()) { func = rb_block_proc(); pfunc = (GtkMenuPositionFunc)menu_pos_func; data = (gpointer)func; G_RELATIVE(self, func); } if (!NIL_P(pshell)){ gpshell = RVAL2WIDGET(pshell); } if (!NIL_P(pitem)) { gpitem = RVAL2WIDGET(pitem); } gtk_menu_popup(_SELF(self), gpshell, gpitem, pfunc, data, NUM2UINT(button), NUM2UINT(activate_time)); return self; } static VALUE rg_popdown(VALUE self) { gtk_menu_popdown(_SELF(self)); return self; } static VALUE rg_reposition(VALUE self) { gtk_menu_reposition(_SELF(self)); return self; } static VALUE menu_detacher; static void detach_func(GtkWidget *attach_widget, GtkMenu *menu) { rb_funcall((VALUE)menu_detacher, id_call, 2, GOBJ2RVAL(attach_widget), GOBJ2RVAL(menu)); } static VALUE rg_attach_to_widget(VALUE self, VALUE attach_widget) { menu_detacher = rb_block_proc(); G_RELATIVE(self, menu_detacher); gtk_menu_attach_to_widget(_SELF(self), GTK_WIDGET(RVAL2GOBJ(attach_widget)), (GtkMenuDetachFunc)detach_func); return self; } static VALUE rg_detach(VALUE self) { gtk_menu_detach(_SELF(self)); return self; } static VALUE rg_s_get_for_attach_widget(G_GNUC_UNUSED VALUE self, VALUE widget) { /* Owned by GTK+ */ return GLIST2ARY(gtk_menu_get_for_attach_widget(GTK_WIDGET(RVAL2GOBJ(widget)))); } void Init_gtk_menu(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU, "Menu", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_screen, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "screen"); RG_DEF_METHOD(reorder_child, 2); RG_DEF_METHOD(attach, 5); RG_DEF_METHOD(popup, 4); RG_DEF_METHOD(popdown, 0); RG_DEF_METHOD(reposition, 0); RG_DEF_METHOD(detach, 0); RG_DEF_SMETHOD(get_for_attach_widget, 1); RG_DEF_METHOD(attach_to_widget, 1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtknotebook.c�������������������������������������������������0000644�0001750�0001750�00000030476�12257552167�020166� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cNotebook #define _SELF(self) GTK_NOTEBOOK(RVAL2GOBJ(self)) #define RVAL2WIDGET(w) GTK_WIDGET(RVAL2GOBJ(w)) #define GTK_TYPE_NOTEBOOK_PAGE (gtk_notebookpage_get_type()) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_notebook_new()); return Qnil; } static VALUE rg_append_page(int argc, VALUE *argv, VALUE self) { VALUE child, label; rb_scan_args(argc, argv, "11", &child, &label); gtk_notebook_append_page(_SELF(self), RVAL2WIDGET(child), NIL_P(label) ? NULL : RVAL2WIDGET(label)); G_CHILD_ADD(self, child); return self; } static VALUE rg_append_page_menu(int argc, VALUE *argv, VALUE self) { VALUE child, tab_label, menu_label; rb_scan_args(argc, argv, "12", &child, &tab_label, &menu_label); gtk_notebook_append_page_menu(_SELF(self), RVAL2WIDGET(child), RVAL2WIDGET(tab_label), NIL_P(menu_label) ? NULL : RVAL2WIDGET(menu_label)); return self; } static VALUE rg_prepend_page(int argc, VALUE *argv, VALUE self) { VALUE child, label; rb_scan_args(argc, argv, "11", &child, &label); gtk_notebook_prepend_page(_SELF(self), RVAL2WIDGET(child), NIL_P(label) ? NULL : RVAL2WIDGET(label)); return self; } static VALUE rg_prepend_page_menu(int argc, VALUE *argv, VALUE self) { VALUE child, tab_label, menu_label; rb_scan_args(argc, argv, "12", &child, &tab_label, &menu_label); gtk_notebook_prepend_page_menu(_SELF(self), RVAL2WIDGET(child), RVAL2WIDGET(tab_label), NIL_P(menu_label) ? NULL : RVAL2WIDGET(menu_label)); return self; } static VALUE rg_insert_page(int argc, VALUE *argv, VALUE self) { VALUE pos, child, label; rb_scan_args(argc, argv, "21", &pos, &child, &label); gtk_notebook_insert_page(_SELF(self), RVAL2WIDGET(child), NIL_P(label) ? NULL : RVAL2WIDGET(label), NUM2INT(pos)); return self; } static VALUE rg_insert_page_menu(int argc, VALUE *argv, VALUE self) { VALUE pos, child, tab_label, menu_label; rb_scan_args(argc, argv, "22", &pos, &child, &tab_label, &menu_label); gtk_notebook_insert_page_menu(_SELF(self), RVAL2WIDGET(child), RVAL2WIDGET(tab_label), RVAL2WIDGET(menu_label), NUM2INT(pos)); return self; } static VALUE rg_remove_page(VALUE self, VALUE pos) { gtk_notebook_remove_page(_SELF(self), NUM2INT(pos)); return self; } static VALUE rg_page_num(VALUE self, VALUE child) { return INT2FIX(gtk_notebook_page_num(_SELF(self), RVAL2WIDGET(child))); } static VALUE rg_next_page(VALUE self) { gtk_notebook_next_page(_SELF(self)); return self; } static VALUE rg_prev_page(VALUE self) { gtk_notebook_prev_page(_SELF(self)); return self; } static VALUE rg_reorder_child(VALUE self, VALUE child, VALUE pos) { gtk_notebook_reorder_child(_SELF(self), RVAL2WIDGET(child), NUM2INT(pos)); return self; } static VALUE rg_get_menu_label(VALUE self, VALUE child) { return GOBJ2RVAL(gtk_notebook_get_menu_label(_SELF(self), RVAL2WIDGET(child))); } static VALUE rg_get_nth_page(VALUE self, VALUE page_num) { GtkWidget *page = gtk_notebook_get_nth_page(_SELF(self), NUM2INT(page_num)); return page ? GOBJ2RVAL(page) : Qnil; } static VALUE rg_n_pages(VALUE self) { return INT2NUM(gtk_notebook_get_n_pages(_SELF(self))); } static VALUE rg_get_tab_label(VALUE self, VALUE child) { return GOBJ2RVAL(gtk_notebook_get_tab_label(_SELF(self), RVAL2WIDGET(child))); } static VALUE rg_query_tab_label_packing(VALUE self, VALUE child) { gboolean expand, fill; GtkPackType pack_type; VALUE ary; gtk_notebook_query_tab_label_packing(_SELF(self), RVAL2WIDGET(child), &expand, &fill, &pack_type); ary = rb_ary_new2(3); rb_ary_push(ary, CBOOL2RVAL(expand)); rb_ary_push(ary, CBOOL2RVAL(fill)); rb_ary_push(ary, GENUM2RVAL(pack_type, GTK_TYPE_PACK_TYPE)); return ary; } static VALUE rg_set_menu_label(VALUE self, VALUE child, VALUE label) { gtk_notebook_set_menu_label(_SELF(self), RVAL2WIDGET(child), NIL_P(label)?NULL:RVAL2WIDGET(label)); return self; } static VALUE rg_set_menu_label_text(VALUE self, VALUE child, VALUE text) { gtk_notebook_set_menu_label_text(_SELF(self), RVAL2WIDGET(child), RVAL2CSTR(text)); return self; } static VALUE rg_set_tab_label(VALUE self, VALUE child, VALUE label) { gtk_notebook_set_tab_label(_SELF(self), RVAL2WIDGET(child), NIL_P(label)?NULL:RVAL2WIDGET(label)); return self; } static VALUE rg_set_tab_label_packing(VALUE self, VALUE child, VALUE expand, VALUE fill, VALUE pack_type) { gtk_notebook_set_tab_label_packing(_SELF(self), RVAL2WIDGET(child), RVAL2CBOOL(expand), RVAL2CBOOL(fill), RVAL2GENUM(pack_type, GTK_TYPE_PACK_TYPE)); return self; } static VALUE rg_set_tab_label_text(VALUE self, VALUE child, VALUE text) { gtk_notebook_set_tab_label_text(_SELF(self), RVAL2WIDGET(child), RVAL2CSTR(text)); return self; } static VALUE rg_get_menu_label_text(VALUE self, VALUE child) { return CSTR2RVAL(gtk_notebook_get_menu_label_text(_SELF(self), RVAL2WIDGET(child))); } static VALUE rg_get_tab_label_text(VALUE self, VALUE child) { return CSTR2RVAL(gtk_notebook_get_tab_label_text(_SELF(self), RVAL2WIDGET(child))); } static VALUE rg_get_tab_reorderable(VALUE self, VALUE child) { return CBOOL2RVAL(gtk_notebook_get_tab_reorderable(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)))); } static VALUE rg_set_tab_reorderable(VALUE self, VALUE child, VALUE reorderable) { gtk_notebook_set_tab_reorderable(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)), RVAL2CBOOL(reorderable)); return self; } static VALUE rg_get_tab_detachable(VALUE self, VALUE child) { return CBOOL2RVAL(gtk_notebook_get_tab_detachable(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)))); } static VALUE rg_set_tab_detachable(VALUE self, VALUE child, VALUE detachable) { gtk_notebook_set_tab_detachable(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)), RVAL2CBOOL(detachable)); return self; } static GtkNotebook* creation_func(GtkNotebook *source, GtkWidget *page, gint x, gint y, gpointer func) { VALUE ret; ret = rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(source), GOBJ2RVAL(page), INT2NUM(x), INT2NUM(y)); return NIL_P(ret) ? (GtkNotebook*)NULL : GTK_NOTEBOOK(RVAL2GOBJ(ret)); } static VALUE rg_s_set_window_creation_hook(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_notebook_set_window_creation_hook((GtkNotebookWindowCreationFunc)creation_func, (gpointer)func, (GDestroyNotify)NULL); return self; } #if GTK_CHECK_VERSION(2,20,0) static VALUE rg_set_action_widget(VALUE self, VALUE widget, VALUE pack_type) { gtk_notebook_set_action_widget(_SELF(self), RVAL2WIDGET(widget), RVAL2GENUM(pack_type, GTK_TYPE_PACK_TYPE)); return self; } static VALUE rg_get_action_widget(VALUE self, VALUE pack_type) { return GOBJ2RVAL(gtk_notebook_get_action_widget(_SELF(self), RVAL2GENUM(pack_type, GTK_TYPE_PACK_TYPE))); } #endif /***********************************************/ /* * Gtk::NotebookPage */ typedef struct { VALUE parent; GtkNotebookPage *page; } GtkNotebookPageData; static GtkNotebookPageData * notebookpage_copy(const GtkNotebookPage *page) { GtkNotebookPageData *data; g_return_val_if_fail (page != NULL, NULL); data = g_new(GtkNotebookPageData, 1); data->page = (GtkNotebookPage *)page; return data; } static GType gtk_notebookpage_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkNotebookPageData", (GBoxedCopyFunc)notebookpage_copy, (GBoxedFreeFunc)g_free); return our_type; } static VALUE signal_g2r_func(G_GNUC_UNUSED guint num, const GValue *values) { GtkNotebookPageData npp; npp.parent = GVAL2RVAL(&values[0]); npp.page = (GtkNotebookPage*)g_value_get_pointer(&values[1]); return rb_ary_new3(3, GVAL2RVAL(&values[0]), BOXED2RVAL(&npp, GTK_TYPE_NOTEBOOK_PAGE), GVAL2RVAL(&values[2])); } /*****************************************/ void Init_gtk_notebook(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_NOTEBOOK, "Notebook", mGtk); G_DEF_CLASS(GTK_TYPE_NOTEBOOK_PAGE, "NotebookPage", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(append_page, -1); RG_DEF_METHOD(append_page_menu, -1); RG_DEF_METHOD(prepend_page, -1); RG_DEF_METHOD(prepend_page_menu, -1); RG_DEF_METHOD(insert_page, -1); RG_DEF_METHOD(insert_page_menu, -1); RG_DEF_METHOD(remove_page, 1); RG_DEF_METHOD(page_num, 1); RG_DEF_METHOD(next_page, 0); RG_DEF_METHOD(prev_page, 0); RG_DEF_METHOD(reorder_child, 2); RG_DEF_METHOD(get_menu_label, 1); RG_DEF_METHOD(get_nth_page, 1); RG_DEF_METHOD(n_pages, 0); RG_DEF_METHOD(get_tab_label, 1); RG_DEF_METHOD(query_tab_label_packing, 1); RG_DEF_METHOD(set_menu_label, 2); RG_DEF_METHOD(set_menu_label_text, 2); RG_DEF_METHOD(set_tab_label, 2); RG_DEF_METHOD(set_tab_label_packing, 4); RG_DEF_METHOD(set_tab_label_text, 2); RG_DEF_METHOD(get_menu_label_text, 1); RG_DEF_METHOD(get_tab_label_text, 1); RG_DEF_METHOD(get_tab_reorderable, 1); RG_DEF_METHOD(set_tab_reorderable, 2); RG_DEF_METHOD(get_tab_detachable, 1); RG_DEF_METHOD(set_tab_detachable, 2); RG_DEF_SMETHOD(set_window_creation_hook, 0); #if GTK_CHECK_VERSION(2,20,0) RG_DEF_METHOD(set_action_widget, 2); RG_DEF_METHOD(get_action_widget, 1); #endif /* GtkNotebookTab */ rb_define_const(RG_TARGET_NAMESPACE, "TAB_FIRST", GTK_NOTEBOOK_TAB_FIRST); rb_define_const(RG_TARGET_NAMESPACE, "TAB_LAST", GTK_NOTEBOOK_TAB_LAST); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "switch_page", (GValToRValSignalFunc)signal_g2r_func); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkgc.c�������������������������������������������������������0000644�0001750�0001750�00000025254�12257552167�016715� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 2001 Neil Conway * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cGC #define _SELF(s) (GDK_GC(RVAL2GOBJ(s))) static VALUE RG_TARGET_NAMESPACE; static VALUE gdkDrawable; static VALUE rg_initialize(VALUE self, VALUE win) { G_INITIALIZE(self, gdk_gc_new(GDK_DRAWABLE(RVAL2GOBJ(win)))); return Qnil; } /* we don't need them. GdkGC* gdk_gc_new_with_values (GdkDrawable *drawable, GdkGCValues *values, GdkGCValuesMask values_mask); void gdk_gc_set_values (GdkGC *gc, GdkGCValues *values, GdkGCValuesMask values_mask); void gdk_gc_get_values (GdkGC *gc, GdkGCValues *values); */ static VALUE rg_set_foreground(VALUE self, VALUE color) { gdk_gc_set_foreground(_SELF(self), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_set_background(VALUE self, VALUE color) { gdk_gc_set_background(_SELF(self), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_set_rgb_fg_color(VALUE self, VALUE color) { gdk_gc_set_rgb_fg_color(_SELF(self), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_set_rgb_bg_color(VALUE self, VALUE color) { gdk_gc_set_rgb_bg_color(_SELF(self), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_set_function(VALUE self, VALUE func) { GdkFunction f; f = (GdkFunction)(RVAL2GENUM(func, GDK_TYPE_FUNCTION)); if (f > GDK_SET) rb_raise(rb_eArgError, "function out of range"); gdk_gc_set_function(_SELF(self), f); return self; } static VALUE rg_set_fill(VALUE self, VALUE fill) { gdk_gc_set_fill(_SELF(self), RVAL2GENUM(fill, GDK_TYPE_FILL)); return self; } static VALUE rg_set_tile(VALUE self, VALUE tile) { gdk_gc_set_tile(_SELF(self), GDK_PIXMAP(RVAL2GOBJ(tile))); return self; } static VALUE rg_set_stipple(VALUE self, VALUE stipple) { gdk_gc_set_stipple(_SELF(self), GDK_PIXMAP(RVAL2GOBJ(stipple))); return self; } static VALUE rg_set_ts_origin(VALUE self, VALUE x, VALUE y) { gdk_gc_set_ts_origin(_SELF(self), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_set_clip_origin(VALUE self, VALUE x, VALUE y) { gdk_gc_set_clip_origin(_SELF(self), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_set_clip_mask(VALUE self, VALUE mask) { gdk_gc_set_clip_mask(_SELF(self), GDK_BITMAP(RVAL2GOBJ(mask))); return self; } static VALUE rg_set_clip_rectangle(VALUE self, VALUE rectangle) { gdk_gc_set_clip_rectangle(_SELF(self), (GdkRectangle*)RVAL2BOXED(rectangle, GDK_TYPE_RECTANGLE)); return self; } static VALUE rg_set_clip_region(VALUE self, VALUE region) { gdk_gc_set_clip_region(_SELF(self), (GdkRegion*)RVAL2BOXED(region, GDK_TYPE_REGION)); return self; } static VALUE rg_set_subwindow_mode(VALUE self, VALUE mode) { gdk_gc_set_subwindow(_SELF(self), RVAL2GENUM(mode, GDK_TYPE_SUBWINDOW_MODE)); return self; } static VALUE rg_set_exposures(VALUE self, VALUE exposures) { gdk_gc_set_exposures(_SELF(self), RVAL2CBOOL(exposures)); return self; } static VALUE rg_set_line_attributes(VALUE self, VALUE line_width, VALUE line_style, VALUE cap_style, VALUE join_style) { gdk_gc_set_line_attributes(_SELF(self), NUM2INT(line_width), RVAL2GENUM(line_style, GDK_TYPE_LINE_STYLE), RVAL2GENUM(cap_style, GDK_TYPE_CAP_STYLE), RVAL2GENUM(join_style, GDK_TYPE_JOIN_STYLE)); return self; } static VALUE rg_set_dashes(VALUE self, VALUE rbdash_offset, VALUE rbdash_list) { GdkGC *gc = _SELF(self); gint dash_offset = NUM2INT(rbdash_offset); long n; gint8 *dash_list = RVAL2GINT8S(rbdash_list, n); gdk_gc_set_dashes(gc, dash_offset, dash_list, n); g_free(dash_list); return self; } static VALUE rg_copy(VALUE self, VALUE dst) { if (RVAL2CBOOL(rb_obj_is_kind_of(dst, gdkDrawable))) { VALUE args[1]; args[0] = dst; dst = rb_class_new_instance(1, args, RG_TARGET_NAMESPACE); } gdk_gc_copy(_SELF(dst), _SELF(self)); return dst; } static VALUE rg_set_colormap(VALUE self, VALUE colormap) { gdk_gc_set_colormap(_SELF(self), GDK_COLORMAP(RVAL2GOBJ(colormap))); return self; } static VALUE rg_foreground(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return BOXED2RVAL(&val.foreground, GDK_TYPE_COLOR); } static VALUE rg_background(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return BOXED2RVAL(&val.background, GDK_TYPE_COLOR); } static VALUE rg_function(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return GENUM2RVAL(val.function, GDK_TYPE_FUNCTION); } static VALUE rg_fill(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return GENUM2RVAL(val.fill, GDK_TYPE_FILL); } static VALUE rg_tile(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return GOBJ2RVAL(val.tile); } static VALUE rg_stipple(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return GOBJ2RVAL(val.stipple); } static VALUE rg_ts_origin(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return rb_ary_new3(2, INT2NUM(val.ts_x_origin), INT2NUM(val.ts_y_origin)); } static VALUE rg_clip_origin(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return rb_ary_new3(2, INT2NUM(val.clip_x_origin), INT2NUM(val.clip_y_origin)); } static VALUE rg_clip_mask(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return GOBJ2RVAL(val.clip_mask); } static VALUE rg_subwindow_mode(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return GENUM2RVAL(val.subwindow_mode, GDK_TYPE_SUBWINDOW_MODE); } static VALUE rg_exposures_p(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return CBOOL2RVAL(val.graphics_exposures); } static VALUE rg_line_attributes(VALUE self) { GdkGCValues val; gdk_gc_get_values(_SELF(self), &val); return rb_ary_new3(4, INT2NUM(val.line_width), GENUM2RVAL(val.line_style, GDK_TYPE_LINE_STYLE), GENUM2RVAL(val.cap_style, GDK_TYPE_CAP_STYLE), GENUM2RVAL(val.join_style, GDK_TYPE_JOIN_STYLE)); } static VALUE rg_colormap(VALUE self) { return GOBJ2RVAL(gdk_gc_get_colormap(_SELF(self))); } static VALUE rg_offset(VALUE self, VALUE x, VALUE y) { gdk_gc_offset(_SELF(self), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_screen(VALUE self) { return GOBJ2RVAL(gdk_gc_get_screen(_SELF(self))); } void Init_gtk_gdk_gc(VALUE mGdk) { RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_GC, "GC", mGdk); gdkDrawable = rb_const_get(mGdk, rb_intern("Drawable")); rbgobj_add_abstract_but_create_instance_class(GDK_TYPE_GC); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(set_foreground, 1); RG_DEF_METHOD(set_background, 1); RG_DEF_METHOD(set_rgb_fg_color, 1); RG_DEF_METHOD(set_rgb_bg_color, 1); RG_DEF_METHOD(set_function, 1); RG_DEF_METHOD(set_fill, 1); RG_DEF_METHOD(set_tile, 1); RG_DEF_METHOD(set_stipple, 1); RG_DEF_METHOD(set_ts_origin, 2); RG_DEF_METHOD(set_clip_origin, 2); RG_DEF_METHOD(set_clip_mask, 1); RG_DEF_METHOD(set_clip_rectangle, 1); RG_DEF_METHOD(set_clip_region, 1); RG_DEF_METHOD(set_subwindow_mode, 1); RG_DEF_METHOD(set_exposures, 1); RG_DEF_METHOD(set_line_attributes, 4); RG_DEF_METHOD(set_dashes, 2); RG_DEF_METHOD(copy, 1); RG_DEF_METHOD(set_colormap, 1); RG_DEF_METHOD(foreground, 0); RG_DEF_METHOD(background, 0); RG_DEF_METHOD(function, 0); RG_DEF_METHOD(fill, 0); RG_DEF_METHOD(tile, 0); RG_DEF_METHOD(stipple, 0); RG_DEF_METHOD(ts_origin, 0); RG_DEF_METHOD(clip_origin, 0); RG_DEF_METHOD(clip_mask, 0); RG_DEF_METHOD(subwindow_mode, 0); RG_DEF_METHOD_P(exposures, 0); RG_DEF_METHOD(line_attributes, 0); RG_DEF_METHOD(colormap, 0); RG_DEF_METHOD(offset, 2); RG_DEF_METHOD(screen, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GdkGCValuesMask */ /* Don't need them. G_DEF_CLASS(GDK_TYPE_GC_VALUES_MASK, "ValuesMask", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_GC_VALUES_MASK, "GDK_GC_"); */ /* GdkFunction */ G_DEF_CLASS(GDK_TYPE_FUNCTION, "Function", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_FUNCTION, "GDK_"); /* GdkFill */ G_DEF_CLASS(GDK_TYPE_FILL, "Fill", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_FILL, "GDK_"); /* GdkSubwindowMode */ G_DEF_CLASS(GDK_TYPE_SUBWINDOW_MODE, "SubWindowMode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_SUBWINDOW_MODE, "GDK_"); /* GdkLineStyle */ G_DEF_CLASS(GDK_TYPE_LINE_STYLE, "LineStyle", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_LINE_STYLE, "GDK_"); /* GdkCapStyle */ G_DEF_CLASS(GDK_TYPE_CAP_STYLE, "CapStyle", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_CAP_STYLE, "GDK_"); /* GdkJoinStyle */ G_DEF_CLASS(GDK_TYPE_JOIN_STYLE, "JoinStyle", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_JOIN_STYLE, "GDK_"); #ifdef GDK_WINDOWING_X11 G_DEF_CLASS3("GdkGCX11", "GCX11", mGdk); #elif defined(GDK_WINDOWING_WIN32) G_DEF_CLASS3("GdkGCWin32", "GCWin32", mGdk); #elif defined(GDK_WINDOWING_FB) G_DEF_CLASS3("GdkGCFB", "GCFB", mGdk); #endif } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcellrenderertoggle.c���������������������������������������0000644�0001750�0001750�00000002506�11701304107�022165� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCellRendererToggle #define _SELF(s) (GTK_CELL_RENDERER_TOGGLE(RVAL2GOBJ(s))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_toggle_new()); return Qnil; } void Init_gtk_cellrenderertoggle(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_TOGGLE, "CellRendererToggle", mGtk); RG_DEF_METHOD(initialize, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkmisc.c�����������������������������������������������������0000644�0001750�0001750�00000004067�11701304107�017254� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cMisc #define _SELF(s) (GTK_MISC(RVAL2GOBJ(s))) static VALUE rg_set_alignment(VALUE self, VALUE xalign, VALUE yalign) { gtk_misc_set_alignment(_SELF(self), NUM2DBL(xalign), NUM2DBL(yalign)); return self; } static VALUE rg_set_padding(VALUE self, VALUE xpad, VALUE ypad) { gtk_misc_set_padding(_SELF(self), NUM2DBL(xpad), NUM2DBL(ypad)); return self; } static VALUE rg_alignment(VALUE self) { gfloat xalign, yalign; gtk_misc_get_alignment(_SELF(self), &xalign, &yalign); return rb_ary_new3(2, rb_float_new(xalign), rb_float_new(yalign)); } static VALUE rg_padding(VALUE self) { gint xpad, ypad; gtk_misc_get_padding(_SELF(self), &xpad, &ypad); return rb_ary_new3(2, INT2NUM(xpad), INT2NUM(ypad)); } void Init_gtk_misc(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MISC, "Misc", mGtk); RG_DEF_METHOD(set_alignment, 2); RG_DEF_METHOD(set_padding, 2); RG_DEF_METHOD(alignment, 0); RG_DEF_METHOD(padding, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkprogressbar.c����������������������������������������������0000644�0001750�0001750�00000005232�11701304107�020645� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cProgressBar static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_progress_bar_new()); return Qnil; } static VALUE rg_pulse(VALUE self) { gtk_progress_bar_pulse(GTK_PROGRESS_BAR(RVAL2GOBJ(self))); return self; } void Init_gtk_progress_bar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PROGRESS_BAR, "ProgressBar", mGtk); /* GtkProgressBarOrientation */ G_DEF_CLASS(GTK_TYPE_PROGRESS_BAR_ORIENTATION, "Orientation", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PROGRESS_BAR_ORIENTATION, "GTK_PROGRESS_"); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(pulse, 0); /* undef deprecated properties */ rb_undef_method(RG_TARGET_NAMESPACE, "adjustment"); rb_undef_method(RG_TARGET_NAMESPACE, "adjustment="); rb_undef_method(RG_TARGET_NAMESPACE, "set_adjustment"); rb_undef_method(RG_TARGET_NAMESPACE, "bar_style"); rb_undef_method(RG_TARGET_NAMESPACE, "bar_style="); rb_undef_method(RG_TARGET_NAMESPACE, "set_bar_style"); rb_undef_method(RG_TARGET_NAMESPACE, "discrete_blocks"); rb_undef_method(RG_TARGET_NAMESPACE, "discrete_blocks="); rb_undef_method(RG_TARGET_NAMESPACE, "set_discrete_blocks"); rb_undef_method(RG_TARGET_NAMESPACE, "activity_blocks"); rb_undef_method(RG_TARGET_NAMESPACE, "activity_blocks="); rb_undef_method(RG_TARGET_NAMESPACE, "set_activity_blocks"); rb_undef_method(RG_TARGET_NAMESPACE, "activity_step"); rb_undef_method(RG_TARGET_NAMESPACE, "activity_step="); rb_undef_method(RG_TARGET_NAMESPACE, "set_activity_step"); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktable.c����������������������������������������������������0000644�0001750�0001750�00000012471�11701304107�017406� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTable #define _SELF(self) (GTK_TABLE(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE row, col, homogeneous; rb_scan_args(argc, argv, "21", &row, &col, &homogeneous); RBGTK_INITIALIZE(self, gtk_table_new(NUM2INT(row), NUM2INT(col), RVAL2CBOOL(homogeneous))); return Qnil; } static VALUE rg_resize(VALUE self, VALUE rows, VALUE columns) { gtk_table_resize(_SELF(self), NUM2UINT(rows), NUM2UINT(columns)); return self; } static VALUE rg_attach(int argc, VALUE *argv, VALUE self) { VALUE child, left, right, top, bottom; VALUE arg0, arg1, arg2, arg3; gint xspc, yspc; GtkAttachOptions xopt, yopt; xopt = yopt = GTK_EXPAND | GTK_FILL; xspc = yspc = 0; rb_scan_args(argc, argv, "54", &child, &left, &right, &top, &bottom, &arg0, &arg1, &arg2, &arg3); if (!NIL_P(arg0)) xopt = RVAL2GFLAGS(arg0, GTK_TYPE_ATTACH_OPTIONS); if (!NIL_P(arg1)) yopt = RVAL2GFLAGS(arg1, GTK_TYPE_ATTACH_OPTIONS); if (!NIL_P(arg2)) xspc = NUM2INT(arg2); if (!NIL_P(arg3)) yspc = NUM2INT(arg3); gtk_table_attach(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)), NUM2INT(left),NUM2INT(right), NUM2INT(top),NUM2INT(bottom), xopt, yopt, xspc, yspc); G_CHILD_ADD(self, child); return self; } static VALUE rg_attach_defaults(VALUE self, VALUE widget, VALUE left_attach, VALUE right_attach, VALUE top_attach, VALUE bottom_attach) { gtk_table_attach_defaults(_SELF(self), GTK_WIDGET(RVAL2GOBJ(widget)), NUM2UINT(left_attach), NUM2UINT(right_attach), NUM2UINT(top_attach), NUM2UINT(bottom_attach)); G_CHILD_ADD(self, widget); return self; } static VALUE tbl_set_row_spacing(VALUE self, VALUE row, VALUE spc) { gtk_table_set_row_spacing(_SELF(self), NUM2UINT(row), NUM2UINT(spc)); return self; } static VALUE rg_get_row_spacing(VALUE self, VALUE row) { return UINT2NUM(gtk_table_get_row_spacing(_SELF(self), NUM2UINT(row))); } static VALUE tbl_set_col_spacing(VALUE self, VALUE col, VALUE spc) { gtk_table_set_col_spacing(_SELF(self), NUM2UINT(col), NUM2UINT(spc)); return self; } static VALUE rg_get_column_spacing(VALUE self, VALUE col) { return UINT2NUM(gtk_table_get_col_spacing(_SELF(self), NUM2UINT(col))); } static VALUE rg_set_row_spacings(VALUE self, VALUE spc) { gtk_table_set_row_spacings(_SELF(self), NUM2UINT(spc)); return self; } static VALUE rg_set_column_spacings(VALUE self, VALUE spc) { gtk_table_set_col_spacings(_SELF(self), NUM2UINT(spc)); return self; } static VALUE rg_row_spacings(VALUE self) { return UINT2NUM(_SELF(self)->row_spacing); } static VALUE rg_column_spacings(VALUE self) { return UINT2NUM(_SELF(self)->column_spacing); } static VALUE rg_default_row_spacing(VALUE self) { return UINT2NUM(gtk_table_get_default_row_spacing(_SELF(self))); } static VALUE rg_default_column_spacing(VALUE self) { return UINT2NUM(gtk_table_get_default_col_spacing(_SELF(self))); } void Init_gtk_table(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TABLE, "Table", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(resize, 2); RG_DEF_METHOD(attach, -1); RG_DEF_METHOD(attach_defaults, 5); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "row_spacing", tbl_set_row_spacing, 2); rb_undef_method(RG_TARGET_NAMESPACE, "row_spacing="); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "column_spacing", tbl_set_col_spacing, 2); rb_undef_method(RG_TARGET_NAMESPACE, "column_spacing="); RG_DEF_METHOD(get_row_spacing, 1); rb_undef_method(RG_TARGET_NAMESPACE, "row_spacing"); RG_DEF_METHOD(get_column_spacing, 1); rb_undef_method(RG_TARGET_NAMESPACE, "column_spacing"); RG_DEF_METHOD(set_row_spacings, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "row_spacings"); RG_DEF_METHOD(set_column_spacings, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "column_spacings"); RG_DEF_METHOD(row_spacings, 0); RG_DEF_METHOD(column_spacings, 0); RG_DEF_METHOD(default_row_spacing, 0); RG_DEF_METHOD(default_column_spacing, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/init.c����������������������������������������������������������0000664�0001750�0001750�00000021423�11740310343�016231� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2001 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #include "gmodule.h" VALUE treeiter_set_value_table; extern void Init_gtk2(void); void Init_gtk2(void) { /* * For Gtk::TreeModel, Gtk::TreeIter. * They should be initialized on this timing. */ treeiter_set_value_table = rb_hash_new(); rb_global_variable(&treeiter_set_value_table); Init_gtk_gdk(); Init_gtk_gtk(); Init_gtk_gdk_atom(mGdk); Init_gtk_gdk_cairo(); Init_gtk_gdk_color(mGdk); Init_gtk_gdk_colormap(mGdk); Init_gtk_gdk_const(mGdk); Init_gtk_gdk_cursor(mGdk); Init_gtk_gdk_device(mGdk); Init_gtk_gdk_display(mGdk); Init_gtk_gdk_display_manager(mGdk); Init_gtk_gdk_dragcontext(mGdk); Init_gtk_gdk_event(mGdk); Init_gtk_gdk_geometry(mGdk); Init_gtk_gdk_image(mGdk); Init_gtk_gdk_input(mGdk); Init_gtk_gdk_keymap(mGdk); Init_gtk_gdk_keyval(mGdk); Init_gtk_gdk_pango(mGdk); Init_gtk_gdk_pangorenderer(mGdk); Init_gtk_gdk_pixbuf(mGdk); Init_gtk_gdk_pixmap(mGdk); Init_gtk_gdk_property(mGdk); Init_gtk_gdk_rectangle(mGdk); Init_gtk_gdk_region(mGdk); Init_gtk_gdk_rgb(mGdk); Init_gtk_gdk_screen(mGdk); Init_gtk_gdk_selection(mGdk); Init_gtk_gdk_threads(mGdk); Init_gtk_gdk_timecoord(mGdk); Init_gtk_gdk_visual(mGdk); Init_gtk_gdk_window(mGdk); Init_gtk_gdk_windowattr(mGdk); Init_gtk_gdk_x11(mGdk); Init_gtk_aboutdialog(mGtk); Init_gtk_accelerator(mGtk); Init_gtk_accel_group(mGtk); Init_gtk_accel_group_entry(mGtk); Init_gtk_accel_key(mGtk); Init_gtk_accel_label(mGtk); Init_gtk_accel_map(mGtk); Init_gtk_accessible(mGtk); Init_gtk_action(mGtk); Init_gtk_actiongroup(mGtk); Init_gtk_adjustment(mGtk); Init_gtk_alignment(mGtk); Init_gtk_allocation(mGtk); Init_gtk_arrow(mGtk); Init_gtk_aspect_frame(mGtk); Init_gtk_assistant(mGtk); Init_gtk_button_box(mGtk); Init_gtk_bin(mGtk); Init_gtk_bindings(mGtk); Init_gtk_border(mGtk); Init_gtk_box(mGtk); Init_gtk_buildable(mGtk); Init_gtk_builder(mGtk); Init_gtk_button(mGtk); Init_gtk_calendar(mGtk); Init_gtk_celleditable(mGtk); Init_gtk_celllayout(mGtk); Init_gtk_cellrenderer(mGtk); Init_gtk_cellrendereraccel(mGtk); Init_gtk_cellrenderercombo(mGtk); Init_gtk_cellrendererpixbuf(mGtk); Init_gtk_cellrendererprogress(mGtk); Init_gtk_cellrendererspin(mGtk); Init_gtk_cellrendererspinner(mGtk); Init_gtk_cellrenderertext(mGtk); Init_gtk_cellrenderertoggle(mGtk); Init_gtk_cellview(mGtk); Init_gtk_check_button(mGtk); Init_gtk_check_menu_item(mGtk); Init_gtk_clipboard(mGtk); Init_gtk_colorbutton(mGtk); Init_gtk_color_selection(mGtk); Init_gtk_color_selection_dialog(mGtk); Init_gtk_combo(mGtk); Init_gtk_combobox(mGtk); Init_gtk_comboboxentry(mGtk); Init_gtk_const(mGtk); Init_gtk_container(mGtk); Init_gtk_curve(mGtk); Init_gtk_dialog(mGtk); Init_gtk_drag(mGtk); Init_gtk_drawing_area(mGtk); Init_gtk_editable(mGtk); Init_gtk_entry(mGtk); Init_gtk_entry_completion(mGtk); Init_gtk_eventbox(mGtk); Init_gtk_expander(mGtk); Init_gtk_file_chooser(mGtk); Init_gtk_filesystemerror(mGtk); Init_gtk_filechooserbutton(mGtk); Init_gtk_file_chooser_dialog(mGtk); Init_gtk_file_chooser_widget(mGtk); Init_gtk_file_filter(mGtk); Init_gtk_file_selection(mGtk); Init_gtk_fixed(mGtk); Init_gtk_fontbutton(mGtk); Init_gtk_font_selection(mGtk); Init_gtk_font_selection_dialog(mGtk); Init_gtk_frame(mGtk); Init_gtk_gamma_curve(mGtk); Init_gtk_gdk_draw(mGdk); Init_gtk_gdk_gc(mGdk); Init_gtk_handle_box(mGtk); Init_gtk_hbutton_box(mGtk); Init_gtk_hbox(mGtk); Init_gtk_hpaned(mGtk); Init_gtk_hruler(mGtk); Init_gtk_hscale(mGtk); Init_gtk_hscrollbar(mGtk); Init_gtk_hseparator(mGtk); Init_gtk_icon_factory(mGtk); Init_gtk_iconinfo(mGtk); Init_gtk_icon_set(mGtk); Init_gtk_icon_size(mGtk); Init_gtk_icon_source(mGtk); Init_gtk_icon_theme(mGtk); Init_gtk_iconview(mGtk); Init_gtk_image(mGtk); Init_gtk_image_menu_item(mGtk); Init_gtk_imcontext(mGtk); Init_gtk_imcontext_simple(mGtk); Init_gtk_im_multicontext(mGtk); Init_gtk_infobar(mGtk); Init_gtk_input_dialog(mGtk); Init_gtk_invisible(mGtk); Init_gtk_item(mGtk); Init_gtk_itemfactory(mGtk); Init_gtk_label(mGtk); Init_gtk_layout(mGtk); Init_gtk_link_button(mGtk); Init_gtk_list_store(mGtk); Init_gtk_menu(mGtk); Init_gtk_menu_bar(mGtk); Init_gtk_menu_item(mGtk); Init_gtk_menu_shell(mGtk); Init_gtk_menutoolbutton(mGtk); Init_gtk_message_dialog(mGtk); Init_gtk_misc(mGtk); Init_gtk_notebook(mGtk); Init_gtk_object(mGtk); Init_gtk_option_menu(mGtk); Init_gtk_page_setup(mGtk); Init_gtk_page_setup_unix_dialog(mGtk); Init_gtk_paned(mGtk); Init_gtk_paper_size(mGtk); Init_gtk_plug(mGtk); Init_gtk_print_context(mGtk); Init_gtk_printer(mGtk); Init_gtk_print_job(mGtk); Init_gtk_print_operation(mGtk); Init_gtk_print_operation_preview(mGtk); Init_gtk_print_settings(mGtk); Init_gtk_print_unix_dialog(mGtk); Init_gtk_progress(mGtk); Init_gtk_progress_bar(mGtk); Init_gtk_radio_action(mGtk); Init_gtk_radio_button(mGtk); Init_gtk_radio_menu_item(mGtk); Init_gtk_radiotoolbutton(mGtk); Init_gtk_range(mGtk); Init_gtk_rc(mGtk); Init_gtk_rcstyle(mGtk); Init_gtk_recentaction(mGtk); Init_gtk_recent_chooser(mGtk); Init_gtk_recent_chooser_dialog(mGtk); Init_gtk_recent_chooser_menu(mGtk); Init_gtk_recent_chooser_widget(mGtk); Init_gtk_recent_data(mGtk); Init_gtk_recent_filter(mGtk); Init_gtk_recent_filter_info(mGtk); Init_gtk_recent_info(mGtk); Init_gtk_recent_manager(mGtk); Init_gtk_ruler(mGtk); Init_gtk_scale(mGtk); Init_gtk_scalebutton(mGtk); Init_gtk_scrollbar(mGtk); Init_gtk_scrolled_window(mGtk); Init_gtk_selection(mGtk); Init_gtk_selectiondata(mGtk); Init_gtk_separator(mGtk); Init_gtk_separator_menu_item(mGtk); Init_gtk_separatortoolitem(mGtk); Init_gtk_settings(mGtk); Init_gtk_size_group(mGtk); Init_gtk_socket(mGtk); Init_gtk_spin_button(mGtk); Init_gtk_spinner(mGtk); Init_gtk_statusbar(mGtk); Init_gtk_status_icon(mGtk); Init_gtk_stock(mGtk); Init_gtk_style(mGtk); Init_gtk_table(mGtk); Init_gtk_target_list(mGtk); Init_gtk_tearoff_menu_item(mGtk); Init_gtk_text_appearance(mGtk); Init_gtk_text_attributes(mGtk); Init_gtk_textbuffer(mGtk); Init_gtk_textchild(mGtk); Init_gtk_textiter(mGtk); Init_gtk_textmark(mGtk); Init_gtk_texttag(mGtk); Init_gtk_text_tag_table(mGtk); Init_gtk_textview(mGtk); Init_gtk_toggle_action(mGtk); Init_gtk_toggle_button(mGtk); Init_gtk_toggletoolbutton(mGtk); Init_gtk_toolbar(mGtk); Init_gtk_toolbutton(mGtk); Init_gtk_toolitem(mGtk); Init_gtk_tooltip(mGtk); Init_gtk_tooltips(mGtk); Init_gtk_treedragdest(mGtk); Init_gtk_treedragsource(mGtk); Init_gtk_treeiter(mGtk); Init_gtk_treemodel(mGtk); Init_gtk_treemodelfilter(mGtk); Init_gtk_tmodelsort(mGtk); Init_gtk_treepath(mGtk); Init_gtk_treerowreference(mGtk); Init_gtk_treeselection(mGtk); Init_gtk_treesortable(mGtk); Init_gtk_tree_store(mGtk); Init_gtk_treeview(mGtk); Init_gtk_treeviewcolumn(mGtk); Init_gtk_uimanager(mGtk); Init_gtk_vbutton_box(mGtk); Init_gtk_vbox(mGtk); Init_gtk_viewport(mGtk); Init_gtk_volumebutton(mGtk); Init_gtk_vpaned(mGtk); Init_gtk_vruler(mGtk); Init_gtk_vscale(mGtk); Init_gtk_vscrollbar(mGtk); Init_gtk_vseparator(mGtk); Init_gtk_widget(mGtk); Init_gtk_window(mGtk); Init_gtk_windowgroup(mGtk); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrecentchoosermenu.c����������������������������������������0000644�0001750�0001750�00000003123�12257552167�022063� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRecentChooserMenu #define _SELF(self) (GTK_RECENT_CHOOSER_MENU(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE manager; GtkWidget* menu; rb_scan_args(argc, argv, "01", &manager); if (NIL_P(manager)){ menu = gtk_recent_chooser_menu_new_for_manager(GTK_RECENT_MANAGER(RVAL2GOBJ(manager))); } else { menu = gtk_recent_chooser_menu_new(); } RBGTK_INITIALIZE(self, menu); return Qnil; } void Init_gtk_recent_chooser_menu(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_CHOOSER_MENU, "RecentChooserMenu", mGtk); RG_DEF_METHOD(initialize, -1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkhseparator.c�����������������������������������������������0000644�0001750�0001750�00000002566�11701304107�020473� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cHSeparator static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_hseparator_new()); return Qnil; } void Init_gtk_hseparator(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HSEPARATOR, "HSeparator", mGtk); RG_DEF_METHOD(initialize, 0); } ������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkhscale.c���������������������������������������������������0000644�0001750�0001750�00000003475�11701304107�017562� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cHScale static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2, arg3; GtkAdjustment *adj = NULL; GtkWidget *widget; rb_scan_args(argc, argv, "03", &arg1, &arg2, &arg3); if (NIL_P(arg1) || RVAL2GTYPE(arg1) == GTK_TYPE_ADJUSTMENT){ if (!NIL_P(arg1)) adj = GTK_ADJUSTMENT(RVAL2GOBJ(arg1)); widget = gtk_hscale_new(adj); } else { widget = gtk_hscale_new_with_range(NUM2DBL(arg1), NUM2DBL(arg2), NUM2DBL(arg3)); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_hscale(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HSCALE, "HScale", mGtk); RG_DEF_METHOD(initialize, -1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkwindow.c���������������������������������������������������0000644�0001750�0001750�00000067501�12257552167�017634� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cWindow #define _SELF(s) GDK_WINDOW(RVAL2GOBJ(s)) static VALUE rg_initialize(VALUE self, VALUE parent, VALUE attributes, VALUE attributes_mask) { GdkWindow* win; win = gdk_window_new(NIL_P(parent) ? NULL : _SELF(parent), (GdkWindowAttr*)RVAL2BOXED(attributes, GDK_TYPE_WINDOW_ATTR), RVAL2GFLAGS(attributes_mask, GDK_TYPE_WINDOW_ATTRIBUTES_TYPE)); G_INITIALIZE(self, win); return Qnil; } static VALUE rg_destroy(VALUE self) { gdk_window_destroy(_SELF(self)); return Qnil; } static VALUE rg_window_type(VALUE self) { return GENUM2RVAL(gdk_window_get_window_type(_SELF(self)), GDK_TYPE_WINDOW_TYPE); } static VALUE rg_s_at_pointer(G_GNUC_UNUSED VALUE self) { gint x, y; GdkWindow* win = gdk_window_at_pointer(&x, &y); return rb_ary_new3(3, GOBJ2RVAL(win), INT2FIX(x), INT2FIX(y)); } static VALUE rg_show(VALUE self) { gdk_window_show(_SELF(self)); return self; } static VALUE rg_show_unraised(VALUE self) { gdk_window_show_unraised(_SELF(self)); return self; } static VALUE rg_hide(VALUE self) { gdk_window_hide(_SELF(self)); return Qnil; } static VALUE rg_visible_p(VALUE self) { return CBOOL2RVAL(gdk_window_is_visible(_SELF(self))); } static VALUE rg_viewable_p(VALUE self) { return CBOOL2RVAL(gdk_window_is_viewable(_SELF(self))); } static VALUE rg_state(VALUE self) { return GENUM2RVAL(gdk_window_get_state(_SELF(self)), GDK_TYPE_WINDOW_STATE); } static VALUE rg_withdraw(VALUE self) { gdk_window_withdraw(_SELF(self)); return Qnil; } static VALUE rg_iconify(VALUE self) { gdk_window_iconify(_SELF(self)); return self; } static VALUE rg_deiconify(VALUE self) { gdk_window_deiconify(_SELF(self)); return self; } static VALUE rg_stick(VALUE self) { gdk_window_stick(_SELF(self)); return self; } static VALUE rg_unstick(VALUE self) { gdk_window_unstick(_SELF(self)); return self; } static VALUE rg_maximize(VALUE self) { gdk_window_maximize(_SELF(self)); return self; } static VALUE rg_unmaximize(VALUE self) { gdk_window_unmaximize(_SELF(self)); return self; } static VALUE rg_fullscreen(VALUE self) { gdk_window_fullscreen(_SELF(self)); return self; } static VALUE rg_unfullscreen(VALUE self) { gdk_window_unfullscreen(_SELF(self)); return self; } static VALUE rg_set_keep_above(VALUE self, VALUE setting) { gdk_window_set_keep_above(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_set_keep_below(VALUE self, VALUE setting) { gdk_window_set_keep_below(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_move(VALUE self, VALUE x, VALUE y) { gdk_window_move(_SELF(self), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_resize(VALUE self, VALUE w, VALUE h) { gdk_window_resize(_SELF(self), NUM2INT(w), NUM2INT(h)); return self; } static VALUE rg_move_resize(VALUE self, VALUE x, VALUE y, VALUE w, VALUE h) { gdk_window_move_resize(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h)); return self; } static VALUE rg_scroll(VALUE self, VALUE dx, VALUE dy) { gdk_window_scroll(_SELF(self), NUM2INT(dx), NUM2INT(dy)); return self; } static VALUE rg_move_region(VALUE self, VALUE region, VALUE dx, VALUE dy) { gdk_window_move_region(_SELF(self), (GdkRegion*)RVAL2BOXED(region, GDK_TYPE_REGION), NUM2INT(dx), NUM2INT(dy)); return self; } static VALUE rg_reparent(VALUE self, VALUE new_parent, VALUE x, VALUE y) { gdk_window_reparent(_SELF(self), _SELF(new_parent), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_clear(VALUE self) { gdk_window_clear(_SELF(self)); return self; } static VALUE rg_clear_area(int argc, VALUE *argv, VALUE self) { VALUE gen_expose, x, y, w, h; rb_scan_args(argc, argv, "41", &x, &y, &w, &h, &gen_expose); if (! NIL_P(gen_expose) && RVAL2CBOOL(gen_expose)){ gdk_window_clear_area_e(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h)); } else { gdk_window_clear_area(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h)); } return self; } static VALUE rg_raise(VALUE self) { gdk_window_raise(_SELF(self)); return self; } static VALUE rg_lower(VALUE self) { gdk_window_lower(_SELF(self)); return self; } static VALUE rg_focus(VALUE self, VALUE timestamp) { gdk_window_focus(_SELF(self), NUM2UINT(timestamp)); return self; } static VALUE rg_register_dnd(VALUE self) { gdk_window_register_dnd(_SELF(self)); return self; } static VALUE rg_begin_resize_drag(VALUE self, VALUE edge, VALUE button, VALUE root_x, VALUE root_y, VALUE timestamp) { gdk_window_begin_resize_drag(_SELF(self), RVAL2GENUM(edge, GDK_TYPE_WINDOW_EDGE), NUM2INT(button), NUM2INT(root_x), NUM2INT(root_y), NUM2UINT(timestamp)); return self; } static VALUE rg_begin_move_drag(VALUE self, VALUE button, VALUE root_x, VALUE root_y, VALUE timestamp) { gdk_window_begin_move_drag(_SELF(self), NUM2INT(button), NUM2INT(root_x), NUM2INT(root_y), NUM2UINT(timestamp)); return self; } static VALUE rg_s_constrain_size(G_GNUC_UNUSED VALUE self, VALUE geometry, VALUE flags, VALUE w, VALUE h) { gint new_width, new_height; gdk_window_constrain_size((GdkGeometry*)RVAL2BOXED(geometry, GDK_TYPE_GEOMETRY), RVAL2GFLAGS(flags, GDK_TYPE_WINDOW_HINTS), NUM2INT(w), NUM2INT(h), &new_width, &new_height); return rb_assoc_new(INT2NUM(new_width), INT2NUM(new_height)); } #if GTK_CHECK_VERSION(2, 12, 0) static VALUE rg_beep(VALUE self) { gdk_window_beep(_SELF(self)); return self; } #endif static VALUE rg_begin_paint(VALUE self, VALUE area) { if (rb_obj_is_kind_of(area, GTYPE2CLASS(GDK_TYPE_RECTANGLE))){ gdk_window_begin_paint_rect(_SELF(self), (GdkRectangle*)RVAL2BOXED(area, GDK_TYPE_RECTANGLE)); } else { gdk_window_begin_paint_region(_SELF(self), (GdkRegion*)RVAL2BOXED(area, GDK_TYPE_REGION)); } return self; } static VALUE rg_end_paint(VALUE self) { gdk_window_end_paint(_SELF(self)); return self; } static VALUE rg_invalidate(VALUE self, VALUE area, VALUE invalidate_children) { if (rb_obj_is_kind_of(area, GTYPE2CLASS(GDK_TYPE_REGION))){ gdk_window_invalidate_region(_SELF(self), RVAL2BOXED(area, GDK_TYPE_REGION), RVAL2CBOOL(invalidate_children)); } else { gdk_window_invalidate_rect(_SELF(self), RVAL2BOXED(area, GDK_TYPE_RECTANGLE), RVAL2CBOOL(invalidate_children)); } return self; } static gboolean invalidate_child_func_wrap(GdkWindow *window, VALUE func) { VALUE result = rb_funcall(func, id_call, 1, GOBJ2RVAL(window)); return RVAL2CBOOL(result); } typedef gboolean (*ChildFunc) (GdkWindow*, gpointer); static VALUE rg_invalidate_maybe_recurse(VALUE self, VALUE region) { VALUE func = (VALUE)NULL; if (rb_block_given_p()){ func = rb_block_proc(); G_RELATIVE(self, func); } gdk_window_invalidate_maybe_recurse(_SELF(self), RVAL2BOXED(region, GDK_TYPE_REGION), (ChildFunc)invalidate_child_func_wrap, (gpointer)func); return self; } static VALUE rg_update_area(VALUE self) { GdkRegion* ret = gdk_window_get_update_area(_SELF(self)); return BOXED2RVAL(ret, GDK_TYPE_REGION); } static VALUE rg_freeze_updates(VALUE self) { gdk_window_freeze_updates(_SELF(self)); return self; } static VALUE rg_thaw_updates(VALUE self) { gdk_window_thaw_updates(_SELF(self)); return self; } static VALUE rg_s_process_all_updates(VALUE self) { gdk_window_process_all_updates(); return self; } static VALUE rg_process_updates(VALUE self, VALUE update_children) { gdk_window_process_updates(_SELF(self), RVAL2CBOOL(update_children)); return self; } static VALUE rg_s_set_debug_updates(VALUE self, VALUE setting) { gdk_window_set_debug_updates(RVAL2CBOOL(setting)); return self; } static VALUE rg_internal_paint_info(VALUE self) { GdkDrawable* real_drawable; gint x_offset, y_offset; gdk_window_get_internal_paint_info(_SELF(self), &real_drawable, &x_offset, &y_offset); return rb_ary_new3(3, GOBJ2RVAL(real_drawable), INT2NUM(x_offset), INT2NUM(y_offset)); } static VALUE rg_configure_finished(VALUE self) { gdk_window_configure_finished(_SELF(self)); return self; } static VALUE rg_enable_synchronized_configure(VALUE self) { gdk_window_enable_synchronized_configure(_SELF(self)); if (rb_block_given_p()) { rb_ensure(rb_yield, self, rg_configure_finished, self); } return self; } static VALUE rg_set_user_data(VALUE self, VALUE user_data) { gdk_window_set_user_data(_SELF(self), (gpointer)RVAL2GOBJ(user_data)); return self; } static VALUE rg_set_override_redirect(VALUE self, VALUE override_redirect) { gdk_window_set_override_redirect(_SELF(self), RVAL2CBOOL(override_redirect)); return self; } static VALUE rg_set_accept_focus(VALUE self, VALUE accept_focus) { gdk_window_set_accept_focus(_SELF(self), RVAL2CBOOL(accept_focus)); return self; } static VALUE rg_set_focus_on_map(VALUE self, VALUE focus_on_map) { gdk_window_set_focus_on_map(_SELF(self), RVAL2CBOOL(focus_on_map)); return self; } /* GdkXEvent is not implemented. void gdk_window_add_filter (GdkWindow *window, GdkFilterFunc function, gpointer data); void gdk_window_remove_filter (GdkWindow *window, GdkFilterFunc function, gpointer data); GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent, GdkEvent *event, gpointer data); */ static VALUE rg_shape_combine_mask(VALUE self, VALUE shape_mask, VALUE offset_x, VALUE offset_y) { gdk_window_shape_combine_mask(_SELF(self), GDK_BITMAP(RVAL2GOBJ(shape_mask)), NUM2INT(offset_x), NUM2INT(offset_y)); return self; } static VALUE rg_shape_combine_region(VALUE self, VALUE shape_region, VALUE offset_x, VALUE offset_y) { gdk_window_shape_combine_region(_SELF(self), NIL_P(shape_region) ? NULL : (GdkRegion*)RVAL2BOXED(shape_region, GDK_TYPE_REGION), INT2NUM(offset_x), INT2NUM(offset_y)); return self; } static VALUE rg_set_child_shapes(VALUE self) { gdk_window_set_child_shapes(_SELF(self)); return self; } static VALUE rg_merge_child_shapes(VALUE self) { gdk_window_merge_child_shapes(_SELF(self)); return self; } static VALUE rg_input_shape_combine_mask(VALUE self, VALUE mask, VALUE x, VALUE y) { gdk_window_input_shape_combine_mask(_SELF(self), GDK_BITMAP(RVAL2GOBJ(mask)), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_input_shape_combine_region(VALUE self, VALUE shape_region, VALUE offset_x, VALUE offset_y) { gdk_window_input_shape_combine_region(_SELF(self), (GdkRegion*)RVAL2BOXED(shape_region, GDK_TYPE_REGION), NUM2INT(offset_x), NUM2INT(offset_y)); return self; } static VALUE rg_set_child_input_shapes(VALUE self) { gdk_window_set_child_input_shapes(_SELF(self)); return self; } static VALUE rg_merge_child_input_shapes(VALUE self) { gdk_window_merge_child_input_shapes(_SELF(self)); return self; } static VALUE rg_set_static_gravities(VALUE self, VALUE use_static) { gboolean ret = gdk_window_set_static_gravities(_SELF(self), RVAL2CBOOL(use_static)); if (! ret) rb_raise(rb_eRuntimeError, "couldn't turn on static gravity"); return self; } static VALUE rg_set_title(VALUE self, VALUE title) { gdk_window_set_title(_SELF(self),RVAL2CSTR(title)); return self; } static VALUE rg_set_background(VALUE self, VALUE color) { gdk_window_set_background(_SELF(self), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_set_back_pixmap(VALUE self, VALUE pixmap, VALUE parent_relative) { gdk_window_set_back_pixmap(_SELF(self), GDK_PIXMAP(RVAL2GOBJ(pixmap)), RVAL2CBOOL(parent_relative)); return self; } static VALUE rg_set_cursor(VALUE self, VALUE cursor) { gdk_window_set_cursor(_SELF(self), RVAL2BOXED(cursor, GDK_TYPE_CURSOR)); return self; } static VALUE rg_user_data(VALUE self) { GObject *data = NULL; gdk_window_get_user_data(_SELF(self), (gpointer)&data); return GOBJ2RVAL(data); } static VALUE rg_geometry(VALUE self) { gint x, y, w, h, d; gdk_window_get_geometry(_SELF(self), &x, &y, &w, &h, &d); return rb_ary_new3(5, INT2NUM(x), INT2NUM(y), INT2NUM(w), INT2NUM(h), INT2NUM(d)); } static VALUE rg_set_geometry_hints(VALUE self, VALUE geometry, VALUE geom_mask) { gdk_window_set_geometry_hints(_SELF(self), NIL_P(geometry) ? (GdkGeometry*)NULL : (GdkGeometry*)RVAL2BOXED(geometry, GDK_TYPE_GEOMETRY), RVAL2GFLAGS(geom_mask, GDK_TYPE_WINDOW_HINTS)); return self; } static VALUE rg_set_icon_list(VALUE self, VALUE rbpixbufs) { GdkWindow *window = _SELF(self); GList *pixbufs = RVAL2GDKPIXBUFGLIST(rbpixbufs); gdk_window_set_icon_list(window, pixbufs); g_list_free(pixbufs); return self; } static VALUE rg_set_modal_hint(VALUE self, VALUE modal) { gdk_window_set_modal_hint(_SELF(self), RVAL2CBOOL(modal)); return self; } static VALUE rg_set_type_hint(VALUE self, VALUE hint) { gdk_window_set_type_hint(_SELF(self), RVAL2GENUM(hint, GDK_TYPE_WINDOW_TYPE_HINT)); return self; } static VALUE rg_type_hint(VALUE self) { return GENUM2RVAL(gdk_window_get_type_hint(_SELF(self)), GDK_TYPE_WINDOW_TYPE_HINT); } static VALUE rg_set_skip_taskbar_hint(VALUE self, VALUE hint) { gdk_window_set_skip_taskbar_hint(_SELF(self), RVAL2CBOOL(hint)); return self; } static VALUE rg_set_skip_pager_hint(VALUE self, VALUE hint) { gdk_window_set_skip_pager_hint(_SELF(self), RVAL2CBOOL(hint)); return self; } static VALUE rg_set_urgency_hint(VALUE self, VALUE hint) { gdk_window_set_urgency_hint(_SELF(self), RVAL2CBOOL(hint)); return self; } static VALUE rg_position(VALUE self) { gint x, y; gdk_window_get_position(_SELF(self), &x, &y); return rb_assoc_new(INT2NUM(x), INT2NUM(y)); } static VALUE rg_root_origin(VALUE self) { int x, y; gdk_window_get_root_origin(_SELF(self), &x, &y); return rb_assoc_new(INT2FIX(x), INT2FIX(y)); } static VALUE rg_frame_extents(VALUE self) { GdkRectangle rect; gdk_window_get_frame_extents(_SELF(self), &rect); return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE); } static VALUE rg_origin(VALUE self) { gint x, y; gdk_window_get_origin(_SELF(self), &x, &y); return rb_assoc_new(INT2NUM(x), INT2NUM(y)); } static VALUE rg_pointer(VALUE self) { gint x, y; GdkModifierType state; GdkWindow* ret = gdk_window_get_pointer(_SELF(self), &x, &y, &state); return rb_ary_new3(4, GOBJ2RVAL(ret), INT2NUM(x), INT2NUM(y), GFLAGS2RVAL(state, GDK_TYPE_MODIFIER_TYPE)); } static VALUE rg_parent(VALUE self) { return GOBJ2RVAL(gdk_window_get_parent(_SELF(self))); } static VALUE rg_toplevel(VALUE self) { return GOBJ2RVAL(gdk_window_get_toplevel(_SELF(self))); } static VALUE rg_children(VALUE self) { /* Don't use gdk_window_get_children() here */ GList* list = gdk_window_peek_children(_SELF(self)); VALUE ary = rb_ary_new(); while (list) { rb_ary_push(ary, GOBJ2RVAL(list->data)); list = list->next; } return ary; } static VALUE rg_events(VALUE self) { return GFLAGS2RVAL(gdk_window_get_events(_SELF(self)), GDK_TYPE_EVENT_MASK); } static VALUE rg_set_events(VALUE self, VALUE mask) { gdk_window_set_events(_SELF(self), RVAL2GFLAGS(mask, GDK_TYPE_EVENT_MASK)); return self; } static VALUE rg_set_icon(VALUE self, VALUE icon, VALUE pixmap, VALUE mask) { gdk_window_set_icon(_SELF(self), NIL_P(icon) ? NULL :_SELF(icon), NIL_P(pixmap) ? NULL : GDK_PIXMAP(RVAL2GOBJ(pixmap)), NIL_P(mask) ? NULL : GDK_BITMAP(RVAL2GOBJ(mask))); return self; } static VALUE rg_set_icon_name(VALUE self, VALUE name) { gdk_window_set_icon_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_set_transient_for(VALUE self, VALUE parent) { gdk_window_set_transient_for(_SELF(self), _SELF(parent)); return self; } static VALUE rg_set_role(VALUE self, VALUE role) { gdk_window_set_role(_SELF(self), RVAL2CSTR(role)); return self; } static VALUE rg_set_group(VALUE self, VALUE leader) { gdk_window_set_group(_SELF(self), _SELF(leader)); return self; } static VALUE rg_group(VALUE self) { return GOBJ2RVAL(gdk_window_get_group(_SELF(self))); } static VALUE rg_set_decorations(VALUE self, VALUE decor) { gdk_window_set_decorations(_SELF(self), RVAL2GFLAGS(decor, GDK_TYPE_WM_DECORATION)); return self; } static VALUE rg_decorations(VALUE self) { GdkWMDecoration decorations; gboolean ret = gdk_window_get_decorations(_SELF(self), &decorations); return ret ? GFLAGS2RVAL(decorations, GDK_TYPE_WM_DECORATION) : Qnil; } static VALUE rg_set_functions(VALUE self, VALUE func) { gdk_window_set_functions(_SELF(self), RVAL2GFLAGS(func, GDK_TYPE_WM_FUNCTION)); return self; } #if GTK_CHECK_VERSION(2, 12, 0) static VALUE rg_set_composited(VALUE self, VALUE composited) { gdk_window_set_composited(_SELF(self), RVAL2CBOOL(composited)); return self; } static VALUE rg_set_opacity(VALUE self, VALUE opacity) { gdk_window_set_opacity(_SELF(self), NUM2DBL(opacity)); return self; } static VALUE rg_set_startup_id(VALUE self, VALUE startup_id) { gdk_window_set_startup_id(_SELF(self), RVAL2CSTR_ACCEPT_NIL(startup_id)); return self; } #endif static VALUE rg_s_toplevels(G_GNUC_UNUSED VALUE self) { return GLIST2ARYF(gdk_window_get_toplevels()); } static VALUE rg_s_default_root_window(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_get_default_root_window()); } /* Would you need this? GdkPointerHooks* gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); */ /* From X Window System Interaction */ static VALUE rg_s_foreign_new(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE arg[2]; GdkWindow * win = NULL; rb_scan_args(argc, argv, "11", &arg[0], &arg[1]); switch(argc) { case 1: win = gdk_window_foreign_new(RVAL2GDKNATIVEWINDOW(arg[0])); break; case 2: win = gdk_window_foreign_new_for_display(RVAL2GOBJ(arg[0]), RVAL2GDKNATIVEWINDOW(arg[1])); break; default: break; } if (win == NULL) return Qnil; else { return GOBJ2RVAL(win); } } static VALUE rg_s_lookup(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE arg[2]; GdkWindow * win = NULL; rb_scan_args(argc, argv, "11", &arg[0], &arg[1]); switch(argc) { case 1: win = gdk_window_lookup(RVAL2GDKNATIVEWINDOW(arg[0])); break; case 2: win = gdk_window_lookup_for_display(RVAL2GOBJ(arg[0]), RVAL2GDKNATIVEWINDOW(arg[1])); break; default: break; } if (win == NULL) return Qnil; else { return GOBJ2RVAL(win); } } #ifdef GDK_WINDOWING_X11 static VALUE rg_server_time(VALUE self) { return UINT2NUM(gdk_x11_get_server_time(_SELF(self))); } static VALUE rg_set_user_time(VALUE self, VALUE time) { gdk_x11_window_set_user_time(_SELF(self), NUM2UINT(time)); return Qnil; } static VALUE rg_move_to_current_desktop(VALUE self) { gdk_x11_window_move_to_current_desktop(_SELF(self)); return self; } #endif void Init_gtk_gdk_window(VALUE mGdk) { GObjectClass *g_class; VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_WINDOW, "Window", mGdk); g_class = g_type_class_peek(GDK_TYPE_WINDOW); RG_DEF_METHOD(initialize, 3); RG_DEF_METHOD(destroy, 0); RG_DEF_METHOD(window_type, 0); RG_DEF_SMETHOD(at_pointer, 0); RG_DEF_SMETHOD(constrain_size, 4); RG_DEF_SMETHOD(process_all_updates, 0); RG_DEF_SMETHOD(set_debug_updates, 1); RG_DEF_METHOD(show, 0); RG_DEF_METHOD(show_unraised, 0); RG_DEF_METHOD(hide, 0); RG_DEF_METHOD_P(visible, 0); RG_DEF_METHOD_P(viewable, 0); RG_DEF_METHOD(withdraw, 0); RG_DEF_METHOD(state, 0); RG_DEF_METHOD(iconify, 0); RG_DEF_METHOD(deiconify, 0); RG_DEF_METHOD(stick, 0); RG_DEF_METHOD(unstick, 0); RG_DEF_METHOD(maximize, 0); RG_DEF_METHOD(unmaximize, 0); RG_DEF_METHOD(fullscreen, 0); RG_DEF_METHOD(unfullscreen, 0); RG_DEF_METHOD(set_keep_above, 1); RG_DEF_METHOD(set_keep_below, 1); RG_DEF_METHOD(move, 2); RG_DEF_METHOD(resize, 2); RG_DEF_METHOD(move_resize, 4); RG_DEF_METHOD(scroll, 2); RG_DEF_METHOD(move_region, 3); RG_DEF_METHOD(reparent, 3); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD(clear_area, -1); RG_DEF_METHOD(raise, 0); RG_DEF_METHOD(lower, 0); RG_DEF_METHOD(focus, 1); RG_DEF_METHOD(register_dnd, 0); #if GTK_CHECK_VERSION(2, 12, 0) RG_DEF_METHOD(beep, 0); #endif RG_DEF_METHOD(begin_resize_drag, 5); RG_DEF_METHOD(begin_move_drag, 4); RG_DEF_METHOD(begin_paint, 1); RG_DEF_METHOD(end_paint, 0); RG_DEF_METHOD(invalidate, 2); RG_DEF_METHOD(invalidate_maybe_recurse, 1); RG_DEF_METHOD(update_area, 0); RG_DEF_METHOD(freeze_updates, 0); RG_DEF_METHOD(thaw_updates, 0); RG_DEF_METHOD(process_updates, 1); RG_DEF_METHOD(internal_paint_info, 0); RG_DEF_METHOD(configure_finished, 0); RG_DEF_METHOD(enable_synchronized_configure, 0); RG_DEF_METHOD(set_user_data, 1); RG_DEF_METHOD(set_override_redirect, 1); RG_DEF_METHOD(set_accept_focus, 1); RG_DEF_METHOD(set_focus_on_map, 1); RG_DEF_METHOD(shape_combine_mask, 3); RG_DEF_METHOD(shape_combine_region, 3); RG_DEF_METHOD(set_child_shapes, 0); RG_DEF_METHOD(merge_child_shapes, 0); RG_DEF_METHOD(input_shape_combine_mask, 3); RG_DEF_METHOD(input_shape_combine_region, 3); RG_DEF_METHOD(set_child_input_shapes, 0); RG_DEF_METHOD(merge_child_input_shapes, 0); RG_DEF_METHOD(set_static_gravities, 1); RG_DEF_METHOD(set_title, 1); RG_DEF_METHOD(set_background, 1); RG_DEF_METHOD(set_back_pixmap, 2); RG_DEF_METHOD(set_cursor, 1); RG_DEF_METHOD(user_data, 0); RG_DEF_METHOD(geometry, 0); RG_DEF_METHOD(set_geometry_hints, 2); RG_DEF_METHOD(set_icon_list, 1); RG_DEF_METHOD(set_modal_hint, 1); RG_DEF_METHOD(set_type_hint, 1); RG_DEF_METHOD(type_hint, 0); RG_DEF_METHOD(set_skip_taskbar_hint, 1); RG_DEF_METHOD(set_skip_pager_hint, 1); RG_DEF_METHOD(set_urgency_hint, 1); RG_DEF_METHOD(position, 0); RG_DEF_METHOD(root_origin, 0); RG_DEF_METHOD(frame_extents, 0); RG_DEF_METHOD(origin, 0); RG_DEF_METHOD(pointer, 0); RG_DEF_METHOD(parent, 0); RG_DEF_METHOD(toplevel, 0); RG_DEF_SMETHOD(default_root_window, 0); RG_DEF_METHOD(children, 0); RG_DEF_METHOD(events, 0); RG_DEF_METHOD(set_events, 1); RG_DEF_METHOD(set_icon, 3); RG_DEF_METHOD(set_icon_name, 1); RG_DEF_METHOD(set_transient_for, 1); RG_DEF_METHOD(set_role, 1); RG_DEF_METHOD(set_group, 1); RG_DEF_METHOD(group, 0); RG_DEF_METHOD(set_decorations, 1); RG_DEF_METHOD(decorations, 0); RG_DEF_METHOD(set_functions, 1); #if GTK_CHECK_VERSION(2, 12, 0) RG_DEF_METHOD(set_composited, 1); RG_DEF_METHOD(set_opacity, 1); RG_DEF_METHOD(set_startup_id, 1); #endif RG_DEF_SMETHOD(toplevels, 0); RG_DEF_SMETHOD(foreign_new, -1); RG_DEF_SMETHOD(lookup, -1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GdkWindowType */ G_DEF_CLASS(GDK_TYPE_WINDOW_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_WINDOW_TYPE, "GDK_WINDOW_"); /* GdkWindowClass */ G_DEF_CLASS(GDK_TYPE_WINDOW_CLASS, "Class", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_WINDOW_CLASS, "GDK_"); /* GdkWindowHints */ G_DEF_CLASS(GDK_TYPE_WINDOW_HINTS, "Hints", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_WINDOW_HINTS, "GDK_"); /* GdkGravity */ G_DEF_CLASS(GDK_TYPE_GRAVITY, "Gravity", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_GRAVITY, "GDK_"); /* GdkWindowEdge */ G_DEF_CLASS(GDK_TYPE_WINDOW_EDGE, "Edge", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_WINDOW_EDGE, "GDK_WINDOW_"); /* GdkWindowTypeHint */ G_DEF_CLASS(GDK_TYPE_WINDOW_TYPE_HINT, "TypeHint", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_WINDOW_TYPE_HINT, "GDK_WINDOW_"); /* GdkWindowAttibutesType */ G_DEF_CLASS(GDK_TYPE_WINDOW_ATTRIBUTES_TYPE, "AttributesType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_WINDOW_ATTRIBUTES_TYPE, "GDK_"); /* GdkFilterReturn */ G_DEF_CLASS(GDK_TYPE_FILTER_RETURN, "FilterReturn", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_FILTER_RETURN, "GDK_"); /* GdkModifierType */ G_DEF_CLASS(GDK_TYPE_MODIFIER_TYPE, "ModifierType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_MODIFIER_TYPE, "GDK_"); /* GdkWMDecoration */ G_DEF_CLASS(GDK_TYPE_WM_DECORATION, "WMDecoration", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_WM_DECORATION, "GDK_"); /* GdkWMFunction */ G_DEF_CLASS(GDK_TYPE_WM_FUNCTION, "WMFunction", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_WM_FUNCTION, "GDK_"); rb_define_const(RG_TARGET_NAMESPACE, "PARENT_RELATIVE", INT2FIX(GDK_PARENT_RELATIVE)); #ifdef GDK_WINDOWING_X11 RG_DEF_METHOD(server_time, 0); RG_DEF_METHOD(set_user_time, 1); RG_DEF_METHOD(move_to_current_desktop, 0); G_DEF_CLASS3("GdkWindowImplX11", "WindowImplX11", mGdk); #elif defined(GDK_WINDOWING_WIN32) G_DEF_CLASS3("GdkWindowImplWin32", "WindowImplWin32", mGdk); #elif defined(GDK_WINDOWING_FB) G_DEF_CLASS3("GdkWindowFB", "WindowFB", mGdk); #endif } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkprogress.c�������������������������������������������������0000644�0001750�0001750�00000002232�11701304107�020155� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" void Init_gtk_progress(VALUE mGtk) { G_DEF_CLASS(GTK_TYPE_PROGRESS, "Progress", mGtk); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcalendar.c�������������������������������������������������0000644�0001750�0001750�00000010132�12257552167�020102� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCalendar #define _SELF(self) (GTK_CALENDAR(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_calendar_new()); return Qnil; } static VALUE rg_select_month(VALUE self, VALUE month, VALUE year) { gint ret = gtk_calendar_select_month(_SELF(self), NUM2INT(month)-1, NUM2INT(year)); return INT2FIX(ret); } static VALUE rg_select_day(VALUE self, VALUE day) { gtk_calendar_select_day(_SELF(self), NUM2INT(day)); return self; } static VALUE rg_mark_day(VALUE self, VALUE day) { gtk_calendar_mark_day(_SELF(self), NUM2INT(day)); return self; } static VALUE rg_unmark_day(VALUE self, VALUE day) { gtk_calendar_unmark_day(_SELF(self), NUM2INT(day)); return self; } static VALUE rg_clear_marks(VALUE self) { gtk_calendar_clear_marks(_SELF(self)); return self; } static VALUE rg_date(VALUE self) { VALUE ret; guint year, month, day; gtk_calendar_get_date(_SELF(self), &year, &month, &day); ret = rb_ary_new(); rb_ary_push(ret, INT2FIX(year)); rb_ary_push(ret, INT2FIX(month+1)); rb_ary_push(ret, INT2FIX(day)); return ret; } static VALUE rg_freeze(VALUE self) { gtk_calendar_freeze(_SELF(self)); return self; } static VALUE rg_thaw(VALUE self) { gtk_calendar_thaw(_SELF(self)); return self; } static VALUE rg_display_options(int argc, VALUE *argv, VALUE self) { VALUE flags; rb_scan_args(argc, argv, "01", &flags); if (NIL_P(flags)){ return GFLAGS2RVAL(gtk_calendar_get_display_options(_SELF(self)), GTK_TYPE_CALENDAR_DISPLAY_OPTIONS); } else { /* This is for backward compatibility. */ rb_warning("Gtk::Calendar#display_options(flags) has been deprecated. Use Gtk::Calendar#set_display_options(flags)."); gtk_calendar_display_options(_SELF(self), RVAL2GFLAGS(flags, GTK_TYPE_CALENDAR_DISPLAY_OPTIONS)); } return self; } static VALUE rg_set_display_options(VALUE self, VALUE flags) { gtk_calendar_set_display_options(_SELF(self), RVAL2GFLAGS(flags, GTK_TYPE_CALENDAR_DISPLAY_OPTIONS)); return self; } void Init_gtk_calendar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CALENDAR, "Calendar", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(select_month, 2); RG_DEF_METHOD(select_day, 1); RG_DEF_METHOD(mark_day, 1); RG_DEF_METHOD(unmark_day, 1); RG_DEF_METHOD(clear_marks, 0); RG_DEF_METHOD(date, 0); RG_DEF_METHOD(freeze, 0); RG_DEF_METHOD(thaw, 0); RG_DEF_METHOD(display_options, -1); RG_DEF_METHOD(set_display_options, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "display_options"); G_DEF_CLASS(GTK_TYPE_CALENDAR_DISPLAY_OPTIONS, "DisplayOptions", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_CALENDAR_DISPLAY_OPTIONS, "GTK_CALENDAR_"); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcolorsel.c�������������������������������������������������0000644�0001750�0001750�00000013117�12257552167�020161� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cColorSelection #define _SELF(s) (GTK_COLOR_SELECTION(RVAL2GOBJ(self))) static VALUE RG_TARGET_NAMESPACE; static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_color_selection_new()); return Qnil; } static VALUE rg_previous_alpha(VALUE self) { return INT2NUM(gtk_color_selection_get_previous_alpha(_SELF(self))); } static VALUE rg_set_previous_alpha(VALUE self, VALUE alpha) { gtk_color_selection_set_previous_alpha(_SELF(self), NUM2INT(alpha)); return self; } static VALUE rg_set_previous_color(VALUE self, VALUE color) { gtk_color_selection_set_previous_color(_SELF(self), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_previous_color(VALUE self) { GdkColor color; gtk_color_selection_get_previous_color(_SELF(self), &color); return GDKCOLOR2RVAL(&color); } static VALUE rg_adjusting_p(VALUE self) { return CBOOL2RVAL(gtk_color_selection_is_adjusting(_SELF(self))); } static VALUE rg_s_palette_from_string(G_GNUC_UNUSED VALUE self, VALUE str) { GdkColor* gcolors; gint i, n_colors; VALUE ary = Qnil; gboolean ret = gtk_color_selection_palette_from_string(RVAL2CSTR(str), &gcolors, &n_colors); if (ret) { ary = rb_ary_new(); for (i = 0; i < n_colors; i++) { rb_ary_push(ary, GDKCOLOR2RVAL(&gcolors[i])); } } return ary; } struct rbgdk_rval2gdkcolors_args { VALUE ary; long n; GdkColor *result; }; static VALUE rbgdk_rval2gdkcolors_body(VALUE value) { long i; struct rbgdk_rval2gdkcolors_args *args = (struct rbgdk_rval2gdkcolors_args *)value; for (i = 0; i < args->n; i++) args->result[i] = *RVAL2GDKCOLOR(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkcolors_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdkcolors_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GdkColor * rbgdk_rval2gdkcolors(VALUE value, long *n) { struct rbgdk_rval2gdkcolors_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GdkColor, args.n + 1); rb_rescue(rbgdk_rval2gdkcolors_body, (VALUE)&args, rbgdk_rval2gdkcolors_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } #define RVAL2GDKCOLORS(value, n) rbgdk_rval2gdkcolors(value, n) static VALUE rg_s_palette_to_string(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE rbcolors; long n; GdkColor *colors; gchar *palette; if (argc > 1) rb_scan_args(argc, argv, "*", &rbcolors); else rb_scan_args(argc, argv, "10", &rbcolors); colors = RVAL2GDKCOLORS(rbcolors, &n); palette = gtk_color_selection_palette_to_string(colors, n); g_free(colors); return CSTR2RVAL_FREE(palette); } static void screen_func(GdkScreen *screen, const GdkColor *colors, gint n_colors) { int i; VALUE func = rb_cvar_get(RG_TARGET_NAMESPACE, rb_intern("__palette_proc__")); VALUE ary = rb_ary_new(); for (i = 0; i < n_colors; i++){ ary = rb_ary_push(ary, GDKCOLOR2RVAL((GdkColor *)&colors[i])); } if (! NIL_P(func)) rb_funcall(func, id_call, 2, GOBJ2RVAL(screen), ary); } static VALUE rg_s_set_change_palette_hook(VALUE self) { VALUE func = rb_block_proc(); rb_cv_set(RG_TARGET_NAMESPACE, "__palette_proc__", func); gtk_color_selection_set_change_palette_with_screen_hook( (GtkColorSelectionChangePaletteWithScreenFunc)screen_func); return self; } /* Don't implement them. GtkColorSelectionChangePaletteFunc gtk_color_selection_set_change_palette_hook (GtkColorSelectionChangePaletteFunc func); void (*GtkColorSelectionChangePaletteWithScreenFunc) (GdkScreen *screen, const GdkColor *colors, gint n_colors); */ void Init_gtk_color_selection(VALUE mGtk) { RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_COLOR_SELECTION, "ColorSelection", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(previous_alpha, 0); RG_DEF_METHOD(set_previous_alpha, 1); RG_DEF_METHOD(set_previous_color, 1); RG_DEF_METHOD(previous_color, 0); RG_DEF_METHOD_P(adjusting, 0); RG_DEF_SMETHOD(palette_to_string, -1); RG_DEF_SMETHOD(palette_from_string, 1); RG_DEF_SMETHOD(set_change_palette_hook, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkscalebutton.c����������������������������������������������0000644�0001750�0001750�00000004151�11701304107�020636� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #if GTK_CHECK_VERSION(2,12,0) #define RG_TARGET_NAMESPACE cScaleButton #define _SELF(s) (GTK_SCALE_BUTTON(RVAL2GOBJ(s))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2, arg3, arg4, arg5; GtkWidget *widget; gdouble min = 0; gdouble max = 100; gdouble step = 2; rb_scan_args(argc, argv, "14", &arg1, &arg2, &arg3, &arg4, &arg5); if (!NIL_P(arg2)) min = NUM2DBL(arg2); if (!NIL_P(arg3)) max = NUM2DBL(arg3); if (!NIL_P(arg4)) step = NUM2DBL(arg4); widget = gtk_scale_button_new(RVAL2GENUM(arg1, GTK_TYPE_ICON_SIZE), min, max, step, NULL); RBGTK_INITIALIZE(self, widget); if (!NIL_P(arg5)) { const gchar **icons = RVAL2STRV(arg5); gtk_scale_button_set_icons(_SELF(self), icons); g_free(icons); } return Qnil; } #endif void Init_gtk_scalebutton(VALUE mGtk) { #if GTK_CHECK_VERSION(2,12,0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SCALE_BUTTON, "ScaleButton", mGtk); RG_DEF_METHOD(initialize, -1); #endif } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkwindowattr.c�����������������������������������������������0000644�0001750�0001750�00000013523�12124610262�020502� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" /*****************************************/ static GdkWindowAttr* attr_copy(const GdkWindowAttr* win) { GdkWindowAttr* new_win; g_return_val_if_fail (win != NULL, NULL); new_win = g_new(GdkWindowAttr, 1); *new_win = *win; return new_win; } GType gdk_windowattr_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkWindowAttr", (GBoxedCopyFunc)attr_copy, (GBoxedFreeFunc)g_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cWindowAttr #define _SELF(w) ((GdkWindowAttr*)RVAL2BOXED(w, GDK_TYPE_WINDOW_ATTR)) static VALUE rg_initialize(VALUE self, VALUE width, VALUE height, VALUE wclass, VALUE window_type) { GdkWindowAttr attribute; attribute.width = NUM2INT(width); attribute.height = NUM2INT(height); attribute.wclass = RVAL2GENUM(wclass, GDK_TYPE_WINDOW_CLASS); attribute.window_type = RVAL2GENUM(window_type, GDK_TYPE_WINDOW_TYPE); G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_WINDOW_ATTR, &attribute)); return Qnil; } #define ATTR_STR(name)\ static VALUE \ attr_get_ ## name (VALUE self)\ {\ return CSTR2RVAL(_SELF(self)->name);\ }\ static VALUE \ attr_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = (gchar *)RVAL2CSTR(val);\ return self;\ } #define ATTR_INT(name)\ static VALUE \ attr_get_ ## name (VALUE self)\ {\ return INT2NUM(_SELF(self)->name);\ }\ static VALUE \ attr_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = NUM2INT(val);\ return self;\ } ATTR_STR(title); ATTR_INT(event_mask); ATTR_INT(x); ATTR_INT(y); ATTR_INT(width); ATTR_INT(height); static VALUE rg_wclass(VALUE self) { return GENUM2RVAL(_SELF(self)->wclass, GDK_TYPE_WINDOW_CLASS); } static VALUE rg_set_wclass(VALUE self, VALUE val) { _SELF(self)->wclass = RVAL2GENUM(val, GDK_TYPE_WINDOW_CLASS); return self; } static VALUE rg_visual(VALUE self) { return GOBJ2RVAL(_SELF(self)->visual); } static VALUE rg_set_visual(VALUE self, VALUE val) { _SELF(self)->visual = GDK_VISUAL(RVAL2GOBJ(val)); return self; } static VALUE rg_colormap(VALUE self) { return GOBJ2RVAL(_SELF(self)->colormap); } static VALUE rg_set_colormap(VALUE self, VALUE val) { _SELF(self)->colormap = GDK_COLORMAP(RVAL2GOBJ(val)); return self; } static VALUE rg_window_type(VALUE self) { return GENUM2RVAL(_SELF(self)->window_type, GDK_TYPE_WINDOW_TYPE); } static VALUE rg_set_window_type(VALUE self, VALUE val) { _SELF(self)->window_type = RVAL2GENUM(val, GDK_TYPE_WINDOW_TYPE); return self; } static VALUE rg_cursor(VALUE self) { return BOXED2RVAL(_SELF(self)->cursor, GDK_TYPE_CURSOR); } static VALUE rg_set_cursor(VALUE self, VALUE val) { _SELF(self)->cursor = (GdkCursor*)(RVAL2BOXED(val, GDK_TYPE_CURSOR)); return self; } ATTR_STR(wmclass_name); ATTR_STR(wmclass_class); static VALUE rg_override_redirect(VALUE self) { return CBOOL2RVAL(_SELF(self)->override_redirect); } static VALUE rg_set_override_redirect(VALUE self, VALUE val) { _SELF(self)->override_redirect = RVAL2CBOOL(val); return self; } void Init_gtk_gdk_windowattr(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_WINDOW_ATTR, "WindowAttr", mGdk); RG_DEF_METHOD(initialize, 4); rb_define_method(RG_TARGET_NAMESPACE, "title", attr_get_title, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_title", attr_set_title, 1); rb_define_method(RG_TARGET_NAMESPACE, "event_mask", attr_get_event_mask, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_event_mask", attr_set_event_mask, 1); rb_define_method(RG_TARGET_NAMESPACE, "x", attr_get_x, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_x", attr_set_x, 1); rb_define_method(RG_TARGET_NAMESPACE, "y", attr_get_y, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_y", attr_set_y, 1); rb_define_method(RG_TARGET_NAMESPACE, "width", attr_get_width, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_width", attr_set_width, 1); rb_define_method(RG_TARGET_NAMESPACE, "height", attr_get_height, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_height", attr_set_height, 1); RG_DEF_METHOD(wclass, 0); RG_DEF_METHOD(set_wclass, 1); RG_DEF_METHOD(visual, 0); RG_DEF_METHOD(set_visual, 1); RG_DEF_METHOD(colormap, 0); RG_DEF_METHOD(set_colormap, 1); RG_DEF_METHOD(window_type, 0); RG_DEF_METHOD(set_window_type, 1); RG_DEF_METHOD(cursor, 0); RG_DEF_METHOD(set_cursor, 1); rb_define_method(RG_TARGET_NAMESPACE, "wmclass_name", attr_get_wmclass_name, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_wmclass_name", attr_set_wmclass_name, 1); rb_define_method(RG_TARGET_NAMESPACE, "wmclass_class", attr_get_wmclass_class, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_wmclass_class", attr_set_wmclass_class, 1); RG_DEF_METHOD(override_redirect, 0); RG_DEF_METHOD(set_override_redirect, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkscale.c����������������������������������������������������0000644�0001750�0001750�00000003116�12257552167�017424� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cScale #define _SELF(self) (GTK_SCALE(RVAL2GOBJ(self))) static VALUE rg_layout(VALUE self) { return GOBJ2RVAL(gtk_scale_get_layout(_SELF(self))); } static VALUE rg_layout_offsets(VALUE self) { gint x, y; gtk_scale_get_layout_offsets(_SELF(self), &x, &y); return rb_assoc_new(INT2NUM(x), INT2NUM(y)); } void Init_gtk_scale(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SCALE, "Scale", mGtk); RG_DEF_METHOD(layout, 0); RG_DEF_METHOD(layout_offsets, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkconst.c����������������������������������������������������0000644�0001750�0001750�00000014441�12257552167�017466� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" /* * constants */ void Init_gtk_const(VALUE mGtk) { /* * version information */ rb_define_const(mGtk, "BINDING_VERSION", rb_ary_new3(3, INT2FIX(RBGTK_MAJOR_VERSION), INT2FIX(RBGTK_MINOR_VERSION), INT2FIX(RBGTK_MICRO_VERSION))); rb_define_const(mGtk, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(GTK_MAJOR_VERSION), INT2FIX(GTK_MINOR_VERSION), INT2FIX(GTK_MICRO_VERSION))); rb_define_const(mGtk, "VERSION", rb_ary_new3(3, INT2FIX(gtk_major_version), INT2FIX(gtk_minor_version), INT2FIX(gtk_micro_version))); rb_define_const(mGtk, "MAJOR_VERSION", INT2FIX(gtk_major_version)); rb_define_const(mGtk, "MINOR_VERSION", INT2FIX(gtk_minor_version)); rb_define_const(mGtk, "MICRO_VERSION", INT2FIX(gtk_micro_version)); rb_define_const(mGtk, "BINARY_AGE", INT2FIX(gtk_binary_age)); rb_define_const(mGtk, "INTERFACE_AGE", INT2FIX(gtk_interface_age)); /* * standard enumeration */ /* GtkAccelFlags */ G_DEF_CLASS(GTK_TYPE_ACCEL_FLAGS, "AccelFlags", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_ACCEL_FLAGS, "GTK_"); /* GtkAnchorType */ G_DEF_CLASS(GTK_TYPE_ANCHOR_TYPE, "AnchorType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_ANCHOR_TYPE, "GTK_"); /* GtkAttachOptions */ G_DEF_CLASS(GTK_TYPE_ATTACH_OPTIONS, "AttachOptions", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_ATTACH_OPTIONS, "GTK_"); /* GtkCornerType */ G_DEF_CLASS(GTK_TYPE_CORNER_TYPE, "CornerType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_CORNER_TYPE, "GTK_"); /* GtkDeleteType */ G_DEF_CLASS(GTK_TYPE_DELETE_TYPE, "DeleteType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_DELETE_TYPE, "GTK_"); /* GtkDirectionType */ G_DEF_CLASS(GTK_TYPE_DIRECTION_TYPE, "DirectionType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_DIRECTION_TYPE, "GTK_"); /* GtkExpanderStyle */ G_DEF_CLASS(GTK_TYPE_EXPANDER_STYLE, "ExpanderStyle", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_EXPANDER_STYLE, "GTK_"); /* GtkJustification */ G_DEF_CLASS(GTK_TYPE_JUSTIFICATION, "Justification", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_JUSTIFICATION, "GTK_"); /* GtkMessageType */ G_DEF_CLASS(GTK_TYPE_MESSAGE_TYPE, "MessageType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_MESSAGE_TYPE, "GTK_MESSAGE_"); /* GtkMetricType */ G_DEF_CLASS(GTK_TYPE_METRIC_TYPE, "MetricType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_METRIC_TYPE, "GTK_"); /* GtkMovementStep */ G_DEF_CLASS(GTK_TYPE_MOVEMENT_STEP, "MovementStep", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_MOVEMENT_STEP, "GTK_"); /* GtkOrientation */ G_DEF_CLASS(GTK_TYPE_ORIENTATION, "Orientation", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_ORIENTATION, "GTK_"); /* GtkPackType */ G_DEF_CLASS(GTK_TYPE_PACK_TYPE, "PackType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_PACK_TYPE, "GTK_"); /* GtkPathPriorityType */ G_DEF_CLASS(GTK_TYPE_PATH_PRIORITY_TYPE, "PathPriorityType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_PATH_PRIORITY_TYPE, "GTK_"); /* GtkPathType */ G_DEF_CLASS(GTK_TYPE_PATH_TYPE, "PathType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_PATH_TYPE, "GTK_"); /* GtkPolicyType */ G_DEF_CLASS(GTK_TYPE_POLICY_TYPE, "PolicyType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_POLICY_TYPE, "GTK_"); /* GtkPositionType */ G_DEF_CLASS(GTK_TYPE_POSITION_TYPE, "PositionType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_POSITION_TYPE, "GTK_"); /* GtkReliefStyle */ G_DEF_CLASS(GTK_TYPE_RELIEF_STYLE, "ReliefStyle", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_RELIEF_STYLE, "GTK_"); /* GtkResizeMode */ G_DEF_CLASS(GTK_TYPE_RESIZE_MODE, "ResizeMode", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_RESIZE_MODE, "GTK_"); /* GtkResponseType */ G_DEF_CLASS(GTK_TYPE_RESPONSE_TYPE, "ResponseType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_RESPONSE_TYPE, "GTK_"); /* GtkScrollStep */ G_DEF_CLASS(GTK_TYPE_SCROLL_STEP, "ScrollStep", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_SCROLL_STEP, "GTK_"); /* GtkScrollType */ G_DEF_CLASS(GTK_TYPE_SCROLL_TYPE, "ScrollType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_SCROLL_TYPE, "GTK_"); /* GtkSelectionMode */ G_DEF_CLASS(GTK_TYPE_SELECTION_MODE, "SelectionMode", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_SELECTION_MODE, "GTK_"); /* GtkShadowType */ G_DEF_CLASS(GTK_TYPE_SHADOW_TYPE, "ShadowType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_SHADOW_TYPE, "GTK_"); /* GtkStateType */ G_DEF_CLASS(GTK_TYPE_STATE_TYPE, "StateType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_STATE_TYPE, "GTK_"); /* GtkSubmenuDirection */ G_DEF_CLASS(GTK_TYPE_SUBMENU_DIRECTION, "SubmenuDirection", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_SUBMENU_DIRECTION, "GTK_"); /* GtkSubmenuPlacement */ G_DEF_CLASS(GTK_TYPE_SUBMENU_PLACEMENT, "SubmenuPlacement", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_SUBMENU_PLACEMENT, "GTK_"); /* GtkUpdateType */ G_DEF_CLASS(GTK_TYPE_UPDATE_TYPE, "UpdateType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_UPDATE_TYPE, "GTK_"); /* GtkVisibility */ G_DEF_CLASS(GTK_TYPE_VISIBILITY, "Visibility", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_VISIBILITY, "GTK_"); /* GtkSortType */ G_DEF_CLASS(GTK_TYPE_SORT_TYPE, "SortType", mGtk); G_DEF_CONSTANTS(mGtk, GTK_TYPE_SORT_TYPE, "GTK_"); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktextappearance.c�������������������������������������������0000644�0001750�0001750�00000012353�11701304107�021322� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" /*****************************************/ static GtkTextAppearance* app_copy(const GtkTextAppearance* app) { GtkTextAppearance* new_app; g_return_val_if_fail (app != NULL, NULL); new_app = g_new(GtkTextAppearance, 1); *new_app = *app; return new_app; } GType gtk_text_appearance_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkTextAppearance", (GBoxedCopyFunc)app_copy, (GBoxedFreeFunc)g_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cTextAppearance #define _SELF(t) ((GtkTextAppearance*)RVAL2BOXED(t, GTK_TYPE_TEXT_APPEARANCE)) /***********************************************/ #define ATTR_INT(name)\ static VALUE \ txt_app_int_ ## name (VALUE self)\ {\ return INT2NUM(_SELF(self)->name);\ }\ static VALUE \ txt_app_int_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = NUM2INT(val); \ return self;\ } #define ATTR_BOOL(name)\ static VALUE \ txt_app_bool_ ## name (VALUE self)\ {\ return CBOOL2RVAL(_SELF(self)->name);\ }\ static VALUE \ txt_app_bool_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = RVAL2CBOOL(val);\ return self;\ } #define ATTR_ENUM(name, gtype)\ static VALUE \ txt_app_enums_ ## name (VALUE self)\ {\ return GENUM2RVAL(_SELF(self)->name, gtype);\ }\ static VALUE \ txt_app_enums_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = RVAL2GENUM(val, gtype);\ return self;\ } #define ATTR_GOBJ(name)\ static VALUE \ txt_app_gobj_ ## name (VALUE self)\ {\ VALUE val; \ if (_SELF(self)->name == NULL) return Qnil;\ val = GOBJ2RVAL(_SELF(self)->name); \ G_CHILD_SET(self, rb_intern(G_STRINGIFY(name)), val);\ return val; \ }\ static VALUE \ txt_app_gobj_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = RVAL2GOBJ(val);\ G_CHILD_SET(self, rb_intern(G_STRINGIFY(name)), val);\ return self;\ } #define ATTR_COLOR(name)\ static VALUE \ txt_app_color_ ## name (VALUE self)\ {\ VALUE val = BOXED2RVAL(&_SELF(self)->name, GDK_TYPE_COLOR);\ G_CHILD_SET(self, rb_intern(G_STRINGIFY(name)), val);\ return val;\ }\ static VALUE \ txt_app_color_set_ ## name (VALUE self, VALUE val)\ {\ G_CHILD_SET(self, rb_intern(G_STRINGIFY(name)), val);\ _SELF(self)->name = *RVAL2GDKCOLOR(val); \ return self;\ } #define DEFINE_ACCESSOR(gt, type, name) \ rb_define_method(gt, G_STRINGIFY(name), txt_app_ ## type ## _## name, 0);\ rb_define_method(gt, G_STRINGIFY(set_ ## name), txt_app_ ## type ## _set_## name, 1); /***********************************************/ ATTR_COLOR(bg_color); ATTR_COLOR(fg_color); ATTR_GOBJ(bg_stipple); ATTR_GOBJ(fg_stipple); ATTR_INT(rise); ATTR_ENUM(underline, PANGO_TYPE_UNDERLINE); ATTR_BOOL(strikethrough); ATTR_BOOL(draw_bg); ATTR_BOOL(inside_selection); ATTR_BOOL(is_text); static VALUE rg_initialize(VALUE self) { GtkTextAppearance* app = ALLOC(GtkTextAppearance); memset(app, 0, sizeof(GtkTextAppearance)); G_INITIALIZE(self, app); return Qnil; } void Init_gtk_text_appearance(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_APPEARANCE, "TextAppearance", mGtk); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, color, bg_color); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, color, fg_color); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, gobj, bg_stipple); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, gobj, fg_stipple); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, rise); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, enums, underline); RG_DEF_METHOD(initialize, 0); rb_define_method(RG_TARGET_NAMESPACE, "strikethrough?", txt_app_bool_strikethrough, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_strikethrough", txt_app_bool_set_strikethrough, 1); rb_define_method(RG_TARGET_NAMESPACE, "draw_bg?", txt_app_bool_draw_bg, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_draw_bg", txt_app_bool_set_draw_bg, 1); rb_define_method(RG_TARGET_NAMESPACE, "inside_selection?", txt_app_bool_inside_selection, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_inside_selection", txt_app_bool_set_inside_selection, 1); rb_define_method(RG_TARGET_NAMESPACE, "text?", txt_app_bool_is_text, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_text", txt_app_bool_set_is_text, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkscrolledwindow.c�������������������������������������������0000644�0001750�0001750�00000007153�12257552167�021401� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cScrolledWindow #define _SELF(self) (GTK_SCROLLED_WINDOW(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2; GtkAdjustment *h_adj = NULL; GtkAdjustment *v_adj = NULL; rb_scan_args(argc, argv, "02", &arg1, &arg2); if (!NIL_P(arg1)) h_adj = GTK_ADJUSTMENT(RVAL2GOBJ(arg1)); if (!NIL_P(arg2)) v_adj = GTK_ADJUSTMENT(RVAL2GOBJ(arg2)); RBGTK_INITIALIZE(self, gtk_scrolled_window_new(h_adj, v_adj)); return Qnil; } static VALUE rg_set_policy(VALUE self, VALUE hpolicy, VALUE vpolicy) { gtk_scrolled_window_set_policy(_SELF(self), RVAL2GENUM(hpolicy, GTK_TYPE_POLICY_TYPE), RVAL2GENUM(vpolicy, GTK_TYPE_POLICY_TYPE)); return self; } static VALUE rg_policy(VALUE self) { GtkPolicyType hpolicy, vpolicy; gtk_scrolled_window_get_policy(_SELF(self), &hpolicy, &vpolicy); return rb_ary_new3(2, GENUM2RVAL(hpolicy, GTK_TYPE_POLICY_TYPE), GENUM2RVAL(vpolicy, GTK_TYPE_POLICY_TYPE)); } static VALUE rg_add_with_viewport(VALUE self, VALUE other) { gtk_scrolled_window_add_with_viewport(_SELF(self), GTK_WIDGET(RVAL2GOBJ(other))); G_CHILD_ADD(self, other); return self; } static VALUE rg_hscrollbar(VALUE self) { return GOBJ2RVAL(gtk_scrolled_window_get_hscrollbar(_SELF(self))); } static VALUE rg_vscrollbar(VALUE self) { return GOBJ2RVAL(gtk_scrolled_window_get_vscrollbar(_SELF(self))); } static VALUE rg_set_placement(VALUE self, VALUE corner_type) { gtk_scrolled_window_set_placement(_SELF(self), RVAL2GENUM(corner_type, GTK_TYPE_CORNER_TYPE)); return self; } static VALUE rg_unset_placement(VALUE self) { gtk_scrolled_window_unset_placement(_SELF(self)); return self; } static VALUE rg_placement(VALUE self) { return GENUM2RVAL(gtk_scrolled_window_get_placement(_SELF(self)), GTK_TYPE_CORNER_TYPE); } void Init_gtk_scrolled_window(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SCROLLED_WINDOW, "ScrolledWindow", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_policy, 2); RG_DEF_METHOD(policy, 0); RG_DEF_METHOD(add_with_viewport, 1); RG_DEF_METHOD(hscrollbar, 0); RG_DEF_METHOD(vscrollbar, 0); RG_DEF_METHOD(unset_placement, 0); RG_DEF_METHOD(placement, 0); RG_DEF_METHOD(set_placement, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "placement"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreepath.c�������������������������������������������������0000644�0001750�0001750�00000011133�11701304107�020125� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTreePath #define _SELF(s) ((GtkTreePath*)RVAL2BOXED(s, GTK_TYPE_TREE_PATH)) static ID id_equal; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE path; GtkTreePath* widget; if (argc == 1) { path = argv[0]; if (TYPE(path) == T_STRING){ widget = gtk_tree_path_new_from_string(RVAL2CSTR(path)); } else { widget = gtk_tree_path_new(); gtk_tree_path_append_index(widget, NUM2INT(path)); } if (widget == NULL) rb_raise(rb_eArgError, "Invalid path %s was passed.", RVAL2CSTR(path)); } else { int i; widget = gtk_tree_path_new(); for (i = 0; i < argc; i++) gtk_tree_path_append_index(widget, NUM2INT(argv[i])); } G_INITIALIZE(self, widget); return Qnil; } static VALUE rg_to_str(VALUE self) { gchar* s = gtk_tree_path_to_string(_SELF(self)); VALUE result = CSTR2RVAL(s); g_free(s); return result; } /* Do we need this ? GtkTreePath* gtk_tree_path_new_first (void); Deprecated #define gtk_tree_path_new_root () */ static VALUE rg_append_index(VALUE self, VALUE index) { gtk_tree_path_append_index(_SELF(self), NUM2INT(index)); return self; } static VALUE rg_prepend_index(VALUE self, VALUE index) { gtk_tree_path_prepend_index(_SELF(self), NUM2INT(index)); return self; } static VALUE rg_depth(VALUE self) { return INT2NUM(gtk_tree_path_get_depth(_SELF(self))); } static VALUE rg_indices(VALUE self) { VALUE ary; gint i, length; gint* indices; length = gtk_tree_path_get_depth(_SELF(self)); indices = gtk_tree_path_get_indices(_SELF(self)); if (indices != NULL) { ary = rb_ary_new2(length); for (i = 0; i < length; i++) { rb_ary_push(ary, INT2NUM(indices[i])); } return ary; } else { return Qnil; } } static VALUE rg_operator_treepath_compare(VALUE self, VALUE other) { return INT2NUM(gtk_tree_path_compare(_SELF(self), _SELF(other))); } static VALUE rg_operator_treepath_equal(VALUE self, VALUE other) { if (!RVAL2CBOOL(rb_funcall(CLASS_OF(self), id_equal, 1, CLASS_OF(other)))) { return Qfalse; } return CBOOL2RVAL(gtk_tree_path_compare(_SELF(self), _SELF(other)) == 0); } static VALUE rg_next_bang(VALUE self) { gtk_tree_path_next(_SELF(self)); return self; } static VALUE rg_prev_bang(VALUE self) { return CBOOL2RVAL(gtk_tree_path_prev(_SELF(self))); } static VALUE rg_up_bang(VALUE self) { return CBOOL2RVAL(gtk_tree_path_up(_SELF(self))); } static VALUE rg_down_bang(VALUE self) { gtk_tree_path_down(_SELF(self)); return Qtrue; } static VALUE rg_ancestor_p(VALUE self, VALUE descendant) { return CBOOL2RVAL(gtk_tree_path_is_ancestor(_SELF(self), _SELF(descendant))); } static VALUE rg_descendant_p(VALUE self, VALUE ancestor) { return CBOOL2RVAL(gtk_tree_path_is_descendant(_SELF(self), _SELF(ancestor))); } void Init_gtk_treepath(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_PATH, "TreePath", mGtk); id_equal = rb_intern("=="); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(to_str, 0); RG_DEF_ALIAS("to_s", "to_str"); RG_DEF_METHOD(append_index, 1); RG_DEF_METHOD(prepend_index, 1); RG_DEF_METHOD(depth, 0); RG_DEF_METHOD(indices, 0); RG_DEF_METHOD_OPERATOR("<=>", treepath_compare, 1); RG_DEF_METHOD_OPERATOR("==", treepath_equal, 1); RG_DEF_METHOD_BANG(next, 0); RG_DEF_METHOD_BANG(prev, 0); RG_DEF_METHOD_BANG(up, 0); RG_DEF_METHOD_BANG(down, 0); RG_DEF_METHOD_P(ancestor, 1); RG_DEF_METHOD_P(descendant, 1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktoolitem.c�������������������������������������������������0000644�0001750�0001750�00000010542�12257552167�020172� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cToolItem #define _SELF(self) (GTK_TOOL_ITEM(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_tool_item_new()); return Qnil; } static VALUE rg_set_homogeneous(VALUE self, VALUE homogeneous) { gtk_tool_item_set_homogeneous(_SELF(self), RVAL2CBOOL(homogeneous)); return self; } static VALUE rg_homogeneous_p(VALUE self) { return CBOOL2RVAL(gtk_tool_item_get_homogeneous(_SELF(self))); } static VALUE rg_set_expand(VALUE self, VALUE expand) { gtk_tool_item_set_expand(_SELF(self), RVAL2CBOOL(expand)); return self; } static VALUE rg_expand_p(VALUE self) { return CBOOL2RVAL(gtk_tool_item_get_expand(_SELF(self))); } static VALUE rg_set_tooltip(int argc, VALUE *argv, VALUE self) { VALUE tooltip, tip_text, tip_private; rb_scan_args(argc, argv, "21", &tooltip, &tip_text, &tip_private); gtk_tool_item_set_tooltip(_SELF(self), GTK_TOOLTIPS(RVAL2GOBJ(tooltip)), RVAL2CSTR(tip_text), NIL_P(tip_private) ? NULL : RVAL2CSTR(tip_private)); return self; } static VALUE rg_set_use_drag_window(VALUE self, VALUE use_drag_window) { gtk_tool_item_set_use_drag_window(_SELF(self), RVAL2CBOOL(use_drag_window)); return self; } static VALUE rg_use_drag_window_p(VALUE self) { return CBOOL2RVAL(gtk_tool_item_get_use_drag_window(_SELF(self))); } static VALUE rg_icon_size(VALUE self) { return GENUM2RVAL(gtk_tool_item_get_icon_size(_SELF(self)), GTK_TYPE_ICON_SIZE); } static VALUE rg_orientation(VALUE self) { return GENUM2RVAL(gtk_tool_item_get_orientation(_SELF(self)), GTK_TYPE_ORIENTATION); } static VALUE rg_toolbar_style(VALUE self) { return GENUM2RVAL(gtk_tool_item_get_toolbar_style(_SELF(self)), GTK_TYPE_TOOLBAR_STYLE); } static VALUE rg_relief_style(VALUE self) { return GENUM2RVAL(gtk_tool_item_get_relief_style(_SELF(self)), GTK_TYPE_RELIEF_STYLE); } static VALUE rg_retrieve_proxy_menu_item(VALUE self) { return GOBJ2RVAL(gtk_tool_item_retrieve_proxy_menu_item(_SELF(self))); } static VALUE rg_get_proxy_menu_item(VALUE self, VALUE menu_item_id) { return GOBJ2RVAL(gtk_tool_item_get_proxy_menu_item(_SELF(self), RVAL2CSTR(menu_item_id))); } static VALUE rg_set_proxy_menu_item(VALUE self, VALUE menu_item_id, VALUE menu_item) { gtk_tool_item_set_proxy_menu_item(_SELF(self), RVAL2CSTR(menu_item_id), GTK_WIDGET(RVAL2GOBJ(menu_item))); return self; } static VALUE rg_rebuild_menu(VALUE self) { gtk_tool_item_rebuild_menu(_SELF(self)); return self; } void Init_gtk_toolitem(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOOL_ITEM, "ToolItem", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_homogeneous, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "homogenous"); RG_DEF_METHOD_P(homogeneous, 0); RG_DEF_METHOD(set_expand, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "expand"); RG_DEF_METHOD_P(expand, 0); RG_DEF_METHOD(set_tooltip, -1); RG_DEF_METHOD(set_use_drag_window, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "use_drag_window"); RG_DEF_METHOD_P(use_drag_window, 0); RG_DEF_METHOD(icon_size, 0); RG_DEF_METHOD(orientation, 0); RG_DEF_METHOD(toolbar_style, 0); RG_DEF_METHOD(relief_style, 0); RG_DEF_METHOD(retrieve_proxy_menu_item, 0); RG_DEF_METHOD(get_proxy_menu_item, 1); RG_DEF_METHOD(set_proxy_menu_item, 2); RG_DEF_METHOD(rebuild_menu, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcheckbutton.c����������������������������������������������0000644�0001750�0001750�00000004350�11701304107�020625� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCheckButton static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, use_underline; GtkWidget *widget; if (rb_scan_args(argc, argv, "02", &label, &use_underline) > 0) { if (TYPE(label) == T_STRING){ if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)){ widget = gtk_check_button_new_with_mnemonic(RVAL2CSTR(label)); } else { widget = gtk_check_button_new_with_label(RVAL2CSTR(label)); } } else if (TYPE(label) == T_SYMBOL){ widget = gtk_check_button_new_with_label(rb_id2name(SYM2ID(label))); gtk_button_set_use_stock(GTK_BUTTON(widget), TRUE); } else { rb_raise(rb_eArgError, "invalid argument %s (expect Symbol(Gtk::Stock constants) or String)", rb_class2name(CLASS_OF(label))); } } else { widget = gtk_check_button_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_check_button(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CHECK_BUTTON, "CheckButton", mGtk); RG_DEF_METHOD(initialize, -1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfilechooser.c����������������������������������������������0000644�0001750�0001750�00000020210�12257552167�020631� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005,2006 Ruby-GNOME2 Project Team * Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mFileChooser #define _SELF(self) GTK_FILE_CHOOSER(RVAL2GOBJ(self)) #ifdef HAVE_GTK_GTKFILESYSTEM_H /* For error handling */ # define GTK_FILE_SYSTEM_ENABLE_UNSUPPORTED # include <gtk/gtkfilesystem.h> #endif static VALUE gslist2ary_free(GSList* list) { GSList* l; VALUE ary = rb_ary_new(); for (l = list; l != NULL; l = g_slist_next(l)) { rb_ary_push(ary, CSTR2RVAL_FREE(l->data)); } g_slist_free(list); return ary; } static VALUE rg_set_current_name(VALUE self, VALUE name) { /* doc says the awaited string is UTF-8, so use RVAL2CSTR */ gtk_file_chooser_set_current_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_filename(VALUE self) { return CSTRFILENAME2RVAL_FREE(gtk_file_chooser_get_filename(_SELF(self))); } static VALUE rg_set_filename(VALUE self, VALUE rbfilename) { gchar *filename = RVAL2CSTRFILENAME(rbfilename); gboolean ret = gtk_file_chooser_set_filename(_SELF(self), filename); g_free(filename); if (!ret) rb_raise(rb_eRuntimeError, "Can't set filename"); return self; } static VALUE rg_select_filename(VALUE self, VALUE rbfilename) { gchar *filename = RVAL2CSTRFILENAME(rbfilename); gboolean ret = gtk_file_chooser_select_filename(_SELF(self), filename); g_free(filename); return CBOOL2RVAL(ret); } static VALUE rg_unselect_filename(VALUE self, VALUE rbfilename) { gchar *filename = RVAL2CSTRFILENAME(rbfilename); gtk_file_chooser_unselect_filename(_SELF(self), filename); g_free(filename); return self; } static VALUE rg_select_all(VALUE self) { gtk_file_chooser_select_all(_SELF(self)); return self; } static VALUE rg_unselect_all(VALUE self) { gtk_file_chooser_unselect_all(_SELF(self)); return self; } static VALUE rg_filenames(VALUE self) { return CSTRFILENAMEARRAY2RVAL_FREE(gtk_file_chooser_get_filenames(_SELF(self))); } static VALUE rg_set_current_folder(VALUE self, VALUE filename) { gboolean ret = gtk_file_chooser_set_current_folder(_SELF(self), RVAL2CSTR(filename)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set current folder"); return self; } static VALUE rg_current_folder(VALUE self) { return CSTR2RVAL_FREE(gtk_file_chooser_get_current_folder(_SELF(self))); } static VALUE rg_uri(VALUE self) { return CSTR2RVAL_FREE(gtk_file_chooser_get_uri(_SELF(self))); } static VALUE rg_set_uri(VALUE self, VALUE uri) { gboolean ret = gtk_file_chooser_set_uri(_SELF(self), RVAL2CSTR(uri)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set uri"); return self; } static VALUE rg_select_uri(VALUE self, VALUE uri) { return CBOOL2RVAL(gtk_file_chooser_select_uri(_SELF(self), RVAL2CSTR(uri))); } static VALUE rg_unselect_uri(VALUE self, VALUE uri) { gtk_file_chooser_unselect_uri(_SELF(self), RVAL2CSTR(uri)); return self; } static VALUE rg_uris(VALUE self) { return gslist2ary_free(gtk_file_chooser_get_uris(_SELF(self))); } static VALUE rg_set_current_folder_uri(VALUE self, VALUE uri) { gboolean ret = gtk_file_chooser_set_current_folder_uri(_SELF(self), RVAL2CSTR(uri)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set current folder uri"); return self; } static VALUE rg_current_folder_uri(VALUE self) { return CSTR2RVAL_FREE(gtk_file_chooser_get_current_folder_uri(_SELF(self))); } static VALUE rg_preview_filename(VALUE self) { return CSTR2RVAL_FREE(gtk_file_chooser_get_preview_filename(_SELF(self))); } static VALUE rg_preview_uri(VALUE self) { return CSTR2RVAL_FREE(gtk_file_chooser_get_preview_uri(_SELF(self))); } static VALUE rg_add_filter(VALUE self, VALUE filter) { gtk_file_chooser_add_filter(_SELF(self), GTK_FILE_FILTER(RVAL2GOBJ(filter))); return self; } static VALUE rg_remove_filter(VALUE self, VALUE filter) { gtk_file_chooser_remove_filter(_SELF(self), GTK_FILE_FILTER(RVAL2GOBJ(filter))); return self; } static VALUE rg_filters(VALUE self) { return GSLIST2ARYF(gtk_file_chooser_list_filters(_SELF(self))); } static VALUE rg_add_shortcut_folder(VALUE self, VALUE rbfolder) { gchar *folder = RVAL2CSTRFILENAME(rbfolder); GError *error = NULL; gboolean ret = gtk_file_chooser_add_shortcut_folder(_SELF(self), folder, &error); g_free(folder); if (!ret) RAISE_GERROR(error); return self; } static VALUE rg_remove_shortcut_folder(VALUE self, VALUE rbfolder) { gchar *folder = RVAL2CSTRFILENAME(rbfolder); GError *error = NULL; gboolean ret = gtk_file_chooser_remove_shortcut_folder(_SELF(self), folder, &error); g_free(folder); if (!ret) RAISE_GERROR(error); return self; } static VALUE rg_shortcut_folders(VALUE self) { return CSTRFILENAMEARRAY2RVAL_FREE(gtk_file_chooser_list_shortcut_folders(_SELF(self))); } static VALUE rg_add_shortcut_folder_uri(VALUE self, VALUE uri) { GError *error = NULL; if (! gtk_file_chooser_add_shortcut_folder_uri(_SELF(self), RVAL2CSTR(uri), &error)) RAISE_GERROR(error); return self; } static VALUE rg_remove_shortcut_folder_uri(VALUE self, VALUE uri) { GError *error = NULL; if (! gtk_file_chooser_remove_shortcut_folder_uri(_SELF(self), RVAL2CSTR(uri), &error)) RAISE_GERROR(error); return self; } static VALUE rg_shortcut_folder_uris(VALUE self) { return gslist2ary_free(gtk_file_chooser_list_shortcut_folder_uris(_SELF(self))); } void Init_gtk_file_chooser(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_FILE_CHOOSER, "FileChooser", mGtk); RG_DEF_METHOD(set_current_name, 1); RG_DEF_METHOD(set_filename, 1); RG_DEF_METHOD(filename, 0); RG_DEF_METHOD(select_filename, 1); RG_DEF_METHOD(unselect_filename, 1); RG_DEF_METHOD(select_all, 0); RG_DEF_METHOD(unselect_all, 0); RG_DEF_METHOD(filenames, 0); RG_DEF_METHOD(set_current_folder, 1); RG_DEF_METHOD(current_folder, 0); RG_DEF_METHOD(set_uri, 1); RG_DEF_METHOD(uri, 0); RG_DEF_METHOD(select_uri, 1); RG_DEF_METHOD(unselect_uri, 1); RG_DEF_METHOD(uris, 0); RG_DEF_METHOD(set_current_folder_uri, 1); RG_DEF_METHOD(current_folder_uri, 0); RG_DEF_METHOD(preview_filename, 0); RG_DEF_METHOD(preview_uri, 0); RG_DEF_METHOD(add_filter, 1); RG_DEF_METHOD(remove_filter, 1); RG_DEF_METHOD(filters, 0); RG_DEF_METHOD(add_shortcut_folder, 1); RG_DEF_METHOD(remove_shortcut_folder, 1); RG_DEF_METHOD(shortcut_folders, 0); RG_DEF_METHOD(add_shortcut_folder_uri, 1); RG_DEF_METHOD(remove_shortcut_folder_uri, 1); RG_DEF_METHOD(shortcut_folder_uris, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkFileChooserAction */ G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_ACTION, "Action", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_FILE_CHOOSER_ACTION, "GTK_FILE_CHOOSER_"); /* GtkFileChooserError */ G_DEF_ERROR(GTK_FILE_CHOOSER_ERROR, "FileChooserError", mGtk, rb_eRuntimeError, GTK_TYPE_FILE_CHOOSER_ERROR); /* GtkFileChooserConfirmation */ G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_CONFIRMATION, "Confirmation", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_FILE_CHOOSER_CONFIRMATION, "GTK_FILE_CHOOSER_"); G_DEF_CLASS3("GtkFileChooserEmbed", "FileChooserEmbed", mGtk); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkatom.c�����������������������������������������������������0000644�0001750�0001750�00000006415�12124610262�017242� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #include "rbgdk.h" #define RG_TARGET_NAMESPACE cAtom #define _SELF(a) (((GdkAtomData*)RVAL2BOXED(a, GDK_TYPE_ATOM))->atom) /*****************************************/ static GdkAtomData * gdk_atom_copy(const GdkAtom atom) { GdkAtomData* data; data = g_new(GdkAtomData, 1); data->atom = atom; return data; } GType gdk_atom_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkAtomData", (GBoxedCopyFunc)gdk_atom_copy, (GBoxedFreeFunc)g_free); return our_type; } GdkAtom get_gdkatom(VALUE atom) { if (TYPE(atom) == T_STRING) return gdk_atom_intern(RVAL2CSTR(atom), FALSE); return ((GdkAtomData*)RVAL2BOXED(atom, GDK_TYPE_ATOM))->atom; } /*****************************************/ static VALUE rg_s_intern(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE name; VALUE exist; rb_scan_args(argc, argv, "11", &name, &exist); return BOXED2RVAL(gdk_atom_intern(RVAL2CSTR(name), RVAL2CBOOL(exist)), GDK_TYPE_ATOM); } /* We don't need them. GdkAtom gdk_atom_intern_static_string(const gchar *atom_name); */ static VALUE rg_initialize(VALUE self, VALUE num) { guint atom = FIX2INT(num); if (atom == 0) { /* This is a trick for passing 0(NULL) */ G_INITIALIZE(self, GUINT_TO_POINTER(1)); _SELF(self) = GUINT_TO_POINTER(GDK_NONE); } else { G_INITIALIZE(self, GUINT_TO_POINTER(atom)); } return Qnil; } static VALUE rg_name(VALUE self) { return CSTR2RVAL_FREE(gdk_atom_name(_SELF(self))); } static VALUE rg_to_i(VALUE self) { return UINT2NUM(GPOINTER_TO_UINT(_SELF(self))); } static VALUE rg_operator_equal(VALUE self, VALUE other) { return CBOOL2RVAL(_SELF(self) == _SELF(other)); } void Init_gtk_gdk_atom(VALUE mGdk) { VALUE none; VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_ATOM, "Atom", mGdk); RG_DEF_SMETHOD(intern, -1); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(to_i, 0); RG_DEF_METHOD_OPERATOR("==", equal, 1); /* This is a trick to define GDK_NONE as a BOXED object */ none = BOXED2RVAL((gpointer)1, GDK_TYPE_ATOM); rb_define_const(RG_TARGET_NAMESPACE, "NONE", none); _SELF(none) = GDK_NONE; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkvbox.c�����������������������������������������������������0000644�0001750�0001750�00000003041�11701304107�017266� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cVBox static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE homogeneous, spacing; rb_scan_args(argc, argv, "02", &homogeneous, &spacing); RBGTK_INITIALIZE(self, gtk_vbox_new(RVAL2CBOOL(homogeneous), (NIL_P(spacing)?0:NUM2INT(spacing)))); return Qnil; } void Init_gtk_vbox(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VBOX, "VBox", mGtk); RG_DEF_METHOD(initialize, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkinfobar.c��������������������������������������������������0000664�0001750�0001750�00000010324�11740310343�017736� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #if GTK_CHECK_VERSION(2,18,0) #define RG_TARGET_NAMESPACE cInfoBar #define _SELF(self) (GTK_INFO_BAR(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { if (argc == 0){ RBGTK_INITIALIZE(self, gtk_info_bar_new ()); } else if (argc > 0){ //TODO gtk_info_bar_new_with_buttons rb_raise(rb_eArgError, "method does not yet supported adding buttons"); } else { rb_raise(rb_eArgError, "invalid argument number"); } return Qnil; } static VALUE rg_get_action_area(VALUE self) { return GOBJ2RVAL(gtk_info_bar_get_action_area(_SELF(self))); } static VALUE rg_get_content_area(VALUE self) { return GOBJ2RVAL(gtk_info_bar_get_content_area(_SELF(self))); } static VALUE rg_get_message_type(VALUE self) { return GENUM2RVAL(gtk_info_bar_get_message_type(_SELF(self)), GTK_TYPE_MESSAGE_TYPE); } static VALUE rg_set_message_type(VALUE self, VALUE type) { gtk_info_bar_set_message_type(_SELF(self), RVAL2GENUM(type, GTK_TYPE_MESSAGE_TYPE)); return self; } static VALUE rg_set_default_response(VALUE self, VALUE response_id) { gtk_info_bar_set_default_response(_SELF(self), RVAL2GENUM(response_id, GTK_TYPE_RESPONSE_TYPE)); return self; } static VALUE rg_add_action_widget(VALUE self, VALUE widget, VALUE response_id) { gtk_info_bar_add_action_widget(_SELF(self), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2GENUM(response_id, GTK_TYPE_RESPONSE_TYPE)); return self; } static VALUE rg_add_button(VALUE self, VALUE button_text, VALUE response_id) { const gchar *name; if (SYMBOL_P(button_text)) { name = rb_id2name(SYM2ID(button_text)); } else { name = RVAL2CSTR(button_text); } return GOBJ2RVAL(gtk_info_bar_add_button(_SELF(self), name, RVAL2GENUM(response_id, GTK_TYPE_RESPONSE_TYPE))); } /* static VALUE rg_add_buttons(int argc, VALUE *argv, VALUE self) { } */ static VALUE rg_set_response_sensitive(VALUE self, VALUE response_id, VALUE sensitive) { gtk_info_bar_set_response_sensitive(_SELF(self), RVAL2GENUM(response_id, GTK_TYPE_RESPONSE_TYPE), RVAL2CBOOL(sensitive)); return self; } static VALUE rg_response(VALUE self, VALUE response_id) { gtk_info_bar_response(_SELF(self), RVAL2GENUM(response_id, GTK_TYPE_RESPONSE_TYPE)); return self; } #endif void Init_gtk_infobar(VALUE mGtk) { #if GTK_CHECK_VERSION(2,18,0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_INFO_BAR, "InfoBar", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(get_action_area, 0); RG_DEF_ALIAS("action_area", "get_action_area"); RG_DEF_METHOD(get_content_area, 0); RG_DEF_ALIAS("content_area", "get_content_area"); RG_DEF_METHOD(get_message_type, 0); RG_DEF_ALIAS("message_type", "get_message_type"); RG_DEF_METHOD(set_message_type, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "message_type"); RG_DEF_METHOD(set_default_response, 1); RG_DEF_METHOD(add_action_widget, 2); RG_DEF_METHOD(add_button, 2); /* RG_DEF_METHOD(add_buttons, -1); */ RG_DEF_METHOD(set_response_sensitive, 2); RG_DEF_METHOD(response, 1); #endif } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkcolor.c����������������������������������������������������0000644�0001750�0001750�00000006535�12124610262�017423� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE rb_cGdkColor #define _SELF(c) (RVAL2GDKCOLOR(c)) VALUE RG_TARGET_NAMESPACE = Qnil; static VALUE rg_initialize(VALUE self, VALUE red, VALUE green, VALUE blue) { GdkColor color; color.pixel = 0; color.red = NUM2INT(red); color.green = NUM2INT(green); color.blue = NUM2INT(blue); G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_COLOR, &color)); return Qnil; } static VALUE rg_s_parse(G_GNUC_UNUSED VALUE self, VALUE name) { GdkColor c; if (! gdk_color_parse(RVAL2CSTR(name), &c)) { rb_raise(rb_eArgError, "can't parse color name `%s'", RVAL2CSTR(name)); } return BOXED2RVAL(&c, GDK_TYPE_COLOR); } static VALUE rg_pixel(VALUE self) { return INT2NUM(_SELF(self)->pixel); } static VALUE rg_red(VALUE self) { return INT2FIX(_SELF(self)->red); } static VALUE rg_set_red(VALUE self, VALUE red) { _SELF(self)->red = NUM2INT(red); return self; } static VALUE rg_green(VALUE self) { return INT2FIX(_SELF(self)->green); } static VALUE rg_set_green(VALUE self, VALUE green) { _SELF(self)->green = NUM2INT(green); return self; } static VALUE rg_blue(VALUE self) { return INT2FIX(_SELF(self)->blue); } static VALUE rg_set_blue(VALUE self, VALUE blue) { _SELF(self)->blue = NUM2INT(blue); return self; } static VALUE rg_to_a(VALUE self) { GdkColor *c = _SELF(self); return rb_ary_new3(3, INT2FIX(c->red), INT2FIX(c->green), INT2FIX(c->blue)); } static VALUE rg_operator_gdkcolor_equal(VALUE self, VALUE other) { return CBOOL2RVAL(gdk_color_equal(_SELF(self), _SELF(other))); } #if GTK_CHECK_VERSION(2, 12, 0) static VALUE rg_to_s(VALUE self) { return CSTR2RVAL_FREE(gdk_color_to_string(_SELF(self))); } #endif void Init_gtk_gdk_color(VALUE mGdk) { RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_COLOR, "Color", mGdk); RG_DEF_SMETHOD(parse, 1); RG_DEF_METHOD(initialize, 3); RG_DEF_METHOD(pixel, 0); RG_DEF_METHOD(red, 0); RG_DEF_METHOD(set_red, 1); RG_DEF_METHOD(green, 0); RG_DEF_METHOD(set_green, 1); RG_DEF_METHOD(blue, 0); RG_DEF_METHOD(set_blue, 1); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD_OPERATOR("==", gdkcolor_equal, 1); #if GTK_CHECK_VERSION(2, 12, 0) RG_DEF_METHOD(to_s, 0); #endif G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreemodel.c������������������������������������������������0000644�0001750�0001750�00000017710�12102213526�020300� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mTreeModel #define _SELF(s) (GTK_TREE_MODEL(RVAL2GOBJ(s))) static VALUE rg_flags(VALUE self) { return GFLAGS2RVAL(gtk_tree_model_get_flags(_SELF(self)), GTK_TYPE_TREE_MODEL_FLAGS); } static VALUE rg_n_columns(VALUE self) { return INT2NUM(gtk_tree_model_get_n_columns(_SELF(self))); } static VALUE rg_get_column_type(VALUE self, VALUE index) { return GTYPE2CLASS(gtk_tree_model_get_column_type(_SELF(self), NUM2INT(index))); } static VALUE rg_iter_first(VALUE self) { VALUE val = Qnil; GtkTreeIter iter; GtkTreeModel* model = _SELF(self); gboolean ret = (gtk_tree_model_get_iter_first(model, &iter)); iter.user_data3 = model; if (ret) { val = GTKTREEITER2RVAL(&iter); } return val; } static VALUE rg_iter_root(VALUE self) { VALUE val = Qnil; GtkTreeIter iter; GtkTreeModel* model = _SELF(self); gboolean ret = (gtk_tree_model_get_iter_root(model, &iter)); iter.user_data3 = model; if (ret) { val = GTKTREEITER2RVAL(&iter); } return val; } static VALUE rg_iter_next(VALUE self, VALUE iter) { VALUE val = Qnil; gboolean ret = (gtk_tree_model_iter_next(_SELF(self), RVAL2GTKTREEITER(iter))); if (ret) { val = GTKTREEITER2RVAL(&iter); } return val; } static VALUE rg_get_iter(VALUE self, VALUE path) { VALUE val = Qnil; GtkTreeIter iter; gboolean ret; GtkTreeModel* model = _SELF(self); if (TYPE(path) == T_STRING){ ret = gtk_tree_model_get_iter_from_string(model, &iter, RVAL2CSTR(path)); } else { ret = gtk_tree_model_get_iter(model, &iter, RVAL2GTKTREEPATH(path)); } iter.user_data3 = model; if (ret) { val = GTKTREEITER2RVAL(&iter); } return val; } static VALUE rg_get_value(VALUE self, VALUE iter, VALUE column) { GValue value = G_VALUE_INIT; VALUE ret = Qnil; gtk_tree_model_get_value(_SELF(self), RVAL2GTKTREEITER(iter), NUM2INT(column), &value); if (G_VALUE_TYPE(&value) != G_TYPE_INVALID){ ret = GVAL2RVAL(&value); g_value_unset(&value); } return ret; } /* These methods may be neededless. void gtk_tree_model_ref_node (GtkTreeModel *tree_model, GtkTreeIter *iter); void gtk_tree_model_unref_node (GtkTreeModel *tree_model, GtkTreeIter *iter); */ /* XXXX void gtk_tree_model_get_valist (GtkTreeModel *tree_model, GtkTreeIter *iter, va_list var_args); */ static gboolean treemodel_foreach_func(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, G_GNUC_UNUSED gpointer func) { iter->user_data3 = model; rb_yield(rb_ary_new3(3, GOBJ2RVAL(model), GTKTREEPATH2RVAL(path), GTKTREEITER2RVAL(iter))); return FALSE; } static VALUE rg_each(VALUE self) { gtk_tree_model_foreach(_SELF(self), (GtkTreeModelForeachFunc)treemodel_foreach_func, (gpointer)NULL); return self; } static VALUE rg_row_changed(VALUE self, VALUE path, VALUE iter) { gtk_tree_model_row_changed(_SELF(self), RVAL2GTKTREEPATH(path), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_row_inserted(VALUE self, VALUE path, VALUE iter) { gtk_tree_model_row_inserted(_SELF(self), RVAL2GTKTREEPATH(path), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_row_has_child_toggled(VALUE self, VALUE path, VALUE iter) { gtk_tree_model_row_has_child_toggled(_SELF(self), RVAL2GTKTREEPATH(path), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_row_deleted(VALUE self, VALUE path) { gtk_tree_model_row_deleted(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_rows_reordered(VALUE self, VALUE rbpath, VALUE rbiter, VALUE rbnew_order) { GtkTreeModel *proxy = _SELF(self); GtkTreePath *path = RVAL2GTKTREEPATH(rbpath); GtkTreeIter *iter = RVAL2GTKTREEITER(rbiter); gint columns = gtk_tree_model_get_n_columns(proxy); long n; gint *new_order = RVAL2GINTS(rbnew_order, n); if (n != columns) { g_free(new_order); rb_raise(rb_eArgError, "new order array must contain same number of elements as the number of columns in the store: %ld != %d", n, columns); } gtk_tree_model_rows_reordered(proxy, path, iter, new_order); g_free(new_order); return self; } static VALUE rg_iter_is_valid_p(G_GNUC_UNUSED VALUE self, G_GNUC_UNUSED VALUE iter) { return Qtrue; } static VALUE signal_func(G_GNUC_UNUSED guint num, const GValue *values) { GtkTreeModel* model = g_value_get_object(&values[0]); GtkTreePath* path = g_value_get_boxed(&values[1]); GtkTreeIter* iter = g_value_get_boxed(&values[2]); iter->user_data3 = model; return rb_ary_new3(3, GOBJ2RVAL(model), GTKTREEPATH2RVAL(path), GTKTREEITER2RVAL(iter)); } static VALUE signal_rows_reordered_func(G_GNUC_UNUSED guint num, const GValue *values) { GtkTreeModel* model = g_value_get_object(&values[0]); GtkTreePath* path = g_value_get_boxed(&values[1]); GtkTreeIter* iter = g_value_get_boxed(&values[2]); gint* new_orders = (gint*)g_value_get_pointer(&values[3]); gint len = gtk_tree_model_iter_n_children(model, iter); VALUE orders = Qnil; int i; iter->user_data3 = model; orders = rb_ary_new2(len); for (i = 0; i < len; i++, new_orders++) { rb_ary_push(orders, INT2NUM(*new_orders)); } return rb_ary_new3(4, GOBJ2RVAL(model), GTKTREEPATH2RVAL(path), GTKTREEITER2RVAL(iter), orders); } void Init_gtk_treemodel(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_TREE_MODEL, "TreeModel", mGtk); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(n_columns, 0); RG_DEF_METHOD(get_column_type, 1); RG_DEF_METHOD(iter_first, 0); RG_DEF_METHOD(iter_root, 0); RG_DEF_METHOD(iter_next, 1); RG_DEF_METHOD(get_iter, 1); RG_DEF_METHOD(get_value, 2); RG_DEF_METHOD(each, 0); RG_DEF_METHOD(row_changed, 2); RG_DEF_METHOD(row_inserted, 2); RG_DEF_METHOD(row_has_child_toggled, 2); RG_DEF_METHOD(row_deleted, 1); RG_DEF_METHOD(rows_reordered, 3); RG_DEF_METHOD_P(iter_is_valid, 1); /* GtkTreeModelFlags */ G_DEF_CLASS(GTK_TYPE_TREE_MODEL_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TREE_MODEL_FLAGS, "GTK_TREE_MODEL_"); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row_changed", (GValToRValSignalFunc)signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row_inserted", (GValToRValSignalFunc)signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row_has_child_toggled", (GValToRValSignalFunc)signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "rows_reordered", (GValToRValSignalFunc)signal_rows_reordered_func); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ��������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcurve.c����������������������������������������������������0000644�0001750�0001750�00000006077�11701304107�017450� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCurve static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_curve_new()); return Qnil; } static VALUE rg_reset(VALUE self) { gtk_curve_reset(GTK_CURVE(RVAL2GOBJ(self))); return self; } static VALUE rg_set_gamma(VALUE self, VALUE gamma) { gtk_curve_set_gamma(GTK_CURVE(RVAL2GOBJ(self)), NUM2DBL(gamma)); return self; } static VALUE rg_set_range(VALUE self, VALUE min_x, VALUE max_x, VALUE min_y, VALUE max_y) { gtk_curve_set_range(GTK_CURVE(RVAL2GOBJ(self)), NUM2DBL(min_x), NUM2DBL(max_x), NUM2DBL(min_y), NUM2DBL(max_y)); return self; } static VALUE rg_set_vector(VALUE self, VALUE length, VALUE vector) { gint len = NUM2INT(length); gfloat *c_vec; gint i; c_vec = ALLOCA_N(gfloat, len); for (i = 0; i < len; i++) c_vec[i] = NUM2DBL(RARRAY_PTR(vector)[i]); gtk_curve_set_vector(GTK_CURVE(RVAL2GOBJ(self)), len, c_vec); return self; } static VALUE rg_get_vector(VALUE self, VALUE length) { gint len = NUM2INT(length); gfloat *c_vec; gint i; VALUE vector = rb_ary_new2(len); c_vec = ALLOCA_N(gfloat, len); gtk_curve_get_vector(GTK_CURVE(RVAL2GOBJ(self)), len, c_vec); for (i = 0; i < len; i++) rb_ary_push(vector, rb_float_new(c_vec[i])); return vector; } void Init_gtk_curve(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CURVE, "Curve", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(reset, 0); RG_DEF_METHOD(set_gamma, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "gamma"); RG_DEF_METHOD(set_range, 4); RG_DEF_METHOD(set_vector, 2); G_DEF_SETTER(RG_TARGET_NAMESPACE, "vector"); /* NOTE: For backwards compatability. */ RG_DEF_METHOD(get_vector, 1); RG_DEF_ALIAS("vector", "get_vector"); /* GtkCurveType(from standard constants) */ G_DEF_CLASS(GTK_TYPE_CURVE_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_CURVE_TYPE, "GTK_CURVE_"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktextchild.c������������������������������������������������0000644�0001750�0001750�00000003215�11701304107�020303� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTextChildAnchor #define _SELF(self) GTK_TEXT_CHILD_ANCHOR(RVAL2GOBJ(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_text_child_anchor_new()); return Qnil; } static VALUE rg_widgets(VALUE self) { return GLIST2ARYF(gtk_text_child_anchor_get_widgets(_SELF(self))); } static VALUE rg_deleted_p(VALUE self) { return CBOOL2RVAL(gtk_text_child_anchor_get_deleted(_SELF(self))); } void Init_gtk_textchild(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_CHILD_ANCHOR, "TextChildAnchor", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(widgets, 0); RG_DEF_METHOD_P(deleted, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcombobox.c�������������������������������������������������0000644�0001750�0001750�00000010541�12257552167�020145� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cComboBox #define _SELF(self) (GTK_COMBO_BOX(RVAL2GOBJ(self))) #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE model_or_false; GtkWidget* widget; rb_scan_args(argc, argv, "01", &model_or_false); if (rb_obj_is_kind_of(model_or_false, GTYPE2CLASS(GTK_TYPE_TREE_MODEL))){ widget = gtk_combo_box_new_with_model(GTK_TREE_MODEL(RVAL2GOBJ(model_or_false))); } else if (NIL_P(model_or_false) || TYPE(model_or_false) == T_TRUE){ widget = gtk_combo_box_new_text(); } else if (TYPE(model_or_false) == T_FALSE){ widget = gtk_combo_box_new(); } else { rb_raise(rb_eArgError, "invalid 2nd argument %s (except true/false or Gtk::TreeModel)", rb_class2name(CLASS_OF(model_or_false))); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_active_iter(VALUE self) { GtkTreeIter iter; VALUE val = Qnil; gboolean ret = gtk_combo_box_get_active_iter(_SELF(self), &iter); if (ret){ iter.user_data3 = (gpointer)gtk_combo_box_get_model(_SELF(self)); val = BOXED2RVAL(&iter, GTK_TYPE_TREE_ITER); } return val; } static VALUE rg_set_active_iter(VALUE self, VALUE iter) { gtk_combo_box_set_active_iter(_SELF(self), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_append_text(VALUE self, VALUE text) { gtk_combo_box_append_text(_SELF(self), RVAL2CSTR(text)); return self; } static VALUE rg_insert_text(VALUE self, VALUE position, VALUE text) { gtk_combo_box_insert_text(_SELF(self), NUM2INT(position), RVAL2CSTR(text)); return self; } static VALUE rg_prepend_text(VALUE self, VALUE text) { gtk_combo_box_prepend_text(_SELF(self), RVAL2CSTR(text)); return self; } static VALUE rg_remove_text(VALUE self, VALUE position) { gtk_combo_box_remove_text(_SELF(self), NUM2INT(position)); return self; } static VALUE rg_active_text(VALUE self) { return CSTR2RVAL_FREE(gtk_combo_box_get_active_text(_SELF(self))); } static VALUE rg_popup_accessible(VALUE self) { return GOBJ2RVAL(gtk_combo_box_get_popup_accessible(_SELF(self))); } /* How can I implement this? GtkTreeViewRowSeparatorFunc gtk_combo_box_get_row_separator_func (GtkComboBox *combo_box); */ static gboolean row_separator_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer *func) { iter->user_data3 = model; return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(model), GTKTREEITER2RVAL(iter))); } static VALUE rg_set_row_separator_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_combo_box_set_row_separator_func(_SELF(self), (GtkTreeViewRowSeparatorFunc)row_separator_func, (gpointer)func, NULL); return self; } 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); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkimcontextsimple.c������������������������������������������0000644�0001750�0001750�00000004211�11701304107�021534� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cIMContextSimple #define _SELF(self) (GTK_IM_CONTEXT_SIMPLE(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_im_context_simple_new()); return Qnil; } /* TODO: Why are we taking a third argument? Shouldn't it be determined by the * length of rbdata? */ static VALUE rg_add_table(VALUE self, VALUE rbdata, VALUE rbmax_seq_len, VALUE rbn_seqs) { GtkIMContextSimple *context_simple = _SELF(self); gint max_seq_len = NUM2INT(rbmax_seq_len); gint n_seqs = NUM2INT(rbn_seqs); long n; guint16 *data; if (max_seq_len > GTK_MAX_COMPOSE_LEN) rb_raise(rb_eArgError, "max_seq_len cannot be greater than GTK_MAX_COMPOSE_LEN: %d > %d", max_seq_len, GTK_MAX_COMPOSE_LEN); data = RVAL2GUINT16S(rbdata, n); gtk_im_context_simple_add_table(context_simple, data, max_seq_len, n_seqs); g_free(data); return self; } void Init_gtk_imcontext_simple(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_IM_CONTEXT_SIMPLE, "IMContextSimple", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add_table, 3); rb_define_const(RG_TARGET_NAMESPACE, "MAX_COMPOSE_LEN", GTK_MAX_COMPOSE_LEN); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkscreen.c���������������������������������������������������0000644�0001750�0001750�00000025401�12257552167�017575� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2006 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef HAVE_RB_CAIRO_H #include <rb_cairo.h> #endif #define RG_TARGET_NAMESPACE cScreen #define _SELF(i) GDK_SCREEN(RVAL2GOBJ(i)) static ID id_new; static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_screen_get_default()); } static VALUE rg_default_colormap(VALUE self) { return GOBJ2RVAL(gdk_screen_get_default_colormap(_SELF(self))); } static VALUE rg_set_default_colormap(VALUE self, VALUE colormap) { gdk_screen_set_default_colormap(_SELF(self), GDK_COLORMAP(RVAL2GOBJ(colormap))); return self; } static VALUE rg_system_colormap(VALUE self) { return GOBJ2RVAL(gdk_screen_get_system_colormap(_SELF(self))); } static VALUE rg_system_visual(VALUE self) { return GOBJ2RVAL(gdk_screen_get_system_visual(_SELF(self))); } static VALUE rg_rgb_colormap(VALUE self) { return GOBJ2RVAL(gdk_screen_get_rgb_colormap(_SELF(self))); } static VALUE rg_rgb_visual(VALUE self) { return GOBJ2RVAL(gdk_screen_get_rgb_visual(_SELF(self))); } static VALUE rg_rgba_colormap(VALUE self) { return GOBJ2RVAL(gdk_screen_get_rgba_colormap(_SELF(self))); } static VALUE rg_rgba_visual(VALUE self) { return GOBJ2RVAL(gdk_screen_get_rgba_visual(_SELF(self))); } static VALUE rg_composited_p(VALUE self) { return CBOOL2RVAL(gdk_screen_is_composited(_SELF(self))); } static VALUE rg_root_window(VALUE self) { return GOBJ2RVAL(gdk_screen_get_root_window(_SELF(self))); } static VALUE rg_display(VALUE self) { return GOBJ2RVAL(gdk_screen_get_display(_SELF(self))); } static VALUE rg_number(VALUE self) { return INT2NUM(gdk_screen_get_number(_SELF(self))); } static VALUE rg_width(VALUE self) { return INT2NUM(gdk_screen_get_width(_SELF(self))); } static VALUE rg_height(VALUE self) { return INT2NUM(gdk_screen_get_height(_SELF(self))); } static VALUE rg_width_mm(VALUE self) { return INT2NUM(gdk_screen_get_width_mm(_SELF(self))); } static VALUE rg_height_mm(VALUE self) { return INT2NUM(gdk_screen_get_height_mm(_SELF(self))); } static VALUE rg_visuals(VALUE self) { return GLIST2ARYF(gdk_screen_list_visuals(_SELF(self))); } static VALUE rg_toplevel_windows(VALUE self) { return GLIST2ARYF(gdk_screen_get_toplevel_windows(_SELF(self))); } static VALUE rg_display_name(VALUE self) { gchar* name = gdk_screen_make_display_name(_SELF(self)); VALUE ret = CSTR2RVAL(name); g_free(name); return ret; } static VALUE rg_n_monitors(VALUE self) { return INT2NUM(gdk_screen_get_n_monitors(_SELF(self))); } static VALUE rg_monitor_geometry(VALUE self, VALUE num) { GdkRectangle rect; gdk_screen_get_monitor_geometry(_SELF(self), NUM2INT(num), &rect); return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE); } static VALUE rg_get_monitor(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2; VALUE ret; rb_scan_args(argc, argv, "11", &arg1, &arg2); if (argc == 2){ ret = INT2NUM(gdk_screen_get_monitor_at_point(_SELF(self), NUM2INT(arg1), NUM2INT(arg2))); } else if (argc == 1){ ret = INT2NUM(gdk_screen_get_monitor_at_window(_SELF(self), GDK_WINDOW(RVAL2GOBJ(arg1)))); } else { rb_raise(rb_eArgError, "Wrong number of arguments: %d", argc); } return ret; } static VALUE rg_broadcast_client_message(VALUE self, VALUE event) { gdk_screen_broadcast_client_message(_SELF(self), RVAL2GEV(event)); return self; } /* type: String, Integer, Gdk::Color. */ static VALUE rg_get_setting(int argc, VALUE *argv, VALUE self) { VALUE name, type; GType gtype; GValue val = G_VALUE_INIT; gboolean ret; VALUE value; rb_scan_args(argc, argv, "11", &name, &type); if (NIL_P(type)) gtype = G_TYPE_STRING; else gtype = CLASS2GTYPE(type); g_value_init(&val, gtype); ret = gdk_screen_get_setting(_SELF(self), RVAL2CSTR(name), &val); value = ret ? GVAL2RVAL(&val) : Qnil; g_value_unset(&val); return value; } #ifdef HAVE_RB_CAIRO_H static VALUE gdkscreen_get_font_options(VALUE self) { return CRFONTOPTIONS2RVAL((cairo_font_options_t *)gdk_screen_get_font_options(_SELF(self))); } static VALUE gdkscreen_set_font_options(VALUE self, VALUE options) { gdk_screen_set_font_options(_SELF(self), (const cairo_font_options_t *)RVAL2CRFONTOPTIONS(options)); return self; } #endif static VALUE rg_active_window(VALUE self) { return GOBJ2RVAL(gdk_screen_get_active_window(_SELF(self))); } static VALUE rg_window_stack(VALUE self) { GList* list = gdk_screen_get_window_stack(_SELF(self)); VALUE ary = rb_ary_new(); while (list) { rb_ary_push(ary, GOBJ2RVAL(list->data)); g_object_unref(list->data); list = list->next; } g_list_free(list); return ary; } static void child_setup(gpointer func) { if (! NIL_P(func)){ rb_funcall((VALUE)func, id_call, 0); } } static VALUE rg_spawn_on_screen(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags) { GError *err = NULL; gboolean ret; gint child_pid; VALUE func = Qnil; gchar **gargv; gchar **genvp; if (rb_block_given_p()) { func = rb_block_proc(); G_RELATIVE(self, func); } gargv = (gchar **)RVAL2STRV(argv); genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp); ret = gdk_spawn_on_screen(_SELF(self), NIL_P(working_directory) ? NULL : RVAL2CSTR(working_directory), gargv, genvp, NUM2INT(flags), (GSpawnChildSetupFunc)child_setup, (gpointer)func, &child_pid, &err); g_free(gargv); g_free(genvp); if (!ret) RAISE_GERROR(err); return INT2NUM(child_pid); } static VALUE rg_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags) { GError *err = NULL; gboolean ret; gint child_pid; VALUE func = Qnil; gchar **gargv; gchar **genvp; gint standard_input, standard_output, standard_error; if (rb_block_given_p()) { func = rb_block_proc(); G_RELATIVE(self, func); } gargv = (gchar **)RVAL2STRV(argv); genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp); ret = gdk_spawn_on_screen_with_pipes(_SELF(self), NIL_P(working_directory) ? NULL : RVAL2CSTR(working_directory), gargv, genvp, NUM2INT(flags), (GSpawnChildSetupFunc)child_setup, (gpointer)func, &child_pid, &standard_input, &standard_output, &standard_error, &err); g_free(gargv); g_free(genvp); if (!ret) RAISE_GERROR(err); return rb_ary_new3(4, INT2NUM(child_pid), rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_input)), rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_output)), rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_error))); } static VALUE rg_spawn_command_line_on_screen(G_GNUC_UNUSED VALUE self, VALUE command_line) { GError *err = NULL; VALUE ret; ret = CBOOL2RVAL(g_spawn_command_line_async(RVAL2CSTR(command_line), &err)); if (!ret) RAISE_GERROR(err); return ret; } /* From X Window System Interaction */ #ifdef GDK_WINDOWING_X11 #include <gdk/gdkx.h> static VALUE rg_xnumber(VALUE self) { return INT2NUM(GDK_SCREEN_XNUMBER(_SELF(self))); } static VALUE rg_supports_net_wm_hint_p(VALUE self, VALUE property) { return CBOOL2RVAL(gdk_x11_screen_supports_net_wm_hint(_SELF(self), RVAL2ATOM(property))); } static VALUE rg_window_manager_name(VALUE self) { return CSTR2RVAL(gdk_x11_screen_get_window_manager_name(_SELF(self))); } static VALUE rg_screen_number(VALUE self) { return INT2NUM(gdk_x11_screen_get_screen_number(_SELF(self))); } #endif void Init_gtk_gdk_screen(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_SCREEN, "Screen", mGdk); id_new = rb_intern("new"); RG_DEF_SMETHOD(default, 0); RG_DEF_METHOD(default_colormap, 0); RG_DEF_METHOD(set_default_colormap, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "default_colormap"); RG_DEF_METHOD(system_colormap, 0); RG_DEF_METHOD(system_visual, 0); RG_DEF_METHOD(rgb_colormap, 0); RG_DEF_METHOD(rgb_visual, 0); RG_DEF_METHOD(rgba_colormap, 0); RG_DEF_METHOD(rgba_visual, 0); RG_DEF_METHOD_P(composited, 0); RG_DEF_METHOD(root_window, 0); RG_DEF_METHOD(display, 0); RG_DEF_METHOD(number, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(width_mm, 0); RG_DEF_METHOD(height_mm, 0); RG_DEF_METHOD(visuals, 0); RG_DEF_METHOD(toplevel_windows, 0); RG_DEF_METHOD(display_name, 0); RG_DEF_METHOD(n_monitors, 0); RG_DEF_METHOD(monitor_geometry, 1); RG_DEF_METHOD(get_monitor, -1); RG_DEF_METHOD(broadcast_client_message, 1); RG_DEF_METHOD(get_setting, -1); #ifdef HAVE_RB_CAIRO_H G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "font_options", gdkscreen_get_font_options, 0); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "font_options", gdkscreen_set_font_options, 1); #endif RG_DEF_METHOD(active_window, 0); RG_DEF_METHOD(window_stack, 0); RG_DEF_METHOD(spawn_on_screen, 4); RG_DEF_METHOD(spawn_on_screen_with_pipes, 4); RG_DEF_METHOD(spawn_command_line_on_screen, 1); #ifdef GDK_WINDOWING_X11 RG_DEF_METHOD(xnumber, 0); RG_DEF_METHOD_P(supports_net_wm_hint, 0); RG_DEF_METHOD(window_manager_name, 0); RG_DEF_METHOD(screen_number, 0); #endif #ifdef GDK_WINDOWING_X11 G_DEF_CLASS3("GdkScreenX11", "ScreenX11", mGdk); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdk.c���������������������������������������������������������0000644�0001750�0001750�00000026701�12257552167�016401� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mGdk VALUE RG_TARGET_NAMESPACE; /* We don't need them. void gdk_init (gint *argc, gchar ***argv); gboolean gdk_init_check (gint *argc, gchar ***argv); void gdk_parse_args (gint *argc, gchar ***argv); */ struct rbgdk_rval2gdkpoints_args { VALUE ary; long n; GdkPoint *result; }; static VALUE rbgdk_rval2gdkpoints_body(VALUE value) { long i; struct rbgdk_rval2gdkpoints_args *args = (struct rbgdk_rval2gdkpoints_args *)value; for (i = 0; i < args->n; i++) { VALUE points = rb_ary_to_ary(RARRAY_PTR(args->ary)[i]); if (RARRAY_LEN(points) != 2) rb_raise(rb_eArgError, "point %ld should be array of size 2", i); args->result[i].x = NUM2INT(RARRAY_PTR(points)[0]); args->result[i].y = NUM2INT(RARRAY_PTR(points)[1]); } return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkpoints_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdkpoints_args *)value)->result); rb_exc_raise(rb_errinfo()); } GdkPoint * rbgdk_rval2gdkpoints(VALUE value, long *n) { struct rbgdk_rval2gdkpoints_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GdkPoint, args.n + 1); rb_rescue(rbgdk_rval2gdkpoints_body, (VALUE)&args, rbgdk_rval2gdkpoints_rescue, (VALUE)&args); *n = args.n; return args.result; } struct rbgdk_rval2gdkatoms_args { VALUE ary; long n; GdkAtom *result; }; static VALUE rbgdk_rval2gdkatoms_body(VALUE value) { long i; struct rbgdk_rval2gdkatoms_args *args = (struct rbgdk_rval2gdkatoms_args *)value; for (i = 0; i < args->n; i++) args->result[i] = RVAL2ATOM(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkatoms_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdkatoms_args *)value)->result); rb_exc_raise(rb_errinfo()); } GdkAtom * rbgdk_rval2gdkatoms(VALUE value, long *n) { struct rbgdk_rval2gdkatoms_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GdkAtom, args.n + 1); rb_rescue(rbgdk_rval2gdkatoms_body, (VALUE)&args, rbgdk_rval2gdkatoms_rescue, (VALUE)&args); *n = args.n; return args.result; } struct rval2gdkpixbufglist_args { VALUE ary; long n; GList *result; }; static VALUE rbgdk_rval2gdkpixbufglist_body(VALUE value) { long i; struct rval2gdkpixbufglist_args *args = (struct rval2gdkpixbufglist_args *)value; for (i = 0; i < args->n; i++) args->result = g_list_append(args->result, GDK_PIXBUF(RVAL2GOBJ(RARRAY_PTR(args->ary)[i]))); return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkpixbufglist_rescue(VALUE value) { g_list_free(((struct rval2gdkpixbufglist_args *)value)->result); rb_exc_raise(rb_errinfo()); } GList * rbgdk_rval2gdkpixbufglist(VALUE value) { struct rval2gdkpixbufglist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgdk_rval2gdkpixbufglist_body, (VALUE)&args, rbgdk_rval2gdkpixbufglist_rescue, (VALUE)&args); return args.result; } static VALUE rg_m_display_arg_name(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gdk_get_display_arg_name()); } static VALUE rg_m_set_locale(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gdk_set_locale()); } static VALUE rg_m_set_sm_client_id(VALUE self, VALUE id) { gdk_set_sm_client_id(NIL_P(id) ? NULL : RVAL2CSTR(id)); return self; } static VALUE rg_m_notify_startup_complete(int argc, VALUE *argv, VALUE self) { VALUE startup_id; rb_scan_args(argc, argv, "01", &startup_id); if (NIL_P(startup_id)) { gdk_notify_startup_complete(); } else { #if GTK_CHECK_VERSION(2, 12, 0) gdk_notify_startup_complete_with_id(RVAL2CSTR(startup_id)); #else rb_raise(rb_eNotImpError, "GTK+ >= 2.12 is required to use " "Gdk.notify_startup_complete with startup ID."); #endif } return self; } static VALUE rg_m_program_class(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gdk_get_program_class()); } static VALUE rg_m_set_program_class(VALUE self, VALUE program_class) { gdk_set_program_class(RVAL2CSTR(program_class)); return self; } static VALUE rg_m_display(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gdk_get_display()); } #ifdef HAVE_X11_XLIB_H #ifdef HAVE_XGETERRORTEXT #include <X11/Xlib.h> #include <errno.h> static VALUE rb_x_error; static VALUE rb_x_io_error; static int rbgdk_x_error(Display *display, XErrorEvent *error) { gchar buf[64]; XGetErrorText(display, error->error_code, buf, 63); rb_funcall((VALUE)rb_x_error, id_call, 4, INT2NUM(error->serial), INT2NUM(error->error_code), INT2NUM(error->request_code), INT2NUM(error->minor_code)); return 0; } static int rbgdk_x_io_error(Display *display) { int errno_saved = errno; const gchar* disp; const gchar* error; disp = display ? DisplayString(display) : gdk_get_display_arg_name(); if (! disp) disp = "(none)"; error = g_strerror(errno_saved); rb_funcall((VALUE)rb_x_io_error, id_call, 3, CSTR2RVAL(disp), INT2NUM(errno), CSTR2RVAL(error)); return 0; } #endif #endif static VALUE rg_m_set_x_error_handler(VALUE self) { #ifdef HAVE_XGETERRORTEXT rb_x_error = rb_block_proc(); G_RELATIVE(self, rb_x_error); XSetErrorHandler(rbgdk_x_error); #else rb_warn("Not supported on this environment."); #endif return self; } static VALUE rg_m_set_x_io_error_handler(VALUE self) { #ifdef HAVE_XGETERRORTEXT rb_x_io_error = rb_block_proc(); G_RELATIVE(self, rb_x_io_error); XSetIOErrorHandler(rbgdk_x_io_error); #else rb_warn("Not supported on this environment."); #endif return self; } static VALUE rg_m_flush(VALUE self) { gdk_flush(); return self; } static VALUE rg_m_screen_width(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_screen_width()); } static VALUE rg_m_screen_width_mm(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_screen_width_mm()); } static VALUE rg_m_screen_height(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_screen_height()); } static VALUE rg_m_screen_height_mm(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_screen_height_mm()); } static VALUE rg_m_pointer_grab(G_GNUC_UNUSED VALUE self, VALUE win, VALUE owner_events, VALUE event_mask, VALUE confine_to, VALUE cursor, VALUE time) { return GENUM2RVAL(gdk_pointer_grab(GDK_WINDOW(RVAL2GOBJ(win)), RVAL2CBOOL(owner_events), RVAL2GFLAGS(event_mask, GDK_TYPE_EVENT_MASK), NIL_P(confine_to)?NULL:GDK_WINDOW(RVAL2GOBJ(confine_to)), NIL_P(cursor)?NULL:(GdkCursor*)RVAL2BOXED(cursor, GDK_TYPE_CURSOR), NUM2INT(time)), GDK_TYPE_GRAB_STATUS); } static VALUE rg_m_pointer_ungrab(VALUE self, VALUE time) { gdk_pointer_ungrab(NUM2INT(time)); return self; } static VALUE rg_m_keyboard_grab(G_GNUC_UNUSED VALUE self, VALUE win, VALUE owner_events, VALUE time) { return GENUM2RVAL(gdk_keyboard_grab(GDK_WINDOW(RVAL2GOBJ(win)), RVAL2CBOOL(owner_events), NUM2INT(time)), GDK_TYPE_GRAB_STATUS); } static VALUE rg_m_keyboard_ungrab(VALUE self, VALUE time) { gdk_keyboard_ungrab(NUM2INT(time)); return self; } static VALUE rg_m_pointer_is_grabbed_p(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gdk_pointer_is_grabbed()); } static VALUE rg_m_set_double_click_time(VALUE self, VALUE msec) { gdk_set_double_click_time(NUM2UINT(msec)); return self; } static VALUE rg_m_beep(VALUE self) { gdk_beep(); return self; } static VALUE rg_m_error_trap_push(VALUE self) { gdk_error_trap_push(); return self; } static VALUE rg_m_error_trap_pop(VALUE self) { gdk_error_trap_pop(); return self; } static VALUE rg_m_windowing_x11_p(G_GNUC_UNUSED VALUE self) { #ifdef GDK_WINDOWING_X11 return Qtrue; #else return Qfalse; #endif } static VALUE rg_m_windowing_win32_p(G_GNUC_UNUSED VALUE self) { #ifdef GDK_WINDOWING_WIN32 return Qtrue; #else return Qfalse; #endif } static VALUE rg_m_windowing_fb_p(G_GNUC_UNUSED VALUE self) { #ifdef GDK_WINDOWING_FB return Qtrue; #else return Qfalse; #endif } static VALUE rg_m_windowing_quartz_p(G_GNUC_UNUSED VALUE self) { #ifdef GDK_WINDOWING_QUARTZ return Qtrue; #else return Qfalse; #endif } static VALUE rg_m_windowing_directfb_p(G_GNUC_UNUSED VALUE self) { #ifdef GDK_WINDOWING_DIRECTFB return Qtrue; #else return Qfalse; #endif } static VALUE rg_m_target(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(RUBY_GTK2_TARGET); } static VALUE rg_m_cairo_available_p(G_GNUC_UNUSED VALUE self) { return Qtrue; } void Init_gtk_gdk(void) { RG_TARGET_NAMESPACE = rb_define_module("Gdk"); RG_DEF_MODFUNC(display_arg_name, 0); RG_DEF_MODFUNC(set_locale, 0); RG_DEF_MODFUNC(set_sm_client_id, 1); RG_DEF_MODFUNC(notify_startup_complete, -1); RG_DEF_MODFUNC(program_class, 0); RG_DEF_MODFUNC(set_program_class, 1); RG_DEF_MODFUNC(display, 0); RG_DEF_MODFUNC(set_x_error_handler, 0); RG_DEF_MODFUNC(set_x_io_error_handler, 0); RG_DEF_MODFUNC(screen_width, 0); RG_DEF_MODFUNC(screen_width_mm, 0); RG_DEF_MODFUNC(screen_height, 0); RG_DEF_MODFUNC(screen_height_mm, 0); RG_DEF_MODFUNC(beep, 0); RG_DEF_MODFUNC(flush, 0); RG_DEF_MODFUNC(set_double_click_time, 1); RG_DEF_MODFUNC(pointer_grab, 6); RG_DEF_MODFUNC(pointer_ungrab, 1); RG_DEF_MODFUNC(keyboard_grab, 3); RG_DEF_MODFUNC(keyboard_ungrab, 1); RG_DEF_MODFUNC_P(pointer_is_grabbed, 0); RG_DEF_MODFUNC(error_trap_push, 0); RG_DEF_MODFUNC(error_trap_pop, 0); RG_DEF_MODFUNC_P(windowing_x11, 0); RG_DEF_MODFUNC_P(windowing_win32, 0); RG_DEF_MODFUNC_P(windowing_fb, 0); RG_DEF_MODFUNC_P(windowing_quartz, 0); RG_DEF_MODFUNC_P(windowing_directfb, 0); RG_DEF_MODFUNC(target, 0); RG_DEF_MODFUNC_P(cairo_available, 0); /* GdkGrabStatus */ G_DEF_CLASS(GDK_TYPE_GRAB_STATUS, "GrabStatus", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_GRAB_STATUS, "GDK_"); G_DEF_SETTERS(RG_TARGET_NAMESPACE); }���������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkiconview.c�������������������������������������������������0000644�0001750�0001750�00000020131�12257552167�020154� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cIconView #define _SELF(s) (GTK_ICON_VIEW(RVAL2GOBJ(s))) static ID id_model; static ID id_select_path; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE model; rb_scan_args(argc, argv, "01", &model); if (NIL_P(model)){ RBGTK_INITIALIZE(self, gtk_icon_view_new()); } else { G_CHILD_SET(self, id_model, model); RBGTK_INITIALIZE(self, gtk_icon_view_new_with_model(GTK_TREE_MODEL(RVAL2GOBJ(model)))); } return Qnil; } static VALUE rg_get_path_at_pos(VALUE self, VALUE x, VALUE y) { return GTKTREEPATH2RVAL(gtk_icon_view_get_path_at_pos(_SELF(self), NUM2INT(x), NUM2INT(y))); } static void iview_foreach_func(GtkIconView *iview, GtkTreePath *path, gpointer *func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(iview), GTKTREEPATH2RVAL(path)); } static VALUE rg_selected_each(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_icon_view_selected_foreach(_SELF(self), (GtkIconViewForeachFunc)iview_foreach_func, (gpointer)func); return self; } static VALUE rg_select_path(VALUE self, VALUE path) { G_CHILD_SET(self, id_select_path, path); gtk_icon_view_select_path(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_unselect_path(VALUE self, VALUE path) { G_CHILD_UNSET(self, id_select_path); gtk_icon_view_unselect_path(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_path_is_selected_p(VALUE self, VALUE path) { return CBOOL2RVAL(gtk_icon_view_path_is_selected(_SELF(self), RVAL2GTKTREEPATH(path))); } static VALUE rg_selected_items(VALUE self) { GList* list = gtk_icon_view_get_selected_items(_SELF(self)); VALUE ret = GLIST2ARY2(list, GTK_TYPE_TREE_PATH); g_list_foreach(list, (GFunc)gtk_tree_path_free, NULL); g_list_free(list); return ret; } static VALUE rg_item_activated(VALUE self, VALUE path) { gtk_icon_view_item_activated(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_create_drag_icon(VALUE self, VALUE path) { return GOBJ2RVAL(gtk_icon_view_create_drag_icon(_SELF(self), RVAL2GTKTREEPATH(path))); } static VALUE rg_enable_model_drag_dest(VALUE self, VALUE rbtargets, VALUE rbactions) { GtkIconView *icon_view = _SELF(self); GdkDragAction actions = RVAL2GFLAGS(rbactions, GDK_TYPE_DRAG_ACTION); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_icon_view_enable_model_drag_dest(icon_view, targets, n, actions); g_free(targets); return self; } static VALUE rg_enable_model_drag_source(VALUE self, VALUE rbstart_button_mask, VALUE rbtargets, VALUE rbactions) { GtkIconView *icon_view = _SELF(self); GdkModifierType start_button_mask = RVAL2GFLAGS(rbstart_button_mask, GDK_TYPE_MODIFIER_TYPE); GdkDragAction actions = RVAL2GFLAGS(rbactions, GDK_TYPE_DRAG_ACTION); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_icon_view_enable_model_drag_source(icon_view, start_button_mask, targets, n, actions); g_free(targets); return self; } static VALUE rg_cursor(VALUE self) { GtkTreePath* path; GtkCellRenderer* cell; gboolean cursor_set = gtk_icon_view_get_cursor(_SELF(self), &path, &cell); return cursor_set ? rb_assoc_new(GTKTREEPATH2RVAL(path), GOBJ2RVAL(cell)) : Qnil; } static VALUE rg_get_dest_item(VALUE self, VALUE drag_x, VALUE drag_y) { GtkTreePath* path; GtkIconViewDropPosition pos; gboolean item_at_pos = gtk_icon_view_get_dest_item_at_pos(_SELF(self), NUM2INT(drag_x), NUM2INT(drag_y), &path, &pos); return item_at_pos ? rb_assoc_new(GTKTREEPATH2RVAL(path), GENUM2RVAL(pos, GTK_TYPE_ICON_VIEW_DROP_POSITION)) : Qnil; } static VALUE rg_drag_dest_item(VALUE self) { GtkTreePath* path; GtkIconViewDropPosition pos; gtk_icon_view_get_drag_dest_item(_SELF(self), &path, &pos); return rb_assoc_new(GTKTREEPATH2RVAL(path), GENUM2RVAL(pos, GTK_TYPE_ICON_VIEW_DROP_POSITION)); } static VALUE rg_get_item(VALUE self, VALUE x, VALUE y) { GtkTreePath* path; GtkCellRenderer* cell; gboolean item_at_pos = gtk_icon_view_get_item_at_pos(_SELF(self), NUM2INT(x), NUM2INT(y), &path, &cell); return item_at_pos ? rb_assoc_new(GTKTREEPATH2RVAL(path), GOBJ2RVAL(cell)) : Qnil; } static VALUE rg_visible_range(VALUE self) { GtkTreePath* start_path; GtkTreePath* end_path; gboolean valid_paths = gtk_icon_view_get_visible_range(_SELF(self), &start_path, &end_path); return valid_paths ? rb_assoc_new(GTKTREEPATH2RVAL(start_path), GTKTREEPATH2RVAL(end_path)) : Qnil; } static VALUE rg_scroll_to_path(VALUE self, VALUE path, VALUE use_align, VALUE row_align, VALUE col_align) { gtk_icon_view_scroll_to_path(_SELF(self), RVAL2GTKTREEPATH(path), RVAL2CBOOL(use_align), NUM2DBL(row_align), NUM2DBL(col_align)); return self; } static VALUE rg_set_cursor(VALUE self, VALUE path, VALUE cell, VALUE start_editing) { gtk_icon_view_set_cursor(_SELF(self), RVAL2GTKTREEPATH(path), NIL_P(cell) ? NULL : RVAL2GOBJ(cell), RVAL2CBOOL(start_editing)); return self; } static VALUE rg_set_drag_dest_item(VALUE self, VALUE path, VALUE pos) { gtk_icon_view_set_drag_dest_item(_SELF(self), NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path), RVAL2GENUM(pos, GTK_TYPE_ICON_VIEW_DROP_POSITION)); return self; } static VALUE rg_unset_model_drag_dest(VALUE self) { gtk_icon_view_unset_model_drag_dest(_SELF(self)); return self; } static VALUE rg_unset_model_drag_source(VALUE self) { gtk_icon_view_unset_model_drag_source(_SELF(self)); return self; } void Init_gtk_iconview(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_VIEW, "IconView", mGtk); id_model = rb_intern("model"); id_select_path = rb_intern("select_path"); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(get_path_at_pos, 2); RG_DEF_ALIAS("get_path", "get_path_at_pos"); RG_DEF_METHOD(selected_each, 0); RG_DEF_METHOD(select_path, 1); RG_DEF_METHOD(unselect_path, 1); RG_DEF_METHOD_P(path_is_selected, 1); RG_DEF_METHOD(selected_items, 0); RG_DEF_METHOD(item_activated, 1); RG_DEF_METHOD(create_drag_icon, 1); RG_DEF_METHOD(enable_model_drag_dest, 2); RG_DEF_METHOD(enable_model_drag_source, 3); RG_DEF_METHOD(cursor, 0); RG_DEF_METHOD(get_dest_item, 2); RG_DEF_METHOD(drag_dest_item, 0); RG_DEF_METHOD(get_item, 2); RG_DEF_METHOD(visible_range, 0); RG_DEF_METHOD(scroll_to_path, 4); RG_DEF_METHOD(set_cursor, 3); RG_DEF_METHOD(set_drag_dest_item, 2); RG_DEF_METHOD(unset_model_drag_dest, 0); RG_DEF_METHOD(unset_model_drag_source, 0); /* GtkIconViewDropPosition */ G_DEF_CLASS(GTK_TYPE_ICON_VIEW_DROP_POSITION, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_ICON_VIEW_DROP_POSITION, "GTK_ICON_VIEW_"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkseparatormenuitem.c����������������������������������������0000644�0001750�0001750�00000002413�11701304107�022056� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cSeparatorMenuItem static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_separator_menu_item_new()); return Qnil; } void Init_gtk_separator_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SEPARATOR_MENU_ITEM, "SeparatorMenuItem", mGtk); RG_DEF_METHOD(initialize, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrecentfilter.c���������������������������������������������0000644�0001750�0001750�00000010575�12257552167�021032� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRecentFilter #define _SELF(self) (GTK_RECENT_FILTER(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_recent_filter_new()); return Qnil; } static VALUE rg_name(VALUE self) { return CSTR2RVAL(gtk_recent_filter_get_name(_SELF(self))); } static VALUE rg_set_name(VALUE self, VALUE name) { gtk_recent_filter_set_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_add_mime_type(VALUE self, VALUE mime_type) { gtk_recent_filter_add_mime_type(_SELF(self), RVAL2CSTR(mime_type)); return self; } static VALUE rg_add_pattern(VALUE self, VALUE pattern) { gtk_recent_filter_add_pattern(_SELF(self), RVAL2CSTR(pattern)); return self; } static VALUE rg_add_pixbuf_formats(VALUE self) { gtk_recent_filter_add_pixbuf_formats(_SELF(self)); return self; } static VALUE rg_add_application(VALUE self, VALUE application) { gtk_recent_filter_add_application(_SELF(self), RVAL2CSTR(application)); return self; } static VALUE rg_add_group(VALUE self, VALUE group) { gtk_recent_filter_add_group(_SELF(self), RVAL2CSTR(group)); return self; } static VALUE rg_add_age(VALUE self, VALUE days) { gtk_recent_filter_add_age(_SELF(self), NUM2INT(days)); return self; } struct callback_arg { VALUE callback; VALUE info; }; static VALUE invoke_callback(VALUE arg_) { struct callback_arg *arg = (struct callback_arg *)arg_; return rb_funcall(arg->callback, id_call, 1, arg->info); } static gboolean filter_func(const GtkRecentFilterInfo *info, gpointer func) { VALUE result; struct callback_arg arg; arg.callback = (VALUE)func; arg.info = BOXED2RVAL((gpointer)info, GTK_TYPE_RECENT_FILTER_INFO); result = G_PROTECT_CALLBACK(invoke_callback, &arg); return NIL_P(rb_errinfo()) ? TRUE : RVAL2CBOOL(result); } static void remove_callback_reference(gpointer data) { G_CHILD_REMOVE(mGtk, (VALUE)data); } static VALUE rg_add_custom(VALUE self, VALUE needed) { VALUE func = rb_block_proc(); G_CHILD_ADD(mGtk, func); gtk_recent_filter_add_custom(_SELF(self), RVAL2GFLAGS(needed, GTK_TYPE_RECENT_FILTER_FLAGS), (GtkRecentFilterFunc)filter_func, (gpointer)func, (GDestroyNotify)remove_callback_reference); return self; } static VALUE rg_needed(VALUE self) { return GFLAGS2RVAL(gtk_recent_filter_get_needed(_SELF(self)), GTK_TYPE_RECENT_FILTER_FLAGS); } static VALUE rg_filter(VALUE self, VALUE filter_info) { return CBOOL2RVAL(gtk_recent_filter_filter(_SELF(self), (GtkRecentFilterInfo*)RVAL2BOXED(filter_info, GTK_TYPE_RECENT_FILTER_INFO))); } void Init_gtk_recent_filter(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_FILTER, "RecentFilter", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(set_name, 1); RG_DEF_METHOD(add_mime_type, 1); RG_DEF_METHOD(add_pattern, 1); RG_DEF_METHOD(add_pixbuf_formats, 0); RG_DEF_METHOD(add_application, 1); RG_DEF_METHOD(add_group, 1); RG_DEF_METHOD(add_age, 1); RG_DEF_METHOD(add_custom, 1); RG_DEF_METHOD(needed, 0); RG_DEF_METHOD(filter, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkRecentFilterFlags */ G_DEF_CLASS(GTK_TYPE_RECENT_FILTER_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_RECENT_FILTER_FLAGS, "GTK_RECENT_FILTER_"); } �����������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkregion.c���������������������������������������������������0000644�0001750�0001750�00000017375�11701304107�017572� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRegion #define _SELF(r) ((GdkRegion*)RVAL2BOXED(r, GDK_TYPE_REGION)) /**********************************/ GType gdk_region_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkRegion", (GBoxedCopyFunc)gdk_region_copy, (GBoxedFreeFunc)gdk_region_destroy); return our_type; } /**********************************/ static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE points_or_rectangle, rbfill_rule; GdkRegion *region; rb_scan_args(argc, argv, "02", &points_or_rectangle, &rbfill_rule); if (NIL_P(points_or_rectangle)) { region = gdk_region_new(); } else if (TYPE(points_or_rectangle) == T_ARRAY) { GdkFillRule fill_rule = RVAL2GENUM(rbfill_rule, GDK_TYPE_FILL_RULE); long n; GdkPoint *points = RVAL2GDKPOINTS(points_or_rectangle, &n); region = gdk_region_polygon(points, n, fill_rule); g_free(points); } else if (RVAL2GTYPE(points_or_rectangle) == GDK_TYPE_RECTANGLE) { region = gdk_region_rectangle((GdkRectangle*)RVAL2BOXED(points_or_rectangle, GDK_TYPE_RECTANGLE)); } else { rb_raise(rb_eArgError, "invalid argument %s (expect array of Gdk::Point or Gdk::Rectangle, nil)", rb_class2name(CLASS_OF(points_or_rectangle))); } G_INITIALIZE(self, region); return Qnil; } static VALUE rg_rectangles(VALUE self) { GdkRectangle* rectangles; gint n_rect, i; VALUE ary; gdk_region_get_rectangles(_SELF(self), &rectangles, &n_rect); ary = rb_ary_new2(n_rect); for (i = 0; i < n_rect; i++) { rb_ary_push(ary, BOXED2RVAL(&rectangles[i], GDK_TYPE_RECTANGLE)); } g_free(rectangles); return ary; } static void gdkregion_span_func(GdkSpan *span, gpointer func) { rb_funcall((VALUE)func, id_call, 3, INT2NUM(span->x), INT2NUM(span->y), INT2NUM(span->width)); } struct rbgdk_rval2gdkspans_args { VALUE ary; long n; GdkSpan *result; }; static VALUE rbgdk_rval2gdkspans_body(VALUE value) { long i; struct rbgdk_rval2gdkspans_args *args = (struct rbgdk_rval2gdkspans_args *)value; for (i = 0; i < args->n; i++) { VALUE points = rb_ary_to_ary(RARRAY_PTR(args->ary)[i]); if (RARRAY_LEN(points) != 2) rb_raise(rb_eArgError, "point %ld should be array of size 3", i); args->result[i].x = NUM2INT(RARRAY_PTR(points)[0]); args->result[i].y = NUM2INT(RARRAY_PTR(points)[1]); args->result[i].width = NUM2INT(RARRAY_PTR(points)[1]); } return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkspans_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdkspans_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GdkSpan * rbgdk_rval2gdkspans(VALUE value, long *n) { struct rbgdk_rval2gdkspans_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GdkSpan, args.n + 1); rb_rescue(rbgdk_rval2gdkspans_body, (VALUE)&args, rbgdk_rval2gdkspans_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } #define RVAL2GDKSPANS(value, n) rbgdk_rval2gdkspans(value, n) static VALUE rg_spans_intersect_each(VALUE self, VALUE rbspans, VALUE rbsorted) { GdkRegion *region = _SELF(self); gboolean sorted = RVAL2CBOOL(rbsorted); VALUE func = rb_block_proc(); long n; GdkSpan *spans; G_RELATIVE(self, func); spans = RVAL2GDKSPANS(rbspans, &n); gdk_region_spans_intersect_foreach(region, spans, n, sorted, (GdkSpanFunc)gdkregion_span_func, (gpointer)func); g_free(spans); return self; } static VALUE rg_clipbox(VALUE self) { GdkRectangle rect; gdk_region_get_clipbox(_SELF(self), &rect); return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE); } static VALUE rg_empty_p(VALUE self) { return CBOOL2RVAL(gdk_region_empty(_SELF(self))); } static VALUE rg_operator_equal(VALUE self, VALUE obj) { if (!rb_obj_is_instance_of(obj, GTYPE2CLASS(GDK_TYPE_REGION))) { return Qnil; } return CBOOL2RVAL(gdk_region_equal(_SELF(self), _SELF(obj))); } static VALUE rg_point_in_p(VALUE self, VALUE x, VALUE y) { return CBOOL2RVAL(gdk_region_point_in(_SELF(self), NUM2INT(x), NUM2INT(y))); } static VALUE rg_rect_in(VALUE self, VALUE rect) { return GENUM2RVAL(gdk_region_rect_in( _SELF(self), (GdkRectangle*)RVAL2BOXED(rect, GDK_TYPE_RECTANGLE)), GDK_TYPE_OVERLAP_TYPE); } static VALUE rg_offset(VALUE self, VALUE dx, VALUE dy) { gdk_region_offset(_SELF(self), NUM2INT(dx), NUM2INT(dy)); return self; } static VALUE rg_shrink(VALUE self, VALUE dx, VALUE dy) { gdk_region_shrink(_SELF(self), NUM2INT(dx), NUM2INT(dy)); return self; } static VALUE rg_intersect(VALUE self, VALUE region) { gdk_region_intersect(_SELF(self), _SELF(region)); return self; } static VALUE rg_union(VALUE self, VALUE other) { if (RVAL2GTYPE(other) == GDK_TYPE_RECTANGLE){ gdk_region_union_with_rect(_SELF(self), (GdkRectangle*)RVAL2BOXED(other, GDK_TYPE_RECTANGLE)); } else { gdk_region_union(_SELF(self), _SELF(other)); } return self; } static VALUE rg_subtract(VALUE self, VALUE region) { gdk_region_subtract(_SELF(self), _SELF(region)); return self; } static VALUE rg_xor(VALUE self, VALUE region) { gdk_region_xor(_SELF(self), _SELF(region)); return self; } void Init_gtk_gdk_region(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_REGION, "Region", mGdk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(rectangles, 0); RG_DEF_METHOD(spans_intersect_each, 2); RG_DEF_METHOD(clipbox, 0); RG_DEF_METHOD_P(empty, 0); RG_DEF_METHOD_OPERATOR("==", equal, 1); RG_DEF_METHOD_P(point_in, 2); RG_DEF_METHOD(rect_in, 1); RG_DEF_METHOD(offset, 2); RG_DEF_METHOD(shrink, 2); RG_DEF_METHOD(intersect, 1); RG_DEF_METHOD(union, 1); RG_DEF_METHOD(subtract, 1); RG_DEF_METHOD(xor, 1); /* GdkOverlapType */ G_DEF_CLASS(GDK_TYPE_OVERLAP_TYPE, "OverlapType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_OVERLAP_TYPE, "GDK_"); /* GdkFillRule */ G_DEF_CLASS(GDK_TYPE_FILL_RULE, "FillRule", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_FILL_RULE, "GDK_"); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkaccellabel.c�����������������������������������������������0000644�0001750�0001750�00000003205�11701304107�020361� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 2001 Neil Conway * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAccelLabel static VALUE rg_initialize(VALUE self, VALUE string) { RBGTK_INITIALIZE(self, gtk_accel_label_new(RVAL2CSTR(string))); return Qnil; } static VALUE rg_accel_width(VALUE self) { return INT2NUM(gtk_accel_label_get_accel_width(GTK_ACCEL_LABEL(RVAL2GOBJ(self)))); } static VALUE rg_refetch(VALUE self) { gtk_accel_label_refetch(GTK_ACCEL_LABEL(RVAL2GOBJ(self))); return Qfalse; // always returns false } void Init_gtk_accel_label(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCEL_LABEL, "AccelLabel", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(accel_width, 0); RG_DEF_METHOD(refetch, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreerowreference.c�����������������������������������������0000644�0001750�0001750�00000011147�12257552167�021706� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" /*****************************************/ #ifndef GTK_TYPE_TREE_ROW_REFERENCE static GtkTreeRowReference* treerowref_copy(const GtkTreeRowReference *ref) { return (GtkTreeRowReference*)ref; } GType rbgtk_tree_row_reference_get_type() { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkTreeRowReference", (GBoxedCopyFunc)treerowref_copy, (GBoxedFreeFunc)gtk_tree_row_reference_free); return our_type; } GtkTreeRowReference * rbgtk_get_tree_row_reference(VALUE obj) { return (GtkTreeRowReference*)RVAL2BOXED(obj, GTK_TYPE_TREE_ROW_REFERENCE); } #endif /*****************************************/ #define RG_TARGET_NAMESPACE cTreeRowReference #define _SELF(s) RVAL2TREEROWREFERENCE(s) /*****************************************/ static ID id_proxy; static ID id_model; static ID id_path; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE proxy, model, path; GtkTreeRowReference* ref; if (argc == 3){ rb_scan_args(argc, argv, "3", &proxy, &model, &path); G_CHILD_SET(self, id_proxy, proxy); ref = gtk_tree_row_reference_new_proxy(RVAL2GOBJ(proxy), GTK_TREE_MODEL(RVAL2GOBJ(model)), RVAL2GTKTREEPATH(path)); } else { rb_scan_args(argc, argv, "2", &model, &path); ref = gtk_tree_row_reference_new(GTK_TREE_MODEL(RVAL2GOBJ(model)), RVAL2GTKTREEPATH(path)); } if (ref == NULL) rb_raise(rb_eArgError, "Invalid arguments were passed."); G_CHILD_SET(self, id_model, model); G_CHILD_SET(self, id_path, path); G_INITIALIZE(self, ref); return Qnil; } static VALUE rg_path(VALUE self) { VALUE ret = GTKTREEPATH2RVAL(gtk_tree_row_reference_get_path(_SELF(self))); G_CHILD_SET(self, id_path, ret); return ret; } static VALUE rg_model(VALUE self) { VALUE ret = GOBJ2RVAL(gtk_tree_row_reference_get_model(_SELF(self))); G_CHILD_SET(self, id_model, ret); return ret; } static VALUE rg_valid_p(VALUE self) { return CBOOL2RVAL(gtk_tree_row_reference_valid(_SELF(self))); } static VALUE rg_s_inserted(VALUE self, VALUE proxy, VALUE path) { gtk_tree_row_reference_inserted(RVAL2GOBJ(proxy), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_s_deleted(VALUE self, VALUE proxy, VALUE path) { gtk_tree_row_reference_deleted(RVAL2GOBJ(proxy), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_s_reordered(VALUE self, VALUE rbproxy, VALUE rbpath, VALUE rbiter, VALUE rbnew_order) { GObject *proxy = RVAL2GOBJ(rbproxy); GtkTreePath *path = RVAL2GTKTREEPATH(rbpath); GtkTreeIter *iter = RVAL2GTKTREEITER(rbiter); /* TODO: How do we implement this check? gint columns = gtk_tree_model_get_n_columns(proxy); */ long n; gint *new_order = RVAL2GINTS(rbnew_order, n); /* if (n != columns) { g_free(new_order); rb_raise(rb_eArgError, "new order array must contain same number of elements as the number of columns in the store: %ld != %d", n, columns); } */ gtk_tree_row_reference_reordered(proxy, path, iter, new_order); g_free(new_order); return self; } void Init_gtk_treerowreference(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_ROW_REFERENCE, "TreeRowReference", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(path, 0); RG_DEF_METHOD(model, 0); RG_DEF_METHOD_P(valid, 0); RG_DEF_SMETHOD(inserted, 2); RG_DEF_SMETHOD(deleted, 2); RG_DEF_SMETHOD(reordered, 4); id_proxy = rb_intern("proxy"); id_model = rb_intern("model"); id_path = rb_intern("path"); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkgamma.c����������������������������������������������������0000644�0001750�0001750�00000003203�11701304107�017372� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cGammaCurve static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_gamma_curve_new()); return Qnil; } static VALUE rg_gamma(VALUE self) { return rb_float_new(GTK_GAMMA_CURVE(RVAL2GOBJ(self))->gamma); } static VALUE rg_curve(VALUE self) { return GOBJ2RVAL(GTK_GAMMA_CURVE(RVAL2GOBJ(self))->curve); } void Init_gtk_gamma_curve(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_GAMMA_CURVE, "GammaCurve", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(gamma, 0); RG_DEF_METHOD(curve, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreemodelfilter.c������������������������������������������0000644�0001750�0001750�00000013636�12257552167�021533� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTreeModelFilter #define _SELF(s) (GTK_TREE_MODEL_FILTER(RVAL2GOBJ(s))) static ID id_child_model; static ID id_root; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE child_model, root; GtkTreeModel* widget; rb_scan_args(argc, argv, "11", &child_model, &root); G_CHILD_SET(self, id_child_model, child_model); if (NIL_P(root)){ widget = gtk_tree_model_filter_new(GTK_TREE_MODEL(RVAL2GOBJ(child_model)), (GtkTreePath*)NULL); } else { G_CHILD_SET(self, id_root, root); widget = gtk_tree_model_filter_new(GTK_TREE_MODEL(RVAL2GOBJ(child_model)), (GtkTreePath*)RVAL2GTKTREEPATH(root)); } G_INITIALIZE(self, widget); return Qnil; } static gboolean visible_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer func) { VALUE ret; iter->user_data3 = model; ret = rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(model), GTKTREEITER2RVAL(iter)); return RVAL2CBOOL(ret); } static VALUE rg_set_visible_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_model_filter_set_visible_func(_SELF(self), (GtkTreeModelFilterVisibleFunc)visible_func, (gpointer)func, NULL); return self; } static void modify_func(GtkTreeModel *model, GtkTreeIter *iter, GValue *value, gint column, gpointer func) { VALUE ret; iter->user_data3 = model; ret = rb_funcall((VALUE)func, id_call, 3, GOBJ2RVAL(model), GTKTREEITER2RVAL(iter), INT2NUM(column)); rbgobj_rvalue_to_gvalue(ret, value); } /* * Should return value * * e.g. * filter.set_modify_func(String) do |model, iter, column| * "foo" * end */ static VALUE rg_set_modify_func(int argc, VALUE *argv, VALUE self) { VALUE func = rb_block_proc(); gint i; GType* types; if (argc == 0) rb_raise(rb_eArgError, "need more than 1 class type."); types = ALLOCA_N(GType, argc); G_RELATIVE(self, func); for (i = 0; i < argc; i++){ types[i] = CLASS2GTYPE(argv[i]); } gtk_tree_model_filter_set_modify_func(_SELF(self), argc, types, (GtkTreeModelFilterModifyFunc)modify_func, (gpointer)func, NULL); return self; } static VALUE rg_set_visible_column(VALUE self, VALUE column) { gtk_tree_model_filter_set_visible_column(_SELF(self), NUM2INT(column)); return self; } static VALUE rg_model(VALUE self) { return GOBJ2RVAL(gtk_tree_model_filter_get_model(_SELF(self))); } static VALUE rg_convert_child_iter_to_iter(VALUE self, VALUE child_iter) { GtkTreeIter filter_iter; GtkTreeModelFilter* modelfilter = _SELF(self); gtk_tree_model_filter_convert_child_iter_to_iter(modelfilter, &filter_iter, RVAL2GTKTREEITER(child_iter)); filter_iter.user_data3 = gtk_tree_model_filter_get_model(modelfilter); return GTKTREEITER2RVAL(&filter_iter); } static VALUE rg_convert_iter_to_child_iter(VALUE self, VALUE filtered_iter) { GtkTreeIter child_iter; GtkTreeModelFilter* modelfilter = _SELF(self); gtk_tree_model_filter_convert_iter_to_child_iter(modelfilter, &child_iter, RVAL2GTKTREEITER(filtered_iter)); child_iter.user_data3 = gtk_tree_model_filter_get_model(modelfilter); return GTKTREEITER2RVAL(&child_iter); } static VALUE rg_convert_child_path_to_path(VALUE self, VALUE child_path) { return GTKTREEPATH2RVAL(gtk_tree_model_filter_convert_child_path_to_path( _SELF(self), RVAL2GTKTREEPATH(child_path))); } static VALUE rg_convert_path_to_child_path(VALUE self, VALUE filter_path) { return GTKTREEPATH2RVAL(gtk_tree_model_filter_convert_path_to_child_path( _SELF(self), RVAL2GTKTREEPATH(filter_path))); } static VALUE rg_refilter(VALUE self) { gtk_tree_model_filter_refilter(_SELF(self)); return self; } static VALUE rg_clear_cache(VALUE self) { gtk_tree_model_filter_clear_cache(_SELF(self)); return self; } void Init_gtk_treemodelfilter(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_MODEL_FILTER, "TreeModelFilter", mGtk); id_child_model = rb_intern("child_model"); id_root = rb_intern("root"); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_visible_func, 0); RG_DEF_METHOD(set_modify_func, -1); RG_DEF_METHOD(set_visible_column, 1); RG_DEF_METHOD(model, 0); RG_DEF_METHOD(convert_child_iter_to_iter, 1); RG_DEF_METHOD(convert_iter_to_child_iter, 1); RG_DEF_METHOD(convert_child_path_to_path, 1); RG_DEF_METHOD(convert_path_to_child_path, 1); RG_DEF_METHOD(refilter, 0); RG_DEF_METHOD(clear_cache, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkstock.c����������������������������������������������������0000644�0001750�0001750�00000031240�12257552167�017457� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 KUBO Takehiro * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mStock #define Check_Symbol(sym) do { \ if (!SYMBOL_P(sym)) \ rb_raise(rb_eArgError, "invalid argument %s (expect Symbol)", \ rb_class2name(CLASS_OF(sym))); \ } while (0) /* check whether sym is a Symbol or not in advance. */ #define SYM2CSTR(sym) rb_id2name(SYM2ID(sym)) #define CSTR2SYM(str) ID2SYM(rb_intern(str)) static VALUE rg_s_add(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE stock_id, label, modifier, keyval, translation_domain; GtkStockItem item; rb_scan_args(argc, argv, "23", &stock_id, &label, &modifier, &keyval, &translation_domain); Check_Symbol(stock_id); item.stock_id = (gchar *)SYM2CSTR(stock_id); item.label = (gchar *)RVAL2CSTR(label); item.modifier = NIL_P(modifier) ? 0 : NUM2UINT(modifier); item.keyval = NIL_P(keyval) ? 0 : NUM2UINT(keyval); item.translation_domain = NIL_P(translation_domain) ? NULL : (gchar *)RVAL2CSTR(translation_domain); gtk_stock_add(&item, 1); return Qnil; } static VALUE rg_s_lookup(G_GNUC_UNUSED VALUE self, VALUE stock_id) { GtkStockItem item; Check_Symbol(stock_id); if (gtk_stock_lookup(SYM2CSTR(stock_id), &item)) { return rb_ary_new3(5, CSTR2SYM(item.stock_id), CSTR2RVAL(item.label), UINT2NUM(item.modifier), UINT2NUM(item.keyval), CSTR2RVAL(item.translation_domain)); } rb_raise(rb_eArgError, "no such stock-id: %s", SYM2CSTR(stock_id)); } static VALUE rg_s_ids(G_GNUC_UNUSED VALUE self) { GSList *ids = gtk_stock_list_ids(); GSList *l; VALUE ary = rb_ary_new(); for (l = ids; l != NULL; l = g_slist_next(l)) { rb_ary_push(ary, CSTR2SYM(l->data)); g_free(l->data); } g_slist_free(ids); return ary; } static gchar * translate_func(const gchar *path, gpointer func) { VALUE ret = rb_funcall((VALUE)func, id_call, 1, CSTR2RVAL(path)); return (gchar *)RVAL2CSTR(ret); } static VALUE rg_s_set_translate_func(VALUE klass, VALUE domain) { VALUE func = rb_block_proc(); G_RELATIVE(klass, func); gtk_stock_set_translate_func(RVAL2CSTR(domain), (GtkTranslateFunc)translate_func, (gpointer)func, NULL); return Qnil; } void Init_gtk_stock(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "Stock"); rb_undef_method(RG_TARGET_NAMESPACE, "new"); RG_DEF_SMETHOD(add, -1); RG_DEF_SMETHOD(lookup, 1); RG_DEF_SMETHOD(ids, 0); RG_DEF_SMETHOD(set_translate_func, 1); /* Stock IDs (not all are stock items; some are images only) */ rb_define_const(RG_TARGET_NAMESPACE, "ABOUT", CSTR2SYM(GTK_STOCK_ABOUT)); rb_define_const(RG_TARGET_NAMESPACE, "ADD", CSTR2SYM(GTK_STOCK_ADD)); rb_define_const(RG_TARGET_NAMESPACE, "APPLY", CSTR2SYM(GTK_STOCK_APPLY)); rb_define_const(RG_TARGET_NAMESPACE, "BOLD", CSTR2SYM(GTK_STOCK_BOLD)); rb_define_const(RG_TARGET_NAMESPACE, "CANCEL", CSTR2SYM(GTK_STOCK_CANCEL)); #if GTK_CHECK_VERSION(2,16,0) rb_define_const(RG_TARGET_NAMESPACE, "CAPS_LOCK_WARNING", CSTR2SYM(GTK_STOCK_CAPS_LOCK_WARNING)); #endif rb_define_const(RG_TARGET_NAMESPACE, "CDROM", CSTR2SYM(GTK_STOCK_CDROM)); rb_define_const(RG_TARGET_NAMESPACE, "CLEAR", CSTR2SYM(GTK_STOCK_CLEAR)); rb_define_const(RG_TARGET_NAMESPACE, "CLOSE", CSTR2SYM(GTK_STOCK_CLOSE)); rb_define_const(RG_TARGET_NAMESPACE, "COLOR_PICKER", CSTR2SYM(GTK_STOCK_COLOR_PICKER)); rb_define_const(RG_TARGET_NAMESPACE, "CONVERT", CSTR2SYM(GTK_STOCK_CONVERT)); rb_define_const(RG_TARGET_NAMESPACE, "CONNECT", CSTR2SYM(GTK_STOCK_CONNECT)); rb_define_const(RG_TARGET_NAMESPACE, "COPY", CSTR2SYM(GTK_STOCK_COPY)); rb_define_const(RG_TARGET_NAMESPACE, "CUT", CSTR2SYM(GTK_STOCK_CUT)); rb_define_const(RG_TARGET_NAMESPACE, "DELETE", CSTR2SYM(GTK_STOCK_DELETE)); rb_define_const(RG_TARGET_NAMESPACE, "DIALOG_AUTHENTICATION", CSTR2SYM(GTK_STOCK_DIALOG_AUTHENTICATION)); rb_define_const(RG_TARGET_NAMESPACE, "DIALOG_ERROR", CSTR2SYM(GTK_STOCK_DIALOG_ERROR)); rb_define_const(RG_TARGET_NAMESPACE, "DIALOG_INFO", CSTR2SYM(GTK_STOCK_DIALOG_INFO)); rb_define_const(RG_TARGET_NAMESPACE, "DIALOG_QUESTION", CSTR2SYM(GTK_STOCK_DIALOG_QUESTION)); rb_define_const(RG_TARGET_NAMESPACE, "DIALOG_WARNING", CSTR2SYM(GTK_STOCK_DIALOG_WARNING)); rb_define_const(RG_TARGET_NAMESPACE, "DIRECTORY", CSTR2SYM(GTK_STOCK_DIRECTORY)); #if GTK_CHECK_VERSION(2,12,0) rb_define_const(RG_TARGET_NAMESPACE, "DISCARD", CSTR2SYM(GTK_STOCK_DISCARD)); #endif rb_define_const(RG_TARGET_NAMESPACE, "DISCONNECT", CSTR2SYM(GTK_STOCK_DISCONNECT)); rb_define_const(RG_TARGET_NAMESPACE, "DND", CSTR2SYM(GTK_STOCK_DND)); rb_define_const(RG_TARGET_NAMESPACE, "DND_MULTIPLE", CSTR2SYM(GTK_STOCK_DND_MULTIPLE)); rb_define_const(RG_TARGET_NAMESPACE, "EDIT", CSTR2SYM(GTK_STOCK_EDIT)); rb_define_const(RG_TARGET_NAMESPACE, "FILE", CSTR2SYM(GTK_STOCK_FILE)); rb_define_const(RG_TARGET_NAMESPACE, "EXECUTE", CSTR2SYM(GTK_STOCK_EXECUTE)); rb_define_const(RG_TARGET_NAMESPACE, "FIND", CSTR2SYM(GTK_STOCK_FIND)); rb_define_const(RG_TARGET_NAMESPACE, "FIND_AND_REPLACE", CSTR2SYM(GTK_STOCK_FIND_AND_REPLACE)); rb_define_const(RG_TARGET_NAMESPACE, "FLOPPY", CSTR2SYM(GTK_STOCK_FLOPPY)); rb_define_const(RG_TARGET_NAMESPACE, "FULLSCREEN", CSTR2SYM(GTK_STOCK_FULLSCREEN)); rb_define_const(RG_TARGET_NAMESPACE, "GOTO_BOTTOM", CSTR2SYM(GTK_STOCK_GOTO_BOTTOM)); rb_define_const(RG_TARGET_NAMESPACE, "GOTO_FIRST", CSTR2SYM(GTK_STOCK_GOTO_FIRST)); rb_define_const(RG_TARGET_NAMESPACE, "GOTO_LAST", CSTR2SYM(GTK_STOCK_GOTO_LAST)); rb_define_const(RG_TARGET_NAMESPACE, "GOTO_TOP", CSTR2SYM(GTK_STOCK_GOTO_TOP)); rb_define_const(RG_TARGET_NAMESPACE, "GO_BACK", CSTR2SYM(GTK_STOCK_GO_BACK)); rb_define_const(RG_TARGET_NAMESPACE, "GO_DOWN", CSTR2SYM(GTK_STOCK_GO_DOWN)); rb_define_const(RG_TARGET_NAMESPACE, "GO_FORWARD", CSTR2SYM(GTK_STOCK_GO_FORWARD)); rb_define_const(RG_TARGET_NAMESPACE, "GO_UP", CSTR2SYM(GTK_STOCK_GO_UP)); rb_define_const(RG_TARGET_NAMESPACE, "HARDDISK", CSTR2SYM(GTK_STOCK_HARDDISK)); rb_define_const(RG_TARGET_NAMESPACE, "HELP", CSTR2SYM(GTK_STOCK_HELP)); rb_define_const(RG_TARGET_NAMESPACE, "HOME", CSTR2SYM(GTK_STOCK_HOME)); rb_define_const(RG_TARGET_NAMESPACE, "INDENT", CSTR2SYM(GTK_STOCK_INDENT)); rb_define_const(RG_TARGET_NAMESPACE, "INFO", CSTR2SYM(GTK_STOCK_INFO)); rb_define_const(RG_TARGET_NAMESPACE, "INDEX", CSTR2SYM(GTK_STOCK_INDEX)); rb_define_const(RG_TARGET_NAMESPACE, "ITALIC", CSTR2SYM(GTK_STOCK_ITALIC)); rb_define_const(RG_TARGET_NAMESPACE, "JUMP_TO", CSTR2SYM(GTK_STOCK_JUMP_TO)); rb_define_const(RG_TARGET_NAMESPACE, "JUSTIFY_CENTER", CSTR2SYM(GTK_STOCK_JUSTIFY_CENTER)); rb_define_const(RG_TARGET_NAMESPACE, "JUSTIFY_FILL", CSTR2SYM(GTK_STOCK_JUSTIFY_FILL)); rb_define_const(RG_TARGET_NAMESPACE, "JUSTIFY_LEFT", CSTR2SYM(GTK_STOCK_JUSTIFY_LEFT)); rb_define_const(RG_TARGET_NAMESPACE, "JUSTIFY_RIGHT", CSTR2SYM(GTK_STOCK_JUSTIFY_RIGHT)); rb_define_const(RG_TARGET_NAMESPACE, "LEAVE_FULLSCREEN", CSTR2SYM(GTK_STOCK_LEAVE_FULLSCREEN)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_FORWARD", CSTR2SYM(GTK_STOCK_MEDIA_FORWARD)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_NEXT", CSTR2SYM(GTK_STOCK_MEDIA_NEXT)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_PAUSE", CSTR2SYM(GTK_STOCK_MEDIA_PAUSE)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_PLAY", CSTR2SYM(GTK_STOCK_MEDIA_PLAY)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_PREVIOUS", CSTR2SYM(GTK_STOCK_MEDIA_PREVIOUS)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_RECORD", CSTR2SYM(GTK_STOCK_MEDIA_RECORD)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_REWIND", CSTR2SYM(GTK_STOCK_MEDIA_REWIND)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_STOP", CSTR2SYM(GTK_STOCK_MEDIA_STOP)); rb_define_const(RG_TARGET_NAMESPACE, "MISSING_IMAGE", CSTR2SYM(GTK_STOCK_MISSING_IMAGE)); rb_define_const(RG_TARGET_NAMESPACE, "NETWORK", CSTR2SYM(GTK_STOCK_NETWORK)); rb_define_const(RG_TARGET_NAMESPACE, "NEW", CSTR2SYM(GTK_STOCK_NEW)); rb_define_const(RG_TARGET_NAMESPACE, "NO", CSTR2SYM(GTK_STOCK_NO)); rb_define_const(RG_TARGET_NAMESPACE, "OK", CSTR2SYM(GTK_STOCK_OK)); rb_define_const(RG_TARGET_NAMESPACE, "OPEN", CSTR2SYM(GTK_STOCK_OPEN)); rb_define_const(RG_TARGET_NAMESPACE, "ORIENTATION_LANDSCAPE", CSTR2SYM(GTK_STOCK_ORIENTATION_LANDSCAPE)); rb_define_const(RG_TARGET_NAMESPACE, "ORIENTATION_PORTRAIT", CSTR2SYM(GTK_STOCK_ORIENTATION_PORTRAIT)); rb_define_const(RG_TARGET_NAMESPACE, "ORIENTATION_REVERSE_LANDSCAPE", CSTR2SYM(GTK_STOCK_ORIENTATION_REVERSE_LANDSCAPE)); rb_define_const(RG_TARGET_NAMESPACE, "ORIENTATION_REVERSE_PORTRAIT", CSTR2SYM(GTK_STOCK_ORIENTATION_REVERSE_PORTRAIT)); #if GTK_CHECK_VERSION(2,14,0) rb_define_const(RG_TARGET_NAMESPACE, "PAGE_SETUP", CSTR2SYM(GTK_STOCK_PAGE_SETUP)); #endif rb_define_const(RG_TARGET_NAMESPACE, "PASTE", CSTR2SYM(GTK_STOCK_PASTE)); rb_define_const(RG_TARGET_NAMESPACE, "PREFERENCES", CSTR2SYM(GTK_STOCK_PREFERENCES)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT", CSTR2SYM(GTK_STOCK_PRINT)); #if GTK_CHECK_VERSION(2,14,0) rb_define_const(RG_TARGET_NAMESPACE, "PRINT_ERROR", CSTR2SYM(GTK_STOCK_PRINT_ERROR)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT_PAUSED", CSTR2SYM(GTK_STOCK_PRINT_PAUSED)); #endif rb_define_const(RG_TARGET_NAMESPACE, "PRINT_PREVIEW", CSTR2SYM(GTK_STOCK_PRINT_PREVIEW)); #if GTK_CHECK_VERSION(2,14,0) rb_define_const(RG_TARGET_NAMESPACE, "PRINT_REPORT", CSTR2SYM(GTK_STOCK_PRINT_REPORT)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT_WARNING", CSTR2SYM(GTK_STOCK_PRINT_WARNING)); #endif rb_define_const(RG_TARGET_NAMESPACE, "PROPERTIES", CSTR2SYM(GTK_STOCK_PROPERTIES)); rb_define_const(RG_TARGET_NAMESPACE, "QUIT", CSTR2SYM(GTK_STOCK_QUIT)); rb_define_const(RG_TARGET_NAMESPACE, "REDO", CSTR2SYM(GTK_STOCK_REDO)); rb_define_const(RG_TARGET_NAMESPACE, "REFRESH", CSTR2SYM(GTK_STOCK_REFRESH)); rb_define_const(RG_TARGET_NAMESPACE, "REMOVE", CSTR2SYM(GTK_STOCK_REMOVE)); rb_define_const(RG_TARGET_NAMESPACE, "REVERT_TO_SAVED", CSTR2SYM(GTK_STOCK_REVERT_TO_SAVED)); rb_define_const(RG_TARGET_NAMESPACE, "SAVE", CSTR2SYM(GTK_STOCK_SAVE)); rb_define_const(RG_TARGET_NAMESPACE, "SAVE_AS", CSTR2SYM(GTK_STOCK_SAVE_AS)); rb_define_const(RG_TARGET_NAMESPACE, "SELECT_ALL", CSTR2SYM(GTK_STOCK_SELECT_ALL)); rb_define_const(RG_TARGET_NAMESPACE, "SELECT_COLOR", CSTR2SYM(GTK_STOCK_SELECT_COLOR)); rb_define_const(RG_TARGET_NAMESPACE, "SELECT_FONT", CSTR2SYM(GTK_STOCK_SELECT_FONT)); rb_define_const(RG_TARGET_NAMESPACE, "SORT_ASCENDING", CSTR2SYM(GTK_STOCK_SORT_ASCENDING)); rb_define_const(RG_TARGET_NAMESPACE, "SORT_DESCENDING", CSTR2SYM(GTK_STOCK_SORT_DESCENDING)); rb_define_const(RG_TARGET_NAMESPACE, "SPELL_CHECK", CSTR2SYM(GTK_STOCK_SPELL_CHECK)); rb_define_const(RG_TARGET_NAMESPACE, "STOP", CSTR2SYM(GTK_STOCK_STOP)); rb_define_const(RG_TARGET_NAMESPACE, "STRIKETHROUGH", CSTR2SYM(GTK_STOCK_STRIKETHROUGH)); rb_define_const(RG_TARGET_NAMESPACE, "UNDELETE", CSTR2SYM(GTK_STOCK_UNDELETE)); rb_define_const(RG_TARGET_NAMESPACE, "UNDERLINE", CSTR2SYM(GTK_STOCK_UNDERLINE)); rb_define_const(RG_TARGET_NAMESPACE, "UNDO", CSTR2SYM(GTK_STOCK_UNDO)); rb_define_const(RG_TARGET_NAMESPACE, "UNINDENT", CSTR2SYM(GTK_STOCK_UNINDENT)); rb_define_const(RG_TARGET_NAMESPACE, "YES", CSTR2SYM(GTK_STOCK_YES)); rb_define_const(RG_TARGET_NAMESPACE, "ZOOM_100", CSTR2SYM(GTK_STOCK_ZOOM_100)); rb_define_const(RG_TARGET_NAMESPACE, "ZOOM_FIT", CSTR2SYM(GTK_STOCK_ZOOM_FIT)); rb_define_const(RG_TARGET_NAMESPACE, "ZOOM_IN", CSTR2SYM(GTK_STOCK_ZOOM_IN)); rb_define_const(RG_TARGET_NAMESPACE, "ZOOM_OUT", CSTR2SYM(GTK_STOCK_ZOOM_OUT)); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkscrollbar.c������������������������������������������������0000644�0001750�0001750�00000002235�11701304107�020277� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" void Init_gtk_scrollbar(VALUE mGtk) { G_DEF_CLASS(GTK_TYPE_SCROLLBAR, "Scrollbar", mGtk); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkprintsettings.c��������������������������������������������0000644�0001750�0001750�00000056570�12257552167�021266� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cPrintSettings #define _SELF(s) (GTK_PRINT_SETTINGS(RVAL2GOBJ(s))) #define RVAL2UNIT(o) (RVAL2GENUM(o, GTK_TYPE_UNIT)) static VALUE s_string, s_bool, s_double, s_length, s_int; #if GTK_CHECK_VERSION(2,12,0) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2; GtkPrintSettings* settings = NULL; GError *error = NULL; rb_scan_args(argc, argv, "02", &arg1, &arg2); if (NIL_P(arg1)){ settings = gtk_print_settings_new(); } else if (NIL_P(arg2)){ settings = gtk_print_settings_new_from_file(RVAL2CSTR(arg1), &error); if (!settings) { RAISE_GERROR(error); } } else { settings = gtk_print_settings_new_from_key_file((GKeyFile*)RVAL2BOXED(arg1, G_TYPE_KEY_FILE), RVAL2CSTR(arg2), &error); if (!settings) { RAISE_GERROR(error); } } G_INITIALIZE(self, settings); return Qnil; } #else static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_print_settings_new()); return Qnil; } #endif static VALUE rg_dup(VALUE self) { return GOBJ2RVALU(gtk_print_settings_copy(_SELF(self))); } static VALUE rg_has_key_p(VALUE self, VALUE key) { return CBOOL2RVAL(gtk_print_settings_has_key(_SELF(self), RVAL2CSTR(key))); } static VALUE ps_get(VALUE self, VALUE key) { return CSTR2RVAL(gtk_print_settings_get(_SELF(self), RVAL2CSTR(key))); } static VALUE ps_set(VALUE self, VALUE key, VALUE value) { gtk_print_settings_set(_SELF(self), RVAL2CSTR(key), RVAL2CSTR_ACCEPT_NIL(value)); return self; } static VALUE rg_unset(VALUE self, VALUE key) { gtk_print_settings_unset(_SELF(self), RVAL2CSTR(key)); return self; } static void ps_foreach_cb(const gchar *key, const gchar *value, gpointer data) { rb_funcall((VALUE)data, id_call, 2, CSTR2RVAL(key), CSTR2RVAL(value)); } static VALUE rg_each(VALUE self) { gtk_print_settings_foreach(_SELF(self), ps_foreach_cb, (gpointer)rb_block_proc()); return self; } static VALUE rg_get_bool(VALUE self, VALUE key) { return CBOOL2RVAL(gtk_print_settings_get_bool(_SELF(self), RVAL2CSTR(key))); } static VALUE ps_set_bool(VALUE self, VALUE key, VALUE value) { gtk_print_settings_set_bool(_SELF(self), RVAL2CSTR(key), RVAL2CBOOL(value)); return self; } static VALUE rg_get_double(int argc, VALUE *argv, VALUE self) { VALUE key, default_value; gdouble value; rb_scan_args(argc, argv, "11", &key, &default_value); if (NIL_P(default_value)) value = gtk_print_settings_get_double(_SELF(self), RVAL2CSTR(key)); else value = gtk_print_settings_get_double_with_default(_SELF(self), RVAL2CSTR(key), NUM2DBL(default_value)); return rb_float_new(value); } static VALUE ps_set_double(VALUE self, VALUE key, VALUE value) { gtk_print_settings_set_double(_SELF(self), RVAL2CSTR(key), NUM2DBL(value)); return self; } static VALUE rg_get_length(VALUE self, VALUE key, VALUE unit) { return rb_float_new(gtk_print_settings_get_length(_SELF(self), RVAL2CSTR(key), RVAL2UNIT(unit))); } static VALUE ps_set_length(VALUE self, VALUE key, VALUE value, VALUE unit) { gtk_print_settings_set_length(_SELF(self), RVAL2CSTR(key), NUM2DBL(value), RVAL2UNIT(unit)); return self; } static VALUE rg_get_int(int argc, VALUE *argv, VALUE self) { VALUE key, default_value; gint value; rb_scan_args(argc, argv, "11", &key, &default_value); if (NIL_P(default_value)) value = gtk_print_settings_get_int(_SELF(self), RVAL2CSTR(key)); else value = gtk_print_settings_get_int_with_default(_SELF(self), RVAL2CSTR(key), NUM2INT(default_value)); return INT2NUM(value); } static VALUE ps_set_int(VALUE self, VALUE key, VALUE value) { gtk_print_settings_set_int(_SELF(self), RVAL2CSTR(key), NUM2INT(value)); return self; } static VALUE rg_get(int argc, VALUE *argv, VALUE self) { VALUE key, type, unit_or_default, result; rb_scan_args(argc, argv, "12", &key, &type, &unit_or_default); if (NIL_P(type) || (RVAL2CBOOL(rb_equal(type, s_string)))) { result = ps_get(self, key); } else if (RVAL2CBOOL(rb_equal(type, s_bool))) { result = rg_get_bool(self, key); } else if (RVAL2CBOOL(rb_equal(type, s_double))) { VALUE double_argv[2]; double_argv[0] = key; double_argv[1] = unit_or_default; result = rg_get_double(2, double_argv, self); } else if (RVAL2CBOOL(rb_equal(type, s_length))) { result = rg_get_length(self, key, unit_or_default); } else if (RVAL2CBOOL(rb_equal(type, s_int))) { VALUE int_argv[2]; int_argv[0] = key; int_argv[1] = unit_or_default; result = rg_get_int(2, int_argv, self); } else { VALUE inspected_type; inspected_type = rb_inspect(type); rb_raise(rb_eArgError, "%s must be nil, :string, :bool, :double, :length or :int", RVAL2CSTR(inspected_type)); } return result; } static VALUE rg_set(int argc, VALUE *argv, VALUE self) { VALUE key, value, unit; rb_scan_args(argc, argv, "21", &key, &value, &unit); switch (TYPE(value)) { case T_STRING: ps_set(self, key, value); break; case T_TRUE: case T_FALSE: ps_set_bool(self, key, value); break; case T_FIXNUM: ps_set_int(self, key, value); break; case T_FLOAT: if (NIL_P(unit)) { ps_set_double(self, key, value); } else { ps_set_length(self, key, value, unit); } break; case T_NIL: rg_unset(self, key); break; default: { VALUE inspected_value; inspected_value = rb_inspect(value); rb_raise(rb_eArgError, "%s is invalid value", RVAL2CSTR(inspected_value)); break; } } return self; } static VALUE rg_operator_ps_set_generic_indexer(int argc, VALUE *argv, VALUE self) { if (argc == 3) { VALUE swapped_argv[3]; swapped_argv[0] = argv[0]; swapped_argv[1] = argv[2]; swapped_argv[2] = argv[1]; rg_set(argc, swapped_argv, self); } else if (argc == 2) { rg_set(argc, argv, self); } else { rb_raise(rb_eArgError, "wrong number of arguments (%d for 2 or 3)", argc); } return argv[2]; } /* Helpers: */ static VALUE rg_printer(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_printer(_SELF(self))); } static VALUE rg_set_printer(VALUE self, VALUE printer) { gtk_print_settings_set_printer(_SELF(self), RVAL2CSTR_ACCEPT_NIL(printer)); return self; } static VALUE rg_orientation(VALUE self) { return GENUM2RVAL(gtk_print_settings_get_orientation(_SELF(self)), GTK_TYPE_PAGE_ORIENTATION); } static VALUE rg_set_orientation(VALUE self, VALUE orientation) { gtk_print_settings_set_orientation(_SELF(self), RVAL2GENUM(orientation, GTK_TYPE_PAGE_ORIENTATION)); return self; } static VALUE rg_paper_size(VALUE self) { return GOBJ2RVAL(gtk_print_settings_get_paper_size(_SELF(self))); } static VALUE rg_set_paper_size(VALUE self, VALUE paper_size) { gtk_print_settings_set_paper_size(_SELF(self), RVAL2BOXED(paper_size, GTK_TYPE_PAPER_SIZE)); return self; } static VALUE rg_paper_width(VALUE self, VALUE unit) { return rb_float_new(gtk_print_settings_get_paper_width(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_set_paper_width(VALUE self, VALUE paper_width, VALUE unit) { gtk_print_settings_set_paper_width(_SELF(self), NUM2DBL(paper_width), RVAL2UNIT(unit)); return self; } static VALUE rg_paper_height(VALUE self, VALUE unit) { return rb_float_new(gtk_print_settings_get_paper_height(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_set_paper_height(VALUE self, VALUE paper_height, VALUE unit) { gtk_print_settings_set_paper_height(_SELF(self), NUM2DBL(paper_height), RVAL2UNIT(unit)); return self; } static VALUE rg_use_color_p(VALUE self) { return CBOOL2RVAL(gtk_print_settings_get_use_color(_SELF(self))); } static VALUE rg_set_use_color(VALUE self, VALUE use_color) { gtk_print_settings_set_use_color(_SELF(self), RVAL2CBOOL(use_color)); return self; } static VALUE rg_collate_p(VALUE self) { return CBOOL2RVAL(gtk_print_settings_get_collate(_SELF(self))); } static VALUE rg_set_collate(VALUE self, VALUE collate) { gtk_print_settings_set_collate(_SELF(self), RVAL2CBOOL(collate)); return self; } static VALUE rg_reverse_p(VALUE self) { return CBOOL2RVAL(gtk_print_settings_get_reverse(_SELF(self))); } static VALUE rg_set_reverse(VALUE self, VALUE reverse) { gtk_print_settings_set_reverse(_SELF(self), RVAL2CBOOL(reverse)); return self; } static VALUE rg_duplex(VALUE self) { return GENUM2RVAL(gtk_print_settings_get_duplex(_SELF(self)), GTK_TYPE_PRINT_DUPLEX); } static VALUE rg_set_duplex(VALUE self, VALUE duplex) { gtk_print_settings_set_duplex(_SELF(self), RVAL2GENUM(duplex, GTK_TYPE_PRINT_DUPLEX)); return self; } static VALUE rg_quality(VALUE self) { return GENUM2RVAL(gtk_print_settings_get_quality(_SELF(self)), GTK_TYPE_PRINT_QUALITY); } static VALUE rg_set_quality(VALUE self, VALUE quality) { gtk_print_settings_set_quality(_SELF(self), RVAL2GENUM(quality, GTK_TYPE_PRINT_QUALITY)); return self; } static VALUE rg_n_copies(VALUE self) { return INT2NUM(gtk_print_settings_get_n_copies(_SELF(self))); } static VALUE rg_set_n_copies(VALUE self, VALUE n_copies) { gtk_print_settings_set_n_copies(_SELF(self), NUM2INT(n_copies)); return self; } static VALUE rg_number_up(VALUE self) { return INT2NUM(gtk_print_settings_get_number_up(_SELF(self))); } static VALUE rg_set_number_up(VALUE self, VALUE number_up) { gtk_print_settings_set_number_up(_SELF(self), NUM2INT(number_up)); return self; } static VALUE rg_resolution(VALUE self) { return INT2NUM(gtk_print_settings_get_resolution(_SELF(self))); } static VALUE rg_set_resolution(VALUE self, VALUE resolution) { gtk_print_settings_set_resolution(_SELF(self), NUM2INT(resolution)); return self; } static VALUE rg_scale(VALUE self) { return rb_float_new(gtk_print_settings_get_scale(_SELF(self))); } static VALUE rg_set_scale(VALUE self, VALUE scale) { gtk_print_settings_set_scale(_SELF(self), NUM2DBL(scale)); return self; } static VALUE rg_print_pages(VALUE self) { return GENUM2RVAL(gtk_print_settings_get_print_pages(_SELF(self)), GTK_TYPE_PRINT_PAGES); } static VALUE rg_set_print_pages(VALUE self, VALUE print_pages) { gtk_print_settings_set_print_pages(_SELF(self), RVAL2GENUM(print_pages, GTK_TYPE_PRINT_PAGES)); return self; } static VALUE rg_page_ranges(VALUE self) { VALUE rb_ranges; GtkPageRange *ranges; int i, num_ranges; ranges = gtk_print_settings_get_page_ranges(_SELF(self), &num_ranges); rb_ranges = rb_ary_new2(num_ranges); for (i = 0; i < num_ranges; i++) { rb_ary_push(rb_ranges, rb_ary_new3(2, INT2NUM(ranges[i].start), INT2NUM(ranges[i].end))); } g_free(ranges); return rb_ranges; } struct rbgtk_rval2gtkpageranges_args { VALUE ary; long n; GtkPageRange *result; }; static VALUE rbgtk_rval2gtkpageranges_body(VALUE value) { long i; struct rbgtk_rval2gtkpageranges_args *args = (struct rbgtk_rval2gtkpageranges_args *)value; for (i = 0; i < args->n; i++) { VALUE ary = rb_ary_to_ary(RARRAY_PTR(args->ary)[i]); if (RARRAY_LEN(ary) != 2) rb_raise(rb_eArgError, "range %ld should be array of size 2", i); args->result[i].start = NUM2INT(RARRAY_PTR(ary)[0]); args->result[i].end = NUM2INT(RARRAY_PTR(ary)[1]); } return Qnil; } static G_GNUC_NORETURN VALUE rbgtk_rval2gtkpageranges_rescue(VALUE value) { g_free(((struct rbgtk_rval2gtkpageranges_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GtkPageRange * rbgtk_rval2gtkpageranges(VALUE value, long *n) { struct rbgtk_rval2gtkpageranges_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GtkPageRange, args.n + 1); rb_rescue(rbgtk_rval2gtkpageranges_body, (VALUE)&args, rbgtk_rval2gtkpageranges_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } #define RVAL2GTKPAGERANGES(value, n) rbgtk_rval2gtkpageranges(value, n) static VALUE rg_set_page_ranges(VALUE self, VALUE rbpage_ranges) { GtkPrintSettings *settings = _SELF(self); long n; GtkPageRange *page_ranges = RVAL2GTKPAGERANGES(rbpage_ranges, &n); gtk_print_settings_set_page_ranges(settings, page_ranges, n); g_free(page_ranges); return self; } static VALUE rg_page_set(VALUE self) { return GENUM2RVAL(gtk_print_settings_get_page_set(_SELF(self)), GTK_TYPE_PAGE_SET); } static VALUE rg_set_page_set(VALUE self, VALUE page_set) { gtk_print_settings_set_page_set(_SELF(self), RVAL2GENUM(page_set, GTK_TYPE_PAGE_SET)); return self; } static VALUE rg_default_source(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_default_source(_SELF(self))); } static VALUE rg_set_default_source(VALUE self, VALUE default_source) { gtk_print_settings_set_default_source(_SELF(self), RVAL2CSTR_ACCEPT_NIL(default_source)); return self; } static VALUE rg_media_type(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_media_type(_SELF(self))); } static VALUE rg_set_media_type(VALUE self, VALUE media_type) { gtk_print_settings_set_media_type(_SELF(self), RVAL2CSTR_ACCEPT_NIL(media_type)); return self; } static VALUE rg_dither(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_dither(_SELF(self))); } static VALUE rg_set_dither(VALUE self, VALUE dither) { gtk_print_settings_set_dither(_SELF(self), RVAL2CSTR_ACCEPT_NIL(dither)); return self; } static VALUE rg_finishings(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_finishings(_SELF(self))); } static VALUE rg_set_finishings(VALUE self, VALUE finishings) { gtk_print_settings_set_finishings(_SELF(self), RVAL2CSTR_ACCEPT_NIL(finishings)); return self; } static VALUE rg_output_bin(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_output_bin(_SELF(self))); } static VALUE rg_set_output_bin(VALUE self, VALUE output_bin) { gtk_print_settings_set_output_bin(_SELF(self), RVAL2CSTR_ACCEPT_NIL(output_bin)); return self; } #if GTK_CHECK_VERSION(2,12,0) static VALUE rg_to_file(VALUE self, VALUE file_name) { GError *error = NULL; if (!gtk_print_settings_to_file(_SELF(self), RVAL2CSTR(file_name), &error)) { RAISE_GERROR(error); } return self; } static VALUE rg_to_key_file(int argc, VALUE *argv, VALUE self) { VALUE key_file, group_name; rb_scan_args(argc, argv, "11", &key_file, &group_name); gtk_print_settings_to_key_file(_SELF(self), (GKeyFile*)RVAL2BOXED(key_file, G_TYPE_KEY_FILE), RVAL2CSTR_ACCEPT_NIL(group_name)); return self; } #endif void Init_gtk_print_settings(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE; s_string = ID2SYM(rb_intern("string")); s_bool = ID2SYM(rb_intern("bool")); s_double = ID2SYM(rb_intern("double")); s_length = ID2SYM(rb_intern("length")); s_int = ID2SYM(rb_intern("int")); RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_SETTINGS, "PrintSettings", mGtk); rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable); #if GTK_CHECK_VERSION(2,12,0) RG_DEF_METHOD(initialize, -1); #else RG_DEF_METHOD(initialize, 0); #endif RG_DEF_METHOD(dup, 0); RG_DEF_METHOD_P(has_key, 1); RG_DEF_METHOD(get, -1); RG_DEF_ALIAS("[]", "get"); RG_DEF_METHOD(get_bool, 1); RG_DEF_METHOD(get_double, -1); RG_DEF_METHOD(get_length, 2); RG_DEF_METHOD(get_int, -1); RG_DEF_METHOD(set, -1); RG_DEF_METHOD_OPERATOR("[]=", ps_set_generic_indexer, -1); RG_DEF_METHOD(unset, -1); RG_DEF_ALIAS("delete", "unset"); RG_DEF_METHOD(each, 0); rb_define_const(RG_TARGET_NAMESPACE, "PRINTER", CSTR2RVAL(GTK_PRINT_SETTINGS_PRINTER)); rb_define_const(RG_TARGET_NAMESPACE, "ORIENTATION", CSTR2RVAL(GTK_PRINT_SETTINGS_ORIENTATION)); rb_define_const(RG_TARGET_NAMESPACE, "PAPER_FORMAT", CSTR2RVAL(GTK_PRINT_SETTINGS_PAPER_FORMAT)); rb_define_const(RG_TARGET_NAMESPACE, "PAPER_WIDTH", CSTR2RVAL(GTK_PRINT_SETTINGS_PAPER_WIDTH)); rb_define_const(RG_TARGET_NAMESPACE, "PAPER_HEIGHT", CSTR2RVAL(GTK_PRINT_SETTINGS_PAPER_HEIGHT)); rb_define_const(RG_TARGET_NAMESPACE, "N_COPIES", CSTR2RVAL(GTK_PRINT_SETTINGS_N_COPIES)); rb_define_const(RG_TARGET_NAMESPACE, "DEFAULT_SOURCE", CSTR2RVAL(GTK_PRINT_SETTINGS_DEFAULT_SOURCE)); rb_define_const(RG_TARGET_NAMESPACE, "QUALITY", CSTR2RVAL(GTK_PRINT_SETTINGS_QUALITY)); rb_define_const(RG_TARGET_NAMESPACE, "RESOLUTION", CSTR2RVAL(GTK_PRINT_SETTINGS_RESOLUTION)); rb_define_const(RG_TARGET_NAMESPACE, "USE_COLOR", CSTR2RVAL(GTK_PRINT_SETTINGS_USE_COLOR)); rb_define_const(RG_TARGET_NAMESPACE, "DUPLEX", CSTR2RVAL(GTK_PRINT_SETTINGS_DUPLEX)); rb_define_const(RG_TARGET_NAMESPACE, "COLLATE", CSTR2RVAL(GTK_PRINT_SETTINGS_COLLATE)); rb_define_const(RG_TARGET_NAMESPACE, "REVERSE", CSTR2RVAL(GTK_PRINT_SETTINGS_REVERSE)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_TYPE", CSTR2RVAL(GTK_PRINT_SETTINGS_MEDIA_TYPE)); rb_define_const(RG_TARGET_NAMESPACE, "DITHER", CSTR2RVAL(GTK_PRINT_SETTINGS_DITHER)); rb_define_const(RG_TARGET_NAMESPACE, "SCALE", CSTR2RVAL(GTK_PRINT_SETTINGS_SCALE)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT_PAGES", CSTR2RVAL(GTK_PRINT_SETTINGS_PRINT_PAGES)); rb_define_const(RG_TARGET_NAMESPACE, "PAGE_RANGES", CSTR2RVAL(GTK_PRINT_SETTINGS_PAGE_RANGES)); rb_define_const(RG_TARGET_NAMESPACE, "PAGE_SET", CSTR2RVAL(GTK_PRINT_SETTINGS_PAGE_SET)); rb_define_const(RG_TARGET_NAMESPACE, "FINISHINGS", CSTR2RVAL(GTK_PRINT_SETTINGS_FINISHINGS)); rb_define_const(RG_TARGET_NAMESPACE, "NUMBER_UP", CSTR2RVAL(GTK_PRINT_SETTINGS_NUMBER_UP)); rb_define_const(RG_TARGET_NAMESPACE, "OUTPUT_BIN", CSTR2RVAL(GTK_PRINT_SETTINGS_OUTPUT_BIN)); rb_define_const(RG_TARGET_NAMESPACE, "OUTPUT_FILE_FORMAT", CSTR2RVAL(GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT)); rb_define_const(RG_TARGET_NAMESPACE, "OUTPUT_URI", CSTR2RVAL(GTK_PRINT_SETTINGS_OUTPUT_URI)); rb_define_const(RG_TARGET_NAMESPACE, "WIN32_DRIVER_VERSION", CSTR2RVAL(GTK_PRINT_SETTINGS_WIN32_DRIVER_VERSION)); rb_define_const(RG_TARGET_NAMESPACE, "WIN32_DRIVER_EXTRA", CSTR2RVAL(GTK_PRINT_SETTINGS_WIN32_DRIVER_EXTRA)); /* Helpers: */ RG_DEF_METHOD(printer, 0); RG_DEF_METHOD(set_printer, 1); RG_DEF_METHOD(orientation, 0); RG_DEF_METHOD(set_orientation, 1); RG_DEF_METHOD(paper_size, 0); RG_DEF_METHOD(set_paper_size, 1); RG_DEF_METHOD(paper_width, 1); RG_DEF_METHOD(set_paper_width, 2); RG_DEF_METHOD(paper_height, 1); RG_DEF_METHOD(set_paper_height, 2); RG_DEF_METHOD_P(use_color, 0); RG_DEF_METHOD(set_use_color, 1); RG_DEF_METHOD_P(collate, 0); RG_DEF_METHOD(set_collate, 1); RG_DEF_METHOD_P(reverse, 0); RG_DEF_METHOD(set_reverse, 1); RG_DEF_METHOD(duplex, 0); RG_DEF_METHOD(set_duplex, 1); RG_DEF_METHOD(quality, 0); RG_DEF_METHOD(set_quality, 1); RG_DEF_METHOD(n_copies, 0); RG_DEF_METHOD(set_n_copies, 1); RG_DEF_METHOD(number_up, 0); RG_DEF_METHOD(set_number_up, 1); RG_DEF_METHOD(resolution, 0); RG_DEF_METHOD(set_resolution, 1); RG_DEF_METHOD(scale, 0); RG_DEF_METHOD(set_scale, 1); RG_DEF_METHOD(print_pages, 0); RG_DEF_METHOD(set_print_pages, 1); RG_DEF_METHOD(page_ranges, 0); RG_DEF_METHOD(set_page_ranges, 1); RG_DEF_METHOD(page_set, 0); RG_DEF_METHOD(set_page_set, 1); RG_DEF_METHOD(default_source, 0); RG_DEF_METHOD(set_default_source, 1); RG_DEF_METHOD(media_type, 0); RG_DEF_METHOD(set_media_type, 1); RG_DEF_METHOD(dither, 0); RG_DEF_METHOD(set_dither, 1); RG_DEF_METHOD(finishings, 0); RG_DEF_METHOD(set_finishings, 1); RG_DEF_METHOD(output_bin, 0); RG_DEF_METHOD(set_output_bin, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkPageOrientation */ G_DEF_CLASS(GTK_TYPE_PAGE_ORIENTATION, "PageOrientation", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PAGE_ORIENTATION, "GTK_PAGE_"); /* GtkPrintDuplex */ G_DEF_CLASS(GTK_TYPE_PRINT_DUPLEX, "PrintDuplex", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PRINT_DUPLEX, "GTK_PRINT_"); /* GtkPrintQuality */ G_DEF_CLASS(GTK_TYPE_PRINT_QUALITY, "PrintQuality", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PRINT_QUALITY, "GTK_PRINT_"); /* GtkPrintPages */ G_DEF_CLASS(GTK_TYPE_PRINT_PAGES, "PrintPages", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PRINT_PAGES, "GTK_PRINT_"); /* GtkPageSet */ G_DEF_CLASS(GTK_TYPE_PAGE_SET, "PageSet", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PAGE_SET, "GTK_"); #if GTK_CHECK_VERSION(2,12,0) RG_DEF_METHOD(to_file, 1); RG_DEF_METHOD(to_key_file, -1); #endif } ����������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkinput.c����������������������������������������������������0000644�0001750�0001750�00000004526�11701304107�017440� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mInput static void exec_input(gpointer data, G_GNUC_UNUSED gint source, GdkInputCondition condition) { rb_funcall((VALUE)data, id_call, 1, GFLAGS2RVAL(condition, GDK_TYPE_INPUT_CONDITION)); } static VALUE rg_m_add(VALUE self, VALUE filedescriptor, VALUE gdk_input_condition) { VALUE id; VALUE func; func = rb_block_proc(); id = INT2FIX(gdk_input_add(NUM2INT(rb_funcall(filedescriptor, rb_intern("to_i"), 0)), RVAL2GFLAGS(gdk_input_condition, GDK_TYPE_INPUT_CONDITION), (GdkInputFunction)exec_input, (gpointer)func)); G_RELATIVE2(self, func, id_relative_callbacks, id); return id; } static VALUE rg_m_remove(VALUE self, VALUE id) { gdk_input_remove(NUM2INT(id)); G_REMOVE_RELATIVE(self, id_relative_callbacks, id); return id; } void Init_gtk_gdk_input(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Input"); RG_DEF_MODFUNC(add, 2); RG_DEF_MODFUNC(remove, 1); /* GdkInputCondition */ G_DEF_CLASS(GDK_TYPE_INPUT_CONDITION, "Condition", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_INPUT_CONDITION, "GDK_INPUT_"); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreedragsource.c�������������������������������������������0000644�0001750�0001750�00000002030�11701304107�021323� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" void Init_gtk_treedragsource(VALUE mGtk) { G_DEF_INTERFACE(GTK_TYPE_TREE_DRAG_SOURCE, "TreeDragSource", mGtk); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkcolormap.c�������������������������������������������������0000644�0001750�0001750�00000007606�12257552167�020141� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cColormap #define _SELF(self) (GDK_COLORMAP(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self, VALUE visual, VALUE allocate) { GdkColormap *cmap = gdk_colormap_new(GDK_VISUAL(RVAL2GOBJ(visual)), RVAL2CBOOL(allocate)); G_INITIALIZE(self, cmap); return Qnil; } static VALUE rg_s_system(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_colormap_get_system()); } /* Don't implement this. Because API is ugly (especially treating of "success"). Use Gdk::Colormap#alloc_color instead. gint gdk_colormap_alloc_colors (GdkColormap *colormap, GdkColor *colors, gint ncolors, gboolean writeable, gboolean best_match, gboolean *success); */ static VALUE rg_alloc_color(VALUE self, VALUE color, VALUE writeable, VALUE best_match) { gboolean result; GdkColor *c = RVAL2GDKCOLOR(color); result = gdk_colormap_alloc_color(_SELF(self), c, RVAL2CBOOL(writeable), RVAL2CBOOL(best_match)); return result ? INT2NUM(c->pixel) : Qnil; } /* Don't implement Gdk::Colormap#free_colors. Because it should be pair with Gdk::Colormap#alloc_colors */ static VALUE rg_free_color(VALUE self, VALUE color) { gdk_colormap_free_colors(_SELF(self), RVAL2GDKCOLOR(color), 1); return self; } static VALUE rg_query_color(VALUE self, VALUE pixel) { GdkColor color; gdk_colormap_query_color(_SELF(self), NUM2ULONG(pixel), &color); return GDKCOLOR2RVAL(&color); } static VALUE rg_visual(VALUE self) { return GOBJ2RVAL(gdk_colormap_get_visual(_SELF(self))); } static VALUE rg_screen(VALUE self) { return GOBJ2RVAL(gdk_colormap_get_screen(_SELF(self))); } static VALUE rg_colors(VALUE self) { GdkColormap *cmap; GdkColor *colors; GdkVisual *visual; VALUE ary; int i; cmap = _SELF(self); colors = cmap->colors; visual = gdk_colormap_get_visual(cmap); if (visual->type == GDK_VISUAL_GRAYSCALE || visual->type == GDK_VISUAL_PSEUDO_COLOR) { ary = rb_ary_new2(cmap->size); for (i = 0; i < cmap->size; i++) { rb_ary_push(ary, BOXED2RVAL(colors, GDK_TYPE_COLOR)); colors++; } return ary; } else { return Qnil; } } void Init_gtk_gdk_colormap(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_COLORMAP, "Colormap", mGdk); RG_DEF_SMETHOD(system, 0); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(alloc_color, 3); RG_DEF_METHOD(free_color, 1); RG_DEF_METHOD(query_color, 1); RG_DEF_METHOD(visual, 0); RG_DEF_METHOD(screen, 0); RG_DEF_METHOD(colors, 0); } ��������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkx11.c������������������������������������������������������0000644�0001750�0001750�00000021153�12257552167�016727� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef GDK_WINDOWING_X11 #define RG_TARGET_NAMESPACE mX11 /* Can't implement #define GDK_ROOT_WINDOW () */ /* Deprecated. #define GDK_ROOT_PARENT () */ /* Can't implement #define GDK_DISPLAY () #define GDK_WINDOW_XDISPLAY (win) */ /* Use Gdk::Drawable#xid #define GDK_WINDOW_XID (win) */ /* Same as GDK_WINDOW_* #define GDK_PIXMAP_XDISPLAY (pix) #define GDK_PIXMAP_XID (pix) #define GDK_DISPLAY_XDISPLAY (display) #define GDK_DRAWABLE_XDISPLAY (win) #define GDK_DRAWABLE_XID (win) */ /* Can't implement #define GDK_IMAGE_XDISPLAY (image) #define GDK_IMAGE_XIMAGE (image) #define GDK_GC_XDISPLAY (gc) #define GDK_COLORMAP_XDISPLAY (cmap) #define GDK_COLORMAP_XCOLORMAP (cmap) #define GDK_SCREEN_XDISPLAY (screen) */ /* Implement at Gdk::Screen #define GDK_SCREEN_XNUMBER (screen) */ /* Can't implement #define GDK_SCREEN_XSCREEN (screen) #define GDK_VISUAL_XVISUAL (vis) */ /* Deprecated. #define GDK_FONT_XDISPLAY (font) #define GDK_FONT_XFONT (font) */ /* Can't implement. #define GDK_CURSOR_XCURSOR (cursor) #define GDK_CURSOR_XDISPLAY (cursor) #define GDK_GC_XGC (gc) #define GDK_GC_GET_XGC (gc) */ /* Don't need this. #define GDK_WINDOW_XWINDOW */ /* Can't implement. GdkVisual* gdkx_visual_get (VisualID xvisualid); GdkColormap* gdkx_colormap_get (Colormap xcolormap); */ /* Implement at Gdk::Pixmap. GdkPixmap* gdk_pixmap_foreign_new (GdkNativeWindow anid); GdkPixmap* gdk_pixmap_foreign_new_for_display (GdkDisplay *display, GdkNativeWindow anid); */ /* Implement at Gdk::Window. GdkWindow* gdk_window_foreign_new (GdkNativeWindow anid); GdkWindow* gdk_window_foreign_new_for_display (GdkDisplay *display, GdkNativeWindow anid); */ static VALUE rg_m_xid_table_lookup(int argc, VALUE *argv, VALUE self) { VALUE arg[2]; GdkPixmap* win = NULL; rb_scan_args(argc, argv, "11", &arg[0], &arg[1]); switch(argc) { case 1: win = gdk_xid_table_lookup(NUM2UINT(arg[0])); break; case 2: win = gdk_xid_table_lookup_for_display(RVAL2GOBJ(arg[0]), NUM2UINT(arg[1])); break; } if (win == NULL) return Qnil; else { return GOBJ2RVAL(win); } } /* Implement at Gdk::Window GdkWindow* gdk_window_lookup (GdkNativeWindow anid); GdkWindow* gdk_window_lookup_for_display (GdkDisplay *display, GdkNativeWindow anid); */ /* Implement at Gdk::Pixmap GdkPixmap* gdk_pixmap_lookup (GdkNativeWindow anid); GdkPixmap* gdk_pixmap_lookup_for_display (GdkDisplay *display, GdkNativeWindow anid); */ /* Deprecated. #define gdk_font_lookup (xid) #define gdk_font_lookup_for_display (display, xid) */ /* Can't implement. GdkDisplay* gdk_x11_lookup_xdisplay (Display *xdisplay); */ /* Implement at Gdk::Window guint32 gdk_x11_get_server_time (GdkWindow *window); */ static VALUE rg_m_net_wm_supports_p(VALUE self, VALUE property) { return CBOOL2RVAL(gdk_net_wm_supports(RVAL2ATOM(property))); } /* Implement at Gdk::Screen gboolean gdk_x11_screen_supports_net_wm_hint (GdkScreen *screen, GdkAtom property); const char* gdk_x11_screen_get_window_manager_name (GdkScreen *screen); */ /* Can't implement GdkVisual* gdk_x11_screen_lookup_visual (GdkScreen *screen, VisualID xvisualid); GdkColormap* gdk_x11_colormap_foreign_new (GdkVisual *visual, Colormap xcolormap); Colormap gdk_x11_colormap_get_xcolormap (GdkColormap *colormap); Display* gdk_x11_colormap_get_xdisplay (GdkColormap *colormap); Cursor gdk_x11_cursor_get_xcursor (GdkCursor *cursor); Display* gdk_x11_cursor_get_xdisplay (GdkCursor *cursor); Display* gdk_x11_display_get_xdisplay (GdkDisplay *display); */ /* Implement at Gdk::Display void gdk_x11_display_grab (GdkDisplay *display); void gdk_x11_display_ungrab (GdkDisplay *display); void gdk_x11_register_standard_event_type (GdkDisplay *display, gint event_base, gint n_events); */ /* Can't implement Display* gdk_x11_drawable_get_xdisplay (GdkDrawable *drawable); */ /* Use Gdk::Drawable#xid instead XID gdk_x11_drawable_get_xid (GdkDrawable *drawable); */ /* Deprecated G_CONST_RETURN char* gdk_x11_font_get_name (GdkFont *font); Display* gdk_x11_font_get_xdisplay (GdkFont *font); gpointer gdk_x11_font_get_xfont (GdkFont *font); */ /* Can't implement Display* gdk_x11_gc_get_xdisplay (GdkGC *gc); GC gdk_x11_gc_get_xgc (GdkGC *gc); Window gdk_x11_get_default_root_xwindow (void); */ static VALUE rg_m_default_screen(VALUE self) { return INT2NUM(gdk_x11_get_default_screen()); } /* Can't implement Display* gdk_x11_get_default_xdisplay (void); */ static VALUE rg_m_grab_server(VALUE self) { gdk_x11_grab_server(); return Qnil; } /* Can't implement Display* gdk_x11_image_get_xdisplay (GdkImage *image); XImage* gdk_x11_image_get_ximage (GdkImage *image); */ /* Implement at Gdk::Screen. int gdk_x11_screen_get_screen_number (GdkScreen *screen); */ /* Can't impelement Screen* gdk_x11_screen_get_xscreen (GdkScreen *screen); */ static VALUE rg_m_ungrab_server(VALUE self) { gdk_x11_ungrab_server(); return Qnil; } /* Can't implement Visual* gdk_x11_visual_get_xvisual (GdkVisual *visual); Atom gdk_x11_atom_to_xatom (GdkAtom atom); Atom gdk_x11_atom_to_xatom_for_display (GdkDisplay *display, GdkAtom atom); GdkAtom gdk_x11_xatom_to_atom (Atom xatom); GdkAtom gdk_x11_xatom_to_atom_for_display (GdkDisplay *display, Atom xatom); Atom gdk_x11_get_xatom_by_name (const gchar *atom_name); Atom gdk_x11_get_xatom_by_name_for_display (GdkDisplay *display, const gchar *atom_name); G_CONST_RETURN gchar* gdk_x11_get_xatom_name (Atom xatom); G_CONST_RETURN gchar* gdk_x11_get_xatom_name_for_display (GdkDisplay *display, Atom xatom); */ #endif void Init_gtk_gdk_x11(VALUE mGdk) { #ifdef GDK_WINDOWING_X11 VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "X11"); RG_DEF_MODFUNC(xid_table_lookup, -1); RG_DEF_MODFUNC_P(net_wm_supports, 1); RG_DEF_MODFUNC(default_screen, 0); RG_DEF_MODFUNC(grab_server, 0); RG_DEF_MODFUNC(ungrab_server, 0); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcontainer.c������������������������������������������������0000644�0001750�0001750�00000054127�11701304107�020305� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cContainer #define _SELF(s) (GTK_CONTAINER(RVAL2GOBJ(self))) /* We don't need this. #define GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID(object, property_id, pspec) */ static VALUE type_to_prop_setter_table; static VALUE type_to_prop_getter_table; static VALUE rg_resize_container_p(VALUE self) { return CBOOL2RVAL(GTK_IS_RESIZE_CONTAINER(_SELF(self))); } static VALUE rg_remove(VALUE self, VALUE other) { G_CHILD_REMOVE(self, other); gtk_container_remove(_SELF(self), GTK_WIDGET(RVAL2GOBJ(other))); return self; } static VALUE rg_check_resize(VALUE self) { gtk_container_check_resize(_SELF(self)); return self; } static VALUE rg_each(int argc, VALUE *argv, VALUE self) { VALUE callback; rb_scan_args(argc, argv, "01", &callback); if (NIL_P(callback)) { callback = rb_block_proc(); } gtk_container_foreach(_SELF(self), exec_callback, (gpointer)callback); return self; } static VALUE rg_each_forall(int argc, VALUE *argv, VALUE self) { VALUE callback; rb_scan_args(argc, argv, "01", &callback); if (NIL_P(callback)) { callback = rb_block_proc(); } gtk_container_forall(_SELF(self), exec_callback, (gpointer)callback); return self; } static VALUE rg_children(VALUE self) { return GLIST2ARYF(gtk_container_get_children(_SELF(self))); } static VALUE rg_set_reallocate_redraws(VALUE self, VALUE needs_redraws) { gtk_container_set_reallocate_redraws(_SELF(self), RVAL2CBOOL(needs_redraws)); return self; } static VALUE rg_set_focus_child(VALUE self, VALUE child) { gtk_container_set_focus_child(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child))); return self; } static VALUE rg_set_focus_vadjustment(VALUE self, VALUE adjustment) { gtk_container_set_focus_vadjustment(_SELF(self), NIL_P(adjustment) ? NULL : GTK_ADJUSTMENT(RVAL2GOBJ(adjustment))); return self; } static VALUE rg_set_focus_hadjustment(VALUE self, VALUE adjustment) { gtk_container_set_focus_hadjustment(_SELF(self), NIL_P(adjustment) ? NULL : GTK_ADJUSTMENT(RVAL2GOBJ(adjustment))); return self; } static VALUE rg_focus_vadjustment(VALUE self) { GtkAdjustment* adj = gtk_container_get_focus_vadjustment(_SELF(self)); return adj ? GOBJ2RVAL(adj) : Qnil; } static VALUE rg_focus_hadjustment(VALUE self) { GtkAdjustment* adj = gtk_container_get_focus_hadjustment(_SELF(self)); return adj ? GOBJ2RVAL(adj) : Qnil; } static VALUE rg_resize_children(VALUE self) { gtk_container_resize_children(_SELF(self)); return self; } static VALUE rg_child_type(VALUE self) { return GTYPE2CLASS(gtk_container_child_type(_SELF(self))); } /* void gtk_container_child_get (GtkContainer *container, GtkWidget *child, const gchar *first_prop_name, ...); void gtk_container_child_set (GtkContainer *container, GtkWidget *child, const gchar *first_prop_name, ...); */ void rbgtkcontainer_register_child_property_setter(GType gtype, const char *name, RValueToGValueFunc func) { GObjectClass* oclass; GParamSpec* pspec; VALUE table = rb_hash_aref(type_to_prop_setter_table, INT2FIX(gtype)); if (NIL_P(table)){ table = rb_hash_new(); rb_hash_aset(type_to_prop_setter_table, INT2FIX(gtype), table); } oclass = g_type_class_ref(gtype); pspec = gtk_container_class_find_child_property(oclass, name); rb_hash_aset(table, rb_intern(g_param_spec_get_name(pspec)), Data_Wrap_Struct(rb_cData, NULL, NULL, func)); g_type_class_unref(oclass); } void rbgtkcontainer_register_child_property_getter(GType gtype, const char *name, GValueToRValueFunc func) { GObjectClass* oclass; GParamSpec* pspec; VALUE table = rb_hash_aref(type_to_prop_getter_table, INT2FIX(gtype)); if (NIL_P(table)){ table = rb_hash_new(); rb_hash_aset(type_to_prop_getter_table, INT2FIX(gtype), table); } oclass = g_type_class_ref(gtype); pspec = gtk_container_class_find_child_property(oclass, name); rb_hash_aset(table, rb_intern(g_param_spec_get_name(pspec)), Data_Wrap_Struct(rb_cData, NULL, NULL, func)); } static VALUE rg_child_get_property(VALUE self, VALUE child, VALUE prop_name) { GParamSpec* pspec; const char* name; if (SYMBOL_P(prop_name)) { name = rb_id2name(SYM2ID(prop_name)); } else { name = RVAL2CSTR(prop_name); } pspec = gtk_container_class_find_child_property( G_OBJECT_GET_CLASS(RVAL2GOBJ(self)), name); if (!pspec) rb_raise(rb_eArgError, "No such property: %s", name); else { GValueToRValueFunc getter = NULL; GValue gval = G_VALUE_INIT; VALUE ret; { VALUE table = rb_hash_aref(type_to_prop_getter_table, INT2FIX(pspec->owner_type)); if (!NIL_P(table)){ VALUE obj = rb_hash_aref(table, rb_intern(g_param_spec_get_name(pspec))); if (!NIL_P(obj)) Data_Get_Struct(obj, void, getter); } } g_value_init(&gval, G_PARAM_SPEC_VALUE_TYPE(pspec)); gtk_container_child_get_property(GTK_CONTAINER(RVAL2GOBJ(self)), GTK_WIDGET(RVAL2GOBJ(child)), name , &gval); ret = getter ? getter(&gval) : GVAL2RVAL(&gval); G_CHILD_ADD(child, ret); g_value_unset(&gval); return ret; } } static VALUE rg_child_set_property(VALUE self, VALUE child, VALUE prop_name, VALUE val) { GParamSpec* pspec; const char* name; if (SYMBOL_P(prop_name)) { name = rb_id2name(SYM2ID(prop_name)); } else { name = RVAL2CSTR(prop_name); } pspec = gtk_container_class_find_child_property( G_OBJECT_GET_CLASS(RVAL2GOBJ(self)), name); if (!pspec) rb_raise(rb_eArgError, "No such property: %s", name); else { RValueToGValueFunc setter = NULL; GValue gval = G_VALUE_INIT; g_value_init(&gval, G_PARAM_SPEC_VALUE_TYPE(pspec)); { VALUE table = rb_hash_aref(type_to_prop_setter_table, INT2FIX(pspec->owner_type)); if (!NIL_P(table)){ VALUE obj = rb_hash_aref(table, rb_intern(g_param_spec_get_name(pspec))); if (!NIL_P(obj)) Data_Get_Struct(obj, void, setter); } } if (setter) setter(val, &gval); else { if (!NIL_P(val)) rbgobj_rvalue_to_gvalue(val, &gval); } G_CHILD_ADD(child, val); gtk_container_child_set_property(GTK_CONTAINER(RVAL2GOBJ(self)), GTK_WIDGET(RVAL2GOBJ(child)), name, &gval); g_value_unset(&gval); return self; } } static VALUE rg_add(int argc, VALUE *argv, VALUE self) { VALUE other, properties; GtkWidget *child; rb_scan_args(argc, argv, "11", &other, &properties); child = GTK_WIDGET(RVAL2GOBJ(other)); gtk_widget_freeze_child_notify(child); gtk_container_add(_SELF(self), child); G_CHILD_ADD(self, other); if (child->parent && (! NIL_P(properties))){ int i; VALUE ary; GObject* obj; Check_Type(properties, T_HASH); ary = rb_funcall(properties, rb_intern("to_a"), 0); obj = RVAL2GOBJ(self); for (i = 0; i < RARRAY_LEN(ary); i++) { rg_child_set_property(self, other, RARRAY_PTR(RARRAY_PTR(ary)[i])[0], RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); } } gtk_widget_thaw_child_notify(child); return self; } /* void gtk_container_child_get_valist (GtkContainer *container, GtkWidget *child, const gchar *first_property_name, va_list var_args); void gtk_container_child_set_valist (GtkContainer *container, GtkWidget *child, const gchar *first_property_name, va_list var_args); */ static VALUE rg_propagate_expose(VALUE self, VALUE child, VALUE event) { gtk_container_propagate_expose(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)), (GdkEventExpose *)RVAL2GEV(event)); return self; } static VALUE rg_focus_chain(VALUE self) { gboolean ret; GList *glist = NULL; ret = gtk_container_get_focus_chain(_SELF(self), &glist); return GLIST2ARYF(glist); } struct rval2gtkwidgetglist_args { VALUE ary; long n; GList *result; }; static VALUE rbg_rval2gtkwidgetglist_body(VALUE value) { long i; struct rval2gtkwidgetglist_args *args = (struct rval2gtkwidgetglist_args *)value; for (i = 0; i < args->n; i++) args->result = g_list_append(args->result, GTK_WIDGET(RVAL2GOBJ(RARRAY_PTR(args->ary)[i]))); return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gtkwidgetglist_rescue(VALUE value) { g_list_free(((struct rval2gtkwidgetglist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GList * rbg_rval2gtkwidgetglist(VALUE value) { struct rval2gtkwidgetglist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbg_rval2gtkwidgetglist_body, (VALUE)&args, rbg_rval2gtkwidgetglist_rescue, (VALUE)&args); return args.result; } #define RVAL2GTKWIDGETGLIST(value) rbg_rval2gtkwidgetglist(value) static VALUE rg_set_focus_chain(VALUE self, VALUE rbfocusable_widgets) { GtkContainer *container = _SELF(self); GList *focusable_widgets = RVAL2GTKWIDGETGLIST(rbfocusable_widgets); gtk_container_set_focus_chain(container, focusable_widgets); g_list_free(focusable_widgets); return self; } static VALUE rg_unset_focus_chain(VALUE self) { gtk_container_unset_focus_chain(_SELF(self)); return self; } static VALUE rg_s_child_property(VALUE self, VALUE property_name) { GObjectClass* oclass; const char* name; GParamSpec* prop; VALUE result; if (SYMBOL_P(property_name)) { name = rb_id2name(SYM2ID(property_name)); } else { name = RVAL2CSTR(property_name); } oclass = g_type_class_ref(CLASS2GTYPE(self)); prop = gtk_container_class_find_child_property(oclass, name); if (!prop){ g_type_class_unref(oclass); rb_raise(rb_eNameError, "no such property: %s", name); } result = GOBJ2RVAL(prop); g_type_class_unref(oclass); return result; } static VALUE rg_s_install_child_property(int argc, VALUE *argv, VALUE self) { const RGObjClassInfo* cinfo = rbgobj_lookup_class(self); GtkContainerClass* gclass; VALUE spec, prop_id; GParamSpec* pspec; rb_scan_args(argc, argv, "11", &spec, &prop_id); pspec = G_PARAM_SPEC(RVAL2GOBJ(spec)); if (cinfo->klass != self) rb_raise(rb_eTypeError, "%s isn't registerd class", rb_class2name(self)); gclass = GTK_CONTAINER_CLASS(g_type_class_ref(cinfo->gtype)); gtk_container_class_install_child_property(gclass, NIL_P(prop_id) ? 1 : NUM2UINT(prop_id), pspec); return self; } static VALUE rg_s_child_properties(int argc, VALUE *argv, VALUE self) { GObjectClass* oclass = g_type_class_ref(CLASS2GTYPE(self)); guint n_properties; GParamSpec** props; VALUE inherited_too; VALUE ary; guint i; if (rb_scan_args(argc, argv, "01", &inherited_too) == 0) inherited_too = Qtrue; props = gtk_container_class_list_child_properties(oclass, &n_properties); ary = rb_ary_new(); for (i = 0; i < n_properties; i++){ if (RVAL2CBOOL(inherited_too) || GTYPE2CLASS(props[i]->owner_type) == self) rb_ary_push(ary, CSTR2RVAL(props[i]->name)); } g_free(props); g_type_class_unref(oclass); return ary; } /**********************************************************************/ static VALUE proc_mod_eval; static GQuark q_ruby_setter; static GQuark q_ruby_getter; static VALUE cont_initialize(int argc, VALUE *argv, VALUE self) { VALUE params_hash; GObject* gobj; rb_scan_args(argc, argv, "01", ¶ms_hash); if (!NIL_P(params_hash)) Check_Type(params_hash, T_HASH); gobj = rbgobj_gobject_new(RVAL2GTYPE(self), params_hash); RBGTK_INITIALIZE(self, gobj); return Qnil; } // FIXME: use rb_protect static void get_prop_func(GObject* object, G_GNUC_UNUSED guint property_id, GValue* value, GParamSpec* pspec) { ID ruby_getter = (ID)g_param_spec_get_qdata(pspec, q_ruby_getter); if (!ruby_getter) { gchar* name = g_strdup(g_param_spec_get_name(pspec)); gchar* p; for (p = name; *p; p++) { if (*p == '-') *p = '_'; } ruby_getter = rb_intern(name); g_param_spec_set_qdata(pspec, q_ruby_getter, (gpointer)ruby_getter); g_free(name); } { VALUE ret = rb_funcall(GOBJ2RVAL(object), ruby_getter, 0); rbgobj_rvalue_to_gvalue(ret, value); } } // FIXME: use rb_protect static void set_prop_func(GObject* object, G_GNUC_UNUSED guint property_id, const GValue* value, GParamSpec* pspec) { ID ruby_setter = (ID)g_param_spec_get_qdata(pspec, q_ruby_setter); if (!ruby_setter) { gchar* name = g_strconcat(g_param_spec_get_name(pspec), "=", NULL); gchar* p; for (p = name; *p; p++) { if (*p == '-') *p = '_'; } ruby_setter = rb_intern(name); g_param_spec_set_qdata(pspec, q_ruby_setter, (gpointer)ruby_setter); g_free(name); } rb_funcall(GOBJ2RVAL(object), ruby_setter, 1, GVAL2RVAL(value)); } // FIXME: use rb_protect static void get_child_prop_func(GtkContainer *container, GtkWidget *child, G_GNUC_UNUSED guint property_id, GValue *value, GParamSpec *pspec) { ID ruby_getter = (ID)g_param_spec_get_qdata(pspec, q_ruby_getter); if (!ruby_getter) { gchar* name = g_strconcat("get_", g_param_spec_get_name(pspec), NULL); gchar* p; for (p = name; *p; p++) { if (*p == '-') *p = '_'; } ruby_getter = rb_intern(name); g_param_spec_set_qdata(pspec, q_ruby_getter, (gpointer)ruby_getter); g_free(name); } { VALUE ret = rb_funcall(GOBJ2RVAL(container), ruby_getter, 1, GOBJ2RVAL(child)); rbgobj_rvalue_to_gvalue(ret, value); } } // FIXME: use rb_protect static void set_child_prop_func(GtkContainer *container, GtkWidget *child, G_GNUC_UNUSED guint property_id, const GValue *value, GParamSpec *pspec) { ID ruby_setter = (ID)g_param_spec_get_qdata(pspec, q_ruby_setter); if (!ruby_setter) { gchar* name = g_strconcat("set_", g_param_spec_get_name(pspec), NULL); gchar* p; for (p = name; *p; p++) { if (*p == '-') *p = '_'; } ruby_setter = rb_intern(name); g_param_spec_set_qdata(pspec, q_ruby_setter, (gpointer)ruby_setter); g_free(name); } rb_funcall(GOBJ2RVAL(container), ruby_setter, 2, GOBJ2RVAL(child), GVAL2RVAL(value)); } // FIXME: use rb_protect static void class_init_func(gpointer g_class, G_GNUC_UNUSED gpointer class_data) { GObjectClass* g_class1 = G_OBJECT_CLASS(g_class); GtkContainerClass* g_class2 = GTK_CONTAINER_CLASS(g_class); g_class1->set_property = set_prop_func; g_class1->get_property = get_prop_func; g_class2->set_child_property = set_child_prop_func; g_class2->get_child_property = get_child_prop_func; #if 0 VALUE class_init_proc = (VALUE)class_data; rb_funcall(proc_mod_eval, rb_intern("call"), 2, GTYPE2CLASS(G_TYPE_FROM_CLASS(g_class)), class_init_proc); #endif } static VALUE rg_s_type_register(int argc, VALUE* argv, VALUE self) { VALUE type_name, flags; volatile VALUE class_init_proc = Qnil; GType parent_type; GTypeInfo* info; rb_scan_args(argc, argv, "03", &type_name, &info, &flags); /* TODO: Replace this copy-paste job with the real thing in glib2. */ { const RGObjClassInfo* cinfo = rbgobj_lookup_class(self); if (cinfo->klass == self) rb_raise(rb_eTypeError, "already registered"); } { VALUE superclass = rb_funcall(self, rb_intern("superclass"), 0); const RGObjClassInfo* cinfo = CLASS2CINFO(superclass); if (cinfo->klass != superclass) rb_raise(rb_eTypeError, "super class must be registered to GLib"); parent_type = cinfo->gtype; } if (NIL_P(type_name)){ VALUE s = rb_funcall(self, rb_intern("name"), 0); if (strlen(StringValuePtr(s)) == 0) rb_raise(rb_eTypeError, "can't determine type name"); type_name = rb_funcall( rb_eval_string("lambda{|x| x.gsub(/::/,'') }"), rb_intern("call"), 1, s); } { GTypeQuery query; g_type_query(parent_type, &query); /* TODO: This should not require a new GTypeInfo, as GLib doesn't * retain a copy. */ info = g_new0(GTypeInfo, 1); info->class_size = query.class_size; info->base_init = NULL; info->base_finalize = NULL; info->class_init = class_init_func; info->class_finalize = NULL; info->class_data = (gpointer)class_init_proc; info->instance_size = query.instance_size; info->n_preallocs = 0; info->instance_init = NULL; info->value_table = NULL; } { GType type = g_type_register_static(parent_type, StringValuePtr(type_name), info, NIL_P(flags) ? 0 : NUM2INT(flags)); G_RELATIVE(self, class_init_proc); rbgobj_register_class(self, type, TRUE, TRUE); { RGObjClassInfo* cinfo = (RGObjClassInfo*)rbgobj_lookup_class(self); cinfo->flags |= RBGOBJ_DEFINED_BY_RUBY; } { GType parent = g_type_parent(type); const RGObjClassInfo* cinfo = GTYPE2CINFO(parent); VALUE m = rb_define_module_under(self, RubyGtkContainerHookModule); if (! (cinfo->flags & RBGOBJ_DEFINED_BY_RUBY)) { rb_define_method(m, "initialize", cont_initialize, -1); } rb_include_module(self, m); } return Qnil; } } /**********************************************************************/ static void cont_mark_callback(GtkWidget *w, G_GNUC_UNUSED gpointer data) { rbgobj_gc_mark_instance(w); } static void cont_mark(void* p) { gtk_container_forall(GTK_CONTAINER(p), cont_mark_callback, NULL); } /**********************************************************************/ void Init_gtk_container(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_GC_FUNC(GTK_TYPE_CONTAINER, "Container", mGtk, cont_mark, NULL); RG_DEF_METHOD_P(resize_container, 0); RG_DEF_METHOD(add, -1); RG_DEF_ALIAS("<<", "add"); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(check_resize, 0); RG_DEF_METHOD(each, -1); RG_DEF_METHOD(each_forall, -1); RG_DEF_METHOD(children, 0); RG_DEF_METHOD(set_reallocate_redraws, 1); RG_DEF_METHOD(set_focus_child, 1); RG_DEF_METHOD(set_focus_vadjustment, 1); RG_DEF_METHOD(set_focus_hadjustment, 1); RG_DEF_METHOD(focus_vadjustment, 0); RG_DEF_METHOD(focus_hadjustment, 0); RG_DEF_METHOD(resize_children, 0); RG_DEF_METHOD(child_type, 0); RG_DEF_METHOD(child_get_property, 2); RG_DEF_METHOD(child_set_property, 3); RG_DEF_METHOD(propagate_expose, 2); RG_DEF_METHOD(focus_chain, 0); RG_DEF_METHOD(set_focus_chain, 1); RG_DEF_METHOD(unset_focus_chain, 0); RG_DEF_SMETHOD(child_property, 1); RG_DEF_SMETHOD(child_properties, -1); RG_DEF_SMETHOD(install_child_property, -1); q_ruby_getter = g_quark_from_static_string("__ruby_getter"); q_ruby_setter = g_quark_from_static_string("__ruby_setter"); RG_DEF_SMETHOD(type_register, -1); rb_global_variable(&proc_mod_eval); proc_mod_eval = rb_eval_string("lambda{|obj,proc| obj.module_eval(&proc)}"); G_DEF_SETTERS(RG_TARGET_NAMESPACE); rb_global_variable(&type_to_prop_setter_table); rb_global_variable(&type_to_prop_getter_table); type_to_prop_setter_table = rb_hash_new(); type_to_prop_getter_table = rb_hash_new(); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktextiter.c�������������������������������������������������0000644�0001750�0001750�00000042414�12257552167�020211� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTextIter #define _SELF(s) ((GtkTextIter*)RVAL2BOXED(s, GTK_TYPE_TEXT_ITER)) #define RVAL2TAG(t) (GTK_TEXT_TAG(RVAL2GOBJ(t))) #define ITR2RVAL(i) (BOXED2RVAL(i, GTK_TYPE_TEXT_ITER)) static gboolean is_compat_240; static ID id_pixbuf; static VALUE rg_buffer(VALUE self) { return GOBJ2RVAL(gtk_text_iter_get_buffer(_SELF(self))); } #define def_gint_getter(__name__) \ static VALUE \ get_##__name__(VALUE self) \ { \ return INT2NUM(gtk_text_iter_get_##__name__(_SELF(self))); \ } def_gint_getter(offset) def_gint_getter(line) def_gint_getter(line_offset) def_gint_getter(line_index) def_gint_getter(visible_line_offset) def_gint_getter(visible_line_index) static VALUE rg_char(VALUE self) { gchar buf[10]; gint len = g_unichar_to_utf8(gtk_text_iter_get_char(_SELF(self)), buf); buf[len] = '\0'; return CSTR2RVAL(buf); } static VALUE rg_get_slice(VALUE self, VALUE rhs) { return CSTR2RVAL(gtk_text_iter_get_slice(_SELF(self), _SELF(rhs))); } static VALUE rg_get_text(VALUE self, VALUE rhs) { return CSTR2RVAL(gtk_text_iter_get_text(_SELF(self), _SELF(rhs))); } static VALUE rg_get_visible_slice(VALUE self, VALUE rhs) { return CSTR2RVAL(gtk_text_iter_get_visible_slice(_SELF(self), _SELF(rhs))); } static VALUE rg_get_visible_text(VALUE self, VALUE rhs) { return CSTR2RVAL(gtk_text_iter_get_visible_text(_SELF(self), _SELF(rhs))); } static VALUE rg_pixbuf(VALUE self) { GdkPixbuf* pixbuf = gtk_text_iter_get_pixbuf(_SELF(self)); VALUE ret = Qnil; if (pixbuf){ ret = GOBJ2RVAL(pixbuf); G_CHILD_SET(self, id_pixbuf, ret); } return ret; } static VALUE rg_marks(VALUE self) { return GSLIST2ARYF(gtk_text_iter_get_marks(_SELF(self))); } static VALUE rg_toggled_tags(VALUE self, VALUE toggled_on) { return GSLIST2ARYF(gtk_text_iter_get_toggled_tags(_SELF(self), RVAL2CBOOL(toggled_on))); } static VALUE rg_child_anchor(VALUE self) { GtkTextChildAnchor* anchor = gtk_text_iter_get_child_anchor(_SELF(self)); return anchor ? GOBJ2RVAL(anchor) : Qnil; } static VALUE rg_begins_tag_p(VALUE self, VALUE tag) { return CBOOL2RVAL(gtk_text_iter_begins_tag(_SELF(self), RVAL2TAG(tag))); } static VALUE rg_ends_tag_p(VALUE self, VALUE tag) { return CBOOL2RVAL(gtk_text_iter_ends_tag(_SELF(self), RVAL2TAG(tag))); } static VALUE rg_toggles_tag_p(VALUE self, VALUE tag) { return CBOOL2RVAL(gtk_text_iter_toggles_tag(_SELF(self), RVAL2TAG(tag))); } static VALUE rg_has_tag_p(VALUE self, VALUE tag) { return CBOOL2RVAL(gtk_text_iter_has_tag(_SELF(self), RVAL2TAG(tag))); } static VALUE rg_tags(VALUE self) { return GSLIST2ARYF(gtk_text_iter_get_tags(_SELF(self))); } static VALUE rg_editable_p(VALUE self, VALUE default_setting) { return CBOOL2RVAL(gtk_text_iter_editable(_SELF(self), RVAL2CBOOL(default_setting))); } static VALUE rg_can_insert_p(VALUE self, VALUE default_setting) { return CBOOL2RVAL(gtk_text_iter_can_insert(_SELF(self), RVAL2CBOOL(default_setting))); } #define def_predicate(__name__) \ static VALUE \ __name__(VALUE self) \ { \ return CBOOL2RVAL(gtk_text_iter_##__name__(_SELF(self))); \ } def_predicate(starts_word) def_predicate(ends_word) def_predicate(inside_word) def_predicate(starts_sentence) def_predicate(ends_sentence) def_predicate(starts_line) def_predicate(ends_line) def_predicate(is_cursor_position) def_gint_getter(chars_in_line) def_gint_getter(bytes_in_line) static VALUE rg_attributes(VALUE self) { GtkTextAttributes attr; if(gtk_text_iter_get_attributes(_SELF(self), &attr) == TRUE){ return BOXED2RVAL(&attr, GTK_TYPE_TEXT_ATTRIBUTES); } else { return Qnil; } } static VALUE rg_language(VALUE self) { return CSTR2RVAL(pango_language_to_string(gtk_text_iter_get_language(_SELF(self)))); } def_predicate(is_end) def_predicate(is_start) #define def_move(__name__) \ static VALUE \ __name__(VALUE self) \ { \ return CBOOL2RVAL(gtk_text_iter_##__name__(_SELF(self))); \ } #define def_move_gint(__name__) \ static VALUE \ __name__(VALUE self, VALUE i) \ { \ return CBOOL2RVAL(gtk_text_iter_##__name__(_SELF(self), NUM2INT(i))); \ } def_move(forward_char) def_move(backward_char) def_move_gint(forward_chars) def_move_gint(backward_chars) def_move(forward_line) def_move(backward_line) def_move_gint(forward_lines) def_move_gint(backward_lines) def_move(forward_word_end) def_move(backward_word_start) def_move_gint(forward_word_ends) def_move_gint(backward_word_starts) def_move(forward_sentence_end) def_move(backward_sentence_start) def_move_gint(forward_sentence_ends) def_move_gint(backward_sentence_starts) def_move_gint(forward_visible_word_ends) def_move_gint(backward_visible_word_starts) def_move(forward_visible_word_end) def_move(backward_visible_word_start) def_move(forward_visible_cursor_position) def_move(backward_visible_cursor_position) def_move_gint(forward_visible_cursor_positions) def_move_gint(backward_visible_cursor_positions) def_move(forward_visible_line) def_move(backward_visible_line) def_move_gint(forward_visible_lines) def_move_gint(backward_visible_lines) def_move(forward_cursor_position) def_move(backward_cursor_position) def_move_gint(forward_cursor_positions) def_move_gint(backward_cursor_positions) def_move(forward_to_line_end) static VALUE rg_forward_to_end(VALUE self) { gtk_text_iter_forward_to_end(_SELF(self)); return self; } #define def_gint_setter(__name__) \ static VALUE \ set_##__name__(VALUE self, VALUE val) \ { \ gtk_text_iter_set_##__name__(_SELF(self), NUM2INT(val)); \ return val; \ } def_gint_setter(offset) def_gint_setter(line) def_gint_setter(line_offset) def_gint_setter(line_index) def_gint_setter(visible_line_offset) def_gint_setter(visible_line_index) static VALUE rg_forward_to_tag_toggle(int argc, VALUE *argv, VALUE self) { VALUE tag; rb_scan_args(argc, argv, "01", &tag); return CBOOL2RVAL(gtk_text_iter_forward_to_tag_toggle(_SELF(self), NIL_P(tag) ? NULL : RVAL2TAG(tag))); } static VALUE rg_backward_to_tag_toggle(int argc, VALUE *argv, VALUE self) { VALUE tag; rb_scan_args(argc, argv, "01", &tag); return CBOOL2RVAL(gtk_text_iter_backward_to_tag_toggle(_SELF(self), NIL_P(tag) ? NULL : RVAL2TAG(tag))); } static gboolean char_predicate_func(guint32 ch, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 1, UINT2NUM(ch))); } static VALUE rg_forward_find_char(int argc, VALUE *argv, VALUE self) { VALUE limit; volatile VALUE func = rb_block_proc(); rb_scan_args(argc, argv, "01", &limit); return CBOOL2RVAL(gtk_text_iter_forward_find_char(_SELF(self), (GtkTextCharPredicate)char_predicate_func, (gpointer)func, NIL_P(limit) ? NULL : _SELF(limit))); } static VALUE rg_backward_find_char(int argc, VALUE *argv, VALUE self) { VALUE limit; volatile VALUE func = rb_block_proc(); rb_scan_args(argc, argv, "01", &limit); return CBOOL2RVAL(gtk_text_iter_backward_find_char(_SELF(self), (GtkTextCharPredicate)char_predicate_func, (gpointer)func, NIL_P(limit) ? NULL : _SELF(limit))); } static VALUE rg_forward_search(int argc, VALUE *argv, VALUE self) { GtkTextIter m_start, m_end; VALUE str, flags, limit; gboolean ret; rb_scan_args(argc, argv, "21", &str, &flags, &limit); if (is_compat_240){ ret = gtk_text_iter_forward_search(_SELF(self), RVAL2CSTR(str), RVAL2GFLAGS(flags, GTK_TYPE_TEXT_SEARCH_FLAGS), &m_start, &m_end, NIL_P(limit) ? NULL : _SELF(limit)); } else { ret = gtk_text_iter_forward_search(_SELF(self), RVAL2CSTR(str), RVAL2GENUM(flags, GTK_TYPE_TEXT_SEARCH_FLAGS), &m_start, &m_end, NIL_P(limit) ? NULL : _SELF(limit)); } return ret ? rb_ary_new3(2, ITR2RVAL(&m_start), ITR2RVAL(&m_end)) : Qnil; } static VALUE rg_backward_search(int argc, VALUE *argv, VALUE self) { GtkTextIter m_start, m_end; VALUE str, flags, limit; gboolean ret; rb_scan_args(argc, argv, "21", &str, &flags, &limit); if (is_compat_240){ ret = gtk_text_iter_backward_search(_SELF(self), RVAL2CSTR(str), RVAL2GFLAGS(flags, GTK_TYPE_TEXT_SEARCH_FLAGS), &m_start, &m_end, NIL_P(limit) ? NULL : _SELF(limit)); } else { ret = gtk_text_iter_backward_search(_SELF(self), RVAL2CSTR(str), RVAL2GENUM(flags, GTK_TYPE_TEXT_SEARCH_FLAGS), &m_start, &m_end, NIL_P(limit) ? NULL : _SELF(limit)); } return ret ? rb_ary_new3(2, ITR2RVAL(&m_start), ITR2RVAL(&m_end)) : Qnil; } static VALUE rg_operator_equal(VALUE self, VALUE other) { return CBOOL2RVAL(gtk_text_iter_equal(_SELF(self), _SELF(other))); } static VALUE rg_operator_compare(VALUE self, VALUE rhs) { return INT2NUM(gtk_text_iter_compare(_SELF(self), _SELF(rhs))); } /* The following methods don't have to be implimented. Including Comparable module is enough. gboolean gtk_text_iter_in_range (const GtkTextIter *iter, const GtkTextIter *start, const GtkTextIter *end); void gtk_text_iter_order (GtkTextIter *first, GtkTextIter *second); */ void Init_gtk_textiter(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_ITER, "TextIter", mGtk); rb_include_module(RG_TARGET_NAMESPACE, rb_mComparable); is_compat_240 = gtk_check_version(2, 4, 0) ? FALSE : TRUE; id_pixbuf = rb_intern("pixbuf"); RG_DEF_METHOD(buffer, 0); rb_define_method(RG_TARGET_NAMESPACE, "offset", get_offset, 0); rb_define_method(RG_TARGET_NAMESPACE, "line", get_line, 0); rb_define_method(RG_TARGET_NAMESPACE, "line_offset", get_line_offset, 0); rb_define_method(RG_TARGET_NAMESPACE, "line_index", get_line_index, 0); rb_define_method(RG_TARGET_NAMESPACE, "visible_line_offset", get_visible_line_offset, 0); rb_define_method(RG_TARGET_NAMESPACE, "visible_line_index", get_visible_line_index, 0); RG_DEF_METHOD(char, 0); RG_DEF_METHOD(get_slice, 1); RG_DEF_METHOD(get_text, 1); RG_DEF_METHOD(get_visible_slice, 1); RG_DEF_METHOD(get_visible_text, 1); RG_DEF_METHOD(pixbuf, 0); RG_DEF_METHOD(marks, 0); RG_DEF_METHOD(child_anchor, 0); RG_DEF_METHOD(toggled_tags, 1); RG_DEF_METHOD_P(begins_tag, 1); RG_DEF_METHOD_P(ends_tag, 1); RG_DEF_METHOD_P(toggles_tag, 1); RG_DEF_METHOD_P(has_tag, 1); RG_DEF_METHOD(tags, 0); RG_DEF_METHOD_P(editable, 1); RG_DEF_METHOD_P(can_insert, 1); rb_define_method(RG_TARGET_NAMESPACE, "starts_word?", starts_word, 0); rb_define_method(RG_TARGET_NAMESPACE, "ends_word?", ends_word, 0); rb_define_method(RG_TARGET_NAMESPACE, "inside_word?", inside_word, 0); rb_define_method(RG_TARGET_NAMESPACE, "starts_sentence?", starts_sentence, 0); rb_define_method(RG_TARGET_NAMESPACE, "ends_sentence?", ends_sentence, 0); rb_define_method(RG_TARGET_NAMESPACE, "starts_line?", starts_line, 0); rb_define_method(RG_TARGET_NAMESPACE, "ends_line?", ends_line, 0); rb_define_method(RG_TARGET_NAMESPACE, "cursor_position?", is_cursor_position, 0); rb_define_method(RG_TARGET_NAMESPACE, "chars_in_line", get_chars_in_line, 0); rb_define_method(RG_TARGET_NAMESPACE, "bytes_in_line", get_bytes_in_line, 0); RG_DEF_METHOD(attributes, 0); RG_DEF_METHOD(language, 0); rb_define_method(RG_TARGET_NAMESPACE, "end?", is_end, 0); rb_define_method(RG_TARGET_NAMESPACE, "start?", is_start, 0); rb_define_method(RG_TARGET_NAMESPACE, "forward_char", forward_char, 0); rb_define_method(RG_TARGET_NAMESPACE, "backward_char", backward_char, 0); rb_define_method(RG_TARGET_NAMESPACE, "forward_chars", forward_chars, 1); rb_define_method(RG_TARGET_NAMESPACE, "backward_chars", backward_chars, 1); rb_define_method(RG_TARGET_NAMESPACE, "forward_line", forward_line, 0); rb_define_method(RG_TARGET_NAMESPACE, "backward_line", backward_line, 0); rb_define_method(RG_TARGET_NAMESPACE, "forward_lines", forward_lines, 1); rb_define_method(RG_TARGET_NAMESPACE, "backward_lines", backward_lines, 1); rb_define_method(RG_TARGET_NAMESPACE, "forward_word_end", forward_word_end, 0); rb_define_method(RG_TARGET_NAMESPACE, "backward_word_start", backward_word_start, 0); rb_define_method(RG_TARGET_NAMESPACE, "forward_word_ends", forward_word_ends, 1); rb_define_method(RG_TARGET_NAMESPACE, "backward_word_starts", backward_word_starts, 1); rb_define_method(RG_TARGET_NAMESPACE, "forward_sentence_end", forward_sentence_end, 0); rb_define_method(RG_TARGET_NAMESPACE, "backward_sentence_start", backward_sentence_start, 0); rb_define_method(RG_TARGET_NAMESPACE, "forward_sentence_ends", forward_sentence_ends, 1); rb_define_method(RG_TARGET_NAMESPACE, "backward_sentence_starts", backward_sentence_starts, 1); rb_define_method(RG_TARGET_NAMESPACE, "forward_visible_word_ends", forward_visible_word_ends, 1); rb_define_method(RG_TARGET_NAMESPACE, "backward_visible_word_starts", backward_visible_word_starts, 1); rb_define_method(RG_TARGET_NAMESPACE, "forward_visible_word_end", forward_visible_word_end, 0); rb_define_method(RG_TARGET_NAMESPACE, "backword_visible_word_start", backward_visible_word_start, 0); rb_define_method(RG_TARGET_NAMESPACE, "forward_visible_cursor_position", forward_visible_cursor_position, 0); rb_define_method(RG_TARGET_NAMESPACE, "backward_visible_cursor_position", backward_visible_cursor_position, 0); rb_define_method(RG_TARGET_NAMESPACE, "forward_visible_cursor_positions", forward_visible_cursor_positions, 1); rb_define_method(RG_TARGET_NAMESPACE, "backward_visible_cursor_positions", backward_visible_cursor_positions, 1); rb_define_method(RG_TARGET_NAMESPACE, "forward_visible_line", forward_visible_line, 0); rb_define_method(RG_TARGET_NAMESPACE, "backward_visible_line", backward_visible_line, 0); rb_define_method(RG_TARGET_NAMESPACE, "forward_visible_lines", forward_visible_lines, 1); rb_define_method(RG_TARGET_NAMESPACE, "backward_visible_lines", backward_visible_lines, 1); rb_define_method(RG_TARGET_NAMESPACE, "forward_cursor_position", forward_cursor_position, 0); rb_define_method(RG_TARGET_NAMESPACE, "backward_cursor_position", backward_cursor_position, 0); rb_define_method(RG_TARGET_NAMESPACE, "forward_cursor_positions", forward_cursor_positions, 1); rb_define_method(RG_TARGET_NAMESPACE, "backward_cursor_positions", backward_cursor_positions, 1); RG_DEF_METHOD(forward_to_end, 0); rb_define_method(RG_TARGET_NAMESPACE, "forward_to_line_end", forward_to_line_end, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_offset", set_offset, 1); rb_define_method(RG_TARGET_NAMESPACE, "set_line", set_line, 1); rb_define_method(RG_TARGET_NAMESPACE, "set_line_offset", set_line_offset, 1); rb_define_method(RG_TARGET_NAMESPACE, "set_line_index", set_line_index, 1); rb_define_method(RG_TARGET_NAMESPACE, "set_visible_line_offset", set_visible_line_offset, 1); rb_define_method(RG_TARGET_NAMESPACE, "set_visible_line_index", set_visible_line_index, 1); RG_DEF_METHOD(forward_to_tag_toggle, -1); RG_DEF_METHOD(backward_to_tag_toggle, -1); RG_DEF_METHOD(forward_find_char, -1); RG_DEF_METHOD(backward_find_char, -1); RG_DEF_METHOD(forward_search, -1); RG_DEF_METHOD(backward_search, -1); RG_DEF_METHOD_OPERATOR("==", equal, 1); RG_DEF_METHOD_OPERATOR("<=>", compare, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkTextSearchFlags */ G_DEF_CLASS(GTK_TYPE_TEXT_SEARCH_FLAGS, "SearchFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TEXT_SEARCH_FLAGS, "GTK_TEXT_"); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkbutton.c���������������������������������������������������0000644�0001750�0001750�00000006234�12257552167�017654� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cButton #define _SELF(self) (GTK_BUTTON(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, use_underline; GtkWidget *widget = NULL; if (rb_scan_args(argc, argv, "02", &label, &use_underline) > 0) { if (TYPE(label) == T_STRING){ if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)){ widget = gtk_button_new_with_mnemonic(RVAL2CSTR(label)); } else { widget = gtk_button_new_with_label(RVAL2CSTR(label)); } } else if (TYPE(label) == T_SYMBOL){ widget = gtk_button_new_from_stock(rb_id2name(SYM2ID(label))); } else { rb_raise(rb_eArgError, "invalid argument %s (expect Symbol(Gtk::Stock constants) or String)", rb_class2name(CLASS_OF(label))); } } else { widget = gtk_button_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_pressed(VALUE self) { gtk_button_pressed(GTK_BUTTON(RVAL2GOBJ(self))); return self; } static VALUE rg_released(VALUE self) { gtk_button_released(_SELF(self)); return self; } static VALUE rg_enter(VALUE self) { gtk_button_enter(_SELF(self)); return self; } static VALUE rg_leave(VALUE self) { gtk_button_leave(_SELF(self)); return self; } static VALUE rg_set_alignment(VALUE self, VALUE xalign, VALUE yalign) { gtk_button_set_alignment(_SELF(self), NUM2DBL(xalign), NUM2DBL(yalign)); return self; } static VALUE rg_alignment(VALUE self) { gfloat xalign, yalign; gtk_button_get_alignment(_SELF(self), &xalign, &yalign); return rb_assoc_new(rb_float_new(xalign), rb_float_new(yalign)); } void Init_gtk_button(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BUTTON, "Button", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(pressed, 0); RG_DEF_METHOD(released, 0); RG_DEF_METHOD(enter, 0); RG_DEF_METHOD(leave, 0); RG_DEF_METHOD(set_alignment, 2); G_DEF_SETTER(RG_TARGET_NAMESPACE, "alignment"); RG_DEF_METHOD(alignment, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkiconinfo.c�������������������������������������������������0000644�0001750�0001750�00000005752�12257552167�020151� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cIconInfo #define _SELF(i) ((GtkIconInfo*)RVAL2BOXED(i, GTK_TYPE_ICON_INFO)) static VALUE rg_base_size(VALUE self) { return INT2NUM(gtk_icon_info_get_base_size(_SELF(self))); } static VALUE rg_filename(VALUE self) { return CSTR2RVAL(gtk_icon_info_get_filename(_SELF(self))); } static VALUE rg_builtin_pixbuf(VALUE self) { return GOBJ2RVAL(gtk_icon_info_get_builtin_pixbuf(_SELF(self))); } static VALUE rg_load_icon(VALUE self) { GError* error = NULL; GdkPixbuf* pixbuf = gtk_icon_info_load_icon(_SELF(self), &error); VALUE ret; if (error) RAISE_GERROR(error); ret = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return ret; } static VALUE rg_set_raw_coordinates(VALUE self, VALUE raw_coordinates) { gtk_icon_info_set_raw_coordinates(_SELF(self), RVAL2CBOOL(raw_coordinates)); return self; } static VALUE rg_embedded_rect(VALUE self) { GdkRectangle rectangle; gboolean ret = gtk_icon_info_get_embedded_rect(_SELF(self), &rectangle); if (ret) return BOXED2RVAL(&rectangle, GDK_TYPE_RECTANGLE); else return Qnil; } static VALUE rg_attach_points(VALUE self) { GdkPoint* points; gint n_points, i; gboolean ret = gtk_icon_info_get_attach_points(_SELF(self), &points, &n_points); VALUE ary = Qnil; if (ret){ ary = rb_ary_new(); for (i = 0; i < n_points; i++){ rb_ary_push(ary, rb_assoc_new(INT2NUM(points[i].x), INT2NUM(points[i].y))); } g_free(points); } return ary; } static VALUE rg_display_name(VALUE self) { return CSTR2RVAL(gtk_icon_info_get_display_name(_SELF(self))); } void Init_gtk_iconinfo(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_INFO, "IconInfo", mGtk); RG_DEF_METHOD(base_size, 0); RG_DEF_METHOD(filename, 0); RG_DEF_METHOD(builtin_pixbuf, 0); RG_DEF_METHOD(load_icon, 0); RG_DEF_METHOD(set_raw_coordinates, 1); RG_DEF_METHOD(embedded_rect, 0); RG_DEF_METHOD(attach_points, 0); RG_DEF_METHOD(display_name, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ����������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreemodelsort.c��������������������������������������������0000644�0001750�0001750�00000006763�12257552167�021240� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTreeModelSort #define _SELF(s) (GTK_TREE_MODEL_SORT(RVAL2GOBJ(s))) static ID id_model; static VALUE rg_initialize(VALUE self, VALUE model) { G_CHILD_SET(self, id_model, model); G_INITIALIZE(self, gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(RVAL2GOBJ(model)))); return Qnil; } static VALUE rg_convert_child_path_to_path(VALUE self, VALUE child_path) { return GTKTREEPATH2RVAL(gtk_tree_model_sort_convert_child_path_to_path( _SELF(self), RVAL2GTKTREEPATH(child_path))); } static VALUE rg_convert_child_iter_to_iter(VALUE self, VALUE child_iter) { GtkTreeIter sort_iter; GtkTreeModelSort* modelsort = _SELF(self); gtk_tree_model_sort_convert_child_iter_to_iter(modelsort, &sort_iter, RVAL2GTKTREEITER(child_iter)); sort_iter.user_data3 = gtk_tree_model_sort_get_model(modelsort); return GTKTREEITER2RVAL(&sort_iter); } static VALUE rg_convert_path_to_child_path(VALUE self, VALUE sorted_path) { return GTKTREEPATH2RVAL(gtk_tree_model_sort_convert_path_to_child_path( _SELF(self), RVAL2GTKTREEPATH(sorted_path))); } static VALUE rg_convert_iter_to_child_iter(VALUE self, VALUE sorted_iter) { GtkTreeIter child_iter; GtkTreeModelSort* modelsort = _SELF(self); gtk_tree_model_sort_convert_iter_to_child_iter(modelsort, &child_iter, RVAL2GTKTREEITER(sorted_iter)); child_iter.user_data3 = gtk_tree_model_sort_get_model(modelsort); return GTKTREEITER2RVAL(&child_iter); } static VALUE rg_reset_default_sort_func(VALUE self) { gtk_tree_model_sort_reset_default_sort_func(_SELF(self)); return self; } static VALUE rg_clear_cache(VALUE self) { gtk_tree_model_sort_clear_cache(_SELF(self)); return self; } static VALUE rg_iter_is_valid_p(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_tree_model_sort_iter_is_valid(_SELF(self), RVAL2GTKTREEITER(iter))); } void Init_gtk_tmodelsort(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_MODEL_SORT, "TreeModelSort", mGtk); id_model = rb_intern("model"); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(convert_child_path_to_path, 1); RG_DEF_METHOD(convert_child_iter_to_iter, 1); RG_DEF_METHOD(convert_path_to_child_path, 1); RG_DEF_METHOD(convert_iter_to_child_iter, 1); RG_DEF_METHOD(reset_default_sort_func, 0); RG_DEF_METHOD(clear_cache, 0); RG_DEF_METHOD_P(iter_is_valid, 1); } �������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkuimanager.c������������������������������������������������0000644�0001750�0001750�00000012676�12257552167�020320� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cUIManager #define _SELF(self) (GTK_UI_MANAGER(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_ui_manager_new()); return Qnil; } static VALUE rg_insert_action_group(VALUE self, VALUE action_group, VALUE pos) { gtk_ui_manager_insert_action_group(_SELF(self), RVAL2GOBJ(action_group), NUM2INT(pos)); G_CHILD_ADD(self, action_group); return self; } static VALUE rg_remove_action_group(VALUE self, VALUE action_group) { gtk_ui_manager_remove_action_group(_SELF(self), RVAL2GOBJ(action_group)); G_CHILD_REMOVE(self, action_group); return self; } static VALUE rg_action_groups(VALUE self) { /* Owned by GTK+ */ return GLIST2ARY(gtk_ui_manager_get_action_groups(_SELF(self))); } static VALUE rg_accel_group(VALUE self) { return GOBJ2RVAL(gtk_ui_manager_get_accel_group(_SELF(self))); } static VALUE rg_get_widget(VALUE self, VALUE path) { GtkWidget* widget = gtk_ui_manager_get_widget(_SELF(self), RVAL2CSTR(path)); if (! widget) rb_raise(rb_eArgError, "no widget was found."); return GOBJ2RVAL(widget); } static VALUE rg_get_toplevels(VALUE self, VALUE types) { return GSLIST2ARYF(gtk_ui_manager_get_toplevels(_SELF(self), RVAL2GFLAGS(types, GTK_TYPE_UI_MANAGER_ITEM_TYPE))); } static VALUE rg_get_action(VALUE self, VALUE path) { return GOBJ2RVAL(gtk_ui_manager_get_action(_SELF(self), RVAL2CSTR(path))); } static VALUE rg_add_ui(int argc, VALUE *argv, VALUE self) { GError* error = NULL; guint ret; VALUE buffer; if (argc == 1) { VALUE buffer_or_filename; rb_scan_args(argc, argv, "10", &buffer_or_filename); StringValue(buffer_or_filename); buffer = rb_funcall(buffer_or_filename, rb_intern("include?"), 1, CSTR2RVAL("<ui>")); if (RVAL2CBOOL(buffer)){ StringValue(buffer_or_filename); ret = gtk_ui_manager_add_ui_from_string(_SELF(self), RSTRING_PTR(buffer_or_filename), RSTRING_LEN(buffer_or_filename), &error); } else { ret = gtk_ui_manager_add_ui_from_file(_SELF(self), RVAL2CSTR(buffer_or_filename), &error); } } else { VALUE merge_id, path, name, action, type, top; rb_scan_args(argc, argv, "60", &merge_id, &path, &name, &action, &type, &top); ret = NUM2UINT(merge_id); gtk_ui_manager_add_ui(_SELF(self), ret, RVAL2CSTR(path), RVAL2CSTR(name), RVAL2CSTR(action), RVAL2GFLAGS(type, GTK_TYPE_UI_MANAGER_ITEM_TYPE), RVAL2CBOOL(top)); } if (ret == 0) RAISE_GERROR(error); return UINT2NUM(ret); } static VALUE rg_new_merge_id(VALUE self) { return UINT2NUM(gtk_ui_manager_new_merge_id(_SELF(self))); } static VALUE rg_remove_ui(VALUE self, VALUE merge_id) { gtk_ui_manager_remove_ui(_SELF(self), NUM2UINT(merge_id)); return self; } static VALUE rg_ensure_update(VALUE self) { gtk_ui_manager_ensure_update(_SELF(self)); return self; } static void rbuimanager_mark(void *p) { GtkUIManager *manager; GList *node; manager = GTK_UI_MANAGER(p); for (node = gtk_ui_manager_get_action_groups(manager); node; node = g_list_next(node)) { GtkWidget *action_group = node->data; rbgobj_gc_mark_instance(action_group); } rbgobj_gc_mark_instance(gtk_ui_manager_get_accel_group(manager)); } void Init_gtk_uimanager(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_GC_FUNC(GTK_TYPE_UI_MANAGER, "UIManager", mGtk, rbuimanager_mark, NULL); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(insert_action_group, 2); RG_DEF_METHOD(remove_action_group, 1); RG_DEF_METHOD(action_groups, 0); RG_DEF_METHOD(accel_group, 0); RG_DEF_METHOD(get_widget, 1); RG_DEF_ALIAS("[]", "get_widget"); RG_DEF_METHOD(get_toplevels, 1); RG_DEF_METHOD(get_action, 1); RG_DEF_METHOD(add_ui, -1); RG_DEF_METHOD(new_merge_id, 0); RG_DEF_METHOD(remove_ui, 1); RG_DEF_METHOD(ensure_update, 0); /* GtkUIManagerItemType */ G_DEF_CLASS(GTK_TYPE_UI_MANAGER_ITEM_TYPE, "ItemType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_UI_MANAGER_ITEM_TYPE, "GTK_UI_MANAGER_"); } ������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrecentfilterinfo.c�����������������������������������������0000644�0001750�0001750�00000011164�12257552167�021701� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" /*****************************************/ static GtkRecentFilterInfo* rf_copy(const GtkRecentFilterInfo* info) { GtkRecentFilterInfo* new_info; g_return_val_if_fail (info != NULL, NULL); new_info = g_new(GtkRecentFilterInfo, 1); *new_info = *info; return new_info; } static void rf_free(GtkRecentFilterInfo* boxed) { if (boxed) { g_free(boxed->applications); g_free(boxed->groups); g_free(boxed); } } GType gtk_recent_filter_info_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkRecentFilterInfo", (GBoxedCopyFunc)rf_copy, (GBoxedFreeFunc)rf_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cRecentFilterInfo #define _SELF(w) ((GtkRecentFilterInfo*)RVAL2BOXED(w, GTK_TYPE_RECENT_FILTER_INFO)) static VALUE rg_initialize(VALUE self) { GtkRecentFilterInfo finfo; memset(&finfo, 0, sizeof(GtkRecentFilterInfo)); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_RECENT_FILTER_INFO, &finfo)); return Qnil; } static VALUE rg_contains(VALUE self) { return GFLAGS2RVAL(_SELF(self)->contains, GTK_TYPE_RECENT_FILTER_FLAGS); } static VALUE rg_set_contains(VALUE self, VALUE contains) { _SELF(self)->contains = RVAL2GFLAGS(contains, GTK_TYPE_RECENT_FILTER_FLAGS); return self; } #define FINFO_STR(name)\ static VALUE \ rf_get_ ## name (VALUE self)\ {\ return CSTR2RVAL(_SELF(self)->name);\ }\ static VALUE \ rf_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = RVAL2CSTR(val);\ return self;\ } FINFO_STR(uri); FINFO_STR(display_name); FINFO_STR(mime_type); static VALUE rg_applications(VALUE self) { const gchar** apps = _SELF(self)->applications; VALUE ary = rb_ary_new(); gint i = 0; while (apps[i]) { rb_ary_push(ary, CSTR2RVAL((gchar*)apps[i])); i++; } return ary; } static VALUE rg_set_applications(VALUE self, VALUE applications) { /* NOTE: This can't be right. What guarantees that the entries in * applications will be around? It should be RVAL2STRV_DUP and use * g_strfreev in free above. */ _SELF(self)->applications = RVAL2STRV(applications); return self; } static VALUE rg_groups(VALUE self) { const gchar** grps = _SELF(self)->groups; VALUE ary = rb_ary_new(); gint i = 0; while (grps[i]) { rb_ary_push(ary, CSTR2RVAL((gchar*)grps[i])); i++; } return ary; } static VALUE rg_set_groups(VALUE self, VALUE groups) { _SELF(self)->groups = RVAL2STRV(groups); return self; } static VALUE rg_age(VALUE self) { return INT2NUM(_SELF(self)->age); } static VALUE rg_set_age(VALUE self, VALUE age) { _SELF(self)->age = NUM2INT(age); return self; } void Init_gtk_recent_filter_info(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_FILTER_INFO, "RecentFilterInfo", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(contains, 0); RG_DEF_METHOD(set_contains, 1); rb_define_method(RG_TARGET_NAMESPACE, "uri", rf_get_uri, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_uri", rf_set_uri, 1); rb_define_method(RG_TARGET_NAMESPACE, "display_name", rf_get_display_name, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_display_name", rf_set_display_name, 1); rb_define_method(RG_TARGET_NAMESPACE, "mime_type", rf_get_mime_type, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_mime_type", rf_set_mime_type, 1); RG_DEF_METHOD(applications, 0); RG_DEF_METHOD(set_applications, 1); RG_DEF_METHOD(groups, 0); RG_DEF_METHOD(set_groups, 1); RG_DEF_METHOD(age, 0); RG_DEF_METHOD(set_age, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkframe.c����������������������������������������������������0000644�0001750�0001750�00000004263�11701304107�017411� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFrame static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label; rb_scan_args(argc, argv, "01", &label); RBGTK_INITIALIZE(self, gtk_frame_new(NIL_P(label)?NULL:RVAL2CSTR(label))); return Qnil; } static VALUE rg_set_label_align(VALUE self, VALUE xalign, VALUE yalign) { gtk_frame_set_label_align(GTK_FRAME(RVAL2GOBJ(self)), NUM2DBL(xalign), NUM2DBL(yalign)); return self; } static VALUE rg_label_align(VALUE self) { gfloat xalign, yalign; gtk_frame_get_label_align(GTK_FRAME(RVAL2GOBJ(self)), &xalign, &yalign); return rb_ary_new3(2, rb_float_new(xalign), rb_float_new(yalign)); } void Init_gtk_frame(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FRAME, "Frame", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_label_align, 2); RG_DEF_METHOD(label_align, 0); rb_undef_method(RG_TARGET_NAMESPACE, "shadow"); rb_undef_method(RG_TARGET_NAMESPACE, "shadow="); rb_undef_method(RG_TARGET_NAMESPACE, "set_shadow"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfilesystemerror.c������������������������������������������0000644�0001750�0001750�00000004013�12257552167�021570� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005,2006 Ruby-GNOME2 Project Team * Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFileSystemError void Init_gtk_filesystemerror(VALUE mGtk) { #ifdef GTK_FILE_SYSTEM_ERROR VALUE RG_TARGET_NAMESPACE; /* GtkFileSystemError */ RG_TARGET_NAMESPACE = G_DEF_ERROR2(GTK_FILE_SYSTEM_ERROR, "FileSystemError", mGtk, rb_eRuntimeError); rb_define_const(RG_TARGET_NAMESPACE, "NONEXISTENT", INT2NUM(GTK_FILE_SYSTEM_ERROR_NONEXISTENT)); rb_define_const(RG_TARGET_NAMESPACE, "NOT_FOLDER", INT2NUM(GTK_FILE_SYSTEM_ERROR_NOT_FOLDER)); rb_define_const(RG_TARGET_NAMESPACE, "INVALID_URI", INT2NUM(GTK_FILE_SYSTEM_ERROR_INVALID_URI)); rb_define_const(RG_TARGET_NAMESPACE, "BAD_FILENAME", INT2NUM(GTK_FILE_SYSTEM_ERROR_BAD_FILENAME)); rb_define_const(RG_TARGET_NAMESPACE, "FAILED", INT2NUM(GTK_FILE_SYSTEM_ERROR_FAILED)); rb_define_const(RG_TARGET_NAMESPACE, "ALREADY_EXSITS", INT2NUM(GTK_FILE_SYSTEM_ERROR_ALREADY_EXISTS)); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktoolbar.c��������������������������������������������������0000644�0001750�0001750�00000027305�12257552167�020005� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cToolbar #define _SELF(self) (GTK_TOOLBAR(RVAL2GOBJ(self))) #define N_RVAL2CSTR(text) (NIL_P(text) ? NULL : RVAL2CSTR(text)) #define N_RVAL2WIDGET(w) (NIL_P(w) ? NULL : GTK_WIDGET(RVAL2GOBJ(w))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_toolbar_new()); return Qnil; } static VALUE rg_append(int argc, VALUE *argv, VALUE self) { GtkWidget* ret = NULL; VALUE type = Qnil; VALUE widget, stock_id, element_type, text, ttext, ptext, icon, func; if (argc > 0) type = argv[0]; if (NIL_P(type) || TYPE(type) == T_STRING){ rb_scan_args(argc, argv, "05", &text, &ttext, &ptext, &icon, &func); if (NIL_P(func)) func = rb_block_proc(); G_RELATIVE(self, func); ret = gtk_toolbar_append_item(_SELF(self), N_RVAL2CSTR(text), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext), N_RVAL2WIDGET(icon), GTK_SIGNAL_FUNC(exec_callback), (gpointer)func); } else if (TYPE(type) == T_FIXNUM) { rb_scan_args(argc, argv, "07", &element_type, &widget, &text, &ttext, &ptext, &icon, &func); if (NIL_P(func)) func = rb_block_proc(); G_RELATIVE(self, func); ret = gtk_toolbar_append_element(_SELF(self), RVAL2GENUM(element_type, GTK_TYPE_TOOLBAR_CHILD_TYPE), N_RVAL2WIDGET(widget), N_RVAL2CSTR(text), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext), N_RVAL2WIDGET(icon), GTK_SIGNAL_FUNC(exec_callback), (gpointer)func); if (RVAL2GENUM(element_type, GTK_TYPE_TOOLBAR_CHILD_TYPE) == GTK_TOOLBAR_CHILD_SPACE) ret = NULL; } else if (TYPE(type) == T_SYMBOL) { rb_scan_args(argc, argv, "13", &stock_id, &ttext, &ptext, &func); if (NIL_P(func)) func = rb_block_proc(); G_RELATIVE(self, func); ret = gtk_toolbar_insert_stock(_SELF(self), rb_id2name(SYM2ID(stock_id)), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext), GTK_SIGNAL_FUNC(exec_callback), (gpointer)func, -1); } else { rb_scan_args(argc, argv, "12", &widget, &ttext, &ptext); gtk_toolbar_append_widget(_SELF(self), GTK_WIDGET(RVAL2GOBJ(widget)), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext)); return widget; } return ret ? GOBJ2RVAL(ret) : Qnil; } static VALUE rg_prepend(int argc, VALUE *argv, VALUE self) { GtkWidget* ret = NULL; VALUE type = Qnil; VALUE widget, stock_id, element_type, text, ttext, ptext, icon, func; if (argc > 0) type = argv[0]; if (NIL_P(type) || TYPE(type) == T_STRING){ rb_scan_args(argc, argv, "05", &text, &ttext, &ptext, &icon, &func); if (NIL_P(func)) func = rb_block_proc(); G_RELATIVE(self, func); ret = gtk_toolbar_prepend_item(_SELF(self), N_RVAL2CSTR(text), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext), N_RVAL2WIDGET(icon), GTK_SIGNAL_FUNC(exec_callback), (gpointer)func); } else if (TYPE(type) == T_FIXNUM) { rb_scan_args(argc, argv, "07", &element_type, &widget, &text, &ttext, &ptext, &icon, &func); if (NIL_P(func)) func = rb_block_proc(); G_RELATIVE(self, func); ret = gtk_toolbar_prepend_element(_SELF(self), RVAL2GENUM(element_type, GTK_TYPE_TOOLBAR_CHILD_TYPE), N_RVAL2WIDGET(widget), N_RVAL2CSTR(text), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext), N_RVAL2WIDGET(icon), GTK_SIGNAL_FUNC(exec_callback), (gpointer)func); if (RVAL2GENUM(element_type, GTK_TYPE_TOOLBAR_CHILD_TYPE) == GTK_TOOLBAR_CHILD_SPACE) ret = NULL; } else if (TYPE(type) == T_SYMBOL) { rb_scan_args(argc, argv, "13", &stock_id, &ttext, &ptext, &func); if (NIL_P(func)) func = rb_block_proc(); G_RELATIVE(self, func); ret = gtk_toolbar_insert_stock(_SELF(self), rb_id2name(SYM2ID(stock_id)), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext), GTK_SIGNAL_FUNC(exec_callback), (gpointer)func, 0); } else { rb_scan_args(argc, argv, "12", &widget, &ttext, &ptext); gtk_toolbar_prepend_widget(_SELF(self), GTK_WIDGET(RVAL2GOBJ(widget)), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext)); return widget; } return ret ? GOBJ2RVAL(ret) : Qnil; } static VALUE rg_insert(int argc, VALUE *argv, VALUE self) { GtkWidget* ret = NULL; VALUE type = Qnil; VALUE pos, widget, stock_id, element_type, text, ttext, ptext, icon, func; if (argc > 1) type = argv[1]; if (NIL_P(type) || TYPE(type) == T_STRING){ rb_scan_args(argc, argv, "15", &pos, &text, &ttext, &ptext, &icon, &func); if (NIL_P(func)) func = rb_block_proc(); G_RELATIVE(self, func); ret = gtk_toolbar_insert_item(_SELF(self),N_RVAL2CSTR(text), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext), N_RVAL2WIDGET(icon), GTK_SIGNAL_FUNC(exec_callback), (gpointer)func, NUM2INT(pos)); } else if (TYPE(type) == T_FIXNUM) { rb_scan_args(argc, argv, "17", &pos, &element_type, &widget, &text, &ttext, &ptext, &icon, &func); if (NIL_P(func)) func = rb_block_proc(); G_RELATIVE(self, func); ret = gtk_toolbar_insert_element(_SELF(self), RVAL2GENUM(element_type, GTK_TYPE_TOOLBAR_CHILD_TYPE), N_RVAL2WIDGET(widget), N_RVAL2CSTR(text), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext), N_RVAL2WIDGET(icon), GTK_SIGNAL_FUNC(exec_callback), (gpointer)func, NUM2INT(pos)); if (RVAL2GENUM(element_type, GTK_TYPE_TOOLBAR_CHILD_TYPE) == GTK_TOOLBAR_CHILD_SPACE) ret = NULL; } else if (TYPE(type) == T_SYMBOL) { rb_scan_args(argc, argv, "14", &pos, &stock_id, &ttext, &ptext, &func); if (NIL_P(func)) func = rb_block_proc(); G_RELATIVE(self, func); ret = gtk_toolbar_insert_stock(_SELF(self), rb_id2name(SYM2ID(stock_id)), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext), GTK_SIGNAL_FUNC(exec_callback), (gpointer)func, NUM2INT(pos)); } else if (rb_obj_is_kind_of(type, GTYPE2CLASS(GTK_TYPE_TOOL_ITEM))){ rb_scan_args(argc, argv, "20", &pos, &widget); gtk_toolbar_insert(_SELF(self), GTK_TOOL_ITEM(RVAL2GOBJ(widget)), NUM2INT(pos)); return widget; } else { rb_scan_args(argc, argv, "22", &pos, &widget, &ttext, &ptext); gtk_toolbar_insert_widget(_SELF(self), GTK_WIDGET(RVAL2GOBJ(widget)), N_RVAL2CSTR(ttext), N_RVAL2CSTR(ptext), NUM2INT(pos)); return widget; } return ret ? GOBJ2RVAL(ret) : Qnil; } static VALUE rg_item_index(VALUE self, VALUE item) { return INT2NUM(gtk_toolbar_get_item_index(_SELF(self), GTK_TOOL_ITEM(RVAL2GOBJ(item)))); } static VALUE rg_n_items(VALUE self) { return INT2NUM(gtk_toolbar_get_n_items(_SELF(self))); } static VALUE rg_nth_item(VALUE self, VALUE n) { return GOBJ2RVAL(gtk_toolbar_get_nth_item(_SELF(self), NUM2INT(n))); } static VALUE rg_drop_index(VALUE self, VALUE x, VALUE y) { return INT2NUM(gtk_toolbar_get_drop_index(_SELF(self), NUM2INT(x), NUM2INT(y))); } static VALUE rg_set_drop_highlight_item(VALUE self, VALUE item, VALUE index) { gtk_toolbar_set_drop_highlight_item(_SELF(self), GTK_TOOL_ITEM(RVAL2GOBJ(item)), NUM2INT(index)); return self; } static VALUE rg_relief_style(VALUE self) { return GENUM2RVAL(gtk_toolbar_get_relief_style(_SELF(self)), GTK_TYPE_RELIEF_STYLE); } static VALUE rg_append_space(VALUE self) { gtk_toolbar_append_space(_SELF(self)); return self; } static VALUE rg_prepend_space(VALUE self) { gtk_toolbar_prepend_space(_SELF(self)); return self; } static VALUE rg_insert_space(VALUE self, VALUE pos) { gtk_toolbar_insert_space(_SELF(self), NUM2INT(pos)); return self; } static VALUE rg_remove_space(VALUE self, VALUE position) { gtk_toolbar_remove_space(_SELF(self), NUM2INT(position)); return self; } static VALUE rg_unset_icon_size(VALUE self) { gtk_toolbar_unset_icon_size(_SELF(self)); return self; } static VALUE rg_unset_style(VALUE self) { gtk_toolbar_unset_style(_SELF(self)); return self; } void Init_gtk_toolbar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOOLBAR, "Toolbar", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(item_index, 1); RG_DEF_METHOD(n_items, 0); RG_DEF_METHOD(nth_item, 1); RG_DEF_METHOD(drop_index, 2); RG_DEF_METHOD(set_drop_highlight_item, 2); RG_DEF_METHOD(relief_style, 0); RG_DEF_METHOD(append, -1); RG_DEF_METHOD(prepend, -1); RG_DEF_METHOD(insert, -1); RG_DEF_METHOD(append_space, 0); RG_DEF_METHOD(prepend_space, 0); RG_DEF_METHOD(insert_space, 1); RG_DEF_METHOD(remove_space, 1); RG_DEF_METHOD(unset_icon_size, 0); RG_DEF_METHOD(unset_style, 0); /* GtkToolbarChildType */ G_DEF_CLASS(GTK_TYPE_TOOLBAR_CHILD_TYPE, "ChildType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TOOLBAR_CHILD_TYPE, "GTK_TOOLBAR_"); /* GtkToolbarSpaceStyle */ G_DEF_CLASS(GTK_TYPE_TOOLBAR_SPACE_STYLE, "SpaceStyle", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TOOLBAR_SPACE_STYLE, "GTK_TOOLBAR_"); /* GtkToolbarStyle(from Standard Constants) */ G_DEF_CLASS(GTK_TYPE_TOOLBAR_STYLE, "Style", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TOOLBAR_STYLE, "GTK_TOOLBAR_"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkmenubar.c��������������������������������������������������0000644�0001750�0001750�00000003041�12257552167�017763� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cMenuBar static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_menu_bar_new()); return Qnil; } void Init_gtk_menu_bar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU_BAR, "MenuBar", mGtk); RG_DEF_METHOD(initialize, 0); /* GtkPackDirection */ G_DEF_CLASS(GTK_TYPE_PACK_DIRECTION, "PackDirection", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PACK_DIRECTION, "GTK_"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktextattributes.c�������������������������������������������0000644�0001750�0001750�00000014302�11701304107�021405� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTextAttributes #define _SELF(s) ((GtkTextAttributes*)RVAL2BOXED(s, GTK_TYPE_TEXT_ATTRIBUTES)) /***********************************************/ #define ATTR_INT(name)\ static VALUE \ txt_attr_int_ ## name (VALUE self)\ {\ return INT2NUM(_SELF(self)->name);\ }\ static VALUE \ txt_attr_int_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = NUM2INT(val); \ return self;\ } #define ATTR_BOOL(name)\ static VALUE \ txt_attr_bool_ ## name (VALUE self)\ {\ return CBOOL2RVAL(_SELF(self)->name);\ }\ static VALUE \ txt_attr_bool_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = RVAL2CBOOL(val);\ return self;\ } #define ATTR_FLAGS(name, gtype)\ static VALUE \ txt_attr_flags_ ## name (VALUE self)\ {\ return GFLAGS2RVAL(_SELF(self)->name, gtype);\ }\ static VALUE \ txt_attr_flags_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = RVAL2GFLAGS(val, gtype);\ return self;\ } #define ATTR_ENUM(name, gtype)\ static VALUE \ txt_attr_enums_ ## name (VALUE self)\ {\ return GENUM2RVAL(_SELF(self)->name, gtype);\ }\ static VALUE \ txt_attr_enums_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = RVAL2GENUM(val, gtype);\ return self;\ } #define ATTR_BOXED(name, gtype)\ static VALUE \ txt_attr_boxed_ ## name (VALUE self)\ {\ VALUE val; \ if (_SELF(self)->name == NULL) return Qnil;\ val = BOXED2RVAL(_SELF(self)->name, gtype);\ G_CHILD_SET(self, rb_intern(G_STRINGIFY(name)), val);\ return val;\ }\ static VALUE \ txt_attr_boxed_set_ ## name (VALUE self, VALUE val)\ {\ G_CHILD_SET(self, rb_intern(G_STRINGIFY(name)), val);\ _SELF(self)->name = RVAL2BOXED(val, gtype);\ return self;\ } #define DEFINE_ACCESSOR(gt, type, name) \ rb_define_method(gt, G_STRINGIFY(name), txt_attr_ ## type ## _## name, 0);\ rb_define_method(gt, G_STRINGIFY(set_ ## name), txt_attr_ ## type ## _set_## name, 1); /***********************************************/ static VALUE txt_attr_boxed_appearance(VALUE self) { GtkTextAppearance app = _SELF(self)->appearance; return BOXED2RVAL(&app, GTK_TYPE_TEXT_APPEARANCE); } static VALUE txt_attr_boxed_set_appearance(VALUE self, VALUE val) { GtkTextAppearance* app = (GtkTextAppearance*)RVAL2BOXED(val, GTK_TYPE_TEXT_APPEARANCE); _SELF(self)->appearance = *app; return self; } ATTR_ENUM(justification, GTK_TYPE_JUSTIFICATION); ATTR_ENUM(direction, GTK_TYPE_DIRECTION_TYPE); ATTR_BOXED(font, PANGO_TYPE_FONT_DESCRIPTION); static VALUE txt_attr_double_font_scale(VALUE self) { return rb_float_new(_SELF(self)->font_scale); } static VALUE txt_attr_double_set_font_scale(VALUE self, VALUE val) { _SELF(self)->font_scale = NUM2DBL(val); return self; } ATTR_INT(left_margin); ATTR_INT(indent); ATTR_INT(right_margin); ATTR_INT(pixels_above_lines); ATTR_INT(pixels_below_lines); ATTR_INT(pixels_inside_wrap); ATTR_BOXED(tabs, PANGO_TYPE_TAB_ARRAY); ATTR_ENUM(wrap_mode, GTK_TYPE_WRAP_MODE); ATTR_BOXED(language, PANGO_TYPE_LANGUAGE); ATTR_BOOL(invisible); ATTR_BOOL(bg_full_height); ATTR_BOOL(editable); ATTR_BOOL(realized); /***********************************************/ static VALUE rg_initialize(VALUE self) { GtkTextAttributes *attr; attr = gtk_text_attributes_new(); G_INITIALIZE(self, attr); return Qnil; } static VALUE rg_copy_values(VALUE self, VALUE dest) { gtk_text_attributes_copy_values(_SELF(self), _SELF(dest)); return self; } void Init_gtk_text_attributes(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_ATTRIBUTES, "TextAttributes", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(copy_values, 1); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, boxed, appearance); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, enums, justification); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, enums, direction); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, boxed, font); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, double, font_scale); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, left_margin); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, indent); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, right_margin); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, pixels_above_lines); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, pixels_below_lines); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, pixels_inside_wrap); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, boxed, tabs); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, enums, wrap_mode); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, boxed, language); rb_define_method(RG_TARGET_NAMESPACE, "invisible?", txt_attr_bool_invisible, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_invisible", txt_attr_bool_set_invisible, 1); rb_define_method(RG_TARGET_NAMESPACE, "bg_full_height?", txt_attr_bool_bg_full_height, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_bg_full_height", txt_attr_bool_set_bg_full_height, 1); rb_define_method(RG_TARGET_NAMESPACE, "editable?", txt_attr_bool_editable, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_editable", txt_attr_bool_set_editable, 1); rb_define_method(RG_TARGET_NAMESPACE, "realized?", txt_attr_bool_realized, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_realized", txt_attr_bool_set_realized, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkvisual.c���������������������������������������������������0000644�0001750�0001750�00000013475�12257552167�017631� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cVisual #define _SELF(self) (GDK_VISUAL(RVAL2GOBJ(self))) static VALUE rg_s_query_depths(G_GNUC_UNUSED VALUE self) { gint *depth; gint count; VALUE ary; int i; gdk_query_depths(&depth, &count); ary = rb_ary_new2(count); for (i = 0; i < count; i++) { rb_ary_push(ary, INT2NUM((depth)[i])); } return ary; } static VALUE rg_s_query_visual_types(G_GNUC_UNUSED VALUE self) { GdkVisualType *visual_types; gint count; VALUE ary; int i; gdk_query_visual_types(&visual_types, &count); ary = rb_ary_new2(count); for (i = 0; i < count; i++) { rb_ary_push(ary, GENUM2RVAL((visual_types)[i], GDK_TYPE_VISUAL_TYPE)); } return ary; } static VALUE rg_s_visuals(G_GNUC_UNUSED VALUE self) { GList *list = gdk_list_visuals(), *cur; VALUE ary = rb_ary_new(); for (cur = list; cur != NULL; cur = cur->next) { rb_ary_push(ary, GOBJ2RVAL((GdkVisual *)cur->data)); } g_list_free(list); return ary; } static VALUE rg_s_best_depth(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_visual_get_best_depth()); } static VALUE rg_s_best_type(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_visual_get_best_type()); } static VALUE rg_s_system(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_visual_get_system()); } static VALUE rg_s_best(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_visual_get_best()); } static VALUE rg_s_best_with_depth(G_GNUC_UNUSED VALUE self, VALUE depth) { return GOBJ2RVAL(gdk_visual_get_best_with_depth(NUM2INT(depth))); } static VALUE rg_s_best_with_type(G_GNUC_UNUSED VALUE self, VALUE type) { return GOBJ2RVAL(gdk_visual_get_best_with_depth( (GdkVisualType)GENUM2RVAL(type, GDK_TYPE_VISUAL_TYPE))); } static VALUE rg_s_best_with_both(G_GNUC_UNUSED VALUE self, VALUE depth, VALUE type) { return GOBJ2RVAL(gdk_visual_get_best_with_both( NUM2INT(depth), (GdkVisualType)RVAL2GENUM(type, GDK_TYPE_VISUAL_TYPE))); } static VALUE rg_screen(VALUE self) { return GOBJ2RVAL(gdk_visual_get_screen(_SELF(self))); } /* Structure accessors */ static VALUE rg_visual_type(VALUE self) { return GENUM2RVAL(_SELF(self)->type, GDK_TYPE_VISUAL_TYPE); } static VALUE rg_depth(VALUE self) { return INT2FIX(_SELF(self)->depth); } static VALUE rg_byte_order(VALUE self) { return GENUM2RVAL(_SELF(self)->byte_order, GDK_TYPE_BYTE_ORDER); } static VALUE rg_colormap_size(VALUE self) { return INT2FIX(_SELF(self)->colormap_size); } static VALUE rg_bits_per_rgb(VALUE self) { return INT2FIX(_SELF(self)->bits_per_rgb); } static VALUE rg_red_mask(VALUE self) { return INT2FIX(_SELF(self)->red_mask); } static VALUE rg_red_shift(VALUE self) { return INT2FIX(_SELF(self)->red_shift); } static VALUE rg_red_prec(VALUE self) { return INT2FIX(_SELF(self)->red_prec); } static VALUE rg_green_mask(VALUE self) { return INT2FIX(_SELF(self)->green_mask); } static VALUE rg_green_shift(VALUE self) { return INT2FIX(_SELF(self)->green_shift); } static VALUE rg_green_prec(VALUE self) { return INT2FIX(_SELF(self)->green_prec); } static VALUE rg_blue_mask(VALUE self) { return INT2FIX(_SELF(self)->blue_mask); } static VALUE rg_blue_shift(VALUE self) { return INT2FIX(_SELF(self)->blue_shift); } static VALUE rg_blue_prec(VALUE self) { return INT2FIX(_SELF(self)->blue_prec); } void Init_gtk_gdk_visual(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_VISUAL, "Visual", mGdk); /* class methods */ RG_DEF_SMETHOD(query_depths, 0); RG_DEF_SMETHOD(query_visual_types, 0); RG_DEF_SMETHOD(visuals, 0); RG_DEF_SMETHOD(best_depth, 0); RG_DEF_SMETHOD(best_type, 0); RG_DEF_SMETHOD(system, 0); RG_DEF_SMETHOD(best, 0); RG_DEF_SMETHOD(best_with_depth, 1); RG_DEF_SMETHOD(best_with_type, 1); RG_DEF_SMETHOD(best_with_both, 2); /* instance methods */ RG_DEF_METHOD(screen, 0); RG_DEF_METHOD(visual_type, 0); RG_DEF_METHOD(depth, 0); RG_DEF_METHOD(byte_order, 0); RG_DEF_METHOD(colormap_size, 0); RG_DEF_METHOD(bits_per_rgb, 0); RG_DEF_METHOD(red_mask, 0); RG_DEF_METHOD(red_shift, 0); RG_DEF_METHOD(red_prec, 0); RG_DEF_METHOD(green_mask, 0); RG_DEF_METHOD(green_shift, 0); RG_DEF_METHOD(green_prec, 0); RG_DEF_METHOD(blue_mask, 0); RG_DEF_METHOD(blue_shift, 0); RG_DEF_METHOD(blue_prec, 0); /* GdkVisualType */ G_DEF_CLASS(GDK_TYPE_VISUAL_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_VISUAL_TYPE, "GDK_VISUAL_"); /* GdkByteOrder */ G_DEF_CLASS(GDK_TYPE_BYTE_ORDER, "ByteOrder", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_BYTE_ORDER, "GDK_"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkimmulticontext.c�������������������������������������������0000644�0001750�0001750�00000002766�11701304107�021412� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cIMMulticontext #define _SELF(self) (GTK_IM_MULTICONTEXT(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_im_multicontext_new()); return Qnil; } static VALUE rg_append_menuitems(VALUE self, VALUE menushell) { gtk_im_multicontext_append_menuitems(_SELF(self), RVAL2GOBJ(menushell)); return self; } void Init_gtk_im_multicontext(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_IM_MULTICONTEXT, "IMMulticontext", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(append_menuitems, 1); } ����������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktexttag.c��������������������������������������������������0000644�0001750�0001750�00000004443�11701304107�017777� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTextTag static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE name; rb_scan_args(argc, argv, "01", &name); G_INITIALIZE(self, gtk_text_tag_new(NIL_P(name) ? NULL : RVAL2CSTR(name))); return Qnil; } static VALUE rg_priority(VALUE self) { return INT2NUM(gtk_text_tag_get_priority(GTK_TEXT_TAG(RVAL2GOBJ(self)))); } static VALUE rg_set_priority(VALUE self, VALUE priority) { gtk_text_tag_set_priority(GTK_TEXT_TAG(RVAL2GOBJ(self)), NUM2INT(priority)); return priority; } static VALUE rg_event(VALUE self, VALUE event_object, VALUE event, VALUE iter) { gboolean ret = gtk_text_tag_event(GTK_TEXT_TAG(RVAL2GOBJ(self)), RVAL2GOBJ(event_object), RVAL2GEV(event), (GtkTextIter*)RVAL2BOXED(iter, GTK_TYPE_TEXT_ITER)); return CBOOL2RVAL(ret); } void Init_gtk_texttag(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_TAG, "TextTag", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(priority, 0); RG_DEF_METHOD(set_priority, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "priority"); RG_DEF_METHOD(event, 3); /* GtkWrapMode */ G_DEF_CLASS(GTK_TYPE_WRAP_MODE, "WrapMode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_WRAP_MODE, "GTK_"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktoggleaction.c���������������������������������������������0000644�0001750�0001750�00000003623�12257552167�021017� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cToggleAction #define _SELF(self) (GTK_TOGGLE_ACTION(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self, VALUE name, VALUE label, VALUE tooltip, VALUE stock_id) { const gchar *gstockid = NULL; if (TYPE(stock_id) == T_SYMBOL){ gstockid = rb_id2name(SYM2ID(stock_id)); } else if (TYPE(stock_id) == T_STRING){ gstockid = RVAL2CSTR(stock_id); } G_INITIALIZE(self, gtk_toggle_action_new(RVAL2CSTR(name), RVAL2CSTR(label), NIL_P(tooltip) ? NULL : RVAL2CSTR(tooltip), gstockid)); return Qnil; } static VALUE rg_toggled(VALUE self) { gtk_toggle_action_toggled(_SELF(self)); return self; } void Init_gtk_toggle_action(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOGGLE_ACTION, "ToggleAction", mGtk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(toggled, 0); } �������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkwindowgroup.c����������������������������������������������0000644�0001750�0001750�00000003276�11701304107�020706� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cWindowGroup static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_window_group_new()); return Qnil; } static VALUE rg_add(VALUE self, VALUE window) { gtk_window_group_add_window(GTK_WINDOW_GROUP(RVAL2GOBJ(self)), GTK_WINDOW(RVAL2GOBJ(window))); return self; } static VALUE rg_remove(VALUE self, VALUE window) { gtk_window_group_remove_window(GTK_WINDOW_GROUP(RVAL2GOBJ(self)), GTK_WINDOW(RVAL2GOBJ(window))); return self; } void Init_gtk_windowgroup(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_WINDOW_GROUP, "WindowGroup", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add, 1); RG_DEF_METHOD(remove, 1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkvscale.c���������������������������������������������������0000644�0001750�0001750�00000003475�11701304107�017600� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cVScale static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2, arg3; GtkAdjustment *adj = NULL; GtkWidget *widget; rb_scan_args(argc, argv, "03", &arg1, &arg2, &arg3); if (NIL_P(arg1) || RVAL2GTYPE(arg1) == GTK_TYPE_ADJUSTMENT){ if (!NIL_P(arg1)) adj = GTK_ADJUSTMENT(RVAL2GOBJ(arg1)); widget = gtk_vscale_new(adj); } else { widget = gtk_vscale_new_with_range(NUM2DBL(arg1), NUM2DBL(arg2), NUM2DBL(arg3)); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_vscale(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VSCALE, "VScale", mGtk); RG_DEF_METHOD(initialize, -1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkevent.c����������������������������������������������������0000644�0001750�0001750�00000122706�12257552167�017445� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2002-2013 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" static VALUE rb_cGdkEvent; static VALUE rb_cGdkEventAny; static VALUE rb_cGdkEventExpose; static VALUE rb_cGdkEventNoExpose; static VALUE rb_cGdkEventVisibility; static VALUE rb_cGdkEventMotion; static VALUE rb_cGdkEventButton; static VALUE rb_cGdkEventScroll; static VALUE rb_cGdkEventKey; static VALUE rb_cGdkEventCrossing; static VALUE rb_cGdkEventFocus; static VALUE rb_cGdkEventConfigure; static VALUE rb_cGdkEventProperty; static VALUE rb_cGdkEventSelection; static VALUE rb_cGdkEventOwnerChange; static VALUE rb_cGdkEventProximity; static VALUE rb_cGdkEventClient; static VALUE rb_cGdkEventDND; static VALUE rb_cGdkEventWindowState; static VALUE rb_cGdkEventSetting; static VALUE rb_cGdkEventGrabBroken; #define DEFINE_EVENT_TYPE(type_lower_case, type_upper_case) \ static GType \ rb_gdk_event_ ## type_lower_case ## _get_type(void) \ { \ static GType type = 0; \ if (type == 0) { \ type = g_boxed_type_register_static("GdkEvent" # type_upper_case, \ (GBoxedCopyFunc)gdk_event_copy, \ (GBoxedFreeFunc)gdk_event_free); \ } \ return type; \ } DEFINE_EVENT_TYPE(any, Any) DEFINE_EVENT_TYPE(expose, Expose) DEFINE_EVENT_TYPE(no_expose, NoExpose) DEFINE_EVENT_TYPE(visibility, Visibility) DEFINE_EVENT_TYPE(motion, Motion) DEFINE_EVENT_TYPE(button, Button) DEFINE_EVENT_TYPE(scroll, Scroll) DEFINE_EVENT_TYPE(key, Key) DEFINE_EVENT_TYPE(crossing, Crossing) DEFINE_EVENT_TYPE(focus, Focus) DEFINE_EVENT_TYPE(configure, Configure) DEFINE_EVENT_TYPE(property, Property) DEFINE_EVENT_TYPE(selection, Selection) DEFINE_EVENT_TYPE(owner_change, OwnerChange) DEFINE_EVENT_TYPE(proximity, Proximity) DEFINE_EVENT_TYPE(client, Client) DEFINE_EVENT_TYPE(dnd, DND) DEFINE_EVENT_TYPE(window_state, WindowState) DEFINE_EVENT_TYPE(setting, Setting) DEFINE_EVENT_TYPE(grab_broken, GrabBroken) #define GDK_TYPE_EVENT_ANY (rb_gdk_event_any_get_type()) #define GDK_TYPE_EVENT_EXPOSE (rb_gdk_event_expose_get_type()) #define GDK_TYPE_EVENT_NO_EXPOSE (rb_gdk_event_no_expose_get_type()) #define GDK_TYPE_EVENT_VISIBILITY (rb_gdk_event_visibility_get_type()) #define GDK_TYPE_EVENT_MOTION (rb_gdk_event_motion_get_type()) #define GDK_TYPE_EVENT_BUTTON (rb_gdk_event_button_get_type()) #define GDK_TYPE_EVENT_SCROLL (rb_gdk_event_scroll_get_type()) #define GDK_TYPE_EVENT_KEY (rb_gdk_event_key_get_type()) #define GDK_TYPE_EVENT_CROSSING (rb_gdk_event_crossing_get_type()) #define GDK_TYPE_EVENT_FOCUS (rb_gdk_event_focus_get_type()) #define GDK_TYPE_EVENT_CONFIGURE (rb_gdk_event_configure_get_type()) #define GDK_TYPE_EVENT_PROPERTY (rb_gdk_event_property_get_type()) #define GDK_TYPE_EVENT_SELECTION (rb_gdk_event_selection_get_type()) #define GDK_TYPE_EVENT_OWNER_CHANGE (rb_gdk_event_owner_change_get_type()) #define GDK_TYPE_EVENT_PROXIMITY (rb_gdk_event_proximity_get_type()) #define GDK_TYPE_EVENT_CLIENT (rb_gdk_event_client_get_type()) #define GDK_TYPE_EVENT_DND (rb_gdk_event_dnd_get_type()) #define GDK_TYPE_EVENT_WINDOW_STATE (rb_gdk_event_window_state_get_type()) #define GDK_TYPE_EVENT_SETTING (rb_gdk_event_setting_get_type()) #define GDK_TYPE_EVENT_GRAB_BROKEN (rb_gdk_event_grab_broken_get_type()) /***********************************************/ static GType rb_gdk_event_type_to_gtype(GdkEventType event_type) { GType gtype = GDK_TYPE_EVENT_ANY; switch (event_type) { case GDK_NOTHING: case GDK_DELETE: case GDK_DESTROY: break; case GDK_EXPOSE: gtype = GDK_TYPE_EVENT_EXPOSE; break; case GDK_MOTION_NOTIFY: gtype = GDK_TYPE_EVENT_MOTION; break; case GDK_BUTTON_PRESS: case GDK_2BUTTON_PRESS: case GDK_3BUTTON_PRESS: case GDK_BUTTON_RELEASE: gtype = GDK_TYPE_EVENT_BUTTON; break; case GDK_KEY_PRESS: case GDK_KEY_RELEASE: gtype = GDK_TYPE_EVENT_KEY; break; case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: gtype = GDK_TYPE_EVENT_CROSSING; break; case GDK_FOCUS_CHANGE: gtype = GDK_TYPE_EVENT_FOCUS; break; case GDK_CONFIGURE: gtype = GDK_TYPE_EVENT_CONFIGURE; break; case GDK_MAP: case GDK_UNMAP: break; case GDK_PROPERTY_NOTIFY: gtype = GDK_TYPE_EVENT_PROPERTY; break; case GDK_SELECTION_CLEAR: case GDK_SELECTION_REQUEST: case GDK_SELECTION_NOTIFY: gtype = GDK_TYPE_EVENT_SELECTION; break; case GDK_PROXIMITY_IN: case GDK_PROXIMITY_OUT: gtype = GDK_TYPE_EVENT_PROXIMITY; break; case GDK_DRAG_ENTER: case GDK_DRAG_LEAVE: case GDK_DRAG_MOTION: case GDK_DRAG_STATUS: case GDK_DROP_START: case GDK_DROP_FINISHED: gtype = GDK_TYPE_EVENT_DND; break; case GDK_CLIENT_EVENT: gtype = GDK_TYPE_EVENT_CLIENT; break; case GDK_VISIBILITY_NOTIFY: gtype = GDK_TYPE_EVENT_VISIBILITY; break; case GDK_NO_EXPOSE: gtype = GDK_TYPE_EVENT_NO_EXPOSE; break; case GDK_SCROLL: gtype = GDK_TYPE_EVENT_SCROLL; break; case GDK_WINDOW_STATE: gtype = GDK_TYPE_EVENT_WINDOW_STATE; break; case GDK_SETTING: gtype = GDK_TYPE_EVENT_SETTING; break; case GDK_OWNER_CHANGE: gtype = GDK_TYPE_EVENT_OWNER_CHANGE; break; case GDK_GRAB_BROKEN: gtype = GDK_TYPE_EVENT_GRAB_BROKEN; break; #if GTK_CHECK_VERSION(2, 14, 0) case GDK_DAMAGE: gtype = GDK_TYPE_EVENT_EXPOSE; break; #endif #if GTK_CHECK_VERSION(2, 18, 0) case GDK_EVENT_LAST: break; #endif default: break; } return gtype; } static VALUE rb_gdk_event_type_to_class(GdkEventType event_type) { VALUE klass = Qnil; switch (event_type) { case GDK_NOTHING: case GDK_DELETE: case GDK_DESTROY: break; case GDK_EXPOSE: klass = rb_cGdkEventExpose; break; case GDK_MOTION_NOTIFY: klass = rb_cGdkEventMotion; break; case GDK_BUTTON_PRESS: case GDK_2BUTTON_PRESS: case GDK_3BUTTON_PRESS: case GDK_BUTTON_RELEASE: klass = rb_cGdkEventButton; break; case GDK_KEY_PRESS: case GDK_KEY_RELEASE: klass = rb_cGdkEventKey; break; case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: klass = rb_cGdkEventCrossing; break; case GDK_FOCUS_CHANGE: klass = rb_cGdkEventFocus; break; case GDK_CONFIGURE: klass = rb_cGdkEventConfigure; break; case GDK_MAP: case GDK_UNMAP: break; case GDK_PROPERTY_NOTIFY: klass = rb_cGdkEventProperty; break; case GDK_SELECTION_CLEAR: case GDK_SELECTION_REQUEST: case GDK_SELECTION_NOTIFY: klass = rb_cGdkEventSelection; break; case GDK_PROXIMITY_IN: case GDK_PROXIMITY_OUT: klass = rb_cGdkEventProximity; break; case GDK_DRAG_ENTER: case GDK_DRAG_LEAVE: case GDK_DRAG_MOTION: case GDK_DRAG_STATUS: case GDK_DROP_START: case GDK_DROP_FINISHED: klass = rb_cGdkEventDND; break; case GDK_CLIENT_EVENT: klass = rb_cGdkEventClient; break; case GDK_VISIBILITY_NOTIFY: klass = rb_cGdkEventVisibility; break; case GDK_NO_EXPOSE: klass = rb_cGdkEventNoExpose; break; case GDK_SCROLL: klass = rb_cGdkEventScroll; break; case GDK_WINDOW_STATE: klass = rb_cGdkEventWindowState; break; case GDK_SETTING: klass = rb_cGdkEventSetting; break; case GDK_OWNER_CHANGE: klass = rb_cGdkEventOwnerChange; break; case GDK_GRAB_BROKEN: klass = rb_cGdkEventGrabBroken; break; #if GTK_CHECK_VERSION(2, 14, 0) case GDK_DAMAGE: klass = rb_cGdkEventExpose; break; #endif #if GTK_CHECK_VERSION(2, 18, 0) case GDK_EVENT_LAST: break; #endif default: break; } if (NIL_P(klass)) { klass = rb_cGdkEventAny; } return klass; } static GType rb_gdk_event_to_gtype(VALUE event) { VALUE klass; GType type = GDK_TYPE_EVENT; klass = rb_obj_class(event); if (klass == rb_cGdkEvent) { type = GDK_TYPE_EVENT; } else if (klass == rb_cGdkEventAny) { type = GDK_TYPE_EVENT_ANY; } else if (klass == rb_cGdkEventExpose) { type = GDK_TYPE_EVENT_EXPOSE; } else if (klass == rb_cGdkEventNoExpose) { type = GDK_TYPE_EVENT_NO_EXPOSE; } else if (klass == rb_cGdkEventVisibility) { type = GDK_TYPE_EVENT_VISIBILITY; } else if (klass == rb_cGdkEventMotion) { type = GDK_TYPE_EVENT_MOTION; } else if (klass == rb_cGdkEventButton) { type = GDK_TYPE_EVENT_BUTTON; } else if (klass == rb_cGdkEventScroll) { type = GDK_TYPE_EVENT_SCROLL; } else if (klass == rb_cGdkEventKey) { type = GDK_TYPE_EVENT_KEY; } else if (klass == rb_cGdkEventCrossing) { type = GDK_TYPE_EVENT_CROSSING; } else if (klass == rb_cGdkEventFocus) { type = GDK_TYPE_EVENT_FOCUS; } else if (klass == rb_cGdkEventConfigure) { type = GDK_TYPE_EVENT_CONFIGURE; } else if (klass == rb_cGdkEventProperty) { type = GDK_TYPE_EVENT_PROPERTY; } else if (klass == rb_cGdkEventSelection) { type = GDK_TYPE_EVENT_SELECTION; } else if (klass == rb_cGdkEventOwnerChange) { type = GDK_TYPE_EVENT_OWNER_CHANGE; } else if (klass == rb_cGdkEventProximity) { type = GDK_TYPE_EVENT_PROXIMITY; } else if (klass == rb_cGdkEventClient) { type = GDK_TYPE_EVENT_CLIENT; } else if (klass == rb_cGdkEventDND) { type = GDK_TYPE_EVENT_DND; } else if (klass == rb_cGdkEventWindowState) { type = GDK_TYPE_EVENT_WINDOW_STATE; } else if (klass == rb_cGdkEventSetting) { type = GDK_TYPE_EVENT_SETTING; } else if (klass == rb_cGdkEventGrabBroken) { type = GDK_TYPE_EVENT_GRAB_BROKEN; } else { rb_raise(rb_eArgError, "Not event object: %s", RBG_INSPECT(event)); } return type; } VALUE make_gdkevent(GdkEvent *event) { if (!event) return Qnil; return BOXED2RVAL(event, rb_gdk_event_type_to_gtype(event->any.type)); } GdkEvent* get_gdkevent(VALUE event) { return RVAL2BOXED(event, rb_gdk_event_to_gtype(event)); } /***********************************************/ #define ATTR_STR(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return CSTR2RVAL(get_gdkevent(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ get_gdkevent(self)->type.name = (gchar *)RVAL2CSTR(val);\ return self;\ } #define ATTR_INT(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return INT2NUM(get_gdkevent(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ get_gdkevent(self)->type.name = NUM2INT(val);\ return self;\ } #define ATTR_UINT(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return UINT2NUM(get_gdkevent(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ get_gdkevent(self)->type.name = NUM2UINT(val);\ return self;\ } #define ATTR_GDKNATIVEWINDOW(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return GDKNATIVEWINDOW2RVAL(get_gdkevent(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ get_gdkevent(self)->type.name = RVAL2GDKNATIVEWINDOW(val);\ return self;\ } #define ATTR_FLOAT(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return rb_float_new(get_gdkevent(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ get_gdkevent(self)->type.name = NUM2DBL(val);\ return self;\ } #define ATTR_GOBJ(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return GOBJ2RVAL(get_gdkevent(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ GdkEvent *event;\ event = get_gdkevent(self);\ if (event->type.name)\ g_object_unref(event->type.name);\ event->type.name = RVAL2GOBJ(val);\ if (event->type.name)\ g_object_ref(event->type.name);\ return self;\ } #define ATTR_BOOL(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return CBOOL2RVAL(get_gdkevent(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ get_gdkevent(self)->type.name = RVAL2CBOOL(val);\ return self;\ } #define ATTR_ATOM(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ GdkAtom atom = get_gdkevent(self)->type.name;\ return BOXED2RVAL(atom, GDK_TYPE_ATOM);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ get_gdkevent(self)->type.name = RVAL2ATOM(val);\ return self;\ } #define ATTR_FLAGS(type, name, gtype)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return GFLAGS2RVAL(get_gdkevent(self)->type.name, gtype);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ get_gdkevent(self)->type.name = RVAL2GFLAGS(val, gtype);\ return self;\ } #define ATTR_ENUM(type, name, gtype)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return GENUM2RVAL(get_gdkevent(self)->type.name, gtype);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ get_gdkevent(self)->type.name = RVAL2GENUM(val, gtype);\ return self;\ } #define ATTR_AXES(type, gdkklass) \ static VALUE \ gdkevent ##type ## _axes(VALUE self)\ {\ gdkklass type = get_gdkevent(self)->type;\ return type.axes ? rb_ary_new3(2, \ rb_float_new(type.axes[0]),\ rb_float_new(type.axes[1])) : Qnil;\ } \ static VALUE \ gdkevent ## type ## _set_axes(VALUE self, VALUE x, VALUE y)\ {\ gdkklass val = get_gdkevent(self)->type;\ val.axes[0] = NUM2DBL(x);\ val.axes[1] = NUM2DBL(y);\ return self;\ } #define DEFINE_ACCESSOR(event, type, name) \ rb_define_method(event, G_STRINGIFY(name), gdkevent ## type ## _## name, 0);\ rb_define_method(event, G_STRINGIFY(set_ ## name), gdkevent ## type ## _set_## name, 1); /* initialize */ #define GDKEVENT_INIT(type, default_gtype) \ static VALUE \ gdkevent ## type ## _initialize(int argc, VALUE *argv, VALUE self)\ {\ VALUE type;\ GdkEventType gtype;\ \ rb_scan_args(argc, argv, "01", &type);\ if (NIL_P(type)){\ gtype = default_gtype;\ } else {\ gtype = RVAL2GENUM(type, GDK_TYPE_EVENT_TYPE);\ }\ \ G_INITIALIZE(self, gdk_event_new(gtype));\ return Qnil;\ } #define DEFINE_INIT(event, type) \ rb_define_method(event, "initialize", gdkevent ## type ## _initialize, -1); /***********************************************/ /* GdkEvent Singleton Methods */ static VALUE gdkevent_s_events_pending(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gdk_events_pending()); } static VALUE gdkevent_s_peek(G_GNUC_UNUSED VALUE self) { return make_gdkevent(gdk_event_peek()); } static VALUE gdkevent_s_get(G_GNUC_UNUSED VALUE self) { return make_gdkevent(gdk_event_get()); } static VALUE gdkevent_s_get_graphics_expose(G_GNUC_UNUSED VALUE self, VALUE window) { return make_gdkevent(gdk_event_get_graphics_expose(GDK_WINDOW(RVAL2GOBJ(window)))); } /* GdkEvent */ static VALUE gdkevent_initialize(VALUE self, VALUE type) { GdkEventType event_type; VALUE klass; event_type = RVAL2GENUM(type, GDK_TYPE_EVENT_TYPE); klass = rb_gdk_event_type_to_class(event_type); if (!RVAL2CBOOL(rb_obj_is_kind_of(self, klass))) { rb_raise(rb_eArgError, "Wrong event type for this class: %s: %s", RBG_INSPECT(type), RBG_INSPECT(klass)); } G_INITIALIZE(self, gdk_event_new(event_type)); return Qnil; } static VALUE gdkevent_type(VALUE self) { return GENUM2RVAL(get_gdkevent(self)->type, GDK_TYPE_EVENT_TYPE); } static VALUE gdkevent_put(VALUE self) { gdk_event_put(get_gdkevent(self)); return self; } /* We don't need this. gdk_event_get_time(); gboolean gdk_event_get_state (GdkEvent *event, GdkModifierType *state); */ static VALUE gdkevent_get_axis(VALUE self, VALUE axis_use) { gdouble value; gboolean ret = gdk_event_get_axis(get_gdkevent(self), RVAL2GENUM(axis_use, GDK_TYPE_AXIS_USE), &value); return ret ? rb_float_new(value) : Qnil; } static VALUE gdkevent_get_coords(VALUE self) { gdouble x_win, y_win; gboolean ret = gdk_event_get_coords(get_gdkevent(self), &x_win, &y_win); return ret ? rb_ary_new3(2, rb_float_new(x_win), rb_float_new(y_win)) : Qnil; } static VALUE gdkevent_get_root_coords(VALUE self) { gdouble x_root, y_root; gboolean ret = gdk_event_get_root_coords(get_gdkevent(self), &x_root, &y_root); return ret ? rb_ary_new3(2, rb_float_new(x_root), rb_float_new(y_root)) : Qnil; } static void handler_func(GdkEvent *event, gpointer func) { rb_funcall((VALUE)func, id_call, 1, make_gdkevent(event)); } static VALUE gdkevent_s_handler_set(VALUE self) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); gdk_event_handler_set((GdkEventFunc)handler_func, (gpointer)func, NULL); return self; } static VALUE gdkevent_s_get_show_events(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gdk_get_show_events()); } static VALUE gdkevent_s_set_show_events(VALUE self, VALUE show_events) { gdk_set_show_events(RVAL2CBOOL(show_events)); return self; } static VALUE gdkevent_set_screen(VALUE self, VALUE screen) { gdk_event_set_screen(get_gdkevent(self), GDK_SCREEN(RVAL2GOBJ(screen))); return self; } static VALUE gdkevent_screen(VALUE self) { return GOBJ2RVAL(gdk_event_get_screen(get_gdkevent(self))); } /* type: String, Integer, Gdk::Color. */ static VALUE gdkevent_s_setting_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE name, type; GType gtype; GValue val = G_VALUE_INIT; gboolean ret; VALUE value; rb_scan_args(argc, argv, "11", &name, &type); if (NIL_P(type)) gtype = G_TYPE_STRING; else gtype = CLASS2GTYPE(type); g_value_init(&val, gtype); ret = gdk_setting_get(RVAL2CSTR(name), &val); value = ret ? GVAL2RVAL(&val) : Qnil; g_value_unset(&val); return value; } /* GdkEventAny */ ATTR_GOBJ(any, window); ATTR_BOOL(any, send_event); /* GdkEventKey */ ATTR_UINT(key, time); ATTR_FLAGS(key, state, GDK_TYPE_MODIFIER_TYPE); ATTR_INT(key, keyval); ATTR_UINT(key, hardware_keycode); ATTR_UINT(key, group); /* GdkEventButton */ ATTR_UINT(button, time); ATTR_FLOAT(button, x); ATTR_FLOAT(button, y); ATTR_AXES(button, GdkEventButton); ATTR_INT(button, button); ATTR_FLAGS(button, state, GDK_TYPE_MODIFIER_TYPE); ATTR_GOBJ(button, device); ATTR_FLOAT(button, x_root); ATTR_FLOAT(button, y_root); /* GdkEventScroll */ ATTR_UINT(scroll, time); ATTR_FLOAT(scroll, x); ATTR_FLOAT(scroll, y); ATTR_FLAGS(scroll, state, GDK_TYPE_MODIFIER_TYPE); ATTR_ENUM(scroll, direction, GDK_TYPE_SCROLL_DIRECTION); ATTR_GOBJ(scroll, device); ATTR_FLOAT(scroll, x_root); ATTR_FLOAT(scroll, y_root); GDKEVENT_INIT(scroll, GDK_SCROLL); /* GdkEventMotion */ ATTR_UINT(motion, time); ATTR_FLOAT(motion, x); ATTR_FLOAT(motion, y); ATTR_AXES(motion, GdkEventMotion); ATTR_FLOAT(motion, x_root); ATTR_FLOAT(motion, y_root); ATTR_FLAGS(motion, state, GDK_TYPE_MODIFIER_TYPE); ATTR_BOOL(motion, is_hint); ATTR_GOBJ(motion, device); GDKEVENT_INIT(motion, GDK_MOTION_NOTIFY); #if GTK_CHECK_VERSION(2, 12, 0) static VALUE gdkeventmotion_request_motions(VALUE self) { gdk_event_request_motions(&(get_gdkevent(self)->motion)); return self; } #endif /* GdkEventExpose */ static VALUE gdkeventexpose_area(VALUE self) { return BOXED2RVAL(&get_gdkevent(self)->expose.area, GDK_TYPE_RECTANGLE); } static VALUE gdkeventexpose_set_area(VALUE self, VALUE rect) { GdkRectangle* grect = (GdkRectangle*)RVAL2BOXED(rect, GDK_TYPE_RECTANGLE); GdkEventExpose *event = &(get_gdkevent(self)->expose); event->area.x = grect->x; event->area.y = grect->y; event->area.width = grect->width; event->area.height = grect->height; return self; } static VALUE gdkeventexpose_region(VALUE self) { return BOXED2RVAL(get_gdkevent(self)->expose.region, GDK_TYPE_REGION); } static VALUE gdkeventexpose_set_region(VALUE self, VALUE region) { get_gdkevent(self)->expose.region = RVAL2BOXED(region, GDK_TYPE_REGION); return self; } ATTR_INT(expose, count); GDKEVENT_INIT(expose, GDK_EXPOSE); /* GdkEventVisibility */ ATTR_ENUM(visibility, state, GDK_TYPE_VISIBILITY_STATE); GDKEVENT_INIT(visibility, GDK_VISIBILITY_NOTIFY); /* GdkEventCrossing */ ATTR_GOBJ(crossing, subwindow); ATTR_UINT(crossing, time); ATTR_INT(crossing, x); ATTR_INT(crossing, y); ATTR_FLOAT(crossing, x_root); ATTR_FLOAT(crossing, y_root); ATTR_ENUM(crossing, mode, GDK_TYPE_CROSSING_MODE); ATTR_ENUM(crossing, detail, GDK_TYPE_NOTIFY_TYPE); ATTR_BOOL(crossing, focus); ATTR_FLAGS(crossing, state, GDK_TYPE_MODIFIER_TYPE); /* GdkEventFocus */ ATTR_BOOL(focus_change, in); GDKEVENT_INIT(focus_change, GDK_FOCUS_CHANGE); /* GdkEventConfigure */ ATTR_INT(configure, x); ATTR_INT(configure, y); ATTR_INT(configure, width); ATTR_INT(configure, height); GDKEVENT_INIT(configure, GDK_CONFIGURE); /* GdkEventProperty */ ATTR_ATOM(property, atom); ATTR_UINT(property, time); ATTR_ENUM(property, state, GDK_TYPE_PROPERTY_STATE); GDKEVENT_INIT(property, GDK_PROPERTY_NOTIFY); /* GdkEventSelection */ ATTR_ATOM(selection, selection); ATTR_ATOM(selection, target); ATTR_ATOM(selection, property); ATTR_GDKNATIVEWINDOW(selection, requestor); ATTR_INT(selection, time); /* GdkEventDND */ ATTR_GOBJ(dnd, context); ATTR_UINT(dnd, time); ATTR_INT(dnd, x_root); ATTR_INT(dnd, y_root); /* GdkEventProximity */ ATTR_UINT(proximity, time); ATTR_GOBJ(proximity, device); /* GdkEventClient */ ATTR_ATOM(client, message_type); GDKEVENT_INIT(client, GDK_CLIENT_EVENT); static VALUE gdkeventclient_data_format(VALUE self) { return INT2NUM(get_gdkevent(self)->client.data_format); } static VALUE gdkeventclient_data(VALUE self) { int i; VALUE ary = Qnil; gushort format = get_gdkevent(self)->client.data_format; if (format == 8) { ary = rb_ary_new2(20); for (i = 0; i < 20; i++) rb_ary_push(ary, INT2FIX(get_gdkevent(self)->client.data.b[i])); } else if (format == 16) { ary = rb_ary_new2(10); for (i = 0; i<10; i++) rb_ary_push(ary, INT2FIX(get_gdkevent(self)->client.data.s[i])); } else if (format == 32){ ary = rb_ary_new2(5); for (i = 0; i < 5; i++) rb_ary_push(ary, INT2NUM(get_gdkevent(self)->client.data.l[i])); } else { rb_warn("The format is not supported."); } return ary; } static VALUE gdkeventclient_send_client_message(int argc, VALUE *argv, VALUE self) { VALUE xid, display; rb_scan_args(argc, argv, "11", &xid, &display); if (NIL_P(display)){ return CBOOL2RVAL(gdk_event_send_client_message( get_gdkevent(self), RVAL2GDKNATIVEWINDOW(xid))); } else { return CBOOL2RVAL(gdk_event_send_client_message_for_display( GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), get_gdkevent(self), RVAL2GDKNATIVEWINDOW(xid))); } } static VALUE gdkeventclient_send_clientmessage_toall(VALUE self) { gdk_event_send_clientmessage_toall(get_gdkevent(self)); return self; } static GdkFilterReturn filter_func(GdkXEvent *xevent, GdkEvent *event, gpointer func) { VALUE ret = rb_funcall((VALUE)func, id_call, 2, LONG2NUM((glong)xevent), make_gdkevent(event)); return RVAL2GENUM(ret, GDK_TYPE_FILTER_RETURN); } static VALUE gdkevent_s_add_client_message_filter(VALUE self, VALUE message_type) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); gdk_add_client_message_filter(RVAL2ATOM(message_type), (GdkFilterFunc)filter_func, (gpointer)func); return self; } /* GdkEventNoExpose */ GDKEVENT_INIT(noexpose, GDK_NO_EXPOSE); /* GdkEventWindowState */ ATTR_FLAGS(window_state, changed_mask, GDK_TYPE_WINDOW_STATE); ATTR_FLAGS(window_state, new_window_state, GDK_TYPE_WINDOW_STATE); GDKEVENT_INIT(window_state, GDK_WINDOW_STATE); /* GdkEventSetting */ ATTR_ENUM(setting, action, GDK_TYPE_SETTING_ACTION); ATTR_STR(setting, name); GDKEVENT_INIT(setting, GDK_SETTING); /* GdkEventOwnerChange */ ATTR_GDKNATIVEWINDOW(owner_change, owner); ATTR_ENUM(owner_change, reason, GDK_TYPE_OWNER_CHANGE); ATTR_ATOM(owner_change, selection); ATTR_UINT(owner_change, time); ATTR_UINT(owner_change, selection_time); GDKEVENT_INIT(owner_change, GDK_OWNER_CHANGE); /* GdkEventGrabBroken */ ATTR_BOOL(grab_broken, keyboard); ATTR_BOOL(grab_broken, implicit); ATTR_GOBJ(grab_broken, grab_window); GDKEVENT_INIT(grab_broken, GDK_GRAB_BROKEN); /* MISC */ static VALUE gdkevent_g2r(const GValue *values) { return make_gdkevent(g_value_get_boxed(&values[0])); } void Init_gtk_gdk_event(VALUE mGdk) { /* GdkEvent */ rb_cGdkEvent = G_DEF_CLASS(GDK_TYPE_EVENT, "Event", mGdk); rb_define_method(rb_cGdkEvent, "initialize", gdkevent_initialize, 1); rb_define_method(rb_cGdkEvent, "event_type", gdkevent_type, 0); rb_define_singleton_method(rb_cGdkEvent, "events_pending?", gdkevent_s_events_pending, 0); rb_define_singleton_method(rb_cGdkEvent, "peek", gdkevent_s_peek, 0); rb_define_singleton_method(rb_cGdkEvent, "get", gdkevent_s_get, 0); rb_define_method(rb_cGdkEvent, "put", gdkevent_put, 0); rb_define_method(rb_cGdkEvent, "get_axis", gdkevent_get_axis, 1); rb_define_method(rb_cGdkEvent, "coords", gdkevent_get_coords, 0); rb_define_method(rb_cGdkEvent, "root_coords", gdkevent_get_root_coords, 0); rb_define_singleton_method(rb_cGdkEvent, "handler_set", gdkevent_s_handler_set, 0); rb_define_singleton_method(rb_cGdkEvent, "show_events?", gdkevent_s_get_show_events, 0); rb_define_singleton_method(rb_cGdkEvent, "set_show_events", gdkevent_s_set_show_events, 1); rb_define_singleton_method(rb_cGdkEvent, "setting_get", gdkevent_s_setting_get, -1); rb_define_singleton_method(rb_cGdkEvent, "add_client_message_filter", gdkevent_s_add_client_message_filter, 1); rb_define_method(rb_cGdkEvent, "screen", gdkevent_screen, 0); rb_define_method(rb_cGdkEvent, "set_screen", gdkevent_set_screen, 1); G_DEF_SETTERS(rb_cGdkEvent); /* * GdkEvent's Constants */ rb_define_const(rb_cGdkEvent, "CURRENT_TIME", INT2FIX(GDK_CURRENT_TIME)); rb_define_const(rb_cGdkEvent, "PRIORITY_EVENTS", INT2FIX(GDK_PRIORITY_EVENTS)); rb_define_const(rb_cGdkEvent, "PRIORITY_REDRAW", INT2FIX(GDK_PRIORITY_REDRAW)); /* GdkEventType */ /* XXX */ G_RENAME_CONSTANT("2BUTTON_PRESS","BUTTON2_PRESS"); G_RENAME_CONSTANT("3BUTTON_PRESS","BUTTON3_PRESS"); G_DEF_CLASS(GDK_TYPE_EVENT_TYPE, "Type", rb_cGdkEvent); G_RENAME_CONSTANT("2BUTTON_PRESS","BUTTON2_PRESS"); G_RENAME_CONSTANT("3BUTTON_PRESS","BUTTON3_PRESS"); G_DEF_CONSTANTS(rb_cGdkEvent, GDK_TYPE_EVENT_TYPE, "GDK_"); /* GdkEventMask */ G_DEF_CLASS(GDK_TYPE_EVENT_MASK, "Mask", rb_cGdkEvent); G_DEF_CONSTANTS(rb_cGdkEvent, GDK_TYPE_EVENT_MASK, "GDK_"); /* GdkEventAny */ rb_cGdkEventAny = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_ANY, "EventAny", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventAny, any, window); rb_define_method(rb_cGdkEventAny, "send_event?", gdkeventany_send_event, 0); rb_define_method(rb_cGdkEventAny, "set_send_event", gdkeventany_set_send_event, 1); G_DEF_SETTERS(rb_cGdkEventAny); /* GdkEventExpose */ rb_cGdkEventExpose = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_EXPOSE, "EventExpose", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventExpose, expose, area); DEFINE_ACCESSOR(rb_cGdkEventExpose, expose, region); DEFINE_ACCESSOR(rb_cGdkEventExpose, expose, count); DEFINE_INIT(rb_cGdkEventExpose, expose); rb_define_singleton_method(rb_cGdkEventExpose, "get_graphics_expose", gdkevent_s_get_graphics_expose, 1); G_DEF_SETTERS(rb_cGdkEventExpose); /* GdkEventNoExpose */ rb_cGdkEventNoExpose = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_NO_EXPOSE, "EventNoExpose", mGdk, rb_cGdkEvent); DEFINE_INIT(rb_cGdkEventNoExpose, noexpose); /* GdkEventVisibility */ rb_cGdkEventVisibility = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_VISIBILITY, "EventVisibility", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventVisibility, visibility, state); DEFINE_INIT(rb_cGdkEventVisibility, visibility); G_DEF_SETTERS(rb_cGdkEventVisibility); /* GdkVisibilityState */ G_DEF_CLASS(GDK_TYPE_VISIBILITY_STATE, "State", rb_cGdkEventVisibility); G_DEF_CONSTANTS(rb_cGdkEventVisibility, GDK_TYPE_VISIBILITY_STATE, "GDK_VISIBILITY_"); /* GdkEventMotion */ rb_cGdkEventMotion = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_MOTION, "EventMotion", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, time); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, x); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, y); rb_define_method(rb_cGdkEventMotion, "axes", gdkeventmotion_axes, 0); rb_define_method(rb_cGdkEventMotion, "set_axes", gdkeventmotion_set_axes, 1); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, state); rb_define_method(rb_cGdkEventMotion, "hint?", gdkeventmotion_is_hint, 0); rb_define_method(rb_cGdkEventMotion, "set_hint", gdkeventmotion_set_is_hint, 1); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, device); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, x_root); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, y_root); DEFINE_INIT(rb_cGdkEventMotion, motion); #if GTK_CHECK_VERSION(2, 12, 0) rb_define_method(rb_cGdkEventMotion, "request", gdkeventmotion_request_motions, 0); #endif G_DEF_SETTERS(rb_cGdkEventMotion); /* GdkEventButton */ rb_cGdkEventButton = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_BUTTON, "EventButton", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventButton, button, time); DEFINE_ACCESSOR(rb_cGdkEventButton, button, x); DEFINE_ACCESSOR(rb_cGdkEventButton, button, y); rb_define_method(rb_cGdkEventButton, "axes", gdkeventbutton_axes, 0); rb_define_method(rb_cGdkEventButton, "set_axes", gdkeventbutton_set_axes, 2); DEFINE_ACCESSOR(rb_cGdkEventButton, button, state); DEFINE_ACCESSOR(rb_cGdkEventButton, button, button); DEFINE_ACCESSOR(rb_cGdkEventButton, button, device); DEFINE_ACCESSOR(rb_cGdkEventButton, button, x_root); DEFINE_ACCESSOR(rb_cGdkEventButton, button, y_root); G_DEF_SETTERS(rb_cGdkEventButton); /* GdkEventScroll */ rb_cGdkEventScroll = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_SCROLL, "EventScroll", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, time); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, x); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, y); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, state); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, direction); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, device); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, x_root); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, y_root); DEFINE_INIT(rb_cGdkEventScroll, scroll); G_DEF_SETTERS(rb_cGdkEventScroll); /* GdkScrollDirection */ G_DEF_CLASS(GDK_TYPE_SCROLL_DIRECTION, "Direction", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventScroll, GDK_TYPE_SCROLL_DIRECTION, "GDK_SCROLL_"); /* GdkEventKey */ rb_cGdkEventKey = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_KEY, "EventKey", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventKey, key, time); DEFINE_ACCESSOR(rb_cGdkEventKey, key, state); DEFINE_ACCESSOR(rb_cGdkEventKey, key, keyval); DEFINE_ACCESSOR(rb_cGdkEventKey, key, hardware_keycode); DEFINE_ACCESSOR(rb_cGdkEventKey, key, group); G_DEF_SETTERS(rb_cGdkEventKey); /* GdkEventCrossing */ rb_cGdkEventCrossing = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_CROSSING, "EventCrossing", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, subwindow); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, time); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, x); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, y); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, x_root); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, y_root); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, mode); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, detail); rb_define_method(rb_cGdkEventCrossing, "focus?", gdkeventcrossing_focus, 0); rb_define_method(rb_cGdkEventCrossing, "set_focus", gdkeventcrossing_set_focus, 1); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, state); G_DEF_SETTERS(rb_cGdkEventCrossing); /* GdkCrossingMode */ G_DEF_CLASS(GDK_TYPE_CROSSING_MODE, "Mode", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventCrossing, GDK_TYPE_CROSSING_MODE, "GDK_CROSSING_"); /* GdkNotifyType */ G_DEF_CLASS(GDK_TYPE_NOTIFY_TYPE, "NotifyType", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventScroll, GDK_TYPE_NOTIFY_TYPE, "GDK_"); /* GdkEventFocus */ rb_cGdkEventFocus = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_FOCUS, "EventFocus", mGdk, rb_cGdkEvent); rb_define_method(rb_cGdkEventFocus, "in?", gdkeventfocus_change_in, 0); rb_define_method(rb_cGdkEventFocus, "set_in", gdkeventfocus_change_set_in, 1); DEFINE_INIT(rb_cGdkEventFocus, focus_change); G_DEF_SETTERS(rb_cGdkEventFocus); /* GdkEventConfigure */ rb_cGdkEventConfigure = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_CONFIGURE, "EventConfigure", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventConfigure, configure, x); DEFINE_ACCESSOR(rb_cGdkEventConfigure, configure, y); DEFINE_ACCESSOR(rb_cGdkEventConfigure, configure, width); DEFINE_ACCESSOR(rb_cGdkEventConfigure, configure, height); DEFINE_INIT(rb_cGdkEventConfigure, configure); G_DEF_SETTERS(rb_cGdkEventConfigure); /* GdkEventProperty */ rb_cGdkEventProperty = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_PROPERTY, "EventProperty", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventProperty, property, atom); DEFINE_ACCESSOR(rb_cGdkEventProperty, property, time); DEFINE_ACCESSOR(rb_cGdkEventProperty, property, state); DEFINE_INIT(rb_cGdkEventProperty, property); G_DEF_SETTERS(rb_cGdkEventProperty); /* GdkPropertyState */ G_DEF_CLASS(GDK_TYPE_PROPERTY_STATE, "State", rb_cGdkEventProperty); G_DEF_CONSTANTS(rb_cGdkEventProperty, GDK_TYPE_PROPERTY_STATE, "GDK_"); /* GdkEventSelection */ rb_cGdkEventSelection = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_SELECTION, "EventSelection", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventSelection, selection, selection); DEFINE_ACCESSOR(rb_cGdkEventSelection, selection, target); DEFINE_ACCESSOR(rb_cGdkEventSelection, selection, property); DEFINE_ACCESSOR(rb_cGdkEventSelection, selection, requestor); DEFINE_ACCESSOR(rb_cGdkEventSelection, selection, time); G_DEF_SETTERS(rb_cGdkEventSelection); /* GdkEventOwnerChange */ rb_cGdkEventOwnerChange = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_OWNER_CHANGE, "EventOwnerChange", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventOwnerChange, owner_change, owner); DEFINE_ACCESSOR(rb_cGdkEventOwnerChange, owner_change, reason); DEFINE_ACCESSOR(rb_cGdkEventOwnerChange, owner_change, selection); DEFINE_ACCESSOR(rb_cGdkEventOwnerChange, owner_change, time); DEFINE_ACCESSOR(rb_cGdkEventOwnerChange, owner_change, selection_time); G_DEF_SETTERS(rb_cGdkEventOwnerChange); DEFINE_INIT(rb_cGdkEventOwnerChange, owner_change); /* GdkOwnerChange */ G_DEF_CLASS(GDK_TYPE_OWNER_CHANGE, "OwnerChange", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventScroll, GDK_TYPE_OWNER_CHANGE, "GDK_OWNER_CHANGE_"); /* GdkEventProximity */ rb_cGdkEventProximity = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_PROXIMITY, "EventProximity", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventProximity, proximity, time); DEFINE_ACCESSOR(rb_cGdkEventProximity, proximity, device); G_DEF_SETTERS(rb_cGdkEventProximity); /* GdkEventClient */ rb_cGdkEventClient = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_CLIENT, "EventClient", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventClient, client, message_type); rb_define_method(rb_cGdkEventClient, "data_format", gdkeventclient_data_format, 0); rb_define_method(rb_cGdkEventClient, "data", gdkeventclient_data, 0); rb_define_method(rb_cGdkEventClient, "send_client_message", gdkeventclient_send_client_message, -1); rb_define_method(rb_cGdkEventClient, "send_clientmessage_toall", gdkeventclient_send_clientmessage_toall, 0); DEFINE_INIT(rb_cGdkEventClient, client); G_DEF_SETTERS(rb_cGdkEventClient); /* GdkEventDND */ rb_cGdkEventDND = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_DND, "EventDND", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventDND, dnd, context); DEFINE_ACCESSOR(rb_cGdkEventDND, dnd, time); DEFINE_ACCESSOR(rb_cGdkEventDND, dnd, x_root); DEFINE_ACCESSOR(rb_cGdkEventDND, dnd, y_root); G_DEF_SETTERS(rb_cGdkEventDND); /* GdkEventWindowState */ rb_cGdkEventWindowState = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_WINDOW_STATE, "EventWindowState", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventWindowState, window_state, changed_mask); DEFINE_ACCESSOR(rb_cGdkEventWindowState, window_state, new_window_state); DEFINE_INIT(rb_cGdkEventWindowState, window_state); G_DEF_SETTERS(rb_cGdkEventWindowState); /* GdkWindowState */ G_DEF_CLASS(GDK_TYPE_WINDOW_STATE, "WindowState", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventWindowState, GDK_TYPE_WINDOW_STATE, "GDK_WINDOW_STATE_"); /* GdkEventSetting */ rb_cGdkEventSetting = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_SETTING, "EventSetting", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventSetting, setting, action); DEFINE_ACCESSOR(rb_cGdkEventSetting, setting, name); DEFINE_INIT(rb_cGdkEventSetting, setting); G_DEF_SETTERS(rb_cGdkEventSetting); /* GdkSettingAction */ G_DEF_CLASS(GDK_TYPE_SETTING_ACTION, "Action", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventSetting, GDK_TYPE_SETTING_ACTION, "GDK_SETTING_"); /* GdkEventGrabBroken */ rb_cGdkEventGrabBroken = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_GRAB_BROKEN, "EventGrabBroken", mGdk, rb_cGdkEvent); rb_define_method(rb_cGdkEventGrabBroken, "keyboard?", gdkeventgrab_broken_keyboard, 0); rb_define_method(rb_cGdkEventGrabBroken, "set_keyboard", gdkeventgrab_broken_set_keyboard, 1); rb_define_method(rb_cGdkEventGrabBroken, "implicit?", gdkeventgrab_broken_implicit, 0); rb_define_method(rb_cGdkEventGrabBroken, "set_implicit", gdkeventgrab_broken_set_implicit, 1); DEFINE_ACCESSOR(rb_cGdkEventGrabBroken, grab_broken, grab_window); DEFINE_INIT(rb_cGdkEventGrabBroken, grab_broken); G_DEF_SETTERS(rb_cGdkEventGrabBroken); rbgobj_register_g2r_func(GDK_TYPE_EVENT, &gdkevent_g2r); } ����������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtklabel.c����������������������������������������������������0000644�0001750�0001750�00000007635�11701304107�017404� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cLabel #define _SELF(s) (GTK_LABEL(RVAL2GOBJ(s))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, with_mnemonic; GtkWidget* widget = NULL; rb_scan_args(argc, argv, "02", &label, &with_mnemonic); if (NIL_P(with_mnemonic) || ! RVAL2CBOOL(with_mnemonic)){ widget = gtk_label_new(NIL_P(label)?NULL:RVAL2CSTR(label)); } else { widget = gtk_label_new_with_mnemonic(NIL_P(label)?NULL:RVAL2CSTR(label)); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_operator_label_set_text_only(VALUE self, VALUE text) { gtk_label_set_text(_SELF(self), RVAL2CSTR(text)); return text; } static VALUE rg_set_text(int argc, VALUE *argv, VALUE self) { VALUE label, with_mnemonic; rb_scan_args(argc, argv, "02", &label, &with_mnemonic); if (NIL_P(with_mnemonic) || ! RVAL2CBOOL(with_mnemonic)){ gtk_label_set_text(_SELF(self), RVAL2CSTR(label)); } else { gtk_label_set_text_with_mnemonic(_SELF(self), RVAL2CSTR(label)); } return self; } static VALUE rg_operator_label_set_markup_only(VALUE self, VALUE text) { gtk_label_set_markup(_SELF(self), RVAL2CSTR(text)); return text; } static VALUE rg_set_markup(int argc, VALUE *argv, VALUE self) { VALUE str, with_mnemonic; rb_scan_args(argc, argv, "02", &str, &with_mnemonic); if (NIL_P(with_mnemonic) || ! RVAL2CBOOL(with_mnemonic)){ gtk_label_set_markup(_SELF(self), RVAL2CSTR(str)); } else { gtk_label_set_markup_with_mnemonic(_SELF(self), RVAL2CSTR(str)); } return self; } static VALUE rg_layout_offsets(VALUE self) { gint x, y; gtk_label_get_layout_offsets(_SELF(self), &x, &y); return rb_ary_new3(2, INT2NUM(x), INT2NUM(y)); } static VALUE rg_text(VALUE self) { return CSTR2RVAL(gtk_label_get_text(_SELF(self))); } static VALUE rg_select_region(VALUE self, VALUE start_offset, VALUE end_offset) { gtk_label_select_region(_SELF(self), NUM2INT(start_offset), NUM2INT(end_offset)); return self; } static VALUE rg_layout(VALUE self) { return GOBJ2RVAL(gtk_label_get_layout(_SELF(self))); } static VALUE rg_selection_bounds(VALUE self) { gint start, end; gboolean ret = gtk_label_get_selection_bounds(_SELF(self), &start, &end); return ret ? rb_ary_new3(2, INT2NUM(start), INT2NUM(end)) : Qnil; } void Init_gtk_label(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_LABEL, "Label", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(text, 0); RG_DEF_METHOD(set_text, -1); RG_DEF_METHOD_OPERATOR("text=", label_set_text_only, 1); RG_DEF_METHOD(set_markup, -1); RG_DEF_METHOD_OPERATOR("markup=", label_set_markup_only, 1); RG_DEF_METHOD(layout_offsets, 0); RG_DEF_METHOD(select_region, 2); RG_DEF_METHOD(layout, 0); RG_DEF_METHOD(selection_bounds, 0); } ���������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkiconfactory.c����������������������������������������������0000644�0001750�0001750�00000004432�11701304107�020635� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cIconFactory #define _SELF(s) (GTK_ICON_FACTORY(RVAL2GOBJ(s))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_icon_factory_new()); return Qnil; } static VALUE rg_add(VALUE self, VALUE id, VALUE icon_set) { gtk_icon_factory_add(_SELF(self), RVAL2CSTR(id), (GtkIconSet*)RVAL2BOXED(icon_set, GTK_TYPE_ICON_SET)); return self; } static VALUE rg_add_default(VALUE self) { gtk_icon_factory_add_default(_SELF(self)); return self; } static VALUE rg_lookup(VALUE self, VALUE id) { GtkIconSet *icon_set; icon_set = gtk_icon_factory_lookup(_SELF(self), RVAL2CSTR(id)); return BOXED2RVAL(icon_set, GTK_TYPE_ICON_SET); } static VALUE rg_s_lookup_default(G_GNUC_UNUSED VALUE self, VALUE id) { GtkIconSet *icon_set; icon_set = gtk_icon_factory_lookup_default(RVAL2CSTR(id)); return BOXED2RVAL(icon_set, GTK_TYPE_ICON_SET); } static VALUE rg_remove_default(VALUE self) { gtk_icon_factory_remove_default(_SELF(self)); return self; } void Init_gtk_icon_factory(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_FACTORY, "IconFactory", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add, 2); RG_DEF_METHOD(add_default, 0); RG_DEF_METHOD(remove_default, 0); RG_DEF_METHOD(lookup, 1); RG_DEF_SMETHOD(lookup_default, 1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkicontheme.c������������������������������������������������0000644�0001750�0001750�00000016512�12257552167�020314� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cIconTheme #define _SELF(i) GTK_ICON_THEME(RVAL2GOBJ(i)) #define RVAL2ICON_LOOKUP_FLAGS(flags) (RVAL2GFLAGS(flags, GTK_TYPE_ICON_LOOKUP_FLAGS)) #define ICON_INFO2RVAL(info) (BOXED2RVAL(info, GTK_TYPE_ICON_INFO)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_icon_theme_new()); return Qnil; } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_icon_theme_get_default()); } static VALUE rg_s_get_for_screen(G_GNUC_UNUSED VALUE self, VALUE screen) { return GOBJ2RVAL(gtk_icon_theme_get_for_screen(GDK_SCREEN(RVAL2GOBJ(screen)))); } static VALUE rg_set_screen(VALUE self, VALUE screen) { gtk_icon_theme_set_screen(_SELF(self), GDK_SCREEN(RVAL2GOBJ(screen))); return self; } static VALUE rg_set_search_path(VALUE self, VALUE rbpath) { GtkIconTheme *theme = _SELF(self); long n; const gchar **path = RVAL2STRS(rbpath, n); gtk_icon_theme_set_search_path(theme, path, n); g_free(path); return self; } static VALUE rg_search_path(VALUE self) { gchar **path; gtk_icon_theme_get_search_path(_SELF(self), &path, NULL); return STRV2RVAL_FREE(path); } static VALUE rg_append_search_path(VALUE self, VALUE path) { gtk_icon_theme_append_search_path(_SELF(self), RVAL2CSTR(path)); return self; } static VALUE rg_prepend_search_path(VALUE self, VALUE path) { gtk_icon_theme_prepend_search_path(_SELF(self), RVAL2CSTR(path)); return self; } static VALUE rg_set_custom_theme(VALUE self, VALUE theme_name) { gtk_icon_theme_set_custom_theme(_SELF(self), NIL_P(theme_name) ? NULL : RVAL2CSTR(theme_name)); return self; } static VALUE rg_has_icon_p(VALUE self, VALUE icon_name) { return CBOOL2RVAL(gtk_icon_theme_has_icon(_SELF(self), RVAL2CSTR(icon_name))); } static VALUE rg_lookup_icon(VALUE self, VALUE icon_name, VALUE size, VALUE flags) { GtkIconInfo* info; info = gtk_icon_theme_lookup_icon(_SELF(self), RVAL2CSTR(icon_name), NUM2INT(size), RVAL2ICON_LOOKUP_FLAGS(flags)); return ICON_INFO2RVAL(info); } static VALUE rg_load_icon(VALUE self, VALUE icon_name, VALUE size, VALUE flags) { GError *error = NULL; GdkPixbuf *pixbuf; pixbuf = gtk_icon_theme_load_icon(_SELF(self), RVAL2CSTR(icon_name), NUM2INT(size), RVAL2ICON_LOOKUP_FLAGS(flags), &error); if (!pixbuf) RAISE_GERROR(error); return GOBJ2RVAL(pixbuf); } static VALUE rg_icons(int argc, VALUE *argv, VALUE self) { VALUE context; GList *icons; rb_scan_args(argc, argv, "01", &context); icons = gtk_icon_theme_list_icons(_SELF(self), RVAL2CSTR_ACCEPT_NIL(context)); return GLIST2ARY_STR_FREE(icons); } static VALUE rg_get_icon_sizes(VALUE self, VALUE icon_name) { VALUE ary = rb_ary_new(); gint* sizes = gtk_icon_theme_get_icon_sizes(_SELF(self), RVAL2CSTR(icon_name)); gint* tmp_sizes = sizes; while (*tmp_sizes) { rb_ary_push(ary, INT2NUM(*tmp_sizes)); tmp_sizes++; } g_free(sizes); return ary; } static VALUE rg_example_icon_name(VALUE self) { return CSTR2RVAL_FREE(gtk_icon_theme_get_example_icon_name(_SELF(self))); } static VALUE rg_rescan_if_needed(VALUE self) { return CBOOL2RVAL(gtk_icon_theme_rescan_if_needed(_SELF(self))); } static VALUE rg_s_add_builtin_icon(VALUE self, VALUE icon_name, VALUE size, VALUE pixbuf) { gtk_icon_theme_add_builtin_icon(RVAL2CSTR(icon_name), NUM2INT(size), GDK_PIXBUF(RVAL2GOBJ(pixbuf))); return self; } #if GTK_CHECK_VERSION(2, 12, 0) static VALUE rg_choose_icon(int argc, VALUE *argv, VALUE self) { VALUE rb_icon_names, rb_size, rb_flags; gint size; const gchar **icon_names; GtkIconLookupFlags flags; GtkIconInfo *info; rb_scan_args(argc, argv, "21", &rb_icon_names, &rb_size, &rb_flags); if (RVAL2CBOOL(rb_obj_is_kind_of(rb_icon_names, rb_cString))) { icon_names = ALLOCA_N(const gchar *, 2); icon_names[0] = RVAL2CSTR(rb_icon_names); icon_names[1] = NULL; } else if (RVAL2CBOOL(rb_obj_is_kind_of(rb_icon_names, rb_cArray))) { icon_names = RVAL2STRV(rb_icon_names); } else { rb_raise(rb_eArgError, "expected (name, size), (name, size, flags), " "([name1, name2, ...], size) or " "([name1, name2, ...], size, flags): %s", RBG_INSPECT(rb_ary_new4(argc, argv))); } size = NUM2INT(rb_size); if (NIL_P(rb_flags)) { flags = GTK_ICON_LOOKUP_GENERIC_FALLBACK; } else { flags = RVAL2ICON_LOOKUP_FLAGS(rb_flags); } info = gtk_icon_theme_choose_icon(_SELF(self), icon_names, size, flags); return ICON_INFO2RVAL(info); } static VALUE rg_contexts(VALUE self) { return GLIST2ARY_STR_FREE(gtk_icon_theme_list_contexts(_SELF(self))); } #endif void Init_gtk_icon_theme(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_THEME, "IconTheme", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_SMETHOD(default, 0); RG_DEF_SMETHOD(get_for_screen, 1); RG_DEF_METHOD(set_screen, 1); RG_DEF_METHOD(set_search_path, 1); RG_DEF_METHOD(search_path, 0); RG_DEF_METHOD(append_search_path, 1); RG_DEF_METHOD(prepend_search_path, 1); RG_DEF_METHOD(set_custom_theme, 1); RG_DEF_METHOD_P(has_icon, 1); RG_DEF_METHOD(lookup_icon, 3); RG_DEF_METHOD(load_icon, 3); RG_DEF_METHOD(icons, -1); RG_DEF_METHOD(get_icon_sizes, 1); RG_DEF_METHOD(example_icon_name, 0); RG_DEF_METHOD(rescan_if_needed, 0); RG_DEF_SMETHOD(add_builtin_icon, 3); #if GTK_CHECK_VERSION(2, 12, 0) RG_DEF_METHOD(choose_icon, -1); RG_DEF_METHOD(contexts, 0); #endif G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkIconThemeError */ G_DEF_ERROR(GTK_ICON_THEME_ERROR, "IconThemeError", mGtk, rb_eRuntimeError, GTK_TYPE_ICON_THEME_ERROR); /* GtkIconLookupFlags */ G_DEF_CLASS(GTK_TYPE_ICON_LOOKUP_FLAGS, "LookupFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_ICON_LOOKUP_FLAGS, "GTK_ICON_"); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrecentchooserwidget.c��������������������������������������0000644�0001750�0001750�00000003143�12257552167�022404� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRecentChooserWidget #define _SELF(self) (GTK_RECENT_CHOOSER_WIDGET(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE manager; GtkWidget* widget; rb_scan_args(argc, argv, "01", &manager); if (NIL_P(manager)){ widget = gtk_recent_chooser_widget_new_for_manager(GTK_RECENT_MANAGER(RVAL2GOBJ(manager))); } else { widget = gtk_recent_chooser_widget_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_recent_chooser_widget(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_CHOOSER_WIDGET, "RecentChooserWidget", mGtk); RG_DEF_METHOD(initialize, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkstatusbar.c������������������������������������������������0000644�0001750�0001750�00000004232�11701304107�020323� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cStatusbar #define _SELF(self) (GTK_STATUSBAR(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_statusbar_new()); return Qnil; } static VALUE rg_get_context_id(VALUE self, VALUE text) { return INT2FIX(gtk_statusbar_get_context_id(_SELF(self), RVAL2CSTR(text))); } static VALUE rg_push(VALUE self, VALUE id, VALUE text) { return INT2FIX(gtk_statusbar_push(_SELF(self), NUM2INT(id), RVAL2CSTR(text))); } static VALUE rg_pop(VALUE self, VALUE id) { gtk_statusbar_pop(_SELF(self), NUM2INT(id)); return self; } static VALUE rg_remove(VALUE self, VALUE cid, VALUE mid) { gtk_statusbar_remove(_SELF(self), NUM2INT(cid), NUM2INT(mid)); return self; } void Init_gtk_statusbar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_STATUSBAR, "Statusbar", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(get_context_id, 1); RG_DEF_METHOD(push, 2); RG_DEF_METHOD(pop, 1); RG_DEF_METHOD(remove, 2); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktoolbutton.c�����������������������������������������������0000644�0001750�0001750�00000003354�12257552167�020552� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cToolButton #define _SELF(self) (GTK_TOOL_BUTTON(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE obj, label; GtkToolItem* item; rb_scan_args(argc, argv, "02", &obj, &label); if (TYPE(obj) == T_SYMBOL){ item = gtk_tool_button_new_from_stock(rb_id2name(SYM2ID(obj))); } else if (TYPE(obj) == T_STRING){ item = gtk_tool_button_new_from_stock(RVAL2CSTR(obj)); } else { item = gtk_tool_button_new(GTK_WIDGET(RVAL2GOBJ(obj)), NIL_P(label) ? NULL : RVAL2CSTR(label)); } RBGTK_INITIALIZE(self, item); return Qnil; } void Init_gtk_toolbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOOL_BUTTON, "ToolButton", mGtk); RG_DEF_METHOD(initialize, -1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkaccelmap.c�������������������������������������������������0000644�0001750�0001750�00000007522�12257552167�020107� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAccelMap #define RVAL2MOD(mods) (NIL_P(mods) ? 0 : RVAL2GFLAGS(mods, GDK_TYPE_MODIFIER_TYPE)) static VALUE rg_s_add_entry(VALUE self, VALUE path, VALUE key, VALUE mods) { gtk_accel_map_add_entry(RVAL2CSTR(path), NUM2UINT(key), RVAL2MOD(mods)); return self; } static VALUE rg_s_lookup_entry(VALUE self, VALUE path) { GtkAccelKey key; if(gtk_accel_map_lookup_entry(RVAL2CSTR(path), &key)) return BOXED2RVAL(&key, GTK_TYPE_ACCEL_KEY); else return self; } static VALUE rg_s_change_entry(G_GNUC_UNUSED VALUE self, VALUE path, VALUE key, VALUE mods, VALUE replace) { return CBOOL2RVAL(gtk_accel_map_change_entry(RVAL2CSTR(path), NUM2UINT(key), RVAL2MOD(mods), RVAL2CBOOL(replace))); } static VALUE rg_s_load(VALUE self, VALUE filename) { gtk_accel_map_load(RVAL2CSTR(filename)); return self; } static VALUE rg_s_save(VALUE self, VALUE filename) { gtk_accel_map_save(RVAL2CSTR(filename)); return self; } static VALUE rg_s_add_filter(VALUE self, VALUE pattern) { gtk_accel_map_add_filter(RVAL2CSTR(pattern)); return self; } static void accel_map_foreach_func(gpointer func, const gchar *path, guint key, GdkModifierType mods, gboolean changed) { rb_funcall((VALUE)func, id_call, 4, CSTR2RVAL(path), UINT2NUM(key), GFLAGS2RVAL(mods, GDK_TYPE_MODIFIER_TYPE), CBOOL2RVAL(changed)); } static VALUE rg_s_each(VALUE self) { volatile VALUE func = rb_block_proc(); gtk_accel_map_foreach((gpointer)func, (GtkAccelMapForeach)accel_map_foreach_func); return self; } static VALUE rg_s_each_unfilterd(VALUE self) { volatile VALUE func = rb_block_proc(); gtk_accel_map_foreach_unfiltered((gpointer)func, (GtkAccelMapForeach)accel_map_foreach_func); return self; } /* void gtk_accel_map_load_scanner (GScanner *scanner); */ /* We don't need them. void gtk_accel_map_load_fd (gint fd); void gtk_accel_map_save_fd (gint fd); */ static VALUE rg_s_get(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_accel_map_get()); } static VALUE rg_s_lock_path(VALUE self, VALUE accel_path) { gtk_accel_map_lock_path(RVAL2CSTR(accel_path)); return self; } static VALUE rg_s_unlock_path(VALUE self, VALUE accel_path) { gtk_accel_map_unlock_path(RVAL2CSTR(accel_path)); return self; } void Init_gtk_accel_map(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCEL_MAP, "AccelMap", mGtk); RG_DEF_SMETHOD(add_entry, 3); RG_DEF_SMETHOD(lookup_entry, 1); RG_DEF_SMETHOD(change_entry, 4); RG_DEF_SMETHOD(load, 1); RG_DEF_SMETHOD(save, 1); RG_DEF_SMETHOD(add_filter, 1); RG_DEF_SMETHOD(each, 0); RG_DEF_SMETHOD(each_unfilterd, 0); RG_DEF_SMETHOD(get, 0); RG_DEF_SMETHOD(lock_path, 1); RG_DEF_SMETHOD(unlock_path, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkpixbuf.c���������������������������������������������������0000644�0001750�0001750�00000015007�12257552167�017614� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cPixbuf #define _SELF(s) GDK_PIXBUF(RVAL2GOBJ(s)) static VALUE rg_render_threshold_alpha(VALUE self, VALUE bitmap, VALUE src_x, VALUE src_y, VALUE dest_x, VALUE dest_y, VALUE width, VALUE height, VALUE alpha_threshold) { gdk_pixbuf_render_threshold_alpha(_SELF(self), GDK_BITMAP(RVAL2GOBJ(bitmap)), NUM2INT(src_x), NUM2INT(src_y), NUM2INT(dest_x), NUM2INT(dest_y), NUM2INT(width), NUM2INT(height), NUM2INT(alpha_threshold)); return self; } static VALUE rg_render_to_drawable(int argc, VALUE *argv, VALUE self) { VALUE gc, src_x, src_y, dest_x, dest_y, width, height, dither, x_dither, y_dither; rb_warn("Gdk::Pixbuf#render_to_drawable is obsolete. Use Gdk::Drawable#draw_pixbuf instead."); rb_scan_args(argc, argv, "73", &gc, &src_x, &src_y, &dest_x, &dest_y, &width, &height, &dither, &x_dither, &y_dither); if (NIL_P(gc)) rb_raise(rb_eArgError, "arguments 1 must be non nil"); if (NIL_P(src_x)) rb_raise(rb_eArgError, "arguments 2 must be non nil"); if (NIL_P(src_y)) rb_raise(rb_eArgError, "arguments 3 must be non nil"); if (NIL_P(dest_x)) rb_raise(rb_eArgError, "arguments 4 must be non nil"); if (NIL_P(dest_y)) rb_raise(rb_eArgError, "arguments 5 must be non nil"); if (NIL_P(width)) rb_raise(rb_eArgError, "arguments 6 must be non nil"); if (NIL_P(height)) rb_raise(rb_eArgError, "arguments 7 must be non nil"); gdk_pixbuf_render_to_drawable(_SELF(self), GDK_DRAWABLE(RVAL2GOBJ(self)), GDK_GC(RVAL2GOBJ(gc)), NUM2INT(src_x), NUM2INT(src_y), NUM2INT(dest_x), NUM2INT(dest_y), NUM2INT(width), NUM2INT(height), NIL_P(dither) ? GDK_RGB_DITHER_NONE : RVAL2GENUM(dither, GDK_TYPE_RGB_DITHER), NIL_P(x_dither) ? 0 : NUM2INT(x_dither), NIL_P(y_dither) ? 0 : NUM2INT(y_dither)); return self; } static VALUE rg_render_pixmap_and_mask(int argc, VALUE *argv, VALUE self) { VALUE colormap_or_alpha, alpha; GdkPixmap *pixmap; GdkBitmap *mask; rb_scan_args(argc, argv, "11", &colormap_or_alpha, &alpha); if (rb_obj_is_kind_of(colormap_or_alpha, GTYPE2CLASS(GDK_TYPE_COLORMAP))){ gdk_pixbuf_render_pixmap_and_mask_for_colormap(_SELF(self), RVAL2GOBJ(colormap_or_alpha), &pixmap, &mask, NIL_P(alpha)?0:NUM2INT(alpha)); } else { gdk_pixbuf_render_pixmap_and_mask(_SELF(self), &pixmap, &mask, NIL_P(colormap_or_alpha)? 0:NUM2INT(colormap_or_alpha)); } return rb_ary_new3(2, pixmap ? GOBJ2RVAL(pixmap) : Qnil, mask ? GOBJ2RVAL(mask) : Qnil); } static VALUE rg_s_from_drawable(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE cmap, src, src_x, src_y, width, height, dest, dest_x, dest_y; GdkPixbuf* buf; rb_scan_args(argc, argv, "63", &cmap, &src, &src_x, &src_y, &width, &height, &dest, &dest_x, &dest_y); buf = gdk_pixbuf_get_from_drawable(GDK_PIXBUF(RVAL2GOBJ(dest)), GDK_DRAWABLE(RVAL2GOBJ(src)), GDK_COLORMAP(RVAL2GOBJ(cmap)), NUM2INT(src_x), NUM2INT(src_y), NIL_P(dest_x) ? 0 : NUM2INT(dest_x), NIL_P(dest_y) ? 0 : NUM2INT(dest_y), NUM2INT(width), NUM2INT(height)); if (NIL_P(dest)) { if (buf) { return GOBJ2RVALU(buf); } else { return Qnil; } } else { return dest; } } static VALUE rg_s_from_image(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE cmap, src, src_x, src_y, width, height, dest, dest_x, dest_y; GdkPixbuf* buf; rb_scan_args(argc, argv, "63", &cmap, &src, &src_x, &src_y, &width, &height, &dest, &dest_x, &dest_y); buf = gdk_pixbuf_get_from_image(GDK_PIXBUF(RVAL2GOBJ(dest)), GDK_IMAGE(RVAL2GOBJ(src)), GDK_COLORMAP(RVAL2GOBJ(cmap)), NUM2INT(src_x), NUM2INT(src_y), NIL_P(dest_x) ? 0 : NUM2INT(dest_x), NIL_P(dest_y) ? 0 : NUM2INT(dest_y), NUM2INT(width), NUM2INT(height)); if (NIL_P(dest)) { if (buf) { return GOBJ2RVAL(buf); } else { return Qnil; } } else { return dest; } } void Init_gtk_gdk_pixbuf(VALUE mGdk) { /* * This defines Gdk::Pixbuf methods of GDK side. */ VALUE RG_TARGET_NAMESPACE = GTYPE2CLASS(GDK_TYPE_PIXBUF); RG_DEF_METHOD(render_threshold_alpha, 8); RG_DEF_METHOD(render_to_drawable, -1); RG_DEF_METHOD(render_pixmap_and_mask, -1); RG_DEF_SMETHOD(from_drawable, -1); RG_DEF_SMETHOD(from_image, -1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkpangorenderer.c��������������������������������������������0000644�0001750�0001750�00000007603�12257552167�021155� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2012 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cPangoRenderer #define _SELF(s) (GDK_PANGO_RENDERER(RVAL2GOBJ(s))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE screen; GdkScreen* gscreen; rb_scan_args(argc, argv, "01", &screen); if (NIL_P(screen)){ gscreen = gdk_screen_get_default(); } else { gscreen = GDK_SCREEN(RVAL2GOBJ(screen)); } G_INITIALIZE(self, gdk_pango_renderer_new(gscreen)); return Qnil; } static VALUE rg_s_get_default(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE screen; GdkScreen* gscreen; rb_scan_args(argc, argv, "01", &screen); if (NIL_P(screen)){ gscreen = gdk_screen_get_default(); } else { gscreen = GDK_SCREEN(RVAL2GOBJ(screen)); } return GOBJ2RVAL(gdk_pango_renderer_get_default(gscreen)); } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { GdkScreen* gscreen = gdk_screen_get_default(); return GOBJ2RVAL(gdk_pango_renderer_get_default(gscreen)); } static VALUE rg_set_drawable(VALUE self, VALUE drawable) { gdk_pango_renderer_set_drawable(_SELF(self), GDK_DRAWABLE(RVAL2GOBJ(drawable))); return self; } static VALUE rg_set_gc(VALUE self, VALUE gc) { gdk_pango_renderer_set_gc(_SELF(self), NIL_P(gc) ? NULL : GDK_GC(RVAL2GOBJ(gc))); return self; } #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE static VALUE rg_set_stipple(VALUE self, VALUE part, VALUE stipple) { gdk_pango_renderer_set_stipple(_SELF(self), RVAL2GENUM(part, PANGO_TYPE_RENDER_PART), NIL_P(stipple) ? NULL : GDK_BITMAP(RVAL2GOBJ(stipple))); return self; } #else static VALUE rg_set_stipple(G_GNUC_UNUSED VALUE self, G_GNUC_UNUSED VALUE part, G_GNUC_UNUSED VALUE stipple) { rb_warning("Gdk::PangoRender#set_tipple is not supported (Require pango-1.8.1 or later"); return self; } #endif #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE static VALUE rg_set_override_color(VALUE self, VALUE part, VALUE color) { gdk_pango_renderer_set_override_color(_SELF(self), RVAL2GENUM(part, PANGO_TYPE_RENDER_PART), RVAL2GDKCOLOR(color)); return self; } #else static VALUE rg_set_override_color(G_GNUC_UNUSED VALUE self, G_GNUC_UNUSED VALUE part, G_GNUC_UNUSED VALUE color) { rb_warning("Gdk::PangoRender#set_override_color is not supported (Require pango-1.8.1 or later"); return self; } #endif void Init_gtk_gdk_pangorenderer(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PANGO_RENDERER, "PangoRenderer", mGdk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_drawable, 1); RG_DEF_METHOD(set_gc, 1); RG_DEF_METHOD(set_stipple, 2); RG_DEF_METHOD(set_override_color, 2); RG_DEF_SMETHOD(get_default, -1); RG_DEF_SMETHOD(default, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfilechooserbutton.c����������������������������������������0000644�0001750�0001750�00000004113�12257552167�022071� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFileChooserButton static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE title, action, backend; GtkWidget* widget; rb_scan_args(argc, argv, "12", &title, &action, &backend); if (TYPE(title) == T_STRING) { if (NIL_P(backend)){ widget = gtk_file_chooser_button_new(RVAL2CSTR(title), RVAL2GENUM(action, GTK_TYPE_FILE_CHOOSER_ACTION)); } else { widget = gtk_file_chooser_button_new_with_backend(RVAL2CSTR(title), RVAL2GENUM(action, GTK_TYPE_FILE_CHOOSER_ACTION), RVAL2CSTR(backend)); } } else { widget = gtk_file_chooser_button_new_with_dialog(GTK_WIDGET(RVAL2GOBJ(title))); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_filechooserbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_BUTTON, "FileChooserButton", mGtk); RG_DEF_METHOD(initialize, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrc.c�������������������������������������������������������0000644�0001750�0001750�00000014531�12257552167�016744� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mRC /* static VALUE rc_scanner_new(VALUE self) { return BOXED2RVAL(gtk_rc_scanner_new(), GTK_TYPE_GSCANNER); } */ static VALUE rg_m_get_style(G_GNUC_UNUSED VALUE self, VALUE widget) { GtkStyle* style = gtk_rc_get_style(GTK_WIDGET(RVAL2GOBJ(widget))); GType gtype = G_OBJECT_TYPE(style); const gchar* name = G_OBJECT_TYPE_NAME(style); if (! rb_const_defined_at(mGtk, rb_intern(name))){ G_DEF_CLASS(gtype, (gchar*)name, mGtk); } return GOBJ2RVAL(gtk_rc_get_style(GTK_WIDGET(RVAL2GOBJ(widget)))); } static VALUE rg_m_get_style_by_paths(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE settings, widget_path, class_path, klass; GtkStyle* style; GType gtype; const gchar* name; rb_scan_args(argc, argv, "13", &settings, &widget_path, &class_path, &klass); style = gtk_rc_get_style_by_paths(GTK_SETTINGS(RVAL2GOBJ(settings)), NIL_P(widget_path) ? NULL : RVAL2CSTR(widget_path), NIL_P(class_path) ? NULL : RVAL2CSTR(class_path), NIL_P(klass) ? G_TYPE_NONE : CLASS2GTYPE(klass)); if (style){ gtype = G_OBJECT_TYPE(style); name = G_OBJECT_TYPE_NAME(style); if (! rb_const_defined_at(mGtk, rb_intern(name))){ G_DEF_CLASS(gtype, (gchar*)name, mGtk); } return GOBJ2RVAL(style); } return Qnil; } static VALUE rg_m_parse(G_GNUC_UNUSED VALUE self, VALUE filename) { gtk_rc_parse(RVAL2CSTR(filename)); return filename; } static VALUE rg_m_parse_string(G_GNUC_UNUSED VALUE self, VALUE rc_string) { gtk_rc_parse_string(RVAL2CSTR(rc_string)); return rc_string; } static VALUE rg_m_reparse_all(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gtk_rc_reparse_all()); } static VALUE rg_m_reparse_all_for_settings(G_GNUC_UNUSED VALUE self, VALUE settings, VALUE force_load) { return CBOOL2RVAL(gtk_rc_reparse_all_for_settings(GTK_SETTINGS(RVAL2GOBJ(settings)), RVAL2CBOOL(force_load))); } static VALUE rg_m_reset_styles(G_GNUC_UNUSED VALUE self, VALUE settings) { gtk_rc_reset_styles(GTK_SETTINGS(RVAL2GOBJ(settings))); return settings; } static VALUE rg_m_add_default_file(G_GNUC_UNUSED VALUE self, VALUE filename) { gtk_rc_add_default_file(RVAL2CSTR(filename)); return filename; } static VALUE rg_m_default_files(G_GNUC_UNUSED VALUE self) { gchar** files = gtk_rc_get_default_files(); VALUE ary = rb_ary_new(); while(*files){ rb_ary_push(ary, CSTR2RVAL(*files)); files++; } return ary; } static VALUE rg_m_set_default_files(G_GNUC_UNUSED VALUE self, VALUE rbfilenames) { gchar **filenames = (gchar **)RVAL2STRV(rbfilenames); gtk_rc_set_default_files(filenames); g_free(filenames); return rbfilenames; } /* guint gtk_rc_parse_color (GScanner *scanner, GdkColor *color); guint gtk_rc_parse_color_full (GScanner *scanner, GtkRcStyle *style, GdkColor *color); guint gtk_rc_parse_state (GScanner *scanner, GtkStateType *state); guint gtk_rc_parse_priority (GScanner *scanner, GtkPathPriorityType *priority); */ static VALUE rg_m_find_module_in_path(G_GNUC_UNUSED VALUE self, VALUE module_file) { return CSTR2RVAL_FREE(gtk_rc_find_module_in_path(RVAL2CSTR(module_file))); } /* gchar* gtk_rc_find_pixmap_in_path (GtkSettings *settings, GScanner *scanner, const gchar *pixmap_file); */ static VALUE rg_m_module_dir(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL_FREE(gtk_rc_get_module_dir()); } static VALUE rg_m_im_module_path(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gtk_rc_get_im_module_path()); } static VALUE rg_m_im_module_file(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gtk_rc_get_im_module_file()); } static VALUE rg_m_theme_dir(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL_FREE(gtk_rc_get_theme_dir()); } void Init_gtk_rc(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "RC"); RG_DEF_MODFUNC(get_style, 1); RG_DEF_MODFUNC(get_style_by_paths, -1); RG_DEF_MODFUNC(parse, 1); RG_DEF_MODFUNC(parse_string, 1); RG_DEF_MODFUNC(reparse_all, 0); RG_DEF_MODFUNC(reparse_all_for_settings, 2); RG_DEF_MODFUNC(reset_styles, 1); RG_DEF_MODFUNC(add_default_file, 1); RG_DEF_MODFUNC(default_files, 0); RG_DEF_MODFUNC(set_default_files, 1); RG_DEF_MODFUNC(find_module_in_path, 1); RG_DEF_MODFUNC(module_dir, 0); RG_DEF_MODFUNC(im_module_path, 0); RG_DEF_MODFUNC(im_module_file, 0); RG_DEF_MODFUNC(theme_dir, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkRcFlags */ G_DEF_CLASS(GTK_TYPE_RC_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_RC_FLAGS, "GTK_RC_"); /* GtkRcTokenType */ G_DEF_CLASS(GTK_TYPE_RC_TOKEN_TYPE, "TokenType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_RC_TOKEN_TYPE, "GTK_RC_"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkpagesetupunixdialog.c��������������������������������������0000644�0001750�0001750�00000005061�11701304107�022375� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef HAVE_GTK_UNIX_PRINT #include <gtk/gtkpagesetupunixdialog.h> #define RG_TARGET_NAMESPACE cPageSetupUnixDialog #define _SELF(s) (GTK_PAGE_SETUP_UNIX_DIALOG(RVAL2GOBJ(s))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GtkWidget *dialog; VALUE title, parent; rb_scan_args(argc, argv, "02", &title, &parent); dialog = gtk_page_setup_unix_dialog_new(RVAL2CSTR_ACCEPT_NIL(title), RVAL2GOBJ(parent)); RBGTK_INITIALIZE(self, dialog); return Qnil; } static VALUE rg_set_page_setup(VALUE self, VALUE page_setup) { gtk_page_setup_unix_dialog_set_page_setup(_SELF(self), RVAL2GOBJ(page_setup)); return self; } static VALUE rg_page_setup(VALUE self) { return GOBJ2RVAL(gtk_page_setup_unix_dialog_get_page_setup(_SELF(self))); } static VALUE rg_set_print_settings(VALUE self, VALUE print_settings) { gtk_page_setup_unix_dialog_set_print_settings(_SELF(self), RVAL2GOBJ(print_settings)); return Qnil; } static VALUE rg_print_settings(VALUE self) { return GOBJ2RVAL(gtk_page_setup_unix_dialog_get_print_settings(_SELF(self))); } #endif void Init_gtk_page_setup_unix_dialog(VALUE mGtk) { #ifdef HAVE_GTK_UNIX_PRINT VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PAGE_SETUP_UNIX_DIALOG, "PageSetupUnixDialog", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_page_setup, 1); RG_DEF_METHOD(page_setup, 0); RG_DEF_METHOD(set_print_settings, 1); RG_DEF_METHOD(print_settings, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); #endif } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkaccelgroup.c�����������������������������������������������0000644�0001750�0001750�00000014023�12257552167�020460� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAccelGroup #define _SELF(w) GTK_ACCEL_GROUP(RVAL2GOBJ(w)) #define RVAL2MOD(mods) (NIL_P(mods) ? 0 : RVAL2GFLAGS(mods, GDK_TYPE_MODIFIER_TYPE)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_accel_group_new()); return Qnil; } static VALUE rg_connect(int argc, VALUE *argv, VALUE self) { VALUE key, mods, flags, path, closure; GClosure *rclosure; if (argc > 2){ rb_scan_args(argc, argv, "31", &key, &mods, &flags, &closure); if (NIL_P(closure)){ rclosure = g_rclosure_new(rb_block_proc(), Qnil, NULL); } else { rclosure = (GClosure*)RVAL2BOXED(closure, G_TYPE_CLOSURE); } g_rclosure_attach(rclosure, self); gtk_accel_group_connect(_SELF(self), NUM2UINT(key), RVAL2MOD(mods), RVAL2GFLAGS(flags, GTK_TYPE_ACCEL_FLAGS), rclosure); } else { rb_scan_args(argc, argv, "11", &path, &closure); if (NIL_P(closure)){ rclosure = g_rclosure_new(rb_block_proc(), Qnil, NULL); } else { rclosure = (GClosure*)RVAL2BOXED(closure, G_TYPE_CLOSURE); } g_rclosure_attach(rclosure, self); gtk_accel_group_connect_by_path(_SELF(self), RVAL2CSTR(path), rclosure); } return self; } static VALUE rg_disconnect_key(VALUE self, VALUE key, VALUE mods) { return CBOOL2RVAL(gtk_accel_group_disconnect_key(_SELF(self), NUM2UINT(key), RVAL2MOD(mods))); } static VALUE rg_query(VALUE self, VALUE key, VALUE mods) { GtkAccelGroupEntry *entries; guint n_entries; guint cnt; VALUE result; entries = gtk_accel_group_query(_SELF(self), NUM2UINT(key), RVAL2MOD(mods), &n_entries); if(n_entries == 0){ return Qnil; } else{ result = rb_ary_new2(n_entries); for(cnt=0; cnt<n_entries; cnt++, entries++) rb_ary_push(result, BOXED2RVAL(entries, GTK_TYPE_ACCEL_GROUP_ENTRY)); return result; } } static VALUE rg_disconnect(VALUE self, VALUE closure) { return CBOOL2RVAL(gtk_accel_group_disconnect(_SELF(self), (GClosure*)RVAL2BOXED(closure, G_TYPE_CLOSURE))); } static VALUE rg_s_from_accel_closure(G_GNUC_UNUSED VALUE self, VALUE closure) { return GOBJ2RVAL(gtk_accel_group_from_accel_closure( (GClosure*)RVAL2BOXED(closure, G_TYPE_CLOSURE))); } static gboolean gaccelgrp_find_func(GtkAccelKey *key, GClosure *closure, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 2, BOXED2RVAL(key, GTK_TYPE_ACCEL_KEY), BOXED2RVAL(closure, G_TYPE_CLOSURE))); } static VALUE rg_find(VALUE self) { GtkAccelKey *result; volatile VALUE func = rb_block_proc(); result = gtk_accel_group_find(_SELF(self), (GtkAccelGroupFindFunc)gaccelgrp_find_func, (gpointer)func); return BOXED2RVAL(result, GTK_TYPE_ACCEL_KEY); } static VALUE rg_activate(VALUE self, VALUE accel_quark, VALUE acceleratable, VALUE accel_key, VALUE accel_mods) { GQuark quark = 0; if (TYPE(accel_quark) == T_STRING){ quark = g_quark_from_string(RVAL2CSTR(accel_quark)); } else { quark = NUM2UINT(quark); } return CBOOL2RVAL(gtk_accel_group_activate(_SELF(self), quark, RVAL2GOBJ(acceleratable), NUM2UINT(accel_key), RVAL2MOD(accel_mods))); } static VALUE _gaccelgrp_lock_ensure(VALUE self) { gtk_accel_group_unlock(_SELF(self)); return Qnil; } static VALUE rg_lock(VALUE self) { gtk_accel_group_lock(_SELF(self)); if (rb_block_given_p()){ rb_ensure(rb_yield, self, _gaccelgrp_lock_ensure , self); } return self; } static VALUE rg_unlock(VALUE self) { gtk_accel_group_unlock(_SELF(self)); return self; } static VALUE rg_s_activate(G_GNUC_UNUSED VALUE self, VALUE obj, VALUE key, VALUE modtype) { return CBOOL2RVAL(gtk_accel_groups_activate(G_OBJECT(RVAL2GOBJ(obj)), NUM2UINT(key), RVAL2MOD(modtype))); } static VALUE rg_s_from_object(G_GNUC_UNUSED VALUE self, VALUE object) { /* Owned by GTK+ */ return GSLIST2ARY(gtk_accel_groups_from_object(RVAL2GOBJ(object))); } void Init_gtk_accel_group(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCEL_GROUP, "AccelGroup", mGtk); RG_DEF_SMETHOD(activate, 3); RG_DEF_SMETHOD(from_object, 1); RG_DEF_SMETHOD(from_accel_closure, 1); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(activate, 4); RG_DEF_METHOD(lock, 0); RG_DEF_METHOD(unlock, 0); RG_DEF_METHOD(connect, -1); RG_DEF_METHOD(disconnect, 1); RG_DEF_METHOD(disconnect_key, 2); RG_DEF_METHOD(query, 2); RG_DEF_METHOD(find, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfixed.c����������������������������������������������������0000644�0001750�0001750�00000004262�11701304107�017415� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFixed #define _SELF(self) (GTK_FIXED(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_fixed_new()); return Qnil; } static VALUE rg_put(VALUE self, VALUE win, VALUE x, VALUE y) { gtk_fixed_put(_SELF(self), GTK_WIDGET(RVAL2GOBJ(win)), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_move(VALUE self, VALUE win, VALUE x, VALUE y) { gtk_fixed_move(_SELF(self), GTK_WIDGET(RVAL2GOBJ(win)), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_has_window_p(VALUE self) { return CBOOL2RVAL(gtk_fixed_get_has_window(_SELF(self))); } static VALUE rg_set_has_window(VALUE self, VALUE has_window) { gtk_fixed_set_has_window(_SELF(self), RVAL2CBOOL(has_window)); return self; } void Init_gtk_fixed(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FIXED, "Fixed", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(put, 3); RG_DEF_METHOD(move, 3); RG_DEF_METHOD_P(has_window, 0); RG_DEF_METHOD(set_has_window, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkaction.c���������������������������������������������������0000644�0001750�0001750�00000013247�12257552167�017620� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAction #define _SELF(self) (GTK_ACTION(RVAL2GOBJ(self))) #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE name, label, tooltip, stock_id; const gchar *stock = NULL; rb_scan_args(argc, argv, "22", &name, &label, &tooltip, &stock_id); if (TYPE(stock_id) == T_SYMBOL) { stock = rb_id2name(SYM2ID(stock_id)); } else if (TYPE(stock_id) == T_STRING){ stock = RVAL2CSTR(stock_id); } G_INITIALIZE(self, gtk_action_new(RVAL2CSTR(name), RVAL2CSTR(label), NIL_P(tooltip) ? NULL : RVAL2CSTR(tooltip), stock)); return Qnil; } static VALUE rg_is_sensitive_p(VALUE self) { return CBOOL2RVAL(gtk_action_is_sensitive(_SELF(self))); } static VALUE rg_is_visible_p(VALUE self) { return CBOOL2RVAL(gtk_action_is_visible(_SELF(self))); } static VALUE rg_activate(VALUE self) { gtk_action_activate(_SELF(self)); return self; } static VALUE rg_create_icon(VALUE self, VALUE icon_size) { return GOBJ2RVAL(gtk_action_create_icon(_SELF(self), RVAL2GENUM(icon_size, GTK_TYPE_ICON_SIZE))); } static VALUE rg_create_menu_item(VALUE self) { return GOBJ2RVAL(gtk_action_create_menu_item(_SELF(self))); } #if GTK_CHECK_VERSION(2, 12, 0) static VALUE rg_create_menu(VALUE self) { return GOBJ2RVAL(gtk_action_create_menu(_SELF(self))); } #endif static VALUE rg_create_tool_item(VALUE self) { return GOBJ2RVAL(gtk_action_create_tool_item(_SELF(self))); } static VALUE rg_connect_proxy(VALUE self, VALUE proxy) { gtk_action_connect_proxy(_SELF(self), RVAL2WIDGET(proxy)); return self; } static VALUE rg_disconnect_proxy(VALUE self, VALUE proxy) { gtk_action_disconnect_proxy(_SELF(self), RVAL2WIDGET(proxy)); return self; } static VALUE rg_proxies(VALUE self) { /* Owned by GTK+ */ return GSLIST2ARY(gtk_action_get_proxies(_SELF(self))); } static VALUE rg_connect_accelerator(VALUE self) { gtk_action_connect_accelerator(_SELF(self)); return self; } static VALUE rg_disconnect_accelerator(VALUE self) { gtk_action_disconnect_accelerator(_SELF(self)); return self; } static VALUE rg_block_activate_from(VALUE self, VALUE proxy) { gtk_action_block_activate_from(_SELF(self), RVAL2WIDGET(proxy)); return self; } static VALUE rg_unblock_activate_from(VALUE self, VALUE proxy) { gtk_action_unblock_activate_from(_SELF(self), RVAL2WIDGET(proxy)); return self; } static VALUE rg_set_accel_path(VALUE self, VALUE accel_path) { gtk_action_set_accel_path(_SELF(self), RVAL2CSTR(accel_path)); return self; } static VALUE rg_set_accel_group(VALUE self, VALUE accel_group) { gtk_action_set_accel_group(_SELF(self), RVAL2GOBJ(accel_group)); return self; } static VALUE rg_accel_path(VALUE self) { return CSTR2RVAL(gtk_action_get_accel_path(_SELF(self))); } static VALUE rg_accel_closure(VALUE self) { return BOXED2RVAL(gtk_action_get_accel_closure(_SELF(self)), G_TYPE_CLOSURE); } static void action_mark(void *p) { GtkAction *action; GSList *node; action = GTK_ACTION(p); for (node = gtk_action_get_proxies(action); node; node = g_slist_next(node)) { GtkWidget *proxy = node->data; rbgobj_gc_mark_instance(proxy); } } void Init_gtk_action(VALUE mGtk) { 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"); RG_DEF_METHOD(accel_path, 0); RG_DEF_METHOD(accel_closure, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfilechooserwidget.c����������������������������������������0000644�0001750�0001750�00000003301�12257552167�022037� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFileChooserWidget static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE action, back; GtkWidget* widget; rb_scan_args(argc, argv, "11", &action, &back); if (NIL_P(back)){ widget = gtk_file_chooser_widget_new(RVAL2GENUM(action, GTK_TYPE_FILE_CHOOSER_ACTION)); } else { widget = gtk_file_chooser_widget_new_with_backend(RVAL2GENUM(action, GTK_TYPE_FILE_CHOOSER_ACTION), RVAL2CSTR(back)); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_file_chooser_widget(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_WIDGET, "FileChooserWidget", mGtk); RG_DEF_METHOD(initialize, -1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkconversions.h����������������������������������������������0000644�0001750�0001750�00000002300�11701304107�020642� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RB_GDK_CONVERSIONS_H__ #define __RB_GDK_CONVERSIONS_H__ #include <rbgobject.h> #include <gdk/gdk.h> #define RVAL2GDKCOLOR(color) ((GdkColor *)RVAL2BOXED(color, GDK_TYPE_COLOR)) #define GDKCOLOR2RVAL(color) (BOXED2RVAL(color, GDK_TYPE_COLOR)) #endif /* __RB_GDK_CONVERSIONS_H__ */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkimage.c����������������������������������������������������0000644�0001750�0001750�00000007330�11701304107�017357� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cImage #define _SELF(i) GDK_IMAGE(RVAL2GOBJ(i)) static VALUE rg_initialize(VALUE self, VALUE type, VALUE visual, VALUE w, VALUE h) { GdkImage* image = gdk_image_new((GdkImageType)RVAL2GENUM(type, GDK_TYPE_IMAGE_TYPE), GDK_VISUAL(RVAL2GOBJ(visual)), NUM2INT(w), NUM2INT(h)); if (image) G_INITIALIZE(self, image); else rb_raise(rb_eArgError, "The image could not be created."); return Qnil; } static VALUE rg_colormap(VALUE self) { return GOBJ2RVAL(gdk_image_get_colormap(_SELF(self))); } static VALUE rg_set_colormap(VALUE self, VALUE colormap) { gdk_image_set_colormap(_SELF(self), RVAL2GOBJ(colormap)); return self; } static VALUE rg_put_pixel(VALUE self, VALUE x, VALUE y, VALUE pix) { gdk_image_put_pixel(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(pix)); return self; } static VALUE rg_get_pixel(VALUE self, VALUE x, VALUE y) { return INT2NUM(gdk_image_get_pixel(_SELF(self), NUM2INT(x), NUM2INT(y))); } static VALUE rg_image_type(VALUE self) { return GENUM2RVAL((_SELF(self))->type, GDK_TYPE_IMAGE_TYPE); } static VALUE rg_visual(VALUE self) { return GOBJ2RVAL((_SELF(self))->visual); } static VALUE rg_byte_order(VALUE self) { return GENUM2RVAL((_SELF(self))->byte_order, GDK_TYPE_BYTE_ORDER); } static VALUE rg_bits_per_pixel(VALUE self) { return INT2NUM((_SELF(self))->bits_per_pixel); } static VALUE rg_width(VALUE self) { return INT2NUM((_SELF(self))->width); } static VALUE rg_height(VALUE self) { return INT2NUM((_SELF(self))->height); } static VALUE rg_depth(VALUE self) { return INT2NUM((_SELF(self))->depth); } static VALUE rg_bpp(VALUE self) { return INT2NUM((_SELF(self))->bpp); } static VALUE rg_bpl(VALUE self) { return INT2NUM((_SELF(self))->bpl); } void Init_gtk_gdk_image(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_IMAGE, "Image", mGdk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(colormap, 0); RG_DEF_METHOD(set_colormap, 1); RG_DEF_METHOD(put_pixel, 3); RG_DEF_METHOD(get_pixel, 2); RG_DEF_METHOD(image_type, 0); RG_DEF_METHOD(visual, 0); RG_DEF_METHOD(byte_order, 0); RG_DEF_METHOD(bits_per_pixel, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(depth, 0); RG_DEF_METHOD(bpp, 0); RG_DEF_METHOD(bpl, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GdkImageType */ G_DEF_CLASS(GDK_TYPE_IMAGE_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_IMAGE_TYPE, "GDK_IMAGE_"); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkkeymap.c���������������������������������������������������0000644�0001750�0001750�00000010733�12257552167�017606� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cKeymap #define _SELF(s) GDK_KEYMAP(RVAL2GOBJ(s)) static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_keymap_get_default()); } static VALUE rg_s_for_display(G_GNUC_UNUSED VALUE self, VALUE display) { return GOBJ2RVAL(gdk_keymap_get_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)))); } static VALUE rg_lookup_key(VALUE self, VALUE keycode, VALUE group, VALUE level) { GdkKeymapKey key; key.keycode = NUM2UINT(keycode); key.group = NUM2INT(group); key.level = NUM2INT(level); return INT2NUM(gdk_keymap_lookup_key(_SELF(self), &key)); } static VALUE rg_translate_keyboard_state(VALUE self, VALUE hardware_keycode, VALUE state, VALUE group) { guint keyval; gint effective_group, level; GdkModifierType consumed_modifiers; gboolean ret; ret = gdk_keymap_translate_keyboard_state(_SELF(self), NUM2UINT(hardware_keycode), RVAL2GFLAGS(state, GDK_TYPE_MODIFIER_TYPE), NUM2INT(group), &keyval, &effective_group, &level, &consumed_modifiers); return ret ? rb_ary_new3(4, UINT2NUM(keyval), INT2NUM(effective_group), INT2NUM(level), GFLAGS2RVAL(consumed_modifiers, GDK_TYPE_MODIFIER_TYPE)) : Qnil; } static VALUE rg_get_entries_for_keyval(VALUE self, VALUE keyval) { GdkKeymapKey* keys; gint n_keys; gboolean ret; ret = gdk_keymap_get_entries_for_keyval(_SELF(self), NUM2UINT(keyval), &keys, &n_keys); if (ret){ VALUE key; VALUE ary = rb_ary_new(); gint i; for (i = 0; i < n_keys; i++){ key = rb_ary_new3(3, UINT2NUM(keys[i].keycode), INT2NUM(keys[i].group), INT2NUM(keys[i].level)); rb_ary_push(ary, key); } g_free(keys); return ary; } else { return Qnil; } } static VALUE rg_get_entries_for_keycode(VALUE self, VALUE hardware_keycode) { GdkKeymapKey* keys; guint* keyvals; gint n_entries; gboolean ret = gdk_keymap_get_entries_for_keycode(_SELF(self), NUM2UINT(hardware_keycode), &keys, &keyvals, &n_entries); if (ret){ VALUE key; VALUE ary = rb_ary_new(); gint i; for (i = 0; i < n_entries; i++){ key = rb_ary_new3(4, UINT2NUM(keys[i].keycode), INT2NUM(keys[i].group), INT2NUM(keys[i].level), UINT2NUM(keyvals[i])); rb_ary_push(ary, key); } g_free(keys); g_free(keyvals); return ary; } else { return Qnil; } } static VALUE rg_direction(VALUE self) { return GENUM2RVAL(gdk_keymap_get_direction(_SELF(self)), PANGO_TYPE_DIRECTION); } #if GTK_CHECK_VERSION(2, 12, 0) static VALUE rg_have_bidi_layouts_p(VALUE self) { return CBOOL2RVAL(gdk_keymap_have_bidi_layouts(_SELF(self))); } #endif void Init_gtk_gdk_keymap(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_KEYMAP, "Keymap", mGdk); RG_DEF_SMETHOD(default, 0); RG_DEF_SMETHOD(for_display, 0); RG_DEF_METHOD(lookup_key, 3); RG_DEF_METHOD(translate_keyboard_state, 3); RG_DEF_METHOD(get_entries_for_keyval, 1); RG_DEF_METHOD(get_entries_for_keycode, 1); RG_DEF_METHOD(direction, 0); #if GTK_CHECK_VERSION(2, 12, 0) RG_DEF_METHOD_P(have_bidi_layouts, 0); #endif #ifdef GDK_WINDOWING_X11 G_DEF_CLASS3("GdkKeymapX11", "KeymapX11", mGdk); #endif } �������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkproperty.c�������������������������������������������������0000644�0001750�0001750�00000022616�12257552167�020207� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mProperty static VALUE rg_m_text_property_to_text_list(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { gint num, i; gchar** list; VALUE ret = Qnil; if (argc == 3) { VALUE encoding, format, text; rb_scan_args(argc, argv, "30", &encoding, &format, &text); StringValue(text); num = gdk_text_property_to_text_list(RVAL2ATOM(encoding), NUM2INT(format), (const guchar*)RVAL2CSTR(text), RSTRING_LEN(text), &list); } else { VALUE display, encoding, format, text; rb_scan_args(argc, argv, "40", &display, &encoding, &format, &text); StringValue(text); num = gdk_text_property_to_text_list_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2ATOM(encoding), NUM2INT(format), (const guchar*)RVAL2CSTR(text), RSTRING_LEN(text), &list); } ret = rb_ary_new2(num); for (i =0; i < num; i++){ rb_ary_push(ret, CSTR2RVAL(list[i])); } gdk_free_text_list(list); return ret; } static VALUE rg_m_text_property_to_utf8_list(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { gint num, i; gchar** list; VALUE ret = Qnil; if (argc == 3) { VALUE encoding, format, text; rb_scan_args(argc, argv, "30", &encoding, &format, &text); StringValue(text); num = gdk_text_property_to_utf8_list(RVAL2ATOM(encoding), NUM2INT(format), (const guchar*)RVAL2CSTR(text), RSTRING_LEN(text), &list); } else { VALUE display, encoding, format, text; rb_scan_args(argc, argv, "40", &display, &encoding, &format, &text); StringValue(text); num = gdk_text_property_to_utf8_list_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2ATOM(encoding), NUM2INT(format), (const guchar*)RVAL2CSTR(text), RSTRING_LEN(text), &list); } ret = rb_ary_new2(num); for (i =0; i < num; i++){ rb_ary_push(ret, CSTR2RVAL(list[i])); } g_strfreev(list); return ret; } static VALUE rg_m_string_to_compound_text(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { gint num; GdkAtom encoding; gint format; guchar *ctext; gint length; if (argc == 1) { VALUE str; rb_scan_args(argc, argv, "10", &str); num = gdk_string_to_compound_text(RVAL2CSTR(str), &encoding, &format, &ctext, &length); } else { VALUE display, str; rb_scan_args(argc, argv, "20", &display, &str); num = gdk_string_to_compound_text_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2CSTR(str), &encoding, &format, &ctext, &length); } if (num == 0){ VALUE ret = CSTR2RVAL((const char*)ctext); gdk_free_compound_text(ctext); return rb_ary_new3(3, BOXED2RVAL(encoding, GDK_TYPE_ATOM), INT2NUM(format), ret); } else { rb_raise(rb_eRuntimeError, "failed to converts a string %d\n", num); } return Qnil; } static VALUE rg_m_utf8_to_string_target(G_GNUC_UNUSED VALUE self, VALUE str) { return CSTR2RVAL((const char*)gdk_utf8_to_string_target(RVAL2CSTR(str))); } static VALUE rg_m_utf8_to_compound_text(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { GdkAtom encoding; gint format; guchar *ctext; gint length; gint ret; if (argc == 1) { VALUE str; rb_scan_args(argc, argv, "10", &str); ret = gdk_utf8_to_compound_text(RVAL2CSTR(str), &encoding, &format, &ctext, &length); } else { VALUE display, str; rb_scan_args(argc, argv, "20", &display, &str); ret = gdk_utf8_to_compound_text_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2CSTR(str), &encoding, &format, &ctext, &length); } if (ret){ VALUE val = CSTR2RVAL((const char*)ctext); gdk_free_compound_text(ctext); return rb_ary_new3(3, BOXED2RVAL(encoding, GDK_TYPE_ATOM), INT2NUM(format), val); } else { rb_raise(rb_eRuntimeError, "failed to converts a string %d\n", ret); } return Qnil; } static VALUE rg_m_change(int argc, VALUE *argv, VALUE self) { int fmt, len; void* dat; GdkAtom ntype; VALUE win, property, type, size= Qnil, mode, src; if(6 == argc) rb_scan_args(argc, argv, "60", &win, &property, &type, &size, &mode, &src); else rb_scan_args(argc, argv, "50", &win, &property, &type, &mode, &src); rbgtk_atom2selectiondata(type, size, src, &ntype, &dat, &fmt, &len); gdk_property_change(GDK_WINDOW(RVAL2GOBJ(win)), RVAL2ATOM(property), ntype, fmt, RVAL2GENUM(mode, GDK_TYPE_PROP_MODE), dat, len); rbgtk_atom2selectiondata_free(ntype, dat); return self; } static VALUE rg_m_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { /* for argument processing */ GdkAtom rtype; gint rfmt, rlen; guchar* rdat; VALUE win, property, type, offset=INT2FIX(0), length=INT2FIX(9999), delete; /* for inner processing */ gint i; size_t j; VALUE ret = 0; if(6 == argc) rb_scan_args(argc, argv, "60", &win, &property, &type, &offset, &length, &delete); else rb_scan_args(argc, argv, "40", &win, &property, &type, &delete); if(gdk_property_get(GDK_WINDOW(RVAL2GOBJ(win)), RVAL2ATOM(property), RVAL2ATOM(type), NUM2INT(offset), NUM2INT(length), RVAL2CBOOL(delete), &rtype, &rfmt, &rlen, &rdat) == FALSE){ return Qnil; } switch(rfmt){ case 8: default: ret = RBG_STRING_SET_UTF8_ENCODING(rb_str_new((const char*)rdat, rlen)); break; case 16: ret = rb_ary_new(); for( i = 0; i < rlen; i++){ rb_ary_push(ret, rb_Integer(((unsigned short*)rdat)[i])); } break; case 32: ret = rb_ary_new(); if(rtype != GDK_SELECTION_TYPE_ATOM){ for(j = 0; j < (rlen/sizeof(unsigned long)); j++){ rb_ary_push(ret, INT2FIX(((unsigned long*)rdat)[j])); } } else { for(j = 0; j < (rlen/sizeof(unsigned long)); j++){ rb_ary_push(ret, BOXED2RVAL((GdkAtom)((unsigned long*)rdat)[j], GDK_TYPE_ATOM)); } } break; } return rb_ary_new3(3, BOXED2RVAL(rtype, GDK_TYPE_ATOM), ret, INT2NUM(rlen)); } static VALUE rg_m_delete(VALUE self, VALUE win, VALUE property) { gdk_property_delete(GDK_WINDOW(RVAL2GOBJ(win)), RVAL2ATOM(property)); return self; } void Init_gtk_gdk_property(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Property"); RG_DEF_MODFUNC(text_property_to_text_list, -1); RG_DEF_MODFUNC(text_property_to_utf8_list, -1); RG_DEF_MODFUNC(string_to_compound_text, -1); RG_DEF_MODFUNC(utf8_to_string_target, 1); RG_DEF_MODFUNC(utf8_to_compound_text, -1); RG_DEF_MODFUNC(change, -1); RG_DEF_MODFUNC(get, -1); RG_DEF_MODFUNC(delete, 2); /* GdkPropMode from GdkProperties */ G_DEF_CLASS(GDK_TYPE_PROP_MODE, "PropMode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_PROP_MODE, "GDK_PROP_"); } ������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdk.h���������������������������������������������������������0000644�0001750�0001750�00000005121�11701304107�016355� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RB_GDK_H__ #define __RB_GDK_H__ #include <rbgobject.h> #include <rbgtkmacros.h> #include <gdk/gdk.h> #include <rbgdkconversions.h> #ifdef GDK_WINDOWING_X11 # include <gdk/gdkx.h> #endif #ifdef GDK_WINDOWING_WIN32 # include <gdk/gdkwin32.h> #endif #define RVAL2GDKPOINTS(value, n) rbgdk_rval2gdkpoints(value, n) #define RVAL2GDKATOMS(value, n) rbgdk_rval2gdkatoms(value, n) #define RVAL2GDKPIXBUFGLIST(value) rbgdk_rval2gdkpixbufglist(value) #define GDK_BITMAP(b) ((GdkBitmap*)GDK_PIXMAP(b)) #define GEV2RVAL(ev) (make_gdkevent(ev)) #define RVAL2GEV(ev) (get_gdkevent(ev)) #define RVAL2ATOM(atom) (get_gdkatom(atom)) #define RVAL2GDKNATIVEWINDOW(value) ((GdkNativeWindow)NUM2UINT(value)) /* TODO: Will UINT2NUM work for pointers on 64-bit Windows? */ #define GDKNATIVEWINDOW2RVAL(value) UINT2NUM((guint32)value) #define GDK_TYPE_GEOMETRY (gdk_geometry_get_type()) #define GDK_TYPE_REGION (gdk_region_get_type()) #define GDK_TYPE_ATOM (gdk_atom_get_type()) #define GDK_TYPE_WINDOW_ATTR (gdk_windowattr_get_type()) #define GDK_TYPE_TIME_COORD (gdk_timecoord_get_type()) RUBY_GTK2_VAR VALUE mGdk; RUBY_GTK2_VAR VALUE rb_cGdkColor; typedef struct { GdkAtom atom; } GdkAtomData; GdkPoint *rbgdk_rval2gdkpoints(VALUE value, long *n); GdkAtom *rbgdk_rval2gdkatoms(VALUE value, long *n); GList *rbgdk_rval2gdkpixbufglist(VALUE value); extern GType gdk_windowattr_get_type(void); extern GType gdk_atom_get_type(void); extern GType gdk_geometry_get_type(void); extern GType gdk_region_get_type(void); extern GType gdk_timecoord_get_type(void); extern GdkAtom get_gdkatom(VALUE atom); extern VALUE make_gdkevent(GdkEvent* event); extern GdkEvent* get_gdkevent(VALUE event); #endif /* __RB_GDK_H__ */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfilechooserdialog.c����������������������������������������0000644�0001750�0001750�00000004447�12257552167�022027� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFileChooserDialog #define _SELF(self) GTK_FILE_CHOOSER_DIALOG(RVAL2GOBJ(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE title, parent, action, back, button_ary; GtkWidget* dialog; const gchar *gtitle; GtkWindow *gparent; GtkFileChooserAction gaction; const gchar *gback; rb_scan_args(argc, argv, "04*", &title, &parent, &action, &back, &button_ary); gtitle = NIL_P(title) ? NULL : RVAL2CSTR(title); gparent = NIL_P(parent) ? NULL : GTK_WINDOW(RVAL2GOBJ(parent)); gaction = NIL_P(action) ? GTK_FILE_CHOOSER_ACTION_OPEN : RVAL2GENUM(action, GTK_TYPE_FILE_CHOOSER_ACTION); gback = NIL_P(back) ? NULL : RVAL2CSTR(back); dialog = gtk_file_chooser_dialog_new_with_backend(gtitle, gparent, gaction, gback, NULL, NULL); RBGTK_INITIALIZE(self, dialog); rbgtk_dialog_add_buttons_internal(self, button_ary); return Qnil; } void Init_gtk_file_chooser_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_DIALOG, "FileChooserDialog", mGtk); RG_DEF_METHOD(initialize, -1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkoptionmenu.c�����������������������������������������������0000644�0001750�0001750�00000004034�11701304107�020510� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifndef GTK_DISABLE_DEPRECATED /* Since 2.4 */ #define RG_TARGET_NAMESPACE cOptionMenu static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_option_menu_new()); return Qnil; } static VALUE rg_remove_menu(VALUE self) { gtk_option_menu_remove_menu(GTK_OPTION_MENU(RVAL2GOBJ(self))); return self; } static VALUE rg_set_history(VALUE self, VALUE index) { gtk_option_menu_set_history(GTK_OPTION_MENU(RVAL2GOBJ(self)), NUM2INT(index)); return self; } static VALUE rg_history(VALUE self) { return INT2NUM(gtk_option_menu_get_history(GTK_OPTION_MENU(RVAL2GOBJ(self)))); } #endif void Init_gtk_option_menu(VALUE mGtk) { #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 } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreestore.c������������������������������������������������0000644�0001750�0001750�00000025436�12257552167�020362� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2012 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTreeStore #define _SELF(s) (GTK_TREE_STORE(RVAL2GOBJ(s))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { gint cnt; GtkTreeStore* store; GType* buf; if (argc == 0) rb_raise(rb_eArgError, "need more than 1 class type."); buf = ALLOCA_N(GType, argc); for (cnt = 0; cnt < argc; cnt++) { buf[cnt] = CLASS2GTYPE(argv[cnt]); } store = gtk_tree_store_newv(argc, buf); G_INITIALIZE(self, store); return Qnil; } static VALUE rg_set_column_types(int argc, VALUE *argv, VALUE self) { gint cnt; GType* buf; if (argc == 0) rb_raise(rb_eArgError, "need more than 1 class type."); buf = ALLOCA_N(GType, argc); for (cnt = 0; cnt < argc; cnt++) { buf[cnt] = CLASS2GTYPE(argv[cnt]); } gtk_tree_store_set_column_types(_SELF(self), argc, buf); return self; } static VALUE rg_set_value(VALUE self, VALUE iter, VALUE column, VALUE value) { GType gtype = gtk_tree_model_get_column_type(GTK_TREE_MODEL(RVAL2GOBJ(self)), NUM2INT(column)); GValue gval = G_VALUE_INIT; g_value_init(&gval, gtype); rbgobj_rvalue_to_gvalue(value, &gval); G_CHILD_ADD(self, iter); G_CHILD_ADD(iter, value); gtk_tree_store_set_value(_SELF(self), RVAL2GTKTREEITER(iter), NUM2INT(column), &gval); g_value_unset(&gval); return self; } /* void gtk_tree_store_set (GtkTreeStore *tree_store, GtkTreeIter *iter, ...); void gtk_tree_store_set_valist (GtkTreeStore *tree_store, GtkTreeIter *iter, va_list var_args); */ static VALUE rg_remove(VALUE self, VALUE iter) { G_CHILD_REMOVE(self, iter); return CBOOL2RVAL(gtk_tree_store_remove(_SELF(self), RVAL2GTKTREEITER(iter))); } static VALUE rg_insert(int argc, VALUE *argv, VALUE self) { VALUE parent, position, values, ret; GtkTreeIter iter; GtkTreeStore* model = _SELF(self); rb_scan_args(argc, argv, "21", &parent, &position, &values); if (NIL_P(values)){ gtk_tree_store_insert(model, &iter, NIL_P(parent) ? NULL : RVAL2GTKTREEITER(parent), NUM2INT(position)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); } else { gint *c_columns; GValue *c_values; long size, i; size = NUM2INT(rb_funcall(values, rb_intern("size"), 0)); c_columns = ALLOCA_N(gint, size); c_values = ALLOCA_N(GValue, size); if(TYPE(values)==T_ARRAY) { for(i=0; i<size; i++) { GType gtype; GValue gval = G_VALUE_INIT; c_columns[i] = i; gtype = gtk_tree_model_get_column_type(GTK_TREE_MODEL(RVAL2GOBJ(self)), c_columns[i]); g_value_init(&gval, gtype); rbgobj_rvalue_to_gvalue(rb_ary_shift(values), &gval); c_values[i] = gval; } } else if(TYPE(values)==T_HASH) { VALUE r_columns; r_columns = rb_funcall(values, rb_intern("keys"), 0); for(i=0; i<size; i++) { GType gtype; GValue gval = G_VALUE_INIT; c_columns[i] = NUM2INT (rb_ary_entry(r_columns, i)); gtype = gtk_tree_model_get_column_type(GTK_TREE_MODEL(RVAL2GOBJ(self)), c_columns[i]); g_value_init(&gval, gtype); rbgobj_rvalue_to_gvalue(rb_hash_aref(values, INT2NUM(c_columns[i])), &gval); c_values[i] = gval; } } else { rb_raise(rb_eArgError, "values must be of type Hash or Array"); } gtk_tree_store_insert_with_valuesv(model, &iter, NIL_P(parent) ? NULL : RVAL2GTKTREEITER(parent), NUM2INT(position), c_columns, c_values, size); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); for(i=0; i<size; i++) { G_CHILD_ADD(ret, rbgobj_gvalue_to_rvalue(&(c_values[i]))); g_value_unset(&(c_values[i])); } } return ret; } static VALUE rg_insert_before(VALUE self, VALUE parent, VALUE sibling) { VALUE ret; GtkTreeIter iter; GtkTreeStore* model = _SELF(self); gtk_tree_store_insert_before(model, &iter, NIL_P(parent) ? NULL : RVAL2GTKTREEITER(parent), NIL_P(sibling) ? NULL : RVAL2GTKTREEITER(sibling)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_insert_after(VALUE self, VALUE parent, VALUE sibling) { VALUE ret; GtkTreeIter iter; GtkTreeStore* model = _SELF(self); gtk_tree_store_insert_after(model, &iter, NIL_P(parent) ? NULL : RVAL2GTKTREEITER(parent), NIL_P(sibling) ? NULL : RVAL2GTKTREEITER(sibling)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); return ret; } /* The 2 following functions where implemented as TreeStore#insert which will use a Hash instead of pairs of parameters void gtk_tree_store_insert_with_values (GtkTreeStore *tree_store, GtkTreeIter *iter, GtkTreeIter *parent, gint position, ...); void gtk_tree_store_insert_with_valuesv (GtkTreeStore *tree_store, GtkTreeIter *iter, GtkTreeIter *parent, gint position, gint *columns, GValue *values, gint n_values); */ static VALUE rg_prepend(VALUE self, VALUE parent) { VALUE ret; GtkTreeIter iter; GtkTreeStore* model = _SELF(self); gtk_tree_store_prepend(model, &iter, NIL_P(parent)?NULL:RVAL2GTKTREEITER(parent)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_append(VALUE self, VALUE parent) { VALUE ret; GtkTreeIter iter; GtkTreeStore* model = _SELF(self); gtk_tree_store_append(model, &iter, NIL_P(parent)?NULL:RVAL2GTKTREEITER(parent)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_ancestor_p(VALUE self, VALUE iter, VALUE descendant) { return gtk_tree_store_is_ancestor(_SELF(self), RVAL2GTKTREEITER(iter), RVAL2GTKTREEITER(descendant)); } static VALUE rg_iter_depth(VALUE self, VALUE iter) { return INT2NUM(gtk_tree_store_iter_depth(_SELF(self), RVAL2GTKTREEITER(iter))); } static VALUE rg_clear(VALUE self) { G_CHILD_REMOVE_ALL(self); gtk_tree_store_clear(_SELF(self)); return self; } static VALUE rg_iter_is_valid_p(VALUE self, VALUE iter) { return (NIL_P(iter)) ? Qfalse : CBOOL2RVAL(gtk_tree_store_iter_is_valid(_SELF(self), RVAL2GTKTREEITER(iter))); } static VALUE rg_reorder(VALUE self, VALUE rbparent, VALUE rbnew_order) { GtkTreeStore *store = _SELF(self); GtkTreeIter *parent = RVAL2GTKTREEITER(rbparent); gint n_children = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), parent); long n; gint *new_order = RVAL2GINTS(rbnew_order, n); if (n != n_children) { g_free(new_order); rb_raise(rb_eArgError, "new order array must contain the same number of elements as the number of children in the parent: %ld != %d", n, n_children); } gtk_tree_store_reorder(store, parent, new_order); g_free(new_order); return self; } static VALUE rg_swap(VALUE self, VALUE iter1, VALUE iter2) { gtk_tree_store_swap(_SELF(self), RVAL2GTKTREEITER(iter1), RVAL2GTKTREEITER(iter2)); return self; } static VALUE rg_move_before(VALUE self, VALUE iter, VALUE position) { gtk_tree_store_move_before(_SELF(self), RVAL2GTKTREEITER(iter), NIL_P(position) ? NULL : RVAL2GTKTREEITER(position)); return self; } static VALUE rg_move_after(VALUE self, VALUE iter, VALUE position) { gtk_tree_store_move_after(_SELF(self), RVAL2GTKTREEITER(iter), NIL_P(position) ? NULL : RVAL2GTKTREEITER(position)); return self; } void Init_gtk_tree_store(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_STORE, "TreeStore", mGtk); rbgtk_register_treeiter_set_value_func(GTK_TYPE_TREE_STORE, (rbgtkiter_set_value_func)>k_tree_store_set_value); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_column_types, -1); RG_DEF_METHOD(set_value, 3); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(insert, -1); RG_DEF_METHOD(insert_before, 2); RG_DEF_METHOD(insert_after, 2); RG_DEF_METHOD(prepend, 1); RG_DEF_METHOD(append, 1); RG_DEF_METHOD_P(ancestor, 2); RG_DEF_METHOD(iter_depth, 1); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD_P(iter_is_valid, 1); RG_DEF_METHOD(reorder, 2); RG_DEF_METHOD(swap, 2); RG_DEF_METHOD(move_before, 2); RG_DEF_METHOD(move_after, 2); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkvpaned.c���������������������������������������������������0000644�0001750�0001750�00000002543�11701304107�017573� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cVPaned static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_vpaned_new()); return Qnil; } void Init_gtk_vpaned(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VPANED, "VPaned", mGtk); RG_DEF_METHOD(initialize, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkthreads.c��������������������������������������������������0000644�0001750�0001750�00000003500�11701304107�017722� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef G_THREADS_ENABLED #define RG_TARGET_NAMESPACE mThreads static VALUE rg_m_init(VALUE self) { #ifndef GDK_WINDOWING_WIN32 if (!g_thread_supported()){ g_thread_init(NULL); } gdk_threads_init(); #endif return self; } static VALUE rg_m_enter(VALUE self) { gdk_threads_enter(); return self; } static VALUE rg_m_leave(VALUE self) { gdk_threads_leave(); return self; } static VALUE rg_m_synchronize(G_GNUC_UNUSED VALUE self) { VALUE func = rb_block_proc(); gdk_threads_enter(); func = rb_block_proc(); rb_funcall(func, id_call, 0); gdk_threads_leave(); return Qnil; } #endif void Init_gtk_gdk_threads(VALUE mGdk) { #ifdef G_THREADS_ENABLED VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Threads"); RG_DEF_MODFUNC(init, 0); RG_DEF_MODFUNC(enter, 0); RG_DEF_MODFUNC(leave, 0); RG_DEF_MODFUNC(synchronize, 0); #endif } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/extconf.rb������������������������������������������������������0000644�0001750�0001750�00000007607�12257552167�017143� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin extconf.rb for Ruby/GTK extention library =end require 'pathname' source_dir = Pathname(__FILE__).dirname base_dir = source_dir.parent.parent.expand_path top_dir = base_dir.parent.expand_path top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "gtk2" package_id = "gtk+-2.0" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end have_func("rb_errinfo") ["glib2", "atk", "pango", "gdk_pixbuf2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end rcairo_options = {} rcairo_source_dir_names = ["rcairo"] if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM rcairo_source_dir_names.unshift("rcairo.win32") end rcairo_source_dir_names.each do |rcairo_source_dir_name| rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name if rcairo_source_dir.exist? rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s break end end unless check_cairo(rcairo_options) exit(false) end setup_win32(module_name, base_dir) unless required_pkg_config_package([package_id, 2, 10, 0], :debian => "libgtk2.0-dev", :redhat => "gtk2-devel", :homebrew => "gtk+", :macports => "gtk2") exit(false) end have_header("st.h") have_header("ruby/st.h") STDOUT.print("checking for target... ") STDOUT.flush target = PKGConfig.variable(package_id, "target") $defs << "-DRUBY_GTK2_TARGET=\\\"#{target}\\\"" STDOUT.print(target, "\n") gdk_include_path = nil include_paths = $CFLAGS.gsub(/-D\w+/, '').split(/-I/) + ['/usr/include'] include_paths.each do |path| path.strip! if FileTest.exist?("#{path}/gdk/gdkkeysyms.h") gdk_include_path = Pathname("#{path}/gdk") break end end raise "can't find gdkkeysyms.h" if gdk_include_path.nil? gtk_header = "gtk/gtk.h" have_func('gtk_plug_get_type', gtk_header) have_func('gtk_socket_get_type', gtk_header) have_func('pango_render_part_get_type', gtk_header) have_header('gtk/gtkfilesystem.h') do |src| "#define GTK_FILE_SYSTEM_ENABLE_UNSUPPORTED\n#{src}" end xlib_header = "X11/Xlib.h" if target == "x11" and have_header('X11/Xlib.h') and have_library("X11") have_func("XReadBitmapFileData", xlib_header) have_func("XGetErrorText", xlib_header) end if target != "win32" and PKGConfig.have_package('gtk+-unix-print-2.0') $defs.push("-DHAVE_GTK_UNIX_PRINT") end create_pkg_config_file("Ruby/GTK2", package_id, ruby_gnome2_version) rbgdkkeysyms_h_path = Pathname("rbgdkkeysyms.h") gdkkeysyms_h_paths = [] gdkkeysyms_h_paths << gdk_include_path + "gdkkeysyms.h" gdkkeysyms_h_paths << gdk_include_path + "gdkkeysyms-compat.h" rbgdkkeysyms_h_path.open("w") do |rbgdkkeysyms_h| gdkkeysyms_h_paths.each do |path| next unless path.exist? path.each_line do |line| if /^#define\s+(GDK_\w+)\s+\d+/ =~ line define_line = "rb_define_const(mGdkKeyval, \"#{$1}\", INT2FIX(#{$1}));" rbgdkkeysyms_h.puts(define_line) end end end end add_distcleanfile("rbgdkkeysyms.h") ensure_objs $defs << "-DRUBY_GTK2_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end �������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkhpaned.c���������������������������������������������������0000644�0001750�0001750�00000002543�11701304107�017555� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cHPaned static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_hpaned_new()); return Qnil; } void Init_gtk_hpaned(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HPANED, "HPaned", mGtk); RG_DEF_METHOD(initialize, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkpaned.c����������������������������������������������������0000644�0001750�0001750�00000005673�11701304107�017414� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cPaned #define _SELF(self) (GTK_PANED(RVAL2GOBJ(self))) #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) static VALUE rg_add1(VALUE self, VALUE child) { gtk_paned_add1(_SELF(self), RVAL2WIDGET(child)); return self; } static VALUE rg_add2(VALUE self, VALUE child) { gtk_paned_add2(_SELF(self), RVAL2WIDGET(child)); return self; } static VALUE rg_pack1(VALUE self, VALUE child, VALUE resize, VALUE shrink) { gtk_paned_pack1(_SELF(self), RVAL2WIDGET(child), RVAL2CBOOL(resize), RVAL2CBOOL(shrink)); return self; } static VALUE rg_pack2(VALUE self, VALUE child, VALUE resize, VALUE shrink) { gtk_paned_pack2(_SELF(self), RVAL2WIDGET(child), RVAL2CBOOL(resize), RVAL2CBOOL(shrink)); return self; } static VALUE rg_child1(VALUE self) { GtkWidget *child = _SELF(self)->child1; return (child == NULL) ? Qnil : GOBJ2RVAL(child); } static VALUE rg_child2(VALUE self) { GtkWidget *child = _SELF(self)->child2; return (child == NULL) ? Qnil : GOBJ2RVAL(child); } static VALUE rg_child1_resize_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->child1_resize); } static VALUE rg_child1_shrink_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->child1_shrink); } static VALUE rg_child2_resize_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->child2_resize); } static VALUE rg_child2_shrink_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->child2_shrink); } void Init_gtk_paned(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PANED, "Paned", mGtk); RG_DEF_METHOD(add1, 1); RG_DEF_METHOD(add2, 1); RG_DEF_METHOD(pack1, 3); RG_DEF_METHOD(pack2, 3); RG_DEF_METHOD(child1, 0); RG_DEF_METHOD(child2, 0); RG_DEF_METHOD_P(child1_resize, 0); RG_DEF_METHOD_P(child1_shrink, 0); RG_DEF_METHOD_P(child2_resize, 0); RG_DEF_METHOD_P(child2_shrink, 0); } ���������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkstatusicon.c�����������������������������������������������0000644�0001750�0001750�00000005642�12257552167�020537� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cStatusIcon #define _SELF(w) (GTK_STATUS_ICON(RVAL2GOBJ(w))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_status_icon_new()); return Qnil; } /* Don't implement this. Use Gtk::StatusIcon.new.set_foo(v) instead. GtkStatusIcon* gtk_status_icon_new_from_pixbuf (GdkPixbuf *pixbuf); GtkStatusIcon* gtk_status_icon_new_from_file (const gchar *filename); GtkStatusIcon* gtk_status_icon_new_from_stock (const gchar *stock_id); GtkStatusIcon* gtk_status_icon_new_from_icon_name (const gchar *icon_name); */ static VALUE rg_set_tooltip(VALUE self, VALUE tooltip_text) { gtk_status_icon_set_tooltip(_SELF(self), RVAL2CSTR(tooltip_text)); return self; } static VALUE rg_position_menu(VALUE self, VALUE menu) { gint x, y; gboolean push_in; gtk_status_icon_position_menu(GTK_MENU(RVAL2GOBJ(menu)), &x, &y, &push_in, (gpointer)(_SELF(self))); return rb_ary_new3(3, INT2NUM(x), INT2NUM(y), CBOOL2RVAL(push_in)); } static VALUE rg_geometry(VALUE self) { GdkScreen* screen; GdkRectangle area; GtkOrientation orientation; gboolean ret = gtk_status_icon_get_geometry(_SELF(self), &screen, &area, &orientation); if (ret) { return rb_ary_new3(3, GOBJ2RVAL(screen), BOXED2RVAL(&area, GDK_TYPE_RECTANGLE), GENUM2RVAL(orientation, GTK_TYPE_ORIENTATION)); } else { return rb_ary_new3(3, Qnil, Qnil, Qnil); } } void Init_gtk_status_icon(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_STATUS_ICON, "StatusIcon", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_tooltip, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "tooltip"); RG_DEF_METHOD(position_menu, 1); RG_DEF_METHOD(geometry, 0); } ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkruler.c����������������������������������������������������0000644�0001750�0001750�00000004237�11701304107�017451� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRuler #define _SELF(self) (GTK_RULER(RVAL2GOBJ(self))) static VALUE rg_set_range(VALUE self, VALUE lower, VALUE upper, VALUE position, VALUE max_size) { gtk_ruler_set_range(_SELF(self), NUM2DBL(lower), NUM2DBL(upper), NUM2DBL(position), NUM2DBL(max_size)); return self; } static VALUE rg_range(VALUE self) { gdouble lower, upper, position, max_size; gtk_ruler_get_range(_SELF(self), &lower, &upper, &position, &max_size); return rb_ary_new3(4, rb_float_new(lower), rb_float_new(upper), rb_float_new(position), rb_float_new(max_size)); } static VALUE rg_draw_ticks(VALUE self) { gtk_ruler_draw_ticks(_SELF(self)); return self; } static VALUE rg_draw_pos(VALUE self) { gtk_ruler_draw_pos(_SELF(self)); return self; } 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); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkmenushell.c������������������������������������������������0000644�0001750�0001750�00000006047�12257552167�020337� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cMenuShell #define _SELF(self) (GTK_MENU_SHELL(RVAL2GOBJ(self))) #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) static VALUE rg_append(VALUE self, VALUE child) { gtk_menu_shell_append(_SELF(self),RVAL2WIDGET(child)); G_CHILD_ADD(self, child); return self; } static VALUE rg_prepend(VALUE self, VALUE child) { gtk_menu_shell_prepend(_SELF(self), RVAL2WIDGET(child)); G_CHILD_ADD(self, child); return self; } static VALUE rg_insert(VALUE self, VALUE child, VALUE pos) { gtk_menu_shell_insert(_SELF(self), RVAL2WIDGET(child), NUM2INT(pos)); G_CHILD_ADD(self, child); return self; } static VALUE rg_deactivate(VALUE self) { gtk_menu_shell_deactivate(_SELF(self)); return self; } static VALUE rg_select_item(VALUE self, VALUE menu_item) { gtk_menu_shell_select_item(_SELF(self), RVAL2WIDGET(menu_item)); return self; } static VALUE rg_select_first(VALUE self, VALUE search_sensitive) { gtk_menu_shell_select_first(_SELF(self), RVAL2CBOOL(search_sensitive)); return self; } static VALUE rg_deselect(VALUE self) { gtk_menu_shell_deselect(_SELF(self)); return self; } static VALUE rg_activate_item(VALUE self, VALUE menu_item, VALUE force_deactivate) { gtk_menu_shell_activate_item(_SELF(self), RVAL2WIDGET(menu_item), RVAL2CBOOL(force_deactivate)); return self; } void Init_gtk_menu_shell(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU_SHELL, "MenuShell", mGtk); RG_DEF_METHOD(append, 1); RG_DEF_METHOD(prepend, 1); RG_DEF_METHOD(insert, 2); RG_DEF_METHOD(deactivate, 0); RG_DEF_METHOD(select_item, 1); RG_DEF_METHOD(select_first, 1); RG_DEF_METHOD(deselect, 0); RG_DEF_METHOD(activate_item, 2); /* GtkMenuDirectionType */ G_DEF_CLASS(GTK_TYPE_MENU_DIRECTION_TYPE, "DirectionType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_MENU_DIRECTION_TYPE, "GTK_MENU_"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkvbbox.c����������������������������������������������������0000644�0001750�0001750�00000002572�11701304107�017440� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cVButtonBox static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_vbutton_box_new()); return Qnil; } void Init_gtk_vbutton_box(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VBUTTON_BOX, "VButtonBox", mGtk); RG_DEF_METHOD(initialize, 0); } ��������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkradiomenuitem.c��������������������������������������������0000644�0001750�0001750�00000011100�11701304107�021145� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi, * dellin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRadioMenuItem struct rbgtk_rval2gtkradiomenuitemgslist_args { VALUE ary; long n; GSList *result; }; static VALUE rbgtk_rval2gtkradiomenuitemgslist_body(VALUE value) { long i; struct rbgtk_rval2gtkradiomenuitemgslist_args *args = (struct rbgtk_rval2gtkradiomenuitemgslist_args *)value; for (i = 0; i < args->n; i++) args->result = g_slist_append(args->result, GTK_RADIO_MENU_ITEM(RVAL2GOBJ(RARRAY_PTR(args->ary)[i]))); return Qnil; } static G_GNUC_NORETURN VALUE rbgtk_rval2gtkradiomenuitemgslist_rescue(VALUE value) { g_slist_free(((struct rbgtk_rval2gtkradiomenuitemgslist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GSList * rbgtk_rval2gtkradiomenuitemgslist(VALUE value) { struct rbgtk_rval2gtkradiomenuitemgslist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgtk_rval2gtkradiomenuitemgslist_body, (VALUE)&args, rbgtk_rval2gtkradiomenuitemgslist_rescue, (VALUE)&args); return args.result; } #define RVAL2GTKRADIOMENUITEMGSLIST(value) rbgtk_rval2gtkradiomenuitemgslist(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2, arg3; GtkWidget *widget; GSList *list = NULL; const gchar *label = NULL; const gchar *mnemonic = NULL; if (rb_scan_args(argc, argv, "03", &arg1, &arg2, &arg3) > 0 && TYPE(arg1) == T_STRING) { if (NIL_P(arg2) || RVAL2CBOOL(arg2)) mnemonic = RVAL2CSTR(arg1); else label = RVAL2CSTR(arg1); } else { if (!NIL_P(arg2)) { if (NIL_P(arg3) || RVAL2CBOOL(arg3)) mnemonic = RVAL2CSTR(arg2); else label = RVAL2CSTR(arg2); } if (rb_obj_is_kind_of(arg1, GTYPE2CLASS(GTK_TYPE_RADIO_MENU_ITEM))) list = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(RVAL2GOBJ(arg1))); else if (TYPE(arg1) == T_ARRAY) /* TODO: This might leak. */ list = RVAL2GTKRADIOMENUITEMGSLIST(arg1); else if (!NIL_P(arg1)) rb_raise(rb_eArgError, "invalid argument %s (expect Array or Gtk::RadioMenuItem)", rb_class2name(CLASS_OF(arg1))); } if (label != NULL) widget = gtk_radio_menu_item_new_with_label(list, label); else if (mnemonic != NULL) widget = gtk_radio_menu_item_new_with_mnemonic(list, mnemonic); else widget = gtk_radio_menu_item_new(list); RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rmitem_get_group(VALUE self) { /* Owened by GTK+ */ return GSLIST2ARY(gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(RVAL2GOBJ(self)))); } static VALUE rmitem_set_group(VALUE self, VALUE grp_ary) { GtkRadioMenuItem *rmitem2add, *rmitem_orig; GSList *group; rmitem2add = GTK_RADIO_MENU_ITEM(RVAL2GOBJ(self)); rmitem_orig = GTK_RADIO_MENU_ITEM(RVAL2GOBJ(rb_ary_entry(grp_ary, 0))); group = gtk_radio_menu_item_group(rmitem_orig); gtk_radio_menu_item_set_group(rmitem2add, group); return GSLIST2ARY(gtk_radio_menu_item_get_group(rmitem2add)); } void Init_gtk_radio_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RADIO_MENU_ITEM, "RadioMenuItem", mGtk); RG_DEF_METHOD(initialize, -1); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "group", rmitem_get_group, 0); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "group", rmitem_set_group, 1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcellrenderertext.c�����������������������������������������0000644�0001750�0001750�00000003156�11701304107�021672� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCellRendererText #define _SELF(s) (GTK_CELL_RENDERER_TEXT(RVAL2GOBJ(s))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_text_new()); return Qnil; } static VALUE rg_set_fixed_height_from_font(VALUE self, VALUE number_of_rows) { gtk_cell_renderer_text_set_fixed_height_from_font(_SELF(self), NUM2INT(number_of_rows)); return self; } void Init_gtk_cellrenderertext(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_TEXT, "CellRendererText", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_fixed_height_from_font, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "fixed_height_from_font"); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkaccelgroupentry.c������������������������������������������0000644�0001750�0001750�00000005162�12124610262�021526� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAccelGroupEntry #define _SELF(s) ((GtkAccelGroupEntry*)RVAL2BOXED(s, GTK_TYPE_ACCEL_GROUP_ENTRY)) static GtkAccelGroupEntry * agentry_copy(const GtkAccelGroupEntry *agentry) { GtkAccelGroupEntry *new_agentry; g_return_val_if_fail (agentry != NULL, NULL); new_agentry = g_new(GtkAccelGroupEntry, 1); *new_agentry = *agentry; return new_agentry; } GType gtk_accel_group_entry_get_type(void) { static GType our_type = 0; if(our_type == 0) our_type = g_boxed_type_register_static("GtkAccelGroupEntry", (GBoxedCopyFunc)agentry_copy, (GBoxedFreeFunc)g_free); return our_type; } /* struct _GtkAccelGroupEntry { GtkAccelKey key; GClosure *closure; GQuark accel_path_quark; }; */ static VALUE rg_initialize(VALUE self) { GtkAccelGroupEntry key; memset(&key, 0, sizeof(GtkAccelGroupEntry)); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_ACCEL_GROUP_ENTRY, &key)); return Qnil; } static VALUE rg_accel_key(VALUE self) { return BOXED2RVAL(&_SELF(self)->key, GTK_TYPE_ACCEL_KEY); } static VALUE rg_closure(VALUE self) { return BOXED2RVAL(_SELF(self)->closure, G_TYPE_CLOSURE); } static VALUE rg_accel_path(VALUE self) { const gchar *quark_str = g_quark_to_string(_SELF(self)->accel_path_quark); return quark_str ? CSTR2RVAL(quark_str) : Qnil; } void Init_gtk_accel_group_entry(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCEL_GROUP_ENTRY, "AccelGroupEntry", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(accel_key, 0); RG_DEF_METHOD(closure, 0); RG_DEF_METHOD(accel_path, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkiconsource.c�����������������������������������������������0000644�0001750�0001750�00000010442�11701304107�020464� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cIconSource #define _SELF(s) ((GtkIconSource*)RVAL2BOXED(s, GTK_TYPE_ICON_SOURCE)) static VALUE rg_initialize(VALUE self) { GtkIconSource *icon_source; icon_source = gtk_icon_source_new(); G_INITIALIZE(self, icon_source); return Qnil; } static VALUE rg_direction(VALUE self) { return GENUM2RVAL(gtk_icon_source_get_direction(_SELF(self)), GTK_TYPE_TEXT_DIRECTION); } static VALUE rg_direction_wildcarded_p(VALUE self) { return CBOOL2RVAL(gtk_icon_source_get_direction_wildcarded(_SELF(self))); } static VALUE rg_filename(VALUE self) { return CSTR2RVAL(gtk_icon_source_get_filename(_SELF(self))); } static VALUE rg_pixbuf(VALUE self) { GdkPixbuf *pixbuf; pixbuf = gtk_icon_source_get_pixbuf(_SELF(self)); return pixbuf ? GOBJ2RVAL(pixbuf) : Qnil; } static VALUE rg_size(VALUE self) { return GENUM2RVAL(gtk_icon_source_get_size(_SELF(self)), GTK_TYPE_ICON_SIZE); } static VALUE rg_size_wildcarded_p(VALUE self) { return CBOOL2RVAL(gtk_icon_source_get_size_wildcarded(_SELF(self))); } static VALUE rg_state(VALUE self) { return GENUM2RVAL(gtk_icon_source_get_state(_SELF(self)), GTK_TYPE_STATE_TYPE); } static VALUE rg_state_wildcarded_p(VALUE self) { return CBOOL2RVAL(gtk_icon_source_get_state_wildcarded(_SELF(self))); } static VALUE rg_set_direction(VALUE self, VALUE direction) { gtk_icon_source_set_direction(_SELF(self), RVAL2GENUM(direction, GTK_TYPE_TEXT_DIRECTION)); return self; } static VALUE rg_set_direction_wildcarded(VALUE self, VALUE setting) { gtk_icon_source_set_direction_wildcarded(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_set_filename(VALUE self, VALUE filename) { gtk_icon_source_set_filename(_SELF(self), RVAL2CSTR(filename)); return self; } static VALUE rg_set_pixbuf(VALUE self, VALUE pixbuf) { gtk_icon_source_set_pixbuf(_SELF(self), GDK_PIXBUF(RVAL2GOBJ(pixbuf))); return self; } static VALUE rg_set_size(VALUE self, VALUE size) { gtk_icon_source_set_size(_SELF(self), RVAL2GENUM(size, GTK_TYPE_ICON_SIZE)); return self; } static VALUE rg_set_size_wildcarded(VALUE self, VALUE setting) { gtk_icon_source_set_size_wildcarded(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_set_state(VALUE self, VALUE state) { gtk_icon_source_set_state(_SELF(self), RVAL2GENUM(state, GTK_TYPE_STATE_TYPE)); return self; } static VALUE rg_set_state_wildcarded(VALUE self, VALUE setting) { gtk_icon_source_set_state_wildcarded(_SELF(self), RVAL2CBOOL(setting)); return self; } void Init_gtk_icon_source(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_SOURCE, "IconSource", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(direction, 0); RG_DEF_METHOD_P(direction_wildcarded, 0); RG_DEF_METHOD(filename, 0); RG_DEF_METHOD(pixbuf, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD_P(size_wildcarded, 0); RG_DEF_METHOD(state, 0); RG_DEF_METHOD_P(state_wildcarded, 0); RG_DEF_METHOD(set_direction, 1); RG_DEF_METHOD(set_direction_wildcarded, 1); RG_DEF_METHOD(set_filename, 1); RG_DEF_METHOD(set_pixbuf, 1); RG_DEF_METHOD(set_size, 1); RG_DEF_METHOD(set_size_wildcarded, 1); RG_DEF_METHOD(set_state, 1); RG_DEF_METHOD(set_state_wildcarded, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkhruler.c���������������������������������������������������0000644�0001750�0001750�00000002543�11701304107�017617� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cHRuler static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_hruler_new()); return Qnil; } void Init_gtk_hruler(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HRULER, "HRuler", mGtk); RG_DEF_METHOD(initialize, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcelleditable.c���������������������������������������������0000644�0001750�0001750�00000003253�11701304107�020726� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mCellEditable #define _SELF(s) (GTK_CELL_EDITABLE(RVAL2GOBJ(s))) static VALUE rg_start_editing(VALUE self, VALUE event) { gtk_cell_editable_start_editing(_SELF(self), NIL_P(event) ? NULL : RVAL2GEV(event)); return self; } static VALUE rg_editing_done(VALUE self) { gtk_cell_editable_editing_done(_SELF(self)); return self; } static VALUE rg_remove_widget(VALUE self) { gtk_cell_editable_remove_widget(_SELF(self)); return self; } void Init_gtk_celleditable(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_CELL_EDITABLE, "CellEditable", mGtk); RG_DEF_METHOD(start_editing, 1); RG_DEF_METHOD(editing_done, 0); RG_DEF_METHOD(remove_widget, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcellview.c�������������������������������������������������0000644�0001750�0001750�00000007140�12257552167�020150� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005,2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCellView #define _SELF(self) (GTK_CELL_VIEW(RVAL2GOBJ(self))) static ID id_model; static ID id_text; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE text; VALUE with_markup = Qnil; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "02", &text, &with_markup); if (NIL_P(text)) { widget = gtk_cell_view_new(); } else { G_CHILD_SET(self, id_text, text); if (TYPE(text) == T_STRING){ if (NIL_P(with_markup) || RVAL2CBOOL(with_markup)){ widget = gtk_cell_view_new_with_markup(RVAL2CSTR(text)); } else { widget = gtk_cell_view_new_with_text(RVAL2CSTR(text)); } } else if (rb_obj_is_kind_of(text, GTYPE2CLASS(GDK_TYPE_PIXBUF))){ widget = gtk_cell_view_new_with_pixbuf(GDK_PIXBUF(RVAL2GOBJ(text))); } else { rb_raise(rb_eArgError, "invalid argument %s (expect String or Gdk::Pixbuf)", rb_class2name(CLASS_OF(text))); } } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_set_displayed_row(VALUE self, VALUE path) { gtk_cell_view_set_displayed_row(_SELF(self), NIL_P(path) ? (GtkTreePath*)NULL : RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_displayed_row(VALUE self) { return GTKTREEPATH2RVAL(gtk_cell_view_get_displayed_row(_SELF(self))); } static VALUE rg_get_size_of_row(VALUE self, VALUE path) { GtkRequisition req; gboolean ret = gtk_cell_view_get_size_of_row(_SELF(self), RVAL2GTKTREEPATH(path), &req); if (! ret) rb_raise(rb_eRuntimeError, "Can't get the value"); return rb_ary_assoc(INT2NUM(req.width), INT2NUM(req.height)); } /* Use Gtk::CellView#background_gdk(Gdk::Color) instead. void gtk_cell_view_set_background_color (GtkCellView *cell_view, const GdkColor *color); */ static VALUE rg_cell_renderers(VALUE self) { return GLIST2ARYF(gtk_cell_view_get_cell_renderers(_SELF(self))); } 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); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkliststore.c������������������������������������������������0000644�0001750�0001750�00000024577�12257552167�020403� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cListStore #define _SELF(s) (GTK_LIST_STORE(RVAL2GOBJ(s))) static ID id_to_a, id_size; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { gint cnt; GtkListStore* store; GType* buf; if (argc == 0) rb_raise(rb_eArgError, "need more than 1 class type."); buf = ALLOCA_N(GType, argc); for (cnt = 0; cnt < argc; cnt++) { buf[cnt] = CLASS2GTYPE(argv[cnt]); } store = gtk_list_store_newv(argc, buf); G_INITIALIZE(self, store); return Qnil; } static VALUE rg_set_column_types(int argc, VALUE *argv, VALUE self) { gint cnt; GType* buf; if (argc == 0) rb_raise(rb_eArgError, "need more than 1 class type."); buf = ALLOCA_N(GType, argc); for (cnt = 0; cnt < argc; cnt++) { buf[cnt] = CLASS2GTYPE(argv[cnt]); } gtk_list_store_set_column_types(_SELF(self), argc, buf); return self; } static VALUE rg_set_value(VALUE self, VALUE iter, VALUE column, VALUE value) { GType gtype = gtk_tree_model_get_column_type(GTK_TREE_MODEL(RVAL2GOBJ(self)), NUM2INT(column)); GValue gval = G_VALUE_INIT; g_value_init(&gval, gtype); rbgobj_rvalue_to_gvalue(value, &gval); G_CHILD_ADD(iter, value); gtk_list_store_set_value(_SELF(self), RVAL2GTKTREEITER(iter), NUM2INT(column), &gval); g_value_unset(&gval); return self; } #if GTK_CHECK_VERSION(2, 12, 0) typedef struct _ValuesInfo { gint i; VALUE iter; GtkTreeModel *model; gint *g_columns; GValue *g_values; } ValuesInfo; static int collect_value(VALUE key, VALUE value, ValuesInfo *info) { GType g_type; gint column; column = NUM2INT(key); info->g_columns[info->i] = column; g_type = gtk_tree_model_get_column_type(info->model, column); g_value_init(&(info->g_values[info->i]), g_type); rbgobj_rvalue_to_gvalue(value, &(info->g_values[info->i])); G_CHILD_ADD(info->iter, value); info->i++; return ST_CONTINUE; } static void hash_to_values(VALUE hash, VALUE iter, GtkTreeModel *model, gint *g_columns, GValue *g_values, G_GNUC_UNUSED gint length) { ValuesInfo info; info.i = 0; info.iter = iter; info.model = model; info.g_columns = g_columns; info.g_values = g_values; rb_hash_foreach(hash, collect_value, (VALUE)(&info)); } static void array_to_values(VALUE array, VALUE iter, GtkTreeModel *model, gint *g_columns, GValue *g_values, gint length) { gint i; for (i = 0; i < length; i++) { GType g_type; g_columns[i] = i; g_type = gtk_tree_model_get_column_type(model, i); g_value_init(&g_values[i], g_type); rbgobj_rvalue_to_gvalue(RARRAY_PTR(array)[i], &g_values[i]); G_CHILD_ADD(iter, RARRAY_PTR(array)[i]); } } static VALUE rg_set_values(VALUE self, VALUE iter, VALUE values) { GValue *g_values; GtkListStore *store; GtkTreeModel *model; gint *g_columns; gint i, length; length = NUM2INT(rb_funcall(values, id_size, 0)); if (length == 0) return self; g_columns = ALLOCA_N(gint, length); g_values = ALLOCA_N(GValue, length); MEMZERO(g_values, GValue, length); store = _SELF(self); model = GTK_TREE_MODEL(store); if (RVAL2CBOOL(rb_obj_is_kind_of(values, rb_cHash))) { hash_to_values(values, iter, model, g_columns, g_values, length); } else if (RVAL2CBOOL(rb_obj_is_kind_of(values, rb_cArray))) { array_to_values(values, iter, model, g_columns, g_values, length); } else { rb_raise(rb_eArgError, "must be array or hash of values"); } gtk_list_store_set_valuesv(store, RVAL2GTKTREEITER(iter), g_columns, g_values, length); for (i = 0; i < length; i++) g_value_unset(&g_values[i]); return self; } #endif /* void gtk_tree_store_set (GtkTreeStore *tree_store, GtkTreeIter *iter, ...); void gtk_tree_store_set_valist (GtkTreeStore *tree_store, GtkTreeIter *iter, va_list var_args); */ static VALUE rg_remove(VALUE self, VALUE iter) { G_CHILD_REMOVE(self, iter); return CBOOL2RVAL(gtk_list_store_remove(_SELF(self), RVAL2GTKTREEITER(iter))); } struct lstore_insert_args { GtkListStore *store; GtkTreeIter iter; gint position; VALUE ary; long i; long n; gint *columns; GValue *values; }; static VALUE lstore_insert_body(VALUE value) { struct lstore_insert_args *args = (struct lstore_insert_args *)value; GtkTreeModel *model = GTK_TREE_MODEL(args->store); for (args->i = 0; args->i < args->n; args->i++) { VALUE ary = rb_ary_to_ary(RARRAY_PTR(args->ary)[args->i]); args->columns[args->i] = NUM2INT(RARRAY_PTR(ary)[1]); g_value_init(&args->values[args->i], gtk_tree_model_get_column_type(model, args->columns[args->i])); rbgobj_rvalue_to_gvalue(RARRAY_PTR(ary)[0], &args->values[args->i]); } gtk_list_store_insert_with_valuesv(args->store, &args->iter, args->position, args->columns, args->values, args->n); return Qnil; } static VALUE lstore_insert_ensure(VALUE value) { long i; struct lstore_insert_args *args = (struct lstore_insert_args *)value; for (i = 0; i < args->i; i++) g_value_unset(&args->values[i]); g_free(args->values); g_free(args->columns); return Qnil; } /* Gtk::ListStore#insert(pos, val1 => 0, val2 => 2, ... ) */ static VALUE rg_insert(int argc, VALUE *argv, VALUE self) { VALUE position, values, result; struct lstore_insert_args args; args.store = _SELF(self); rb_scan_args(argc, argv, "11", &position, &values); args.position = NUM2INT(position); if (NIL_P(values)){ gtk_list_store_insert(args.store, &args.iter, args.position); } else { args.ary = rb_funcall(values, id_to_a, 0); args.n = RARRAY_LEN(args.ary); args.columns = g_new(gint, args.n); args.values = g_new0(GValue, args.n); rb_ensure(lstore_insert_body, (VALUE)&args, lstore_insert_ensure, (VALUE)&args); } args.iter.user_data3 = args.store; result = GTKTREEITER2RVAL(&args.iter); return result; } static VALUE rg_insert_before(VALUE self, VALUE sibling) { VALUE ret; GtkTreeIter iter; GtkListStore* model = _SELF(self); gtk_list_store_insert_before(model, &iter, NIL_P(sibling) ? NULL : RVAL2GTKTREEITER(sibling)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); return ret; } static VALUE rg_insert_after(VALUE self, VALUE sibling) { VALUE ret; GtkTreeIter iter; GtkListStore* model = _SELF(self); gtk_list_store_insert_after(model, &iter, NIL_P(sibling) ? NULL : RVAL2GTKTREEITER(sibling)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); return ret; } static VALUE rg_prepend(VALUE self) { VALUE ret; GtkTreeIter iter; GtkListStore* model = _SELF(self); gtk_list_store_prepend(model, &iter); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); return ret; } static VALUE rg_append(VALUE self) { VALUE ret; GtkTreeIter iter; GtkListStore* model = _SELF(self); gtk_list_store_append(model, &iter); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); return ret; } static VALUE rg_clear(VALUE self) { G_CHILD_REMOVE_ALL(self); gtk_list_store_clear(_SELF(self)); return self; } static VALUE rg_iter_is_valid_p(VALUE self, VALUE iter) { return (NIL_P(iter)) ? Qfalse : CBOOL2RVAL(gtk_list_store_iter_is_valid(_SELF(self), RVAL2GTKTREEITER(iter))); } static VALUE rg_reorder(VALUE self, VALUE rbnew_order) { GtkListStore *store = _SELF(self); long n; gint *new_order = RVAL2GINTS(rbnew_order, n); gtk_list_store_reorder(store, new_order); g_free(new_order); return self; } static VALUE rg_swap(VALUE self, VALUE iter1, VALUE iter2) { gtk_list_store_swap(_SELF(self), RVAL2GTKTREEITER(iter1), RVAL2GTKTREEITER(iter2)); return self; } static VALUE rg_move_before(VALUE self, VALUE iter, VALUE position) { gtk_list_store_move_before(_SELF(self), RVAL2GTKTREEITER(iter), NIL_P(position) ? NULL : RVAL2GTKTREEITER(position)); return self; } static VALUE rg_move_after(VALUE self, VALUE iter, VALUE position) { gtk_list_store_move_after(_SELF(self), RVAL2GTKTREEITER(iter), NIL_P(position) ? NULL : RVAL2GTKTREEITER(position)); return self; } void Init_gtk_list_store(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_LIST_STORE, "ListStore", mGtk); id_to_a = rb_intern("to_a"); id_size = rb_intern("size"); rbgtk_register_treeiter_set_value_func(GTK_TYPE_LIST_STORE, (rbgtkiter_set_value_func)>k_list_store_set_value); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_column_types, -1); RG_DEF_METHOD(set_value, 3); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(insert, -1); RG_DEF_METHOD(insert_before, 1); RG_DEF_METHOD(insert_after, 1); RG_DEF_METHOD(prepend, 0); RG_DEF_METHOD(append, 0); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD_P(iter_is_valid, 1); RG_DEF_METHOD(reorder, 1); RG_DEF_METHOD(swap, 2); RG_DEF_METHOD(move_before, 2); RG_DEF_METHOD(move_after, 2); #if GTK_CHECK_VERSION(2, 12, 0) RG_DEF_METHOD(set_values, 2); #endif } ���������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktearoffmenuitem.c������������������������������������������0000644�0001750�0001750�00000002625�11701304107�021511� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTearoffMenuItem static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_tearoff_menu_item_new()); return Qnil; } void Init_gtk_tearoff_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEAROFF_MENU_ITEM, "TearoffMenuItem", mGtk); RG_DEF_METHOD(initialize, 0); } �����������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtk.c���������������������������������������������������������0000644�0001750�0001750�00000034222�12121311640�016371� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2001 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #include <locale.h> #define RG_TARGET_NAMESPACE mGtk VALUE RG_TARGET_NAMESPACE; static VALUE rbgtk_eGtkInitError; ID id_relative_callbacks; ID id_call; static ID id__windows__; static ID id__quit_callbacks__, id__timeout_callbacks__; static ID id__idle_callbacks__, id__snooper_callbacks__; typedef struct _callback_info_t { VALUE callback; ID key; guint id; } callback_info_t; static void remove_from_windows(G_GNUC_UNUSED GtkWidget *window, VALUE obj) { VALUE klass, windows; klass = rb_obj_class(obj); windows = rb_ivar_get(klass, id__windows__); if (!NIL_P(windows)) { rb_hash_delete(windows, obj); } } void rbgtk_initialize_gtkobject(VALUE obj, GtkObject *gtkobj) { gtkobj = g_object_ref(gtkobj); gtk_object_sink(gtkobj); G_INITIALIZE(obj, gtkobj); if (GTK_IS_WINDOW(gtkobj) || GTK_IS_MENU_SHELL(gtkobj)) { VALUE klass; klass = rb_obj_class(obj); if (rb_ivar_defined(klass, id__windows__) == Qfalse) { rb_ivar_set(klass, id__windows__, rb_hash_new()); } rb_hash_aset(rb_ivar_get(klass, id__windows__), obj, Qnil); g_signal_connect_after(gtkobj, "destroy", G_CALLBACK(remove_from_windows), (gpointer)obj); } } void exec_callback(GtkWidget *widget, gpointer proc) { rb_funcall((VALUE)proc, id_call, 1, GOBJ2RVAL(widget)); } /* * Gtk module */ /* We can't use rbgtk_poll() on native Win32. Because GPollFD doesn't have file descriptor but HANDLE. */ #define USE_POLL_FUNC static VALUE rg_m_events_pending_p(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gtk_events_pending()); } static VALUE gtk_m_function_body(VALUE data) { callback_info_t *info = (callback_info_t *)data; VALUE ret = rb_funcall(info->callback, id_call, 0); if (info->key && !ret) G_REMOVE_RELATIVE(RG_TARGET_NAMESPACE, info->key, UINT2NUM(info->id)); return ret; } static gboolean gtk_m_function(gpointer data) { return RVAL2CBOOL(G_PROTECT_CALLBACK(gtk_m_function_body, data)); } static VALUE gtk_m_function2_body(gpointer proc) { rb_funcall((VALUE)proc, id_call, 0); return Qnil; } static void gtk_m_function2(gpointer proc) { G_PROTECT_CALLBACK(gtk_m_function2_body, proc); } static VALUE rg_m_set_locale(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gtk_set_locale()); } static VALUE rg_m_disable_setlocale(G_GNUC_UNUSED VALUE self) { gtk_disable_setlocale(); return Qnil; } static VALUE rg_m_default_language(G_GNUC_UNUSED VALUE self) { return BOXED2RVAL(gtk_get_default_language(), PANGO_TYPE_LANGUAGE); } typedef void (*SignalFunc) (int); static gboolean _initialized = FALSE; static VALUE rg_m_init(int argc, VALUE *argv, VALUE self) { gint i, gargc; VALUE argary; char** gargv; VALUE progname; if (_initialized) return self; else _initialized = TRUE; rb_scan_args(argc, argv, "01", &argary); if (NIL_P(argary)){ argary = rb_const_get(rb_cObject, rb_intern("ARGV")); gargc = RARRAY_LEN(argary); } else { Check_Type(argary, T_ARRAY); gargc = RARRAY_LEN(argary); } gargv = ALLOCA_N(char *, gargc + 1); progname = rb_gv_get("$0"); gargv[0] = (char *)RVAL2CSTR(progname); for (i = 0; i < gargc; i++) if (TYPE(RARRAY_PTR(argary)[i]) == T_STRING) gargv[i+1] = (char *)RVAL2CSTR(RARRAY_PTR(argary)[i]); else gargv[i+1] = (char *)""; gargc++; { gboolean is_initialized; is_initialized = gtk_init_check(&gargc, &gargv); if (! is_initialized) { const char *display_name_arg = gdk_get_display_arg_name(); display_name_arg = display_name_arg ? display_name_arg : g_getenv("DISPLAY"); rb_raise(rbgtk_eGtkInitError, "Cannot open display: %s", display_name_arg ? display_name_arg : " "); } setlocale(LC_NUMERIC, "C"); } return self; } /* We don't need them. gtk_init() gtk_exit() */ static VALUE rg_m_main(G_GNUC_UNUSED VALUE self) { gtk_main(); return Qnil; } static VALUE rg_m_main_level(G_GNUC_UNUSED VALUE self) { return INT2FIX(gtk_main_level()); } static VALUE rg_m_main_quit(G_GNUC_UNUSED VALUE self) { gtk_main_quit(); return Qnil; } static VALUE rg_m_main_iteration(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gtk_main_iteration()); } static VALUE rg_m_main_iteration_do(G_GNUC_UNUSED VALUE self, VALUE blocking) { return CBOOL2RVAL(gtk_main_iteration_do(RVAL2CBOOL(blocking))); } static VALUE rg_m_main_do_event(G_GNUC_UNUSED VALUE self, VALUE event) { gtk_main_do_event(RVAL2GEV(event)); return event; } /* We don't need them. gtk_true() gtk_false() */ static VALUE rg_m_grab_add(G_GNUC_UNUSED VALUE self, VALUE widget) { gtk_grab_add(GTK_WIDGET(RVAL2GOBJ(widget))); return Qnil; } static VALUE rg_m_current(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_grab_get_current()); } static VALUE rg_m_grab_remove(G_GNUC_UNUSED VALUE self, VALUE widget) { gtk_grab_remove(GTK_WIDGET(RVAL2GOBJ(widget))); return Qnil; } static VALUE rg_m_init_add(VALUE self) { volatile VALUE func = rb_block_proc(); gtk_init_add((GtkFunction)gtk_m_function2, (gpointer)func); G_RELATIVE(self, func); return Qnil; } static VALUE rg_m_quit_add(VALUE self, VALUE main_level) { volatile VALUE func = rb_block_proc(); VALUE rb_id; callback_info_t *info; guint id; info = ALLOC(callback_info_t); info->callback = func; info->key = id_relative_callbacks; id = gtk_quit_add_full(NUM2UINT(main_level), (GtkFunction)gtk_m_function, NULL, (gpointer)info, g_free); info->id = id; rb_id = UINT2NUM(id); G_RELATIVE2(self, func, id__quit_callbacks__, rb_id); return rb_id; } static VALUE rg_m_quit_remove(VALUE self, VALUE quit_handler_id) { gtk_quit_remove(NUM2UINT(quit_handler_id)); G_REMOVE_RELATIVE(self, id__quit_callbacks__, quit_handler_id); return quit_handler_id; } /* We don't need this. gtk_quit_add_full () gtk_quit_add_destroy() gtk_quit_remove_by_data() gtk_timeout_add_full() */ static VALUE rg_m_timeout_add(VALUE self, VALUE interval) { VALUE func, rb_id; callback_info_t *info; guint id; func = rb_block_proc(); info = ALLOC(callback_info_t); info->callback = func; info->key = id__timeout_callbacks__; id = gtk_timeout_add_full(NUM2UINT(interval), (GtkFunction)gtk_m_function, NULL, (gpointer)info, g_free); info->id = id; rb_id = UINT2NUM(id); G_RELATIVE2(self, func, id__timeout_callbacks__, rb_id); return rb_id; } static VALUE rg_m_timeout_remove(VALUE self, VALUE id) { gtk_timeout_remove(NUM2UINT(id)); G_REMOVE_RELATIVE(self, id__timeout_callbacks__, id); return Qnil; } static VALUE rg_m_idle_add(VALUE self) { VALUE func, rb_id; callback_info_t *info; guint id; func = rb_block_proc(); info = ALLOC(callback_info_t); info->callback = func; info->key = id__idle_callbacks__; id = gtk_idle_add_full(G_PRIORITY_DEFAULT_IDLE, (GtkFunction)gtk_m_function, NULL, (gpointer)info, g_free); info->id = id; rb_id = UINT2NUM(id); G_RELATIVE2(self, func, id__idle_callbacks__, rb_id); return rb_id; } static VALUE rg_m_idle_add_priority(VALUE self, VALUE priority) { VALUE func, rb_id; callback_info_t *info; guint id; func = rb_block_proc(); info = ALLOC(callback_info_t); info->callback = func; info->key = id__idle_callbacks__; id = gtk_idle_add_full(NUM2INT(priority), (GtkFunction)gtk_m_function, NULL, (gpointer)info, g_free); info->id = id; rb_id = UINT2NUM(id); G_RELATIVE2(self, func, id__idle_callbacks__, rb_id); return rb_id; } static VALUE rg_m_idle_remove(VALUE self, VALUE id) { gtk_idle_remove(NUM2UINT(id)); G_REMOVE_RELATIVE(self, id__idle_callbacks__, id); return Qnil; } /* We don't need this. gtk_idle_remove_by_data() gtk_idle_add_full() Use Gdk::Input.add, remove gtk_input_add_full() gtk_input_remove() */ static gint gtk_m_key_snoop_func(GtkWidget *grab_widget, GdkEventKey *event, gpointer func) { VALUE ret = rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(grab_widget), GEV2RVAL((GdkEvent*)event)); return RVAL2CBOOL(ret); } static VALUE rg_m_key_snooper_install(VALUE self) { VALUE func = rb_block_proc(); VALUE id = INT2FIX(gtk_key_snooper_install( (GtkKeySnoopFunc)gtk_m_key_snoop_func, (gpointer)func)); G_RELATIVE2(self, func, id__snooper_callbacks__, id); return id; } static VALUE rg_m_key_snooper_remove(VALUE self, VALUE id) { gtk_key_snooper_remove(NUM2UINT(id)); G_REMOVE_RELATIVE(self, id__snooper_callbacks__, id); return Qnil; } static VALUE rg_m_current_event(G_GNUC_UNUSED VALUE self) { return GEV2RVAL(gtk_get_current_event()); } static VALUE rg_m_current_event_time(G_GNUC_UNUSED VALUE self) { return INT2NUM(gtk_get_current_event_time()); } static VALUE rg_m_current_event_state(G_GNUC_UNUSED VALUE self) { GdkModifierType state; gboolean ret = gtk_get_current_event_state(&state); return ret ? GFLAGS2RVAL(state, GDK_TYPE_MODIFIER_TYPE) : Qnil; } static VALUE rg_m_get_event_widget(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE event; rb_scan_args(argc, argv, "01", &event); return GOBJ2RVAL(gtk_get_event_widget(NIL_P(event) ? NULL :RVAL2GEV(event))); } static VALUE rg_m_propagate_event(G_GNUC_UNUSED VALUE self, VALUE widget, VALUE event) { gtk_propagate_event(GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2GEV(event)); return Qnil; } /* From Version Information */ static VALUE rg_m_check_version(G_GNUC_UNUSED VALUE self, VALUE major, VALUE minor, VALUE micro) { const gchar *ret; ret = gtk_check_version(FIX2INT(major), FIX2INT(minor), FIX2INT(micro)); return ret ? CSTR2RVAL(ret) : Qnil; } static VALUE rg_m_check_version_p(G_GNUC_UNUSED VALUE self, VALUE major, VALUE minor, VALUE micro) { const gchar *ret; ret = gtk_check_version(FIX2INT(major), FIX2INT(minor), FIX2INT(micro)); return CBOOL2RVAL(ret == NULL); } #if GTK_CHECK_VERSION(2,14,0) static VALUE rg_m_show_uri(G_GNUC_UNUSED VALUE self, VALUE rb_uri_or_options) { VALUE rb_screen = Qnil; VALUE rb_uri = Qnil; VALUE rb_timestamp = Qnil; GdkScreen *screen = NULL; const gchar *uri = NULL; guint32 timestamp = GDK_CURRENT_TIME; GError *error = NULL; if (TYPE(rb_uri_or_options) == T_HASH) { rbg_scan_options(rb_uri_or_options, "screen", &rb_screen, "uri", &rb_uri, "timestamp", &rb_timestamp, NULL); } else { rb_uri = rb_uri_or_options; } screen = RVAL2GOBJ(rb_screen); uri = StringValueCStr(rb_uri); if (!NIL_P(rb_timestamp)) { timestamp = NUM2UINT(rb_timestamp); } if (!gtk_show_uri(screen, uri, timestamp, &error)) { RAISE_GERROR(error); } return self; } #endif /* * Init */ void Init_gtk_gtk(void) { id_call = rb_intern("call"); id__windows__ = rb_intern("__windows__"); id__quit_callbacks__ = rb_intern("__quit_callbacks__"); id__timeout_callbacks__ = rb_intern("__timeout_callbacks__"); id__idle_callbacks__ = rb_intern("__idle_callbacks__"); id__snooper_callbacks__ = rb_intern("__snooper_callbacks__"); RG_TARGET_NAMESPACE = rb_define_module("Gtk"); rb_ivar_set(RG_TARGET_NAMESPACE, id_relative_callbacks, Qnil); rbgtk_eGtkInitError = rb_define_class_under(RG_TARGET_NAMESPACE, "InitError", rb_eRuntimeError); RG_DEF_MODFUNC_P(events_pending, 0); RG_DEF_MODFUNC(set_locale, 0); RG_DEF_MODFUNC(disable_setlocale, 0); RG_DEF_MODFUNC(default_language, 0); RG_DEF_MODFUNC(init, -1); RG_DEF_MODFUNC(main, 0); RG_DEF_MODFUNC(main_level, 0); RG_DEF_MODFUNC(main_quit, 0); RG_DEF_MODFUNC(main_iteration, 0); RG_DEF_MODFUNC(main_iteration_do, 1); RG_DEF_MODFUNC(main_do_event, 1); RG_DEF_MODFUNC(grab_add, 1); RG_DEF_MODFUNC(current, 0); RG_DEF_MODFUNC(grab_remove, 1); RG_DEF_MODFUNC(init_add, 0); RG_DEF_MODFUNC(quit_add, 1); RG_DEF_MODFUNC(quit_remove, 1); RG_DEF_MODFUNC(timeout_add, 1); RG_DEF_MODFUNC(timeout_remove, 1); RG_DEF_MODFUNC(idle_add, 0); RG_DEF_MODFUNC(idle_add_priority, 1); RG_DEF_MODFUNC(idle_remove, 1); RG_DEF_MODFUNC(key_snooper_install, 0); RG_DEF_MODFUNC(key_snooper_remove, 1); RG_DEF_MODFUNC(current_event, 0); RG_DEF_MODFUNC(current_event_time, 0); RG_DEF_MODFUNC(current_event_state, 0); RG_DEF_MODFUNC(get_event_widget, -1); RG_DEF_MODFUNC(propagate_event, 2); RG_DEF_MODFUNC(check_version, 3); RG_DEF_MODFUNC_P(check_version, 3); #if GTK_CHECK_VERSION(2,14,0) RG_DEF_MODFUNC(show_uri, 1); #endif rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_RESIZE", INT2FIX(GTK_PRIORITY_RESIZE)); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkdrag.c�����������������������������������������������������0000644�0001750�0001750�00000031675�12257552167�017265� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mDrag #define RVAL2DC(c) (GDK_DRAG_CONTEXT(RVAL2GOBJ(c))) #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) struct rbgtk_rval2gtktargetentries_args { VALUE ary; long n; GtkTargetEntry *result; }; static VALUE rbgtk_rval2gtktargetentries_body(VALUE value) { long i; struct rbgtk_rval2gtktargetentries_args *args = (struct rbgtk_rval2gtktargetentries_args *)value; for (i = 0; i < args->n; i++) { VALUE entry = rb_ary_to_ary(RARRAY_PTR(args->ary)[i]); VALUE flags = RARRAY_PTR(entry)[1]; VALUE info = RARRAY_PTR(entry)[2]; args->result[i].target = (gchar *)RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[0]); args->result[i].flags = NIL_P(flags) ? 0 : RVAL2GFLAGS(flags, GTK_TYPE_TARGET_FLAGS); args->result[i].info = NIL_P(info) ? 0 : NUM2INT(info); } return Qnil; } static G_GNUC_NORETURN VALUE rbgtk_rval2gtktargetentries_rescue(VALUE value) { g_free(((struct rbgtk_rval2gtktargetentries_args *)value)->result); rb_exc_raise(rb_errinfo()); } GtkTargetEntry * rbgtk_rval2gtktargetentries(VALUE value, long *n) { struct rbgtk_rval2gtktargetentries_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GtkTargetEntry, args.n + 1); rb_rescue(rbgtk_rval2gtktargetentries_body, (VALUE)&args, rbgtk_rval2gtktargetentries_rescue, (VALUE)&args); *n = args.n; return args.result; } GtkTargetEntry * rbgtk_rval2gtktargetentries_accept_nil(VALUE value, long *n) { if (!NIL_P(value)) return rbgtk_rval2gtktargetentries(value, n); *n = 0; return NULL; } GtkTargetEntry * rbgtk_get_target_entry(VALUE targets) { long n; return RVAL2GTKTARGETENTRIES(targets, &n); } static VALUE rg_m_dest_set(VALUE self, VALUE rbwidget, VALUE rbflags, VALUE rbtargets, VALUE rbactions) { GtkWidget *widget = RVAL2WIDGET(rbwidget); GtkDestDefaults flags = RVAL2GFLAGS(rbflags, GTK_TYPE_DEST_DEFAULTS); GdkDragAction actions = RVAL2GFLAGS(rbactions, GDK_TYPE_DRAG_ACTION); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES_ACCEPT_NIL(rbtargets, &n); gtk_drag_dest_set(widget, flags, targets, n, actions); g_free(targets); return self; } static VALUE rg_m_dest_set_proxy(VALUE self, VALUE widget, VALUE proxy_window, VALUE protocol, VALUE use_coordinates) { gtk_drag_dest_set_proxy(RVAL2WIDGET(widget), GDK_WINDOW(RVAL2GOBJ(proxy_window)), RVAL2GENUM(protocol, GDK_TYPE_DRAG_PROTOCOL), RVAL2CBOOL(use_coordinates)); return self; } static VALUE rg_m_dest_unset(VALUE self, VALUE widget) { gtk_drag_dest_unset(RVAL2WIDGET(widget)); return self; } static VALUE rg_m_dest_find_target(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE widget, context, target_list; GdkAtom ret; rb_scan_args(argc, argv, "21", &widget, &context, &target_list); ret = gtk_drag_dest_find_target( RVAL2WIDGET(widget), RVAL2DC(context), NIL_P(target_list) ? NULL : RVAL2BOXED(target_list, GTK_TYPE_TARGET_LIST)); return BOXED2RVAL(ret, GDK_TYPE_ATOM); } static VALUE rg_m_dest_get_target_list(G_GNUC_UNUSED VALUE self, VALUE widget) { GtkTargetList* list = gtk_drag_dest_get_target_list(RVAL2WIDGET(widget)); return BOXED2RVAL(list, GTK_TYPE_TARGET_LIST); } static VALUE rg_m_dest_set_target_list(VALUE self, VALUE widget, VALUE target_list) { gtk_drag_dest_set_target_list( RVAL2WIDGET(widget), NIL_P(target_list) ? NULL : RVAL2BOXED(target_list, GTK_TYPE_TARGET_LIST)); return self; } static VALUE rg_m_dest_add_text_targets(VALUE self, VALUE widget) { gtk_drag_dest_add_text_targets(RVAL2WIDGET(widget)); return self; } static VALUE rg_m_dest_add_image_targets(VALUE self, VALUE widget) { gtk_drag_dest_add_image_targets(RVAL2WIDGET(widget)); return self; } static VALUE rg_m_dest_add_uri_targets(VALUE self, VALUE widget) { gtk_drag_dest_add_uri_targets(RVAL2WIDGET(widget)); return self; } static VALUE rg_m_dest_set_track_motion(VALUE self, VALUE widget, VALUE track_motion) { gtk_drag_dest_set_track_motion(RVAL2WIDGET(widget), RVAL2CBOOL(track_motion)); return self; } static VALUE rg_m_dest_get_track_motion(G_GNUC_UNUSED VALUE self, VALUE widget) { return CBOOL2RVAL(gtk_drag_dest_get_track_motion(RVAL2WIDGET(widget))); } static VALUE rg_m_finish(VALUE self, VALUE context, VALUE success, VALUE del, VALUE time) { gtk_drag_finish(RVAL2DC(context), RVAL2CBOOL(success), RVAL2CBOOL(del), NUM2UINT(time)); return self; } static VALUE rg_m_get_data(VALUE self, VALUE widget, VALUE context, VALUE target, VALUE time) { gtk_drag_get_data(RVAL2WIDGET(widget), RVAL2DC(context), RVAL2ATOM(target), NUM2UINT(time)); return self; } static VALUE rg_m_get_source_widget(G_GNUC_UNUSED VALUE self, VALUE context) { return GOBJ2RVAL(gtk_drag_get_source_widget(RVAL2DC(context))); } static VALUE rg_m_highlight(VALUE self, VALUE widget) { gtk_drag_highlight(RVAL2WIDGET(widget)); return self; } static VALUE rg_m_unhighlight(VALUE self, VALUE widget) { gtk_drag_unhighlight(RVAL2WIDGET(widget)); return self; } static VALUE rg_m_begin(G_GNUC_UNUSED VALUE self, VALUE widget, VALUE target_list, VALUE actions, VALUE button, VALUE event) { return GOBJ2RVAL(gtk_drag_begin(RVAL2WIDGET(widget), RVAL2BOXED(target_list, GTK_TYPE_TARGET_LIST), RVAL2GFLAGS(actions, GDK_TYPE_DRAG_ACTION), NUM2INT(button), RVAL2GEV(event))); } static VALUE rg_m_set_icon(int argc, VALUE *argv, VALUE self) { VALUE context, obj, pixmap = Qnil, mask = Qnil, hot_x, hot_y; if (argc == 6) { rb_scan_args(argc, argv, "60", &context, &obj, &pixmap, &mask, &hot_x, &hot_y); gtk_drag_set_icon_pixmap(RVAL2DC(context), GDK_COLORMAP(RVAL2GOBJ(obj)), GDK_PIXMAP(RVAL2GOBJ(pixmap)), GDK_BITMAP(RVAL2GOBJ(mask)), NUM2INT(hot_x), NUM2INT(hot_y)); } else { rb_scan_args(argc, argv, "40", &context, &obj, &hot_x, &hot_y); if (TYPE(obj) == T_SYMBOL){ gtk_drag_set_icon_stock(RVAL2DC(context), rb_id2name(SYM2ID(obj)), NUM2INT(hot_x), NUM2INT(hot_y)); } else if (rb_obj_is_kind_of(obj, GTYPE2CLASS(GTK_TYPE_WIDGET))){ gtk_drag_set_icon_widget(RVAL2DC(context), RVAL2WIDGET(obj), NUM2INT(hot_x), NUM2INT(hot_y)); } else if (rb_obj_is_kind_of(obj, GTYPE2CLASS(GDK_TYPE_PIXBUF))){ gtk_drag_set_icon_pixbuf(RVAL2DC(context), GDK_PIXBUF(RVAL2GOBJ(obj)), NUM2INT(hot_x), NUM2INT(hot_y)); } else { rb_raise(rb_eArgError, "invalid argument %s", rb_class2name(CLASS_OF(obj))); } } return self; } static VALUE rg_m_set_icon_name(VALUE self, VALUE context, VALUE name, VALUE hot_x, VALUE hot_y) { gtk_drag_set_icon_name(RVAL2DC(context), RVAL2CSTR(name), NUM2INT(hot_x), NUM2INT(hot_y)); return self; } static VALUE rg_m_set_icon_default(VALUE self, VALUE context) { gtk_drag_set_icon_default(RVAL2DC(context)); return self; } static VALUE rg_m_threshold_p(G_GNUC_UNUSED VALUE self, VALUE widget, VALUE start_x, VALUE start_y, VALUE current_x, VALUE current_y) { return CBOOL2RVAL(gtk_drag_check_threshold(RVAL2WIDGET(widget), NUM2INT(start_x), NUM2INT(start_y), NUM2INT(current_x), NUM2INT(current_y))); } static VALUE rg_m_source_set(VALUE self, VALUE rbwidget, VALUE rbstart_button_mask, VALUE rbtargets, VALUE rbactions) { GtkWidget *widget = RVAL2WIDGET(rbwidget); GdkModifierType start_button_mask = RVAL2GFLAGS(rbstart_button_mask, GDK_TYPE_MODIFIER_TYPE); GdkDragAction actions = RVAL2GFLAGS(rbactions, GDK_TYPE_DRAG_ACTION); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_drag_source_set(widget, start_button_mask, targets, n, actions); g_free(targets); return self; } static VALUE rg_m_source_set_icon(int argc, VALUE *argv, VALUE self) { VALUE widget, obj, pixmap = Qnil, mask = Qnil; rb_scan_args(argc, argv, "22", &widget, &obj, &pixmap, &mask); if (argc == 4){ gtk_drag_source_set_icon(RVAL2WIDGET(widget), GDK_COLORMAP(RVAL2GOBJ(obj)), GDK_PIXMAP(RVAL2GOBJ(pixmap)), GDK_BITMAP(RVAL2GOBJ(mask))); } else if (argc == 2){ if (TYPE(obj) == T_SYMBOL){ gtk_drag_source_set_icon_stock(RVAL2WIDGET(widget), rb_id2name(SYM2ID(obj))); } else { gtk_drag_source_set_icon_pixbuf(RVAL2WIDGET(widget), GDK_PIXBUF(RVAL2GOBJ(obj))); } } else { rb_raise(rb_eArgError, "need 2 or 4 arguments"); } return self; } static VALUE rg_m_source_set_icon_name(VALUE self, VALUE widget, VALUE icon_name) { gtk_drag_source_set_icon_name(RVAL2WIDGET(widget), RVAL2CSTR(icon_name)); return self; } static VALUE rg_m_source_unset(VALUE self, VALUE widget) { gtk_drag_source_unset(RVAL2WIDGET(widget)); return self; } static VALUE rg_m_source_set_target_list(VALUE self, VALUE widget, VALUE targetlist) { GtkTargetList* tlist = NULL; if (! NIL_P(targetlist)) tlist = (GtkTargetList*)RVAL2BOXED(targetlist, GTK_TYPE_TARGET_LIST); gtk_drag_source_set_target_list(RVAL2WIDGET(widget),tlist); return self; } static VALUE rg_m_source_get_target_list(G_GNUC_UNUSED VALUE self, VALUE widget) { GtkTargetList* ret = gtk_drag_source_get_target_list(RVAL2WIDGET(widget)); return NIL_P(ret) ? Qnil : BOXED2RVAL(ret, GTK_TYPE_TARGET_LIST); } static VALUE rg_m_source_add_text_targets(VALUE self, VALUE widget) { gtk_drag_source_add_text_targets(RVAL2WIDGET(widget)); return self; } static VALUE rg_m_source_add_image_targets(VALUE self, VALUE widget) { gtk_drag_source_add_image_targets(RVAL2WIDGET(widget)); return self; } static VALUE rg_m_source_add_uri_targets(VALUE self, VALUE widget) { gtk_drag_source_add_uri_targets(RVAL2WIDGET(widget)); return self; } void Init_gtk_drag(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "Drag"); RG_DEF_MODFUNC(dest_set, 4); RG_DEF_MODFUNC(dest_set_proxy, 4); RG_DEF_MODFUNC(dest_unset, 1); RG_DEF_MODFUNC(dest_find_target, -1); RG_DEF_MODFUNC(dest_get_target_list, 1); RG_DEF_MODFUNC(dest_set_target_list, 2); RG_DEF_MODFUNC(dest_add_text_targets, 1); RG_DEF_MODFUNC(dest_add_image_targets, 1); RG_DEF_MODFUNC(dest_add_uri_targets, 1); RG_DEF_MODFUNC(dest_set_track_motion, 2); RG_DEF_MODFUNC(dest_get_track_motion, 1); RG_DEF_MODFUNC(finish, 4); RG_DEF_MODFUNC(get_data, 4); RG_DEF_MODFUNC(get_source_widget, 1); RG_DEF_MODFUNC(highlight, 1); RG_DEF_MODFUNC(unhighlight, 1); RG_DEF_MODFUNC(begin, 5); RG_DEF_MODFUNC_P(threshold, 5); RG_DEF_MODFUNC(set_icon, -1); RG_DEF_MODFUNC(set_icon_name, 4); RG_DEF_MODFUNC(set_icon_default, 1); RG_DEF_MODFUNC(source_set, 4); RG_DEF_MODFUNC(source_set_icon, -1); RG_DEF_MODFUNC(source_set_icon_name, 2); RG_DEF_MODFUNC(source_unset, 1); RG_DEF_MODFUNC(source_set_target_list, 2); RG_DEF_MODFUNC(source_get_target_list, 1); RG_DEF_MODFUNC(source_add_text_targets, 1); RG_DEF_MODFUNC(source_add_image_targets, 1); RG_DEF_MODFUNC(source_add_uri_targets, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkDestDefaults */ G_DEF_CLASS(GTK_TYPE_DEST_DEFAULTS, "DestDefaults", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_DEST_DEFAULTS, "GTK_"); /* GtkTargetFlags */ G_DEF_CLASS(GTK_TYPE_TARGET_FLAGS, "TargetFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TARGET_FLAGS, "GTK_"); } �������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkiconset.c��������������������������������������������������0000644�0001750�0001750�00000005537�11701304107�017770� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cIconSet #define _SELF(s) ((GtkIconSet*)RVAL2BOXED(s, GTK_TYPE_ICON_SET)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GtkIconSet *icon_set; VALUE pixbuf; rb_scan_args(argc, argv, "01", &pixbuf); if(NIL_P(pixbuf)) icon_set = gtk_icon_set_new(); else icon_set = gtk_icon_set_new_from_pixbuf(RVAL2GOBJ(pixbuf)); G_INITIALIZE(self, icon_set); return Qnil; } static VALUE rg_add_source(VALUE self, VALUE source) { gtk_icon_set_add_source(_SELF(self), RVAL2BOXED(source, GTK_TYPE_ICON_SOURCE)); return self; } static VALUE rg_sizes(VALUE self) { GtkIconSize *sizes; gint n_sizes; VALUE result; int n; gtk_icon_set_get_sizes(_SELF(self), &sizes, &n_sizes); result = rb_ary_new(); for(n=0; n<n_sizes; n++, sizes++) rb_ary_push(result, GENUM2RVAL(*sizes, GTK_TYPE_ICON_SIZE)); return result; } static VALUE rg_render_icon(int argc, VALUE *argv, VALUE self) { VALUE style, direction, state, size, widget, detail; rb_scan_args(argc, argv, "42", &style, &direction, &state, &size, &widget, &detail); return GOBJ2RVAL(gtk_icon_set_render_icon(_SELF(self), RVAL2GOBJ(style), RVAL2GENUM(direction, GTK_TYPE_TEXT_DIRECTION), RVAL2GENUM(state, GTK_TYPE_STATE_TYPE), RVAL2GENUM(size, GTK_TYPE_ICON_SIZE), NIL_P(widget) ? NULL : RVAL2GOBJ(widget), NIL_P(detail) ? NULL : RVAL2CSTR(detail))); } void Init_gtk_icon_set(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_SET, "IconSet", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(add_source, 1); RG_DEF_METHOD(sizes, 0); RG_DEF_METHOD(render_icon, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreeviewcolumn.c�������������������������������������������0000644�0001750�0001750�00000020406�12257552167�021406� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTreeViewColumn #define _SELF(s) (GTK_TREE_VIEW_COLUMN(RVAL2GOBJ(s))) #define RVAL2CELLRENDERER(c) (GTK_CELL_RENDERER(RVAL2GOBJ(c))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { int i; int col; GtkTreeViewColumn *tvc; GtkCellRenderer *renderer; const gchar *name; VALUE ary, val; tvc = gtk_tree_view_column_new(); if (argc > 0){ gtk_tree_view_column_set_title(tvc, RVAL2CSTR(argv[0])); if (argc > 1) { gtk_tree_view_column_pack_start(tvc, RVAL2CELLRENDERER(argv[1]), TRUE); G_CHILD_ADD(self, argv[1]); } } RBGTK_INITIALIZE(self, tvc); if (argc == 3){ ary = rb_funcall(argv[2], rb_intern("to_a"), 0); renderer = RVAL2CELLRENDERER(argv[1]); for (i = 0; i < RARRAY_LEN(ary); i++) { val = RARRAY_PTR(RARRAY_PTR(ary)[i])[0]; if (SYMBOL_P(val)) { name = rb_id2name(SYM2ID(val)); } else { name = RVAL2CSTR(val); } col = NUM2INT(RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); gtk_tree_view_column_add_attribute(_SELF(self), renderer, name, col); } } return Qnil; } static VALUE rg_pack_start(VALUE self, VALUE cell, VALUE expand) { G_CHILD_ADD(self, cell); gtk_tree_view_column_pack_start(_SELF(self), RVAL2CELLRENDERER(cell), RVAL2CBOOL(expand)); return self; } static VALUE rg_pack_end(VALUE self, VALUE cell, VALUE expand) { G_CHILD_ADD(self, cell); gtk_tree_view_column_pack_end(_SELF(self), RVAL2CELLRENDERER(cell), RVAL2CBOOL(expand)); return self; } static VALUE rg_clear(VALUE self) { G_CHILD_REMOVE_ALL(self); gtk_tree_view_column_clear(_SELF(self)); return self; } static VALUE rg_cell_renderers(VALUE self) { return GLIST2ARYF(gtk_tree_view_column_get_cell_renderers(_SELF(self))); } static VALUE rg_add_attribute(VALUE self, VALUE cell, VALUE attribute, VALUE column) { const gchar *name; if (SYMBOL_P(attribute)) { name = rb_id2name(SYM2ID(attribute)); } else { name = RVAL2CSTR(attribute); } gtk_tree_view_column_add_attribute(_SELF(self), RVAL2CELLRENDERER(cell), name, NUM2INT(column)); return self; } static VALUE rg_set_attributes(VALUE self, VALUE renderer, VALUE attributes) { GtkTreeViewColumn *tvc; GtkCellRenderer *grenderer; const gchar *name; int i, col; VALUE ary, val; Check_Type(attributes, T_HASH); tvc = _SELF(self); grenderer = RVAL2CELLRENDERER(renderer); gtk_tree_view_column_clear_attributes(tvc, grenderer); ary = rb_funcall(attributes, rb_intern("to_a"), 0); for (i = 0; i < RARRAY_LEN(ary); i++) { val = RARRAY_PTR(RARRAY_PTR(ary)[i])[0]; if (SYMBOL_P(val)) { name = rb_id2name(SYM2ID(val)); } else { name = RVAL2CSTR(val); } col = NUM2INT(RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); gtk_tree_view_column_add_attribute(tvc, grenderer, name, col); } return self; } static void cell_data_func(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer func) { iter->user_data3 = model; rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(tree_column), GOBJ2RVAL(cell), GOBJ2RVAL(model), GTKTREEITER2RVAL(iter)); } static VALUE rg_set_cell_data_func(VALUE self, VALUE renderer) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); G_RELATIVE(renderer, func); gtk_tree_view_column_set_cell_data_func(_SELF(self), RVAL2CELLRENDERER(renderer), (GtkTreeCellDataFunc)cell_data_func, (gpointer)func, NULL); return self; } static VALUE rg_clear_attributes(VALUE self, VALUE cell) { gtk_tree_view_column_clear_attributes(_SELF(self), RVAL2CELLRENDERER(cell)); return self; } static VALUE rg_clicked(VALUE self) { gtk_tree_view_column_clicked(_SELF(self)); return self; } static VALUE rg_cell_set_cell_data(VALUE self, VALUE model, VALUE iter, VALUE is_expander, VALUE is_expanded) { gtk_tree_view_column_cell_set_cell_data(_SELF(self), GTK_TREE_MODEL(RVAL2GOBJ(model)), RVAL2GTKTREEITER(iter), RVAL2CBOOL(is_expander), RVAL2CBOOL(is_expanded)); return self; } static VALUE rg_cell_size(VALUE self) { GdkRectangle cell_area; gint x_offset, y_offset, width, height; VALUE cell; /* Is this collect implement for cell_area ? */ cell_area.x = -1; cell_area.y = -1; cell_area.width = -1; cell_area.height = -1; gtk_tree_view_column_cell_get_size(_SELF(self), &cell_area, &x_offset, &y_offset, &width, &height); if (cell_area.x == -1 || cell_area.y == -1 || cell_area.width == -1 || cell_area.height == -1){ cell = Qnil; } else { cell = BOXED2RVAL(&cell_area, GDK_TYPE_RECTANGLE); } return rb_ary_new3(5, cell, x_offset ? INT2NUM(x_offset) : Qnil, y_offset ? INT2NUM(y_offset) : Qnil, width ? INT2NUM(width) : Qnil, height ? INT2NUM(height) : Qnil); } static VALUE rg_cell_is_visible_p(VALUE self) { return CBOOL2RVAL(gtk_tree_view_column_cell_is_visible(_SELF(self))); } static VALUE rg_focus_cell(VALUE self, VALUE renderer) { gtk_tree_view_column_focus_cell(_SELF(self), RVAL2CELLRENDERER(renderer)); return self; } static VALUE rg_queue_resize(VALUE self) { gtk_tree_view_column_queue_resize(_SELF(self)); return self; } #if GTK_CHECK_VERSION(2,12,0) static VALUE rg_tree_view(VALUE self) { return GOBJ2RVAL(gtk_tree_view_column_get_tree_view(_SELF(self))); } #endif #if !GTK_CHECK_VERSION(2,18,0) static VALUE rg_sort_column_id(VALUE self) { return INT2NUM(gtk_tree_view_column_get_sort_column_id(_SELF(self))); } static VALUE rg_set_sort_column_id(VALUE self, VALUE id) { gtk_tree_view_column_set_sort_column_id(_SELF(self), NUM2INT(id)); return self; } #endif void Init_gtk_treeviewcolumn(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_VIEW_COLUMN, "TreeViewColumn", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(pack_start, 2); RG_DEF_METHOD(pack_end, 2); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD(cell_renderers, 0); RG_DEF_METHOD(add_attribute, 3); RG_DEF_METHOD(set_attributes, 2); RG_DEF_METHOD(set_cell_data_func, 1); RG_DEF_METHOD(clear_attributes, 1); RG_DEF_METHOD(clicked, 0); RG_DEF_METHOD(cell_set_cell_data, 4); RG_DEF_METHOD(cell_size, 0); RG_DEF_METHOD_P(cell_is_visible, 0); RG_DEF_METHOD(focus_cell, 1); RG_DEF_METHOD(queue_resize, 0); #if GTK_CHECK_VERSION(2,12,0) RG_DEF_METHOD(tree_view, 0); #endif #if !GTK_CHECK_VERSION(2,18,0) RG_DEF_METHOD(sort_column_id, 0); RG_DEF_METHOD(set_sort_column_id, 1); RG_DEF_ALIAS("sort_column_id=", "set_sort_column_id"); #endif /* GtkTreeViewColumnSizing */ G_DEF_CLASS(GTK_TYPE_TREE_VIEW_COLUMN_SIZING, "Sizing", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TREE_VIEW_COLUMN_SIZING, "GTK_TREE_VIEW_COLUMN_"); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcellrendererprogress.c�������������������������������������0000644�0001750�0001750�00000002424�12257552167�022571� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Darren Willis * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCellRendererProgress static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_progress_new()); return Qnil; } void Init_gtk_cellrendererprogress(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_PROGRESS, "CellRendererProgress", mGtk); RG_DEF_METHOD(initialize, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkiconsize.c�������������������������������������������������0000644�0001750�0001750�00000005662�12257552167�020170� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mIconSize static VALUE rg_m_lookup(G_GNUC_UNUSED VALUE self, VALUE size) { gint width, height; if(gtk_icon_size_lookup(RVAL2GENUM(size, GTK_TYPE_ICON_SIZE), &width, &height)) return rb_ary_new3(2, INT2FIX(width), INT2FIX(height)); else return Qnil; } static VALUE rg_m_lookup_for_settings(G_GNUC_UNUSED VALUE self, VALUE settings, VALUE size) { gint width, height; if(gtk_icon_size_lookup_for_settings(GTK_SETTINGS(RVAL2GOBJ(settings)), RVAL2GENUM(size, GTK_TYPE_ICON_SIZE), &width, &height)) return rb_ary_new3(2, INT2FIX(width), INT2FIX(height)); else return Qnil; } static VALUE rg_m_register(G_GNUC_UNUSED VALUE self, VALUE name, VALUE width, VALUE height) { /* XXXX FIXME This should be GENUM2RVAL */ return INT2FIX(gtk_icon_size_register(RVAL2CSTR(name), NUM2INT(width), NUM2INT(height))); } static VALUE rg_m_register_alias(G_GNUC_UNUSED VALUE self, VALUE alias, VALUE target) { gtk_icon_size_register_alias(RVAL2CSTR(alias), RVAL2GENUM(target, GTK_TYPE_ICON_SIZE)); return Qnil; } static VALUE rg_m_from_name(G_GNUC_UNUSED VALUE self, VALUE name) { return INT2FIX(gtk_icon_size_from_name(RVAL2CSTR(name))); } static VALUE rg_m_get_name(G_GNUC_UNUSED VALUE self, VALUE size) { return CSTR2RVAL(gtk_icon_size_get_name(RVAL2GENUM(size, GTK_TYPE_ICON_SIZE))); } void Init_gtk_icon_size(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "IconSize"); RG_DEF_MODFUNC(lookup, 1); RG_DEF_MODFUNC(lookup_for_settings, 2); RG_DEF_MODFUNC(register, 3); RG_DEF_MODFUNC(register_alias, 2); RG_DEF_MODFUNC(from_name, 1); RG_DEF_MODFUNC(get_name, 1); /* GtkIconSize */ G_DEF_CLASS(GTK_TYPE_ICON_SIZE, "IconSize", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_ICON_SIZE, "GTK_ICON_SIZE_"); } ������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfontselection.c��������������������������������������������0000644�0001750�0001750�00000002557�11701304107�021177� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 2001 Neil Conway <neilconway@rogers.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFontSelection static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_font_selection_new()); return Qnil; } void Init_gtk_font_selection(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FONT_SELECTION, "FontSelection", mGtk); RG_DEF_METHOD(initialize, 0); rb_undef_method(RG_TARGET_NAMESPACE, "font"); } �������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreeview.c�������������������������������������������������0000644�0001750�0001750�00000057100�12257552167�020171� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTreeView #define _SELF(s) (GTK_TREE_VIEW(RVAL2GOBJ(s))) #define TREEVIEW_COL(c) (GTK_TREE_VIEW_COLUMN(RVAL2GOBJ(c))) #define RVAL2CELLRENDERER(c) (GTK_CELL_RENDERER(RVAL2GOBJ(c))) static ID id_model; static ID id_selection; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE model; GtkWidget *widget; if (rb_scan_args(argc, argv, "01", &model) == 1) { G_CHILD_SET(self, id_model, model); widget = gtk_tree_view_new_with_model(GTK_TREE_MODEL(RVAL2GOBJ(model))); } else { widget = gtk_tree_view_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_selection(VALUE self) { VALUE ret = GOBJ2RVAL(gtk_tree_view_get_selection(_SELF(self))); G_CHILD_SET(self, id_selection, ret); return ret; } static VALUE rg_columns_autosize(VALUE self) { gtk_tree_view_columns_autosize(_SELF(self)); return self; } static VALUE rg_append_column(VALUE self, VALUE column) { G_CHILD_ADD(self, column); return INT2NUM(gtk_tree_view_append_column(_SELF(self), TREEVIEW_COL(column))); } static VALUE rg_remove_column(VALUE self, VALUE column) { G_CHILD_REMOVE(self, column); return INT2NUM(gtk_tree_view_remove_column(_SELF(self), TREEVIEW_COL(column))); } static void cell_data_func(GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer func) { iter->user_data3 = model; rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(column), GOBJ2RVAL(cell), GOBJ2RVAL(model), GTKTREEITER2RVAL(iter)); } static VALUE rg_insert_column(int argc, VALUE *argv, VALUE self) { VALUE args[4]; rb_scan_args(argc, argv, "22", /* NORMAL ATTRIBUTES DATA_FUNC */ &args[0], /* column position position */ &args[1], /* position title title */ &args[2], /* renderer renderer */ &args[3]); /* attributes */ if (argc == 2) { G_CHILD_ADD(self, args[0]); return INT2NUM(gtk_tree_view_insert_column(_SELF(self), TREEVIEW_COL(args[0]), NUM2INT(args[1]))); } else if (argc == 3) { int ret; VALUE func = rb_block_proc(); G_RELATIVE(self, func); ret = gtk_tree_view_insert_column_with_data_func(_SELF(self), NUM2INT(args[0]), RVAL2CSTR(args[1]), RVAL2CELLRENDERER(args[2]), (GtkTreeCellDataFunc)cell_data_func, (gpointer)func, NULL); return INT2NUM(ret); } else if (argc == 4) { int i; int col; int ret; const gchar *name; VALUE ary; GtkCellRenderer* renderer = RVAL2CELLRENDERER(args[2]); GtkTreeViewColumn* column = gtk_tree_view_column_new(); Check_Type(args[3], T_HASH); /* TODO: Should this really be done before we know that everything * below worked without error? */ G_CHILD_ADD(self, args[2]); G_CHILD_ADD(self, args[3]); gtk_tree_view_column_set_title(column, RVAL2CSTR(args[1])); gtk_tree_view_column_pack_start(column, renderer, TRUE); ret = gtk_tree_view_insert_column(_SELF(self), column, NUM2INT(args[0])); ary = rb_funcall(args[3], rb_intern("to_a"), 0); for (i = 0; i < RARRAY_LEN(ary); i++) { VALUE val = RARRAY_PTR(RARRAY_PTR(ary)[i])[0]; if (SYMBOL_P(val)) { name = rb_id2name(SYM2ID(val)); } else { name = RVAL2CSTR(val); } col = NUM2INT(RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); gtk_tree_view_column_add_attribute(column, renderer, name, col); } return INT2NUM(ret); } else { rb_raise(rb_eArgError, "Wrong number of arguments: %d", argc); } return Qnil; } static VALUE rg_get_column(VALUE self, VALUE num) { return GOBJ2RVAL(gtk_tree_view_get_column(_SELF(self), NUM2INT(num))); } static VALUE rg_columns(VALUE self) { return GLIST2ARYF(gtk_tree_view_get_columns(_SELF(self))); } static VALUE rg_move_column_after(VALUE self, VALUE column, VALUE base_column) { gtk_tree_view_move_column_after(_SELF(self), TREEVIEW_COL(column), NIL_P(base_column) ? NULL : TREEVIEW_COL(base_column)); return self; } static gboolean column_drop_func(GtkTreeView *treeview, GtkTreeViewColumn *column, GtkTreeViewColumn *prev_column, GtkTreeViewColumn *next_column, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(treeview), GOBJ2RVAL(column), GOBJ2RVAL(prev_column), GOBJ2RVAL(next_column))); } static VALUE rg_set_column_drag_function(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_view_set_column_drag_function(_SELF(self), (GtkTreeViewColumnDropFunc)column_drop_func, (gpointer)func, NULL); return self; } static VALUE rg_scroll_to_point(VALUE self, VALUE x, VALUE y) { gtk_tree_view_scroll_to_point(_SELF(self), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_scroll_to_cell(VALUE self, VALUE path, VALUE column, VALUE use_align, VALUE row_align, VALUE col_align) { gtk_tree_view_scroll_to_cell(_SELF(self), NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path), NIL_P(column) ? NULL : TREEVIEW_COL(column), RVAL2CBOOL(use_align), NUM2DBL(row_align), NUM2DBL(col_align)); return self; } static VALUE rg_set_cursor(VALUE self, VALUE path, VALUE focus_column, VALUE start_editing) { gtk_tree_view_set_cursor(_SELF(self), RVAL2GTKTREEPATH(path), NIL_P(focus_column) ? NULL : TREEVIEW_COL(focus_column), RVAL2CBOOL(start_editing)); return self; } static VALUE rg_cursor(VALUE self) { GtkTreePath* path; GtkTreeViewColumn* focus_column; gtk_tree_view_get_cursor(_SELF(self), &path, &focus_column); return rb_ary_new3(2, path ? GTKTREEPATH2RVAL(path) : Qnil, GOBJ2RVAL(focus_column)); } static VALUE rg_expand_all(VALUE self) { gtk_tree_view_expand_all(_SELF(self)); return self; } static VALUE rg_collapse_all(VALUE self) { gtk_tree_view_collapse_all(_SELF(self)); return self; } static VALUE rg_expand_row(VALUE self, VALUE path, VALUE open_all) { return CBOOL2RVAL(gtk_tree_view_expand_row(_SELF(self), RVAL2GTKTREEPATH(path), RVAL2CBOOL(open_all))); } static VALUE rg_expand_to_path(VALUE self, VALUE path) { gtk_tree_view_expand_to_path(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_collapse_row(VALUE self, VALUE path) { return CBOOL2RVAL(gtk_tree_view_collapse_row(_SELF(self), RVAL2GTKTREEPATH(path))); } static void mapping_func(GtkTreeView *treeview, GtkTreePath *path, gpointer func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(treeview), GTKTREEPATH2RVAL(path)); } static VALUE rg_map_expanded_rows(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_view_map_expanded_rows(_SELF(self), (GtkTreeViewMappingFunc)mapping_func, (gpointer)func); return self; } static VALUE rg_row_expanded_p(VALUE self, VALUE path) { return CBOOL2RVAL(gtk_tree_view_row_expanded(_SELF(self), RVAL2GTKTREEPATH(path))); } static VALUE rg_get_path_at_pos(VALUE self, VALUE x, VALUE y) { GtkTreePath* path; GtkTreeViewColumn* column; gint cell_x, cell_y; gboolean ret; ret = gtk_tree_view_get_path_at_pos(_SELF(self), NUM2INT(x), NUM2INT(y), &path, &column, &cell_x, &cell_y); return ret ? rb_ary_new3(4, path ? GTKTREEPATH2RVAL(path) : Qnil, column ? GOBJ2RVAL(column) : Qnil, INT2NUM(cell_x), INT2NUM(cell_y)) : Qnil; } static VALUE rg_get_cell_area(VALUE self, VALUE path, VALUE column) { GdkRectangle rect; gtk_tree_view_get_cell_area(_SELF(self), NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path), NIL_P(column) ? NULL : TREEVIEW_COL(column), &rect); return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE); } static VALUE rg_get_background_area(VALUE self, VALUE path, VALUE column) { GdkRectangle rect; gtk_tree_view_get_background_area(_SELF(self), NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path), NIL_P(column) ? NULL : TREEVIEW_COL(column), &rect); return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE); } static VALUE rg_visible_rect(VALUE self) { GdkRectangle rect; gtk_tree_view_get_visible_rect(_SELF(self), &rect); return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE); } static VALUE rg_visible_range(VALUE self) { GtkTreePath* start_path; GtkTreePath* end_path; gboolean valid_paths = gtk_tree_view_get_visible_range(_SELF(self), &start_path, &end_path); return valid_paths ? rb_assoc_new(GTKTREEPATH2RVAL(start_path), GTKTREEPATH2RVAL(end_path)) : Qnil; } static VALUE rg_bin_window(VALUE self) { return GOBJ2RVAL(gtk_tree_view_get_bin_window(_SELF(self))); } static VALUE rg_widget_to_tree_coords(VALUE self, VALUE wx, VALUE wy) { gint tx, ty; gtk_tree_view_widget_to_tree_coords(_SELF(self), NUM2INT(wx), NUM2INT(wy), &tx, &ty); return rb_ary_new3(2, INT2NUM(tx), INT2NUM(ty)); } static VALUE rg_tree_to_widget_coords(VALUE self, VALUE tx, VALUE ty) { gint wx, wy; gtk_tree_view_tree_to_widget_coords(_SELF(self), NUM2INT(tx), NUM2INT(ty), &wx, &wy); return rb_ary_new3(2, INT2NUM(wx), INT2NUM(wy)); } #if GTK_CHECK_VERSION(2,12,0) static VALUE rg_convert_bin_window_to_tree_coords(VALUE self, VALUE bx, VALUE by) { gint tx, ty; gtk_tree_view_convert_bin_window_to_tree_coords(_SELF(self), NUM2INT(bx), NUM2INT(by), &tx, &ty); return rb_ary_new3(2, INT2NUM(tx), INT2NUM(ty)); } static VALUE rg_convert_bin_window_to_widget_coords(VALUE self, VALUE bx, VALUE by) { gint wx, wy; gtk_tree_view_convert_bin_window_to_widget_coords(_SELF(self), NUM2INT(bx), NUM2INT(by), &wx, &wy); return rb_ary_new3(2, INT2NUM(wx), INT2NUM(wy)); } static VALUE rg_convert_tree_to_bin_window_coords(VALUE self, VALUE tx, VALUE ty) { gint bx, by; gtk_tree_view_convert_tree_to_bin_window_coords(_SELF(self), NUM2INT(tx), NUM2INT(ty), &bx, &by); return rb_ary_new3(2, INT2NUM(bx), INT2NUM(by)); } static VALUE rg_convert_tree_to_widget_coords(VALUE self, VALUE tx, VALUE ty) { gint wx, wy; gtk_tree_view_convert_tree_to_widget_coords(_SELF(self), NUM2INT(tx), NUM2INT(ty), &wx, &wy); return rb_ary_new3(2, INT2NUM(wx), INT2NUM(wy)); } static VALUE rg_convert_widget_to_bin_window_coords(VALUE self, VALUE wx, VALUE wy) { gint bx, by; gtk_tree_view_convert_widget_to_bin_window_coords(_SELF(self), NUM2INT(wx), NUM2INT(wy), &bx, &by); return rb_ary_new3(2, INT2NUM(bx), INT2NUM(by)); } static VALUE rg_convert_widget_to_tree_coords(VALUE self, VALUE wx, VALUE wy) { gint tx, ty; gtk_tree_view_convert_widget_to_tree_coords(_SELF(self), NUM2INT(wx), NUM2INT(wy), &tx, &ty); return rb_ary_new3(2, INT2NUM(tx), INT2NUM(ty)); } #endif static VALUE rg_enable_model_drag_dest(VALUE self, VALUE rbtargets, VALUE rbactions) { GtkTreeView *view = _SELF(self); GdkDragAction actions = RVAL2GFLAGS(rbactions, GDK_TYPE_DRAG_ACTION); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_tree_view_enable_model_drag_dest(view, targets, n, actions); g_free(targets); return self; } static VALUE rg_enable_model_drag_source(VALUE self, VALUE rbstart_button_mask, VALUE rbtargets, VALUE rbactions) { GtkTreeView *view = _SELF(self); GdkModifierType start_button_mask = RVAL2GFLAGS(rbstart_button_mask, GDK_TYPE_MODIFIER_TYPE); GdkDragAction actions = RVAL2GFLAGS(rbactions, GDK_TYPE_DRAG_ACTION); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES_ACCEPT_NIL(rbtargets, &n); if (targets == NULL) return self; gtk_tree_view_enable_model_drag_source(view, start_button_mask, targets, n, actions); g_free(targets); return self; } static VALUE rg_unset_rows_drag_source(VALUE self) { gtk_tree_view_unset_rows_drag_source(_SELF(self)); return self; } static VALUE rg_unset_rows_drag_dest(VALUE self) { gtk_tree_view_unset_rows_drag_dest(_SELF(self)); return self; } static VALUE rg_set_drag_dest_row(VALUE self, VALUE path, VALUE pos) { gtk_tree_view_set_drag_dest_row(_SELF(self), NIL_P(path)?NULL:RVAL2GTKTREEPATH(path), RVAL2GENUM(pos, GTK_TYPE_TREE_VIEW_DROP_POSITION)); return self; } static VALUE rg_drag_dest_row(VALUE self) { GtkTreePath* path = NULL; GtkTreeViewDropPosition pos; gtk_tree_view_get_drag_dest_row(_SELF(self), &path, &pos); return rb_ary_new3(2, path ? GTKTREEPATH2RVAL(path) : Qnil, GENUM2RVAL(pos, GTK_TYPE_TREE_VIEW_DROP_POSITION)); } static VALUE rg_get_dest_row_at_pos(VALUE self, VALUE drag_x, VALUE drag_y) { GtkTreePath* path; GtkTreeViewDropPosition pos; gboolean ret; ret = gtk_tree_view_get_dest_row_at_pos(_SELF(self), NUM2INT(drag_x), NUM2INT(drag_y), &path, &pos); return ret ? rb_ary_new3(2, path ? GTKTREEPATH2RVAL(path) : Qnil, GENUM2RVAL(pos, GTK_TYPE_TREE_VIEW_DROP_POSITION)) : Qnil; } static VALUE rg_create_row_drag_icon(VALUE self, VALUE path) { return GOBJ2RVAL(gtk_tree_view_create_row_drag_icon(_SELF(self), RVAL2GTKTREEPATH(path))); } /* We don't need this. GtkTreeViewSearchEqualFunc gtk_tree_view_get_search_equal_func (GtkTreeView *tree_view); */ static gboolean search_equal_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer func) { iter->user_data3 = model; return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(model), INT2NUM(column), CSTR2RVAL(key), GTKTREEITER2RVAL(iter))); } static VALUE rg_set_search_equal_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_view_set_search_equal_func(_SELF(self), (GtkTreeViewSearchEqualFunc)search_equal_func, (gpointer)func, NULL); return self; } /* * Optional Signals */ static VALUE treeview_signal_func(G_GNUC_UNUSED guint num, const GValue *values) { GtkTreeView* view = g_value_get_object(&values[0]); GtkTreeIter* iter = g_value_get_boxed(&values[1]); iter->user_data3 = gtk_tree_view_get_model(view); return rb_ary_new3(3, GOBJ2RVAL(view), GTKTREEITER2RVAL(iter), GVAL2RVAL(&values[2])); } static VALUE rg_set_cursor_on_cell(VALUE self, VALUE path, VALUE focus_column, VALUE focus_cell, VALUE start_editing) { gtk_tree_view_set_cursor_on_cell(_SELF(self), RVAL2GTKTREEPATH(path), NIL_P(focus_column) ? NULL : TREEVIEW_COL(focus_column), NIL_P(focus_cell) ? NULL : GTK_CELL_RENDERER(RVAL2GOBJ(focus_cell)), RVAL2CBOOL(start_editing)); return self; } /* How can I implement this? GtkTreeViewRowSeparatorFunc gtk_tree_view_get_row_separator_func (GtkTreeView *tree_view); */ static gboolean row_separator_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer func) { VALUE ret; iter->user_data3 = model; ret = rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(model), GTKTREEITER2RVAL(iter)); return CBOOL2RVAL(ret); } static VALUE rg_set_row_separator_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_view_set_row_separator_func(_SELF(self), row_separator_func, (gpointer)func, (GtkDestroyNotify)NULL); return self; } static VALUE rg_search_entry(VALUE self) { return GOBJ2RVAL(gtk_tree_view_get_search_entry(_SELF(self))); } static VALUE rg_set_search_entry(VALUE self, VALUE entry) { gtk_tree_view_set_search_entry(_SELF(self), RVAL2GOBJ(entry)); return self; } /* Can't define this. GtkTreeViewSearchPositionFunc gtk_tree_view_get_search_position_func (GtkTreeView *tree_view); */ struct callback_arg { VALUE callback; VALUE tree_view; VALUE search_dialog; }; static VALUE invoke_callback(VALUE data) { struct callback_arg *arg = (struct callback_arg *)data; rb_funcall(arg->callback, id_call, 2, arg->tree_view, arg->search_dialog); return Qnil; } static void search_position_func(GtkTreeView *tree_view, GtkWidget *search_dialog, gpointer func) { struct callback_arg arg; arg.callback = (VALUE)func; arg.tree_view = GOBJ2RVAL(tree_view); arg.search_dialog = GOBJ2RVAL(search_dialog); G_PROTECT_CALLBACK(invoke_callback, &arg); } static void remove_callback_reference(gpointer data) { G_CHILD_REMOVE(mGtk, (VALUE)data); } static VALUE rg_set_search_position_func(VALUE self) { VALUE func = rb_block_proc(); G_CHILD_ADD(mGtk, func); gtk_tree_view_set_search_position_func(_SELF(self), (GtkTreeViewSearchPositionFunc)search_position_func, (gpointer)func, (GDestroyNotify)remove_callback_reference); return self; } void Init_gtk_treeview(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_VIEW, "TreeView", mGtk); id_selection = rb_intern("selection"); id_model = rb_intern("model"); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(selection, 0); RG_DEF_METHOD(columns_autosize, 0); RG_DEF_METHOD(append_column, 1); RG_DEF_METHOD(remove_column, 1); RG_DEF_METHOD(insert_column, -1); RG_DEF_METHOD(get_column, 1); RG_DEF_METHOD(columns, 0); RG_DEF_METHOD(move_column_after, 2); RG_DEF_METHOD(set_column_drag_function, 0); RG_DEF_METHOD(scroll_to_point, 2); RG_DEF_METHOD(scroll_to_cell, 5); RG_DEF_METHOD(set_cursor, 3); RG_DEF_METHOD(cursor, 0); RG_DEF_METHOD(expand_all, 0); RG_DEF_METHOD(collapse_all, 0); RG_DEF_METHOD(expand_row, 2); RG_DEF_METHOD(collapse_row, 1); RG_DEF_METHOD(expand_to_path, 1); RG_DEF_METHOD(map_expanded_rows, 0); RG_DEF_METHOD_P(row_expanded, 1); RG_DEF_METHOD(get_path_at_pos, 2); RG_DEF_ALIAS("get_path", "get_path_at_pos"); RG_DEF_METHOD(get_cell_area, 2); RG_DEF_METHOD(get_background_area, 2); RG_DEF_METHOD(visible_rect, 0); RG_DEF_METHOD(visible_range, 0); RG_DEF_METHOD(bin_window, 0); RG_DEF_METHOD(widget_to_tree_coords, 2); RG_DEF_METHOD(tree_to_widget_coords, 2); #if GTK_CHECK_VERSION(2,12,0) RG_DEF_METHOD(convert_bin_window_to_tree_coords, 2); RG_DEF_METHOD(convert_bin_window_to_widget_coords, 2); RG_DEF_METHOD(convert_tree_to_bin_window_coords, 2); RG_DEF_METHOD(convert_tree_to_widget_coords, 2); RG_DEF_METHOD(convert_widget_to_bin_window_coords, 2); RG_DEF_METHOD(convert_widget_to_tree_coords, 2); #endif RG_DEF_METHOD(enable_model_drag_dest, 2); RG_DEF_METHOD(enable_model_drag_source, 3); RG_DEF_METHOD(unset_rows_drag_source, 0); RG_DEF_METHOD(unset_rows_drag_dest, 0); RG_DEF_METHOD(set_drag_dest_row, 2); RG_DEF_METHOD(drag_dest_row, 0); RG_DEF_METHOD(get_dest_row_at_pos, 2); RG_DEF_ALIAS("get_dest_row", "get_dest_row_at_pos"); RG_DEF_METHOD(create_row_drag_icon, 1); RG_DEF_METHOD(set_search_equal_func, 0); RG_DEF_METHOD(set_cursor_on_cell, 4); RG_DEF_METHOD(set_row_separator_func, 0); RG_DEF_METHOD(search_entry, 0); RG_DEF_METHOD(set_search_entry, 1); RG_DEF_METHOD(set_search_position_func, 0); /* Constants */ G_DEF_CLASS(GTK_TYPE_TREE_VIEW_DROP_POSITION, "DropPosition", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TREE_VIEW_DROP_POSITION, "GTK_TREE_VIEW_"); /* GtkTreeViewGridLines */ G_DEF_CLASS(GTK_TYPE_TREE_VIEW_GRID_LINES, "GridLines", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TREE_VIEW_GRID_LINES, "GTK_TREE_VIEW_"); /* Option Signals */ G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row-collapsed", (GValToRValSignalFunc)treeview_signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row-expanded", (GValToRValSignalFunc)treeview_signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "test-collapse-row", (GValToRValSignalFunc)treeview_signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "test-expand-row", (GValToRValSignalFunc)treeview_signal_func); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtksizegroup.c������������������������������������������������0000644�0001750�0001750�00000004077�12257552167�020373� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2005 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cSizeGroup #define _SELF(self) (GTK_SIZE_GROUP(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self, VALUE mode) { G_INITIALIZE(self, gtk_size_group_new(RVAL2GENUM(mode, GTK_TYPE_SIZE_GROUP_MODE))); return Qnil; } static VALUE rg_add_widget(VALUE self, VALUE widget) { gtk_size_group_add_widget(_SELF(self), GTK_WIDGET(RVAL2GOBJ(widget))); return self; } static VALUE rg_remove_widget(VALUE self, VALUE widget) { gtk_size_group_remove_widget(_SELF(self), GTK_WIDGET(RVAL2GOBJ(widget))); return self; } static VALUE rg_widgets(VALUE self) { return GSLIST2ARY(gtk_size_group_get_widgets(_SELF(self))); } void Init_gtk_size_group(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SIZE_GROUP, "SizeGroup", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(add_widget, 1); RG_DEF_METHOD(remove_widget, 1); RG_DEF_METHOD(widgets, 0); /* GtkSizeGroupMode */ G_DEF_CLASS(GTK_TYPE_SIZE_GROUP_MODE, "Mode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_SIZE_GROUP_MODE, "GTK_SIZE_GROUP_"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcolorbutton.c����������������������������������������������0000644�0001750�0001750�00000002736�12257552167�020716� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cColorButton static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE color; GtkWidget* widget; rb_scan_args(argc, argv, "01", &color); if (NIL_P(color)){ widget = gtk_color_button_new(); } else { widget = gtk_color_button_new_with_color(RVAL2GDKCOLOR(color)); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_colorbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_COLOR_BUTTON, "ColorButton", mGtk); RG_DEF_METHOD(initialize, -1); } ����������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkvruler.c���������������������������������������������������0000644�0001750�0001750�00000002542�11701304107�017634� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cVRuler static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_vruler_new()); return Qnil; } void Init_gtk_vruler(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VRULER, "VRuler", mGtk); RG_DEF_METHOD(initialize, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkdialog.c���������������������������������������������������0000644�0001750�0001750�00000016531�12257552167�017601� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cDialog #define _SELF(self) (GTK_DIALOG(RVAL2GOBJ(self))) static ID id_to_a; static VALUE rg_add_button(VALUE self, VALUE button_text, VALUE response_id) { const gchar *name; if (SYMBOL_P(button_text)) { name = rb_id2name(SYM2ID(button_text)); } else { name = RVAL2CSTR(button_text); } return GOBJ2RVAL(gtk_dialog_add_button(_SELF(self), name, RVAL2GENUM(response_id, GTK_TYPE_RESPONSE_TYPE))); } struct rbgtk_dialog_add_buttons_internal_args { VALUE self; VALUE buttons; }; static VALUE rbgtk_dialog_add_buttons_internal_body(VALUE value) { struct rbgtk_dialog_add_buttons_internal_args *args = (struct rbgtk_dialog_add_buttons_internal_args *)value; long i; long n = RARRAY_LEN(args->buttons); for (i = 0; i < n; i++) { VALUE button = rb_ary_to_ary(RARRAY_PTR(args->buttons)[i]); rg_add_button(args->self, RARRAY_PTR(button)[0], RARRAY_PTR(button)[1]); } return args->self; } static VALUE rbgtk_dialog_add_buttons_internal_ensure(VALUE value) { g_object_thaw_notify(RVAL2GOBJ(((struct rbgtk_dialog_add_buttons_internal_args *)value)->self)); return Qnil; } VALUE rbgtk_dialog_add_buttons_internal(VALUE self, VALUE buttons) { struct rbgtk_dialog_add_buttons_internal_args args = { self, buttons }; if (NIL_P(RARRAY_PTR(buttons)[0])) return self; g_object_freeze_notify(RVAL2GOBJ(self)); return rb_ensure(rbgtk_dialog_add_buttons_internal_body, (VALUE)&args, rbgtk_dialog_add_buttons_internal_ensure, (VALUE)&args); } static VALUE rg_add_buttons(int argc, VALUE *argv, VALUE self) { VALUE button_ary; rb_scan_args(argc, argv, "*", &button_ary); rbgtk_dialog_add_buttons_internal(self, button_ary); return self; } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE title, parent, flags, button_ary; rb_scan_args(argc, argv, "03*", &title, &parent, &flags, &button_ary); if (argc == 0){ RBGTK_INITIALIZE(self, gtk_dialog_new()); } else if (argc > 0){ GtkDialog* dialog = GTK_DIALOG(g_object_new(GTK_TYPE_DIALOG, NULL)); GtkDialogFlags gflags = NIL_P(flags) ? 0 : RVAL2GFLAGS(flags, GTK_TYPE_DIALOG_FLAGS); if (! NIL_P(title)) gtk_window_set_title(GTK_WINDOW(dialog), RVAL2CSTR(title)); if (! NIL_P(parent)) gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(RVAL2GOBJ(parent))); if (gflags & GTK_DIALOG_MODAL) gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); if (gflags & GTK_DIALOG_DESTROY_WITH_PARENT) gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE); if (gflags & GTK_DIALOG_NO_SEPARATOR) gtk_dialog_set_has_separator(dialog, FALSE); RBGTK_INITIALIZE(self, dialog); if (! NIL_P(button_ary)) rbgtk_dialog_add_buttons_internal(self, button_ary); } else { rb_raise(rb_eArgError, "invalid argument number"); } return Qnil; } static VALUE rg_run(VALUE self) { if (rb_block_given_p()){ VALUE ret = INT2NUM(gtk_dialog_run(_SELF(self))); rb_yield(ret); return ret; } else { return INT2NUM(gtk_dialog_run(_SELF(self))); } } static VALUE rg_response(VALUE self, VALUE response_id) { gtk_dialog_response(_SELF(self), NUM2INT(response_id)); return self; } static VALUE rg_add_action_widget(VALUE self, VALUE child, VALUE response_id) { gtk_dialog_add_action_widget(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)), NUM2INT(response_id)); return self; } static VALUE rg_set_default_response(VALUE self, VALUE response_id) { gtk_dialog_set_default_response(_SELF(self), NUM2INT(response_id)); return self; } static VALUE rg_set_response_sensitive(VALUE self, VALUE response_id, VALUE setting) { gtk_dialog_set_response_sensitive(_SELF(self), NUM2INT(response_id), RVAL2CBOOL(setting)); return self; } static VALUE rg_s_alternative_dialog_button_order_p(G_GNUC_UNUSED VALUE self, VALUE screen) { gboolean ret = gtk_alternative_dialog_button_order(NIL_P(screen) ? NULL : GDK_SCREEN(RVAL2GOBJ(screen))); return CBOOL2RVAL(ret); } /* Use gtk_dialog_set_alternative_button_order_from_array() instead. void gtk_dialog_set_alternative_button_order (GtkDialog *dialog, gint first_response_id, ...); */ static VALUE rg_set_alternative_button_order(VALUE self, VALUE rbnew_order) { GtkDialog *dialog = _SELF(self); long n; gint *new_order = RVAL2GINTS(rbnew_order, n); gtk_dialog_set_alternative_button_order_from_array(dialog, n, new_order); g_free(new_order); return self; } static VALUE rg_vbox(VALUE self) { return GOBJ2RVAL(_SELF(self)->vbox); } static VALUE rg_action_area(VALUE self) { return GOBJ2RVAL(_SELF(self)->action_area); } static VALUE rg_get_response(VALUE self, VALUE widget) { return INT2NUM(gtk_dialog_get_response_for_widget(_SELF(self), RVAL2GOBJ(widget))); } void Init_gtk_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_DIALOG, "Dialog", mGtk); id_to_a = rb_intern("to_a"); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(run, 0); RG_DEF_METHOD(response, 1); RG_DEF_METHOD(add_button, 2); RG_DEF_METHOD(add_buttons, -1); RG_DEF_METHOD(add_action_widget, 2); RG_DEF_METHOD(set_default_response, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "default_response"); RG_DEF_SMETHOD_P(alternative_dialog_button_order, 1); RG_DEF_METHOD(set_alternative_button_order, 1); RG_DEF_METHOD(set_response_sensitive, 2); RG_DEF_METHOD(vbox, 0); RG_DEF_METHOD(action_area, 0); RG_DEF_METHOD(get_response, 1); RG_DEF_ALIAS("get_response_for_widget", "get_response"); /* GtkDialogFlags */ G_DEF_CLASS(GTK_TYPE_DIALOG_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_DIALOG_FLAGS, "GTK_DIALOG_"); /* GtkResponseType */ G_DEF_CLASS(GTK_TYPE_RESPONSE_TYPE, "ResponseType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_RESPONSE_TYPE, "GTK_"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkkeyval.c���������������������������������������������������0000644�0001750�0001750�00000006033�11701304107�017567� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #include <gdk/gdkkeysyms.h> #define RG_TARGET_NAMESPACE mGdkKeyval static VALUE rg_m_to_name(G_GNUC_UNUSED VALUE self, VALUE keyval) { gchar* name = gdk_keyval_name(NUM2UINT(keyval)); return name ? CSTR2RVAL(name) : Qnil; } static VALUE rg_m_from_name(G_GNUC_UNUSED VALUE self, VALUE keyval_name) { return UINT2NUM(gdk_keyval_from_name(RVAL2CSTR(keyval_name))); } static VALUE rg_m_upper_p(G_GNUC_UNUSED VALUE self, VALUE keyval) { return CBOOL2RVAL(gdk_keyval_is_upper(NUM2UINT(keyval))); } static VALUE rg_m_lower_p(G_GNUC_UNUSED VALUE self, VALUE keyval) { return CBOOL2RVAL(gdk_keyval_is_lower(NUM2UINT(keyval))); } static VALUE rg_m_convert_case(G_GNUC_UNUSED VALUE self, VALUE symbol) { guint upper, lower; gdk_keyval_convert_case(NUM2UINT(symbol), &lower, &upper); return rb_ary_new3(2, UINT2NUM(lower), UINT2NUM(upper)); } static VALUE rg_m_to_upper(G_GNUC_UNUSED VALUE self, VALUE keyval) { return INT2NUM(gdk_keyval_to_upper(NUM2UINT(keyval))); } static VALUE rg_m_to_lower(G_GNUC_UNUSED VALUE self, VALUE keyval) { return INT2NUM(gdk_keyval_to_lower(NUM2UINT(keyval))); } static VALUE rg_m_to_unicode(G_GNUC_UNUSED VALUE self, VALUE keyval) { return UINT2NUM(gdk_keyval_to_unicode(NUM2UINT(keyval))); } static VALUE rg_m_from_unicode(G_GNUC_UNUSED VALUE self, VALUE wc) { VALUE unicode; if (TYPE(wc) == T_STRING) { unicode = NUM2UINT(rb_funcall(wc, rb_intern("[]"), 1, INT2FIX(0))); } else { unicode = NUM2UINT(wc); } return UINT2NUM(gdk_unicode_to_keyval(unicode)); } void Init_gtk_gdk_keyval(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Keyval"); RG_DEF_MODFUNC(to_name, 1); RG_DEF_MODFUNC(from_name, 1); RG_DEF_MODFUNC_P(upper, 1); RG_DEF_MODFUNC_P(lower, 1); RG_DEF_MODFUNC(convert_case, 1); RG_DEF_MODFUNC(to_upper, 1); RG_DEF_MODFUNC(to_lower, 1); RG_DEF_MODFUNC(to_unicode, 1); RG_DEF_MODFUNC(from_unicode, 1); #include "rbgdkkeysyms.h" } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtk.h���������������������������������������������������������0000644�0001750�0001750�00000011560�11701304107�016401� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef _RBGTK_H #define _RBGTK_H #include <rbgobject.h> #include <rbgtkmacros.h> #include <gtk/gtk.h> #include <rbgdk.h> #include <rbgtkconversions.h> #include <signal.h> #define RubyGtkContainerHookModule "RubyGtkContainerHook__" #define RBGTK_INITIALIZE(obj,gtkobj)\ (rbgtk_initialize_gtkobject(obj, GTK_OBJECT(gtkobj))) #define GTK_TYPE_ALLOCATION (gtk_allocation_get_type()) #define GTK_TYPE_ACCEL_KEY (gtk_accel_key_get_type()) #define GTK_TYPE_ACCEL_GROUP_ENTRY (gtk_accel_group_entry_get_type()) #define GTK_TYPE_BINDING_SET (gtk_bindingset_get_type()) #define GTK_TYPE_TEXT_APPEARANCE (gtk_text_appearance_get_type()) #define GTK_TYPE_RECENT_FILTER_INFO (gtk_recent_filter_info_get_type()) #define GTK_TYPE_RECENT_DATA (gtk_recent_data_get_type()) #ifndef GTK_TYPE_TARGET_LIST extern GType gtk_target_list_get_type(); #define GTK_TYPE_TARGET_LIST (gtk_target_list_get_type()) #endif RUBY_GTK2_VAR VALUE mGtk; /* * for gtk2.0/gtk2.2 */ #ifndef GTK_TYPE_CLIPBOARD #define GTK_TYPE_CLIPBOARD (rbgtk_clipboard_get_type()) #define RVAL2CLIPBOARD(obj) (rbgtk_get_clipboard(obj)) #define CLIPBOARD2RVAL(val) (rbgtk_make_clipboard(val)) extern GType rbgtk_clipboard_get_type(); extern GtkClipboard* rbgtk_get_clipboard(VALUE obj); extern VALUE rbgtk_make_clipboard(GtkClipboard* gobj); #else #define RVAL2CLIPBOARD(obj) (GTK_CLIPBOARD(RVAL2GOBJ(obj))) #define CLIPBOARD2RVAL(val) (GOBJ2RVAL(val)) #endif #ifndef GTK_TYPE_TREE_ROW_REFERENCE #define GTK_TYPE_TREE_ROW_REFERENCE (rbgtk_tree_row_reference_get_type()) #define RVAL2TREEROWREFERENCE(obj) (rbgtk_get_tree_row_reference(obj)) extern GType rbgtk_tree_row_reference_get_type(); extern GtkTreeRowReference* rbgtk_get_tree_row_reference(VALUE obj); #else #define RVAL2TREEROWREFERENCE(obj) ((GtkTreeRowReference*)(RVAL2BOXED(obj, GTK_TYPE_TREE_ROW_REFERENCE))) #endif /* * for gtk */ extern void rbgtk_initialize_gtkobject(VALUE obj, GtkObject *gtkobj); extern void exec_callback(GtkWidget *widget, gpointer proc); extern GType gtk_allocation_get_type(void); extern GType gtk_accel_key_get_type(void); extern GType gtk_accel_group_entry_get_type(void); extern GType gtk_bindingset_get_type(void); extern GType gtk_text_appearance_get_type(void); extern GType gtk_recent_filter_info_get_type(void); extern GType gtk_recent_data_get_type(void); /* * Gtk::TreeIter callback */ typedef void (*rbgtkiter_set_value_func)(void *model, GtkTreeIter *iter, gint column, GValue *value); extern void rbgtk_register_treeiter_set_value_func(GType, rbgtkiter_set_value_func); /* * Gtk::SelectionData */ extern void rbgtk_atom2selectiondata(VALUE type, VALUE size, VALUE src, GdkAtom* gtype, void** data, gint* format, gint* length); extern void rbgtk_atom2selectiondata_free(GdkAtom gtype, void* data); /* * Gtk::Drag */ #define RVAL2GTKTARGETENTRIES(value, n) rbgtk_rval2gtktargetentries(value, n) extern GtkTargetEntry *rbgtk_rval2gtktargetentries(VALUE value, long *n); #define RVAL2GTKTARGETENTRIES_ACCEPT_NIL(value, n) rbgtk_rval2gtktargetentries_accept_nil(value, n) GtkTargetEntry *rbgtk_rval2gtktargetentries_accept_nil(VALUE value, long *n); /* Only for backwards compatibility. */ GtkTargetEntry *rbgtk_get_target_entry(VALUE targets); /* * Gtk::Container */ extern void rbgtkcontainer_register_child_property_setter(GType gtype, const char* prop_name, RValueToGValueFunc func); extern void rbgtkcontainer_register_child_property_getter(GType gtype, const char* prop_name, GValueToRValueFunc func); /* * Dialog */ extern VALUE rbgtk_dialog_add_buttons_internal(VALUE self, VALUE button_ary); #endif /* _RBGTK_H */ ������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/gtk2.def��������������������������������������������������������0000644�0001750�0001750�00000001355�11701304107�016447� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXPORTS Init_gtk2 mGdk DATA rb_cGdkColor DATA mGtk DATA exec_callback rbgdk_rval2gdkpoints rbgdk_rval2gdkatoms rbgdk_rval2gdkpixbufglist gdk_atom_get_type gdk_geometry_get_type gdk_region_get_type gdk_windowattr_get_type get_gdkatom get_gdkevent gtk_accel_group_entry_get_type gtk_accel_key_get_type gtk_target_list_get_type gtk_bindingset_get_type make_gdkevent rbgtk_atom2selectiondata rbgtk_atom2selectiondata_free rbgtk_rval2gtktargetentries rbgtk_rval2gtktargetentries_accept_nil rbgtk_get_target_entry rbgtk_initialize_gtkobject rbgtk_register_treeiter_set_value_func gtk_text_appearance_get_type rbgtk_dialog_add_buttons_internal �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcellrendereraccel.c����������������������������������������0000644�0001750�0001750�00000003037�12257552167�021775� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCellRendererAccel #define _SELF(s) (GTK_CELL_RENDERER_ACCEL(RVAL2GOBJ(s))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_accel_new()); return Qnil; } void Init_gtk_cellrendereraccel(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_ACCEL, "CellRendererAccel", mGtk); RG_DEF_METHOD(initialize, 0); /* GtkCellRendererAccelMode */ G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_ACCEL_MODE, "Mode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_CELL_RENDERER_ACCEL_MODE, "GTK_CELL_RENDERER_ACCEL_"); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkdisplaymanager.c�������������������������������������������0000644�0001750�0001750�00000003135�12257552167�021316� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cDisplayManager #define _SELF(obj) GDK_DISPLAY_MANAGER(RVAL2GOBJ(obj)) static VALUE rg_s_get(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_display_manager_get()); } static VALUE rg_displays(VALUE self) { return GSLIST2ARYF(gdk_display_manager_list_displays(_SELF(self))); } /* Move to Gdk::Display. static VALUE gdkdisplaymanager_get_core_pointer(VALUE self) { return GOBJ2RVAL(gdk_display_get_core_pointer(_SELF(self))); } */ void Init_gtk_gdk_display_manager(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DISPLAY_MANAGER, "DisplayManager", mGdk); RG_DEF_SMETHOD(get, 0); RG_DEF_METHOD(displays, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkbuildable.c������������������������������������������������0000644�0001750�0001750�00000010317�11701304107�020237� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #if GTK_CHECK_VERSION(2, 12, 0) #define RG_TARGET_NAMESPACE cBuildable #define _SELF(self) (GTK_BUILDABLE(RVAL2GOBJ(self))) #define RVAL2BUILDER(obj) (GTK_BUILDER(RVAL2GOBJ(obj))) static VALUE rg_builder_name(VALUE self) { return CSTR2RVAL(gtk_buildable_get_name(_SELF(self))); } static VALUE rg_set_builder_name(VALUE self, VALUE name) { gtk_buildable_set_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_add_child(int argc, VALUE *argv, VALUE self) { VALUE builder, child, type; rb_scan_args(argc, argv, "21", &builder, &child, &type); gtk_buildable_add_child(_SELF(self), RVAL2BUILDER(builder), RVAL2GOBJ(child), RVAL2CSTR_ACCEPT_NIL(type)); return self; } static VALUE rg_set_buildable_property(VALUE self, VALUE rb_builder, VALUE rb_name, VALUE rb_value) { GtkBuilder *builder; const gchar *name; GValue value = G_VALUE_INIT; builder = RVAL2BUILDER(rb_builder); name = RVAL2CSTR(rb_name); rbgobj_initialize_gvalue(&value, rb_value); gtk_buildable_set_buildable_property(_SELF(self), builder, name, &value); return self; } static VALUE rg_construct_child(VALUE self, VALUE builder, VALUE name) { return GOBJ2RVAL(gtk_buildable_construct_child(_SELF(self), RVAL2BUILDER(builder), RVAL2CSTR(name))); } /* customized buildable is not supported yet. gboolean gtk_buildable_custom_tag_start (GtkBuildable *buildable, GtkBuilder *builder, GObject *child, const gchar *tagname, GMarkupParser *parser, gpointer *data); void gtk_buildable_custom_tag_end (GtkBuildable *buildable, GtkBuilder *builder, GObject *child, const gchar *tagname, gpointer *data); void gtk_buildable_custom_finished (GtkBuildable *buildable, GtkBuilder *builder, GObject *child, const gchar *tagname, gpointer data); void gtk_buildable_parser_finished (GtkBuildable *buildable, GtkBuilder *builder); */ static VALUE rg_get_internal_child(VALUE self, VALUE builder, VALUE child_name) { return GOBJ2RVAL(gtk_buildable_get_internal_child(_SELF(self), RVAL2BUILDER(builder), RVAL2CSTR(child_name))); } #endif void Init_gtk_buildable(VALUE mGtk) { #if GTK_CHECK_VERSION(2, 12, 0) VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BUILDABLE, "Buildable", mGtk); RG_DEF_METHOD(builder_name, 0); RG_DEF_METHOD(set_builder_name, 1); RG_DEF_METHOD(add_child, -1); RG_DEF_METHOD(set_buildable_property, 3); RG_DEF_METHOD(construct_child, 2); RG_DEF_METHOD(get_internal_child, 2); G_DEF_SETTERS(RG_TARGET_NAMESPACE); #endif } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkpango.c����������������������������������������������������0000644�0001750�0001750�00000013573�12257552167�017431� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #include "rbpango.h" #define RG_TARGET_NAMESPACE mPango static VALUE rg_m_context(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE screen, ret; rb_scan_args(argc, argv, "01", &screen); if (NIL_P(screen)){ ret = GOBJ2RVAL(gdk_pango_context_get()); } else { ret = GOBJ2RVAL(gdk_pango_context_get_for_screen(GDK_SCREEN(RVAL2GOBJ(screen)))); } return ret; } static VALUE gdkpango_context_set_colormap(VALUE self, VALUE colormap) { gdk_pango_context_set_colormap(PANGO_CONTEXT(RVAL2GOBJ(self)), GDK_COLORMAP(RVAL2GOBJ(colormap))); return self; } static VALUE gdkpango_attr_embossed_initialize(VALUE self, VALUE embossed) { DATA_PTR(self) = gdk_pango_attr_embossed_new(RVAL2CBOOL(embossed)); return Qnil; } static VALUE gdkpango_attr_embossed_value(VALUE self) { return CBOOL2RVAL(((GdkPangoAttrEmbossed*)RVAL2ATTR(self))->embossed); } static VALUE gdkpango_attr_stipple_initialize(VALUE self, VALUE stipple) { DATA_PTR(self) = gdk_pango_attr_stipple_new(GDK_BITMAP(RVAL2GOBJ(stipple))); return Qnil; } static VALUE gdkpango_attr_stipple_value(VALUE self) { return GOBJ2RVAL(((GdkPangoAttrStipple*)RVAL2ATTR(self))->stipple); } static VALUE gdkpango_layout_get_clip_region(VALUE self, VALUE rbx_origin, VALUE rby_origin, VALUE rbindex_ranges) { PangoLayout *layout = PANGO_LAYOUT(RVAL2GOBJ(self)); gint x_origin = NUM2INT(rbx_origin); gint y_origin = NUM2INT(rby_origin); long n; gint *index_ranges = RVAL2GINTS(rbindex_ranges, n); GdkRegion *result; if (n % 2 != 0) { g_free(index_ranges); rb_raise(rb_eArgError, "an even number of byte indexes must be given"); } result = gdk_pango_layout_get_clip_region(layout, x_origin, y_origin, index_ranges, n / 2); g_free(index_ranges); return BOXED2RVAL(result, GDK_TYPE_REGION); } static VALUE gdkpango_layout_line_get_clip_region(VALUE self, VALUE rbx_origin, VALUE rby_origin, VALUE rbindex_ranges) { PangoLayoutLine *line = (PangoLayoutLine *)RVAL2BOXED(self, PANGO_TYPE_LAYOUT_LINE); gint x_origin = NUM2INT(rbx_origin); gint y_origin = NUM2INT(rby_origin); long n; gint *index_ranges = RVAL2GINTS(rbindex_ranges, n); GdkRegion *result; if (n % 2 != 0) { g_free(index_ranges); rb_raise(rb_eArgError, "an even number of byte indexes must be given"); } result = gdk_pango_layout_line_get_clip_region(line, x_origin, y_origin, index_ranges, n / 2); g_free(index_ranges); return BOXED2RVAL(result, GDK_TYPE_REGION); } #if GTK_CHECK_VERSION(2, 12, 0) static VALUE gdkpango_attr_emboss_color_initialize(VALUE self, VALUE color) { DATA_PTR(self) = gdk_pango_attr_emboss_color_new(RVAL2GDKCOLOR(color)); return Qnil; } static VALUE gdkpango_attr_emboss_color_value(VALUE self) { return BOXED2RVAL(&(((GdkPangoAttrEmbossColor *)RVAL2ATTR(self))->color), PANGO_TYPE_COLOR); } #endif void Init_gtk_gdk_pango(VALUE mGdk) { VALUE klass; PangoAttribute* tmpattr; GdkColor color; VALUE RG_TARGET_NAMESPACE = 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")); RG_DEF_MODFUNC(context, -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 } �������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkitem.c�����������������������������������������������������0000644�0001750�0001750�00000003167�11701304107�017257� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cItem /* * Item */ static VALUE rg_select(VALUE self) { gtk_item_select(GTK_ITEM(RVAL2GOBJ(self))); return self; } static VALUE rg_deselect(VALUE self) { gtk_item_deselect(GTK_ITEM(RVAL2GOBJ(self))); return self; } static VALUE rg_toggle(VALUE self) { gtk_item_toggle(GTK_ITEM(RVAL2GOBJ(self))); return self; } void Init_gtk_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ITEM, "Item", mGtk); RG_DEF_METHOD(select, 0); RG_DEF_METHOD(deselect, 0); RG_DEF_METHOD(toggle, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkeditable.c�������������������������������������������������0000644�0001750�0001750�00000010156�11701304107�020066� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mEditable static VALUE rg_select_region(VALUE self, VALUE start, VALUE end) { gtk_editable_select_region(GTK_EDITABLE(RVAL2GOBJ(self)), NUM2INT(start), NUM2INT(end)); return self; } static VALUE rg_selection_bounds(VALUE self) { gint start, end; gboolean ret; ret = gtk_editable_get_selection_bounds(GTK_EDITABLE(RVAL2GOBJ(self)), &start, &end); return ret ? rb_ary_new3(2, INT2NUM(start), INT2NUM(end)) : Qnil; } static VALUE rg_insert_text(VALUE self, VALUE new_text, VALUE pos) { gint p = NUM2INT(pos); StringValue(new_text); gtk_editable_insert_text(GTK_EDITABLE(RVAL2GOBJ(self)), RSTRING_PTR(new_text), RSTRING_LEN(new_text), &p); return INT2NUM(p); } static VALUE rg_delete_text(VALUE self, VALUE start, VALUE end) { gtk_editable_delete_text(GTK_EDITABLE(RVAL2GOBJ(self)), NUM2INT(start), NUM2INT(end)); return self; } static VALUE rg_get_chars(VALUE self, VALUE start, VALUE end) { return CSTR2RVAL_FREE( gtk_editable_get_chars(GTK_EDITABLE(RVAL2GOBJ(self)), /* check s */ NUM2INT(start), NUM2INT(end))); /* check start,end */ } static VALUE rg_delete_selection(VALUE self) { gtk_editable_delete_selection(GTK_EDITABLE(RVAL2GOBJ(self))); return self; } static VALUE rg_position(VALUE self) { return INT2NUM(gtk_editable_get_position(GTK_EDITABLE(RVAL2GOBJ(self)))); } static VALUE rg_set_position(VALUE self, VALUE position) { gtk_editable_set_position(GTK_EDITABLE(RVAL2GOBJ(self)), NUM2INT(position)); return self; } static VALUE rg_set_editable(VALUE self, VALUE editable) { gtk_editable_set_editable(GTK_EDITABLE(RVAL2GOBJ(self)), RVAL2CBOOL(editable)); return self; } static VALUE rg_editable_p(VALUE self) { return CBOOL2RVAL(gtk_editable_get_editable(GTK_EDITABLE(RVAL2GOBJ(self)))); } static VALUE rg_cut_clipboard(VALUE self) { gtk_editable_cut_clipboard(GTK_EDITABLE(RVAL2GOBJ(self))); return self; } static VALUE rg_copy_clipboard(VALUE self) { gtk_editable_copy_clipboard(GTK_EDITABLE(RVAL2GOBJ(self))); return self; } static VALUE rg_paste_clipboard(VALUE self) { gtk_editable_paste_clipboard(GTK_EDITABLE(RVAL2GOBJ(self))); return self; } void Init_gtk_editable(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_EDITABLE, "Editable", mGtk); RG_DEF_METHOD(select_region, 2); RG_DEF_METHOD(selection_bounds, 0); RG_DEF_METHOD(insert_text, 2); RG_DEF_METHOD(delete_text, 2); RG_DEF_METHOD(get_chars, 2); RG_DEF_METHOD(delete_selection, 0); RG_DEF_METHOD(position, 0); RG_DEF_METHOD(set_position, 1); RG_DEF_METHOD(set_editable, 1); RG_DEF_METHOD_P(editable, 0); RG_DEF_METHOD(copy_clipboard, 0); RG_DEF_METHOD(cut_clipboard, 0); RG_DEF_METHOD(paste_clipboard, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktextbuffer.c�����������������������������������������������0000644�0001750�0001750�00000065065�12257552167�020526� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTextBuffer #define _SELF(s) (GTK_TEXT_BUFFER(RVAL2GOBJ(s))) #define RVAL2ITR(i) (GtkTextIter*)RVAL2BOXED(i, GTK_TYPE_TEXT_ITER) #define ITR2RVAL(i) (BOXED2RVAL(i, GTK_TYPE_TEXT_ITER)) #define RVAL2MARK(m) (GTK_TEXT_MARK(RVAL2GOBJ(m))) #define N_RVAL2CSTR(text) (NIL_P(text) ? NULL : RVAL2CSTR(text)) #define RVAL2TAG(t) (GTK_TEXT_TAG(RVAL2GOBJ(t))) #define RVAL2ANCHOR(a) (GTK_TEXT_CHILD_ANCHOR(RVAL2GOBJ(a))) #define ATOM2RVAL(a) (BOXED2RVAL(a, GDK_TYPE_ATOM)) static ID id_tagtable; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE table; rb_scan_args(argc, argv, "01", &table); if (NIL_P(table)) G_INITIALIZE(self, gtk_text_buffer_new(NULL)); else { G_CHILD_SET(self, id_tagtable, table); G_INITIALIZE(self, gtk_text_buffer_new(GTK_TEXT_TAG_TABLE(RVAL2GOBJ(table)))); } return Qnil; } static VALUE rg_line_count(VALUE self) { return INT2NUM(gtk_text_buffer_get_line_count(_SELF(self))); } static VALUE rg_char_count(VALUE self) { return INT2NUM(gtk_text_buffer_get_char_count(_SELF(self))); } static VALUE txt_set_text(VALUE self, VALUE text) { StringValue(text); gtk_text_buffer_set_text(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text)); return self; } static VALUE rg_backspace(VALUE self, VALUE iter, VALUE interactive, VALUE default_editable) { return CBOOL2RVAL(gtk_text_buffer_backspace(_SELF(self), RVAL2ITR(iter), RVAL2CBOOL(interactive), RVAL2CBOOL(default_editable))); } static VALUE rg_insert_at_cursor(VALUE self, VALUE text) { StringValue(text); gtk_text_buffer_insert_at_cursor(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text)); return self; } static VALUE rg_insert_interactive(VALUE self, VALUE iter, VALUE text, VALUE editable) { StringValue(text); return CBOOL2RVAL(gtk_text_buffer_insert_interactive(_SELF(self), RVAL2ITR(iter), RSTRING_PTR(text), RSTRING_LEN(text), RVAL2CBOOL(editable))); } static VALUE rg_insert_interactive_at_cursor(VALUE self, VALUE text, VALUE editable) { StringValue(text); return CBOOL2RVAL(gtk_text_buffer_insert_interactive_at_cursor(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text), RVAL2CBOOL(editable))); } static VALUE rg_insert_range(VALUE self, VALUE iter, VALUE start, VALUE end) { gtk_text_buffer_insert_range(_SELF(self), RVAL2ITR(iter), RVAL2ITR(start), RVAL2ITR(end)); return self; } static VALUE rg_insert_range_interactive(VALUE self, VALUE iter, VALUE start, VALUE end, VALUE editable) { return CBOOL2RVAL(gtk_text_buffer_insert_range_interactive(_SELF(self), RVAL2ITR(iter), RVAL2ITR(start), RVAL2ITR(end), RVAL2CBOOL(editable))); } static VALUE rg_delete(VALUE self, VALUE start, VALUE end) { gtk_text_buffer_delete(GTK_TEXT_BUFFER(RVAL2GOBJ(self)), RVAL2ITR(start), RVAL2ITR(end)); return self; } static VALUE rg_delete_interactive(VALUE self, VALUE start, VALUE end, VALUE editable) { return CBOOL2RVAL(gtk_text_buffer_delete_interactive(_SELF(self), RVAL2ITR(start), RVAL2ITR(end), RVAL2CBOOL(editable))); } static VALUE rg_get_text(int argc, VALUE *argv, VALUE self) { VALUE start, end, include_hidden_chars; GtkTextIter start_iter, end_iter; GtkTextBuffer* buffer = _SELF(self); gchar* ret; VALUE result; rb_scan_args(argc, argv, "03", &start, &end, &include_hidden_chars); if (NIL_P(start)) gtk_text_buffer_get_start_iter(buffer, &start_iter); if (NIL_P(end)) gtk_text_buffer_get_end_iter(buffer, &end_iter); if (NIL_P(include_hidden_chars)) include_hidden_chars = Qfalse; ret = gtk_text_buffer_get_text( buffer, NIL_P(start) ? &start_iter : RVAL2ITR(start), NIL_P(end) ? &end_iter : RVAL2ITR(end), RVAL2CBOOL(include_hidden_chars)); result = CSTR2RVAL(ret); g_free(ret); return result; } static VALUE txt_get_text_all(VALUE self) { return rg_get_text(0, NULL, self); } static VALUE rg_get_slice(int argc, VALUE *argv, VALUE self) { VALUE start, end, include_hidden_chars; GtkTextIter start_iter, end_iter; GtkTextBuffer* buffer = _SELF(self); gchar* ret; VALUE result; rb_scan_args(argc, argv, "03", &start, &end, &include_hidden_chars); if (NIL_P(start)) gtk_text_buffer_get_start_iter(buffer, &start_iter); if (NIL_P(end)) gtk_text_buffer_get_end_iter(buffer, &end_iter); if (NIL_P(include_hidden_chars)) include_hidden_chars = Qfalse; ret = gtk_text_buffer_get_slice( buffer, NIL_P(start) ? &start_iter : RVAL2ITR(start), NIL_P(end) ? &end_iter : RVAL2ITR(end), RVAL2CBOOL(include_hidden_chars)); result = CSTR2RVAL(ret); g_free(ret); return result; } static VALUE rg_slice(VALUE self) { return rg_get_slice(0, NULL, self); } static VALUE rg_insert_pixbuf(VALUE self, VALUE iter, VALUE pixbuf) { G_CHILD_ADD(self, iter); G_CHILD_ADD(iter, pixbuf); if (RVAL2CBOOL(ruby_debug)) rb_warning("Gtk::TextBuffer#insert_pixbuf is deprecated. Use Gtk::TextBuffer#insert instead."); gtk_text_buffer_insert_pixbuf(_SELF(self), RVAL2ITR(iter), GDK_PIXBUF(RVAL2GOBJ(pixbuf))); return self; } static VALUE rg_insert_child_anchor(VALUE self, VALUE iter, VALUE anchor) { G_CHILD_ADD(self, iter); G_CHILD_ADD(iter, anchor); if (RVAL2CBOOL(ruby_debug)) rb_warning("Gtk::TextBuffer#insert_child_anchor is deprecated. Use Gtk::TextBuffer#insert instead."); gtk_text_buffer_insert_child_anchor(_SELF(self), RVAL2ITR(iter), GTK_TEXT_CHILD_ANCHOR(RVAL2GOBJ(anchor))); return self; } static VALUE rg_create_child_anchor(VALUE self, VALUE iter) { VALUE ret = GOBJ2RVAL(gtk_text_buffer_create_child_anchor(_SELF(self), RVAL2ITR(iter))); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_create_mark(VALUE self, VALUE name, VALUE where, VALUE left_gravity) { VALUE ret = GOBJ2RVAL(gtk_text_buffer_create_mark(_SELF(self), NIL_P(name) ? NULL : RVAL2CSTR(name), RVAL2ITR(where), RVAL2CBOOL(left_gravity))); G_CHILD_ADD(self, ret); return ret; } #if GTK_CHECK_VERSION(2,12,0) static VALUE rg_add_mark(VALUE self, VALUE mark, VALUE where) { gtk_text_buffer_add_mark(_SELF(self), RVAL2MARK(mark), RVAL2ITR(where)); return self; } #endif static VALUE rg_delete_mark(VALUE self, VALUE mark) { if (rb_obj_is_kind_of(mark, GTYPE2CLASS(GTK_TYPE_TEXT_MARK))){ G_CHILD_REMOVE(self, mark); gtk_text_buffer_delete_mark(_SELF(self), RVAL2MARK(mark)); } else { G_CHILD_REMOVE(self, GOBJ2RVAL(gtk_text_buffer_get_mark(_SELF(self), RVAL2CSTR(mark)))); gtk_text_buffer_delete_mark_by_name(_SELF(self), RVAL2CSTR(mark)); } return self; } static VALUE rg_get_mark(VALUE self, VALUE name) { return GOBJ2RVAL(gtk_text_buffer_get_mark(_SELF(self), RVAL2CSTR(name))); } /* static VALUE rg_get_insert(VALUE self) { return GOBJ2RVAL(gtk_text_buffer_get_insert(_SELF(self))); } */ static VALUE rg_selection_bound(VALUE self) { return GOBJ2RVAL(gtk_text_buffer_get_selection_bound(_SELF(self))); } static VALUE rg_place_cursor(VALUE self, VALUE where) { gtk_text_buffer_place_cursor(_SELF(self), RVAL2ITR(where)); return self; } static VALUE rg_select_range(VALUE self, VALUE ins, VALUE bound) { gtk_text_buffer_select_range(_SELF(self), RVAL2ITR(ins), RVAL2ITR(bound)); return self; } static VALUE rg_get_iter_at_child_anchor(VALUE self, VALUE anchor) { GtkTextIter iter; gtk_text_buffer_get_iter_at_child_anchor(_SELF(self), &iter, RVAL2ANCHOR(anchor)); return ITR2RVAL(&iter); } static VALUE rg_modified_p(VALUE self) { return CBOOL2RVAL(gtk_text_buffer_get_modified(_SELF(self))); } static VALUE rg_set_modified(VALUE self, VALUE setting) { gtk_text_buffer_set_modified(_SELF(self), RVAL2CBOOL(setting)); return setting; } static VALUE rg_add_selection_clipboard(VALUE self, VALUE clipboard) { G_CHILD_ADD(self, clipboard); gtk_text_buffer_add_selection_clipboard(_SELF(self), RVAL2CLIPBOARD(clipboard)); return self; } static VALUE rg_remove_selection_clipboard(VALUE self, VALUE clipboard) { G_CHILD_REMOVE(self, clipboard); gtk_text_buffer_remove_selection_clipboard(_SELF(self), RVAL2CLIPBOARD(clipboard)); return self; } static VALUE rg_deserialize(VALUE self, VALUE content_buffer, VALUE format, VALUE iter, VALUE data) { GError* error = NULL; gboolean ret; StringValue(data); ret = gtk_text_buffer_deserialize(_SELF(self), _SELF(content_buffer), RVAL2ATOM(format), RVAL2ITR(iter), (const guint8*)RSTRING_PTR(data), (gsize)RSTRING_LEN(data), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_deserialize_can_create_tags_p(VALUE self, VALUE format) { return CBOOL2RVAL(gtk_text_buffer_deserialize_get_can_create_tags(_SELF(self), RVAL2ATOM(format))); } static VALUE rg_deserialize_set_can_create_tags(VALUE self, VALUE format, VALUE can_create_tags) { gtk_text_buffer_deserialize_set_can_create_tags(_SELF(self), RVAL2ATOM(format), RVAL2CBOOL(can_create_tags)); return self; } static VALUE rg_deserialize_formats(VALUE self) { gint i; gint n_formats; GdkAtom* atoms = gtk_text_buffer_get_deserialize_formats(_SELF(self), &n_formats); VALUE ary = rb_ary_new(); for (i = 0; i < n_formats; i++){ rb_ary_push(ary, ATOM2RVAL(atoms[i])); } return ary; } static VALUE rg_serialize_formats(VALUE self) { gint i; gint n_formats; GdkAtom* atoms = gtk_text_buffer_get_serialize_formats(_SELF(self), &n_formats); VALUE ary = rb_ary_new(); for (i = 0; i < n_formats; i++){ rb_ary_push(ary, ATOM2RVAL(atoms[i])); } return ary; } struct callback_arg { VALUE callback; int argc; VALUE *argv; }; static VALUE invoke_callback(VALUE data) { struct callback_arg *arg = (struct callback_arg *)data; return rb_funcall2(arg->callback, id_call, arg->argc, arg->argv); } static gboolean deserialize_func(GtkTextBuffer *register_buffer, GtkTextBuffer *content_buffer, GtkTextIter *iter, const guint8 *data, gsize length, gboolean create_tags, gpointer func, G_GNUC_UNUSED GError **error) { VALUE result; VALUE argv[5]; struct callback_arg arg; argv[0] = GOBJ2RVAL(register_buffer); argv[1] = GOBJ2RVAL(content_buffer); argv[2] = ITR2RVAL(iter); argv[3] = RBG_STRING_SET_UTF8_ENCODING(rb_str_new((char*)data, length)); argv[4] = CBOOL2RVAL(create_tags); arg.callback = (VALUE)func; arg.argc = 5; arg.argv = argv; result = G_PROTECT_CALLBACK(invoke_callback, &arg); return NIL_P(rb_errinfo()) ? RVAL2CBOOL(result) : FALSE; } static void remove_callback_reference(gpointer callback) { G_CHILD_REMOVE(mGtk, (VALUE)callback); } static VALUE rg_register_deserialize_format(VALUE self, VALUE mime_type) { VALUE block = rb_block_proc(); GdkAtom atom; G_CHILD_ADD(mGtk, block); atom = gtk_text_buffer_register_deserialize_format(_SELF(self), (const gchar*)RVAL2CSTR(mime_type), (GtkTextBufferDeserializeFunc)deserialize_func, (gpointer)block, (GDestroyNotify)remove_callback_reference); return ATOM2RVAL(atom); } static VALUE rg_register_deserialize_target(VALUE self, VALUE tagset_name) { return ATOM2RVAL(gtk_text_buffer_register_deserialize_tagset(_SELF(self), (const gchar*)(NIL_P(tagset_name) ? NULL : RVAL2CSTR(tagset_name)))); } static guint8* serialize_func(GtkTextBuffer *register_buffer, GtkTextBuffer *content_buffer, GtkTextIter *start, GtkTextIter *end, gsize *length, gpointer func) { VALUE result; VALUE argv[4]; struct callback_arg arg; argv[0] = GOBJ2RVAL(register_buffer); argv[1] = GOBJ2RVAL(content_buffer); argv[2] = ITR2RVAL(start); argv[3] = ITR2RVAL(end); arg.callback = (VALUE)func; arg.argc = 4; arg.argv = argv; /* This should return data as String */ result = G_PROTECT_CALLBACK(invoke_callback, &arg); StringValue(result); *length = RSTRING_LEN(result); return (guint8*)(NIL_P(rb_errinfo()) ? RSTRING_PTR(result) : NULL); } static VALUE rg_register_serialize_format(VALUE self, VALUE mime_type) { VALUE block = rb_block_proc(); GdkAtom atom; G_CHILD_ADD(mGtk, block); atom = gtk_text_buffer_register_serialize_format(_SELF(self), (const gchar*)RVAL2CSTR(mime_type), (GtkTextBufferSerializeFunc)serialize_func, (gpointer)block, (GDestroyNotify)remove_callback_reference); return ATOM2RVAL(atom); } static VALUE rg_register_serialize_target(VALUE self, VALUE tagset_name) { return ATOM2RVAL(gtk_text_buffer_register_serialize_tagset(_SELF(self), NIL_P(tagset_name) ? NULL : RVAL2CSTR(tagset_name))); } static VALUE rg_serialize(VALUE self, VALUE content_buffer, VALUE format, VALUE start, VALUE end) { gsize length; guint8* ret = gtk_text_buffer_serialize(_SELF(self), _SELF(content_buffer), RVAL2ATOM(format), RVAL2ITR(start), RVAL2ITR(end), &length); return RBG_STRING_SET_UTF8_ENCODING(rb_str_new((char*)ret, length)); } static VALUE rg_unregister_deserialize_format(VALUE self, VALUE format) { gtk_text_buffer_unregister_deserialize_format(_SELF(self), RVAL2ATOM(format)); return self; } static VALUE rg_unregister_serialize_format(VALUE self, VALUE format) { gtk_text_buffer_unregister_serialize_format(_SELF(self), RVAL2ATOM(format)); return self; } static VALUE rg_cut_clipboard(VALUE self, VALUE clipboard, VALUE default_editable) { G_CHILD_ADD(self, clipboard); gtk_text_buffer_cut_clipboard(_SELF(self), RVAL2CLIPBOARD(clipboard), RVAL2CBOOL(default_editable)); return self; } static VALUE rg_copy_clipboard(VALUE self, VALUE clipboard) { G_CHILD_ADD(self, clipboard); gtk_text_buffer_copy_clipboard(_SELF(self), RVAL2CLIPBOARD(clipboard)); return self; } static VALUE rg_paste_clipboard(VALUE self, VALUE clipboard, VALUE location, VALUE default_editable) { G_CHILD_ADD(self, clipboard); gtk_text_buffer_paste_clipboard(_SELF(self), RVAL2CLIPBOARD(clipboard), NIL_P(location) ? NULL : RVAL2ITR(location), RVAL2CBOOL(default_editable)); return self; } static VALUE rg_selection_bounds(VALUE self) { GtkTextIter start, end; gboolean ret = gtk_text_buffer_get_selection_bounds(_SELF(self), &start, &end); return rb_ary_new3(3, ITR2RVAL(&start), ITR2RVAL(&end), CBOOL2RVAL(ret)); } static VALUE rg_delete_selection(int argc, VALUE *argv, VALUE self) { VALUE interactive, default_editable; rb_scan_args(argc, argv, "20", &interactive, &default_editable); return CBOOL2RVAL(gtk_text_buffer_delete_selection(_SELF(self), RVAL2CBOOL(interactive), RVAL2CBOOL(default_editable))); } static VALUE rg_end_user_action(VALUE self) { gtk_text_buffer_end_user_action(_SELF(self)); return self; } static VALUE rg_begin_user_action(VALUE self) { gtk_text_buffer_begin_user_action(_SELF(self)); if (rb_block_given_p()) rb_ensure(rb_yield, self, rg_end_user_action, self); return self; } static VALUE rg_start_iter(VALUE self) { GtkTextIter iter; gtk_text_buffer_get_start_iter(_SELF(self), &iter); return ITR2RVAL(&iter); } static VALUE rg_end_iter(VALUE self) { GtkTextIter iter; gtk_text_buffer_get_end_iter(_SELF(self), &iter); return ITR2RVAL(&iter); } static VALUE rg_move_mark(VALUE self, VALUE mark, VALUE where) { if (rb_obj_is_kind_of(mark, GTYPE2CLASS(GTK_TYPE_TEXT_MARK))) gtk_text_buffer_move_mark(_SELF(self), RVAL2MARK(mark), RVAL2ITR(where)); else gtk_text_buffer_move_mark_by_name(_SELF(self), RVAL2CSTR(mark), RVAL2ITR(where)); return self; } static VALUE rg_create_tag(VALUE self, VALUE tag_name, VALUE properties) { GtkTextTag *tag; VALUE ret; tag = gtk_text_tag_new(NIL_P(tag_name) ? (gchar*)NULL : RVAL2CSTR(tag_name)); gtk_text_tag_table_add (gtk_text_buffer_get_tag_table(_SELF(self)), tag); G_SET_PROPERTIES(GOBJ2RVAL(tag), properties); ret = GOBJ2RVAL(tag); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_insert(int argc, VALUE *argv, VALUE self) { VALUE where, value, tags; gint start_offset; GtkTextIter start; int i; rb_scan_args(argc, argv, "2*", &where, &value, &tags); G_CHILD_ADD(self, where); G_CHILD_ADD(self, value); if (rb_obj_is_kind_of(value, GTYPE2CLASS(GDK_TYPE_PIXBUF))){ gtk_text_buffer_insert_pixbuf(_SELF(self), RVAL2ITR(where), GDK_PIXBUF(RVAL2GOBJ(value))); } else if (rb_obj_is_kind_of(value, GTYPE2CLASS(GTK_TYPE_TEXT_CHILD_ANCHOR))){ gtk_text_buffer_insert_child_anchor(_SELF(self), RVAL2ITR(where), GTK_TEXT_CHILD_ANCHOR(RVAL2GOBJ(value))); } else { start_offset = gtk_text_iter_get_offset(RVAL2ITR(where)); StringValue(value); gtk_text_buffer_insert(_SELF(self), RVAL2ITR(where), RSTRING_PTR(value), RSTRING_LEN(value)); if (RARRAY_LEN(tags) == 0) return self; /* TODO: Do we really want to do this before we know that everything * below passed without any errors? */ G_CHILD_ADD(self, tags); gtk_text_buffer_get_iter_at_offset(_SELF(self), &start, start_offset); for(i = 0; i < RARRAY_LEN(tags); i++) { GtkTextTag *tag; if (rb_obj_is_kind_of(RARRAY_PTR(tags)[i], GTYPE2CLASS(GTK_TYPE_TEXT_TAG))) { tag = RVAL2GOBJ(RARRAY_PTR(tags)[i]); } else { tag = gtk_text_tag_table_lookup(_SELF(self)->tag_table, RVAL2CSTR(RARRAY_PTR(tags)[i])); if (tag == NULL) { g_warning ("%s: no tag with name '%s'!", G_STRLOC, RVAL2CSTR(RARRAY_PTR(tags)[i])); return self; } } gtk_text_buffer_apply_tag(_SELF(self), tag, &start, RVAL2ITR(where)); } } return self; } static VALUE rg_insert_with_tags(int argc, VALUE *argv, VALUE self) { if (RVAL2CBOOL(ruby_debug)) rb_warning("Gtk::TextBuffer#insert_with_tags is deprecated. Use Gtk::TextBuffer#insert instead."); rg_insert(argc, argv, self); return self; } static VALUE rg_apply_tag(VALUE self, VALUE tag, VALUE start, VALUE end) { if (rb_obj_is_kind_of(tag, GTYPE2CLASS(GTK_TYPE_TEXT_TAG))) gtk_text_buffer_apply_tag(_SELF(self), RVAL2TAG(tag), RVAL2ITR(start), RVAL2ITR(end)); else gtk_text_buffer_apply_tag_by_name(_SELF(self), RVAL2CSTR(tag), RVAL2ITR(start), RVAL2ITR(end)); return self; } static VALUE rg_remove_tag(VALUE self, VALUE tag, VALUE start, VALUE end) { if (rb_obj_is_kind_of(tag, GTYPE2CLASS(GTK_TYPE_TEXT_TAG))) gtk_text_buffer_remove_tag(_SELF(self), RVAL2TAG(tag), RVAL2ITR(start), RVAL2ITR(end)); else gtk_text_buffer_remove_tag_by_name(_SELF(self), RVAL2CSTR(tag), RVAL2ITR(start), RVAL2ITR(end)); return self; } static VALUE rg_remove_all_tags(VALUE self, VALUE start, VALUE end) { gtk_text_buffer_remove_all_tags(_SELF(self), RVAL2ITR(start), RVAL2ITR(end)); return self; } static VALUE rg_get_iter_at_line_offset(VALUE self, VALUE line_number, VALUE char_offset) { GtkTextIter iter; gtk_text_buffer_get_iter_at_line_offset(_SELF(self), &iter, NUM2INT(line_number), NUM2INT(char_offset)); return ITR2RVAL(&iter); } static VALUE rg_get_iter_at_line_index(VALUE self, VALUE line_number, VALUE byte_index) { GtkTextIter iter; gtk_text_buffer_get_iter_at_line_index(_SELF(self), &iter, NUM2INT(line_number), NUM2INT(byte_index)); return ITR2RVAL(&iter); } static VALUE rg_get_iter_at_offset(VALUE self, VALUE char_offset) { GtkTextIter iter; gtk_text_buffer_get_iter_at_offset(_SELF(self), &iter, NUM2INT(char_offset)); return ITR2RVAL(&iter); } static VALUE rg_get_iter_at_line(VALUE self, VALUE line_number) { GtkTextIter iter; gtk_text_buffer_get_iter_at_line(_SELF(self), &iter, NUM2INT(line_number)); return ITR2RVAL(&iter); } static VALUE rg_bounds(VALUE self) { GtkTextIter start, end; VALUE result; gtk_text_buffer_get_bounds(_SELF(self), &start, &end); result = rb_ary_new(); rb_ary_push(result, ITR2RVAL(&start)); rb_ary_push(result, ITR2RVAL(&end)); return result; } static VALUE rg_get_iter_at_mark(VALUE self, VALUE mark) { GtkTextIter iter; gtk_text_buffer_get_iter_at_mark(_SELF(self), &iter, RVAL2MARK(mark)); return ITR2RVAL(&iter); } void Init_gtk_textbuffer(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_BUFFER, "TextBuffer", mGtk); id_tagtable = rb_intern("tagtable"); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(line_count, 0); RG_DEF_METHOD(char_count, 0); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "text", txt_set_text, 1); RG_DEF_METHOD(insert, -1); RG_DEF_METHOD(insert_with_tags, -1); RG_DEF_METHOD(backspace, 3); RG_DEF_METHOD(insert_at_cursor, 1); RG_DEF_METHOD(insert_interactive, 3); RG_DEF_METHOD(insert_interactive_at_cursor, 2); RG_DEF_METHOD(insert_range, 3); RG_DEF_METHOD(insert_range_interactive, 4); RG_DEF_METHOD(delete, 2); RG_DEF_METHOD(delete_interactive, 3); RG_DEF_METHOD(get_text, -1); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "text", txt_get_text_all, 0); RG_DEF_METHOD(get_slice, -1); RG_DEF_METHOD(slice, 0); RG_DEF_METHOD(insert_pixbuf, 2); RG_DEF_METHOD(insert_child_anchor, 2); RG_DEF_METHOD(create_child_anchor, 1); RG_DEF_METHOD(create_mark, 3); #if GTK_CHECK_VERSION(2,12,0) RG_DEF_METHOD(add_mark, 2); #endif RG_DEF_METHOD(delete_mark, 1); RG_DEF_METHOD(get_mark, 1); /* Comment out because this method's name is very bad. Use Gtk::TextBuffer#get_mark("insert") instead. RG_DEF_METHOD(get_insert, 0); */ RG_DEF_METHOD(selection_bound, 0); RG_DEF_METHOD(place_cursor, 1); RG_DEF_METHOD(select_range, 2); RG_DEF_METHOD_P(modified, 0); RG_DEF_METHOD(set_modified, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "modified"); RG_DEF_METHOD(add_selection_clipboard, 1); RG_DEF_METHOD(remove_selection_clipboard, 1); RG_DEF_METHOD(deserialize, 4); RG_DEF_METHOD_P(deserialize_can_create_tags, 1); RG_DEF_METHOD(deserialize_set_can_create_tags, 2); RG_DEF_METHOD(deserialize_formats, 0); RG_DEF_METHOD(serialize_formats, 0); RG_DEF_METHOD(register_deserialize_format, 1); RG_DEF_METHOD(register_deserialize_target, 1); RG_DEF_METHOD(register_serialize_format, 1); RG_DEF_METHOD(register_serialize_target, 1); RG_DEF_METHOD(serialize, 4); RG_DEF_METHOD(unregister_deserialize_format, 1); RG_DEF_METHOD(unregister_serialize_format, 1); RG_DEF_METHOD(cut_clipboard, 2); RG_DEF_METHOD(copy_clipboard, 1); RG_DEF_METHOD(paste_clipboard, 3); RG_DEF_METHOD(selection_bounds, 0); RG_DEF_METHOD(delete_selection, -1); RG_DEF_METHOD(begin_user_action, 0); RG_DEF_METHOD(end_user_action, 0); RG_DEF_METHOD(start_iter, 0); RG_DEF_METHOD(end_iter, 0); RG_DEF_METHOD(get_iter_at_line_offset, 2); RG_DEF_METHOD(get_iter_at_line_index, 2); RG_DEF_METHOD(get_iter_at_offset, 1); RG_DEF_METHOD(get_iter_at_line, 1); RG_DEF_METHOD(bounds, 0); RG_DEF_METHOD(get_iter_at_mark, 1); RG_DEF_METHOD(move_mark, 2); RG_DEF_METHOD(get_iter_at_child_anchor, 1); RG_DEF_METHOD(create_tag, 2); RG_DEF_METHOD(apply_tag, 3); RG_DEF_METHOD(remove_tag, 3); RG_DEF_METHOD(remove_all_tags, 2); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkpixmap.c���������������������������������������������������0000644�0001750�0001750�00000017741�12257552167�017624� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef HAVE_XREADBITMAPFILEDATA #include <X11/Xlib.h> #endif /* HAVE_XREADBITMAPFILEDATA */ #define RG_TARGET_NAMESPACE cPixmap static VALUE rg_initialize(VALUE self, VALUE win, VALUE w, VALUE h, VALUE depth) { G_INITIALIZE(self, gdk_pixmap_new(GDK_WINDOW(RVAL2GOBJ(win)), NUM2INT(w), NUM2INT(h), NUM2INT(depth))); return Qnil; } static VALUE rg_s_create_from_data(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE win, data, w, h, depth, fg, bg, ret; rb_scan_args(argc, argv, "43", &win, &data, &w, &h, &depth, &fg, &bg); StringValue(data); if (NIL_P(depth)){ ret = GOBJ2RVAL(gdk_bitmap_create_from_data(NIL_P(win) ? NULL : GDK_WINDOW(RVAL2GOBJ(win)), RVAL2CSTR(data), NUM2INT(w), NUM2INT(h))); } else { ret = GOBJ2RVAL(gdk_pixmap_create_from_data(NIL_P(win) ? NULL : GDK_WINDOW(RVAL2GOBJ(win)), RVAL2CSTR(data), NUM2INT(w), NUM2INT(h), NUM2INT(depth), RVAL2GDKCOLOR(fg), RVAL2GDKCOLOR(bg))); } return ret; } static VALUE rg_s_create_from_xpm(G_GNUC_UNUSED VALUE self, VALUE win, VALUE color, VALUE fname) { GdkPixmap *result; GdkBitmap *mask; result = gdk_pixmap_create_from_xpm(GDK_WINDOW(RVAL2GOBJ(win)), &mask, RVAL2GDKCOLOR(color), RVAL2CSTR(fname)); if (result == NULL) rb_raise(rb_eArgError, "Pixmap not created from %s", RVAL2CSTR(fname)); return rb_assoc_new(GOBJ2RVAL(result), GOBJ2RVAL(mask)); } static VALUE rg_s_create_from_xpm_d(G_GNUC_UNUSED VALUE self, VALUE win, VALUE tcolor, VALUE data) { GdkPixmap *result; GdkBitmap *mask; const gchar **buf = RVAL2STRV(data); result = gdk_pixmap_create_from_xpm_d(GDK_WINDOW(RVAL2GOBJ(win)), &mask, RVAL2GDKCOLOR(tcolor), (gchar **)buf); g_free(buf); return rb_assoc_new(GOBJ2RVAL(result), GOBJ2RVAL(mask)); } static VALUE rg_s_colormap_create_from_xpm(G_GNUC_UNUSED VALUE self, VALUE win, VALUE colormap, VALUE tcolor, VALUE fname) { GdkPixmap *result; GdkBitmap *mask; result = gdk_pixmap_colormap_create_from_xpm(NIL_P(win) ? NULL : GDK_WINDOW(RVAL2GOBJ(win)), GDK_COLORMAP(RVAL2GOBJ(colormap)), &mask, RVAL2GDKCOLOR(tcolor), RVAL2CSTR(fname)); if (result == NULL) rb_raise(rb_eArgError, "Pixmap not created from %s", RVAL2CSTR(fname)); return rb_assoc_new(GOBJ2RVAL(result), GOBJ2RVAL(mask)); } static VALUE rg_s_colormap_create_from_xpm_d(G_GNUC_UNUSED VALUE self, VALUE win, VALUE colormap, VALUE tcolor, VALUE data) { GdkPixmap *result; GdkBitmap *mask; const gchar **buf = RVAL2STRV(data); result = gdk_pixmap_colormap_create_from_xpm_d(NIL_P(win) ? NULL : GDK_WINDOW(RVAL2GOBJ(win)), GDK_COLORMAP(RVAL2GOBJ(colormap)), &mask, RVAL2GDKCOLOR(tcolor), (gchar **)buf); return rb_assoc_new(GOBJ2RVAL(result), GOBJ2RVAL(mask)); } #ifdef HAVE_XREADBITMAPFILEDATA static VALUE rg_s_create_from_xbm(VALUE self, VALUE win, VALUE fname) { GdkBitmap *new; unsigned char *data; unsigned int width, height; int x, y; StringValue(fname); if (XReadBitmapFileData(RVAL2CSTR(fname), &width, &height, &data, &x, &y)) rb_raise(rb_eArgError, "Bitmap not created from %s", RVAL2CSTR(fname)); new = gdk_bitmap_create_from_data(GDK_WINDOW(RVAL2GOBJ(win)), (const gchar*)data, width, height); XFree(data); return GOBJ2RVAL(new); } #endif /* HAVE_XREADBITMAPFILEDATA */ /* From X Window System Interaction */ /* Gdk::Window.foreign_new(anid) Gdk::Window.foreign_new(display, anid) # Since GTK+-2.2 Gdk::Window.foreign_new(screen, anid, width, height, depth) # Since GTK+-2.10 */ static VALUE rg_s_foreign_new(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE arg[5]; GdkPixmap* win = NULL; rb_scan_args(argc, argv, "14", &arg[0], &arg[1], &arg[2], &arg[3], &arg[4]); switch(argc) { case 1: win = gdk_pixmap_foreign_new(RVAL2GDKNATIVEWINDOW(arg[0])); break; case 2: win = gdk_pixmap_foreign_new_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(arg[0])), RVAL2GDKNATIVEWINDOW(arg[1])); break; case 5: win = gdk_pixmap_foreign_new_for_screen(GDK_SCREEN(RVAL2GOBJ(arg[0])), RVAL2GDKNATIVEWINDOW(arg[1]), /* anid */ NUM2INT(arg[2]), /* width */ NUM2INT(arg[3]), /* height */ NUM2INT(arg[4])); /* depth */ break; default: break; } return win ? GOBJ2RVAL(win) : Qnil; } static VALUE rg_s_lookup(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE arg[2]; GdkPixmap* win = NULL; rb_scan_args(argc, argv, "11", &arg[0], &arg[1]); switch(argc) { case 1: win = gdk_pixmap_lookup(RVAL2GDKNATIVEWINDOW(arg[0])); break; case 2: win = gdk_pixmap_lookup_for_display(RVAL2GOBJ(arg[0]), RVAL2GDKNATIVEWINDOW(arg[1])); break; default: break; } if (win == NULL) return Qnil; else { return GOBJ2RVAL(win); } } void Init_gtk_gdk_pixmap(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PIXMAP, "Pixmap", mGdk); RG_DEF_METHOD(initialize, 4); RG_DEF_SMETHOD(create_from_data, -1); RG_DEF_SMETHOD(create_from_xpm, 3); RG_DEF_SMETHOD(create_from_xpm_d, 3); RG_DEF_SMETHOD(colormap_create_from_xpm, 4); RG_DEF_SMETHOD(colormap_create_from_xpm_d, 4); #ifdef HAVE_XREADBITMAPFILEDATA RG_DEF_SMETHOD(create_from_xbm, 2); #endif /* HAVE_XREADBITMAPFILEDATA */ #ifdef GDK_WINDOWING_X11 G_DEF_CLASS3("GdkPixmapImplX11", "PixmapImplX11", mGdk); #elif defined(GDK_WINDOWING_WIN32) G_DEF_CLASS3("GdkPixmapImplWin32", "PixmapImplWin32", mGdk); #elif defined(GDK_WINDOWING_FB) G_DEF_CLASS3("GdkPixmapFB", "PixmapFB", mGdk); #endif RG_DEF_SMETHOD(foreign_new, -1); RG_DEF_SMETHOD(lookup, -1); } �������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkseparatortoolitem.c����������������������������������������0000644�0001750�0001750�00000002404�12257552167�022111� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cSeparatorToolItem static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_separator_tool_item_new()); return Qnil; } void Init_gtk_separatortoolitem(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SEPARATOR_TOOL_ITEM, "SeparatorToolItem", mGtk); RG_DEF_METHOD(initialize, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktargetlist.c�����������������������������������������������0000644�0001750�0001750�00000006617�12257552167�020530� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTargetList #define _SELF(r) ((GtkTargetList*)RVAL2BOXED(r, GTK_TYPE_TARGET_LIST)) static VALUE rg_initialize(VALUE self, VALUE rbtargets) { long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); GtkTargetList *list = gtk_target_list_new(targets, n); g_free(targets); G_INITIALIZE(self, list); return Qnil; } static VALUE rg_add(VALUE self, VALUE target, VALUE flags, VALUE info) { gtk_target_list_add(_SELF(self), RVAL2ATOM(target), FIX2UINT(flags), FIX2UINT(info)); return self; } static VALUE rg_add_table(VALUE self, VALUE rbtargets) { GtkTargetList *list = _SELF(self); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_target_list_add_table(list, targets, n); g_free(targets); return self; } static VALUE rg_add_text_targets(VALUE self, VALUE info) { gtk_target_list_add_text_targets(_SELF(self), NUM2UINT(info)); return self; } static VALUE rg_add_image_targets(VALUE self, VALUE info, VALUE writable) { gtk_target_list_add_image_targets(_SELF(self), NUM2UINT(info), RVAL2CBOOL(writable)); return self; } static VALUE rg_add_uri_targets(VALUE self, VALUE info) { gtk_target_list_add_uri_targets(_SELF(self), NUM2UINT(info)); return self; } static VALUE rg_add_rich_text_targets(VALUE self, VALUE info, VALUE deserializable, VALUE buffer) { gtk_target_list_add_rich_text_targets(_SELF(self), NUM2UINT(info), RVAL2CBOOL(deserializable), GTK_TEXT_BUFFER(RVAL2GOBJ(buffer))); return self; } static VALUE rg_remove(VALUE self, VALUE target) { gtk_target_list_remove(_SELF(self), RVAL2ATOM(target)); return self; } static VALUE rg_find(VALUE self, VALUE target) { guint info; gboolean ret = gtk_target_list_find(_SELF(self), RVAL2ATOM(target), &info); return ret ? INT2NUM(info) : Qnil; } void Init_gtk_target_list(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TARGET_LIST, "TargetList", mGtk); rbgobj_boxed_not_copy_obj(GTK_TYPE_TARGET_LIST); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(add, 3); RG_DEF_METHOD(add_table, 1); RG_DEF_METHOD(add_text_targets, 1); RG_DEF_METHOD(add_image_targets, 2); RG_DEF_METHOD(add_uri_targets, 1); RG_DEF_METHOD(add_rich_text_targets, 3); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(find, 1); } �����������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcellrendererspinner.c��������������������������������������0000644�0001750�0001750�00000002560�11701304107�022362� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #if GTK_CHECK_VERSION(2,20,0) #define RG_TARGET_NAMESPACE cCellRendererSpinner #define _SELF(s) (GTK_CELL_RENDERER_SPINNER(RVAL2GOBJ(s))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_spinner_new()); return Qnil; } #endif void Init_gtk_cellrendererspinner(VALUE mGtk) { #if GTK_CHECK_VERSION(2,20,0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_SPINNER, "CellRendererSpinner", mGtk); RG_DEF_METHOD(initialize, 0); #endif } ������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrcstyle.c��������������������������������������������������0000644�0001750�0001750�00000011572�11701304107�020005� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRcStyle #define _SELF(rc) (GTK_RC_STYLE(RVAL2GOBJ(rc))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_rc_style_new()); return Qnil; } static VALUE rg_name(VALUE self) { return CSTR2RVAL(_SELF(self)->name); } static VALUE rg_set_name(VALUE self, VALUE name) { _SELF(self)->name = g_strdup(RVAL2CSTR(name)); return self; } static VALUE rg_bg_pixmap_name(VALUE self, VALUE idx) { int i = NUM2INT(idx); if (i < 0 || 5 < i) rb_raise(rb_eArgError, "state out of range"); return CSTR2RVAL(_SELF(self)->bg_pixmap_name[i]); } static VALUE rg_set_bg_pixmap_name(VALUE self, VALUE idx, VALUE bg_pixmap_name) { int i = NUM2INT(idx); if (i < 0 || 5 < i) rb_raise(rb_eArgError, "state out of range"); _SELF(self)->bg_pixmap_name[i] = g_strdup(RVAL2CSTR(bg_pixmap_name)); return self; } static VALUE rg_font_desc(VALUE self) { PangoFontDescription* desc = _SELF(self)->font_desc; return BOXED2RVAL(desc, PANGO_TYPE_FONT_DESCRIPTION); } static VALUE rg_set_font_desc(VALUE self, VALUE font_desc) { _SELF(self)->font_desc = (PangoFontDescription*)RVAL2BOXED(font_desc, PANGO_TYPE_FONT_DESCRIPTION); return self; } static VALUE rg_color_flags(VALUE self, VALUE rb_state_type) { GtkStateType state_type; state_type = RVAL2GTKSTATETYPE(rb_state_type); return GTKRCFLAGS2RVAL(_SELF(self)->color_flags[state_type]); } static VALUE rg_set_color_flags(VALUE self, VALUE rb_state_type, VALUE flags) { GtkStateType state_type; state_type = RVAL2GTKSTATETYPE(rb_state_type); _SELF(self)->color_flags[state_type] = RVAL2GTKRCFLAGS(flags); return self; } #define DEFINE_STYLE_COLOR(type) \ static VALUE \ rcstyle_set_ ## type(VALUE self, VALUE idx, VALUE r, VALUE g, VALUE b) \ { \ GdkColor *color; \ int i = NUM2INT(idx); \ \ if (i < 0 || 5 < i) rb_raise(rb_eArgError, "state out of range"); \ color = &(_SELF(self) -> type [i]); \ color->red = NUM2INT(r); \ color->green = NUM2INT(g); \ color->blue = NUM2INT(b); \ return self;\ } \ static VALUE \ rcstyle_ ## type(VALUE self, VALUE idx) \ { \ int i = NUM2INT(idx); \ \ if (i < 0 || 5 < i) rb_raise(rb_eArgError, "state out of range"); \ return BOXED2RVAL(&_SELF(self)-> type [i], GDK_TYPE_COLOR); \ } \ DEFINE_STYLE_COLOR(fg); DEFINE_STYLE_COLOR(bg); DEFINE_STYLE_COLOR(text); DEFINE_STYLE_COLOR(base); static VALUE rg_xthickness(VALUE self) { return INT2NUM(_SELF(self)->xthickness); } static VALUE rg_set_xthickness(VALUE self, VALUE xthickness) { _SELF(self)->xthickness = NUM2INT(xthickness); return self; } static VALUE rg_ythickness(VALUE self) { return INT2NUM(_SELF(self)->ythickness); } static VALUE rg_set_ythickness(VALUE self, VALUE ythickness) { _SELF(self)->ythickness = NUM2INT(ythickness); return self; } void Init_gtk_rcstyle(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RC_STYLE, "RcStyle", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(color_flags, 1); RG_DEF_METHOD(set_color_flags, 2); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(set_name, 1); RG_DEF_METHOD(bg_pixmap_name, 1); RG_DEF_METHOD(set_bg_pixmap_name, 2); RG_DEF_METHOD(font_desc, 0); RG_DEF_METHOD(set_font_desc, 1); rb_define_method(RG_TARGET_NAMESPACE, "fg", rcstyle_fg, 1); rb_define_method(RG_TARGET_NAMESPACE, "bg", rcstyle_bg, 1); rb_define_method(RG_TARGET_NAMESPACE, "text", rcstyle_text, 1); rb_define_method(RG_TARGET_NAMESPACE, "base", rcstyle_base, 1); rb_define_method(RG_TARGET_NAMESPACE, "set_fg", rcstyle_set_fg, 4); rb_define_method(RG_TARGET_NAMESPACE, "set_bg", rcstyle_set_bg, 4); rb_define_method(RG_TARGET_NAMESPACE, "set_text", rcstyle_set_text, 4); rb_define_method(RG_TARGET_NAMESPACE, "set_base", rcstyle_set_base, 4); RG_DEF_METHOD(xthickness, 0); RG_DEF_METHOD(ythickness, 0); RG_DEF_METHOD(set_xthickness, 1); RG_DEF_METHOD(set_ythickness, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkbox.c������������������������������������������������������0000644�0001750�0001750�00000007762�11701304107�017116� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cBox #define _SELF(self) (GTK_BOX(RVAL2GOBJ(self))) #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) static void box_pack_start_or_end(int argc, VALUE *argv, VALUE self, int start) { VALUE arg0, arg1, arg2, arg3; gint expand, fill, padding; GtkWidget *widget, *child; expand = fill = Qtrue; padding = 0; switch (rb_scan_args(argc, argv, "13", &arg0, &arg1, &arg2, &arg3)) { case 4: padding = NUM2INT(arg3); case 3: fill = RVAL2CBOOL(arg2); case 2: expand = RVAL2CBOOL(arg1); default: child = GTK_WIDGET(RVAL2GOBJ(arg0)); G_CHILD_ADD(self, arg0); break; } widget = GTK_WIDGET(RVAL2GOBJ(self)); if (start) gtk_box_pack_start(_SELF(self), child, expand, fill, padding); else gtk_box_pack_end(_SELF(self), child, expand, fill, padding); } static VALUE rg_pack_start(int argc, VALUE *argv, VALUE self) { box_pack_start_or_end(argc, argv, self, 1); return self; } static VALUE rg_pack_end(int argc, VALUE *argv, VALUE self) { box_pack_start_or_end(argc, argv, self, 0); return self; } static VALUE rg_pack_start_defaults(VALUE self, VALUE widget) { gtk_box_pack_start_defaults(_SELF(self), RVAL2WIDGET(widget)); return self; } static VALUE rg_pack_end_defaults(VALUE self, VALUE widget) { gtk_box_pack_end_defaults(_SELF(self), RVAL2WIDGET(widget)); return self; } static VALUE rg_reorder_child(VALUE self, VALUE child, VALUE pos) { gtk_box_reorder_child(_SELF(self), RVAL2WIDGET(child), NUM2INT(pos)); return self; } static VALUE rg_query_child_packing(VALUE self, VALUE child) { gboolean expand, fill; guint padding; GtkPackType pack_type; VALUE ary; gtk_box_query_child_packing(_SELF(self), RVAL2WIDGET(child), &expand, &fill, &padding, &pack_type); ary = rb_ary_new2(4); rb_ary_push(ary, expand == FALSE ? Qfalse : Qtrue); rb_ary_push(ary, fill == FALSE ? Qfalse : Qtrue); rb_ary_push(ary, INT2NUM(padding)); rb_ary_push(ary, GENUM2RVAL(pack_type, GTK_TYPE_PACK_TYPE)); return ary; } static VALUE rg_set_child_packing(VALUE self, VALUE child, VALUE expand, VALUE fill, VALUE padding, VALUE pack_type) { gtk_box_set_child_packing(_SELF(self), RVAL2WIDGET(child), RVAL2CBOOL(expand), RVAL2CBOOL(fill), NUM2UINT(padding), RVAL2GENUM(pack_type, GTK_TYPE_PACK_TYPE)); return self; } void Init_gtk_box(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BOX, "Box", mGtk); RG_DEF_METHOD(pack_start, -1); RG_DEF_METHOD(pack_end, -1); RG_DEF_METHOD(pack_start_defaults, 1); RG_DEF_METHOD(pack_end_defaults, 1); RG_DEF_METHOD(reorder_child, 2); RG_DEF_METHOD(query_child_packing, 1); RG_DEF_METHOD(set_child_packing, 5); } ��������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkdevice.c���������������������������������������������������0000644�0001750�0001750�00000014347�11701304107�017542� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cDevice #define _SELF(self) (GDK_DEVICE(RVAL2GOBJ(self))) /* Methods */ static VALUE rg_s_list(G_GNUC_UNUSED VALUE self) { /* Owned by GDK */ return GLIST2ARY(gdk_devices_list()); } static VALUE rg_s_set_extension_events(G_GNUC_UNUSED VALUE self, VALUE window, VALUE mask, VALUE mode) { gdk_input_set_extension_events(GDK_WINDOW(RVAL2GOBJ(window)), NUM2INT(mask), FIX2INT(mode)); return Qnil; } static VALUE rg_set_source(VALUE self, VALUE source) { gdk_device_set_source(_SELF(self), RVAL2GENUM(source, GDK_TYPE_INPUT_SOURCE)); return self; } static VALUE rg_set_mode(VALUE self, VALUE mode) { return CBOOL2RVAL(gdk_device_set_mode(_SELF(self), RVAL2GENUM(mode, GDK_TYPE_INPUT_MODE))); } static VALUE rg_set_key(VALUE self, VALUE index, VALUE keyval, VALUE modifiers) { gdk_device_set_key(_SELF(self), NUM2UINT(index), NUM2UINT(keyval), RVAL2GFLAGS(modifiers, GDK_TYPE_MODIFIER_TYPE)); return self; } static VALUE rg_set_axis_use(VALUE self, VALUE index, VALUE use) { gdk_device_set_axis_use(_SELF(self), NUM2UINT(index), RVAL2GENUM(use, GDK_TYPE_AXIS_USE)); return self; } static VALUE rg_s_core_pointer(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_device_get_core_pointer()); } static VALUE rg_get_state(VALUE self, VALUE window) { gdouble axes[2]; GdkModifierType mask; gdk_device_get_state(_SELF(self), GDK_WINDOW(RVAL2GOBJ(window)), axes, &mask); return rb_ary_new3(3, rb_float_new(axes[0]), rb_float_new(axes[1]), GFLAGS2RVAL(mask, GDK_TYPE_MODIFIER_TYPE)); } static VALUE rg_get_history(VALUE self, VALUE window, VALUE start, VALUE stop) { gboolean ret; GdkTimeCoord** events; gint i, n_events; VALUE ary = Qnil; ret = gdk_device_get_history(_SELF(self), GDK_WINDOW(RVAL2GOBJ(window)), NUM2UINT(start), NUM2UINT(stop), &events, &n_events); if (ret){ ary = rb_ary_new(); for (i = 0; i < n_events; i++){ rb_ary_push(ary, BOXED2RVAL(events, GDK_TYPE_TIME_COORD)); } gdk_device_free_history(events, n_events); } return ary; } static VALUE rg_get_axis(VALUE self, VALUE rbaxes, VALUE rbuse) { GdkDevice *device = _SELF(self); GdkAxisUse use = RVAL2GENUM(rbuse, GDK_TYPE_AXIS_USE); long n; gdouble *axes = RVAL2GDOUBLES(rbaxes, n); gint device_n_axes = gdk_device_get_n_axes(device); gdouble value; gboolean found; if (n != device_n_axes) rb_raise(rb_eArgError, "unexpected number of axes: %ld != %d", n, device_n_axes); found = gdk_device_get_axis(device, axes, use, &value); g_free(axes); return found ? DBL2NUM(value) : Qnil; } /* Accessor */ static VALUE rg_name(VALUE self) { return CSTR2RVAL(_SELF(self)->name); } static VALUE rg_source(VALUE self) { return GENUM2RVAL(_SELF(self)->source, GDK_TYPE_INPUT_SOURCE); } static VALUE rg_mode(VALUE self) { return GENUM2RVAL(_SELF(self)->mode, GDK_TYPE_INPUT_MODE); } static VALUE rg_has_cursor_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->has_cursor); } static VALUE rg_axes(VALUE self) { gint i; VALUE ary = rb_ary_new(); GdkDeviceAxis* axes = _SELF(self)->axes; for (i = 0; i < _SELF(self)->num_axes; i++){ rb_ary_push(ary, rb_ary_new3(3, GENUM2RVAL(axes[i].use, GDK_TYPE_AXIS_USE), rb_float_new(axes[i].min), rb_float_new(axes[i].max))); } return ary; } static VALUE rg_keys(VALUE self) { gint i; VALUE ary = rb_ary_new(); GdkDeviceKey* keys = _SELF(self)->keys; for (i = 0; i < _SELF(self)->num_keys; i++){ rb_ary_push(ary, rb_ary_new3(2, UINT2NUM(keys[i].keyval), GFLAGS2RVAL(keys[i].modifiers, GDK_TYPE_MODIFIER_TYPE))); } return ary; } void Init_gtk_gdk_device(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DEVICE, "Device", mGdk); RG_DEF_SMETHOD(list, 0); RG_DEF_SMETHOD(core_pointer, 0); RG_DEF_SMETHOD(set_extension_events, 3); RG_DEF_METHOD(set_source, 1); RG_DEF_METHOD(set_mode, 1); RG_DEF_METHOD(set_key, 3); RG_DEF_METHOD(set_axis_use, 2); RG_DEF_METHOD(get_state, 1); RG_DEF_METHOD(get_history, 3); RG_DEF_METHOD(get_axis, 2); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(source, 0); RG_DEF_METHOD(mode, 0); RG_DEF_METHOD_P(has_cursor, 0); RG_DEF_METHOD(axes, 0); RG_DEF_METHOD(keys, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GdkInputSource */ G_DEF_CLASS(GDK_TYPE_INPUT_SOURCE, "InputSource", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_INPUT_SOURCE, "GDK_"); /* GdkInputMode */ G_DEF_CLASS(GDK_TYPE_INPUT_MODE, "InputMode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_INPUT_MODE, "GDK_"); /* GdkAxisUse */ G_DEF_CLASS(GDK_TYPE_AXIS_USE, "AxisUse", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_AXIS_USE, "GDK_"); /* GdkExtensionMode */ G_DEF_CLASS(GDK_TYPE_EXTENSION_MODE, "ExtensionMode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_EXTENSION_MODE, "GDK_"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtksocket.c���������������������������������������������������0000644�0001750�0001750�00000004100�11701304107�017575� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 2002 Neil Conway * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef HAVE_GTK_SOCKET_GET_TYPE #define RG_TARGET_NAMESPACE cSocket #define _SELF(self) GTK_SOCKET(RVAL2GOBJ(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_socket_new()); return Qnil; } static VALUE rg_add_id(VALUE self, VALUE wid) { gtk_socket_add_id(_SELF(self), #ifdef GDK_NATIVE_WINDOW_POINTER GUINT_TO_POINTER(NUM2ULONG(wid)) #else (guint32)NUM2UINT(wid) #endif ); return self; } static VALUE rg_plug_window(VALUE self) { return GOBJ2RVAL(_SELF(self)->plug_window); } static VALUE rg_id(VALUE self) { GdkNativeWindow id = gtk_socket_get_id(_SELF(self)); #ifdef GDK_NATIVE_WINDOW_POINTER return UINT2NUM(GPOINTER_TO_UINT(id)); #else return UINT2NUM(id); #endif } #endif /* HAVE_GTK_SOCKET_GET_TYPE */ void Init_gtk_socket(VALUE mGtk) { #ifdef HAVE_GTK_SOCKET_GET_TYPE VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SOCKET, "Socket", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(plug_window, 0); RG_DEF_METHOD(add_id, 1); RG_DEF_METHOD(id, 0); #endif } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkdragcontext.c����������������������������������������������0000644�0001750�0001750�00000017735�12257552167�020653� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cDragContext #define _SELF(self) (GDK_DRAG_CONTEXT(RVAL2GOBJ(self))) static VALUE rg_protocol(VALUE self) { return GENUM2RVAL(_SELF(self)->protocol, GDK_TYPE_DRAG_PROTOCOL); } static VALUE rg_source_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->is_source); } static VALUE rg_source_window(VALUE self) { return GOBJ2RVAL(_SELF(self)->source_window); } static VALUE rg_dest_window(VALUE self) { return GOBJ2RVAL(_SELF(self)->dest_window); } static VALUE rg_targets(VALUE self) { GList *list = _SELF(self)->targets, *cur; VALUE ary = rb_ary_new(); for (cur = list; cur != NULL; cur = cur->next) { rb_ary_push(ary, BOXED2RVAL((GdkAtom)cur->data, GDK_TYPE_ATOM)); } return ary; } static VALUE rg_actions(VALUE self) { return GFLAGS2RVAL(_SELF(self)->actions, GDK_TYPE_DRAG_ACTION); } static VALUE rg_suggested_action(VALUE self) { return GFLAGS2RVAL(_SELF(self)->suggested_action, GDK_TYPE_DRAG_ACTION); } static VALUE rg_action(VALUE self) { return GFLAGS2RVAL(_SELF(self)->action, GDK_TYPE_DRAG_ACTION); } static VALUE rg_start_time(VALUE self) { return UINT2NUM(_SELF(self)->start_time); } static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gdk_drag_context_new()); return Qnil; } static VALUE rg_s_get_protocol(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE xid; GdkDragProtocol prot; GdkNativeWindow ret; if (argc == 1) { rb_scan_args(argc, argv, "10", &xid); ret = gdk_drag_get_protocol(RVAL2GDKNATIVEWINDOW(xid), &prot); } else { VALUE display; rb_scan_args(argc, argv, "20", &display, &xid); ret = gdk_drag_get_protocol_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2GDKNATIVEWINDOW(xid), &prot); } return rb_ary_new3(2, GENUM2RVAL(prot, GDK_TYPE_DRAG_PROTOCOL), GDKNATIVEWINDOW2RVAL(ret)); } /* Instance Methods */ static VALUE rg_selection(VALUE self) { return BOXED2RVAL(gdk_drag_get_selection(_SELF(self)), GDK_TYPE_ATOM); } static VALUE rg_drag_abort(VALUE self, VALUE time) { gdk_drag_abort(_SELF(self), NUM2UINT(time)); return self; } static VALUE rg_drop_reply(VALUE self, VALUE ok, VALUE time) { gdk_drop_reply(_SELF(self), RVAL2CBOOL(ok), NUM2UINT(time)); return self; } static VALUE rg_drag_drop(VALUE self, VALUE time) { gdk_drag_drop(_SELF(self), NUM2UINT(time)); return self; } static VALUE rg_find_window(int argc, VALUE *argv, VALUE self) { VALUE drag_window, x_root, y_root; GdkWindow *dest_window; GdkDragProtocol prot; if (argc == 3) { rb_scan_args(argc, argv, "30", &drag_window, &x_root, &y_root); gdk_drag_find_window(_SELF(self), GDK_WINDOW(RVAL2GOBJ(drag_window)), NUM2INT(x_root), NUM2INT(y_root), &dest_window, &prot); } else { VALUE screen; rb_scan_args(argc, argv, "40", &drag_window, &screen, &x_root, &y_root); gdk_drag_find_window_for_screen(_SELF(self), GDK_WINDOW(RVAL2GOBJ(drag_window)), GDK_SCREEN(RVAL2GOBJ(screen)), NUM2INT(x_root), NUM2INT(y_root), &dest_window, &prot); } return rb_ary_new3(2, GOBJ2RVAL(dest_window), GENUM2RVAL(prot, GDK_TYPE_DRAG_PROTOCOL)); } struct rbgdk_rval2gdkatomglist_args { VALUE ary; long n; GList *result; }; static VALUE rbgdk_rval2gdkatomglist_body(VALUE value) { long i; struct rbgdk_rval2gdkatomglist_args *args = (struct rbgdk_rval2gdkatomglist_args *)value; for (i = 0; i < args->n; i++) args->result = g_list_append(args->result, GINT_TO_POINTER(RVAL2ATOM(RARRAY_PTR(args->ary)[i]))); return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkatomglist_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdkatomglist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GList * rbgdk_rval2gdkatomglist(VALUE value) { struct rbgdk_rval2gdkatomglist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgdk_rval2gdkatomglist_body, (VALUE)&args, rbgdk_rval2gdkatomglist_rescue, (VALUE)&args); return args.result; } #define RVAL2GDKATOMGLIST(value) rbgdk_rval2gdkatomglist(value) static VALUE rg_s_drag_begin(G_GNUC_UNUSED VALUE self, VALUE rbwindow, VALUE rbtargets) { GdkWindow *window = GDK_WINDOW(RVAL2GOBJ(rbwindow)); GList *targets = RVAL2GDKATOMGLIST(rbtargets); GdkDragContext *result = gdk_drag_begin(window, targets); g_list_free(targets); return GOBJ2RVAL(result); } static VALUE rg_drag_motion(VALUE self, VALUE dest_window, VALUE protocol, VALUE x_root, VALUE y_root, VALUE suggested_action, VALUE possible_actions, VALUE time) { gboolean ret = gdk_drag_motion(_SELF(self), GDK_WINDOW(RVAL2GOBJ(dest_window)), RVAL2GENUM(protocol, GDK_TYPE_DRAG_PROTOCOL), NUM2INT(x_root), NUM2INT(y_root), RVAL2GFLAGS(suggested_action, GDK_TYPE_DRAG_ACTION), RVAL2GFLAGS(possible_actions, GDK_TYPE_DRAG_ACTION), NUM2UINT(time)); return CBOOL2RVAL(ret); } static VALUE rg_drop_finish(VALUE self, VALUE success, VALUE time) { gdk_drop_finish(_SELF(self), RVAL2CBOOL(success), NUM2UINT(time)); return self; } static VALUE rg_drag_status(VALUE self, VALUE action, VALUE time) { gdk_drag_status(_SELF(self), RVAL2GFLAGS(action, GDK_TYPE_DRAG_ACTION), NUM2UINT(time)); return self; } static VALUE rg_drag_drop_succeeded_p(VALUE self) { return CBOOL2RVAL(gdk_drag_drop_succeeded(_SELF(self))); } void Init_gtk_gdk_dragcontext(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DRAG_CONTEXT, "DragContext", mGdk); RG_DEF_SMETHOD(get_protocol, -1); RG_DEF_SMETHOD(drag_begin, 1); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(protocol, 0); RG_DEF_METHOD_P(source, 0); RG_DEF_METHOD(source_window, 0); RG_DEF_METHOD(dest_window, 0); RG_DEF_METHOD(targets, 0); RG_DEF_METHOD(actions, 0); RG_DEF_METHOD(suggested_action, 0); RG_DEF_METHOD(action, 0); RG_DEF_METHOD(start_time, 0); RG_DEF_METHOD(selection, 0); RG_DEF_METHOD(drag_abort, 1); RG_DEF_METHOD(drop_reply, 2); RG_DEF_METHOD(drag_drop, 1); RG_DEF_METHOD(find_window, 4); RG_DEF_METHOD(drag_motion, 7); RG_DEF_METHOD(drop_finish, 2); RG_DEF_METHOD(drag_status, 2); RG_DEF_METHOD_P(drag_drop_succeeded, 0); /* Constants */ G_DEF_CLASS(GDK_TYPE_DRAG_PROTOCOL, "Protocol", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_DRAG_ACTION, "Action", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_DRAG_PROTOCOL, "GDK_DRAG_"); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_DRAG_ACTION, "GDK_"); } �����������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkprintjob.c�������������������������������������������������0000644�0001750�0001750�00000007352�11701304107�020150� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef HAVE_GTK_UNIX_PRINT #include <gtk/gtkprintjob.h> #ifndef GTK_TYPE_PRINT_CAPABILITIES # define GTK_TYPE_PRINT_CAPABILITIES (gtk_print_capabilities_get_type()) #endif #ifdef HAVE_RB_CAIRO_H # include <rb_cairo.h> #endif #define RG_TARGET_NAMESPACE cPrintJob #define _SELF(s) (GTK_PRINT_JOB(RVAL2GOBJ(s))) static VALUE RG_TARGET_NAMESPACE; static VALUE rg_initialize(VALUE self, VALUE title, VALUE printer, VALUE settings, VALUE page_setup) { GtkPrintJob *job; job = gtk_print_job_new(RVAL2CSTR(title), GTK_PRINTER(RVAL2GOBJ(printer)), GTK_PRINT_SETTINGS(RVAL2GOBJ(settings)), GTK_PAGE_SETUP(RVAL2GOBJ(page_setup))); G_INITIALIZE(self, job); return Qnil; } static VALUE rg_status(VALUE self) { return GENUM2RVAL(gtk_print_job_get_status(_SELF(self)), GTK_TYPE_PRINT_STATUS); } static VALUE rg_set_source_file(VALUE self, VALUE filename) { GError *error = NULL; gboolean result; result = gtk_print_job_set_source_file(_SELF(self), RVAL2CSTR(filename), &error); if (!result) RAISE_GERROR(error); return Qnil; } #ifdef HAVE_RB_CAIRO_H static VALUE rg_surface(VALUE self) { cairo_surface_t *surface; GError *error = NULL; surface = gtk_print_job_get_surface(_SELF(self), &error); if (error) RAISE_GERROR(error); return CRSURFACE2RVAL(surface); } #endif struct callback_arg { VALUE callback; VALUE job; GError* error; }; static VALUE invoke_callback(VALUE data) { struct callback_arg *arg = (struct callback_arg *)data; if (arg->error) RAISE_GERROR(arg->error); rb_funcall(arg->callback, id_call, 1, arg->job); return Qnil; } static void complete_func(GtkPrintJob *job, gpointer data, GError *error) { struct callback_arg arg; arg.callback = (VALUE)data; arg.job = GOBJ2RVAL(job); arg.error = error; G_PROTECT_CALLBACK(invoke_callback, &arg); } static void remove_callback_reference(gpointer data) { G_CHILD_REMOVE(RG_TARGET_NAMESPACE, (VALUE)data); } static VALUE rg_send(VALUE self) { VALUE block = rb_block_proc(); G_CHILD_ADD(RG_TARGET_NAMESPACE, block); gtk_print_job_send(_SELF(self), complete_func, (gpointer)block, remove_callback_reference); return self; } #endif void Init_gtk_print_job(VALUE mGtk) { #ifdef HAVE_GTK_UNIX_PRINT RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_JOB, "PrintJob", mGtk); G_DEF_CLASS(GTK_TYPE_PRINT_CAPABILITIES, "PrintCapabilities", mGtk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(status, 0); RG_DEF_METHOD(set_source_file, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "source_file"); #ifdef HAVE_RB_CAIRO_H RG_DEF_METHOD(surface, 0); #endif RG_DEF_METHOD(send, 0); #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkinputdialog.c����������������������������������������������0000644�0001750�0001750�00000002576�11701304107�020643� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cInputDialog static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_input_dialog_new()); return Qnil; } void Init_gtk_input_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_INPUT_DIALOG, "InputDialog", mGtk); RG_DEF_METHOD(initialize, 0); } ����������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkhbox.c�����������������������������������������������������0000644�0001750�0001750�00000003041�11701304107�017250� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cHBox static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE homogeneous, spacing; rb_scan_args(argc, argv, "02", &homogeneous, &spacing); RBGTK_INITIALIZE(self, gtk_hbox_new(RVAL2CBOOL(homogeneous), (NIL_P(spacing)?0:NUM2INT(spacing)))); return Qnil; } void Init_gtk_hbox(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HBOX, "HBox", mGtk); RG_DEF_METHOD(initialize, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkbindingset.c�����������������������������������������������0000644�0001750�0001750�00000013102�11701304107�020435� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ /* NOTE: - gtk_bindings_activate() is mapped to Gtk::Object#bindings_activate. - gtk_binding_set_by_class() is mapped to Gtk::Object.binding_set */ #include "global.h" #define RVAL2MOD(mods) RVAL2GFLAGS(mods, GDK_TYPE_MODIFIER_TYPE) /*****************************************/ static GtkBindingSet* gtk_bindingset_copy(const GtkBindingSet* bin) { /* GtkBindingSet should not be copied */ return (GtkBindingSet*)bin; } static void gtk_bindingset_free(G_GNUC_UNUSED GtkBindingSet* bin) { /* GtkBindingSet should not be freed */ } GType gtk_bindingset_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkBindingSet", (GBoxedCopyFunc)gtk_bindingset_copy, (GBoxedFreeFunc)gtk_bindingset_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cBindingSet #define _SELF(s) (GtkBindingSet*)(RVAL2BOXED(s, GTK_TYPE_BINDING_SET)) static VALUE rg_initialize(VALUE self, VALUE set_name) { G_INITIALIZE(self, gtk_binding_set_new(RVAL2CSTR(set_name))); return Qnil; } static VALUE rg_s_find(G_GNUC_UNUSED VALUE self, VALUE set_name) { return BOXED2RVAL(gtk_binding_set_find(RVAL2CSTR(set_name)), GTK_TYPE_BINDING_SET); } static VALUE rg_activate(VALUE self, VALUE keyval, VALUE modifiers, VALUE object) { return CBOOL2RVAL(gtk_binding_set_activate(_SELF(self), NUM2UINT(keyval), RVAL2MOD(modifiers), GTK_OBJECT(RVAL2GOBJ(object)))); } static VALUE rg_entry_clear(VALUE self, VALUE keyval, VALUE modifiers) { gtk_binding_entry_clear(_SELF(self), NUM2UINT(keyval), RVAL2MOD(modifiers)); return self; } static VALUE rg_add_signal(int argc, VALUE *argv, VALUE self) { VALUE keyval, modifiers, signame, rest; long i; VALUE param; GSList *slist, *free_slist; slist = NULL; rb_scan_args(argc, argv, "3*", &keyval, &modifiers, &signame, &rest); for (i = 0; i < RARRAY_LEN(rest); i++) { GtkBindingArg *arg; arg = g_new0 (GtkBindingArg, 1); slist = g_slist_prepend (slist, arg); param = RARRAY_PTR(rest)[i]; if (TYPE(param) == T_FLOAT) { arg->arg_type = G_TYPE_DOUBLE; arg->d.double_data = NUM2DBL(param); } else if (rb_respond_to (param, rb_intern("to_int"))) { arg->arg_type = G_TYPE_LONG; arg->d.long_data = NUM2LONG(param); } else if (param == Qfalse) { arg->arg_type = G_TYPE_LONG; arg->d.long_data = 0; } else if (param == Qtrue) { arg->arg_type = G_TYPE_LONG; arg->d.long_data = 1; } else if (rb_respond_to (param, rb_intern("to_str"))) { arg->arg_type = G_TYPE_STRING; arg->d.string_data = (gchar *)RVAL2CSTR(param); } else { rb_raise(rb_eTypeError, "can not convert %s into String, Numeric, " "GLib::Enum/GLib::Flags or true/false", rb_class2name(CLASS_OF(param))); } } slist = g_slist_reverse (slist); gtk_binding_entry_add_signall (_SELF(self), NUM2UINT(keyval), RVAL2MOD(modifiers), RVAL2CSTR(signame), slist); free_slist = slist; while (slist) { g_free (slist->data); slist = slist->next; } g_slist_free (free_slist); return self; } static VALUE rg_add_path(VALUE self, VALUE path_type, VALUE path_pattern, VALUE priority) { gtk_binding_set_add_path(_SELF(self), RVAL2GENUM(path_type, GTK_TYPE_PATH_TYPE), RVAL2CSTR(path_pattern), RVAL2GENUM(priority, GTK_TYPE_PATH_PRIORITY_TYPE)); return self; } static VALUE rg_entry_remove(VALUE self, VALUE keyval, VALUE modifiers) { gtk_binding_entry_remove(_SELF(self), NUM2UINT(keyval), RVAL2MOD(modifiers)); return self; } #if GTK_CHECK_VERSION(2,12,0) static VALUE rg_entry_skip(VALUE self, VALUE keyval, VALUE modifiers) { gtk_binding_entry_skip(_SELF(self), NUM2UINT(keyval), RVAL2MOD(modifiers)); return self; } #endif void Init_gtk_bindings(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BINDING_SET, "BindingSet", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_SMETHOD(find, 1); RG_DEF_METHOD(activate, 3); RG_DEF_METHOD(entry_clear, 2); RG_DEF_METHOD(add_signal, -1); RG_DEF_ALIAS("entry_add_signal", "add_signal"); RG_DEF_METHOD(add_path, 3); RG_DEF_METHOD(entry_remove, 2); #if GTK_CHECK_VERSION(2,12,0) RG_DEF_METHOD(entry_skip, 2); #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcombo.c����������������������������������������������������0000644�0001750�0001750�00000006211�11701304107�017411� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifndef GTK_DISABLE_DEPRECATED /* Since 2.4 */ #define RG_TARGET_NAMESPACE cCombo static VALUE rg_set_popdown_strings(VALUE self, VALUE ary) { int i; GList *glist = NULL; Check_Type(ary, T_ARRAY); for (i=0; i<RARRAY_LEN(ary); i++) { glist = g_list_append(glist, (gpointer)RVAL2CSTR(RARRAY_PTR(ary)[i])); } gtk_combo_set_popdown_strings(GTK_COMBO(RVAL2GOBJ(self)), glist); g_list_free(glist); return self; } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE ary; GtkWidget* widget = NULL; rb_scan_args(argc, argv, "01", &ary); widget = gtk_combo_new(); RBGTK_INITIALIZE(self, widget); if (! NIL_P(ary)){ rg_set_popdown_strings(self, ary); } return Qnil; } static VALUE combo_set_val_in_list(VALUE self, VALUE val, VALUE ok) { gtk_combo_set_value_in_list(GTK_COMBO(RVAL2GOBJ(self)), RVAL2CBOOL(val), RVAL2CBOOL(ok)); return self; } static VALUE rg_set_use_arrows(VALUE self, VALUE val) { gtk_combo_set_use_arrows(GTK_COMBO(RVAL2GOBJ(self)), RVAL2CBOOL(val)); return self; } static VALUE rg_set_use_arrows_always(VALUE self, VALUE val) { gtk_combo_set_use_arrows_always(GTK_COMBO(RVAL2GOBJ(self)), RVAL2CBOOL(val)); return self; } static VALUE rg_disable_activate(VALUE self) { gtk_combo_disable_activate(GTK_COMBO(RVAL2GOBJ(self))); return self; } static VALUE rg_entry(VALUE self) { return GOBJ2RVAL(GTK_COMBO(RVAL2GOBJ(self))->entry); } #endif void Init_gtk_combo(VALUE mGtk) { #ifndef GTK_DISABLE_DEPRECATED /* Since 2.4 */ VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_COMBO, "Combo", mGtk); RG_DEF_METHOD(initialize, -1); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "value_in_list", combo_set_val_in_list, 2); RG_DEF_METHOD(set_use_arrows, 1); RG_DEF_METHOD(set_use_arrows_always, 1); RG_DEF_METHOD(set_popdown_strings, 1); RG_DEF_METHOD(disable_activate, 0); RG_DEF_METHOD(entry, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtklinkbutton.c�����������������������������������������������0000644�0001750�0001750�00000003752�12257552167�020534� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cLinkButton #define _SELF(self) (GTK_LINK_BUTTON(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE uri, label; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "11", &uri, &label); if (NIL_P(label)){ widget = gtk_link_button_new(RVAL2CSTR(uri)); } else { widget = gtk_link_button_new_with_label(RVAL2CSTR(uri), RVAL2CSTR(label)); } RBGTK_INITIALIZE(self, widget); return Qnil; } static void link_func(GtkLinkButton *button, const gchar *link, gpointer func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(button), CSTR2RVAL(link)); } static VALUE rg_s_set_uri_hook(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_link_button_set_uri_hook((GtkLinkButtonUriFunc)link_func, (gpointer)func, (GDestroyNotify)NULL); return self; } void Init_gtk_link_button(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_LINK_BUTTON, "LinkButton", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_SMETHOD(set_uri_hook, 0); } ����������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcomboboxentry.c��������������������������������������������0000644�0001750�0001750�00000003734�12257552167�021235� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cComboBoxEntry static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE model_or_false, text_column; GtkWidget* widget; rb_scan_args(argc, argv, "02", &model_or_false, &text_column); if (rb_obj_is_kind_of(model_or_false, GTYPE2CLASS(GTK_TYPE_TREE_MODEL))){ widget = gtk_combo_box_entry_new_with_model( GTK_TREE_MODEL(RVAL2GOBJ(model_or_false)), NUM2INT(text_column)); } else if (NIL_P(model_or_false) || TYPE(model_or_false) == T_TRUE){ widget = gtk_combo_box_entry_new_text(); } else if (TYPE(model_or_false) == T_FALSE){ widget = gtk_combo_box_entry_new(); } else { rb_raise(rb_eArgError, "invalid 2nd argument %s (except true/false or Gtk::TreeModel)", rb_class2name(CLASS_OF(model_or_false))); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_comboboxentry(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_COMBO_BOX_ENTRY, "ComboBoxEntry", mGtk); RG_DEF_METHOD(initialize, -1); } ������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkplug.c�����������������������������������������������������0000644�0001750�0001750�00000004702�11701304107�017264� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 2002 Neil Conway * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef HAVE_GTK_PLUG_GET_TYPE #define RG_TARGET_NAMESPACE cPlug static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE socket_id; GdkNativeWindow id; if (rb_scan_args(argc, argv, "01", &socket_id) == 0) id = 0; else { #ifdef GDK_NATIVE_WINDOW_POINTER id = GUINT_TO_POINTER(NUM2ULONG(socket_id)); #else id = NUM2UINT(socket_id); #endif } RBGTK_INITIALIZE(self, gtk_plug_new(id)); return Qnil; } /* GtkWidget* gtk_plug_new_for_display (GdkDisplay *display, GdkNativeWindow socket_id); void gtk_plug_construct_for_display (GtkPlug *plug, GdkDisplay *display, GdkNativeWindow socket_id); */ static VALUE rg_construct(VALUE self, VALUE socket_id) { #ifdef GDK_NATIVE_WINDOW_POINTER gtk_plug_construct(GTK_PLUG(RVAL2GOBJ(self)), GUINT_TO_POINTER(NUM2ULONG(socket_id))); #else gtk_plug_construct(GTK_PLUG(RVAL2GOBJ(self)), (guint32)NUM2UINT(socket_id)); #endif return self; } static VALUE rg_id(VALUE self) { GdkNativeWindow id = gtk_plug_get_id(GTK_PLUG(RVAL2GOBJ(self))); #ifdef GDK_NATIVE_WINDOW_POINTER return UINT2NUM(GPOINTER_TO_UINT(id)); #else return UINT2NUM(id); #endif } #endif /* HAVE_GTK_PLUG_GET_TYPE */ void Init_gtk_plug(VALUE mGtk) { #ifdef HAVE_GTK_PLUG_GET_TYPE VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PLUG, "Plug", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(construct, 1); RG_DEF_METHOD(id, 0); #endif } ��������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrecentdata.c�����������������������������������������������0000644�0001750�0001750�00000007653�12257552167�020461� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" /*****************************************/ static GtkRecentData* rd_copy(const GtkRecentData* data) { GtkRecentData* new_data; g_return_val_if_fail (data != NULL, NULL); new_data = g_new(GtkRecentData, 1); *new_data = *data; return new_data; } static void rd_free(GtkRecentData* boxed) { if (boxed){ g_free(boxed->groups); g_free(boxed); } } GType gtk_recent_data_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkRecentData", (GBoxedCopyFunc)rd_copy, (GBoxedFreeFunc)rd_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cRecentData #define _SELF(w) ((GtkRecentData*)RVAL2BOXED(w, GTK_TYPE_RECENT_DATA)) static VALUE rg_initialize(VALUE self) { GtkRecentData data; memset(&data, 0, sizeof(GtkRecentData)); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_RECENT_DATA, &data)); return Qnil; } #define RD_STR(name)\ static VALUE \ rd_get_ ## name (VALUE self)\ {\ return CSTR2RVAL(_SELF(self)->name);\ }\ static VALUE \ rd_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = (gchar *)RVAL2CSTR(val);\ return self;\ } RD_STR(display_name); RD_STR(description); RD_STR(mime_type); RD_STR(app_name); RD_STR(app_exec); static VALUE rg_groups(VALUE self) { gchar** grps = _SELF(self)->groups; VALUE ary = rb_ary_new(); gint i = 0; while (grps[i]) { rb_ary_push(ary, CSTR2RVAL((gchar*)grps[i])); i++; } return ary; } static VALUE rg_set_groups(VALUE self, VALUE groups) { _SELF(self)->groups = RVAL2STRV_DUP(groups); return self; } static VALUE rg_private_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->is_private); } static VALUE rg_set_private(VALUE self, VALUE is_private) { _SELF(self)->is_private = RVAL2CBOOL(is_private); return self; } void Init_gtk_recent_data(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_DATA, "RecentData", mGtk); RG_DEF_METHOD(initialize, 0); rb_define_method(RG_TARGET_NAMESPACE, "display_name", rd_get_display_name, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_display_name", rd_set_display_name, 1); rb_define_method(RG_TARGET_NAMESPACE, "description", rd_get_description, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_description", rd_set_description, 1); rb_define_method(RG_TARGET_NAMESPACE, "mime_type", rd_get_mime_type, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_mime_type", rd_set_mime_type, 1); rb_define_method(RG_TARGET_NAMESPACE, "app_name", rd_get_app_name, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_app_name", rd_set_app_name, 1); rb_define_method(RG_TARGET_NAMESPACE, "app_exec", rd_get_app_exec, 0); rb_define_method(RG_TARGET_NAMESPACE, "set_app_exec", rd_set_app_exec, 1); RG_DEF_METHOD(groups, 0); RG_DEF_METHOD(set_groups, 1); RG_DEF_METHOD_P(private, 0); RG_DEF_METHOD(set_private, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfontbutton.c�����������������������������������������������0000644�0001750�0001750�00000002737�12257552167�020547� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFontButton static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE fontname; GtkWidget* widget; rb_scan_args(argc, argv, "01", &fontname); if (NIL_P(fontname)){ widget = gtk_font_button_new(); } else { widget = gtk_font_button_new_with_font(RVAL2CSTR(fontname)); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_fontbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FONT_BUTTON, "FontButton", mGtk); RG_DEF_METHOD(initialize, -1); } ���������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrecentchooserdialog.c��������������������������������������0000644�0001750�0001750�00000004517�12257552167�022366� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRecentChooserDialog #define _SELF(self) (GTK_RECENT_CHOOSER_DIALOG(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE title, parent, button_ary; GtkWidget* dialog; if (rb_obj_is_kind_of(argv[2], GTYPE2CLASS(GTK_TYPE_RECENT_MANAGER))){ VALUE manager; rb_scan_args(argc, argv, "03*", &title, &parent, &manager, &button_ary); dialog = gtk_recent_chooser_dialog_new_for_manager((const gchar*)RVAL2CSTR_ACCEPT_NIL(title), GTK_WINDOW(RVAL2GOBJ(parent)), GTK_RECENT_MANAGER(RVAL2GOBJ(manager)), (const gchar*)NULL, NULL); } else { rb_scan_args(argc, argv, "02*", &title, &parent, &button_ary); dialog = gtk_recent_chooser_dialog_new((const gchar*)RVAL2CSTR_ACCEPT_NIL(title), GTK_WINDOW(RVAL2GOBJ(parent)), (const gchar*)NULL, NULL); } RBGTK_INITIALIZE(self, dialog); if (button_ary != Qnil){ rbgtk_dialog_add_buttons_internal(self, button_ary); } return Qnil; } void Init_gtk_recent_chooser_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_CHOOSER_DIALOG, "RecentChooserDialog", mGtk); RG_DEF_METHOD(initialize, -1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtksettings.c�������������������������������������������������0000644�0001750�0001750�00000016022�12257552167�020175� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cSettings static VALUE prop_func_table; static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_settings_get_default()); } static VALUE rg_s_get_for_screen(G_GNUC_UNUSED VALUE self, VALUE screen) { return GOBJ2RVAL(gtk_settings_get_for_screen(GDK_SCREEN(RVAL2GOBJ(screen)))); } /* * Gtk::Settings.install_property(...) do |spec, str| * #parse str * new_val = .... # parse value from string. * new_val # return new_val or nil if you can't convert the value. * end */ static gboolean rc_property_parser(const GParamSpec *pspec, const GString *rc_string, GValue *property_value) { VALUE spec = GOBJ2RVAL((gpointer)pspec); VALUE func = rb_hash_aref(prop_func_table, spec); VALUE ret = rb_funcall(func, id_call, 2, spec, CSTR2RVAL(rc_string->str)); if (NIL_P(ret)) { return FALSE; } else if (RVAL2CBOOL(ret)){ rbgobj_rvalue_to_gvalue(ret, property_value); return TRUE; } else { rb_raise(rb_eArgError, "Gtk::Settings#install_property() block should return new value or nil"); } } static VALUE rg_s_install_property(VALUE self, VALUE spec) { GParamSpec* pspec = G_PARAM_SPEC(RVAL2GOBJ(spec)); if (rb_block_given_p()){ VALUE func = rb_block_proc(); rb_hash_aset(prop_func_table, spec, func); gtk_settings_install_property_parser(pspec, (GtkRcPropertyParser)rc_property_parser); } else { gtk_settings_install_property(pspec); } return self; } static VALUE settings_rc_property_parse(G_GNUC_UNUSED VALUE self, VALUE rbspec, VALUE rbstring, GtkRcPropertyParser parser) { GParamSpec *spec = RVAL2GOBJ(rbspec); GString *string = g_string_new(RVAL2CSTR(rbstring)); GValue property = G_VALUE_INIT; gboolean parsed; g_value_init(&property, spec->value_type); parsed = parser(spec, string, &property); g_string_free(string, TRUE); return parsed ? GVAL2RVAL_UNSET(&property) : Qnil; } static VALUE rg_s_rc_property_parse_color(VALUE self, VALUE rbspec, VALUE rbstring) { return settings_rc_property_parse(self, rbspec, rbstring, gtk_rc_property_parse_color); } static VALUE rg_s_rc_property_parse_enum(VALUE self, VALUE rbspec, VALUE rbstring) { return settings_rc_property_parse(self, rbspec, rbstring, gtk_rc_property_parse_enum); } static VALUE rg_s_rc_property_parse_flags(VALUE self, VALUE rbspec, VALUE rbstring) { return settings_rc_property_parse(self, rbspec, rbstring, gtk_rc_property_parse_flags); } static VALUE rg_s_rc_property_parse_requisition(G_GNUC_UNUSED VALUE self, VALUE rbspec, VALUE rbstring) { GParamSpec *spec = RVAL2GOBJ(rbspec); GString *string = g_string_new(RVAL2CSTR(rbstring)); GValue property = G_VALUE_INIT; gboolean parsed; GtkRequisition *requisition; gint width; gint height; g_value_init(&property, GTK_TYPE_REQUISITION); parsed = gtk_rc_property_parse_requisition(spec, string, &property); g_string_free(string, TRUE); if (!parsed) return Qnil; requisition = g_value_get_boxed(&property); width = requisition->width; height = requisition->height; g_value_unset(&property); return rb_assoc_new(INT2NUM(width), INT2NUM(height)); } static VALUE settings_rc_property_parse_border_result(VALUE value) { return BOXED2RVAL(g_value_get_boxed((GValue *)value), GTK_TYPE_BORDER); } static VALUE settings_rc_property_parse_border_ensure(VALUE value) { g_value_unset((GValue *)value); return Qnil; } static VALUE rg_s_rc_property_parse_border(G_GNUC_UNUSED VALUE self, VALUE rbspec, VALUE rbstring) { GParamSpec *spec = RVAL2GOBJ(rbspec); GString *string = g_string_new(RVAL2CSTR(rbstring)); GValue property = G_VALUE_INIT; gboolean parsed; g_value_init(&property, GTK_TYPE_BORDER); parsed = gtk_rc_property_parse_border(spec, string, &property); g_string_free(string, TRUE); if (!parsed) return Qnil; return rb_ensure(settings_rc_property_parse_border_result, (VALUE)&property, settings_rc_property_parse_border_ensure, (VALUE)&property); } static VALUE rg_set_property_value(VALUE self, VALUE rbname, VALUE rbvalue, VALUE origin) { GtkSettings *settings = GTK_SETTINGS(RVAL2GOBJ(self)); GtkSettingsValue svalue = { (gchar *)RVAL2CSTR(origin), G_VALUE_INIT }; const gchar *name = RVAL2CSTR(rbname); g_value_init(&svalue.value, RVAL2GTYPE(rbvalue)); rbgobj_rvalue_to_gvalue(rbvalue, &svalue.value); gtk_settings_set_property_value(settings, name, &svalue); g_value_unset(&svalue.value); return self; } /* We don't need them, Use set_property_value() instead. void gtk_settings_set_string_property (GtkSettings *settings, const gchar *name, const gchar *v_string, const gchar *origin); void gtk_settings_set_long_property (GtkSettings *settings, const gchar *name, glong v_long, const gchar *origin); void gtk_settings_set_double_property (GtkSettings *settings, const gchar *name, gdouble v_double, const gchar *origin); */ void Init_gtk_settings(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SETTINGS, "Settings", mGtk); rb_global_variable(&prop_func_table); prop_func_table = rb_hash_new(); RG_DEF_SMETHOD(default, 0); RG_DEF_SMETHOD(get_for_screen, 1); RG_DEF_SMETHOD(install_property, 1); RG_DEF_SMETHOD(rc_property_parse_color, 2); RG_DEF_SMETHOD(rc_property_parse_enum, 2); RG_DEF_SMETHOD(rc_property_parse_flags, 2); RG_DEF_SMETHOD(rc_property_parse_requisition, 2); RG_DEF_SMETHOD(rc_property_parse_border, 2); RG_DEF_METHOD(set_property_value, 3); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkentry.c����������������������������������������������������0000644�0001750�0001750�00000006151�12257552167�017500� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cEntry #define _SELF(self) (GTK_ENTRY(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_entry_new()); return Qnil; } static VALUE rg_layout(VALUE self) { return GOBJ2RVAL(gtk_entry_get_layout(_SELF(self))); } static VALUE rg_layout_offsets(VALUE self) { int x, y; gtk_entry_get_layout_offsets(_SELF(self), &x, &y); return rb_ary_new3(2, INT2NUM(x), INT2NUM(y)); } static VALUE rg_set_completion(VALUE self, VALUE completion) { gtk_entry_set_completion(_SELF(self), GTK_ENTRY_COMPLETION(RVAL2GOBJ(completion))); G_CHILD_SET(self, rb_intern("completion"), completion); return self; } static VALUE rg_completion(VALUE self) { return GOBJ2RVAL(gtk_entry_get_completion(_SELF(self))); } static VALUE rg_layout_index_to_text_index(VALUE self, VALUE layout_index) { return INT2NUM(gtk_entry_layout_index_to_text_index(_SELF(self), NUM2INT(layout_index))); } static VALUE rg_text_index_to_layout_index(VALUE self, VALUE text_index) { return INT2NUM(gtk_entry_text_index_to_layout_index(_SELF(self), NUM2INT(text_index))); } #if GTK_CHECK_VERSION(2, 12, 0) static VALUE rg_cursor_hadjustment(VALUE self) { return GOBJ2RVAL(gtk_entry_get_cursor_hadjustment(_SELF(self))); } static VALUE rg_set_cursor_hadjustment(VALUE self, VALUE adjustment) { gtk_entry_set_cursor_hadjustment(_SELF(self), RVAL2GOBJ(adjustment)); return self; } #endif 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); RG_DEF_METHOD(set_completion, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "completion"); RG_DEF_METHOD(completion, 0); 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 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfontselectiondialog.c��������������������������������������0000644�0001750�0001750�00000005712�11701304107�022353� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 2001 Neil Conway <neilconway@rogers.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFontSelectionDialog #define _SELF(self) (GTK_FONT_SELECTION_DIALOG(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE title; rb_scan_args(argc, argv, "01", &title); RBGTK_INITIALIZE(self, gtk_font_selection_dialog_new(NIL_P(title) ? NULL : RVAL2CSTR(title))); return Qnil; } static VALUE rg_font_name(VALUE self) { gchar* name = gtk_font_selection_dialog_get_font_name(_SELF(self)); return name ? CSTR2RVAL(name) : Qnil; } static VALUE rg_set_font_name(VALUE self, VALUE fontname) { return CBOOL2RVAL(gtk_font_selection_dialog_set_font_name(_SELF(self), RVAL2CSTR(fontname))); } static VALUE rg_preview_text(VALUE self) { const gchar* text = gtk_font_selection_dialog_get_preview_text(_SELF(self)); return text ? CSTR2RVAL(text) : Qnil; } static VALUE rg_set_preview_text(VALUE self, VALUE text) { gtk_font_selection_dialog_set_preview_text(_SELF(self), RVAL2CSTR(text)); return self; } static VALUE rg_font_selection(VALUE self) { return GOBJ2RVAL(_SELF(self)->fontsel); } static VALUE rg_ok_button(VALUE self) { return GOBJ2RVAL(_SELF(self)->ok_button); } static VALUE rg_cancel_button(VALUE self) { return GOBJ2RVAL(_SELF(self)->cancel_button); } static VALUE rg_apply_button(VALUE self) { return GOBJ2RVAL(_SELF(self)->apply_button); } void Init_gtk_font_selection_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FONT_SELECTION_DIALOG, "FontSelectionDialog", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(font_name, 0); RG_DEF_METHOD(set_font_name, 1); RG_DEF_METHOD(preview_text, 0); RG_DEF_METHOD(set_preview_text, 1); RG_DEF_METHOD(font_selection, 0); RG_DEF_METHOD(ok_button, 0); RG_DEF_METHOD(cancel_button, 0); RG_DEF_METHOD(apply_button, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkimcontext.c������������������������������������������������0000644�0001750�0001750�00000007365�11701304107�020337� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cIMContext #define _SELF(self) (GTK_IM_CONTEXT(RVAL2GOBJ(self))) static VALUE rg_set_client_window(VALUE self, VALUE gdkwindow) { gtk_im_context_set_client_window(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow))); return self; } static VALUE rg_preedit_string(VALUE self) { gchar* str; PangoAttrList* attrs; gint cursor_pos; gtk_im_context_get_preedit_string(_SELF(self), &str, &attrs, &cursor_pos); return rb_ary_new3(3, CSTR2RVAL(str), BOXED2RVAL(attrs, PANGO_TYPE_ATTR_LIST), INT2NUM(cursor_pos)); } static VALUE rg_filter_keypress(VALUE self, VALUE event) { return CBOOL2RVAL(gtk_im_context_filter_keypress(_SELF(self), (GdkEventKey*)RVAL2GEV(event))); } static VALUE rg_focus_in(VALUE self) { gtk_im_context_focus_in(_SELF(self)); return self; } static VALUE rg_focus_out(VALUE self) { gtk_im_context_focus_out(_SELF(self)); return self; } static VALUE rg_reset(VALUE self) { gtk_im_context_reset(_SELF(self)); return self; } static VALUE rg_set_cursor_location(VALUE self, VALUE area) { gtk_im_context_set_cursor_location( _SELF(self), ((GdkRectangle*)RVAL2BOXED(area, GDK_TYPE_RECTANGLE))); return self; } static VALUE rg_set_use_preedit(VALUE self, VALUE use_preedit) { gtk_im_context_set_use_preedit(_SELF(self), RVAL2CBOOL(use_preedit)); return self; } static VALUE rg_set_surrounding(VALUE self, VALUE text, VALUE cursor_index) { StringValue(text); gtk_im_context_set_surrounding(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text), NUM2INT(cursor_index)); return self; } static VALUE rg_surrounding(VALUE self) { gchar* text; gint cursor_index; gboolean result = gtk_im_context_get_surrounding(_SELF(self), &text, &cursor_index); return result ? rb_ary_new3(2, CSTR2RVAL(text), INT2NUM(cursor_index)) : Qnil; } static VALUE rg_delete_surrounding(VALUE self, VALUE offset, VALUE n_chars) { return CBOOL2RVAL(gtk_im_context_delete_surrounding(_SELF(self), NUM2INT(offset), NUM2INT(n_chars))); } void Init_gtk_imcontext(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_IM_CONTEXT, "IMContext", mGtk); RG_DEF_METHOD(set_client_window, 1); RG_DEF_METHOD(preedit_string, 0); /* Is it better to name as "filter_keypress?" ?*/ RG_DEF_METHOD(filter_keypress, 1); RG_DEF_METHOD(focus_in, 0); RG_DEF_METHOD(focus_out, 0); RG_DEF_METHOD(reset, 0); RG_DEF_METHOD(set_cursor_location, 1); RG_DEF_METHOD(set_use_preedit, 1); RG_DEF_METHOD(set_surrounding, 2); RG_DEF_METHOD(surrounding, 0); RG_DEF_METHOD(delete_surrounding, 2); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/global.h��������������������������������������������������������0000644�0001750�0001750�00000034745�12257552167�016564� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2002-2013 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef _RBGTK_GLOBAL_H #define _RBGTK_GLOBAL_H #include "rbgtk.h" #ifdef HAVE_RUBY_ST_H # include <ruby/st.h> #else # include <st.h> #endif #undef RG_DEF_METHOD #define RG_DEF_METHOD(method, argc) \ rb_define_method(RG_TARGET_NAMESPACE, #method, rg_ ## method, argc) #undef RG_DEF_SMETHOD #define RG_DEF_SMETHOD(method, argc) \ rb_define_singleton_method(RG_TARGET_NAMESPACE, #method, rg_s_ ## method, argc) #ifndef HAVE_RB_ERRINFO # define rb_errinfo() (ruby_errinfo) #endif #ifndef G_VALUE_INIT # define G_VALUE_INIT { 0, { { 0 } } } #endif extern ID id_relative_callbacks; extern ID id_call; extern VALUE treeiter_set_value_table; G_GNUC_INTERNAL void Init_gtk_gdk(void); G_GNUC_INTERNAL void Init_gtk_gtk(void); G_GNUC_INTERNAL void Init_gtk_gdk_atom(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_cairo(void); G_GNUC_INTERNAL void Init_gtk_gdk_color(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_colormap(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_const(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_cursor(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_device(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_display(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_display_manager(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_dragcontext(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_event(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_geometry(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_image(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_input(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_keymap(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_keyval(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_pango(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_pangorenderer(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_pixbuf(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_pixmap(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_property(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_rectangle(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_region(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_rgb(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_screen(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_selection(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_threads(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_timecoord(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_visual(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_window(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_windowattr(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_x11(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_aboutdialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accelerator(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accel_group(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accel_group_entry(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accel_key(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accel_label(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accel_map(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accessible(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_action(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_actiongroup(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_adjustment(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_alignment(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_allocation(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_arrow(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_aspect_frame(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_assistant(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_button_box(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_bin(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_bindings(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_border(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_box(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_buildable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_builder(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_calendar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_celleditable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_celllayout(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrenderer(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrendereraccel(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrenderercombo(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrendererpixbuf(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrendererprogress(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrendererspin(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrendererspinner(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrenderertext(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrenderertoggle(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellview(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_check_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_check_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_clipboard(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_colorbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_color_selection(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_color_selection_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_combo(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_combobox(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_comboboxentry(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_const(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_container(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_curve(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_drag(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_drawing_area(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_editable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_entry(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_entry_completion(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_eventbox(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_expander(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_file_chooser(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_filesystemerror(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_filechooserbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_file_chooser_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_file_chooser_widget(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_file_filter(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_file_selection(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_fixed(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_fontbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_font_selection(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_font_selection_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_frame(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_gamma_curve(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_gdk_draw(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_gdk_gc(VALUE mGdk); G_GNUC_INTERNAL void Init_gtk_handle_box(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_hbutton_box(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_hbox(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_hpaned(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_hruler(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_hscale(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_hscrollbar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_hseparator(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_factory(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_iconinfo(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_set(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_size(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_source(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_theme(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_iconview(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_image(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_image_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_imcontext(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_imcontext_simple(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_im_multicontext(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_infobar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_input_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_invisible(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_itemfactory(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_label(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_layout(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_link_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_list_store(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_menu(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_menu_bar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_menu_shell(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_menutoolbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_message_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_misc(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_notebook(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_object(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_option_menu(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_page_setup(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_page_setup_unix_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_paned(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_paper_size(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_plug(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_context(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_printer(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_job(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_operation(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_operation_preview(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_settings(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_unix_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_progress(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_progress_bar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_radio_action(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_radio_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_radio_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_radiotoolbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_range(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_rc(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_rcstyle(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recentaction(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_chooser(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_chooser_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_chooser_menu(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_chooser_widget(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_data(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_filter(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_filter_info(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_info(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_manager(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_ruler(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_scale(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_scalebutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_scrollbar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_scrolled_window(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_selection(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_selectiondata(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_separator(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_separator_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_separatortoolitem(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_settings(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_size_group(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_socket(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_spin_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_spinner(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_statusbar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_status_icon(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_stock(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_style(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_table(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_target_list(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_tearoff_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_text_appearance(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_text_attributes(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_textbuffer(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_textchild(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_textiter(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_textmark(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_texttag(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_text_tag_table(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_textview(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toggle_action(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toggle_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toggletoolbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toolbar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toolbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toolitem(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_tooltip(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_tooltips(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treedragdest(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treedragsource(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treeiter(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treemodel(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treemodelfilter(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_tmodelsort(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treepath(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treerowreference(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treeselection(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treesortable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_tree_store(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treeview(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treeviewcolumn(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_uimanager(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_vbutton_box(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_vbox(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_viewport(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_volumebutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_vpaned(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_vruler(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_vscale(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_vscrollbar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_vseparator(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_widget(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_window(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_windowgroup(VALUE mGtk); #endif /* _RBGTK_GLOBAL_H */ ���������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkvseparator.c�����������������������������������������������0000644�0001750�0001750�00000002566�11701304107�020511� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cVSeparator static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_vseparator_new()); return Qnil; } void Init_gtk_vseparator(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VSEPARATOR, "VSeparator", mGtk); RG_DEF_METHOD(initialize, 0); } ������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkviewport.c�������������������������������������������������0000644�0001750�0001750�00000003011�11701304107�020164� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cViewport static VALUE rg_initialize(VALUE self, VALUE hadj, VALUE vadj) { GtkAdjustment *h_adj = GTK_ADJUSTMENT(RVAL2GOBJ(hadj)); GtkAdjustment *v_adj = GTK_ADJUSTMENT(RVAL2GOBJ(vadj)); RBGTK_INITIALIZE(self, gtk_viewport_new(h_adj, v_adj)); return Qnil; } void Init_gtk_viewport(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VIEWPORT, "Viewport", mGtk); RG_DEF_METHOD(initialize, 2); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkpagesetup.c������������������������������������������������0000644�0001750�0001750�00000013411�12257552167�020331� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cPageSetup #define _SELF(s) (GTK_PAGE_SETUP(RVAL2GOBJ(s))) #define RVAL2SIZE(o) (RVAL2BOXED(o, GTK_TYPE_PAPER_SIZE)) #define RVAL2UNIT(o) (RVAL2GENUM(o, GTK_TYPE_UNIT)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_page_setup_new()); return Qnil; } static VALUE rg_dup(VALUE self) { return GOBJ2RVALU(gtk_page_setup_copy(_SELF(self))); } static VALUE rg_orientation(VALUE self) { return GENUM2RVAL(gtk_page_setup_get_orientation(_SELF(self)), GTK_TYPE_PAGE_ORIENTATION); } static VALUE rg_set_orientation(VALUE self, VALUE orientation) { gtk_page_setup_set_orientation(_SELF(self), RVAL2GENUM(orientation, GTK_TYPE_PAGE_ORIENTATION)); return self; } static VALUE rg_paper_size(VALUE self) { return BOXED2RVAL(gtk_page_setup_get_paper_size(_SELF(self)), GTK_TYPE_PAPER_SIZE); } static VALUE rg_set_paper_size(VALUE self, VALUE paper_size) { gtk_page_setup_set_paper_size(_SELF(self), RVAL2SIZE(paper_size)); return self; } static VALUE rg_get_top_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_top_margin(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_set_top_margin(VALUE self, VALUE margin, VALUE unit) { gtk_page_setup_set_top_margin(_SELF(self), NUM2DBL(margin), RVAL2UNIT(unit)); return self; } static VALUE rg_get_bottom_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_bottom_margin(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_set_bottom_margin(VALUE self, VALUE margin, VALUE unit) { gtk_page_setup_set_bottom_margin(_SELF(self), NUM2DBL(margin), RVAL2UNIT(unit)); return self; } static VALUE rg_get_left_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_left_margin(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_set_left_margin(VALUE self, VALUE margin, VALUE unit) { gtk_page_setup_set_left_margin(_SELF(self), NUM2DBL(margin), RVAL2UNIT(unit)); return self; } static VALUE rg_get_right_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_right_margin(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_set_right_margin(VALUE self, VALUE margin, VALUE unit) { gtk_page_setup_set_right_margin(_SELF(self), NUM2DBL(margin), RVAL2UNIT(unit)); return self; } static VALUE rg_set_paper_size_and_default_margins(VALUE self, VALUE size) { gtk_page_setup_set_paper_size_and_default_margins(_SELF(self), RVAL2SIZE(size)); return self; } /* These take orientation, but not margins into consideration */ static VALUE rg_get_paper_width(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_paper_width(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_get_paper_height(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_paper_height(_SELF(self), RVAL2UNIT(unit))); } /* These take orientation, and margins into consideration */ static VALUE rg_get_page_width(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_page_width(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_get_page_height(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_page_height(_SELF(self), RVAL2UNIT(unit))); } void Init_gtk_page_setup(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PAGE_SETUP, "PageSetup", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(dup, 0); RG_DEF_METHOD(orientation, 0); RG_DEF_METHOD(set_orientation, 1); RG_DEF_METHOD(paper_size, 0); RG_DEF_METHOD(set_paper_size, 1); RG_DEF_METHOD(get_top_margin, 1); RG_DEF_METHOD(set_top_margin, 2); RG_DEF_METHOD(get_bottom_margin, 1); RG_DEF_METHOD(set_bottom_margin, 2); RG_DEF_METHOD(get_left_margin, 1); RG_DEF_METHOD(set_left_margin, 2); RG_DEF_METHOD(get_right_margin, 1); RG_DEF_METHOD(set_right_margin, 2); RG_DEF_METHOD(set_paper_size_and_default_margins, 1); /* These take orientation, but not margins into consideration */ RG_DEF_METHOD(get_paper_width, 1); RG_DEF_METHOD(get_paper_height, 1); /* These take orientation, and margins into consideration */ RG_DEF_METHOD(get_page_width, 1); RG_DEF_METHOD(get_page_height, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkhscrollbar.c�����������������������������������������������0000644�0001750�0001750�00000003051�11701304107�020444� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cHScrollbar static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1; GtkAdjustment *adj = NULL; rb_scan_args(argc, argv, "01", &arg1); if (!NIL_P(arg1)) adj = GTK_ADJUSTMENT(RVAL2GOBJ(arg1)); RBGTK_INITIALIZE(self, gtk_hscrollbar_new(adj)); return Qnil; } void Init_gtk_hscrollbar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HSCROLLBAR, "HScrollbar", mGtk); RG_DEF_METHOD(initialize, -1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkbbox.c�����������������������������������������������������0000644�0001750�0001750�00000004065�12257552167�017273� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cButtonBox static VALUE rg_set_child_secondary(VALUE self, VALUE child, VALUE is_secondary) { gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(RVAL2GOBJ(self)), GTK_WIDGET(RVAL2GOBJ(child)), RVAL2CBOOL(is_secondary)); return self; } static VALUE rg_get_child_secondary(VALUE self, VALUE child) { return CBOOL2RVAL(gtk_button_box_get_child_secondary(GTK_BUTTON_BOX(RVAL2GOBJ(self)), GTK_WIDGET(RVAL2GOBJ(child)))); } void Init_gtk_button_box(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BUTTON_BOX, "ButtonBox", mGtk); RG_DEF_METHOD(set_child_secondary, 2); RG_DEF_METHOD(get_child_secondary, 1); /* GtkButtonBoxStyle(General constants) */ G_DEF_CLASS(GTK_TYPE_BUTTON_BOX_STYLE, "Style", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_BUTTON_BOX_STYLE, "GTK_BUTTONBOX_"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkwidget.c���������������������������������������������������0000644�0001750�0001750�00000076166�12257552167�017637� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cWidget #define _SELF(self) (GTK_WIDGET(RVAL2GOBJ(self))) static VALUE style_prop_func_table; static VALUE rg_flags(VALUE self) { return GFLAGS2RVAL(GTK_WIDGET_FLAGS(_SELF(self)), GTK_TYPE_WIDGET_FLAGS); } static VALUE rg_set_flags(VALUE self, VALUE flag) { GTK_WIDGET_SET_FLAGS(_SELF(self), RVAL2GFLAGS(flag, GTK_TYPE_WIDGET_FLAGS)); return self; } static VALUE rg_unset_flags(VALUE self, VALUE flag) { GTK_WIDGET_UNSET_FLAGS(_SELF(self), RVAL2GFLAGS(flag, GTK_TYPE_WIDGET_FLAGS)); return self; } static VALUE rg_unparent(VALUE self) { gtk_widget_unparent(_SELF(self)); return self; } static VALUE rg_show(VALUE self) { gtk_widget_show(_SELF(self)); return self; } static VALUE rg_show_now(VALUE self) { gtk_widget_show_now(_SELF(self)); return self; } static VALUE rg_hide(VALUE self) { gtk_widget_hide(_SELF(self)); return self; } static VALUE rg_show_all(VALUE self) { gtk_widget_show_all(_SELF(self)); return self; } static VALUE rg_hide_all(VALUE self) { gtk_widget_hide_all(_SELF(self)); return self; } static VALUE rg_map(VALUE self) { gtk_widget_map(_SELF(self)); return self; } static VALUE rg_unmap(VALUE self) { gtk_widget_unmap(_SELF(self)); return self; } static VALUE rg_realize(VALUE self) { gtk_widget_realize(_SELF(self)); return self; } static VALUE rg_unrealize(VALUE self) { gtk_widget_unrealize(_SELF(self)); return self; } static VALUE rg_queue_draw(VALUE self) { gtk_widget_queue_draw(_SELF(self)); return self; } static VALUE rg_queue_resize(VALUE self) { gtk_widget_queue_resize(_SELF(self)); return self; } static VALUE rg_queue_resize_no_redraw(VALUE self) { gtk_widget_queue_resize_no_redraw(_SELF(self)); return self; } /* Note this method is not gtk_widget_get_size_request */ static VALUE rg_size_request(VALUE self) { GtkRequisition req; gtk_widget_size_request(_SELF(self), &req); return rb_ary_new3(2, INT2NUM(req.width), INT2NUM(req.height)); } static VALUE rg_child_requisition(VALUE self) { GtkRequisition req; gtk_widget_get_child_requisition(_SELF(self), &req); return rb_ary_new3(2, INT2NUM(req.width), INT2NUM(req.height)); } static VALUE rg_size_allocate(VALUE self, VALUE alloc) { gtk_widget_size_allocate(_SELF(self), (GtkAllocation*)RVAL2BOXED(alloc, GTK_TYPE_ALLOCATION)); return self; } static VALUE rg_add_accelerator(VALUE self, VALUE sig, VALUE accel, VALUE key, VALUE mod, VALUE flag) { gtk_widget_add_accelerator(_SELF(self), RVAL2CSTR(sig), GTK_ACCEL_GROUP(RVAL2GOBJ(accel)), NUM2INT(key), RVAL2GFLAGS(mod, GDK_TYPE_MODIFIER_TYPE), RVAL2GFLAGS(flag, GTK_TYPE_ACCEL_FLAGS)); return self; } static VALUE rg_remove_accelerator(VALUE self, VALUE accel, VALUE key, VALUE mod) { return CBOOL2RVAL(gtk_widget_remove_accelerator(_SELF(self), GTK_ACCEL_GROUP(RVAL2GOBJ(accel)), NUM2INT(key), RVAL2GFLAGS(mod, GDK_TYPE_MODIFIER_TYPE))); } static VALUE rg_set_accel_path(VALUE self, VALUE accel_path, VALUE accel_group) { gtk_widget_set_accel_path(_SELF(self), RVAL2CSTR(accel_path), GTK_ACCEL_GROUP(RVAL2GOBJ(accel_group))); return self; } static VALUE rg_accel_closures(VALUE self) { return GLIST2ARY2F(gtk_widget_list_accel_closures(_SELF(self)), G_TYPE_CLOSURE); } static VALUE rg_can_activate_accel_p(VALUE self, VALUE signal_id) { return CBOOL2RVAL(gtk_widget_can_activate_accel(_SELF(self), NUM2UINT(signal_id))); } static VALUE rg_event(VALUE self, VALUE event) { return CBOOL2RVAL(gtk_widget_event(_SELF(self), RVAL2GEV(event))); } static VALUE rg_activate(VALUE self) { return CBOOL2RVAL(gtk_widget_activate(_SELF(self))); } static VALUE rg_reparent(VALUE self, VALUE parent) { gtk_widget_reparent(_SELF(self), _SELF(parent)); return self; } static VALUE rg_intersect(VALUE self, VALUE area) { GdkRectangle intersection; gboolean ret = gtk_widget_intersect(_SELF(self), (GdkRectangle*)RVAL2BOXED(area, GDK_TYPE_RECTANGLE), &intersection); return ret ? BOXED2RVAL(&intersection, GDK_TYPE_RECTANGLE) : Qnil; } static VALUE rg_grab_default(VALUE self) { gtk_widget_grab_default(_SELF(self)); return self; } static VALUE rg_set_state(VALUE self, VALUE state) { gtk_widget_set_state(_SELF(self), RVAL2GTKSTATETYPE(state)); return self; } static VALUE rg_set_parent_window(VALUE self, VALUE parent_window) { gtk_widget_set_parent_window(_SELF(self), GDK_WINDOW(RVAL2GOBJ(parent_window))); return self; } static VALUE rg_parent_window(VALUE self) { return GOBJ2RVAL(gtk_widget_get_parent_window(_SELF(self))); } static VALUE rg_add_events(VALUE self, VALUE events) { gtk_widget_add_events(_SELF(self), NUM2INT(events)); return self; } static VALUE rg_toplevel(VALUE self) { return GOBJ2RVAL(gtk_widget_get_toplevel(_SELF(self))); } static VALUE rg_get_ancestor(VALUE self, VALUE klass) { return GOBJ2RVAL(gtk_widget_get_ancestor(_SELF(self), CLASS2GTYPE(klass))); } static VALUE rg_colormap(VALUE self) { return GOBJ2RVAL(gtk_widget_get_colormap(_SELF(self))); } static VALUE rg_set_colormap(VALUE self, VALUE colormap) { gtk_widget_set_colormap(_SELF(self), GDK_COLORMAP(RVAL2GOBJ(colormap))); return self; } static VALUE rg_visual(VALUE self) { return GOBJ2RVAL(gtk_widget_get_visual(_SELF(self))); } static VALUE rg_pointer(VALUE self) { int x, y; gtk_widget_get_pointer(_SELF(self), &x, &y); return rb_assoc_new(INT2FIX(x), INT2FIX(y)); } static VALUE rg_ancestor_p(VALUE self, VALUE ancestor) { return CBOOL2RVAL(gtk_widget_is_ancestor(_SELF(self), _SELF(ancestor))); } static VALUE rg_translate_coordinates(VALUE self, VALUE dest_widget, VALUE src_x, VALUE src_y) { gint dest_x, dest_y; gboolean ret; VALUE result = Qnil; ret = gtk_widget_translate_coordinates(_SELF(self), _SELF(dest_widget), NUM2INT(src_x), NUM2INT(src_y), &dest_x, &dest_y); if (ret) result = rb_ary_new3(2, INT2FIX(dest_x), INT2FIX(dest_y)); return result; } static VALUE rg_hide_on_delete(VALUE self) { return CBOOL2RVAL(gtk_widget_hide_on_delete(_SELF(self))); } static VALUE rg_ensure_style(VALUE self) { gtk_widget_ensure_style(_SELF(self)); return self; } static VALUE rg_reset_rc_styles(VALUE self) { gtk_widget_reset_rc_styles(_SELF(self)); return self; } static VALUE rg_s_push_colormap(G_GNUC_UNUSED VALUE self, VALUE cmap) { gtk_widget_push_colormap(GDK_COLORMAP(RVAL2GOBJ(cmap))); return cmap; } static VALUE rg_s_pop_colormap(VALUE self) { gtk_widget_pop_colormap(); return self; } static VALUE rg_s_set_default_colormap(G_GNUC_UNUSED VALUE self, VALUE cmap) { gtk_widget_set_default_colormap(GDK_COLORMAP(RVAL2GOBJ(cmap))); return cmap; } static VALUE rg_s_default_style(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_widget_get_default_style()); } static VALUE rg_s_default_colormap(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_widget_get_default_colormap()); } static VALUE rg_s_default_visual(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_widget_get_default_visual()); } static VALUE rg_set_direction(VALUE self, VALUE dir) { gtk_widget_set_direction(_SELF(self), RVAL2GENUM(dir, GTK_TYPE_TEXT_DIRECTION)); return self; } static VALUE rg_direction(VALUE self) { return GENUM2RVAL(gtk_widget_get_direction(_SELF(self)), GTK_TYPE_TEXT_DIRECTION); } static VALUE rg_s_set_default_direction(VALUE self, VALUE dir) { gtk_widget_set_default_direction(RVAL2GENUM(dir, GTK_TYPE_TEXT_DIRECTION)); return self; } static VALUE rg_s_default_direction(G_GNUC_UNUSED VALUE self) { return GENUM2RVAL(gtk_widget_get_default_direction(), GTK_TYPE_TEXT_DIRECTION); } static VALUE rg_shape_combine_mask(VALUE self, VALUE shape_mask, VALUE offset_x, VALUE offset_y) { gtk_widget_shape_combine_mask(_SELF(self), GDK_BITMAP(RVAL2GOBJ(shape_mask)), NUM2INT(offset_x), NUM2INT(offset_y)); return self; } static VALUE rg_input_shape_combine_mask(VALUE self, VALUE shape_mask, VALUE offset_x, VALUE offset_y) { gtk_widget_input_shape_combine_mask(_SELF(self), GDK_BITMAP(RVAL2GOBJ(shape_mask)), NUM2INT(offset_x), NUM2INT(offset_y)); return self; } static VALUE rg_path(VALUE self) { guint path_length; gchar *path; gchar *path_reversed; VALUE str_path; VALUE str_path_reversed; gtk_widget_path(_SELF(self), &path_length, &path, &path_reversed); str_path = CSTR2RVAL(path); str_path_reversed = CSTR2RVAL(path_reversed); g_free(path); g_free(path_reversed); return rb_ary_new3(2, str_path, str_path_reversed); } static VALUE rg_class_path(VALUE self) { guint path_length; gchar *path; gchar *path_reversed; VALUE str_path; VALUE str_path_reversed; gtk_widget_class_path(_SELF(self), &path_length, &path, &path_reversed); str_path = CSTR2RVAL(path); str_path_reversed = CSTR2RVAL(path_reversed); g_free(path); g_free(path_reversed); return rb_ary_new3(2, str_path, str_path_reversed); } static VALUE rg_composite_name(VALUE self) { return CSTR2RVAL(gtk_widget_get_composite_name(_SELF(self))); } static VALUE rg_modify_style(VALUE self, VALUE style) { gtk_widget_modify_style(_SELF(self), GTK_RC_STYLE(RVAL2GOBJ(style))); return self; } static VALUE rg_modifier_style(VALUE self) { return GOBJ2RVAL(gtk_widget_get_modifier_style(_SELF(self))); } static VALUE rg_modify_fg(VALUE self, VALUE state, VALUE color) { gtk_widget_modify_fg(_SELF(self), RVAL2GTKSTATETYPE(state), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_modify_bg(VALUE self, VALUE state, VALUE color) { gtk_widget_modify_bg(_SELF(self), RVAL2GTKSTATETYPE(state), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_modify_text(VALUE self, VALUE state, VALUE color) { gtk_widget_modify_text(_SELF(self), RVAL2GTKSTATETYPE(state), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_modify_base(VALUE self, VALUE state, VALUE color) { gtk_widget_modify_base(_SELF(self), RVAL2GTKSTATETYPE(state), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_modify_font(VALUE self, VALUE font_desc) { gtk_widget_modify_font(_SELF(self), (PangoFontDescription*)RVAL2BOXED(font_desc, PANGO_TYPE_FONT_DESCRIPTION)); return self; } #if GTK_CHECK_VERSION(2,12,0) static VALUE rg_modify_cursor(VALUE self, VALUE primary, VALUE seconday) { gtk_widget_modify_cursor(_SELF(self), RVAL2BOXED(primary, GDK_TYPE_COLOR), RVAL2BOXED(seconday, GDK_TYPE_COLOR)); return self; } #endif static VALUE rg_create_pango_context(VALUE self) { return GOBJ2RVALU(gtk_widget_create_pango_context(_SELF(self))); } static VALUE rg_pango_context(VALUE self) { return GOBJ2RVAL(gtk_widget_get_pango_context(_SELF(self))); } static VALUE rg_create_pango_layout(int argc, VALUE *argv, VALUE self) { VALUE text; rb_scan_args(argc, argv, "01", &text); return GOBJ2RVALU(gtk_widget_create_pango_layout(_SELF(self), RVAL2CSTR_ACCEPT_NIL(text))); } static VALUE rg_render_icon(int argc, VALUE *argv, VALUE self) { VALUE stock_id, size, detail; rb_scan_args(argc, argv, "21", &stock_id, &size, &detail); return GOBJ2RVALU(gtk_widget_render_icon(_SELF(self), rb_id2name(SYM2ID(stock_id)), RVAL2GENUM(size, GTK_TYPE_ICON_SIZE), RVAL2CSTR_ACCEPT_NIL(detail))); } static VALUE rg_s_pop_composite_child(VALUE self) { gtk_widget_pop_composite_child(); return self; } static VALUE rg_s_push_composite_child(VALUE self) { gtk_widget_push_composite_child(); return self; } static VALUE rg_queue_draw_area(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_widget_queue_draw_area(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_reset_shapes(VALUE self) { gtk_widget_reset_shapes(_SELF(self)); return self; } static VALUE rg_set_redraw_on_allocate(VALUE self, VALUE redraw_on_allocate) { gtk_widget_set_redraw_on_allocate(_SELF(self), RVAL2CBOOL(redraw_on_allocate)); return self; } static VALUE rg_set_composite_name(VALUE self, VALUE name) { gtk_widget_set_composite_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_set_scroll_adjustments(VALUE self, VALUE h, VALUE v) { return CBOOL2RVAL(gtk_widget_set_scroll_adjustments(_SELF(self), GTK_ADJUSTMENT(_SELF(h)), GTK_ADJUSTMENT(_SELF(v)))); } static VALUE rg_mnemonic_activate(VALUE self, VALUE group_cycling) { return CBOOL2RVAL(gtk_widget_mnemonic_activate(_SELF(self), RVAL2CBOOL(group_cycling))); } /* * Gtk::Widget.install_style_property(...) do |spec, str| * #parse str * new_val = .... # parse value from string. * new_val # return new_val or nil if you can't convert the value. * end */ static gboolean rc_property_parser(const GParamSpec *pspec, const GString *rc_string, GValue *property_value) { VALUE spec = GOBJ2RVAL((gpointer)pspec); VALUE func = rb_hash_aref(style_prop_func_table, spec); VALUE ret = rb_funcall(func, id_call, 2, spec, CSTR2RVAL(rc_string->str)); if (NIL_P(ret)) { return FALSE; } else if (RVAL2CBOOL(ret)){ rbgobj_rvalue_to_gvalue(ret, property_value); return TRUE; } else { rb_raise(rb_eArgError, "Gtk::Widget#install_style_property() block should return new value or nil"); } } static VALUE rg_s_install_style_property(VALUE self, VALUE spec) { const RGObjClassInfo* cinfo = rbgobj_lookup_class(self); GtkWidgetClass* gclass; GParamSpec* pspec = G_PARAM_SPEC(RVAL2GOBJ(spec)); if (cinfo->klass != self) rb_raise(rb_eTypeError, "%s isn't registered class", rb_class2name(self)); gclass = (GtkWidgetClass *)g_type_class_ref(cinfo->gtype); if (rb_block_given_p()){ VALUE func = rb_block_proc(); rb_hash_aset(style_prop_func_table, spec, func); gtk_widget_class_install_style_property_parser(gclass, pspec, (GtkRcPropertyParser)rc_property_parser); } else { gtk_widget_class_install_style_property(gclass, pspec); } return self; } static VALUE rg_s_style_property(VALUE self, VALUE property_name) { GtkWidgetClass* oclass; const char* name; GParamSpec* prop; VALUE result; if (SYMBOL_P(property_name)) { name = rb_id2name(SYM2ID(property_name)); } else { name = RVAL2CSTR(property_name); } oclass = (GtkWidgetClass*)g_type_class_ref(CLASS2GTYPE(self)); prop = gtk_widget_class_find_style_property(oclass, name); if (!prop){ g_type_class_unref(oclass); rb_raise(rb_eval_string("GLib::NoPropertyError"), "no such property: %s", name); } result = GOBJ2RVAL(prop); g_type_class_unref(oclass); return result; } static VALUE rg_s_style_properties(int argc, VALUE *argv, VALUE self) { GtkWidgetClass* oclass = g_type_class_ref(CLASS2GTYPE(self)); guint n_properties; GParamSpec** props; VALUE inherited_too; VALUE ary; guint i; if (rb_scan_args(argc, argv, "01", &inherited_too) == 0) inherited_too = Qtrue; props = gtk_widget_class_list_style_properties(oclass, &n_properties); ary = rb_ary_new(); for (i = 0; i < n_properties; i++){ if (RVAL2CBOOL(inherited_too) || GTYPE2CLASS(props[i]->owner_type) == self) rb_ary_push(ary, CSTR2RVAL(props[i]->name)); } g_free(props); g_type_class_unref(oclass); return ary; } static VALUE rg_region_intersect(VALUE self, VALUE region) { return BOXED2RVAL(gtk_widget_region_intersect(_SELF(self), (GdkRegion*)RVAL2BOXED(region, GDK_TYPE_REGION)), GDK_TYPE_REGION); } static VALUE rg_send_expose(VALUE self, VALUE event) { return INT2NUM(gtk_widget_send_expose(_SELF(self), RVAL2GEV(event))); } /* They are needless method for ruby. void gtk_widget_style_get (GtkWidget *widget, const gchar *first_property_name, ...); void gtk_widget_style_get_valist (GtkWidget *widget, const gchar *first_property_name, va_list var_args); */ static VALUE rg_style_get_property(VALUE self, VALUE prop_name) { GParamSpec* pspec = NULL; const char* name; if (SYMBOL_P(prop_name)) { name = rb_id2name(SYM2ID(prop_name)); } else { name = RVAL2CSTR(prop_name); } pspec = gtk_widget_class_find_style_property((GtkWidgetClass*)g_type_class_ref(RVAL2GTYPE(self)), name); if (!pspec) rb_raise(rb_eval_string("GLib::NoPropertyError"), "No such property: %s", name); else { // FIXME: use rb_ensure to call g_value_unset() GValue gval = G_VALUE_INIT; VALUE ret; g_value_init(&gval, G_PARAM_SPEC_VALUE_TYPE(pspec)); gtk_widget_style_get_property(GTK_WIDGET(RVAL2GOBJ(self)), name, &gval); ret = GVAL2RVAL(&gval); g_value_unset(&gval); return ret; } } static VALUE rg_accessible(VALUE self) { return GOBJ2RVAL(gtk_widget_get_accessible(_SELF(self))); } static VALUE rg_child_focus(VALUE self, VALUE direction) { return CBOOL2RVAL(gtk_widget_child_focus(_SELF(self), RVAL2GENUM(direction, GTK_TYPE_DIRECTION_TYPE))); } #if GTK_CHECK_VERSION(2,12,0) static VALUE rg_error_bell(VALUE self) { gtk_widget_error_bell(_SELF(self)); return self; } static VALUE rg_keynav_failed(VALUE self, VALUE direction) { return CBOOL2RVAL(gtk_widget_keynav_failed(_SELF(self), RVAL2GENUM(direction, GTK_TYPE_DIRECTION_TYPE))); } #endif static VALUE rg_child_notify(VALUE self, VALUE child_property) { gtk_widget_child_notify(_SELF(self), RVAL2CSTR(child_property)); return self; } static VALUE rg_freeze_child_notify(VALUE self) { gtk_widget_freeze_child_notify(_SELF(self)); return self; } static VALUE rg_child_visible_p(VALUE self) { return CBOOL2RVAL(gtk_widget_get_child_visible(_SELF(self))); } static VALUE rg_settings(VALUE self) { return GOBJ2RVAL(gtk_widget_get_settings(_SELF(self))); } static VALUE rg_get_clipboard(VALUE self, VALUE selection) { return CLIPBOARD2RVAL(gtk_widget_get_clipboard(_SELF(self), RVAL2ATOM(selection))); } static VALUE rg_display(VALUE self) { return GOBJ2RVAL(gtk_widget_get_display(_SELF(self))); } static VALUE rg_root_window(VALUE self) { return GOBJ2RVAL(gtk_widget_get_root_window(_SELF(self))); } static VALUE rg_screen(VALUE self) { return GOBJ2RVAL(gtk_widget_get_screen(_SELF(self))); } static VALUE rg_has_screen_p(VALUE self) { return CBOOL2RVAL(gtk_widget_has_screen(_SELF(self))); } /* Note this method is not gtk_widget_size_request() */ static VALUE rg_get_size_request(VALUE self) { gint width, height; gtk_widget_get_size_request(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_set_child_visible(VALUE self, VALUE is_visible) { gtk_widget_set_child_visible(_SELF(self), RVAL2CBOOL(is_visible)); return self; } static VALUE rg_set_size_request(VALUE self, VALUE width, VALUE height) { gtk_widget_set_size_request(_SELF(self), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_thaw_child_notify(VALUE self) { gtk_widget_thaw_child_notify(_SELF(self)); return self; } static VALUE rg_mnemonic_labels(VALUE self) { return GLIST2ARYF(gtk_widget_list_mnemonic_labels(_SELF(self))); } static VALUE rg_add_mnemonic_label(VALUE self, VALUE label) { gtk_widget_add_mnemonic_label(_SELF(self), GTK_WIDGET(RVAL2GOBJ(label))); return self; } static VALUE rg_remove_mnemonic_label(VALUE self, VALUE label) { gtk_widget_remove_mnemonic_label(_SELF(self), GTK_WIDGET(RVAL2GOBJ(label))); return self; } #if GTK_CHECK_VERSION(2,12,0) static VALUE rg_set_tooltip_window(VALUE self, VALUE custom_window) { gtk_widget_set_tooltip_window(_SELF(self), GTK_WINDOW(RVAL2GOBJ(custom_window))); return self; } static VALUE rg_tooltip_window(VALUE self) { return GOBJ2RVAL(gtk_widget_get_tooltip_window(_SELF(self))); } static VALUE rg_trigger_tooltip_query(VALUE self) { gtk_widget_trigger_tooltip_query(_SELF(self)); return self; } #endif static VALUE rg_action(VALUE self) { return GOBJ2RVAL(gtk_widget_get_action(_SELF(self))); } static VALUE rg_composited_p(VALUE self) { return CBOOL2RVAL(gtk_widget_is_composited(_SELF(self))); } static VALUE rg_window(VALUE self) { return GOBJ2RVAL(_SELF(self)->window); } static VALUE rg_set_window(VALUE self, VALUE window) { #if GTK_CHECK_VERSION(2,18,0) gtk_widget_set_window(_SELF(self), GDK_WINDOW(RVAL2GOBJ(window))); #else _SELF(self)->window = RVAL2GOBJ(window); #endif return self; } #define DEFINE_IS_WIDGET(STATE) \ static VALUE \ widget_ ## STATE (VALUE self) \ { \ return( GTK_WIDGET_ ## STATE (_SELF(self))? Qtrue: Qfalse ); \ } DEFINE_IS_WIDGET(TOPLEVEL); DEFINE_IS_WIDGET(NO_WINDOW); DEFINE_IS_WIDGET(REALIZED); DEFINE_IS_WIDGET(MAPPED); /*DEFINE_IS_WIDGET(VISIBLE); VISIBLE is defined as property*/ DEFINE_IS_WIDGET(DRAWABLE); DEFINE_IS_WIDGET(PARENT_SENSITIVE); DEFINE_IS_WIDGET(IS_SENSITIVE); DEFINE_IS_WIDGET(HAS_GRAB); DEFINE_IS_WIDGET(RC_STYLE); static VALUE rg_allocation(VALUE self) { return BOXED2RVAL(&(_SELF(self)->allocation), GTK_TYPE_ALLOCATION); } static VALUE rg_set_allocation(VALUE self, VALUE x, VALUE y, VALUE w, VALUE h) { GtkAllocation *a = &(_SELF(self)->allocation); a->x = NUM2INT(x); a->y = NUM2INT(y); a->width = NUM2INT(w); a->height = NUM2INT(h); return self; } static VALUE rg_requisition(VALUE self) { GtkRequisition req = _SELF(self)->requisition; return rb_ary_new3(2, INT2NUM(req.width), INT2NUM(req.height)); } static VALUE rg_set_requisition(VALUE self, VALUE w, VALUE h) { GtkRequisition *r = &(_SELF(self)->requisition); r->width = NUM2INT(w); r->height = NUM2INT(h); return self; } static VALUE rg_state(VALUE self) { return GENUM2RVAL(_SELF(self)->state, GTK_TYPE_STATE_TYPE); } static VALUE rg_saved_state(VALUE self) { return GENUM2RVAL(_SELF(self)->saved_state, GTK_TYPE_STATE_TYPE); } static VALUE widget_signal_size_request(G_GNUC_UNUSED guint num, const GValue *values) { GtkRequisition* req = (GtkRequisition*)g_value_get_boxed(&values[1]); return rb_ary_new3(2, GVAL2RVAL(&values[0]), rb_ary_new3(2, INT2NUM(req->width), INT2NUM(req->height))); } static VALUE widget_signal_size_allocate(G_GNUC_UNUSED guint num, const GValue *values) { GtkAllocation* alloc = (GtkAllocation*)g_value_get_boxed(&values[1]); return rb_ary_new3(2, GVAL2RVAL(&values[0]), BOXED2RVAL(alloc, GTK_TYPE_ALLOCATION)); } void Init_gtk_widget(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_WIDGET, "Widget", mGtk); rb_global_variable(&style_prop_func_table); style_prop_func_table = rb_hash_new(); /* * instance methods */ RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(set_flags, 1); RG_DEF_METHOD(unset_flags, 1); RG_DEF_METHOD(unparent, 0); RG_DEF_METHOD(show, 0); RG_DEF_METHOD(show_now, 0); RG_DEF_METHOD(hide, 0); RG_DEF_METHOD(show_all, 0); RG_DEF_METHOD(hide_all, 0); RG_DEF_METHOD(map, 0); RG_DEF_METHOD(unmap, 0); RG_DEF_METHOD(realize, 0); RG_DEF_METHOD(unrealize, 0); RG_DEF_METHOD(queue_draw, 0); RG_DEF_METHOD(queue_resize, 0); RG_DEF_METHOD(queue_resize_no_redraw, 0); RG_DEF_METHOD(size_request, 0); RG_DEF_METHOD(child_requisition, 0); RG_DEF_METHOD(size_allocate, 1); RG_DEF_METHOD(add_accelerator, 5); RG_DEF_METHOD(remove_accelerator, 3); RG_DEF_METHOD(set_accel_path, 2); RG_DEF_METHOD(accel_closures, 0); RG_DEF_METHOD_P(can_activate_accel, 1); RG_DEF_METHOD(event, 1); RG_DEF_METHOD(activate, 0); RG_DEF_METHOD(reparent, 1); RG_DEF_SMETHOD(install_style_property, 1); RG_DEF_SMETHOD(style_property, 1); RG_DEF_SMETHOD(style_properties, -1); RG_DEF_METHOD(intersect, 1); RG_DEF_METHOD(grab_default, 0); RG_DEF_METHOD(set_state, 1); RG_DEF_METHOD(set_parent_window, 1); RG_DEF_METHOD(parent_window, 0); RG_DEF_METHOD(add_events, 1); RG_DEF_METHOD(toplevel, 0); RG_DEF_METHOD(get_ancestor, 1); RG_DEF_METHOD(colormap, 0); RG_DEF_METHOD(set_colormap, 1); RG_DEF_METHOD(visual, 0); RG_DEF_METHOD(pointer, 0); RG_DEF_METHOD_P(ancestor, 1); RG_DEF_METHOD(translate_coordinates, 3); RG_DEF_METHOD(hide_on_delete, 0); RG_DEF_METHOD(ensure_style, 0); RG_DEF_METHOD(reset_rc_styles, 0); RG_DEF_METHOD(set_direction, 1); RG_DEF_METHOD(direction, 0); RG_DEF_METHOD(shape_combine_mask, 3); RG_DEF_METHOD(input_shape_combine_mask, 3); RG_DEF_METHOD(path, 0); RG_DEF_METHOD(class_path, 0); RG_DEF_METHOD(composite_name, 0); RG_DEF_METHOD(modify_style, 1); RG_DEF_METHOD(modifier_style, 0); RG_DEF_METHOD(modify_fg, 2); RG_DEF_METHOD(modify_bg, 2); RG_DEF_METHOD(modify_text, 2); RG_DEF_METHOD(modify_base, 2); RG_DEF_METHOD(modify_font, 1); #if GTK_CHECK_VERSION(2,12,0) RG_DEF_METHOD(modify_cursor, 2); #endif RG_DEF_METHOD(create_pango_context, 0); RG_DEF_METHOD(pango_context, 0); RG_DEF_METHOD(create_pango_layout, -1); RG_DEF_METHOD(render_icon, -1); RG_DEF_METHOD(queue_draw_area, 4); RG_DEF_METHOD(reset_shapes, 0); RG_DEF_METHOD(set_redraw_on_allocate, 1); RG_DEF_METHOD(set_composite_name, 1); RG_DEF_METHOD(set_scroll_adjustments, 2); /* for backward compatibility. */ RG_DEF_ALIAS("set_scroll_adjustment", "set_scroll_adjustments"); RG_DEF_METHOD(mnemonic_activate, 1); RG_DEF_METHOD(region_intersect, 1); RG_DEF_METHOD(send_expose, 1); RG_DEF_METHOD(style_get_property, 1); RG_DEF_METHOD(accessible, 0); RG_DEF_METHOD(child_focus, 1); #if GTK_CHECK_VERSION(2,12,0) RG_DEF_METHOD(error_bell, 0); RG_DEF_METHOD(keynav_failed, 0); #endif RG_DEF_METHOD(child_notify, 1); RG_DEF_METHOD(freeze_child_notify, 0); RG_DEF_METHOD_P(child_visible, 0); RG_DEF_METHOD(settings, 0); RG_DEF_METHOD(get_clipboard, 1); RG_DEF_METHOD(display, 0); RG_DEF_METHOD(root_window, 0); RG_DEF_METHOD(screen, 0); RG_DEF_METHOD_P(has_screen, 0); RG_DEF_METHOD(set_child_visible, 1); RG_DEF_METHOD(get_size_request, 0); RG_DEF_METHOD(set_size_request, 2); RG_DEF_METHOD(thaw_child_notify, 0); RG_DEF_METHOD(mnemonic_labels, 0); RG_DEF_METHOD(add_mnemonic_label, 1); RG_DEF_METHOD(remove_mnemonic_label, 1); #if GTK_CHECK_VERSION(2,12,0) RG_DEF_METHOD(set_tooltip_window, 1); RG_DEF_METHOD(tooltip_window, 0); RG_DEF_METHOD(trigger_tooltip_query, 0); #endif RG_DEF_METHOD(action, 0); RG_DEF_METHOD_P(composited, 0); RG_DEF_METHOD(window, 0); RG_DEF_METHOD(set_window, 1); RG_DEF_METHOD(allocation, 0); RG_DEF_METHOD(set_allocation, 4); RG_DEF_METHOD(requisition, 0); RG_DEF_METHOD(set_requisition, 2); RG_DEF_METHOD(state, 0); RG_DEF_METHOD(saved_state, 0); rb_define_method(RG_TARGET_NAMESPACE, "toplevel?", widget_TOPLEVEL, 0); rb_define_method(RG_TARGET_NAMESPACE, "no_window?", widget_NO_WINDOW, 0); rb_define_method(RG_TARGET_NAMESPACE, "realized?", widget_REALIZED, 0); rb_define_method(RG_TARGET_NAMESPACE, "mapped?", widget_MAPPED, 0); rb_define_method(RG_TARGET_NAMESPACE, "drawable?", widget_DRAWABLE, 0); rb_define_method(RG_TARGET_NAMESPACE, "parent_sensitive?", widget_PARENT_SENSITIVE, 0); /* This method's name avoid to sensitive? of a property variables. */ rb_define_method(RG_TARGET_NAMESPACE, "sensitive_with_parent?", widget_IS_SENSITIVE, 0); rb_define_method(RG_TARGET_NAMESPACE, "has_grab?", widget_HAS_GRAB, 0); rb_define_method(RG_TARGET_NAMESPACE, "rc_style?", widget_RC_STYLE, 0); /* * singleton methods */ RG_DEF_SMETHOD(push_colormap, 1); RG_DEF_SMETHOD(pop_colormap, 0); RG_DEF_SMETHOD(set_default_colormap, 1); RG_DEF_SMETHOD(default_style, 0); RG_DEF_SMETHOD(default_colormap, 0); RG_DEF_SMETHOD(default_visual, 0); RG_DEF_SMETHOD(set_default_direction, 1); RG_DEF_SMETHOD(default_direction, 0); RG_DEF_SMETHOD(pop_composite_child, 0); RG_DEF_SMETHOD(push_composite_child, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* * constants */ /* GtkWidgetFlags */ G_DEF_CLASS(GTK_TYPE_WIDGET_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_WIDGET_FLAGS, "GTK_"); /* GtkWidgetHelpType */ G_DEF_CLASS(GTK_TYPE_WIDGET_HELP_TYPE, "HelpType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_WIDGET_HELP_TYPE, "GTK_WIDGET_"); /* GtkTextDirection */ G_DEF_CLASS(GTK_TYPE_TEXT_DIRECTION, "TextDirection", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TEXT_DIRECTION, "GTK_"); /* Special signals */ G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "size-request", (GValToRValSignalFunc)widget_signal_size_request); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "size-allocate", (GValToRValSignalFunc)widget_signal_size_allocate); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkconversions.h����������������������������������������������0000644�0001750�0001750�00000003067�11701304107�020675� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef _RBGTKCONVERSIONS_H #define _RBGTKCONVERSIONS_H #include <rbgobject.h> #include <gtk/gtk.h> #include <rbgdkconversions.h> #define GTKTREEPATH2RVAL(t) (BOXED2RVAL(t, GTK_TYPE_TREE_PATH)) #define RVAL2GTKTREEPATH(t) ((GtkTreePath *)RVAL2BOXED(t, GTK_TYPE_TREE_PATH)) #define GTKTREEITER2RVAL(i) (BOXED2RVAL(i, GTK_TYPE_TREE_ITER)) #define RVAL2GTKTREEITER(i) ((GtkTreeIter *)RVAL2BOXED(i, GTK_TYPE_TREE_ITER)) #define RVAL2GTKSTATETYPE(type) (RVAL2GENUM(type, GTK_TYPE_STATE_TYPE)) #define GTKRCFLAGS2RVAL(flags) (GFLAGS2RVAL(flags, GTK_TYPE_RC_FLAGS)) #define RVAL2GTKRCFLAGS(flags) (RVAL2GFLAGS(flags, GTK_TYPE_RC_FLAGS)) #endif /* _RBGTKCONVERSIONS_H */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkselection.c������������������������������������������������0000644�0001750�0001750�00000011510�12257552167�020317� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mSelection #define RVAL2WIDGET(w) (GTK_WIDGET(RVAL2GOBJ(w))) static VALUE rg_m_owner_set(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { gboolean ret; if (argc == 3){ VALUE widget, selection, time; rb_scan_args(argc, argv, "30", &widget, &selection, &time); ret = gtk_selection_owner_set(RVAL2WIDGET(widget), RVAL2ATOM(selection), NUM2INT(time)); } else { VALUE display, widget, selection, time; rb_scan_args(argc, argv, "40", &display, &widget, &selection, &time); ret = gtk_selection_owner_set_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2WIDGET(widget), RVAL2ATOM(selection), NUM2INT(time)); } return CBOOL2RVAL(ret); } static VALUE rg_m_add_target(VALUE self, VALUE widget, VALUE selection, VALUE target, VALUE info) { gtk_selection_add_target(RVAL2WIDGET(widget), RVAL2ATOM(selection), RVAL2ATOM(target), NUM2INT(info)); return self; } static VALUE rg_m_add_targets(VALUE self, VALUE rbwidget, VALUE rbselection, VALUE rbtargets) { GtkWidget *widget = RVAL2WIDGET(rbwidget); GdkAtom selection = RVAL2ATOM(rbselection); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_selection_add_targets(widget, selection, targets, n); g_free(targets); return self; } static VALUE rg_m_clear_targets(VALUE self, VALUE widget, VALUE selection) { gtk_selection_clear_targets(RVAL2WIDGET(widget), RVAL2ATOM(selection)); return self; } static VALUE rg_m_convert(G_GNUC_UNUSED VALUE self, VALUE widget, VALUE selection, VALUE target, VALUE time) { gboolean ret = gtk_selection_convert(RVAL2WIDGET(widget), RVAL2ATOM(selection), RVAL2ATOM(target), NUM2INT(time)); return CBOOL2RVAL(ret); } static VALUE rg_m_remove_all(VALUE self, VALUE widget) { gtk_selection_remove_all(RVAL2WIDGET(widget)); return self; } static VALUE rg_m_include_image_p(G_GNUC_UNUSED VALUE self, VALUE rbtargets, VALUE rbwritable) { gboolean writable = RVAL2CBOOL(rbwritable); long n; GdkAtom *targets = RVAL2GDKATOMS(rbtargets, &n); gboolean result; result = gtk_targets_include_image(targets, n, writable); g_free(targets); return result; } static VALUE rg_m_include_text_p(G_GNUC_UNUSED VALUE self, VALUE rbtargets) { long n; GdkAtom *targets = RVAL2GDKATOMS(rbtargets, &n); gboolean result; result = gtk_targets_include_text(targets, n); g_free(targets); return result; } static VALUE rg_m_include_uri_p(G_GNUC_UNUSED VALUE self, VALUE rbtargets) { long n; GdkAtom *targets = RVAL2GDKATOMS(rbtargets, &n); gboolean result; result = gtk_targets_include_uri(targets, n); g_free(targets); return result; } static VALUE rg_m_include_rich_text_p(G_GNUC_UNUSED VALUE self, VALUE rbtargets, VALUE rbbuffer) { GtkTextBuffer *buffer = GTK_TEXT_BUFFER(RVAL2GOBJ(rbbuffer)); long n; GdkAtom *targets = RVAL2GDKATOMS(rbtargets, &n); gboolean result; result = gtk_targets_include_rich_text(targets, n, buffer); g_free(targets); return result; } void Init_gtk_selection(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "Selection"); RG_DEF_MODFUNC(owner_set, 3); RG_DEF_MODFUNC(add_target, 4); RG_DEF_MODFUNC(add_targets, 3); RG_DEF_MODFUNC(clear_targets, 2); RG_DEF_MODFUNC(convert, 4); RG_DEF_MODFUNC(remove_all, 1); RG_DEF_MODFUNC_P(include_image, 2); RG_DEF_MODFUNC_P(include_text, 1); RG_DEF_MODFUNC_P(include_uri, 1); RG_DEF_MODFUNC_P(include_rich_text, 2); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkradioaction.c����������������������������������������������0000644�0001750�0001750�00000007345�12257552167�020641� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRadioAction #define _SELF(self) (GTK_RADIO_ACTION(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self, VALUE name, VALUE label, VALUE tooltip, VALUE stock_id, VALUE value) { const gchar *gstock = NULL; if (TYPE(stock_id) == T_STRING){ gstock = RVAL2CSTR(stock_id); } else if (TYPE(stock_id) == T_SYMBOL) { gstock = rb_id2name(SYM2ID(stock_id)); } G_INITIALIZE(self, gtk_radio_action_new(RVAL2CSTR(name), RVAL2CSTR(label), NIL_P(tooltip) ? NULL : RVAL2CSTR(tooltip), gstock, NUM2INT(value))); return Qnil; } static VALUE raction_get_group(VALUE self) { /* Owned by GTK+ */ return GSLIST2ARY(gtk_radio_action_get_group(_SELF(self))); } struct rbgtk_rval2gtkradioactiongslist_args { VALUE ary; long n; GSList *result; }; static VALUE rbgtk_rval2gtkradioactiongslist_body(VALUE value) { long i; struct rbgtk_rval2gtkradioactiongslist_args *args = (struct rbgtk_rval2gtkradioactiongslist_args *)value; for (i = 0; i < args->n; i++) args->result = g_slist_append(args->result, GTK_RADIO_ACTION(RVAL2GOBJ(RARRAY_PTR(args->ary)[i]))); return Qnil; } static G_GNUC_NORETURN VALUE rbgtk_rval2gtkradioactiongslist_rescue(VALUE value) { g_slist_free(((struct rbgtk_rval2gtkradioactiongslist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GSList * rbgtk_rval2gtkradioactiongslist(VALUE value) { struct rbgtk_rval2gtkradioactiongslist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgtk_rval2gtkradioactiongslist_body, (VALUE)&args, rbgtk_rval2gtkradioactiongslist_rescue, (VALUE)&args); return args.result; } #define RVAL2GTKRADIOACTIONGSLIST(value) rbgtk_rval2gtkradioactiongslist(value) static VALUE raction_set_group(VALUE self, VALUE rbgroup) { GtkRadioAction *action = _SELF(self); /* TODO: This might leak. Use gtk_radio_action_join_group() in 3.0. */ if (TYPE(rbgroup) == T_ARRAY) gtk_radio_action_set_group(action, RVAL2GTKRADIOACTIONGSLIST(rbgroup)); else if (NIL_P(rbgroup)) gtk_radio_action_set_group(action, NULL); else gtk_radio_action_set_group(action, gtk_radio_action_get_group(GTK_RADIO_ACTION(RVAL2GOBJ(rbgroup)))); return self; } void Init_gtk_radio_action(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RADIO_ACTION, "RadioAction", mGtk); RG_DEF_METHOD(initialize, 5); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "group", raction_get_group, 0); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "group", raction_set_group, 1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkprintunixdialog.c������������������������������������������0000644�0001750�0001750�00000005432�11701304107�021536� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #ifdef HAVE_GTK_UNIX_PRINT #include <gtk/gtkprintunixdialog.h> #define RG_TARGET_NAMESPACE cPrintUnixDialog #define _SELF(s) (GTK_PRINT_UNIX_DIALOG(RVAL2GOBJ(s))) #ifndef GTK_TYPE_PRINT_CAPABILITIES # define GTK_TYPE_PRINT_CAPABILITIES (gtk_print_capabilities_get_type()) #endif static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GtkWidget *dialog; VALUE title, parent; rb_scan_args(argc, argv, "02", &title, &parent); dialog = gtk_print_unix_dialog_new(NIL_P(title) ? NULL : RVAL2CSTR(title), RVAL2GOBJ(parent)); RBGTK_INITIALIZE(self, dialog); return Qnil; } static VALUE rg_add_custom_tab(VALUE self, VALUE child, VALUE tab_label) { gtk_print_unix_dialog_add_custom_tab(_SELF(self), RVAL2GOBJ(child), RVAL2GOBJ(tab_label)); return self; } static VALUE rg_set_manual_capability(VALUE self, VALUE rb_capabilities) { GtkPrintCapabilities capabilities; capabilities = RVAL2GFLAGS(rb_capabilities, GTK_TYPE_PRINT_CAPABILITIES); gtk_print_unix_dialog_set_manual_capabilities(_SELF(self), capabilities); return self; } #endif void Init_gtk_print_unix_dialog(VALUE mGtk) { #ifdef HAVE_GTK_UNIX_PRINT VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_UNIX_DIALOG, "PrintUnixDialog", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(add_custom_tab, 2); RG_DEF_METHOD(set_manual_capability, 1); RG_DEF_ALIAS("settings", "print_settings"); RG_DEF_ALIAS("set_settings", "set_print_settings"); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkPrintCapabilities */ G_DEF_CLASS(GTK_TYPE_PRINT_CAPABILITIES, "Capabilities", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PRINT_CAPABILITIES, "GTK_PRINT_"); #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkpapersize.c������������������������������������������������0000644�0001750�0001750�00000013346�12257552167�020345� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cPaperSize #define _SELF(s) (RVAL2BOXED(s, GTK_TYPE_PAPER_SIZE)) #define SIZE2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_PAPER_SIZE)) #define RVAL2UNIT(o) (RVAL2GENUM(o, GTK_TYPE_UNIT)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GtkPaperSize *size; if (argc <= 1) { VALUE name; rb_scan_args(argc, argv, "01", &name); size = gtk_paper_size_new(RVAL2CSTR_ACCEPT_NIL(name)); } else if (argc == 4) { size = gtk_paper_size_new_from_ppd(RVAL2CSTR(argv[0]), RVAL2CSTR(argv[1]), NUM2DBL(argv[2]), NUM2DBL(argv[3])); } else if (argc == 5) { size = gtk_paper_size_new_custom(RVAL2CSTR(argv[0]), RVAL2CSTR(argv[1]), NUM2DBL(argv[2]), NUM2DBL(argv[3]), RVAL2UNIT(argv[4])); } else { rb_raise(rb_eArgError, "wrong number of arguments (%d for 0, 1, 4 or 5)", argc); } G_INITIALIZE(self, size); return Qnil; } static VALUE rg_operator_equal(VALUE self, VALUE other) { return CBOOL2RVAL(RVAL2CBOOL(rb_equal(rb_obj_class(self), rb_obj_class(other))) && gtk_paper_size_is_equal(_SELF(self), _SELF(other))); } /* The width is always the shortest side, measure in mm */ static VALUE rg_name(VALUE self) { return CSTR2RVAL(gtk_paper_size_get_name(_SELF(self))); } static VALUE rg_display_name(VALUE self) { return CSTR2RVAL(gtk_paper_size_get_display_name(_SELF(self))); } static VALUE rg_ppd_name(VALUE self) { return CSTR2RVAL(gtk_paper_size_get_ppd_name(_SELF(self))); } static VALUE rg_get_width(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_width(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_get_height(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_height(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_custom_p(VALUE self) { return CBOOL2RVAL(gtk_paper_size_is_custom(_SELF(self))); } /* Only for custom sizes: */ static VALUE rg_set_size(VALUE self, VALUE width, VALUE height, VALUE unit) { gtk_paper_size_set_size(_SELF(self), NUM2DBL(width), NUM2DBL(height), RVAL2UNIT(unit)); return self; } static VALUE rg_get_default_top_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_default_top_margin(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_get_default_bottom_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_default_bottom_margin(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_get_default_left_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_default_left_margin(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_get_default_right_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_default_right_margin(_SELF(self), RVAL2UNIT(unit))); } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gtk_paper_size_get_default()); } void Init_gtk_paper_size(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PAPER_SIZE, "PaperSize", mGtk); RG_DEF_SMETHOD(default, 0); rb_define_const(RG_TARGET_NAMESPACE, "A3", CSTR2RVAL(GTK_PAPER_NAME_A3)); rb_define_const(RG_TARGET_NAMESPACE, "A4", CSTR2RVAL(GTK_PAPER_NAME_A4)); rb_define_const(RG_TARGET_NAMESPACE, "A5", CSTR2RVAL(GTK_PAPER_NAME_A5)); rb_define_const(RG_TARGET_NAMESPACE, "B5", CSTR2RVAL(GTK_PAPER_NAME_B5)); rb_define_const(RG_TARGET_NAMESPACE, "LETTER", CSTR2RVAL(GTK_PAPER_NAME_LETTER)); rb_define_const(RG_TARGET_NAMESPACE, "EXECUTIVE", CSTR2RVAL(GTK_PAPER_NAME_EXECUTIVE)); rb_define_const(RG_TARGET_NAMESPACE, "LEGAL", CSTR2RVAL(GTK_PAPER_NAME_LEGAL)); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD_OPERATOR("==", equal, 1); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(display_name, 0); RG_DEF_METHOD(ppd_name, 0); RG_DEF_METHOD(get_width, 1); RG_DEF_METHOD(get_height, 1); RG_DEF_METHOD_P(custom, 0); RG_DEF_METHOD(set_size, 3); RG_DEF_METHOD(get_default_top_margin, 1); RG_DEF_METHOD(get_default_bottom_margin, 1); RG_DEF_METHOD(get_default_left_margin, 1); RG_DEF_METHOD(get_default_right_margin, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkUnit */ G_DEF_CLASS(GTK_TYPE_UNIT, "Unit", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_UNIT, "GTK_"); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkaspectframe.c����������������������������������������������0000644�0001750�0001750�00000004070�11701304107�020605� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAspectFrame static VALUE rg_initialize(VALUE self, VALUE label, VALUE xalign, VALUE yalign, VALUE ratio, VALUE obey_child) { RBGTK_INITIALIZE(self, gtk_aspect_frame_new(NIL_P(label)?NULL:RVAL2CSTR(label), NUM2DBL(xalign), NUM2DBL(yalign), NUM2DBL(ratio), RVAL2CBOOL(obey_child))); return Qnil; } static VALUE rg_set(VALUE self, VALUE xalign, VALUE yalign, VALUE ratio, VALUE obey_child) { gtk_aspect_frame_set(GTK_ASPECT_FRAME(RVAL2GOBJ(self)), NUM2DBL(xalign), NUM2DBL(yalign), NUM2DBL(ratio), RVAL2CBOOL(obey_child)); return self; } void Init_gtk_aspect_frame(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ASPECT_FRAME, "AspectFrame", mGtk); RG_DEF_METHOD(initialize, 5); RG_DEF_METHOD(set, 4); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcellrenderer.c���������������������������������������������0000644�0001750�0001750�00000011100�12257552167�020773� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCellRenderer #define _SELF(s) (GTK_CELL_RENDERER(RVAL2GOBJ(s))) #define RVAL2RECT(r) ((GdkRectangle*)RVAL2BOXED(r, GDK_TYPE_RECTANGLE)) #define RECT2RVAL(r) (BOXED2RVAL(r, GDK_TYPE_RECTANGLE)) static VALUE rg_get_size(VALUE self, VALUE widget, VALUE cell_area) { GdkRectangle ret; gtk_cell_renderer_get_size(_SELF(self), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2RECT(cell_area), &ret.x, &ret.y, &ret.width, &ret.height); return RECT2RVAL(&ret); } static VALUE rg_render(VALUE self, VALUE window, VALUE widget, VALUE background_area, VALUE cell_area, VALUE expose_area, VALUE flags) { gtk_cell_renderer_render(_SELF(self), GDK_WINDOW(RVAL2GOBJ(window)), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2RECT(background_area), RVAL2RECT(cell_area), RVAL2RECT(expose_area), RVAL2GFLAGS(flags, GTK_TYPE_CELL_RENDERER_STATE)); return self; } static VALUE rg_activate(VALUE self, VALUE event, VALUE widget, VALUE path, VALUE background_area, VALUE cell_area, VALUE flags) { gboolean ret = gtk_cell_renderer_activate(_SELF(self), (GdkEvent*)RVAL2GEV(event), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(path), RVAL2RECT(background_area), RVAL2RECT(cell_area), RVAL2GFLAGS(flags, GTK_TYPE_CELL_RENDERER_STATE)); return CBOOL2RVAL(ret); } static VALUE rg_start_editing(VALUE self, VALUE event, VALUE widget, VALUE path, VALUE background_area, VALUE cell_area, VALUE flags) { GtkCellEditable* edit = gtk_cell_renderer_start_editing(_SELF(self), (GdkEvent*)RVAL2GEV(event), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(path), RVAL2RECT(background_area), RVAL2RECT(cell_area), RVAL2GFLAGS(flags, GTK_TYPE_CELL_RENDERER_STATE)); return edit ? GOBJ2RVAL(edit) : Qnil; } #ifndef GTK_DISABLE_DEPRECATED static VALUE rg_editing_canceled(VALUE self) { gtk_cell_renderer_editing_canceled(_SELF(self)); return self; } #endif static VALUE rg_stop_editing(VALUE self, VALUE canceled) { gtk_cell_renderer_stop_editing(_SELF(self), RVAL2CBOOL(canceled)); return self; } static VALUE rg_fixed_size(VALUE self) { int width, height; gtk_cell_renderer_get_fixed_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_set_fixed_size(VALUE self, VALUE width, VALUE height) { gtk_cell_renderer_set_fixed_size(_SELF(self), NUM2INT(width), NUM2INT(height)); return self; } void Init_gtk_cellrenderer(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER, "CellRenderer", mGtk); RG_DEF_METHOD(get_size, 2); RG_DEF_METHOD(render, 6); RG_DEF_METHOD(activate, 6); RG_DEF_METHOD(start_editing, 6); #ifndef GTK_DISABLE_DEPRECATED RG_DEF_METHOD(editing_canceled, 0); #endif RG_DEF_METHOD(stop_editing, 1); RG_DEF_METHOD(fixed_size, 0); RG_DEF_METHOD(set_fixed_size, 2); /* GtkCellRendererState */ G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_STATE, "State", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_CELL_RENDERER_STATE, "GTK_CELL_RENDERER_"); /* GtkCellRendererMode */ G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_MODE, "Mode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_CELL_RENDERER_MODE, "GTK_CELL_RENDERER_"); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkbuilder.c��������������������������������������������������0000644�0001750�0001750�00000011125�11701304107�017740� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #include <glib-enum-types.h> /* From Ruby/GLib2 */ #if GTK_CHECK_VERSION(2, 12, 0) #define RG_TARGET_NAMESPACE cBuilder #define _SELF(self) (GTK_BUILDER(RVAL2GOBJ(self))) static ID id___connect_signals__; static void builder_mark(gpointer object) { GtkBuilder *builder = object; GSList *objects; objects = gtk_builder_get_objects(builder); g_slist_foreach(objects, (GFunc)rbgobj_gc_mark_instance, NULL); g_slist_free(objects); } static VALUE rg_initialize(VALUE self) { GtkBuilder *builder; builder = gtk_builder_new(); G_INITIALIZE(self, builder); return Qnil; } static VALUE rg_add_from_file(VALUE self, VALUE filename) { GError *error = NULL; if (gtk_builder_add_from_file(_SELF(self), RVAL2CSTR(filename), &error) == 0) RAISE_GERROR(error); return self; } static VALUE rg_add_from_string(VALUE self, VALUE string) { GError *error = NULL; StringValue(string); if (gtk_builder_add_from_string(_SELF(self), RSTRING_PTR(string), RSTRING_LEN(string), &error) == 0) RAISE_GERROR(error); return self; } static VALUE rg_add(VALUE self, VALUE filename_or_xml) { const char xml_detect_re_str[] = "(?:\\A<|[\\r\\n])"; VALUE xml_detect_re; xml_detect_re = rb_reg_new(xml_detect_re_str, strlen(xml_detect_re_str), 0); if (NIL_P(rb_reg_match(xml_detect_re, filename_or_xml))) return rg_add_from_file(self, filename_or_xml); else return rg_add_from_string(self, filename_or_xml); } static VALUE rg_get_object(VALUE self, VALUE name) { return GOBJ2RVAL(gtk_builder_get_object(_SELF(self), RVAL2CSTR(name))); } static VALUE rg_objects(VALUE self) { return GSLIST2ARY_FREE(gtk_builder_get_objects(_SELF(self))); } static void connect_signals(GtkBuilder *builder, GObject *object, const gchar *signal_name, const gchar *handler_name, GObject *connect_object, GConnectFlags flags, gpointer user_data) { VALUE signal_connector = (VALUE)user_data; rb_funcall(GOBJ2RVAL(builder), id___connect_signals__, 6, signal_connector, GOBJ2RVAL(object), CSTR2RVAL(signal_name), CSTR2RVAL(handler_name), GOBJ2RVAL(connect_object), GFLAGS2RVAL(flags, G_TYPE_CONNECT_FLAGS)); } static VALUE rg_connect_signals(VALUE self) { VALUE signal_connector; signal_connector = rb_block_proc(); G_CHILD_ADD(self, signal_connector); gtk_builder_connect_signals_full(_SELF(self), connect_signals, (gpointer)signal_connector); G_CHILD_REMOVE(self, signal_connector); return self; } static VALUE rg_get_type(VALUE self, VALUE name) { return GTYPE2CLASS(gtk_builder_get_type_from_name(_SELF(self), RVAL2CSTR(name))); } #endif void Init_gtk_builder(VALUE mGtk) { #if GTK_CHECK_VERSION(2, 12, 0) VALUE RG_TARGET_NAMESPACE; id___connect_signals__ = rb_intern("__connect_signals__"); RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_GC_FUNC(GTK_TYPE_BUILDER, "Builder", mGtk, builder_mark, NULL); G_DEF_CLASS(GTK_TYPE_BUILDER_ERROR, "BuilderError", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add_from_file, 1); RG_DEF_METHOD(add_from_string, 1); RG_DEF_METHOD(add, 1); RG_DEF_ALIAS("<<", "add"); RG_DEF_METHOD(get_object, 1); RG_DEF_ALIAS("[]", "get_object"); RG_DEF_METHOD(objects, 0); RG_DEF_METHOD(connect_signals, 0); RG_DEF_METHOD(get_type, 1); #endif } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkrgb.c������������������������������������������������������0000644�0001750�0001750�00000014570�11701304107�017053� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mRGB #define RVAL2DRAW(s) GDK_DRAWABLE(RVAL2GOBJ(s)) static VALUE rg_m_draw_rgb_image(int argc, VALUE *argv, VALUE self) { VALUE win, gc, x, y, w, h, dither, buf, rowstride, xdith, ydith; rb_scan_args(argc, argv, "92", &win, &gc, &x, &y, &w, &h, &dither, &buf, &rowstride, &xdith, &ydith); if (argc == 9){ gdk_draw_rgb_image(RVAL2DRAW(win), GDK_GC(RVAL2GOBJ(gc)), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), RVAL2GENUM(dither, GDK_TYPE_RGB_DITHER), (guchar*)RVAL2CSTR(buf), NUM2INT(rowstride)); } else { gdk_draw_rgb_image_dithalign(RVAL2DRAW(win), GDK_GC(RVAL2GOBJ(gc)), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), RVAL2GENUM(dither, GDK_TYPE_RGB_DITHER), (guchar*)RVAL2CSTR(buf), NUM2INT(rowstride), NUM2INT(xdith), NUM2INT(ydith)); } return self; } static VALUE rg_m_draw_indexed_image(VALUE self, VALUE win, VALUE rbgc, VALUE rbx, VALUE rby, VALUE rbwidth, VALUE rbheight, VALUE rbdither, VALUE rbbuf, VALUE rbrowstride, VALUE rbcolors) { GdkDrawable *drawable = RVAL2DRAW(win); GdkGC *gc = GDK_GC(RVAL2GOBJ(rbgc)); gint x = NUM2INT(rbx); gint y = NUM2INT(rby); gint width = NUM2INT(rbwidth); gint height = NUM2INT(rbheight); GdkRgbDither dither = RVAL2GENUM(rbdither, GDK_TYPE_RGB_DITHER); const guchar *buf = (const guchar *)RVAL2CSTR(rbbuf); gint rowstride = NUM2INT(rbrowstride); long n; guint32 *colors = RVAL2GUINT32S(rbcolors, n); GdkRgbCmap *cmap; if (n < 0 || n > 255) { g_free(colors); rb_raise(rb_eArgError, "colors: out of range (0 - 255)"); } cmap = gdk_rgb_cmap_new(colors, n); g_free(colors); gdk_draw_indexed_image(drawable, gc, x, y, width, height, dither, buf, rowstride, cmap); gdk_rgb_cmap_free(cmap); return self; } static VALUE rg_m_draw_gray_image(VALUE self, VALUE win, VALUE gc, VALUE x, VALUE y, VALUE w, VALUE h, VALUE dither, VALUE buf, VALUE rowstride) { gdk_draw_gray_image(RVAL2DRAW(win), GDK_GC(RVAL2GOBJ(gc)), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), RVAL2GENUM(dither, GDK_TYPE_RGB_DITHER), (guchar*)RVAL2CSTR(buf), NUM2INT(rowstride)); return self; } static VALUE rg_m_draw_rgb_32_image(int argc, VALUE *argv, VALUE self) { VALUE win, gc, x, y, w, h, dither, buf, rowstride, xdith, ydith; rb_scan_args(argc, argv, "92", &win, &gc, &x, &y, &w, &h, &dither, &buf, &rowstride, &xdith, &ydith); if (argc == 9){ gdk_draw_rgb_32_image(RVAL2DRAW(win), GDK_GC(RVAL2GOBJ(gc)), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), RVAL2GENUM(dither, GDK_TYPE_RGB_DITHER), (guchar*)RVAL2CSTR(buf), NUM2INT(rowstride)); } else { gdk_draw_rgb_32_image_dithalign(RVAL2DRAW(win), GDK_GC(RVAL2GOBJ(gc)), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), RVAL2GENUM(dither, GDK_TYPE_RGB_DITHER), (guchar*)RVAL2CSTR(buf), NUM2INT(rowstride), NUM2INT(xdith), NUM2INT(ydith)); } return self; } static VALUE rg_m_find_color(VALUE self, VALUE colormap, VALUE color) { gdk_rgb_find_color(GDK_COLORMAP(RVAL2GOBJ(colormap)), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_m_set_install(VALUE self, VALUE install) { gdk_rgb_set_install(RVAL2CBOOL(install)); return self; } static VALUE rg_m_set_min_colors(VALUE self, VALUE min_colors) { gdk_rgb_set_min_colors(NUM2INT(min_colors)); return self; } static VALUE rg_m_visual(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_rgb_get_visual()); } static VALUE rg_m_colormap(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_rgb_get_colormap()); } static VALUE rg_m_ditherable_p(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gdk_rgb_ditherable()); } static VALUE rg_m_set_verbose(VALUE self, VALUE verbose) { gdk_rgb_set_verbose(RVAL2CBOOL(verbose)); return self; } void Init_gtk_gdk_rgb(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "RGB"); RG_DEF_MODFUNC(draw_rgb_image, -1); RG_DEF_MODFUNC(draw_indexed_image, 10); RG_DEF_MODFUNC(draw_gray_image, 9); RG_DEF_MODFUNC(draw_rgb_32_image, -1); RG_DEF_MODFUNC(find_color, 2); RG_DEF_MODFUNC(set_install, 1); RG_DEF_MODFUNC(set_min_colors, 0); RG_DEF_MODFUNC(visual, 0); RG_DEF_MODFUNC(colormap, 0); RG_DEF_MODFUNC_P(ditherable, 0); RG_DEF_MODFUNC(set_verbose, 1); /* GdkRgbDither */ G_DEF_CLASS(GDK_TYPE_RGB_DITHER, "Dither", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_RGB_DITHER, "GDK_RGB_"); } ����������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkentrycompletion.c������������������������������������������0000644�0001750�0001750�00000007042�12257552167�021572� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cEntryCompletion #define _SELF(self) (GTK_ENTRY_COMPLETION(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_entry_completion_new()); return Qnil; } static VALUE rg_entry(VALUE self) { return GOBJ2RVAL(gtk_entry_completion_get_entry(_SELF(self))); } static gboolean entryc_match_func(GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer func) { iter->user_data3 = gtk_entry_completion_get_model(completion); return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 3, GOBJ2RVAL(completion), CSTR2RVAL(key), GTKTREEITER2RVAL(iter))); } static VALUE rg_set_match_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_entry_completion_set_match_func(_SELF(self), (GtkEntryCompletionMatchFunc)entryc_match_func, (gpointer)func, NULL); return self; } static VALUE rg_complete(VALUE self) { gtk_entry_completion_complete(_SELF(self)); return self; } static VALUE rg_insert_prefix(VALUE self) { gtk_entry_completion_insert_prefix(_SELF(self)); return self; } static VALUE rg_insert_action_text(VALUE self, VALUE index, VALUE text) { gtk_entry_completion_insert_action_text(_SELF(self), NUM2INT(index), RVAL2CSTR(text)); return self; } static VALUE rg_insert_action_markup(VALUE self, VALUE index, VALUE markup) { gtk_entry_completion_insert_action_markup(_SELF(self), NUM2INT(index), RVAL2CSTR(markup)); return self; } static VALUE rg_delete_action(VALUE self, VALUE index) { gtk_entry_completion_delete_action(_SELF(self), NUM2INT(index)); return self; } static VALUE entryc_set_text_column(VALUE self, VALUE column) { gtk_entry_completion_set_text_column(_SELF(self), NUM2INT(column)); return self; } #if GTK_CHECK_VERSION(2, 12, 0) static VALUE rg_completion_prefix(VALUE self) { return CSTR2RVAL(gtk_entry_completion_get_completion_prefix(_SELF(self))); } #endif void Init_gtk_entry_completion(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ENTRY_COMPLETION, "EntryCompletion", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(entry, 0); RG_DEF_METHOD(set_match_func, 0); RG_DEF_METHOD(complete, 0); RG_DEF_METHOD(insert_prefix, 0); RG_DEF_METHOD(insert_action_text, 2); RG_DEF_METHOD(insert_action_markup, 2); RG_DEF_METHOD(delete_action, 1); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "text_column", entryc_set_text_column, 1); #if GTK_CHECK_VERSION(2, 12, 0) RG_DEF_METHOD(completion_prefix, 0); #endif } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkdraw.c�����������������������������������������������������0000644�0001750�0001750�00000034543�12257552167�017262� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #include "rbpango.h" #ifdef GDK_WINDOWING_X11 #include <gdk/gdkx.h> #endif #ifdef HAVE_RB_CAIRO_H #include <rb_cairo.h> #endif #define RG_TARGET_NAMESPACE cDrawable #define _SELF(s) GDK_DRAWABLE(RVAL2GOBJ(s)) static VALUE rg_visual(VALUE self) { return GOBJ2RVAL(_SELF(self)); } static VALUE rg_set_colormap(VALUE self, VALUE colormap) { VALUE old_colormap; old_colormap = GOBJ2RVAL(gdk_drawable_get_colormap(_SELF(self))); G_CHILD_REMOVE(self, old_colormap); G_CHILD_ADD(self, colormap); gdk_drawable_set_colormap(_SELF(self), GDK_COLORMAP(RVAL2GOBJ(colormap))); return self; } static VALUE rg_colormap(VALUE self) { VALUE rb_colormap; rb_colormap = GOBJ2RVAL(gdk_drawable_get_colormap(_SELF(self))); G_CHILD_ADD(self, rb_colormap); return rb_colormap; } static VALUE rg_depth(VALUE self) { return INT2NUM(gdk_drawable_get_depth(_SELF(self))); } static VALUE rg_size(VALUE self) { gint width, height; gdk_drawable_get_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_clip_region(VALUE self) { return BOXED2RVAL(gdk_drawable_get_clip_region(_SELF(self)), GDK_TYPE_REGION); } static VALUE rg_visible_region(VALUE self) { return BOXED2RVAL(gdk_drawable_get_visible_region(_SELF(self)), GDK_TYPE_REGION); } static VALUE rg_draw_point(VALUE self, VALUE gc, VALUE x, VALUE y) { gdk_draw_point(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_draw_points(VALUE self, VALUE rbgc, VALUE rbpoints) { GdkDrawable *drawable = _SELF(self); GdkGC *gc = GDK_GC(RVAL2GOBJ(rbgc)); long n; GdkPoint *points = RVAL2GDKPOINTS(rbpoints, &n); gdk_draw_points(drawable, gc, points, n); g_free(points); return self; } static VALUE rg_draw_line(VALUE self, VALUE gc, VALUE x1, VALUE y1, VALUE x2, VALUE y2) { gdk_draw_line(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), NUM2INT(x1), NUM2INT(y1), NUM2INT(x2), NUM2INT(y2)); return self; } static VALUE rg_draw_lines(VALUE self, VALUE rbgc, VALUE rbpoints) { GdkDrawable *drawable = _SELF(self); GdkGC *gc = GDK_GC(RVAL2GOBJ(rbgc)); long n; GdkPoint *points = RVAL2GDKPOINTS(rbpoints, &n); gdk_draw_lines(drawable, gc, points, n); g_free(points); return self; } static VALUE rg_draw_pixbuf(VALUE self, VALUE gc, VALUE pixbuf, VALUE src_x, VALUE src_y, VALUE dest_x, VALUE dest_y, VALUE width, VALUE height, VALUE dither, VALUE x_dither, VALUE y_dither) { gdk_draw_pixbuf(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), GDK_PIXBUF(RVAL2GOBJ(pixbuf)), NUM2INT(src_x), NUM2INT(src_y), NUM2INT(dest_x), NUM2INT(dest_y), NUM2INT(width), NUM2INT(height), RVAL2GENUM(dither, GDK_TYPE_RGB_DITHER), NUM2INT(x_dither), NUM2INT(y_dither)); return self; } struct rbgdk_rval2gdksegments_args { VALUE ary; long n; GdkSegment *result; }; static VALUE rbgdk_rval2gdksegments_body(VALUE value) { long i; struct rbgdk_rval2gdksegments_args *args = (struct rbgdk_rval2gdksegments_args *)value; for (i = 0; i < args->n; i++) { VALUE segments = rb_ary_to_ary(RARRAY_PTR(args->ary)[i]); if (RARRAY_LEN(segments) != 2) rb_raise(rb_eArgError, "segment %ld should be array of size 4", i); args->result[i].x1 = NUM2INT(RARRAY_PTR(segments)[0]); args->result[i].y1 = NUM2INT(RARRAY_PTR(segments)[1]); args->result[i].x2 = NUM2INT(RARRAY_PTR(segments)[2]); args->result[i].y2 = NUM2INT(RARRAY_PTR(segments)[3]); } return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdksegments_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdksegments_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GdkSegment * rbgdk_rval2gdksegments(VALUE value, long *n) { struct rbgdk_rval2gdksegments_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GdkSegment, args.n + 1); rb_rescue(rbgdk_rval2gdksegments_body, (VALUE)&args, rbgdk_rval2gdksegments_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } #define RVAL2GDKSEGMENTS(value, n) rbgdk_rval2gdksegments(value, n) static VALUE rg_draw_segments(VALUE self, VALUE rbgc, VALUE rbsegments) { GdkDrawable *drawable = _SELF(self); GdkGC *gc = GDK_GC(RVAL2GOBJ(rbgc)); long n; GdkSegment *segments = RVAL2GDKSEGMENTS(rbsegments, &n); gdk_draw_segments(drawable, gc, segments, n); g_free(segments); return self; } static VALUE rg_draw_rectangle(VALUE self, VALUE gc, VALUE filled, VALUE x, VALUE y, VALUE w, VALUE h) { gdk_draw_rectangle(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), RVAL2CBOOL(filled), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h)); return self; } static VALUE rg_draw_arc(VALUE self, VALUE gc, VALUE filled, VALUE x, VALUE y, VALUE w, VALUE h, VALUE a1, VALUE a2) { gdk_draw_arc(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), RVAL2CBOOL(filled), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), NUM2INT(a1), NUM2INT(a2)); return self; } static VALUE rg_draw_polygon(VALUE self, VALUE rbgc, VALUE rbfilled, VALUE rbpoints) { GdkDrawable *drawable = _SELF(self); GdkGC *gc = GDK_GC(RVAL2GOBJ(rbgc)); gboolean filled = RVAL2CBOOL(rbfilled); long n; GdkPoint *points = RVAL2GDKPOINTS(rbpoints, &n); gdk_draw_polygon(drawable, gc, filled, points, n); g_free(points); return self; } /* trapezoids = [[y1, x11, x21, y2, x12, x22], ...] */ struct rbgdk_rval2gdktrapezoids_args { VALUE ary; long n; GdkTrapezoid *result; }; static VALUE rbgdk_rval2gdktrapezoids_body(VALUE value) { long i; struct rbgdk_rval2gdktrapezoids_args *args = (struct rbgdk_rval2gdktrapezoids_args *)value; for (i = 0; i < args->n; i++) { VALUE trapezoids = rb_ary_to_ary(RARRAY_PTR(args->ary)[i]); if (RARRAY_LEN(trapezoids) != 6) rb_raise(rb_eArgError, "trapezoid %ld should be array of size 6", i); args->result[i].y1 = NUM2DBL(RARRAY_PTR(trapezoids)[0]); args->result[i].x11 = NUM2DBL(RARRAY_PTR(trapezoids)[1]); args->result[i].x21 = NUM2DBL(RARRAY_PTR(trapezoids)[2]); args->result[i].y2 = NUM2DBL(RARRAY_PTR(trapezoids)[3]); args->result[i].x12 = NUM2DBL(RARRAY_PTR(trapezoids)[4]); args->result[i].x22 = NUM2DBL(RARRAY_PTR(trapezoids)[5]); } return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdktrapezoids_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdktrapezoids_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GdkTrapezoid * rbgdk_rval2gdktrapezoids(VALUE value, long *n) { struct rbgdk_rval2gdktrapezoids_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GdkTrapezoid, args.n + 1); rb_rescue(rbgdk_rval2gdktrapezoids_body, (VALUE)&args, rbgdk_rval2gdktrapezoids_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } #define RVAL2GDKTRAPEZOIDS(value, n) rbgdk_rval2gdktrapezoids(value, n) static VALUE rg_draw_trapezoids(VALUE self, VALUE rbgc, VALUE rbtrapezoids) { GdkDrawable *drawable = _SELF(self); GdkGC *gc = GDK_GC(RVAL2GOBJ(rbgc)); long n; GdkTrapezoid *trapezoids = RVAL2GDKTRAPEZOIDS(rbtrapezoids, &n); gdk_draw_trapezoids(drawable, gc, trapezoids, n); g_free(trapezoids); return self; } static VALUE rg_draw_glyphs(VALUE self, VALUE gc, VALUE font, VALUE x, VALUE y, VALUE glyphs) { gdk_draw_glyphs(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), PANGO_FONT(RVAL2GOBJ(font)), NUM2INT(x), NUM2INT(y), (PangoGlyphString*)(RVAL2BOXED(glyphs, PANGO_TYPE_GLYPH_STRING))); return self; } static VALUE rg_draw_glyphs_transformed(VALUE self, VALUE gc, VALUE matrix, VALUE font, VALUE x, VALUE y, VALUE glyphs) { gdk_draw_glyphs_transformed(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), NIL_P(matrix) ? (PangoMatrix*)NULL : (PangoMatrix*)(RVAL2BOXED(matrix, PANGO_TYPE_MATRIX)), PANGO_FONT(RVAL2GOBJ(font)), NUM2INT(x), NUM2INT(y), (PangoGlyphString*)(RVAL2BOXED(glyphs, PANGO_TYPE_GLYPH_STRING))); return self; } static VALUE rg_draw_layout_line(int argc, VALUE *argv, VALUE self) { VALUE gc, x, y, line, fg, bg; rb_scan_args(argc, argv, "42", &gc, &x, &y, &line, &fg, &bg); gdk_draw_layout_line_with_colors(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), NUM2INT(x), NUM2INT(y), (PangoLayoutLine*)RVAL2BOXED(line, PANGO_TYPE_LAYOUT_LINE), RVAL2GDKCOLOR(fg), RVAL2GDKCOLOR(bg)); return self; } static VALUE rg_draw_layout(int argc, VALUE *argv, VALUE self) { VALUE gc, x, y, layout, fg, bg; rb_scan_args(argc, argv, "42", &gc, &x, &y, &layout, &fg, &bg); gdk_draw_layout_with_colors(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), NUM2INT(x), NUM2INT(y), PANGO_LAYOUT(RVAL2GOBJ(layout)), RVAL2GDKCOLOR(fg), RVAL2GDKCOLOR(bg)); return self; } static VALUE rg_draw_drawable(VALUE self, VALUE gc, VALUE src, VALUE xsrc, VALUE ysrc, VALUE xdst, VALUE ydst, VALUE w, VALUE h) { gdk_draw_drawable(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), _SELF(src), NUM2INT(xsrc), NUM2INT(ysrc), NUM2INT(xdst), NUM2INT(ydst), NUM2INT(w), NUM2INT(h)); return self; } static VALUE rg_draw_image(VALUE self, VALUE gc, VALUE image, VALUE xsrc, VALUE ysrc, VALUE xdst, VALUE ydst, VALUE w, VALUE h) { gdk_draw_image(_SELF(self), GDK_GC(RVAL2GOBJ(gc)), GDK_IMAGE(RVAL2GOBJ(image)), NUM2INT(xsrc), NUM2INT(ysrc), NUM2INT(xdst), NUM2INT(ydst), NUM2INT(w), NUM2INT(h)); return self; } static VALUE rg_get_image(VALUE self, VALUE x, VALUE y, VALUE w, VALUE h) { return GOBJ2RVAL(gdk_drawable_get_image(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h))); } static VALUE rg_copy_to_image(VALUE self, VALUE image, VALUE xsrc, VALUE ysrc, VALUE xdst, VALUE ydst, VALUE w, VALUE h) { return GOBJ2RVAL(gdk_drawable_copy_to_image(_SELF(self), GDK_IMAGE(RVAL2GOBJ(image)), NUM2INT(xsrc), NUM2INT(ysrc), NUM2INT(xdst), NUM2INT(ydst), NUM2INT(w), NUM2INT(h))); } #ifdef GDK_WINDOWING_X11 static VALUE rg_xid(VALUE self) { return ULONG2NUM(GDK_DRAWABLE_XID(_SELF(self))); } #endif #ifdef GDK_WINDOWING_WIN32 static VALUE rg_handle(VALUE self) { HGDIOBJ handle; handle = gdk_win32_drawable_get_handle(_SELF(self)); return ULONG2NUM(GPOINTER_TO_UINT(handle)); } #endif static VALUE rg_display(VALUE self) { return GOBJ2RVAL(gdk_drawable_get_display(_SELF(self))); } static VALUE rg_screen(VALUE self) { return GOBJ2RVAL(gdk_drawable_get_screen(_SELF(self))); } #ifdef HAVE_RB_CAIRO_H static VALUE rg_create_cairo_context(VALUE self) { VALUE rb_cr; cairo_t *cr; cr = gdk_cairo_create(_SELF(self)); rb_cairo_check_status(cairo_status(cr)); rb_cr = CRCONTEXT2RVAL(cr); cairo_destroy (cr); return rb_cr; } #endif void Init_gtk_gdk_draw(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DRAWABLE, "Drawable", mGdk); RG_DEF_METHOD(visual, 0); RG_DEF_METHOD(set_colormap, 1); RG_DEF_METHOD(colormap, 0); RG_DEF_METHOD(depth, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(clip_region, 0); RG_DEF_METHOD(visible_region, 0); RG_DEF_METHOD(draw_point, 3); RG_DEF_METHOD(draw_points, 2); RG_DEF_METHOD(draw_line, 5); RG_DEF_METHOD(draw_lines, 2); RG_DEF_METHOD(draw_pixbuf, 11); RG_DEF_METHOD(draw_segments, 2); RG_DEF_METHOD(draw_rectangle, 6); RG_DEF_METHOD(draw_arc, 8); RG_DEF_METHOD(draw_polygon, 3); RG_DEF_METHOD(draw_trapezoids, 2); RG_DEF_METHOD(draw_glyphs, 5); RG_DEF_METHOD(draw_glyphs_transformed, 6); RG_DEF_METHOD(draw_layout_line, -1); RG_DEF_METHOD(draw_layout, -1); RG_DEF_METHOD(draw_drawable, 8); RG_DEF_METHOD(draw_image, 8); RG_DEF_METHOD(get_image, 4); RG_DEF_METHOD(copy_to_image, 7); #ifdef GDK_WINDOWING_X11 RG_DEF_METHOD(xid, 0); #endif #ifdef GDK_WINDOWING_WIN32 RG_DEF_METHOD(handle, 0); #endif RG_DEF_METHOD(display, 0); RG_DEF_METHOD(screen, 0); #ifdef HAVE_RB_CAIRO_H RG_DEF_METHOD(create_cairo_context, 0); #endif #ifdef GDK_WINDOWING_X11 G_DEF_CLASS3("GdkDrawableImplX11", "DrawableImplX11", mGdk); #elif defined(GDK_WINDOWING_WIN32) G_DEF_CLASS3("GdkDrawableImplWin32", "DrawableImplWin32", mGdk); #elif defined(GDK_WINDOWING_FB) G_DEF_CLASS3("GdkDrawableFB", "DrawableFB", mGdk); #endif G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkaccessible.c�����������������������������������������������0000644�0001750�0001750�00000002425�11701304107�020412� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAccessible static VALUE rg_connect_widget_destroyed(VALUE self) { gtk_accessible_connect_widget_destroyed(GTK_ACCESSIBLE(RVAL2GOBJ(self))); return self; } void Init_gtk_accessible(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCESSIBLE, "Accessible", mGtk); RG_DEF_METHOD(connect_widget_destroyed, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkmacros.h���������������������������������������������������0000644�0001750�0001750�00000002625�11701304107�017610� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RB_GTK_MACROS_H__ #define __RB_GTK_MACROS_H__ #define RBGTK_MAJOR_VERSION RBGLIB_MAJOR_VERSION #define RBGTK_MINOR_VERSION RBGLIB_MINOR_VERSION #define RBGTK_MICRO_VERSION RBGLIB_MICRO_VERSION #if defined(G_PLATFORM_WIN32) && !defined(RUBY_GTK2_STATIC_COMPILATION) # ifdef RUBY_GTK2_COMPILATION # define RUBY_GTK2_VAR __declspec(dllexport) # else # define RUBY_GTK2_VAR extern __declspec(dllimport) # endif #else # define RUBY_GTK2_VAR extern #endif #endif /* __RB_GTK_MACROS_H__ */ �����������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktextmark.c�������������������������������������������������0000644�0001750�0001750�00000004212�11701304107�020150� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTextMark #define _SELF(s) (GTK_TEXT_MARK(RVAL2GOBJ(s))) #if GTK_CHECK_VERSION(2,12,0) static VALUE rg_initialize(VALUE self, VALUE name, VALUE left_gravity) { if (NIL_P(name)) G_INITIALIZE(self, gtk_text_mark_new(NULL, RVAL2CBOOL(left_gravity))); else G_INITIALIZE(self, gtk_text_mark_new(RVAL2CSTR(name), RVAL2CBOOL(left_gravity))); return Qnil; } #endif static VALUE rg_set_visible(VALUE self, VALUE setting) { gtk_text_mark_set_visible(_SELF(self), RVAL2CBOOL(setting)); return setting; } static VALUE rg_visible_p(VALUE self) { return CBOOL2RVAL(gtk_text_mark_get_visible(_SELF(self))); } static VALUE rg_deleted_p(VALUE self) { return CBOOL2RVAL(gtk_text_mark_get_deleted(_SELF(self))); } static VALUE rg_buffer(VALUE self) { return GOBJ2RVAL(gtk_text_mark_get_buffer(_SELF(self))); } 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); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkseparator.c������������������������������������������������0000644�0001750�0001750�00000002235�11701304107�020314� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" void Init_gtk_separator(VALUE mGtk) { G_DEF_CLASS(GTK_TYPE_SEPARATOR, "Separator", mGtk); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkprintoperation.c�������������������������������������������0000644�0001750�0001750�00000011403�12257552167�021410� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cPrintOperation #define _SELF(s) (GTK_PRINT_OPERATION(RVAL2GOBJ(s))) static VALUE RG_TARGET_NAMESPACE; static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_print_operation_new()); return Qnil; } static VALUE rg_run(int argc, VALUE *argv, VALUE self) { VALUE action, parent, rb_result; GtkPrintOperationResult result; GError *error = NULL; rb_scan_args(argc, argv, "11", &action, &parent); result = gtk_print_operation_run(_SELF(self), RVAL2GENUM(action, GTK_TYPE_PRINT_OPERATION_ACTION), RVAL2GOBJ(parent), &error); rb_result = GENUM2RVAL(result, GTK_TYPE_PRINT_OPERATION_RESULT); if (rb_block_given_p()) { return rb_yield(rb_result); } else { if (result == GTK_PRINT_OPERATION_RESULT_ERROR) RAISE_GERROR(error); return rb_result; } } static VALUE rg_error(VALUE self) { GError *error = NULL; gtk_print_operation_get_error(_SELF(self), &error); return error ? rbgerr_gerror2exception(error) : Qnil; } static VALUE rg_finished_p(VALUE self) { return CBOOL2RVAL(gtk_print_operation_is_finished(_SELF(self))); } static VALUE rg_cancel(VALUE self) { gtk_print_operation_cancel(_SELF(self)); return self; } struct callback_arg { VALUE callback; VALUE page_setup; }; static VALUE invoke_callback(VALUE arg_) { struct callback_arg *arg = (struct callback_arg *)arg_; return rb_funcall(arg->callback, id_call, 1, arg->page_setup); } static void page_setup_done_cb(GtkPageSetup *page_setup, gpointer data) { VALUE callback = (VALUE)data; struct callback_arg arg; G_CHILD_UNSET(RG_TARGET_NAMESPACE, rb_intern("setup_done_cb")); arg.callback = callback; arg.page_setup = GOBJ2RVAL(page_setup); G_PROTECT_CALLBACK(invoke_callback, &arg); } static VALUE rg_s_run_page_setup_dialog(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE parent, page_setup, settings; rb_scan_args(argc, argv, "03", &parent, &page_setup, &settings); if (rb_block_given_p()) { volatile VALUE func = rb_block_proc(); G_CHILD_SET(RG_TARGET_NAMESPACE, rb_intern("setup_done_cb"), func); gtk_print_run_page_setup_dialog_async(RVAL2GOBJ(parent), RVAL2GOBJ(page_setup), RVAL2GOBJ(settings), page_setup_done_cb, (gpointer)func); return Qnil; } else { return GOBJ2RVALU(gtk_print_run_page_setup_dialog(RVAL2GOBJ(parent), RVAL2GOBJ(page_setup), RVAL2GOBJ(settings))); } } void Init_gtk_print_operation(VALUE mGtk) { RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_OPERATION, "PrintOperation", mGtk); G_DEF_ERROR(GTK_PRINT_ERROR, "PrintError", mGtk, rb_eRuntimeError, GTK_TYPE_PRINT_ERROR); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(run, -1); RG_DEF_METHOD(error, 0); RG_DEF_METHOD_P(finished, 0); RG_DEF_METHOD(cancel, 0); RG_DEF_SMETHOD(run_page_setup_dialog, -1); /* GtkPrintStatus */ G_DEF_CLASS(GTK_TYPE_PRINT_STATUS, "Status", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PRINT_STATUS, "GTK_PRINT_"); /* GtkPrintOperationAction */ G_DEF_CLASS(GTK_TYPE_PRINT_OPERATION_ACTION,"Action", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PRINT_OPERATION_ACTION, "GTK_PRINT_OPERATION_"); /* GtkPrintOperationResult */ G_DEF_CLASS(GTK_TYPE_PRINT_OPERATION_RESULT, "Result", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_PRINT_OPERATION_RESULT, "GTK_PRINT_OPERATION_"); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreeiter.c�������������������������������������������������0000644�0001750�0001750�00000016101�12257552167�020156� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTreeIter #define _SELF(i) ((GtkTreeIter*)RVAL2BOXED(i, GTK_TYPE_TREE_ITER)) void rbgtk_register_treeiter_set_value_func(GType gtype, rbgtkiter_set_value_func func) { rb_hash_aset(treeiter_set_value_table, INT2NUM(gtype), Data_Wrap_Struct(rb_cData, NULL, NULL, func)); } static VALUE rg_first_bang(VALUE self) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; VALUE ret = CBOOL2RVAL(gtk_tree_model_get_iter_first(model, iter)); iter->user_data3 = model; return ret; } static VALUE rg_next_bang(VALUE self) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; gboolean ret = gtk_tree_model_iter_next(model, iter); if (! ret){ gtk_tree_model_get_iter_first(model, iter); } iter->user_data3 = model; return CBOOL2RVAL(ret); } static VALUE rg_get_value(VALUE self, VALUE column) { GValue value = G_VALUE_INIT; GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; VALUE ret = Qnil; gtk_tree_model_get_value(model, iter, NUM2INT(column), &value); if (G_VALUE_TYPE(&value) != G_TYPE_INVALID){ ret = GVAL2RVAL(&value); g_value_unset(&value); } return ret; } static VALUE rg_first_child(VALUE self) { GtkTreeIter child; GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; gboolean ret = gtk_tree_model_iter_children(model, &child, iter); child.user_data3 = model; return ret ? GTKTREEITER2RVAL(&child) : Qnil; } static VALUE rg_path(VALUE self) { VALUE retval = Qnil; GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; GtkTreePath* path = gtk_tree_model_get_path(model, iter); retval= GTKTREEPATH2RVAL(path); gtk_tree_path_free(path); return retval; } static VALUE rg_has_child_p(VALUE self) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; return CBOOL2RVAL(gtk_tree_model_iter_has_child(model, iter)); } static VALUE rg_n_children(VALUE self) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; return INT2NUM(gtk_tree_model_iter_n_children(model, iter)); } static VALUE rg_nth_child(VALUE self, VALUE n) { GtkTreeIter child; GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; gboolean ret = gtk_tree_model_iter_nth_child(model, &child, iter, NUM2INT(n)); child.user_data3 = model; return ret ? GTKTREEITER2RVAL(&child) : Qnil; } static VALUE rg_parent(VALUE self) { GtkTreeIter parent; GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; gboolean ret = gtk_tree_model_iter_parent(model, &parent, iter); parent.user_data3 = model; return ret ? GTKTREEITER2RVAL(&parent) : Qnil; } static VALUE rg_set_value(VALUE self, VALUE column, VALUE value) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; VALUE obj = rb_hash_aref(treeiter_set_value_table, INT2NUM(G_TYPE_FROM_INSTANCE(model))); rbgtkiter_set_value_func func; GType gtype = gtk_tree_model_get_column_type(model, NUM2INT(column)); GValue gval = G_VALUE_INIT; if (NIL_P(obj)) rb_raise(rb_eTypeError, "Gtk::TreeModel is invalid."); Data_Get_Struct(obj, void, func); g_value_init(&gval, gtype); rbgobj_rvalue_to_gvalue(value, &gval); func(model, iter, NUM2INT(column), &gval); g_value_unset(&gval); return self; } static VALUE rg_operator_treeiter_set_value_eql(VALUE self, VALUE column, VALUE value) { rg_set_value(self, column, value); return value; } static VALUE rg_operator_treeiter_eql(VALUE self, VALUE other) { gint i, num1, num2; GtkTreeIter* iter1 = _SELF(self); GtkTreeIter* iter2; GtkTreeModel* model1; GtkTreeModel* model2; GtkTreePath* path1; GtkTreePath* path2; if (!rb_obj_is_kind_of(other, GTYPE2CLASS(GTK_TYPE_TREE_ITER))) return Qfalse; iter2 = _SELF(other); model1 = (GtkTreeModel*)iter1->user_data3; model2 = (GtkTreeModel*)iter2->user_data3; if (model1 != model2) return Qfalse; num1 = gtk_tree_model_get_n_columns(model1); num2 = gtk_tree_model_get_n_columns(model2); if (num1 != num2) return Qfalse; path1 = gtk_tree_model_get_path(model1, iter1); path2 = gtk_tree_model_get_path(model2, iter2); if (gtk_tree_path_compare(path1, path2) != 0) { gtk_tree_path_free(path1); gtk_tree_path_free(path2); return Qfalse; } else { gtk_tree_path_free(path1); gtk_tree_path_free(path2); } for (i = 0; i < num1; i++){ GValue gval1 = G_VALUE_INIT; GValue gval2 = G_VALUE_INIT; VALUE ret1, ret2; gtk_tree_model_get_value(model1, iter1, i, &gval1); gtk_tree_model_get_value(model2, iter2, i, &gval2); ret1 = GVAL2RVAL(&gval1); ret2 = GVAL2RVAL(&gval2); g_value_unset(&gval1); g_value_unset(&gval2); if (rb_equal(ret1, ret2) == Qfalse) return Qfalse; } return Qtrue; } static VALUE rg_to_str(VALUE self) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; gchar* s = gtk_tree_model_get_string_from_iter (model, iter); VALUE result = CSTR2RVAL(s); g_free(s); return result; } void Init_gtk_treeiter(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_ITER, "TreeIter", mGtk); RG_DEF_METHOD_BANG(first, 0); RG_DEF_METHOD_BANG(next, 0); RG_DEF_METHOD(get_value, 1); RG_DEF_ALIAS("[]", "get_value"); RG_DEF_METHOD(first_child, 0); RG_DEF_METHOD(path, 0); RG_DEF_METHOD_P(has_child, 0); RG_DEF_METHOD(n_children, 0); RG_DEF_METHOD(nth_child, 1); RG_DEF_METHOD(parent, 0); RG_DEF_METHOD(set_value, 2); RG_DEF_METHOD_OPERATOR("[]=", treeiter_set_value_eql, 2); RG_DEF_METHOD_OPERATOR("==", treeiter_eql, 1); RG_DEF_METHOD(to_str, 0); RG_DEF_ALIAS("to_s", "to_str"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkradiobutton.c����������������������������������������������0000644�0001750�0001750�00000006130�11701304107�020644� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRadioButton static VALUE RG_TARGET_NAMESPACE; #define _GROUP(s) (NIL_P(s) ? NULL : GTK_RADIO_BUTTON(RVAL2GOBJ(s))) static GtkWidget* create_button(VALUE group, VALUE label, VALUE use_underline) { GtkWidget* widget = NULL; if (TYPE(label) == T_STRING){ if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)){ widget = gtk_radio_button_new_with_mnemonic_from_widget(_GROUP(group), RVAL2CSTR(label)); } else { widget = gtk_radio_button_new_with_label_from_widget(_GROUP(group), RVAL2CSTR(label)); } } else if (TYPE(label) == T_SYMBOL){ widget = gtk_radio_button_new_with_label_from_widget(_GROUP(group), rb_id2name(SYM2ID(label))); gtk_button_set_use_stock(GTK_BUTTON(widget), TRUE); } else if (NIL_P(label)){ widget = gtk_radio_button_new_from_widget(_GROUP(group)); } else { rb_raise(rb_eArgError, "invalid argument %s (expect Symbol(Gtk::Stock constants) or String)", rb_class2name(CLASS_OF(label))); } return widget; } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE group_or_label, label_or_use_underline, use_underline; GtkWidget *widget; if (rb_scan_args(argc, argv, "03", &group_or_label, &label_or_use_underline, &use_underline) > 0) { if (rb_obj_is_kind_of(group_or_label, RG_TARGET_NAMESPACE)){ widget = create_button(group_or_label, label_or_use_underline, use_underline); } else { widget = create_button(Qnil, group_or_label, label_or_use_underline); } } else { widget = gtk_radio_button_new(NULL); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_group(VALUE self) { /* Owned by GTK+ */ return GSLIST2ARY(gtk_radio_button_get_group(GTK_RADIO_BUTTON(RVAL2GOBJ(self)))); } void Init_gtk_radio_button(VALUE mGtk) { RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RADIO_BUTTON, "RadioButton", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(group, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkaccelerator.c����������������������������������������������0000644�0001750�0001750�00000004733�12257552167�020627� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE mAccelerator #define RVAL2MOD(mods) RVAL2GFLAGS(mods, GDK_TYPE_MODIFIER_TYPE) static VALUE rg_s_valid(G_GNUC_UNUSED VALUE self, VALUE keyval, VALUE modifiers) { return CBOOL2RVAL(gtk_accelerator_valid(NUM2UINT(keyval), RVAL2MOD(modifiers))); } static VALUE rg_s_parse(G_GNUC_UNUSED VALUE self, VALUE accelerator) { guint key; GdkModifierType mods; gtk_accelerator_parse(RVAL2CSTR(accelerator), &key, &mods); return rb_ary_new3(2, UINT2NUM(key), GFLAGS2RVAL(mods, GDK_TYPE_MODIFIER_TYPE)); } static VALUE rg_s_to_name(G_GNUC_UNUSED VALUE self, VALUE key, VALUE mods) { return CSTR2RVAL(gtk_accelerator_name(NUM2UINT(key), RVAL2MOD(mods))); } static VALUE rg_s_get_label(G_GNUC_UNUSED VALUE self, VALUE key, VALUE mods) { return CSTR2RVAL(gtk_accelerator_get_label(NUM2UINT(key), RVAL2MOD(mods))); } static VALUE rg_s_set_default_mod_mask(VALUE self, VALUE default_mod_mask) { gtk_accelerator_set_default_mod_mask(RVAL2MOD(default_mod_mask)); return self; } static VALUE rg_s_default_mod_mask(G_GNUC_UNUSED VALUE self) { return GFLAGS2RVAL(gtk_accelerator_get_default_mod_mask(), GDK_TYPE_MODIFIER_TYPE); } void Init_gtk_accelerator(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "Accelerator"); RG_DEF_SMETHOD(valid, 2); RG_DEF_SMETHOD(parse, 1); /* name is reserved by Ruby */ RG_DEF_SMETHOD(to_name, 2); RG_DEF_SMETHOD(get_label, 2); RG_DEF_SMETHOD(set_default_mod_mask, 1); RG_DEF_SMETHOD(default_mod_mask, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkcursor.c���������������������������������������������������0000644�0001750�0001750�00000007143�12257552167�017636� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2001-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCursor static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GdkCursor* cursor = NULL; if (argc == 1){ VALUE type; rb_scan_args(argc, argv, "10", &type); cursor = gdk_cursor_new(RVAL2GENUM(type, GDK_TYPE_CURSOR_TYPE)); } else if (argc == 2) { VALUE display, type_or_name; rb_scan_args(argc, argv, "20", &display, &type_or_name); if (TYPE(type_or_name) == T_STRING) cursor = gdk_cursor_new_from_name(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2CSTR(type_or_name)); else cursor = gdk_cursor_new_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2GENUM(type_or_name, GDK_TYPE_CURSOR_TYPE)); } else if (argc == 4) { VALUE display, pixbuf, x, y; rb_scan_args(argc, argv, "40", &display, &pixbuf, &x, &y); cursor = gdk_cursor_new_from_pixbuf(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), GDK_PIXBUF(RVAL2GOBJ(pixbuf)), NUM2INT(x), NUM2INT(y)); } else if (argc == 6) { VALUE pixmap, mask, fg, bg, x, y; rb_scan_args(argc, argv, "60", &pixmap, &mask, &fg, &bg, &x, &y); cursor = gdk_cursor_new_from_pixmap(GDK_PIXMAP(RVAL2GOBJ(pixmap)), NIL_P(mask)?NULL:GDK_PIXMAP(RVAL2GOBJ(mask)), RVAL2GDKCOLOR(fg), RVAL2GDKCOLOR(bg), NUM2INT(x), NUM2INT(y)); } G_INITIALIZE(self, cursor); return Qnil; } static VALUE rg_display(VALUE self) { return GOBJ2RVAL(gdk_cursor_get_display((GdkCursor*)RVAL2BOXED(self, GDK_TYPE_CURSOR))); } static VALUE rg_pixmap_p(VALUE self) { return CBOOL2RVAL(((GdkCursor*)RVAL2BOXED(self, GDK_TYPE_COLOR))->type == GDK_CURSOR_IS_PIXMAP); } static VALUE rg_cursor_type(VALUE self) { return GENUM2RVAL(((GdkCursor*)RVAL2BOXED(self, GDK_TYPE_CURSOR))->type, GDK_TYPE_CURSOR_TYPE); } static VALUE rg_image(VALUE self) { return GOBJ2RVAL(gdk_cursor_get_image((GdkCursor*)RVAL2BOXED(self, GDK_TYPE_CURSOR))); } void Init_gtk_gdk_cursor(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_CURSOR, "Cursor", mGdk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(display, 0); RG_DEF_METHOD_P(pixmap, 0); RG_DEF_METHOD(cursor_type, 0); RG_DEF_METHOD(image, 0); G_DEF_CLASS(GDK_TYPE_CURSOR_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_CURSOR_TYPE, "GDK_"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtklayout.c���������������������������������������������������0000644�0001750�0001750�00000005246�11701304107�017636� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cLayout #define _SELF(self) (GTK_LAYOUT(RVAL2GOBJ(self))) #define RVAL2ADJ(a) (GTK_ADJUSTMENT(RVAL2GOBJ(a))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE hadjustment, vadjustment; GtkWidget* layout; rb_scan_args(argc, argv, "02", &hadjustment, &vadjustment); layout = gtk_layout_new( NIL_P(hadjustment) ? 0 : RVAL2ADJ(hadjustment), NIL_P(vadjustment) ? 0 : RVAL2ADJ(vadjustment)); RBGTK_INITIALIZE(self, layout); return Qnil; } static VALUE rg_put(VALUE self, VALUE widget, VALUE x, VALUE y) { gtk_layout_put(_SELF(self), GTK_WIDGET(RVAL2GOBJ(widget)), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_move(VALUE self, VALUE widget, VALUE x, VALUE y) { gtk_layout_move(_SELF(self), GTK_WIDGET(RVAL2GOBJ(widget)), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_set_size(VALUE self, VALUE width, VALUE height) { gtk_layout_set_size(_SELF(self), NUM2UINT(width), NUM2UINT(height)); return self; } static VALUE rg_size(VALUE self) { guint width, height; gtk_layout_get_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_bin_window(VALUE self) { return GOBJ2RVAL(_SELF(self)->bin_window); } void Init_gtk_layout(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_LAYOUT, "Layout", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(put, 3); RG_DEF_METHOD(move, 3); RG_DEF_METHOD(set_size, 2); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(bin_window, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkallocation.c�����������������������������������������������0000644�0001750�0001750�00000007541�12124610262�020450� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" static GtkAllocation * gtk_allocation_copy(const GtkAllocation *alloc) { GtkAllocation *result = g_new (GtkAllocation, 1); *result = *alloc; return result; } GType gtk_allocation_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkAllocation", (GBoxedCopyFunc)gtk_allocation_copy, (GBoxedFreeFunc)g_free); return our_type; } #define RG_TARGET_NAMESPACE cAllocation #define _SELF(r) ((GtkAllocation*)RVAL2BOXED(r, GTK_TYPE_ALLOCATION)) static VALUE rg_initialize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { GtkAllocation allocation; allocation.x = NUM2INT(x); allocation.y = NUM2INT(y); allocation.width = NUM2INT(width); allocation.height = NUM2INT(height); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_ALLOCATION, &allocation)); return Qnil; } static VALUE rg_intersect(VALUE self, VALUE other) { GtkAllocation dest; gboolean ret = gdk_rectangle_intersect(_SELF(self), _SELF(other), &dest); return ret ? BOXED2RVAL(&dest, GTK_TYPE_ALLOCATION) : Qnil; } static VALUE rg_union(VALUE self, VALUE other) { GtkAllocation dest; gdk_rectangle_union(_SELF(self), _SELF(other), &dest); return BOXED2RVAL(&dest, GTK_TYPE_ALLOCATION); } /* Struct accessors */ static VALUE rg_x(VALUE self) { return INT2NUM(_SELF(self)->x); } static VALUE rg_y(VALUE self) { return INT2NUM(_SELF(self)->y); } static VALUE rg_width(VALUE self) { return INT2NUM(_SELF(self)->width); } static VALUE rg_height(VALUE self) { return INT2NUM(_SELF(self)->height); } static VALUE rg_set_x(VALUE self, VALUE x) { _SELF(self)->x = NUM2INT(x); return self; } static VALUE rg_set_y(VALUE self, VALUE y) { _SELF(self)->y = NUM2INT(y); return self; } static VALUE rg_set_width(VALUE self, VALUE width) { _SELF(self)->width = NUM2INT(width); return self; } static VALUE rg_set_height(VALUE self, VALUE height) { _SELF(self)->height = NUM2INT(height); return self; } static VALUE rg_to_a(VALUE self) { GtkAllocation* a = _SELF(self); return rb_ary_new3(4, INT2FIX(a->x), INT2FIX(a->y), INT2FIX(a->width), INT2FIX(a->height)); } static VALUE rg_to_rect(VALUE self) { return BOXED2RVAL(_SELF(self), GDK_TYPE_RECTANGLE); } void Init_gtk_allocation(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ALLOCATION, "Allocation", mGtk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(intersect, 1); RG_DEF_ALIAS("&", "intersect"); RG_DEF_METHOD(union, 1); RG_DEF_ALIAS("|", "union"); RG_DEF_METHOD(x, 0); RG_DEF_METHOD(y, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(set_x, 1); RG_DEF_METHOD(set_y, 1); RG_DEF_METHOD(set_width, 1); RG_DEF_METHOD(set_height, 1); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD(to_rect, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreeselection.c��������������������������������������������0000644�0001750�0001750�00000013655�12257552167�021213� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTreeSelection #define _SELF(s) (GTK_TREE_SELECTION(RVAL2GOBJ(s))) #define RVAL2TREEMODEL(s) (GTK_TREE_MODEL(RVAL2GOBJ(s))) static VALUE rg_set_mode(VALUE self, VALUE type) { gtk_tree_selection_set_mode(_SELF(self), RVAL2GENUM(type, GTK_TYPE_SELECTION_MODE)); return self; } static VALUE rg_mode(VALUE self) { return GENUM2RVAL(gtk_tree_selection_get_mode(_SELF(self)), GTK_TYPE_SELECTION_MODE); } static gboolean selection_func(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(selection), GOBJ2RVAL(model), GTKTREEPATH2RVAL(path), CBOOL2RVAL(path_currently_selected))); } static VALUE rg_set_select_function(VALUE self) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_selection_set_select_function(_SELF(self), (GtkTreeSelectionFunc)selection_func, (gpointer)func, NULL); return self; } /* We don't need this(?) gpointer gtk_tree_selection_get_user_data (GtkTreeSelection *selection); */ static VALUE rg_tree_view(VALUE self) { return GOBJ2RVAL(gtk_tree_selection_get_tree_view(_SELF(self))); } static VALUE rg_selected(VALUE self) { GtkTreeIter iter; GtkTreeModel* model; gboolean ret = gtk_tree_selection_get_selected(_SELF(self), &model, &iter); iter.user_data3 = model; return ret ? GTKTREEITER2RVAL(&iter) : Qnil; } static void foreach_func(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) { iter->user_data3 = model; rb_funcall((VALUE)data, id_call, 3, GOBJ2RVAL(model), GTKTREEPATH2RVAL(path), GTKTREEITER2RVAL(iter)); } static VALUE rg_selected_each(VALUE self) { volatile VALUE func = rb_block_proc(); gtk_tree_selection_selected_foreach(_SELF(self), (GtkTreeSelectionForeachFunc)foreach_func, (gpointer)func); return self; } static VALUE rg_select_path(VALUE self, VALUE path) { gtk_tree_selection_select_path(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_unselect_path(VALUE self, VALUE path) { gtk_tree_selection_unselect_path(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_path_is_selected_p(VALUE self, VALUE path) { return CBOOL2RVAL(gtk_tree_selection_path_is_selected(_SELF(self), RVAL2GTKTREEPATH(path))); } static VALUE rg_select_iter(VALUE self, VALUE iter) { gtk_tree_selection_select_iter(_SELF(self), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_unselect_iter(VALUE self, VALUE iter) { gtk_tree_selection_unselect_iter(_SELF(self), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_iter_is_selected_p(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_tree_selection_iter_is_selected(_SELF(self), RVAL2GTKTREEITER(iter))); } static VALUE rg_select_all(VALUE self) { gtk_tree_selection_select_all(_SELF(self)); return self; } static VALUE rg_unselect_all(VALUE self) { gtk_tree_selection_unselect_all(_SELF(self)); return self; } static VALUE rg_select_range(VALUE self, VALUE start_path, VALUE end_path) { gtk_tree_selection_select_range(_SELF(self), RVAL2GTKTREEPATH(start_path), RVAL2GTKTREEPATH(end_path)); return self; } static VALUE rg_selected_rows(VALUE self) { GtkTreeModel* model; GList* list = gtk_tree_selection_get_selected_rows(_SELF(self), &model); VALUE ret = GLIST2ARY2(list, GTK_TYPE_TREE_PATH); g_list_foreach(list, (GFunc)gtk_tree_path_free, (gpointer)NULL); g_list_free(list); return ret; } static VALUE rg_count_selected_rows(VALUE self) { return INT2NUM(gtk_tree_selection_count_selected_rows(_SELF(self))); } static VALUE rg_unselect_range(VALUE self, VALUE start_path, VALUE end_path) { gtk_tree_selection_unselect_range(_SELF(self), RVAL2GTKTREEPATH(start_path), RVAL2GTKTREEPATH(end_path)); return self; } void Init_gtk_treeselection(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_SELECTION, "TreeSelection", mGtk); RG_DEF_METHOD(set_mode, 1); RG_DEF_METHOD(mode, 0); RG_DEF_METHOD(set_select_function, 0); RG_DEF_METHOD(tree_view, 0); RG_DEF_METHOD(selected, 0); RG_DEF_METHOD(selected_each, 0); RG_DEF_METHOD(select_path, 1); RG_DEF_METHOD(unselect_path, 1); RG_DEF_METHOD_P(path_is_selected, 1); RG_DEF_METHOD(select_iter, 1); RG_DEF_METHOD(unselect_iter, 1); RG_DEF_METHOD_P(iter_is_selected, 1); RG_DEF_METHOD(select_all, 0); RG_DEF_METHOD(unselect_all, 0); RG_DEF_METHOD(select_range, 2); RG_DEF_METHOD(selected_rows, 0); RG_DEF_METHOD(count_selected_rows, 0); RG_DEF_METHOD(unselect_range, 2); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkbin.c������������������������������������������������������0000644�0001750�0001750�00000002565�11701304107�017072� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cBin static VALUE rg_child(VALUE self) { GtkWidget *child = gtk_bin_get_child(RVAL2GOBJ(self)); return child ? GOBJ2RVAL(child) : Qnil; } void Init_gtk_bin(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BIN, "Bin", mGtk); RG_DEF_METHOD(child, 0); } �������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktooltips.c�������������������������������������������������0000644�0001750�0001750�00000005662�12257552167�020222� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTooltips #define _SELF(self) (GTK_TOOLTIPS(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_tooltips_new()); return Qnil; } static VALUE rg_enable(VALUE self) { gtk_tooltips_enable(_SELF(self)); return self; } static VALUE rg_disable(VALUE self) { gtk_tooltips_disable(_SELF(self)); return self; } static VALUE rg_set_tip(VALUE self, VALUE win, VALUE text, VALUE priv) { gtk_tooltips_set_tip(_SELF(self), GTK_WIDGET(RVAL2GOBJ(win)), NIL_P(text)?NULL:RVAL2CSTR(text), NIL_P(priv)?NULL:RVAL2CSTR(priv)); return self; } static VALUE rg_s_get_data(G_GNUC_UNUSED VALUE self, VALUE widget) { GtkTooltipsData* data = gtk_tooltips_data_get(GTK_WIDGET(RVAL2GOBJ(widget))); return rb_ary_new3(3, GOBJ2RVAL(data->widget), CSTR2RVAL(data->tip_text), CSTR2RVAL(data->tip_private)); } static VALUE rg_force_window(VALUE self) { gtk_tooltips_force_window(_SELF(self)); return self; } static VALUE rg_s_get_info(G_GNUC_UNUSED VALUE self, VALUE window) { GtkTooltips* tooltips; GtkWidget* current_widget; gboolean ret = gtk_tooltips_get_info_from_tip_window(GTK_WINDOW(RVAL2GOBJ(window)), &tooltips, ¤t_widget); if (ret) return rb_assoc_new(GOBJ2RVAL(tooltips), GOBJ2RVAL(current_widget)); else return Qnil; } void Init_gtk_tooltips(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOOLTIPS, "Tooltips", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_tip, 3); RG_DEF_METHOD(enable, 0); RG_DEF_METHOD(disable, 0); RG_DEF_METHOD(force_window, 0); RG_DEF_SMETHOD(get_info, 1); RG_DEF_SMETHOD(get_data, 1); } ������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/depend����������������������������������������������������������0000644�0001750�0001750�00000000751�12064346475�016322� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install-so: install-headers install-headers: $(INSTALL_DATA) $(srcdir)/rbgdk.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgdkconversions.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgtk.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgtkconversions.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgtkmacros.h $(RUBYARCHDIR) install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-gtk2.pc $(pkgconfigdir); \ fi �����������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkadjustment.c�����������������������������������������������0000644�0001750�0001750�00000004441�11701304107�020473� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAdjustment #define _SELF(self) (GTK_ADJUSTMENT(RVAL2GOBJ(self))) static VALUE rg_initialize(VALUE self, VALUE value, VALUE lower, VALUE upper, VALUE step_inc, VALUE page_inc, VALUE page_size) { RBGTK_INITIALIZE(self, gtk_adjustment_new(NUM2DBL(value), NUM2DBL(lower), NUM2DBL(upper), NUM2DBL(step_inc), NUM2DBL(page_inc), NUM2DBL(page_size))); return Qnil; } static VALUE rg_clamp_page(VALUE self, VALUE lower, VALUE upper) { gtk_adjustment_clamp_page(_SELF(self), NUM2DBL(lower), NUM2DBL(upper)); return self; } static VALUE rg_changed(VALUE self) { gtk_adjustment_changed(_SELF(self)); return self; } static VALUE rg_value_changed(VALUE self) { gtk_adjustment_value_changed(_SELF(self)); return self; } void Init_gtk_adjustment(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ADJUSTMENT, "Adjustment", mGtk); RG_DEF_METHOD(initialize, 6); RG_DEF_METHOD(clamp_page, 2); RG_DEF_METHOD(changed, 0); RG_DEF_METHOD(value_changed, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkmenutoolbutton.c�������������������������������������������0000644�0001750�0001750�00000005123�12257552167�021433� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cMenuToolButton #define _SELF(self) (GTK_MENU_TOOL_BUTTON(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GtkToolItem* item; if (argc == 0){ item = gtk_menu_tool_button_new((GtkWidget*)NULL, (const gchar*)NULL); } else if (TYPE(argv[0]) == T_SYMBOL || TYPE(argv[0]) == T_STRING){ VALUE stock_id; rb_scan_args(argc, argv, "10", &stock_id); if (TYPE(stock_id) == T_SYMBOL){ item = gtk_menu_tool_button_new_from_stock(rb_id2name(SYM2ID(stock_id))); } else { item = gtk_menu_tool_button_new_from_stock(RVAL2CSTR(stock_id)); } } else { VALUE icon_widget, label; rb_scan_args(argc, argv, "11", &icon_widget, &label); item = gtk_menu_tool_button_new(GTK_WIDGET(RVAL2GOBJ(icon_widget)), NIL_P(label) ? (const gchar*)NULL : RVAL2CSTR(label)); } RBGTK_INITIALIZE(self, item); return Qnil; } static VALUE rg_set_arrow_tooltip(int argc, VALUE *argv, VALUE self) { VALUE tooltips, tip_text, tip_private; rb_scan_args(argc, argv, "12", &tooltips, &tip_text, &tip_private); gtk_menu_tool_button_set_arrow_tooltip(_SELF(self), GTK_TOOLTIPS(RVAL2GOBJ(self)), NIL_P(tip_text) ? NULL : RVAL2CSTR(tip_text), NIL_P(tip_private) ? NULL : RVAL2CSTR(tip_private)); return self; } void Init_gtk_menutoolbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU_TOOL_BUTTON, "MenuToolButton", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_arrow_tooltip, -1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktogglebutton.c���������������������������������������������0000644�0001750�0001750�00000005460�11701304107�021034� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cToggleButton static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, use_underline; GtkWidget *widget; if (rb_scan_args(argc, argv, "02", &label, &use_underline) > 0) { if (TYPE(label) == T_STRING){ if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)){ widget = gtk_toggle_button_new_with_mnemonic(RVAL2CSTR(label)); } else { widget = gtk_toggle_button_new_with_label(RVAL2CSTR(label)); } } else if (TYPE(label) == T_SYMBOL){ widget = gtk_toggle_button_new_with_label(rb_id2name(SYM2ID(label))); gtk_button_set_use_stock(GTK_BUTTON(widget), TRUE); } else { rb_raise(rb_eArgError, "invalid argument %s (expect Symbol(Gtk::Stock constants) or String)", rb_class2name(CLASS_OF(label))); } } else { widget = gtk_toggle_button_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_set_mode(VALUE self, VALUE mode) { gtk_toggle_button_set_mode(GTK_TOGGLE_BUTTON(RVAL2GOBJ(self)), RVAL2CBOOL(mode)); return self; } static VALUE rg_mode_p(VALUE self) { return CBOOL2RVAL(gtk_toggle_button_get_mode(GTK_TOGGLE_BUTTON(RVAL2GOBJ(self)))); } static VALUE rg_toggled(VALUE self) { gtk_toggle_button_toggled(GTK_TOGGLE_BUTTON(RVAL2GOBJ(self))); return self; } void Init_gtk_toggle_button(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOGGLE_BUTTON, "ToggleButton", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_mode, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "mode"); RG_DEF_METHOD_P(mode, 0); RG_DEF_METHOD(toggled, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkprintcontext.c���������������������������������������������0000644�0001750�0001750�00000006327�12257552167�021105� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cPrintContext #define _SELF(s) (GTK_PRINT_CONTEXT(RVAL2GOBJ(s))) # ifdef HAVE_RB_CAIRO_H #include <rb_cairo.h> /* Rendering */ static VALUE rg_cairo_context(VALUE self) { return CRCONTEXT2RVAL(gtk_print_context_get_cairo_context(_SELF(self))); } # endif static VALUE rg_page_setup(VALUE self) { return GOBJ2RVAL(gtk_print_context_get_page_setup(_SELF(self))); } static VALUE rg_width(VALUE self) { return rb_float_new(gtk_print_context_get_width(_SELF(self))); } static VALUE rg_height(VALUE self) { return rb_float_new(gtk_print_context_get_height(_SELF(self))); } static VALUE rg_dpi_x(VALUE self) { return rb_float_new(gtk_print_context_get_dpi_x(_SELF(self))); } static VALUE rg_dpi_y(VALUE self) { return rb_float_new(gtk_print_context_get_dpi_y(_SELF(self))); } /* Fonts */ static VALUE rg_pango_fontmap(VALUE self) { return GOBJ2RVAL(gtk_print_context_get_pango_fontmap(_SELF(self))); } static VALUE rg_create_pango_context(VALUE self) { return GOBJ2RVALU(gtk_print_context_create_pango_context(_SELF(self))); } static VALUE rg_create_pango_layout(VALUE self) { return GOBJ2RVALU(gtk_print_context_create_pango_layout(_SELF(self))); } /* Needed for preview implementations */ # ifdef HAVE_RB_CAIRO_H static VALUE rg_set_cairo_context(VALUE self, VALUE cr, VALUE dpi_x, VALUE dpi_y) { gtk_print_context_set_cairo_context(_SELF(self), RVAL2CRCONTEXT(cr), NUM2DBL(dpi_x), NUM2DBL(dpi_y)); return self; } # endif void Init_gtk_print_context(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_CONTEXT, "PrintContext", mGtk); /* Rendering */ # ifdef HAVE_RB_CAIRO_H RG_DEF_METHOD(cairo_context, 0); # endif RG_DEF_METHOD(page_setup, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(dpi_x, 0); RG_DEF_METHOD(dpi_y, 0); /* Fonts */ RG_DEF_METHOD(pango_fontmap, 0); RG_DEF_METHOD(create_pango_context, 0); RG_DEF_METHOD(create_pango_layout, 0); /* Needed for preview implementations */ # ifdef HAVE_RB_CAIRO_H RG_DEF_METHOD(set_cairo_context, 3); # endif G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkborder.c���������������������������������������������������0000644�0001750�0001750�00000005256�12124610262�017601� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cBorder #define _SELF(self) ((GtkBorder*)RVAL2BOXED(self, GTK_TYPE_BORDER)) #define ATTR_INT(name)\ static VALUE \ border_int_ ## name (VALUE self)\ {\ return INT2NUM(_SELF(self)->name);\ }\ static VALUE \ border_int_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = NUM2INT(val); \ return self;\ } ATTR_INT(left); ATTR_INT(right); ATTR_INT(top); ATTR_INT(bottom); #define DEFINE_ACCESSOR(gt, type, name) \ rb_define_method(gt, G_STRINGIFY(name), border_ ## type ## _## name, 0);\ rb_define_method(gt, G_STRINGIFY(set_ ## name), border_ ## type ## _set_## name, 1); static VALUE rg_initialize(VALUE self, VALUE left, VALUE right, VALUE top, VALUE bottom) { GtkBorder border; border.left = NUM2INT(left); border.right = NUM2INT(right); border.top = NUM2INT(top); border.bottom = NUM2INT(bottom); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_BORDER, &border)); return Qnil; } static VALUE rg_to_a(VALUE self) { GtkBorder* border = _SELF(self); return rb_ary_new3(4, INT2NUM(border->left), INT2NUM(border->right), INT2NUM(border->top), INT2NUM(border->bottom)); } void Init_gtk_border(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BORDER, "Border", mGtk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(to_a, 0); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, left); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, right); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, top); DEFINE_ACCESSOR(RG_TARGET_NAMESPACE, int, bottom); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktextview.c�������������������������������������������������0000644�0001750�0001750�00000024413�12257552167�020217� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTextView #define _SELF(self) (GTK_TEXT_VIEW(RVAL2GOBJ(self))) #define RVAL2BUFFER(b) (GTK_TEXT_BUFFER(RVAL2GOBJ(b))) #define RVAL2MARK(m) (GTK_TEXT_MARK(RVAL2GOBJ(m))) #define RVAL2ITR(i) ((GtkTextIter*)(RVAL2BOXED(i, GTK_TYPE_TEXT_ITER))) #define ITR2RVAL(i) (BOXED2RVAL(i, GTK_TYPE_TEXT_ITER)) static ID id_buffer; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE buffer; GtkWidget* widget; rb_scan_args(argc, argv, "01", &buffer); if (NIL_P(buffer)) widget = gtk_text_view_new(); else { G_CHILD_SET(self, id_buffer, buffer); widget = gtk_text_view_new_with_buffer(RVAL2BUFFER(buffer)); } RBGTK_INITIALIZE(self, widget); return self; } static VALUE textview_set_buffer(VALUE self, VALUE buf) { G_CHILD_SET(self, id_buffer, buf); gtk_text_view_set_buffer(_SELF(self), NIL_P(buf) ? NULL : RVAL2BUFFER(buf)); return self; } static VALUE textview_get_buffer(VALUE self) { VALUE buf = GOBJ2RVAL(gtk_text_view_get_buffer(_SELF(self))); G_CHILD_SET(self, id_buffer, buf); return buf; } static VALUE rg_scroll_to_mark(VALUE self, VALUE mark, VALUE within_margin, VALUE use_align, VALUE xalign, VALUE yalign) { gtk_text_view_scroll_to_mark(_SELF(self), RVAL2MARK(mark), NUM2DBL(within_margin), RVAL2CBOOL(use_align), NUM2DBL(xalign), NUM2DBL(yalign)); return self; } static VALUE rg_scroll_to_iter(VALUE self, VALUE iter, VALUE within_margin, VALUE use_align, VALUE xalign, VALUE yalign) { return CBOOL2RVAL(gtk_text_view_scroll_to_iter(_SELF(self), RVAL2ITR(iter), NUM2DBL(within_margin), RVAL2CBOOL(use_align), NUM2DBL(xalign), NUM2DBL(yalign))); } static VALUE rg_scroll_mark_onscreen(VALUE self, VALUE mark) { gtk_text_view_scroll_mark_onscreen(_SELF(self), RVAL2MARK(mark)); return self; } static VALUE rg_move_mark_onscreen(VALUE self, VALUE mark) { return CBOOL2RVAL(gtk_text_view_move_mark_onscreen(_SELF(self), RVAL2MARK(mark))); } static VALUE rg_place_cursor_onscreen(VALUE self) { return CBOOL2RVAL(gtk_text_view_place_cursor_onscreen(_SELF(self))); } static VALUE rg_visible_rect(VALUE self) { GdkRectangle rect; gtk_text_view_get_visible_rect(_SELF(self), &rect); return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE); } static VALUE rg_get_iter_location(VALUE self, VALUE iter) { GdkRectangle rect; gtk_text_view_get_iter_location(_SELF(self), RVAL2ITR(iter), &rect); return BOXED2RVAL(&rect, GDK_TYPE_RECTANGLE); } static VALUE rg_get_line_at_y(VALUE self, VALUE y) { GtkTextIter target_iter; gint line_top; gtk_text_view_get_line_at_y(_SELF(self), &target_iter, NUM2INT(y), &line_top); return rb_ary_new3(2, ITR2RVAL(&target_iter), INT2NUM(line_top)); } static VALUE rg_get_line_yrange(VALUE self, VALUE iter) { int y, height; gtk_text_view_get_line_yrange(_SELF(self), RVAL2ITR(iter), &y, &height); return rb_ary_new3(2, INT2NUM(y), INT2NUM(height)); } static VALUE rg_get_iter_at_location(VALUE self, VALUE x, VALUE y) { GtkTextIter iter; gtk_text_view_get_iter_at_location(_SELF(self), &iter, NUM2INT(x), NUM2INT(y)); return ITR2RVAL(&iter); } static VALUE rg_get_iter_at_position(VALUE self, VALUE x, VALUE y) { GtkTextIter iter; gint trailing; gtk_text_view_get_iter_at_position(_SELF(self), &iter, &trailing, NUM2INT(x), NUM2INT(y)); return rb_assoc_new(ITR2RVAL(&iter), INT2NUM(trailing)); } static VALUE rg_buffer_to_window_coords(VALUE self, VALUE wintype, VALUE buffer_x, VALUE buffer_y) { int window_x, window_y; gtk_text_view_buffer_to_window_coords(_SELF(self), RVAL2GENUM(wintype, GTK_TYPE_TEXT_WINDOW_TYPE), NUM2INT(buffer_x), NUM2INT(buffer_y), &window_x, &window_y); return rb_ary_new3(2, INT2NUM(window_x), INT2NUM(window_y)); } static VALUE rg_window_to_buffer_coords(VALUE self, VALUE wintype, VALUE window_x, VALUE window_y) { int buffer_x, buffer_y; gtk_text_view_window_to_buffer_coords(_SELF(self), RVAL2GENUM(wintype, GTK_TYPE_TEXT_WINDOW_TYPE), NUM2INT(window_x), NUM2INT(window_y), &buffer_x, &buffer_y); return rb_ary_new3(2, INT2NUM(buffer_x), INT2NUM(buffer_y)); } static VALUE rg_get_window(VALUE self, VALUE wintype) { GdkWindow* win = NULL; win = gtk_text_view_get_window(_SELF(self), RVAL2GENUM(wintype, GTK_TYPE_TEXT_WINDOW_TYPE)); return win ? GOBJ2RVAL(win): Qnil; } static VALUE rg_get_window_type(VALUE self, VALUE gdkwin) { return GENUM2RVAL(gtk_text_view_get_window_type(_SELF(self), RVAL2GOBJ(gdkwin)), GTK_TYPE_TEXT_WINDOW_TYPE); } static VALUE rg_set_border_window_size(VALUE self, VALUE wintype, VALUE size) { gtk_text_view_set_border_window_size(_SELF(self), RVAL2GENUM(wintype, GTK_TYPE_TEXT_WINDOW_TYPE), NUM2INT(size)); return self; } static VALUE rg_get_border_window_size(VALUE self, VALUE wintype) { return INT2NUM(gtk_text_view_get_border_window_size( _SELF(self), RVAL2GENUM(wintype, GTK_TYPE_TEXT_WINDOW_TYPE))); } static VALUE rg_forward_display_line(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_text_view_forward_display_line(_SELF(self), RVAL2ITR(iter))); } static VALUE rg_backward_display_line(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_text_view_backward_display_line(_SELF(self), RVAL2ITR(iter))); } static VALUE rg_forward_display_line_end(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_text_view_forward_display_line_end(_SELF(self), RVAL2ITR(iter))); } static VALUE rg_backward_display_line_start(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_text_view_backward_display_line_start(_SELF(self), RVAL2ITR(iter))); } static VALUE rg_starts_display_line(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_text_view_starts_display_line(_SELF(self), RVAL2ITR(iter))); } static VALUE rg_move_visually(VALUE self, VALUE iter, VALUE count) { return CBOOL2RVAL(gtk_text_view_move_visually(_SELF(self), RVAL2ITR(iter), NUM2INT(count))); } static VALUE rg_add_child_at_anchor(VALUE self, VALUE child, VALUE anchor) { G_CHILD_ADD(self, child); gtk_text_view_add_child_at_anchor(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)), GTK_TEXT_CHILD_ANCHOR(RVAL2GOBJ(anchor))); return self; } static VALUE rg_add_child_in_window(VALUE self, VALUE child, VALUE which_window, VALUE xpos, VALUE ypos) { G_CHILD_ADD(self, child); gtk_text_view_add_child_in_window(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)), RVAL2GENUM(which_window, GTK_TYPE_TEXT_WINDOW_TYPE), NUM2INT(xpos), NUM2INT(ypos)); return self; } static VALUE rg_move_child(VALUE self, VALUE child, VALUE xpos, VALUE ypos) { G_CHILD_ADD(self, child); gtk_text_view_move_child(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child)), NUM2INT(xpos), NUM2INT(ypos)); return self; } static VALUE rg_default_attributes(VALUE self) { return BOXED2RVAL(gtk_text_view_get_default_attributes(_SELF(self)), GTK_TYPE_TEXT_ATTRIBUTES); } void Init_gtk_textview(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_VIEW, "TextView", mGtk); id_buffer = rb_intern("buffer"); RG_DEF_METHOD(initialize, -1); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "buffer", textview_set_buffer, 1); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "buffer", textview_get_buffer, 0); RG_DEF_METHOD(scroll_to_mark, 5); RG_DEF_METHOD(scroll_to_iter, 5); RG_DEF_METHOD(scroll_mark_onscreen, 1); RG_DEF_METHOD(move_mark_onscreen, 1); RG_DEF_METHOD(place_cursor_onscreen, 0); RG_DEF_METHOD(visible_rect, 0); RG_DEF_METHOD(get_iter_location, 1); RG_DEF_METHOD(get_line_at_y, 1); RG_DEF_METHOD(get_line_yrange, 1); RG_DEF_METHOD(get_iter_at_location, 2); RG_DEF_METHOD(get_iter_at_position, 2); RG_DEF_METHOD(buffer_to_window_coords, 3); RG_DEF_METHOD(window_to_buffer_coords, 3); RG_DEF_METHOD(get_window, 1); RG_DEF_METHOD(get_window_type, 1); RG_DEF_METHOD(set_border_window_size, 2); G_DEF_SETTER(RG_TARGET_NAMESPACE, "border_window_size"); RG_DEF_METHOD(get_border_window_size, 1); RG_DEF_METHOD(forward_display_line, 1); RG_DEF_METHOD(backward_display_line, 1); RG_DEF_METHOD(forward_display_line_end, 1); RG_DEF_METHOD(backward_display_line_start, 1); RG_DEF_METHOD(starts_display_line, 1); RG_DEF_METHOD(move_visually, 2); RG_DEF_METHOD(add_child_at_anchor, 2); RG_DEF_METHOD(add_child_in_window, 4); RG_DEF_METHOD(move_child, 3); RG_DEF_METHOD(default_attributes, 0); /* GtkTextWindowType */ G_DEF_CLASS(GTK_TYPE_TEXT_WINDOW_TYPE, "WindowType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_TEXT_WINDOW_TYPE, "GTK_TEXT_"); rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_VALIDATE", INT2FIX(GTK_TEXT_VIEW_PRIORITY_VALIDATE)); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktoggletoolbutton.c�����������������������������������������0000644�0001750�0001750�00000003337�12257552167�021755� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cToggleToolButton #define _SELF(self) (GTK_TOGGLE_TOOL_BUTTON(RVAL2GOBJ(self))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE stock_id; GtkToolItem* item; rb_scan_args(argc, argv, "01", &stock_id); if (NIL_P(stock_id)){ item = gtk_toggle_tool_button_new(); } else { if (TYPE(stock_id) == T_SYMBOL){ item = gtk_toggle_tool_button_new_from_stock(rb_id2name(SYM2ID(stock_id))); } else { item = gtk_toggle_tool_button_new_from_stock(RVAL2CSTR(stock_id)); } } RBGTK_INITIALIZE(self, item); return Qnil; } void Init_gtk_toggletoolbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOGGLE_TOOL_BUTTON, "ToggleToolButton", mGtk); RG_DEF_METHOD(initialize, -1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkassistant.c������������������������������������������������0000644�0001750�0001750�00000014055�12257552167�020352� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAssistant #define _SELF(s) (GTK_ASSISTANT(RVAL2GOBJ(s))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_assistant_new()); return Qnil; } static VALUE rg_current_page(VALUE self) { return INT2NUM(gtk_assistant_get_current_page(_SELF(self))); } static VALUE rg_set_current_page(VALUE self, VALUE page_num) { gtk_assistant_set_current_page(_SELF(self), NUM2INT(page_num)); return self; } static VALUE rg_n_pages(VALUE self) { return INT2NUM(gtk_assistant_get_n_pages(_SELF(self))); } static VALUE rg_get_nth_page(VALUE self, VALUE page_num) { return GOBJ2RVAL(gtk_assistant_get_nth_page(_SELF(self), NUM2INT(page_num))); } static VALUE rg_prepend_page(VALUE self, VALUE page) { return INT2NUM(gtk_assistant_prepend_page(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)))); } static VALUE rg_append_page(VALUE self, VALUE page) { return INT2NUM(gtk_assistant_append_page(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)))); } static VALUE rg_insert_page(VALUE self, VALUE page, VALUE position) { return INT2NUM(gtk_assistant_insert_page(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)), NUM2INT(position))); } static gint ass_page_func(gint current_page, gpointer func) { return NUM2INT(rb_funcall((VALUE)func, id_call, 1, INT2NUM(current_page))); } static VALUE rg_set_forward_page_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_assistant_set_forward_page_func(_SELF(self), (GtkAssistantPageFunc)ass_page_func, (gpointer)func, NULL); return self; } static VALUE rg_set_page_type(VALUE self, VALUE page, VALUE type) { gtk_assistant_set_page_type(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)), RVAL2GENUM(type, GTK_TYPE_ASSISTANT_PAGE_TYPE)); return self; } static VALUE rg_get_page_type(VALUE self, VALUE page) { return GENUM2RVAL(gtk_assistant_get_page_type(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page))), GTK_TYPE_ASSISTANT_PAGE_TYPE); } static VALUE rg_set_page_title(VALUE self, VALUE page, VALUE title) { gtk_assistant_set_page_title(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)), RVAL2CSTR(title)); return self; } static VALUE rg_get_page_title(VALUE self, VALUE page) { return CSTR2RVAL(gtk_assistant_get_page_title(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)))); } static VALUE rg_set_page_header_image(VALUE self, VALUE page, VALUE header_image) { gtk_assistant_set_page_header_image(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)), GDK_PIXBUF(RVAL2GOBJ(header_image))); return self; } static VALUE rg_get_page_header_image(VALUE self, VALUE page) { return GOBJ2RVAL(gtk_assistant_get_page_header_image(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)))); } static VALUE rg_set_page_side_image(VALUE self, VALUE page, VALUE side_image) { gtk_assistant_set_page_side_image(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)), GDK_PIXBUF(RVAL2GOBJ(side_image))); return self; } static VALUE rg_get_page_side_image(VALUE self, VALUE page) { return GOBJ2RVAL(gtk_assistant_get_page_side_image(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)))); } static VALUE rg_set_page_complete(VALUE self, VALUE page, VALUE complete) { gtk_assistant_set_page_complete(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)), RVAL2CBOOL(complete)); return self; } static VALUE rg_get_page_complete(VALUE self, VALUE page) { return CBOOL2RVAL(gtk_assistant_get_page_complete(_SELF(self), GTK_WIDGET(RVAL2GOBJ(page)))); } static VALUE rg_add_action_widget(VALUE self, VALUE child) { gtk_assistant_add_action_widget(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child))); return self; } static VALUE rg_remove_action_widget(VALUE self, VALUE child) { gtk_assistant_remove_action_widget(_SELF(self), GTK_WIDGET(RVAL2GOBJ(child))); return self; } static VALUE rg_update_buttons_state(VALUE self) { gtk_assistant_update_buttons_state(_SELF(self)); return self; } static VALUE rg_commit(VALUE self) { gtk_assistant_commit(_SELF(self)); return self; } void Init_gtk_assistant(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ASSISTANT, "Assistant", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(current_page, 0); RG_DEF_METHOD(set_current_page, 1); RG_DEF_METHOD(n_pages, 0); RG_DEF_METHOD(get_nth_page, 1); RG_DEF_METHOD(prepend_page, 1); RG_DEF_METHOD(append_page, 1); RG_DEF_METHOD(insert_page, 2); RG_DEF_METHOD(set_forward_page_func, 0); RG_DEF_METHOD(set_page_type, 2); RG_DEF_METHOD(get_page_type, 1); RG_DEF_METHOD(set_page_title, 2); RG_DEF_METHOD(get_page_title, 1); RG_DEF_METHOD(set_page_header_image, 2); RG_DEF_METHOD(get_page_header_image, 1); RG_DEF_METHOD(set_page_side_image, 2); RG_DEF_METHOD(get_page_side_image, 1); RG_DEF_METHOD(set_page_complete, 2); RG_DEF_METHOD(get_page_complete, 1); RG_DEF_METHOD(add_action_widget, 1); RG_DEF_METHOD(remove_action_widget, 1); RG_DEF_METHOD(update_buttons_state, 0); RG_DEF_METHOD(commit, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkAssistantPageType */ G_DEF_CLASS(GTK_TYPE_ASSISTANT_PAGE_TYPE, "PageType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_ASSISTANT_PAGE_TYPE, "GTK_ASSISTANT_"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktreedragdest.c���������������������������������������������0000644�0001750�0001750�00000002022�11701304107�020763� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" void Init_gtk_treedragdest(VALUE mGtk) { G_DEF_INTERFACE(GTK_TYPE_TREE_DRAG_DEST, "TreeDragDest", mGtk); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkprintoperationpreview.c������������������������������������0000644�0001750�0001750�00000003650�12257552167�023017� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cPrintOperationPreview #define _SELF(s) (GTK_PRINT_OPERATION_PREVIEW(RVAL2GOBJ(s))) static VALUE rg_render_page(VALUE self, VALUE page_number) { gtk_print_operation_preview_render_page(_SELF(self), NUM2INT(page_number)); return self; } static VALUE rg_end_preview(VALUE self) { gtk_print_operation_preview_end_preview(_SELF(self)); return self; } static VALUE rg_selected_p(VALUE self, VALUE page_number) { gboolean selected; selected = gtk_print_operation_preview_is_selected(_SELF(self), NUM2INT(page_number)); return CBOOL2RVAL(selected); } void Init_gtk_print_operation_preview(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_OPERATION_PREVIEW, "PrintOperationPreview", mGtk); RG_DEF_METHOD(render_page, 1); RG_DEF_METHOD(end_preview, 0); RG_DEF_METHOD_P(selected, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ����������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkcairo.c����������������������������������������������������0000644�0001750�0001750�00000005426�12257552167�017420� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #include <gdk/gdkcairo.h> #include <rb_cairo.h> #define RG_TARGET_NAMESPACE rb_cCairo_Context #define _SELF(self) RVAL2CRCONTEXT(self) static VALUE rg_set_source_gdk_color(VALUE self, VALUE color) { gdk_cairo_set_source_color(_SELF(self), RVAL2GDKCOLOR(color)); rb_cairo_check_status(cairo_status(_SELF(self))); return self; } static VALUE rg_set_source_pixbuf(int argc, VALUE *argv, VALUE self) { VALUE pixbuf, pixbuf_x, pixbuf_y; rb_scan_args(argc, argv, "12", &pixbuf, &pixbuf_x, &pixbuf_y); gdk_cairo_set_source_pixbuf(_SELF(self), GDK_PIXBUF(RVAL2GOBJ(pixbuf)), NIL_P(pixbuf_x) ? 0 : NUM2DBL(pixbuf_x), NIL_P(pixbuf_y) ? 0 : NUM2DBL(pixbuf_y)); rb_cairo_check_status(cairo_status(_SELF(self))); return self; } static VALUE rg_set_source_pixmap(VALUE self, VALUE pixmap, VALUE pixmap_x, VALUE pixmap_y) { gdk_cairo_set_source_pixmap(_SELF(self), GDK_PIXMAP(RVAL2GOBJ(pixmap)), NUM2DBL(pixmap_x), NUM2DBL(pixmap_y)); rb_cairo_check_status(cairo_status(_SELF(self))); return self; } static VALUE rg_gdk_rectangle(VALUE self, VALUE rectangle) { gdk_cairo_rectangle(_SELF(self), (GdkRectangle*)RVAL2BOXED(rectangle, GDK_TYPE_RECTANGLE)); rb_cairo_check_status(cairo_status(_SELF(self))); return self; } static VALUE rg_gdk_region(VALUE self, VALUE region) { gdk_cairo_region(_SELF(self), (GdkRegion*)RVAL2BOXED(region, GDK_TYPE_REGION)); rb_cairo_check_status(cairo_status(_SELF(self))); return self; } void Init_gtk_gdk_cairo(void) { RG_DEF_METHOD(set_source_gdk_color, 1); RG_DEF_METHOD(set_source_pixbuf, -1); RG_DEF_METHOD(set_source_pixmap, 3); RG_DEF_METHOD(gdk_rectangle, 1); RG_DEF_METHOD(gdk_region, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkgeometry.c�������������������������������������������������0000644�0001750�0001750�00000014077�12124610262�020140� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" /*****************************************/ static GdkGeometry* geo_copy(const GdkGeometry* geo) { GdkGeometry* new_geo; g_return_val_if_fail (geo != NULL, NULL); new_geo = g_new(GdkGeometry, 1); *new_geo = *geo; return new_geo; } GType gdk_geometry_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkGeometry", (GBoxedCopyFunc)geo_copy, (GBoxedFreeFunc)g_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cGeometry #define _SELF(g) ((GdkGeometry*)RVAL2BOXED(g, GDK_TYPE_GEOMETRY)) static VALUE rg_initialize(VALUE self) { GdkGeometry geometry; memset(&geometry, 0, sizeof(GdkGeometry)); G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_GEOMETRY, &geometry)); return Qnil; } static VALUE rg_set(VALUE self, VALUE min_width, VALUE min_height, VALUE max_width, VALUE max_height, VALUE base_width, VALUE base_height, VALUE width_inc, VALUE height_inc, VALUE min_aspect, VALUE max_aspect, VALUE gravity) { GdkGeometry *geo = _SELF(self); geo->min_width = NUM2INT(min_width); geo->min_height = NUM2INT(min_height); geo->max_width = NUM2INT(max_width); geo->max_height = NUM2INT(max_height); geo->base_width = NUM2INT(base_width); geo->base_height = NUM2INT(base_height); geo->width_inc = NUM2INT(width_inc); geo->height_inc = NUM2INT(height_inc); geo->min_aspect = NUM2DBL(min_aspect); geo->max_aspect = NUM2DBL(max_aspect); geo->win_gravity = RVAL2GENUM(gravity, GDK_TYPE_GRAVITY); return self; } static VALUE rg_min_width(VALUE self) { return INT2NUM(_SELF(self)->min_width); } static VALUE rg_min_height(VALUE self) { return INT2NUM(_SELF(self)->min_height); } static VALUE rg_max_width(VALUE self) { return INT2NUM(_SELF(self)->max_width); } static VALUE rg_max_height(VALUE self) { return INT2NUM(_SELF(self)->max_height); } static VALUE rg_base_width(VALUE self) { return INT2NUM(_SELF(self)->base_width); } static VALUE rg_base_height(VALUE self) { return INT2NUM(_SELF(self)->base_height); } static VALUE rg_width_inc(VALUE self) { return INT2NUM(_SELF(self)->width_inc); } static VALUE rg_height_inc(VALUE self) { return INT2NUM(_SELF(self)->height_inc); } static VALUE rg_min_aspect(VALUE self) { return rb_float_new(_SELF(self)->min_aspect); } static VALUE rg_max_aspect(VALUE self) { return rb_float_new(_SELF(self)->max_aspect); } static VALUE rg_win_gravity(VALUE self) { return GENUM2RVAL(_SELF(self)->win_gravity, GDK_TYPE_GRAVITY); } static VALUE rg_set_min_width(VALUE self, VALUE min_width) { _SELF(self)->min_width = NUM2INT(min_width); return self; } static VALUE rg_set_min_height(VALUE self, VALUE min_height) { _SELF(self)->min_height = NUM2INT(min_height); return self; } static VALUE rg_set_max_width(VALUE self, VALUE max_width) { _SELF(self)->max_width = NUM2INT(max_width); return self; } static VALUE rg_set_max_height(VALUE self, VALUE max_height) { _SELF(self)->max_height = NUM2INT(max_height); return self; } static VALUE rg_set_base_width(VALUE self, VALUE base_width) { _SELF(self)->base_width = NUM2INT(base_width); return self; } static VALUE rg_set_base_height(VALUE self, VALUE base_height) { _SELF(self)->base_height = NUM2INT(base_height); return self; } static VALUE rg_set_width_inc(VALUE self, VALUE width_inc) { _SELF(self)->width_inc = NUM2INT(width_inc); return self; } static VALUE rg_set_height_inc(VALUE self, VALUE height_inc) { _SELF(self)->height_inc = NUM2INT(height_inc); return self; } static VALUE rg_set_min_aspect(VALUE self, VALUE min_aspect) { _SELF(self)->min_aspect = NUM2DBL(min_aspect); return self; } static VALUE rg_set_max_aspect(VALUE self, VALUE max_aspect) { _SELF(self)->max_aspect = NUM2DBL(max_aspect); return self; } static VALUE rg_set_win_gravity(VALUE self, VALUE gravity) { _SELF(self)->win_gravity = RVAL2GENUM(gravity, GDK_TYPE_GRAVITY); return self; } void Init_gtk_gdk_geometry(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_GEOMETRY, "Geometry", mGdk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(min_width, 0); RG_DEF_METHOD(min_height, 0); RG_DEF_METHOD(max_width, 0); RG_DEF_METHOD(max_height, 0); RG_DEF_METHOD(base_width, 0); RG_DEF_METHOD(base_height, 0); RG_DEF_METHOD(width_inc, 0); RG_DEF_METHOD(height_inc, 0); RG_DEF_METHOD(min_aspect, 0); RG_DEF_METHOD(max_aspect, 0); RG_DEF_METHOD(win_gravity, 0); RG_DEF_METHOD(set, 11); RG_DEF_METHOD(set_min_width, 1); RG_DEF_METHOD(set_min_height, 1); RG_DEF_METHOD(set_max_width, 1); RG_DEF_METHOD(set_max_height, 1); RG_DEF_METHOD(set_base_width, 1); RG_DEF_METHOD(set_base_height, 1); RG_DEF_METHOD(set_width_inc, 1); RG_DEF_METHOD(set_height_inc, 1); RG_DEF_METHOD(set_min_aspect, 1); RG_DEF_METHOD(set_max_aspect, 1); RG_DEF_METHOD(set_win_gravity, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcheckmenuitem.c��������������������������������������������0000644�0001750�0001750�00000003756�11701304107�021146� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCheckMenuItem static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, use_underline; GtkWidget *widget = NULL; if (rb_scan_args(argc, argv, "02", &label, &use_underline) > 0) { if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)){ widget = gtk_check_menu_item_new_with_mnemonic(RVAL2CSTR(label)); } else { widget = gtk_check_menu_item_new_with_label(RVAL2CSTR(label)); } } else { widget = gtk_check_menu_item_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_toggled(VALUE self) { gtk_check_menu_item_toggled(GTK_CHECK_MENU_ITEM(RVAL2GOBJ(self))); return self; } void Init_gtk_check_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CHECK_MENU_ITEM, "CheckMenuItem", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(toggled, 0); } ������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrecentinfo.c�����������������������������������������������0000644�0001750�0001750�00000012726�12257552167�020500� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRecentInfo #define _SELF(self) ((GtkRecentInfo*)RVAL2BOXED(self, GTK_TYPE_RECENT_INFO)) static VALUE rg_uri(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_uri(_SELF(self))); } static VALUE rg_display_name(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_display_name(_SELF(self))); } static VALUE rg_description(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_description(_SELF(self))); } static VALUE rg_mime_type(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_mime_type(_SELF(self))); } static VALUE rg_added(VALUE self) { time_t t = gtk_recent_info_get_added(_SELF(self)); return rb_funcall(rb_cTime, rb_intern("at"), 1, INT2NUM(t)); } static VALUE rg_modified(VALUE self) { time_t t = gtk_recent_info_get_modified(_SELF(self)); return rb_funcall(rb_cTime, rb_intern("at"), 1, INT2NUM(t)); } static VALUE rg_visited(VALUE self) { time_t t = gtk_recent_info_get_visited(_SELF(self)); return rb_funcall(rb_cTime, rb_intern("at"), 1, INT2NUM(t)); } static VALUE rg_private_hint_p(VALUE self) { return CBOOL2RVAL(gtk_recent_info_get_private_hint(_SELF(self))); } static VALUE rg_application_info(VALUE self, VALUE app_name) { const gchar *app_exec; guint count; time_t t; gboolean ret = gtk_recent_info_get_application_info(_SELF(self), RVAL2CSTR(app_name), &app_exec, &count, &t); VALUE ary = rb_ary_new(); if (ret){ rb_ary_push(ary, CSTR2RVAL(app_exec)); rb_ary_push(ary, UINT2NUM(count)); rb_ary_push(ary, rb_funcall(rb_cTime, rb_intern("at"), 1, INT2NUM(t))); } return ary; } static VALUE rg_applications(VALUE self) { gsize i; gsize length; gchar** str = gtk_recent_info_get_applications(_SELF(self), &length); VALUE ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, CSTR2RVAL(str[i])); } g_strfreev(str); return ary; } static VALUE rg_last_application(VALUE self) { return CSTR2RVAL(gtk_recent_info_last_application(_SELF(self))); } static VALUE rg_groups(VALUE self) { gsize i; gsize length; gchar** str = gtk_recent_info_get_groups(_SELF(self), &length); VALUE ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, CSTR2RVAL(str[i])); } g_strfreev(str); return ary; } static VALUE rg_has_group_p(VALUE self, VALUE group_name) { return CBOOL2RVAL(gtk_recent_info_has_group(_SELF(self), RVAL2CSTR(group_name))); } static VALUE rg_has_application_p(VALUE self, VALUE app_name) { return CBOOL2RVAL(gtk_recent_info_has_application(_SELF(self), RVAL2CSTR(app_name))); } static VALUE rg_get_icon(VALUE self, VALUE size) { return GOBJ2RVAL(gtk_recent_info_get_icon(_SELF(self), NUM2INT(size))); } static VALUE rg_short_name(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_short_name(_SELF(self))); } static VALUE rg_uri_display(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_uri_display(_SELF(self))); } static VALUE rg_age(VALUE self) { return INT2NUM(gtk_recent_info_get_age(_SELF(self))); } static VALUE rg_local_p(VALUE self) { return CBOOL2RVAL(gtk_recent_info_is_local(_SELF(self))); } static VALUE rg_exist_p(VALUE self) { return CBOOL2RVAL(gtk_recent_info_exists(_SELF(self))); } static VALUE rg_operator_ri_match(VALUE self, VALUE other) { return CBOOL2RVAL(gtk_recent_info_match(_SELF(self), _SELF(other))); } void Init_gtk_recent_info(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_INFO, "RecentInfo", mGtk); RG_DEF_METHOD(uri, 0); RG_DEF_METHOD(display_name, 0); RG_DEF_METHOD(description, 0); RG_DEF_METHOD(mime_type, 0); RG_DEF_METHOD(added, 0); RG_DEF_METHOD(modified, 0); RG_DEF_METHOD(visited, 0); RG_DEF_METHOD_P(private_hint, 0); RG_DEF_METHOD(application_info, 1); RG_DEF_METHOD(applications, 0); RG_DEF_METHOD(last_application, 0); RG_DEF_METHOD(groups, 0); RG_DEF_METHOD_P(has_group, 1); RG_DEF_METHOD_P(has_application, 1); RG_DEF_METHOD(get_icon, 1); RG_DEF_METHOD(short_name, 0); RG_DEF_METHOD(uri_display, 0); RG_DEF_METHOD(age, 0); RG_DEF_METHOD_P(local, 0); RG_DEF_METHOD_P(exist, 0); RG_DEF_METHOD_OPERATOR("==", ri_match, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkclipboard.c������������������������������������������������0000644�0001750�0001750�00000027334�12257552167�020304� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2006 Ruby-GNOME2 Project * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cClipboard #define _SELF(s) RVAL2CLIPBOARD(s) #ifndef GTK_TYPE_CLIPBOARD static GtkClipboard* clipboard_copy(const GtkClipboard *clipboard) { /* I don't know how to copy this object ... */ return (GtkClipboard*)clipboard; } GType rbgtk_clipboard_get_type() { static GType our_type = 0; if(our_type == 0) our_type = g_boxed_type_register_static("GtkClipboard", (GBoxedCopyFunc)clipboard_copy, (GBoxedFreeFunc)g_free); return our_type; } GtkClipboard* rbgtk_get_clipboard(VALUE obj) { return GTK_CLIPBOARD(RVAL2GOBJ(obj)); } VALUE rbgtk_make_clipboard(GtkClipboard *gobj) { return GOBJ2RVAL(gobj); } #endif static VALUE rg_s_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { GtkClipboard *clipboard; if (argc == 1){ VALUE selection; rb_scan_args(argc, argv, "10", &selection); clipboard = gtk_clipboard_get(RVAL2ATOM(selection)); } else { VALUE display, selection; rb_scan_args(argc, argv, "20", &display, &selection); clipboard = gtk_clipboard_get_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2ATOM(selection)); } return CLIPBOARD2RVAL(clipboard); } static VALUE rg_display(VALUE self) { return GOBJ2RVAL(gtk_clipboard_get_display(_SELF(self))); } static void clipboard_get_func(GtkClipboard *clipboard, GtkSelectionData *selection_data, G_GNUC_UNUSED guint info, gpointer func) { rb_funcall((VALUE)func, id_call, 2, CLIPBOARD2RVAL(clipboard), BOXED2RVAL(selection_data, GTK_TYPE_SELECTION_DATA)); } struct clipboard_set_args { VALUE self; VALUE targets; VALUE func; }; static VALUE clipboard_set_body(VALUE value) { struct clipboard_set_args *args = (struct clipboard_set_args *)value; GtkClipboard *clipboard = _SELF(args->self); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(args->targets, &n); gboolean result = gtk_clipboard_set_with_data(clipboard, targets, n, (GtkClipboardGetFunc)clipboard_get_func, (GtkClipboardClearFunc)NULL, (gpointer)args->func); g_free(targets); return CBOOL2RVAL(result); } static G_GNUC_NORETURN VALUE clipboard_set_rescue(VALUE value) { struct clipboard_set_args *args = (struct clipboard_set_args *)value; G_CHILD_REMOVE(args->self, args->func); rb_exc_raise(rb_errinfo()); } static VALUE rg_set(VALUE self, VALUE targets) { struct clipboard_set_args args = { self, targets, rb_block_proc() }; G_CHILD_ADD(self, args.func); return rb_rescue(clipboard_set_body, (VALUE)&args, clipboard_set_rescue, (VALUE)&args); } /* Do not implement this. Use Gtk::Clipboard#set_with_data instead. gboolean gtk_clipboard_set_with_owner (GtkClipboard *clipboard, const GtkTargetEntry *targets, guint n_targets, GtkClipboardGetFunc get_func, GtkClipboardClearFunc clear_func, GObject *owner); static VALUE rg_owner(VALUE self) { GObject *gobj; gobj = gtk_clipboard_get_owner(_SELF(self)); return gobj ? GOBJ2RVAL(gobj) : Qnil; } */ static VALUE rg_clear(VALUE self) { gtk_clipboard_clear(_SELF(self)); return self; } static VALUE rg_set_text(VALUE self, VALUE text) { StringValue(text); gtk_clipboard_set_text(_SELF(self), RVAL2CSTR(text), RSTRING_LEN(text)); return self; } static VALUE rg_set_image(VALUE self, VALUE pixbuf) { gtk_clipboard_set_image(_SELF(self), GDK_PIXBUF(RVAL2GOBJ(pixbuf))); return self; } static void clipboard_received_func(GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer func) { rb_funcall((VALUE)func, id_call, 2, CLIPBOARD2RVAL(clipboard), BOXED2RVAL(selection_data, GTK_TYPE_SELECTION_DATA)); } static VALUE rg_request_contents(VALUE self, VALUE target) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_clipboard_request_contents(_SELF(self), RVAL2ATOM(target), (GtkClipboardReceivedFunc)clipboard_received_func, (gpointer)func); return self; } static void clipboard_text_received_func(GtkClipboard *clipboard, const gchar *text, gpointer func) { VALUE vtext = Qnil; if (text) { vtext = CSTR2RVAL(text); } rb_funcall((VALUE)func, id_call, 2, CLIPBOARD2RVAL(clipboard), vtext); } static VALUE rg_request_text(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_clipboard_request_text(_SELF(self), (GtkClipboardTextReceivedFunc)clipboard_text_received_func, (gpointer)func); return self; } static void clipboard_image_received_func(GtkClipboard *clipboard, GdkPixbuf *pixbuf, gpointer func) { rb_funcall((VALUE)func, id_call, 2, CLIPBOARD2RVAL(clipboard), GOBJ2RVAL(pixbuf)); } static VALUE rg_request_image(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_clipboard_request_image(_SELF(self), (GtkClipboardImageReceivedFunc)clipboard_image_received_func, (gpointer)func); return self; } static void clipboard_target_received_func(GtkClipboard *clipboard, GdkAtom *atoms, gint n_atoms, gpointer func) { gint i; VALUE ary = rb_ary_new(); for (i = 0; i < n_atoms; i++){ rb_ary_push(ary, BOXED2RVAL(atoms[i], GDK_TYPE_ATOM)); } rb_funcall((VALUE)func, id_call, 2, CLIPBOARD2RVAL(clipboard), ary); } static VALUE rg_request_targets(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_clipboard_request_targets(_SELF(self), (GtkClipboardTargetsReceivedFunc)clipboard_target_received_func, (gpointer)func); return self; } static void clipboard_rich_text_received_func(GtkClipboard *clipboard, GdkAtom format, const guint8 *text, gsize length, gpointer func) { rb_funcall((VALUE)func, id_call, 3, CLIPBOARD2RVAL(clipboard), BOXED2RVAL(format, GDK_TYPE_ATOM), rb_str_new((char*)text, length)); } static VALUE rg_request_rich_text(VALUE self, VALUE buffer) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_clipboard_request_rich_text(_SELF(self), GTK_TEXT_BUFFER(RVAL2GOBJ(buffer)), (GtkClipboardRichTextReceivedFunc)clipboard_rich_text_received_func, (gpointer)func); return self; } static VALUE rg_wait_for_contents(VALUE self, VALUE target) { return BOXED2RVAL(gtk_clipboard_wait_for_contents( _SELF(self), RVAL2ATOM(target)), GTK_TYPE_SELECTION_DATA); } static VALUE rg_wait_for_text(VALUE self) { gchar *str; str = gtk_clipboard_wait_for_text(_SELF(self)); return str ? CSTR2RVAL(str) : Qnil; } static VALUE rg_wait_for_image(VALUE self) { GdkPixbuf* pixbuf = gtk_clipboard_wait_for_image(_SELF(self)); return GOBJ2RVAL(pixbuf); } static VALUE rg_wait_for_rich_text(VALUE self, VALUE buffer) { GdkAtom format; gsize length; guint8* data = gtk_clipboard_wait_for_rich_text(_SELF(self), GTK_TEXT_BUFFER(RVAL2GOBJ(buffer)), &format, &length); if (data){ VALUE str = rb_str_new((char*)data, length); g_free(data); return rb_assoc_new(str, BOXED2RVAL(format, GDK_TYPE_ATOM)); } else { return rb_assoc_new(Qnil, BOXED2RVAL(format, GDK_TYPE_ATOM)); } } static VALUE rg_wait_is_text_available_p(VALUE self) { return CBOOL2RVAL(gtk_clipboard_wait_is_text_available(_SELF(self))); } static VALUE rg_wait_is_image_available_p(VALUE self) { return CBOOL2RVAL(gtk_clipboard_wait_is_image_available(_SELF(self))); } static VALUE rg_wait_is_rich_text_available_p(VALUE self, VALUE buffer) { return CBOOL2RVAL(gtk_clipboard_wait_is_rich_text_available(_SELF(self), GTK_TEXT_BUFFER(RVAL2GOBJ(buffer)))); } static VALUE rg_wait_for_targets(VALUE self) { gint i; VALUE ary = Qnil; GdkAtom* targets; gint n_targets = 0; gboolean ret = gtk_clipboard_wait_for_targets(_SELF(self), &targets, &n_targets); if (ret){ ary = rb_ary_new(); for (i = 0; i < n_targets; i++){ if ((GdkAtom)targets == (GdkAtom)GDK_NONE){ rb_ary_push(ary, rb_eval_string("Gdk::Atom::NONE")); } else rb_ary_push(ary, BOXED2RVAL(targets, GDK_TYPE_ATOM)); targets++; } /* How can I this ? g_free(&o_targets); */ } return ary; } static VALUE rg_wait_is_target_available_p(VALUE self, VALUE target) { return CBOOL2RVAL(gtk_clipboard_wait_is_target_available(_SELF(self), RVAL2ATOM(target))); } static VALUE rg_set_can_store(VALUE self, VALUE rbtargets) { GtkClipboard *clipboard = _SELF(self); long n = 0; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES_ACCEPT_NIL(rbtargets, &n); gtk_clipboard_set_can_store(clipboard, targets, n); g_free(targets); return self; } static VALUE rg_store(VALUE self) { gtk_clipboard_store(_SELF(self)); return self; } void Init_gtk_clipboard(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CLIPBOARD, "Clipboard", mGtk); RG_DEF_SMETHOD(get, -1); RG_DEF_METHOD(display, 0); RG_DEF_METHOD(set, 1); /* RG_DEF_METHOD(owner, 0); */ RG_DEF_METHOD(clear, 0); RG_DEF_METHOD(set_text, 1); RG_DEF_METHOD(set_image, 1); RG_DEF_METHOD(request_contents, 1); RG_DEF_METHOD(request_text, 0); RG_DEF_METHOD(request_image, 0); RG_DEF_METHOD(request_targets, 0); RG_DEF_METHOD(request_rich_text, 1); RG_DEF_METHOD(wait_for_contents, 1); RG_DEF_METHOD(wait_for_text, 0); RG_DEF_METHOD(wait_for_image, 0); RG_DEF_METHOD(wait_for_rich_text, 1); RG_DEF_METHOD_P(wait_is_text_available, 0); RG_DEF_METHOD_P(wait_is_image_available, 0); RG_DEF_METHOD_P(wait_is_rich_text_available, 1); RG_DEF_METHOD(wait_for_targets, 0); RG_DEF_METHOD_P(wait_is_target_available, 1); RG_DEF_METHOD(set_can_store, 1); RG_DEF_METHOD(store, 0); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkalignment.c������������������������������������������������0000644�0001750�0001750�00000005116�12257552167�020315� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAlignment static VALUE rg_initialize(VALUE self, VALUE xalign, VALUE yalign, VALUE xscale, VALUE yscale) { RBGTK_INITIALIZE(self, gtk_alignment_new(NUM2DBL(xalign), NUM2DBL(yalign), NUM2DBL(xscale), NUM2DBL(yscale))); return Qnil; } static VALUE rg_set(VALUE self, VALUE xalign, VALUE yalign, VALUE xscale, VALUE yscale) { gtk_alignment_set(GTK_ALIGNMENT(RVAL2GOBJ(self)), NUM2DBL(xalign), NUM2DBL(yalign), NUM2DBL(xscale), NUM2DBL(yscale)); return self; } static VALUE rg_padding(VALUE self) { guint top, bottom, left, right; gtk_alignment_get_padding(GTK_ALIGNMENT(RVAL2GOBJ(self)), &top, &bottom, &left, &right); return rb_ary_new3(4, UINT2NUM(top), UINT2NUM(bottom), UINT2NUM(left), UINT2NUM(right)); } static VALUE rg_set_padding(VALUE self, VALUE top, VALUE bottom, VALUE left, VALUE right) { gtk_alignment_set_padding(GTK_ALIGNMENT(RVAL2GOBJ(self)), NUM2UINT(top), NUM2UINT(bottom), NUM2UINT(left), NUM2UINT(right)); return self; } void Init_gtk_alignment(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ALIGNMENT, "Alignment", mGtk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(set, 4); RG_DEF_METHOD(padding, 0); RG_DEF_METHOD(set_padding, 4); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkmessagedialog.c��������������������������������������������0000644�0001750�0001750�00000007001�12257552167�021136� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cMessageDialog #define _SELF(s) (GTK_MESSAGE_DIALOG(RVAL2GOBJ(s))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE parent, flags, type, buttons, message; GtkWidget* w; rb_scan_args(argc, argv, "41", &parent, &flags, &type, &buttons, &message); w = gtk_message_dialog_new(NIL_P(parent) ? NULL : GTK_WINDOW(RVAL2GOBJ(parent)), RVAL2GFLAGS(flags, GTK_TYPE_DIALOG_FLAGS), RVAL2GENUM(type, GTK_TYPE_MESSAGE_TYPE), RVAL2GENUM(buttons, GTK_TYPE_BUTTONS_TYPE), "%s", NIL_P(message) ? "": RVAL2CSTR(message)); RBGTK_INITIALIZE(self, w); return Qnil; } /* Don't implement. Use Gtk::MessageDialog#set_markup. GtkWidget* gtk_message_dialog_new_with_markup (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...); */ static VALUE rg_set_markup(VALUE self, VALUE str) { gtk_message_dialog_set_markup(_SELF(self), RVAL2CSTR(str)); return self; } /* Not needed in Ruby void gtk_message_dialog_format_secondary_text (GtkMessageDialog *message_dialog, const gchar *message_format, ...); void gtk_message_dialog_format_secondary_markup (GtkMessageDialog *message_dialog, const gchar *message_format, ...); */ void Init_gtk_message_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MESSAGE_DIALOG, "MessageDialog", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_markup, 1); G_DEF_SETTER(RG_TARGET_NAMESPACE, "markup"); /* GtkMessageType */ G_DEF_CLASS(GTK_TYPE_MESSAGE_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_MESSAGE_TYPE, "GTK_MESSAGE_"); /* GtkButtonsType */ G_DEF_CLASS(GTK_TYPE_BUTTONS_TYPE, "ButtonsType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_BUTTONS_TYPE, "GTK_"); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkstyle.c����������������������������������������������������0000644�0001750�0001750�00000057262�12257552167�017510� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cStyle #define _SELF(w) GTK_STYLE(RVAL2GOBJ(w)) #define RVAL2REC(r) (NIL_P(r) ? NULL : (GdkRectangle*)RVAL2BOXED(r, GDK_TYPE_RECTANGLE)) #define RVAL2ICONSOURCE(s) ((GtkIconSource*)RVAL2BOXED(s, GTK_TYPE_ICON_SOURCE)) #define RVAL2STATE(s) (RVAL2GENUM(s, GTK_TYPE_STATE_TYPE)) #define RVAL2SHADOW(s) (RVAL2GENUM(s, GTK_TYPE_SHADOW_TYPE)) #define RVAL2ARROW(s) (RVAL2GENUM(s, GTK_TYPE_ARROW_TYPE)) #define RVAL2GAP(s) (RVAL2GENUM(s, GTK_TYPE_POSITION_TYPE)) #define RVAL2ORI(s) (RVAL2GENUM(s, GTK_TYPE_ORIENTATION)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_style_new()); return Qnil; } static VALUE rg_attached_p(VALUE self) { return CBOOL2RVAL(GTK_STYLE_ATTACHED(_SELF(self))); } static VALUE rg_copy(VALUE self) { return GOBJ2RVAL(gtk_style_copy(_SELF(self))); } static VALUE rg_attach(VALUE self, VALUE win) { return GOBJ2RVAL(gtk_style_attach(_SELF(self), GDK_WINDOW(RVAL2GOBJ(win)))); } static VALUE rg_detach(VALUE self) { gtk_style_detach(_SELF(self)); return self; } static VALUE rg_set_background(VALUE self, VALUE win, VALUE state_type) { gtk_style_set_background(_SELF(self), GDK_WINDOW(RVAL2GOBJ(win)), RVAL2STATE(state_type)); return self; } static VALUE rg_apply_default_background(VALUE self, VALUE gdkwindow, VALUE set_bg, VALUE state_type, VALUE area, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_style_apply_default_background(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2CBOOL(set_bg), RVAL2STATE(state_type), RVAL2REC(area), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_lookup_color(VALUE self, VALUE color_name) { GdkColor color; if (gtk_style_lookup_color(_SELF(self), RVAL2CSTR(color_name), &color)){ return GDKCOLOR2RVAL(&color); } else { return Qnil; } } static VALUE rg_lookup_icon_set(VALUE self, VALUE stock_id) { const gchar *id; GtkIconSet *ret; if (TYPE(stock_id) == T_STRING) { id = RVAL2CSTR(stock_id); } else { id = rb_id2name(SYM2ID(stock_id)); } ret = gtk_style_lookup_icon_set(_SELF(self), id); return BOXED2RVAL(ret, GTK_TYPE_ICON_SET); } static VALUE rg_render_icon(VALUE self, VALUE source, VALUE direction, VALUE state, VALUE size, VALUE widget, VALUE detail) { return GOBJ2RVAL(gtk_style_render_icon(_SELF(self), RVAL2ICONSOURCE(source), RVAL2GENUM(direction, GTK_TYPE_TEXT_DIRECTION), RVAL2STATE(state), RVAL2GENUM(size, GTK_TYPE_ICON_SIZE), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail))); } static VALUE rg_paint_arrow(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE arrow_type, VALUE fill, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_arrow(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail), RVAL2ARROW(arrow_type), RVAL2CBOOL(fill), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_paint_box(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_box(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_paint_box_gap(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height, VALUE gap_side, VALUE gap_x, VALUE gap_width) { gtk_paint_box_gap(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height), RVAL2GAP(gap_side), NUM2INT(gap_x), NUM2INT(gap_width)); return self; } static VALUE rg_paint_check(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_check(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_paint_diamond(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_diamond(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_paint_extension(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height, VALUE gap_side) { gtk_paint_extension(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height), RVAL2GAP(gap_side)); return self; } static VALUE rg_paint_flat_box(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_flat_box(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_paint_focus(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_focus(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_paint_handle(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height, VALUE orientation) { gtk_paint_handle(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height), RVAL2ORI(orientation)); return self; } static VALUE rg_paint_hline(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE area, VALUE widget, VALUE detail, VALUE x1, VALUE x2, VALUE y) { gtk_paint_hline(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), RVAL2CSTR(detail), NUM2INT(x1), NUM2INT(x2), NUM2INT(y)); return self; } static VALUE rg_paint_option(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_option(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_paint_polygon(VALUE self, VALUE rbwindow, VALUE rbstate_type, VALUE rbshadow_type, VALUE rbarea, VALUE rbwidget, VALUE rbdetail, VALUE rbpoints, VALUE rbfill) { GtkStyle *style = _SELF(self); GdkWindow *window = GDK_WINDOW(RVAL2GOBJ(rbwindow)); GtkStateType state_type = RVAL2STATE(rbstate_type); GtkShadowType shadow_type = RVAL2SHADOW(rbshadow_type); GdkRectangle *area = RVAL2REC(rbarea); GtkWidget *widget = GTK_WIDGET(RVAL2GOBJ(rbwidget)); const gchar *detail = RVAL2CSTR_ACCEPT_NIL(rbdetail); gboolean fill = RVAL2CBOOL(rbfill); long n; GdkPoint *points = RVAL2GDKPOINTS(rbpoints, &n); gtk_paint_polygon(style, window, state_type, shadow_type, area, widget, detail, points, n, fill); g_free(points); return self; } static VALUE rg_paint_shadow(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_shadow(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_paint_shadow_gap(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height, VALUE gap_side, VALUE gap_x, VALUE gap_width) { gtk_paint_shadow_gap(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height), RVAL2GAP(gap_side), NUM2INT(gap_x), NUM2INT(gap_width)); return self; } static VALUE rg_paint_slider(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height, VALUE orientation) { gtk_paint_slider(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height), RVAL2ORI(orientation)); return self; } static VALUE rg_paint_tab(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE shadow_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_tab(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2SHADOW(shadow_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_paint_vline(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE area, VALUE widget, VALUE detail, VALUE y1, VALUE y2, VALUE x) { gtk_paint_vline(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), NUM2INT(y1), NUM2INT(y2), NUM2INT(x)); return self; } static VALUE rg_paint_expander(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE expander_style) { gtk_paint_expander(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), RVAL2GENUM(expander_style, GTK_TYPE_EXPANDER_STYLE)); return self; } static VALUE rg_paint_layout(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE use_text, VALUE area, VALUE widget, VALUE detail, VALUE x, VALUE y, VALUE layout) { gtk_paint_layout(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2CBOOL(use_text), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), NUM2INT(x), NUM2INT(y), PANGO_LAYOUT(RVAL2GOBJ(layout))); return self; } static VALUE rg_paint_resize_grip(VALUE self, VALUE gdkwindow, VALUE state_type, VALUE area, VALUE widget, VALUE detail, VALUE edge, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_paint_resize_grip(_SELF(self), GDK_WINDOW(RVAL2GOBJ(gdkwindow)), RVAL2STATE(state_type), RVAL2REC(area), GTK_WIDGET(RVAL2GOBJ(widget)), NIL_P(detail) ? NULL : RVAL2CSTR(detail), RVAL2GENUM(edge, GDK_TYPE_WINDOW_EDGE), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_s_draw_insertion_cursor(VALUE self, VALUE widget, VALUE drawable, VALUE area, VALUE location, VALUE is_primary, VALUE direction, VALUE draw_arrow) { gtk_draw_insertion_cursor(GTK_WIDGET(RVAL2GOBJ(widget)), GDK_WINDOW(RVAL2GOBJ(drawable)), RVAL2REC(area), RVAL2REC(location), RVAL2CBOOL(is_primary), RVAL2GENUM(direction, GTK_TYPE_TEXT_DIRECTION), RVAL2CBOOL(draw_arrow)); return self; } #define DEFINE_STYLE_COLOR(type) \ static VALUE \ style_set_ ## type(VALUE self, VALUE idx, VALUE r, VALUE g, VALUE b) \ { \ GdkColor *color; \ int i = NUM2INT(idx); \ \ if (i < 0 || 5 < i) rb_raise(rb_eArgError, "state out of range"); \ color = &(_SELF(self) -> type [i]); \ color->red = NUM2INT(r); \ color->green = NUM2INT(g); \ color->blue = NUM2INT(b); \ return self; \ } \ static VALUE \ style_ ## type(VALUE self, VALUE idx) \ { \ int i = NUM2INT(idx); \ \ if (i < 0 || 5 < i) rb_raise(rb_eArgError, "state out of range"); \ return BOXED2RVAL(&_SELF(self)-> type [i], GDK_TYPE_COLOR); \ } \ DEFINE_STYLE_COLOR(fg); DEFINE_STYLE_COLOR(bg); DEFINE_STYLE_COLOR(light); DEFINE_STYLE_COLOR(dark); DEFINE_STYLE_COLOR(mid); DEFINE_STYLE_COLOR(text); DEFINE_STYLE_COLOR(base); DEFINE_STYLE_COLOR(text_aa); static VALUE rg_black(VALUE self) { return BOXED2RVAL(&_SELF(self)->black, GDK_TYPE_COLOR); } static VALUE rg_set_black(VALUE self, VALUE r, VALUE g, VALUE b) { GdkColor* color = &(_SELF(self)->black); color->red = NUM2INT(r); color->green = NUM2INT(g); color->blue = NUM2INT(b); return self; } static VALUE rg_white(VALUE self) { return BOXED2RVAL(&_SELF(self)->white, GDK_TYPE_COLOR); } static VALUE rg_set_white(VALUE self, VALUE r, VALUE g, VALUE b) { GdkColor* color = &(_SELF(self)->white); color->red = NUM2INT(r); color->green = NUM2INT(g); color->blue = NUM2INT(b); return self; } static VALUE rg_font_desc(VALUE self) { PangoFontDescription* desc = _SELF(self)->font_desc; return BOXED2RVAL(desc, PANGO_TYPE_FONT_DESCRIPTION); } static VALUE rg_set_font_desc(VALUE self, VALUE font_desc) { GtkStyle *style = _SELF(self); if (style->font_desc) pango_font_description_free(style->font_desc); style->font_desc = pango_font_description_copy((PangoFontDescription*)RVAL2BOXED(font_desc, PANGO_TYPE_FONT_DESCRIPTION)); return self; } static VALUE rg_xthickness(VALUE self) { return INT2NUM(_SELF(self)->xthickness); } static VALUE rg_set_xthickness(VALUE self, VALUE xthickness) { _SELF(self)->xthickness = NUM2INT(xthickness); return self; } static VALUE rg_ythickness(VALUE self) { return INT2NUM(_SELF(self)->ythickness); } static VALUE rg_set_ythickness(VALUE self, VALUE ythickness) { _SELF(self)->ythickness = NUM2INT(ythickness); return self; } #define DEFINE_STYLE_GC(type) \ static VALUE \ style_set_ ## type(VALUE self, VALUE idx, VALUE gc) \ { \ int i = NUM2INT(idx); \ \ if (i < 0 || 5 < i) rb_raise(rb_eArgError, "state out of range"); \ _SELF(self)-> type [i] = GDK_GC(RVAL2GOBJ(gc));\ return self;\ } \ static VALUE \ style_ ## type(VALUE self, VALUE idx) \ { \ int i = NUM2INT(idx); \ \ if (i < 0 || 5 < i) rb_raise(rb_eArgError, "state out of range"); \ return GOBJ2RVAL(_SELF(self)-> type [i]); \ } \ DEFINE_STYLE_GC(fg_gc); DEFINE_STYLE_GC(bg_gc); DEFINE_STYLE_GC(light_gc); DEFINE_STYLE_GC(dark_gc); DEFINE_STYLE_GC(mid_gc); DEFINE_STYLE_GC(text_gc); DEFINE_STYLE_GC(base_gc); DEFINE_STYLE_GC(text_aa_gc); static VALUE rg_black_gc(VALUE self) { return GOBJ2RVAL(_SELF(self)->black_gc); } static VALUE rg_set_black_gc(VALUE self, VALUE gc) { _SELF(self)->black_gc = GDK_GC(RVAL2GOBJ(gc)); return self; } static VALUE rg_white_gc(VALUE self) { return GOBJ2RVAL(_SELF(self)->white_gc); } static VALUE rg_set_white_gc(VALUE self, VALUE gc) { _SELF(self)->white_gc = GDK_GC(RVAL2GOBJ(gc)); return self; } static VALUE rg_bg_pixmap(VALUE self, VALUE idx) { int i = NUM2INT(idx); if (i < 0 || 5 < i) rb_raise(rb_eArgError, "state out of range"); return GOBJ2RVAL(_SELF(self)->bg_pixmap[i]); } static VALUE rg_set_bg_pixmap(VALUE self, VALUE idx, VALUE bg_pixmap) { int i = NUM2INT(idx); GdkPixmap* pixmap = RVAL2GOBJ(bg_pixmap); g_object_ref(G_OBJECT(pixmap)); if (i < 0 || 5 < i) rb_raise(rb_eArgError, "state out of range"); _SELF(self)->bg_pixmap[i] = pixmap; return self; } void Init_gtk_style(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_STYLE, "Style", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD_P(attached, 0); RG_DEF_METHOD(copy, 0); RG_DEF_ALIAS("clone", "copy"); RG_DEF_ALIAS("dup", "copy"); RG_DEF_METHOD(attach, 1); RG_DEF_METHOD(detach, 0); RG_DEF_METHOD(set_background, 2); RG_DEF_METHOD(apply_default_background, 8); RG_DEF_METHOD(lookup_color, 1); RG_DEF_METHOD(lookup_icon_set, 1); RG_DEF_METHOD(render_icon, 6); RG_DEF_METHOD(paint_arrow, 12); RG_DEF_METHOD(paint_box, 10); RG_DEF_METHOD(paint_box_gap, 13); RG_DEF_METHOD(paint_check, 10); RG_DEF_METHOD(paint_diamond, 10); RG_DEF_METHOD(paint_extension, 10); RG_DEF_METHOD(paint_flat_box, 10); RG_DEF_METHOD(paint_focus, 9); RG_DEF_METHOD(paint_handle, 11); RG_DEF_METHOD(paint_hline, 8); RG_DEF_METHOD(paint_option, 10); RG_DEF_METHOD(paint_polygon, 8); RG_DEF_METHOD(paint_shadow, 10); RG_DEF_METHOD(paint_shadow_gap, 13); RG_DEF_METHOD(paint_slider, 11); RG_DEF_METHOD(paint_tab, 10); RG_DEF_METHOD(paint_vline, 9); RG_DEF_METHOD(paint_expander, 8); RG_DEF_METHOD(paint_layout, 9); RG_DEF_METHOD(paint_resize_grip, 10); RG_DEF_SMETHOD(draw_insertion_cursor, 7); rb_define_method(RG_TARGET_NAMESPACE, "fg", style_fg, 1); rb_define_method(RG_TARGET_NAMESPACE, "bg", style_bg, 1); rb_define_method(RG_TARGET_NAMESPACE, "light", style_light, 1); rb_define_method(RG_TARGET_NAMESPACE, "dark", style_dark, 1); rb_define_method(RG_TARGET_NAMESPACE, "mid", style_mid, 1); rb_define_method(RG_TARGET_NAMESPACE, "text", style_text, 1); rb_define_method(RG_TARGET_NAMESPACE, "base", style_base, 1); rb_define_method(RG_TARGET_NAMESPACE, "text_aa", style_text_aa, 1); rb_define_method(RG_TARGET_NAMESPACE, "set_fg", style_set_fg, 4); rb_define_method(RG_TARGET_NAMESPACE, "set_bg", style_set_bg, 4); rb_define_method(RG_TARGET_NAMESPACE, "set_light", style_set_light, 4); rb_define_method(RG_TARGET_NAMESPACE, "set_dark", style_set_dark, 4); rb_define_method(RG_TARGET_NAMESPACE, "set_mid", style_set_mid, 4); rb_define_method(RG_TARGET_NAMESPACE, "set_text", style_set_text, 4); rb_define_method(RG_TARGET_NAMESPACE, "set_base", style_set_base, 4); rb_define_method(RG_TARGET_NAMESPACE, "set_text_aa", style_set_text_aa, 4); RG_DEF_METHOD(black, 0); RG_DEF_METHOD(set_black, 3); RG_DEF_METHOD(white, 0); RG_DEF_METHOD(set_white, 3); RG_DEF_METHOD(font_desc, 0); RG_DEF_METHOD(set_font_desc, 1); RG_DEF_METHOD(xthickness, 0); RG_DEF_METHOD(ythickness, 0); RG_DEF_METHOD(set_xthickness, 1); RG_DEF_METHOD(set_ythickness, 1); rb_define_method(RG_TARGET_NAMESPACE, "fg_gc", style_fg_gc, 1); rb_define_method(RG_TARGET_NAMESPACE, "bg_gc", style_bg_gc, 1); rb_define_method(RG_TARGET_NAMESPACE, "light_gc", style_light_gc, 1); rb_define_method(RG_TARGET_NAMESPACE, "dark_gc", style_dark_gc, 1); rb_define_method(RG_TARGET_NAMESPACE, "mid_gc", style_mid_gc, 1); rb_define_method(RG_TARGET_NAMESPACE, "text_gc", style_text_gc, 1); rb_define_method(RG_TARGET_NAMESPACE, "base_gc", style_base_gc, 1); rb_define_method(RG_TARGET_NAMESPACE, "text_aa_gc", style_text_aa_gc, 1); RG_DEF_METHOD(black_gc, 0); RG_DEF_METHOD(white_gc, 0); RG_DEF_METHOD(bg_pixmap, 1); rb_define_method(RG_TARGET_NAMESPACE, "set_fg_gc", style_set_fg_gc, 2); rb_define_method(RG_TARGET_NAMESPACE, "set_bg_gc", style_set_bg_gc, 2); rb_define_method(RG_TARGET_NAMESPACE, "set_light_gc", style_set_light_gc, 2); rb_define_method(RG_TARGET_NAMESPACE, "set_dark_gc", style_set_dark_gc, 2); rb_define_method(RG_TARGET_NAMESPACE, "set_mid_gc", style_set_mid_gc, 2); rb_define_method(RG_TARGET_NAMESPACE, "set_text_gc", style_set_text_gc, 2); rb_define_method(RG_TARGET_NAMESPACE, "set_base_gc", style_set_base_gc, 2); rb_define_method(RG_TARGET_NAMESPACE, "set_text_aa_gc", style_set_text_aa_gc, 2); RG_DEF_METHOD(set_black_gc, 1); RG_DEF_METHOD(set_white_gc, 1); RG_DEF_METHOD(set_bg_pixmap, 2); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkimage.c����������������������������������������������������0000644�0001750�0001750�00000011565�12257552167�017426� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cImage #define _SELF(s) (GTK_IMAGE(RVAL2GOBJ(s))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2; GType gtype; GtkWidget* widget = NULL; rb_scan_args(argc, argv, "02", &arg1, &arg2); if (NIL_P(arg1)){ widget = gtk_image_new(); } else if (TYPE(arg1) == T_STRING && argc == 1){ widget = gtk_image_new_from_file(RVAL2CSTR(arg1)); } else if (TYPE(arg1) == T_SYMBOL){ widget = gtk_image_new_from_stock(rb_id2name(SYM2ID(arg1)), RVAL2GENUM(arg2, GTK_TYPE_ICON_SIZE)); } else if (TYPE(arg1) == T_STRING){ widget = gtk_image_new_from_icon_name(RVAL2CSTR(arg1), RVAL2GENUM(arg2, GTK_TYPE_ICON_SIZE)); } else { gtype = RVAL2GTYPE(arg1); if (gtype == GDK_TYPE_IMAGE){ widget = gtk_image_new_from_image(GDK_IMAGE(RVAL2GOBJ(arg1)), GDK_BITMAP(RVAL2GOBJ(arg2))); } else if (gtype == GDK_TYPE_PIXBUF){ widget = gtk_image_new_from_pixbuf(GDK_PIXBUF(RVAL2GOBJ(arg1))); } else if (gtype == GDK_TYPE_PIXMAP){ widget = gtk_image_new_from_pixmap(GDK_PIXMAP(RVAL2GOBJ(arg1)), GDK_BITMAP(RVAL2GOBJ(arg2))); } else if (gtype == GTK_TYPE_ICON_SET){ widget = gtk_image_new_from_icon_set((GtkIconSet*)RVAL2BOXED(arg1, GTK_TYPE_ICON_SET), RVAL2GENUM(arg2, GTK_TYPE_ICON_SIZE)); } else if (g_type_is_a(gtype, GDK_TYPE_PIXBUF_ANIMATION)) { widget = gtk_image_new_from_animation(GDK_PIXBUF_ANIMATION(RVAL2GOBJ(arg1))); } } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_set(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2; GType gtype; rb_scan_args(argc, argv, "11", &arg1, &arg2); if (TYPE(arg1) == T_STRING && argc == 1){ gtk_image_set_from_file(_SELF(self), RVAL2CSTR(arg1)); } else if (TYPE(arg1) == T_SYMBOL){ gtk_image_set_from_stock(_SELF(self), rb_id2name(SYM2ID(arg1)), RVAL2GENUM(arg2, GTK_TYPE_ICON_SIZE)); } else if (TYPE(arg1) == T_STRING){ gtk_image_set_from_icon_name(_SELF(self), RVAL2CSTR(arg1), RVAL2GENUM(arg2, GTK_TYPE_ICON_SIZE)); } else { gtype = RVAL2GTYPE(arg1); if (gtype == GDK_TYPE_IMAGE){ gtk_image_set_from_image(_SELF(self), GDK_IMAGE(RVAL2GOBJ(arg1)), GDK_BITMAP(RVAL2GOBJ(arg2))); } else if (gtype == GDK_TYPE_PIXBUF){ gtk_image_set_from_pixbuf(_SELF(self), GDK_PIXBUF(RVAL2GOBJ(arg1))); } else if (gtype == GDK_TYPE_PIXMAP){ gtk_image_set_from_pixmap(_SELF(self), GDK_PIXMAP(RVAL2GOBJ(arg1)), GDK_BITMAP(RVAL2GOBJ(arg2))); } else if (gtype == GTK_TYPE_ICON_SET){ gtk_image_set_from_icon_set(_SELF(self), (GtkIconSet*)RVAL2BOXED(arg1, GTK_TYPE_ICON_SET), RVAL2GENUM(arg2, GTK_TYPE_ICON_SIZE)); } else if (g_type_is_a(gtype, GDK_TYPE_PIXBUF_ANIMATION)) { gtk_image_set_from_animation(_SELF(self), GDK_PIXBUF_ANIMATION(RVAL2GOBJ(arg1))); } else { rb_raise(rb_eArgError, "invalid argument: %s", rb_class2name(arg1)); } } return self; } static VALUE rg_clear(VALUE self) { gtk_image_clear(_SELF(self)); return self; } void Init_gtk_image(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_IMAGE, "Image", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set, -1); RG_DEF_METHOD(clear, 0); /* GtkImageType */ G_DEF_CLASS(GTK_TYPE_IMAGE_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_IMAGE_TYPE, "GTK_IMAGE_"); G_SET_SYMBOL_PROPERTY(GTK_TYPE_IMAGE, "stock"); } �������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkfilesel.c��������������������������������������������������0000644�0001750�0001750�00000007166�11701304107�017747� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cFileSelection #define _SELF(self) GTK_FILE_SELECTION(RVAL2GOBJ(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE title; rb_scan_args(argc, argv, "01", &title); RBGTK_INITIALIZE(self, gtk_file_selection_new(NIL_P(title) ? NULL : RVAL2CSTR(title))); return Qnil; } static VALUE rg_complete(VALUE self, VALUE pattern) { gtk_file_selection_complete(_SELF(self), RVAL2CSTR(pattern)); return self; } static VALUE rg_show_fileop_buttons(VALUE self) { gtk_file_selection_show_fileop_buttons(_SELF(self)); return Qnil; } static VALUE rg_hide_fileop_buttons(VALUE self) { gtk_file_selection_hide_fileop_buttons(_SELF(self)); return Qnil; } static VALUE rg_selections(VALUE self) { gchar** ptr = gtk_file_selection_get_selections(_SELF(self)); gchar** selections = ptr; VALUE ary = rb_ary_new(); while(*selections){ rb_ary_push(ary, CSTR2RVAL(*selections)); selections++; } if (ptr) g_strfreev(ptr); return ary; } static VALUE rg_fileop_dialog(VALUE self) { GtkWidget* widget = _SELF(self)->fileop_dialog; return widget ? GOBJ2RVAL(widget) : Qnil; } static VALUE rg_dir_list(VALUE self) { return GOBJ2RVAL(_SELF(self)->dir_list); } static VALUE rg_file_list(VALUE self) { return GOBJ2RVAL(_SELF(self)->file_list); } static VALUE rg_ok_button(VALUE self) { return GOBJ2RVAL(_SELF(self)->ok_button); } static VALUE rg_cancel_button(VALUE self) { return GOBJ2RVAL(_SELF(self)->cancel_button); } static VALUE rg_history_pulldown(VALUE self) { return GOBJ2RVAL(_SELF(self)->history_pulldown); } static VALUE rg_fileop_c_dir(VALUE self) { return GOBJ2RVAL(_SELF(self)->fileop_c_dir); } static VALUE rg_fileop_del_file(VALUE self) { return GOBJ2RVAL(_SELF(self)->fileop_del_file); } static VALUE rg_fileop_ren_file(VALUE self) { return GOBJ2RVAL(_SELF(self)->fileop_ren_file); } void Init_gtk_file_selection(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FILE_SELECTION, "FileSelection", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(complete, 1); RG_DEF_METHOD(show_fileop_buttons, 0); RG_DEF_METHOD(hide_fileop_buttons, 0); RG_DEF_METHOD(selections, 0); RG_DEF_METHOD(fileop_dialog, 0); RG_DEF_METHOD(ok_button, 0); RG_DEF_METHOD(cancel_button, 0); RG_DEF_METHOD(dir_list, 0); RG_DEF_METHOD(file_list, 0); RG_DEF_METHOD(history_pulldown, 0); RG_DEF_METHOD(fileop_c_dir, 0); RG_DEF_METHOD(fileop_del_file, 0); RG_DEF_METHOD(fileop_ren_file, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcellrendererpixbuf.c���������������������������������������0000644�0001750�0001750�00000002506�11701304107�022201� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCellRendererPixbuf #define _SELF(s) (GTK_CELL_RENDERER_PIXBUF(RVAL2GOBJ(s))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_pixbuf_new()); return Qnil; } void Init_gtk_cellrendererpixbuf(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_PIXBUF, "CellRendererPixbuf", mGtk); RG_DEF_METHOD(initialize, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkrange.c����������������������������������������������������0000644�0001750�0001750�00000004174�12257552167�017436� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cRange #define _SELF(self) (GTK_RANGE(RVAL2GOBJ(self))) static VALUE rg_value(VALUE self) { return rb_float_new(gtk_range_get_value(_SELF(self))); } static VALUE rg_set_increments(VALUE self, VALUE step, VALUE page) { gtk_range_set_increments(_SELF(self), NUM2DBL(step), NUM2DBL(page)); return self; } static VALUE rg_set_range(VALUE self, VALUE min, VALUE max) { gtk_range_set_range(_SELF(self), NUM2DBL(min), NUM2DBL(max)); return self; } static VALUE rg_set_value(VALUE self, VALUE value) { gtk_range_set_value(_SELF(self), NUM2DBL(value)); return self; } 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"); /* GtkSensitivityType */ G_DEF_CLASS(GTK_TYPE_SENSITIVITY_TYPE, "SensitivityType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_SENSITIVITY_TYPE, "GTK_"); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkcellrendererspin.c�����������������������������������������0000644�0001750�0001750�00000002473�12257552167�021702� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cCellRendererSpin #define _SELF(s) (GTK_CELL_RENDERER_SPIN(RVAL2GOBJ(s))) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_spin_new()); return Qnil; } void Init_gtk_cellrendererspin(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_SPIN, "CellRendererSpin", mGtk); RG_DEF_METHOD(initialize, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkvolumebutton.c���������������������������������������������0000644�0001750�0001750�00000002716�11701304107�021063� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #if GTK_CHECK_VERSION(2,12,0) #define RG_TARGET_NAMESPACE cVolumeButton static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_volume_button_new()); return Qnil; } #endif void Init_gtk_volumebutton(VALUE mGtk) { #if GTK_CHECK_VERSION(2,12,0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VOLUME_BUTTON, "VolumeButton", mGtk); RG_DEF_METHOD(initialize, 0); #endif } ��������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkwindow.c���������������������������������������������������0000644�0001750�0001750�00000036267�12257552167�017661� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2002-2011 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cWindow #define _SELF(s) (GTK_WINDOW(RVAL2GOBJ(s))) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg; GtkWindowType tp = GTK_WINDOW_TOPLEVEL; const gchar *title = NULL; GtkWidget* window = NULL; if (rb_scan_args(argc, argv, "01", &arg) == 1) { if (TYPE(arg) == T_STRING) { StringValue(arg); title = RVAL2CSTR(arg); } else { tp = RVAL2GENUM(arg, GTK_TYPE_WINDOW_TYPE); } } window = gtk_window_new(tp); if (title != NULL) gtk_window_set_title(GTK_WINDOW(window), title); RBGTK_INITIALIZE(self, window); return Qnil; } static VALUE rg_set_wmclass(VALUE self, VALUE wmclass_name, VALUE wmclass_class) { gtk_window_set_wmclass(_SELF(self), NIL_P(wmclass_name)?NULL:RVAL2CSTR(wmclass_name), NIL_P(wmclass_class)?NULL:RVAL2CSTR(wmclass_class)); return self; } static VALUE rg_add_accel_group(VALUE self, VALUE accel) { gtk_window_add_accel_group(_SELF(self), GTK_ACCEL_GROUP(RVAL2GOBJ(accel))); G_CHILD_ADD(self, accel); return self; } static VALUE rg_remove_accel_group(VALUE self, VALUE accel) { gtk_window_remove_accel_group(_SELF(self), GTK_ACCEL_GROUP(RVAL2GOBJ(accel))); G_CHILD_REMOVE(self, accel); return self; } static VALUE gwin_activate_focus(VALUE self) { return CBOOL2RVAL(gtk_window_activate_focus(_SELF(self))); } static VALUE gwin_activate_default(VALUE self) { return CBOOL2RVAL(gtk_window_activate_default(_SELF(self))); } static VALUE rg_active_focus(VALUE self) { rb_warning("Gtk::Window#active_focus is deprecated. Use Gtk::Window#activate_focus"); gtk_window_activate_focus(_SELF(self)); return self; } static VALUE rg_active_default(VALUE self) { rb_warning("Gtk::Window#active_default is deprecated. Use Gtk::Window#activate_default"); gtk_window_activate_default(_SELF(self)); return self; } static VALUE rg_set_default_size(VALUE self, VALUE w, VALUE h) { gtk_window_set_default_size(_SELF(self), NUM2INT(w), NUM2INT(h)); return self; } static VALUE rg_set_geometry_hints(VALUE self, VALUE geometry_widget, VALUE geometry, VALUE geom_mask) { gtk_window_set_geometry_hints(_SELF(self), GTK_WIDGET(RVAL2GOBJ(geometry_widget)), (GdkGeometry*)RVAL2BOXED(geometry, GDK_TYPE_GEOMETRY), RVAL2GFLAGS(geom_mask, GDK_TYPE_WINDOW_HINTS)); return self; } static VALUE rg_s_toplevels(G_GNUC_UNUSED VALUE self) { GList* list = gtk_window_list_toplevels(); VALUE ret = GLIST2ARY(list); g_list_foreach(list, (GFunc)g_object_ref, NULL); g_list_free(list); return ret; } static VALUE rg_add_mnemonic(VALUE self, VALUE keyval, VALUE target) { gtk_window_add_mnemonic(_SELF(self), NUM2INT(keyval), GTK_WIDGET(RVAL2GOBJ(target))); return self; } static VALUE rg_remove_mnemonic(VALUE self, VALUE keyval, VALUE target) { gtk_window_remove_mnemonic(_SELF(self), NUM2INT(keyval), GTK_WIDGET(RVAL2GOBJ(target))); return self; } static VALUE rg_mnemonic_activate(VALUE self, VALUE keyval, VALUE modifier) { return CBOOL2RVAL(gtk_window_mnemonic_activate(_SELF(self), NUM2INT(keyval), RVAL2GFLAGS(modifier, GDK_TYPE_MODIFIER_TYPE))); } static VALUE rg_focus(VALUE self) { return GOBJ2RVAL(gtk_window_get_focus(_SELF(self))); } static VALUE rg_set_focus(VALUE self, VALUE win) { gtk_window_set_focus(_SELF(self), NIL_P(win) ? NULL : GTK_WIDGET(RVAL2GOBJ(win))); return self; } static VALUE rg_set_default(VALUE self, VALUE win) { gtk_window_set_default(_SELF(self), NIL_P(win) ? NULL : GTK_WIDGET(RVAL2GOBJ(win))); return self; } static VALUE rg_present(int argc, VALUE *argv, VALUE self) { VALUE timestamp; if (rb_scan_args(argc, argv, "01", ×tamp) == 1) { gtk_window_present_with_time(_SELF(self), NUM2UINT(timestamp)); } else { gtk_window_present(_SELF(self)); } return self; } static VALUE rg_iconify(VALUE self) { gtk_window_iconify(_SELF(self)); return self; } static VALUE rg_deiconify(VALUE self) { gtk_window_deiconify(_SELF(self)); return self; } static VALUE rg_stick(VALUE self) { gtk_window_stick(_SELF(self)); return self; } static VALUE rg_unstick(VALUE self) { gtk_window_unstick(_SELF(self)); return self; } static VALUE rg_maximize(VALUE self) { gtk_window_maximize(_SELF(self)); return self; } static VALUE rg_unmaximize(VALUE self) { gtk_window_unmaximize(_SELF(self)); return self; } static VALUE rg_fullscreen(VALUE self) { gtk_window_fullscreen(_SELF(self)); return self; } static VALUE rg_unfullscreen(VALUE self) { gtk_window_unfullscreen(_SELF(self)); return self; } static VALUE rg_set_keep_above(VALUE self, VALUE setting) { gtk_window_set_keep_above(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_set_keep_below(VALUE self, VALUE setting) { gtk_window_set_keep_below(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_begin_resize_drag(VALUE self, VALUE edge, VALUE button, VALUE root_x, VALUE root_y, VALUE timestamp) { gtk_window_begin_resize_drag(_SELF(self), RVAL2GENUM(edge, GDK_TYPE_WINDOW_EDGE), NUM2INT(button), NUM2INT(root_x), NUM2INT(root_y), NUM2UINT(timestamp)); return self; } static VALUE rg_begin_move_drag(VALUE self, VALUE button, VALUE root_x, VALUE root_y, VALUE timestamp) { gtk_window_begin_move_drag(_SELF(self), NUM2INT(button), NUM2INT(root_x), NUM2INT(root_y), NUM2UINT(timestamp)); return self; } static VALUE rg_set_frame_dimensions(VALUE self, VALUE left, VALUE top, VALUE right, VALUE bottom) { gtk_window_set_frame_dimensions(_SELF(self), NUM2INT(left), NUM2INT(top), NUM2INT(right), NUM2INT(bottom)); return self; } static VALUE rg_set_has_frame(VALUE self, VALUE setting) { gtk_window_set_has_frame(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_set_mnemonic_modifier(VALUE self, VALUE modifier) { gtk_window_set_mnemonic_modifier(_SELF(self), RVAL2GFLAGS(modifier, GDK_TYPE_MODIFIER_TYPE)); return self; } static VALUE rg_s_default_icon_list(G_GNUC_UNUSED VALUE self) { return GLIST2ARYF(gtk_window_get_default_icon_list()); } static VALUE rg_default_size(VALUE self) { int width, height; gtk_window_get_default_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_frame_dimensions(VALUE self) { int left, top, right, bottom; gtk_window_get_frame_dimensions(_SELF(self), &left, &top, &right, &bottom); return rb_ary_new3(4, INT2NUM(left), INT2NUM(top), INT2NUM(right), INT2NUM(bottom)); } static VALUE rg_has_frame_p(VALUE self) { return CBOOL2RVAL(gtk_window_get_has_frame(_SELF(self))); } static VALUE rg_icon_list(VALUE self) { return GLIST2ARYF(gtk_window_get_icon_list(_SELF(self))); } static VALUE rg_mnemonic_modifier(VALUE self) { return GFLAGS2RVAL(gtk_window_get_mnemonic_modifier(_SELF(self)), GDK_TYPE_MODIFIER_TYPE); } static VALUE rg_position(VALUE self) { int root_x, root_y; gtk_window_get_position(_SELF(self), &root_x, &root_y); return rb_ary_new3(2, INT2NUM(root_x), INT2NUM(root_y)); } static VALUE rg_size(VALUE self) { int width, height; gtk_window_get_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_group(VALUE self) { return GOBJ2RVAL(gtk_window_get_group(_SELF(self))); } static VALUE rg_move(VALUE self, VALUE x, VALUE y) { gtk_window_move(_SELF(self), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_parse_geometry(VALUE self, VALUE geometry) { return CBOOL2RVAL(gtk_window_parse_geometry(_SELF(self), RVAL2CSTR(geometry))); } static VALUE rg_reshow_with_initial_size(VALUE self) { gtk_window_reshow_with_initial_size(_SELF(self)); return self; } static VALUE rg_resize(VALUE self, VALUE width, VALUE height) { gtk_window_resize(_SELF(self), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_s_set_default_icon_list(G_GNUC_UNUSED VALUE self, VALUE rblist) { GList *list = RVAL2GDKPIXBUFGLIST(rblist); gtk_window_set_default_icon_list(list); g_list_free(list); return rblist; } static VALUE rg_s_set_default_icon(VALUE self, VALUE icon_or_filename) { if (TYPE(icon_or_filename) == T_STRING){ GError* err; gboolean ret = gtk_window_set_default_icon_from_file(RVAL2CSTR(icon_or_filename), &err); if (! ret) RAISE_GERROR(err); } else { gtk_window_set_default_icon(GDK_PIXBUF(RVAL2GOBJ(icon_or_filename))); } return self; } static VALUE rg_s_set_default_icon_name(VALUE self, VALUE name) { gtk_window_set_default_icon_name(RVAL2CSTR(name)); return self; } static VALUE gwin_set_icon(VALUE self, VALUE icon_or_filename) { if (TYPE(icon_or_filename) == T_STRING){ GError* err; gboolean ret = gtk_window_set_icon_from_file(_SELF(self), RVAL2CSTR(icon_or_filename), &err); if (! ret) RAISE_GERROR(err); } else { gtk_window_set_icon(_SELF(self), GDK_PIXBUF(RVAL2GOBJ(icon_or_filename))); } return self; } static VALUE rg_set_icon_list(VALUE self, VALUE rblist) { GtkWindow *window = _SELF(self); GList *list = RVAL2GDKPIXBUFGLIST(rblist); gtk_window_set_icon_list(window, list); g_list_free(list); /* TODO: Shouldn't we return self? */ return rblist; } static VALUE rg_s_set_auto_startup_notification(VALUE self, VALUE setting) { gtk_window_set_auto_startup_notification(RVAL2CBOOL(setting)); return self; } /* They are not public methods. static VALUE rg_decorated_window_init(VALUE self) { gtk_decorated_window_init(_SELF(self)); return self; } static VALUE rg_decorated_window_calculate_frame_size(VALUE self) { gtk_decorated_window_calculate_frame_size(_SELF(self)); return self; } static VALUE rg_decorated_window_set_title(VALUE self, VALUE title) { gtk_decorated_window_set_title(_SELF(self), RVAL2CSTR(title)); return self; } static VALUE rg_decorated_window_move_resize_window(VALUE self) { int x, y, width, height; gtk_decorated_window_move_resize_window(_SELF(self), &x, &y, &width, &height); return rb_ary_new3(4, INT2NUM(x), INT2NUM(y), INT2NUM(width), INT2NUM(height)); } */ static void mark_toplevels(G_GNUC_UNUSED void *_) { GList* list = gtk_window_list_toplevels(); GList* p; for (p = list; p; p = g_list_next(p)) rbgobj_gc_mark_instance(p->data); g_list_free(list); } void Init_gtk_window(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_WINDOW, "Window", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_wmclass, 2); RG_DEF_METHOD(add_accel_group, 1); RG_DEF_METHOD(remove_accel_group, 1); /* active_(focus|default) are deprecated. Use activate_* instead. */ RG_DEF_METHOD(active_focus, 0); RG_DEF_METHOD(active_default, 0); G_REPLACE_ACTION(RG_TARGET_NAMESPACE, "activate_focus", gwin_activate_focus, 0); G_REPLACE_ACTION(RG_TARGET_NAMESPACE, "activate_default", gwin_activate_default, 0); RG_DEF_METHOD(set_default_size, 2); RG_DEF_METHOD(set_geometry_hints, 3); RG_DEF_SMETHOD(toplevels, 0); RG_DEF_METHOD(add_mnemonic, 2); RG_DEF_METHOD(remove_mnemonic, 2); RG_DEF_METHOD(mnemonic_activate, 2); RG_DEF_METHOD(focus, 0); RG_DEF_METHOD(set_focus, 1); RG_DEF_METHOD(set_default, 1); RG_DEF_METHOD(present, -1); RG_DEF_METHOD(iconify, 0); RG_DEF_METHOD(deiconify, 0); RG_DEF_METHOD(stick, 0); RG_DEF_METHOD(unstick, 0); RG_DEF_METHOD(maximize, 0); RG_DEF_METHOD(unmaximize, 0); RG_DEF_METHOD(fullscreen, 0); RG_DEF_METHOD(unfullscreen, 0); RG_DEF_METHOD(set_keep_above, 1); RG_DEF_METHOD(set_keep_below, 1); RG_DEF_METHOD(begin_resize_drag, 5); RG_DEF_METHOD(begin_move_drag, 4); RG_DEF_METHOD(set_frame_dimensions, 4); RG_DEF_METHOD(set_mnemonic_modifier, 1); RG_DEF_METHOD(default_size, 0); RG_DEF_SMETHOD(default_icon_list, 0); RG_DEF_METHOD(frame_dimensions, 0); RG_DEF_METHOD(set_has_frame, 1); RG_DEF_METHOD_P(has_frame, 0); RG_DEF_METHOD(icon_list, 0); RG_DEF_METHOD(mnemonic_modifier, 0); RG_DEF_METHOD(position, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(group, 0); RG_DEF_METHOD(move, 2); RG_DEF_METHOD(parse_geometry, 1); RG_DEF_METHOD(reshow_with_initial_size, 0); RG_DEF_METHOD(resize, 2); RG_DEF_SMETHOD(set_default_icon_list, 1); RG_DEF_SMETHOD(set_default_icon, 1); RG_DEF_SMETHOD(set_default_icon_name, 1); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "icon", gwin_set_icon, 1); RG_DEF_METHOD(set_icon_list, 1); RG_DEF_SMETHOD(set_auto_startup_notification, 1); /* RG_DEF_METHOD(decorated_window_init, 0); RG_DEF_METHOD(decorated_window_calculate_frame_size, 0); RG_DEF_METHOD(decorated_window_set_title, 1); RG_DEF_METHOD(decorated_window_move_resize_window, 0); */ G_DEF_SETTERS(RG_TARGET_NAMESPACE); /* GtkWindowPosition (from General constants) */ G_DEF_CLASS(GTK_TYPE_WINDOW_POSITION, "Position", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_WINDOW_POSITION, "GTK_WIN_"); /* GtkWindowType (from General constants) */ G_DEF_CLASS(GTK_TYPE_WINDOW_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_WINDOW_TYPE, "GTK_WINDOW_"); { static VALUE toplevels_marker; toplevels_marker = rb_data_object_alloc(rb_cData, NULL, mark_toplevels, NULL); rb_global_variable(&toplevels_marker); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkhandlebox.c������������������������������������������������0000644�0001750�0001750�00000003026�11701304107�020257� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cHandleBox static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_handle_box_new()); return Qnil; } void Init_gtk_handle_box(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HANDLE_BOX, "HandleBox", mGtk); RG_DEF_METHOD(initialize, 0); rb_undef_method(RG_TARGET_NAMESPACE, "shadow"); rb_undef_method(RG_TARGET_NAMESPACE, "shadow="); rb_undef_method(RG_TARGET_NAMESPACE, "set_shadow"); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdktimecoord.c������������������������������������������������0000644�0001750�0001750�00000006556�11701304107�020273� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cTimeCoord #define _SELF(s) ((GdkTimeCoord*)RVAL2BOXED(s, GDK_TYPE_TIME_COORD)) /**********************************/ static GdkTimeCoord* timecoord_copy(const GdkTimeCoord* val) { GdkTimeCoord* new_val; g_return_val_if_fail (val != NULL, NULL); new_val = g_new(GdkTimeCoord, 1); *new_val = *val; return new_val; } GType gdk_timecoord_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkTimeCoord", (GBoxedCopyFunc)timecoord_copy, (GBoxedFreeFunc)g_free); return our_type; } /**********************************/ static VALUE rg_initialize(VALUE self, VALUE rbtime, VALUE rbaxes) { guint32 time = NUM2UINT(rbtime); long n; gdouble *axes = RVAL2GDOUBLES(rbaxes, n); GdkTimeCoord *coord; if (n > GDK_MAX_TIMECOORD_AXES) { g_free(axes); rb_raise(rb_eArgError, "axes out of range: %ld (0..%d)", n, GDK_MAX_TIMECOORD_AXES); } coord = g_new(GdkTimeCoord, 1); coord->time = time; MEMCPY(coord->axes, axes, gdouble, n); g_free(axes); G_INITIALIZE(self, coord); return Qnil; } static VALUE rg_time(VALUE self) { return UINT2NUM(_SELF(self)->time); } static VALUE rg_set_time(VALUE self, VALUE time) { _SELF(self)->time = NUM2UINT(time); return self; } static VALUE rg_axes(VALUE self) { VALUE ary = rb_ary_new(); int i; for (i = 0; i < GDK_MAX_TIMECOORD_AXES; i++){ rb_ary_push(ary, rb_float_new(_SELF(self)->axes[i])); } return ary; } static VALUE rg_set_axes(VALUE self, VALUE rbaxes) { GdkTimeCoord *coord = _SELF(self); VALUE axes = rb_ary_to_ary(rbaxes); long i; long n = RARRAY_LEN(axes); if (n < 0 || n > GDK_MAX_TIMECOORD_AXES) rb_raise(rb_eArgError, "axes out of range: %ld (0..%d)", n, GDK_MAX_TIMECOORD_AXES); for (i = 0; i < n; i++) coord->axes[i] = NUM2DBL(RARRAY_PTR(axes)[i]); return self; } void Init_gtk_gdk_timecoord(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_TIME_COORD, "TimeCoord", mGdk); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(time, 0); RG_DEF_METHOD(set_time, 1); RG_DEF_METHOD(axes, 0); RG_DEF_METHOD(set_axes, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); rb_define_const(RG_TARGET_NAMESPACE, "MAX_AXES", INT2NUM(GDK_MAX_TIMECOORD_AXES)); } ��������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkinvisible.c������������������������������������������������0000644�0001750�0001750�00000003017�12257552167�020321� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cInvisible #define _SELF(s) GTK_INVISIBLE(RVAL2GOBJ(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE screen; rb_scan_args(argc, argv, "01", &screen); if (argc == 0){ RBGTK_INITIALIZE(self, gtk_invisible_new()); } else { RBGTK_INITIALIZE(self, gtk_invisible_new_for_screen( GDK_SCREEN(RVAL2GOBJ(screen)))); } return Qnil; } void Init_gtk_invisible(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_INVISIBLE, "Invisible", mGtk); RG_DEF_METHOD(initialize, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkaccelkey.c�������������������������������������������������0000644�0001750�0001750�00000005666�12124610262�020111� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cAccelKey #define _SELF(s) ((GtkAccelKey*)RVAL2BOXED(s, GTK_TYPE_ACCEL_KEY)) #define GTK_TYPE_ACCEL_KEY (gtk_accel_key_get_type()) static GtkAccelKey * accel_key_copy(const GtkAccelKey *key) { GtkAccelKey *new_key; g_return_val_if_fail (key != NULL, NULL); new_key = g_new(GtkAccelKey, 1); *new_key = *key; return new_key; } GType gtk_accel_key_get_type(void) { static GType our_type = 0; if(our_type == 0) our_type = g_boxed_type_register_static("GtkAccelKey", (GBoxedCopyFunc)accel_key_copy, (GBoxedFreeFunc)g_free); return our_type; } /* struct _GtkAccelKey { guint accel_key; GdkModifierType accel_mods; guint accel_flags : 16; }; */ static VALUE rg_initialize(VALUE self) { GtkAccelKey key; memset(&key, 0, sizeof(GtkAccelKey)); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_ACCEL_KEY, &key)); return Qnil; } static VALUE rg_key(VALUE self) { return UINT2NUM(_SELF(self)->accel_key); } static VALUE rg_mods(VALUE self) { return GFLAGS2RVAL(_SELF(self)->accel_mods, GDK_TYPE_MODIFIER_TYPE); } static VALUE rg_flags(VALUE self) { return INT2FIX(_SELF(self)->accel_flags); } static VALUE rg_set_key(VALUE self, VALUE key) { _SELF(self)->accel_key = NUM2UINT(key); return self; } static VALUE rg_set_mods(VALUE self, VALUE mods) { _SELF(self)->accel_mods = RVAL2GFLAGS(mods, GDK_TYPE_MODIFIER_TYPE); return self; } static VALUE rg_set_flags(VALUE self, VALUE flags) { _SELF(self)->accel_flags = FIX2INT(flags); return self; } void Init_gtk_accel_key(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCEL_KEY, "AccelKey", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(key, 0); RG_DEF_METHOD(mods, 0); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(set_key, 1); RG_DEF_METHOD(set_mods, 1); RG_DEF_METHOD(set_flags, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkarrow.c����������������������������������������������������0000644�0001750�0001750�00000003724�11701304107�017452� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cArrow static VALUE rg_initialize(VALUE self, VALUE arrow_t, VALUE shadow_t) { RBGTK_INITIALIZE(self, gtk_arrow_new(RVAL2GENUM(arrow_t, GTK_TYPE_ARROW_TYPE), RVAL2GENUM(shadow_t, GTK_TYPE_SHADOW_TYPE))); return Qnil; } static VALUE rg_set(VALUE self, VALUE arrow_t, VALUE shadow_t) { gtk_arrow_set(GTK_ARROW(RVAL2GOBJ(self)), RVAL2GENUM(arrow_t, GTK_TYPE_ARROW_TYPE), RVAL2GENUM(shadow_t, GTK_TYPE_SHADOW_TYPE)); return self; } void Init_gtk_arrow(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ARROW, "Arrow", mGtk); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(set, 2); /* GtkArrowType (from General constants) */ G_DEF_CLASS(GTK_TYPE_ARROW_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_ARROW_TYPE, "GTK_ARROW_"); } ��������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtktooltip.c��������������������������������������������������0000644�0001750�0001750�00000004560�11701304107�020011� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #if GTK_CHECK_VERSION(2,12,0) #define RG_TARGET_NAMESPACE cTooltip /* GTK_TOOLTIP type-cast is private because it should be useless */ #define _SELF(self) (RVAL2GOBJ(self)) static VALUE rg_set_markup(VALUE self, VALUE markup) { gtk_tooltip_set_markup(_SELF(self), RVAL2CSTR(markup)); return self; } static VALUE rg_set_text(VALUE self, VALUE text) { gtk_tooltip_set_text(_SELF(self), RVAL2CSTR(text)); return self; } static VALUE rg_set_icon(VALUE self, VALUE icon) { gtk_tooltip_set_icon(_SELF(self), GDK_PIXBUF(RVAL2GOBJ(icon))); return self; } static VALUE rg_set_icon_from_stock(VALUE self, VALUE stock_id, VALUE size) { gtk_tooltip_set_icon_from_stock(_SELF(self), rb_id2name(SYM2ID(stock_id)), RVAL2GENUM(size, GTK_TYPE_ICON_SIZE)); return self; } static VALUE rg_set_custom(VALUE self, VALUE custom_widget) { gtk_tooltip_set_custom(_SELF(self), GTK_WIDGET(RVAL2GOBJ(custom_widget))); return self; } #endif void Init_gtk_tooltip(VALUE mGtk) { #if GTK_CHECK_VERSION(2,12,0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOOLTIP, "Tooltip", mGtk); RG_DEF_METHOD(set_markup, 1); RG_DEF_METHOD(set_text, 1); RG_DEF_METHOD(set_icon, 1); RG_DEF_METHOD(set_icon_from_stock, 2); RG_DEF_METHOD(set_custom, 1); G_DEF_SETTERS(RG_TARGET_NAMESPACE); #endif } ������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgdkdisplay.c��������������������������������������������������0000644�0001750�0001750�00000032545�12257552167�017772� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2002-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cDisplay #define _SELF(i) GDK_DISPLAY_OBJECT(RVAL2GOBJ(i)) static VALUE rg_close(VALUE self) { gdk_display_close(_SELF(self)); return self; } static VALUE rg_s_open(G_GNUC_UNUSED VALUE self, VALUE display_name) { GdkDisplay* gdisplay = gdk_display_open(RVAL2CSTR(display_name)); if (! gdisplay) { rb_raise(rb_eRuntimeError, "The display `%s' could not be opened.", RVAL2CSTR(display_name)); } else { VALUE display; g_object_ref(gdisplay); display = GOBJ2RVAL(gdisplay); if (rb_block_given_p()) { rb_ensure(rb_yield, display, rg_close, display); return Qnil; } else { return display; } } } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { GdkDisplay* gdisplay = gdk_display_get_default(); if (! gdisplay) rb_raise(rb_eRuntimeError, "No default display is found."); return GOBJ2RVAL(gdisplay); } static VALUE rg_name(VALUE self) { return CSTR2RVAL(gdk_display_get_name(_SELF(self))); } static VALUE rg_n_screens(VALUE self) { return INT2NUM(gdk_display_get_n_screens(_SELF(self))); } static VALUE rg_get_screen(VALUE self, VALUE num) { return GOBJ2RVAL(gdk_display_get_screen(_SELF(self), NUM2INT(num))); } static VALUE rg_default_screen(VALUE self) { return GOBJ2RVAL(gdk_display_get_default_screen(_SELF(self))); } static VALUE rg_pointer_ungrab(VALUE self, VALUE time) { gdk_display_pointer_ungrab(_SELF(self), NUM2ULONG(time)); return self; } static VALUE rg_keyboard_ungrab(VALUE self, VALUE time) { gdk_display_keyboard_ungrab(_SELF(self), NUM2ULONG(time)); return self; } static VALUE rg_pointer_grabbed_p(VALUE self) { return CBOOL2RVAL(gdk_display_pointer_is_grabbed(_SELF(self))); } static VALUE rg_beep(VALUE self) { gdk_display_beep(_SELF(self)); return self; } static VALUE rg_sync(VALUE self) { gdk_display_sync(_SELF(self)); return self; } static VALUE rg_flush(VALUE self) { gdk_display_flush(_SELF(self)); return self; } static VALUE rg_devices(VALUE self) { return rbgutil_glist2ary(gdk_display_list_devices(_SELF(self))); } static VALUE rg_event(VALUE self) { return GEV2RVAL(gdk_display_get_event(_SELF(self))); } static VALUE rg_peek_event(VALUE self) { return GEV2RVAL(gdk_display_peek_event(_SELF(self))); } static VALUE rg_put_event(VALUE self, VALUE event) { gdk_display_put_event(_SELF(self), RVAL2GEV(event)); return self; } /* Don't implement this. static GdkFilterReturn filter_func(GdkXEvent xevent, GdkEvent event, gpointer func) { return GENUM2RVAL(rb_funcall((VALUE)func, id_call, 2, ????, GEV2RVAL(event)), GDK_TYPE_FILTER_RETURN); } static VALUE gdkdisplay_add_client_message_filter(VALUE self, VALUE message_type) { VALUE func = RB_BLOCK_PROC(); G_RELATIVE(self, func); gdk_display_add_client_message_filter(_SELF(self), RVAL2ATOM(message_type), filter_func, func); return self; } */ static VALUE rg_set_double_click_time(VALUE self, VALUE msec) { gdk_display_set_double_click_time(_SELF(self), NUM2UINT(msec)); return self; } static VALUE rg_double_click_time(VALUE self) { return UINT2NUM(_SELF(self)->double_click_time); } static VALUE rg_button_click_time(VALUE self) { return rb_ary_new3(2, UINT2NUM(_SELF(self)->button_click_time[0]), UINT2NUM(_SELF(self)->button_click_time[1])); } static VALUE rg_button_window(VALUE self) { return rb_ary_new3(2, GOBJ2RVAL(_SELF(self)->button_window[0]), GOBJ2RVAL(_SELF(self)->button_window[1])); } static VALUE rg_button_number(VALUE self) { return rb_ary_new3(2, INT2NUM(_SELF(self)->button_number[0]), INT2NUM(_SELF(self)->button_number[1])); } static VALUE rg_closed_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->closed); } static VALUE rg_button_x(VALUE self) { return rb_ary_new3(2, INT2NUM(_SELF(self)->button_x[0]), INT2NUM(_SELF(self)->button_x[1])); } static VALUE rg_button_y(VALUE self) { return rb_ary_new3(2, INT2NUM(_SELF(self)->button_y[0]), INT2NUM(_SELF(self)->button_y[1])); } static VALUE rg_set_double_click_distance(VALUE self, VALUE distance) { gdk_display_set_double_click_distance(_SELF(self), NUM2UINT(distance)); return self; } static VALUE rg_double_click_distance(VALUE self) { return UINT2NUM(_SELF(self)->double_click_distance); } static VALUE rg_pointer(VALUE self) { GdkScreen *screen; int x,y; GdkModifierType mask; gdk_display_get_pointer(_SELF(self), &screen, &x, &y, &mask); return rb_ary_new3(4, GOBJ2RVAL(screen), INT2NUM(x), INT2NUM(y), INT2NUM(mask)); } static VALUE rg_window_at_pointer(VALUE self) { GdkWindow *window; int x,y; window = gdk_display_get_window_at_pointer(_SELF(self), &x, &y); return rb_ary_new3(3, GOBJ2RVAL(window), INT2NUM(x), INT2NUM(y)); } /* Don't implement this. GdkDisplayPointerHooks* gdk_display_set_pointer_hooks (GdkDisplay *display, const GdkDisplayPointerHooks *new_hooks); */ static VALUE rg_supports_cursor_color_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_cursor_color(_SELF(self))); } static VALUE rg_supports_cursor_alpha_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_cursor_alpha(_SELF(self))); } static VALUE rg_default_cursor_size(VALUE self) { return UINT2NUM(gdk_display_get_default_cursor_size(_SELF(self))); } static VALUE rg_maximal_cursor_size(VALUE self) { guint width, height; gdk_display_get_maximal_cursor_size(_SELF(self), &width, &height); return rb_assoc_new(UINT2NUM(width), UINT2NUM(height)); } static VALUE rg_default_group(VALUE self) { return GOBJ2RVAL(gdk_display_get_default_group(_SELF(self))); } static VALUE rg_supports_selection_notification_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_selection_notification(_SELF(self))); } static VALUE rg_request_selection_notification_p(VALUE self, VALUE selection) { return CBOOL2RVAL(gdk_display_request_selection_notification(_SELF(self), RVAL2ATOM(selection))); } static VALUE rg_supports_clipboard_persistence_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_clipboard_persistence(_SELF(self))); } static VALUE rg_store_clipboard(VALUE self, VALUE rbclipboard_window, VALUE rbtime_, VALUE rbtargets) { GdkDisplay *display = _SELF(self); GdkWindow *clipboard_window = GDK_WINDOW(RVAL2GOBJ(rbclipboard_window)); guint32 time_ = NUM2UINT(rbtime_); long n; GdkAtom *targets = RVAL2GDKATOMS(rbtargets, &n); gdk_display_store_clipboard(display, clipboard_window, time_, targets, n); g_free(targets); return self; } static VALUE rg_core_pointer(VALUE self) { return GOBJ2RVAL(gdk_display_get_core_pointer(_SELF(self))); } static VALUE rg_warp_pointer(VALUE self, VALUE screen, VALUE x, VALUE y) { gdk_display_warp_pointer(_SELF(self), RVAL2GOBJ(screen), NUM2INT(x), NUM2INT(y)); return self; } #ifdef GDK_WINDOWING_X11 static VALUE rg_grab(VALUE self) { gdk_x11_display_grab(_SELF(self)); return self; } static VALUE rg_ungrab(VALUE self) { gdk_x11_display_ungrab(_SELF(self)); return self; } static VALUE rg_register_standard_event_type(VALUE self, VALUE event_base, VALUE n_events) { gdk_x11_register_standard_event_type(_SELF(self), NUM2INT(event_base), NUM2INT(n_events)); return self; } static VALUE rg_user_time(VALUE self) { return UINT2NUM(gdk_x11_display_get_user_time(_SELF(self))); } static VALUE rg_set_cursor_theme(VALUE self, VALUE theme, VALUE size) { gdk_x11_display_set_cursor_theme(_SELF(self), RVAL2CSTR(theme), NUM2INT(size)); return self; } #endif # if GTK_CHECK_VERSION(2, 12, 0) /* *** need gdk_x11_display_broadcast_startup_messagev() *** typedef struct _StartupMessageParameterData { gchar **parameters; guint i; } StartupMessageParameterData; static int collect_parameter(VALUE key, VALUE value, VALUE data) { StartupMessageParameterData *parameter_data; parameter_data = (StartupMessageParameterData *)data; parameter_data->parameters[parameter_data->i] = RVAL2CSTR(key); parameter_data->i++; parameter_data->parameters[parameter_data->i] = RVAL2CSTR(value); parameter_data->i++; return ST_CONTINUE; } static VALUE rg_broadcast_startup_message(int argc, VALUE *argv, VALUE self) { VALUE rb_message_type, rb_parameters; char *message_type; guint n_parameters; gchar **parameters; rb_scan_args(argc, argv, "11", &rb_message_type, &rb_parameters); message_type = RVAL2CSTR(rb_message_type); if (NIL_P(rb_parameters)) { n_parameters = 0; parameters = NULL; } else { StartupMessageParameterData data; Check_Type(rb_parameters, T_HASH); n_parameters = NUM2UINT(rb_funcall(rb_parameters, rb_intern("size"), 0)); parameters = ALLOCA_N(gchar *, n_parameters * 2); data.i = 0; data.parameters = parameters; rb_hash_foreach(rb_parameters, collect_parameter, (VALUE)&data); } gdk_x11_display_broadcast_startup_messagev(_SELF(self), message_type, n_parameters, parameters); return self; } */ static VALUE rg_startup_notification_id(VALUE self) { return CSTR2RVAL(gdk_x11_display_get_startup_notification_id(_SELF(self))); } # endif static VALUE rg_supports_shapes_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_shapes(_SELF(self))); } static VALUE rg_supports_input_shapes_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_input_shapes(_SELF(self))); } #if GTK_CHECK_VERSION(2, 12, 0) static VALUE rg_supports_composite_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_composite(_SELF(self))); } static VALUE rg_trigger_tooltip_query(VALUE self) { gtk_tooltip_trigger_tooltip_query(_SELF(self)); return self; } #endif void Init_gtk_gdk_display(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DISPLAY, "Display", mGdk); RG_DEF_SMETHOD(open, 1); RG_DEF_SMETHOD(default, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(n_screens, 0); RG_DEF_METHOD(get_screen, 1); RG_DEF_ALIAS("[]", "get_screen"); RG_DEF_METHOD(default_screen, 0); RG_DEF_METHOD(pointer_ungrab, 1); RG_DEF_METHOD(keyboard_ungrab, 1); RG_DEF_METHOD_P(pointer_grabbed, 0); RG_DEF_METHOD(beep, 0); RG_DEF_METHOD(sync, 0); RG_DEF_METHOD(flush, 0); RG_DEF_METHOD(close, 0); RG_DEF_METHOD(devices, 0); RG_DEF_METHOD(event, 0); RG_DEF_METHOD(peek_event, 0); RG_DEF_METHOD(put_event, 1); RG_DEF_METHOD(set_double_click_time, 1); RG_DEF_METHOD(double_click_time, 0); RG_DEF_METHOD(button_click_time, 0); RG_DEF_METHOD(button_window, 0); RG_DEF_METHOD(button_number, 0); RG_DEF_METHOD_P(closed, 0); RG_DEF_METHOD(button_x, 0); RG_DEF_METHOD(button_y, 0); RG_DEF_METHOD(set_double_click_distance, 1); RG_DEF_METHOD(double_click_distance, 0); RG_DEF_METHOD(pointer, 0); RG_DEF_METHOD(window_at_pointer, 0); RG_DEF_METHOD_P(supports_cursor_color, 0); RG_DEF_METHOD_P(supports_cursor_alpha, 0); RG_DEF_METHOD(default_cursor_size, 0); RG_DEF_METHOD(maximal_cursor_size, 0); RG_DEF_METHOD(default_group, 0); RG_DEF_METHOD_P(supports_selection_notification, 0); RG_DEF_METHOD_P(request_selection_notification, 1); RG_DEF_METHOD_P(supports_clipboard_persistence, 0); RG_DEF_METHOD(store_clipboard, 3); RG_DEF_METHOD(core_pointer, 0); RG_DEF_METHOD(warp_pointer, 3); G_DEF_SETTERS(RG_TARGET_NAMESPACE); #ifdef GDK_WINDOWING_X11 RG_DEF_METHOD(grab, 0); RG_DEF_METHOD(ungrab, 0); RG_DEF_METHOD(register_standard_event_type, 2); RG_DEF_METHOD(user_time, 0); RG_DEF_METHOD(set_cursor_theme, 2); # if GTK_CHECK_VERSION(2, 12, 0) /* RG_DEF_METHOD(broadcast_startup_message, -1); */ RG_DEF_METHOD(startup_notification_id, 0); # endif G_DEF_CLASS3("GdkDisplayX11", "DisplayX11", mGdk); #endif RG_DEF_METHOD_P(supports_shapes, 0); RG_DEF_METHOD_P(supports_input_shapes, 0); #if GTK_CHECK_VERSION(2, 12, 0) RG_DEF_METHOD_P(supports_composite, 0); RG_DEF_METHOD(trigger_tooltip_query, 0); #endif } �����������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/ext/gtk2/rbgtkeventbox.c�������������������������������������������������0000644�0001750�0001750�00000002557�11701304107�020155� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "global.h" #define RG_TARGET_NAMESPACE cEventBox static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_event_box_new()); return Qnil; } void Init_gtk_eventbox(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_EVENT_BOX, "EventBox", mGtk); RG_DEF_METHOD(initialize, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/README�������������������������������������������������������������������0000644�0001750�0001750�00000001532�12257552167�014350� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ruby/GTK2 ========= Ruby/GTK2 is a Ruby binding of GTK+-2.10.x. Requirements ------------ Ruby: http://www.ruby-lang.org/ GTK+: http://www.gtk.org/ Pango: http://www.pango.org/ cairo/rcairo: http://cairographics.org/ (optional) Ruby/GLib2, Ruby/ATK, Ruby/Pango: http://ruby-gnome2.sourceforge.net/ Install ------- 0. install ruby-1.9.x or later, GTK+-2.10.x, Ruby/GLib2, Ruby/Pango (and cairo/rcairo). 1. ruby extconf.rb (To use rcairo on Win32, set CAIRO_PATH as a environment variable first) 2. make 3. su 4. make install Copying ------- Copyright (c) 2002-2005 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/COPYING.LIB��������������������������������������������������������������0000644�0001750�0001750�00000063642�12257552167�015142� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/lib/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�12056665130�014225� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/lib/gtk2/����������������������������������������������������������������0000755�0001750�0001750�00000000000�12137115065�015071� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/lib/gtk2/base.rb���������������������������������������������������������0000755�0001750�0001750�00000004625�12137115065�016342� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/env ruby =begin gtk2/base.rb Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: base.rb,v 1.6 2007/08/13 11:09:22 ktou Exp $ =end require 'glib2' require 'atk' require 'pango' require 'gdk_pixbuf2' base_dir = Pathname.new(__FILE__).dirname.dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/gtk2.so" rescue LoadError require "gtk2.so" end module Gdk LOG_DOMAIN = "Gdk" end if Gdk.cairo_available? module Cairo class Context if method_defined?(:set_source_color) alias_method :set_source_not_gdk_color, :set_source_color def set_source_color(color) if color.is_a?(Gdk::Color) set_source_gdk_color(color) else set_source_not_gdk_color(color) end end else alias_method :set_source_color, :set_source_gdk_color end def source_color=(color) set_source_color(color) color end end end end module Gtk LOG_DOMAIN = "Gtk" class Printer def self.printers(wait = false) printers = [] self.each(wait) {|v| printers << v} printers end end if check_version?(2, 12, 0) class Builder private def canonical_handler_name(name) name.gsub(/[-\s]+/, "_") end def __connect_signals__(connector, object, signal_name, handler_name, connect_object, flags) handler_name = canonical_handler_name(handler_name) if connect_object handler = connect_object.method(handler_name) else handler = connector.call(handler_name) end unless handler $stderr.puts("Undefined handler: #{handler_name}") if $DEBUG return end if flags.after? signal_connect_method = :signal_connect_after else signal_connect_method = :signal_connect end if handler.arity.zero? object.send(signal_connect_method, signal_name) {handler.call} else object.send(signal_connect_method, signal_name, &handler) end end end end end GLib::Log.set_log_domain(Gdk::LOG_DOMAIN) GLib::Log.set_log_domain(Gtk::LOG_DOMAIN) �����������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/lib/1.8/�����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665514�014544� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/lib/gtk2.rb��������������������������������������������������������������0000644�0001750�0001750�00000000361�11701304107�015407� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/env ruby =begin gtk2.rb Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: gtk2.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2/base' Gtk.init �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/lib/1.9/�����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665514�014545� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/������������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�014726� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/���������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�016457� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-operator.rb����������������������������������������0000644�0001750�0001750�00000005024�11701304107�021711� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-operator.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Operator This demo shows how to use GDK and cairo to use Cairo::OPERATOR_* From http://cairographics.org/samples/operator_add.html, http://cairographics.org/samples/operator_atop.html, http://cairographics.org/samples/operator_atop_reverse.html, http://cairographics.org/samples/operator_in.html, http://cairographics.org/samples/operator_in_reverse.html, http://cairographics.org/samples/operator_out.html, http://cairographics.org/samples/operator_out_reverse.html, http://cairographics.org/samples/operator_over.html, http://cairographics.org/samples/operator_over_reverse.html, http://cairographics.org/samples/operator_saturate.html and http://cairographics.org/samples/operator_xor.html =end require 'common' module Demo class CairoOperator < CairoWindow def initialize super('cairo operator') @operator = Cairo::OPERATOR_ADD set_default_size(400, 400) @drawing_area = child remove(@drawing_area) vbox = Gtk::VBox.new vbox.pack_start(@drawing_area, true, true) vbox.pack_start(operator_selector, false, false) add(vbox) end def draw(cr) cr.save do image = Cairo::ImageSurface.from_png("ruby-gnome2-logo.png") cr.translate(0.5, 0.5) cr.rotate(-45 * Math::PI / 180) cr.scale(0.8 / image.width, 0.8 / image.height) cr.translate(-0.5 * image.width, -0.5 * image.height) cr.set_source(image, 0.0, 0.0) cr.paint end cr.set_operator(@operator) cr.set_source_rgba(1, 0, 0, 0.5) cr.rectangle(0.2, 0.2, 0.5, 0.5) cr.fill cr.set_source_rgba(0, 1, 0) cr.rectangle(0.4, 0.4, 0.4, 0.4) cr.fill cr.set_source_rgba(0, 0, 1) cr.rectangle(0.6, 0.6, 0.3, 0.3) cr.fill end def operator_selector combo = Gtk::ComboBox.new operators = [] Cairo.constants.each do |name| operators << name if /^OPERATOR_/ =~ name end operators.sort.each_with_index do |name, i| combo.append_text(name.to_s) combo.set_active(i) if Cairo.const_get(name) == @operator end combo.signal_connect("changed") do |widget| text = widget.active_text @operator = Cairo.const_get(text) if text @drawing_area.queue_draw end combo end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-image.rb�������������������������������������������0000644�0001750�0001750�00000002402�11701304107�021135� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-image.rb,v 1.2 2005/10/16 12:07:32 mutoh Exp $ =begin = cairo/Image This demo shows how to use GDK and cairo to show image. From http://cairographics.org/samples/image.html. =end require 'common' module Demo class CairoImage < CairoWindow def initialize super('cairo gradient') end def draw(cr) cr.save do loader = Gdk::PixbufLoader.new File.open("background.jpg", "rb") do |f| loader.last_write(f.read) end pixbuf = loader.pixbuf cr.translate(0.5, 0.5) cr.rotate(45 * Math::PI / 180) cr.scale(1.0 / pixbuf.width, 1.0 / pixbuf.height) cr.translate(-0.5 * pixbuf.width, -0.5 * pixbuf.height) cr.set_source_pixbuf(pixbuf, 0, 0) cr.paint end cr.save do image = Cairo::ImageSurface.from_png("ruby-gnome2-logo.png") cr.translate(0.5, 0.5) cr.rotate(60 * Math::PI / 180) cr.scale(0.8 / image.width, 0.8 / image.height) cr.translate(-0.5 * image.width, -0.5 * image.height) cr.set_source(image, 0, 0) cr.paint end end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/images.rb������������������������������������������������0000644�0001750�0001750�00000012610�11701304107�020227� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: images.rb,v 1.5 2006/04/08 12:30:03 mutoh Exp $ =begin = Images Gtk::Image is used to display an image; the image can be in a number of formats. Typically, you load an image into a Gdk::Pixbuf, then display the pixbuf. This demo code shows some of the more obscure cases, in the simple case a call to Gtk::Image.new is all you need. If you want to put image data in your program as a String variable, use the make-inline-pixbuf program that comes with GTK+. This way you won't need to depend on loading external files, your application binary can be self-contained. =end require 'common' module Demo class Images < BasicWindow def initialize @pixbuf_loader = nil @load_timeout = 0 @image_stream = nil super('Images') signal_connect('destroy') do cleanup_callback end self.border_width = 8 vbox = Gtk::VBox.new(false, 8) vbox.border_width = 8 add(vbox) label = Gtk::Label.new label.set_markup('<u>Image loaded from a file</u>') vbox.pack_start(label, false, false, 0) frame = Gtk::Frame.new frame.shadow_type = Gtk::SHADOW_IN # The alignment keeps the frame from growing when users resize # the window align = Gtk::Alignment.new(0.5, 0.5, 0, 0) align.add(frame) vbox.pack_start(align, false, false, 0) # demo_find_file looks in the the current directory first, # so you can run gtk-demo without installing GTK, then looks # in the location where the file is installed. pixbuf = nil begin filename = Demo.find_file('gtk-logo-rgb.gif') pixbuf = Gdk::Pixbuf.new(filename) rescue # This code shows off error handling. You can just use # Gtk::Image.new instead if you don't want to report # errors to the user. If the file doesn't load when using # Gtk::Image.new, a 'missing image' icon will # be displayed instead. dialog = Gtk::MessageDialog.new(self, Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::ERROR, Gtk::MessageDialog::BUTTONS_CLOSE, "Unable to open image file 'gtk-logo-rgb.gif': #{$1}") dialog.signal_connect('response') do |widget, data| widget.destroy end dialog.show end image = Gtk::Image.new(pixbuf) frame.add(image) # Animation label = Gtk::Label.new label.set_markup('<u>Animation loaded from a file</u>') vbox.pack_start(label, false, false, 0) frame = Gtk::Frame.new frame.shadow_type = Gtk::SHADOW_IN # The alignment keeps the frame from growing when users resize # the window align = Gtk::Alignment.new(0.5, 0.5, 0, 0) align.add(frame) vbox.pack_start(align, false, false, 0) filename = Demo.find_file('floppybuddy.gif') image = Gtk::Image.new(filename) frame.add(image) # Progressive label = Gtk::Label.new label.set_markup('<u>Progressive image loading</u>') vbox.pack_start(label, false, false, 0) frame = Gtk::Frame.new(nil) frame.shadow_type = Gtk::SHADOW_IN # The alignment keeps the frame from growing when users resize # the window align = Gtk::Alignment.new(0.5, 0.5, 0, 0) align.add(frame) vbox.pack_start(align, false, false, 0) # Create an empty image for now; the progressive loader # will create the pixbuf and fill it in. image = Gtk::Image.new frame.add(image) start_progressive_loading(image) # Sensitivity control button = Gtk::ToggleButton.new('_Insensitive', true) vbox.pack_start(button, false, false, 0) button.signal_connect('toggled') do |widget| vbox.children.each do |widget| if widget != button widget.sensitive = ! button.active? end end end end def start_progressive_loading(image) @load_timeout = Gtk.timeout_add(150) do progressive_timeout(image) end end def progressive_timeout(image) if @image_stream buf = @image_stream.read(256) @pixbuf_loader.write(buf) if @image_stream.eof? @image_stream.close @image_stream = nil @pixbuf_loader.close @pixbuf_loader = nil end else filename = Demo.find_file('alphatest.png') @image_stream = File.open(filename, 'rb') if @pixbuf_loader != nil @pixbuf_loader.close @pixbuf_loader = nil end @pixbuf_loader = Gdk::PixbufLoader.new @pixbuf_loader.signal_connect('area_prepared') do |loader| pixbuf = loader.pixbuf # Avoid displaying random memory contents, since the pixbuf # isn't filled in yet. pixbuf.fill!(0xaaaaaaff) image.pixbuf = pixbuf end @pixbuf_loader.signal_connect('area_updated') do # We know the pixbuf inside the Gtk::Image has changed, but the image # itself doesn't know this; so queue a redraw. If we wanted to be # really efficient, we could use a drawing area or something # instead of a Gtk::Image, so we could control the exact position of # the pixbuf on the display, then we could queue a draw for only # the updated area of the image. image.queue_draw end end # leave timeout installed return true end def cleanup_callback @pixbuf_loader.close if @pixbuf_loader @pixbuf_loader = nil if @load_timeout != 0 Gtk.timeout_remove(@load_timeout) end end end end ������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-fill-and-stroke.rb���������������������������������0000644�0001750�0001750�00000001414�11701304107�023050� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-fill-and-stroke.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Fill And Stroke This demo shows how to use GDK and cairo to fill and stroke. From http://cairographics.org/samples/fill_and_stroke.html. =end require 'common' module Demo class CairoFillAndStroke < CairoWindow def initialize super('cairo fill and stroke') end def draw(cr) cr.move_to(0.5, 0.1) cr.line_to(0.9, 0.9) cr.rel_line_to(-0.4, 0.0) cr.curve_to(0.2, 0.9, 0.2, 0.5, 0.5, 0.5) cr.close_path cr.set_source_rgba(0, 0, 1) cr.fill_preserve cr.set_source_rgba(0, 0, 0) cr.stroke end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/ruby-gnome2-logo.png�������������������������������������0000644�0001750�0001750�00000016040�11701304107�022250� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���P���P���Žò­���bKGD�ÿ�ÿ�ÿ ½§“��� pHYs�� �� ÒÝ~ü���tIMEÓ (1ˆ‰Ù��­IDATxœíœwXT×¾÷¿{Ïf 0Ã�Ò)6@ÔXcIbìõäÄTSŽÇ£Ñ“¨)7on<&1õĘfÔô¨IŒI°`b‰%ìXPÚБ†iLßSöº ÚPLÎû¾÷û<ë™™½WýÌo•½ÊþWÿ«?SÔŸ?ZÙ/mà×\¸, 9| YÓ«))‹vÙX¿Ð]@dD®ªàFQÆ#ËÌñK–rÞÄ÷ÿ ÀÂ/wù^øüãéÆººeúªêIv“I �"™ ¬ÑÎá��øÊƒÊdƒm}äØÏ›)‰ÌÕ]¼ÿÏTçåòü}ÕlMIÉ“6}cš|Èqìí·cðôé&%‹Á9]pè´(ÉÌÄÕ;¡*/w'ysèÂ…'¾ô2ÛUüÿ‘�˲2y7öfJŠúÙ—bxa` ?e’éŽM¯4R™Wq£??ý¬¼â×ìuÚÒÒ•"¿ŒGÅЄ$2Eƒ¸}¢ùƒÍ™Zµ µJ¥.jì¨iÿõrWé0}+jÿе¸¾çûð¬5ëþîr8îdÆd»Ù,a ]ÑOG®Yõ†5Ĩ½ê Äïx8¦îúõ÷´%esâ320yýz§§�œ*U«DI›ïqq˜°bv¯]+åûúMð@b<M}q÷ìéªüÂ@Q±§N¥ƒ““£êÒRiÅéÓ“ :À¹\Ó�(:G‹}+VE—Ÿüu§¹®nü˜iÓ0výzøH$pÖÕ5yj í÷¯îïòÄD�€±¦6®»|ÿÇ�Üsÿë#U…ï2Aܬ7Þ@ôäÉà1 8».ƒ•'N`ïÚµQºòŠ%Ĩ}•’ÈHGñœ|õÕÀê³ç>0+kÆ ’H~øaÐV+\Vk§àÚý¶Z�¬Éäß]¾ÿc�6®sš-‰3×­GxL  8–È%HƒƒQýÆ4õµü-�Ìžq4æŸ÷ùféãOhJJg'Ð4RGe±Àe±t¯–ÊJ�€00@ß]¾ÿ#�f¿ôâˆã/½:cȈó÷›› Žeᬨ€åôi8ÊËábY„BXüÀúò"t�pߪ§g¨‹Šž 0R&ƒ@*W[ë¾éQU9κ:pZ-àt‚–ËÁ<`¨¯_�ø…„”w—÷[°<ëKúÜ_ªÍË‹€ðÔÔÒô¬Œ_¼¤Í_NŒZl;!ƒ¢(ITHìyy V+ l—/ƒX­ �ð�ÐN'(aÐX]#ôL¯ôÇÝ¢ÌO­¦¬6q�‘P°,\õõnÎl†«¾Îòr¸T*³ÄåêQ<œÉɤ¥¡Z¡�Íã9mºÆ Ý•ó–�Ìya£Ï¯¯m¿§>?ƒ­±q Pa¶ú† xôæ©cç"'OoØ PÐ6}ã`ÀGX[ ‡V W]\ÕÕ Nwá�p�„€pÄ* ·z¦™·wºÍÐ82€ �ÌfpÕÕ�ŸN«…«¦.• œÑØg›1œËN¡€E,†òæMˆåò‘LúçXàõ?¬l(.z9<5Í7eî\ØT*œÛ±#ùúžïvhŠ‹çhɘQ©¤þ§Tùùpr`·ƒ×*> €€ €ÃbÑ„¦õL³æÒå;aµ @€NöÈ€+Ð&Þv²ÙP¯P Þj…4"<kÊ/ÖâÀÁ.ËÚï�>¹:áÂŽOVËcb}|ø!Dp ð À¡W^I¡™ àƒ–�.�!„P6xh?º§�°�,�BBªdуížéR4}»/!TZAj²`oå�p]§-XÒxGHRF·rtRðBe'N-†‹‹Ê¸÷^ðÌfØòóa½xaþþŒŒ¤ŠŠçXå-é†D q™ÔJÜ,™N\ÜÏ á#Gäx¤ÍÏûè**Sý�ø5ª3ÇëÄÑpW‹z€“ÅÅ}=î™м)o¿[ !Ü4™Œ{AL‡Ãxà�Àq@ߨר¬Ð�€$-™|”X­54:,N§§Rpƒ­À÷óÓÛOx¦©Õ4F:,?Y ¤p �#•ÆLš° ù^…ëw 4ÕªB!h¥¦;aÍÌÏjeá£RfßÊó´“þЃ٠éÆrtl}�*�¾rù¯ƒgÜ©òL³>ÿjнõuæX�§8Å"mTƨu3ß|½ÌÛòö;@»ÙÀÕÖÂüé§°ÿöxv{ ?·º¸¨M>w‰B2 ôš €í«—€‰¦]ÂÀ€£‰‹în×›Õj�¡çðì�.�¨§i—|Èà-±Ó&÷v¸�¢£ò­ ØÚZ0Ng <�|�„žU¯´#Nìò þÁJQDßÛ*îÞ÷�F,RbÕéà´vpü�à®êÞ¶y<¸ÛÔ³� išóŠØ—p÷Ô·Æ=ý|—ÓWžêw€4÷«€nhÍŽ ��Bxl£ï.iÖÝ{EÁòœ³pwÍàÏ�P3ŒcÀ°aï }ôñvÕ�üCÃt�`C{hYžÀ/� y<—$:r×ÒŸx`ʦw,=.oO<g-,ô  q$&ÎÜ1*}øoÿú?~ž~¤±1‡‰P¨«@û¶Œ�Šâø~"‡g¸ñ‹×Ö‡þßD,RípÀ)�W�d²“Ñãoû¬³|É£†ûˆD¦z¸;ÀÏ�Jx´KþeÒ¼™ëB’2z èÀë–'eýôk0œÔgi%Ç.}úåûç^ÝZyôP‹¿Ñ«Wæðý%×+án_Zt� hÊ.Ž5zÆO “!uÙC§¢ÇݶŒ *ºÈãÙÎñx,_.?“<oÎSÓßÚ\ßYÞB§Ž3Ë <« Gçà� À!�• c•''½3tѼuwmù¨CËöF^õúºk—DŸÜq÷לÝ1rôc!(.7/\.:zô¡3[·FÆL7;gY?Ÿ8þ³ªõ„<B¨q­2o�[PB|»' �H¾÷A€CÕG²~+ýõ·‘¬Vï;濞ù%0r`;‹õ”H&ýTÍçßvÖn÷ƒöƒñz¸;‹�ÿŠ„IŸûëÁ¬owÃ}Sæƒ÷Í{Y$"{ö§ÍF\6±ÕÔ3/¾HþEÓÎ]3grø‰„¼~ô5€äÄ F€¼×¥9ª9íÚÀ¾êÒ»¯·ÄÆì| R @ �ò@ÞÈ+"‘áÝAqŸ}¿haJí/¿ôKûß­ê/_e>žqÇŒÐäd„  §²\£NÁ øÇ«½|å¾¢ý²à~\Å›^Vé+*7”hu#X­òñp÷¦VŠ")É'B¦Œk÷(ÖW¥¯~Þv`ÙCŠ~:,ËU7L/wº|h�zŠ"œO£Hx-*9ùß³þýúá ´1,¾ÿ¡_Òí ¦ºDÈóñ‰K$àÊÊ`ih€íÂØKJÀž9ƒP� vGÚùíŸDÈ�J"Cíñã9NûxÕÙsfa� (ö“‡~Õ/9ï@s>û¢$ç®{r¶l~Øn1ßEfüYÛ•„™32‡-œ9üö;X¤é×4»hªW1'v¨Õ0~ó Ø¬,ƒ”Ë>€p�7õúpŽp#Ð�¦N%ÊSÇößöIž­Q?Ó¬VKcÆÛ;~b923ûµ­•|ÿ}Æúœ3ï>¸¸€ „ÁŽ”s¹ž Ž{¢n%ÆY]vûÍ†Š hÊÊ`±´Ì¥Q�B�ЄP Hðuë°áîy¿R�ï�Î]�ÞÞâUÆL¥Õ”®ªH ¼tÑ×T§bL >æúzƬQóÀ �¾ ŠdNL° ‰·…&Å[SÆpp?¡Ýryµ.üã}÷,ººëÛ½CdÀÝ«6tØ€>àÈZeÝ]}ÉLõñÂú¼¼ôÒc'“«ÎœšŠæ‹Åá„@L\.‘Ëés‡Í� Mó\ŒP §Fçr:µœÝQš4{vvâ¬YÙƒ-Rö%?ÞÈ+€äòyzó¬y¿Øjk'O  €6V¸ €á]yA×Ú“ªróÔ1~ñCIùûöOàñù³´eå“V«¯oh(¤11ð•Ë!’ÉÀ—Já‘T ša@óx „ã`ih€±¶¶5LU•¨Í˃Y«ÏÇÇ.8ð°xض©ëŸ<9kþ-±H¯w&XöPê3¿õÑ7ž@Žß~ ‘ÇË{¡¨!•Šïz?‰îÚ%êòîoC*Oýz—ºD±Ìa± K˜ÈŒ ÄŽ‡À!C ð÷#‚@3î–†�îÅ!BÜ?Û ˆÃ»Á�³ªšK‘·gn^½ ‹ÑhðÛ0ó® 3Þÿ¨ÓÁxoå5@bÔbǤé÷7äào³ùO ÷TÓg�|cc÷­ÎË]ÐÙz­òäQúÆ÷ûåÊk׫ îg †1ôð%K?>BRR@ûø¸·9Ò§iùÝÞµëvËBuå ÎmÛ†¢cÇ\b¹|ïÄgÖ®ÊX³VÝgj­Ô£½1æ²"Þž–-Q^¾²X,’¸~ ã4eòßî;úËç…»ôæfñµÌï–5>ck4DÅŒ‡Q=†¸©ÓÀøŠ=¬ªiWY3œæ{Ý\C«k¤5H§Ùo½… »ws±±Ûþ‘Ÿÿ^pêT=Þ\tjãžúF~jù©_×rGES”X.ÿ,aúïÞñÞ{mÖj Êë¼CËŸ¯Ì½üœ©¾~JDr² ã±Ç0pÆ üüZYº„€Î z†ë亓eqüÍ7q-3Ó6ûíÍIiO¬ªè®öêõî¬Òûøe'NÆ0|›6¡là_æ·¬à£?=ý\ÀÍsçŸÐ(JV0 žºd Rx�¾ááMž:‡×ÆÊ:±¶Žªm‡á›~×âÛ•+ž6rõ²Ó9ïõ¶ÜžêõšÈ 9óìhÙäóV›{Y«Ö†Už?³¹¡ ðžè”Lzê)„ë®RÍ{Tº‚à ¢íîuáO,AŒº«y‰ú›åt`ä@¯v v§~_Túþž…C‹Žüô‘¥A}ÛèY³0fõje2æý)}¬¢†ïÄ_ë?ˆfYN‰$BsñŠl éú `}Îê쎆þ¸o78.qü}÷Ñ©÷ÞëÞÚÊê�´·¢.ªr»êÜÚ_gquäÏfÅq FlÑ©û­ÜýÑÙ­ï%ÈÚIllòÔ+x×] hºÅò:µ(k]µ‹ÝZg'×!`aÒëÁR–2¼W³Ï©_�îýËÂÅ‘c_:¦¡³Ö¬ÁÀ‰›­uu[å<ýxÒ[à êü|4êtˆÌuU>zL·´ÞªÏ�Õ—r}¾½é³:}ú˜»ïFì¨Q Íð€îÛ0�”gõëJO 7ûuX­¸vú4|D"㈖~‡ ûZìõ `Á®Ï©ƒO®™­Q”,KHà¸ë.›Í}³›F½'PÚ…óróSrö,”••D:xð®ŒÕOU÷¥ÌžêÀüÌýRBñ_±X8völðZµy=ÒƒkÝZaÓ5Žã ®©Aö‰à\8iâ›ÈÏGªO�­ãBS½*müôé 17 º©RTÖØÄæfòˆ¯³ðšúz?|.š®š²nÆòGËðѶ¾¹z 0ï‹Oü^÷ì±HD' îî4€­…juô!p8@X„eÝ‚HŠÏoÓŽ¶N£¡¾§³³¡5™Ì'O|~ìÊU'¨Ôѽ'Õ‰z ðÜ{[“6[zbJ <Hë±^=Ç{í¬¨éz;xV+œeepTVÂ¥R, Ph™ ´4ð""ÚÄCA]]Nž9£Ýn4mêÚ¡óç}>xá¢n÷úõF½HÀ¥r,ª ž·Þ6F+ëiåX,°—”À‘Ÿ8nè-‰lv6·ÝZ*uïbu:¡P*‘sù2ÀTÇNšðô°Å‹ö |y¿<¶u¤^¤hÞ(†Ô×ÄbiÏ=ßÞ¶Ýj ò¸ÞÆ N8kká,.§Óâº(»ÅgI ø))h´Zq¥¬ ¥’d²+!ɉk¦nx!'bâÔ[è@›NÅãó!Ü=/ÐκڵƒM~Hþ(�œÑgq1\uu�Çu¸Õ×SœJ…›¾¾È©ª‚ÞjuDGŒ¿cúS3ÿýzù­Z‰k­^´è´r‘hOëë¤çmÝqxVYb³ÁYUWM ˆËÕí[ó}€<«ÕùùT ¼}ò‹s¿ütw@D¬Ûwô¶h=R¯òxŒƒ8 K ÝͲ´ét‚Óë᪮n‰§3xÍ× ÜÓ(E�Š8…B]PLT–|HÂKÉsç•DÄޒ΢3õ  À_o«QÂe±€ñ€Gu��Ç6¸º:pz½×ÕÕ î BZšvú…†^ÿêôW6Ž˜0…Åþ¬Þ§×ê5@‘LVe.¯€Ù`@�צsðì8ÚTk–§×ƒÓé:ç) n«k€{¸€P*­ŒNJ|kâúµÇ/XlÄ)½-FŸÕûa çºêp¹ ×hàß´¾áÙ ·é,“ ÄdrŸMë"îÖP�òà¶<â+VEDî OO}Ú kË’GßÒÖõ U×XHñù–ƒAM5Ù³ä8Àår?=X,€ÓÙm×,îN"€Ž¦í’ˆðœ¤ÄCg/ȱz¥_ÛÛ¬÷«z½¨”ýòƘìÍ[úk4Cgòùàñù è&»j§Óíš«°—‰»�\GÓQq??­TÔ«3Þxeë 9 ûe¾?Õk Lž0¾ú܇[s€¡»þöŽ·üyóµöãÂï;ç}rÓ¼9æÊ 9 ÿôêÚ‘úôÒ‰ï.˜›Ÿ¹ï‡tŽã¥µŠÌÛqœ§œ�.È£i—xÀ€ŸMŸúļ/wVx›bÔByõ¿ìØ/þe'NIL*cÕé†Ïçb&Œ3 œ2Ù<òñÝ¢î‰úð›ÙwË•¹WN •µÉ3�øö1¡�Ç�H¢"ÄMžôؼ»½žü,ܹ+ìô–Í‹5Š’Ñ‚�ÿ8‡Åí²ÛÅ.»]HÑ´SPCóx7E² ½ÿ¹ú«ä‡iw`§7ê@KA ýÅâyëT›nã8Þ/"ìì¾@�V&­»zùØÉ^ëv#ÉÓR™¯¬S›—·®¡ p¡e`À°a†…Á7&™ ¬Õ ›Á€ú‹¡8z!ÉI_ùûßžH_ýdc‹ÜN}šP'Åsç·¼ñé‰7=V ×Ž éÀŸ7Pk�Æ÷¶8PÒí±b,¡·›ôOmyÅZ‘¿xÆC!eÑ"$%Á7(<__P Óf Ï66"û¥—pvëG‹³ßy7@Ÿ7J÷y§úè5O«eqß32Œ½�¿oyk}>ƒêÀyÞ¯�mHdÙ±Œ>ßq·ÝJ?þ1ASZú¼<<<ü¯Ÿヌ¨É“áì>/l2ÓéÀiµà4pj5|XI“&A ŠÉྖè§eÍÑËÝ}ô…¹¢RMŠ–C…�¼¯ÒV�„#Ny|’Æ›4Gg¸X»dÂüù W¢ø}ìéùÙê»%7N‹‹µ_ÚÀ~8|éRMÞw™›ËOÊ8ïp&Ã}>®3u5@5Eù^úbûHbÔén*JS\ BxBÀ)mîuuîð<ªùI‰e¡ùòK8—E«ièC‘[Ô/�)‰ —=pL6àÇ¢ªê¿FHDûƒÓ])À5‡Ã¯êìù'Nnz=MgN:’¡²z?e”œáÍkl)-œNšp/‚++ŒF€a@I¥ ‡ îÆ 4TV‚'ñÓESC?õ½ðý©ËÛÞx#HVó6@J�b𛜠û�² ÛÓÒ6^ÙþQ§£¢ n½30æûw||Hí‚Äöè£Ä’žNÌ1휥əò>@^õó»vã«OCû£ÌýzÜ5uùªy|üJ‹€¯;÷¼]GHk‡¦OÀ8�ƒ�Ô]¹ò\öÛ›?ÈZþHTGé”9iUk§ ‰àwó&¸ŸrsA±l§i�@-Ü'5ƒâ;²× [«ßÏ ß½éÕ¬ÐaCßÔ0Œí7¸O zÓ S�Ä�f�Hà8F_¬¸ïêîo}5mò½ûî_Vuø ©.£¯^¡ÌÍ}Þa4JSXJ©l™Œí, '€\�Œ@`Ëeßutp»7º%ï<õܳ’üýû·ÔßÈ_– `ܧսí‘Y¸Ï ŸÀÒçzÍnµ\uZ,¬H&K³¨5#‡¸\Ì,Šj™Ìí(žÖ*p�€oLô®q«Vþmôúgúe‡Ö-{ãñõ+„…Y'w¨ ‹îMæ8Þtx±u¦,p[M%ÜoÕàà"Ÿ M'້pWÝïØ• ?ù(#aÑ_ûí�Î-{wÖ”¥Ël•yÓfó)¬¬Zäp¹˜éèøIè¬/€ �FÁm•îá‘/:n{:ŠÃà(�«P¨šüTÂn!À¦mÚogÏYÈD†â‚Âe,Ç1ÓÑöN—q4}ú¢ó‰Š®â0Â}:]IÓÎàøøç|¼í{$ó¾^¨ËWIõ‡ö›Ÿ_³æˆËÎZªjj&„5Ýﮇz�™�ªhÚ6røkþ¹æµØ;fü!o‰ ¿ûÊçó‰ã¾)—_} ßä&@�qvà\Ý8®gH.@¶�ä‘H»=uä“ß}Kt«ÊuË:‘ŽDŒZjÿŠUÉ¥ÇOn074Ìôs8ÄäÃ]EûR\p¯¡ä�(¦(Ž (’ø¯ùÛ>Ù+‘Ò³·õ@(ÀfãiúëÅÕåå=cPÖ¦K� `@7a=ÅÁÝË^‚{¨ÂòxyBÂçÉ æ¾vû&ï_áÔ[ý)�À’¯ Î|úa€ZQ2³*çìßX½~ åpe�’àÐäøø½×åà~ÂÑÁ½F\  �%DÒÀ‘£3Þ ’˜}ûóÏ8þˆ½1Àfi¯\Gþ¾ï‚GŽÜf7™çª‹“ !a4Ëú‰¡DpøMŸV¸ŸnL�™fU@TTŽ8(hëÐùóó2Ö¯7ü‘ùÿÓ¶ÉÓ¢àÚOÁ¶o­V'ø‡…¥²&ã0»Ñ$µLRË }ƒåJ‘TZãr:.ý%§RïàJÚÔ+©a³½Õúcâ¥òzÉÁÚ����IEND®B`‚������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/README���������������������������������������������������0000644�0001750�0001750�00000000110�11701304107�017305� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gtk-demo for Ruby/GTK To run, do ruby main.rb in this directory. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/gnu-keys.png���������������������������������������������0000644�0001750�0001750�00000007414�11701304107�020713� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA��± üa��ÃIDATxœí˜kt]e™Ç゙[rré-MÒ&iÚ4Io´Å¦ ´ÒŽÈÀ¨C;D™gPQ†¼T•²Æê×Tg´ule€‚´¢Pš^Ò¦—¤-msk’æ~9IÎmŸ}y÷|ˆ¸)¢ÂÌ—þÖ:Ÿö~÷yþûyþû}Ÿ.q‰K\âê»ü¬2 àC^‰ÅFíd"弋ÏK´¿t᪵ËUËrL+éÍ·RéuÕóæä-©Y<e°o0½oßÞv×¶‡`/pp�ÿ]Šû÷ˆ¿dÑôÅ—\5Ë|dùŠ%‹¯ûÀµúÄÉÈÏ™„nøH²#YÃmçÛk±ýFí¾ÚÌþÚýÛ}߯z�ûÿC€Ì>VV^ºzÍÚU+W­ —”•(=ݽœoí `˜L-(`Fy9&NÀ•šªaYVü왳Év½°mÛ·íª:ÿ/LÖ/zßeŸ½fÍÕ¯ºúÊ�B01o2µjyñù_³è²Å8®ÃPÿçšÏ±î¶uÜpà H)B0Äãqm_µòý[úûû¿ È¿VÀ;ñ@V(\{Ãß^¿îº¿¹fr(6¤  IG{ÏîÜÅæÿøÉx‚3¯céKàÕ½¯¢( �ª*H$â|ñžÏ)ñT¼4h×?å]È‚òî¹üëeýÇn»eŽ®†©‡š¢Y9œkj¢xú4J¦—bè¶þd+W^y%ÕÕÕ¬ÿ‡õhBÃÐ š›š¸ûîÏÐÔÖL  ’™[³|aåÛýéœù³ßIl2F~~þ‡®¿îƒ+÷¨Õ&OÊGÓ Œ@UÓ©®ªâø‘|àA<×ÃÇç _øŽã 8n†S§Oòõ¯n$I1½¤UÂfV^~î<`wn~®ˆ ÅtÓ4'8ŽÉÉÍž-„Z¦éêXYyñÙÞÞÎTÂ’€÷æ�ßÖª¢ÖÜ{ß½Û¿ô¯_šŽq¸®ŽãÇŽR\RȬŠJŠ I§lÚ[Û8yú%e¥¬^½UQÑ5•M›cÏî_‘•“EVvÏ•xŽK"‘ ¯§ï•y‹«n ƒ•/ï®»ñæßø’ò’iK–,ö55ä4kØ÷ê>+cY­Ï=û\mOwÏ0ð ÐÎxçmÿ×O~ú“/œ¿P „¨Be``}û÷ràÀ!ÊÊŠ)-Á¬Ù 3�bÃÃlýÑÙ[»—i%…hšF*™$•Lc†u¬T††c§ÁPðÀôâ’Š;>u{áäÂ)j0Àµ%yyB’Ê` èp㉸õ퇿]WWWwôBç…ÇQ`ô¢òróJnþðÍ'¿ñÐ7†j€B4EÃ4L¤ï³oß«4Ÿk¦§¿‹p$ÂâË/§¿w]»þ‡ÁÁ¦•MÅP5úb$“q¤ëÓÖ|žtÚbáå—±öúkœÒ²r=šeltŒ_=ÿ"GeÓæÇÈÍÍG7t¤¯MÓ0MÓ÷¤×ûäö'ýÃü°þøñãß½¨€ÂÂÂÍ;~¹ãîòòrt]G"ñéIÏAÓ4¡0º®‹ÅhhlàÈázFÆFÈÉ 3:Ã÷$ccc$IFãcœ8zšÊ9ÜzÛG ‡B„B&äMæØ±c<óô.ª««¸é¦›)/+ÇW|Õ¢|f9ápEQP… <ÿÂ.·¾þøÐÓ¿xºúb&ÎÎ8™ÒŠÙøîøîo¨R‘¸ž‹°inm&77JÕÜj–-_Ƽyó9sö4gÎ"•Š“JY8R"}Ÿá¡·ßùqÊʦaè&šj`A4Måà¾ÃlذkÖ\ƒ¦k  ³óéÔ¾ZËÆolDUUt]§¥¥‰_û}ƒ}RL7^L@éG>ú‘2EUPuðéïëãøñÔ××ãù.+®ZJñ´Bz{zùþ¿of$6JEE% Š;î.ß' ÐßÝ˪Õïg΂ùHÏC× ²"Y˜z€@0H__/C±AŽ=Æ¡C‡Ø¹s'K–,aÓc›ض͑#uüÛ}÷ct¦L%O²xɼåÍ@QQQov(»ª­£Gþ&]]]Ì]PÅe‹1µ¨€ìHªªSPXÀ+¯À0LÚšÛhhlॗv“HÅ©¨˜‰c»H–.»ÓÐiiiÆq,²ª*QUáÃí·‚×ΞáÕ½ûÈÍËå¡GbÖÌYƒA�žx|;wî$;7‹p(„¦*˜ƒ–æ–ª‹y øÁŒòïËËÏxãÍdá¢ùÍ0 §xþ…Ý öö³ó™_bÛfù»/›ª¨H_ÒÙy_î|І'˜<©‡¾ù¹9¹¨BcÇŽ§8yº¬ìå3Ë™;g¡P×s ˜&¾ªÁpl˜Ç}Œ£G3½´„RKÌ Òv¶5öVý€�>3½tZ͆O~¼ìƒ7^/fÌ(£«³—¯=¸‘žž>.\ÄàÀwÜùI à­­áÁa&Mš„/}TM#;+ÏÑ#Çøä§?EQQ¢*ÌŸ;ŸË—ãz’ÎŽN¶oŠd*Iii¾2~nìçË÷}™îÞ.**g‰d‹‘ÉØhšŠ¦+HOjo.¡ˆaè‹ïüÇ 7\±rY…¢¨"޲õ¿ŸàÜÙ&6>¼‘¥55<óì.<×¥­¥•-?Üž÷pÓÍ7QZVŠi˜ öóo=BÝá:’©=Ý=¬X¶Çu°,‹¤›K–ÔpõÊUܱAR{`?ßûîwÉÎÉE 'OP6£ן‚"#±QtM! 12Cúž”Ê›K¨âcëo}ðÖõÿwcñ˜¡)ùùˆ ŽR0u ùù‡#<ú­ïp¾½ƒ“'©YZÃ]ÿt††ùâçîå|{EÓ èëígé’+xtÓ&©8¾ëc;6®çŽÑ„@Ó5BÁ0éLšî®nNŸ:…í¤¸ÐÓAr,M"1F*™&™Jáú.©x ¡Hñ´û† L™2eõº[o½ÉJY†›ñ‘Š ŠŠ§¢é:ŠP‘,²³³ÙýÒnÂá0ªªâã³ûÅ_ñ£-[H¦’L)žŒišDó¢?QÏðÈ3€‡‡çz(BAø8¶Ã`j�ES˜R0™¡¡!z{»HéáI#`ɤQ…FBz(¾B$’Õý‡Ìše5wÏš5+0!wÃ#Ãlßþs×aÑâ…0ƒø Ÿ[Ö}”P8‚P¶m£h ;žÚÁÖ­?&šeJáD‚x"®©ô ÷ÒÚÒJUUŽ;~Ðó¸¾;n<E =‰mÛH$ŽkcËñkC'm¥Ñ4•Œkc »äªëVþülXÿ‰õ3²²²ª ¨°ˆû¡‘ažØ¶–Öó }æÎËÜêyøxZËJ±ù[›9Twªê™èšÉàÐé´Ì€ŽÔioo£ªªŠŒ—A À_úøþS3ð=_Ž‹´m!T<W¢**™´ã‡"‘]»ŸÿÍý@vvvQeuå-+V¬Ð…H)I¦’ ÁÔ îúô]$R Z›[i8ÙÀ÷6Ÿ™3 ‡#¼²÷e\Çbîü*‚A“±Ñ$Žç ™$ãI,ËÆ4L`pÀÒtM14Ãt=—ŒÌ ½·nÈtCÕ.RJEA7 2V=`’HŒ1<8x žHÜßt¦Mª�žôVþóŸ¿gáÂ…ª‚|ßÇu\Ò™4ñD|˜4yóÌcÁ‚¤­4ííç™V2P–* 2VÇv¾rܬÛvüŸnûÙaß§µ¤´DF£QÇqþèÍ(ŠB:¢««]ÆFcŽk£é¶mËÓ g;lÇ^?6oLÄ“ã M8ž7kÖ,EH/|ðAH븨BÅ“¶kcÅ-üQ]Ó©YZC$¦§¯‹‘‘>ð%Ž'Ñ4 UÅ?‚ø>D"YÃyù¹ßÿêƒ_¹å?·ð³í? —Ï,kšf:Žƒ”oÌ„m[¸ž+¤ç¢k&�±¡¹¿öàñöópm÷ØïTTT,›]=[(Šòûº”Þx3޾¯SEŒ_Ï8R©Žë’É88®‡çI‚¦ª*šŽ"@Õâñ³+Ë_ŒF£¿êîêþâÕW\ýÜ=Ÿ½§©¹©ù|v4Û ƒ¨ªŠÀ²,\W MÓÑ ƒó-í郵ugóósîrm÷ù7d m¥½Ý½íšªùB<ÏÃr-¤/ñ<!žôpÜ7¦]Ótð\|O¢j vÆÁóÁ“>¾P@(hB;uáÂ…Ï5?=Èx'uÔ÷ýyjûS_ºöškO¬YµæpÝ¡:+>—š6¾MéËÞî>÷™»Úî«Û¾dù‚;O5ž;üæ’{}#»6//oÃ<°xÝmëòMÓŒ¦’)||×ÁõÜ?ªUUUéì¸Àkgèho#ã8Ø™ –e“N¥q‹3§ZÚ\/ó‰“ g_~K·‚ ÌÖTÏ©¾º²²ryAÁT[QeüÀþƒÁ¶ó­Ï&¶e,û7\dª÷º�È>“ÍYðäŽ''UTTT™3šL'ßÒlªªÒ××K}ýA¿³«CøRJ%A ’é”êÄk£Bãöžþg[šÛÿÔŒT²€èïâ˜4«Šhõ¤Ÿz»…o>JhÀBàÎÕkVÏÝúøÖjUSÙLÏóÞ DUUº»;©?vÐëììT¡aYvÆáÈ¡c=gN7==ö'ÿ«yóiT]ÀËm-mÝÛßV 3ÓK¦«Ñìh�áËqª¢Ò×ßCow·’L&0 ƒŽŽ Ní¾C½‰DüŸûzû·ò.LÞþ\¯“Τ’©Ã/íyÉÚûÛ½ÅݺÝeË—…r²sMÑÐ5ž¾.bÃÃ$ ¿áDcêx}ãk+V.þNg{ÏÏcC#4Ãy/x'³QÈV·¬]»¶êÊ«®œYZZêŒ Y{öìQ~û›WR‰ä¶ínaƒÿž¿ù×ùsÇë âw¿¨®ŽkwD"áß&Éöw?¼K\â—¸Ä{Ìÿê;Ô$Í誂����IEND®B`‚����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/menus.rb�������������������������������������������������0000644�0001750�0001750�00000011211�11701304107�020105� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: menus.rb,v 1.4 2005/02/12 23:02:43 kzys Exp $ =begin = Menus There are several widgets involved in displaying menus. The Gtk::MenuBar widget is a horizontal menu bar, which normally appears at the top of an application. The Gtk::Menu widget is the actual menu that pops up. Both Gtk::MenuBar and Gtk::Menu are subclasses of Gtk::MenuShell; a Gtk::MenuShell contains menu items (Gtk::MenuItem). Each menu item contains text and/or images and can be selected by the user. There are several kinds of menu item, including plain Gtk::MenuItem, Gtk::CheckMenuItem which can be checked/unchecked, Gtk::RadioMenuItem which is a check menu item that's in a mutually exclusive group, Gtk::SeparatorMenuItem which is a separator bar, Gtk::TearoffMenuItem which allows a Gtk::Menu to be torn off, and Gtk::ImageMenuItem which can place a Gtk::Image or other widget next to the menu text. A Gtk::MenuItem can have a submenu, which is simply a Gtk::Menu to pop up when the menu item is selected. Typically, all menu items in a menu bar have submenus. The Gtk::OptionMenu widget is a button that pops up a Gtk::Menu when clicked. It's used inside dialogs and such. Gtk::ItemFactory provides a higher-level interface for creating menu bars and menus; while you can construct menus manually, most people don't do that. There's a separate demo for Gtk::ItemFactory. =end require 'common' module Demo class Menus < BasicWindow def initialize super('menus') self.border_width = 0 accel_group = Gtk::AccelGroup.new add_accel_group(accel_group) box1 = Gtk::VBox.new(false, 0) add(box1) menubar = Gtk::MenuBar.new box1.pack_start(menubar, false, true, 0) menu = create_menu(2, true) menuitem = Gtk::MenuItem.new("test\nline2") menuitem.submenu = menu menubar.append(menuitem) menuitem.show menuitem = Gtk::MenuItem.new('foo') menuitem.submenu = create_menu(3, true) menubar.append(menuitem) menuitem.show menuitem = Gtk::MenuItem.new('bar') menuitem.submenu = create_menu(4, true) menuitem.right_justified = true menubar.append(menuitem) menuitem.show box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, true, true, 0) box2.show menu = create_menu(1, false) # menu.accel_group = accel_group menuitem = Gtk::SeparatorMenuItem.new menu.append(menuitem) menuitem.show menuitem = Gtk::CheckMenuItem.new('Accelerate Me') menu.append(menuitem) menuitem.show menuitem.add_accelerator('activate', accel_group, Gdk::Keyval::GDK_F1, 0, Gtk::ACCEL_VISIBLE) menuitem = Gtk::CheckMenuItem.new('Accelerator Locked') menu.append(menuitem) menuitem.show menuitem.add_accelerator('activate', accel_group, Gdk::Keyval::GDK_F2, 0, Gtk::ACCEL_VISIBLE | Gtk::ACCEL_LOCKED) menuitem = Gtk::CheckMenuItem.new('Accelerators Frozen') menu.append(menuitem) menuitem.show menuitem.add_accelerator('activate', accel_group, Gdk::Keyval::GDK_F2, 0, Gtk::ACCEL_VISIBLE) menuitem.add_accelerator('activate', accel_group, Gdk::Keyval::GDK_F3, 0, Gtk::ACCEL_VISIBLE) optionmenu = Gtk::OptionMenu.new optionmenu.menu = menu optionmenu.history = 3 box2.pack_start(optionmenu, true, true, 0) optionmenu.show separator = Gtk::HSeparator.new box1.pack_start(separator, false, true, 0) separator.show box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) box2.show button = Gtk::Button.new('close') button.signal_connect('clicked') do quit end box2.pack_start(button, true, true, 0) button.flags = Gtk::Widget::CAN_DEFAULT button.grab_default button.show end def create_menu (depth, tearoff) if depth < 1 return nil end menu = Gtk::Menu.new group = nil if tearoff menuitem = Gtk::TearoffMenuItem.new menu.append(menuitem) menuitem.show end 5.times do |i| buf = sprintf('item %2d - %d', depth, i + 1) menuitem = Gtk::RadioMenuItem.new(buf) group = menuitem.group menu.append(menuitem) menuitem.show if i == 3 menuitem.sensitive = false end if submenu = create_menu(depth - 1, true) menuitem.submenu = submenu end end menu.show return menu end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/sizegroup.rb���������������������������������������������0000644�0001750�0001750�00000007016�11701304107�021015� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: sizegroup.rb,v 1.5 2005/02/12 23:02:43 kzys Exp $ =begin = Size Groups Gtk::SizeGroup provides a mechanism for grouping a number of widgets together so they all request the same amount of space. This is typically useful when you want a column of widgets to have the same size, but you can't use a Gtk::Table widget. Note that size groups only affect the amount of space requested, not the size that the widgets finally receive. If you want the widgets in a Gtk::SizeGroup to actually be the same size, you need to pack them in such a way that they get the size they request and not more. For example, if you are packing your widgets into a table, you would not include the Gtk::FILL flag. =end require 'common' module Demo class SizeGroup < Gtk::Dialog def initialize super('GtkSizeGroup', nil, 0, [Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_NONE]) color_options = %w(Red Green Blue) dash_options = %w(Solid Dashed Dotted) end_options = %w(Square Round Arrow) set_resizable(false) signal_connect('response') do destroy end vbox = Gtk::VBox.new(false, 5) self.vbox.pack_start(vbox, true, true, 0) vbox.set_border_width(5) size_group = Gtk::SizeGroup.new(Gtk::SizeGroup::HORIZONTAL) ## Create one frame holding color options frame = Gtk::Frame.new('Color Options') vbox.pack_start(frame, true, true, 0) table = Gtk::Table.new(2, 2, false) table.set_border_width(5) table.set_row_spacings(5) table.set_column_spacings(10) frame.add(table) add_row(table, 0, size_group, '_Foreground', color_options) add_row(table, 1, size_group, '_Background', color_options) ## And another frame holding line style options frame = Gtk::Frame.new('Line Options') vbox.pack_start(frame, false, false, 0) table = Gtk::Table.new(2, 2, false) table.set_border_width(5) table.set_row_spacings(5) table.set_column_spacings(10) frame.add(table) add_row(table, 0, size_group, '_Dashing', dash_options) add_row(table, 1, size_group, '_Line ends', end_options) # And a check button to turn grouping on and off check_button = Gtk::CheckButton.new('_Enable grouping', true) vbox.pack_start(check_button, false, false, 0) check_button.set_active(true) check_button.signal_connect('toggled', size_group) do |check_button, size_group| new_mode = if check_button.active? Gtk::SizeGroup::HORIZONTAL else Gtk::SizeGroup::VERTICAL end size_group.set_mode(new_mode) end end def add_row(table, row, size_group, label_text, options) label = Gtk::Label.new(label_text, true) label.set_alignment(0, 1) table.attach(label, 0, 1, row, row + 1, Gtk::EXPAND | Gtk::FILL, 0, 0, 0) option_menu = create_option_menu(options) label.set_mnemonic_widget(option_menu) size_group.add_widget(option_menu) table.attach(option_menu, 1, 2, row, row + 1, 0, 0, 0, 0) end def create_option_menu(strings) menu = Gtk::Menu.new strings.each do |str| menu_item = Gtk::MenuItem.new(str) menu_item.show menu.append(menu_item) end option_menu = Gtk::OptionMenu.new option_menu.set_menu(menu) return option_menu end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-text-extents.rb������������������������������������0000644�0001750�0001750�00000002151�11701304107�022530� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-text-extents.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Text Extents This demo shows how to use GDK and cairo to show text extents. From http://cairographics.org/samples/text.html. =end require 'common' module Demo class CairoTextExtents < CairoWindow TEXT = "Ruby" def initialize super('cairo text') end def draw(cr) cr.select_font_face("Sans", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_NORMAL) cr.set_font_size(0.3) extents = cr.text_extents(TEXT) x = 0.1 y = 0.6 cr.move_to(x, y) cr.show_text(TEXT) # draw helping lines cr.set_source_rgba(1, 0.2, 0.2, 0.6) cr.arc(x, y, 0.05, 0, 2 * Math::PI) cr.fill cr.move_to(x, y) cr.rel_line_to(0, -extents.height) cr.rel_line_to(extents.width, 0) cr.rel_line_to(extents.x_bearing, -extents.y_bearing) cr.stroke end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/alphatest.png��������������������������������������������0000644�0001750�0001750�00000063641�11701304107�021142� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR��|�����B‡}>���gAMA��±Ž|ûQ“��� cHRM��o?��r‡��ô$��„Ï��m_��èj��<‹��W§–mª��g,IDATxœbüÿÿ?Ã(£`Œ‚á�ˆi 0 FÁ(£€>� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 9]:= ¨�h´À£`ƒÿþ3Œ–÷£€Z� €G[£`Œ‚Q02�@�¶ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(äàÿ£€R�@,í€Q0 F~ÀÈ8Ð.Ã�Ðh Œ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� –vÀ(C D–,ó�Rî ŒŒÚ@Z›È``dø"€èµŠñÿö¥áŸÚ­£` €�büÿÿ?Ý,SLWRÜdhæ$†—7×Ï|4C—Hõÿ¡4Àì UÁˆPvÈãfdd”€Ã3 Ìgm0ø$‡ÄúriUÿR=7 †ˆ(YªŒä^`Üë�Ó8õ ¥FXrøÏð¨¦pIgØñtò((� €èÝÂO�bm(›Fèò5@ü ˆ›qèE7B+:`ÆeD(·ÒÊ œNˆÂÿ°< $ÿƒuþG©"þ³=X!ÔÜ‹@\ŒÃ?£`àÂ|kûˆn û Õ©èÿÿc€$Fpúÿšª@Í'FF¦ÿ ”Á \S¾ºxIgè*ZùcŒR�@�Ñ{ ÿƒ È¿Hührÿ‘Ø ú°ujÆ45ÿ°°ÿca£©cüÇ¢ÿ1#ÿ¹‡áúÚi—€UÁQ4}E;D-”T2¨¬ï?È,H΃Îç–Í‹‰U^²$˜&ºþÃÓ,#,Îÿƒ ÿÿÐt¢a|Hÿ”þwÇT¬¶¤™gFÁ( �½ |X!ú—³0F.ÑÅW"™­’øË€¨@þ¢‰c˜)œ‘äÿƒ!L¨±6 ˜aAîFF¨<Pü/¸¡ÿŸ’É!¥<4ÓƒÅFÁ ÁóyÑ·ÿĨ+^̤ª …9¨ÿÿ?¤G÷\02¢¤+°R〔¶ºiæ¡Q0 H��4>JË™{ÁýIÝe`ëþ*’¸zØÌý .œ½opÆfØÿˆŒ ×ÖN{ äìe\ˆÜ0þVy02BZxŒˆÞh ƒ ‚y¼ÿÿ/Æš:$-À8ÎÆ*¤‚÷òþ‚ óÿÐtñÿ?¬¢‡÷ S<aâÀô![±&„†^£€(�@9¤ƒk(½u¿‡¸0º9è½ °¨u)¨ÿ#*F”{h¸†nhR9@+Ѐí_¤–Ü?D•1 ,˜§ŒË5ŒÿÕái…0øÏ�Nà!<XåîÙA‡mà-{Dú¦ ð´¡�w¡ÏFÁ( �Ð@ é`¶Á†¯�[÷×°˜ñ‹~|­|4šñ/´µo‘ýgD-�®­ú ¨p/LXÔjûÿa>#\´âø?:¤3APþ\u`¡<A’ÿ¡®ÿ!…5^V²D¨ˆi¸<n©0@õ=´×Ç3‘ãýÿ!cÿÿMiëËQ0 €�¢÷*l-+F(þÇ€º’”qÖb1ã/Tþ/’:˜d3±-Ë„-ª„Ðà¥uÿ!«nÀ }ôB€qp�¯Ëù_£U^¸óiaÞˆy£`0@DaÏ*„!+æQ–gáÀ4!.èá ØA€&F¤™°¤JFŒPE!Ȩ!$aðÐÌ“£` �h Zøø†[`ø*°uØæ�ˆ.‚ˆ#&Û Ã6Œ ®­™iåC&h¼°®=#h2©ÛþŸÈa‚Q@˜?TØÏÆ7#dx4Ù‰¿ÿ„{cÿ!%=dѳƒÏé0 †p “¹•_°žÞ?¤tö£`@@�Ñ»…\è2 Ñè-|Xà 䌃ܒÿ&ŽzŒAp˪÷?²{5ÖP;@9ÿ‘{àµüল9£`0€ÀüÙjÀ8™þ´Ñï?h‚yÀHÿψœf€ÿO!Ëv¡;1þCÖØ#mǃ„è9þ‡ôÑl�%ÓÔõá(¤€�ˆI[ôV9¶Vÿu`ëþ3Ð1ò²LBcûÈ-rðúyÈ8,xí4†eW×Ly T¿±Ö©µ[µÇ…®Í  …ý4ð®nX\ƒVÔ0þ‡öÌ0æl°U½±Ï€%ýSxúa„Åÿÿÿð´ÄˆÙãüψXvÌž¾¥­½´òï(Ä€�¨e™¸ gÞˆÇ l…8¶Õ=؆z`4Š ]¢ +À§Làj¡¯«ýYÿœá¡úá]øÿÿGÇðøçÍVÆâÔÿ#<2dXåïFäe•D€ÿ 3Àú “=àÆx|)&Êpt¨<û²üXI02|ò7ÐÎ×£`�h ÇðÑ[æ°ÖýM<fà»Ç5neCÖèªh«6®ÝBp+Ÿ‘á�¸7�Ù‘ Ëðÿá² o´À@7K•‘‘a °æB?‡lŽúm•ÿ‡´îqVî(`eoÌf Æýˆ¥—à¾Z ÖCDT`  yŒˆuøÓw„~¦©çGÁ( �Ð@­ÃÇV@à dBçŽàëàÚeû§<#t­=dw$nðŸa-$c3þ‡e~ÄúlXÆÝi;P�TØ©IÀxâd€o’WÀàÍqÐIzÐ>¬&jã024ë‰M ˆþÈj-ðуà]ÛÈö'ˆ`³€½U`a¿”&ž£€D�@]à£Ý¶î“`¶ñzlC<ÈG9@ÖIÿG¬¡ÿè’ã,ò¯®™ü˜Ñýg@ÚxkEÂímáðÏ¥¤ú¥9'$W`‡VþÃçZ Ã9¤l’[ÙóˆA‡öõñ§ÿð4ňÎúŒˆ¹H¥3sIghõ}< Fy� €rH Ê,[I0¹ Ç×êÇŠaÝpX‹÷X·‡|¦Î?Fä%x£ëðéürgºã­ð\³¾ÁKeaC-ÿa󌈉Wp¯ŒˆI[t°¢'z%P_ Ù4í&Ê!|Hïš dø-í ›E]ߎ‚Q@� Üx…¾Qê$°uÿ–H3`z`‹ßð-Ë„±ajÿ1ÀöÝ@EÀ‹+1ÍÀ�W€­|мu@f�t=>ÔÈ’m"Övê`aï ÷è[”tõzÞ5#R,CS‚ϸdüÏ@z+º£¿0@óèYºÂÉÞ[K»Â¿Pâ§Q0 h �h ×á#ï¬ÝN¤È•˜¶XvÛB®}vÿ¾íòQK³A‡ª10º�i.ÈJè=G-–£-|:ßÜnÀh+aüÏôé $p¼CwÃ"n¸ÊýGì‹Å¶—,°¼;â<uL£€ö� €bHÛÑÈ Öý;ÌÀ¶,Û8>ÖùØŠ Øú{ø>ãºWVOþ¤v3ÀV|ÀVû€ON´¥ðË™á ,³‹ áý>.[=Æ6Ì™¬…·#–7 FÁ�4PC:È-{ØI‚°3t`�×p¶Ö?Rw|”ÎâZõ¨�¨ctC[’›±H˜4Ž,ÇnÔ'Ô,Ç�Z7ÎÈxýÌÒŽNdufÑ•@ñJh?â�Mƒèë'7¿!Ùñ$ÇäQ ]ÚÀ°R�Ò¢@·,Ø7»ìµsj7踂l Ÿ±ÿ˜Ñ¥·¯!ÃíL1Àä`ƒ+`ÅL Þ¾mÓr‰Ú˜ä—3Ýhn!dîbÚØá5Ðq›ÿÿNŸiOð!¾Âù=§Á¯,ƒ9õîªÞ8ÐÆ-Ðå'@¸ÿ‡;æˆ>Ⱦ]ÁÈÀ¹‹ÙŸŒ°ÅóÅ¡X{±ñ•ëò€f©¡t<À &¤]¼hA9Ͷ]âÆ­³š<· ›^¿Ã(éÃøîèŒpßÞê½ 93µÎù1q@MPÚy ˜ù€NÑrynX÷¹«Ì¤ Y]eÏy üÿjDÈ"4ªá#v8ò4²`sK‘.ú¡Œ#�Ð@ éÀ |X|†„Ö=º0€­gÀ"×Òð€ù‰Ø«.¯žôM74T@ùÀLjÿÃÅ Œ"K€£ PµÐnX9 ™Wd„´LÑ#t Š<&¡$Ôy×d¡ElíY v_ÔŒíÌ!Š€Cr;èþVO ­¦pW02,ö ù½³K¿ ýU@75�Å‘ï)f‚¬A‡•ê°«$¡ÁÄ[eOð)ÓŒ—‰q“oÎtg ž|FÈYóHe#Rf‡l¸øÿQügD¤ˆ3tUB!R<â@ÁX¸]ÐÝ0w .Äd€Z+ü¡i tý%®aKÐ*#}H‹Q®ƒúLÐzUŽî?HÉsöYL£%Ž5Bò##ríL– ›!@Fd7í» T±XðoÆáNª€’Ž xt2]A X”0Âv ]м ´ˆrꂃ³ØK|ä2‚J^r� €z v“hlý4¾–<2@WÎ댈$= Ö$0þªæÔ‰Ô.Ã9L`Yâ ´Â ˜¤¹¡Nø‡p”…µ‡�®þ1@/Jeüu,¤ÝldYÆÕ*\v|QÓ7â=€� {Pç ½¿z0ÃþÙ(«¨€…þ—Ôž ³Žtù;lòô?tfÑþEtªÀœÿïÂd+Z`aT›‡4ÿ‚<@ÿ:mÎ�s2Ø*Dó! Hص 7@F8ÿ#ÍAlù+µ!U2ãx óÙ!ÿU ¬Ô†ž¬óÿ±< ÿÐÂRŽCV¡TbP ð^ ¬ÀþÏ€-ýþ‡êSoB€3tñ¼ÂP²ë€*P¤qJ­– „<PÔqœèÞ t¿€<Cþƒ¥¤ kÇ2$ëΠªû«ïÿ3 ×» ‚^þŒ(�@}þY`ëþ=fà§Ç·Nº”ºõ2öû6–OÊ´—WMú¤öB7Ø€Ýô‹~ƒˆbaƒˆ’j =^@.'lœe̙ωb�²E¼¼vq ØíÐe¡ÀCƒe|Ñ¡ˆØ'µrÙ'·µ�íqg€…#Ýæä”Ò)®gÏì’@w4Õ~Î…üe@lNûû± rF<äþ`Ä‘ „çN|²§[ƒÿs Ëa!ád¤@ÿ èÝŒÐuñð…”‹ÿ mHz€ßNs"!1€¸ÿvŒ¤t‡o¼‚v^`Ë}‘Óè_èf/œ~d„ÉK¡Æ¿ðƒ†#Ú< @ÜñâF¬•ʈ{ÿÿEšo‚»º’à÷6K�ŧç4ïÄ/Ä€¢öã¼ÅíÇ2€~Üäf0€zL °ëA¡›â`K›‘÷Å`ú±|6oÛ‡_EŠ #ïê±� �yWŒÓ@횎ñêtÔ¤¢¡¤£ˆ‚"BEAÁ(yIºü#Hy8¾µÇ6§;$ÒP°R%Òí­½ë±£‹gþ²ñªwþ1„RÌ»‰Ï5à† À@BÌB(¹p~µ= à=QåVÉqqóx¦s¯É*š42"�E èÆþåÓ‚‚ÁßâŒ?lÉÃæ¶þS}=Ín_ŽýìuÎgñœS$$›•,¯Ç®UÐßéÛ§Ûȶ.†o¿ê\æ³ôÉ1_¾_ª½ ¢x¸ŽÀ7Á‘äÅA#”%_Á^£O‚ë¹û–È”É*Vµ’v@aôjÄuSña» Þ'}²­eºG£MÀù0Y² IÄ%‘Üjƒ—é*SžíÁ¨ª\Œ}ìL›9éȨà Ÿ®î_7WÓ»óóxxÛöR’zß;½Õ ù‰Û­Øb·SâlŒ'Çö­û”ÁS=iOj„^˜Zìa¿­ðwî(Ä@Þ©ô ‚–öŠ[ hk#¢à£´,ì,ñ^ÁB¼€÷YÇìÎ#³’U´±PóÙIòÏ7a“üòLÛoè>вÃ6`è퟼Æç…RBFB6Ÿ½Vy;lÊ?¡ ~CªµÎ4Yõ9v² ˆ*J1Q.QðŽ!Âçɦ˜;v2XXðŽàŸ²AÑ¥gNô+Y” éº:”©,Cü [JÔ[ýu/ôÿã~~q÷ß! –¡QRP2áI§˜jƒvo·MgÒD9 N'•yg¯dˆI0-z7ù’lBò,˜z|!}i¦˜8i©¹|¿Ò ['D!s§öfÿ}n{ÐúS´A×ÀÜ7­¯q0‘R-æl ‚Þi°ý!=Ç™¦z"uŠb‰ e52,FËséE݃ŸÉêÚp?;÷­bv+”ˆ ‡úÇ$|oÿç'6é<ȳšñׄÿ€¼+Öi †¡và/˜ØYA0ÁwTêÐ ‰ é$`de@]øª*Hü ;+ƉßKr¢J DjÓëÇιî³ïî/ªtXe³þ¶«³î{öÖŸ¡X;(;èo»æ>ñÙéN4Uì4²ùмpÎ;‰Z©‰(Í€m[#Ò†3–/m’”bç¤�ÈwSD|<n^Ÿ†­0ýÓÙí¡³8B•-E¶µÁãÓDìÜþÞjqµèù,/_Îæ÷ió‚ [ÜXkBŽ\‰K\!;nîìSDøæ.a€z¨¿}ï¦Â«&qG\ެÂö&ô•¼@£×"p³uœõ{•D…ÿ&Æb„þs‘F­êšð¹XfËd?8%ÁùĪ�|/¥‰Ö.Ë€Öá…gßFÆù¢"<TWió1*,5Ã`¥I¶Ïüín³üãæÎþÀ)ÀßêP™£UÓ1³mè”)‹/ó@ã#æ\öó\6´F¨Vâ>nÿãÿS� Ô¤í`ëþ™fÀ2,c êÈ?’Šü.øz°$'„K«'~× +�¶nÜa‰J?¼(�HI2€/º†ÙËI¬ð‹W`Ù© „tÕ±¹üür FD9«$ ³‡ˆ5i@QPWýxìà?c8dÈà?R ^fˆâˆé`VΩ]ÿ÷Î.›‹n°Ð?ìš:r†!l êü8´û÷Ù¸'PÀÖ©Ù BcéœoÎôÿÿ!—’À¦4aSxÐÉ\ئgFjdf6‘ ZÓŸp…`Ø@ ‘¿HóÏŒ°yZ&Øô0¢ü„ÿ¶Tk ŒøŽÎfÏ»þƒE-ÌœÿðZ“á|Á't‰"õÃÖ-eÂRPÂ4QM;p{aY"‚ÔÓñ` ²Àöª@ÍSÀG‰ÃRP«ÿCBÚ)ÿᣨЋi`é Ã-/ 3™“äðÅYÿáXÉ÷>*Iz‹n˜€�ä=Â0 …#p$F3,Hœ‰V&ÄÈ à(,&ÄX=Ò$Ïq˯`` [DÚÚ yŸ‹ý †_.äó—sXI[O±lûdžâó±?½›]Ê“e{4oú~_[G܈ •¤.¡§ðÝ”©)Ûæ“.%°Ë%‰hCålD=áþÓ‚ôƫ֫ ÷§ûŽ_m ©òÏ(³uä ¡Âdd~ÓN7“{sî·‹“¿Q…3¨->sÚ ám¥7S³  XVñQ‰+ÂÆ`²˜‚XÊŽ}SÚóWD´èI!±P"1I®` ãhîžlžÝ#¬]éÙOùì„F¶…A…ÂXÂÍåà,ǘL\Šœ Û@‘0UèÏÖ‡n}îm‰ðŸ’4Ÿ#ò²±‰ßÁÄ´„~BVmIdô³~Ô.6`n?ƒdûýþe» @Þµã ÃÐø,ììÌlÜ$vĘXX¹G`D¹ ,åÑøƒRQÁÀ@†ªªÒ4uêgËÏÃ?wÞýíË1¢‚ÅÅ­Åñï=פ-!*ÕGírØ]»ÛO̽QÊÛ.XN}ˆ1*éç D¾›=¿ ´L„dïjÀP²+ÚÏÉcÍHs¬Cç•ðø°¹ ¢´H“ér;¯ {ܯ› úéUñr5(Vtv$[ÄÁÂ&‹ý;ÉäŸË<¥2•Æ%„÷ðøu¬M;¤YÅ*1|ɲ|Ð ž]"I³žÉSžø„¾f}Ú´Ð5Pp–²¯‹’µ0þ§nTdNåÛóõPAþ:w‡®G"3ÞIjµiÜ¿K*»ÉNx°ËÛH o"—¡ê=à£TXŸgHÑö:| ö¹= ïÚq†ah½3p�`ggç\€…ÛpŽǪ&yþ´i+$$†ªjIâ†Ç³ýjÿðßIÎo{{6l}t4¥Óçþ•1ÛI»/æõÐàZÏ[/Û)-,±ÊF}~mÒ5êä K)8Á“ 1«9P@{eù›ÅYKw¨$I0…«E @"+T�¸]‹÷q<]o—©¯VÐê=÷dzeÝìC�L¾p67ÝúTã™IJÊŽŸ2ðôxgbÓŸŒÇ Gß…ŒÓâí}ì!3…É5£t‡Ëg—ÆónköÇo¶òÄ0¢ÆõLÅ}oRÄ™1,qŒšµJë'Ùá^¥mh')!¦ $"»%;)دôš³íû¢,sé$™9(N€•5¡üÔ¤ÑÃ.bC uYýemª×bë‘ìµ´`oxð× ÿ%�ygo„0 Ca«#° 4lÀ� =;P2� ‹0+q+zO „ðwGƒ«¾sâXÒ'ùÅùµÃ?}I÷µ EîüR‡#½âÈÜŽ!Ü*åK^|A¡žUÃðY6ñ°$êêÕ£[ñÙœI¡B‡úi¦¸ö ñ/Õ$ÃÓÙ£{ž®¶Íµ÷(½Ñ¥B¦h*&á¹ïi·Ó´NæëݲoŒã~SþáÆ˜©�Ò7 _Q&`� ýv.o•à]ª…S}‘ðÚkfãå�HSùC-@º£÷ï;J*W0 ŒCÅ6p%�A2¥—ö„–ðp¥-öï@Cú…:J­Õ +yÞøž|³Ú®ÇO&jqíÚ@•’^ѼV|Mž;}�/J•ÕÝs`2JêlO‹Ð¦Aý´ƒà2ðým»@ÞÛ ÄÀ÷tôÔHÔ,À”´´0=s°�ƒ°9üg;É' „hˆ„D}'¾;_,ýO¿ûÛ–)xü_ÿ„J­)`Émÿç¿ØìgõZ“¸QöS}ÀÒ=IŒSèí;xæðõ‹*!1½k@'-žüIŒ`õ|(æú¤Fýç´hÄíŠ2N,®& ¸3X-W»ã¶tËép­;'}ððe ÀǘÅ'Ð<–)•[T´Ó¨–ƒöæž¶9°À»Ð]€ã¬jû�aöÉÐU EÇ2ÌĬ4hWÓU²Bí-.$sϬŸ3„9!±Ù}å±Óéx¢°'—vžÔâ¡@¹;iƒãÄìÈ´£(O4Ñ ãJ$Zðþ{{eK+G­ÿy< ïìq†a(loˆ‰ƒ +ç`cæ œ ‰[!Sšçç±Ð©?Rš¤ýúÅN­ð¿±Ý{ìÞqvê?”r Ø߃¥€Ý‚_ÐQ Z»¢ã¨ÜBÕ™f«m"¸œu6±x-°™{¾Éz{˜gÊÁJ’FUéL<~qŠ"dáþ%…û)öm±ÙåFPúg¹-:§dÄ>°ßfø2F´¸¡oy¹'T;U°osEn@_/|e?ش٠m<>2¸Ëù1V$Pܳû)T°iÝ¥]…vÓ± Ëc»›¬Û¤ôâ ÛqŽFw êÎ2Ëæ$ø¬Wýýñ´Êšh9¿{4$Î)þ:¦pøVµYÓ|„ØÄ3õ1ëý¢u—þ—þßnWÈ»–#bª±Ç«kñj%žíÁ lÀ®wù<Ø,fFoŽ÷ Ùax< üªÁ¯}Fû½7_­ï¦^Èïþ„î熧 'Ú‚04›<„Öä†_Ò?û®’Ã*‰ÈpC8,èZ«´K‘МÈ-ùW«)|F½ÈeB%<CÐUDÕøÓíáxÞWûÝ.§ë$åîÕ?ÑÿÞuåì\¬2ÅŒŒ}Kë @†lºYwE7 ™Ú•yãÞA«=’£U'îû¾®'<ë€3š)(¶'’ôþMÒê°ìÎÂE7 ›Gž’¿Ldjj¡´ê&/“ç"0îQtïÿœPŒ| ó†õ�®œ;#Q«¢² ýÝÿkÿ%�yWp„@ I5¾|Û«°‹°+±Ã– w!ŽŽ/Ç|î.w°Ø_üWÑ|æF'1ä,¿R‚d2б/ü4&ÁH)×Û,$LDfÏ^(rˆH¦ÅÏ U Ç£¶«H¿ß]:à:¥…_¯hÜ™,B¶ˆsi}X'QOÇóåɬ ­3Ü„FŽôÓûïjé/ Ȳôn‚; ºSXE’ŸÈ —Þ“¡³<û÷W¦Ff`ÜN1cN:íÞrÃo(òëJ×ÔûÍ"ü ÷ž¿—"A¦³h×â»ÐÙ öÒç°9«CÆÉÆE¹>wf EV³•„m!AØÕ¹3Q¦í4zhKþÛþv<àæÚ†ah4+0ð @ËT4,A†i¨©Œ°#½çÏù’K i’Üq‰PdéYzÒ/:ürõœ|X¸&Rz¡3^É/DÚ‰µäƒ‡íò™A*ézÒ X¬Z¤hºÆh(N”Ꜻp¾9ªÁ'™6=©ÇÛùñRèÆXaÀ& dær“õ‘Ñ£*—¥ûCtúûÞ{×Ó=žž¾}2ëÃ;„„ {Bì¡`2ùèŒâúUäÄWR I{m)€¦ëlG¹¨®K¨R‰¬ù\Á¨EÀ7luî†lw­Â̱*ä Ð@ÚÎûQ&ý”éBÒ‰uÔ•ÿxS1wëÀæC[2î=kTêºáÿDTSapÆZi>Á”þÉY¤dÅÒ§Ø]{#oõ]šû™ÀõÿÇW�òÎåa¢Þ&.F”CtD=Ž[ZI&8a¸1á”É!1!Ò>},þÑáïQüž ÄKà½ðN?. §u{iDF›+A’ö;=¯�’lË£{Á4þ­«_Còœš^ P1Sƒkdxž/½<Ã9†÷¡³LÏ.ºIª0=eyyŒ«Ÿ»Nþýö¢¤¿¹)éý£[3« ÔÉÀk ¶¡'½PÌY„óâ_¾‚eˆm#|P\‹ Ò¢£~ÞÓÂôÆVDáƒð‡™¢P0ÏÎáiIð½pýñ+:£Cþž,äZ{/4T£sæ1áavýÅ)fó” PÑIï@ªap#¢Ù–R0ÇN>Œä*E1‰Ó]#Üe :<å¿ ç n†a`úbÄL€XŒÂ“ ˜ø0Jîì‹ä´ðDäW©u¢&9Ÿ/v~ð?‘sæÒ2ï*‰H}¯á¯6‡‘=/ ˜%íɦ"ÛÃ3ÓÔ¨ÛGêf BuD¼ÙóÍLk;. s‡ãŒÔ|'ج ·ÈÃ×È0ÀÎÃpóB"l`èÇZ+)xe»ÞÓ¢Ëi~}ví±ÇÞˆÁz)Ù@2«,Ø”œ02qÇ;0kg¾;ƒ—Z ¯õfÞG3'SQŒ¹ìTLþ{e®&vIøþвõLäEcˆr8^”›a?²GÏ6zX„‹T¾&ÎBI¯SÌg=›’Ë�“‰0Ø B‡¹0%&­L›É9 öc{ @Þ!AÒ„ ²Ÿö`–`þ­Ã¿U@ÄÜîÞ†¯#3¼“;2,›»½ã¿fî½N òëÓ‹W:úvsâËR·Hbldi‹H¤ÞáVµÑ4ê{(Ž •@Xa¢\ùjÅYd}jGÛ<ž÷ë{ü ’¼%=> eMògë•“Åþ ©«m×]E29Ÿ.·ckþGýaׯìaX±NfÅ©Ûf)9àríS]ß1Ÿ+ZA¤©ÁØ,tôÎí ÈGˆ&# k‰ÿ(ÅL f©v˜l…ß+Ÿ²ûLÛ)·Ä\ÓPG‚Ûùa 6ç=Q•Tð‰ådᎋÅp‹õ $¬·6LŒòÛvy¨WP>¨~ïë¹ÿô?w7Ã0ÐoÆaø° /FéF¬À™VöÙ—6*Uˆ<Q¥ˆ¤±Ï—;÷þü°m¥qÚgab*Þ}׋0¢ã£Äa™>N’È2û¡@gá*NNLw¹ _蔇í•Áå¢ÂH½9TAëÿKeŸxa4%ša}÷ߘrH™)”$ID"àØ½ŒŸZD_Î×û¡7ýð¸=7¯·u²ÐcвIü>T¢ÄE"Å÷á+G’,õ²˜7ºI³GÌ+{à÷$¼o"Á×;åÁýûÚ?ŒÓ›Ã"1‚ÿÏ §\1¿ž^)S›ô$Ã>N•Ô´ÀG^b—¨© F+ÖÕ7�¦]!kÎ6(Y2.1¹¹>ÿoÇG�r®ea†5$øH>áÃRÛé*í†Øi¦e[b×vµáûð;znW4®CN´@JyêE¨oô¥»Ä+ Ÿ-2&Mi™lÙÇ£ MOW§:}[¢Ó{ âóQQþÑô±OLÀ0N ”ÚDXB %h<š¾™žK4áúz¯Mÿz¦Î,Fˆ¶ÙVë.‹"—!Lƒ A¢Õ>+ûë…JüÊîª@ÊY—é–&8tynoùå@ $l >‰½Á«îb5d8´>®þÚ}ÔŠà‘'2N@ÂuO²Íÿ’#¸q‰Ë9بù˜jõ’µUÃS6ÐS)ÅñÝ:ÂOíF§@Ú¼âÖ y¼ ï r†aXóÄ ù&_àE#LIì¸LÀ ÑË4­šÖ¬MœÌî~Õá#²käÞû¦Ïî܉< úb"ø Ï,¤ÚH™‰Ò õ˜)Êž„OS«Mc´eaYCéŠDktL‡muú·õp »à[D—):�‡*7¯'ûƒB'ª%ióBEõ<¯íò¹Åƒµ^Eƒ%€ g)ïØ„jJ;€9òֻ¢Fd; EƒhŸ}’4zTÒÉù%1+f ÕCÊESwîG„o,»;gFL=/é’±Õ<ñW/ìÕc]&Þۧ|j¢�Zµ­´^Eé( ΢¶Ùm^àëÅ[¯`Sê€3­ûÈ„þ¶= a •hÙ‚(銊è驨žމX�Áéÿm‘ Gƒ‹pbÉÒËgËFúu<üoAzsÞëÓRý-Õ•ô;<šøÃŠZy¿ê~QÒ‰€ˆÈÆ™&\-m´qIÜ‘R Õxm¾×AÁýúhèÒúe­‡µ÷Æ 8rN›ò¶œ÷ëÓt±=žŸ…w]-}—œ» ¼&ê€|½“ œ§¨}<[nçÇÝêðW½Ñä¨7 fu×WÃRWØÛÅ– ®Ô.[}(R³iS|šê´ðÄ<µD]È=óІ\}àØ©B.U®ˆø ªGšpRùÐPÛ$åqøHãHÞ`íÉè¢\„¸áÁ:‹4T7¥°G�©Ú` Î_ڷפ‰4)‹øù±:i„Ù")ñŽ"Jíþí ÿ.�yW„0 ¡¯ð¾Ò—ø/Þ¼øÇˆµ, trÐzrì¥3M É0Ý_üÑG[C  ÚtÕN¨‚û|Q‡;ŒX´`8ÁJ„/"û4Å™¯¸ËÂI3(´ëz<ÜçÛe£^[&rÒ×STvz g#̱ÑŒ½Ì"ºÀ¬ÄÛ¥'Æðø¶ŸAÿ6ƒþùsýxÌ$ÐÆwé¤ý Ê.!Xœ¦ÐÉ’Ýé yÊ2F ÏTW §h E}¸"VI=ª?ª@wŸh„×Ô3Ù½hâìÛ�­›Ì³gE©§?3 ÞÆ÷q¬²à¤¼±½–>Ê*®z(±¶®£ò6¥FÁ¥4â•.*+«& !ŠÁÎÿ"Ñ£áª1þ9à @ÞÜ ±d3ž¬Â ŒÁŸ“°âgªÔ¾øªDÀ ¡FªTõÑ&×´ÊÙ>ç_!”®Ž¤à©Qq¨±ôÕþ °{ËF,¹`‹_ ‹Oö¹L©¿ð¸_ÏÏ¥·¥_”n;tfU™Õ  Æ!ô¸KFJ¹Ž§Ë§›jl›”Cî¸H·2íw&¢¦~yÛøJŸ!ø�.‡W�¯îÌJ—F¤¶JØ9éYLùcs¤WôrfjÓ—6gÐÇ ¬ºöL¥X´â4͹Z´)äcœ”‡¤«Ä»Cn9ê¼`”Ä@ÜEòxbÝDx�Ñs át Ûht†š¾gZZFÄ蟀õ™Ó8í¢½àîJŽ„a Ô]RJÚI )„.ÒI&P�I»"#fÂ#üa†>°W°ÚµÏ�ø\lû²Ìf æ‹ÁyÒÃežÔï|>øòºQUYd"UÃ]8|ØÄ¡—a}ÑÇ</ªÉ©·f«Šˆp?*ûÍþ'¯º‚Üåz»ï›Âú²áÔÃxÅà£È)ï¥7Àü¶Ž>k+ç²y‚V(àýrrªKû¹z¦ßÉ’=2ǃ1Ÿ“u½jññ Tn›:Šá¬´såÏó€R'€p*—Tê/KæYT´×ÿÂŒíg½BÎß”Û"xÿ Mn—*ÞÝ$ÕT‚O°Ûø p=”»9kù@ÞÜ Ã@ûÇl,ÀlÀ¼ƒ?ë ±J ñ/QKûÑG[©UmµîÙNìË/þ\5ÎXvUä|¼—Àƒ†àüƒ+[±‡>r\@Ý] $úR¦Å/ñc»]N÷×áj ÐQÚEºp`¼fYAú'˜�üèj…Óa<ï6+ÖÆ®»oë©c±±Æ­âÙÔ U½çæ¿î„, K( &h•:#ÀÈ(wU–�%"â>³*ÆrÛ�KÚy˜†è°lIõ!«µ÷–Åi·ÈØ–’ŽÉ¸ßò\ô‡Ýó_s4£…LNåx‘ìÉÀάÎh[&¨3þû:üI�ò®ía* °0›ðÁü³[ðϬÀ ­ µï|•Ò¨ýABDÊO+õ‘ºgŸ{vð;Qûâl9 ‹Ä²ƒSã͆`ŸŸàÒ�uhJÂ’Õ†ªbøê8ž¯û:­}ÛåYW倞do†ulá—A�rd¤Wb³5îwW·žV_pVW XdÒ‘R?úLm€)Ÿ§CZìÄ—âÄyg$ºtux½ÊÞ)OAçåšr:‘dV^Èá g(ÐóXRÒ°-R'T4‰„цì\iÚÇŸïX§xï%6µ“±Æÿ‚y!ê·di´Ÿ¢Ï°1Í8G›±çøsV3ºŸ³Ô?oÈ»‚„a(/Á:¼@b žìÁŒÅ—1`…š´¾³(•¢}äÕÖ²’sbû®¿ø=0o§ZE{Û|VÍy0…3çX9‘Õj_)�s’y~Évi’Bøöe¶ï·Çs÷G)ôoe¸ «=¢s¡s±¢ÒA#TI !sÀ¶Õ2n§Ën…Ñ9¨±IyÓ^]Zd•À=]ï¬z$ÈŠ}3¤+2ŸÛˆ]"­¿Æ“+¤²… k@žÎ ¢Â`*Î:%£[{ÅNËýÃ#¬{8á)„ÆÈ[€rç„Ò³³®Gþ*Ïß™vø‚°E¦54—*=¦Ì†•ð[´[N*<E0È¥4!ÒC’RcÉwlÙ^¼ÿ/®§�ä];Â0 ňºs Ö^�‰½#'à=D'NÀ1 ÅïÙqÕV° !2µMÕDnâ_ìç_føk õó ÐT¡†Ã¾Ûpíî4§cœ´0®Ú6±R(XäJ½ø¿ßÌ7Ü4ûÓl‘‹þrèŸýC¥ùÕL627s ®³€ ˆV¡&nŸÍ®=¯—ѳF·3 æP8ë…÷‚ƒ> ¡ûö¦W?k¡4o0¦™SVÕÈ -¹¥12JE#jèù ¯µ£‹ÁXg,Tû€ÂºŒ<3GH‘ÓÖ.Œ3WTš´î¸½©ÿ‰zatM.[Źï0ÙlYK0xžö$¬ ;]ÃâH.@ýk´Ì‡�Ô]Û Â0 t`>‘‚˜„­˜‡$†@Gkû÷‘¨?è/¨ÄIkÎgûü µg‡žÌ>ˈ~ÞåÚë]Ep„oˆñðƒƒ›‹WìbpÄdÓA‡óu×ÿ†®i,Ñ=/M§lzJ¥S ‘t‹©EAßd="ã"2 å19Ëakö› *!û`Dí:lf,>TÑ1§G‚F‚„c±¶6¨Ò :— 7ñ0ÑéöÔÆ#+ZD8Íû‹Ôd-èhMO?xñ¨ö2çšï!¬þŒfãYè ëê{BÖÕ¿µ°ÑLgÔZþÝP|áz |UÁuî#ÑÍD¿Ù£”RýÒ*õm”W�'¾»Jr™Ø\’ð–ü<Ù7®·�ä]±Â0 ´ ŽQ( 蘀ž)‚-˜ˆ2%Cä„cé%ë…»t.’ÆDZ-)/éõ‹ÉA;³6Ël¡³žr¿±Ñ€g¯5Á'™'Æ]^ÜQ$³D ¬gcnj§ë}*oxH;ˆÅ«<,¼«×K&ôk‡g}ÿ·Â7cóçdÍ1{ß~,Á–Æ_‚eO(îÎÇãùöدNÈØ;-’E¹Z$c”ÝYÅžaÚGË|ÁÔÀm IÅ&dJƒ…Ô1dRÁjó!¨.øÒr‡&î‘$±|/s§|sz†R.ÀîØ„C=ž¶ˆ–µ0Ke6ƒ™âPhÆ ¼®”'‡ý!wÔ_ð5Ê8о›øS$':ËE1s¥³tæ¡þ²}àa ÜÀÔ B•;† ¥c V`†h)býKq’Ë]:p‘"qìÈŽßÒ[–ðãÏYvj©ÝYfþ´Ì³$=…¾áü¾k…„X)ÐMÞ¬šHû,¬4íçu[~%srñЈ®þU{ÝWÇ˦Ìö¸žÞíºµ¥½0Iš+$,º+züyí{#%w¯{|ë÷í¬`¾�[3ÆiÔâÚ%À+òínx"2é i:hÕMÞ ‡@éVJž¸uÁ÷ÃGÁX`%iŠ“/„ú3÷H‰4ÙP…ò!üÿ’a¦º ¼>5á–ZòûSÜårñš”…èÈ{4´tÅA1¬}5I·i,_K’"–’µ;O•ÉìA4ÿŸ>PwÅ8Ã0Ð L¼ˆ…G±ð‰>€03ó&žÀÂÆ�2&¶ÏNQ êDBU!MªâÚÎårùG‡ßrö}ÇÞÂõÝ1eYaýŒ\‚wØvq§d°6Ìž¸‘9ä›OäàãYØW{D‘¾æÒê¬5Ö×J/ºq©åf¦òÝRœþK¶½ß¬nRo'W])8ð*œ‚YŒš*Ñ8Nª†.(—q9on–]ʳ6 kW¡dÔ¥PÙ5U˜<£õQƧO1ÃnX*Q 3éÙ82|<›7pðó€€8ìˆÊ\‡«T5m¡_! 4š¦*@(A!±©\G‡ d¦Á˜#1²¡n½8Ëá¨%&©óæ0¦»„ߺ71Çc;¨aaVÿ ®5¢�«%{€ý¡Ÿì0 þrÄ”‡�Ê>òŒ>¶]Mê  »zÀ$tï?R&…obDO|Œ(™�’yÿ#vêR XÇ׃–Zª@&åø 6‰èZƒ°0°pösHîÀ,ôg—¿fÎu@¿|g@«/郚…TèC†þ#Z˜¨“™(•/80z®ýï†Nâ!ÙÛœƒ4© ­LaöÂâèW Êé.Ä$?ôZIøÒOè\Èág°uåЂO@w¶þ‡M¤Â[ì° åð1¤ÞÄÿ`»q sâèn(<¼‚˜[V*ÿ¡sŒ°a)áõ;T?ÂLئFDƒs/#Ü-ȇõaÚ…˜†ÇùȆ5èÊè²O´Epÿ#³ÉØQ?\�@�ò®Ýa†Êô Á t À TÌ@KËìAÇÔܱ=ÂŽ¬÷D.Îq ‡›¤‰?±-?}žüË¿5©c¨Ÿï4+ÐiûAÉ(ÿ–…Í]°i@ÀaÛH?lvÍŠ®4¤tý òXnöó¼C†Ö;$×,Êp@þ7KŸUlá³ÜÇõj{˜ö¿;w…pv¢4iR¿h;•ŽqË ´/Õœ·I'£ƒ3âÕkÝŒô¡zß -Dƒ@ó@&Ê·æ»ÊÐG5(Bjyh©›•ÁΜÆNÊ¢öÒœaÝ@½îtr~° Y­h§EŽJn6 ¤$#EU­Jî™?8JÞæHÉ(ÿš^¿ˆ}Ö?5k– +8¢‡u•Я²Î’k%ýùƒ ZÙß"ü§�ä]ÁÂ0 sF`–àØ…-x³ c°óp&¹X²Ò#m'øÑG>I›DqËþÀÇDnq÷‹ö ¥33å¿¶º+Ÿ9ŽÂéXtAÐÓé’ÿ¥ f-to¯.·cíó ºª¤w=7rð4-j‚›Õõ9ýk‹NzÀ+ôæH‡ÔÉG÷ùC´I÷˜ÒxŽž$=Hrë•qEõ¥­oÂîxI=üEŒÔŠKZ‚Âu Ji…F(…ªÔ~þ§Hið‚ˆ(j_âr:´Sá•EZñ°© ‚óVáƱðÂw|¬»µB:z·@€·‡:ŽJ[G*ÒI^Cÿ>!‚{õ<DˆÎÊÃßd^,1íkoÈ»v#„ajÀ$´À1 ‹pÇ Ð0Kd&`J*#Œ­'ɉÃçRq¸I“8þJ²ôžü«¿5¡C+ÞkõLË‚…žµ9í¨w>.©Š«{Ó’¶OrÔÚFª‚ÓÎr³›§®‚njºóÜ1‹p‚P³ãsÞœ³ô\´¾OBÿ‰Ðè‚wõqSÔK^ÀQ°œBøóœÅ >ðs½,L½¹÷8ëhŒFf+ Tgòw':‚™/÷r‚a³úÁ»¨×©ß{ÜM¡òÄ$‡ ª ,í`àêUIø ï°öœ¶�Ö5!P.æ)¹ë©Z§ˆµèºüÀ*Þo×·ôÞ1ÈËÂ'ï5Q€ìˆ`ÊÝ”4>V\?Å­6o mnA2k·ÎŸ–‡�ä]1Â0 4 /aeGB0ð6žÀ„ÄÎÆÎ x;?`gbd¦&Â>û@-T0!*U’(Nj_ì³ó« ŸðKGéM„×ÒÚÿRáúsÀää$M~sÒ2äëâCô1˜.»EÙ˘}(øM=^šÚzucªÑ¶K vGÉÚ›ÌV£º>v›ù±|öáÊ 9M¦.OÆ øxç׳íÀ_míÌ7Ÿ§*Ë‚ªHö÷:-,dŸvkíôpBò—Q>Y&â7´M§–ˆ34"�Ìî²54.¿Jú§Á0K×—O¨,©\¨•jæØ1ˆ u¸Z j§¾¼Ö‹á©4Ûzÿ<Ÿ«³PUõ1Öbüï>‰{ÊeJ{5–›Ï A-8¬þWÝ‹Ü ïÚmb¨o:X‚"53P1¢§É ”°% ˆIs‰ý|9¢ Ñ ¨ ‚(ÎÏ~Ï~ùŀ߽y$ÄíLæ²ej/û-ç|(ÿú‹?&vY%¸gpµÈô >þ+NëqÜ÷<¾¹ãª¾w›û»ß$d‚2e}r&³å¶Èí§ úñûWYŒTaAT;x®¯d–z-ü6ÂGÿ³FaT1„~l±v¼3i�haSŸÉçeP¾X͇$¦±¯ä€ÐŠ«’-˜Ö¨ CŸHÌžæR‘TzeAÿ9@ïG 4PfÛ³´‘eìä:¼ö"`bÀ^CH:Œ÷ W¹*NñBï™ì9Éjûàl¥dàcâz\š“HšIEð™«dwî€=Ÿ�þ5‡ÿ@C±ÀǿܒpE€PElU§Îr-`¡˜¨ž“%ãÿÿH­>ØnÂÐeŒ‘ŒÂ>v‰˜ÇÖ(�[öî@]& e”ÿë”á-ö;G4ÇkÐð$è_èzkèšmHë :, +ør=%`¡oͨݳJí¿‰âOèò;˜» ã¸ÐzæûØ>†OÛ¦å¾!àuþÂç`”02Àþ‚‡/¤wÛ ]eƒ:D0—ZþGI;ÐÖø´‚å/¢`…o*ƒ 7à‰[èxùXEi”À—b2 sèä+t²¾Ê >y‹Õä9è’L´óäÿÃZ@TÈ›ºð ³à�ý•Ög€vÍ2Ÿ0ÀZøùѳýÛ«€Ø¿€ @þvv|XˆÕä5ù£cø@�@C±ÀG/ıµèÑ+�\•´… ß!K5�L¶çæÂÆóa¥Õ Ëè°3ÈŽÅ$ºç:tó˜jQóØj}‹ØO 9 cø~€·– …ÓÿãG6œ$èPðâçÿðSa¬‹ü¶"„~ï(¨SrNíÒÄfÜî™ÅG€Ô-Ä89ìhÄP¬ÕË€Ôõ†vÑv/˜@Ĭ¥ [Ø\òø3ìþSø†&HK’¨Ø†*Bž—@:Ú—Q0þ‡¥EØå"ˆ^¢‡ƒÓSÐÊqÞ të¼ðEZñòÒ€ô”¡n@ZŠáè+DˆzA|h„‘çŽ ôUY=ë«´š4oÐÄï`À†ßàË,‘—G3üEº Óˆ‰éˆÍ[ð zhú…¯½GêEY®9b[ø�4T¯8„öðÀ‘ÇÈ€˜m…E$#j¤2¢‰C¯Œ0>#Ô@ª%`+ÿ·AxÑ1 ‰ú@k$`%ÌåðÑ#äË8ÿói+ÓèJ{¾]÷r…¨Ï½ü v¤G�»<æ‡ÿ_^;stQ#±p€-Ñ;Œ0w1 …9ý?ÒvÆÀBÿ×ÞÙeÃE»gqMëcj—ƒºð»F‘ÂÁ†t-mŸžó°s!…5Ä-`Ç1BîVd„vV@A„ÿ{$ÁFXã9ðøÐ ü*@P‘»‡8Œ 0yèÄ…e°Ëñµð C9ÿ!÷½Â® þ6ÈùL°ä¿ñ:ò=ã{ú…ކ’Ô!Ã\`ÇCæÌa×þg„Ì“@̇,2€'²@o¥åÞâŽãGf€V…a¦Ãâq;2,£ˆ*X:…Ä5ø¢øµ¢pÏ"¹Ýጠ”xd�€�Š>¬öG.ä°G.’Š8t ,ãÿGÕBpaeßo uÆ0¼Xh´ èÂH1*Ça™º~Ù6ô¼/F ›ÉQpC®ÇeBì †ÝIÍÀpH]?¶¨ñ7ÑŽ„T};Ia×´B,…Þz-ía¢ˆ¢¤ÄÜ%µûÿžÙ¥÷Ðj~ûŸIV3A+®ÿÐâj"ìNÖÿï€üÃć,¸e ±2$Ä�)j™ ÆÁ [x™º†ú€'²j‡µð™ Ë« E;ŠnÈUªr˜Z%£7&ðoªƒ Çü‡"ÁªZXÁc3@ëúÿ0—ÀëRFœ ÈJ"D¥ -]`u4,@¶2AMb€ÕiÈÕ4E™£·Â´új/—tœ­4˜/þs Vb„œËrˇÿ áP _0À–ØBÝ‹fXámÃÁ†ælÀÛ ¡\àƒ�#ýM4y#_,ý’ÁhtÞù•½÷ #J^�™ aqD+f'Ä-Ð w4¢˜…¥s¨û¡ û?¼1Úùz娢¦¤º Ú®ú÷Ñ "ãC‹·°›¸`¥>ü®m3—Ô†=³KP }HA>` Ú�ƒ´ÆaZÿÃ9 ùŽKÛ§åý"ÎÅŒ°1{xÝÇ€ì.hÈý‡99£3B­%¾jg„Í‹ÀúH^€+:…a,´n€vA`aˆ@†q ‘­Ä&3À’ØDh¯ÌfD\ 1kÏ�®„VŠŒpwAkD‡‘ÀpOþÇYP�z*,ž)&<„‡ì‘ÿð9%DhCãZöÿCÔ{ðü#ºe�4\ |\lä–?ZKÞèd€gN¢Û}¤ƒó+z¾©s†¥B@k¥€–É0Âg°r º}ÚÆBjT!õbPF…É{Ç5}"×]¼Z¯ü‡Yü‡7O!N€6ø`-Kˆ�”iê’Öý~ϬÒ÷HFËÿ‡Œ£ÃŠ'$§3¼g�=ÄÀpsûô¼¯¤¹ø?lh ÞO€¶ç‘‹~”b)ë3B—ª’Ñÿ!³ï°ž¤èa‚µøá/¬)ö*¡-Q¼cà°¹(Ö¤†µÈ!þf„ú°ž!ÐHσ Vb/ð!×2B»8¯l‚˜k,cô þab BK¨¸ý¸�Ðp  %ðáM Å?€ÎºßSnö‚#þC÷ @Ý 59ôa‰¥qÄ€=b@� Åÿ1_â’ƒ´à #x³šà¦JÁùÝï€Ô;£ÈÒ@ëAG S¯8¼Ö¶‡¡_Ü.5~�ÞYï€øåÉÅÍÄÝàÿÿš{!€<n…ªB[êðޤDúi‚=ø®é½@ê>lP�ZÖ¾ªý½cFÁ+ŠÜËÈðhèy¤ÁXïˆ>ubdÞ‘c€÷d°¯YÇ †ÿŸ6œF*a7ÐÆ´¤‡¼ð11XƒÔ x*eÆk@eOàÝ>x'áJø;¼²g@ ºÀš¹LO°þÜ”a„7‡¡E<,œ`Îe„WÇPÅt$¡°ÂŠÚɵÚ5+ ͺ@[9 §´óÔ ü®r³ ¸Ìø’!³oÿáE=@‡ëàþ{¤âšÏFì@�‘uo÷( >0‰*ç&FÐx&ïX®—%Œ Ý‹ÀÞãçSKZ)/àGÁ( (j;æL»æÈ£”dès!ͺËM7b3«¢ûœPm"r÷Ÿ Þ/e€MÐ@¬Aïí#·è9-EºóN#�ÐPláKpfY'h7,SÖ£`�`aï ,Zõ KNá]h?Z@C‡¾á]5ݲ®3ÿºÊL6c3º! 1ˆ^ïÀ™‚LùB»2Ƚc4,:r[ø�4×á‚Q0 1(l;j ,‰AÇsC×ïÿ‡ì{øÝäÝˆÈøq¨d]=HZ¯¼ëŒc!“Ï H{B GS£ì­a„Q¤ºöþ? î†+� ÑŒ‚Q@5�,ìùe«%#|3b“täŒ)І5ÆÿH;pQŽFÀ<¾ÒN‡o¢D*¼á;#|ƒÆ™ø¨›¡sM#�Ðh? FÁ( &0O‹CŽo€]tÈdVðBïGÀ(œY­|]SáG)#ìß# ï9À|ûßýŒÚÚo)Òý@Ÿ |� €F üQ0 FÕ�°ŒUb@:Š‚éˆ Äý°–?âP;ø×ð#$d1 GŒ¹"vm(d¸ù2t˜™XŽRa¸O‡`´� €F'mGÁ(T­GØy gÝ@7ÃWùB7s£l/„¯@ý¶…̪‚{èW]þ‡ ÝuÀ�Ýl…¼Šô?|÷æ2Rÿõ}>t�@�ø£`Œê�FØf»ÿˆÕîðeñŒÈœÿð…óð£p ÇA‹lŒ܇ï&`€E“CT#(kí‘¶Û@À%jzy¨€�-ðGÁ(TÐ3yþÁO8‚´é¡Å9ü ¤P Ðcø™à»äà§&`Ü4b€ï:†«�àv"¯ÃGY“ÿ¸¥H—äãG†� ÑŒ‚Q@ð1n™žù?´iÜ*;=±{<ÆyÜb•B)üàR´ƒ°ƒ»ŽÐÀÛC �Ðh? FÁ( x½ qôØ%øÉŒÈ[ba­xÐÚè¸ûØñv ¨á z Ð?`ÚÁ@EnÌcÙiûÿZK‘ú±,#�Ðè*Q0 FUÀ„j›_À‚tføHøMaŒÐûœáà0@oì_὎Οފ>ôÂÆ€|CÖØæ*ˆ™ÿ‘×ÞÃWúÀð Ø~:Å �4Zà‚Q0 ¨þ3>e@¹) roñøê È÷Ï¢^. AªÑ—OJB–b2@6o1¢ßó ½Qí?|Í=ìÞjÐ)µ›[ŠtÒ//� ÑŒ‚Q@5�l™ßþ¿r|#ìÚDøšyX ÒZ‡ÜÕËÞy‹8‘‘ýp3uÄ1Òðݶÿ¡w3Âv×2"] ,ìrk€…=‘·¿ �@£þ(£€j`B•õs`áûºØùð&,Fø l·,ürqpkrçí¥ÎRcø…8ÝçÔ€úX w/@6UÁÔÃ7WÁ þÿHÃ8 ë…ý†Q��4Zà‚Q0 ¨  Þïÿ‘‡\ ýø!f»”açÛü‡ ó€†òAs�ga•weªµ@ž� éü‡ ýg„W*ТTi€ÎÕ_5ZØc€�=Œ‚Q@uPØvLX˜Û q^øŽ(ÈŽ,Äñøhgã©÷@Æá®rÓw0s*ºÎ�Õ 1Àç l¯Ÿ†¸+†ñÿ¦«­Eº˜wâŽ0� ÑŒ‚Q@PÔ~ Ø:gÐ�ÆêÀB™VVƒRÂï5—Þ_€r÷ºËMá7^•uŸeʘ1þgP/ñD\ªÌ�)îÁoø6ñ°µXÿ ]=8@�ø£`Œš‚¢öãlÀ¢YÈ–öÜЋt |ÐÕ†/»+Ì_¢ë)ë:Ã,Ïy`Ë둚õ¿ÚK ß¡«Ä€�-ðGÁ(£`„�€�´£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�pwm·Ä Øë&u¤‡H©ñºbÖ10 ‘"å7'ù¼Àðð~ígþ¬xõù|9»uÐå~Ç>}¾ßÝ~$ùéRØÛ¥Â±Å]Ê'åc<…ëÝNÊ7ÛOœÓ0ÝTÑù 5MÖÎ߱qÜk´¸$ŸëÈ¢mË ¹òš=o;m ›=3OdÎ!§ú ú,È5cN\œã,ǹP·ãÐc.çÂ,ë.ÏϽvÎì•ñ. ÇófŒô*Àƒ RÉQã9ß ˆS„ÂIuê(p!¢J¶¡öRÆ«Ÿô~¿ÕG9`làxÛ_²öùˆjg¡üÓ™Ñm~li‘Êôów>k¬¸xª£‡–øy–YkÌÇZ½z®6€2ï– 6 CÍüYåÚ±öß#öd?ðà^fLŸe®œ8\®ÄFÞ`Ẇ³Ä[öÕØÝyê_‰díåA ÿ…}Ûì÷7ùo¿/Ø»‚€A¦ÿ´Ûa…%©xÙe‚Èl›¶i…ô‹?üçɱ#;\y4¸»> ¯®Ye™Â©ÜPo’lÁ·òÇy%(c»E3É—Î'ã!îçäâO£ãp‘n—Ç6*VWKÔSÜr\¨ëêŸú¾ãùô¬8¼d§buÜ«¨=¬¿êß9Þ=‚~'ÿ•÷¸ · v�€`ÿÿÓN’¥ißHÄ…‹Ó*Ê+çï‡6Æmv¨±îr^25øÄ±38Âvu墜Næ×94–Æ;,§¯jå4"¼d0éÁ½¡ižÖ­ù´®“Þá·Š»C'})FýÄQ?�CjÊ[ãºGε铖r¿,S�òË €„ÿÿµWBÚ¡rðâ› U4e|øi íÔœFÓ}s¹n‡7ÕMH_éª&…‹ë¯#²é#Us}VõÍ+Ьú´_´äW÷Ñuç5ÿ ݼÔÔú’¡Øý¶0Ö½Óþ}üG�nÌ�ÿÿµkCਓ‰]µŠ©öUKgFku¸ynŒÚ$ôåOÎÕá¥\%#u¾DŠî\í±'œIë%ÂJ‚pëX'†³w9Ž´7õu÷oswk¤¨xÝš‰Œ[½è÷Õê¥û%| {GÖ‰DUƒjuk8¾#�9V�‚úÿ«;µ9†@uèG3Ór ½úÒY:Õ1û”П[s ÉâPdœÍD ÓÝNK(ÎÚ¡NR÷Ö©0‚Ã&�óEÒU“CÛ)‰U¿]]±’úݦ5Žnm žOZ»¨WÓZº·Þ©›h¾þ)€bHY [«åJL¡L(Ñ[ñàêv£«!”q™‹«õ‡«åƒÞ3@6‹P!F¨òDWOí./¡4±�W8!ÛM_<áK;Ĥ\�[!ãã‹/|-yrÜ€-ì±¥%R�¾Ê››ð¹ŸpžÀ¥™F¯Øq¹‹Úi{È€�ÜšÛ � Cÿÿ¯{•áæ¡‚ ^¢©Û¢Wÿð«ÃQæ—‚(90q$'£m“ÔOû¹dE’‘Ø»…Ĥ:{ðÕºÓ½:¦NXawªbšãI‚ÜoZ›�?!ÙâX¶®ˆM"¤í€ÞõŸ�Ýe À}¹£��Â0Tïi'¡”$MtÄ¿‰y/ Ÿ]n…`ޱ"››žTÝÁõݦDtŠîÝì¤'çãB}˜p• •¡#óÌÔÃÖè€H“·Á#©ÂBî_oµ6eì¨T4Ç>@¥E´Ÿ9ð\q‡”:„ÆÉÑÙ÷e @Žä��‚ õÿOwjc;tÉSkÖJÁ—=|&¿˜Õ‡€ŒÚÉa…ÆØÅT±\Ë$ÁÁDyÃ<_¥ˆÜžÝÇ&2\ÞcRØ[O>x’Ô«oZ ]rÇu윮óq¦ â±qªÖ0ÆIYb¾bªyEJœúüšáoÈ1ƒ� †þÿ_»JÓ·u¸$fÖvóê¿ö$3I²Ïì)a©}“Ò7µEç» u ®**s"ÊD>7@Ú„ÔùGíÕ;hOâì|G™â$ŽÈ÷®:qkG´ÖïöÓ½*¨HßµŠŒO‰Ø½³úQ÷êø»¶`ÇÊq��A˜þÿÓN&¤iK™\dóBD)ÅWø €¹Ç3aHn¿IɘŒc%·²! "ÇÆŸ)= Í \]à+€îª36u×¶bÖ.ALî‘% ¦C+ñ}Êvß‹ûØjb‹K$ ¨§ºpÍä¾XŒÕ±ÛÿY=È€œ3ÖB¨ÿÿÕ®†ðàÚÅAÆ+¹+Â-½ùó´–t§®kª ˜œ?ñ8÷Ó¹N�)Å+'=?í$(ªa3?J¶nÏZ^Hºž’¨ãئˆ”$µöSc!¸KhrQRÿ\_'“Ü_|áÓŒ•Þ×ôª¥Ï­#-][�r­` ýÿ_?:<™ÎíÒ¡ÝŠ’ 37ºõß¾ „„ˆ‰ÂÏëPshu޶º0ŽÜ�V}(~ Ó¹uW2`œ¿=q‹j¯›Œmâ4Ýø ±6%�÷ø¤<N rZq; g4\c¨Œg›AO¢{$žûŸ�ä˜1@!C¹ÿ©]H[ž .ßÉ`¢ Z[xÝÃïÊîˆïŽSô*v¡ÄvÒPâ7þÝ“ŒÔ™0)'_!¦°õöûX’°¤¼ÐÜ:L¤2"ñ$±M"avmÉ0lDx“‹T%“ùTmºuuÖ 7Õø¥�¸1ƒ�@þÿ××Y!:Ô1+Ál{ý¥CI\É”è‡DT%_ö§µˆ[jtÄš„K æ%ïé⩈4截º{žâ@"ææ’ë³³çØn’€f;&R¹¯ R]£ü¹´®ÖæóÃ>Èî­: 1É{ÒƒïÇ@=†Ø01-4bZØ2/)ÝWr3 L/:ŸPKT@Nw™Ð©ŸŸB…)µÂ&†¯Uˆ^yâj\`s¾Š WEGŠß LR[ìøäµæñ\~ÇØMèzÐÜP^*60"[÷ �€ûrI�èýO]ÛA}F4«Ð"ó“΋Ÿ$™KÝ7)$ÊtÂÉîÊÐ5(2Õ;õM¤Á¹b;AU씲Çó]C&÷«>ÆpyÇÈÔ·“¼uˆqËôÔq]1¼îSu6vë˜Ne¯ÊN†µïÖ`õ ¶�äœ1 � ÿÿk'AÂ%Á.: ÚVl‰ƒ/ËL2ðfŽ6 •”·Iw êæjümÓäobH tÚó†Ú¸´=QLc/]d •Ñ6ðU)ùKj“€ãÌ£[íUª¡VÓ‰l¸u4»ïêgªÚÔ_«:_“‹lB¾jK�rÌ€ùÿ«ÓZ# l·RRû ‡Áξt©±‹R]my±›Ê×*»ˆsrñL?E"÷?}ÒèKlôs´‘E*&uqC“ËÙ4bÞLi CCÜNÜ“ºw°åo…{ÆSd«r_ŸöiŠøúöœH¤õ,é_¸9ƒ€a¶ÿÿtO°8³-=ê-Âj0A'—|ñ—ÎnÙ´–o­Ÿ’Q=+SoeþÜó†Jñiÿ¤±g¤g„Ùè´ æ–{ŠkMŒêx^×=‡ã‡¨Ú^ 4ÈSoµ¡œt6¹nù3.ÑÔ¨óޤ.ý �¤™â™5X| ¿µK�òË`„ÿÿu×7C—2F‘@Á1Ç—†Ÿ $} cK#o褙ö›€LÈóžQŸQa;ðÈ�’A܈¿í mÖ'ª1QÜ4h2sªÅò§þ$ð œôþ3ÎÚ[À8ßc†Œõ—†àfÊvfšMÃóÖ|[Ü6¥ßÅ#�9æŽ�ƒÐûßÚµix€“ƒlm´?Á×_:TL­¼S Õ2Êd¿Á.\*b‰sœX¾ƒRt·~ïi5/Õ<É-ÓMjÍå ©°iß5‡ô8»$ÅÕæÑ¶¥|îÛØš G¡QjŽò')!£Â÷Ž�b¡“=èdÏ(£`Œ� €²…? FÁ(£€Ž� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� �ùV0ÂØÿìÁ,Ë$i’âa—íâ¬X ê±_¯†½.·¹æ™Ã.bˆã>ŒÍði»k1ËËrâú³ïNE«Âo¶ç©´F'o·—˜ÃGµ~ƒVgÔÂâOx”^W÷åôŒªduuu2]>†±>«˜ÏÙÙª3-Óy›Œ›ib<¾6ìgß-�wgŒ@Aÿÿj¹BËÎ&6°0ÆMP´s|ùÅá×”RÇWðß>ý'ê;S@”«Aû„‡ |ZSzÒNœš)Ž@u•ECuÖi é .ñWÍŽ ã.TÒtþ).#íQÇÌQ[›°‘(.á*j ±‚μ„¾ µ¤³ê8B‰‰¤wB‡ápÖŸýb&~i[�òÎ €„¡÷¿µ-“IÂs‹mLå þù‰y ¬¬ê}±EÐ’e#@7wº[S«ôx¶¢˜|r¤}Û¿§õŽ™ûí,-�*C;ÙÑsh|hÁnkM–õŒÍ—Vȧ•i9¤ºdúÛ|™ ÷Q>qãgqàæŒq� Azÿ[ÿÕ4¥¯ãð ¡eá5Ã'Fn,F¢äÓâ,òÙDÃjØ€‡»¯BS #¦3õ­¶ ôS3N ¡S[bðÉ·#,NwŠC}®y¤ÆGSÝÔÜô?8‘nbþ;’Þqš¬ Ų'qþF>È9c€b†ÞÿÖ•g‚K‡ïV•Z“¸ôÅø›ªKM¦†ÎAt1`´wÖTSkÔ.Gz T{£*/$|QI­ÿFäi;Q_×W€f»twv“ìüunbé»ù"bÛ„B³ͼÃÕž„^KJø¿´O�r­e�„Õÿÿt§@Öt³K‡¼b5Êע׿tÞ;tœ]> \E»;A¥p1<ÝávsœÉqdÁä$µ8Gu—ÑV·Ò³D­ºçŽtŠUÕ *_`kÝ<%T :Ú¸Ì Y +.Œ ~åÛÛõnÑ@Ìq¬öͰ3|ßÊ€»+F�Aÿÿu«Ç ‚Ý5äœ0ضôú”d`µq†âf¸·"žˆB’.”x£QN‰H±$Tù’$çžc[˜ÂM×·”¡2®éÕ>çé¡ÃpKη›ë&3ƒ@^äRwÕ™½2·n“Ûðu ïÜq��Azÿ[»â{E™ Aù´|õ‰yšÊö¦ìà¦A)Ið)—$O L†÷{ØÀ�–±ðSàëqÉOàeïIÊðv!§ó¤vÕgÊÓêD9t£…¹«¡I­ëN [Š91"4©Ç¦³hdò;[[.)�€ ½ÿ­[C̯‚6¹ *Tßøøj@]“™<Ùš ÏmZx6[ȩᦙÀœ °ŒÍâ5ì@¡UÎñ¶Æ 0­p(ß\ 8]ÿÛ»Õçü§Ä’å,‰r“k³µ·±wkó… È/ƒ�a†ýÿ×\«ÊaH\ÈmЉie^ò5ðí€ÒsƒŠ¹DAƒœ4­Ç\ÏœKñ´4½# MS»KTOÉ�ôÝÙKi={ïÚÄbµ©¯)¡4�›ýsÙìÿ˜Æ-”mv}rÖ6Þ¦âÔ˜<íÓ/t @~¤�� ÿÿº«ˆ:A‡vªÜ(}áðo`lcuÂHDl’�Š’~š›BÍPwç”Ýžxnœ sÛÓ;'‘c<ÆPâÜš…ÛŠ“*'˜)¹¨Ýgú£ö“رp&.óÜÄcçØ1¥aÏU2nÿ{›ù_Ô€{+H�„Aÿÿu§`ˆ:½tÈKV´¶å‚^~¼š-" ~Ç¿ýè8î¡Q¸ Ji·É„¤Û§ v6n^HJ#—õß¹›½)…˜Ø+¹p6ŠvM*†is'¶êÆÙ¯MPîÑG’jIE¾SÏiì¨uYâŸ|çӗ8oî8�à ½ÿ©Û©Re=°d‰—Hù¢�±ròãÕ×R¹–ó, -»d¤5´Göu¶y*Rª°U#SELgw$Sу1EÞ³U.ÿš {s#“ºÝøÕîjR¤}t¾åÜSÌß"!d¿‘ ü]ùÊâ(×]…W�îÍ †¡÷¿µ“ Á×$ù`Áj#hÓtðWNíyRdm›éph­Ž”À“™ºâ6‰MÖ"M×ö»Byž%UòÓYbŸ”ZÔ¶ÏÝ)Ýë-Ž#sŤ¸)!ëžÔˆP]ñÕšÎJqO µ^S`ž´%€jãz†"&S R¡î).µØZkø* tsI-¼‰ú@£$ÃÁÌBojÅ“Rx’ÒÛÂð…1²Ð+\qF(Ýáj(à’#§!¦"D–ÃUáJ7¤Æ©€˜|I(âJØÌ!µÇ¬ŸF� zo¼B¦alB5=¾V5.>63ˆmáÒœèÐ |]ktw[°j½ÁôRƒl.uÈþ!'ƒàËŒØh\ò0@¨‰.¯EGL/ gx›81ñˆl>® …X?cãS!QC ±½<d9Ùï¤T ¤úyDü�È1w€a„ÞÿÖQ·ñ0õÒ¡ž2Är~`È×_:O$@PCx«®¾µz  dó› U“ÔÎ=GëjÎDnœœ5nݳ6¼6CGØrhršwÙÔ#‡‘Ü¢SóN´¸sq¸!"Ýü´FÆ-5¢°Þ¹=ZïâÀä�‚0ðÿ¯v¯¤é”ÆË&rSŒ¢¡”úG‡?º[·NÇšätNúF dHq+Š3&çoÕ4%*âéÄ0ˆ€qÅò€o#)5›î•T—³¦yp±´Ý¯Ëˤ$uO a!Ioç6ŠDã»™›ûÞÜÓö zÝxÅN'{FÁ(£`à��4ЧeŽ‚Q0 FÁ( � ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� zžV¥±·NŠ5Ì@?)f"R¹êiaüâPMˆ.‡Ožµ¤ØË€ä,|\lråèi%éœ9z釥Ef`6²±jZF� Ñþ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@ô:¹NöŒ‚Q0 FÁ(À�h´…? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�ãÿÿÿÚ £`Œ‚Q0 è��h´…? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#��íDÚ×p]Ã����IEND®B`‚�����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-curve-to.rb����������������������������������������0000644�0001750�0001750�00000001532�11701304107�021622� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-curve-to.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Curve To This demo shows how to use GDK and cairo to draw curve. From http://cairographics.org/samples/curve_to.html. =end require 'common' module Demo class CairoCurveTo < CairoWindow X = 0.1 Y = 0.5 X1 = 0.4 Y1 = 0.9 X2 = 0.6 Y2 = 0.1 X3 = 0.9 Y3 = 0.5 def initialize super('cairo curve to') end def draw(cr) cr.move_to(X, Y) cr.curve_to(X1, Y1, X2, Y2, X3, Y3) cr.stroke cr.set_source_rgba(1, 0.2, 0.2, 0.6) cr.set_line_width(0.03) cr.move_to(X, Y) cr.line_to(X1, Y1) cr.move_to(X2, Y2) cr.line_to(X3, Y3) cr.stroke end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-clip.rb��������������������������������������������0000644�0001750�0001750�00000001316�11701304107�021005� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-clip.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Clip This demo shows how to use GDK and cairo to use clip. From http://cairographics.org/samples/clip.html. =end require 'common' module Demo class CairoClip < CairoWindow def initialize super('cairo clip') end def draw(cr) cr.arc(0.5, 0.5, 0.3, 0, 2 * Math::PI) cr.clip cr.new_path cr.rectangle(0, 0, 1, 1) cr.fill cr.set_source_rgba(0, 1, 0) cr.move_to(0, 0) cr.line_to(1, 1) cr.move_to(1, 0) cr.line_to(0, 1) cr.stroke end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-arc-negative.rb������������������������������������0000644�0001750�0001750�00000002162�11701304107�022423� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-arc-negative.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Arc Negative This demo shows how to use GDK and cairo to draw arc in negative. From http://cairographics.org/samples/arc_negative.html. =end require 'common' module Demo class CairoArcNegative < CairoWindow CENTER_X = 0.5 CENTER_Y = 0.5 RADIUS = 0.4 ANGLE1 = 45.0 * (Math::PI / 180.0) # angles are specified ANGLE2 = 180.0 * (Math::PI / 180.0) # in radians def initialize super('cairo arc_negative') end def draw(cr) cr.arc_negative(CENTER_X, CENTER_Y, RADIUS, ANGLE1, ANGLE2) cr.stroke # draw helping lines cr.set_source_rgba(1, 0.2, 0.2, 0.6) cr.arc(CENTER_X, CENTER_Y, 0.05, 0, 2 * Math::PI) cr.fill cr.set_line_width(0.03) cr.arc(CENTER_X, CENTER_Y, RADIUS, ANGLE1, ANGLE1) cr.line_to(CENTER_X, CENTER_Y) cr.arc(CENTER_X, CENTER_Y, RADIUS, ANGLE2, ANGLE2) cr.line_to(CENTER_X, CENTER_Y) cr.stroke end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-text-align-center.rb�������������������������������0000644�0001750�0001750�00000002236�11701304107�023412� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-text-align-center.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Text Align Center This demo shows how to use GDK and cairo to show text in center. From http://cairographics.org/samples/text_align_center.html. =end require 'common' module Demo class CairoTextAlignCenter < CairoWindow TEXT = "Ruby" def initialize super('cairo text align center') end def draw(cr) cr.select_font_face("Sans", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_NORMAL) cr.set_font_size(0.2) extents = cr.text_extents(TEXT) x = 0.5 - (extents.width / 2 + extents.x_bearing) y = 0.5 - (extents.height / 2 + extents.y_bearing) cr.move_to(x, y) cr.show_text(TEXT) # draw helping lines cr.set_source_rgba(1, 0.2, 0.2, 0.6) cr.arc(x, y, 0.05, 0, 2 * Math::PI) cr.fill cr.move_to(0.5, 0) cr.rel_line_to(0, 1) cr.move_to(0, 0.5) cr.rel_line_to(1, 0) cr.stroke end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/gnome-gsame.png������������������������������������������0000644�0001750�0001750�00000010247�11701304107�021346� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA�† 1è–_��^IDATxÚíšYŒdWyÇçœ[{UïÓÝÓ3Ó³Ú3Áa0¶Ù+f1FÆ !äHI”<D‰òDxŽ"EŠ¢D(&Q$ŒDPŽ Þð2›ÇžÍÓ===ÝÕµÝ};çä[Ööx°‰£¼p¥£ª{ëêœïÿíKÁ¯¯__ÿ«Kü?)®q¶ì›àï¿ýtýüÊÚmg×F‡kº7±N¹7ìÞqzy÷Á§>üÁÛã7x–,­ígë„~S�üÝwžoïéߟkÄ0×ÜØ3×éÖ«6Yžš,ñb×MWrâ?ñ[÷?ð®;Þï—¸j¯ÁÉ1ñª´œS¬|ÛúÕ�üÙzþüð¯oY®|ì³·S;s%æÔË>sjÈ\3àÒ–Ï\+Aˆ ÃðáÝËø‹{?ù»+%�y‰¨2ñ•‚ð P/=Sç .>ÓâÙ˜cƘ2­j;ñ_ùÆã 'VFÿò;ïkä wN;û–÷‹›÷ÏÒnjúY›o9¼£Ê-‡¦ÉdG-ÎʽÍÓ¿¹ï†w?úÓŸ=‰ÂB()¥°ÖÚÒ9  4€&0L“Å÷Ð.~¯•$%KL(KùÕ�~âŒ|ð± _ýèѹÏ|þβÕh#B³4§xÛKÜx`©F¼i‘猆¾çíF¨©?òÜIkm«�!…ÆqcŒQ%®7 B§Y`ªô¹£xÞ)ÞuJRcñ–Ò�|ã'g8Òù½wìò¤Õë :Å{S@Ž‚é‰6Ïs:ë.ª&é­Rœ0 îûÄ=yò;ßýþÀzRJ„üßÜÿ¡[Þ²t_«¥îØ}&Ì[iØ‹.»Y÷ø™­•o<òâó/^ÜØ*¸œà[@è{¥w�ò«�\Ú ?Ýjµ§Ž]`Ì*ósÓÌLÍ1Ñô6GU0!u¸¸òÎ['¸<_çk?vÙ=“·§gÚŸTJ=$„õ¿ùÓ{ï¼ëƒ·}yzjòˆª(´ª¢½@$iŒI‡éååewùÎ÷ÝòÞgÏv7øÖ#O?wn}½ Ð/$3QHm«Ð¯d æ*�ÂæÂòȹŽ­M0Qó¹aÏIŒJ˜DpS[1í(”Ðí¾ù=<¶Î³ç3†n$&ñ¥Ôq!„ûÏõù/Ý~Çmïo´[(¥‘J|„SG™”Äi¡j +-êÀ»ë•ù—î¹ûÁÿøù™¯?ü̉B•¦Jv1V%Sr·ú*�äéA£5q*éæ‚8™7d*#Ö†õÌ’:5™óÖ%Á·žöyòl�VàFŠ(—ÓJ©å¯|é÷îÜ1³Ïë®Xì.ŒQµMp4ƒ`³hL`â˜<Œh©ŒÜ~膉jeòo¿ýÄ3…Ô ÂEAtTH(äUF¼të=éTj i-Ö¤˜<åèNGîh–K§ôÝ?ŒøÑ³ß}jDàG“’ÐZØÛv9s7.ÍîR¢"hÔ µºÂ©+œªÁiÍéhªõ:N»‰”!ëT¤Â˜+jìh;Mdµqêâ†[?¦3/¹Úȯ0ÿ¶~Ñ‘j›cóaÞy¨#öN’$`&Ø4ä›?ùÑ ®"ò�INfcnžÊ'2k@VDÍÇ‘(åÐìÔ©7« 2!T«jHcäèj$Ø0Æ’¢-쟞\Ûòâµ-7. ×±alà ]¥Bi>Kç°ÕU!Ejg;šÝÓ¶*ðsÍfœ¡ý„ó[)y’@‚Í�EØ ÇÈ^˜“ˆ‹G³Ù ÕL™^˜B6v@£$Ãæ9J@ª¦ÐYJ£¢@¾cŽÖp@hís×;í}òôj·P¥ `¦°ö8V\ÀI‚‡b+~ÛfÕªR9›™¦ïÖ˜®ç¤Æ0r#ž?chŠ„½­˜—ü°EòbÙ5USÁб2wd›Ð™BÌD¶—EœFá(´Õ -•4ƶæÉu†Œ Ýr™œìa·"nR­ÃÎÍœ>¿²Y1U¿ @É2€»Þqà{¡78æ‡aÒsC^,yœræ\Ä£'\ækWÜ!œWbJCäv¸¹Fœd„IJšj²D£SÎ2ÈB Çê¥#lž’‹µòÇè\ƒ­¢S‡8ÍÐIÂM‡–æJ‘¼VŠÔ@]eýðß³ß8ú®3£‘ÿñ<MšY³v%$O?;àÇ¢LÐõR‚¿ŒVgfwÅ·qèJ Ô+ŠVEˆ©†eº zN£’a³“eBÇ1:rÉ“ˆt´I<è’C¢þ&£n¿»F³/¾Ëc/­\.<PZ³0<g{.t×Û—ý·ÿ:ñ•‘—}Õœ;*^¸[›g`-‚HÄZ€�‹Àh̤vcos­aµEW 1¡JŸ¾2›¬Pï7iâ4:Ш“iC¼1 ú$IŽ•ŠA�žIE·›Ð"ò_¿FF댽ӫ’¹ÿüáäLÝœj¶g/„©>lu2mu¢°©6¡ŠÅZ‘YÿvWÏë…™‰št”h6jLL´Xœ›{wN±gy–¥=;˜ÛwæŽd»#lm'Yæ,ÕÅ}T [“„¾ Í6Ns‚D:b¤jø¹•Ç^ºt¡äûG…¶®)€“ÇŸž{ìàMoùó™‡îö³Ú{µ¬.[œF–xšt+‘ñ(MÝ ë†AE¡l–ØZE‰ºÕT³'�12ÈnFÖ’Þ/"QlÈÒœ02ˆJ+%A³¹¢mÎ ¯D)C~l‰"“oK¥m! õªdn[yǹOõyñÔ£À%!Ä)å‚RjV)5©”jK)kRJØ8ÉL]"† Æi昭ŒnÔil M3"§ÊÒáÝ„±"OZVéöc6F.[ƒ«#7Œ·ÕãïúU¹P‰xSD»qà‹[kSkmbŒ©Œst!Dî@<ߪ´•„Åv¥©:;fª4§êÔêÕZ£G(9 ´åìÏΑ)‡ /Ã#ü$'ÔeZˆ¬bk®Ax>.v^ @^îÖÞ¶Ö¶¬µMkmÍZ+1Ba1™BºIÂT­ÓnÕ+ÌÖ$“:µvg²…jTˆ3p¦$õ(c˜'ähõ‹Ãê3MrÓ&&4à HP¡™iz—6û%ºt �¯Næ®Ä;¥jÈZkó‚èT‘!ª€Xí½…™Úp©55Ýafv†ÙɪVÁhCœE˜4ƒÍMbé"¥ÕŒé‡7N±:!«ÕèÅhk3¬\é JúŸ”r¡øµ$PF;*å µ6|kí˜1ÆL5!D0?9uY>´û…@§1ÃnR”ìIài²Ä’Š:½î6Ü/ʉ㔠Ɉ2Ö¶hQ8¼ôòê¥r®\ÐáÄg¯*h^£Í1b!D`­�ÖÚE`Ñ3U” @=vìüÚáÍ÷Þ´øV»0M†Ø "•’¡Ÿ‘IÇ ƒ$ ¢”¨2ÉÔì.f[‚ `uu{¸ý­‹W[Bk­g¡^ ,Ààü’®ÅØhk­B$ÖÚØZ;²ÖŽ„¯$WÖÚà|íáŸ?Ô¬¿§º7æpGj†¹Àè”<N$†$ÓtC&†»îù{ö.ãTÍV›ÁÀÃ^8qÜþÓ_”:i©[÷ù5»×i½XÀ!LÁ‘ÔZ«­µYq¯­µп°r|va®ÓjµvåÆÅš~jqSð’\l…9ŸøôÙ»™f³ V°ÕpymÕ‹­ëºby÷ι³çÎ÷ò< â½R�ëÕH½Á&˜(sžÍ+’;þÒê© /º2²µ¹a”Mô½€Þ0`kŠ}êsìÝ¿(ŒX]½Ìp4B ‰çû6Ïst®©7ÔšÕ©—/\¼PªFÀ B $¿L…XܹØ|ûÑ£_>zôè}“““³½þ ûØ£ÿýàO<ù­,ËümFŸWuòÌ¥ÇO]{lÿ®Å#3íæ-ªR=И˜^Z˜ßéäIÊå+ë~`6tõ– Ôkurã>­Îd³Z«Ö’8ÉŠ3T©Ì¬\3*_;w.6ï¿ï¾ï¿ÿ¾?:p`ïÞf³9—çzïDgân©Ä®µKkß)Ô†€±ÎfBˆXJ©Ý ZÝzÏt‡îïx÷{nÞ¿wï¼5g1IšàT+dy&²,#I‚0À |ò$›[7 ƒn©[ðH^ÀÑ·ßú‡ºóÎ÷Nœ8ÍêÊ%ý>ZqðàÁÏî^Þsw‰ë~)Ñê !z…®v¡b(„pçæd:HÁÌìá(‡4I±yFµRE IµZ¥Q«’=û.T¶Zp¾ZÄ%^+•xå:ò–›¿!I‘f)I’àù>žï3ò\šÍöGŸÝh)cTÖZ)„§cG ýQÐëõÛõz@»Õ¦ÕêÐï­2rG¸¾Kžk¤kHuNž…IAp¥Ôn×Ë…^¹¤R7a@§Ý¡ßâ¹.Q¢uŽ”’ÎôÔ½À¿Ž];vuÝÒZ«„!T¯Û}j¥QûÐÒâN¤RT+U¦f¦°XüÐC›œ Î0&' B?LKÞRns­Ùu¬^\yJ yÇââív‹~¿ÏІ1qáFCà¦bðpq1à !B@K)m!)¥”W.|Ïòž;}?°QS«Ö¼€Í Ò4Ú°–,JÐVŒ†~© o·åk×w£NÅÑÓ33÷^€ëzb8’¤)qœ„±]Y¹x2‚aÑ%¨b Ÿí !¥TV©TRÇqr)eá±ÎÔÄg´ÑÓiš’§9#o$Ò4EaÓ,QØ<ׄQ¬\|ùœÖÆ+eƽ®z@¨®†ÍÉ$‰öGIòÖáÈÃÑßóLæÊú•“ëëë/cÆ&Já~TäNÉÜÜ\^­Vm¥R1Žãh!eê/4šÍO…Qä ]$‰q]_x^Dèh¢µ1'Ž{&ËóÜo f¯@à&Ëò‡ÜÑ`%‰“Ù4ËjÃáàôË.üèòúú)!D§äF“¹…÷ 4Ón·)½4ÍιýÞãJÚ»ã0nú^@–eB'q’Æaú§_|á9?ºRªš5Æ-ö„oL ÅëŒÀªJìökgÑ£©ÄËÀËÀ…â°4­`aaA�ôû}Õl6fçæÿx¢Ó¾£V«íÜóƒ­n¯ßï_LŽãLçy¾^ì8 œ+Îê½Þ)¥,"à°ì �ÕÂ}€MàR±ù �]gÞU/ºmóCöCŽ™Ò€Ãºß/˜² \KÁy�lAˆ[åÅýø»_ˆ×/MƒÆÞË-u¡Ç½ŸvÉóÄ%õJ©y#�òÒ„D‡v @¶tpP¨Ôë™ûŽK×Qq?6Ô6Ð*y¶¨Ä ¯|ÆtKÕRRUÝVe¥ˆœn·×òØÅ~ÍbÕŠ5.e³mmõqA£•I}y`=ëNéù¸«‘m+À_ϾNi Jg”3Þ¤´÷›òW± ¥ùî¯ô÷’´e)q+·|ÌÿÅ%Ķê;Éû^sÏÿÖ1ÐÁaæ����IEND®B`‚���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-fill-and-stroke2.rb��������������������������������0000644�0001750�0001750�00000001650�11701304107�023134� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-fill-and-stroke2.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Fill And Stroke2 This demo shows how to use GDK and cairo to fill and stroke. From http://cairographics.org/samples/fill_and_stroke2.html. =end require 'common' module Demo class CairoFillAndStroke2 < CairoWindow def initialize super('cairo fill and stroke2') end def draw(cr) cr.move_to(0.5, 0.1) cr.line_to(0.9, 0.9) cr.rel_line_to(-0.4, 0.0) cr.curve_to(0.2, 0.9, 0.2, 0.5, 0.5, 0.5) cr.close_path cr.move_to(0.25, 0.1) cr.rel_line_to(0.2, 0.2) cr.rel_line_to(-0.2, 0.2) cr.rel_line_to(-0.2, -0.2) cr.close_path cr.set_source_rgba(0, 0, 1) cr.fill_preserve cr.set_source_rgba(0, 0, 0) cr.stroke end end end ����������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-dash.rb��������������������������������������������0000644�0001750�0001750�00000001415�11701304107�020775� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-dash.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Dash This demo shows how to use GDK and cairo to show dash. From http://cairographics.org/samples/xxx_dash.html. =end require 'common' module Demo class CairoDash < CairoWindow def initialize super('cairo dash') end def draw(cr) dashes = [ 0.20, # in 0.05, # skip 0.05, # ink 0.05, # skip ] offset = -0.2 cr.set_dash(dashes, offset) cr.move_to(0.5, 0.1) cr.line_to(0.9, 0.9) cr.rel_line_to(-0.4, 0.0) cr.curve_to(0.2, 0.9, 0.2, 0.5, 0.5, 0.5) cr.stroke end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/list_store.rb��������������������������������������������0000644�0001750�0001750�00000011042�11701304107�021147� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: list_store.rb,v 1.5 2005/02/06 18:25:13 kzys Exp $ =begin = Tree View/List Store The Gtk::ListStore is used to store data in list form, to be used later on by a Gtk::TreeView to display it. This demo builds a simple Gtk::ListStore and displays it. See the Stock Browser demo for a more advanced example. =end require 'common' module Demo class ListStore < BasicWindow Bug = Struct.new('Bug', :fixed, :number, :severity, :description) COLUMN_FIXED, COLUMN_NUMBER, COLUMN_SEVERITY, COLUMN_DESCRIPTION, NUM_COLUMNS = *(0..5).to_a DATA = [ [ false, 60482, 'Normal', 'scrollable notebooks and hidden tabs' ], [ false, 60620, 'Critical', 'gdk_window_clear_area (gdkwindow-win32.c) is not thread-safe' ], [ false, 50214, 'Major', 'Xft support does not clean up correctly' ], [ true, 52877, 'Major', 'GtkFileSelection needs a refresh method. ' ], [ false, 56070, 'Normal', "Can't click button after setting in sensitive" ], [ true, 56355, 'Normal', 'GtkLabel - Not all changes propagate correctly' ], [ false, 50055, 'Normal', 'Rework width/height computations for TreeView' ], [ false, 58278, 'Normal', "gtk_dialog_set_response_sensitive doesn't work" ], [ false, 55767, 'Normal', 'Getters for all setters' ], [ false, 56925, 'Normal', 'Gtkcalender size' ], [ false, 56221, 'Normal', 'Selectable label needs right-click copy menu' ], [ true, 50939, 'Normal', 'Add shift clicking to GtkTextView' ], [ false, 6112, 'Enhancement','netscape-like collapsable toolbars' ], [ false, 1, 'Normal', 'First bug :=)' ], ].collect do |ary| Bug.new(*ary) end def initialize super('GtkListStore demo') self.border_width = 8 vbox = Gtk::VBox.new(false, 8) add(vbox) label = Gtk::Label.new('This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).') vbox.pack_start(label, false, false, 0) sw = Gtk::ScrolledWindow.new(nil, nil) sw.shadow_type = Gtk::SHADOW_ETCHED_IN sw.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC) vbox.pack_start(sw, true, true, 0) # create tree model model = create_model # create tree view treeview = Gtk::TreeView.new(model) treeview.rules_hint = true treeview.search_column = COLUMN_DESCRIPTION sw.add(treeview) # add columns to the tree view add_columns(treeview) set_default_size(280, 250) end def create_model # create list store store = Gtk::ListStore.new(TrueClass, Integer, String, String) # add data to the list store DATA.each do |bug| iter = store.append bug.each_with_index do |value, index| iter[index] = value end end return store end def add_columns(treeview) # column for fixed toggles renderer = Gtk::CellRendererToggle.new renderer.signal_connect('toggled') do |cell, path| fixed_toggled(treeview.model, path) end column = Gtk::TreeViewColumn.new('Fixed?', renderer, 'active' => COLUMN_FIXED) # set this column to a fixed sizing (of 50 pixels) column.sizing = Gtk::TreeViewColumn::FIXED column.fixed_width = 50 treeview.append_column(column) # column for bug numbers renderer = Gtk::CellRendererText.new column = Gtk::TreeViewColumn.new('Bug number', renderer, 'text' => COLUMN_NUMBER) column.set_sort_column_id(COLUMN_NUMBER) treeview.append_column(column) # column for severities renderer = Gtk::CellRendererText.new column = Gtk::TreeViewColumn.new('Severity', renderer, 'text' => COLUMN_SEVERITY) column.set_sort_column_id(COLUMN_SEVERITY) treeview.append_column(column) # column for description renderer = Gtk::CellRendererText.new column = Gtk::TreeViewColumn.new('Description', renderer, 'text' => COLUMN_DESCRIPTION) column.set_sort_column_id(COLUMN_DESCRIPTION) treeview.append_column(column) end def fixed_toggled(model, path_str) path = Gtk::TreePath.new(path_str) # get toggled iter iter = model.get_iter(path) fixed =iter[COLUMN_FIXED] # do something with the value fixed ^= 1 # set new value iter[COLUMN_FIXED] = fixed end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-clip-rectangle.rb����������������������������������0000644�0001750�0001750�00000001423�11701304107�022746� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-clip-rectangle.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Clip Rectangle This demo shows how to use GDK and cairo to clip as rectangle. From http://cairographics.org/samples/xxx_clip_rectangle.html. =end require 'common' module Demo class CairoClipRectangle < CairoWindow def initialize super('cairo clip rectangle') end def draw(cr) cr.new_path cr.move_to(0.25, 0.25) cr.line_to(0.25, 0.75) cr.line_to(0.75, 0.75) cr.line_to(0.75, 0.25) cr.line_to(0.25, 0.25) cr.close_path cr.clip cr.move_to(0, 0) cr.line_to(1, 1) cr.stroke end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-self-intersect.rb����������������������������������0000644�0001750�0001750�00000001377�11701304107�023014� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-self-intersect.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Self Intersect This demo shows how to use GDK and cairo to show cross. From http://cairographics.org/samples/xxx_self_intersect.html. =end require 'common' module Demo class CairoSelfIntersect < CairoWindow def initialize super('cairo self intersect') end def draw(cr) cr.move_to(0.3, 0.3) cr.line_to(0.7, 0.3) cr.line_to(0.5, 0.3) cr.line_to(0.5, 0.7) cr.set_line_width(0.22) cr.set_line_cap(Cairo::LINE_CAP_ROUND) cr.set_line_join(Cairo::LINE_JOIN_ROUND) cr.stroke end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/printing.rb����������������������������������������������0000644�0001750�0001750�00000007226�11701304107�020623� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2008 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. =begin = Printing Gtk::PrintOperation offers a simple API to support printing in a cross-platform way. =end require 'common' module Demo class Printing < BasicWindow Data = Struct.new(:font_size, :lines_per_page, :lines, :n_pages) HEADER_HEIGHT = 10 * 72 / 25.4 HEADER_GAP = 3 * 72 / 25.4 def initialize super('Printing') button = Gtk::Button.new("Print...") button.signal_connect("clicked") do begin run_print_operation rescue dialog = Gtk::MessageDialog.new(self, :destroy_with_parent, :error, :close, $!.message) dialog.signal_connect("response") do dialog.destroy true end dialog.show end true end add(button) end private def run_print_operation operation = Gtk::PrintOperation.new data = Data.new data.font_size = 12.0 operation.signal_connect("begin-print") do |_operation, context| on_begin_print(_operation, context, data) end operation.signal_connect("draw-page") do |_operation, context, page_number| on_draw_page(_operation, context, page_number, data) end operation.signal_connect("end-print") do |_operation, context| on_end_print(_operation, context, data) end operation.use_full_page = false operation.unit = :points operation.run(:print_dialog, self) end def on_begin_print(operation, context, data) height = context.height - HEADER_HEIGHT - HEADER_GAP data.lines_per_page = (height / data.font_size).floor data.lines = File.readlines(__FILE__) data.n_pages = (data.lines.size - 1) / data.lines_per_page + 1 operation.set_n_pages(data.n_pages) end def on_draw_page(operation, context, page_number, data) cr = context.cairo_context draw_header(cr, operation, context, page_number, data) draw_body(cr, operation, context, page_number, data) end def draw_header(cr, operation, context, page_number, data) width = context.width cr.rectangle(0, 0, width, HEADER_HEIGHT) cr.set_source_rgb(0.8, 0.8, 0.8) cr.fill_preserve cr.set_source_rgb(0, 0, 0) cr.line_width = 1 cr.stroke layout = context.create_pango_layout layout.font_description = "sans 14" layout.text = File.basename(__FILE__) text_width, text_height = layout.pixel_size if (text_width > width) layout.width = width layout.ellipsize = :start text_width, text_height = layout.pixel_size end y = (HEADER_HEIGHT - text_height) / 2 cr.move_to((width - text_width) / 2, y) cr.show_pango_layout(layout) layout.text = "#{page_number + 1}/#{data.n_pages}" layout.width = -1 text_width, text_height = layout.pixel_size cr.move_to(width - text_width - 4, y) cr.show_pango_layout(layout) end def draw_body(cr, operation, context, page_number, data) layout = context.create_pango_layout description = Pango::FontDescription.new("monosapce") description.size = data.font_size * Pango::SCALE layout.font_description = description cr.move_to(0, HEADER_HEIGHT + HEADER_GAP) start_line = page_number * data.lines_per_page data.lines[start_line, data.lines_per_page].each do |line| layout.text = line cr.show_pango_layout(layout) cr.rel_move_to(0, data.font_size) end end def on_end_print(operation, context, data) end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/gnome-fs-directory.png�����������������������������������0000644�0001750�0001750�00000003774�11701304107�022673� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���bKGD�’�–�{lÌ£ù��±IDATxÚí™Û«WÇ?{fNNB½¤!4Q¢-”„Þ^´ "øà¡"D)ø¢þö¡ø¤OÖ&PúÔŠÅJ¡mb4ZŒ&9Òã5i´69÷“ßï7{-öeÖžßœÓ)‰ gÃoΞ={Öw]¾kí5°sì;ÇÿÝñU@?Âùƒ;)¬Ó·Ï¿Á?¯,âpa‚Mâ™'P 7676Y_¿É7¿ñ=vÍïúÚx4~öàì¹×¸ç®ûØÜ\Ç9Qœs¨š_ÂoÊù?üŽ‹/ñôS?¹|ð௼wõß‹·@34xèà¼úË“8QPUTW¹h %ÊŽ"¨‚ŸìåÈ'qàÀ½=úà — <,Þq üþü¯yëÌËÑE‰WUкFP`¯ƒ;Ýð“,¯¼Ï©“/rú­·o‡Ì_~º-€7ß|³ç^ET/YHcAQœ‚ AxM±�7oN8~ì” wݽ/ÇPöµxƒè–ídÇÃ:«kŒFÖ×6Y^]e2sùÏïqê¹ ¹]hye•µµuD4ž‚ªRUUp‰1€�.X Æ pæWoP×óÔuEU9*WÇ•%þVÔMƒŠÄõ<u3GåÂú®ª¨\ª§®Zß²g÷^ªj<[ ¬¬¬°¾¾IÛú¨}A%,^ 8W¸Ð–8uò•;Îùƒ�n\_b}m/ŠŠ"* „ Ž®B–––ùãùwyög?âðÇŽ„ @S°ƒà\ÉÁážXïcšc-8l8^ý4'N<3€åëŒF¼Ík”Ô9—¯‹ù¬ð¥/Ï~æ=öE¼w”uã²…n}¾º~ã?¬¬,!"³X]¹÷>øð‘.ZÀvÂ9®^ùµ›ç[O|›ãÇæ7ç~ލGQT m[TC´ˆHW"»I�¡*xÜ5‡‚ ­÷á9`aaq6ºti—_úÅL>¸ÿ¾»yþ…ç8~ìa®\{¯-•'” €ˆZï ¯+‹D *øÖã€ÖûìŠA¡~6�W¯^ãÄS?äч¢ªwoajB§?u”kïÿ…üý¯ˆ¶A0 ~,’SÔ‡5Äk<‚÷¤ªÇ·ÁE[ Â{Ñ`•3øîwžäó?ÂÇ?H3·g[_UUšfžÓg^êrBNv!Ú¦ª"ƒjÈê‚£ª¢ZÑÔBðÎqçQGåïg´Àç?Îþ{ösaál,B «všU•2+«FwQ3ÇžäµDìšq,Íc¹TD&L±`jÀý‡ŽpùoêEŒÐµ¥ˆM+bA /Vxs†5d  D:N‰Tg;Ýè„E]Ôô”öóô´)…ö;1Š GÉŠè4O#]ý0�Ù\=AûZÍ+ƘžW‚éÆ$þŸéT;m÷ tí} eïg bU €m„J¾Ÿ(Q¥7·+Åûcb,)g³àÉJ]t÷fR¹DáÊÀí’OxIa¥ ¥%m�‹‰2ÈA�1Wxigt!ï»2kf«ýi: .çÈ4€$Ôô<‰ä ]9ûŽ0™LhÛ6×ûA;@P‰\.ðÙ•Œ¥ç6ÜL¤#Ó0qŽö\Gs|ÌfS¿ Xëˤ2;óÿV )(VÄ‚-]Ð Ÿ-¡’×0ÀAœ\ˆ!áCfD¥p MûgCƒØàV“+ »}fÊÉK2XÌ{(Šùi�UªUD’﹬™,˜LÓªõ+¼}¶°f!Xçvbã �¨¶$O XšÞ@ Nðê vèï%%•‚V“À˜<!&¡ Rt7ÊÒDóV6Tªƒî³+nœP5@Sסbì-^*†‘JúLh…/¨Ñì¶Ò}"ˆ­:M\‘çý‡y`d]¨Š×»‰¥€—¶ôñ$@Aw± žrzÉËÄGüs‘uÀÔ:9ÞRÒ².&ýØuÀ¨1sÑ4ˆoCú6'zd('`’\(†„—¢%S0S‰¯#‰ C?FºýÀ^`h­æ=EË@I@)¼¥ÄäbEƵÚÍú@å*‘±ûÄí§†HhiŠu¡¶ ‰7P—ZýÂMz™V )ÊfÝ�½âÐÖR) ¹XÜ9µ˜‹òÖ @A8â^´£? ¾–"ÛNg` 6êÑ-C,VfoËXÄFBjï™<Ð$âiÌ~ÑÙŽÆPÝ^fʇl+¼LÌÂÅí¥Ä–ü°ð·”ë8\裕[š©D6ÉÍ˜Ø€Ê c>_t[Ë®;•æaJl-æj`A“Ô{~G|uU¹¬ùÊ9œ«pUÑôL¢IÖ�.^x— Þ ÆÁ¥Vhîà5Ñ_|½HÖ÷eùœ·‚Úm–ˆÙ=5‹»®¯š„¥EgÏ9Ǚӿµ�F@n–îö÷O~ÄOL·ûü>p8�ìs½ ˜ëMÌ M|¸1ÅT•Ò¹­MŒëBµÝÿç«YC"ÞÜO=Æ6j¼ÚŸ�›¶’žoMz œy¡ë} Qsí¾;¸[øèÒo¨&™$J Ä ´X*£U7 tÿEƒIz€ì|í=ÛÿuF©MÖ–¢cÉÁ—W½—ºörÿ›‹Þ¢¶ÙÀô>k«öõαsÜúñ_÷MËÚÛG×C����IEND®B`‚����ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-curve-rectangle.rb���������������������������������0000644�0001750�0001750�00000004646�11701304107�023155� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-curve-rectangle.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Curve Rectangle This demo shows how to use GDK and cairo to draw curve rectangle. From http://cairographics.org/samples/curve_rectangle.html. =end require 'common' module Demo class CairoCurveRectangle < CairoWindow # a custom shape, that could be wrapped in a function X0 = 0.1 #< parameters like Cairo::Context#rectangle Y0 = 0.1 RECT_WIDTH = 0.8 RECT_HEIGHT = 0.8 RADIUS = 0.4 #< and an approximate curvature radius X1 = X0 + RECT_WIDTH Y1 = Y0 + RECT_HEIGHT def initialize super('cairo curve rectangle') end def draw(cr) return if (RECT_WIDTH <= 0 || RECT_HEIGHT <= 0) if (RECT_WIDTH / 2 < RADIUS) if (RECT_HEIGHT / 2 < RADIUS) cr.move_to(X0, (Y0 + Y1) / 2) cr.curve_to(X0 ,Y0, X0, Y0, (X0 + X1) / 2, Y0) cr.curve_to(X1, Y0, X1, Y0, X1, (Y0 + Y1) / 2) cr.curve_to(X1, Y1, X1, Y1, (X1 + X0) / 2, Y1) cr.curve_to(X0, Y1, X0, Y1, X0, (Y0 + Y1) / 2) else cr.move_to(X0, Y0 + RADIUS) cr.curve_to(X0 ,Y0, X0, Y0, (X0 + X1) / 2, Y0) cr.curve_to(X1, Y0, X1, Y0, X1, Y0 + RADIUS) cr.line_to(X1 , Y1 - RADIUS) cr.curve_to(X1, Y1, X1, Y1, (X1 + X0) / 2, Y1) cr.curve_to(X0, Y1, X0, Y1, X0, Y1- RADIUS) end else if (RECT_HEIGHT / 2 < RADIUS) cr.move_to(X0, (Y0 + Y1) / 2) cr.curve_to(X0, Y0, X0 , Y0, X0 + RADIUS, Y0) cr.line_to(X1 - RADIUS, Y0) cr.curve_to(X1, Y0, X1, Y0, X1, (Y0 + Y1) / 2) cr.curve_to(X1, Y1, X1, Y1, X1 - RADIUS, Y1) cr.line_to(X0 + RADIUS, Y1) cr.curve_to(X0, Y1, X0, Y1, X0, (Y0 + Y1) / 2) else cr.move_to(X0, Y0 + RADIUS) cr.curve_to(X0 , Y0, X0 , Y0, X0 + RADIUS, Y0) cr.line_to(X1 - RADIUS, Y0) cr.curve_to(X1, Y0, X1, Y0, X1, Y0 + RADIUS) cr.line_to(X1 , Y1 - RADIUS) cr.curve_to(X1, Y1, X1, Y1, X1 - RADIUS, Y1) cr.line_to(X0 + RADIUS, Y1) cr.curve_to(X0, Y1, X0, Y1, X0, Y1- RADIUS) end end cr.close_path cr.set_source_rgba(0.5,0.5,1) cr.fill_preserve cr.set_source_rgba(0.5, 0, 0, 0.5) cr.stroke end end end ������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-line-join.rb���������������������������������������0000644�0001750�0001750�00000001760�11701304107�021745� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-line-join.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Line Join This demo shows how to use GDK and cairo to set line join. From http://cairographics.org/samples/set_line_join.html. =end require 'common' module Demo class CairoLineJoin < CairoWindow def initialize super('cairo line join') end def draw(cr) cr.set_line_width(0.16) cr.move_to(0.3, 0.33) cr.rel_line_to(0.2, -0.2) cr.rel_line_to(0.2, 0.2) cr.set_line_join(Cairo::LINE_JOIN_MITER) # default cr.stroke cr.move_to(0.3, 0.63) cr.rel_line_to(0.2, -0.2) cr.rel_line_to(0.2, 0.2) cr.set_line_join(Cairo::LINE_JOIN_BEVEL) cr.stroke cr.move_to(0.3, 0.93) cr.rel_line_to(0.2, -0.2) cr.rel_line_to(0.2, 0.2) cr.set_line_join(Cairo::LINE_JOIN_ROUND) cr.stroke end end end ����������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/gnome-gimp.png�������������������������������������������0000644�0001750�0001750�00000006522�11701304107�021207� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA�† 1è–_�� IDATxÚíYkŒ]ÕuþÖ>¯{ï9wÞ¶gllÏcÌ#¿ <l 6ˆ!•êªUÔ$}¨jû#Q鿤êCUߢÒü H©i$£´Â-¢¤@m9IJ±“ù9žaf<ß¹¯sÏ=g?Vœ}‡‹±ëqK$"±5[çÜ;÷îû}k}kíµ×>ŸÏǯô _Q¬Ü¹ŸuÔ7­êu„p,+çÒ ô÷ˆk,ðËô !Ä]›×?¶ûáíw ˆ ˆ@ôÑïÒu Ü´ryñ™¿ýÓý=>ÙÙ‘/$~IDhxùÀÐm›Æ~¿G‰È±Óþü=fR.êÛùwóÍ'{Ë¡C"_"ÿ#aŸ¢×Ûýð¶¯cv*­KDäv€ €Ü‚ÎõVK’6»žWztçÖïlÚ0úá[Þ;à Á.ô 9ñÿ<ckGn¿çÎß°l¾R;yêì介~¿ &€ð/ûÞxóÔ™ ±µÃÿøí§~w¯ç:¾Â$\"ò:ÖAnçÿ(©EðëFWŽ~ùñž#AcR)Ä­ä4�Ÿˆ\�‚¥OKs{&¥–Rÿ@*=tÓªåÏüÁWŸ|B$ÈBøDäàp-‹xgp 7züK÷~Ûô”RH©¦™ �àÑ¢rW\OBy¤ÑñŸŸžÛóÈöÇ“4+þîå+ÝŸŸ<w’ �—?²üd¨ŽÞ�îÍ£«6ýæ—wýƒãˆ½RiGJ ¥4Ž?ýýz3¾ Ð�k�æúì%IÒtŲ5Ã+·e™*ž{ϲÁ¾á_œš8ÂlIpž¤®Øx®•~E7øÑ5#;žØ}ïw!¾$•r”ÊÁK¥*òþ÷d� �Åö 0;K±3ó@_íŽ[×=©µ•f?,wÝuûúí4«]¼T©ä.&·+D×Ut½ïÚ鮹ó7žÜù-_ØôÖI¥ ¥†TRiÄÍäðÉÓ怡™Y‚¡˜¡,‰€°ùž&§/V¶Ü}ëa©°Yk­ ˜ydÕÈÐŽBD—æ«)@äPPtÅÅ"h"”VŽ Ýòèέß|`Çß*ƒÇ´ÖTZ›Žå!•n=~êß+ õÓ�i€%ƒeNf):6"òû{oyú/ÿä‡Y&×µZ âVŠLJÃ�Lš´³ã2S§þóíÔҳ†¹ÅÌŠˆ\ßw‡úµ»×ûžwWà»_d0Ø0´É¡5C)¥4”ÖX¨Ö'~üΑï)¥/�| *ƒ+Ìhœ0C¹7’熆†ÜÀwF⸭]Ï0 8®ƒ4“PR¥Bq‹[[¾²w7˜8“J¥i•)×°)1Øa6HÚ)Œa03Œac`Œ6Fhcô§'H¥’¼ÈLlw÷/�Ú7·mÛÞÿWñ­v>üè®ë‰÷~úßxëWQ,øÐZ`ïo·l¼ÅR„Zõ2Þø‰Çß-»Žv´ hÉÐJC ­µžƒg@ 0`Àæì¹éÎOÌ\�!°8 �3˜™Áv3ûX ëºëÃ0üzE_s]÷^fv™yÚó\ñoÿú£·„<øöÛïЦM›°zÍü „óçÎà¾ñç^¹Ú0´ÖðƒÖo¸–-[‰Ç~ c8—…ÔȤD–IdR!ËÒ,­”êáj­9ûÞÑic´�Ä�êœ_[6#)�fÑžçݼaÆïmÞ¼ù!!Dqbb‚§¦¦¾Çñ?=þȶKõF|çþýûñâ‹/b``�{öìÁ·Þ5kÇJýûöáðáÃÇ–-[ µÆªÕëP*¡V™µR1ÐZ[ðJçz3ˆWp’d•ŸþÙû™T©M€d† ˜óldS*wx===¿¾mÛ¶GÆÇǽf³Io¾ù&Åq<†¥?öƒÀ­Õªxå•Wh~~ív›™iš ·^{m?â8¦àرcüꫯBJ‰V«Ï©¶“¡•‚R R*(£Á h®Ö’ƱŸ='¥’�20�I.gN;–ïH¨C ìyÞýQy…Bív»ãr'šœ©Ñ'ó³Ïþ=·Z víÚ…F£3'`õØF´Ûm<óÌ3˜™™Áž={ešÍ&’$A;IÐI¹J(­ò{»Ëf0$©’GŸ¹¤”V (�mb� 0V:Ÿð@”rhrr‡B£ÑÀìì,„þ_ÄÑ£GP,Å¡ÿ…‰s¿@«>‡áÕq߃aëÖ­\«ÕðÔSO¡Ñh Ýn£R¹Œf}ÚæuÕ™ÚÀ0Àl�Î#óôÙ©T*­�µ-ðu�M0·8O*Ü…””²=== fF–ehµZ(•Jˆ¢ˆ¢(9çÏÂÌô9¸Žá€€‰3'0¶nž~úi(¥��RJT« 8{ê}°Î ”^ô‚Ö Ã &òØàV’fX &  fg“se×’Ð3Ÿ­×ë|߇ïûâ(B…p ÑhÆPÚ‡çûðáoìÿÊ}+àex~€´ÝÂÔ…SH“Jk´Zm´³ ÆÆÛÔI¶Úš¯ÔUšÉ@BÓfœ�U€̈¯_éLk½ßqœßaæ¢çyÃða!mU'mhÙ€=Ž`6`f,Ì¥? V¥lÆÉ$æj ApY)å›rðÔ‡s1€„rÍ×í¬è€oÛ}©c}ÓÉž‹i4˲wÇùaE{{zz¢0 Q.GÃ¥bóÏCÉZIÈT¡PÈày>èÚ=µ­erðJkLL]„TŒþ¾¤I¼¸‰q¾3ñôÌ|–´³€fnqTòÉuþxðÊ+ÁŒ€ÖºZ©Tž £(ð…Ja I\C³¾�Y”V AAƒ™lI§Hcëš¶Ìp¹Ò�‘‡ÁÁ2z˦š Íy5@Œ4“<5}©nÁב˦p•õ®Mëªà?q ‰ãx®^¯Š¢R{dyÿÝZ§…¹™IÌΜG&SH©rk@+©²üÄ„ÔnNõF ³s—qnb–î¹}3ÆV£¸íÕZZk”RæÄÉóÕv;[�P!`„i�Ó�f�Ì[µºÎü¿`fŠã¸9;;{xýèÐHàêÛÛIS¤iFJ*è¼â Ci©²T¡ÕJ0;WÁôÌ<.^Z@’dèé-“ç»(øBˆå½ú£�¡/ÐSt‰zÍÈ@ ´n/ë5̘jgò<€9ëŽþ•ÿ‰Ó]ë` ÀÛ¼qôÑLéß |ï¾,ËHÏ6Œ¸Õ†ì”B T,¢T* ·7BO¡¿¿Ê=ŠÅ"šÍSg±r0äÑ}ÜßS®K0H3‰…z‚jSÖÏUÝÚÁƒÿ¬^¯Ÿô<o¡¯¯O^ºtiÁfž« ¾""—€€ ð¶;Bléé)íJSµ^k±1丅¥"Jaårˆr¢¿¯Q¡P `ŒÆùó<yAW*õÖÜüB’¦²±jyï¹osé‘·®ê)ºB Ös×EvË+Ž?Ž3gΨ4MŸ;qâÄwúúú’8ŽÝ#GŽ$K!€.Ž==Šècð�3‰0V ‚»×ó<g™ø½®ã8®ã8®ë’ÄI’fµz£ÕŒ[‰Ö¦#ƒÔJ¢³IU¿°quñ«ãÛ×n¿÷M·=¸÷ÖF£ÉÉI=z“““ÙÙ³gÿ¹Z­¾922òã—^zéÃ%@Þ‹t (‚ÑË@?Àý`ô0ÈÀ�€@ yû£ÓVéž²™$±ù¾ÎŒšÕxࢠܹ^xáñññA)åÖ—_~ù–çŸþŽááa O¾öÚkk—Bàc}"x�ù�Š�‡�"0Ê�zôèãü¾ �ÀïJÏŒÅ2¢ÅʲaÓd³«|hØTÚ²^j¸³T*½e `xxøÞ}ûö½ÛݼޑÒäõ÷böZc¤³sFÖòä .ç*$3Ú]ß‹-èÌz¬Ôñ¨ýLÀ…V«5^©Tþ:‚­¾ï? à¾îtJKè–ÑíÏ‚í�.v÷»ºÝtñN¤Ö©ýÜ�€å–ˆ×å…€ÖÀÀÀúÕ«Wÿáðð°yýõ׫C‚–ØòûD#ª‹Œ×eu÷*½QîªßeW<È®×ÊaÀÎA»–±›v_¸l É¥Jˆ»6nkj»HÖEŠðñö"®ðB7Ýuß™®j“lc¡Ðé%uM\µº"Ôu¯–Øå®âkL²©ZÊÊÉíªøšÅÜ ÁUúŸ×“d÷wùÿ×V2uû:µ±Öi÷6n:¥|:ƒ—8—ºV·D;'1}EB0ŸÕǬtEÛ®(>uWuú™~NLWņ̃ñëóñ©Žÿ÷0iÿORÑ����IEND®B`‚������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/dialog.rb������������������������������������������������0000644�0001750�0001750�00000007353�11701304107�020231� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: dialog.rb,v 1.5 2005/02/12 23:02:43 kzys Exp $ =begin = Dialog and Message Boxes Dialog widgets are used to pop up a transient window for user feedback. =end require 'common' module Demo class Dialog < Demo::BasicWindow def initialize @count = 1 super('Dialogs') set_border_width(8) frame = Gtk::Frame.new('Dialogs') add(frame) vbox = Gtk::VBox.new(false, 8) vbox.set_border_width(8) frame.add(vbox) # Standard message dialog hbox = Gtk::HBox.new(false, 0) vbox.pack_start(hbox, false, false, 0) button = Gtk::Button.new('_Message Dialog', true) button.signal_connect('clicked') do message_dialog_clicked end hbox.pack_start(button, false, false, 0) vbox.pack_start(Gtk::HSeparator.new, false, false, 0) # Interactive dialog hbox = Gtk::HBox.new(false, 8) vbox.pack_start(hbox, false, false, 0) vbox2 = Gtk::VBox.new(false, 0) button = Gtk::Button.new('_Interactive Dialog') button.signal_connect('clicked') do interactive_dialog_clicked end hbox.pack_start(vbox2, false, false, 0) vbox2.pack_start(button, false, false, 0) table = Gtk::Table.new(2, 2, false) table.set_row_spacings(4) table.set_column_spacings(4) hbox.pack_start(table, false, false, 0) label = Gtk::Label.new('_Entry 1', true) table.attach_defaults(label, 0, 1, 0, 1) @entry1 = Gtk::Entry.new table.attach_defaults(@entry1, 1, 2, 0, 1) label.set_mnemonic_widget(@entry1) label = Gtk::Label.new('E_ntry 2', true) table.attach_defaults(label, 0, 1, 1, 2) @entry2 = Gtk::Entry.new table.attach_defaults(@entry2, 1, 2, 1, 2) label.set_mnemonic_widget(@entry2) end def message_dialog_clicked dialog = Gtk::MessageDialog.new(self, Gtk::Dialog::MODAL | Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::INFO, Gtk::MessageDialog::BUTTONS_OK, <<EOS) This message box has been popped up the following number of times: #{@count} EOS dialog.run dialog.destroy @count += 1 end def interactive_dialog_clicked dialog = Gtk::Dialog.new('Interactive Dialog', self, Gtk::Dialog::MODAL | Gtk::Dialog::DESTROY_WITH_PARENT, [Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK], ["_Non-stock Button", Gtk::Dialog::RESPONSE_CANCEL] ) hbox = Gtk::HBox.new(false, 0) hbox.set_border_width(8) dialog.vbox.pack_start(hbox, false, false, 0) stock = Gtk::Image.new(Gtk::Stock::DIALOG_QUESTION, Gtk::IconSize::DIALOG) hbox.pack_start(stock, false, false, 0) table = Gtk::Table.new(2, 2, false) table.set_row_spacings(4) table.set_column_spacings(4) hbox.pack_start(table, true, true, 0) label = Gtk::Label.new('_Entry 1', true) table.attach_defaults(label, 0, 1, 0, 1) local_entry1 = Gtk::Entry.new local_entry1.text = @entry1.text table.attach_defaults(local_entry1, 1, 2, 0, 1) label.set_mnemonic_widget(local_entry1) label = Gtk::Label.new('E_ntry 2', true) table.attach_defaults(label, 0, 1, 1, 2) local_entry2 = Gtk::Entry.new local_entry2.text = @entry2.text table.attach_defaults(local_entry2, 1, 2, 1, 2) label.set_mnemonic_widget(local_entry2) hbox.show_all response = dialog.run if response == Gtk::Dialog::RESPONSE_OK @entry1.text = local_entry1.text @entry2.text = local_entry2.text end dialog.destroy end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/appwindow.rb���������������������������������������������0000644�0001750�0001750�00000016465�11701304107�021006� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: appwindow.rb,v 1.7 2005/03/05 15:01:16 mutoh Exp $ =begin = Application main window Demonstrates a typical application window, with menubar, toolbar, statusbar. =end require 'common' module Demo class AppWindow < BasicWindow def initialize register_stock_icons ## Create toplevel window super('Application Window') table = Gtk::Table.new(1, 4, false) add(table) ## Create the menubar accel_group = Gtk::AccelGroup.new add_accel_group(accel_group) item_factory = Gtk::ItemFactory.new(Gtk::ItemFactory::TYPE_MENU_BAR, '<main>', accel_group) # create menu items menuitem_cb = proc do |data, widget| # TODO: Show item-factory's path to menu item dialog = Gtk::MessageDialog.new(self, Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::INFO, Gtk::MessageDialog::BUTTONS_CLOSE, "You selected or toggled the menu item \"#{Gtk::ItemFactory.path_from_widget(widget)}\"") # Close dialog on user response dialog.signal_connect('response') do |widget, data| widget.destroy end dialog.show end menu_items = [ ["/_File"], ["/_File/_New", "<StockItem>", "<control>N", Gtk::Stock::NEW, menuitem_cb], ["/_File/_Open", "<StockItem>", "<control>O", Gtk::Stock::OPEN, menuitem_cb], ["/File/_Save", "<StockItem>", "<control>S", Gtk::Stock::SAVE, menuitem_cb], ["/File/Save _As...", "<StockItem>", nil, Gtk::Stock::SAVE, menuitem_cb], ["/File/sep1", "<Separator>", nil, nil, menuitem_cb], ["/File/Quit", "<StockItem>", "<control>Q", Gtk::Stock::QUIT, menuitem_cb], ["/_Preferences"], ["/_Preferences/_Color"], ["/_Preferences/Color/_Red", "<RadioItem>", nil, nil, menuitem_cb], ["/_Preferences/Color/_Green", "/Preferences/Color/Red", nil, nil, menuitem_cb], ["/_Preferences/Color/_Blue", "/Preferences/Color/Red", nil, nil, menuitem_cb], ["/Preferences/_Shape"], ["/Preferences/Shape/_Square", "<RadioItem>", nil, nil, menuitem_cb], ["/Preferences/Shape/_Rectangle", "/Preferences/Shape/Square", nil, nil, menuitem_cb], ["/Preferences/Shape/_Oval", "/Preferences/Shape/Square", nil, nil, menuitem_cb], # If you wanted this to be right justified you would use # "<LastBranch>", not "<Branch>". Right justified help menu # items are generally considered a bad idea now days. ["/_Help"], ["/Help/_About", "<Item>", nil, nil, Proc.new{about_cb}], ] item_factory.create_items(menu_items) table.attach(item_factory.get_widget('<main>'), # X direction # Y direction 0, 1, 0, 1, Gtk::EXPAND | Gtk::FILL, 0, 0, 0) ## Create the toolbar toolbar = Gtk::Toolbar.new # toolbar.set_toolbar_style(Gtk::Toolbar::BOTH) toolbar.append(Gtk::Stock::OPEN, "This is a demo button with an 'open' icon" ) do toolbar_cb end toolbar.append(Gtk::Stock::QUIT, "This is a demo button with an 'quit' icon" ) do toolbar_cb end toolbar.append_space toolbar.append(:demo_gtk_logo, "This is a demo button with an 'gtk' icon" ) do toolbar_cb end table.attach(toolbar, # X direction # Y direction 0, 1, 1, 2, Gtk::EXPAND | Gtk::FILL, 0, 0, 0) ## Create document sw = Gtk::ScrolledWindow.new sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) sw.shadow_type = Gtk::SHADOW_IN table.attach(sw, # X direction # Y direction 0, 1, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) set_default_size(200, 200) contents = Gtk::TextView.new sw.add(contents) ## Create statusbar statusbar = Gtk::Statusbar.new table.attach(statusbar, # X direction # Y direction 0, 1, 3, 4, Gtk::EXPAND | Gtk::FILL, 0, 0, 0) # Show text widget info in the statusbar buffer = contents.buffer buffer.signal_connect('changed') do |buffer| update_statusbar(buffer, statusbar) end # cursor moved buffer.signal_connect('mark_set') do |buffer, iter, mark| update_statusbar(buffer, statusbar) end end def toolbar_cb(*args) dialog = Gtk::MessageDialog.new(self, Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::INFO, Gtk::MessageDialog::BUTTONS_CLOSE, "You selected a toolbar button") # Close dialog on user response dialog.signal_connect('response') do |widget, data| widget.destroy end dialog.show end def about_cb(*args) unless Gtk.check_version?(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" return end authors = ["Peter Mattis", "Spencer Kimball", "Josh MacDonald", "and many more..."] documentors = ["Owen Taylor", "Tony Gale", "Mattias Clasen <mclasen@redhat.com>", "and many more..."] license = %Q[ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the Gnome Library; see the file COPYING.LIB.If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ] transparent = Gdk::Pixbuf.new(Demo.find_file("gtk-logo-rgb.gif")).add_alpha(true, 0xff, 0xff, 0xff) Gtk::AboutDialog.set_email_hook {|about, link| puts "send mail to #{link}" } Gtk::AboutDialog.set_url_hook {|about, link| puts "show url #{link}" } Gtk::AboutDialog.show(self, :name => "GTK+ Code Demos", :version => Gtk::VERSION.join("."), :copyright => "(C) 1997-2004 The GTK+ Team", :license => license, :website => "http://www.gtk.org", :comments => "Program to demonstrate GTK+ functions.", :authors => authors, :documenters => documentors, :logo => transparent) end def update_statusbar(buffer, statusbar) statusbar.pop(0) iter = buffer.get_iter_at_mark(buffer.get_mark('insert')) statusbar.push(0, "Cursor at row #{iter.line} column #{iter.line_offset} - #{buffer.char_count} chars in document") end def register_stock_icons # Register our stock items Gtk::Stock.add(:demo_gtk_logo, '_GTK!') # Add out custom icon factory to the list of defaults factory = Gtk::IconFactory.new factory.add_default filename = Demo.find_file('gtk-logo-rgb.gif') pixbuf = Gdk::Pixbuf.new(filename) transparent = pixbuf.add_alpha(true, 0xff, 0xff, 0xff) icon_set = Gtk::IconSet.new(transparent) factory.add('demo_gtk_logo', icon_set) end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/hypertext.rb���������������������������������������������0000644�0001750�0001750�00000015056�11701304107�021025� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: hypertext.rb,v 1.2 2005/12/01 09:27:01 ktou Exp $ =begin = Text Widget/Hypertext Usually, tags modify the appearance of text in the view, e.g. making it bold or colored or underlined. But tags are not restricted to appearance. They can also affect the behavior of mouse and key presses, as this demo shows. =end require 'common' module Demo class Hypertext < BasicWindow def initialize super('Hypertext') @hand_cursor = Gdk::Cursor.new(Gdk::Cursor::HAND2) @regular_cursor = Gdk::Cursor.new(Gdk::Cursor::XTERM) @hovering = false set_default_size(450, 450) self.border_width = 0 view = Gtk::TextView.new view.wrap_mode = Gtk::TextTag::WRAP_WORD view.signal_connect('key-press-event') do |*args| key_press_event(*args) end view.signal_connect('event-after') do |*args| event_after(*args) end view.signal_connect('motion-notify-event') do |*args| motion_notify_event(*args) end view.signal_connect('visibility-notify-event') do |*args| visibility_notify_event(*args) end buffer = view.buffer sw = Gtk::ScrolledWindow.new sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) add(sw) sw.add(view) show_page(buffer, 1) end # Inserts a piece of text into the buffer, giving it the usual # appearance of a hyperlink in a web browser: blue and underlined. # Additionally, attaches some data on the tag, to make it recognizable # as a link. def insert_link(buffer, iter, text, page) tag = buffer.create_tag(nil, { 'foreground' => 'blue', 'underline' => Pango::AttrUnderline::SINGLE, }) tag.page = page buffer.insert(iter, text, tag) print("Insert #{tag}:#{page}\n") end # Fills the buffer with text and interspersed links. In any real # hypertext app, this method would parse a file to identify the links. def show_page(buffer, page) puts buffer.text = '' iter = buffer.get_iter_at_offset(0) case page when 1 buffer.insert(iter, 'Some text ot show that simple ') insert_link(buffer, iter, 'hypertext', 3) buffer.insert(iter, ' can easily be realized with ') insert_link(buffer, iter, 'tags', 2) buffer.insert(iter, '.') when 2 buffer.insert(iter, %Q[A tag is an attribute that can be applied to some range of text. For example, a tag might be called "bold" and make the text insid the tag bold. However, the tag concept is more general than that; tags don't have to affect appearance. They can instead affect the behavior of mouse and key presses, "lock" a range of text so the user can't edit it, or countless other things.]) buffer.insert(iter, "\n") insert_link(buffer, iter, 'Go back', 1) when 3 tag = buffer.create_tag(nil, { 'weight' => Pango::FontDescription::WEIGHT_BOLD }) buffer.insert(iter, "hypertext:\n", tag); buffer.insert(iter, %Q[machine-readable text that is not sequential but is organized so that related items of information are connected.\n]) insert_link(buffer, iter, 'Go back', 1) end end # Looks at all tags covering the position of iter in the text view, # and if one of them is a link, follow it by showing the page identified # by the data attached to it. def follow_if_link(text_view, iter) tags = iter.tags tags.each do |tag| print("Follow #{tag}:#{tag.page}\n") if tag.page show_page(text_view.buffer, tag.page) break end end end # Links can be activated by pressing Enter. def key_press_event(text_view, event) case event.keyval when Gdk::Keyval::GDK_Return, Gdk::Keyval::GDK_KP_Enter buffer = text_view.buffer iter = buffer.get_iter_at_mark(buffer.get_mark("insert")) follow_if_link(text_view, iter) end false end # Links can also be activated by clicking. def event_after(text_view, event) unless event.kind_of?(Gdk::EventButton) and event.button == 1 return false end buffer = text_view.buffer # we shouldn't follow a link if the user has selected something range = buffer.selection_bounds if range and range[0].offset != range[1].offset return false end x, y = text_view.window_to_buffer_coords(Gtk::TextView::WINDOW_WIDGET, event.x, event.y) iter = text_view.get_iter_at_location(x, y) follow_if_link(text_view, iter) end # Looks at all tags covering the position (x, y) in the text view, # and if one of them is a link, change the cursor to the "hands" cursor # typically used by web browsers. def set_cursor_if_appropriate(text_view, x, y) buffer = text_view.buffer iter = text_view.get_iter_at_location(x, y) hovering = false tags = iter.tags tags.each do |t| if t.page hovering = true break end end if hovering != @hovering @hovering = hovering window = text_view.get_window(Gtk::TextView::WINDOW_TEXT) window.cursor = if @hovering @hand_cursor else @regular_cursor end end end # Update the cursor image if the pointer moved. def motion_notify_event(text_view, event) x, y = text_view.window_to_buffer_coords(Gtk::TextView::WINDOW_WIDGET, event.x, event.y) set_cursor_if_appropriate(text_view, x, y) text_view.window.pointer false end # Also update the cursor image if the window becomes visible # (e.g. when a window covering it got iconified). def visibility_notify_event (text_view, event) window, wx, wy = text_view.window.pointer bx, by = text_view.window_to_buffer_coords(Gtk::TextView::WINDOW_WIDGET, wx, wy) set_cursor_if_appropriate(text_view, bx, by) false end end end module Gtk class TextTag attr_accessor :page end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/pixbufs.rb�����������������������������������������������0000644�0001750�0001750�00000011356�11701304107�020450� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: pixbufs.rb,v 1.5 2005/02/12 23:02:43 kzys Exp $ =begin = Pixbufs A Gdk::Pixbuf represents an image, normally in RGB or RGBA format. Pixbufs are normally used to load files from disk and perform image scaling. This demo is not all that educational, but looks cool. It was written by Extreme Pixbuf Hacker Federico Mena Quintero. It also shows off how to use Gtk::DrawingArea to do a simple animation. Look at the Image demo for additional pixbuf usage examples. =end require 'common' module Demo class Pixbufs < BasicWindow FRAME_DELAY = 50 BACKGROUND_NAME = 'background.jpg' IMAGE_NAMES = [ 'apple-red.png', 'gnome-applets.png', 'gnome-calendar.png', 'gnome-foot.png', 'gnome-gmush.png', 'gnome-gimp.png', 'gnome-gsame.png', 'gnu-keys.png', 'ruby-gnome2-logo.png' ] CYCLE_LEN = 60 def initialize super('Pixbufs') set_resizable(false) @background = nil @frame = nil @frame_num = 0 @images = [] begin load_pixbufs set_size_request(@background.width, @background.height) @frame = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, false, 8, @background.width, @background.height) @da = Gtk::DrawingArea.new @da.signal_connect('expose_event') do |w, e| expose_cb(w, e) end add(@da) timeout_id = Gtk.timeout_add(FRAME_DELAY) do timeout end signal_connect('destroy') do Gtk.timeout_remove(timeout_id) end rescue dialog = Gtk::MessageDialog.new(self, Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::ERROR, Gtk::MessageDialog::BUTTONS_CLOSE, "Failed to load an image: #{$!.message}") dialog.signal_connect('response') do dialog.destroy end dialog.show end end def load_pixbufs # Loads the images for the demo if @background return # already loaded earlier end # demo_find_file() looks in the the current directory first, # so you can run gtk-demo without installing GTK, then looks # in the location where the file is installed. # filename = Demo.find_file(BACKGROUND_NAME) @background = Gdk::Pixbuf.new(filename) IMAGE_NAMES.each_with_index do |basename, i| filename = Demo.find_file(basename) @images[i] = Gdk::Pixbuf.new(filename) end end def expose_cb(widget, event) rowstride = @frame.rowstride pixels = @frame.pixels pixels[0, rowstride * event.area.y + event.area.x * 3] = '' Gdk::RGB.draw_rgb_image(widget.window, widget.style.black_gc, event.area.x, event.area.y, event.area.width, event.area.height, Gdk::RGB::Dither::NORMAL, pixels, rowstride, event.area.x, event.area.y) true end # Timeout handler to regenerate the frame def timeout @background.copy_area(0, 0, @background.width, @background.height, @frame, 0, 0) f = Float(@frame_num % CYCLE_LEN) / CYCLE_LEN; xmid = @background.width / 2.0 ymid = @background.height / 2.0 radius = [xmid, ymid].min / 2.0 @images.each_with_index do |image, i| ang = 2.0 * Math::PI * Float(i) / IMAGE_NAMES.length - f * 2.0 * Math::PI r = radius + (radius / 3.0) * Math.sin(f * 2.0 * Math::PI) xpos = (xmid + r * Math.cos(ang) - image.width / 2.0 + 0.5).floor ypos = (ymid + r * Math.sin(ang) - image.height / 2.0 + 0.5).floor k = if (i & 1) == 1 Math.sin(f * 2.0 * Math::PI) else Math.cos(f * 2.0 * Math::PI) end k = [0.25, 2.0 * k * k].max r1 = Gdk::Rectangle.new(xpos, ypos, image.width * k, image.height * k) r2 = Gdk::Rectangle.new(0, 0, @background.width, @background.height) dest = r1.intersect(r2) if dest @frame.composite!(image, dest.x, dest.y, dest.width, dest.height, xpos, ypos, k, k, Gdk::Pixbuf::INTERP_NEAREST, if (i & 1) == 1 [ 127, (255 * Math.sin(f * 2.0 * Math::PI)).abs ].max else [ 127, (255 * Math.cos(f * 2.0 * Math::PI)).abs ].max end) end end @da.queue_draw @frame_num += 1 true end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/apple-red.png��������������������������������������������0000644�0001750�0001750�00000006731�11701304107�021023� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA��± üa�� IDATxœí™[Œ]WyÇk­½Ï9sóŒí8Á NìÜ)J„Ú„¶¢áÚ¨·Bª>p‰©E¤–¢ •¶‰WÉK« ÒR@è­«@›¤@Bq—‚S+¶ã8vÛ3ã™sÎÞk}—>œ3Á1¾Ä^ª|ÒÖž9ëöÿ¯ïûÖúïµàe{Ù^¶—ítvþy³—_æá¥Tz߇ß} „„¯ŸrçãÞ½ížc§ksëïÞð§M“?pï¿<üp+ÐÿE>ÑâÙ*ܾõÖ§ºúúÜêî W]³ví†Ëfgº½ôvwßûÖÛ>yºv!„›¿·ã'+³_ýŸdéL…·o½m]aûÄD•Ö­ŸÎóG»€¹‹7®îL¯ª«ù#ͯ¾êµ¿Òìü¯>tb»÷þÞW-,.ßñØã{�>üä—Eà,ð§&§+Ö¬›hæ â /—–¤Ú³{^Ž>ß„Õçõzàñþ;Þû‰“ÞñàÃ?êÿüû/ ;p·o}ïƒU¦.¹tµ÷—KGŇ«f»Ë6¯)oš]ºäÒÙáE¯Z¼ä²91|î}~÷ö•¶ó ËW--7CàÏÏ4øÎíŸ ;·ö%åáéì”oßzÛ!òí g|a¾•é™NgnMoñàþåé˜,çVºK‹U!†ˆ@0“G¾|ç×¶¼nËæÚ±k5pÍJŸo»éºg&;Wˆ5B8tpaßoùû;[6:à�×½ùOü\ œ2¹R wÍ®ér|¡•óΟ¨=Ó÷ÉéZ–—›ÜEBˆâ®|[ŒñaÕ²ÆÝþ,Æê­¿ÿ¡w~÷±û¿xà“½ù¶ VÕmäB)†F§h¡¬šá›ÿñcŽÝ·ó±ù¦üàÏüõÎíŸ}ê\IüŒþàn}G§Sef¶c"º´vÝÔªg÷ï/-þ3Æj"„ø`áówo»gprÛÛ>øŽAØúõ»¿qoÛäwÝò;7¬ª¹¥ŠO ̄ᰠ& ¬AÄXªA۰ضì8pìSî9pßÏMàßâªÙNwnmïØáƒƒja~¨n,‡v„?s÷¶{v}ôú7¼ñò¹ÙO„ÞÛêP ÷€v4!tñõ¯˜™ÜÒéTÔUMŒO¤Éh[(ê ‹0 š:²Ð4ôuÈ¢(­”íí;ú‘'Ÿyn÷9Øú©Û?SÕéc©bùèáጙõ!|'„øé/ýÍßÿø¦Í›7½çÒ+ÿ©Wu_Õ«œN¬H)‚£•‰DÄ^'ªj´FĪBÄ,h.è°%49³ Ãä ­0o…¥fH_ ô¹CóÍû¿ùøSÿv&/Ên¯zÏÂüàhÉ–ÜùtJÕ?ܽížç�^¿qãÆÛ6]ñÝ^·»~ºÓ£î&º5³¤‰)†‹G©¨ˆÄ1¢¢!@©Š2Ä ¦ÄºÆÛ–z¢f² ¨rª©\饊6šìœ?7¹ý=¯¿òÃ_ùÞ“wžÕï¿ãÖ·§Š/”¬ùå;¿úw'WüÛ7ßüìyÓÓë'¦ºÌ^°ž¹›˜½æjò±c …ã»wÓz–€CDqbO1£H¡ä!Þ´ÈÀÐa f´î´æ›–c•±P26,dÁh¨RäЀ«¶ïصëŒ0Óh™O~ùίÞ{r¥/¾õ¦»VOM¬ŸìVlØòæ^}½Ù5ä…#„�ey_\¤3Ѹ*1‚D7‰­*J­x§*4+DÐÆ¨ªÈ$‘¦Ä"½,õXä’Ùú^àêSxAJüpÇvýpÇž8¹ÂG®Ý×®Y½mº×eÝÆM¬Þ²…zr\ÉÇŽ1œ?LÞÿ ž êN£Éˆqû© X4L IŽzÁ‹!u$Dw¬¨á!P¢!¦X(3J€””⺫~ýÊÅÇw>ýðÉøÎ*æ®;oõç;Ý f®ØLթѦO{è ±ÛAž?ŒMt˜zåèU„:áÁñz47"ƒ’qsHÁÐNDSÀªˆ‡@Ý8Éœn5A7¢‚¡5eÐÏ<¾3øÐ®¿aª—¶têHš`â ÀÜ_ v:,î~‚ J¯;I±–’‡`†U"”* †af˜#æPpÄ wÇD0¬UÕÁSÀ«š˜"Vkaêð`ó9¸zõìÇT‘º5³—^W/…8–žÝOgn‰l‚?ŽÇ�ÆÈ¦P2â ¥àÑQsÌÇå8ž‰;‘–Aܦ TÑÀ"â‚J9%Æ3êô^]ývÝ« )àÓ”¥%°@Û_¢®júBŒxɘ9w'ˆŽfÔTð(ê„0 ªˆº¡-/lp˜aðèˆAìAi¡#äaE¬N­0NKàm7]·©êE’;¡ªétzØ`@~ï$Zɘ`x°¡D‘Ê^1CQŠÌƱoNÉÝ„@Ápu,‚†@¨z¼%º¡j÷S‹ÖÓ¸6ÍÝÔÑ:ઔ¶EÍkñ¾â®àŠÕ©)¨e¢  š"ÇÜа` ®h ¨ š"ä–íT ÍžñFP¡v,GbrJ>5ÎÓèZÀS TP'4Q�uÜï÷Gñl†«b*-¨+1€8˜ʨ>L UÇ£",*¹±V1�,EŠƒ,ä ˆ*Æà‚U;Ή@é&D„ ©"ËÇÑ™š&}a5\ )²"Jò‚F0U°Œ3 s°h Б‡BÄ+¬isaØ©ãè’§+ îœù Ãþ‹ªJ)-M™:&ÚàXɸ‚ "ÁÁŒày4âãd-£ÝÖTr‘•ðD@µ�¢#§È°(Þq†ƒ@ªàþ­Sá<ãçܶw½Å§«ŠéÙULÍÌЛYE*J.™D ‰BŒ#À%Cdb¦`# jŠ™0#ÁqZUT)†h¦¡¯…¥¥}7kCPK ÿüý§VŸ“�fÿZaoI¹Š@ÓPB iAŠ€ Ö©Á#Á”Ñ  ÁF‚Î Q£¨¢>JdŽPÌ1I‰áPÉ"XTlXæ‘E"iªûµÓa<ãF¶oyð…F §Ð¶}ƒã ó¾´˜g$ª‘ŒHF­àAQW\‚‘%SPpCU ¡ ªä±bQÚ2¤Í-ÍPXj %D OXÁpm÷®Óa<ë‰ÀÞý[‡¦{ êºK/E꺦rÃB¤[9FEŠ©¢2Á�g¤ñÕT(>"ÕZ@<£hsaÐŽÂgyÙhC¡ÑL_)Ž ±ŠLMt¿ùîºùtøÎzbö|Ö[{ùvÌÆ0FÔ•*A"E" 'U(ÁG3.¨ƒE–‘lPSZsD %;Ù¡µB¿1¬rch•Ð&3Ô„%$çàDõ9F‘b§ÂwÆ“9€ï<±gϯ¾ìµ¸^aÅPuç€áØX£dœ¢ &dW²Y5CÇIšK!k _œR2m$*¦F ‘,B«…¶iI) 1=zßýO~ è2ÒÇD^Ðg%�pÑk.þþª6¼3¤0-È”¡‘Q¡ ¢BGQr0úº‘-­*c…ZAÛ*mCiZ¡´ó€³‡vÙ;ä`˜dòÎH=é ³æÁÎÇö»øúK¾1³TÞ•ºiÚMG ±â¢d7Ä MiQ-´Ái‡™¶("…Á Ý€Ì’9Z”"­&•Ì À°1({ž[ûž]Ø�¼¸ è+‚¢�Ë+º+lÎHâѽ‹›/»ð‰nˆoR·©Ò m„6R bN«ÎòÀö[Z)ô‡™Ö•A¥%¯¬< " 13´€ 2¸ptPرëЉQ2\1þûyFGõÏ­NŽ]r¦±tw<ùÌÂÞ#‹ÏoZ»ê7S7¤vüQ"RȪ´­ÐäB.™Ö„ÖœR mŒL©æŠV¦F6§˜Ñ´‚hFUYÌÂýí?yü0ÆØgt`|8°B 7.<e–Ÿ@`xÅB¿¹á¿ùµ 3SLÖMÐd§ˆÒ¨¡V#KA4#Á1%zi ×ÑæF¡)£Z*÷íØ{ªñø°Øì“ ŸÓˆÕÍ@8ˆ%ë•=}xÇŠuS]D…lIiAQBFH‘l‘*8î ¦UÀÕ(ê¨({öy`ç¾S½ lgtϰx¬�«Æx)^ \lÞ\;=Ó›zýåë¹üüi' í÷yàñƒÌ÷�fç&¹æ¢µœ?Óeª[Ó«ªÈÐŒ‡<úÌQç_tåŒÂå{ÀŒâþ©ñ³2û²ì¥Zf€W0Z..^\ ¬½pÃÚn€p`ÿÑsèöE —½À.F³|˜Q¬ïc”´GNXtÎõr!c"kÇdÎYyo�Vû^éšÑjW1Ê¥È(VV“§ÇàŽ1Z"Ÿžð>6®ÿ3‹ÍÏ{;ydb v˜“XsØ<´2N8á·ö0ÃqY?óŒfza\ï´!þºÞ9¡züTŒr¥;þ¿ðÓÍÒO�9ÖÞèø7ƒŒc‚2~Ÿieü…8]¿‘Ÿ†Ñ‰blEËœ ç|µôÿÆþ\އÂÁ—����IEND®B`‚���������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/colorsel.rb����������������������������������������������0000644�0001750�0001750�00000003761�11701304107�020613� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: colorsel.rb,v 1.4 2005/02/12 23:02:43 kzys Exp $ =begin = Color Selector Gtk::ColorSelection lets the user choose a color. Gtk::ColorSelectionDialog is a prebuilt dialog containing a Gtk::ColorSelection. =end require 'common' module Demo class ColorSel < BasicWindow def initialize super('Color Selection') @color = Gdk::Color.new(0, 0, 65535) set_border_width(8) vbox = Gtk::VBox.new(false, 0) vbox.set_border_width(8) add(vbox) ## Create the color swatch area @frame = Gtk::Frame.new @frame.set_shadow_type(Gtk::SHADOW_IN) vbox.pack_start(@frame, true, true, 0) @da = Gtk::DrawingArea.new @da.signal_connect('expose_event') do |widget, event| if widget.window style = widget.style widget.window.draw_rectangle(style.bg_gc(Gtk::STATE_NORMAL), true, event.area.x, event.area.y, event.area.width, event.area.height) end end # set a minimum size @da.set_size_request(200, 200) # set the color @da.modify_bg(Gtk::STATE_NORMAL, @color) @frame.add(@da) alignment = Gtk::Alignment.new(1.0, 0.5, 0.0, 0.0) button = Gtk::Button.new('_Change the above color', true) alignment.add(button) vbox.pack_start(alignment, false, false, 0) button.signal_connect('clicked') do change_color_callback end end def change_color_callback dialog = Gtk::ColorSelectionDialog.new('Changing color') dialog.set_transient_for(self) colorsel = dialog.colorsel colorsel.set_previous_color(@color) colorsel.set_current_color(@color) colorsel.set_has_palette(true) response = dialog.run if response == Gtk::Dialog::RESPONSE_OK @color = colorsel.current_color @da.modify_bg(Gtk::STATE_NORMAL, @color) end dialog.destroy end end end ���������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/common.rb������������������������������������������������0000644�0001750�0001750�00000003725�12257552167�020303� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin common.rb - Common class for gtk-demo. Copyright (c) 2003-2005 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: common.rb,v 1.9 2005/10/15 03:41:36 mutoh Exp $ =end require 'gtk2' module Demo def self.find_file(basename) file_load_paths = [ File.dirname(__FILE__), "/usr/share/gtk-2.0/demo", "/usr/local/share/gtk-2.0/demo", ] file_load_paths.each do |dirname| path = File.join(dirname, basename) if File.exist?(path) return path end end raise "#{basename}: No such file or directory" end class BasicWindow < Gtk::Window def initialize(title = nil) super(Gtk::Window::TOPLEVEL) if title set_title("#{title} in Ruby/GTK") end signal_connect("key_press_event") do |widget, event| if event.state.control_mask? and event.keyval == Gdk::Keyval::GDK_q destroy true else false end end signal_connect("delete_event") do |widget, event| quit end end def quit destroy true end end class CairoWindow < BasicWindow def initialize(title=nil) super unless Gdk.cairo_available? add_cairo_require_label return end drawing_area = Gtk::DrawingArea.new add(drawing_area) drawing_area.signal_connect("expose_event") do |widget, event| cr = widget.window.create_cairo_context cr.scale(*widget.window.size) cr.set_line_width(0.04) cr.save do cr.set_source_color(Gdk::Color.new(65535, 65535, 65535)) cr.gdk_rectangle(Gdk::Rectangle.new(0, 0, 1, 1)) cr.fill end draw(cr) end end def add_cairo_require_label message = "This sample requires GTK+ 2.8.0 or later and cairo support" add(Gtk::Label.new(message)) end def draw(cr) raise "not implemented" end end end �������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/background.jpg�������������������������������������������0000644�0001750�0001750�00000053313�11701304107�021263� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ÿØÿà�JFIF��H�H��ÿþ�Created with The GIMPÿÛ�C�    $.' ",#(7),01444'9=82<.342ÿÛ�C  2!!22222222222222222222222222222222222222222222222222ÿÀ�"�ÿÄ��������������ÿÄ�8��!1AQ"a2q#B‘R¡3±ÁrÑáðb¢ñ‚C²ÿÄ�������������ÿÄ��������������1ÿÚ� ��?�ùØT[C ŽGzFÈÜh ÊŽè¤^¶‚<M±iœïpŽIЯ;¹椑!w«{رPÌI�ûè³[µl„¶¡GÍ"!täI<ŽT$ßšY>¨hÐð|Ó lŒ‹F¤T€{¢æ(Äv×4 ùTQúž|Q •¡KH§Âylém¸Uw$‰¨¦"G¿4©îd€vEL¹ C1Ôÿ�H¦€‹€2;‘ÞY $É=«¶â3Yø4Àçp€£»V”M•´'UDýkYR#‰¢ŠB@X±ã˜§®X"A™8¦$ërBÁ¨©“ K„ö¥Ð¸dŒˆÖ©Þ1`Nˆ¢ÙpË›ŽMTDL‹î~)‚©oÏŠ%²%ýFQ"™-¢Ã³³ß<šŠÐP Ä\ˆŽ(žÃ@E/¦z––g[}ãST´¨€ùËÀª€ª-¡ˆÉŒ–¥ïpª¸Dìš* ¨„‡$÷¢EÁ‘V¶$~ê7U ›`Ð {ÐU-yZàTê»§ÔkŠ :ÔƒD!7@`5²{~(1`v¿ØÖ²0±™úݤ}«Næ[®åͰP‹b"7"¢Œ¾1—�Ð ˆ²rf�V ®ÀÁ$O€œîo~ÕP¨e½5'€HÝîq§��ñTf÷ËÚ †õþ±’ÈXE–g˜ ¨U27è?½‚)÷7ö¦fôWõ]Û‰?ù¬«mos9ùŸÅ� ‹hb$ÈïCÙYQÝ‹ÖÐG‰ –-3€]îÉ:ŠsRH;Õ½ìX¨f$€}ôY­Ú¶B[P£æ‘ºr$žGª NïÍ,ŸT4hx>iƒ…¶FE£R*@=Ñsb;kš|‹*(ýO>(„ÊáP¥€ˆ$S„ ‚a<¶t„6‚Ü*»’DÔS £ßšT÷²@;"¦\!˜ê¤S@EÀÈï@ˆG¬�’džÕÛq¬ü`s¸@@ÑÝ«J&ÊÚƪ¢~µ¬ƒ)ÄÑE! ,XñÌS‚×, ̉Su¹!`ÔTÉ…%‡B{Rè\2FDkTï°'DQ ‰l¸eÍÇ&ª ¢&EŽw?ŒÁT·çÅÙþ£(L–ÑaÙÙ‚ïžME!G*@u&cŠe·mT,HÉæ€~(EÅ9#Q@ fëlŸµ=ËÊ! …Ȭ¶ò-î#(š2¨!Ió@¶Ý ÂV0 Áý­n` 9ÆÀÉÐ ™ºÑ¢� [—{KHâ¨ýBÎôOŠKކâ[µp+³�Ì[`WEë-›ŽY- H’[ïÞªb¡‚ÌDI;&¤Q˜ÀEQäŠ(Äté’º“î9ôàqãɨ C*•WsÄÒª"�c7™,DÁ Ì¶Üì@ù¦Æ@rÅLh ¦@] LQ‘X‚÷îdP’É,<ÿ�ȱP ÐøB&æ Z õP& ˜<ÓûÜcÅ1#Sßâ¤?SÙ$ÀÞµTlf4cÍ'Ð…TnH rŦ8ì)D ÔsF%x"Gsº�ðèqàÀì�©Â— žcš¦Á5Í*¶�³0#tåÄr?Šbà3*¸ÍJÒÿ�˜k÷ ð©n€Ú'æŸÐ{BÒÝ%²Þ*œ}ê FGÀâœ6"ñ €Hó½Ö�¡,@-ò8¨¦FÈ<R›ym V0“3Û° C\’D[‰ È2PÊí5º{ÂÏQ饦¼ä{À×4¾­—ê­®#„"j¿á9‹w.-¶g¸Æ r<î´Ê¹t×z«—º«KmBª0ŸãïHöå‹úAŸl=v¯N.Y¸—,—%¢cÛ\­w¦==¤Vf¸ šËHr¤Q2f8¦[vÕBÄÌžhâ€$Y S‘"5�¦n¶À1ÉûSܼ¢QÜŠËo"Þâ2‰£*‚‘4 mÐÜ!c ЬÚÙæ�£œl�<˜Ý�™›­ ¹y´¹Ž êÔ!\ïDø¤¸èn%»W»0 Ŷt^±rÙ¸áÕ’ÐÔ‰%¾ýê &*,ÄD“²jEŒUH¢ŒGN™+©>ãïN<šŠ2©UpX÷<M*¢ 3y’ÄL À[mÎÄšld,TÆ€ êdÒÈÕiˆ/q¾æE !Œ’ÃÈñLQK�@„ R`þiÑÂ�E¢Q¥b`yƒÍ?½À&<Pã5=þ*Cõ=’L ëUFÆcF<Ò}UA†äŠÈ‚X¹Ðâ™U÷¬Ç�qSÄþ¡Æw—z.$ÌDŠ ;æ üTÐ  d|v YäXA'½asAX�y4Á LšÖ¹~òô¶!È|SÞP–YËûTdAø®Ïð«>—Kê”&õïv^*¡¬†ôÝ=„F´­se‹{ˆûÒ]éìtß­îeµ-胯üWeç·ÓÚqÎMû@šæ¿~Ût—{‚ ŠÑÔu-«ÑÒ³µÍqmÛàAä×jõXÚÀ&O„5È@W Úy ÂÕÁp*ʾ;šhrI =èC!ÉýÇ9•æg(Çš ÒÞÐ3X:4™Ÿš6P ³cŠÒË h46ÕPº1:Á¦H�d{ ED†nÇÁ¢H˜ù¨¬å‚Ù:óX¸E‘; P®n-Ç� “Oƒ‘îÖZxª…úB¨2Õ‘1�·#°ÿ�µ>H’¨ÒÝÏ1HÓýŽê(3b]î0…H¤é:TêɽԶ(L­¿#É¥¼¢ëZéÆÃ¹ÈÏaÍ{im-ZKP›m?¶«.uèºc­€ʯïRK¾‡T-[¶nÜpX3 éký-¶9\xñ ½C¿SnèDÁS�³Ú£Nr—Q¦ê(ù~(`K ¸š·UuQv¯Ü)©aseTžIæƒ2)e§ø+éþaº{$•W>à§;U ••Âߎi€+ðPÊý꣰t=´ :{p8öƒULÚÖ²Z*kÕ$MÅyð Nç_qÕÒÊâ&�^MF—¿y:Nšå¶½“±¦¼äŘ0P£ˆÇtUBuÎH=šY’wÏzˆÌˆ%‹)•PzÌp<Aêgyw¢âLÉÔ@øª(wñS@0‘ñÚd ‘aLžô…Í`äÐ-2jwZåûËÒØ@‡ qñOyBYg/íQ‘â»?¬ú]/ªP›×½Ùxª†±þÓtöҵ͖-î#ïIw§±Ó~·¹–Ô·¢¿ñ]—žßOh=Ç97íkšýûmÒ\\}î,j*wGQÔ¶¬[D?JÎÔW5Å·lJ“]«Õck�™>X×!\\'jt9æƒ WÀ\«*øîi¡É$€ ÷¡ ‡'÷ä W™œ Ohl/K{@Í`èÒd~h`Ù@2ÌyŽ)ÿ�K,- ÐÛUBèÄè˜} ‘ì)»‰ c梳–gdëÍbáDHì)B¹¸·�‚@M>G»Yh âª-剃<ÖÂæ^ëe{ŒZgñMmË-ÇHUŸ'¼Pfh ÔPÐÄÚõ#Œ´9õg¶ª; Ù'G½H€’ÀÆØŠ¨Ïe]Š»–V½.’_¥¶%Dk…¹ŸT°ó¨ o�€bÇúvh:úÛ`² º¯cûMs\`Ph99ù¤ ~á•°@=ØÇö A[%ÛǸ:ž*)½÷>cE© lFÜÉâ™ÉÍH2æ'À4æ§l—£<¹:+^%m9Æ·LätöU@÷üš”QI™ ŒJ)Ðù »Û ƒÁÚr?Š»=ÛÖú{.© ’Þ?[ ô–ÔÞpÀ˜9©-Æ7’ÏMmn:ÉbÜ]·.Û»ÕYÚ!‚wUã¶ ÉËƒÍ <˜åÿ�ÇÅ]ÑÜzçFÚ¤î*€2'B¢²«2cnÒö˜¬RÞ‹9b7£ýâ…²}Ïí÷HŸ™=ósxðsó@m*-ëW[;“æ½1 ú¬à~ªòðp¡Äò *ûΉòhã¼îX悳¸75,÷4‹$‰âx5FЊˆ¶¤“ÃËPg11ø4 ±ˆ1Þ‹LSöª€ˆ.ÀÉ:í ™> Pˤvu9"t4OdÛ|Ä‹iíÙí®õ†,èHçâŠ"˜Ù=Ϫ1K¶Ö2R{οŠXuö2OôäÄž>k)!8‚wÄTPd yb`Ï5°¹—ºÙ^ã™üS[rËqÒggÉïšÈ4�[CkÔŽ2ÐçÔvžÚ¨ì+dLõ FKb*£=•v*îYXD ôºI~–Ú@•A®æ}RÃ΢¼�V‹éÙ ëëm‚È‚èb½í5Íq€U@} äçæ5û†VÁ�÷cÚl—lKàêx¨¦÷Üú@U¦@-±r7'Šg$h?5 ˘Ÿ�ÐSš²\zŒòäèx­x•´äsÝ3‘ÓÙUÜòhQDe&vf‚1(H§Cæ‚ïl6SiÈ@8þ("ì÷o[é캤‚KxüUnƒÒ[SyÃ`椷ÞK=5µ¸ë%‹pvÜh»nïUd h„B ÝTsŒZØ+'.40Lòc—ÿ�wGqëœj“¸¨�È Š,énØ·°[©«—æ>ÂªŠŠ¹bÞuAžà¶¡@‰&;P"©ô˜1P@ˆð*‰"I<®¢—Ó,CL~ŸšGéÿ�ÌuInããk¡ÜÕF·ƒ Ž-±ÁªS)wü §êzfé¬ÚµÓZv ?Wæ¤Èöî0¸XÜb¢š}ØhäI¥KVñ¬ÁГ³6> dOšƒlË@#š�Ku Ëh€?{öHDH #šÀŸE@*K 11A…»s¶ ÄêˆÀËæY  v, �V�‡m–ÁPó ÉÇäö®fêl(—Û]»*“?o£\[}:é PÌ;ë-€ª¶­°KK¨A Ô?á‡;—®eFŒIÖ€¯ImäRAPǽrÝ«CñI~àéÖÊçý5p«Y³eíàK‚}Ìg½@ v Ó•BÊ$åªwöª!| ¬¤eÇÔ r1ã½ óŽÜS¤¢›…1v³3ª(* ‰ #±=èåÁb'KS�IrÎNɱ‚K¸yø T—n�ÞŒÖfU"u:¬�~(¢ ½[HÒ/šRI2I3â²17)’ÚŠÀb§Oo­Œ`L±ç½{€(µi3¸tk J‡+ä;!Ò´áÑqžýÍ*!yÙ€LÕBÉ+�…cÇÚŸ#&Êc*& РÀ±¸ÅGQ@ÚBÀ‚û'¸¬Qša¤0ˆ=«I6t&¶d‘ ÆäЍ,énØ·°[©«—æ>ÂªŠŠ¹bÞuAžà¶¡@‰&;TR*ŸIƒ¨’$“Êê)}2Ä1dÇáyù¤~ŸüÇT–î>6±:ÍTkx0¸âÐ`¨õ2—|; ~§¦nšÍ«]5§`Óõp>jLnã …À&*)§ÝˆöŽDšTµošÌ 0+0#cêDù H6Ì´9 ·P̶ˆ÷¿aT„@D€ ’9¬ ôT x°Ó[·;b�ÜN¨Œ ¾e˜÷ñJbÊ`vÐlU2 œ~Ojæn¦Áb‰qµÛ²©3ñ1Fú5Å·Ó®• ðñ^²Ø «jÛ´º„ÍAÃþs¹zàFThÄh ô–ÞE$ {Ñ -Ú´?—î`®q?ÓQ§ µ›6^Þ¸'ÜÆ{Ôb ÐÙÝ9T, òNZ§qoj¢ÀªÊX»éÖ¹–Ý`·mæå­É×< v!m®+�;ÔzŒmÙw$·üÔUX’˜È˜ÜR[{ª iµ¶.9“Z:‹ªnž‘aŒ‰p¦+§¡±q÷¹Ü#KûG‰ªŠdëxº^=EИTñ\îÖÞ×®¯qîð̇šõz{NÁ˜ÀÅxaÿ�Ú¼ÁuÖze6Ŷ’qÖ¦¢¥é ÇrO�›À*Ûq͹“le5Å�\ÙÇÕ(UQ�ƒuÜë|QƒÞµÄK\r} óAƒ(8éî°½¾ô3,˜Êg[ª;„¶GÞ‘W�äÓ‘Ž8º €=È=ªÖ:¯M$ “ÆÏGPÁî)vÜ(â›@sÜÍŸ¬ºW °SûGšæ$“=·C1ëÔ$÷Ûfi_—ñUŠM²àmާŠV¦Dÿ�Óºgp-¬dDkÒ5Ì' Aíê(=чý±TqéY�$Ö·mî÷ÕØ3ê å Ï ÄóU ‰ŠfvÀ"”qðS¯ÜÞ*`›ìBŽÝ?…‡»ÔOy­ZP=¨cŸ&‚ªg3ˆîh¹« æLE ¶ÅŽ­,•»s‘1âkYó æN¾(6*<˜¬ 7±X sOšÚÛ>É“É'“A-’œ ’EIv oæ+ DóLÌbkâ7S 3¦LA“QL°WÚitÏ„äØö¦! >aI˜ƒÚƒ*ÙéÊ›–=ÍT5¨[ ¡?÷ K’�“ð(Œ[ÙÃf{ŠP™)9·ÜÏ?jŠ»éÖ¹–Ý`·mæå­É×< v!m®+�;ÔzŒmÙw$·üÐU‰)Œ‰Å%°÷º –˜Û[`ã™5£¨º¦ééÈ— bºz_{‘Â4¿´xš¨¦N·‹¥ãÔ] €õOÎímízê÷ï Àhy¯W§´ìŒ W†ý«Ì]g¦Sl[i'jj*^ Üw$ð�ì)°|­°GÐk™0ÆPc\P�…Íœ}Q€…Uðh0']ηÅØ=ë\@TµÇ GÒ42ƒŽžá; ÛïAÃ2ÉŒ¦uº£±HKaTxéqM9àP‹ È܃ڭcªôÒJ <lñQTu â—mÂŽ)°D=ÌÐYúË¥pË?´y®bI3Ût3°]HOqA-¶f•ùPè¤Û.Øêx¥i dOý;¦wÚÆDF¹Ý#\ÂrÑÞ¢™¶ð�íÞ¡Ô¨{Jè81ç{®„'…Ùþk*CNF š¨ô‚‹¬Î¾Ûc‚Üš£„A$•FÔ÷5À½Uà°ªF‡Š•ë¯pÎXž7ÅHµÓÔõÃf׶ߟÝ\6Ðvã‚Kq>)íà¶A ÃÉmîƒ>¶™þõP f� ú{Ñ(¸É^ò>ôÃPHÊ>)L´â<ø¨¥À9Õ²XžAYíÛE_VåÂIúTóT̘ÅŽbiQQ=Øï·z¨æ|,î¨ò2P¤Š*¨P\dR[ÊöûÑy$Nñ⢂(Y$“q»v•ˆE-?Þ¶6Ën\8šÆÒ}^³¦wºoômÉc“ ŒÑ´ŠÜ{y1<·ŠM;’¤°_Š¡KŽL¬5½P¯qÐâ`ö¥°5_Ô?¸™¤[=KtÉt2æäâ„D ¬¡Eç²H/É�HïUIpI9æh,úsÚháí€ÐO$ Fd´Œå‚¨å›‘iBÁKez›½C„)l/´’'~)S©|¥Ó^aÌâ?ä×_Afå»n€¬î^'.õåæQqÚ%—\Tî„Ôÿ�2nÜ{�8ûWu¬¯�2B†|Wu�t"ÊÛS÷w¨©1ITªD F§æ³bÙ'˜S†Ú c1.fƒx&w1@'´–O`)‹Æ‚’#°¢$dý¢ªij�Oon襋EŒ‚�ùÙ¥´F;$’IŸÍ1_vY“<ÍE8d™ÀGoµ#31>Õ¸ãuŽ=þO4¶ð�íÞ¡Ô¨{Jè81ç{®„'…Ùþk*CNF š¨ô‚‹¬Î¾Ûc‚Üš£„A$•FÔ÷5À½Uà°ªF‡Š•ë¯pÎXž7ÅHµÓÔõÃf׶ߟÝ\6Ðvã‚Kq>)íà¶A ÃÉmîƒ>¶™þõP f� ú{Ñ(¸É^ò>ôÃPHÊ>)L´â<ø¨¥À9Õ²XžAYíÛE_VåÂIúTóT̘ÅŽbiQQ=Øï·z¨æ|,î¨ò2P¤Š*¨P\dR[ÊöûÑy$Nñ⢂(Y$“q»v•ˆE-?Þ¶6Ën\8šÆÒ}^³¦wºoômÉc“ ŒÑ´ŠÜ{y1<·ŠM;’¤°_Š¡KŽL¬5½P¯qÐâ`ö¥°5_Ô?¸™¤[=KtÉt2æäâ„D ¬¡Eç²H/É�HïUP…Ü÷¥w-¨“P!QCƒºÊ¢²µÌf3Tÿ�“@ÊŽë‘!Wÿ�wH#d+]c¡@|Õ\¡ !Gj[èâ‡SÀïA’Ù�©'#ãµDÙ~ÜP/€(¼ óÉ¥ôÜúŒH;ÐPÈAŽFÍ`Z vyjpél€ž|Ð’Nê)I¹væ6öcm:Z`B«±&Zy¬€¸t/µì?wæ‹Yic &cUq?¨µ<� )mÛ‹¢ã6À «ªå1Qd%N4gL)À–c‘h¥u gžP¸:~³©2xdñF×A{¨Qwª|Wœ$Àÿ�½5‹g¨ÿ�E3éôè ž í^ª#»F•&Y›ÅZGôVí'é]¸4:ì *õØnžÕ’×Ã7s&»’ý•Ì-ÀÄ+›§{Vo]{¿¨÷"cŠƒ z‡ÜtjFÚ¿UÒÛ>à\öÿ�EtõoníÑsÓE�§Z©‚ìÏé®*?UGªÈálb¿õRºª.w :Ë÷W%¾²ôD&‡1Q{—z‹Ì ã÷MHµÑw¨wµn8^Z¹æè lóâ)ñ–$ûˆÔÏ5‚¢œˆ“þÔ âZ|S¯?ÿ�4€!-+ÉíªV¤Ä( \Ãĉæ„1Y% wâi•-ú›A€‘³LU]¶ax� XÒ-¡ãã½+–r}6UOêj£º äö�R Viº¾a*¢JÂݲ×OrP%Å Yై‰5@팪b;H@2\" ö e�(PHÏzWp"Ú‰1ÅÕt8; ,ª++\Æc5Où4 ¨î¹÷t‚6BµÖ:4ÍUÊrv¥·þŽ(qU<ô- ’r>;Q„M‘'íÅø‹Àß<š_IÝϨÁ‰½õ ”älÖ §g–§–Ì(‰çÍ $›—ncof6Ó¥¦�„*»e§šÈ ‡BøÛ^Ã÷~h¹‘P:f5Qqú‰×ûSÀ�ÁØ–ݸº.3l º®QBTásFtœ f9ŠWP–yàE�kƒ§é :“'€&Omtº…z§ÅyÂLûÓX¶zñS>ŸN€™àžÕê¢;´iRe™¼U¤q/EnÒ~•Ûƒ@ƒ¡®ÀÒ¯Q†éíY-qL3q÷2k¹/Ù\ÂÜ A⹺wµfõ×»úqò&8¨9¤3,HÏâ²”ÁRäÑgÌ,4ÁUWP\÷ P@B2b`˜¬¨KF_oÿ�imŸP³/кüÕ†#góA°USX÷<ÐEs9'lR3’Ø) ?{xÈ€ªmƧE¨6#7XZ.ñÿ�V«Ç÷@ø€©`'#¿jn€£jiäÅ:&�µÈ,Ü/Š’@~àшPÄ-»däO4°öžü4Éh#z—}ÍûAàRÜcé ÜÔVP™$±¬@Ä’GŽiÒÜ ˆXüŸµMšÐ0VGe‰ §Gí¼íŽî€gä+Òu bãÜ00öÍy–ДËÒkpu'cñE܈n³ ˆ=¦‚v‘ͼdmÏ'íM‚Ì–2<Ó\!-„š_NB+¹ ïâª&–’àä/e¬ä'`+’&5°Êf"¢” *TòÝé€[i‚‚;±=éCûHTãs©7qbX[>æË€<�8fŲI“&g·j ¸¬GÚŽ0YV  ±üÐ U�€´P{¨ª2aæ±¶ 2y ÿ�5T[]?‚ÞL LÝì†3Åõ$Å�æîrú¨ ã; j95PñÐP�X2ìÁÖÿ�š¢ZœÜ3qÈÐ'ŠPÒ°ÛiÔR/¾{�{@Ы@HÐ�€9¡l*— ³@©¢Tæ€ÈfX ŸÅ!e)‚¤É¢2ϘXþi‚ª® ¹ï@ €„*dÄÁ1YP–Œ0,¾ßþÒÛ>¡f_¡uùª$# FÏæƒ`ª¦ ±îy ŠærN>ؤg%°R~öð)‘U 2ÛN‹PlG n°´2,]ãþ­V!îð)RÀ.NG~Ô ÝG:ÕÓÉŠtLkY¸_$€ýÁ£*¡ˆ[vÉÈ$žh aí=ùi’ÐFõ.û›öƒÀ¥¸ÇÓ @'¹¨¬ 02IcX‰$Ó¥¸@ ±ù?j›5 `¬ŽËANÛyÛÝ�ÏÈW¤êÅǸ`aíšó-¡)—¤ÖàêNÇ⋹!Ýf{Mí#›xÈÛžOÚ› ™,dy¦¸B[9?4¾œ„WrAÞ#ÅT#çýé™ñ´Ÿ[÷ð<ÑI,ØÉ ÌÖ²î&ãk]……@Úÿ�¥oÇî56b`lÏzir‚AT¾«" Wm šŠ)eTÞ{ ¢î]·’àP. DöŠÓ ±ßµŒY`ix§ Š�ˆkBh‚HHÝÚ¹ aìHù¤BC.91<)À" <Oz'lZ æbª3>M*ã™n@ì)Š§Ò¤ªù¥:IàŠ×ÜÁvsð)•àP'F¡bÅΦí˾¢€†Dîº.8±Ô½›„¤hD½T)õŽÉOïHKA”“ÿ�ƽ‰ýL|QÌ�·=¢€*i¸0 ÚvMf†¸�[‡‘ªÁ™î4ÈÑæƒÈ" óÅEb‘qT,À–,x™Àb!Œx§[aÜ<‘D2'Ý(#›%§3Ìê©eZÝ«aS'DÐÌ™÷4fú–}ǹ?ö %ýÝÉæuqö©ÙS\È‚ÿ�4ÞÕö)‰÷j˜ S”ƒö©JäB‘äÓ$ð~ kL=b#@’HàÐ9";…$½m®”7ƒ±w+Ø"µÇ¨ÿ�“Ú©aíÞéâÛ<¶ò{UC2~iY³.O�Õíô­Ô/­m–݆~þ+”•õ• y˜ p…QqNñž)’Ù¶ÅÜU¿ú0S Wžäö£%܄ɀÑ'QXHùÿ�zGf|m'Öýü4RK62Bó5¬†E{…I¸Ú×aU�[kþ•¿¸ÔÙˆe³=é¥Ê Pú¬ˆ%]´€@j(¥”ESxIì‚‹¹vÞJ@¸|Ú+L6Ç~Ô 1e¥âœ6( ­ ¢ " owh<懰I#æ‘ ¸äÄò@§�ˆ,@ñ=è°Yh'™Š¨Ìù4¨ Že¹°¦*ŸJ’«æ”é$€j+_sÙÏÀ¦Tt{@…‹:›·.úŠQºè¸âÇRönn‘¡>õP§Ö;%?½!-ROÿ�vö'õ1ñG0ÜöŠ�¨Y¦àÀ/iÙ5šànF«g¸Ó#Gš _ ˆ@'Ïå zk¡ñþôª2V·ù¬6ëò;Љ_“@×a”,kÄš/Ì·Qwö7¸&‹…Zá– FFPAÌÜÇÄÏÍbÁ-åŒjÍ4@�æ<SÁÀµEL°tlð¦±uAˆÛLÀ¬si&y¡g {, Î…Tf[h3¹»ŸµyAC}P8€<QãÜvÇVÔVžì@üE)arãd}‰ýÍ5ÆD·•Â1žõ%êºtLm«·»…S³üUEzêãžÅ¢“îg0&ºlÜ6Pý@ÔÜ`žÑ¡ÛŸø­Ð(·ÑÛS2HüÕ/ôëzÍÜ‹„a¶S¿ŠŠäk-iÀr¹8 TVËBÚÉš{¯ÓzcÒ{ŠàÁ,6µM–å„H ÌE¸—Êx…ÝP\.HìE:¥Å|Ø0@¢27KP'¨2v´ŠÖع‚{Õ³|Ôg�h#›ŽË‰h3$jª&ÖÂL9“Ú&ªŠ¨I ÃÉÿ�ŠLÍûzPÊ– nö¨¦¶NlÌ@@4w 6Ç“H¨¡±ÊLÖ ö’ í3U�s#=¼Ísu-ˆvlçÍX‹ Pß"…›#üý´f0ˆHÉ; ìézt鬄·„òìy5a À@g=éðL¾‚È6q¿[sŠOÚ§Zཆ½ÖÝ´×¢ª!Chy¨z^Í29HPÝ£µ2à#ÜïñEÞãtèÈš!qg_Õ2dèÍ3É�I�ЋŒÇ÷ºc7``Ä-鮇ÇûÒ¨ÉXvßæ°Û¯Èï@\DB%~M]†P±¯h¿2ÜEEߨÞàš.k†XUA3s?5‹·”1¨4ÐI�@˜ñL�Õ=2À=ѳšÅÕ#m3±Í¦™æ…œ-ì°/:Q™m Îæî~Õæ õ@â�ñGqÛuZwQZ{±ñ¥…Ë‘ö'÷4×ÞWÆ{Ô—ªéÑ1¶®ÞîNÏñUè_¨{Œz{ŠO¹œÀšé³pØ=Cõ�?Sq‚{F‡n|â·@¢ßGl]LÉ#óT¿Ó­ë7r.†ÙNþ*+‘¬µ§Èfäàt)Q[- j&iî¿MéIî+ƒ°ÙþÕ4[–"ƒ1â_)âtApH¹#±ê—ó`ÁˆÈLÝ-@€®†RE–ÐS6;Lï‚«¡À’ÖYmHb9"(³ªçy’ʶ v5º—¯Ùb—vÉ£Øk:«¿æoK¢˜¶œƒó^½¤(\˜SÅZ5RÓ+z1þeÚH$à(_[–m²ƒpÿ�×Ô«¢‹ÖQUË„%‡c@td]ÿ�2ר¦íö¥W+YºÍqU{Þ™Pl, kÞ6M` $“ϰq…P`Is•"¯¯r ‹k·oø¢ìò¶Óë}@ÿ�z£'§dZ¶|f~j¢ii.uÖí²M´L‚ù5é…L ŸÛ^xÈ>b;šê^¨fŒØ1Vœjjã©lŒ^^æ ~£ÅsõÝEGÓ´÷0òßÕRê:‡½qò:èWÆæ†äïñL¬…€¹2 íX7ëfAã·jı8Àv©ººbààn‚¦ŽÔ…”!ð5×3Œ»Ð¶ªí‘�"ð<šRT´— èUmo6cŒìÚµ§Å7ošV`·¸|мdÇf"‰Ç†MÑJ9 ûUb9“³=¨-rÖ¡¼)¬`)0&55—‚<5‹É“@]ÔD˜=kp—äl?© -rZ‚ñD†¸RPpuUMÕ#£ú`Ìlÿ�Ås¢ÂÄkÅ mô‡²Í7¦ʆk’½¼ÔV@5½HΪ 1€<Ö£Ûž$P"Ú–LGv (¬Iv©Í,”<˜¢ 2+9lˆÚŠ>Âp�ÇÇ÷ @WC)"ŽKh�©›À¦wÁUÐàIk,¶¤1‘ÙÕs¼Ée[P; šÝK×ì±Kމ;dÑì 5„Ußó7¥ÑL[NAù¯^Ò.L)ˆâ­Gš©i•½ÿ�2í$p/­Ë ¶ÙA¸ŠëêUÑEë(ªåÂñ :2.ÿ�™kÎìÓvûR«•¬Ýf‡¸ª½ÀïL¨6µï&°’IçŠX8ÂÀ¨0$¹Ê‘W×¹EµÛ·üQvy[iõ¾ ½Q“Ó²-[>3?5Q4´—:ëvÙ&Ú&A|šôÂǦ‚Oí¯<d1ƒÍu/T3Fl«N55qÔ¶F//s?Qâ¹úî¢Ç£éÚ{˜yoê©uCÞ¸ùt+ŒãsCrwø¦aVBŒ‚á@\™ö¬õ³ ñÛµbXˆ `;TÝ]1p p7AFÓ?ÇjBÊøŠkˆÆ]è[UvÈ€xM+IbAŽÕ.­™zk€I$ö“NÁUí*Éw1$ÏÞ‹ôÊêPÝxî*£Ð±h[²ª–ʨ™ÿ�Š=Mô²è–ÓP$±ú«t×SÓ¶n¹8ˆû×7YÔ‹×u¿¢‡QÔ5ô�·±xSæê.9¶„ʬÍI933�Åm ²{nƒUŽšÚ<‘X!k˜-âNöSJ"‚�ˆñZÛ³µÃ¨� U@EôٰĘå½ãd~ X2vkd¹Xk´ÿ�ÅEe8.þ£ªh<ïŸ4-¦Sq´ÎÏM¿|,ˆñª¸úÀmšœULš ¤S%˶¸ s$€W™ŸŠ¨$ÒÝI´ÛN¨²�ßQb<ö¢g)‘‚ ÙÜ'0inam@v�×z á,âI8’8¬¿©vZEµò;ÕAŒÊ-™"gæ•­»îT(ùª¡öÜx2Ú”¨, ØÌêŒÓì9¤iôÙ¾5ÿ�åme"Ú©‰&(º $Ü‘@Eµ,ð1 2…)%’vÜÖÀ”PͰ$ÈúPÛö¡ˆ}@’Wdˆ‘î|GX<)<šÙO¸ñ@eTƒlßT%¸•æf‰pÒ«ûH+£ôˆíU¯N ´Á#_z|Éæ“‰öK‘üÕHhC⢕Ifo�G¶æ„šÀmšbÞØ V’ăª][2ô×�’Hí&&‚«ÚU’îbIŸ½é•Ô¡ºñÜUG¡bзeU-•P#3ÿ�z›éeÑ-¦ IcõVé®§§lÝrq÷®n³©®ë~E£¨kèobð§ÍÔ\sm •Yš’rffŠ Úd öÝ>«5´y"°B×0[Ä즔Eâµ·gk‡P�ª€‹é³a‰1Ë+{ÆÈü °dìÖÉs °×iÿ�ŠŠÊp]ýGTÐyß>h[L¦ãižþ(›~øY'ãT qõ€Û588*ª˜4H>¦K—mq@æI�¯3?PI¥º“i¶8Qd¾¢ÄyíDÎS"*+³¸N"`ÒÜÂÚ€$ì®ôÂYÄ’q$qYRì´‹käwª†°ˆnƒx ëNLDOsA*\‘î'‰â)ÔBv™QJ¤™}(åh”B/;$Ñ@Ø–h¶ªl@Ñ$·a@@UB˜<‘²híT@ŸÌÓ�@ÜÐP(>Aø “–k-솟«’"¸cÀ(­arFºû¬×B¶ýÌ{&rV:ÜQHRˆnæ(ª2²N‚óÍ5±é£»!Mh@ì’qóA¤ÈÀ’DÍ1}ož` þõƒ¸ê£ˆ�€4$RìÞ]N¨­¶d¸n>*_ó‘=ò¥´'“³@J;´gm7Ç53iñkÎÇ“ª¶ÔÂÆûòiDYLŒfO}TSçnÂB! NäÔкÛ÷!bL’;U’wpóK‰iÌPášÀ“¨ÝhŸ·j`c‘àhT´A ìrÑïA>™&Ic j¯‚}GCš@¯#µ¶Ð7sN•æ s²ŽÑ^òbmÛì#gtÀ�1…âO4ÅËí‰ûT‹aÊ$UCúVä˜ànРð(9:Æ8ÙñQº.ÿ�•oLÃs‘íö °!ÜAr#u€%d¿öÝV×øwOg¥7©’¬µÉÙ®{6îÜ›LîY¦()€.ZN¸ÿ�ß4ºÊ&´À‰™>*a²¶² ‘À梪„ãäO4 +¶Õ@Y?šÎ]ä�#Hƒµb˜&!'ûÕF°ˆnƒx ëNLDOsA*\‘î'‰â)ÔBv™QJ¤™}(åh”B/;$Ñ@Ø–h¶ªl@Ñ$·a@@UB˜<‘²híT@ŸÌÓ�@ÜÐP(>Aø “–k-솟«’"¸cÀ(­arFºû¬×B¶ýÌ{&rV:ÜQHRˆnæ(ª2²N‚óÍ5±é£»!Mh@ì’qóA¤ÈÀ’DÍ1}ož` þõƒ¸ê£ˆ�€4$RìÞ]N¨­¶d¸n>*_ó‘=ò¥´'“³@J;´gm7Ç53iñkÎÇ“ª¶ÔÂÆûòiDYLŒfO}TSçnÂB! NäÔкÛ÷!bL’;U’wpóK‰iÌPúÀPKr@£Š¸ Àñ:¬Êp¶Åf}Ü“MŠªª)àwóA;Œmâ¡ò-À#tm#(w{xp o\ºÒÞŸ´Õ™—fw'@ð*¡S6‚Š[„…ÖÉÐÞ™½úøæ™Y\‘­ÅE(¶UàÃTJ£2ûDòiƒŒ¤Œˆ46Ò ¾{UF ŽˆÌV ®Å‰“æf˜*:I“HM¶1ˆgGu×5l"“‘ïFB¨äî¦0Ŷ8Ñ&ÃGbüPJj&fh† ’vbŒp5Å!*ºÐ1¶êù\ƒÚ“CÑR}G$’t<R¸ýÆ8àö§Rw­PvcbŠÃâ"•¹¿i¬¶•¶Tèj€ –%ÐcTù@1ÜH-bCxmÖ+qÿ�9žêf€œÝù2|žg‡bŠ£RhX p•Yâ°¸.g‰ÚT0¶0NûLÑs€$AŠC؈05¨¬-©ÄŸù¨¦x‘êQuÊE±îfÁ{óYn3Þ fÓ](�’РÕÓ§ê¯_·êÛK6‘Ã"MTYz+ÂǦýK±hÉLA¬ÎÏwü½åd’"·É®¶qŒŸh®{ïvÏQnáAm•‚|ÿ�ïÚ¢¹™O1Ìòhf-Û0�?ØV¸áÎmqƒÄTÖÚ¸V»t‹\ãÆT‰ÎNɉ¦“‘<wÝlØßp)+®@%T rE_¬·$ 8«€ÌªÌ¡W lVgÝÉ4تª¢ž4¸ÆÞ*"Ü7FÒ2‡w·‡@¡a&õË­-éû@àMP)™vgrtª3`H ˆ¥¸H]lé›ß¯Ži‘e•ÉÜTR‹aUQž�ì5Aª3/´O&˜8ÊHȃCm!@ËçµT`ÁèˆÅ`ªìX™>fi‚   d™Ù4„Ûc€ftwQMsVÂ)9ôd*ˆþNêc [c€M2l4v Å�4¦¢ffH`É'f)ØÇ\R«©Ýn¯•È0= y4='ÔrI'CÅ+ÜcŽjqµ'zÕ�'f6'ø¬>")[;öšËi[eN†¨ "-ëy1bF÷ÁŠÊT¡TŸ3DA&hýè°}¶×CB(µaR5õ–ëÁ™ãÅkŒVÑ`Ô§„~ $À$p?4PY˜ÌƒÇÛÿ�f˜ÈPƒTÌÇ!ˆäÆ©`" >hYsm4IÑOdžIïX’ ýõ?zP$   Í(ÆÕ²@˜˜?ì+*’Ç™žÔQ2Äi~4V�.C\=»D*# @1£X¶™;k"’2mРF̬ï@S}‘–§SNÅ·1æ²Ê Pù"a@€;Áaˆ˜‰¦¸ø.õ޳΢•ÈM‚ *¡‰…bÍÞ?µZÕ¯FÑ%}íÍdìíãɬßTO ÌöšÌÊöÐH*ˆš, !Çj¨À¬¢¶'S·¨LÊâ>ÔÁ‚#Ç“Am»ì±EøïQZiîK*¬O>ß!mL ïDœl(ˆüÐSü:×§Òª²êûÉ®ä·vâŸMr?ÿ�Íyëuìÿ�¤åOž&ŠuC†7±aÀíA×zòtÀ-xŸ©¸Âì÷ådž¸Ñšåî±2-§÷4 MÉøˆ %3yk„�VÆÑ}¦DZˆÔIf ƒ9KjGj�qÄp¤ž8¦xJ)ÜLÎéAuv¢"~‚Ìyn(õ¼˜±#{àÅe*P„*O™¢ “4~ôX¾Ûk¡¡ „Z°©úËõ`ÌñâµÆ+h°jS‹B?P`8š ¨,ÌfAãíÿ�³Ld(AªfcÄrcT°H‹4,¹¶š $Æè§²O$÷¬IþúŸ½(’Ðf”cjÙ ÌLö•IcÌÏj(™b4¿Hš�«�!®Ý€¢† Ѭ[L‰‡5‘I6„hP#fVw )¾ÈËS©§bÛˆ˜óYeP(|ˆ° @à°ÄLDÓ\|zïYçQJä&ÁPƒD±fïÚ­j×£h’¾öæ²HvvqäÖoª'ŠŠQm D‚9èa#q +*;¢‘zÚñ4Ŧp ½Â9'B椑!w«{رPÌI�ûè³[µl„¶¡GÍ"!täI<ŽT$ßšY>¨hÐð|Ó lŒ‹F¤T€{¢æ(Äv×4 ùTQúž|Q •¡KH§Âylém¸Uw$‰¨¦"G¿4©îd€vEL¹ C1Ôÿ�H¦€‹€2;‘ÞY $É=«¶â3Yø4Àçp€£»V”M•´'UDýkYR#‰¢ŠB@X±ã˜§®X"A™8¦$ërBÁ¨©“ K„ö¥Ð¸dŒˆÖ©Þ1`Nˆ¢ÙpË›ŽMTDL‹î~)‚©oÏŠ%²%ýFQ"™-¢Ã³³ß<šŠÐP Ä\ˆŽ(žÃ@E/¦z––g[}ãST´¨€ùËÀª€ª-¡ˆÉŒ–¥ïpª¸Dìš* ¨„‡$÷¢EÁ‘V¶$~ê7U ›`Ð {ÐU-yZàTê»§ÔkŠ :ÔƒD!7@`5²{~(1`v¿ØÖ²0±™úݤ}«Næ[®åͰP‹b"7"¢Œ¾1—�Ð ˆ²rf�V ®ÀÁ$O€œîo~ÕP¨e½5'€HÝîq§��ñTf÷ËÚ †õþ±’ÈXE–g˜ ¨U27è?½‚)÷7ö¦fôWõ]Û‰?ù¬«mos9ùŸÅ� ‹hb$ÈïCÙYQÝ‹ÖÐG‰ –-3€]îÉ:ŠsRH;Õ½ìX¨f$€}ôY­Ú¶B[P£æ‘ºr$žGª NïÍ,ŸT4hx>iƒ…¶FE£R*@=Ñsb;kš|‹*(ýO>(„ÊáP¥€ˆ$S„ ‚a<¶t„6‚Ü*»’DÔS £ßšT÷²@;"¦\!˜ê¤S@EÀÈï@ˆG¬�’džÕÛq¬ü`s¸@@ÑÝ«J&ÊÚƪ¢~µ¬ƒ)ÄÑE! ,XñÌS‚×, ̉Su¹!`ÔTÉ…%‡B{Rè\2FDkTï°'DQ ‰l¸eÍÇ&ª ¢&EŽw?ŒÁT·çÅÙþ£(L–ÑaÙÙ‚ïžME!G*@u&cŠe·mT,HÉæ€~(EÅ9#Q@ fëlŸµ=ËÊ! …Ȭ¶ò-î#(š2¨!Ió@¶Ý ÂV0 Áý­n` 9ÆÀÉÐ ™ºÑ¢� [—{KHâ¨ýBÎôOŠKކâ[µp+³�Ì[`WEë-›ŽY- H’[ïÞªb¡‚ÌDI;&¤Q˜ÀEQäŠ(Äté’º“î9ôàqãɨ C*•WsÄÒª"�c7™,DÁ Ì¶Üì@ù¦Æ@rÅLh ¦@] LQ‘X‚÷îdP’É,<ÿ�ȱP ÐøB&æ Z õP& ˜<ÓûÜcÅ1#Sßâ¤?SÙ$ÀÞµTlf4cÍ'Ð…TnH rŦ8ì)D ÔsF%x"Gsº�ðèqàÀì�©Â— žcš¦Á5Í*¶�³0#tåÄr?Šbà3*¸ÍJÒÿ�˜k÷ ð©n€Ú'æŸÐ{BÒÝ%²Þ*œ}ê FGÀâœ6"ñ €Hó½Ö�¡,@-ò8¨¦FÈ<R›ym V0“3Û° C\’D[‰ È2PÊí5º{ÂÏQ饦¼ä{À×4¾­—ê­®#„"j¿á9‹w.-¶g¸Æ r<î´Ê¹t×z«—º«KmBª0ŸãïHöå‹úAŸl=v¯N.Y¸—,—%¢cÛ\­w¦==¤Vf¸ šËHr¤Q2f8¦[vÕBÄÌžhâ€$Y S‘"5�¦n¶À1ÉûSܼ¢QÜŠËo"Þâ2‰£*‚‘4 mÐÜ!c ЬÚÙæ�£œl�<˜Ý�™›­ ¹y´¹Ž êÔ!\ïDø¤¸èn%»W»0 Ŷt^±rÙ¸áÕ’ÐÔ‰%¾ýê &*,ÄD“²jEŒUH¢ŒGN™+©>ãïN<šŠ2©UpX÷<M*¢ 3y’ÄL À[mÎÄšld,TÆ€ êdÒÈÕiˆ/q¾æE !Œ’ÃÈñLQK�@„ R`þiÑÂ�E¢Q¥b`yƒÍ?½À&<Pã5=þ*Cõ=’L ëUFÆcF<Ò}UA†äŠÈ‚X¹Ðâ™U÷¬Ç�qSÄþ¡Æw—z.$ÌDŠ ;æ üTÐ  d|v YäXA'½asAX�y4Á LšÖ¹~òô¶!È|SÞP–YËûTdAø®Ïð«>—Kê”&õïv^*¡¬†ôÝ=„F´­se‹{ˆûÒ]éìtß­îeµ-胯üWeç·ÓÚqÎMû@šæ¿~Ût—{‚ ŠÑÔu-«ÑÒ³µÍqmÛàAä×jõXÚÀ&O„5È@W Úy ÂÕÁp*ʾ;šhrI =èC!ÉýÇ9•æg(Çš ÒÞÐ3X:4™Ÿš6P ³cŠÒË h46ÕPº1:Á¦H�d{ ED†nÇÁ¢H˜ù¨¬å‚Ù:óX¸E‘; P®n-Ç� “Oƒ‘îÖZxª…úB¨2Õ‘1�·#°ÿ�µ>H’¨ÒÝÏ1HÓýŽê(3b]î0…H¤é:TêɽԶ(L­¿#É¥¼¢ëZéÆÃ¹ÈÏaÍ{im-ZKP›m?¶«.uèºc­€ʯïRK¾‡T-[¶nÜpX3 éký-¶9\xñ ½C¿SnèDÁS�³Ú£Nr—Q¦ê(ù~(`K ¸š·UuQv¯Ü)©aseTžIæƒ2)e§ø+éþaº{$•W>à§;U ••Âߎi€+ðPÊý꣰t=´ :{p8öƒULÚÖ²Z*kÕ$MÅyð Nç_qÕÒÊâ&�^MF—¿y:Nšå¶½“±¦¼äŘ0P£ˆÇtUBuÎH=šY’wÏzˆÌˆ%‹)•PzÌp<Aêgyw¢âLÉÔ@øª(wñS@0‘ñÚd ‘aLžô…Í`äÐ-2jwZåûËÒØ@‡ qñOyBYg/íQ‘â»?¬ú]/ªP›×½Ùxª†±þÓtöҵ͖-î#ïIw§±Ó~·¹–Ô·¢¿ñ]—žßOh=Ç97íkšýûmÒ\\}î,j*wGQÔ¶¬[D?JÎÔW5Å·lJ“]«Õck�™>X×!\\'jt9æƒ WÀ\«*øîi¡É$€ ÷¡ ‡'÷ä W™œ Ohl/K{@Í`èÒd~h`Ù@2ÌyŽ)ÿ�K,- ÐÛUBèÄè˜} ‘ì)»‰ c梳–gdëÍbáDHì)B¹¸·�‚@M>G»Yh âª-剃<ÖÂæ^ëe{ŒZgñMmË-ÇHUŸ'¼Pfh ÔPÐÄÚõ#Œ´9õg¶ª; Ù'G½H€’ÀÆØŠ¨Ïe]Š»–V½.’_¥¶%Dk…¹ŸT°ó¨ o�€bÇúvh:úÛ`² º¯cûMs\`Ph99ù¤ ~á•°@=ØÇö A[%ÛǸ:ž*)½÷>cE© lFÜÉâ™ÉÍH2æ'À4æ§l—£<¹:+^%m9Æ·LätöU@÷üš”QI™ ŒJ)Ðù »Û ƒÁÚr?Š»=ÛÖú{.© ’Þ?[ ô–ÔÞpÀ˜9©-Æ7’ÏMmn:ÉbÜ]·.Û»ÕYÚ!‚wUã¶ ÉËƒÍ <˜åÿ�ÇÅ]ÑÜzçFÚ¤î*€2'B¢²«2cnÒö˜¬RÞ‹9b7£ýâ…²}Ïí÷HŸ™=ósxðsó@m*-ëW[;“æ½1 ú¬à~ªòðp¡Äò *ûΉòhã¼îX悳¸75,÷4‹$‰âx5FЊˆ¶¤“ÃËPg11ø4 ±ˆ1Þ‹LSöª€ˆ.ÀÉ:í ™> Pˤvu9"t4OdÛ|Ä‹iíÙí®õ†,èHçâŠ"˜Ù=Ϫ1K¶Ö2R{οŠXuö2OôäÄž>k)!8‚wÄTPd yb`Ï5°¹—ºÙ^ã™üS[rËqÒggÉïšÈ4�[CkÔŽ2ÐçÔvžÚ¨ì+dLõ FKb*£=•v*îYXD ôºI~–Ú@•A®æ}RÃ΢¼�V‹éÙ ëëm‚È‚èb½í5Íq€U@} äçæ5û†VÁ�÷cÚl—lKàêx¨¦÷Üú@U¦@-±r7'Šg$h?5 ˘Ÿ�ÐSš²\zŒòäèx­x•´äsÝ3‘ÓÙUÜòhQDe&vf‚1(H§Cæ‚ïl6SiÈ@8þ("ì÷o[é캤‚KxüUnƒÒ[SyÃ`椷ÞK=5µ¸ë%‹pvÜh»nïUd h„B ÝTsŒZØ+'.40Lòc—ÿ�wGqëœj“¸¨�È Š,énØ·°[©«—æ>ÂªŠŠ¹bÞuAžà¶¡@‰&;P"©ô˜1P@ˆð*‰"I<®¢—Ó,CL~ŸšGéÿ�ÌuInããk¡ÜÕF·ƒ Ž-±ÁªS)wü §êzfé¬ÚµÓZv ?Wæ¤Èöî0¸XÜb¢š}ØhäI¥KVñ¬ÁГ³6> dOšƒlË@#š�Ku Ëh€?{öHDH #šÀŸE@*K 11A…»s¶ ÄêˆÀËæY  v, �V�‡m–ÁPó ÉÇäö®fêl(—Û]»*“?o£\[}:é PÌ;ë-€ª¶­°KK¨A Ô?á‡;—®eFŒIÖ€¯ImäRAPǽrÝ«CñI~àéÖÊçý5p«Y³eíàK‚}Ìg½@ v Ó•BÊ$åªwöª!| ¬¤eÇÔ r1ã½ óŽÜS¤¢›…1v³3ª(* ‰ #±=èåÁb'KS�IrÎNɱ‚K¸yø T—n�ÞŒÖfU"u:¬�~(¢ ½[HÒ/šRI2I3â²17)’ÚŠÀb§Oo­Œ`L±ç½{€(µi3¸tk J‡+ä;!Ò´áÑqžýÍ*!yÙ€LÕBÉ+�…cÇÚŸ#&Êc*& РÀ±¸ÅGQ@ÚBÀ‚û'¸¬Qša¤0ˆ=«I6t&¶d‘ ÆäЍ,énØ·°[©«—æ>ÂªŠŠ¹bÞuAžà¶¡@‰&;TR*ŸIƒ¨’$“Êê)}2Ä1dÇáyù¤~ŸüÇT–î>6±:ÍTkx0¸âÐ`¨õ2—|; ~§¦nšÍ«]5§`Óõp>jLnã …À&*)§ÝˆöŽDšTµošÌ 0+0#cêDù H6Ì´9 ·P̶ˆ÷¿aT„@D€ ’9¬ ôT x°Ó[·;b�ÜN¨Œ ¾e˜÷ñJbÊ`vÐlU2 œ~Ojæn¦Áb‰qµÛ²©3ñ1Fú5Å·Ó®• ðñ^²Ø «jÛ´º„ÍAÃþs¹zàFThÄh ô–ÞE$ {Ñ -Ú´?—î`®q?ÓQ§ µ›6^Þ¸'ÜÆ{Ôb ÐÙÝ9T, òNZ§qoj¢ÀªÊX»éÖ¹–Ý`·mæå­É×< v!m®+�;ÔzŒmÙw$·üÔUX’˜È˜ÜR[{ª iµ¶.9“Z:‹ªnž‘aŒ‰p¦+§¡±q÷¹Ü#KûG‰ªŠdëxº^=EИTñ\îÖÞ×®¯qîð̇šõz{NÁ˜ÀÅxaÿ�Ú¼ÁuÖze6Ŷ’qÖ¦¢¥é ÇrO�›À*Ûq͹“le5Å�\ÙÇÕ(UQ�ƒuÜë|QƒÞµÄK\r} óAƒ(8éî°½¾ô3,˜Êg[ª;„¶GÞ‘W�äÓ‘Ž8º €=È=ªÖ:¯M$ “ÆÏGPÁî)vÜ(â›@sÜÍŸ¬ºW °SûGšæ$“=·C1ëÔ$÷Ûfi_—ñUŠM²àmާŠV¦Dÿ�Óºgp-¬dDkÒ5Ì' Aíê(=чý±TqéY�$Ö·mî÷ÕØ3ê å Ï ÄóU ‰ŠfvÀ"”qðS¯ÜÞ*`›ìBŽÝ?…‡»ÔOy­ZP=¨cŸ&‚ªg3ˆîh¹« æLE ¶ÅŽ­,•»s‘1âkYó æN¾(6*<˜¬ 7±X sOšÚÛ>É“É'“A-’œ ’EIv oæ+ DóLÌbkâ7S 3¦LA“QL°WÚitÏ„äØö¦! >aI˜ƒÚƒ*ÙéÊ›–=ÍT5¨[ ¡?÷ K’�“ð(Œ[ÙÃf{ŠP™)9·ÜÏ?jŠ»éÖ¹–Ý`·mæå­É×< v!m®+�;ÔzŒmÙw$·üÐU‰)Œ‰Å%°÷º –˜Û[`ã™5£¨º¦ééÈ— bºz_{‘Â4¿´xš¨¦N·‹¥ãÔ] €õOÎímízê÷ï Àhy¯W§´ìŒ W†ý«Ì]g¦Sl[i'jj*^ Üw$ð�ì)°|­°GÐk™0ÆPc\P�…Íœ}Q€…Uðh0']ηÅØ=ë\@TµÇ GÒ42ƒŽžá; ÛïAÃ2ÉŒ¦uº£±HKaTxéqM9àP‹ È܃ڭcªôÒJ <lñQTu â—mÂŽ)°D=ÌÐYúË¥pË?´y®bI3Ût3°]HOqA-¶f•ùPè¤Û.Øêx¥i dOý;¦wÚÆDF¹Ý#\ÂrÑÞ¢™¶ð�íÞ¡Ô¨{Jè81ç{®„'…Ùþk*CNF š¨ô‚‹¬Î¾Ûc‚Üš£„A$•FÔ÷5À½Uà°ªF‡Š•ë¯pÎXž7ÅHµÓÔõÃf׶ߟÝ\6Ðvã‚Kq>)íà¶A ÃÉmîƒ>¶™þõP f� ú{Ñ(¸É^ò>ôÃPHÊ>)L´â<ø¨¥À9Õ²XžAYíÛE_VåÂIúTóT̘ÅŽbiQQ=Øï·z¨æ|,î¨ò2P¤Š*¨P\dR[ÊöûÑy$Nñ⢂(Y$“q»v•ˆE-?Þ¶6Ën\8šÆÒ}^³¦wºoômÉc“ ŒÑ´ŠÜ{y1<·ŠM;’¤°_Š¡KŽL¬5½P¯qÐâ`ö¥°5_Ô?¸™¤[=KtÉt2æäâ„D ¬¡Eç²H/É�HïUIpI9æh,úsÚháí€ÐO$ Fd´Œå‚¨å›‘iBÁKez›½C„)l/´’'~)S©|¥Ó^aÌâ?ä×_Afå»n€¬î^'.õåæQqÚ%—\Tî„Ôÿ�2nÜ{�8ûWu¬¯�2B†|Wu�t"ÊÛS÷w¨©1ITªD F§æ³bÙ'˜S†Ú c1.fƒx&w1@'´–O`)‹Æ‚’#°¢$dý¢ªij�Oon襋EŒ‚�ùÙ¥´F;$’IŸÍ1_vY“<ÍE8d™ÀGoµ#31>Õ¸ãuŽ=þO4¶ð�íÞ¡Ô¨{Jè81ç{®„'…Ùþk*CNF š¨ô‚‹¬Î¾Ûc‚Üš£„A$•FÔ÷5À½Uà°ªF‡Š•ë¯pÎXž7ÅHµÓÔõÃf׶ߟÝ\6Ðvã‚Kq>)íà¶A ÃÉmîƒ>¶™þõP f� ú{Ñ(¸É^ò>ôÃPHÊ>)L´â<ø¨¥À9Õ²XžAYíÛE_VåÂIúTóT̘ÅŽbiQQ=Øï·z¨æ|,î¨ò2P¤Š*¨P\dR[ÊöûÑy$Nñ⢂(Y$“q»v•ˆE-?Þ¶6Ën\8šÆÒ}^³¦wºoômÉc“ ŒÑ´ŠÜ{y1<·ŠM;’¤°_Š¡KŽL¬5½P¯qÐâ`ö¥°5_Ô?¸™¤[=KtÉt2æäâ„D ¬¡Eç²H/É�HïUP…Ü÷¥w-¨“P!QCƒºÊ¢²µÌf3Tÿ�“@ÊŽë‘!Wÿ�wH#d+]c¡@|Õ\¡ !Gj[èâ‡SÀïA’Ù�©'#ãµDÙ~ÜP/€(¼ óÉ¥ôÜúŒH;ÐPÈAŽFÍ`Z vyjpél€ž|Ð’Nê)I¹væ6öcm:Z`B«±&Zy¬€¸t/µì?wæ‹Yic &cUq?¨µ<� )mÛ‹¢ã6À «ªå1Qd%N4gL)À–c‘h¥u gžP¸:~³©2xdñF×A{¨Qwª|Wœ$Àÿ�½5‹g¨ÿ�E3éôè ž í^ª#»F•&Y›ÅZGôVí'é]¸4:ì *õØnžÕ’×Ã7s&»’ý•Ì-ÀÄ+›§{Vo]{¿¨÷"cŠƒ z‡ÜtjFÚ¿UÒÛ>à\öÿ�EtõoníÑsÓE�§Z©‚ìÏé®*?UGªÈálb¿õRºª.w :Ë÷W%¾²ôD&‡1Q{—z‹Ì ã÷MHµÑw¨wµn8^Z¹æè lóâ)ñ–$ûˆÔÏ5‚¢œˆ“þÔ âZ|S¯?ÿ�4€!-+ÉíªV¤Ä( \Ãĉæ„1Y% wâi•-ú›A€‘³LU]¶ax� XÒ-¡ãã½+–r}6UOêj£º äö�R Viº¾a*¢JÂݲ×OrP%Å Yై‰5@팪b;H@2\" ö e�(PHÏzWp"Ú‰1ÅÕt8; ,ª++\Æc5Où4 ¨î¹÷t‚6BµÖ:4ÍUÊrv¥·þŽ(qU<ô- ’r>;Q„M‘'íÅø‹Àß<š_IÝϨÁ‰½õ ”älÖ §g–§–Ì(‰çÍ $›—ncof6Ó¥¦�„*»e§šÈ ‡BøÛ^Ã÷~h¹‘P:f5Qqú‰×ûSÀ�ÁØ–ݸº.3l º®QBTásFtœ f9ŠWP–yàE�kƒ§é :“'€&Omtº…z§ÅyÂLûÓX¶zñS>ŸN€™àžÕê¢;´iRe™¼U¤q/EnÒ~•Ûƒ@ƒ¡®ÀÒ¯Q†éíY-qL3q÷2k¹/Ù\ÂÜ A⹺wµfõ×»úqò&8¨9¤3,HÏâ²”ÁRäÑgÌ,4ÁUWP\÷ P@B2b`˜¬¨KF_oÿ�imŸP³/кüÕ†#góA°USX÷<ÐEs9'lR3’Ø) ?{xÈ€ªmƧE¨6#7XZ.ñÿ�V«Ç÷@ø€©`'#¿jn€£jiäÅ:&�µÈ,Ü/Š’@~àшPÄ-»däO4°öžü4Éh#z—}ÍûAàRÜcé ÜÔVP™$±¬@Ä’GŽiÒÜ ˆXüŸµMšÐ0VGe‰ §Gí¼íŽî€gä+Òu bãÜ00öÍy–ДËÒkpu'cñE܈n³ ˆ=¦‚v‘ͼdmÏ'íM‚Ì–2<Ó\!-„š_NB+¹ ïâª&–’àä/e¬ä'`+’&5°Êf"¢” *TòÝé€[i‚‚;±=éCûHTãs©7qbX[>æË€<�8fŲI“&g·j ¸¬GÚŽ0YV  ±üÐ U�€´P{¨ª2aæ±¶ 2y ÿ�5T[]?‚ÞL LÝì†3Åõ$Å�æîrú¨ ã; j95PñÐP�X2ìÁÖÿ�š¢ZœÜ3qÈÐ'ŠPÒ°ÛiÔR/¾{�{@Ы@HÐ�€9¡l*— ³@©¢Tæ€ÈfX ŸÅ!e)‚¤É¢2ϘXþi‚ª® ¹ï@ €„*dÄÁ1YP–Œ0,¾ßþÒÛ>¡f_¡uùª$# FÏæƒ`ª¦ ±îy ŠærN>ؤg%°R~öð)‘U 2ÛN‹PlG n°´2,]ãþ­V!îð)RÀ.NG~Ô ÝG:ÕÓÉŠtLkY¸_$€ýÁ£*¡ˆ[vÉÈ$žh aí=ùi’ÐFõ.û›öƒÀ¥¸ÇÓ @'¹¨¬ 02IcX‰$Ó¥¸@ ±ù?j›5 `¬ŽËANÛyÛÝ�ÏÈW¤êÅǸ`aíšó-¡)—¤ÖàêNÇ⋹!Ýf{Mí#›xÈÛžOÚ› ™,dy¦¸B[9?4¾œ„WrAÞ#ÅTÿÙ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/editable_cells.rb����������������������������������������0000644�0001750�0001750�00000010226�11701304107�021716� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: editable_cells.rb,v 1.7 2005/02/06 18:25:13 kzys Exp $ =begin = Tree View/Editable Cells This demo demonstrates the use of editable cells in a Gtk::TreeView. If you're new to the Gtk::TreeView widgets and associates, look into the Gtk::ListStore example first. =end require 'common' module Demo class EditableCells < BasicWindow Item = Struct.new('Item', :number, :product, :editable) COLUMN_NUMBER, COLUMN_PRODUCT, COLUMN_EDITABLE, NUM_COLUMNS = *(0..4).to_a def initialize super('Shopping list') self.border_width = 5 vbox = Gtk::VBox.new(false, 5) add(vbox) vbox.pack_start(Gtk::Label.new('Shopping list (you can edit the cells!)'), false, false, 0) sw = Gtk::ScrolledWindow.new sw.shadow_type = Gtk::SHADOW_ETCHED_IN sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) vbox.pack_start(sw, true, true, 0) # create model model = create_model # create tree view treeview = Gtk::TreeView.new(model) treeview.rules_hint = true treeview.selection.mode = Gtk::SELECTION_SINGLE add_columns(treeview) sw.add(treeview) # some buttons hbox = Gtk::HBox.new(true, 4) vbox.pack_start(hbox, false, false, 0) button = Gtk::Button.new('Add item') button.signal_connect('clicked') do add_item(model) end hbox.pack_start(button, true, true, 0) button = Gtk::Button.new('Remove item') button.signal_connect('clicked') do remove_item(treeview) end hbox.pack_start(button, true, true, 0) set_default_size(320, 200) end def create_model # create array @articles = [] add_items # create list store model = Gtk::ListStore.new(Integer, String, TrueClass) # add items @articles.each do |article| iter = model.append article.each_with_index do |value, index| iter.set_value(index, value) end end return model end def add_items item = Item.new(3, 'bottles of coke', true) @articles.push(item) item = Item.new(5, 'packages of noodles', true) @articles.push(item) item = Item.new(2, 'packages of chocolate chip cookies', true) @articles.push(item) item = Item.new(1, 'can vanilla ice cream', true) @articles.push(item) item = Item.new(6, 'eggs', true) @articles.push(item) end def add_columns(treeview) model = treeview.model # number column renderer = Gtk::CellRendererText.new renderer.signal_connect('edited') do |*args| cell_edited(*args.push(model)) end treeview.insert_column(-1, 'Number', renderer, { :text => COLUMN_NUMBER, :editable => COLUMN_EDITABLE, }) def renderer.column COLUMN_NUMBER end # product column renderer = Gtk::CellRendererText.new renderer.signal_connect('edited') do |*args| cell_edited(*args.push(model)) end def renderer.column COLUMN_PRODUCT end treeview.insert_column(-1, 'Product', renderer, { :text => COLUMN_PRODUCT, :editable => COLUMN_EDITABLE, }) end def cell_edited(cell, path_string, new_text, model) path = Gtk::TreePath.new(path_string) column = cell.column iter = model.get_iter(path) case column when COLUMN_NUMBER i = iter.path.indices[0] @articles[i].number = new_text.to_i iter.set_value(column, @articles[i].number) when COLUMN_PRODUCT i = iter.path.indices[0] @articles[i].product = new_text iter.set_value(column, @articles[i].product) end end def add_item(model) foo = Item.new(0, 'Description here', true) @articles.concat([foo]) iter = model.append foo.each_with_index do |value, index| iter.set_value(index, value) end end def remove_item(treeview) model = treeview.model selection = treeview.selection if iter = selection.selected @articles.delete_at(iter.path.indices[0]) model.remove(iter) end end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/main.rb��������������������������������������������������0000755�0001750�0001750�00000023333�12257552167�017737� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/env ruby =begin main.rb - Main class of gtk-demo. Copyright (c) 2003-2013 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: main.rb,v 1.20 2007/07/09 13:21:54 ggc Exp $ =end require 'gtk2' $:.unshift(File.dirname(__FILE__)) module Demo class Main < Gtk::Window TITLE_COLUMN, FILENAME_COLUMN, CLASS_COLUMN, ITALIC_COLUMN = 0, 1, 2, 3 def initialize super() @current_file = nil @info_buffer = Gtk::TextBuffer.new @source_buffer = Gtk::TextBuffer.new set_title('Ruby/GTK+ Code Demos') signal_connect('destroy') do Gtk.main_quit end signal_connect("key_press_event") do |widget, event| if event.state.control_mask? and event.keyval == Gdk::Keyval::GDK_q destroy true else false end end hbox = Gtk::HBox.new add(hbox) tree = create_tree scrolled_window = Gtk::ScrolledWindow.new scrolled_window.add(tree) hbox.pack_start(scrolled_window, false, false, 0) notebook = Gtk::Notebook.new hbox.pack_start(notebook, true, true, 0) notebook.append_page(create_text(@info_buffer, false), Gtk::Label.new('_Info', true)) notebook.append_page(create_text(@source_buffer, true), Gtk::Label.new('_Source', true)) @info_buffer.create_tag('title', {'font' => 'Sans 18'}) @source_buffer.create_tag('comment', {'foreground' => 'red'}) @source_buffer.create_tag('const', {'foreground' => 'ForestGreen'}) @source_buffer.create_tag('string', { 'foreground' => 'RosyBrown', 'weight' => Pango::FontDescription::WEIGHT_BOLD }) @source_buffer.create_tag('reserved', {'foreground' => 'purple'}) end def script_info(path) title = nil klass = nil depend = nil file = File.open(path) file.each do |ln| if not title and ln =~ /^=\s+(.*)$/ title = $1 if title =~ /^(.*)\((.+?)\)$/ title = $1 depend = $2 end elsif not klass and ln =~ /\s*class\s+([A-Z][A-Za-z0-9_]*)/ klass = $1 end if title and klass break end end if not klass raise "File not found: #{path}." end return title, klass.intern, depend end def generate_index base_dir = File.dirname(__FILE__) # Target scripts scripts = Dir.glob(File.join(base_dir, '*.rb')) # Generate index tree children = {} index = [] not_script_base_names = %w(common.rb main.rb) scripts.each do |fn| base_name = File.basename(fn) next if not_script_base_names.include?(base_name) title, klass, depend = script_info(fn) if depend and not Gtk.const_defined?(depend) next end if title =~ %r{^(.+?)/(.+)$} parent = $1 child = $2 unless children[parent] children[parent] = [] index += [[parent, nil, nil, []]] end children[parent] += [[child, fn, klass]] else index += [[title, fn, klass]] end end # Sort children children.each_key do |parent| children[parent].sort! do |a, b| a[0] <=> b[0] end end # Expand children index.collect! do |row| if row[3] row[3] = children[row[0]] end row end index.sort! do |a, b| a[0] <=> b[0] end index end def create_tree model = Gtk::TreeStore.new(String, String, String, TrueClass) tree_view = Gtk::TreeView.new tree_view.set_model(model) selection = tree_view.selection selection.set_mode(Gtk::SELECTION_BROWSE) tree_view.set_size_request(200, -1) append_children(model, generate_index) cell = Gtk::CellRendererText.new cell.style = Pango::FontDescription::STYLE_ITALIC column = Gtk::TreeViewColumn.new("Widget (double click for demo)", cell, { 'text' => TITLE_COLUMN, 'style_set' => ITALIC_COLUMN, }) tree_view.append_column(column) selection.signal_connect('changed') do |selection| iter = selection.selected load_file(iter.get_value(FILENAME_COLUMN)) if iter end tree_view.signal_connect('row_activated') do |tree_view, path, column| row_activated_cb(tree_view.model, path) end tree_view.expand_all return tree_view end def append_children(model, source, parent = nil) source.each do |title, filename, klass, children| iter = model.append(parent) [title, filename, klass].each_with_index do |value, i| if value iter.set_value(i, value) end end iter.set_value(ITALIC_COLUMN, false) if children append_children(model, children, iter) end end end def row_activated_cb(model, path) iter = model.get_iter(path) iter.set_value(ITALIC_COLUMN, true) lib = iter.get_value(FILENAME_COLUMN) if lib require(lib) klass = Demo.const_get(iter.get_value(CLASS_COLUMN)) window = klass.new window.signal_connect('destroy') do iter.set_value(ITALIC_COLUMN, false) end window.show_all @window = window end end def create_text(buffer, is_source) scrolled_window = Gtk::ScrolledWindow.new scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) scrolled_window.set_shadow_type(Gtk::SHADOW_IN) text_view = Gtk::TextView.new text_view.set_buffer(buffer) text_view.set_editable(false) text_view.set_cursor_visible(false) scrolled_window.add(text_view) if is_source font_desc = Pango::FontDescription.new('Monospace 12') text_view.modify_font(font_desc) text_view.set_wrap_mode(Gtk::TextTag::WRAP_NONE) else text_view.set_wrap_mode(Gtk::TextTag::WRAP_WORD) text_view.set_pixels_above_lines(2) text_view.set_pixels_below_lines(2) end return scrolled_window end def fontify(start_iter = @source_buffer.start_iter, end_iter = @source_buffer.end_iter) str = @source_buffer.get_text(start_iter, end_iter, true) tokenizer = RubyTokonizer.new tokenizer.tokenize(str, start_iter.offset) do |tag, start, last| @source_buffer.apply_tag(tag.to_s, @source_buffer.get_iter_at_offset(start), @source_buffer.get_iter_at_offset(last)) end end def load_file(filename) if filename == @current_file return end @info_buffer.delete(*@info_buffer.bounds) @source_buffer.delete(*@source_buffer.bounds) file = begin File.open(filename) rescue $stderr.puts "Cannot open: #{$!}" if $DEBUG return end start = @info_buffer.get_iter_at_offset(0) state = :before_header file.each do |line| case state when :before_header if line =~ /^=begin$/ state = :in_header end when :in_header if line =~ /^=end$/ state = :body start = @source_buffer.get_iter_at_offset(0) elsif line =~ /^=\s+(.*)$/ title = $1 title.gsub!(/\s*\(.*\)$/, '') # Delete depend field last = start @info_buffer.insert(last, title) start = last.clone start.backward_chars(title.length) @info_buffer.apply_tag('title', start, last) start = last else @info_buffer.insert(start, line) end when :body # Reading program body @source_buffer.insert(start, line) end end fontify @current_file = filename end end class RubyTokonizer RESERVED_WORDS = %w(begin end module class def if then else while unless do case when require yield) RESERVED_WORDS_PATTERN = Regexp.compile(/(^|\s+)(#{RESERVED_WORDS.collect do |pat| Regexp.quote(pat) end.join('|')})(\s+|$)/) def tokenize(str, index = 0) until str.empty? tag = nil case str when /".+?"/, /'.+?'/ tag = :string when /#.*$/ tag = :comment when RESERVED_WORDS_PATTERN tag = :reserved when /[A-Z][A-Za-z0-9_]+/ tag = :const end if tag tokenize($~.pre_match, index) do |*args| yield(*args) end yield(tag, index + $~.begin(0), index + $~.end(0)) index += (str.length - $~.post_match.length) str = $~.post_match else index += str.length str = '' end end end end end target = ARGV.shift if target Demo::INDEX.each do |title, filename, klass_symbol, children| if target == filename or target == klass_symbol.id2name require filename window = Demo.const_get(klass_symbol).new window.show_all class << window def quit Gtk.main_quit end end break end end else main = Demo::Main.new main.set_default_size(600, 400) main.show_all end Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/iconview.rb����������������������������������������������0000644�0001750�0001750�00000006511�11701304107�020610� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: iconview.rb,v 1.7 2007/08/05 15:41:31 mutoh Exp $ =begin = Icon View (IconView) The Gtk::IconView widget is used to display and manipulate icons. It uses a Gtk::TreeModel for data storage, so the list store example might be helpful. =end $KCODE="u" require 'common' module Demo class IconView < Demo::BasicWindow COL_PATH, COL_DISPLAY_NAME, COL_IS_DIR, COL_PIXBUF = (0..3).to_a def fill_store @store.clear Dir.glob(File.join(@parent, "*")).each do |path| is_dir = FileTest.directory?(path) iter = @store.append # set COL_DISPLAY_NAME first because changing an iter will trigger the # sort function; if we set something else first, the value of # COL_DISPLAY_NAME for this row will be "nil" and the sort function will fail puts path #puts GLib.convert(GLib.filename_to_utf8(path), "Shift_JIS", "UTF-8") #puts File.basename(GLib.convert(GLib.filename_to_utf8(path), "Shift_JIS", "UTF-8")) # iter[COL_DISPLAY_NAME] = File.basename(GLib.filename_to_utf8(path)) iter[COL_DISPLAY_NAME] = GLib.filename_to_utf8(path) iter[COL_PATH] = path iter[COL_IS_DIR] = is_dir iter[COL_PIXBUF] = is_dir ? @folder_pixbuf : @file_pixbuf end end def initialize super('Gtk::IconView demo') @file_pixbuf = Gdk::Pixbuf.new(Demo.find_file("gnome-fs-regular.png")) @folder_pixbuf = Gdk::Pixbuf.new(Demo.find_file("gnome-fs-directory.png")) @store = Gtk::ListStore.new(String, String, TrueClass, Gdk::Pixbuf) @parent = "/" @store.set_default_sort_func do |a, b| if !a[COL_IS_DIR] and b[COL_IS_DIR] 1 elsif a[COL_IS_DIR] and !b[COL_IS_DIR] -1 else a[COL_DISPLAY_NAME] <=> b[COL_DISPLAY_NAME] end end @store.set_sort_column_id(Gtk::TreeSortable::DEFAULT_SORT_COLUMN_ID, Gtk::SORT_ASCENDING) fill_store set_default_size(650, 400) set_border_width(8) vbox = Gtk::VBox.new(false, 0) add(vbox) toolbar = Gtk::Toolbar.new vbox.pack_start(toolbar, false, false, 0) up_button = Gtk::ToolButton.new(Gtk::Stock::GO_UP) up_button.important = true up_button.sensitive = false toolbar.insert(-1, up_button) up_button.signal_connect("clicked") do @parent = File.dirname(@parent) fill_store up_button.sensitive = @parent != "/" end home_button = Gtk::ToolButton.new(Gtk::Stock::HOME) home_button.important = true toolbar.insert(-1, home_button) home_button.signal_connect("clicked") do @parent = GLib.home_dir fill_store up_button.sensitive = true end sw = Gtk::ScrolledWindow.new sw.shadow_type = Gtk::SHADOW_ETCHED_IN sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) vbox.pack_start(sw, true, true, 0) iconview = Gtk::IconView.new(@store) iconview.selection_mode = Gtk::SELECTION_MULTIPLE iconview.text_column = COL_DISPLAY_NAME iconview.pixbuf_column = COL_PIXBUF iconview.signal_connect("item_activated") do |iview, path| iter = @store.get_iter(path) if iter[COL_DISPLAY_NAME] @parent = iter[COL_PATH] fill_store up_button.sensitive = true end end sw.add(iconview) iconview.grab_focus end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/stock_browser.rb�����������������������������������������0000644�0001750�0001750�00000013650�11701304107�021655� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: stock_browser.rb,v 1.5 2005/02/12 23:02:43 kzys Exp $ =begin = Stock Item and Icon Browser This source code for this demo doesn't demonstrate anything particularly useful in applications. The purpose of the 'demo' is just to provide a handy place to browse the available stock icons and stock items. =end require 'common' module Demo class StockBrowser < BasicWindow Item = Struct.new('Item', :stock_id, :label, :modifier, :keyval, :translation_domain) ItemInfo = Struct.new('ItemInfo', :id, :item, :small_icon, :const, :accel_str) ItemDisplay = Struct.new('ItemDisplay', :type_label, :const_label, :id_label, :label_accel_label, :icon_image) def initialize super('Stock Icons and Items') set_default_size(-1, 500) self.border_width = 8 hbox = Gtk::HBox.new(false, 8) add(hbox) sw = Gtk::ScrolledWindow.new sw.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC) hbox.pack_start(sw, false, false, 0) model = create_model treeview = Gtk::TreeView.new(model) sw.add(treeview) column = Gtk::TreeViewColumn.new column.title = 'Const' cell_renderer = Gtk::CellRendererPixbuf.new column.pack_start(cell_renderer, false) column.set_attributes(cell_renderer, "stock_id" => 1) cell_renderer = Gtk::CellRendererText.new column.pack_start(cell_renderer, true) column.set_cell_data_func(cell_renderer) do |column, cell, model, iter| cell.text = iter[0].const end treeview.append_column(column) cell_renderer = Gtk::CellRendererText.new treeview.insert_column(-1, 'Label', cell_renderer) do |col, cell, model, iter| info = iter[0] cell.text = info.item.label if info end cell_renderer = Gtk::CellRendererText.new treeview.insert_column(-1, 'Accel', cell_renderer) do |col, cell, model, iter| info = iter[0] cell.text = info.accel_str if info end cell_renderer = Gtk::CellRendererText.new treeview.insert_column(-1, 'ID', cell_renderer) do |col, cell, model, iter| info = iter[0] cell.text = info.id if info end align = Gtk::Alignment.new(0.5, 0.0, 0.0, 0.0) hbox.pack_end(align, false, false, 0) frame = Gtk::Frame.new('Selected Item') align.add(frame) vbox = Gtk::VBox.new(false, 8) vbox.border_width = 4 frame.add(vbox) display = ItemDisplay.new class << treeview @display = nil attr_accessor :display end treeview.display = display display.type_label = Gtk::Label.new display.const_label = Gtk::Label.new display.id_label = Gtk::Label.new display.label_accel_label = Gtk::Label.new display.icon_image = Gtk::Image.new # empty image vbox.pack_start(display.type_label, false, false, 0) vbox.pack_start(display.icon_image, false, false, 0) vbox.pack_start(display.label_accel_label, false, false, 0) vbox.pack_start(display.const_label, false, false, 0) vbox.pack_start(display.id_label, false, false, 0) selection = treeview.selection selection.mode = Gtk::SELECTION_SINGLE selection.signal_connect('changed') do |s| selection_changed(s) end end def create_model store = Gtk::ListStore.new(ItemInfo, String, String, String) list_ids = Gtk::Stock.ids list_ids.sort! do |a, b| a.to_s <=> b.to_s end list_ids.each do |stock_id| info = ItemInfo.new info.id = stock_id begin info.item = Item.new(*Gtk::Stock.lookup(stock_id)) rescue ArgumentError info.item = Item.new end # only show icons for stock IDs that have default icons icon_set = Gtk::IconFactory.lookup_default(info.id.to_s) if icon_set # See what sizes this stock icon really exists at sizes = icon_set.sizes # Use menu size if it exists, otherwise first size found size = sizes.find do |s| s == Gtk::IconSize::MENU end || sizes.first info.small_icon = render_icon(info.id, size, '') unless size == Gtk::IconSize::MENU # Make the result the proper size for our thumbnail w, h = Gtk::IconSize.lookup(size) scaled = info.small_icon.scale(w, h, Gdk::Pixbuf::INTERP_BILINEAR) info.small_icon = scaled end else info.small_icon = nil end if info.item.keyval info.accel_str = Gtk::Accelerator.to_name(info.item.keyval, info.item.modifier) else info.accel_str = '' end info.const = id_to_const(info.id) iter = store.append iter[0] = info iter[1] = info.id end return store end def selection_changed(selection) treeview = selection.tree_view display = treeview.display iter = selection.selected info = iter[0] display.type_label.label = if info.small_icon and info.item.label 'Icon and Item' elsif info.small_icon 'Icon Only' elsif info.item.label 'Item Only' else '???????' end display.const_label.label = info.const display.id_label.label = info.id if info.item.label str = "%s %s" % [info.item.label, info.accel_str] display.label_accel_label.set_text(str, true) else display.label_accel_label.set_text('') end if info.small_icon display.icon_image.set(info.id, get_largest_size(info.id)) else display.icon_image.pixbuf = nil end end def get_largest_size(symbol) set = Gtk::IconFactory.lookup_default(symbol.id2name) best_size = Gtk::IconSize::INVALID best_pixels = 0 sizes = set.sizes sizes.collect! do |i| width, height = Gtk::IconSize.lookup(i) [i, width * height] end return (sizes.max do |a, b| a[1] <=> b[1] end)[0] end def id_to_const(id) const = '' s = id.id2name if s =~ /^gtk-/ const += 'Gtk::Stock::' s[0,4] = '' end const += s.upcase.gsub(/-/, '_') const end end end ����������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/panes.rb�������������������������������������������������0000644�0001750�0001750�00000007506�11701304107�020100� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: panes.rb,v 1.5 2005/02/12 23:06:07 kzys Exp $ =begin = Paned Widgets The Gtk::HPaned and Gtk::VPaned Widgets divide their content area into two panes with a divider in between that the user can adjust. A separate child is placed into each pane. There are a number of options that can be set for each pane. This test contains both a horizontal (HPaned) and a vertical (VPaned) widget, and allows you to adjust the options for each side of each widget. =end require 'common' module Demo class Panes < BasicWindow def initialize super('Panes') self.border_width = 0 vbox = Gtk::VBox.new(false, 0) add(vbox) vpaned = Gtk::VPaned.new vbox.pack_start(vpaned, true, true, 0) vpaned.border_width = 5 hpaned = Gtk::HPaned.new vpaned.add1(hpaned) frame = Gtk::Frame.new frame.shadow_type = Gtk::SHADOW_IN frame.set_size_request(60, 60) hpaned.add1(frame) button = Gtk::Button.new('_Hi there', true) frame.add(button) frame = Gtk::Frame.new frame.shadow_type = Gtk::SHADOW_IN frame.set_size_request(80, 60) hpaned.add2(frame) frame = Gtk::Frame.new frame.shadow_type = Gtk::SHADOW_IN frame.set_size_request(60, 80) vpaned.add2(frame) # Now create toggle buttons to control sizing vbox.pack_start(create_pane_options(hpaned, 'Horizontal', 'Left', 'Right'), false, false, 0) vbox.pack_start(create_pane_options(vpaned, 'Vertical', 'Top', 'Bottom'), false, false, 0) end def create_pane_options(paned, frame_label, label1, label2) frame = Gtk::Frame.new(frame_label) frame.border_width = 4 table = Gtk::Table.new(3, 2, true) frame.add(table) label = Gtk::Label.new(label1) table.attach_defaults(label, 0, 1, 0, 1) check_button = Gtk::CheckButton.new('_Resize', true) table.attach_defaults(check_button, 0, 1, 1, 2) check_button.signal_connect('toggled') do toggle_resize(paned.child1) end check_button = Gtk::CheckButton.new('_Shrink', true) table.attach_defaults(check_button, 0, 1, 2, 3) check_button.active = true check_button.signal_connect('toggled') do toggle_shrink(paned.child1) end label = Gtk::Label.new(label2) table.attach_defaults(label, 1, 2, 0, 1) check_button = Gtk::CheckButton.new('_Resize') table.attach_defaults(check_button, 1, 2, 1, 2) check_button.active = true check_button.signal_connect('toggled') do toggle_resize(paned.child2) end check_button = Gtk::CheckButton.new('_Shrink') table.attach_defaults(check_button, 1, 2, 2, 3) check_button.active = true check_button.signal_connect('toggled') do toggle_shrink(paned.child2) end return frame end def toggle_resize(child) paned = child.parent is_child1 = (child == paned.child1) resize = if is_child1 paned.child1_resize? else paned.child2_resize? end shrink = if is_child1 paned.child1_shrink? else paned.child2_shrink? end child.parent.remove(child) if is_child1 paned.pack1(child, !resize, shrink) else paned.pack2(child, !resize, shrink) end end def toggle_shrink(child) paned = child.parent is_child1 = (child == paned.child1) resize = if is_child1 paned.child1_resize? else paned.child2_resize? end shrink = if is_child1 paned.child1_shrink? else paned.child2_shrink? end child.parent.remove(child) if is_child1 paned.pack1(child, resize, !shrink) else paned.pack2(child, resize, !shrink) end end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-long-lines.rb��������������������������������������0000644�0001750�0001750�00000001635�11701304107�022131� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-long-lines.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Long Lines This demo shows how to use GDK and cairo to show long lines. From http://cairographics.org/samples/xxx_long_liens.html. =end require 'common' module Demo class CairoLongLines < CairoWindow def initialize super('cairo long lines') end def draw(cr) cr.move_to(0.1, -50) cr.line_to(0.1, 50) cr.set_source_rgba(1, 0, 0) cr.stroke cr.move_to(0.2, -60) cr.line_to(0.2, 60) cr.set_source_rgba(1, 1, 0) cr.stroke cr.move_to(0.3, -70) cr.line_to(0.3, 70) cr.set_source_rgba(0, 1, 0) cr.stroke cr.move_to(0.4, -80) cr.line_to(0.4, 80) cr.set_source_rgba(0, 0, 1) cr.stroke end end end ���������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-pattern-fill.rb������������������������������������0000644�0001750�0001750�00000003705�11701304107�022463� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-pattern-fill.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Pattern Fill This demo shows how to use GDK and cairo to fill by pattern. From http://cairographics.org/samples/pattern_fill.html. =end require 'common' module Demo class CairoPatternFill < CairoWindow X_FUZZ = 0.08 Y_FUZZ = 0.08 X_INNER_RADIUS = 0.3 Y_INNER_RADIUS = 0.2 X_OUTER_RADIUS = 0.45 Y_OUTER_RADIUS = 0.35 SPIKES = 10 TEXT = "Ruby!" def initialize super('cairo pattern fill') end def draw(cr) srand(45) cr.set_line_width(0.01) x = y = nil 0.step(SPIKES * 2 - 1, 2) do |i| x = x_position(i, X_INNER_RADIUS) y = y_position(i, Y_INNER_RADIUS) if (i == 0) cr.move_to(x, y) else cr.line_to(x, y) end i += 1 x = x_position(i, X_OUTER_RADIUS) y = y_position(i, Y_OUTER_RADIUS) cr.line_to(x, y) end cr.close_path cr.stroke cr.select_font_face("Sans", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_BOLD) cr.move_to(x - 0.5, y) cr.set_font_size(0.1) cr.text_path(TEXT) cr.set_source_rgba(1, 0, 0.5) cr.fill cr.set_font_size(0.2) extents = cr.text_extents(TEXT) x = 0.5 - (extents.width / 2 + extents.x_bearing) y = 0.5 - (extents.height / 2 + extents.y_bearing) cr.move_to(x, y) cr.text_path(TEXT) cr.set_source_rgba(1, 0, 0) cr.stroke end def x_position(i, radius) 0.5 + Math.cos(Math::PI * i / SPIKES) * radius + rand * X_FUZZ end def y_position(i, radius) 0.5 + Math.sin(Math::PI * i / SPIKES) * radius + rand * Y_FUZZ end end end �����������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-clip-image.rb��������������������������������������0000644�0001750�0001750�00000002315�11701304107�022065� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-clip-image.rb,v 1.2 2005/10/16 12:07:32 mutoh Exp $ =begin = cairo/Clip Image This demo shows how to use GDK and cairo to use clip for image. From http://cairographics.org/samples/clip_image.html. =end require 'common' module Demo class CairoClipImage < CairoWindow def initialize super('cairo clip image') end def draw(cr) cr.save do cr.arc(0.5, 0.5, 0.4, 0, 2 * Math::PI) cr.clip cr.new_path loader = Gdk::PixbufLoader.new File.open("background.jpg", "rb") do |f| loader.last_write(f.read) end pixbuf = loader.pixbuf cr.scale(1.0 / pixbuf.width, 1.0 / pixbuf.height) cr.set_source_pixbuf(pixbuf, 0, 0) cr.paint end cr.save do cr.arc(0.5, 0.5, 0.3, 0, 2 * Math::PI) cr.clip cr.new_path image = Cairo::ImageSurface.from_png("ruby-gnome2-logo.png") cr.scale(1.0 / image.width, 1.0 / image.height) cr.set_source(image, 0, 0) cr.paint end end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/gnome-fs-regular.png�������������������������������������0000644�0001750�0001750�00000003403�11701304107�022315� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���4���Ì“»‘���bKGD������ùC»��¸IDATxÚÕšKoWDZCÚ4³Ð*HtEÊ¢,‚RBÃ+ÚO€Ô]Yõ#ðP%XtQ‰Hx4< ‚À’MT‰v”‡`ÄĵöÜÓ…3ž;wî±SPÒ+dß¹w|ÿó?çÌ5Àw€,„«»»ûéúõëúN`u ¹wïžè£P(È|Œb±(cccrôèQ_©õÀ{@*VܺuKDDfffÞŠ@J©†®r¹,ÅbQ¦¦¦dttÔWâ“8%R¼ƒ!"ˆHÃû*• ="“ɰyóf._¾ ð�X´Ùä Mlݺu^×G¹\ ££ƒ-[¶044Dkk«S‰Ð—Û·oÏ‹àþ~abb�¥™L†M›6qòä :::¬J¤æÃâºÀú~…çy58yžGww77~ÊñãÇM85ÍBsÜ&0ˆ¡ ”J%¦¦¦¸sçccc\½z•R©Ä† Ýœ:u à{`©O±Í&„â”hDh÷Úª ¶y_¡#GŽP,Q¾¡Y±¢‹={ö| ü�€Jó¦žu.Ã÷D¥„¾¾>–/_N.—£Xü‡\îããã�œ8qÂ߸dF…¦Ù<zl¡P ½½=Qp×ýF¬_]+³Ÿ!•JQ©T�˜žžæáäÓiòù<££·8vìÀ.à`ÒÊB.Œ»‚ÏÄrTè�ãzÀ*¥jó"Uæñ¼Êìž* õô|ÆôtžÞÞ/éééñ·7ùš“,÷6¬`”Š*¨”ªy�šŒ5Áý¶¶¶ÈS›u¶mÛ¦YEæ„å8Œ›Êxž2Œ¢´õ¾ðÕ¸(fhnnv—"Âèè(©TÊbéÏd’�2Ë&Á=ÏSšð¢Á‰Ð_‰+W.ÓÞþÕtÍ67×ïѬEÄšæ½@ý{ô·õ}I9'¡íÛ¿¨eÂ$,»•±1²qÀ>veOîÞýù|ž„jT¸yóétºXDï)U½|·ûÐð</4_UFÕ TÝ«4…dûb###tvv&yÀ&˜Ýʦ‹MÏ„ÝîòŒ2<ý]_9ýwcb@رcårÙ¢ VX$c\‡¢D(Øe°€F«óýý{xñb*B"pãÆ -Z “1tXøÌ\ÊÈ´>ÌD›W³óÕDX<xÖÅ‹Éd>Lö€Ý2,\kƒ‹ù“I‚5¶¬ޝº $;wîä͛׆2Ñø.Nf´`Â%¬¨X!+"ìÝ»çÏŸ%AH¸~ý:--­šûUH€*Ó(“H„I|hDÆ¥°bºg.\8ϲeËŠ^õ@ÃÆ$f€Û˜M÷€ÉLÅ&@H)¡··—R©T³Š¿Ñ,®¢Êˆ5ù…ƒÜF™6Á%ÂBû÷ —›LNd×®ýÆâÅ‹5H ±B8i™î×á\žÆLññ«N³Zsç†éêZ™ÄzpÚù\êêõBÌ^'‰³Ä¶C’zXH±k×. …£$p?Ôœ”k’³÷qµUUŽxò$!¥ô²ÕUÛç}fr1IØâRc³°ðbíÞDÃÃgYµjM2 éÖò» [ÿj«ƒ\Lb&-[IaÖWîJ !úúv“ÏOÐgwe+äìl$k KýYbbâqR"S\º4Bgç’cø–ðk•(Yæþðš(Da©¯:ÃêÕk“šhÛhòr´­´¹ßÖ¸»˜%êMkÕ!€þþ~^¾|Q³F”“ÅÑ™¹ß8؊ðÁÄ)´/Ç¡Cƒd³'×B##¿²tiFK(n&ÑÝï×6îîMBJ†ë&Sè(„Ξ=Ú5%çàýŒ$ZÛäñ¨«%¶s‹ë«yµŠpÙên)MеCg9n[÷úrpð0'CÈ/[£Ü«×*ÊÊ"ÑžXOnQ|“b"àÌ™_X»v]r°¥ñzP›ÔóvÛž’Ï!B™xß¾ýärO-Ör»}®‚ÛâŵopðkÆÇÿJnêÏŸ?GW× ë›ã(LpÙzh˸[X™Ó§fݺ“=”Ó$0†;‰¹--uŸ34rêȘœœpÔþâÌØs=Ù©WðÇ¿I†ÃÃC¬\¹Ú€L´·¹¿‘à‹Â.~}]rõ©IïeÞ…Å)€û÷ïÂÀÀ!ž<ÉZš”xú{Û¯#55… ”Íf혜œdff†±±ßgON<Òé4 eܽû'Ùl–W¯^YoÁü_¨ÎëG`Õû´Ú÷9ð>ТŸ�.À!Àkà)0áŸCõè¾Hÿð€P*MZ0/dÁmŠ(€¶Cžú@e����IEND®B`‚�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/floppybuddy.gif������������������������������������������0000644�0001750�0001750�00000012140�11701304107�021463� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89aP�F�÷€����  !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~�ãã‚‚‚ƒƒƒ„„„………†††‡‡‡ˆˆˆ‰‰‰ŠŠŠ‹‹‹ŒŒŒŽŽŽ‘‘‘’’’“““”””•••–––———˜˜˜™™™ššš›››œœœžžžŸŸŸ   ¡¡¡¢¢¢£££¤¤¤¥¥¥¦¦¦ÿ��¨¨¨ÿÿ=v{ÿ«««¬¬¬­­­®®®¯¯¯°°°±±±²²²³³³´´´µµµ¶¶¶···¸¸¸¹¹¹ººº»»»¼¼¼½½½¾¾¾¿¿¿¸ÂÙÁÁÁÂÂÂÃÃÃÄÄÄÅÅÅÆÆÆÇÇÇÈÈÈÉÉÉÊÊÊËËËÌÌÌÍÍÍÎÎÎÏÏÏÐÐÐÑÑÑÒÒÒÓÓÓÔÔÔÕÕÕÖÖÖ×××ØØØÙÙÙÚÚÚÛÛÛÜÜÜÝÝÝÞÞÞßßßàààáááâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿ!ÿ NETSCAPE2.0è�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó¦H� ‹þŠ2hJ§2rD)@*0£.µšª©O®[µvDÙ•@ª³Xsjjõé×¶lÅ6$æÙ«wÓÒ5¨”mW¯)»ÆÝ9- ½Í¢Í{ø,ÒEgúu8ìÎÇ Ó5|’®b¼‹Œ¼ô­S¯C£J%ˆx3è«|C¿f ™´ÐÛ¸Ic¨¹qhº»q}vmÛB—N­•êÀÏÐóþ-½8çª(U/g»ysêûÖ_þ9¼qáÙµã^?¸9yó³ßï‹>²döëí§¾|pÞó§_Mª6Ó~ÏÁ‡ÖÏ•‡vé(á„Þ„`‚.ä}õ W!*IøØ…¾õçІ£9gßNÀ´èâ‹À�ðÇúAÈškhq¨áƒ®8SŒ)ÁãŒ5ÚHg¡f>�$JBÊH£L:×àƒmÜh:‰QIeŠô!I‘–6 $˜0JY$dH¢X‘™'u¹¦“mŠ©Ah긑š*…9åž|j’šB¾è昉aéÑ€x&Úbˆ„âÄåe1aJ„Yzi… véiŠš–J¢§¦¦:*©”©¸êA*=äÒ«°žª­´ç®¹ê𔕽ò,B¼k$±ÃKªO9Ūl}<ëWL%‹*QÉMËÖi¯.WÚ~H¡†šS•;R¸Âáçìvç‘®»Õ¶;îm_2xn~)Á.÷ïµÉåkn¼2zk0Áõê À.9,oÄ[.ºÏf¬ñÆwìñÇ#�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó&΃EE4eS™Fž„ª@ªTL}ZÅ 4©TƒI»bÍš’ëPª �vèX¢(ÍúDËÀÕµj7)Ö©V«U©¨{×nªµ÷*ýÛ4ëYºóR{÷êáœ5Á*ʹ³âÁ ãµ,š�h‚q ¶|PJ¨|…’]üx'ÊФsW¾Z÷êË_Sí¬•øÞ™­'[Ö}˜uä«[[Eì%ìØÄ_Où|9s¬ûÏ¥.PøðìÚasÇí½¹sƒ†ÛSW¹½¦ýú¼Æo8yèý’•gÞuhà`ë ´ŸwÔ%¤V€"h röY·]„ìÉ—Öƒ¨ñvÜNÀ„(âˆÀ�ðÇÇ–àd”‘Ö`]&øáL%¦Db‰'¦\~ rуx™vÚŒ�ÔˆÒ&¢x!†ÿAjµFd("™ã’6èãDP¾8%JU’˜¤Ž¨q¤E[¢V`‘`)æ•êÁ×eH_Úø¦’qÊy&[kÞx'™¥éQŠGú)"}y~åš`1Uh!…;)ZÞ„”NèNŽfê’¤šv*i„Ú÷éI+¤Ҩšñhꥄ¨–Š«¨Vk‡³Žêjª±*t뎵¶Ê¬›æ*+Od!UÜ_½’D–lÆvÕ§²5†`u]Ñ6”kØŽ4­µ²¡è-·M¡œ²Ôf—Ò·Žyfb²«’¸¢˜nWâJ5ï¹Ó¢æвµù•cøÂ$¯Kì~͵n›­° 7ìðÃG,±T�!þ’This GIF file was assembled by CDavis with GIF Construction Set from: Alchemy Mindworks Inc. P.O. Box 500 Beeton, Ontario L0G 1A0 CANADA. �!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó¦H� ‹þŠ2hJ§2rD)@*0£.µšª©O®[µvDÙ•@ª³Xsjjõé×¶lÅ6$æÙ«wÓÒ5¨”mW¯)»ÆÝ9- ½Í¢Í{ø,ÒEgúu8ìÎÇ Ó5|’®b¼‹Œ¼ô­S¯C£J%ˆx3è«|C¿f ™´ÐÛ¸Ic¨¹qhº»q}vmÛB—N­•êÀÏÐóþ-½8çª(U/g»ysêûÖ_þ9¼qáÙµã^?¸9yó³ßï‹>²döëí§¾|pÞó§_Mª6Ó~ÏÁ‡ÖÏ•‡vé(á„Þ„`‚.ä}õ W!*IøØ…¾õçІ£9gßNÀ´èâ‹À�ðÇúAÈškhq¨áƒ®8SŒ)ÁãŒ5ÚHg¡f>�$JBÊH£L:×àƒmÜh:‰QIeŠô!I‘–6 $˜0JY$dH¢X‘™'u¹¦“mŠ©Ah긑š*…9åž|j’šB¾è昉aéÑ€x&Úbˆ„âÄåe1aJ„Yzi… véiŠš–J¢§¦¦:*©”©¸êA*=äÒ«°žª­´ç®¹ê𔕽ò,B¼k$±ÃKªO9Ūl}<ëWL%‹*QÉMËÖi¯.WÚ~H¡†šS•;R¸Âáçìvç‘®»Õ¶;îm_2xn~)Á.÷ïµÉåkn¼2zk0Áõê À.9,oÄ[.ºÏf¬ñÆwìñÇ#�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó&΃EE4eS™Fž„ª@ªTL}ZÅ 4©TƒI»bÍš’ëPª �vèX¢(ÍúDËÀÕµj7)Ö©V«U©¨{×nªµ÷*ýÛ4ëYºóR{÷êáœ5Á*ʹ³âÁ ãµ,š�h‚q ¶|PJ¨|…’]üx'ÊФsW¾Z÷êË_Sí¬•øÞ™­'[Ö}˜uä«[[Eì%ìØÄ_Où|9s¬ûÏ¥.PøðìÚasÇí½¹sƒ†ÛSW¹½¦ýú¼Æo8yèý’•gÞuhà`ë ´ŸwÔ%¤V€"h röY·]„ìÉ—Öƒ¨ñvÜNÀ„(âˆÀ�ðÇÇ–àd”‘Ö`]&øáL%¦Db‰'¦\~ rуx™vÚŒ�ÔˆÒ&¢x!†ÿAjµFd("™ã’6èãDP¾8%JU’˜¤Ž¨q¤E[¢V`‘`)æ•êÁ×eH_Úø¦’qÊy&[kÞx'™¥éQŠGú)"}y~åš`1Uh!…;)ZÞ„”NèNŽfê’¤šv*i„Ú÷éI+¤Ҩšñhꥄ¨–Š«¨Vk‡³Žêjª±*t뎵¶Ê¬›æ*+Od!UÜ_½’D–lÆvÕ§²5†`u]Ñ6”kØŽ4­µ²¡è-·M¡œ²Ôf—Ò·Žyfb²«’¸¢˜nWâJ5ï¹Ó¢æвµù•cøÂ$¯Kì~͵n›­° 7ìðÃG,±T�!þThis space for rent...�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó¦H� ‹þŠ2hJ§2rD)@*0£.µšª©O®[µvDÙ•@ª³Xsjjõé×¶lÅ6$æÙ«wÓÒ5¨”mW¯)»ÆÝ9- ½Í¢Í{ø,ÒEgúu8ìÎÇ Ó5|’®b¼‹Œ¼ô­S¯C£J%ˆx3è«|C¿f ™´ÐÛ¸Ic¨¹qhº»q}vmÛB—N­•êÀÏÐóþ-½8çª(U/g»ysêûÖ_þ9¼qáÙµã^?¸9yó³ßï‹>²döëí§¾|pÞó§_Mª6Ó~ÏÁ‡ÖÏ•‡vé(á„Þ„`‚.ä}õ W!*IøØ…¾õçІ£9gßNÀ´èâ‹À�ðÇúAÈškhq¨áƒ®8SŒ)ÁãŒ5ÚHg¡f>�$JBÊH£L:×àƒmÜh:‰QIeŠô!I‘–6 $˜0JY$dH¢X‘™'u¹¦“mŠ©Ah긑š*…9åž|j’šB¾è昉aéÑ€x&Úbˆ„âÄåe1aJ„Yzi… véiŠš–J¢§¦¦:*©”©¸êA*=äÒ«°žª­´ç®¹ê𔕽ò,B¼k$±ÃKªO9Ūl}<ëWL%‹*QÉMËÖi¯.WÚ~H¡†šS•;R¸Âáçìvç‘®»Õ¶;îm_2xn~)Á.÷ïµÉåkn¼2zk0Áõê À.9,oÄ[.ºÏf¬ñÆwìñÇ#�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó&΃EE4eS™Fž„ª@ªTL}ZÅ 4©TƒI»bÍš’ëPª �vèX¢(ÍúDËÀÕµj7)Ö©V«U©¨{×nªµ÷*ýÛ4ëYºóR{÷êáœ5Á*ʹ³âÁ ãµ,š�h‚q ¶|PJ¨|…’]üx'ÊФsW¾Z÷êË_Sí¬•øÞ™­'[Ö}˜uä«[[Eì%ìØÄ_Où|9s¬ûÏ¥.PøðìÚasÇí½¹sƒ†ÛSW¹½¦ýú¼Æo8yèý’•gÞuhà`ë ´ŸwÔ%¤V€"h röY·]„ìÉ—Öƒ¨ñvÜNÀ„(âˆÀ�ðÇÇ–àd”‘Ö`]&øáL%¦Db‰'¦\~ rуx™vÚŒ�ÔˆÒ&¢x!†ÿAjµFd("™ã’6èãDP¾8%JU’˜¤Ž¨q¤E[¢V`‘`)æ•êÁ×eH_Úø¦’qÊy&[kÞx'™¥éQŠGú)"}y~åš`1Uh!…;)ZÞ„”NèNŽfê’¤šv*i„Ú÷éI+¤Ҩšñhꥄ¨–Š«¨Vk‡³Žêjª±*t뎵¶Ê¬›æ*+Od!UÜ_½’D–lÆvÕ§²5†`u]Ñ6”kØŽ4­µ²¡è-·M¡œ²Ôf—Ò·Žyfb²«’¸¢˜nWâJ5ï¹Ó¢æвµù•cøÂ$¯Kì~͵n›­° 7ìðÃG,±T�!þïThis GIF file was assembled with GIF Construction Set from: Alchemy Mindworks Inc. P.O. Box 500 Beeton, Ontario L0G 1A0 CANADA. This comment block will not appear in files created with a registered version of GIF Construction Set�;��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/builder.rb�����������������������������������������������0000644�0001750�0001750�00000002213�11701304107�020406� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2008 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # =begin = Interface Builder Demonstrates an interface loaded from a XML description. =end require 'common' module Demo class Dialog < Demo::BasicWindow def initialize super('Interface Builder') available = Gtk.check_version?(2, 12, 0) if available label = Gtk::Label.new("Build an interface from XML description.") else label = Gtk::Label.new("You need GTK+ >= 2.12.0 to run this demo.") end add(label) return unless available @builder = Gtk::Builder.new filename = File.join(File.dirname(__FILE__), "demo.ui") @builder << filename @builder.connect_signals {|name| method(name)} @window = @builder["window1"] @window.show_all signal_connect("destroy") do @window.destroy unless @window.destroyed? end end private def quit_activate @window.destroy destroy unless destroyed? end def about_activate dialog = @builder["aboutdialog1"] dialog.run dialog.hide end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/clipboard.rb���������������������������������������������0000644�0001750�0001750�00000003734�11701304107�020730� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # $Id: clipboard.rb,v 1.3 2005/07/28 14:30:38 mutoh Exp $ =begin = Clipboard GtkClipboard is used for clipboard handling. This demo shows how to copy and paste text to and from the clipboard. =end require 'common' module Demo class Clipboard < Demo::BasicWindow def initialize super('Clipboard') unless Gtk.check_version?(2, 2, 0) add(Gtk::Label.new("This sample requires GTK+ 2.2.0 or later")) return end vbox = Gtk::VBox.new(false, 0) vbox.border_width = 8 add(vbox) label = Gtk::Label.new(%Q["Copy" will copy the text\nin the entry to the clipboard]) vbox.pack_start(label, false, false, 0) hbox = Gtk::HBox.new(false, 0) hbox.border_width = 8 vbox.pack_start(hbox, false, false, 0) # Create the first entry entry = Gtk::Entry.new hbox.pack_start(entry, true, true, 0) # Create the button button = Gtk::Button.new(Gtk::Stock::COPY) hbox.pack_start(button, false, false, 0) button.signal_connect('clicked', entry) do |w, e| clipboard = e.get_clipboard(Gdk::Selection::CLIPBOARD) clipboard.text = e.text end label = Gtk::Label.new(%Q["Paste" will paste the text from the clipboard to the entry]) vbox.pack_start(label, false, false, 0) hbox = Gtk::HBox.new(false, 4) hbox.border_width = 8 vbox.pack_start(hbox, false, false, 0) # Create the second entry entry = Gtk::Entry.new hbox.pack_start(entry, true, true, 0) # Create the button button = Gtk::Button.new(Gtk::Stock::PASTE) hbox.pack_start(button, false, false, 0) button.signal_connect('clicked', entry) do |w, e| clipboard = e.get_clipboard(Gdk::Selection::CLIPBOARD) clipboard.request_text do |board, text, data| e.text = text end end end end end ������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-image-pattern.rb�����������������������������������0000644�0001750�0001750�00000002000�11701304107�022602� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-image-pattern.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Image Pattern This demo shows how to use GDK and cairo to use image pattern. From http://cairographics.org/samples/imagepattern.html. =end require 'common' module Demo class CairoImagePattern < CairoWindow def initialize super('cairo image pattern') end def draw(cr) image = Cairo::ImageSurface.from_png("ruby-gnome2-logo.png") pattern = Cairo::SurfacePattern.new(image) pattern.set_extend(Cairo::EXTEND_REPEAT) cr.translate(0.5, 0.5) cr.rotate(Math::PI / 4) cr.scale(1 / Math.sqrt(2), 1 / Math.sqrt(2)) cr.translate(-0.5, -0.5) matrix = Cairo::Matrix.scale(image.width * 5, image.height * 5) pattern.set_matrix(matrix) cr.set_source(pattern) cr.rectangle(0, 0, 1.0, 1.0) cr.fill end end end ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/gnome-gmush.png������������������������������������������0000644�0001750�0001750�00000006254�11701304107�021400� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA�† 1è–_�� cIDATxÚí˜[Œ$×YǧNUß{î{õŽ×qŒlb³K¸¯"„1RŒ2QL B âÍ‘xˆKHŒŠà„<8h­„`@‰ÀÂö‚/+lÇ»k{–ÝÙÞ¹ôLwOwuuÕ9U禪U Þ Á ¹¥£ª­©­úÿ¿ïÿ}ßÿ|ðûà÷ÁïÿõO¼/}àáO Ä­Ñh(.]X}îò[W;ÿ§ <öç_^qƜȄX‰ÂÑò02#Lš¡cÅ•+kÿzñìkŸÚèô®\ï³ýïèGÿäw}Ïñ?’³Ç“åp2Á&´N1iFÍ÷¹uùvœµÄñä¾è®Iuvr§;\{ß |å鯭4ëÍÓ‰ŠQ©ÆXƒµ¦dÖK½Rg¶5‹ÖŠV½–£íC‹¿¾ÓþÊûFàϾñ—'Ïø‚C¬L’˜ÌXpŽz½ïWðœGŽÉ¬a0걺&ð=ŸîÎÖY*íÆççš_ô£Kÿ+ý‹ÇŽ¼ç¾“ó­™cì‰Ì˜åI‘(…µ‹c¶9Ë\{k-ã¹)vGCâ$áÍÞÛh­Ù ‡8Ö8Kó_ô£_þ®xåÍWWgæW„'t–-§©"Ñ <çyDKf-&K1YF"ÆŒµøRø{¯BÙŒXÅ€ÂÚƒÿãzãò…æ–¾à oE› c-išbL†6ƒCzRJÖY `¬a4M Œ'!›;Û8OJZÍ6Õ Æh<&Mõ¡¥#s÷ïlì~û¦ œ»üæ±cŽ>.„XÉL†³vïÎb¬Ù+Ng0Æ¢2E–eh‚³8kq´I‰z]T–2Gd6Åó%"È@ÒnµY>| ‰`§ßãóoÌF¿ÀÍXë^=vxþÀóÆšek-Σ·½Ej @f22k±ÖâU|Æaóƒ�™s¤Ö <‡Ò÷ñ«5d¢ñ$´Z-ª~@µRcŽFáÏÞ´„Ž,:½¹¹¾üû¿÷Û¼üâ|ßGzÂóðr¹T‚€f³IµZ!|: ç8pð ¹9Æã1·Üùa°¤ž@Jüß—x•�+6]æ[³ =Ó¦Ñj>püÀOn_Þþ§÷" ßíb¬’c¾”ö3?Ï›Îíukñ¤O!¨ÂDQ„ÔkuffZlnl±´¸Àîλ½> ÕRiΟy‰¥ Êb« ÒŒÔ¦h“2 GlûŒÂ½Ñ.Ãh„­x÷†Wûü^¼wM‹”Ç„Œ†‚ ¤ï£µ" C¢(Bk š&;;=¶º]œu4š ÖÖ®T*¤:Å“q“fKss´dWºw>?vÛÜ}t™Z­Æ$‰ÙnÓ°RàÕ*?xð£·ýá {!kíÚoþƯ-?ÿܳ{ò‘r¯ËàH…NSßGú’v³I¥Ra8 ŸÌ ~ø¾“ôû#&qL’$øR²¸0ÃÖÆeŽÝr”Üs7Æ¢hÂ$NXö¹°»Å¥Íu”V$J¡µ&Ý®ÿêúWrX._ïMÀ9·ÒÝÚ<ýÙÏ|ß—~€çK)ž‡5–8I˜Lb²,¥Z­Òn·¸ç#ʼn�¥iš’$ J©éò}É÷ÝyœÞ`€1†jµÂìÌ ó sÔ*úqÈ·Îýom¬¡RÖ)v{ôÃsÝö‘p°×/øoHœþöß?½ò[~qÊÖX‡µ!RJjÕ*‰RÄqÂOúiA)Åd2A)E’$ÄyŠcµZÁs çÀ9GµZáà%æçX\œgqaŽšðåoþëý.ÎºŽ½<øøøò “·Åñ=í´sît·»µòØ—åâÅ·ñ¥Dú>Rz{�ã„D)>tû|üÔŒÇc´ÖDQDE$IB†ŒÇã) ¥Öjl–rôÈ!.-Òh68rè ³³mæææh6ê„:æOŸùþáõ³¸Ì|=|öß?—ƒŸ®kÚ8çV€ÓßøÛ¯óôÓGŽkY–‘$ ¿øK¿Šs‚$I¦ ƒiš2 DQD†(¥Ÿ­ÎAµ0;3ÃÑ#‡8~|™ã·Þ²Gfn–±ŽùüýÝÑ€tµww|±ßLNÀ\“•B<éœ[þÄÏüÜã?~ê+Ïýó?òâ Ïqþ;¯Ñh6xàÁO²¼|| \)…”ß÷‰¢ˆ,ËÇT*¤”cPJ!„G«UG @ÀöNŸI†!Î:”Ò>rC ‹tÃ]¼ƒ­q±ÿÕBÍ€»f3'„è�ŸŽG'~à‡~äñï½÷ûOîôº¬wÖ¸cùêõúôÞJ¥B–eH)B0™Lð}ÏóBàœCks‚ápÄÒâFƒ…ùY¸uùfÚmêÏ_ø¯]^!°“t¨�ºÇu»ÑÙÖÌàG/®¯­4š­Gî¸ëî“K9”RT*¬µ8çBÐn·§×…!¦·Ö²´´H·»E0Dx<RzD™â¯Ÿ}ž¯½ô,BxX~+~uã<PË3�Þ ïn?zë“À“[ÛÝ'œuO'£çíMí’å(2¡Ôžá˲ c ÖZÚíæ^V¬£?¡º–Y›³«ö,ˆ«¯F/\þ UU€½é™ÞÃÚè=ËœƒJ’)%išN£.¥$Ë2œsÅ dg4b}´óÀyÀ@â¶<\]‚'°Ú¼¾½ó„¾2|-ï€È€�Ð7E ßï¯h½>Ë2¬µ¥cò}ƒ™ê˜õœÀ¯U°Â/°dÂôîäÕxkøRº1º˜ë½‘ƒV@µD¿)iš>’eÙd!0 i·Ûh­QJM H)ó°WI§FfëIo§ZGÉnÔÉ&js€µ\*•x-'áçFôÆk ÛížHÓôdš¦$Švéû>išRÎŽ1fZE'2ÆzkôÜ ×Ó9Ph-'PX“ϸ,þíÝàÇ0Okýéb–IL&“½è&É;ˆÙ|7Wœ‹½Ý 9ØÂÔrÉÔóUË£_Ïåm€w#àÏó©$I S Zkâ8ž- Öú$œsÓVëûþ‘ü™2[�/HÒ)d$J8®ë«Ä<àgY¶ìyÃáF£A–eÄqŒÖ)åt¹>Œ1SÅ— çÜ<Ð.Ùd›iZ’OZ’_rÑ™#àÏœ9³R´È 9çHÓ”4Mñ}cÌÔJGQôŽVÉ[l4K`MI&|^”êB�»¢ˆÀx<ö‹èJ)§¦M›|Puš¦Óm©sn:äòá¦öi¾ú. Ý»ì],`½ë�_è4Ã0(¢]¯×ÙÜÜDkM†Xk™L&ÄqÌp8¤ÓéLk¢N^J©/]º•4îçEêçïû:Q±Šì¸É€|衇¾Yg¥R¡×ëÑï÷§rŠã˜ÑhÄÅ‹i·ÛÓùPH¨°qoïÓvP~Oa™óÐùÑäç×ìFž€¿»»ûª”ò^¥Íf“ííí©ßBÐétò=4h­±ÖNmv~ßî[o½µYÚÚ}Eœ•fÃþ•]oþ‘W^yå‰bÒV*¶··I’„(Šèv»¬­­Q¯×ÑZ¿£zžÇ`0¸töìÙs9˜8_ •Î‹ë ˜ä×t©C “×�¼Ð¢_$•gžyfýþûï¿KJy[–e¬®®N-ÃÕ«WqÎÑh4ÞÑN{½^çõ×_£Óélç ’‰$çD&ÀØÍ­Å(?Nò¥-¯·…–ЬòÔSO™ŸŸïµZ­CµZmáüùó�„aH–e4 ºÝîúÕ«W¯¼üò˯¯®®n(¥Æ¥ £\”ƒåÇaiKà‹ÿ›ŠkÌ€WD¾4-›À 0 ,³§NúX†Uç\õÅ_\Ëﯔ²XL¶¤e]’GqŒJ„ÂÒå׈kÌ@ÑŠq^x“VNb.?oæ«^j²”Å2h“Ÿg¥ÂTù=q~-*Iª,«$¿÷š&qÑ!Dþoߥ†Ê^-/£ây*–˺¨-e@åçª$¹"òE¯yOìö “´Ê–¢8É£”\£·¯Mš}ÒÙŸ³Ï²JJà³!P�Hÿ B*zg@–<++|~’_/À‹Ò+öÝŸ–†—¹î[ïRв4=½}5â—À{eßRÒº.]7¥³ßâ›R´m)Źû $Ý’vÚ����IEND®B`‚����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/tree_store.rb��������������������������������������������0000644�0001750�0001750�00000016403�11701304107�021141� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: tree_store.rb,v 1.7 2005/02/06 18:25:13 kzys Exp $ =begin = Tree View/Tree Store The Gtk::TreeStore is used to store data in tree form, to be used later on by a Gtk::TreeView to display it. This demo builds a simple Gtk::TreeStore and displays it. If you're new to the GtkTreeView widgets and associates, look into the Gtk::ListStore example first. =end require 'common' module Demo class TreeStore < BasicWindow # TreeItem structure TreeItem = Struct.new('TreeItem', :label, :alex, :havoc, :tim, :owen, :dave, :world_holiday) # shared by the European hackers # columns ( HOLIDAY_NAME_COLUMN, ALEX_COLUMN, HAVOC_COLUMN, TIM_COLUMN, OWEN_COLUMN, DAVE_COLUMN, VISIBLE_COLUMN, WORLD_COLUMN, NUM_COLUMNS, ) = *(0..9).to_a # tree data TOPLEVEL = [ ['January', [ ["New Years Day", true, true, true, true, false, true], ["Presidential Inauguration", false, true, false, true, false, false], ["Martin Luther King Jr. day", false, true, false, true, false, false], ] ], ['February', [ ["Presidents' Day", false, true, false, true, false, false], ["Groundhog Day", false, false, false, false, false, false], ["Valentine's Day", false, false, false, false, true, true], ] ], ['March', [ ["National Tree Planting Day", false, false, false, false, false, false], [ "St Patrick's Day", false, false, false, false, false, true], ] ], ['April', [ [ "April Fools' Day", false, false, false, false, false, true ], [ "Army Day", false, false, false, false, false, false ], [ "Earth Day", false, false, false, false, false, true ], [ "Administrative Professionals' Day", false, false, false, false, false, false ], ]], ['May', [ [ "Nurses' Day", false, false, false, false, false, false ], [ "National Day of Prayer", false, false, false, false, false, false ], [ "Mothers' Day", false, false, false, false, false, true ], [ "Armed Forces Day", false, false, false, false, false, false ], [ "Memorial Day", true, true, true, true, false, true ], ] ], ['June', [ [ "June Fathers' Day", false, false, false, false, false, true ], [ "Juneteenth (Liberation of Slaves)", false, false, false, false, false, false ], [ "Flag Day", false, true, false, true, false, false ], ] ], ['July', [ [ "Parents' Day", false, false, false, false, false, true ], [ "Independence Day", false, true, false, true, false, false ], ] ], ['August', [ [ "Air Force Day", false, false, false, false, false, false ], [ "Coast Guard Day", false, false, false, false, false, false ], [ "Friendship Day", false, false, false, false, false, false ], ] ], ['September', [ [ "Grandparents' Day", false, false, false, false, false, true ], [ "Citizenship Day or Constitution Day", false, false, false, false, false, false ], [ "Labor Day", true, true, true, true, false, true ], ] ], ['October', [ [ "National Children's Day", false, false, false, false, false, false ], [ "Bosses' Day", false, false, false, false, false, false ], [ "Sweetest Day", false, false, false, false, false, false ], [ "Mother-in-Law's Day", false, false, false, false, false, false ], [ "Navy Day", false, false, false, false, false, false ], [ "Columbus Day", false, true, false, true, false, false ], [ "Halloween", false, false, false, false, false, true ], ] ], ['November', [ [ "Marine Corps Day", false, false, false, false, false, false ], [ "Veterans' Day", true, true, true, true, false, true ], [ "Thanksgiving", false, true, false, true, false, false ], ] ], ['December', [ [ 'Pearl Harbor Remembrance Day', false, false, false, false, false, false ], [ 'Christmas', true, true, true, true, false, true ], [ 'Kwanzaa', false, false, false, false, false, false ], ] ], ].collect do |month_name, holidays| [ month_name, holidays.collect do |args| TreeItem.new(args) end, ] end def initialize # create window, etc super('Card planning sheet') vbox = Gtk::VBox.new(false, 8) vbox.border_width = 8 add(vbox) vbox.pack_start(Gtk::Label.new("Jonathan's Holiday Card Planning Sheet"), false, false, 0) sw = Gtk::ScrolledWindow.new(nil, nil) sw.shadow_type = Gtk::SHADOW_ETCHED_IN sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) vbox.pack_start(sw, true, true, 0) # create model model = create_model # create tree view treeview = Gtk::TreeView.new(model) treeview.rules_hint = true treeview.selection.mode = Gtk::SELECTION_MULTIPLE add_columns(treeview) sw.add(treeview) # expand all rows after the treeview widget has been realized treeview.signal_connect('realize') do treeview.expand_all end set_default_size(650, 400) end def create_model # create tree store model = Gtk::TreeStore.new(String, TrueClass, TrueClass, TrueClass, TrueClass, TrueClass, TrueClass, TrueClass) # add data to the tree store TOPLEVEL.each do |month_name, holidays| iter = model.append(nil) iter[HOLIDAY_NAME_COLUMN] = month_name (ALEX_COLUMN..DAVE_COLUMN).each do |index| iter[index] = false end # add children holidays.each do |holiday| child_iter = model.append(iter) child_iter[HOLIDAY_NAME_COLUMN] = holiday.label[0] %w(alex havoc tim owen dave).each_with_index do |person, i| child_iter[ALEX_COLUMN + i] = holiday[person] end child_iter[VISIBLE_COLUMN] = true child_iter[WORLD_COLUMN] = holiday.world_holiday end end return model end def add_columns(treeview) model = treeview.model # column for holiday names renderer = Gtk::CellRendererText.new renderer.xalign = 0.0 col_offset = treeview.insert_column(-1, 'Holiday', renderer, 'text' => HOLIDAY_NAME_COLUMN) column = treeview.get_column(col_offset - 1) column.clickable = true [ ['Alex', true ], ['Havoc', false], ['Tim', true ], ['Owen', false], ['Dave', false], ].each_with_index do |args, i| person, european = *args renderer = Gtk::CellRendererToggle.new renderer.xalign = 0.0 eval(%Q[def renderer.column; #{ALEX_COLUMN + i}; end]) renderer.signal_connect('toggled') do |cell, path| item_toggled(cell, path, model) end attributes = { 'active' => (ALEX_COLUMN + i), 'visible' => VISIBLE_COLUMN, } if european attributes['activatable'] = WORLD_COLUMN end col_offset = treeview.insert_column(-1, person, renderer, attributes) column = treeview.get_column(col_offset - 1) column.sizing = Gtk::TreeViewColumn::FIXED column.fixed_width = 50 column.clickable = true end end def item_toggled (cell, path_str, model) path = Gtk::TreePath.new(path_str) column = cell.column # get toggled iter iter = model.get_iter(path) toggle_item = iter[column] # do something with the value toggle_item ^= 1 # set new value iter[column] = toggle_item end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/textview.rb����������������������������������������������0000644�0001750�0001750�00000036105�11701304107�020646� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: textview.rb,v 1.8 2005/02/06 18:25:13 kzys Exp $ =begin = Text Widget/Multiple Views The Gtk::TextView widget displays a Gtk::TextBuffer. One Gtk::TextBuffer can be displayed by multiple Gtk::TextViews. This demo has two views displaying a single buffer, and shows off the widget's text formatting features. =end require 'common' module Demo class TextView < BasicWindow GRAY50_WIDTH = 2 GRAY50_HEIGHT = 2 GRAY50_BITS = [0x02, 0x01].pack("c") @@nest_window = nil def initialize super("TextView Window") set_default_size(450, 450) set_title("TextView") set_border_width(0) vpaned = Gtk::VPaned.new vpaned.set_border_width(5) add(vpaned) ## # For convenience, we just use the autocreated buffer from # the first text view; you could also create the buffer # by itself with Gtk::TextBuffer.new, then later create # a view widget. # view1 = Gtk::TextView.new buffer = view1.buffer view2 = Gtk::TextView.new(buffer) sw = Gtk::ScrolledWindow.new(nil, nil) sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) vpaned.add1(sw) sw.add(view1) sw = Gtk::ScrolledWindow.new(nil, nil) sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) vpaned.add2(sw) sw.add(view2) create_tags(buffer) insert_text(buffer) attach_widgets(view1) attach_widgets(view2) vpaned.show_all self.show end def create_tags(buffer) ## # Create a bunch of tags. Note that it's also possible to # create tags with Gtk::TextTag.new then add them to the # tag table for the buffer, Gtk::TextBuffer#create_tag is # just a convenience function. Also note that you don't have # to give tags a name; pass NULL for the name to create an # anonymous tag. # # In any real app, another useful optimization would be to create # a Gtk::TextTagTable in advance, and reuse the same tag table for # all the buffers with the same tag set, instead of creating # new copies of the same tags for every buffer. # # Tags are assigned default priorities in order of addition to the # tag table. That is, tags created later that affect the same text # property affected by an earlier tag will override the earlier # tag. You can modify tag priorities with # Gtk::TextTag#set_priority. # buffer.create_tag('heading', 'weight' => Pango::FontDescription::WEIGHT_BOLD, 'size' => 15 * Pango::SCALE) buffer.create_tag("italic", "style" => Pango::FontDescription::STYLE_ITALIC) buffer.create_tag("bold", "weight" => Pango::FontDescription::WEIGHT_BOLD) buffer.create_tag("big", # points times the PANGO_SCALE factor "size" => 20 * Pango::SCALE) buffer.create_tag("xx-small", "scale" => Pango::AttrScale::XX_SMALL) buffer.create_tag("x-large", "scale" => Pango::AttrScale::X_LARGE) buffer.create_tag("monospace", "family" => "monospace") buffer.create_tag("blue_foreground", "foreground" => "blue") buffer.create_tag("red_background", "background" => "red") stipple = Gdk::Pixmap.create_from_data(nil, GRAY50_BITS, GRAY50_WIDTH, GRAY50_HEIGHT) buffer.create_tag("background_stipple", "background_stipple" => stipple) buffer.create_tag("foreground_stipple", "foreground_stipple" => stipple) buffer.create_tag("big_gap_before_line", "pixels_above_lines" => 30) buffer.create_tag("big_gap_after_line", "pixels_below_lines" => 30) buffer.create_tag("double_spaced_line", "pixels_inside_wrap" => 10) buffer.create_tag("not_editable", "editable" => false) buffer.create_tag("word_wrap", "wrap_mode" => Gtk::TextTag::WRAP_WORD) buffer.create_tag("char_wrap", "wrap_mode" => Gtk::TextTag::WRAP_CHAR) buffer.create_tag("no_wrap", "wrap_mode" => Gtk::TextTag::WRAP_NONE) buffer.create_tag("center", "justification" => Gtk::JUSTIFY_CENTER) buffer.create_tag("right_justify", "justification" => Gtk::JUSTIFY_RIGHT) buffer.create_tag("wide_margins", "left_margin" => 50, "right_margin" => 50) buffer.create_tag("strikethrough", "strikethrough" => true) buffer.create_tag("underline", "underline" => Pango::AttrUnderline::SINGLE) buffer.create_tag("double_underline", "underline" => Pango::AttrUnderline::DOUBLE) buffer.create_tag("superscript", "rise" => 10 * Pango::SCALE, # 10 pixels "size" => 8 * Pango::SCALE) # 8 points buffer.create_tag("subscript", "rise" => -10 * Pango::SCALE, # 10 pixels "size" => 8 * Pango::SCALE) # 8 points buffer.create_tag("rtl_quote", "wrap_mode" => Gtk::TextTag::WRAP_WORD, "direction" => Gtk::Widget::TEXT_DIR_RTL, "indent" => 30, "left_margin" => 20, "right_margin" => 20) end def insert_text(buffer) ## # Demo.find_file looks in the the current directory first, # so you can run gtk-demo without installing GTK, then looks # in the location where the file is installed. # filename = Demo.find_file("gtk-logo-rgb.gif") pixbuf = Gdk::Pixbuf.new(filename) if filename unless pixbuf $stderr.print "Failed to load image file gtk-logo-rgb.gif\n" exit 1 end scaled = pixbuf.scale(32, 32, Gdk::Pixbuf::INTERP_BILINEAR) pixbuf = scaled ## # get start of buffer; each insertion will revalidate the # iterator to point to just after the inserted text. # iter = buffer.get_iter_at_offset(0) buffer.insert(iter, "The text widget can display text with all kinds of nifty attributes. It also supports multiple views of the same buffer; this demo is showing the same buffer in two places.\n\n") buffer.insert(iter, "Font styles. ", 'heading') buffer.insert(iter, "For example, you can have ") buffer.insert(iter, "italic", "italic") buffer.insert(iter, ", ") buffer.insert(iter, "bold", "bold") buffer.insert(iter, ", or ") buffer.insert(iter, "monospace(typewriter)", "monospace") buffer.insert(iter, ", or ") buffer.insert(iter, "big", "big") buffer.insert(iter, " text. ") buffer.insert(iter, "It's best not to hardcode specific text sizes; you can use relative sizes as with CSS, such as ") buffer.insert(iter, "xx-small", "xx-small") buffer.insert(iter, " or ") buffer.insert(iter, "x-large", "x-large") buffer.insert(iter, " to ensure that your program properly adapts if the user changes the default font size.\n\n") buffer.insert(iter, "Colors. ", "heading") buffer.insert(iter, "Colors such as ") buffer.insert(iter, "a blue foreground", "blue_foreground") buffer.insert(iter, " or ") buffer.insert(iter, "a red background", "red_background") buffer.insert(iter, " or even ") buffer.insert(iter, "a stippled red background", "red_background", "background_stipple") buffer.insert(iter, " or ") buffer.insert(iter, "a stippled blue foreground on solid red background", "blue_foreground", "red_background", "foreground_stipple") buffer.insert(iter, "(select that to read it) can be used.\n\n") buffer.insert(iter, "Underline, strikethrough, and rise. ", "heading") buffer.insert(iter, "Strikethrough", "strikethrough") buffer.insert(iter, ", ") buffer.insert(iter, "underline", "underline") buffer.insert(iter, ", ") buffer.insert(iter, "double underline", "double_underline") buffer.insert(iter, ", ") buffer.insert(iter, "superscript", "superscript") buffer.insert(iter, ", and ") buffer.insert(iter, "subscript", "subscript") buffer.insert(iter, " are all supported.\n\n") buffer.insert(iter, "Images. ", "heading") buffer.insert(iter, "The buffer can have images in it: ") buffer.insert(iter, pixbuf) buffer.insert(iter, pixbuf) buffer.insert(iter, pixbuf) buffer.insert(iter, " for example.\n\n") buffer.insert(iter, "Spacing. ", "heading") buffer.insert(iter, "You can adjust the amount of space before each line.\n") buffer.insert(iter, "This line has a whole lot of space before it.\n", "big_gap_before_line", "wide_margins") buffer.insert(iter, "You can also adjust the amount of space after each line; this line has a whole lot of space after it.\n", "big_gap_after_line", "wide_margins") buffer.insert(iter, "You can also adjust the amount of space between wrapped lines; this line has extra space between each wrapped line in the same paragraph. To show off wrapping, some filler text: the quick brown fox jumped over the lazy dog. Blah blah blah blah blah blah blah blah blah.\n", "double_spaced_line", "wide_margins") buffer.insert(iter, "Also note that those lines have extra-wide margins.\n\n") buffer.insert(iter, "Editability. ", "heading") buffer.insert(iter, "This line is 'locked down' and can't be edited by the user - just try it! You can't delete this line.\n\n", "not_editable") buffer.insert(iter, "Wrapping. ", "heading") buffer.insert(iter, "This line(and most of the others in this buffer) is word-wrapped, using the proper Unicode algorithm. Word wrap should work in all scripts and languages that GTK+ supports. Let's make this a long paragraph to demonstrate: blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah\n\n") buffer.insert(iter, "This line has character-based wrapping, and can wrap between any two character glyphs. Let's make this a long paragraph to demonstrate: blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah\n\n", "char_wrap") buffer.insert(iter, "This line has all wrapping turned off, so it makes the horizontal scrollbar appear.\n\n\n", "no_wrap") buffer.insert(iter, "Justification. ", "heading") buffer.insert(iter, "\nThis line has center justification.\n", "center") buffer.insert(iter, "This line has right justification.\n", "right_justify") buffer.insert(iter, "\nThis line has big wide margins. Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.\n", "wide_margins") buffer.insert(iter, "Internationalization. ", "heading") buffer.insert(iter, "You can put all sorts of Unicode text in the buffer.\n\nGerman(Deutsch Süd) Grüß Gott\nGreek(Ελληνικά) Γειά σας\nHebrew שלו×\nJapanese(日本語)\n\nThe widget properly handles bidirectional text, word wrapping, DOS/UNIX/Unicode paragraph separators, grapheme boundaries, and so on using the Pango internationalization framework.\n") buffer.insert(iter, "Here's a word-wrapped quote in a right-to-left language:\n") buffer.insert(iter, "??? ??? ???? ?? ???? ???????? ????? ?? ???? ?????? ??????? ??????? ?? ???? ?????? ?? ????? ?? ??????? ????? ??????? ??? ?????? ????? ?????? ????? ???? ?? ?????? ?????? ?? ???????? ?????? ????? ?? ???? ???? ????????? ???????. ???? ???? ??? ???????? ????? ?? »????????« ?? ???????.\n\n", "rtl_quote") buffer.insert(iter, "You can put widgets in the buffer: Here's a button: ") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, " and a menu: ") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, " and a scale: ") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, " and an animation: ") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, " finally a text entry: ") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, ".\n") buffer.insert(iter, "\n\nThis demo doesn't demonstrate all the Gtk::TextBuffer features; it leaves out, for example: invisible/hidden text(doesn't work in GTK 2, but planned), tab stops, application-drawn areas on the sides of the widget for displaying breakpoints and such...") # Apply word_wrap tag to whole buffer buf_start, buf_end = buffer.bounds buffer.apply_tag("word_wrap", buf_start, buf_end) end def find_anchor(iter) while iter.forward_char do return true if iter.child_anchor end return false end def attach_widgets(text_view) buffer = text_view.buffer; iter = buffer.start_iter i = 0; while find_anchor(iter) do anchor = iter.child_anchor if i == 0 widget = Gtk::Button.new("Click Me") widget.signal_connect('clicked') { |button| if @@nest_window and ! @@nest_window.destroyed? @@nest_window.present break end buffer = Gtk::TextBuffer.new iter = buffer.start_iter buffer.insert(iter, "This buffer is shared by a set of nested text views.\n Nested view:\n") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, "\nDon't do this in real applications, please.\n") view = Gtk::TextView.new(buffer) recursive_attach_view(0, view, anchor) @@nest_window = Gtk::Window.new(Gtk::Window::TOPLEVEL) sw = Gtk::ScrolledWindow.new(nil, nil) sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) @@nest_window.add(sw) sw.add(view) @@nest_window.set_default_size(300, 400) @@nest_window.show_all } elsif i == 1 menu = Gtk::Menu.new widget = Gtk::OptionMenu.new menu_item = Gtk::MenuItem.new("Option 1") menu.append(menu_item) menu_item = Gtk::MenuItem.new("Option 2") menu.append(menu_item) menu_item = Gtk::MenuItem.new("Option 3") menu.append(menu_item) widget.menu = menu elsif i == 2 widget = Gtk::HScale.new widget.set_range(0, 100) widget.set_size_request(70, -1) elsif i == 3 filename = Demo.find_file("floppybuddy.gif") widget = Gtk::Image.new(filename) elsif i == 4 widget = Gtk::Entry.new else #widget = nil; avoids a compiler warning #g_assert_not_reached ; end text_view.add_child_at_anchor(widget, anchor) widget.show_all i += 1 end end def recursive_attach_view(depth, view, anchor) return if depth > 4 child_view = Gtk::TextView.new(view.buffer) # Event box is to add a black border around each child view event_box = Gtk::EventBox.new color = Gdk::Color.parse("black") event_box.modify_bg(Gtk::STATE_NORMAL, color) align = Gtk::Alignment.new(0.5, 0.5, 1.0, 1.0) align.set_border_width(1) event_box.add(align) align.add(child_view) view.add_child_at_anchor(event_box, anchor) recursive_attach_view(depth + 1, child_view, anchor) end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-arc.rb���������������������������������������������0000644�0001750�0001750�00000002061�11701304107�020621� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-arc.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Arc This demo shows how to use GDK and cairo to draw arc. From http://cairographics.org/samples/arc.html. =end require 'common' module Demo class CairoArc < CairoWindow CENTER_X = 0.5 CENTER_Y = 0.5 RADIUS = 0.4 ANGLE1 = 45.0 * (Math::PI / 180.0) # angles are specified ANGLE2 = 180.0 * (Math::PI / 180.0) # in radians def initialize super('cairo arc') end def draw(cr) cr.arc(CENTER_X, CENTER_Y, RADIUS, ANGLE1, ANGLE2) cr.stroke # draw helping lines cr.set_source_rgba(1, 0.2, 0.2, 0.6) cr.arc(CENTER_X, CENTER_Y, 0.05, 0, 2 * Math::PI) cr.fill cr.set_line_width(0.03) cr.arc(CENTER_X, CENTER_Y, RADIUS, ANGLE1, ANGLE1) cr.line_to(CENTER_X, CENTER_Y) cr.arc(CENTER_X, CENTER_Y, RADIUS, ANGLE2, ANGLE2) cr.line_to(CENTER_X, CENTER_Y) cr.stroke end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-path.rb��������������������������������������������0000644�0001750�0001750�00000001134�11701304107�021010� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-path.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Path This demo shows how to use GDK and cairo to draw path. From http://cairographics.org/samples/path.html. =end require 'common' module Demo class CairoPath < CairoWindow def initialize super('cairo path') end def draw(cr) cr.move_to(0.5, 0.1) cr.line_to(0.9, 0.9) cr.rel_line_to(-0.4, 0.0) cr.curve_to(0.2, 0.9, 0.2, 0.5, 0.5, 0.5) cr.stroke end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/rotated_text.rb������������������������������������������0000644�0001750�0001750�00000006173�11701304107�021477� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: rotated_text.rb,v 1.2 2005/03/05 15:01:16 mutoh Exp $ =begin = Rotated Text This demo shows how to use GDK and Pango to draw rotated and transformed text. The use of Gdk::PangoRenderer in this example is a somewhat advanced technique; most applications can simply use Gdk::Drawable#draw_layout. We use it here mostly because that allows us to work in user coordinates - that is, coordinates prior to the application of the transformation matrix, rather than device coordinates. As of GTK+-2.6, the ability to draw transformed and anti-aliased graphics as shown in this example is only present for text. With GTK+-2.8, a new graphics system called "Cairo" will be introduced that provides these capabilities and many more for all types of graphics. =end require 'common' module Demo class RotatedText < BasicWindow RADIUS = 150 N_WORDS = 10 FONT = "Sans Bold 27" def initialize super('Rotated Text') unless Gtk.check_version?(2, 6, 0) add(Gtk::Label.new("This sample requires GTK+ 2.6.0 or later")) return end drawing_area = Gtk::DrawingArea.new add(drawing_area) drawing_area.modify_bg(Gtk::STATE_NORMAL, Gdk::Color.new(65535, 65535, 65535)) drawing_area.signal_connect("expose_event") do matrix = Pango::Matrix.new # Get the default renderer for the screen, and set it up for drawing renderer = Gdk::PangoRenderer.get_default(drawing_area.screen) renderer.drawable = drawing_area.window renderer.gc = style.black_gc width = drawing_area.allocation.width height = drawing_area.allocation.height # Set up a transformation matrix so that the user space coordinates for # the centered square where we draw are [-RADIUS, RADIUS], [-RADIUS, RADIUS] # We first center, then change the scale device_radius = [width, height].min / 2.0 matrix.translate!(device_radius + (width - 2 * device_radius) / 2.0, device_radius + (height - 2 * device_radius) / 2.0) matrix.scale!(device_radius / RADIUS, device_radius / RADIUS) # Create a PangoLayout, set the font and text context = Gdk::Pango.context layout = Pango::Layout.new(context) layout.text = "Text" layout.font_description = Pango::FontDescription.new(FONT) # Draw the layout N_WORDS times in a circle (0...N_WORDS).each do |i| rotated_matrix = matrix.dup angle = 360 * i / N_WORDS.to_f # Gradient from red at angle == 60 to blue at angle == 300 red = 65535 * (1 + Math.cos((angle - 60) * Math::PI / 180.0)) / 2 color = Gdk::Color.new(red, 0, 65535 - red) renderer.set_override_color(Pango::Renderer::PART_FOREGROUND, color) rotated_matrix.rotate!(angle) context.matrix = rotated_matrix # Inform Pango to re-layout the text with the new transformation matrix layout.context_changed width, height = layout.size renderer.draw_layout(layout, - width / 2, - RADIUS * Pango::SCALE) end # Clean up default renderer, since it is shared renderer.set_override_color(Gdk::PangoRenderer::PART_FOREGROUND, nil) renderer.drawable = nil renderer.gc = nil end end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/gnome-calendar.png���������������������������������������0000644�0001750�0001750�00000005303�11701304107�022020� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA�† 1è–_�� zIDATxÚí™]lWÇwvvwÖñÆÞÆNvc7ޓ֤¡}ˆB‘òÐ"TDA¨ VT­è‡¢Ò¨¼ òQ Ayªh¥‚à)•BB ŠRˆª>Ñ Tb'µó¹‰¿¿âÙ]Û;wwfîåaïìŽ7N²*ªD®u5³ã™;çÎÿœû¿wàN»Óî´;íNûnân“þ¤�·0¨;ôÿ€èÀx½É}â†ë°?&ÃEÚÌx± …ôÍ@tàwßù¦RJ£µ"T!õ@QW …@ a „H Í_(®yJÀ6'C"™"aÛ$ì ËBûuüZ ß÷ ”BiM*ü ¤*=ܪD©;ÀÏw�eúBB­ E*öãˆÈes8ÝN£Û2H)A6žûÁË/éOïèãù×^Žã˜ÁZãJ)[?J%èíà•#/h´ÆÊl°34ç*Àê€ÒøaH†(­ÄÐω|>Ïêê*¡c76º $2äïÙ'\O6.8y}ìàB‘¹·ßÆ1€¾úÜaá…ŠÕÔ‘Êmãs‡u™'¬X¿ �aH B|r÷ן£P(J¥(^)R¯Ô‘R¶¼´€�ÔÕòúšD–J”NžDΗ^ä݈¢aîýòc_ÛûõkG-VVW6�l ·í¶�|êé#bhǶm†!nÅe~y¾e 9Fhfªòƒ¡ÛA^GÎÏ#‹ã”ÆÆ7Ð)rÀpðø¾$^<|˜þîñ]À ÙÞQøJ¡”"“Ìpyò2•• îªK­V£^­oð¸ $ŽíÄʈ†�œà C÷;QØ{üI¤ÓÈ¥nÏc‹ë2}ü8ŸÙÚ­ôÎ;¿�r€–k€ß �ᇠ�LÙd´Gíàui²ëëÈ ãà8ƃ@ ñ"�Z!§Š&7Ú—Ö½@^x¾Oÿì,kÕ*Ëóóœ)-l À]€o[¹€fMöƒ¥Cz8@oäܸ ¯K‰;7ÇÄ™ vïÛÝ(d6LJããxà�½h-€œ©`�µ¿¿Oèû¬•ËŒ—]í5êMØdU`ÎPHw@…„ª1’c; â9¦âD5#Mœ™@.}@îþ<GåïýYüõí·8uêOÏüŒ=Ø ‘Ó¢™ $žçaÏÏ£*eV¯]cqu•)P÷€C!€*Pê7Ëø¬hÕÃ¥ŒÑ±’y-^ÓwïÛÍ„”§%¯?öÙzU?ûò÷Åb¢Ïó(_+“N§[ÏF V#¼pÏuq]—J¡€\žëžÔÀNòeã}7zÒê@?PJ5“3ªñä®röíÛ‡”’;w¢´FYŠíwmçrñ2ÓÓÓœàùžïŽ",‹òÂËBnÛÆº¬ëõZ ÏLd®áEô¶;Ñ5Ö­[¼•mb$VF¥”är¹fDŠ3ÿ<ùâ9vîØ‰mÛ¸®»!™SË‹tË¥©)Jå2 … ss¬KI­î 3û–“·”"6OXJk­9 âÔql§e¼Ýºîù½} Y` ¡ …‚èëïcÿ}ûIžï‘ÉdðHË*ž”¸‹‹\‚ó++íû!4Pfňûh¡f„¡jÔs36u©ù2hÐɱ\ÏmþHX÷Þ{/é-i‰D#J¡$“̰RYÁ™˜ ÕÛËT±ˆ[©0Ž`ÕóH&“Ø ‹dÒ˜2Ü—1.:Í+TšPéÖå\/È¢ÿ•–KLü{‚Òr)Š�åõ2£££xž×�g7¢Ô=µ@.ŸgñìYÜ•N{’R½ŽmÛôôôÐÝ•!›É`<ïµ+�Í›B­ÐJ7<î8-ÑMý1wåÊäÒìèѼùæ›<ûÒ‹âı?òί¾ËéÓ§I§Ó ÞKIO:ÉÊ¥K,MN2[©pQXd·f P(°ÅɈt2…1>²7¾Övg«)â:Åç?€çyäóyF+CüëÜ ?ùí l÷ÖõSÏKôl ð=ŸÉË“¤R)¶/¢¶fY˜˜àZ©Ä)ßÇJgÈõäDeYZXbbGëFÐíç@oÐ84©ÓÛÛËÞ½¬­­á¤ÓX5ŸååeÖì!Jå:­ÉÌO“àêûïS)—¹¸¶N)‘ ¯¿‘‘òù<‰DËBˆÍ KsIjßb­£3­ukò±ÁénH‚Lƒ£-êÀ¶mÛ¨«:=çÏS­×¹zõ*ÊRìܽ“|`áž=Ët*Eya¹•ÎÙî,ÃCà  è�!Z£ ‰˜×o™í‹pݘ´hoT£ã8­óxïvØ}ÏnºººH%möÝ¿ƒŸ=ÈÈÐõ‹çyøÕW©{K®ËDbmé&¿#ÏÀÀ�éTù]‹8¬X[7Ë뢠…Fk´c;¢¡ã$N·Ó(jAã7@.›kF)“Ì`Û6IÛfïÐ^r¹ 'þJßð0Çßxƒ]<ÂGî 3W®ÒßÛËž={ÈårXV˧ Ñô§h¡o6ëödÖZ£ôƆHŒI)7H Ä”W­5™L†ÕÙz³YæGG™>wŽ3cc¯ûd³Y†v 180Hº+Mm½Ö¢‚@ÄìQ›íNt¥µR|ï™'õÈCÜî^’øé_áéC‘ïïgzt”%×eTk–ì Z«25;…5¿‘ÑIX£ƒÂØ®h¡&û”B¯ûŠrÝçÄ»ÇtÛ[ˆjE“ºZj…c'¸«Ëak*Í®áa1yêK®ËTu]Tõ🰺Æ%o©ñ³€nl(r ñ ò~ض½rC�Ç4 „¸Éd'„Æ„:o!:zûçGîc¥XdòÂ&«ëzÂI“ô} !Ò©¤¶–h+ß´Ö-úGº7 ÝI4À[ïÏ=À`зšÅµ $M©³ceΪ_Ü¿ûž'F¾ýÑ{ï1>7wù—ccïÛ€^óž²kž1.Z°\–ÌÒ10ãŨNVdÚÜ�ëfÀº9v)c|tŒ¶=‘Ž<úè 3ccLÎÌ”Ž‹¿1ãE94yÚµ0nzÅ�“æz=Duøœ•‡:°3<êQ$" ÖSÞWŸ›¾4;»òûññ×Öjfyš1*À¤Qš‘XócÝ3ï“4‹vËøÛ‰@Ôj1/E†Æ£`Ç€X_9\)—ùÛ•+¯—J3Æø.3æªÑø3ÀŠ3¢†£Mݼ7ê·M!Ñ$h§b/³ã}½R™›™ùÃ_&'OÛͺÖ2ž]®Æt¾jKÒvqúè–NëlË|Ã"ßôDL£Ø±ódlû/º¾Øe¶G2&Ÿ&MÖŒ1A[¹Œz‹NР“m½É¹Ž½È2ƒF�jm«+–´«¦�ÌÏWqí3m<²íçú¶·×Ûô‡Š½°ý£„µIÔt¬¢”Ly\0×T[ŽÅ›ÚdK]ý·_ht[^´ oð•ÆQaÅPHÝäÓÓÍŽû7²ö1­Xy L2ê[|ôÓ|šh[ÏÞêÃ^Çí? Äž®™ðÄö����IEND®B`‚�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/drawingarea.rb�������������������������������������������0000644�0001750�0001750�00000015217�11701304107�021254� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: drawingarea.rb,v 1.5 2005/02/12 23:02:43 kzys Exp $ =begin = Drawing Area Gtk::DrawingArea is a blank area where you can draw custom displays of various kinds. This demo has two drawing areas. The checkerboard area shows how you can just draw something; all you have to do is write a signal handler for expose_event, as shown here. The 'scribble' area is a bit more advanced, and shows how to handle events such as button presses and mouse motion. Click the mouse and drag in the scribble area to draw squiggles. Resize the window to clear the area. =end require 'common' module Demo class DrawingArea < BasicWindow def initialize # Pixmap for scribble area, to store current scribbles @pixmap = nil super('Drawing Area') self.border_width = 8 vbox = Gtk::VBox.new(false, 8) vbox.border_width = 8 add(vbox) ## Create the checkerboard area label = Gtk::Label.new label.set_markup('<u>Checkerboard pattern</u>') vbox.pack_start(label, false, false, 0) frame = Gtk::Frame.new frame.shadow_type = Gtk::SHADOW_IN vbox.pack_start(frame, true, true, 0) da = Gtk::DrawingArea.new # set a minimum size da.set_size_request(100, 100) frame.add(da) da.signal_connect('expose_event') do |widget, event| checkerboard_expose(widget) end ## Create the scribble area label = Gtk::Label.new label.set_markup('<u>Scribble area</u>') vbox.pack_start(label, false, false, 0) frame = Gtk::Frame.new frame.shadow_type = Gtk::SHADOW_IN vbox.pack_start(frame, true, true, 0) da = Gtk::DrawingArea.new # set a minimum size da.set_size_request(100, 100) frame.add(da) # Signals used to handle backing pixmap da.signal_connect('expose_event') do |*args| scribble_expose_event(*args) end da.signal_connect('configure_event') do |widget, event| scribble_configure_event(widget) end # Event signals da.signal_connect('motion_notify_event') do |*args| scribble_motion_notify_event(*args) end da.signal_connect('button_press_event') do |*args| scribble_button_press_event(*args) end # Ask to receive events the drawing area doesn't normally # subscribe to da.events |= (Gdk::Event::LEAVE_NOTIFY_MASK | Gdk::Event::BUTTON_PRESS_MASK | Gdk::Event::POINTER_MOTION_MASK | Gdk::Event::POINTER_MOTION_HINT_MASK) end # Create a new pixmap of the appropriate size to store our scribbles def scribble_configure_event(widget) @pixmap = Gdk::Pixmap.new(self.window, widget.allocation.width, widget.allocation.height, -1) # Initialize the pixmap to white @pixmap.draw_rectangle(widget.style.white_gc, true, 0, 0, widget.allocation.width, widget.allocation.height) # We've handled the configure event, no need for further processing. return true end CHECK_SIZE = 10 SPACING = 2 def checkerboard_expose(da) # At the start of an expose handler, a clip region of event.area # is set on the window, and event.area has been cleared to the # widget's background color. The docs for # gdk_window_begin_paint_region give more details on how this # works. # It would be a bit more efficient to keep these # GC's around instead of recreating on each expose, but # this is the lazy/slow way. gc1 = Gdk::GC.new(da.window) gc1.rgb_fg_color = Gdk::Color.new(30000, 0, 30000) gc2 = Gdk::GC.new(da.window) gc2.rgb_fg_color = Gdk::Color.new(65535, 65535, 65535) xcount = 0 SPACING.step(da.allocation.width, CHECK_SIZE + SPACING) do |i| ycount = xcount % 2; # start with even/odd depending on row SPACING.step(da.allocation.height, CHECK_SIZE + SPACING) do |j| gc = if ycount % 2 == 1 gc1 else gc2 end # If we're outside event.area, this will do nothing. # It might be mildly more efficient if we handled # the clipping ourselves, but again we're feeling lazy. da.window.draw_rectangle(gc, true, i, j, CHECK_SIZE, CHECK_SIZE) ycount += 1 end xcount += 1 end # return true because we've handled this event, so no # further processing is required. # return true end # Redraw the screen from the pixmap def scribble_expose_event(widget, event) # We use the 'foreground GC' for the widget since it already exists, # but honestly any GC would work. The only thing to worry about # is whether the GC has an inappropriate clip region set. widget.window.draw_drawable(widget.style.fg_gc(widget.state), @pixmap, # Only copy the area that was exposed. event.area.x, event.area.y, event.area.x, event.area.y, event.area.width, event.area.height) return false end def draw_brush(widget, x, y) update_rect = Gdk::Rectangle.new(x - 3, y - 3, 6, 6) # Paint to the pixmap, where we store our state @pixmap.draw_rectangle(widget.style.black_gc, true, update_rect.x, update_rect.y, update_rect.width, update_rect.height) # Now invalidate the affected region of the drawing area. widget.window.invalidate(update_rect, false) end def scribble_button_press_event(widget, event) unless @pixmap # paranoia check, in case we haven't gotten a configure event return false end if event.button == 1 draw_brush(widget, event.x, event.y) end # We've handled the event, stop processing return true end def scribble_motion_notify_event(widget, event) unless @pixmap # paranoia check, in case we haven't gotten a configure event return false end # This call is very important; it requests the next motion event. # If you don't call Gdk::Window#pointer you'll only get # a single motion event. The reason is that we specified # Gdk::POINTER_MOTION_HINT_MASK to Gtk::Widget#set_events. # If we hadn't specified that, we could just use event.x, event.y # as the pointer location. But we'd also get deluged in events. # By requesting the next event as we handle the current one, # we avoid getting a huge number of events faster than we # can cope. win, x, y, state = event.window.pointer if (state & Gdk::Window::BUTTON1_MASK) != 0 draw_brush(widget, x, y) end # We've handled it, stop processing return true end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/item_factory.rb������������������������������������������0000644�0001750�0001750�00000005341�11701304107�021452� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: item_factory.rb,v 1.4 2005/02/12 23:02:43 kzys Exp $ =begin = Item Factory The Gtk::ItemFactory object allows the easy creation of menus from an array of descriptions of menu items. =end require 'common' module Demo class ItemFactory < BasicWindow def initialize super('Item Factory') accel_group = Gtk::AccelGroup.new item_factory = Gtk::ItemFactory.new(Gtk::ItemFactory::TYPE_MENU_BAR, '<main>', accel_group) add_accel_group(accel_group) set_border_width(0) ifactory_cb = proc do |data, widget| puts "ItemFactory: activated \"#{Gtk::ItemFactory.path_from_widget(widget)}\"" end menu_items = [ ['/_File'], ['/File/tearoff1', '<Tearoff>', nil, nil, ifactory_cb], ['/File/_New', '<Item>', '<control>N', nil, ifactory_cb], ['/File/_Open', '<Item>', '<control>O', nil, ifactory_cb], ['/File/_Save', '<Item>', '<control>S', nil, ifactory_cb], ['/File/Save _As...', '<Item>', nil, nil, ifactory_cb], ['/File/sep1', '<Separator>'], ['/File/_Quit', '<Item>', '<control>Q', nil, ifactory_cb], ['/_Preferences'], ['/_Preferences/_Color'], [ '/_Preferences/Color/_Red', '<RadioItem>', nil, nil, ifactory_cb], ['/_Preferences/Color/_Green', '/Preferences/Color/Red', nil, nil, ifactory_cb], ['/_Preferences/Color/_Blue', '/Preferences/Color/Red', nil, nil, ifactory_cb], ['/_Preferences/_Shape'], ['/_Preferences/Shape/_Square', '<RadioItem>', nil, nil, ifactory_cb], [ '/_Preferences/Shape/_Rectangle', '/Preferences/Shape/Square', nil, nil, ifactory_cb], [ '/_Preferences/Shape/_Oval', '/Preferences/Shape/Rectangle', nil, nil, ifactory_cb], [ '/_Help', '<LastBranch>'], [ '/Help/_About', '<Item>', nil, nil, ifactory_cb], ] item_factory.create_items(menu_items) item_factory.get_item('/Preferences/Shape/Oval').set_active(true) box1 = Gtk::VBox.new(false, 0) add(box1) box1.pack_start(item_factory.get_widget('<main>'), false, false, 0) label = Gtk::Label.new("Type\n<alt>\nto start") label.set_size_request(200, 200) label.set_alignment(0.5, 0.5) box1.pack_start(label, true, true, 0) separator = Gtk::HSeparator.new box1.pack_start(separator) box2 = Gtk::VBox.new(false, 10) box2.set_border_width(10) box1.pack_start(box2, false, true, 0) button = Gtk::Button.new('close') # TODO: Need signal_connect_swapped? button.signal_connect('clicked') do quit end box2.pack_start(button, true, true, 0) button.set_flags(Gtk::Widget::CAN_DEFAULT) button.grab_default end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/gnome-foot.png�������������������������������������������0000644�0001750�0001750�00000005544�11701304107�021225� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���/���0���§#â���gAMA�† 1è–_�� IDATxÚíYkl×y=wfvvf¹»Ü—ø¶)Q¢‡®Ūl#H¬¨qd×mT i›4N A †´(Šnì� šþ‹]Ë l´µì<ä§â8vÜ*–#%RDY$MJæŠÏå>¸»Ü÷Ìì¼·?2T ·€,‹T\À0»³çžïÜs¿ ¼_ï×e»/ýׇ Ýóµ»oß>Ð:qj¼Àýþ…^Ú·o߉¡¡m÷Xíæ—pöd åWMËjoô1Wð[â?kll,°cûСT*5â:6ÑM‹•$eW2þo�bï ð¿xù¥ÑÉ3§ò“Ç}ò3ºÿÆõü›¯}õ–xgô¥­PUÕÑjI´3&–cïò�¸ß+øûÆwM&â rÕ¿%vì£{vÝ€ïéîú”$+Œ¥µQ)à˜:ÚšN•¶Æ˜–ýU�¿OðdçΑ/ËR³7ODzHKR"ÉxôûÉDb›ªëƒ–!ÍzKéÏAHˆiY�0  ïíR»’ºÜedLU©ó(fàyêQŠ–¤ôïûàݵr‘]] Cj6ѪU!É”¶J-Ë€€a�³å>—­Áå奂�‹JŠ‚zµ‚|q “ççˆEï0Ÿyúçæm{©¦µA=åJ™|¶ã¬7xx#™¿l«ÔuSÛ6Ð}Wz6˜™#gÞ˜%r[%-¹M²«¥ƒ–i|¢Zov,e ˜|óŸçQÀpÀ"�zÕÀ}åÃ_¼ëówÔª•âñ_Ÿ¬hšÚU®ÔvycŠª­­ àѦ¬¤Y†|´)ÉB&_‚ã¸Ä; àq�Õ«¶ßtÓMb¹\^”¥–÷ÄcÏŽŒØ& ÁG�Ô}F+�îå8nÿu;·ÿhdhp6ÒZbæe�w7Û%5¿ÿ“· 3 3Ôjµ`*Íá-ñ賎û¤n˜�xÊw€�-�8pàÀéh$Rwmcg.›#««…\½Ùšm´d몂g ¬•Kdjê,ÍJ(”*Û}–ïðk_z�úâÏ~º'žHýíµ×^sk¤£#¥È-¦­Èdzü7vq5_ÏVONžKçÄøÔÌF8Î%5¯*²¸­'ö¹QcŽþêÎ]X„iÙÃ�žõõëÞ÷Ío„<øýëGG¿ïŒÞÐV”Ë4PŠ¥…y°ŒäÃz[¾®Öl}¶Ñ”Nj†™¿Òƽ$ó¯O¾‘?õÛñ)ž#»³…"Ñ �::Bâͪ¦Ï?ôàƒ±OìûøK× îiTËðAªDZõ*ÄpÍz0 m[”6–V 1YQ¿ àO|¹mªÏKO½ø_·gìƒÿ^ªÔ†|Ÿ6<JÛ{÷îíØ÷ñ[ÖÓÛ󇦮AWUšžž Z[¡Õê±-„åž_¢ƒ½ R\«Ò|©B,ÇÐ¥à/%òõ¯ß+&S)í§?å5JiÖó¼–a~dÙökÏ?ÿÜýÃÃ#¦È-È­:YLŸC«^%Íz”RO$`êáàôÄ42Ù²«eâ÷ÈÓ� ›Å<33=ýÍ­[·þ}³¶úØ£ó?öø?Î-eu=OýÁ#¸¿¯ï+ŽmžâÂòò+‹°-,Ç‘Žpº¦]ÓŒÇH_w ÇÇ'×5®û»9ÁìᇾwCW*ñmÓÐ#µµר–¯ëÙ’<448°€5<<|<—³l›– +¨UÊ`–D¢QpG]Ç ÒD2‰JµŠÅ•<$Y¹˜2�Ô6­aŸxâpu'ÀóŽ€Î-­ X®†cÑð?ˆ¢pw,ù Òr±€Å¹4ÕÕ6 ð<µ,“0 ÏóÐn+¨V*ôìôyœ™z“x…o‘G|ð›ãógÎNåÂ<{¸+ÿÂj©J.,­ Úhaë@ï®T"±€&šõ14ª,An«Ð4XÉd’´šuÌÎ/’ó1y~†yqšð �m37)娩³÷'bQÏ0ÌÏi†É –D‰D’‚¦¡¡\ÈB… šÖ*5Äã1œ9;A³…UrjâmJ y‹< �þÀ¿i7 <k´äoøLÝ`@7¬çD!([¦N’½4(ˆ°-¢ˆC[1sþ<òÅ5;y–ê¿cÛÐ0àQ�GÿÖÉ»Ñÿ¥|ÞóÓâ�¿¶§ Gz뵪ËNETŠy˜†ÏóÀ³ ¦gçà·ö3P@€€=üÃÇ?”ÚÒuÝ)K-” ùåñññ=u$ ÀÚ¨M þËÖüŠª†u]3µ¶Ì b®ëRÏs‰¢(t9·JJ•ú:‹/û2™à�À‘gŸ¾iûжGú®ùièımPÏõRïýûo½ùÇÿyüô½�¤ ?I@znAn·U…Rt˜†NÃÑN(R“6 Ô›õONm�ÿ`~ø·¿u_߇wíz™òq×¶‰çºTn5`èÇA­Þ`‹åê„ ?e˜ÖAå6<�³Z«ç®èq¶e!à‰(ŠðÛÔ—Èì[¤ÓéÄbz&¤*R]½�Y[Íö-Z.®"[(a>“ƒiÙŸðÄ¥âûoå²¹‰ë¯Ù#vD�P0Ƕ‰`Y®ëooÌÃÏ<—WšÕ'oûØ-_n˱LƒºA±œYA¦P„iÙ�òì͘˜¹óK˯êºF M%‘αM,Ë¢§+…Á¾"ƒýä¸å—~yâŸ^=ùú3,ÇÑžAÒOV³×u±V­_\Ùwâ>ïzVY©TÕ?øÀŽ/ÏlË$ŽãÀ²,DÂ!ù�M%c¡î-‰”¤¨¯™–ýV0íù¥ÌÌŸÿåçìélV+T‘%drLÌ\€ãº�0ày?m¸lÐ’•Úøë'ÇFGîL%“4D2IEMÀ £ÔëM‰F>ûéOÝy3Šõ¨·°ã׳ݽý}±X|wo_oÿÊü,µl ¶ãbi¥�ãúå�uSÜÆ/#[(=948ðÇ `zz{a[aY᎞GPIg,¾íÚí#ð úúûHu¡^-CmËà¸�Š¥]XÉ_äÀÄ;ñú+™{¿˜>¾¶V™WU ¶mƒåX0, Ï£4ÚC<‘ЪW©®©`Yº¦"³Fni¥|¹•e̤Pk´Ößû� ï$>\é|Þr=×NÆ"·«í6  C�JY¦Ç’b!ǶÈZ±@MC#Å\†VË«¤V)cöÂ=vjªn¬çüïøÌ»› Þ[«5ò‚ ìòÜVI’a[xŽƒØÑA¢qD¢1†×¶‰ ŠXYZ�¥ Éd2ôÔÙÌgrç[�óçAWåfD/Wk3Çý‘G½„iZ„eâyxž'�ˆe™„BD1D8–%kkeL›%ÇOOÂõ<øáí²æ^-ðÔõ¼FµÞœ$ 1-;Ñ”dhªF$©EmS'–eQ]Ó‰m0Mƒ,g2xýó8vê,Õ~7ð|Æ/çjf£Š0Ö½%ñÏÑŽÐ^Â0l8$Òî-I° ƒ(J=j;.–²«XÈäˆaZëÞÊbMoÖåÛ;M©C| ð-Q®8΂<‚< ‰‚<e†ú^N}Æßôg8ÞE�DÜ à»~Ž×|F=ÿq}??àvnÿ®þh³ŠñAõû7"ÛtûŸW|/?ç ­÷ø·CÀ—ñ󽽞ó߯÷ë*Öø À樕ÇF����IEND®B`‚������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/button_box.rb��������������������������������������������0000644�0001750�0001750�00000004325�11701304107�021151� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: button_box.rb,v 1.3 2005/02/12 23:02:43 kzys Exp $ =begin = Button Boxes The Button Box widgets are used to arrange buttons with padding. =end require 'common' module Demo class ButtonBox < BasicWindow def initialize super('Button Boxes') set_border_width(10) main_vbox = Gtk::VBox.new(false, 0) add(main_vbox) frame_horiz = Gtk::Frame.new('Horizontal Button Boxes') main_vbox.pack_start(frame_horiz, true, true, 10) vbox = Gtk::VBox.new(false, 0) vbox.set_border_width(10) frame_horiz.add(vbox) vbox.pack_start(create_bbox(true, 'Spread', 40, Gtk::ButtonBox::SPREAD), true, true, 0) vbox.pack_start(create_bbox(true, 'Edge', 40, Gtk::ButtonBox::EDGE), true, true, 5) vbox.pack_start(create_bbox(true, 'Start', 40, Gtk::ButtonBox::START), true, true, 5) vbox.pack_start(create_bbox(true, 'End', 40, Gtk::ButtonBox::END), true, true, 5) frame_vert = Gtk::Frame.new('Vertical Button Boxes') main_vbox.pack_start(frame_vert, true, true, 10) hbox = Gtk::HBox.new(false, 0) hbox.set_border_width(10) frame_vert.add(hbox) hbox.pack_start(create_bbox(false, 'Spread', 30, Gtk::ButtonBox::SPREAD), true, true, 0) hbox.pack_start(create_bbox(false, 'Edge', 30, Gtk::ButtonBox::EDGE), true, true, 5) hbox.pack_start(create_bbox(false, 'Start', 30, Gtk::ButtonBox::START), true, true, 5) hbox.pack_start(create_bbox(false, 'End', 30, Gtk::ButtonBox::END), true, true, 5) end def create_bbox(horizontal, title, spacing, layout) frame = Gtk::Frame.new(title) bbox = if horizontal Gtk::HButtonBox.new else Gtk::VButtonBox.new end bbox.set_border_width(5) frame.add(bbox) bbox.layout_style = layout bbox.set_spacing(spacing) [Gtk::Stock::OK, Gtk::Stock::CANCEL, Gtk::Stock::HELP].each do |stock| button = Gtk::Button.new(stock) bbox.add(button) end return frame end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/entry_completion.rb��������������������������������������0000644�0001750�0001750�00000003041�11701304107�022352� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # $Id: entry_completion.rb,v 1.3 2005/02/25 17:09:24 kzys Exp $ =begin = Entry Completion (EntryCompletion) GtkEntryCompletion provides a mechanism for adding support for completion in GtkEntry. =end require 'common' module Demo class EntryCompletion < Gtk::Dialog def initialize super('GtkEntryCompletion', nil, # parent 0, [Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_NONE]) self.resizable = false signal_connect('response') do self.destroy end vbox = Gtk::VBox.new(false, 5) self.vbox.pack_start(vbox, true, true) vbox.border_width = 5 label = Gtk::Label.new label.markup = 'Completion demo, try writing <b>total</b> or <b>gnome</b> for example' vbox.pack_start(label, false, false) # Create our entry entry = Gtk::Entry.new vbox.pack_start(entry, false, false) # Create the completion object completion = Gtk::EntryCompletion.new # Assign the completion to the entry entry.completion = completion # Create a tree model and use it as the completion model completion.model = create_completion_model # Use model column 0 as the text column completion.text_column = 0 end def create_completion_model store = Gtk::ListStore.new(String) %w(GNOME total totally).each do |word| iter = store.append iter[0] = word end store end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-line-cap.rb����������������������������������������0000644�0001750�0001750�00000002261�11701304107�021546� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-line-cap.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Line Cap This demo shows how to use GDK and cairo to set line cap. From http://cairographics.org/samples/set_line_cap.html. =end require 'common' module Demo class CairoLineCap < CairoWindow def initialize super('cairo line cap') end def draw(cr) cr.set_line_width(0.12) cr.set_line_cap(Cairo::LINE_CAP_BUTT) # default cr.move_to(0.25, 0.2) cr.line_to(0.25, 0.8) cr.stroke cr.set_line_cap(Cairo::LINE_CAP_ROUND) cr.move_to(0.5, 0.2) cr.line_to(0.5, 0.8) cr.stroke cr.set_line_cap(Cairo::LINE_CAP_SQUARE) cr.move_to(0.75, 0.2) cr.line_to(0.75, 0.8) cr.stroke # draw helping lines cr.set_source_rgba(1, 0.2, 0.2) cr.set_line_width(0.01) cr.move_to(0.25, 0.2) cr.line_to(0.25, 0.8) cr.move_to(0.5, 0.2) cr.line_to(0.5, 0.8) cr.move_to(0.75, 0.2) cr.line_to(0.75, 0.8) cr.stroke end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/demo.ui��������������������������������������������������0000644�0001750�0001750�00000027402�11701304107�017725� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> <interface> <object class="GtkListStore" id="liststore1"> <columns> <column type="gchararray"/> <column type="gchararray"/> <column type="gint"/> <column type="gchararray"/> </columns> <data> <row> <col id="0">John</col> <col id="1">Doe</col> <col id="2">25</col> <col id="3">This is the John Doe row</col> </row> <row> <col id="0">Mary</col> <col id="1">Dole</col> <col id="2">50</col> <col id="3">This is the Mary Dole row</col> </row> </data> </object> <object class="GtkUIManager" id="uimanager"> <child> <object class="GtkActionGroup" id="DefaultActions"> <child> <object class="GtkAction" id="Copy"> <property name="name">Copy</property> <property name="tooltip" translatable="yes">Copy selected object into the clipboard</property> <property name="stock_id">gtk-copy</property> </object> </child> <child> <object class="GtkAction" id="Cut"> <property name="name">Cut</property> <property name="tooltip" translatable="yes">Cut selected object into the clipboard</property> <property name="stock_id">gtk-cut</property> </object> </child> <child> <object class="GtkAction" id="EditMenu"> <property name="name">EditMenu</property> <property name="label" translatable="yes">_Edit</property> </object> </child> <child> <object class="GtkAction" id="FileMenu"> <property name="name">FileMenu</property> <property name="label" translatable="yes">_File</property> </object> </child> <child> <object class="GtkAction" id="New"> <property name="name">New</property> <property name="tooltip" translatable="yes">Create a new file</property> <property name="stock_id">gtk-new</property> </object> </child> <child> <object class="GtkAction" id="Open"> <property name="name">Open</property> <property name="tooltip" translatable="yes">Open a file</property> <property name="stock_id">gtk-open</property> </object> </child> <child> <object class="GtkAction" id="Paste"> <property name="name">Paste</property> <property name="tooltip" translatable="yes">Paste object from the Clipboard</property> <property name="stock_id">gtk-paste</property> </object> </child> <child> <object class="GtkAction" id="Quit"> <property name="name">Quit</property> <property name="tooltip" translatable="yes">Quit the program</property> <property name="stock_id">gtk-quit</property> <signal handler="quit_activate" name="activate"/> </object> </child> <child> <object class="GtkAction" id="Save"> <property name="name">Save</property> <property name="is_important">True</property> <property name="tooltip" translatable="yes">Save a file</property> <property name="stock_id">gtk-save</property> </object> </child> <child> <object class="GtkAction" id="SaveAs"> <property name="name">SaveAs</property> <property name="tooltip" translatable="yes">Save with a different name</property> <property name="stock_id">gtk-save-as</property> </object> </child> <child> <object class="GtkAction" id="HelpMenu"> <property name="name">HelpMenu</property> <property name="label" translatable="yes">_Help</property> </object> </child> <child> <object class="GtkAction" id="About"> <property name="name">About</property> <property name="stock_id">gtk-about</property> <signal handler="about_activate" name="activate"/> </object> <accelerator key="F1"/> </child> </object> </child> <ui> <menubar name="menubar1"> <menu action="FileMenu" name="FileMenu"> <menuitem action="New" name="New"/> <menuitem action="Open" name="Open"/> <menuitem action="Save" name="Save"/> <menuitem action="SaveAs" name="SaveAs"/> <separator/> <menuitem action="Quit" name="Quit"/> </menu> <menu action="EditMenu"> <menuitem action="Copy" name="Copy"/> <menuitem action="Cut" name="Cut"/> <menuitem action="Paste" name="Paste"/> </menu> <menu action="HelpMenu" name="HelpMenu"> <menuitem action="About" name="About"/> </menu> </menubar> <toolbar name="toolbar1"> <toolitem action="New" name="New"/> <toolitem action="Open" name="Open"/> <toolitem action="Save" name="Save"/> <separator/> <toolitem action="Copy" name="Copy"/> <toolitem action="Cut" name="Cut"/> <toolitem action="Paste" name="Paste"/> </toolbar> </ui> </object> <object class="GtkAboutDialog" id="aboutdialog1"> <property name="program-name" translatable="yes">GtkBuilder demo</property> <accessibility> <relation target="window1" type="subwindow-of"/> </accessibility> </object> <object class="GtkWindow" id="window1"> <property name="default_height">250</property> <property name="default_width">440</property> <property name="title">GtkBuilder demo</property> <child> <object class="GtkVBox" id="vbox1"> <property name="visible">True</property> <child> <object constructor="uimanager" class="GtkMenuBar" id="menubar1"> <property name="visible">True</property> <child internal-child="accessible"> <object class="AtkObject" id="a11y-menubar"> <property name="AtkObject::accessible-name">The menubar</property> </object> </child> </object> <packing> <property name="expand">False</property> </packing> </child> <child> <object constructor="uimanager" class="GtkToolbar" id="toolbar1"> <property name="visible">True</property> <child internal-child="accessible"> <object class="AtkObject" id="a11y-toolbar"> <property name="AtkObject::accessible-name">The toolbar</property> </object> </child> </object> <packing> <property name="expand">False</property> <property name="position">1</property> </packing> </child> <child> <object class="GtkScrolledWindow" id="scrolledwindow1"> <property name="hscrollbar_policy">automatic</property> <property name="shadow_type">in</property> <property name="visible">True</property> <property name="vscrollbar_policy">automatic</property> <child> <object class="GtkTreeView" id="treeview1"> <property name="visible">True</property> <property name="model">liststore1</property> <property name="tooltip-column">3</property> <child internal-child="accessible"> <object class="AtkObject" id="a11y-treeview"> <property name="AtkObject::accessible-name">Name list</property> <property name="AtkObject::accessible-description"> A list of person with name, surname and age columns </property> </object> </child> <child> <object class="GtkTreeViewColumn" id="column1"> <property name="title">Name</property> <child> <object class="GtkCellRendererText" id="renderer1"/> <attributes> <attribute name="text">0</attribute> </attributes> </child> </object> </child> <child> <object class="GtkTreeViewColumn" id="column2"> <property name="title">Surname</property> <child> <object class="GtkCellRendererText" id="renderer2"/> <attributes> <attribute name="text">1</attribute> </attributes> </child> </object> </child> <child> <object class="GtkTreeViewColumn" id="column3"> <property name="title">Age</property> <child> <object class="GtkCellRendererText" id="renderer3"/> <attributes> <attribute name="text">2</attribute> </attributes> </child> </object> </child> </object> </child> <accessibility> <action action_name="move-cursor" description="Move the cursor to select another person."/> </accessibility> </object> <packing> <property name="position">2</property> </packing> </child> <child> <object class="GtkStatusbar" id="statusbar1"> <property name="visible">True</property> </object> <packing> <property name="expand">False</property> <property name="position">3</property> </packing> </child> </object> </child> </object> </interface> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/gtk-logo-rgb.gif�����������������������������������������0000644�0001750�0001750�00000014433�11701304107�021424� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89ak�Œ�ç��ÿÿÿïûõïô󪫹ÔÄèÔÜÔ˜¸­Æ¹ÅÄ/L”\lÀu’x 4# "7èÕï„x¤:Z¬5d Y$]'+4 ."dª¢Ü»Ò¼-E76Z7nNdlG7]9<E$.˜,d `jn'$2H*XDMM7,>$7L 5(4…=`Ûëà-LE*48  ; &M–=rá2fÆpˆz$L-M¸>vâ!C‚ÌåÚ %<’/e®o{,D´9MG 'Þõç=WW +T›,[Ÿ’ª¬43\Ç,  7gÓOkw1U» Ã¸DVr¦” ‚¤Œ=!2kFZûîú&Rl #4Td\ھس˜JmÍ ,š~¬ÕÌâ($;DL&p,X%I 5'iU!¤):ÉFA9GDjÓÔÖÕ<HõNL—91>e²)<9 H ØFE‚,)7 ëIKj)%6#&¨89;4P 4E&¶@<G[žL%7)\4T**b4ö^d"f)G#X$*TLZ'' Å9CªA5ß?Jo3&o' <,T2¶5<V\+}/ 9Ƴԑ|­–†Ì& Hêãòº¥×¢–¼É»áíìïïÛ÷…oŸ6|‚ެ¦‡¹B\VƒàrЬ7WOxÐgŽt\„Nr”OT^¢B¬ZY_-¬1ž:¬AÑ@$œ,Ú’ÜGÆF;à<XÕªá<è<äÈí5¹9 D1r4ÖµÜ5Ó8+Š.(¸,Fd&•+r+‡;§?š]¶z<œ9š<\JhN¦T»œÊJlH2‚4&¤*»”ƈ4,ƒ/3Æ7t"F$t*%|!“4´,<X "H88i’'79<žÒœRtXŠV~<‚„ˆ‡]Š˜Œb„[+aìx€^6LŽFœ¦t¬ˆS j9yz^„nFt–n¤nŠLÿÿÿÿÿÿÿÿÿÿÿÿ,����k�Œ��þ�H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“  \yR€@—/YÊ4s`€fê4 €�T D@Ájî\Y ƒ†F0B… .`È t)I 8tððD#*Œ ÁÀ‰pkŒñâu$'N H1BÅ ,ZXuñb¸ˆáDZw#Œ+d¨˜Ñ†ƒ,lÜ`P 9t¬p€¸D¨7Ø!ƒ•8`PÃÁfjôð‘ƒ÷͈/LŠšš¢J /‚ÐèÐÁ†l Hܸ!Þ9zg²âmi84‹þ3 @¤AlÓvÀbôeE²gÇŽ=¥K„%þ!#%ÄAÈÆÙhÓÕ€Coõiç`S´pC~£ô§P�A %HWÂtm‘vCñÉÇ |>4˜âÞ•pA àYhPJ,A‡~(Ût,0ñC&Η"ŠCÎwÅa¥…†Œ9ñŽˆÝ Û” @¡ƒƒ¼5¤ÚqGZp¤X@QHñ"\Ö6eS´d–¦Xä–:¼�b¥˜R\T¥Ž 2AdvP0CMà  àp%‘õ ‰ƒ„¥ÝpÊRBY±D‡ÞMwÙlBL‘å h6¥l5„¢zP §þÜ10abK%qE‹9JY‚@+ÀªõÂ,Ø6儳æGÁ‚[j7°•¢2YЀët»Vaâ-œ:®ù…›#š,4!*}Ù51‚¬¥a° ü™ë¡šÈ"¶ùmÆB¥Nh[¿•V0…vCú0A ¸†TIZ´p&š:º *ƒLˆ(®¸³"›,¸h: ­‰¼1ÑBùÅ’�[àŠ˜?8„[û;B: ¬ÃLÖ­;n|ÃpΗƒ¢$#F*`EÉÂuY ‚>¨C·ãF9âÀB«èCÝJÕ7Ô ôƒC#‰æ(ª¨–áÞ0BB¸ºÂ�GÉ@­fÍàþœCd6t·uCÞsù®yNDWAš†[ÖÍzv'»%Ô ­ŠÍÖ7\]¼ð凇‰€îœsSÑ�¹�QTýaÜ[É`hRš"€Œ.ÙYúðÅe-d¦,Ù Ë÷BÓ¡¬âJAÂçqA´v`0@i,ÂUAì½<¶ñ@¿™Ø\b‰â'×^ÊcDÆQÖP†«pò6"˜Áù †ù›zkÖ|¸U)<ŠKô)\ *ÅŠõaI ÀO¿6S³Ø¹ê~E�ÌJ�šEêM˜ÃNþU»e-RrÊÁïJÓŠ…(!'€AÐT6 ¬{ZÚŽun7®”è„þ*ªÙ£æÄ›{ÉæC.H`ÐR¸%­Ì¯èŠ@œ0ƒ<�1RÀ€ ä¶DMM-NCS| '·4áY?`ÂØ„ðUˆ&Ü[‘ìW4¸ÀB�èŠf ƒ#\àjà€âÖ½ïõîY`€Ø‡(@¸½¡h°MØ\0„ïOwK$]œb!‹Ö•`!Ã,† °¡ nxCà ¼qP€_íz'‰Ìn#ãXHG ‰7´€B,j±† Ø!Vàc Ô9ÌlÈbtðAAn Tdî FFüÆjì© ÷¸HF&îm :¸.fÄ |ÈBìðÁ”wþÀCÌt€@ ,\Ц€|u°š½¹Ÿø@׃’±xDœ#o¨°† HF»èD x ìá4àCü€<üpá¢Æ»¬1!Œp] ‹4©ªmljôC別ˆÆ‚ hÀÒP2ôÂ6¸À/:º…#Ðà€DIñ 3¹èÓ4Ÿ§p;Žý€GºØ"Õòƒ–q>è¤ÅL ¤áÀ†\…A‚ #(yÌ B ˆ©â!„‚‹.PƒB”¯§>0\ ƒ&™ön`CøÁ¦bv™`òƒ½ó->`Èà k0ˆA aÜ@ Å@H�‘†#ð!ª~Åþ"øY>¨ ôÓRWÛ‚&ÍQ>ÞT™ÝzGÂéJWXÁ†(c´¤%-%JP âÐäxjb[R? áE|@¬$@:·‹\c÷ô‡± @A—åÕÃVpOX�Ä€n~I{Œ°i€"NÐ Œ”»xðÃ"PúÇ#`€ X«oü6Á(ÁnKÀ ®¤I¹êVG¸ÁÝç7н@2ˆðA¤REp ñÇI! .X£‰˜ ·`+c,øAC‡Æ?qQàr¯”O~€‹ÖÀ% ÆØotõ«ŒDªAyiÄBÚ‡Ë ^æN ½úŒ@’®ëØþˆ$®$à°¿ÔÁ"ó¥,C¿¤….t™ŸR$$�Š Š`¿ dƒÔÀ‡4”á€(Š‚tš&ÖvÒæë Œ°„ Ôµk‰ñ]f¬vÄ^Ć©>¢Ðx ÃS£ùâ#À¡Uõ Í<Ô1±Þ`"7{“N#È SÎ5±‰ñ쌷<C!8Bmû ë©"R­tHJôÁH%EÂ…=pSæt ‡=4`BPƒ  1ZR+;ºÂ€K4lbHt@°Ôvu¡AmK µåÃ$119ú` ž›’"¥¤Þ-ý� hÀdù°ü*[Ï÷&FþK ´$�”˜Øàåjÿ 4`ƒ$±àHafÜë͆P‘A'Ç»$[ ¸\àR˜†~I-ê<›˜½ûVm%8´ò–—ôÕöCÁ-q‡?XâE ÿ˜@§—Ct a]6°Àrá"…=ôÂÞNû²Ù{ׄ8â-¯µºË¬@\‹PƒÑ·xɳòf6`@Ò°ëÚRîS9•Y‚Ô"D�‡ Ô‰«»|ªsÈv.¡OK e·…¤ƒg1@ Ù„ÒP<ä£-Ÿ]d ) $�•è@mYþyîÂL°5é™�P�Ž=]-hKZ3!)\£Þ£–²½)þaˆ¦ƒÓuÑ(ðˆFfåçî#ñ’Z{ª~�ÄÊÝ7P˜ÙtpÆX`… ³WÞ‡{£v 6À &Æ ŠU¶€¾'À!Àu…¦ R° °æ– l~x€ /Ö!¹C<½Á •sE@W4€ qe€  ¾ `ÐÎ eßGyQ§Z |j` ž ctP‹°mPhs�fBzß%X5¾”ŸÀ�ièU‡e÷†}ØG ¾@Yp †@O@jÙÀCÑ� `ÂÇ€ †Òv&È] MrØ]o` | 7ÀR¡‘n1Ði6àþAZ’yÑ•†»’6�\Xb¾ÐUÚ Ò–„ܵ ~ô0ËDVR@Üc‡f _w&(>�\pˆÞA•Ð ‡{ÝH$Ћ$ÐKGZáPPÖ I$Ó‡qàyÝå¬8hùáw±um– ÜàW‚Ї~è�ÐCà ÇP‹K° ·§ƒËVZo!A @ŽæHW¦l˜{À!q` [s –Àâr|ðÜE¸ŒÝµ ‹�F·”à øÑ‹K@o2¨}ѵrˆpqö #—<Ƹ÷´ t@~EAM)^ˆÁo`un "ems þ H†�œ`а Ýpޤ¥ y|–ŽpÊðqÊЀ~¦0°ø’Û[ßà’€$x_—Hˆ~4à¤7Uƒ` 6Ð�r¥ “¨ƒÁ  Ù`6P”r—_#W àtúÕ < ‘3@2›€É7UtPcA”}‚x° !¥„0Uß�6�Œ¸``†`à §gáW `Ž¥æÇdŒO@2Ü@}YR‘Pc€t&¢ˆj 16„°`|pxð ‹`Oƒž¹ ½È)• l9já 2$ mIZað°0°o± ß@|~… ¬Øš•öG~þ· „p àP×ø ƒ@A€‘æÈ $0oë°“£¶{ê Ëà™ÑUœpñlJ/À nÀ†  X•.²Lmà~ð€à߇¸QrÙ`Yðä™ Â�rÄ  ìUQ™qŽ.Òƒ‘ú)ÎøŸ±õ8˜ÙiJâ@Rt âÙ‹A€™¶G Ý`6P¡%Îð; ]Ê€‚áR ¹ˆbô l�ÏRÜ  j0ÕmÀ—o€ùväð~â飊@jÊ`‡H¦`à †€ %F‘ùAÈ _hbU†wÉФå› ¥{Xm„ kjt¦Ôr’Pþtʦ ÚAY`žÄ l†b)Z!7¦pqeŒq¬ã"›° µY|‚ ¥ýÈù4Un``pˆ`p¨j™Ž6à fðÌ` ÌÀ ÂU–•ÊC¡`r ¡'�ä/ùyH [èW5 O wÌ�‰·óh*¤Ê°<„$°ù¨oq‹À«�Qð"}PUTJ¬(•F÷”S% `¡ŽZŸdZ¦%œ0޵.Apg2 ÃÍ�®OðG›–`›.§ ¢Zl°m÷Ø®K€6¯¤e¿Ù!7° °Î`‘ú£»ð“GWÎÖ¤N:Щ–pþ®.7Á^üX‹v{ZRnpl¦&f²ˆAËp Yà Šͺ­(†ô€²dò",+Å÷ á¢åš®®Ù•Œù®fÙ_Ú!ÎÀ cˆ+äÉ›¹Ø“`ЭõÀI°œŠ° [m3$Š+~@séz]êW‘ðÞ—£¶™BëP™!KàžÉ ¿yÚ€²€&Xäð‹·°VJ ^PkmöW[ìZi ÚZbG‰+4`>š2ð\ô©lëà!GP (+`µEp[hXWR·¥7+[€ÀŠ"y›’f™o 2 !‹¡…g] ¡€²Q þDÛ`Ÿ–|€µ G^Éf7à}Ê ¢ˆ1™Ë›¾ÃÙ–£u¾>š” !�•0h}ðj`¹¹km»ËšÉZ|tp­% ¸ù•o¢žŸœ‚&¾Ð…ÑU¤„j a½æu›[m~ /˾Õö ,§ (V$P¦©{`�wºº% Á Q 7``ç€ k°»¥qšÌC6pgxv“•¦7Ù‹©[f0²Ê¶ f2%`)Á‚ŇŸ7òb`Å÷Wt A$0Ÿ£f¤â¢·c¦ YYà“&æ `H7p‰ !�`&PܲŸçä w…æ êÉŽÂùþØP­ ù›#\)Ç`Æ¤å ¨¢ °vƒÆç ÇêçWTL·3[ûk<tÞÀˆ¶.0¤;ˆlv-Ì�½djQ4Š ¦ÔRರ† .Š´ìrYŒ|œgÇ @‹gt‰­ÂU`à“Á ‹< ŽŒÇ�Hm` Œ`KxË%`˜›lhz¼+F\b^¬ž¬wÁ¶ÅŒœÐ Ý`ƒpJÁ›'29ÍŸHu¥QªÅ·Í$€«ÄP´Ò¾TÄmмä ÝÀ /š*ѤoA*Ê]yКߋ»Ü•Þá�¼¡ì‚þ¼lÉœÀ#¼ pJZÌ�/" €þ‡ÀüVà ¯å‡l`ϰ¶O„ùÐy¬ÅŠ;ZŽè¡w k¡OÐ %Æ€/râ"Lœ ÀŠûx‡Õ¶ ­ù¿xͱ¥³’Ѿ™Ap¶y¦ á ´<;eŠŒ&Þ ‹ƒè�‡Gh 8]Õ%5[ùA¶ÉøŒ‹%– *Ó¬IêÑŒ¨ÌVëê“é` qà ßÐe—u©ù0€@Óp]hžæ4íË­ù1º~}ŒHZÝ@ -ò�o@™j0£×˜o[yP %€ÃÕVGG lÙ.€{¹Ù¾P†µÅ  ¡ ¡i ‹` €0„�Ì`tír�%-Àˆ³¼þi€·_j‘j`�›R tá{*�® èá’Ãêr1 ÇÍŒ~ålö¡&öºù¡Ïš}õ¶©Êk)… Ô+Z°\ñ¶yo ÏøØo½¿~Ð"˜gß\KàÕâüÀæ� Pr i=‡@ ƒöb–°§V„�â{§Å\ ƒˆzÀ‘xÌÛz¨5)øð)9 û-Ú×GÀÒæážxÅSÜ"Ÿ\bÝ`¾H“[ààÊ&™A@T\<°bÁi…°Oå"§äã×-râ:² ü‘Djƒ ù"»! ) )) €.Â=îr!>U˜Pþ lbzˆ•Ðˋ؈÷êT7œ £M…Ð’o å!¾ ÁΜM¡Ç° DMÝrI 7¸¥îà× £ Âç¹Z^h‚%ì “‰× êÀ;º\Xæ;°î°�L3íãÙ¬ -ÒËë¡^m¾ k6)ÅÆ!�F@ ï GçéíãEè4ÞÇt<YÔº(`]"�º€ ¬qåÒ k›¼¿×nsÙþ¼ÛN KÝZ–`¦á"¡ í`åbµe¹W<C”ýîÎ+eGYGˆ‘øþª�‹3�º°B•R‘®å0Ù%ÐqjÛ%Æ*c àÎ0JRþçÁ»Øx%ààxv” œRúPª`@%UxŒ`˜€$Ú¾í%+0 ¿íPEtÞÚèîWûägȈKG¤¡\°0âQ�kp[ÐBÕ5M´j›½l•ˆ,LÒ† 2@ç¡ àS AQœRÆ ü¼Lu—ö� 2ÀnA|лP9÷¢kÛÉ<BuethÏ÷á« rð�k²&A\ì™Ïj-ã²EÏ÷°S¾!+üe¥‘ùK§¼Ê~ňWŽoZùuuñ°É~0C¸q玥 ¯Ï€ QÐoò`Éß%A]bÐ�ŸþÃûû �OÀrî�z§ÈCš_æ@ ¥‰.ý<1µðTÖÇH Ñ¡”A‹¯@þQ •áA0ßéþ�QÂ3sY\¸á D‰x^�<„QâDŠ-^Ęq"»4Jи`cáHaZ88RâB }h„SæL‹;– 1²Ä ÔF)òxÏáÄ—4EúðZrŽ´ÄÊ€‘ î¹LšU«Æ¢ÉœQâ aP8‰q! ½­mÝÊ´c¡Á 7nð˜QBM±·}ýZLbAFÎ <ˆÐõïâ¿¢ˆ,lÏaQÅŒ-kݷϨ¡—=·}@¤/•?ŸNÀjÖ­]¿†5 �;�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/expander.rb����������������������������������������������0000644�0001750�0001750�00000002045�11701304107�020571� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # $Id: expander.rb,v 1.2 2005/02/25 17:09:25 kzys Exp $ =begin = Expander (Expander) GtkExpander allows to provide additional content that is initially hidden. This is also known as "disclosure triangle". =end require 'common' module Demo class Expander < Gtk::Dialog def initialize super('GtkExpander', nil, # parent 0, [Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_NONE]) self.resizable = false signal_connect('response') do self.destroy end vbox = Gtk::VBox.new(false, 5) self.vbox.pack_start(vbox, true, true) vbox.border_width = 5 label = Gtk::Label.new('Expander demo. CLick on the triangle for details.') vbox.pack_start(label, false, false) # Create the expander expander = Gtk::Expander.new('Details') vbox.pack_start(expander, false, false) expander.add(Gtk::Label.new('Details can be shown or hidden.')) end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/changedisplay.rb�����������������������������������������0000644�0001750�0001750�00000026332�11701304107�021603� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: changedisplay.rb,v 1.6 2005/07/30 11:22:15 mutoh Exp $ =begin = Change Display Demonstrates migrating a window between different displays and screens. A display is a mouse and keyboard with some number of associated monitors. A screen is a set of monitors grouped into a single physical work area. The neat thing about having multiple displays is that they can be on a completely separate computers, as long as there is a network connection to the computer where the application is running. Only some of the windowing systems where GTK+ runs have the concept of multiple displays and screens. (The X Window System is the main example.) Other windowing systems can only handle one keyboard and mouse, and combine all monitors into a single screen. This is a moderately complex example, and demonstrates: - Tracking the currently open displays and screens - Changing the screen for a window - Letting the user choose a window by clicking on it - Using Gtk::ListStore and Gtk::TreeView - Using Gtk::Dialog =end require 'common' module Demo class ChangeDisplay < Gtk::Dialog # These enumerations provide symbolic names for the columns # in the two GtkListStore models. DISPLAY_COLUMN_NAME, DISPLAY_COLUMN_DISPLAY = 0, 1 SCREEN_COLUMN_NUMBER, SCREEN_COLUMN_SCREEN = 0, 1 # Main entry point. If the dialog for this demo doesn't yet exist, creates # it. Otherwise, destroys it. def initialize @size_group = nil @display_model = nil @screen_model = nil @screen_selection = nil @current_display = nil @current_screen = nil super('Change Screen or display', nil, # parent Gtk::Dialog::NO_SEPARATOR, [Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_CLOSE], ['Change', Gtk::Dialog::RESPONSE_OK]) set_default_size(300, 400) signal_connect('response') do |dialog, response_id| if response_id == Gtk::Dialog::RESPONSE_OK if Gtk.check_version?(2, 2, 0) query_change_display else puts "This sample requires GTK+ 2.2.0 or later" end else destroy # Gtk.main_quit? end end signal_connect('destroy') do end unless Gtk.check_version?(2, 2, 0) vbox.add(Gtk::Label.new("This sample requires GTK+ 2.2.0 or later")) return end vbox = Gtk::VBox.new(false, 5) vbox.set_border_width(8) self.vbox.pack_start(vbox, true, true) @size_group = Gtk::SizeGroup.new(Gtk::SizeGroup::HORIZONTAL) frame = create_display_frame vbox.pack_start(frame, true, true) frame = create_screen_frame vbox.pack_start(frame, true, true) initialize_displays end # Adds all currently open displays to our list of displays, # and set up a signal connection so that we'll be notified # when displays are opened in the future as well. def initialize_displays manager = Gdk::DisplayManager.get manager.displays.each do |display| add_display(display) end handler_id = manager.signal_connect('display_opened') do |display| add_display(display) end signal_connect('destroy') do manager.signal_handler_disconnect(handler_id) end end # Fills in the screen list based on the current display def fill_screens @screen_model.clear if @current_display n_screens = @current_display.n_screens n_screens.times do |i| iter = @screen_model.append iter.set_value(SCREEN_COLUMN_NUMBER, i) iter.set_value(SCREEN_COLUMN_SCREEN, @current_display.get_screen(i)) if i == 0 @screen_selection.select_iter(iter) end end end end # Creates the 'Display' frame in the main window. def create_display_frame frame, tree_view, button_vbox = create_frame('Display') button = left_align_button_new('_Open...') button.signal_connect('clicked') do open_display_cb end button_vbox.pack_start(button, false, false, 0) button = left_align_button_new('_Close') button.signal_connect('clicked') do if @current_display @current_display.close end end button_vbox.pack_start(button, false, false, 0) @display_model = Gtk::ListStore.new(String, Gdk::Display) tree_view.model = @display_model column = Gtk::TreeViewColumn.new('Name', Gtk::CellRendererText.new, {'text' => DISPLAY_COLUMN_NAME}) tree_view.append_column(column) selection = tree_view.selection selection.signal_connect('changed') do display_changed_cb(selection) end return frame end # Creates the 'Screen' frame in the main window. def create_screen_frame frame, tree_view, button_vbox = create_frame('Screen') @screen_model = Gtk::ListStore.new(Integer, Gdk::Screen) tree_view.model = @screen_model column = Gtk::TreeViewColumn.new('Number', Gtk::CellRendererText.new, {'text' => SCREEN_COLUMN_NUMBER}) tree_view.append_column(column) @screen_selection = tree_view.selection @screen_selection.signal_connect('changed') do |selection| @current_screen = if iter = selection.selected iter.get_value(SCREEN_COLUMN_SCREEN) else nil end end return frame end # This function is used both for creating the 'Display' and # 'Screen' frames, since they have a similar structure. The # caller hooks up the right context for the value returned # in tree_view, and packs any relevant buttons into button_vbox. def create_frame(title) frame = Gtk::Frame.new(title) hbox = Gtk::HBox.new(false, 8) hbox.set_border_width(8) frame.add(hbox) scrollwin = Gtk::ScrolledWindow.new scrollwin.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC) scrollwin.shadow_type = Gtk::SHADOW_IN hbox.pack_start(scrollwin, true, true) tree_view = Gtk::TreeView.new tree_view.headers_visible = false scrollwin.add(tree_view) selection = tree_view.selection selection.mode = Gtk::SELECTION_BROWSE button_vbox = Gtk::VBox.new(false, 5) hbox.pack_start(button_vbox, false, false) @size_group.add_widget(button_vbox) return frame, tree_view, button_vbox end # If we have a stack of buttons, it often looks better if their contents # are left-aligned, rather than centered. This function creates a button # and left-aligns it contents. def left_align_button_new(label) button = Gtk::Button.new(label, true) button.child.set_alignment(0.0, 0.5) return button end # Prompts the user for a toplevel window to move, and then moves # that window to the currently selected display def query_change_display screen = self.window.screen toplevel = query_for_toplevel(screen, "Please select the toplevel\n"+ "to move to the new screen") if toplevel toplevel.screen = @current_screen else screen.display.beep end end # Asks the user to click on a window, then waits for them click # the mouse. When the mouse is released, returns the toplevel # window under the pointer, or nil, if there is none. def query_for_toplevel(screen, prompt) toplevel = nil display = screen.display popup = Gtk::Window.new(Gtk::Window::POPUP) popup.screen = screen popup.modal = true popup.window_position = Gtk::Window::POS_CENTER frame = Gtk::Frame.new frame.set_shadow_type(Gtk::SHADOW_OUT) popup.add(frame) label = Gtk::Label.new(prompt) label.set_padding(10, 10) frame.add(label) popup.show_all # TODO: Gdk::Cursor.new(screen.display, Gdk::Cursor::CROSSHAIR) cursor = Gdk::Cursor.new(Gdk::Cursor::CROSSHAIR) if Gdk::pointer_grab(popup.window, false, Gdk::Event::BUTTON_RELEASE_MASK, nil, cursor, Gdk::Event::CURRENT_TIME) == Gdk::GRAB_SUCCESS clicked = false popup.signal_connect('button-release-event') do clicked = true end # Process events until clicked is set by button_release_event_cb. # We pass in may_block = true since we want to wait if there # are no events currently. until clicked Gtk.main_iteration # TODO: GLib::main_context_iteration(nil, true) toplevel = find_toplevel_at_pointer(screen.display) if toplevel == popup toplevel = nil end end popup.destroy Gdk.flush # Really release the grab return toplevel end end # Finds the toplevel window under the mouse pointer, if any. def find_toplevel_at_pointer(display) pointer_window, x, y = display.window_at_pointer # The user data field of a GdkWindow is used to store a pointer # to the widget that created it. if pointer_window widget = pointer_window.user_data end return (if widget widget.toplevel else nil end) end # Called when the user clicks on 'Open...' in the display # frame. Prompts for a new display, and then opens a connection # to that display. def open_display_cb dialog = Gtk::Dialog.new('Open Display', self, Gtk::Dialog::MODAL, [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], [Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK]) dialog.default_response = Gtk::Dialog::RESPONSE_OK display_entry = Gtk::Entry.new display_entry.activates_default = true dialog_label = Gtk::Label.new("Please enter the name of\nthe new display\n") dialog.vbox.add(dialog_label) dialog.vbox.add(display_entry) display_entry.grab_focus dialog.vbox.show_all result = nil until result response_id = dialog.run break if response_id != Gtk::Dialog::RESPONSE_OK new_screen_name = display_entry.text unless new_screen_name.empty? begin result = Gdk::Dispaly.open(new_screen_name) rescue dialog_label.text = "Can't open display :\n\t%s\nplease try another one\n" % [new_screen_name] end end end dialog.destroy end # Called when the selected row in the display list changes. # Updates info.current_display, then refills the list of # screens. def display_changed_cb(selection) @current_display = if iter = selection.selected iter.get_value(DISPLAY_COLUMN_DISPLAY) else nil end fill_screens end # Adds a new display to our list of displays, and connects # to the 'closed' signal so that we can remove it from the # list of displays again. def add_display(display) iter = @display_model.append iter.set_value(DISPLAY_COLUMN_NAME, display.name) iter.set_value(DISPLAY_COLUMN_DISPLAY, display) handler_id = display.signal_connect('closed') do display_closed_cb(display) end signal_connect('destroy') do display.signal_handler_disconnect(handler_id) end end # Called when one of the currently open displays is closed. # Remove it from our list of displays. def display_closed_cb(display) @display_model.each do |model, path, iter| tmp_display = iter.get_value( DISPLAY_COLUMN_DISPLAY) if tmp_display == display @display_model.remove(iter) break end end end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/gnome-applets.png����������������������������������������0000644�0001750�0001750�00000006022�11701304107�021716� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA��± üa���bKGD�ÿ�ÿ�ÿ ½§“��� pHYs��`��`zxE���tIMEÐ (–ªŠ�� IDATxÚíšYŒ×u†¿Ú«»§»g㢤9Ò–dk¡MÑ–I¦@Ó’F² 'P q^b=Fâ ûI6ò”<YÀÉk Iˆ Ã@LÙ¢hQ#ÒÒˆÔˆξw³»ºö5}‹(·‡Ãe˜<)à  =·«þÿžÿœ{î¹#qs—$L.ÜK…¿gK ÷·ü’v�\&¬H aùý-'r#äpU˜V¸W csÀ1,'“þoÈg])€6„é˽‘Ï~ „@Ðc±°[â õ: (à&PÌOÝsp÷3_:z|dxèpÉ4È’4'±á:NàØöZ³eM¯®o¾}ú½÷ߘ]XYïóÅ3ãB|üy@.€Ï—Ÿ|ìsû¿ö•§¿yûÞ½_“$‰,ËH’˜(Š ‚�ß÷ñ<ϱ±]ÛvX[ßøÉÙ>úÑGç/nÁÉN(×9ó&P*/ÿ»üüÄñíÞ=r¿a–0Œº®£ëŠª **²,!!‘IR–B–¡ªò§†û_쯹³ +baGRR¶/dS*ÿ·?ø«{ïýÄ·+}5Õ,•)•ʦ‰n¨ª†ªj]ðR7² Ò4%Mb’$%NRUS¥/ì®Ì.¬¾ÙCâ–È¥£ç³ÿwóò÷ÆÆö}£Tî£T*S®”)•K覉a訪Š,É¿$’4!‰câ8!Šc’8¤‡ëåÅ•Í;%¡l3ûj>û?øþwÿäÀ»ÿ¼\©R*•)U*”ÊeÌRÃ4Q5EQd².ø$é‚•ð}Ÿ(މã˜8ŽˆÂˆLÊ•Kzk}³}¦^o˜„| ÚÓÇž¿{ß_꺎¦i¦iš˜å åJõŠ™å ¦ib˜š¦Ñ¯‚”¡êЬ )2²¬¢¨ ²,S)›ß®Ò°t+üNö9vôñoišnÊ²Š¢¨hš†¦F Ã,Q*WɃYӻ໱Ð/Ë Š,Q®T”î½$uM–es°¿ï;B¦ê6x®›@±Lкdp°ÿÅî edYñ)Ë2ªªc–úPUýÊwH2ùxI’d Y’»™ª\'Nº*‘$©û2Yz±RÖïr½a/ÈÛ¥Ï'}x"K3²,#ËR²,ƒ,íf–4%ŽC|Ï&ŽÃ+ß!Æåã³4#ÍR$Ecy­I(Wøpz«ã`Ù®RíÓ¿*2Ý {AÞ¦XS«ÕÊ#išt2‰ºEDa@x¾‡çv| ðˆÂ€(êŽKÓ˜$‰IÓ„4MI’Çqyá…xüèqÖ7/Ó±]TM£R.?ôÝŒämô¯jŠüÉ8ê®°QÔøÝ•Öw\§sÅ|×Á÷}¿K" C¢(&ŽºÙÈj5Ñ4z—^z‰;Flj☡¡a\Ï¿è/xAÚ‰®H“dO…A@„¾‹ï{xŽƒëØ¸¶…ݱpm ×±ñß÷|·;>£( ˜››g}}3gÞ£^ïgâ¹ç¨Vð\›,Í€ r£IÝ®úŒ¢Ðô=ïÊ +Ë]¾išE!ªª‘×B¹¼ßÅs=<ÏízÊó‚�ÇõHâÿxí ‡wqäÈþú‡/£ëŠ¢*À° X¢àK®g]Ø.`$ÏóƒÀï‚Y_ßä¿Nüš8ΰ;mÛ¢cµéXÝOǶÄ÷Žcã:.žçŠø高øžËüü¿9u’0 ˜xî9ÒTUM€A &d¤]o0÷z ¸äâÜRóàø¾Û$I¢i9œýà<©¤òÈáдnž¿V5êx>—–™_fßþýì“eNœøtާŽ=Í/~þSJ†‰¨ uDµ*]Ë ÊUÖ(ùìCǧ/ÌÜÖ±]‚žxž³gÏ"e]ï¦iJŠ rñ|×qXZ\âÌÔ4—æ?È“?J…LNž& <×feeOßÿ‹ óÆek h 9b3tM]Í)Üq×þÿð…?:ôãþfæù³ïaee…ŸýçëŒÞ¹—O#IRV×6(—L.·ÚX–EÛ² ‚ñxæÙϳ²4χS°´¼€m;ŒŽÞN¬,^âÈçá×_KóŠW”í†À]kû©l³SSSkjæýÙ‰çYZ^å GŸâ¶½{ù‡ü'—ÛL›Æó|6M66[ôUk<ðÀƒ<úØcÿÒãÝSorñâǬo¬awl‚0$cöìÆ45ÖÖ79vü™ìäÉ“«À²ðBGr|-[y ßGËíÍÏOÿ¼Ùl›úxÅÅÆÇ0>>Îî]CܵŒGŽf×®aÂÀ'Í2,Ëbò·y·cÑhlà!žïá{>A!I…ƒÃÃ8V‹™ù¥ö=÷=X6Mó“¾ï¿½Å{Û8Ø*f9 xÿüÅWJ%ýI×q´Öåˬ­®ò¹‡?ÿþäÒ4¦ÝXãö=à I,ÌÏ’¥)aF1AAÅ1iS2M¢8¥¿V#ô¼ìÜôìlËþ÷êÄÄľW_}õN`¦ÐénvC“×C†ï‡Š¥¾ŠyŸë‡È²ÂÚê çΟ'=š–ÕÂî´ñ=? ñÿʪì!q#Ë2%䯯J¥ÆÐà�ozw}yus©Ùl^[[[«†aø« äëÙR–›­N§Z1ïlµÛ{² &'ß%ŠBÈRü Ä45â$&ŠÅ¬ûq% ’$¡© }• õZZµŠ¦›\º4c>{þ`˲fFFF5‹ÀA (lvnzSo�}Í–mÉÄw¾szrÀ¶;¨ªBÿ�Aà¡k*ª"“$ i’"+2Šª ©*¦aP¯Õì¯Ó_¯£éKË«ö/ßšœÎÁ–ã8‹Õju¤Õj'F!³›%{¡T;¶çÊ%IÒUU¦Z­aª*ÓW)£ë:•rÓ0é«”©×ê R«V©Öjhºž½õö鿩ɩ1Ã9ÐnµZoO¿>.´^n(ˆ‹íÁHôpZÀ°FÉFûòm»‡²f£Q¾{l CM쯡j*º¦#ÉJwK©t72�ïœy?üÍäÔ\ÇvÛâ™¶ ‘›'´ÿ ðmàõë©…¶# öÐVå,ˆ¦gç C3TEÙsï½uM×ÕáÁ!YQU)#ËÚm+_Üˆææ—Üóæ?%! ¯@ ÓCÀ^>üðãkõ¤ëÈR†(u÷cÀ3À—óâ¥e‘·Õž¼]lðÊÀA¡í¬“ë_x¸)nˆ¢î/€o�+Ûuï”›hîZÀQ`Q¼,ï<¸ùlúiŒO®ôŸ›U c‹g“7y³A|52ð”�7]èB‡Ð9p¯ ™@xqª ›bç–ÇÆo?ÞÏÞÞÝÚ§Eý~ªp·Ò{ ¸ÂÖ‚tc Řð€5à.àaàÍ[A€‚¾ëÀ}À/ eÇÕäfç bà\„ŠæŠßGÀYàëÀÏÄDí˜@®Å6ð$ðÓ-<ÐE/´E,¼·Eäà=ñ¬<VDâ8q³Å//™¥¯.Ù‹!¾â¦<+d£M`·ÈPV˜³ø<}þðCÑv±wêbÉ}H¤¾ÙB&*za+9Bÿ{€zÀçõ4zó³µQàâ­$Pr8ÓC 7zeÔ^š)|çÀoÕ©ž à²{Ãê‹üü Èy Õ·XÔ~o£$š¹Qá·aáðïjmöÓ¢õÒØ "˜E‘êÜÂB¦b xvœõÄÂP‹ZÔsž|µEkSØŽ%”_‰XòóüÝ{.^å˜52* @ñNÁwB�hŸÈJiOýÓ{È]´Xd¡ìZåò­8'ÞîZ† ®O º—¶YG2AdÇÝ;õ@ÔîÑzo—o«þøÿëÿÄõßÄÖAýkå����IEND®B`‚��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-text.rb��������������������������������������������0000644�0001750�0001750�00000002060�11701304107�021037� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-text.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Text This demo shows how to use GDK and cairo to show text. From http://cairographics.org/samples/text.html. =end require 'common' module Demo class CairoText < CairoWindow def initialize super('cairo text') end def draw(cr) cr.select_font_face("Sans", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_BOLD) cr.set_font_size(0.35) cr.move_to(0.04, 0.53) cr.show_text("Hello") cr.move_to(0.27, 0.65) cr.text_path("void") cr.set_source_rgba(0.5, 0.5, 1) cr.fill_preserve cr.set_source_rgba(0, 0, 0) cr.set_line_width(0.01) cr.stroke # draw helping lines cr.set_source_rgba(1,0.2,0.2, 0.6) cr.arc(0.04, 0.53, 0.02, 0, 2 * Math::PI) cr.arc(0.27, 0.65, 0.02, 0, 2 * Math::PI) cr.fill end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/gtk-demo/cairo-gradient.rb����������������������������������������0000644�0001750�0001750�00000001642�11701304107�021655� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-gradient.rb,v 1.2 2005/10/12 15:23:49 ktou Exp $ =begin = cairo/Gradient This demo shows how to use GDK and cairo to gradient. From http://cairographics.org/samples/gradient.html. =end require 'common' module Demo class CairoGradient < CairoWindow def initialize super('cairo gradient') end def draw(cr) pat = Cairo::LinearPattern.new(0.0, 0.0, 0.0, 1.0) pat.add_color_stop_rgb(1, 0, 0, 0) pat.add_color_stop_rgb(0, 1, 0, 0) cr.rectangle(0, 0, 1, 1) cr.set_source(pat) cr.fill pat = Cairo::RadialPattern.new(0.45, 0.4, 0.1, 0.4, 0.4, 0.5) pat.add_color_stop_rgba(0, 1, 1, 1, 0.8) pat.add_color_stop_rgba(1, 0, 0, 0) cr.set_source(pat) cr.arc(0.5, 0.5, 0.3, 0, 2 * Math::PI) cr.fill end end end ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/�������������������������������������������������������������0000755�0001750�0001750�00000000000�11740310343�015663� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/to_drawable.rb�����������������������������������������������0000644�0001750�0001750�00000001554�11701304107�020476� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin to_drawable.rb - Gdk::Pixbuf(GDK methods) sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: to_drawable.rb,v 1.6 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' filename = ARGV[0] unless filename puts "ruby #{$0} filename" exit(1) end pixbuf = Gdk::Pixbuf.new(filename) w = Gtk::Window.new("Drawable sample") w.realize w.signal_connect('delete-event') do Gtk.main_quit end d = Gtk::DrawingArea.new gc = Gdk::GC.new(w.window) d.signal_connect('expose-event') do |w, e| unless e.count > 0 width = w.allocation.width height = w.allocation.height pixbuf = pixbuf.scale(width, height) d.window.draw_pixbuf(gc, pixbuf, 0, 0, 0, 0, width, height, Gdk::RGB::DITHER_NORMAL, 0, 0) end true end w.add(d) w.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/drawing.rb���������������������������������������������������0000644�0001750�0001750�00000003662�11701304107�017650� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin drawing.rb - Gtk::Drawing sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: drawing.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' class Canvas < Gtk::DrawingArea def initialize super signal_connect("expose_event") { |w,e| expose_event(w,e) } signal_connect("configure_event") { |w, e| configure_event(w,e) } @buffer = nil @bgc = nil end def expose_event(w,e) unless @buffer.nil? rec = e.area w.window.draw_drawable(@bgc, @buffer, rec.x, rec.y, rec.x, rec.y, rec.width, rec.height) end false end def clear(b = @buffer) return if b.nil? g = b.size @bgc = self.style.bg_gc(self.state) if @bgc.nil? if (g[0] > 0 && g[1] > 0) b.draw_rectangle(@bgc, true, 0,0, g[0], g[1]) end end def configure_event(w,e) g = w.window.geometry if (g[2] > 0 && g[3] > 0) b = Gdk::Pixmap::new(w.window, g[2], g[3], -1) clear(b) if not @buffer.nil? g = @buffer.size b.draw_drawable(@bgc, @buffer, 0, 0, 0, 0, g[0], g[1]) end @buffer = b end true end end class A < Canvas def initialize super signal_connect("button_press_event") { |w,e| pressed(w,e) } set_events(Gdk::Event::BUTTON_PRESS_MASK) end def pressed(widget, ev) if not @last.nil? @buffer.draw_line(widget.style.fg_gc(widget.state), @last.x, @last.y, ev.x, ev.y) x1,x2 = if (@last.x < ev.x) then [@last.x, ev.x] else [ev.x, @last.x] end y1,y2 = if (@last.y < ev.y) then [@last.y, ev.y] else [ev.y, @last.y] end widget.queue_draw_area(x1, y1, x2 - x1 + 1, y2 - y1 + 1) end @last = nil @last = ev true end end window = Gtk::Window.new("drawing test") window.signal_connect("destroy") { Gtk.main_quit } canvas = A.new window.add(canvas) window.show_all Gtk::main ������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/settings.rb��������������������������������������������������0000644�0001750�0001750�00000002736�11701304107�020056� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin setting.rb - Gtk::Settings sample script. Copyright (C) 2004-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: settings.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' spec = GLib::Param::Int.new("integer", # name "Integer", # nick "Integer integer", # blurb 0, # min 10000, # max 0, # default GLib::Param::READABLE| GLib::Param::WRITABLE) enum = GLib::Param::Enum.new("enum", # name "Enum", # nick "Enum enum", # blurb GLib::Type["GdkCursorType"], #type Gdk::Cursor::ARROW, #default GLib::Param::READABLE| GLib::Param::WRITABLE) flags = GLib::Param::Flags.new("flags", # name "Flags", # nick "Flags flags", # blurb GLib::Type["GdkEventMask"], #type Gdk::Event::LEAVE_NOTIFY_MASK, #default GLib::Param::READABLE| GLib::Param::WRITABLE) p Gtk::Settings.rc_property_parse_color(spec, "{2222,44444,65535}").to_a p Gtk::Settings.rc_property_parse_enum(enum, "watch") p Gtk::Settings.rc_property_parse_flags(flags, "(scroll-mask|structure-mask)") p Gtk::Settings.rc_property_parse_requisition(spec, "{100, 200}") p Gtk::Settings.rc_property_parse_border(spec, "{100, 200, 300, 400}").to_a ����������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/button.rb����������������������������������������������������0000644�0001750�0001750�00000003167�11701304107�017530� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin button.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: button.rb,v 1.10 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("buttons") window.border_width = 0 box1 = Gtk::VBox.new(false, 0) window.add(box1) table = Gtk::Table.new(3, 3, false) table.set_row_spacings(5) table.set_column_spacings(5) table.set_border_width(10) box1.pack_start(table, true, true, 0) button = [] 0.upto(8) do |i| button.push Gtk::Button.new("button"+(i+1).to_s) end 0.upto(8) do |i| button[i].signal_connect("clicked") do |w| p [i] j = (i + 1) % 9 if button[j].visible? button[j].hide else button[j].show end end button[i].show end table.attach(button[0], 0, 1, 0, 1, nil, nil, 0, 0) table.attach(button[1], 1, 2, 1, 2, nil, nil, 0, 0) table.attach(button[2], 2, 3, 2, 3, nil, nil, 0, 0) table.attach(button[3], 0, 1, 2, 3, nil, nil, 0, 0) table.attach(button[4], 2, 3, 0, 1, nil, nil, 0, 0) table.attach(button[5], 1, 2, 2, 3, nil, nil, 0, 0) table.attach(button[6], 1, 2, 0, 1, nil, nil, 0, 0) table.attach(button[7], 2, 3, 1, 2, nil, nil, 0, 0) table.attach(button[8], 0, 1, 1, 2, nil, nil, 0, 0) separator = Gtk::HSeparator.new box1.pack_start(separator, false, true, 0) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) close = Gtk::Button.new("close") close.signal_connect("clicked") do Gtk.main_quit end box2.pack_start(close, true, true, 0) close.can_default = true close.grab_default window.show_all Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/misc_button.rb�����������������������������������������������0000644�0001750�0001750�00000002667�11701304107�020547� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin misc_button.rb - Ruby/GTK sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: misc_button.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 4, 0) puts "This sample requires GTK+ 2.4.0 or later" puts str exit end box = Gtk::VBox.new #Gtk::ColorButton colorbutton = Gtk::ColorButton.new colorbutton.signal_connect("color-set") do p colorbutton.color.to_a end box.add(colorbutton) #Gtk::FontButton fontbutton = Gtk::FontButton.new fontbutton.signal_connect("font-set") do p fontbutton.font_name end box.add(fontbutton) #Gtk::FileChooserButton(GTK+-2.6.0 or later) if str = Gtk.check_version(2, 6, 0) puts "Gtk::FileChooserButton requires GTK+ 2.6.0 or later" else filebutton = Gtk::FileChooserButton.new("Gtk::FileChooserButton", Gtk::FileChooser::ACTION_OPEN) filebutton.filename = GLib.home_dir filebutton.signal_connect("current-folder-changed") do |w, e| p filebutton.filename end box.add(filebutton) end #Quit quitbutton = Gtk::Button.new("Quit") quitbutton.signal_connect("clicked") do Gtk.main_quit end box.add(quitbutton) Gtk::Window.new.add(box).set_default_size(200, 100).show_all Gtk.main �������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/pointer_grab.rb����������������������������������������������0000644�0001750�0001750�00000001713�11701304107�020663� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin pointer_grab.rb - Gdk::Window#pointer_grab/ungrab sample script. Copyright (C) 2001-2006 Masao Mutoh<mutoh@highway.ne.jp> This program is licenced under the same licence as Ruby-GNOME. $Date: 2006/06/17 13:18:12 $ $Id: pointer_grab.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Pointer grab/ungrab sample") cursor = Gdk::Cursor.new(Gdk::Cursor::WATCH) button1 = Gtk::Button.new("Grab Window!") button2 = Gtk::Button.new("Ungrab Window!") button1.signal_connect('clicked') do Gdk.pointer_grab(window.window, true, Gdk::Event::BUTTON_PRESS_MASK, window.window, cursor, Gdk::Event::CURRENT_TIME) p Gdk.pointer_is_grabbed? end button2.signal_connect('clicked') do Gdk.pointer_ungrab(Gdk::Event::CURRENT_TIME) p Gdk.pointer_is_grabbed? end window.add(Gtk::VBox.new.add(button1).add(button2)) window.set_default_size(200,100).show_all window.signal_connect("destroy"){Gtk.main_quit} Gtk.main �����������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/aboutdialog.rb�����������������������������������������������0000644�0001750�0001750�00000002355�11701304107�020505� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin aboutdialog.rb - Ruby/GTK sample script. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: aboutdialog.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" puts str exit end Gtk::AboutDialog.set_email_hook {|about, link| p "email_hook" p link } Gtk::AboutDialog.set_url_hook {|about, link| p "url_hook" p link } a = Gtk::AboutDialog.new a.artists = ["Artist 1 <no1@foo.bar.com>", "Artist 2 <no2@foo.bar.com>"] a.authors = ["Author 1 <no1@foo.bar.com>", "Author 2 <no2@foo.bar.com>"] a.comments = "This is a sample script for Gtk::AboutDialog" a.copyright = "Copyright (C) 2005 Ruby-GNOME2 Project" a.documenters = ["Documenter 1 <no1@foo.bar.com>", "Documenter 2 <no2@foo.bar.com>"] a.license = "This program is licenced under the same licence as Ruby-GNOME2." a.logo = Gdk::Pixbuf.new("gnome-logo-icon.png") a.program_name = "Gtk::AboutDialog sample" a.translator_credits = "Translator 1\nTranslator 2\n" a.version = "1.0.0" a.website = "http://ruby-gnome2.sourceforge.jp" a.website_label = "Ruby-GNOME2 Project Website" p a.run �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/threads.rb���������������������������������������������������0000644�0001750�0001750�00000002525�11701304107�017644� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin threads.rb - Ruby/GTK2 sample script. Copyright (c) 2003-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: threads.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' require 'thread' label = Gtk::Label.new Thread.new { (0...1000).each { |cnt| p "A:" + cnt.to_s label.label = "A:" + cnt.to_s sleep(2) } } start_button = Gtk::Button.new("start") stop_button = Gtk::Button.new("stop") start_button.signal_connect("clicked") do start_button.sensitive=false @th = Thread.new { (0...10).each { |cnt| p "B:" + cnt.to_s label.label = "B:" + cnt.to_s sleep(2) } @th = nil start_button.sensitive = true start_button.grab_focus stop_button.sensitive = false } stop_button.sensitive = true stop_button.grab_focus end stop_button.signal_connect("clicked") do if @th @th.kill puts "killed" @th = nil start_button.sensitive = true start_button.grab_focus stop_button.sensitive = false end end stop_button.sensitive = false box = Gtk::VBox.new. set_size_request(100,100) box << label << start_button << stop_button win = Gtk::Window.new << box win.show_all.signal_connect("delete_event") do p "Exiting..." Gtk.main_quit Thread.list.each {|t| t.kill } end Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/fileselection.rb���������������������������������������������0000644�0001750�0001750�00000001173�11701304107�021035� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin fileselection.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: fileselection.rb,v 1.10 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' puts "Deprecated. Use Gtk::FileChooserDialog instead." window = Gtk::FileSelection.new("file selection dialog") window.window_position = Gtk::Window::POS_MOUSE window.border_width = 0 ret = window.run if ret == Gtk::Dialog::RESPONSE_OK puts "OK" puts window.filename elsif ret == Gtk::Dialog::RESPONSE_CANCEL puts "CANCEL" puts window.filename end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/combobox.rb��������������������������������������������������0000644�0001750�0001750�00000003522�11701304107�020020� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin combobox.rb - Ruby/GTK sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: combobox.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 4, 0) puts "This sample requires GTK+ 2.4.0 or later" puts str exit end window = Gtk::Window.new("Gtk::ComboBox sample") window.signal_connect("destroy"){Gtk.main_quit} # # Text only # combo1 = Gtk::ComboBox.new ["foo", "bar", "fuga", "hoge"].each do |val| combo1.append_text(val) end combo1.active = 1 combo1.signal_connect("changed") do p "combo1: #{combo1.active}, #{combo1.active_iter[0]}" end # # Icon and text # model = Gtk::ListStore.new(Gdk::Pixbuf, String) [[Gtk::Stock::QUIT, "quit"], [Gtk::Stock::CANCEL, "cancel"], [Gtk::Stock::OK, "ok"]].each do |stock, name| iter = model.append iter[0] = window.render_icon(stock, Gtk::IconSize::MENU, "icon") iter[1] = name end combo2 = Gtk::ComboBox.new(model) # column 1 renderer = Gtk::CellRendererPixbuf.new combo2.pack_start(renderer, false) combo2.set_attributes(renderer, :pixbuf => 0) # column 2 renderer = Gtk::CellRendererText.new combo2.pack_start(renderer, true) combo2.set_attributes(renderer, :text => 1) combo2.active = 2 combo2.signal_connect("changed") do p "combo2: #{combo2.active}, #{combo2.active_iter[1]}" end # # Gtk::ComboBoxEntry # combo3 = Gtk::ComboBoxEntry.new ["foo", "bar", "fuga", "hoge"].each do |val| combo3.append_text(val) end combo3.active = 1 combo3.signal_connect("changed") do if combo3.active_iter p "combo3: #{combo3.active}, #{combo3.active_iter[0]}" end end # Show main window vbox = Gtk::VBox.new vbox.add(combo1).add(combo2).add(combo3) window.add(vbox).show_all Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/label.rb�����������������������������������������������������0000644�0001750�0001750�00000002042�11701304107�017263� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin label.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: label.rb,v 1.8 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' win = Gtk::Window.new("Gtk::Label sample") win.signal_connect("destroy"){Gtk.main_quit} label1 = Gtk::Label.new("_Not Use Mnemonic") label1.selectable = true label2 = Gtk::Label.new("_Use Mnemonic", true) label3 = Gtk::Label.new.set_markup(%Q[<markup><span size="xx-large" weight="bold" foreground="blue"><u>Ruby-GNOME2</u></span> is <span foreground="red" size="x-large"><i>cool</i></span>!</markup>], true) label4 = Gtk::Label.new.set_markup(%Q[<span foreground="#999900">_Not Use Mnemonic</span>]) label5 = Gtk::Label.new.set_markup(%Q[<span foreground="#009999">_Use Mnemonic</span>], true) box = Gtk::VBox.new box.add(label1) box.add(label2) box.add(label3) box.add(label4) box.add(label5) win.add(box).show_all # This can be called after realized only. label1.select_region(3, 8) Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/cairo-pong.rb������������������������������������������������0000755�0001750�0001750�00000010636�11701304107�020255� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin cairo-pong.rb - Ruby/GTK with cairo sample script. Original: gtkcairo sample by Evan Martins. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: cairo-pong.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require "gtk2" unless Gdk.cairo_available? raise "GTK+ 2.8.0 or later and cairo support are required." end module Pong class CenteredItem attr_accessor :x, :y attr_reader :width, :height def initialize(x, y, width, height) @x = x @y = y @width = width @height = height end def min_x @x - @width / 2 end def max_x @x + @width / 2 end def min_y @y - @height / 2 end def max_y @y + @height / 2 end end class CenteredCircle < CenteredItem def draw(cr) cr.translate(min_x, min_y) cr.scale(@width, @height) cr.arc(0.5, 0.5, 0.5, 0, 2 * Math::PI) cr.fill end end class CenteredRect < CenteredItem def draw(cr) cr.translate(min_x, min_y) cr.scale(@width, @height) cr.rectangle(0, 0, 1, 1) cr.fill end end class Ball < CenteredCircle attr_accessor :dx, :dy def initialize(dx=0.02, dy=0.02) super(0.8, 0.5, 0.04, 0.04) @dx = dx @dy = dy end def update @x += @dx @y += @dy # ball bouncing if max_y > 1 @y = 1 - (max_y - 1) @dy *= -1 elsif min_y < 0 @y -= min_y @dy *= -1 end if max_x > 1 @x = 1 - (max_x - 1) @dx *= -1 elsif min_x < 0 @x -= min_x @dx *= -1 end end end class Paddle < CenteredRect def initialize(field, x, y) super(x, y, 0.05, 0.3) @field = field end def update(ball) # is the ball coming towards us? if (ball.x < @x and ball.dx > 0) or (ball.x > @x and ball.dx < 0) # move to intercept it @y = ball.y end end def ball_hit?(ball) ball.y > min_y and ball.y < max_y end def update_ball(ball) if ball_hit?(ball) if ball.min_x < @x and ball.max_x > min_x # hit our left side ball.x -= (ball.max_x - min_x) ball.dx = -ball.dx elsif ball.max_x > @x and ball.min_x < max_x # hit our right side ball.x += (max_x - ball.min_x) ball.dx = -ball.dx end end end end class Field attr_accessor :width, :height def initialize(margin=0.05) @margin = margin @left_paddle = Paddle.new(self, @margin, 0.5) @right_paddle = Paddle.new(self, 1 - @margin, 0.7) @paddles = [@left_paddle, @right_paddle] @ball = Ball.new end def update @paddles.each do |paddle| paddle.update(@ball) end @ball.update @paddles.each do |paddle| paddle.update_ball(@ball) end end def draw(cr) cr.set_source_rgba(1, 1, 1) cr.rectangle(0, 0, 1, 1) cr.fill cr.save do cr.set_source_rgba(0.8, 0.8, 0.8, 0.8) cr.set_line_join(Cairo::LINE_JOIN_ROUND) @paddles.each do |paddle| cr.save {paddle.draw(cr)} end end cr.set_source_rgba(0, 0, 0) cr.save {@ball.draw(cr)} end end class Window < Gtk::Window def initialize(speed=30) super() @speed = speed self.title = 'Pong Demonstration' signal_connect('destroy') { Gtk.main_quit } signal_connect("key_press_event") do |widget, event| if event.state.control_mask? and event.keyval == Gdk::Keyval::GDK_q destroy true else false end end set_default_size(260, 200) @field = Field.new @drawing_area = Gtk::DrawingArea.new set_expose_event vb = Gtk::VBox.new(false, 5) vb.border_width = 10 vb.pack_start(@drawing_area, true, true, 0) vb.show_all add(vb) Gtk.timeout_add(@speed) do @field.update @drawing_area.queue_draw unless @drawing_area.destroyed? end end def set_expose_event @drawing_area.signal_connect('expose_event') do |widget, event| cr = widget.window.create_cairo_context cr.scale(*widget.window.size) @field.draw(cr) end end end end Pong::Window.new.show_all Gtk.main ��������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/textbuffer_serialize.rb��������������������������������������0000644�0001750�0001750�00000010516�11701304107�022436� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin textbuffer_serialize.rb - Ruby/GTK sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: textbuffer_serialize.rb,v 1.1 2006/11/23 08:39:13 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 10, 0) puts "This sample requires GTK+ 2.10.0 or later" puts str exit end current_folder = ENV['HOME'] || "." file_name = "serialized.dat" textview = Gtk::TextView.new textview.set_size_request(600, 400) buffer = textview.buffer buffer.text = DATA.read format = buffer.serialize_formats[0] buffer.register_serialize_target(nil) buffer.register_deserialize_target(nil) window = Gtk::Window.new("Gtk::TextBuffer Serialize Demo") vbox = Gtk::VBox.new serialize_button = Gtk::FileChooserButton.new("Serialize to a file", Gtk::FileChooser::ACTION_OPEN) deserialize_button = Gtk::FileChooserButton.new("Serialize to a file", Gtk::FileChooser::ACTION_OPEN) serialize_button.current_folder = current_folder deserialize_button.current_folder = current_folder toolbar = Gtk::Toolbar.new toolbar.append(Gtk::Stock::OPEN, "Deserialize from a file") do dialog = Gtk::FileChooserDialog.new("Deserialize from a file", window, Gtk::FileChooser::ACTION_OPEN, nil, [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT]) dialog.filename = File.expand_path(file_name) if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT file_name = dialog.filename File.open(file_name, "rb") {|io| buffer.delete(buffer.start_iter, buffer.end_iter) buffer.deserialize(buffer, format, buffer.start_iter, io.read) } end dialog.destroy end toolbar.append(Gtk::Stock::SAVE, "Serialize to a file") do dialog = Gtk::FileChooserDialog.new("Serialize from a file", window, Gtk::FileChooser::ACTION_SAVE, nil, [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT]) dialog.current_name = file_name if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT file_name = dialog.filename File.open(file_name, "wb") {|io| io.write(buffer.serialize(buffer, format, buffer.start_iter, buffer.end_iter)) } end dialog.destroy end toolbar.append(Gtk::Stock::CLEAR, "Clear all") do buffer.delete(buffer.start_iter, buffer.end_iter) end toolbar.append_space toolbar.append(Gtk::Stock::SELECT_COLOR, "Color the region") do dialog = Gtk::ColorSelectionDialog.new("Color the region") if dialog.run == Gtk::Dialog::RESPONSE_OK bounds = buffer.selection_bounds color = dialog.colorsel.current_color tag_name = color.to_a.inspect unless tag = buffer.tag_table.lookup(tag_name) tag = Gtk::TextTag.new(tag_name).set_foreground_gdk(color) end buffer.tag_table.add(tag) buffer.apply_tag(tag, bounds[0], bounds[1]) end dialog.destroy end toolbar.append(Gtk::Stock::SELECT_FONT, "Set a font to the region") do dialog = Gtk::FontSelectionDialog.new("Set font to the region") if dialog.run == Gtk::Dialog::RESPONSE_OK bounds = buffer.selection_bounds font = dialog.font_name unless tag = buffer.tag_table.lookup(font) tag = Gtk::TextTag.new(font).set_font(font) end buffer.tag_table.add(tag) buffer.apply_tag(tag, bounds[0], bounds[1]) end dialog.destroy end toolbar.append_space toolbar.append(Gtk::Stock::QUIT, "Quit this application") do Gtk.main_quit end vbox.pack_start(toolbar, false, false).add(Gtk::ScrolledWindow.new.add(textview)) window.add(vbox) window.show_all window.signal_connect("destroy") { Gtk.main_quit } Gtk.main __END__ This is a sample script for rich text serialization/deserialization. 1. Edit this text using font/color buttons. 2. Click save button and save this text (= serialize this as rich text to a file) 3. Click clear button and clear this text buffer. 4. Click load button and load the file which you save (= deserialize this). ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/uimanager2.xml�����������������������������������������������0000644�0001750�0001750�00000001576�11701304107�020446� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0"?> <ui> <menubar name='MenuBar'> <menu action='FileMenu'> <menuitem action='New'/> <menuitem action='Open'/> <menuitem action='Save'/> <menuitem action='SaveAs'/> <separator/> <menuitem action='Quit'/> </menu> <menu action='PreferencesMenu'> <menu action='ColorMenu'> <menuitem action='Red'/> <menuitem action='Green'/> <menuitem action='Blue'/> </menu> <menu action='ShapeMenu'> <menuitem action='Square'/> <menuitem action='Rectangle'/> <menuitem action='Oval'/> </menu> <menuitem action='Bold'/> </menu> <menu action='HelpMenu'> <menuitem action='About'/> </menu> </menubar> <toolbar name='ToolBar'> <toolitem action='Open'/> <toolitem action='Quit'/> <separator action='Sep1'/> <toolitem action='Logo'/> </toolbar> </ui> ����������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/t-gtksocket.rb�����������������������������������������������0000644�0001750�0001750�00000003311�11701304107�020443� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin Sample script using Gtk::Socket and Gtk::Plug. $ ruby t-gtksocket.rb Written by Alex Boussinet <mailto:dbug@wanadoo.fr> for testing purpose only. Copyright (c) 2003-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: t-gtksocket.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' class MyGtkSocket < Gtk::Window def initialize super("Gtk::Socket Test") set_window_position(Gtk::Window::POS_CENTER) signal_connect("delete_event"){Gtk::main_quit} @buttons = [] 6.times {|n| @buttons << Gtk::Button.new("Plug #{n}") @buttons.last.signal_connect("clicked"){ plug(n) } } @table = Gtk::Table.new(1, 2) @table.set_size_request(320, 200) add(@table) @vbox = Gtk::VBox.new(true, 5) @buttons.each{|b| @vbox.add(b) } @vbox.set_size_request(150, 190) @table.attach(@vbox, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL, 5, 5) @socket = Gtk::Socket.new @table.attach(@socket, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL, 5, 5) @socket.set_size_request(150, 150) show_all @xid = @socket.id @pid = 0 end def plug(arg) if @pid != 0 Process.kill("SIGKILL", @pid) Process.waitpid(@pid) begin @table.remove(@socket) unless @socket.destroyed? rescue ArgumentError # socket has been destroyed because child process finished unexpectedly end @socket = Gtk::Socket.new @table.attach(@socket, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL, 5, 5) @socket.set_size_request(150, 190) @socket.show @xid = @socket.id end @pid = fork { exec "ruby t-gtkplug.rb -x #{@xid} Plug#{arg}" } end end MyGtkSocket.new Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/treemodelfilter.rb�������������������������������������������0000644�0001750�0001750�00000002505�11701304107�021376� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin treemodelfilter.rb - Gtk::TreeModelFilter sample Copyright (c) 2004,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: treemodelfilter.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 4, 0) puts "This sample requires GTK+ 2.4.0 or later" puts str exit end ls = Gtk::ListStore.new(String, Integer) column1 = Gtk::TreeViewColumn.new("data1", Gtk::CellRendererText.new, {:text => 0}) column2 = Gtk::TreeViewColumn.new("data2", Gtk::CellRendererText.new, {:text => 1}) mf = Gtk::TreeModelFilter.new(ls) mf.set_visible_func do |model, iter| /a/ =~ iter[0] end mf.set_modify_func(String, String) do |model, iter, column| child_iter = model.convert_iter_to_child_iter(iter) if column == 0 child_iter[0] else "#{child_iter[1]} * 2 = #{child_iter[1] * 2}" end end treeview = Gtk::TreeView.new(mf) treeview.append_column(column1) treeview.append_column(column2) [ ["aaa", 1], ["aab", 2], ["aac", 3], ["bba", 4], ["bbb", 5], ["bbc", 6] ].each do |str, num| iter = ls.append iter[0] = str iter[1] = num end win = Gtk::Window.new("Gtk::TreeModelFilter sample") win.signal_connect("destroy"){Gtk.main_quit} win.add(treeview).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/style_property.rc��������������������������������������������0000644�0001750�0001750�00000000730�11701304107�021313� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* style_property.rc - Ruby/GTK sample rc file for style_property.rb. Copyright (c) 2004 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: style_property.rc,v 1.1 2004/01/25 15:52:38 mutoh Exp $ */ style "test-default" { bg[NORMAL] = { 0.80, 0.80, 0.40 } MyButton::focus-line-width = 3 MyButton::focus-line-pattern = "\10\2" MyButton::foo = 30 MyButton::bar = boat } class "MyButton" style "test-default" ����������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/t-gtkplug.rb�������������������������������������������������0000644�0001750�0001750�00000002620�11701304107�020124� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin Sample script using Gtk::Socket and Gtk::Plug. $ ruby t-gtksocket.rb Written by Alex Boussinet <mailto:dbug@wanadoo.fr> for testing purpose only. Copyright (c) 2003-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: t-gtkplug.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' class MyGtkPlug def initialize(xid, plug) plug = "Button" if plug.nil? if xid.nil? @window = Gtk::Window.new("Gtk::Plug Test") @window.set_default_size(250, 50) else @window = Gtk::Plug.new(xid.to_i) end @window.window_position = Gtk::Window::POS_CENTER @window.signal_connect("delete_event"){Gtk.main_quit} @vbox = Gtk::VBox.new(true, 5) @window.add(@vbox) @button1 = Gtk::Button.new(plug) @button1.signal_connect("clicked"){ $stderr.puts plug} @button2 = Gtk::Button.new("Exit") @button2.signal_connect("clicked"){Gtk.main_quit} # Exit button to test an unexpected end of child process by Gtk::Socket @vbox.add(@button1) @vbox.add(@button2) @window.show_all end end xid = nil ARGV.each_index { |i| arg = ARGV.at(i) if arg == "-x" if arg.length > 2 xid = arg[2..-1] else xid = ARGV.at(i + 1) ARGV.delete_at(i + 1) end xid = nil if xid.to_i <= 0 ARGV.delete_at(i) end } MyGtkPlug.new(xid, ARGV.shift) Gtk.main ����������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/entrycompletion.rb�������������������������������������������0000644�0001750�0001750�00000001471�11701304107�021444� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin entrycompletion.rb - Ruby/GTK sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. Enter "G", "t" on the entry box. $Id: entrycompletion.rb,v 1.4 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 4, 0) puts "This sample requires GTK+ 2.4.0 or later" puts str exit end window = Gtk::Window.new window.set_default_size(200, 200) entry = Gtk::Entry.new completion = Gtk::EntryCompletion.new entry.completion = completion model = Gtk::ListStore.new(String) ["GNOME", "total", "totally"].each do |v| iter = model.append iter[0] = v end completion.model = model completion.text_column = 0 window.add(entry).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/dialog2.rb���������������������������������������������������0000644�0001750�0001750�00000002041�11701304107�017524� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin dialog2.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: dialog2.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::Dialog sample2") button = Gtk::Button.new("Create Dialog") button.signal_connect("clicked") do dialog = Gtk::Dialog.new("Gtk::Dialog Sample 2", window, Gtk::Dialog::MODAL|Gtk::Dialog::NO_SEPARATOR, [Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK], [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL]) dialog.vbox.add(Gtk::Label.new("Gtk::Dialog Sample 2")) dialog.set_default_size(300, 300) dialog.vbox.show_all result = dialog.run case result when Gtk::Dialog::RESPONSE_OK p "OK" when Gtk::Dialog::RESPONSE_CANCEL p "Cancel" end dialog.destroy end window.add(button).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/image.rb�����������������������������������������������������0000644�0001750�0001750�00000001437�11701304107�017275� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin image.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: image.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Image") window.signal_connect("destroy") do Gtk.main_quit end window.border_width = 0 box1 = Gtk::VBox.new(false, 10) box1.border_width = 10 button = Gtk::Button.new box1.add(button) label = Gtk::Label.new("Gtk::Image\ntest") image = Gtk::Image.new("test.xpm") box2 = Gtk::HBox.new(false, 5).add(image).add(label) button.add(box2) box1.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked") do Gtk.main_quit end box1.add(button) window.add(box1).show_all Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/calendar.rb��������������������������������������������������0000644�0001750�0001750�00000002753�11701304107�017766� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin calendar.rb - Gtk::Calendar sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: calendar.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' cal = Gtk::Calendar.new w = Gtk::Window.new("Calendar sample") w.add(cal).show_all.signal_connect('delete_event') do Gtk.main_quit end date = Time.new cal.select_month(date.month, date.year) cal.select_day(date.day) cal.mark_day(date.day) #cal.clear_marks cal.display_options(Gtk::Calendar::SHOW_HEADING | Gtk::Calendar::SHOW_DAY_NAMES | Gtk::Calendar::NO_MONTH_CHANGE | Gtk::Calendar::SHOW_WEEK_NUMBERS | Gtk::Calendar::WEEK_START_MONDAY) year, month, day = cal.date puts "this is #{month} #{day}, #{year}" cal.signal_connect('day_selected') do year, month, day = cal.date puts "selected day: #{day}" end cal.signal_connect('month_changed') do year, month, day = cal.date puts "changed month: #{month}" end cal.signal_connect('day_selected_double_click') do year, month, day = cal.date puts "dclicked day: #{day}" end cal.signal_connect('prev_month') do year, month, day = cal.date puts "prev month: #{month}" end cal.signal_connect('next_month') do year, month, day = cal.date puts "next_month: #{month}" end cal.signal_connect('prev_year') do year, month, day = cal.date puts "prev_year: #{year}" end cal.signal_connect('next_year') do year, month, day = cal.date puts "next year: #{year}" end Gtk.main ���������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/test.xpm�����������������������������������������������������0000644�0001750�0001750�00000003767�11701304107�017403� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char *openfile[] = { /* width height num_colors chars_per_pixel */ " 20 19 66 2", /* colors */ ".. c None", ".# c #000000", ".a c #dfdfdf", ".b c #7f7f7f", ".c c #006f6f", ".d c #00efef", ".e c #009f9f", ".f c #004040", ".g c #00bfbf", ".h c #ff0000", ".i c #ffffff", ".j c #7f0000", ".k c #007070", ".l c #00ffff", ".m c #00a0a0", ".n c #004f4f", ".o c #00cfcf", ".p c #8f8f8f", ".q c #6f6f6f", ".r c #a0a0a0", ".s c #7f7f00", ".t c #007f7f", ".u c #5f5f5f", ".v c #707070", ".w c #00f0f0", ".x c #009090", ".y c #ffff00", ".z c #0000ff", ".A c #00afaf", ".B c #00d0d0", ".C c #00dfdf", ".D c #005f5f", ".E c #00b0b0", ".F c #001010", ".G c #00c0c0", ".H c #000f0f", ".I c #00007f", ".J c #005050", ".K c #002f2f", ".L c #dfcfcf", ".M c #dfd0d0", ".N c #006060", ".O c #00e0e0", ".P c #00ff00", ".Q c #002020", ".R c #dfc0c0", ".S c #008080", ".T c #001f1f", ".U c #003f3f", ".V c #007f00", ".W c #00000f", ".X c #000010", ".Y c #00001f", ".Z c #000020", ".0 c #00002f", ".1 c #000030", ".2 c #00003f", ".3 c #000040", ".4 c #00004f", ".5 c #000050", ".6 c #00005f", ".7 c #000060", ".8 c #00006f", ".9 c #000070", "#. c #7f7f80", "## c #9f9f9f", /* pixels */ "........................................", "........................................", "........................................", ".......................#.#.#............", ".....................#.......#...#......", "...............................#.#......", ".......#.#.#.................#.#.#......", ".....#.y.i.y.#.#.#.#.#.#.#..............", ".....#.i.y.i.y.i.y.i.y.i.#..............", ".....#.y.i.y.i.y.i.y.i.y.#..............", ".....#.i.y.i.y.#.#.#.#.#.#.#.#.#.#.#....", ".....#.y.i.y.#.s.s.s.s.s.s.s.s.s.#......", ".....#.i.y.#.s.s.s.s.s.s.s.s.s.#........", ".....#.y.#.s.s.s.s.s.s.s.s.s.#..........", ".....#.#.s.s.s.s.s.s.s.s.s.#............", ".....#.#.#.#.#.#.#.#.#.#.#..............", "........................................", "........................................", "........................................" }; ���������ruby-gnome2-all-2.1.0/gtk2/sample/misc/window.rb����������������������������������������������������0000644�0001750�0001750�00000001003�11701304107�017507� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin window.rb - Gtk::Window sample. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: window.rb,v 1.9 2006/10/21 16:58:00 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::Window sample") window.signal_connect("destroy"){Gtk.main_quit} button = Gtk::Button.new("Hello World") button.signal_connect("clicked") do puts "hello world" Gtk.main_quit end window.add(button) window.show_all Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/dialog.rb����������������������������������������������������0000644�0001750�0001750�00000002256�11701304107�017452� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin dialog.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: dialog.rb,v 1.6 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::Dialog sample") button = Gtk::Button.new("Create Dialog") button.signal_connect("clicked") do dialog = Gtk::Dialog.new dialog.title = "Gtk::Dialog Sample" dialog.transient_for = window dialog.set_default_size(300, 300) dialog.vbox.add(Gtk::Label.new("Gtk::Dialog Sample")) dialog.add_button("OK", Gtk::Dialog::RESPONSE_OK) dialog.add_button(Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL) dialog.add_button(Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_CLOSE) dialog.set_default_response(Gtk::Dialog::RESPONSE_CANCEL) dialog.signal_connect("response") do |widget, response| case response when Gtk::Dialog::RESPONSE_OK p "OK" when Gtk::Dialog::RESPONSE_CANCEL p "Cancel" when Gtk::Dialog::RESPONSE_CLOSE p "Close" dialog.destroy end end dialog.show_all end window.add(button).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/checkbutton.rb�����������������������������������������������0000644�0001750�0001750�00000001671�11701304107�020524� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin checkbutton.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: checkbutton.rb,v 1.10 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("check buttons") window.border_width = 0 box1 = Gtk::VBox.new window.add(box1) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2) button1 = Gtk::CheckButton.new("_button1") button2 = Gtk::CheckButton.new("_button2", false) button3 = Gtk::CheckButton.new(Gtk::Stock::QUIT) box2.add(button1) box2.add(button2) box2.add(button3) box1.pack_start(Gtk::HSeparator.new) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2) close = Gtk::Button.new("close") close.signal_connect("clicked") do Gtk.main_quit end box2.pack_start(close) close.can_default = true close.grab_default window.show_all Gtk.main �����������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/frame.rb�����������������������������������������������������0000644�0001750�0001750�00000002676�11701304107�017313� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin frame.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: frame.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("buttons") window.signal_connect("destroy") do Gtk.main_quit end window.border_width = 0 box1 = Gtk::VBox.new(false, 0) window.add(box1) box2 = Gtk::HBox.new(false, 5) box2.border_width = 10 box1.pack_start(box2, true, true, 0) label = Gtk::Label.new("Hello World") frame = Gtk::Frame.new("Frame 1") box2.pack_start(frame, true, true, 0) box3 = Gtk::VBox.new(false, 5) box3.border_width = 5 frame.add(box3) button = Gtk::Button.new("switch") button.signal_connect("clicked") do label.reparent(box3) end box3.pack_start(button, false, true, 0) box3.pack_start(label, false, true, 0) frame = Gtk::Frame.new("Frame 2") box2.pack_start(frame, true, true, 0) box4 = Gtk::VBox.new(false, 5) box4.border_width = 5 frame.add(box4) button = Gtk::Button.new("switch") button.signal_connect("clicked") do label.reparent(box4) end box4.pack_start(button, false, true, 0) separator = Gtk::HSeparator.new box1.pack_start(separator, false, true, 0) box2 = Gtk::HBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) button = Gtk::Button.new("close") button.signal_connect("clicked") do Gtk.main_quit end box2.pack_start(button) window.show_all Gtk.main ������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/gc.rb��������������������������������������������������������0000644�0001750�0001750�00000004316�11701304107�016603� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin gc.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: gc.rb,v 1.6 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gdk::GC sample") window.set_default_size(300, 300) window.app_paintable = true window.realize drawable = window.window gc = Gdk::GC.new(drawable) red = Gdk::Color.new(65535, 0, 0) green = Gdk::Color.new(0, 65535, 0) colormap = Gdk::Colormap.system colormap.alloc_color(red, false, true) colormap.alloc_color(green, false, true) window.signal_connect("expose-event") do |win, evt| gc.set_foreground(red) gc.set_background(green) gc.set_line_attributes(5, Gdk::GC::LINE_SOLID, Gdk::GC::CAP_NOT_LAST, Gdk::GC::JOIN_MITER) drawable.draw_line(gc, 20, 10, 150, 10) gc.set_line_attributes(5, Gdk::GC::LINE_ON_OFF_DASH, Gdk::GC::CAP_NOT_LAST, Gdk::GC::JOIN_MITER) drawable.draw_line(gc, 20, 30, 150, 30) gc.set_line_attributes(5, Gdk::GC::LINE_DOUBLE_DASH, Gdk::GC::CAP_NOT_LAST, Gdk::GC::JOIN_MITER) drawable.draw_line(gc, 20, 50, 150, 50) gc.set_line_attributes(30, Gdk::GC::LINE_SOLID, Gdk::GC::CAP_NOT_LAST, Gdk::GC::JOIN_MITER) drawable.draw_line(gc, 20, 100, 120, 100) gc.set_line_attributes(30, Gdk::GC::LINE_SOLID, Gdk::GC::CAP_BUTT, Gdk::GC::JOIN_MITER) drawable.draw_line(gc, 20, 140, 120, 140) gc.set_line_attributes(30, Gdk::GC::LINE_SOLID, Gdk::GC::CAP_ROUND, Gdk::GC::JOIN_MITER) drawable.draw_line(gc, 20, 180, 120, 180) gc.set_line_attributes(30, Gdk::GC::LINE_SOLID, Gdk::GC::CAP_PROJECTING, Gdk::GC::JOIN_MITER) drawable.draw_line(gc, 20, 220, 120, 220) gc.set_line_attributes(40, Gdk::GC::LINE_SOLID, Gdk::GC::CAP_NOT_LAST, Gdk::GC::JOIN_MITER) drawable.draw_lines(gc, [[200, 80], [220, 30], [280, 50]]) gc.set_line_attributes(40, Gdk::GC::LINE_SOLID, Gdk::GC::CAP_NOT_LAST, Gdk::GC::JOIN_ROUND) drawable.draw_lines(gc, [[200, 170], [220, 120], [280, 140]]) gc.set_line_attributes(40, Gdk::GC::LINE_SOLID, Gdk::GC::CAP_NOT_LAST, Gdk::GC::JOIN_BEVEL) drawable.draw_lines(gc, [[200, 260], [220, 210], [280, 230]]) end window.show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/tree_combo.rb������������������������������������������������0000644�0001750�0001750�00000003713�11701304107�020330� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin tree_combo.rb - Gtk::TreeView and Gtk::CellRendererCombo sample script. Copyright (C) 2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: tree_combo.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" puts str exit end T_APPLICATION = 0 T_COMBO_TEXT_COLUMN = 1 T_COMBO_MODEL = 2 T_COMBO_HAS_ENTRY = 3 T_COMBO_EDITABLE = 4 T_COMBO_TEXT = 5 # The COMPUTER combo model combo_model = Gtk::ListStore.new(String) ["Ruby", "Perl", "Python", "Java"].each do |v| iter = combo_model.append iter[0] = v end # The table model. model = Gtk::ListStore.new(String, # T_APPLICATION Integer, # T_COMBO_TEXT_COLUMN Gtk::ListStore, # T_COMBO_MODEL TrueClass, # T_COMBO_HAS_ENTRY TrueClass, # T_COMBO_EDITABLE String) # T_COMBO_TEXT view = Gtk::TreeView.new(model) # 1st column(Text) trenderer = Gtk::CellRendererText.new tcol = Gtk::TreeViewColumn.new("Application", trenderer, :text => T_APPLICATION) view.append_column(tcol) # 2nd column(Combo) crenderer = Gtk::CellRendererCombo.new crenderer.signal_connect("edited") do |renderer, path, text| model.get_iter(path)[T_COMBO_TEXT] = text end ccol = Gtk::TreeViewColumn.new("Language", crenderer, :text_column => T_COMBO_TEXT_COLUMN, :model => T_COMBO_MODEL, :has_entry => T_COMBO_HAS_ENTRY, :editable => T_COMBO_EDITABLE, :text => T_COMBO_TEXT) view.append_column(ccol) # Create rows. (1..2).each do |v| iter = model.append iter[T_APPLICATION] = "application #{v}" iter[T_COMBO_MODEL] = combo_model iter[T_COMBO_HAS_ENTRY] = false iter[T_COMBO_EDITABLE] = true iter[T_COMBO_TEXT] = combo_model.get_iter("0")[0] end win = Gtk::Window.new win.signal_connect("delete_event"){ Gtk.main_quit } win.add(view).show_all Gtk.main �����������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/togglebutton.rb����������������������������������������������0000644�0001750�0001750�00000001366�11701304107�020731� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin togglebutton.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: togglebutton.rb,v 1.10 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::ToggleButton sample") window.border_width = 10 box = Gtk::VBox.new(false, 10) window.add(box) button1 = Gtk::ToggleButton.new("_button1") button2 = Gtk::ToggleButton.new("_button2", false) button3 = Gtk::ToggleButton.new(Gtk::Stock::QUIT) box.add(button1).add(button2).add(button3) box.pack_start(Gtk::HSeparator.new) close = Gtk::Button.new("close") close.signal_connect("clicked") do Gtk.main_quit end box.add(close) window.show_all Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/drag-move.rb�������������������������������������������������0000644�0001750�0001750�00000005041�11701304107�020067� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin drag-move.rb - Move widget by drag sample script. Copyright (C) 2006 Kouhei Sutou This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 13:18:12 $ $Id: drag-move.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' class DraggableWidget < Gtk::EventBox def initialize super set_visible_window(false) @dragging = false @drag_button = 1 set_button_press_event set_button_release_event set_motion_notify_event end def layout parent end def move(x, y) if layout layout.move(self, x, y) true else false end end def dragging? @dragging end private def set_button_press_event signal_connect("button_press_event") do |widget, event| if event.button == @drag_button Gtk.grab_add(widget) x, y, w, h = widget.allocation.to_a drag_start(x, y, event.x_root, event.y_root) else false end end end def set_motion_notify_event signal_connect("motion_notify_event") do |widget, event| if dragging? drag_motion(event.x_root, event.y_root) else false end end end def set_button_release_event signal_connect("button_release_event") do |widget, event| if event.button == @drag_button Gtk.grab_remove(widget) drag_end else false end end end def set_drag_move_position_event signal_connect("drag_move_position") do |widget, x, y| if layout layout.move(widget, x, y) true else false end end end def drag_start(x, y, base_x, base_y) @dragging = true @drag_x = x @drag_y = y @drag_base_x = base_x @drag_base_y = base_y true end def drag_motion(base_x, base_y) delta_x = base_x - @drag_base_x delta_y = base_y - @drag_base_y if delta_x != 0 and delta_y != 0 move(@drag_x + delta_x, @drag_y + delta_y) else false end end def drag_end @dragging = false true end end window = Gtk::Window.new("Draggable Widget sample") window.signal_connect("destroy"){Gtk.main_quit} layout = Gtk::Layout.new draggable_widget = DraggableWidget.new draggable_widget.set_size_request(50, 50) layout.put(draggable_widget, 75, 75) draggable_widget.signal_connect("expose_event") do |widget, event| x, y, w, h = widget.allocation.to_a fg = Gdk::GC.new(widget.window) widget.window.draw_arc(fg, true, x, y, w, h, 0 * 64, 360 * 64) false end window.add(layout) window.show_all Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/pangorenderer.rb���������������������������������������������0000644�0001750�0001750�00000003342�11701304107�021043� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin pangorenderer.rb - Ruby/GTK sample script. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: pangorenderer.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' RADIUS = 80 N_WORDS = 16 if str = Gtk.check_version(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" puts str exit end win = Gtk::Window.new("Gdk::PangoRenderer sample") win.signal_connect("destroy"){Gtk.main_quit} win.set_default_size(400, 400) win.realize matrix = Pango::Matrix.new renderer = Gdk::PangoRenderer.default renderer.drawable = win.window renderer.gc = Gdk::GC.new(win.window) width, height = win.size device_radius = [width, height].min / 6.0 matrix.translate!(device_radius + (width - 2 * device_radius) / 2.0, device_radius + (height - 2 * device_radius) / 2.0) matrix.scale!(device_radius / RADIUS, device_radius / RADIUS) context = Gdk::Pango.context layout = Pango::Layout.new(context) layout.text = "Ruby-GNOME2" layout.font_description = Pango::FontDescription.new("Sans Bold 14") background = Gdk::Color.new(65535, 65535, 65535) Gdk::Colormap.system.alloc_color(background, false, true) win.window.background = background win.signal_connect("expose_event") do (0...N_WORDS).each do |i| rotated_matrix = matrix.dup angle = 360 * i / N_WORDS.to_f color = Gdk::Color.new(65535 * rand, 65535 * rand, 65535 * rand) renderer.set_override_color(Pango::Renderer::PART_FOREGROUND, color) rotated_matrix.rotate!(angle) context.set_matrix(rotated_matrix) layout.context_changed width, height = layout.size renderer.draw_layout(layout, width / 2, RADIUS * Pango::SCALE) end end win.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/print.rb�����������������������������������������������������0000644�0001750�0001750�00000015673�11701304107�017356� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin print.rb - Gtk::Print* sample Copyright (C) 2007 Mathieu Blondel This program is licenced under the same licence as Ruby-GNOME2. $Id: print.rb,v 1.1 2007/08/05 15:41:31 mutoh Exp $ =end require 'gtk2' # Values returned by a Pango::Layout or set in a Pango::Layout # are always multiple of Pango::SCALE. Those are convenience methods to # deal with that. class Pango::Layout def size_in_points self.size.collect { |v| v / Pango::SCALE } end def width_in_points self.size[0] / Pango::SCALE end def height_in_points self.size[1] / Pango::SCALE end def width_in_points=(width) self.width = width * Pango::SCALE end end class Print < Gtk::PrintOperation FONT = Pango::FontDescription.new("sans 12") FONT_SMALL = Pango::FontDescription.new("sans 8") FONT_SIZE = 12 FONT_SMALL_SIZE = 8 def initialize (parent_window, text) super() @parent_window = parent_window @text = text # with this option disabled, the origin is the the upper left corner # *taking into consideration margins* ! self.use_full_page = false self.unit = Gtk::PaperSize::UNIT_POINTS # set default paper size page_setup = Gtk::PageSetup.new paper_size = Gtk::PaperSize.new(Gtk::PaperSize.default) page_setup.paper_size_and_default_margins = paper_size self.default_page_setup = page_setup # show a progress bar self.show_progress = true # You must choose between "paginate" and "begin-print". # "begin-print" is emitted only once and "paginate" is emitted # until the block returns true. # In both cases, you must set the number of pages at the end with # Gtk::PrintOperation#n_pages= signal_connect("begin-print") do |pop, context| puts "calls begin-print" cr = context.cairo_context paragraphs = @text.split("\n") layouts = [] paragraphs.each do |para| layouts << create_layout(cr, para) end # distribute paragraph layouts among pages @page_layouts = [] curr_height = 0 n_pages = 0 layouts.each do |layout| height = layout.height_in_points if curr_height + height > real_page_height n_pages += 1 curr_height = 0 end @page_layouts[n_pages] ||= [] @page_layouts[n_pages] << layout curr_height += height end pop.n_pages = n_pages + 1 end signal_connect("draw-page") do |pop, context, page_num| puts "calls draw-page %d" % page_num cr = context.cairo_context x, y = [0,0] # this means we start at the upper left margin if @page_layouts[page_num] @page_layouts[page_num].each do |layout| cr.move_to(x,y) cr.show_pango_layout(layout) y += layout.height_in_points end total_pages = @page_layouts.length else total_pages = 1 end # page_num starts at 0 draw_footer(cr, page_num + 1, total_pages) end end def run_print_dialog res = run(ACTION_PRINT_DIALOG, @parent_window) case res when RESULT_ERROR puts "error" when RESULT_CANCEL puts "cancelled" when RESULT_APPLY puts "applied" when RESULT_IN_PROGRESS puts "in progress" end end def run_preview res = run(ACTION_PREVIEW, @parent_window) end private def page_height setup = self.default_page_setup # this takes margins into consideration, contrary to get_paper_height setup.get_page_height(Gtk::PaperSize::UNIT_POINTS) end def page_width setup = self.default_page_setup width = setup.get_page_width(Gtk::PaperSize::UNIT_POINTS) end def real_page_height page_height - footer_height end def footer_height 5 * FONT_SMALL_SIZE end def create_layout(cr, text) layout = cr.create_pango_layout layout.width_in_points = page_width layout.font_description = FONT layout.wrap = Pango::Layout::WRAP_CHAR layout.ellipsize = Pango::Layout::ELLIPSIZE_NONE layout.single_paragraph_mode = false layout.text = text layout end def draw_footer(cr, nth_page, total_page) layout = cr.create_pango_layout layout.alignment = Pango::Layout::ALIGN_RIGHT layout.font_description = FONT_SMALL layout.text = "Page %d/%d" % [nth_page, total_page] + "\n" + \ Time.now.strftime("Printed on %Y/%m/%d at %H:%M") + "\n" + \ "Powered by Ruby-GNOME2!" width, height = layout.size_in_points x, y = [page_width, page_height] x -= width y -= height cr.move_to(x, y) cr.show_pango_layout(layout) cr.rel_move_to(width, -2) cr.rel_line_to(-page_width, 0) cr.stroke end end class Window < Gtk::Window def initialize super signal_connect("delete-event") { Gtk.main_quit } set_default_size(600, 600) @textview = Gtk::TextView.new @textview.wrap_mode = Gtk::TextTag::WRAP_WORD hbox = Gtk::HBox.new page_setup_button = Gtk::Button.new page_setup_button.label = "Page setup" page_setup_button.signal_connect("clicked") do @page_setup = Print::run_page_setup_dialog(self, # parent window @page_setup) end print_preview_button = Gtk::Button.new(Gtk::Stock::PRINT_PREVIEW) print_preview_button.signal_connect("clicked") do printop = Print.new(self, @textview.buffer.text) printop.default_page_setup = @page_setup if @page_setup printop.run_preview end print_button = Gtk::Button.new(Gtk::Stock::PRINT) print_button.signal_connect("clicked") do printop = Print.new(self, @textview.buffer.text) printop.default_page_setup = @page_setup if @page_setup printop.run_print_dialog end [page_setup_button, print_preview_button, print_button].each do |b| hbox.pack_start(b, true, true) # expand, fill end scrollbar = Gtk::VScrollbar.new vbox = Gtk::VBox.new scroll = Gtk::ScrolledWindow.new.add(@textview) scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) vbox.pack_start(scroll) vbox.pack_end(hbox, false, false) add(vbox) show_all end end Window.new Gtk.main ���������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/tree_progress.rb���������������������������������������������0000644�0001750�0001750�00000002425�11701304107�021074� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin tree_progress.rb - Gtk::TreeView and Gtk::CellRendererProgress sample script. Copyright (C) 2004-2006 Darren Willis, Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: tree_progress.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" puts str exit end win = Gtk::Window.new("Gtk::CellRendererProgress sample") win.set_default_size(300, 50) model = Gtk::ListStore.new(String, Float) view = Gtk::TreeView.new(model) prog = model.append prog[0] = "bar 1" prog[1] = 50 prog1 = model.append prog1[0] = "bar 2" prog1[1] = 5 prog2 = model.append prog2[0] = "bar 3" prog2[1] = 10 arenderer = Gtk::CellRendererText.new acol = Gtk::TreeViewColumn.new("words", arenderer, :text => 0) view.append_column(acol) prenderer = Gtk::CellRendererProgress.new pcol = Gtk::TreeViewColumn.new("Progress", prenderer, :value => 1) view.append_column(pcol) win.signal_connect("delete_event"){ Gtk.main_quit } win.add(view) win.show_all dir = 1 thr = Thread.new do loop { prog2[1] += dir if prog2[1] > 100 prog2[1] = 100 dir = - dir end if prog2[1] < 0 prog2[1] = 0 dir = - dir end sleep 0.01 } end Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/linkbutton.rb������������������������������������������������0000644�0001750�0001750�00000001642�11701304107�020402� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin linkbutton.rb - Gtk::LinkButton sample. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: linkbutton.rb,v 1.1 2006/10/21 16:58:00 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::LinkButton sample") window.signal_connect("destroy"){Gtk.main_quit} vbox = Gtk::VBox.new # URI only button1 = Gtk::LinkButton.new("http://ruby-gnome2.sourceforge.jp/") button1.signal_connect("clicked") do puts button1.uri end vbox.pack_start(button1) # URI with a label button2 = Gtk::LinkButton.new("http://ruby-gnome2.sourceforge.jp/", "Ruby-GNOME2 Website") button2.signal_connect("clicked") do puts button2.uri end # Global setting instead of using clicked signals. Gtk::LinkButton.set_uri_hook {|button, link| puts "set_uri_hook: " + link } vbox.pack_start(button2) window.add(vbox) window.show_all Gtk.main ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/dndtreeview.rb�����������������������������������������������0000644�0001750�0001750�00000002755�11701304107�020537� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin dndtreeview.rb - Drag and Drop sample script. Copyright (C) 2003-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 13:18:12 $ $Id: dndtreeview.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' class TestWindow < Gtk::Window attr_reader :list TARGET_TABLE = [["GTK_TREE_MODEL_ROW", 0, 0]] def initialize() super("Drag and Drop Gtk::TreeView") set_default_size(300,128) signal_connect("destroy") { Gtk.main_quit } data = [["Hello", "KON-NI-CHIWA"], ["Goodbye", "SAYO-NARA"], ["Good morning", "OHA-YO-GOZAI-MASU"], ["Good evening", "KON-BAN-WA"]] model = Gtk::ListStore.new(String, String) view = Gtk::TreeView.new(model) renderer = Gtk::CellRendererText.new col1 = Gtk::TreeViewColumn.new("Data", renderer, {:text => 0}) col2 = Gtk::TreeViewColumn.new("Data", renderer, {:text => 1}) view.append_column(col1) view.append_column(col2) data.each do |v1, v2| iter = model.append iter.set_value(0, v1) iter.set_value(1, v2) end view.enable_model_drag_source(Gdk::Window::BUTTON1_MASK, TARGET_TABLE, Gdk::DragContext::ACTION_COPY|Gdk::DragContext::ACTION_MOVE) view.enable_model_drag_dest(TARGET_TABLE, Gdk::DragContext::ACTION_COPY|Gdk::DragContext::ACTION_MOVE) add(view) end end win = TestWindow.new.show_all Gtk.main �������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/scalebutton.rb�����������������������������������������������0000644�0001750�0001750�00000001234�11701304107�020531� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin scalebutton.rb - Very simple Gtk::ScaleButton example. Copyright (c) 2007 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: scalebutton.rb,v 1.1 2007/07/12 14:04:54 ggc Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 12, 0) puts "This sample requires GTK+ 2.12.0 or later" puts str exit end window = Gtk::Window.new window.add(scale = Gtk::ScaleButton.new(Gtk::IconSize::BUTTON)) scale.set_icons(['gtk-goto-bottom', 'gtk-goto-top', 'gtk-execute']) scale.signal_connect('value-changed') { |widget, value| puts "value changed: #{value}" } window.show_all Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/infobar.rb���������������������������������������������������0000775�0001750�0001750�00000000725�11740310343�017641� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'gtk2' label=Gtk::Label.new.show info=Gtk::InfoBar.new info.no_show_all=true info.content_area.add(label) info.add_button(Gtk::Stock::OK, Gtk::ResponseType::OK) info.signal_connect('response'){|info, response| info.hide} w=Gtk::Window.new w.add(info) w.show_all w.signal_connect("delete_event"){Gtk.main_quit} GLib::Timeout.add_seconds(1){ label.text='ERROR' info.message_type=Gtk::MessageType::ERROR info.show false } Gtk.main �������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/combo_check.rb�����������������������������������������������0000644�0001750�0001750�00000003014�11701304107�020440� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin combo_check.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: combo_check.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("entry") window.border_width = 0 box1 = Gtk::VBox.new window.add(box1) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2) entry = Gtk::Entry.new entry.text = "hello world" entry.select_region(0, -1) box2.pack_start(entry) # # Gtk::Combo has been deprecated. Use Gtk::ComboBox instead. # cb = Gtk::Combo.new cb.set_popdown_strings(["item0", "item1 item1", "item2 item2 item2", "item3 item3 item3 item3", "item4 item4 item4 item4 item4", "item5 item5 item5 item5 item5 item5", "item6 item6 item6 item6 item6", "item7 item7 item7 item7", "item8 item8 item8", "item9 item9"]) cb.entry.set_text("hello world") cb.entry.select_region(0, -1) box2.pack_start(cb, true, true, 0) check = Gtk::CheckButton.new("Editable") box2.pack_start(check, false, true, 0) check.signal_connect("toggled") do cb.entry.set_editable(check.active?) entry.set_editable(check.active?) end check.state = 0 box1.pack_start(Gtk::HSeparator.new) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2) button = Gtk::Button.new("close") button.signal_connect("clicked") do Gtk.main_quit end box2.pack_start(button) button.can_default = true button.grab_default window.show_all Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/stock.rb�����������������������������������������������������0000644�0001750�0001750�00000001434�11701304107�017333� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin stock.rb - Gtk::Stock sample script. Copyright (C) 2001-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: stock.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::Stock sample") window.signal_connect("destroy"){Gtk.main_quit} stocks = Gtk::Stock.constants.sort image = Gtk::Image.new label = Gtk::Label.new button = Gtk::Button.new("Click!") cnt = 0 button.signal_connect("clicked") do stock_name = "Gtk::Stock::#{stocks[cnt]}" label.set_text(stock_name) image.set(eval(stock_name), Gtk::IconSize::DIALOG) if cnt < stocks.size - 1 cnt += 1 else cnt = 0 end end box = Gtk::VBox.new.add(image).add(label).add(button) window.add(box).set_default_size(200,200).show_all Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/xbm_cursor.rb������������������������������������������������0000644�0001750�0001750�00000003123�11701304107�020370� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin xbm_cursor.rb - Gdk::Cursor sample script. Copyright (C) 2001-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 13:18:12 $ $Id: xbm_cursor.rb,v 1.6 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' cursor_bits = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0xe0, 0x78, 0x00, 0xe0, 0x70, 0x00, 0xe0, 0x70, 0x00, 0xe0, 0x38, 0x00, 0xe0, 0x1f, 0x00, 0xe0, 0x1d, 0x00, 0xe0, 0x38, 0x00, 0xe0, 0x78, 0x00, 0xe0, 0xf0, 0x00, 0xf0, 0xf3, 0x01, 0xf0, 0xe3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].pack("c*") cursor_mask_bits = [ 0x63, 0x8e, 0x0f, 0x67, 0x8e, 0x0f, 0x06, 0xc6, 0x07, 0x04, 0x00, 0x00, 0xf0, 0x3f, 0x08, 0xe7, 0x78, 0x0e, 0xe7, 0x70, 0x0f, 0xe4, 0x70, 0x03, 0xe0, 0x38, 0x00, 0xe7, 0x1f, 0x0c, 0xe7, 0x1d, 0x0f, 0xe0, 0x38, 0x0e, 0xe0, 0x78, 0x08, 0xe7, 0xf0, 0x00, 0xf7, 0xf3, 0x01, 0xf0, 0xe3, 0x01, 0x04, 0x00, 0x00, 0x46, 0x24, 0x06, 0x67, 0x66, 0x0e, 0x67, 0x66, 0x0e].pack("c*") window = Gtk::Window.new("Gdk::Cursor sample") window.signal_connect("destroy"){Gtk.main_quit} window.realize source = Gdk::Pixmap.create_from_data(window.window, cursor_bits, 19, 19) mask = Gdk::Pixmap.create_from_data(window.window, cursor_mask_bits, 19, 19) fg = Gdk::Color.new(65535, 0, 0) bg = Gdk::Color.new(65535, 65535, 0) cursor = Gdk::Cursor.new(source, mask, fg, bg, 10, 10) window.window.set_cursor(cursor) window.add(Gtk::Label.new("Put your cursor on this window.")) window.set_default_size(200, 100).show_all Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/treeview.rb��������������������������������������������������0000644�0001750�0001750�00000003615�11701304107�020045� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin treeview.rb - Gtk::TreeView sample Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: treeview.rb,v 1.8 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::TreeView sample") # Create data model = Gtk::TreeStore.new(String, String, Gdk::Color, Float, Gdk::Pixbuf) # column 1 root_iter = model.append(nil) root_iter[0] = "Root" root_iter[1] = "red" root_iter[2] = Gdk::Color.new(0, 65535, 0) root_iter[3] = 5.0 # column 2 root_iter[4] = window.render_icon(Gtk::Stock::NEW, Gtk::IconSize::DIALOG, "icon1") child_iter1 = model.append(root_iter) child_iter1[0] = "Child_Iter1" child_iter1[1] = "green" child_iter1[2] = Gdk::Color.new(65535, 0, 0) child_iter1[3] = 3.0 # column 2 child_iter1[4] = window.render_icon(Gtk::Stock::OPEN, Gtk::IconSize::MENU, "icon2") child_iter2 = model.append(root_iter) child_iter2[0] = "Child_Iter2" child_iter2[1] = "yellow" child_iter2[2] = Gdk::Color.new(0, 0, 65535) child_iter2[3] = 0.9 # column 2 child_iter2[4] = window.render_icon(Gtk::Stock::QUIT, Gtk::IconSize::BUTTON, "icon3") # Create view tv = Gtk::TreeView.new(model) # column 1 renderer = Gtk::CellRendererText.new column = Gtk::TreeViewColumn.new("Gtk::CellRenderText", renderer, { :text => 0, :background => 1, :foreground_gdk => 2, :scale => 3, }) tv.append_column(column) # column 2 renderer = Gtk::CellRendererPixbuf.new column = Gtk::TreeViewColumn.new("Gtk::CellRenderPixbuf", renderer, { :pixbuf => 4 }) tv.append_column(column) window.add(tv).set_default_size(300, 300).show_all window.signal_connect("destroy"){Gtk.main_quit} Gtk.main �������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/colorselection.rb��������������������������������������������0000644�0001750�0001750�00000001205�11701304107�021230� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin colorselection.rb - Gtk::ColorSelection sample script. Copyright (C) 2005,2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: colorselection.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' settings = Gtk::Settings.default # You can save the palette to use right click on the palette. Gtk::ColorSelection.set_change_palette_hook{|screen, colors| puts strs = Gtk::ColorSelection.palette_to_string(colors) settings.gtk_color_palette = strs } a = Gtk::ColorSelection.new a.has_palette = true Gtk::Window.new.add(a).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/cursor.rb����������������������������������������������������0000644�0001750�0001750�00000001320�11701304107�017517� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin cursor.rb - Gdk::Cursor sample script. Copyright (C) 2001-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: cursor.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gdk::Cursor sample") window.realize button = Gtk::Button.new("Click!") button.use_underline = false cursors = Gdk::Cursor::Type.values - [Gdk::Cursor::CURSOR_IS_PIXMAP] cnt = 0 button.signal_connect('clicked') do cursor = cursors[cnt] p cursor.inspect button.set_label(cursor.inspect) window.window.set_cursor(Gdk::Cursor.new(cursor)) cnt += 1 cnt = 0 if cnt == cursors.size end window.add(button) window.set_default_size(400,100).show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/iconview.rb��������������������������������������������������0000644�0001750�0001750�00000001524�11701304107�020033� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin iconview.rb - Ruby/GTK2 sample script. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: iconview.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' TEXT_COLUMN = 0 PIXBUF_COLUMN = 1 model = Gtk::ListStore.new(String, Gdk::Pixbuf) iv = Gtk::IconView.new(model) iv.text_column = TEXT_COLUMN iv.pixbuf_column = PIXBUF_COLUMN Dir.glob("../gtk-demo/gnome*.png").each do |f| iter = model.append iter[TEXT_COLUMN] = File.basename(f) iter[PIXBUF_COLUMN] = Gdk::Pixbuf.new(f) end iv.signal_connect("item_activated") do |iv, path| iter = model.get_iter(path) p iter [0] end win = Gtk::Window.new("Gtk::IconView sample") win.signal_connect("destroy"){Gtk.main_quit} win.add(iv).set_default_size(300,300).show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/menu.rb������������������������������������������������������0000644�0001750�0001750�00000003306�11701304107�017154� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin menu.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: menu.rb,v 1.8 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' def create_menu(depth) return nil if depth < 1 menu = Gtk::Menu.new group = nil submenu = nil for i in 0..4 buf = sprintf("item %2d - %d", depth, i + 1) menuitem = Gtk::RadioMenuItem.new(group, buf) group = menuitem.group menu.append(menuitem) if depth > 1 menuitem.set_submenu create_menu(depth - 1) end end menu end window = Gtk::Window.new("menus") window.signal_connect("destroy") do Gtk.main_quit end window.border_width = 0 box1 = Gtk::VBox.new(false, 0) window.add(box1) menubar = Gtk::MenuBar.new box1.pack_start(menubar, false, true, 0) menu = create_menu(2) menuitem = Gtk::MenuItem.new("test\nline2") menuitem.set_submenu(menu) menubar.append(menuitem) menuitem = Gtk::MenuItem.new("foo") menuitem.set_submenu(create_menu(3)) menubar.append(menuitem) menuitem = Gtk::MenuItem.new("bar") menuitem.set_submenu(create_menu(4)) menubar.append(menuitem) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, true, true, 0) optionmenu = Gtk::OptionMenu.new optionmenu.set_menu(create_menu(1)) optionmenu.set_history(4) box2.pack_start(optionmenu, true, true, 0) separator = Gtk::HSeparator.new box1.pack_start(separator, false, true, 0) box2 = Gtk::HBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) button = Gtk::Button.new("close") button.signal_connect("clicked") do window.destroy end box2.pack_start(button, true, true, 0) window.show_all Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/filechooser.rb�����������������������������������������������0000644�0001750�0001750�00000002324�11701304107�020511� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin filechooser.rb - Ruby/GTK2 sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: filechooser.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require "gtk2" if str = Gtk.check_version(2, 4, 0) puts "This sample requires GTK+ 2.4.0 or later" puts str exit end dialog = Gtk::FileChooserDialog.new("Gtk::FileChooser sample", nil, Gtk::FileChooser::ACTION_OPEN, "gnome-vfs", [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT], [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL] ) extra_button = Gtk::Button.new("Extra button") extra_button.signal_connect("clicked") do puts "extra button is clicked" end dialog.extra_widget = extra_button filter_rb = Gtk::FileFilter.new filter_rb.name = "Ruby Scripts" filter_rb.add_pattern("*.rb") filter_rb.add_pattern("*.rbw") dialog.add_filter(filter_rb) filter_c = Gtk::FileFilter.new filter_c.name = "C sources" filter_c.add_pattern("*.[c|h]") dialog.add_filter(filter_c) dialog.add_shortcut_folder("/tmp") if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT puts "filename = #{dialog.filename}" puts "uri = #{dialog.uri}" end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/style_property.rb��������������������������������������������0000755�0001750�0001750�00000003200�11701304107�021310� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin style_property.rb - Ruby/GTK2 sample script. Copyright (c) 2004,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: style_property.rb,v 1.4 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' class MyButton < Gtk::Button type_register def initialize(label = nil) # When type_register() is used. # super is equivalent to GLib::Object#initialize. super("label" => label) end install_style_property(GLib::Param::Int.new("foo", # name "Foo", # nick "FOO", # blurb 0, #min 100, #max 5, #default GLib::Param::READABLE | GLib::Param::WRITABLE)) do |pspec, str| p pspec, str str.to_i + 10 #return the converted value. end install_style_property(GLib::Param::Enum.new("bar", # name "Bar", # nick "BAR", # blurb GLib::Type["GdkCursorType"], #Enum type Gdk::Cursor::ARROW, #default GLib::Param::READABLE | GLib::Param::WRITABLE)) do |pspec, str| p pspec, str if str.strip! == "boat" Gdk::Cursor::BOAT else pspec.default end end end Gtk::RC.parse("./style_property.rc") win = Gtk::Window.new("Gtk::RC sample") b = MyButton.new("Hello") b.signal_connect("clicked"){ Gtk.main_quit } p MyButton.style_properties win.set_default_size(100, 100) win.add(b).show_all win.signal_connect("destroy"){ Gtk.main_quit } # You need to call them after "Gtk::Widget#show" # (Or in expose event). p b.style_get_property("foo") p cursor = b.style_get_property("bar") Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/itemfactory2.rb����������������������������������������������0000644�0001750�0001750�00000004554�11701304107�020626� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin itemfactory2.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. *NOTE* Gtk::ItemFactory has been deprecated. Use Gtk::UIManager instead. $Id: itemfactory2.rb,v 1.8 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' puts "Deprecated. Use Gtk::UIManager instead." window = Gtk::Window.new("Gtk::ItemFactory2") window.signal_connect("destroy") do Gtk.main_quit end window.signal_connect("delete_event") do Gtk.main_quit end accelgroup = Gtk::AccelGroup.new window.add_accel_group(accelgroup) ifp = Gtk::ItemFactory.new(Gtk::ItemFactory::TYPE_MENU_BAR, "<main>", accelgroup) ifp.create_item("/_Stock") ifp.create_item("/_Stock/_New", "<StockItem>", "<control>N", Gtk::Stock::NEW, 1) do |v, _| p "StockItem #{v}" end item = ifp.create_item("/_Stock/_Open", "<StockItem>", "<control>O", Gtk::Stock::OPEN, 2) do |v, _| p "StockItem #{v}" end ifp.create_item("/_Stock/_Quit", "<StockItem>", "<control>Q", Gtk::Stock::QUIT, 3) do |v, _| p "Quit" Gtk.main_quit end ifp.create_item("/_Item") ifp.create_item("/_Item/Item_1", "<Item>"){p "Item1"} ifp.create_item("/_Item/Item_2", "<Item>"){p "Item2"} ifp.create_item("/_Check") ifp.create_item("/_Check/Check_1", "<CheckItem>"){p "Check1"} ifp.create_item("/_Check/Check_2", "<CheckItem>"){p "Check2"} ifp.create_item("/_Toggle") ifp.create_item("/_Toggle/Toggle_1", "<ToggleItem>", nil, nil, 1){|v, _| p "Toggle#{v}"} ifp.create_item("/_Toggle/Toggle_2", "<ToggleItem>", nil, nil, 2){|v, _| p "Toggle#{v}"} ifp.create_item("/_Radio") ifp.create_item("/_Radio/Radio_1", "<RadioItem>", nil, nil, 1){|v, _| p "Radio#{v}"} ifp.create_item("/_Radio/Radio_2", "/Radio/Radio1", nil, nil, 2){|v, _| p "Radio#{v}"} ifp.create_item("/_Radio/Radio_3", "/Radio/Radio1", nil, nil, 3){|v, _| p "Radio#{v}"} ifp.create_item("/_Misc", "<LastBranch>") ifp.create_item("/_Misc/Tearoff", "<Tearoff>") ifp.create_item("/_Misc/Title", "<Title>") ifp.create_item("/_Misc/Seperator", "<Separator>") ifp.create_item("/_Misc/Image", "<ImageItem>", "", Gdk::Pixbuf.new("gnome-logo-icon.png")) do p "ImageItem" end ifp.get_widget("/Stock/Open").sensitive = false vbox = Gtk::VBox.new vbox.add(ifp.get_widget("<main>")) vbox.add(Gtk::Label.new("Gtk::ItemFactory sample").set_size_request(400, 200)) window.add(vbox) window.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/mouse-gesture.rb���������������������������������������������0000644�0001750�0001750�00000023674�11701304107�021026� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin mouse-gesture.rb - mouse gesture sample script. Copyright (C) 2005,2006 Kouhei Sutou This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 13:18:12 $ $Id: mouse-gesture.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' unless Gdk.cairo_available? STDERR.puts("need cairo and rcairo support for this sample") exit 1 end class GestureProcessor DEFAULT_THRESHOLD = 16 DEFAULT_SKEW_THRESHOLD_ANGLE = 30 attr_accessor :threshold, :skew_threshold_angle attr_reader :motions def initialize(threshold=nil, skew_threshold_angle=nil) @threshold = threshold || DEFAULT_THRESHOLD @skew_threshold_angle = skew_threshold_angle @skew_threshold_angle ||= DEFAULT_SKEW_THRESHOLD_ANGLE reset end def started? @started end MOTIONS = %w(L R U D UL UR LL LR) def available_motion?(motion) MOTIONS.include?(motion) end def start(x, y) @prev_x = @x = x @prev_y = @y = y @started = true @motions = [] end def update_position(x, y) mx = x - @prev_x my = y - @prev_y motion = judge_motion(mx, my) if motion @prev_x = @x = x @prev_y = @y = y if @motions.last == motion false else @motions << motion true end else false end end def reset @started = false @x = @y = -1 @motions = [] end def to_a @motions end def position [@x, @y] end private def judge_motion(mx, my) mxa = mx.abs mya = my.abs distance = Math.sqrt(mxa ** 2 + mya ** 2) upper_theta = (45 + @skew_threshold_angle) * (Math::PI / 180.0) lower_theta = (45 - @skew_threshold_angle) * (Math::PI / 180.0) if distance > @threshold and mya < Math.tan(upper_theta) * mxa and mya > Math.tan(lower_theta) * mxa judge_corner_motion(mx, my) elsif mxa > @threshold or mya > @threshold judge_cross_motion(mx, my) else nil end end def judge_corner_motion(mx, my) if mx < 0 if my < 0 "UL" else "LL" end else if my < 0 "UR" else "LR" end end end def judge_cross_motion(mx, my) if mx.abs > my.abs if mx < 0 "L" else "R" end else if my < 0 "U" else "D" end end end end class Gesture < Gtk::EventBox DEFAULT_BACK_RGBA = [0.2, 0.2, 0.2, 0.5] DEFAULT_LINE_RGBA = [1, 0, 0, 1] DEFAULT_NEXT_RGBA = [0, 1, 0, 0.8] DEFAULT_CURRENT_RGBA = [1, 0, 1, 0.8] def initialize(conf={}) super() set_visible_window(false) conf ||= {} @back_rgba = conf[:back_rgba] || DEFAULT_BACK_RGBA @line_rgba = conf[:line_rgba] || DEFAULT_LINE_RGBA @next_rgba = conf[:next_rgba] || DEFAULT_NEXT_RGBA @current_rgba = conf[:current_rgba] || DEFAULT_CURRENT_RGBA @processor = GestureProcessor.new(conf[:threshold], conf[:skew_threshold_angle]) @actions = [] set_expose_event set_motion_notify_event set_button_release_event end def add_action(sequence, action=Proc.new) invalid_motion = sequence.find do |motion| not @processor.available_motion?(motion) end raise "invalid motion: #{invalid_motion}" if invalid_motion @actions << [sequence, action] end def start(widget, button, x, y, base_x, base_y) Gtk.grab_add(self) @widget = widget @button = button @processor.start(x, y) @base_x = base_x @base_y = base_y @cr = window.create_cairo_context @cr.set_source_rgba(@line_rgba) @cr.move_to(x, y) end private def perform_action act = action act.call(@widget) if act @processor.reset end def action motions = @processor.motions @actions.each do |sequence, act| return act if sequence == motions end nil end def available_motions motions = @processor.motions @actions.collect do |sequence, act| if sequence == motions sequence.last else nil end end.compact.uniq end def next_available_motions motions = @processor.motions @actions.collect do |sequence, act| if sequence[0..-2] == motions sequence.last else nil end end.compact.uniq end def match? not action.nil? end def set_expose_event signal_connect("expose_event") do |widget, event| if @processor.started? cr = widget.window.create_cairo_context cr.rectangle(*widget.allocation.to_a) cr.set_source_rgba(@back_rgba) cr.fill cr.set_source_rgba(@next_rgba) draw_available_marks(cr, next_available_motions) if action cr.set_source_rgba(@current_rgba) draw_mark(cr, *@processor.position) end @cr.stroke_preserve true else false end end end def draw_mark(cr, x=nil, y=nil, radius=nil) x ||= @processor.position[0] y ||= @processor.position[1] radius ||= @processor.threshold cr.save do cr.translate(x, y) cr.scale(radius, radius) cr.arc(0, 0, 0.5, 0, 2 * Math::PI) cr.fill end end def draw_available_marks(cr, motions) motions.each do |motion| adjust_x = calc_position_ratio(motion, %w(R), %w(L), %w(UR LR), %w(UL LL)) adjust_y = calc_position_ratio(motion, %w(D), %w(U), %w(LR LL), %w(UR UL)) threshold = @processor.threshold x, y = @processor.position x += threshold * adjust_x y += threshold * adjust_y draw_mark(cr, x, y, threshold) end end def calc_position_ratio(motion, inc, dec, inc_skew, dec_skew) case motion when *inc 1 when *inc_skew 1 / Math.sqrt(2) when *dec -1 when *dec_skew -1 / Math.sqrt(2) else 0 end end def set_motion_notify_event signal_connect("motion_notify_event") do |widget, event| if @processor.started? x = @base_x + event.x y = @base_y + event.y @cr.line_to(x, y) @cr.save do if @processor.update_position(x, y) queue_draw end end @cr.stroke_preserve true else false end end end def set_button_release_event signal_connect("button_release_event") do |widget, event| if event.button == @button and @processor.started? Gtk.grab_remove(self) perform_action hide true else false end end end end class GesturedWidget < Gtk::EventBox DEFAULT_GESTURE_BUTTON = 3 def initialize(gesture_button=nil) super() set_visible_window(false) @gesture_button = gesture_button || DEFAULT_GESTURE_BUTTON set_button_press_event end def layout parent end def gesture(x, y, base_x, base_y) if layout layout.gesture(self, @gesture_button, x, y, base_x, base_y) end end private def set_button_press_event signal_connect("button_press_event") do |widget, event| if event.button == @gesture_button x, y, w, h = widget.allocation.to_a gesture(x + event.x, y + event.y, x, y) else false end end end end class Layout < Gtk::Layout def initialize() super() @gesture = Gesture.new() put(@gesture, 0, 0) end def gesture(widget, button, x, y, base_x, base_y) remove(@gesture) put(@gesture, 0, 0) _, _, w, h = allocation.to_a @gesture.set_size_request(w, h) @gesture.show @gesture.start(widget, button, x, y, base_x, base_y) end def add_gesture_action(sequence, action=Proc.new) @gesture.add_action(sequence, action) end end window = Gtk::Window.new("Mouse Gesture sample") layout = Layout.new gestured_widget = GesturedWidget.new gestured_widget.set_size_request(50, 50) gestured_widget.signal_connect("expose_event") do |widget, event| x, y, w, h = widget.allocation.to_a cr = widget.window.create_cairo_context cr.set_source_rgba([0.8, 0.8, 0.3, 1]) cr.translate(x, y) cr.scale(w, h) cr.arc(0.5, 0.5, 0.5, -0.1, 360) cr.fill false end layout.put(gestured_widget, 75, 75) gestured_widget2 = GesturedWidget.new gestured_widget2.set_size_request(100, 50) gestured_widget2.signal_connect("expose_event") do |widget, event| x, y, w, h = widget.allocation.to_a cr = widget.window.create_cairo_context cr.set_source_rgba([0.3, 0.3, 0.8, 1]) cr.translate(x, y) cr.scale(w, h) cr.arc(0.5, 0.5, 0.5, -0.1, 360) cr.fill false end layout.put(gestured_widget2, 0, 25) # gesture handlers expand_size = 20 expand_left = Proc.new do |widget| x = layout.child_get_property(widget, :x) y = layout.child_get_property(widget, :y) w, h = widget.size_request layout.move(widget, x - expand_size, y) widget.set_size_request(w + expand_size, h) end expand_right = Proc.new do |widget| x = layout.child_get_property(widget, :x) y = layout.child_get_property(widget, :y) w, h = widget.size_request layout.move(widget, x, y) widget.set_size_request(w + expand_size, h) end expand_top = Proc.new do |widget| x = layout.child_get_property(widget, :x) y = layout.child_get_property(widget, :y) w, h = widget.size_request layout.move(widget, x, y - expand_size) widget.set_size_request(w, h + expand_size) end expand_bottom = Proc.new do |widget| x = layout.child_get_property(widget, :x) y = layout.child_get_property(widget, :y) w, h = widget.size_request layout.move(widget, x, y) widget.set_size_request(w, h + expand_size) end layout.add_gesture_action(["L"]) do |widget| expand_left.call(widget) end layout.add_gesture_action(["U"]) do |widget| expand_top.call(widget) end layout.add_gesture_action(["LL"]) do |widget| expand_left.call(widget) expand_bottom.call(widget) end layout.add_gesture_action(["R", "LR"]) do |widget| expand_right.call(widget) expand_bottom.call(widget) expand_right.call(widget) end window.add(layout) window.signal_connect("destroy"){Gtk.main_quit} window.show_all Gtk.main ��������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/uimanager.rb�������������������������������������������������0000644�0001750�0001750�00000010012�11701304107�020150� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin uimanager.rb - Copyright (C) 2004-2006 Masao Mutoh Original version is demos/gtk-demo/ui_manager.c. This program is licenced under the same licence as Ruby-GNOME2. $Id: uimanager.rb,v 1.6 2007/07/12 14:53:09 ggc Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 4, 0) puts "This sample requires GTK+ 2.4.0 or later" puts str exit end if not Gtk.check_version(2, 12, 0) recentmenuitem = "<menuitem name='recent' action='recent'/>" else recentmenuitem = "" end ui_info = %Q[ <ui> <menubar name='MenuBar'> <menu action='FileMenu'> <menuitem action='New'/> <menuitem action='Open'/> #{recentmenuitem} <menuitem action='Save'/> <menuitem action='SaveAs'/> <separator/> <menuitem action='Quit'/> </menu> <menu action='PreferencesMenu'> <menu action='ColorMenu'> <menuitem action='Red'/> <menuitem action='Green'/> <menuitem action='Blue'/> </menu> <menu action='ShapeMenu'> <menuitem action='Square'/> <menuitem action='Rectangle'/> <menuitem action='Oval'/> </menu> <menuitem action='Bold'/> </menu> <menu action='HelpMenu'> <menuitem action='About'/> </menu> </menubar> <toolbar name='ToolBar'> <toolitem action='Open'/> <toolitem action='Quit'/> <separator action='Sep1'/> <toolitem action='Logo'/> </toolbar> </ui>] callback = Proc.new {|actiongroup, action| puts "`#{action.name}' is clicked. " if action.is_a? Gtk::ToggleAction puts "active? = #{action.active?}" end } callback_quit = Proc.new { p "Quit is called." Gtk.main_quit } callback_radio = Proc.new {|action, current| puts "action = `#{action.name}'" puts "current = `#{current.name}'" } actions = [ ["FileMenu", nil, "_File"], ["PreferencesMenu", nil, "_Preferences"], ["ColorMenu", nil, "_Color"], ["ShapeMenu", nil, "_Shape"], ["HelpMenu", nil, "_Help"], ["New", Gtk::Stock::NEW, "_New", "<control>N", "Create a new file", callback], ["Open", Gtk::Stock::OPEN, "_Open", "<control>O", "Open a file", callback], ["Save", Gtk::Stock::SAVE, "_Save", "<control>S", "Save current file", callback], ["SaveAs", Gtk::Stock::SAVE, "Save _As...", nil, "Save to a file", callback], ["Quit", Gtk::Stock::QUIT, "_Quit", "<control>Q", "Quit", callback_quit], ["About", nil, "_About", "<control>A", "About", callback], ["Logo", "demo-gtk-logo", nil, nil, "GTK+", callback] ] toggle_actions = [ ["Bold", Gtk::Stock::BOLD, "_Bold", "<control>B", "Bold", callback, true] ] color_radio_actions = [ ["Red", nil, "_Red", "<control>R", "Blood", 0], ["Green", nil, "_Green", "<control>G", "Grass", 1], ["Blue", nil, "_Blue", "<control>B", "Sky", 2] ] shape_radio_actions = [ ["Square", nil, "_Square", "<control>S", "Square", 0], ["Rectangle", nil, "_Rectangle", "<control>R", "Rectangle", 1], ["Oval", nil, "_Oval", "<control>O", "Egg", 2] ] window = Gtk::Window.new("Gtk::UIManager sample") actiongroup = Gtk::ActionGroup.new("Actions") actiongroup.add_actions(actions) actiongroup.add_toggle_actions(toggle_actions) actiongroup.add_radio_actions(color_radio_actions, 1) do |action, current| puts "action = `#{action.name}'" puts "current = `#{current.name}'" end actiongroup.add_radio_actions(shape_radio_actions, 2, callback_radio) if not Gtk.check_version(2, 12, 0) action = Gtk::RecentAction.new('recent', 'Open Recent', nil, 'gtk-open') [ 'item-activated', 'activate' ].each { |signal| action.signal_connect(signal) { |action| puts "`Recent' #{signal}, uri=#{action.current_uri || 'no item selected'}" } } actiongroup.add_action(action) end uimanager = Gtk::UIManager.new uimanager.insert_action_group(actiongroup, 0) window.add_accel_group(uimanager.accel_group) uimanager.add_ui(ui_info) vbox = Gtk::VBox.new vbox.pack_start(uimanager["/MenuBar"], false, false) vbox.pack_start(Gtk::Label.new("Gtk::UIManager Sample")) window.add(vbox) window.set_default_size(100, 100).show_all window.signal_connect("destroy"){Gtk.main_quit} Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/entry.rb�����������������������������������������������������0000644�0001750�0001750�00000001132�11701304107�017344� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin entry.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: entry.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("entry") window.border_width = 0 box1 = Gtk::VBox.new(false, 10) window.add(box1) entry = Gtk::Entry.new box1.add(entry) box1.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked") do Gtk.main_quit end box1.add(button) window.show_all entry.text = "hello world" Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/listview.rb��������������������������������������������������0000644�0001750�0001750�00000003760�11701304107�020062� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin listview.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: listview.rb,v 1.11 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::ListStore sample") window.border_width = 0 box1 = Gtk::VBox.new(false, 0) window.add(box1) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, true, true, 0) scrolled_win = Gtk::ScrolledWindow.new scrolled_win.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC) box2.pack_start(scrolled_win, true, true, 0) data = [ "hello", "world", "blah", "foo", "bar", "argh", "spencer", "is a", "wussy", "programmer" ] model = Gtk::ListStore.new(String) column = Gtk::TreeViewColumn.new("Data", Gtk::CellRendererText.new, {:text => 0}) treeview = Gtk::TreeView.new(model) treeview.append_column(column) treeview.selection.set_mode(Gtk::SELECTION_SINGLE) scrolled_win.add_with_viewport(treeview) data.each do |v| iter = model.append iter[0] = v end button = Gtk::Button.new("add") button.set_flags(Gtk::Widget::CAN_FOCUS) i = 0 button.signal_connect("clicked") do iter = model.append iter[0] = "add item #{i}" i += 1 end box2.pack_start(button, false, true, 0) button = Gtk::Button.new("remove") button.set_flags(Gtk::Widget::CAN_FOCUS) button.signal_connect("clicked") do iter = treeview.selection.selected model.remove(iter) if iter end box2.pack_start(button, false, true, 0) separator = Gtk::HSeparator.new box1.pack_start(separator, false, true, 0) separator.show box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) button = Gtk::Button.new("close") button.signal_connect("clicked") do Gtk.main_quit end box2.pack_start(button, true, true, 0) button.set_flags(Gtk::Widget::CAN_DEFAULT) button.grab_default window.set_default_size(300, 300) window.show_all Gtk.main ����������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/composited-windows.rb����������������������������������������0000644�0001750�0001750�00000007171�11701304107�022052� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin composited-windows.rb - Sample script translated from http://library.gnome.org/devel/gdk/unstable/gdk-Windows.html#composited-window-example Copyright (c) 2008 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. =end require 'gtk2' if str = Gtk.check_version(2, 12, 0) puts "This sample requires GTK+ 2.12.0 or later." puts str exit end unless Gdk.cairo_available? puts "This sample requires Cairo support." exit end Gtk.init # Make the widgets button = Gtk::Button.new("A Button") event = Gtk::EventBox.new window = Gtk::Window.new(Gtk::Window::TOPLEVEL) # Put a red background on the window window.modify_bg(Gtk::STATE_NORMAL, Gdk::Color.parse("red")) # Set the colourmap for the event box. Must be done before the event box is realised. event.colormap = event.screen.rgba_colormap # Set our event box to have a fully-transparent background # drawn on it. Currently there is no way to simply tell GTK+ # that "transparency" is the background colour for a widget. event.app_paintable = true event.signal_connect('expose-event') do |widget, event| # This function simply draws a transparency onto a widget on the area # for which it receives expose events. This is intended to give the # event box a "transparent" background. # # In order for this to work properly, the widget must have an RGBA # colourmap. The widget should also be set as app-paintable since it # doesn't make sense for GTK+ to draw a background if we are drawing it # (and because GTK+ might actually replace our transparency with its # default background colour). # cr = widget.window.create_cairo_context cr.operator = Cairo::OPERATOR_CLEAR cr.gdk_region(event.region) cr.fill false end # Put them inside one another window.border_width = 10 window.add(event) event.add(button) # Realize and show everything window.show_all # Set the event box GdkWindow to be composited. # Obviously must be performed after event box is realised. event.window.composited = true # Set up the compositing handler. # Note that we do _after_ so that the normal (red) background is drawn # by gtk before our compositing occurs. # window.signal_connect_after('expose-event') do |widget, event| # This function performs the actual compositing of the event box onto # the already-existing background of the window at 50% normal opacity. # # In this case we do not want app-paintable to be set on the widget # since we want it to draw its own (red) background. Because of this, # however, we must ensure that we use #signal_connect_after so that # this handler is called after the red has been drawn. If it was # called before then GTK would just blindly paint over our work. # # Note: if the child window has children, then you need a cairo 1.16 # feature to make this work correctly. # # get our child (in this case, the event box) child = widget.child # create a cairo context to draw to the window cr = widget.window.create_cairo_context # the source data is the (composited) event box # NOTICE: next line generates a GTK warning, it is maybe a GTK problem, it is tracked # at http://bugzilla.gnome.org/show_bug.cgi?id=526965 cr.set_source_pixmap(child.window, child.allocation.x, child.allocation.y) # draw no more than our expose event intersects our child region = Gdk::Region.new(Gdk::Rectangle.new(child.allocation.x, child.allocation.y, child.allocation.width, child.allocation.height)) region.intersect(event.region) cr.gdk_region(region) cr.clip # composite, with a 50% opacity cr.operator = Cairo::OPERATOR_OVER cr.paint(0.5) false end Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/toolbar.rb���������������������������������������������������0000644�0001750�0001750�00000002735�11701304107�017657� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin toolbar.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: toolbar.rb,v 1.11 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::Toolbar sample") window.signal_connect("destroy") do Gtk.main_quit end toolbar = Gtk::Toolbar.new toolbar.append("Horizontal", "Horizontal toolbar layout", "Toolbar/Horizontal", Gtk::Image.new("test.xpm")) do toolbar.orientation = Gtk::ORIENTATION_HORIZONTAL end toolbar.append("Vertical", "Vertical toolbar layout", "Toolbar/Vertical", Gtk::Image.new("test.xpm")) do toolbar.orientation = Gtk::ORIENTATION_VERTICAL end toolbar.append_space toolbar.append("Icons", "Only show toolbar icons", "Toolbar/IconsOnly", Gtk::Image.new("test.xpm")) do toolbar.toolbar_style = Gtk::Toolbar::ICONS end toolbar.append("Text", "Only show toolbar text", "Toolbar/TextOnly", Gtk::Image.new("test.xpm")) do toolbar.toolbar_style = Gtk::Toolbar::TEXT end toolbar.append("Both", "Show toolbar icons and text", "Toolbar/Both", Gtk::Image.new("test.xpm")) do toolbar.toolbar_style = Gtk::Toolbar::BOTH end toolbar.append_space toolbar.append("Enable", "Enable tooltips",nil, Gtk::Image.new("test.xpm")) do toolbar.tooltips = true end toolbar.append("Disable", "Disable tooltips",nil, Gtk::Image.new("test.xpm")) do toolbar.tooltips = false end window.add(toolbar) window.show_all Gtk.main �����������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/recentchooserdialog.rb���������������������������������������0000644�0001750�0001750�00000002753�11701304107�022240� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin recentchooserdialog.rb - Ruby/GTK2 sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: recentchooserdialog.rb,v 1.2 2006/11/15 23:46:13 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 10, 0) puts "This sample requires GTK+ 2.10.0 or later" puts str exit end dialog = Gtk::RecentChooserDialog.new("Recent Chooser Dialog Sample", nil, [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT]) dialog.signal_connect("response") do |widget, response| case response when Gtk::Dialog::RESPONSE_ACCEPT info = dialog.current_item if info puts "----" puts info.uri puts info.display_name puts info.description puts info.mime_type puts info.added puts info.modified puts info.visited puts info.private_hint? p info.application_info("gedit") p info.applications puts info.last_application p info.groups puts info.has_group?("web") puts info.has_application?("gedit") puts info.get_icon(64) puts info.short_name puts info.uri_display puts info.age puts info.local? puts info.exist? end else p "Close" dialog.destroy Gtk.main_quit end end dialog.show_all Gtk.main ���������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/assistant.rb�������������������������������������������������0000755�0001750�0001750�00000023017�11701304107�020225� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin test-assistant.rb - Ruby/GTK version of testassistant.c from gtk+ 2.10 sources. Guillaume Cottenceau for the ruby-gnome2 project. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: assistant.rb,v 1.1 2006/11/23 08:39:12 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 10, 0) puts "This sample requires GTK+ 2.10.0 or later" puts str exit end class AssistantRunner def initialize @simple_assistant = nil @generous_assistant = nil @selected_branch = "A" @nonlinear_assistant = nil @full_featured_assistant = nil end def run_simple_assistant @simple_assistant = run_assistant(@simple_assistant, :create_simple_assistant) end def run_generous_assistant @generous_assistant = run_assistant(@generous_assistant, :create_generous_assistant) end def run_nonlinear_assistant @nonlinear_assistant = run_assistant(@nonlinear_assistant, :create_nonlinear_assistant) end def run_full_featured_assistant @full_featured_assistant = run_assistant(@full_featured_assistant, :create_full_featured_assistant) end private def run_assistant(assistant, assistant_create_method) assistant ||= send(assistant_create_method) if !assistant.visible? assistant.show else assistant.destroy assistant = nil end assistant end def add_completion_test_page(assistant, text, visible, complete) page = Gtk::VBox.new(0, 0) check = Gtk::CheckButton.new("Complete") page.add(Gtk::Label.new(text)) page.add(check) check.active = complete check.signal_connect('toggled') do complete = check.active? assistant.set_page_complete(page, complete) end page.show_all if visible assistant.append_page(page) assistant.set_page_title(page, text) assistant.set_page_complete(page, complete) page end def create_test_page(text) Gtk::Label.new(text) end def prepare_cb(assistant, page) if page.is_a?(Gtk::Label) puts "prepare: #{page.text}" elsif assistant.get_page_type(page) == Gtk::Assistant::PAGE_PROGRESS progress = page.child assistant.set_page_complete(page, false) progress.fraction = 0.0 Gtk.timeout_add(300) do page = assistant.get_nth_page(assistant.current_page) progress = page.child value = progress.fraction = progress.fraction + 0.1 continue = value < 1.0 assistant.set_page_complete(page, true) unless continue continue end else puts "prepare: #{assistant.current_page}" end end def create_simple_assistant assistant = Gtk::Assistant.new assistant.set_default_size(400, 300) assistant.signal_connect('cancel') do puts "cancel" assistant.hide end assistant.signal_connect('close') do puts "close" assistant.hide end assistant.signal_connect('apply') do puts "apply" end assistant.signal_connect('prepare') do |_assistant, page| prepare_cb(_assistant, page) end page = create_test_page("Page 1") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 1") assistant.set_page_complete(page, true) page = create_test_page("Page 2") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 2") assistant.set_page_type(page, :confirm) assistant.set_page_complete(page, true) end def create_generous_assistant assistant = Gtk::Assistant.new assistant.set_default_size(400, 300) assistant.signal_connect('cancel') do puts "cancel" assistant.hide end assistant.signal_connect('close') do puts "close" assistant.hide end assistant.signal_connect('apply') do puts "apply" end assistant.signal_connect('prepare') do|_assistant, page| prepare_cb(_assistant, page) end page = create_test_page("Introduction") page.show assistant.append_page(page) assistant.set_page_title(page, "Introduction") assistant.set_page_type(page, :intro) assistant.set_page_complete(page, true) page = add_completion_test_page(assistant, "Content", true, false) next_page = add_completion_test_page(assistant, "More Content", true, true) check = Gtk::CheckButton.new("Next page visible"); check.active = true check.signal_connect('toggled') do puts "beuh" next_page.visible = check.active? end check.show page.add(check) add_completion_test_page(assistant, "Even More Content", true, true) page = create_test_page("Confirmation") page.show assistant.append_page(page) assistant.set_page_title(page, "Confirmation") assistant.set_page_type(page, :confirm) assistant.set_page_complete(page, true) page = Gtk::Alignment.new(0.5, 0.5, 0.9, 0.0) page.add(Gtk::ProgressBar.new) page.show_all assistant.append_page(page) assistant.set_page_title(page, "Progress") assistant.set_page_type(page, :progress) assistant.set_page_complete(page, true) page = create_test_page("Summary") page.show assistant.append_page(page) assistant.set_page_title(page, "Summary") assistant.set_page_type(page, :summary) assistant.set_page_complete(page, true) end def create_nonlinear_assistant assistant = Gtk::Assistant.new assistant.set_default_size(400, 300) assistant.signal_connect('cancel') do puts "cancel" assistant.hide end assistant.signal_connect('close') do puts "close" assistant.hide end assistant.signal_connect('apply') do puts "apply" end assistant.signal_connect('prepare') do |_assistant, page| prepare_cb(_assistant, page) end assistant.set_forward_page_func do |current_page| retval = -1 if current_page == 0 if @selected_branch == 'A' retval = 1 else retval = 2 end elsif current_page == 1 || current_page == 2 retval = 3 end retval end page = Gtk::VBox.new(false, 6) button = Gtk::RadioButton.new('branch A') page.pack_start(button, false, false, 0) button.signal_connect('toggled') do @selected_branch = 'A' end button.active = true button = Gtk::RadioButton.new(button, 'branch B') page.pack_start(button, false, false, 0) button.signal_connect('toggled') do @selected_branch = 'B' end page.show_all assistant.append_page(page) assistant.set_page_title(page, "Page 1") assistant.set_page_complete(page, true) page = create_test_page("Page 2A") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 2A") assistant.set_page_complete(page, true) page = create_test_page("Page 2B") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 2B") assistant.set_page_complete(page, true) page = create_test_page("Confirmation") page.show assistant.append_page(page) assistant.set_page_title(page, "Confirmation") assistant.set_page_type(page, :confirm) assistant.set_page_complete(page, true) end def create_full_featured_assistant assistant = Gtk::Assistant.new assistant.set_default_size(400, 300) assistant.signal_connect('cancel') do puts "cancel" assistant.hide end assistant.signal_connect('close') do puts "close" assistant.hide end assistant.signal_connect('apply') do puts "apply" end assistant.signal_connect('prepare') do |_assistant, page| prepare_cb(_assistant, page) end button = Gtk::Button.new(Gtk::Stock::STOP) button.show assistant.add_action_widget(button) page = create_test_page("Page 1") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 1") assistant.set_page_complete(page, true) #- set a side image pixbuf = page.render_icon(Gtk::Stock::DIALOG_WARNING, :dialog) assistant.set_page_side_image(page, pixbuf) #- set a header image pixbuf = page.render_icon(Gtk::Stock::DIALOG_INFO, :dialog) assistant.set_page_header_image(page, pixbuf) page = create_test_page("Invisible page") assistant.append_page(page) page = create_test_page("Page 3") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 3") assistant.set_page_type(page, :confirm) assistant.set_page_complete(page, true) #- set a header image pixbuf = page.render_icon(Gtk::Stock::DIALOG_INFO, :dialog) assistant.set_page_header_image(page, pixbuf) assistant end end runner = AssistantRunner.new buttons = [ [ 'simple assistant', proc { runner.run_simple_assistant } ], [ 'generous assistant', proc { runner.run_generous_assistant } ], [ 'nonlinear assistant', proc { runner.run_nonlinear_assistant } ], [ 'full featured assistant', proc { runner.run_full_featured_assistant } ], ] if ENV['RTL'] Gtk::Widget.default_direction = Gtk::Widget::TEXT_DIR_RTL end window = Gtk::Window.new(Gtk::Window::TOPLEVEL) window.signal_connect('destroy') { Gtk.main_quit } window.signal_connect('delete-event') { false } box = Gtk::VBox.new(false, 6) window.add(box) buttons.each do |label, callback| button = Gtk::Button.new(label) button.signal_connect('clicked') do callback.call end box.pack_start(button, true, true, 0) end window.show_all Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/button2.rb���������������������������������������������������0000644�0001750�0001750�00000001161�11701304107�017602� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/local/bin/ruby =begin button2.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: button2.rb,v 1.4 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::Button sample") button1 = Gtk::Button.new("_HELLO") button2 = Gtk::Button.new("_HELLO", false) button3 = Gtk::Button.new(Gtk::Stock::QUIT) button3.signal_connect("clicked"){ Gtk.main_quit } box = Gtk::VBox.new box.add(button1) box.add(button2) box.add(button3) window.add(box).set_default_size(100,100).show_all Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/dnd.rb�������������������������������������������������������0000644�0001750�0001750�00000003664�11701304107�016764� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin dnd.rb - Drag and Drop sample script. Copyright (C) 2002-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 13:18:12 $ $Id: dnd.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' class SrcWindow < Gtk::Window def initialize super("Source Window") @label = Gtk::Label.new("Drag here!") add(@label) set_default_size(100, 100) Gtk::Drag.source_set(self, Gdk::Window::BUTTON1_MASK | Gdk::Window::BUTTON2_MASK, [["test", Gtk::Drag::TARGET_SAME_APP, 12345]], Gdk::DragContext::ACTION_COPY | Gdk::DragContext::ACTION_MOVE) signal_connect("drag_data_get") do |widget, context, selection_data, info, time| # selection_data.set("text/uri-list", 8, "hoge.txt") selection_data.set(Gdk::Selection::TYPE_STRING, "hoge.txt") end end end class DestWindow < Gtk::Window def initialize super("Dest Window") @label = Gtk::Label.new("Drop here!") add(@label) set_default_size(100, 100) Gtk::Drag.dest_set(self, Gtk::Drag::DEST_DEFAULT_MOTION | Gtk::Drag::DEST_DEFAULT_HIGHLIGHT, [["test", Gtk::Drag::TARGET_SAME_APP, 12345]], Gdk::DragContext::ACTION_COPY|Gdk::DragContext::ACTION_MOVE) signal_connect("drag-data-received") do |w, dc, x, y, selectiondata, info, time| dc.targets.each do |target| if target.name == "test" || selectiondata.type == Gdk::Selection::TYPE_STRING puts selectiondata.data end end end signal_connect("drag-drop") do |w, dc, x, y, time| Gtk::Drag.get_data(w, dc, dc.targets[0], time) end end end win1 = SrcWindow.new win2 = DestWindow.new win1.show_all.signal_connect("destroy"){Gtk.main_quit} win2.show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ����������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/gdkscreen.rb�������������������������������������������������0000644�0001750�0001750�00000001266�11701304107�020160� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin gdkscreen.rb - Gdk::Screen sample script. Copyright (C) 2004-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: gdkscreen.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' screen = Gdk::Screen.default settings_map = [ "gtk-double-click-time", "gtk-dnd-drag-threshold", "gtk-can-change-accels", "gtk-color-palette", "gtk-font-name", "gtk-icon-sizes", "gtk-key-theme-name", "gtk-toolbar-style", "gtk-toolbar-icon-size", "gtk-im-preedit-style", "gtk-im-status-style", "gtk-cursor-blink", "gtk-cursor-blink-time", "gtk-theme-name" ] settings_map.each do |v| puts "#{v}: #{screen.get_setting(v)}" end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/alpha-demo.rb������������������������������������������������0000755�0001750�0001750�00000003346�11701304107�020226� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin alpha-demo.rb - alpha blended window sample script. (need xcompmgr) Original: alphademo.py by Mike Hearn (*1) and David Trowbridge (*2) * (1) http://plan99.net/~mike/blog/2006/06/05/alpha-blended-windows-in-python/ * (2) http://david.navi.cx/blog/?p=91 Translated to Ruby by Juergen Mangler <juergen.mangler@univie.ac.at> Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: alpha-demo.rb,v 1.1 2007/01/06 03:55:44 ktou Exp $ =end require 'gtk2' require 'cairo' class AlphaDemo < Gtk::Window def initialize() super() set_app_paintable(true) set_title("AlphaDemo") set_decorated(false) set_default_size(200, 220) signal_connect("delete_event") do Gtk.main_quit end set_double_buffered(false) signal_connect('expose-event') do |widget, event| cr = widget.window.create_cairo_context rgba = [1.0, 1.0, 1.0] rgba << 0.0 if @supports_alpha cr.set_source_rgba(rgba) cr.set_operator(Cairo::OPERATOR_SOURCE) cr.paint twidth, theight = widget.size cr.set_source_rgba(1.0, 0.2, 0.2, 0.6) radius = [twidth, theight].min.to_f / 2 - 0.8 cr.arc(twidth.to_f / 2, theight.to_f / 2, radius, 0, 2.0 * Math::PI) cr.fill_preserve cr.stroke end signal_connect('screen-changed') do |widget, old_screen| screen_changed(widget, old_screen) end screen_changed(self) end def screen_changed(widget,old_screen=nil) tcolormap = widget.screen.rgba_colormap @supports_alpha = !tcolormap.nil? tcolormap ||= widget.screen.rgb_colormap widget.set_colormap(tcolormap) end end alpha = AlphaDemo.new alpha.show Gtk.main() ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/gnome-logo-icon.png������������������������������������������0000644�0001750�0001750�00000006022�11701304107�021360� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡��� pHYs�� �� ÒÝ~ü���tIMEÒ !??G…�� ±IDATxœí™mp”ÕÇ÷nt@²ÙMIHÌî“Í’]Ü @"³@‚–šQ¦8MÀ@iE ”–J­Äi+`U”Ö)*kkªR-[B[ªX“ªmi±$Vc² /BDÝ /aŠåöþ°IžÍ‹f¦_<3ÿ$ϹçœçîëynàKùR¾ˆÿ7€Ñ£G;` ©ü€hÙ÷ôôDþbõ¡ø#+cÆŒq*¥Ü1‚û…ùJ©Ž¾ BÎ;€Ú«´âk‹>!Á ×ëwÄëõ*„7Bzôz=ñ!èõúb!e½Ôé\R§CÆÙ%%n­¶Ù%%‘÷ 1¡‹Ò#¤¬”R‚ë¶… ïB Â:Î)¤ôJ)QvýPXXX~¦»û> =J©‘OÀ˜”d–B–K©#S¦Lqü~sD'¤[J±¯]_˜Íf€~v!ýçO`lò¸yc“ǽ‘”<îàØäqó"Á¤Î¢5äBH€J©Ó¡Ó銘6$&&òÕ¹sƒqcèâ†K>9%ͬP^ˆì�¥”%95MsÇ�˜4É€ |(;ÇŠ+0 �Þ__ýçK@HQ)zo^ÆÝuu^)åÌX>‡À/ƒDò{‡Ãnç›Ë—Ô§ŒOo ùá°ÛùÞw×yˆ ‡aO!)D?´¶¶ºº><á”B4H!üÑm3¦OÇ”™ ШåÛFƒ‘­nw¸—«ûêûñnB§ó Žhœã®Ð³7ºmÍšï�øÇgšúúõ…!1‘ß¾ò;@õøLS“†>Òûƒ&žiq¦gšaqG@z¥DÃa·¥H)«¥RHÖ¬^Íôn�pK±÷õõ—Bb4ùíÎáXž “e‹†¾ùA%Ü՞aÎR!´+¥ !ýæ(½êì<ª”Rë3ÌYd˜³PJ«Ër0ì§”"ÔåŒöÍ0g©¥UË•ßÛïÇYZµ¿?€R*²ï÷›±Ègfe›Aù¢uË—Uy±ý™ù ÈÉÉyãðáî…·-àñŸ>àB4Ï.åÈ‘#ti+&x„»…‘J)Åæ-[+Ö:Ì)-Áž—n®Þ¼eë ýðz>,¦k¬*«¿»V)¥œ¦k¬(¥œJ©OC½öi¸‡Â½5P¯…ì6‡ü>UJíPJ™µüŠƒl£BH/P~>~âC€r!d“%gb“ïðù@%à°X',Ö<(ÂbζYú„õ!h´Xó¼B`Q—TdtÌ96,Ö<„�_ëpÔRŽ=€ÔÌ,3ÐH¨Ì-œ6•~å©/«ì˜¹ç¹|H©DŸÂdž  \)U®o�ñ !ª•RÏõ#&§Ž¶÷Òi†æ.ÔÓÓCOO¾Ö掯/º½23ój„”Ì) @îkY÷`5’öUL˜´±!<Q.¤d˜0"„GJ9¯ë˜ŽwDÚ‚4ÓΟ?A˜W44G ^¯àì™3áÌw4·´TæÙl�žlG~5Jy¡‡=ÏïÝù‚%Ûî |t¢úôtii)¯¼ü2�ÆÄ$.©KÍ—­oØ€R !Ä’<›­¨Ùú³§êAøÒ…ŒÞkn1î?<<úTŸ ,ˆLÿ§ŸÐí÷ÓÐhÀØ”TNŸ:ÉØq)½ôIé&'JÕsùÓoD$#=ú½uþäÔ´ÄhýéS'HNMÓôû¥gGì](95è*@éAŒ,y€ÒÙ3ŒIãMøO‹èSƧÁ-»]¯¼ŒÁ`ОBw"N§ë…¤tóz„ÈGF ú*/ð"Æ´LŒi™˜²óhk=„..®æÎ‹Á` ÃdÑžBÁ#ß\0@BJF;`ù"=­%ÛÝHÉÌb€ò “åw�«WUóUÕ½ìÂ|úŠæܵì›4ÿû]„”ètq$¤f:Ò2R‹!IHH`Ûc›Âä=@÷ïŽwú8ÞécÆM7õâcšÝk¾õ­œ8ÚÁ‰£ÚkÀd6c0$p¼£¥¶©Eƒ~„ GlÖl6<¸Ž‰¹9�ÛÔ¢%-ÿ|3Ò^pýu�Xr&RX0Î#m‘Z(¼=pÿ÷BÄžBá��£’RÖ5#A~eU%+—- ?º-9WEEð‡‘‡AEs !BÐÑÖBG[ áû¢‹uÚõ“Ùõ«gÂäý€ËVèZuSéÍüñ÷u,þú"L&R§ãÁÜOû¡÷ñµ6ãkmFtšk%esôz¾Ò8®˜àõܰEÏÊ»¾AÅ¢…a•¨É¶;c^ &{Þ/혬À5öËS¾í½ƒ�ئ— \×jÈ´ÉNžÜø úx…ÕÙŽÉ Ñ6áø9×^?x@!ú•š dOº®ŸN§»‹¨Òz0¹ÿÞTܱ üXc»qÎCaýO6lDÆ„NôKgý 1 *š ääOëooœG¨îLÖݳ‚ŠÛçC°×+­“ šB1œ7ƒ¾á\ꬿ)!^÷¥_ruz:¹E7[Ïw/ëu…ÚÖcŒƒfi©üy§'LÞroú Ì "ß}Åœ‘î{õ…gòs§Ü8¬µ¡}+uÐzçozçoBT^ć£”Û¦lS‹=gA`Ac,?×ô àBÆÄ\+ÞZ‡¼Í¡o#tqý ½êâ8sþ+×þ[A1¶‚bqá\Hw0om|Ðæã ϯëmÅHÉÊåK RÒ8ß´üI�Fë¹ÓXÏ®A]e`ê¯O2¿b_›Ø€î_9š‰k&`íÞÍ¡tñÒ]—°žy뙿Йu%w¾ýW””5JÊF%%±ðÄs/º.]e¸oÉžn^ÝÜŠuæ× !?Mûôô4JŠn�¨¿eG u-w’{º‰­[Ì¡ýD#ò)K÷æèkeX»—pÄÕÁ’¿_¡@kâmäÞÁBñ·ì(éyiO\5ŠÀ‚õ-ë×VfŽï.¡˜p?s»é`KÚ;@4‚Èe»îîªð«½m®¦,/›½eq¬ž·¨QHÚÇö_ìevág 깸iOoßc“8üd6rw!üaåitÛöÑuñ]÷Náçw·5=õðªm9× „n ä+d¥:K,›ù·”P:£ÀZ :º^r³ÿê“÷Ô·¬ Dpó[vŸ…ºæ@4rÅÚ ˜|2Ö"®'ù¬- oeîÏžä¿w—²‰R‹ý©âç[·ª²dÆ´A"6Ü<“Mkïð5,@ÁNŸmšÖ]|¶ýiö¿â7k{|”Ù깸Éw”ko£ev?uïñÿ³šÜwv3íÉOøÓÿiëŽ)¥æ½¸ç5Ï#ÛŸ7v‡þñ6©\ðUøöåºHˆ‰Mon$¿(øŽ+ž¸•‹÷ìéÇ)"‰Ï’R½:vÉwe¶7B¸ÌQOÝ{®H[Ê£èºx!: óÇþ€g÷ëo¹<»~ϱ“Å$^àÌãÞoÜN¡ÓE^4 5ñ0—”‡Œt­÷ÇN o E”R@Ms[»eÿ»ÍtŸ½<" ñc(>•«Ó" Ú:s^`ÛˆDîBE2µ%ù<ûçÓ,u$óìá NG ] Íœ?,âÐk>Ì#X.äÓû?2>‚åˆ;GÈŽÃE³Øöæë¬T %‡Û;yüÙZö½ý!¿wÀš`/$@ÑTî|óužX©-= À‹]åÔ5£¶4ŸÅ¯=|‰ñâž×xdûó|εÅ!,{©SÅâWQ;ç-¿:#Ö’À­¡ß^”R|ì°ûõ·æïG¢ìÚcÔ½{uo'¥‚'ëôZêÿº˜ÇœUÀÃìnJ |”ÚªxþÕ•ÆæÝ‹ù¯: @s[ï»ÓˆýðT¿+îY—¦0ëR<eÎ[ƒ=•›†ž29ɬ‹Ç˜¥PÄ…> ÜWwXtÃŒ½€ƒÚÒJ¢/Ƶ®Ô‡zÅþ?GŠq)I»����IEND®B`‚��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/properties.rb������������������������������������������������0000755�0001750�0001750�00000004321�11701304107�020405� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin properties.rb - GLib::Object#properties and Gtk::Container#child_properties sample script. Copyright (C) 2004-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: properties.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' class MyButton < Gtk::Button type_register def initialize(label = nil) # XXX: # When type_register() is used. # super is equivalent to GLib::Object#initialize. super("label" => label) @fuga = 0 @hoge = 0 end # define new property "fuga" install_property(GLib::Param::Int.new("fuga", # name "Fuga", # nick "fuga fuga", # blurb 0, # min 10000, # max 0, # default GLib::Param::READABLE | GLib::Param::WRITABLE)) # define new property "hoge" install_child_property(GLib::Param::Int.new("hoge", # name "Hoge", # nick "hoge hoge", # blurb 0, # min 10000, # max 0, # default GLib::Param::READABLE | GLib::Param::WRITABLE)) # implementation of the property "fuga" def fuga puts "MyButton#fuga is called" @fuga end def fuga=(arg) puts "MyButton#fuga= is called" @fuga = arg notify("fuga") end # implementation of the property "hoge" def get_hoge(child) puts "MyButton#get_hoge is called" @hoge end def set_hoge(child, arg) puts "MyButton#set_hoge is called" @hoge = arg end end b = MyButton.new("Hello") p b p b.label p b.gtype p MyButton.properties p b.get_property("fuga") b.set_property("fuga", 1) p b.get_property("fuga") p MyButton.child_properties p child = b.child p b.child_get_property(child, "hoge") b.child_set_property(child, "hoge", 2) p b.child_get_property(child, "hoge") p MyButton.ancestors ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/radiobutton.rb�����������������������������������������������0000644�0001750�0001750�00000001771�11701304107�020546� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin radiobutton.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: radiobutton.rb,v 1.10 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Gtk::RadioButton sample") window.signal_connect("destroy"){Gtk.main_quit} box1 = Gtk::VBox.new window.add(box1) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.add(box2) button1 = Gtk::RadioButton.new("_button1") button2 = Gtk::RadioButton.new(button1, "_button2", false) button3 = Gtk::RadioButton.new(button1, Gtk::Stock::QUIT) box2.add(button1).add(button2).add(button3) box1.add(Gtk::HSeparator.new) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.add(box2) close = Gtk::Button.new("close") close.signal_connect("clicked") do Gtk.main_quit end box2.add(close) close.can_default = true close.grab_default window.signal_connect("destroy"){Gtk.main_quit} window.show_all Gtk.main �������ruby-gnome2-all-2.1.0/gtk2/sample/misc/rgtk+cairo.rb������������������������������������������������0000644�0001750�0001750�00000002003�11701304107�020241� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin rgtk+cairo.rb - Ruby/GTK2 using Ruby/Cairo sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. Heavily inspired from png.rb example of rcairo. $Id: rgtk+cairo.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' require 'cairo' w = Gtk::Window.new.add(vb = Gtk::VBox.new) vb.add(da = Gtk::DrawingArea.new) da.set_size_request(200, 200) da.signal_connect('expose-event') { |widget, event| cr = widget.window.create_cairo_context # fill background with white cr.set_source_rgba(1.0, 1.0, 1.0) cr.paint # create shape cr.move_to(50, 50) cr.curve_to(100, 25, 100, 75, 150, 50) cr.line_to(150, 150) cr.line_to(50, 150) cr.close_path cr.set_source_rgb(0.0, 0.0, 0.0) cr.fill_preserve cr.set_source_rgb(1.0, 0.0, 0.0) cr.set_line_join(Cairo::LINE_JOIN_MITER) cr.set_line_width(4) cr.stroke } w.signal_connect("destroy"){Gtk.main_quit} w.show_all Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/helloworld.rb������������������������������������������������0000644�0001750�0001750�00000001235�11701304107�020362� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin helloworld.rb - Ruby/GTK2 first sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: helloworld.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' button = Gtk::Button.new("Hello World") button.signal_connect("clicked") { puts "Hello World" } window = Gtk::Window.new("Hello World sample") window.signal_connect("delete_event") { puts "delete event occurred" #true false } window.signal_connect("destroy") { puts "destroy event occurred" Gtk.main_quit } window.border_width = 10 window.add(button) window.show_all Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/aboutdialog2.rb����������������������������������������������0000644�0001750�0001750�00000002566�11701304107�020573� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin aboutdialog2.rb - Ruby/GTK sample script. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: aboutdialog2.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" puts str exit end Gtk::AboutDialog.set_email_hook {|about, link| p "email_hook" p link } Gtk::AboutDialog.set_url_hook {|about, link| p "url_hook" p link } Gtk::AboutDialog.show(nil, "artists" => ["Artist 1 <no1@foo.bar.com>", "Artist 2 <no2@foo.bar.com>"], "authors" => ["Author 1 <no1@foo.bar.com>", "Author 2 <no2@foo.bar.com>"], "comments" => "This is a sample script for Gtk::AboutDialog", "copyright" => "Copyright (C) 2005 Ruby-GNOME2 Project", "documenters" => ["Documenter 1 <no1@foo.bar.com>", "Documenter 2 <no2@foo.bar.com>"], "license" => "This program is licenced under the same licence as Ruby-GNOME2.", "logo_icon_name" => "gtk-home", "program_name" => "Gtk::AboutDialog sample", "translator_credits" => "Translator 1 <no1@foo.bar.com>\nTranslator 2 <no2@foo.bar.com>\n", "version" => "1.0.0", "website" => "http://ruby-gnome2.sourceforge.jp", "website_label" => "Ruby-GNOME2 Project Website" ) Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/expander.rb��������������������������������������������������0000644�0001750�0001750�00000001132�11701304107�020011� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin expander.rb - Ruby/GTK2 sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: expander.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' expander = Gtk::Expander.new("Expander Sample") expander.expanded = true button = Gtk::Button.new("Hide this button.") button.signal_connect("clicked") do expander.expanded = false end button.set_size_request(200, 200) expander.add(button) Gtk::Window.new.add(expander).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/itemfactory.rb�����������������������������������������������0000644�0001750�0001750�00000005323�11701304107�020537� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin itemfactory.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. *NOTE* Gtk::ItemFactory has been deprecated. Use Gtk::UIManager instead. $Id: itemfactory.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' puts "Deprecated. Use Gtk::UIManager instead." window = Gtk::Window.new("Gtk::ItemFactory") window.signal_connect("destroy") do Gtk.main_quit end window.signal_connect("delete_event") do Gtk.main_quit end accelgroup = Gtk::AccelGroup.new window.add_accel_group(accelgroup) ifp = Gtk::ItemFactory.new(Gtk::ItemFactory::TYPE_MENU_BAR, "<main>", accelgroup) cal_stock = Proc.new {|d, item| p "StockItem, #{d}"} cal_quit = Proc.new{p "Quit"; Gtk.main_quit} cal_check = Proc.new {|d, item| p "CheckItem, #{d}"} cal_toggle = Proc.new {|d, item| p "ToggleItem, #{d}"} cal_radio = Proc.new {|d, item| p "RadioItem, #{d}"} cal_misc = Proc.new {|d, item| p "Misc #{d}"} ifp.create_items([ ["/_Stock"], ["/_Stock/_New", "<StockItem>", "<control>N", Gtk::Stock::NEW, cal_stock, 1], ["/_Stock/_Open", "<StockItem>", "<control>O", Gtk::Stock::OPEN, cal_stock, 2], ["/_Stock/_Quit", "<StockItem>", "<control>Q", Gtk::Stock::QUIT, cal_quit], ["/_Check"], ["/_Check/Check_1", "<CheckItem>", "", "", cal_check, 1], ["/_Check/Check_2", "<CheckItem>", "", "", cal_check, 2], ["/_Toggle"], ["/_Toggle/Toggle_1", "<ToggleItem>", "", "", cal_toggle, 1], ["/_Toggle/Toggle_2", "<ToggleItem>", "", "", cal_toggle, 2], ["/_Toggle/Toggle_3", "<ToggleItem>", "", "", cal_toggle, 3], ["/_Radio", "<Branch>"], ["/_Radio/Radio_1", "<RadioItem>", nil, nil, cal_radio, 1], ["/_Radio/Radio_2", "/Radio/Radio1", nil, nil, cal_radio, 2], ["/_Radio/Radio_3", "/Radio/Radio1", nil, nil, cal_radio, 3], ["/_Misc", "<LastBranch>"], ["/_Misc/Tearoff", "<Tearoff>"], ["/_Misc/Title", "<Title>"], ["/_Misc/Image", "<ImageItem>", "", Gdk::Pixbuf.new("gnome-logo-icon.png"), cal_misc, 1], ["/_Misc/Separator", "<Separator>"], ["/_Misc/Item", "<Item>", nil, nil, cal_misc, 2] ]) ifp.get_widget("/Stock/Open").sensitive = false ifp.delete_item("/Toggle/Toggle2") vbox = Gtk::VBox.new vbox.add(ifp.get_widget("<main>")) vbox.add(Gtk::Label.new("Gtk::ItemFactory sample").set_size_request(400, 200)) window.add(vbox) window.show_all Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/buttonbox.rb�������������������������������������������������0000644�0001750�0001750�00000004130�11701304107�020230� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin buttonbox.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: buttonbox.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' def create_bbox_window(horizontal, title, pos, spacing, layout) window = Gtk::Window.new(title) window.signal_connect("delete_event") do window.destroy end box1 = Gtk::VBox.new(false, 0) window.add(box1) if horizontal window.set_default_size(550, 60) window.move(150, pos) bbox = Gtk::HButtonBox.new else window.set_default_size(150, 400) window.move(pos, 200) bbox = Gtk::VButtonBox.new end bbox.layout_style = layout bbox.spacing = spacing box1.border_width = 25 box1.pack_start(bbox, true, true, 0) button = Gtk::Button.new("OK") bbox.add(button) button.signal_connect("clicked") do window.destroy end button = Gtk::Button.new("Cancel") bbox.add(button) button.signal_connect("clicked") do window.destroy end button = Gtk::Button.new("Help") bbox.add(button) window.show_all end def test_hbbox create_bbox_window(true, "Spread", 50, 40, Gtk::ButtonBox::SPREAD) create_bbox_window(true, "Edge", 250, 40, Gtk::ButtonBox::EDGE) create_bbox_window(true, "Start", 450, 40, Gtk::ButtonBox::START) create_bbox_window(true, "End", 650, 15, Gtk::ButtonBox::END) end def test_vbbox create_bbox_window(false, "Spread", 50, 40, Gtk::ButtonBox::SPREAD) create_bbox_window(false, "Edge", 250, 40, Gtk::ButtonBox::EDGE) create_bbox_window(false, "Start", 450, 40, Gtk::ButtonBox::START) create_bbox_window(false, "End", 650, 15, Gtk::ButtonBox::END) end window = Gtk::Window.new("button box") window.signal_connect("delete_event") do Gtk.main_quit end window.border_width = 20 bbox = Gtk::HButtonBox.new window.add(bbox) button = Gtk::Button.new("Horizontal") button.signal_connect("clicked") do test_hbbox end bbox.add(button) button = Gtk::Button.new("Vertical") button.signal_connect("clicked") do test_vbbox end bbox.add(button) window.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/keyboard_grab.rb���������������������������������������������0000644�0001750�0001750�00000001424�11701304107�021002� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin keyboard_grab.rb - Gdk::Window#keyboard_grab/ungrab sample script. Copyright (C) 2001-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME. $Date: 2006/06/17 13:18:12 $ $Id: keyboard_grab.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' window = Gtk::Window.new("Keyboard Grab/Ungrab sample") button1 = Gtk::Button.new("Grab Keyboard!") button2 = Gtk::Button.new("Ungrab Keyboard!") button1.signal_connect('clicked') do Gdk.keyboard_grab(window.window, true, Gdk::Event::CURRENT_TIME) end button2.signal_connect('clicked') do Gdk.keyboard_ungrab(Gdk::Event::CURRENT_TIME) end window.add(Gtk::VBox.new.add(button1).add(button2)) window.set_default_size(200,100).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/tooltips.rb��������������������������������������������������0000644�0001750�0001750�00000015356�11701304107�020075� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin tooltips.rb - Demonstrates the new tooltip API of Gtk+ 2.12; rg2 translation from gtk/tests/testtooltips.c. Copyright (c) 2007 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: tooltips.rb,v 1.1 2007/07/10 13:17:34 ggc Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 12, 0) puts "This sample requires GTK+ 2.12.0 or later" puts str exit end def treeview_query_tooltip(treeview, keyboard_tip, x, y, tooltip) if keyboard_tip # Keyboard mode path, = treeview.cursor if not path return false end else bin_x, bin_y = treeview.convert_widget_to_bin_window_coords(x, y) # Mouse mode path, = treeview.get_path_at_pos(bin_x, bin_y) if not path return false end end data = treeview.model.get_value(treeview.model.get_iter(path), 0) tooltip.markup = "<b>Path #{path}:</b> #{data}" return true end def textview_query_tooltip(textview, keyboard_tip, x, y, tooltip, tag) if keyboard_tip iter = textview.buffer.get_iter_at_offset(textview.buffer.cursor_position) else bx, by = textview.window_to_buffer_coords(Gtk::TextView::WINDOW_TEXT, x, y) iter, = textview.get_iter_at_position(bx, by) end if iter.has_tag?(tag) tooltip.text = 'Tooltip on text tag' return true else return false end end def drawingarea_query_tooltip(keyboard_tip, x, y, tooltip, rectangles) if keyboard_tip return false end for r in rectangles if r.x < x && x < r.x + 50 && r.y < y && y < r.y + 50 tooltip.markup = r.tooltip return true end end return false end Gtk.init window = Gtk::Window.new(Gtk::Window::TOPLEVEL) window.title = 'Tooltips test' window.border_width = 10 window.signal_connect('delete-event') { Gtk.main_quit } box = Gtk::VBox.new(false, 3) window.add(box) # A check button using the tooltip-markup property button = Gtk::CheckButton.new('This one uses the tooltip-markup property') button.tooltip_text = 'Hello, I am a static tooltip.' box.pack_start(button, false, false, 0) raise if button.tooltip_text != 'Hello, I am a static tooltip.' raise if button.tooltip_markup != 'Hello, I am a static tooltip.' # A check button using the query-tooltip signal button = Gtk::CheckButton.new('I use the query-tooltip signal') button.has_tooltip = true button.signal_connect('query-tooltip') { |widget, x, y, keyboard_tip, tooltip| tooltip.markup = widget.label tooltip.set_icon_from_stock(Gtk::Stock::DELETE, Gtk::IconSize::MENU) true } box.pack_start(button, false, false, 0) # A label label = Gtk::Label.new('I am just a label') label.selectable = false label.tooltip_text = 'Label & and tooltip' box.pack_start(label, false, false, 0) raise if label.tooltip_text != "Label & and tooltip" raise if label.tooltip_markup != "Label & and tooltip" # A selectable label label = Gtk::Label.new('I am a selectable label') label.selectable = true label.tooltip_markup = '<b>Another</b> Label tooltip' box.pack_start(label, false, false, 0) raise if label.tooltip_text != 'Another Label tooltip' raise if label.tooltip_markup != '<b>Another</b> Label tooltip' # Another one, with a custom tooltip window button = Gtk::CheckButton.new('This one has a custom tooltip window!') box.pack_start(button, false, false, 0) tooltip_window = Gtk::Window.new(Gtk::Window::POPUP) tooltip_button = Gtk::Label.new('blaat!') tooltip_window.add(tooltip_button) tooltip_button.show button.tooltip_window = tooltip_window button.signal_connect('query-tooltip') { |widget, x, y, keyboard_tip, tooltip| widget.tooltip_window.modify_bg(Gtk::StateType::NORMAL, Gdk::Color.new(0, 65535, 0)) true } button.has_tooltip = true # An insensitive button button = Gtk::Button.new('This one is insensitive') button.sensitive = false button.tooltip_text = 'Insensitive!' box.pack_start(button, false, false, 0) # Tree view store = Gtk::TreeStore.new(String) iter = store.insert(nil, 0, ['File Manager']) iter = store.insert(nil, 0, ['Gossip']) iter = store.insert(nil, 0, ['System Settings']) iter = store.insert(nil, 0, ['The GIMP']) iter = store.insert(nil, 0, ['Terminal']) iter = store.insert(nil, 0, ['Word Processor']) treeview = Gtk::TreeView.new(store) treeview.set_size_request(200, 240) treeview.append_column(Gtk::TreeViewColumn.new('Test', Gtk::CellRendererText.new, { :text => 0 })) treeview.has_tooltip = true treeview.signal_connect('query-tooltip') { |widget, x, y, keyboard_tip, tooltip| treeview_query_tooltip(widget, keyboard_tip, x, y, tooltip) } treeview.selection.signal_connect('changed') { treeview.trigger_tooltip_query } # Set a tooltip on the column column = treeview.get_column(0) column.clickable = true #column.button.tooltip_text = 'Header' .button not available box.pack_start(treeview, false, false, 2) # Text view buffer = Gtk::TextBuffer.new buffer.insert(buffer.end_iter, 'Hello, the text ') tag = buffer.create_tag('bold', { 'weight' => Pango::WEIGHT_BOLD }) buffer.insert(buffer.end_iter, 'in bold', tag) buffer.insert(buffer.end_iter, ' has a tooltip!') textview = Gtk::TextView.new(buffer) textview.set_size_request(200, 50) textview.has_tooltip = true textview.signal_connect('query-tooltip') { |widget, x, y, keyboard_tip, tooltip| textview_query_tooltip(widget, keyboard_tip, x, y, tooltip, tag) } box.pack_start(textview, false, false, 2) # Drawing area if Gdk.cairo_available? Rectangle = Struct.new("Rectangle", :x, :y, :r, :g, :b, :tooltip) rectangles = [ Rectangle.new(10, 10, 0.0, 0.0, 0.9, "Blue box!"), Rectangle.new(200, 170, 1.0, 0.0, 0.0, "Red thing"), Rectangle.new(100, 50, 0.8, 0.8, 0.0, "Yellow thing") ] drawingarea = Gtk::DrawingArea.new drawingarea.set_size_request(320, 240) drawingarea.has_tooltip = true drawingarea.signal_connect('expose_event') { cr = drawingarea.window.create_cairo_context cr.rectangle(0, 0, drawingarea.allocation.width, drawingarea.allocation.height) cr.set_source_rgb(1.0, 1.0, 1.0) cr.fill rectangles.each { |r| cr.rectangle(r.x, r.y, 50, 50) cr.set_source_rgb(r.r, r.g, r.b) cr.stroke cr.rectangle(r.x, r.y, 50, 50) cr.set_source_rgba(r.r, r.g, r.b, 0.5) cr.fill } } drawingarea.signal_connect('query-tooltip') { |widget, x, y, keyboard_tip, tooltip| drawingarea_query_tooltip(keyboard_tip, x, y, tooltip, rectangles) } box.pack_start(drawingarea, false, false, 2) else warn "Part of this sample needs Cairo support. Make sure your ruby-gtk2 is compiled with Cairo support, and rcairo is installed." end window.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/statusicon.rb������������������������������������������������0000644�0001750�0001750�00000006044�11701304107�020406� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin status_icon.rb - Gtk::StatusIcon sample. This sample refers gtk/tests/teststatusicon.c of GTK+-2.10.x. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: statusicon.rb,v 1.1 2006/11/17 18:12:41 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 10, 0) puts "This sample requires GTK+ 2.10.0 or later" puts str exit end class StatusIconSample < Gtk::StatusIcon STATUS_INFO = 0 STATUS_QUESTION = 1 def initialize super @status = STATUS_INFO update_icon set_blinking(true) signal_connect("activate"){ icon_activated } signal_connect("popup-menu"){|w, button, activate_time| menu = Gtk::Menu.new checkmenuitem = Gtk::CheckMenuItem.new("Blink") checkmenuitem.active = blinking? checkmenuitem.signal_connect("activate"){|w| set_blinking(w.active?) } menu.append(checkmenuitem) menuitem = Gtk::MenuItem.new("Quit") menuitem.signal_connect("activate"){ set_visible(false) Gtk.main_quit } menu.append(menuitem) menu.show_all menu.popup(nil, nil, button, activate_time) } timeout_func end def update_icon if @status == STATUS_INFO set_icon_name(Gtk::Stock::DIALOG_INFO) set_tooltip("Some Information ...") else set_icon_name(Gtk::Stock::DIALOG_QUESTION) set_tooltip("Some Question ...") end end def timeout_func GLib::Timeout.add(2000) { if @status == STATUS_INFO @status = STATUS_QUESTION else @status = STATUS_INFO end update_icon true } end def icon_activated unless @dialog @dialog = Gtk::MessageDialog.new(nil, 0, Gtk::MessageDialog::QUESTION, Gtk::MessageDialog::BUTTONS_CLOSE, "You wanna test the status icon?") @dialog.window_position = Gtk::Window::POS_CENTER @dialog.signal_connect("response"){ @dialog.hide } @dialog.signal_connect("delete_event"){ @dialog.hide_on_delete } toggle = Gtk::ToggleButton.new("_Show the icon") @dialog.vbox.pack_end(toggle, true, true, 6) toggle.active = visible? toggle.signal_connect("toggled"){|w| set_visible(w.active?) } toggle = Gtk::ToggleButton.new("_Blink the icon") @dialog.vbox.pack_end(toggle, true, true, 6) toggle.active = blinking? toggle.signal_connect("toggled"){|w| set_blinking(w.active?) } toggle = Gtk::ToggleButton.new("_Change the icon") @dialog.vbox.pack_end(toggle, true, true, 6) toggle.active = (@timeout != 0) toggle.signal_connect("toggled"){ if @timeout and @timeout > 0 GLib::Source.remove(@timeout) @timeout = 0 else @timeout = timeout_func end } end @dialog.show_all @dialog.present end end StatusIconSample.new Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/bindings.rb��������������������������������������������������0000644�0001750�0001750�00000005412�11701304107�020005� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin bindings.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: bindings.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end =begin Usage: bindings.rb <filename> Following key bindings are effective in the TextView area. <space> : scroll down by one page <backspace> : scroll up by one page j : move cursor donw by one line k : move cursor up by one line clicking buttons cause following effect "space" : same as pressing <space> in text view area. "back_space" : same as pressing <backspace> in text view area. "cancel j/k" : disable 'j' and 'k' binding =end require 'gtk2' class Pager < Gtk::TextView type_register # widget's key binding can be defined like this binding_set.add_signal(Gdk::Keyval::GDK_space, 0, "move_cursor", Gtk::MOVEMENT_PAGES, 1, false) binding_set.add_signal(Gdk::Keyval::GDK_BackSpace, 0, "move_cursor", Gtk::MOVEMENT_PAGES, -1, false) def initialize(path) @path = path super() @buffer = self.buffer load set_editable(false) set_size_request(400, 400) end def load open(@path).read.each_line do |line| @buffer.insert_at_cursor(line) end @buffer.place_cursor(@buffer.start_iter) end end path = ARGV[0] || __FILE__ window = Gtk::Window.new window.name = "pager_window" sw = Gtk::ScrolledWindow.new vbox = Gtk::VBox.new hbox = Gtk::HBox.new pager = Pager.new(path) hbox.add(button1 = Gtk::Button.new("space")) hbox.add(button2 = Gtk::Button.new("back_space")) hbox.add(button3 = Gtk::Button.new("cancel j/k")) button1.signal_connect("clicked") do Pager.binding_set.activate(Gdk::Keyval::GDK_space, 0, pager) end button2.signal_connect("clicked") do pager.bindings_activate(Gdk::Keyval::GDK_BackSpace, 0) end # Key bindings can be attached to any widget by # Gtk::BindingSet#add_path # see RC Files section of GTK+ documentation for more detail. bset = Gtk::BindingSet.new("j_and_k") bset.add_signal(Gdk::Keyval::GDK_j, 0, "move_cursor", Gtk::MOVEMENT_DISPLAY_LINES, 1, false) bset.add_signal(Gdk::Keyval::GDK_k, 0, "move_cursor", Gtk::MOVEMENT_DISPLAY_LINES, -1, false) bset.add_path(Gtk::PathType::WIDGET, "pager_window.*.Pager", Gtk::PathPriorityType::APPLICATION) button3.signal_connect("clicked") do bset.entry_clear(Gdk::Keyval::GDK_j, 0) bset.entry_clear(Gdk::Keyval::GDK_k, 0) end sw.add(pager) vbox.add(hbox).add(sw) window.add(vbox) window.show_all pager.grab_focus window.signal_connect("destroy") { Gtk.main_quit } Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/misc/uimanager2.rb������������������������������������������������0000644�0001750�0001750�00000005151�11701304107�020242� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin uimanager2.rb - Copyright (C) 2004-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: uimanager2.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 4, 0) puts "This sample requires GTK+ 2.4.0 or later" puts str exit end callback = Proc.new {|actiongroup, action| puts "`#{action.name}' is clicked. " if action.is_a? Gtk::ToggleAction puts "active? = #{action.active?}" end } callback_quit = Proc.new { p "Quit is called." Gtk.main_quit } callback_radio = Proc.new {|action, current| puts "action = `#{action.name}'" puts "current = `#{current.name}'" } actions = [ ["FileMenu", nil, "_File"], ["PreferencesMenu", nil, "_Preferences"], ["ColorMenu", nil, "_Color"], ["ShapeMenu", nil, "_Shape"], ["HelpMenu", nil, "_Help"], ["New", Gtk::Stock::NEW, "_New", "<control>N", "Create a new file", callback], ["Open", Gtk::Stock::OPEN, "_Open", "<control>O", "Open a file", callback], ["Save", Gtk::Stock::SAVE, "_Save", "<control>S", "Save current file", callback], ["SaveAs", Gtk::Stock::SAVE, "Save _As...", nil, "Save to a file", callback], ["Quit", Gtk::Stock::QUIT, "_Quit", "<control>Q", "Quit", callback_quit], ["About", nil, "_About", "<control>A", "About", callback], ["Logo", "demo-gtk-logo", nil, nil, "GTK+", callback] ] toggle_actions = [ ["Bold", Gtk::Stock::BOLD, "_Bold", "<control>B", "Bold", callback, true] ] color_radio_actions = [ ["Red", nil, "_Red", "<control>R", "Blood", 0], ["Green", nil, "_Green", "<control>G", "Grass", 1], ["Blue", nil, "_Blue", "<control>B", "Sky", 2] ] shape_radio_actions = [ ["Square", nil, "_Square", "<control>S", "Square", 0], ["Rectangle", nil, "_Rectangle", "<control>R", "Rectangle", 1], ["Oval", nil, "_Oval", "<control>O", "Egg", 2] ] window = Gtk::Window.new("Gtk::UIManager sample2") window.signal_connect("destroy"){Gtk.main_quit} actiongroup = Gtk::ActionGroup.new("Actions") actiongroup.add_actions(actions) actiongroup.add_toggle_actions(toggle_actions) actiongroup.add_radio_actions(color_radio_actions, 1) do |action, current| puts "action = `#{action.name}'" puts "current = `#{current.name}'" end actiongroup.add_radio_actions(shape_radio_actions, 2, callback_radio) uimanager = Gtk::UIManager.new uimanager.insert_action_group(actiongroup, 0) window.add_accel_group(uimanager.accel_group) uimanager.add_ui("./uimanager2.xml") vbox = Gtk::VBox.new vbox.pack_start(uimanager["/MenuBar"], false, false) vbox.pack_start(Gtk::Label.new("Gtk::UIManager Sample")) window.add(vbox) window.set_default_size(100, 100).show_all Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/����������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�016413� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/scrolledwindow.rb�����������������������������������������0000644�0001750�0001750�00000004072�11701304107�022002� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header scrolledwindow.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/21 17:47:19 $ $Id: scrolledwindow.rb,v 1.7 2005/07/21 17:47:19 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ScrolledWindowSample < SampleDialog def initialize super("dialog") scrolled_window = Gtk::ScrolledWindow.new scrolled_window.border_width = 10 scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) vbox.add(scrolled_window) table = Gtk::Table.new(20, 20, false) table.row_spacings = 10 table.column_spacings = 10 scrolled_window.add_with_viewport(table) table.focus_hadjustment = scrolled_window.hadjustment table.focus_vadjustment = scrolled_window.vadjustment for i in 0..19 for j in 0..19 buffer = "button (#{i},#{j})" button = Gtk::ToggleButton.new(buffer) table.attach(button, i, i + 1, j, j + 1) end end button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} action_area.pack_start(button, true, true, 0) set_default_size(300, 300) end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/rulers.rb�������������������������������������������������0000644�0001750�0001750�00000001775�11701304107�020266� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header rulers.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: rulers.rb,v 1.9 2005/07/18 17:13:33 mutoh Exp $ =end require 'sample' class RulerSample < SampleWindow def initialize super("rulers") set_default_size(300, 300) set_events(Gdk::Event::POINTER_MOTION_MASK | Gdk::Event::POINTER_MOTION_HINT_MASK) table = Gtk::Table.new(2, 2, false) add(table) hruler = Gtk::HRuler.new hruler.metric = Gtk::CENTIMETERS hruler.set_range(100, 0, 0, 20) vruler = Gtk::VRuler.new vruler.set_range(5, 15, 0, 20) signal_connect("motion_notify_event"){ |w, e| vruler.signal_emit("motion_notify_event", e) } table.attach(hruler, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::FILL, 0, 0) signal_connect("motion_notify_event"){ |w, e| hruler.signal_emit("motion_notify_event", e) } table.attach(vruler, 0, 1, 1, 2, Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) end end ���ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/shapedwindow.rb�������������������������������������������0000644�0001750�0001750�00000004306�11701304107�021437� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header shapedwindow.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: shapedwindow.rb,v 1.7 2005/07/21 17:47:19 mutoh Exp $ =end require 'sample' class ShapeSampleBasic < Gtk::Window include Sample extend SampleClass @@root_win = nil def initialize(xpm_file, x, y, px, py, type) super(type) @destroyed = false signal_connect("destroy"){destroy} realize @@root_win = Gdk::Window.default_root_window unless @@root_win window.set_events(window.events | Gdk::Event::BUTTON_MOTION_MASK | Gdk::Event::POINTER_MOTION_HINT_MASK | Gdk::Event::BUTTON_PRESS_MASK) signal_connect("button_press_event") do |w, event| if (event.event_type == Gdk::Event::BUTTON_PRESS) @x = event.x @y = event.y Gtk.grab_add(self) Gdk.pointer_grab(window, true, Gdk::Event::BUTTON_RELEASE_MASK | Gdk::Event::BUTTON_MOTION_MASK | Gdk::Event::POINTER_MOTION_HINT_MASK, nil, nil, 0) end end signal_connect("button_release_event") do Gtk.grab_remove(self) Gdk.pointer_ungrab(0) end signal_connect("motion_notify_event") do xp, yp, mask = @@root_win.pointer move(xp - @x, yp - @y) end move(x, y) style = Gtk::Widget.default_style fixed = Gtk::Fixed.new fixed.set_size_request(100, 100) add(fixed) gdk_pixmap, gdk_pixmap_mask = Gdk::Pixmap::create_from_xpm(window, style.bg(Gtk::STATE_NORMAL), xpm_file) pixmap = Gtk::Image.new(gdk_pixmap, gdk_pixmap_mask) fixed.put(pixmap, px, py) shape_combine_mask(gdk_pixmap_mask, px, py) end end class ShapeSampleModeller < ShapeSampleBasic def initialize super("Modeller.xpm", 440, 140, 0, 0, Gtk::Window::POPUP) end end class ShapeSampleSheets < ShapeSampleBasic def initialize super("FilesQueue.xpm", 580, 170, 0, 0, Gtk::Window::POPUP) end end class ShapeSampleRings < ShapeSampleBasic def initialize super("3DRings.xpm", 460, 270, 25, 25, Gtk::Window::TOPLEVEL) end end ShapesSample = Class.new class << ShapesSample def invoke ShapeSampleModeller.invoke ShapeSampleSheets.invoke ShapeSampleRings.invoke end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/button.rb�������������������������������������������������0000644�0001750�0001750�00000007410�11701304107�020255� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header button.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/17 16:55:26 $ $Id: button.rb,v 1.6 2005/07/17 16:55:26 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ButtonSample < SampleWindow def initialize super("buttons") box1 = Gtk::VBox.new(false, 0) add(box1) table = Gtk::Table.new(3, 3, false) table.row_spacings = 5 table.column_spacings = 5 table.border_width = 10 box1.pack_start(table, true, true, 0) button = [ Gtk::Button.new("button1"), Gtk::Button.new("button2"), Gtk::Button.new("button3"), Gtk::Button.new("button4"), Gtk::Button.new("button5"), Gtk::Button.new("button6"), Gtk::Button.new("button7"), Gtk::Button.new("button8"), Gtk::Button.new("button9"), ] button[0].signal_connect("clicked") do button_window(button[1]) end table.attach(button[0], 0, 1, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) button[1].signal_connect("clicked") do button_window(button[2]) end table.attach(button[1], 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) button[2].signal_connect("clicked") do button_window(button[3]) end table.attach(button[2], 2, 3, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) button[3].signal_connect("clicked") do button_window(button[4]) end table.attach(button[3], 0, 1, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) button[4].signal_connect("clicked") do button_window(button[5]) end table.attach(button[4], 2, 3, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) button[5].signal_connect("clicked") do button_window(button[6]) end table.attach(button[5], 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) button[6].signal_connect("clicked") do button_window(button[7]) end table.attach(button[6], 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) button[7].signal_connect("clicked") do button_window(button[8]) end table.attach(button[7], 2, 3, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) button[8].signal_connect("clicked") do button_window(button[0]) end table.attach(button[8], 0, 1, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) box1.pack_start(Gtk::HSeparator.new, false, true, 0) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) button[9] = Gtk::Button.new("close") button[9].signal_connect("clicked") do destroy end box2.add(button[9]) end private def button_window(button) unless button.visible? button.show else button.hide end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/pixmap.rb�������������������������������������������������0000644�0001750�0001750�00000003313�11701304107�020236� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header pixmap.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/18 17:13:32 $ $Id: pixmap.rb,v 1.5 2005/07/18 17:13:32 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class PixmapSample < SampleWindow def initialize super("pixmap") vbox = Gtk::VBox.new(false, 0) add(vbox) button = Gtk::Button.new vbox.pack_start(button, false, false, 10) label = Gtk::Label.new("Pixmap\ntest") boxbutton = Gtk::HBox.new(false, 0) boxbutton.border_width = 2 boxbutton.add(Gtk::Image.new("test.xpm")) boxbutton.add(label) button.add(boxbutton) vbox.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, false, false, 10) end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/README����������������������������������������������������0000644�0001750�0001750�00000000402�11701304107�017267� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-testgtk - testgtk.c rewritten in Ruby/GTK To run, do ruby testgtk.rb in this directory. ---- (Maintainer from Ruby/GTK2) Masao Mutoh <mutoh@highway.ne.jp> (Original Author of Ruby/GTK version) Hiroshi Igarashi <igarashi@ueda.info.waseda.ac.jp> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/progressbar.rb��������������������������������������������0000644�0001750�0001750�00000011624�11701304107�021275� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header progressbar.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: progressbar.rb,v 1.9 2005/07/18 17:13:32 mutoh Exp $ Rewritten by Minoru Inachi <inachi@earth.interq.or.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ProgressBarSample < SampleDialog def initialize super("Gtk::ProgressBar") set_border_width(10) vbox1 = Gtk::VBox.new(false, 5) vbox1.border_width = 10 vbox.add(vbox1) frame = Gtk::Frame.new("Progress") vbox1.add(frame) vbox2 = Gtk::VBox.new(false, 5) frame.add(vbox2) align = Gtk::Alignment.new(0.5, 0.5, 0, 0) vbox2.pack_start(align, FALSE, FALSE, 5) @pbar = Gtk::ProgressBar.new align.add(@pbar) @timer = Gtk.timeout_add(100){progress_timeout} align = Gtk::Alignment.new(0.5, 0.5, 0, 0) vbox2.pack_start(align, false, false, 5); hbox = Gtk::HBox.new(false, 5) align.add(hbox) label = Gtk::Label.new("Label updated by user :") hbox.add(label) @label = Gtk::Label.new("") hbox.add(@label) frame = Gtk::Frame.new("Options") vbox1.add(frame) vbox2 = Gtk::VBox.new(false, 5) frame.add(vbox2) tab = Gtk::Table.new(3, 2, false) vbox2.add(tab) label = Gtk::Label.new("Orientation :"); tab.attach(label, 0, 1, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 5, 5) label.set_alignment(0, 0.5) @omenu1 = build_option_menu( [ OptionMenuItem.new("Left-Right", proc { |w| toggle_orientation(w) }), OptionMenuItem.new("Right-Left", proc { |w| toggle_orientation(w) }), OptionMenuItem.new("Bottom-Top", proc { |w| toggle_orientation(w) }), OptionMenuItem.new("Top-Bottom", proc { |w| toggle_orientation(w) }) ], 0) hbox = Gtk::HBox.new(false, 0) tab.attach(hbox, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 5, 5); hbox.add(@omenu1) check = Gtk::CheckButton.new("Show text") check.signal_connect("clicked") do |w| toggle_show_text(w) end tab.attach(check, 0, 1, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 5, 5) hbox = Gtk::HBox.new(false, 0) tab.attach(hbox, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 5, 5) label = Gtk::Label.new("Text align :") tab.attach(label, 0, 1, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 5, 5) label.set_alignment(0, 0.5) hbox = Gtk::HBox.new(false, 0) tab.attach(hbox, 1, 2, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 5, 5) label = Gtk::Label.new("x :") hbox.pack_start(label, false, true, 5) adj = Gtk::Adjustment.new(0.5, 0, 1, 0.1, 0.1, 0) @x_align_spin = Gtk::SpinButton.new(adj, 0, 1) adj.signal_connect("value_changed"){adjust_align} hbox.pack_start(@x_align_spin, false, true, 0) @x_align_spin.sensitive = false label = Gtk::Label.new("y :") hbox.pack_start(label, false, true, 5) adj = Gtk::Adjustment.new(0.5, 0, 1, 0.1, 0.1, 0) @y_align_spin = Gtk::SpinButton.new(adj, 0, 1) adj.signal_connect("value_changed"){adjust_align} hbox.pack_start(@y_align_spin, false, true, 0) @y_align_spin.sensitive = false button = Gtk::Button.new("close") button.signal_connect("clicked"){ Gtk::timeout_remove(@timer) destroy } button.can_default = true self.action_area.add(button) button.grab_default end private def toggle_orientation(rmitem) return unless rmitem.mapped? i = 3 group = rmitem.group group.each do |g| break if g.active? i -= 1 end @pbar.orientation = i end private def progress_timeout new_val = @pbar.fraction + 0.05 new_val = 0.0 if new_val > 1.0 @pbar.fraction = new_val @label.text = "#{(new_val * 100).to_i}" true end private def toggle_show_text(cbutton) @pbar.show_text = cbutton.active? @x_align_spin.sensitive = cbutton.active? @y_align_spin.sensitive = cbutton.active? end private def adjust_align @pbar.text_xalign = @x_align_spin.value @pbar.text_yalign = @y_align_spin.value end end ������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/labels.rb�������������������������������������������������0000644�0001750�0001750�00000005046�11701304107�020207� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- =begin header labels.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002,2003 Ruby-GNOME2 Project Team $Id: labels.rb,v 1.7 2005/07/17 16:55:27 mutoh Exp $ =end require 'sample' class LabelSample < SampleWindow def initialize super("Gtk::Label") set_border_width(5) vbox = Gtk::VBox::new(false, 5) hbox = Gtk::HBox::new(false, 5) hbox.pack_start(vbox, false, false, 0) create_frame("Normal Label", "This is a Normal label", vbox) create_frame("Multi-line Label", "This is a Multi-line label.\nSecond line\nThird line", vbox) create_frame("Left Justified Label", "This is a Left-Justified\nMulti-line label.\nThird line", vbox) do |label| label.justify = Gtk::JUSTIFY_LEFT end create_frame("Right Justified Label", "This is a Right-Justified\nMulti-line label.\nFourth line, (j/k)", vbox) do |label| label.justify = Gtk::JUSTIFY_RIGHT end vbox = Gtk::VBox::new(false, 5) hbox.pack_start(vbox, false, false, 0) create_frame("Line wrapped label", "This is an example of a line-wrapped label. It should not be taking up the entire width allocated to it, but automatically wraps the words to fit. The time has come, for all good men, to come to the aid of their party. The sixth sheik's six sheep's sick.\n It supports multiple paragraphs correctly, and correctly adds many extra spaces. ", vbox) do |label| label.wrap = true end create_frame("Filled, wrapped label", "This is an example of a line-wrapped, filled label. It should be taking up the entire width allocated to it. Here is a seneance to prove my point. Here is another sentence. Here comes the sun, do de do de do.\n This is a new paragraph.\n This is another newer, longer, better paragraph. It is coming to an end, unfortunately.", vbox) do |label| label.justify = Gtk::JUSTIFY_FILL label.wrap = true end create_frame("Underlined label", "This label is underlined!\nThis one is underlined in 日本語ã®å…¥ç”¨quite a funky fashion", vbox) do |label| label.justify = Gtk::JUSTIFY_LEFT label.pattern = "_________________________ _ _________ _ _____ _ __ __ ___ ____ _____" end add(hbox) end def create_frame(title, label_str, vbox) frame = Gtk::Frame::new(title) frame.show label = Gtk::Label::new(label_str) yield(label) if iterator? frame.add(label) vbox.pack_start(frame, false, false, 0) end private :create_frame end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/fontselection.rb������������������������������������������0000644�0001750�0001750�00000003005�11701304107�021612� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header fontselection.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: fontselection.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ Rewritten by Neil Conway <neilconway@rogers.com> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class FontSelectionSample < Gtk::FontSelectionDialog include Sample extend SampleClass def initialize super('Font Selection Dialog') set_window_position(Gtk::Window::POS_MOUSE) signal_connect('destroy') { destroy } ok_button.signal_connect('clicked') { puts font_name destroy } cancel_button.signal_connect('clicked') { destroy } end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/wmhints.rb������������������������������������������������0000644�0001750�0001750�00000001774�11701304107�020442� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header wmhints.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: wmhints.rb,v 1.8 2005/07/21 17:47:19 mutoh Exp $ =end require 'sample' class WMHintsSample < SampleWindow def initialize super("WM Hints") realize circles = Gdk::Pixmap.create_from_xbm(window, "circles.xbm") window.set_icon(nil, circles, circles) window.icon_name = "WMHints Test Icon" window.decorations = Gdk::Window::DECOR_ALL | Gdk::Window::DECOR_MENU window.functions = Gdk::Window::FUNC_ALL | Gdk::Window::FUNC_RESIZE vbox = Gtk::VBox.new(false, 10) add(vbox) label = Gtk::Label.new("Try iconizing me!") label.set_size_request(150, 50) vbox.pack_start(label, true, true, 0) vbox.pack_start(Gtk::HSeparator.new, false, true, 0) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, true, true, 0) button.can_default = true button.grab_default end end ����ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/circles.xbm�����������������������������������������������0000644�0001750�0001750�00000006335�11701304107�020556� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#define circles_width 64 #define circles_height 64 static unsigned char circles_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xff, 0x01, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0xc0, 0xff, 0x01, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0xf8, 0x1f, 0x00, 0x20, 0x00, 0x00, 0xff, 0x03, 0xf8, 0x0f, 0x00, 0xff, 0x07, 0x00, 0xfe, 0x03, 0xfc, 0x07, 0xc0, 0xff, 0x1f, 0x00, 0xfc, 0x07, 0xfc, 0x07, 0xf0, 0xff, 0x7f, 0x00, 0xfc, 0x07, 0xfc, 0x03, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0x07, 0xfe, 0x03, 0xfc, 0xff, 0xff, 0x01, 0xf8, 0x0f, 0xfe, 0x01, 0xfe, 0x8f, 0xff, 0x03, 0xf0, 0x0f, 0xfe, 0x01, 0xfe, 0x01, 0xfc, 0x03, 0xf0, 0x0f, 0xff, 0x01, 0xff, 0x00, 0xf8, 0x07, 0xf0, 0x1f, 0xff, 0x00, 0x7f, 0x00, 0xf0, 0x07, 0xe0, 0x1f, 0xff, 0x80, 0x3f, 0x00, 0xe0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0xe0, 0x1f, 0xff, 0xc0, 0x0f, 0x00, 0x80, 0x1f, 0xe0, 0x1f, 0xff, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x81, 0x3f, 0x00, 0xe0, 0x0f, 0xf0, 0x1f, 0xfe, 0x01, 0x7f, 0x00, 0xf0, 0x07, 0xf0, 0x0f, 0xfe, 0x01, 0xff, 0x00, 0xf8, 0x07, 0xf0, 0x0f, 0xfe, 0x03, 0xfe, 0x01, 0xfc, 0x03, 0xf8, 0x0f, 0xfc, 0x03, 0xfe, 0x8f, 0xff, 0x03, 0xf8, 0x07, 0xfc, 0x07, 0xfc, 0xff, 0xff, 0x01, 0xfc, 0x07, 0xfc, 0x07, 0xf8, 0xff, 0xff, 0x00, 0xfc, 0x07, 0xf8, 0x0f, 0xf0, 0xff, 0x7f, 0x00, 0xfe, 0x03, 0xf8, 0x1f, 0xc0, 0xff, 0x1f, 0x00, 0xff, 0x03, 0xf0, 0x1f, 0x00, 0xff, 0x07, 0x00, 0xff, 0x01, 0xf0, 0x3f, 0x00, 0x20, 0x00, 0x80, 0xff, 0x01, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0xc0, 0xff, 0x01, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0xfe, 0xff, 0x01, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/test.xpm��������������������������������������������������0000644�0001750�0001750�00000003767�11701304107�020135� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char *openfile[] = { /* width height num_colors chars_per_pixel */ " 20 19 66 2", /* colors */ ".. c None", ".# c #000000", ".a c #dfdfdf", ".b c #7f7f7f", ".c c #006f6f", ".d c #00efef", ".e c #009f9f", ".f c #004040", ".g c #00bfbf", ".h c #ff0000", ".i c #ffffff", ".j c #7f0000", ".k c #007070", ".l c #00ffff", ".m c #00a0a0", ".n c #004f4f", ".o c #00cfcf", ".p c #8f8f8f", ".q c #6f6f6f", ".r c #a0a0a0", ".s c #7f7f00", ".t c #007f7f", ".u c #5f5f5f", ".v c #707070", ".w c #00f0f0", ".x c #009090", ".y c #ffff00", ".z c #0000ff", ".A c #00afaf", ".B c #00d0d0", ".C c #00dfdf", ".D c #005f5f", ".E c #00b0b0", ".F c #001010", ".G c #00c0c0", ".H c #000f0f", ".I c #00007f", ".J c #005050", ".K c #002f2f", ".L c #dfcfcf", ".M c #dfd0d0", ".N c #006060", ".O c #00e0e0", ".P c #00ff00", ".Q c #002020", ".R c #dfc0c0", ".S c #008080", ".T c #001f1f", ".U c #003f3f", ".V c #007f00", ".W c #00000f", ".X c #000010", ".Y c #00001f", ".Z c #000020", ".0 c #00002f", ".1 c #000030", ".2 c #00003f", ".3 c #000040", ".4 c #00004f", ".5 c #000050", ".6 c #00005f", ".7 c #000060", ".8 c #00006f", ".9 c #000070", "#. c #7f7f80", "## c #9f9f9f", /* pixels */ "........................................", "........................................", "........................................", ".......................#.#.#............", ".....................#.......#...#......", "...............................#.#......", ".......#.#.#.................#.#.#......", ".....#.y.i.y.#.#.#.#.#.#.#..............", ".....#.i.y.i.y.i.y.i.y.i.#..............", ".....#.y.i.y.i.y.i.y.i.y.#..............", ".....#.i.y.i.y.#.#.#.#.#.#.#.#.#.#.#....", ".....#.y.i.y.#.s.s.s.s.s.s.s.s.s.#......", ".....#.i.y.#.s.s.s.s.s.s.s.s.s.#........", ".....#.y.#.s.s.s.s.s.s.s.s.s.#..........", ".....#.#.s.s.s.s.s.s.s.s.s.#............", ".....#.#.#.#.#.#.#.#.#.#.#..............", "........................................", "........................................", "........................................" }; ���������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/dialog.rb�������������������������������������������������0000644�0001750�0001750�00000001601�11701304107�020175� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin dialog.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: dialog.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ =end require 'sample' class DialogSample < SampleDialog def initialize super("Gtk::Dialog") set_default_size(200, 100) button = Gtk::Button.new("OK") button.can_default = true action_area.pack_start(button) button.grab_default button = Gtk::Button.new("Toggle") button.signal_connect("clicked"){label_toggle} button.can_default = true action_area.pack_start(button) @label = nil end private def label_toggle if @label == nil then @label = Gtk::Label.new("Dialog Test") @label.signal_connect("destroy"){@label = nil} @label.set_padding(10, 10) vbox.pack_start(@label) @label.show else @label.destroy end end end �������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/checkbutton.rb��������������������������������������������0000644�0001750�0001750�00000003521�11701304107�021252� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header checkbutton.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: checkbutton.rb,v 1.6 2005/07/17 16:55:26 mutoh Exp $ Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/17 16:55:26 $ $Id: checkbutton.rb,v 1.6 2005/07/17 16:55:26 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class CheckButtonSample < SampleWindow def initialize super("check buttons") box1 = Gtk::VBox.new add(box1) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.add(box2) button = Gtk::CheckButton.new("button1") box2.add(button) button = Gtk::CheckButton.new("button2") box2.add(button) button = Gtk::CheckButton.new("button3") box2.add(button) box1.pack_start(Gtk::HSeparator.new) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.add(box2) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} box2.add(button) end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/range.rb��������������������������������������������������0000644�0001750�0001750�00000003515�11701304107�020040� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header range.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: range.rb,v 1.6 2005/07/18 17:13:32 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class RangeSample < SampleWindow def initialize super("range controls") vbox = Gtk::VBox.new(false, 10) add(vbox) adjustment = Gtk::Adjustment.new(0.0, 0.0, 101.0, 0.1, 1.0, 1.0) scale = Gtk::HScale.new(adjustment) scale.set_size_request(150, 50) scale.update_policy = Gtk::UPDATE_DELAYED scale.digits = 1 scale.draw_value = true vbox.add(scale) scrollbar = Gtk::HScrollbar.new(adjustment) scrollbar.update_policy = Gtk::UPDATE_CONTINUOUS vbox.add(scrollbar) vbox.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, true, true, 0) button.can_default = true button.grab_default end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/togglebutton.rb�������������������������������������������0000644�0001750�0001750�00000003057�11701304107�021462� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header togglebutton.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/21 17:47:19 $ $Id: togglebutton.rb,v 1.6 2005/07/21 17:47:19 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ToggleButtonSample < SampleWindow def initialize super("toggle buttons") set_border_width(5) vbox = Gtk::VBox.new(false, 5) add(vbox) (1..3).each do |i| vbox.add(Gtk::ToggleButton.new("button#{i}")) end vbox.pack_start(Gtk::HSeparator.new, false, true, 0) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.add(button) end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/marble.xpm������������������������������������������������0000644�0001750�0001750�00001115707�11701304107�020417� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char *granite07[] = { /* width height num_colors chars_per_pixel */ " 384 384 16 1", /* colors */ ". c #000000", "# c #111111", "a c #222222", "b c #333333", "c c #444444", "d c #555555", "e c #666666", "f c #777777", "g c #888888", "h c #999999", "i c #aaaaaa", "j c #bbbbbb", "k c #cccccc", "l c #dddddd", "m c #eeeeee", "n c #ffffff", /* pixels */ "aacfedbbcbbaaaaaaaaabaabaaaaabcbcbbbabbchfdcccbbabbbaaabaabcbaa#aa#######a#aaaabcddeefhec##dgbabbaaadabbcfbaa##########aaabbaaa#a#####a#aa###a#aaabbbbcbbbccdedaaaaa#aaaaa#a#abaaabbabbbeddbbaaaaaca##a#aaaba########aaaadcababbabdehd.##.a######.cgdcb###b##.##.##aaaaa####abcba######a##aac#a##a####aa#aa##babbbcfccbbbcdccccecbbbcbbbcdccddcbcdfeecbhhjihhgffc.aaa####.#######aaaaaaaabbaaaaa", "aaacedccbbcbaaaaaa#bbaabbbaaaabcaabbbbbbafhfccbbbbbbabacbacbaaaaa##########a###abbcdeghhhcagb#ababaaccbacdfca#a####aa###aaaaabaaa#####aca#aabaababbcccccccbcdfdaaaa###aaaaaaaaaaabbbbbbccccccbbcbcaaa##aaaaabaaaa###abdaccceebaaaabehja####a######..#aeec#bb##########aa#####abba#########aaca########aa#aa###aaaabddbbbbbbbbbbccbbabbbbabbabbabcbcbcefhfeddccefhhijheecb#...a####aaaaaaaabaaaaa", "aaabccccccdbabcbaaa#aaaaaaaaaaabbabbbbbccabefdccabcbbabacccbaaabaa######a######aaabceiiiihije#bbabbaaeaabcedcaabaa########aaaabaa##a###ab#aabcababbccccccdeeeecc#a##a##aaaaaaaaaabbbbbbbcccbbbdcbbcdaa#a#aabbaaaaa###acbaa#bccaa#abcfig.#######.#######acddgefdda#######a########a#######aaaaaa#a######aaaa#####aaacdcbabbaaabbbcaaaaaaaaabbbaaabbaabbbcbcbabbabcdeefghjkjgc#..####aaaaaaaaaaaa#", "#aaaaaacbccbcabbbaaaaaabcaaaaabbbbbbabbbcbaabffccbccbccbbcbaaaabaaaa#aa#aa##a#aaaaabbikkjhijicabbbcc#faaacdebcbda#########aaaaaaaaa####aa##cacccabcccdccccdddfdcbaa##a##abbbabccbbcbbbccccaaa#abbaaba#a##abbbbbaaaaaaaaaaccaaca##aabcfic.###aa#######a####bddeeddb####.##.###aaa#########aaaa###aa####aaaa#######aabdbbbbcabbbaaaa#aaaaaaaaabaaabbbaabbbbdbbaaabccccccdcefhhkhda##aaaa#a#aaaaa##", "#aaabaabcecbaa##bcaaaaaaaababbabaaabbabbaabb#chhfdccccbcbecaaabaaaaaaaaaa####aaaaaaabdgjkkijijdabbdcabfaabcecbbec###########a#aaaabaa#######abbaaaadddedddeeefeccaa###a#aabcccdcbcbbbbccbbbbaaaaa#aabbaaaabbbbbbaaaaaaabbbbbaaa####acegha##a#aabbb####a##adccdedbcc#######.###a###a#######aaa#a#aa##..#aa#########abdbaabbabbbaa###aaaaaaaaaaaaacbaaababbdbabbabcbbcbcbccbbdegjkgb#aa#aa#aaaaaaa", "##aa#aabccccaaaaaaaa#aaaaaabbaabbbaaaaabbbcbbcfhhgfcccbbbbccbaabbaaaaaaabaa#aaaabaaaabbcehkljjdabacccbgbaaccdb#adea#########aa#abaaaaa#####ac#ba##accdedddefffeaba##a#aaaaacccccccbbbcccaabaaaaaaaaa#aaaaabcbbaaa#bbbbaaefccdbaaa#aaacdei##aa##aabbbaaa#a#cdcccccbcea.#########bbaaa######a###a#aaaa.#aaba####.###abcbaaabaabbbaa###aaaaaaaaaaaabbaaaaaaaaaaababcbbcbbaabbbdddeghheba##ab#abaa##", "#####bbaaaaabaaaaa##aa#adccaabaaabbbbabbabbbabccbccfdbccbbbbbcaabcaabaaabbaaaaaaaaaaaabbbcglli#accbbbddgabcddbbaacea#a##########aaa#aaa##aaaa####aabcddeeefffgdbbaaaa###baabbbbbbcdabdcbcaaabaaaaaaa#aaaaaabcbbbbadfbbbaejhhebbccaaaaaccfi.aba##abaaaba####ecbbccba#fc.####.##.bba#a#######aaaaaaaaaaa##aaaa######abcdaa#aaaabaaa###aaaaabaaabbbaaba##aaababcbbcbbbbbcbaaabbccccddgggeb#aadca###", "#####bcaaaaaabcbaaa#aaaabcccaaaaaaabaaabbbbbbbaacbabeeddddccbcbbcccbabaaaabaabaaaaaaaaabbbbglmdbcbaabebdgdbcecbbaabdbaa#########aabbaaaa#aa#a##a#aabbdceeedccdcbbaaaaa##aaabbcbbbabaaabbababbaaaa#aaaaaaaabcdccbbbabcbbbcfijfbcdcabb#abcbif#abb##aaabaaaa##fcccbbcaa#db#..##.##.aaa#########ab#aaaaaa#aabaaaaa#####abdbbaaaabbaaaa###b#a#aaaabaaaaaaaaaaaaaabbabbbbaabbbaaaabbbbbbbceffecccbaa##", "#####abaaaaa#accbbbbaaabaaaaaaaaaaadcbaabbabbbabbdcaacgfddddcdddcadfcaaaabcbbabaaaaaabcabbbdjliacbababcbdfcdeeaaaaaabba########a##aa#aabaa##a######abddeggca#bcbaaaaaa####aaaaaabbbbbcbbbbbaaa##a#aaaaaaaabcbccbbaaaabaabfgfiecccccbbaaaccicbbbcbaaabaaabb#ceccccdca##aacdb######aaa###a###aabaaaaaa#aabca#abba#####abca##aaaaaaaaa##a##aaaaaaabaaaaaaabaaaacbcbacdbaaabaaaaaabaaaaabbcddccbaa##", "####aa#aaaaaaabccbabbaaaaaaaaaaaaabfaaabbcbbbbbabdebaabdffddedefedccecccdcbbbbbccbccbbbbbbccekldaabaaabccbfaaaaaaaaaaaba########aaaaaaaaba##aaa###aabbccfgfaababbbaaaaa#aabbaabaaccaabcccbcbaa##aaaaaabaabbbccbbbaabbbbbbdddghdbbbcccb#abcdebcccbaabbbabbcbaecddddbaa##.#acdeca#######a#aaaaaaaaaaaaaaabba##abba####aacba##aaaaaaaaaaaaa##aba#abaaaaaaabaaaabbbbbbcbabbaabbaaaaabaaaaaaaaccbaa##", ".####aa#aabaa##bccbaabbbba#aaaaabbaefdaabbbbccbbbaddaaabadeeffhhhffdedddeecbbbbcccbbabcbabbcfjjlkeaaaaacdadcaa#aaaaaaa#ab######ba#aaabbabcaa#aa###babcddcedba##acbaaaaaa#ababbbacbbbcccdfffbaa#aaaacbaabcbabccbbcbbbbbbcbbccedbbbccdccbaabcgb#bccbbbababbbcccdededcb#a####...addcba##aabbbbbbbbaaaaabba#aaa##abba####abbaa###a#aa#aa##aaa#a##abaaaaaaaaabababbcdbcb#baaaaaaaaaaaaaaaaaa#aaaaa###", "######a##aaaaaa#accbaaabbbaaa#aaababdcaaabbbbcccbbbdbabbbacdccgecadbbbcdccddeddcccccbaabcbbcgjhhjgeb#aacdcccaa#aa#aaa#a#aaa##aaaaa#aaabbaabb#aa###aabccddeccbbbaabcbbbcbbb#aacbbadbabcccddbaaa#aaaaabbbbabbbbcdbbbabbcddcbbbccaabbbccbbaaaadi##abbbbbbbaabbbacdeedbd######aa####bceda#aabbabaaaaaaaaba#aaaaa#aabaaa###acaaaa####aa##aaaaaaaa#aaaaaaaaaaababaaaaabcaaaaaaabbcbaaaaaaaaa###aaaa###", "##########aabaa#accbbabbbbbba##aaaabbcbbbbbbbbcbaaabdbbbbbbddccbbbbaaaabbabbbbcefefdcbaadbcddje#debgfbabecdc####aa##a###a#aa#aa##a##aaabbcabbaa###aabbcceedbcbaaaabdcccbabaaabbbbabbccbbaaaaaa#aaaaaaaabbbbbcbccabcccccdcccbbbbabbababbba#abfe#aaaaaaaabccbbaaaedddc######adcaaaa##dfcaaaaaaaaaa#aaaaa##aabcaaabbaa#aaab###aa###aaaaaaaaaaaa##aaaaaaaaaabaaabaaabcabaaaaaaabcbaabaaa##a###aa####", "#########aaaaaaabbcbbbbabcbaacbaa##aaabaaabccccccbaabecabbbcddbacdeba#aaaaabaaabbdfgedcbaccdcgica#aadghdbddd#aa#aaa#a###aaaabaa#####aaaaabbbbbba#aaabccceecbddbaa#bbccabcbbbbbacccdbbdabbaaaaaaa#aaaa#aabbbbcccdcbcbbccccccbcaababbdbabbba#bbgaabaaa#aaacccdcddbeedba#a##a#aba#aaaa##decbaaba#aaa###a#a###abba#bba###aaba####a####aaaaaaaaaaaa#aaabbbaaabbaabbaabbaaa#aa#a#abbaabbbaaa#aaaa#####", "############aaaaaaacbbbbbbbaa#aaa#a##aaaaaaaacbbbbbbabdcabbbcdbaccdba#aaaaaababbcbbdddedccddefihaa#aaahiiiffd#aaaa#abaa##aaaaacaa##a#bcaaaabbbcaaaabccdddecabaaaaacbbbabbccccccbbdbdfdaabbaaa###a#aaaaaaaabbbbbbbaaabdcddccbbbbabbbccaabbbaabfdaaabaa#aa##aabbbbbddba##aa#a#aa##aaaaaabcdbbaaa##aa#####a#aaabbaaaaa##abb######aa###aaaaaaaaaaaaaaaaabaaaaaaaabbbbaaabaaa#aaaaaaabbbaaaaaaaaa####", "###########aa#aa#aaaccabbaaaaaaabb#######a#aaabcbbbabbaeebbccbcbacdaaa##a#aabbbbccbbcbcdegifdfgifba##aaaagigha#aaaaabbaaaaaaaaabaaa##acaaaaabbbbbbabcdddefeba####abbaabccccbbbcbadcbcbaabba#aaaa#aaaaaababacccbaadbabbccedcccbbccbbabaaaaa##ade###abba#aa##abbba#cebb.#a####.#a#aaaaaaaaacfca#aaa###aa###abaabaaaaaaaabbaa#######aaaaa#aa#aaaaaaaaaaababdaaabbbbbababaaaaaa#aaaaaabbaaabaaaaa###", "##########a#aaabaaaaccaaaaaaabaaaaaaba###a##abaaabbababaccbcbbcccaaba#a###aaabbccdccccccdeegggfigaabb#aaa#fffcba#abbaaaaaaaaaaa#abba##aaa##aabbbcbbbbcdeegfeb####aabaabacbbbcbccaabbabaaaaaaa##aa#aaaaababbabbcbcdbbcccbddcdcccabcbbababba###afba#aabba#acaaabbbbaddb##aa####.####aabbaaaabffcaaaaaa##a##bcabbaaaaaaabbbc#a#a#######aaaaa#####a##ababbbbbaaaabbcbaaaaaaaaaaa#aaaaaabaaababaaaaa#", "#######a#####a#aaaaabcbaaaaaa#aabaaaaaa###abbabaaaaaccaaabdbccbccbaaca#####accddcccccccddeeefikjeabcca#a#abfifbaa#abbbbbaaaaaaaaa#bbba#bcaaaaaaaccbcccceffeccaa##aaabbbcabbacbddbbaabdbaaaaaaaaaaaaaaabbbaabbbbbbbbbcbbccccdcdcccabbbbbaaba###dcaaaabbaaabaabcbccaadba#aaa########aaaa##aaaacgdbaaaa####cfffda#a#aaaabbdbaa#aaa########aaaa#aa##aaabbabbbaaabbbaaaaaabaaaaaaaa#aaaaabaaaaaaaaa#a", "a###########aaaaaaaabbaabaaa###abaaa#a##a###a#aaaaabacaaabccbbbcbbbcbb####a#bdfbbccccccdefecdgiiddaabbaaaabacfeaaaaaabcccbaaaaaaabaaacaa##aaaaaaabccddcfgfgbabaaa#aaabbcccbccbcddbbacabbbbbbbbaaacbaaaabcbabbbbbcbbcbccbccdccdccdcbaabbbaabaaade#aa#baaabaa##abbcbacdb#.#abbccc#.##aaa####aa#aeeaaaaaaabbabddfgfba#aabcd#aaaa########aa##a##aaaaaababbaabbbbbabccbababaaaaaaa##a#aaaabbaaaaaaaa#", "#a###a######aaaaaaaacdaaaaaaaa#aaaaaaaaaa#####a###abbbbaaaaccbbbcbbbbaa#aaaaaeecabcccbccdedcdfgigeaaaacbaaabaacbaaaaaaabcbbbaaaaaaaaabccaaaaaaaaaacccceffffbabb#a####aaaabcccccddcdedbbbbaabcabbbccbccbcbcbbbbbbbbbcecbccccceccccdccbbaaaaaaabce#bbaaa###aaa##ababcacda#abb##a#######a#########bfdca#abcbaabaabcffddbabdc#aaaaa##########aa####aaaaaaabbabbbbbbbcbbbcbaaaaaaaa#aa#aaaaaabaa##b##", "##a#########aabaaaabcdbabaaaaa##aaaaabaaba######a##ababbbbbabbbbcbcdddbbaa#abceecabccccccdddfedgjgdbaaabaaabbbaaba#aabaabaccaaaaaaaabbccbbbaaabaaabcddefgfebbbb#aa####aaaabbcccccbbfeccbbbaaababbbbbbbccba#abbbabbcdccdcbddcddcccdcddcbaaaaaabcfbadaa#######a#abbacbbcc###a#a########a######a##aabdcabccbbababaaaacdfededbbaa#aa##aa######ba#aa#aaabbabaababcbbcbcbbbabbaaaaaaaa##aaabaaacba#a##", "##########a#abaaaaabbbcbbbcaa###a#aaaaa##aba#######aaaaaabbdccbaabccdddecaaaabccdbbacccddcdefdfgiifcba#bbaaabbaaaababbbbbbbabbaabaaaacbbbcbbaaaaaaaceeeefffbaaaa###a##aaaabbcbbbddcddddcbcbbaaabbbbababbabaaabababbbbcccdccddcddccccdecaaaa#abccfbbaaa#######aabbaacabe###a#aa#a#a##.aa#######a#aa#cfeecdcccccabbbabacggcabbaaabbaaaa####aabb#aaaabbababbbbbbcccbbbbbcccbbbaaaa#aaaaaababbaaaa##", "######a####abcbaaaaabbccbcbaa###a##aaa##a###aa######aaaaaabdgebaaabbbccacbaaaaabbbaaabccddcdeeffgigbaaaaaabaabcaaababbbbaabbacbaaabbaaaababccbabbabbdffefhdcaaa###aaabba#aababcbdeeccceccccbababbbbabbabbaaaaaabbaabbcbcccccdcddddccccdcaaaababcdeaba#####.###aaabaab#b####a####a##aa#b########aaaaabedddcccccaaaabbcabeaaaabbccbaaa#abbaaabbbaaaabbbaaacbcbcbbdccbaabbacbbbbbaaaaaaaaabbaa#####", "######aaa#abbcbaaaaabdccbbaaa#######aaa#####aaa##a#a##aaaababcbbaaaaabdebbbaaa##aaaaaaaabccddeefggieaaaaaaaacabaabbbabbbbaaaabbaaaaaaabbbabbccbaabbbdfgghebbbaa#####abba#aabbbcbccdcbbbcddcccbbbabbabbbabbabaaaaaaacbbabcbbccccddddccbcccaaaaaabbdcbc##########aaacbbaa####a####aa###a#aa###aaa###abbceddedcccbaaaacccdca##a#abbbabaaaabaaabbba#aabbbbbbccbbbbaaacccbbcbbaaabbbbbbabaaabaaaa####", "#######aa#aaccabbabaabdecbb#a########aaaa####aaa#aba##a#aaaaaaabbdcaabdcbcaacb####abb#abaabccdeffghfdabaaaa#acbbbbcbabcabcbaaaabbbabaaaabbbbbcccbbbccdfedccbbb#########aaaababbacccbcbbbddbdcccccbbbbaaaabbaabbaaaaabaabbbbccdcceedccccacbaaaabbbbddb####aa######aabbaa####a####aa#aa###a#####aa#aabbddeccddccbbbabbbbceb###aa#aaaaaa##aa####aaaa#abbbbbccacccbaa#accbbbbbaaababbabaaaaaaaaa####", "##a#####aaaaaabbbbabacdddccaa########aa#a#####aaa#aa#aaaaaaaaaaaabcabbcbbbbababa###baaaaaaabccdeeehifbabaaa###abbcbbcaccbcbbbaabbbbabaaabbbbbbbbcccccddbccbbbbba#######aaabbbaabbcccbdcbbdbbddcdcccbabaabaaaaaaaaaaaaaaaabbcccddecccbbacccbbbaabbbceca############aaaaa#############a#############aaaaabccddcbbbabbbbbbba#####a##a####aaa#######aaa#babaabbcbaaa##abbbaabbcbbbbaaaaaaaabbaaa####", "#########abaaabbabbbbbddeccca##aa######a#aa####bbaaaaaaaaaaaaaaaaaabccbcccebacfdb#####aaaaaaabcdddcfgfccbaa##a##abcbbcbbdcccccabbabaababbbbbbbbbbcdccddbabbbbbba########aaababbbacdccccaabcbbcabddddbbaaabbabbbaaaaaaaaabbbddcddecbccbbbdcbabbbaabbcda#############abaaaa############a####bb##a####aaaaabcffdcccbbbbbbbb#######aaa###aaaa#######aabaaaabbcbaaaaaaaa#aaaaaabbccbbaaaaaabbbaaa####", "#########aaabbabcbbbbbdddcbaaaaa###############aabaaaa#aaaaaaaaaaabbabbdefffccbba###aa##aaaaaabcdceecggdcbbaa##aa#aacbb#bcdddddabbbbbabbbabbbbbbbccfeedbbbbbbcbba#a#####a#acababbbdcbcbabbabaabaabeedcaaaaaaaabcbbaaaaaaabbcdfdddccbbbbcbccbabbbaaabcda########a#aaaaaaa#aa#####aaabaaaaaaacb##aaa#aaababbcdefddbbcbccbaa#####aaaaaaaab##a########aa#abbcccbaaaaaa###aaaaabaabccbbbaaaaaaaaa####", "########aaaaaaabbbbbbcdedbbbbabaa##########aa###bbb###a##aaaaaaabbaabbbdfeedb##a#a##aa###aaabbbbccdefbfecbbbaaa####a#adb#acdecdfcbaabcbbbbcbbbbbbcdeffbcccabbcdbbba#a###a#aabaaaaaccccbaaaaabbbbaabdfedaaaababbbbbaaaaaaababbcedcccbbbbaccccbaaaccbbabeb######aaaaa#aaa###a######aaaaaaabacbca#aaaaaabbbbccdegfeccccccbcbaaa#####aaaa#aaaaa###a###aaaabbbcccb##a#aaa#aaaaaaaabbdeddcbabaaaaa####", "#########a#aabbbbbbbbdddccbbba#aaaa##aa##a####a#bba#a#a#aaaabaabbbabbeedeeefdaaaa#####bb##aaabbabcddehgifffdcbaaaa#aa#aaaaaccdeddcabbbcbbbccbabbccdceeecdcaaaabbcccaaaaaaaaaaaaaabacdddbaabaabbbbcccccfdbaabbaabbcaaaaaaababbcccccbbbbbbbccbcca#acbbbbbda#####aaaa####ab##a######aaaaaaabaccbaaaaabbbbbbccceffcdeedcbbbbaaaa#aaaaaaaaa#aaabaaaaaa##aaaabbbcbbcbaa#####aaaaaabbbcccddcbbaaaaa####", "##########a#aabbcbcbbcecccbbbabaaaaaa#####a#aaaabbaa##ba#acaaababbbbbbbcdcfgdbbbaa####aba##aaaabbbccdfefhfgedecaaa##abaaaaacbabebbbbbbbbcccbcbbbbddbedbddcaaaaaabdccaaba#aaaaaa#bbbbbaddccaaabcbbdcbbcbddabbbbbbbccaaaaaaaaabcddcbbbbbbbbbbbbbbaaaabbaabe#########a####bb#aa#####aa#aaaabccdbbbbabbcbbbccccdccbaaeffdbca#aaaa#aaaaaaa#aaaaabaaaa#aaaabaabbccbbcceb#bcaaaaaaaabbbbcdcbbbaaaaa####", "#######aa#aaaaabbccbbcdccddcabaaaaaaaaa###aaa#aabcaaa#bba#aabaabbbbbbabcccdfedcaa##aaa######aaaabbbbcdddghhgfedcbaaaa#aaaaabcbbbccbbbbbbbcbccdcccccbeebccbbbaaaaaccccccba#aaaaaaabaaabbbddbbbbcccbcccbaceeacbbbcbccbaaabbabbbbceccbbbbbabbbbbbbab#aabbbbcc#.######a####.bcbcba####aaaa#bedccbbbbbbbaabccddedaaaaa##beeda#aaaaaaaaaaaaaaaaaaaaabba##babbabbbbcbbbccccbbaaaaabbabaabddcbbbaaaa####", "##########aaaabbbbccccbcddddbaaaa##a#a#a###aaaa#baabbaaaaaaaabbbabcbaabccbddfebaaba#ba######aaaabbbbbcddfiiigggedbaaaaaaaaaabcbabccbbbbbbbcccddddccceecccccbbaaaabccddbbba#aaaaaaaaabcbbbcccdccbcbabcbabceecbabbbbbbaaaabaabbbcddbbbbbbbbaabbbcbbbbaaabcbdc########..####ccccba#abbaaaabddbabbbcabbbbcccceeca###aaa##aaa##a#aaaaaaaaaaaaaaaaaaaaa##aabcbbbbbbbccbbbbcddaaaaacbaaaabddbbaaaaaa###", "############aaabbabcddccdbcdcbcbbbaaaaa##a##aaaa##abaaabaaaaaaabbaacaabddabcefc#aabaaa###a####aaabbbbbbddgihhfffgeaaaaaaaaaaaaabbbcbbbbbbbbbcddeeedceccdcccccaaaaabcbddbaa#a#ab#aaacbbbbbbddebbbbccbbbabbbedbaaaaaaaaaaaabbabbccecbbbbccbbbbaabbbbcc#aaabbcc######a#####.bccabbacbababaabdcabbbabbabbbcbdecabaa##aaaa####aaaaba##aaaaabaaababa##aa#aaabbbbbbbbcbbbbacbedbaaa#bbaaaabcbbbbaaaa#aa", "#######a####aaaaabaabbcccbabbbbbbbcbaaa######a#aa######aaaa#aaa#acbbbabeeebabddbaaabaa####aa#a#aababbbbbcehhgeeffdca##aaaaaaaaaabbbbabbbbbbcdcdddfgfhcbbcbbbcbaaaaabcccdbba###baaaabcbbaabcdeecaaabbbbbbaabddecaaaaaaaabbbbbbbccfcbcbbbbbbbaaaaabbbcca#aabacc#######a####acdcbbbbbbaaaabbccaabbbbbbbabbceecabb#aa#aaaa#######aaa##aaaaaaabbaaaaaaaaaaaabbbaabccbbcbaaacgdaaaa#aababbbabbbbaaaaa#", "###a#####a#aaaaaabcbacbbddcaaabbbbbbbaaaaaa##a#####a####aaaaa#aaabdbcbbedefcaaabaaaaabaaa#a##abaaaaababbbcfgggfeefea##aaaaaaaaaaabcbbbbbbbbcdcdddefgeabbbbaabccaabaaceddeeaaa##aaaaaabbbabbcdedbabbbaaaaaaaacfecaaaaabaabbbbbbcdfdbccbbbbbaaaaaabbbcdbaa#aabdb#########a#acdcccbaaab#aabccbbbbbbabbbceedccbcbbaaaa#baa#a###a#a##aa###aaaabaaaaaaaa##aaaabbaaabcbbbbbabbdfeaaaa#ababbcbbaabaaaaaa", "#####a#####aaaaaabbbbbbbcddcbabccaaabbaaaaa#a##a##a######aaaaaabaaaaacbbbffeaaaababbabbbbbaa##bbaaaabbbbcccghghgeffbaaabbaaaaaabbabccbbbbbbcdddefggecccbabaaabbbacbabbdddecbaa####aabaababbcccdcabaa#aaa###abceedcaaaaabbbbccddefdccdccbcbbaaaaabbccdccdb#abbd###a#####a#a#cddcccaaaaaaaaabccbbbbdeefbba##aabaaa#aaaaaa#aa###aaa##a####aaaaaaaaaaaa##aaaabacbabbbbbcbbbbcfgbaaa#aa#abbab#aaaabba", "##########abaaabbbbbcbcdcccdcbbbcbbbbbba#aaaaa#a############aa#aaaaaaababbdeaaaacbbbbbddcbaaa##abaaaabbbbcccghhhedecababcbaaaaaababcbbbbbccbddceggffecccbbbaaabca#aaaadddedcb#a##aaaabbbabbbbcccdd###aaaa#aa##bcefeddcddccefdddfdcccccccccbbaaaaaabccccdddaabbda########ab##bbbddcbbaa#aaaabcbbbcdddccaaaaa#abaaaaaaaaaa#aa#aaaabaa#####aaaaaaaa#######aabaacbabbbbbbcbbbbdfbbaaaa###baabaabaaba", "###########aaaabbcbbbcccbddbcdccbbbbcabbaaaaaaaaa###a##aa###aaaabaaababbccbbdb#abccabddbbbba#aaaabdbbaabbbbcdehihbaabbbbcdcbbbbaababbedcbbaccdddeeefedabbabaaa#aaa#aa#beeeeffca###aaabbbcbbbbbbcced#a###a##aaa#abffgfedcccfhcbdebcbccdccccbbaaaaaabbcccccddbaabdcb#.#aa#aaa##abdddcbbbaaababbbbbcbdbabbbbbb##ababbbaaaaa#aa#aa##aaa######ababaaa#####a#aabcbbbabbbbbbcccbbbeabcbba###aaaaaaaaaab", "b#########aaaaababbbbabbbbdebcccccbbbabaaaaaaaaaaaa########aa#abbaaabbabbdbcbbbaaadcbcbdbabba##aa##abcb#aaabcdcfhgdabbbccdcbcbbbbbbabcgdcbdbbdedeeehfgdbbbbbaaaa#aaa#abddddgeedcaaaaaabbbdccccccbceeaa###a###aaaacfghhgedccggefbccccccccccbbbbbbaabbcccccccdaabaaccb#aaa###a##adedccbcbaaabbbbcbbcddbaaabbbbaadbbaabbaaa##abaaa#aaaaaaaa#aaabaa########abbadccaaabbbcccccbbdcbcbbba###aaaaaaaabb", "aa##########aaabbbbbbbaabbaccbceeebbaabbaabaaabbbbaaa###aaaba#aabaaaaababbccggcbaabccbbbccbca##aaaabdbbabbabbcdddghbabbccddcbbbcbbbbbccgfcbccceddddeddedddcbababaaaaaa#accdeffedbaaaaaaaacccccbbbccffb#a#####aaaaabfhgghhhhgghecbccbccccccccbbbbaaabbbbcbbbcdcbbabbcb#####abca#abccccccabbbbbbbbbdddbaaaaabab#cdba#aabaaaaaaaa#aaa#a#aa#####aaaa#######aabbbbccbbbabbdeddcbbeaabbcb###aaaaaaaaab", "baaa######a#aaabaabdbbcbabbaccccedaaaaaaaaaaaaaaadbaa#aaaa##aaaaaaaaabbbcbcccdbaaaaabdcbacbcdcaaaaaaaabaaccbbccdddhgcabcccdecbcbbcbbabadedbbcdedcddeeccdddeeedcbbcbaabbbabbcddddec#aaaaaabbcccccbccdffc##a##a#aaaaaafheffhgeccefcbbcbcccccccbbbbaaabbbbccbbddedbabbcc.##a##abc###cdcccbcbbbabbbaddccababbbaaabaddba##aaaaaa#aaa#a#aaaaa##aa##aaaa#######abbbbccbcbbbbdefeeccecaaaaa####aabaaaaaa", "bb#a########aabbbaaababcccdaacdbbaba#aaaaaa#aaa##acaa###aa#aaaaaaaaaaabcdcccaaaaaaaaadbcbbbbacc###aaaaaaaacbbccdcdfggbbbcccdecccddcbbbacdfdbcdebbbcccdcccccdcbefccbaaaaabcbbccabdfcaaaaaaabbdddccccccefe##a##aaaaaaaadfghhhdbbcccccbcbbccdccbbbcaaaabbbbdccddeeba#bbda######.acabbddccabcbbbbbbbddccaaaaaaaaaaabdca#a#aaa#aaaaa##a#aaaaa##aa##aaa#a##a##abbbbccbbdbbccefffeccd#a########abaaaaaa", "aa##########aaaaabaabbaaccdcaacbbaab####aaaa#aaaaaa#a####abaaaaaaabcaaabddcacda#aaabacbbbbddddcbaaa##aaaaa#abbdcccdegfbbcdcdefccddccccbcbbfdccecabccbcbbbcdddcbffdcccb#aacbaabcbbeecaa#aaaabcedddccccddfeb#####aaaaaabbehhfcccbcccccbbccccccbcbcbbaaabbbcdcceddcbbabba########bcbbcdcbbbbbbbbaacccccaaaaaaaaaaaabcba####aba##aaaaaa#aaaaaa##a#aaaaaaa#aaabaabbcbbbbbbbdffffeeeaa########aabcaaaa", "aba#a#aa####aaaaabbabbabbaccaaabaaaa#######a####aaaaa####aaa#bbaaaabaaacbddcbccaaaaaaaaaaacdeabcbba#a###a#aaabccccdeegfcbcdddeedcdccddccccfedddcbbccbbbbbbccddedecccdca#aaaaaaabacedcddcbabaabccccccccceccd####aaaaaabaacdghhfecccccbbccccccccbcbbbaabbbcccccddcddceaca########cdccdccbbbbbbbbbccbcdcaaaaaaaaaaaaaaba#####aaaaaaa###aaaaa##a####aaaa###aabbbbbbccbdbbbcdefffgaa#a#######aabaaaaa", "aa#####aa###aaababbccccbbbbcbaaababa#######a#aabaaaaaa####aa#abbaaaabbaabbdcbbcdbbbbaaaaaabcddbcbba#####a#aaabcdccceefhgbbdcceeeeccccccddeefeeecccacccbcbabbccdefdbcebaaaabaababbbcdcdfffdabbbbbcccccccecade#aa#aabaaaabaackijkidbbbcbccccccccbcbbbbaabbccccccccddegfdaa#######ceedcbbcaacccccbcccccbaaaaaaaaaabaaaaaaaaa####aaa.baa######aaaa####baaa#aaaabbbbbccdcbbcddedfgfb##########abbaaa#", "#a########aaaaaaccbbcdcccbbbba#aaaaaa#####aa#aaab#aaaa#.###aa#aabababcbabaccbccdedaaaa#aaaaabccacbaa#a######aacbcccdffhigeccccdeedddccbcddffdefcbabbbcdecbabbbbcddecddbbaaabbabbbcccddeeffabbabbbbcccccdecdedb#a#aaabbaaaaahifgikfcbcccccccccccbbaaabbcbbbccbbbbcccdhea#a#####aedfebccccbbcbcccccccbaaaaaabaa#aaaaaaaaaba#b###aaa#b#######a####aa##abbbabaaabbbbbcdecbbcdedefghc#########abcedcb", "a############a#abcbbbcddccbbbcaaaaaa#a####a#a###ba#aa#######aaba#bbbbbccaabcccddeebaaaa##aaaabaaabaaaa#####a#aaaabcbdeggihfccccdddffdcbcccdfcbcbbbbbbccbbbbabaabcdfebcbbca##aabbbbcdcdfffeeaabbbccbbcccdeeddeed##aaabaaaaachgcccfijebbcccccccccbbaaaaabbbaabbaabbcbbcfecaaa#aaadcddbbdcccabbcccbbbabbaaaa#aaa###aaaaaaaaaaaaa##aaaaba######a######a#abbbbbbabbcbbbddcabcddddefgfa########aacedcc", "#######aaa#####aaaccccddcdcccbbaaaaa####a####a#aaaa#aa#######abaaabbccacdaadccdddccba#aa#bbaaabaaabaaaaaa#aaaaaababbbdeffiiebcccdddeedcccdcfbcbbbbaabcbbbbbbaaaabcdeefeeddedbaaabcbdccefffffabbbbbbbbbcdcdddddefbaabbbbabaeidccddcejgbbccccccccbbbbaaabaaaaabaaabccccdffebaabbaaddcc#cdccabcccccbbbbbaaaaa#aaaa##aa#aaaaaaaaabaaaba#b##a####a#a#a##a#aabbabbaabbbbddecbbdcccddeega.##.#a##aab###", "#########a#####ababccbbbdcccccabbb##aaaaaa#aaaaa##aaaaaa#..###aaaaaaccbbdcbbccdbccdaa##a#a#aaaaaa#ba###a#a#aaaaaaabbbcdeefhgeccedbbcdedeedgebbbbbbbbcdcbbbaabaaabacccddccccbdcaabbadddeefffgfbabbbbccccccccdddbggbaabbbbabhefcccddddihdccccccccbbbababaaa###aa#aabbbcdeeffa.##abcfedabccbcccabcbbbbbbabaaaaa###aaaaaaaabaaaaaaaaaaaaba#######aaab#####aaabaaaabbbaceffecbccddccdec#####.##aa#aa#", "#aa########a####abbccbbccdcccbbbbba#a##aaaaabaa#aa####aaba#.##baaaabccdabdbabbbbbcccbaa####aaaaaaa#aaaa######aaaabbabccdfeehihfggfdbceedddeddfdccbbcbbbbbbbbbbaaabaccccbbccdddecababedefffffhgdaaabccbcccccdddbfhfbbbcbbackdeeccdddccfhgbccccbbbaabaaabba#####a#aabbbdeddeda.###aeddcbaaccccccccbbbbbabaaaaaaaaaa##aba##abbaaaaaaaaaab######aa##aa###aaabbbaaaaabbbeffffdcdcdeffda######.###aaa#", "#aaa############aabcdcbcdcfedeecbbaba##aaaaabaa###b#a##aaaa####abaaacdcaacdaacbcaaaaaaaabc##aaaabaaaaaa######aaaaabbbdddeddfhhhhhhfcccffffdbaabcbdbabbbbbbbbbbaaaaabbcccbbbbcfdedbbadeddeefdefhffecbbcbcccccceddgibbbbbbdecccbbccccddddhidccccbbaacaaabba########aabccedddeda####cdcecbccccddddcbbbbbabbaaa#a#####a#######abaaaaaaa#aaaa#a##aaaa#a####aabaaaaaaaaabccddfgfddefge################", "##aaaaa#aa######aaabdccbccdeefebbaccb###aaabcbaa########aa######aaba#bdbbbcabbbbbbaaba##aba#####ababaaa##a#a##aaaabbcddedddeeefhghfddccdhecbbbaaaababbbabbabcbaaaaaabbccbbbbbbeefdbbbddbddffdggihiebbbcbbcccccedeicbcbbcdccccccccddddddcfifccbbbbabbabbbaaa####aa#aabcedddefeb##.bdcdeccbcccdddcbabbbbaaaaaa#aa############abaa#aaaaa#aaaaaaaaaa#######aabaaaaaaaabbabbcefgecbcc############a#a#", "##aaaa####aa##a##aaabcdcbbccdcdccbcaba##aaaabbbaa#aa#a####a######aabaaabaaaaaaaabbba#aa###a##a###abbbaa#aaaa#a##aabbcededddddeghggcdfedffddcbbbaaabbbbbccabbbbbcaaaaabccbbbbbbeccefdbcdbcbcefefhgghdbbcbcccccccdcefedbadccbbcccccddddddddeggcbbbaacaabbbaaa######aaaabdcdeedefbaa#deddcdcbbcdedccbbbcbaaaaaa##################aaaaa#aa##abaaaa#aaa#aa##aaaaaaaaaabaabbacdbacbaaba###############", "##a#aaa####aa##a##aaabbbbbcdeccbbaaaaabbaaabbaabaa###aaaa#########aaab#aaaaaaaaabbaaaa#a#a#aa#a#aabaaaa###abb##aaaaabcdeeddefghhhebbbfebbdddccbbbbbaaabdcbcbcbacbaaabbabcbbcccddbbcefecdcbbbcddehgggcbbcbcccccccdddffbbdbbbbbccccddddddddddegcbbaabaaabbbaaa######aaabbbcdefdeca#ddedcdddbacadedccbbbbbabaaaa###############.####aaa##a###a##aaa#aaa#abaabaaaaaaaaaaaaabcdbaaaa#a########a##a###", "a##a#aaaa#####aaaaaaabcccbbcdebbaaba#a#bbaaabbaaaa####aaa#####aa#abaaaaaaaabaaaaaabbbaaaaaa#aaaaaababaaa####aaaaaaaabcddddefedhhgbbbbcefbcdedcedabbbababbbcbbbbbbaaabbaabbbbbcbcddbbbcdcebbbbdcabehhebbbbcccccccceddhfddbbbbbccccddddddddddcdfdaaaaaababbaaaaaaaaaaabbbbccddcdfededffddddcbcabcddccbbcbbaaaaa#####################aa##a#a#######aa###aaaaaa###aaaaaaaaaabbccaabaaaa######a######", "aaaabaa##aa####aaaaaabbccccbcccaabbba#a##aaaabbb######aaaaba##aaaaababb##aaaaaa#aabaaaa#aaa#aabaaaaaacbaa####aaaaaaabcdeddefefhheabbbbbdfgfgedcfaaabbbbbbaaaaaacabaa#baaabbabaabbdeeeccabdccbbbcaachifbbbcccccbcccddejkeabbbbccccddddddddddccceebabbaabaaaaaaa#aaaabbbcbbcccddefgedfedddcccbaabcdcccbcbcaabaaaa########.##.########aa###a########aaaaa#a###a###aaaaaaaaababccaabaa#########aa#a#", "##aaaacb########aaaaabbbbcccbdcddbbcbc#aaaca##a#aba######abca#aaaa#aa###aa###aaaaaabbaaa#a###aaaaaaa##bcbba###a#aaaabbceedddehgfdaaabaccbfhiihffcaaaaccbaaaaaaacabaaabbaabcbbbbbbbcbdeffedfdb#acaabafjgbbcbcccbccccdefiicbbbbacccddddddddccccbbcfbbbbbabaaaaaaaaaabbbcbbbbccccdegfecfdbaabdabbbbcccdcccbbbbaaaa###################a#aa##a#a##a####a#aaaaa###########aaaaaabbbbbaabaa#######aa###", "###aaacba#######abaabbdcbbcdcbbefcbabcbbaaaaa####aa#a#a#a#a##aaab###a#aa####abb#a#aacbaa####aaaaaaa#aaabdcbaaaaaaaaabaceefeeffffbaaabbabccehigfeeddefdbabaaaaabbbabaabaaaaabbbbbbabccbabdedda##aaabbachhbbcbccccbbcccdeghebbbaccddddddddddccccbacecbabaaaaaa#aaaaabbbccbbbbcccdcdgfdfebbbbbcccbcbcddccccccbbaaaaa################aabbaaaa####aa###a##aba#############aaaaabbbddbbaba##########.#", "####aaaba#######aaaaabdfdbbcccbbdebbaaaab#aaa#a###aa###aaa###aba#####aaa#####aba#aaa#baaa#####aaaaa###aabcccaabbbbbcbbbdfffgeccebaaabbbbcbbeffedccfghhebaaaaaabbaaaaaaaabaabbabbbbbacbbbbcbdda####abbabghabbbccccbbccddddghdaabcddddeedddddcccbbabdfdaaaaa##aaaaaabccccccbbccddcbefdffdcbbbcdccbbccddcccccbbbaaaa################bbccbaabaa#aaaaaa#aabba##a#########a#aaaaabbccbcabaa###########", "#####aaaba#######aaacccefcccbcdccbcbbaaaaa#abcba#########aaaaaaa######aaaa####aa##aaa#aaaaaaa##aaaaa##aaaccddcccdddddcceeffdccdccbaaaaabbbbcfggdddfffggfebaaaaaaaaaabaaabccbbbbbbbabccbbbbbcbdb###aabbbbghbacccccccccccdddfigdbcddddddeddddcccbbbabbfeabaa#####aaaabcccccbcbdddecegfffcccabbccccbbccdcccccbbbbaaaa############a#aaaababaaaaaaa#aaa##aaaa#aaa##########aaaaaabbcccbbdba#########.", "#####aaaaa######aaabddefcccbabdccccbaaaaaa###aaa######aaabaabbba#######aaaa####a###aaaaaa#a##a#aaaaaaaaaabcddddcdeeedefgfefecdaabbaaaaabbbbbadfebcfdfgffeeecaaaaaaabaaacabdbaaabbbcdcbbbbbbbbccb#a###abbaegcabccccdcccccdddcfihfdccdddddddddcccbaaaaaddbaa######aaabccccbcbccdddhfcfgecccbbbbcbccbccbccbcccbbbbaaaa#a##########aaaaaabccbcba#aa#aa#aaaaa#aaaaa###########aaaabbaddedaa##a#.#####", "####aaaaaa#######cffdabcbcdcbbadfbcbbaa###a#aaa#aaaaaaabaaaababaa#######a##a#########aaa##aa##aa#aaaaaaaaabdeddccddddddffeeeec#a#aaabbbaaabbbcggdcfeeeeegfdccbabccbbaaabbbcaaaaabbbcdbbbbccbbbdbaaa###abbccebabbccccbcccccddcdfhjhedddddddddccbbaaaaaabdda#######aaabbddccbbdddedccdgeeedccbbccdccbccbcbccccbbbaaaaa#########.##aaabbaabbbcbaaa###aaaaaaa#a#a#a########aaaaabbaccddeb###########", "########aaa######acddbabcbbcccabcddcaabbaaa##aaaaaabbbcaaaabbaaaaaba########aaa#aa###aaa###aa##abaaaaaacbbbcdffeddeccdffffeddbaaaa#abbaaaabaabegebdfeddeffeddddcdddcabbacbcbccbaabbacccbcdbbbcdb#aa##aabbbbbffbbccccbccccccdddedfkkidddddddcccbbaaaaabbabdb#a#####abcccdbccccddfcccdfgeedccbbbcbccccbbabbcccbbbbbbaaa############a#a#aaaacacbaaa####aaa#aa###a##a######aaabaabbbbbbdfa##########", "#################abbcbaacccccbccaacbcaaaaaaaaaaaaaaabccabbbbaaab##bb######a#aba##aa##aaaaa##a#a#acabbbacdcbcddffffdgeefefeddcb#a##aaaaabaaaaaaddfdcfdccccccdcbcbcccecbbabccdddddcbbbbccccccbbbceb#aa###aaaabbfgbacccbcccdcdddeedgjkihccddcccccbbaaaabaabaadca####aabbcccbcddccefdcdeeeedddcacbccccccbabaaabbbbbbbaaaa###########.#####aaaabacbba##aaaaaaa####a####a######abbabbcbcbcdb###a##.##.", "###########aa#####bdbaaaaccddbbdcba#bbaa##aa#aaaabbbbbbaaabaaaaba##aa.####aaa##a#aaaaaabbbaa#####abaabbbbbccdddeefeffddefdccaa####aaaaaaaaaabaeefdedeccbabbbdddbbccccabbbbbbbbcdcccbcccccccccbaaaa#a####aaaabacgcabbcccdddefffedgijfehdcccccccbbbaa#aaaaaaabcbaaaaaabbccdcdddefgecddeefedccbbbabccbbbbaaaaaabbbbaaaaaa################aaabcbabbaa#aaaaa#aaa###a####a####aaabaabcbbbcbba###aa####", "############a#####abaaaaaabddccbcdddbaaaa###aaaabaaabbbaaaabbabba###b######aa######a##aacbcbba##a##babbccccdddddeeefgfeedccdb####a#aaaaaaaaaaadefedecbabbbbbcddddbcddcaabaaaaaabbbbbaabbccdcccbbbcb#a##aa#aaabbbfdbbccddddeffffefggeedjhedcdcccbbaaaaaaaaaaabbcaaaaabbcdcccdeefgdcccdefeccbbbbbbbccbbbbaaaaaaabbbaaaaa#######aa######aaabbbcab#a#aaaaaaaa#a##a#####abaaa#abaabbbbbbdccc####aa#.#", "###aaa###a#a#a####aabaaaaaabdbbbcecdcbaaaaaaaa#aaaaaaaaaaaaabccbb###a########a#a#aaaaa##aaaabca#a##aabbccccccdcccbbbbcbcabbbb#a#a#a#aaaabaaaabbeffddeabcbbbbcccccdccbbbaaaaa#abaaaaaaaaaababbbbbcbb#a##a##a#aaaabefcbdeeddeffffffeddfbchjieccccbbbaaaaaaaaaaaacfcabbbbcdddcdehggffeeddgfecbbccbbbccbcbbaaaaaaaaabaaa######a##aaa####aaaaaaabbaa##aaaaaaa#aaaa#####aabbaaaabbbbbbccccddbaaaa####.", "####aaaaa#aaaa#aaaaaaabbaaabccbbbcddbbdcbaaaaaabaaaaaabbbbaaaaabaaa###############aaaaa##a#aaaaaaaaaaabbccccdcbbbaaaaaaaabaaa#######aaaaabbbabaacffffbbbbbbbbbbbbccccbaaaaaaaaaaaa##aaaaaaabbccca#######aa###aaaabcgfcdeeefgggggggeffcbbehkjebbcbbaa##aaaa#aaaadheabbbcdddcegfbccdfffgggedccccbbbbbabbbaaaaaaaaabaaaaaa######aaaaa#aa##aaaabaaaaaaaaaaaaa##aaa##aaa#acbaaabababbcccdecbaaaa###a#", "#######a###abaaaaaaaaaaabbdccccbbbceefebcaaaaaa#aaaaaabbbcccaabaaa###aaa#######a###aaaba##aaaaaaa#aaaabccccccbbbaaaaaaaaabaa###a###a#aaaaacbababa#eeedbbbbcddbcbccbccccaaaaaaaa#a#aaaaaaaabbbbcba########aa####aabbbghdeeegggggghggfedbbbcdikgbbbbbaa#aaaaaaaaaabheaabccddegdccccdddccfffddbbabbbcbbbbbbbbbbbaaaaaaaa########a###aaaa#a#abaaaaaaaaaaabbabaaaaaaa#a##ccaaaaaaaaaabcccbacaaabaa###", "##a#aa#####aaaaaaaaaa#aabbbabbcbbabcdeedcbbbaaaaaaabbbccdddccccbbccbdcbcca########aa####aa##a#aaa###aabbccdccbbbaaaaaabaaaaa#########aaaaabcaaabaa#dfcccbcccbcccccdccccdbbaaaaaa###aaaaaaabbbcb######aa###aaaa###abbcfheeffghhghhijifcbbbbbehjhcbbba##aaaa##aaa##afgdbbcefecdcdccddddddeedcbabbcbbabbcbbbaaaaaaaabaa######a#a#a###aaaa#aaabaaaaa#aaaaaaaaaaaaaaaa#a#bcaaaaabaaaaabbcccbcabbbaaa#", "aaaaaaaaaa#aaaaaaaaaaaa#abaa#aaaaaaaaabcbbaabbbabbbbccddddddefdbcdccdecddcaa##aab######baaaa##ab###aaaabbbcccbbaaaaaaaaaaaaaa########aaaaaacdbaabaa#dcabccdddcccccdeeddddddbaaaaaa###aaaaabbbca#a#########a###a##aaabcegefgfhhggiiihddbbccbbfegihfb###aaaaa#aaaa##adgfefecbddccccddcedccefdcbabcdcaabbbbbbbaaaaaaaaaa#a####aaa#aa###aaaabaaaa#aaaaaaa#aaa##aaabaa##abcbaaa#aaaaaaabbbbdddbbbaaaa", "aaaabbabaaaaabaaaaa#a#aaa#abaaaaabaaaaaaaaababbbbccdddeeefdfffedccbbbbcccccaaaaacb#abaab#aaba#aaa###a#aaaabccbaaaa##aaa#abaa###a##a#aa#aaaaacca#abaaadbabddddfededcbbcaaabcddcaaaaaa###aabbbcdca######a####aa##aaaaabbcdkgghhhhhgiigecabbbccffedgiida#aaaaaaa#aaaaaabfecbccccbbbabbbddddddccbaaacdcbbcbbbbbbbaaaaaaaaa##################baaaaaaaa######aa#aaaaa#a##abbbbaaaaabbaaaababbddcbbbbaa", "aaaaabcccbbbaabaaaaa#aaaaa#aaaaaaaaaaaaabaaabaaabbbcdffefgffdcccdddcccccbaabaaacbab#aa##aaabb#a#a##aaaaaaabbbcaaa###aaaa#aaa#a###aaa#abaaaaaacccbaaaabcbaaccbbdccbbbababba#abccbaaaaaaaaaabdeabaa##########aa####aaaabbceghghhihiihhgcbbbbbbegdcdedhhdd#aaaaaaaaaaaaabdccccccaaabbbbcddddfeffdbbabcbbbbbbbbbaaaaaa###a#########aa#######acbaaa#####aaaa##aaaaaaaaa#a#aaaaaaaaaabbbbaabbccddbbbba", "aaaababbbccbbcbaaaaaa#aaabba#aaaaabaaaaababbbbbaaaaaa#aabbcaaabbbbbbbbbcbaaaaaabaaaa####a##aaaa######aaaaaabbbbb#######a#aaa#a###a##a#aaa#aaacbbcbabbabcabbbcddbaaabbaaaa##aaaabbaaaaaaaabbcdbaaa###########a####aaaaabbbcfihghhhihhhdabbbbbbeeccccbdehfaa##aaaa#aaaaaabedccbaaaabcdcddcbfeffddeedccbbbbbbabbaaaaa#############aa########ababaa###aaaaa###aaaaaaaaa##abaaaaabbbbbbbbbbbbcdffabaa", "aaaaabbacbbbabaaaa#aaa#aaaacba###aaabaaaaaababaaaaaaaaaa##aaaaaaaaababbccc###aabaaaa##a##aaaaa#aa##aa#abaaaacccb##a#a#a#aaaaa####aaaa###a#aa#ababdbbbabcbabbbbbbbbbcbbaaaaaaaaaaba#a###aaacbcdaaaa#########.#####aaaaaabbccfkjgfhhifdfdaaababbffcbbbbbacgda#aaaaaaaaaaaaaddcba#aabccccdbbdeefeddfdfecbbacaaaabbaa##############aaaaa#######a#aa###aaa####aaaaaabaaaaaaaba#aaababbbcccddddgihcabb", "baaaaababccccbbaaa##aaaaaaa#cddb#####aabbbbaaaaaaaaaaa#####aaa##aa#aabadedca#abbaaaaaa####aaaa#a#aaaaa##aababcbca#aaaa#####aa###a#aa##aaaaa#a#aaacbaabbbcbabcccbbbbcbabba#aaaaaaaa#bbaaaaabbadb###################aaaaaabacbgkkihhggfedaaaaaaaceecbaaaaabffgeca#aaaaaa###acdca#aaacbbccbcbeeefffdabdfecabaaababbaa#a##########aaaaaa#######abaa##aaaa#####aaaaaaaaaaaaaabaaabaabbbbbcdegghffdabb", "bbaaaaaabbcccccbbaaaaaaabaaaabccca###aabcceebaaaaaaaaaaa#a##a#####aa#aaaddbbaaabaaaaaaaaaaaaabb##abb#aaaaaaabcbba##aaa###aaa#########a#aaaaaaaaaaaaaabbbccbaabccbcbbbbbaaaaaaaaa##aaabaaaaccbed#################.##aaa#aaaaacekljihhhdbaaaaaaabdeedbaaaaaabceffdaaaaa#####abdd##abbbbccccbcedfeddbbbbdddbbaaababaaa#################aa#aa.###aa##ba##aa###aaaaaaabaaaaabaaaaababbabbbdfhjifeecba", "bbbaaababaabbcccbaaaaaa#aaaaa#aaba##aaabcbbccbaaaaaaaaaaaaa#aa####aaaaaabccbaaa#aaaabaabaaaa#abdca#acaaaaabaabbaba#aaaaaaabba##aaaaaaaaaaaa##a#aabbbbbbbccbbbacbcbabbbbbaaa#aaa##aaaaaacbccccdbbba#a########a#.####aaaaabaaaaafklljhfcaaaaaaaa#dcgfcbbaaabccccdggcbaaaaa#aaaacdaabbbbbbbbcbddeeddccccbbcecbaaaaaaaa#a##############aaa##a####aa##b###aa#aaaaaaaaaaaaaa#aabaaaaaabaabbdggghhfbdeb", "bbabbaaaaaabbcbccbabba#aaaa##a#aaa#a#aaabbabbbaaaaaabbabaaaa#a#####aaaaaadcba###aaaaaaaaaaaaaaabbaa#abaaaabbbcbaa#aaaaaaaaaaaa#aaaaaaaaaa#aaaaaaaabbbbbbbcbababbbcbbbbaaaa###a###aaaaaaaccddcddbaaba#aaaa####a#.#.#aaaaabbaaa##djlljc#aaaaaaaa#afdfebaaaabccccddegfdbaabbbbbbabddbbbbbbbbbadceedcdcccbbabdebaaaa#aaa#############aaaaaa#ab####a##ba#####aaaaaaaaaaaaaaaaaaaaaaaaaabcdfebbbabbbcc", "ecabbaaaaababcdcccbbbcdbaaaabbaa#aaaa##aabcbbbaabaaabbaabaaa#aa###aaaaaabecbaa#a#a#aaaaaaaaaa#aaaaaaaaaaaabbcbaa###aaaaabaaaaaaa#a####aaa#aabaaaaaabbbbbbdcbbabbbcbbaaaaa####aaa#aa###aaabcccccbaabbba##a####aa#####aaaabaaaaa##ahlkfa#aaaaaaa##fbbecaaaabccbcdddceghecbbccccbbbccddbbabaa#ccedddddccbbaaacfbaa#a##a############a##aaaaaaaaa##a###ca#aa###aaaaaaaaabaaaacabbaaabbbbddea###aaaabc", "abbcbbbbaaaabbccbbbbaaaa#a#aaaabcaaaaaa#aabbbbaabaaccbbabaaaaaaaaaaaabbabdcbaaaaa###aaaaaaaa#aaaaaabbbaabbbabaa#aaaaaa#aaacbbaaa##aa##aaaaabcbaaaaabacbccccabaabaacbcbaaa####aaaaa####aaaabdccdba#abbaaa#######a######aaaaaba#####dljfa#aaaaaaa#ddaadcbccbbbbccccdccehihfddccccccbbdfaaaabbbceefedddcbbbbaaaecaaaaa##a###a####a##a##aaaaaa####a###ba#aa###aaaaaaaaabbbbacbbbbbaaacccdd#####aaaab", "babbbcccbbbaacdbccbbbaaaaa######aaaaaaaa##abbbbabaaabbaaaaaaaaaaaa##abbbdcccbaa#aa#####aa#aaaaaaaaaaabcbabbabaa##aaaaaab#accbaaaaa#aaaaaaabcddbaaaaabbbccccbaabbbbaabbbbaa###aaaaa#####a#abceeeaaa#aaaaba#######a#######aaaaaaa###.cgjgb#aaaaaaaafcaacdcdcbcbbcbbccdeefeeghfeccccbcddc#aabaaaeffeccccbbbbbaaacdcaaba##aa##a#aa#aaaa#aa###a####a####b#a##aaaaaaaaaaaaabbbbcababbbbcdddeb#a#####aa", "bacbbcddcbbbbacddccbabbaaaaaa#a##aaaaaa####aabbaaaaaaabaaaaabaaaaaaaaabbcccbbabaaaaa#a#aaaaaaaaaaaaaaaabbccbbba##aaa#aaaaaabbbaaaa#aaa##abbaabbcbaabbcccccbbbbbabbbabbbbaa#############aaabbcedbaaaaaa#aaa######a########a#aaaa##a##adhjc#aaaaaaacdb##bddcbbbbaabbccefgecceffgfcbceccedabbaaacffdccbbbbbbbbbaabccbbaaa#aa####a###aaaaa#a##bb##a###ab##a###aaaaaaaaaaabaaabbbcbcbbbcefeb#####aa#a", "aaccbcddcbbabcbcddcbbbcbaaaaaaaa#aaaabaa##a#aaaa##aaaaaaaaaaaaaa#aaaaaaaaabbccaaaaaaa#aaabbaaaaaaaaaa##aabccccbaa#aaaa#abaaaaaaaaaaaaaabbbbaabbaccbddedcbbbbbabbbcbcbbcaaaa############a#aacbcba##aaaaaa#aaa#a###########a###aaaaa####adid#aaaaa##eca##addcbbaaaabbcddefddefddgiedccccffbaaaaaefeccbbbbbbbbbaabacdbbba####aa#a##a##aaaaaaccbba###.aa#aa#ba#a#aa#aaaaabbabcbccbcbcccegc######ba#a", "abcbbccdedcbbbabdddcbabbbbbaa##aa#aaabaa######aaaaaaaaaaaaaaa#aa#######aa#aabcbbaaaaaaaaabcaaa###abaaa#aaabcbcb#aa##aa#abbaaaaaaaabbcaaaaaabbgecbbbbccbbbbbabcabbcbbbbaaaaa##############aaabaaaa#aaba#######a###########ba#aaa#aaa###aabffcaaaaaabeb####cdcbaaaaaaabbccdeffeeegihfddddffcaaaabefeccaabbbbbbbaaaabdba#aa####aaaaa###aaaacccbbba#######aaaa#aa#a##aabbbbbbbccccccccddgf#aa##a#aaa", "aabcdddddddbbbccabcdccbaaaaaa#####bbaaaa#######aaaaaaa###a#####a#########aaaacbbbaaaa#accdddba#a#aaaaaaaaabbbcbaaaaa#aaaabaaaaabba#bdaaaaabeecbbcbcbccbbbbabbbbbbbabbbbaa#aa####a########aaaaacaabaabaa#######aa########abbbbaa##aaaa###aaegfb#aa##dcaaaabddbaaa##a##aaabcdfgffgiggfffedefea#aabffccbaaabbaaabaaaaacbaaaaaaa####a##aaaaaabbabaaa##aa##aaaaa######aabcbaabbccccbbddedeeaaaaa#baaa", "aabbdeedeedddaccbbbcbcccbaaaaaabbaccaaa#a#aa###aa#aaaa#########aa#a#####a##babbbbbcbbcfdccccbbaabaaaaabaabbbccbbaaaaaaaaaabaaaaaaaaacfcaaabcbbaaababbcaabbbabbbbbaaacbabaaa####a##.########a#abd##baaaaaa##.###aa#######abbadb#a#########aaeiib####bca#aabadcba########aabccdgghgfeddddeedegdaaabdedbbaaabbabbaaaaa#cbaaaaaaaa#a##a#aaa#abbbbaaa#aa##aaaaaaa#####aaabaabbbbccbbbcdecef######acaa", "baabcccddedddbacccbccdcbbbbaa####aa##aaa###a###aaaa#a#####aaaa#a#aaa###aaaaabbbbbabcgjfdccbbbaaaaaaaaaaaabbacccba###aaaaaaab##aaaabbbdfdbaabdecbbbabaabbbbbbbbbbbbababbaaaaaa######.########a#acdb#aaaaaaa######aa######abbccb####aa######afiifa###bca#aaaabcbba#a######aaabcdeefcbcedccccceffaaaaacdbaaabbbaabbabaaabcbbaaaaaaaaa##a#a##abbaaaa#ba##aaa###a####aaaaaaaaaaccbbbcccdeff.######aaa", "a#aabbbcdeddcccbcccccdcbbabaaaa##a###aa#a#a#####aa##a###a##aaa####aa#a#a#aaabbaabbbbbffdccbbbabbaaaabbbbbabcbbbaaa##aaaaaaaaa###aabcbbcdfdaacebbbbbaaabbbbbbbbbaaaaabbabaaaa###aa############abcdcaaaabbaaa######aa#####abbbdc#############adghf###cdaa##aaaabbaa##.##.##aaabcdecedbbcdecbbbccebaabacdaaaaabbbbbbbaaaaabdcbaaabaaaaa##aa#aaabaaa#bcaaaaaa###aa#a#a#aaaaaaaaababccdceec##########", "###bbbbcdeddddcccccbccbccbbbaaa#####.#a##aa######a##aaaa###aaaaa##a###aaaaaabbbbbbbccddcdcbbbbbcdbbbadecccccbcb###a###aaaabaaaa###accbbccfhcacbbbabbabbbbbbbbaaabbbaabbbaa####aa#########.####aabcbaaaabbaaaa#####a#####aabacfb###############dhhc.ddb###a###bbca#.#....##aaabcdccecbbccedbbcccedbabbdcbaaaaaaaabaaabaaaacccaabaaaaaaaaaaa#abaaabbcaaaaaa###########aaaaaaababbbceeda.#####a###a", "#baaabbcdeddddddddbbcccbcbbbbaaaa################aaababba####aaaaaa###aaaaaaabbaabbdecbccccccbbbccccbcbbbcbbddeeca###aaaabccaaaaaa##abbbbcdedbbabbaaaaabbbbbbbbaaaaaaabbaa#######aaa##########aabbbaaabbaabaaa########aaaaaabdfb####aa#########cghhceba###a##aabaa#.....###aaabcdceebbbbbddcbccbcdcabcedbbaaaaaaaabaaaaaa#cddbbbaaaaaaaaaaaaaaaaccbaaaaaba#a#a######a##a#aaaaaaccdeed####aa####a", "aaabaabccceeddeedcabbbcbbcbbbbbbaaaaa#########a##aaaaabbcbaa#aa#aaaaa#aaaaaaaaaaabbcddcbbbbbbbbbbbbbabbbbbbaabbdgfba#aaaaabbaaa##aaaaaabbbcceedaaaaabbabbbabbbbbbaaaaaabba#######aba#########a##abbcaabcbaabbba########aabbaabddca#aaaaa#########adjhaaa#aa#####aaa#...####aaabbcccfdabbbbbddcccbbccacffccbaaaaaaaaababaaa##bccccbabaaaaaa#aaaaabdcaabbaaaaa#########a#a#aaa###bcddhga####aa####", "##aabbbbcdffeddeebdcbbbbbcbbcbcbaaaaaa##.##aa######aabbbbaaaa#aaaaaaa##aaabb#aaaaacddfbcbabbccbccbbbaabbaaba#abadfdbbaaaabcaaaaaaaaabbbababbceedaaaabbabbbbbbbbbbaaaaaaaaa##.#####aa#########aaa#aacdabbbaaaaaaaa#######bbbbccdcddbaabbaaa####aa###bhgea#######.##aaa#####aaaababbbcebababbabdeccbbbceffeecbaaaaaaaaabaaaaaaa#bcccbbbbaaaaaaababbbbbaaaabaaa#######a##a#aa#aaaaabddhg###########", "#a#aaabcdddffdddeeedbbbbbcbbbbcbbbaabaaa#a##a##aacaaaaaaaaaa#a##aaaaacdaaaabaaaa#accdeaaaaabbbbccbbbbaaaaabbbababcdddcccbbaaaa#aaaabbbaaaaaabdeeeaaaaaababbbbbbaaaaaaaaaaaa###a####ba####a####aaaaaabecaa######aaa#####a#ababccccbcbabaaaaaaa###a####dijdb########a#a###aa##a#abbbbddbaaaaabbabdddcfeffffeccbbaaaaa#aaaaaaaaaa#abccbcabaaaaaaaabbaaababaaaaa#aaaa###aaa#aaaaaaaaabchga#####aaa##", "#a#a###abccdddefdeeecbbbbbbaabbbbbbbbba#########abaa#aaaaaaa##a#aaaaaccbaaabbabbcbbccfbcaaaababbbbbaaaaaaaaaaaabbbabbabaabaaa#aaaaaabbabaaa#abcdfea#aaaabbbbaaaaaaaaaaaaaaaa#######bba##########aaaabcedbb#######aa#####a##abdcbbccbaaaaaa#aaaaa#aa###bgjjga#######aba#aadba##aabbbccbaaaaabbaaabedffeffffdcbbaaaaaaaaaaaaaaaa#aaaccbbbaaaaaaaaaaaababbbaaaa#aaa#####aaaaaaaaaaabbbghc#####aaaaa", "a##a#aa#aabccbdfgeefeccababbbaabaabbbaa#a##.######aaaaaaabba##aa##abbbcbcbbccacbbdedgheccbbabbaaaaaaaaabbaaaaaaaaaaaaaaaaaacbbba#ababbbbaaaaaaabdeeca#aabcbaaaaaaaa#aaabaaaaa####.##ba###########aaabbceeba########a#########cbbbabbbaaa#aa#aaaaaaaaa###djkjb#b#..#abbcaaabcba##aaabbcaaa#aaaaabaacfffffedffccbaaaaaaaaaaaaaaaaaaaabcbbaaaaaa##aaaaabaaabaa#aaaaaaa#a#a#a#aaaabbbbccgc######aaa#", "##aaaaaa##aaccbaeihfgggcbabbbaaaaacbbceceeca########aaaaaabaaaaaaaabbbdcccdebbcbbabacedecbbbabaa#aaaaaabbbbaaaaaaaaaa#aaaaa#abbbbacbbbbbbaaaaaaaccddbbbbbbbaaaaaaaaa##aaa#a##a#####aa#############aaabbceeea########a########aaaaaaaabbaa###a###aaa######agjkhgfb.#aabddaaaaaaa###aabdb##b###aaaaa#cffffeeeeeccbaaaaa#aaaaaaaaaaaaaabcbaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaabbbbbdfeba####aaa#", "#a#aaaaa###aacca#cjjhhjebcbaa##a##acegebdcbdb#.#cbcaaaaaaaaaaaaaaaaaabbcdgiecbbaaabbbcbcdcbbbbbaaaa#aabaabcbaaaaa#aa#aa#aaa###aaaaaa####a###aaaabcddbcbbbaaaaaaa#aaaa#aaaaa##a#####baa#.#######a##aabbcdddffa##.####aa##.####aaaaaaaaaabaaa###########a####chhiihc..ceffbabaaabaaaaabccaacc###aaccbbegfffededdccbaa#a#aaaaaaaaaaaaaaaabcbbaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaabcccefeaaa###aa#a", "aaa#abaaaa##aaba##eiiikhccbddefeeffgecccdccdeffefddc#aaaba#aaabaabbaaaabcdhfbbbbaaacdecbbaabbbcbbbbaaaabbbbbbaaaaaa#######a###aaa#aaaaa######aaaaaccbcbaaaaaaa####aa##aaaaa#####a##############a##aaabcccccdfb##.#####a######aaa#aaaaaaaaaaa##########aaa##.#aejjifb#cffacbbbaaa#acbbcc##ddda##cddeefgfffeedddcabbaa#aaaaaaaaaaaaaaaaaaacbbaaaaaaabbabbbcaabaaaabbabbbbabbbbbbbbbbbdfc####a##aa#", "#aaa#a#a##a####b###dgkkjgccfiifdfdeeccddddcdcccccbca#aa##aa#aaaaabbbaababeggdbaaaaadfcbbbbbbcccbabcbaaaaabcabbbcbaaaaaa##########a#a########aa##a#accbbaaa#########aa###aaaa###aaa####.#########b##aabcbbcddfb###############aaaa###abbaaba#aaa#########aa#####djjjifbcebccdcba#bbacbcb##addccdcdeeefgfffeecbccbbbaaaaaaaa#aaaaaaaaaaaaaabbaaaaaaabaabbbbbaabababbbbbbbbbccccbbbbcced####a###aa#", "a##aaaaaaaaa#a#ba..#agkgfecfikgddcccdcccbcccbcbcbbdba##bccaaa#bbccccbaabbefffcaaaabdfbbbbbbbbccaaabaaaaaaabcbbbabbbbaaaa#######aaa############aa###abbaaa####a############a####a#######.#####a##aaa####aaaacfa#######..######aaaa###a#cdcbbbabcbaa#aab#########.chiiihfcddeghhgdccdabdaa#addcddceefeeffeeeedbbcccbbaaaaa#aaaaaaaaaaaaaaaaabbbbaaaaaaabaabbaaaababbbbbbbcccdccdcbbceea####aa###aa", "a####aaaabaaabbab#.#aaeecdhfijfcccddcccbbbbccbbbccaaa###.a#abccccbcbcbbbbbff#a###abcebabbbbccbcaabbaaaaabccbbbbbbbbbbbaaa#aa####aa##############aaaa#ababaa##############a#a######a####################aabbcacaaab#####.#.##abbaa###aaabcacbcaaaaaaa#aa#########.bgihiifcdgijjjiidaaabe#a#bdcbccccddddddecdecbbbccbbaaaaa##aabbaaaaaaaaaaabbbbbabbbaaaabbbbbaaabbbbbbbccdddedddefeffa####a#####a", "#######aaaaaaaaaa#.#abcdaahkkjgbbcccbbbbbcbbcbbbbaaaa#a######abddedccccbbacffcbb##acccacdcabbdccdbabaaaa#abbbbbaabbbbcba###a############.##.###########ababaa##################a##a###.################aaabcbcdbbbaa##.#.#.#aabaa###abcdcaabaa####aa#aabbb###a###.#bgjhacegijjjjjjhedfgea##cbbbccbbbcccccdcccbbbccaabaaaaaaaaaaaaaaaaaaaaaabcbabaaabaaabbbbbaababbbbbbccddddedffceedb######aa###", "aaa#a####a##aaa##a.##acda#cejjfdbbbbbabcbaabbcbbaa#aaa##a#a###baecbdfedddefhhgefea#cedbafecbbcbecbbccbbbbabbbbbbbccabbcdcaa####################.#######aaaaca##########################.########a######aaaaccccbbca#a########aaaa####bedcaabaa##aaaabaaabc########..#figefhikjihhhhiijiihd##bbcdbcccbcccddebcbbbbcdbaaaaaaaaaaaaaaaa#aaaaaabbcbbbbbbbabbbbbbbabbbbbccddedeedffa###a#####aaaaaaa#", "###aa############a#.##bccbbbbehhaabbbaaabbabbcbaba#aaa#######becdda#fgecddeehghegdabdecaabedbcaacbbddbbbbbbcbbbbbbdbaaccccba#########a################aaaaabcaba###############################a#####.###aaaabccbcb##a######aab##a###accbca#b#####aaaaaaaaa###.####...diihiiihfgeffeffhijid##ddcdccccccddddccbbaabddcaaaaaaabaaaaaaaaaaaaaaabbcbbabbababbbbbbbabbcbccdddedefc.##########aa#aaaa#", "#aaaaa#aaa##a######.#abbccaaaabgfb#ababa#aaaacbaaaaabbbab####edeefeccgedcddehhfacebadecaaaabcccbbbbcbabbbbbcbbcbccccccabccdb#######abb###a##############aaaacbccba##########a######.########a###a#########aabcceccb###a#####aaaa##aaaaacbb##ac######aaaaa##aaa#######..diihffffffdeddddefiigaaeddddbbcdddccdccbaaabcedbbbaababaaaaaaaaaaaaaaaabdcbaabbababbbbbbbbbbbbcceeegc.#############aaaaaa", "aabcbbaaaaaaaa########bbcdbaaaaaffa#aaaaa#aaabbaaaabcdeddabaefcdddefcgfddddeghcccffddbaaabbbbbccbccdbcbabbbbbbcbbbbbdcabbbddb########bca#a#######a##a###aaaaaaabdbaa#aaa####aca##...###aa####a##a########aaabbbdecc##aaa############aa#abba##a#########aa#aaaaa########.bgiedcccdccccccccdhigdeeeeedcdddccbcebaaaaaaceebbbbbbbababaaaaaaaaaaaabcccccfedcbbbbbbbbbbbbabcfffe############a###aaaaa", "a#aaedbbbbaaa#a#######abddca#aaaadcaa##aa####aabababbbccccfggcbcccccfgeccccdddffedfecddcbbbbccbbccdcddbbbbbbcbbbaabbcc#abaacba########aa##..#######aa####aaaaa###bbaaa#aaaaa#cc###a.####aa##aaa#########aaabbbbadcdaaabba##########a#aa#bbaa##a#######a#aa#aaaaaa#######.ageccbbbbbbbbbbbcbehigffeedddddccbcccbbaaa#accdcbbbbbbaaaaaaaaaaaaaabbcbccdbaadfdcbbbbbbbcbcefccba#################aaa#", "#aaacbaabbcbbbaa#######abcca##aaabbcba########abbaaabaabccdcbabbbccbcedccccccccccccedbbcdbbbccbcbbcbcbbbbbbbbbbabbbbcccbbaaaaaa##a####a#aa####.#####aa##a#aaaaa##abbcaaaabbbabcaaa#.#.###aa#a##a########aaabccabbddbaabaa####.##.aaaaaa##bba##############aaaa##a########.#bddbbbbbbbbbaaaaabfhhgfeedddccbccbdabaaabbbccddcbbbbbbaaaaaaaaaaabacbbcceb#a#babcbbbbbbcbce##.####################aa#", "aaaaaa#aaaababba#######abcccb#a#aaacddb######aaaaa#aaaaabbbbbbbcbbbbcdcbcbccbccccddbababcccccccccbbbbaaabbbbccbdcbbbbabcbbaa######aa#aaa############aa#####aaaaa#acbabaa#baabbcb#a##.#####baaa#########aaaabcdcccccbaaaa##########abaaa###aa##############a####aaa########.##dcbbbbbbbaaaaaaaabghgffedccccccbbcabbaaabbcbdedbbbbbbaaaaaaaaaabaaabccdecbcabbbcbbbbbcbeea###aa####################", "aaaaaaaaaaaaaa##########acceeba###bbbcda#######a####aaaaabbbabbabbbbbcccccccccbcbbcdcbaabbcbcccccbbbbbcabbbbddegebbbbbbbcaaaaa#########a######aba#####aa#####abaaaabcbb#aa##abaaba#####a##aaaaa######aaaaaaacccccbccaa##a#######aa#aabaa##aaa####aa########a#aaaaaa###########addcbbbaaaaaaaaaa#fieeeddcccbbbbbaaabaabbaaabdedcccbaaaabaaaaabbaabbbcdebaaccbbdddcbbcdc#aaaa###########.########b", "aaaaa#aaa#aa#############abcdfdaaaabcdf###aaaa##a#####aaaaabbccabbaaaabbbcccccbcbabbccbbbbbbbbbbbccbbcccbbbcdcdedecabbbbaaaaaaa########abb##aa#aaabaa#aba###a#aa#aabcccbabb###aa#aaa######aa##aa######aaaaaaaccccdaba###########aaa#aaba#aaaa#aa##a########aca##aaa######a######cffaaaaaaaaaaaaa#ehfeeedcbbbbbbcbaabbbbbbbaadeeefedcbaabbabbccbabbdcbcaabdcccccceedffb##aa####################a#", "aaaaa###aaaaaa#####.####aabccfgbaabbcfeda##aaabaaaaaa#aaaaaaaccbccbaaabcccbbccbbbbbbcbbbbbbbcbbbbbcabcccbababccdeccbabbbbaaaaa#aa########aaaaaaaabedaa##a#aaabaaaaabaccbaaaca###aaaaaa#####a###aa###a##aaa#aaaccbbabaa############aaaaaaaaaaaaa#########a##acdaabaaaa############acecaaaaaaaaaaaaafhffeddcbbabbcbbabbbbbbbbaabbdeddfeddbabbbdcabbabbababbbcbcbccddffcdaaaa##a###################", "aa#a#####aa#aaaa#########abcdcfeaaacbdccfcbbbdddbbbbbaaaaa#aaaabcbaabbbcccbbbcbbcccccccccbbcbcccbbbbbcccbbabbacddedcaabbabaaaaa##aa########cb##aa#cfdaa##aaababbbbaaaabbbbaabaaa#abaaa#####a#bbaaaa##a##aaaaaabbccdaaaaa#####bb#####aa##aaaaaaaa############aabbbbaaaa##aa##########deaaa###aaaaabcgiggddccccccccabbbbbabbaba#aabcaacccccbbcdbaacbbabbbbabcbcdddd####abaa#a##a#a#aa############a", "aaa#####aa#a#aaaaaaa######abccdfa#bbcddbcccdcdaaccdecbbbbbbbaabccbaaabbcccbbbccbccccddccccccddccbbbbbbcccbbbbbcccdddbabbbabaaaa########.####bba##a#aca###aaaaaaaaaaaaaabbbaabaabaaabba#######ababba.##aaaaaaaaabcdcb#aaaa#####a##########aaaaaa#a####aaaa##.##abbba#aab#aba#aa#a#####cgeaa####aa#aabfiigdccccbccccbbbbaabbbbaaaaaabccbbccccdabcbccaaaaabbbccdebdbaaaaaaaaa#a######aaaaa#########", "#aa#a###aaa####aa##a#####aabbbbeb#abbceeba#a####aaaba##cdbbbcccdccbbbbbbccbbabcbbbcbcddccccccddddddccdcabbbcbccbbbddcbbbbbbbaaaa#########.####aaa####a#a#aaaaaaaaaaaaaabbbbaaabaaaaaaba####a#.a##ab##.a##a##aaaabbddb##aa#####aa######.##aaaaaa#aa####a#aaa###abbb###acaacaaaa##a#####bff###a##aaa#aacghhfccbcbcbbcbbbbbbbcaaaabababbdccccddbbccccaaaaaabbccee##aaaabbacaaaa######aaa#aaaaaaa###", "#aaa##########aaaaa########bbbbbea#babcea#a######aaa####bccddcddedcccccccccbcbccbbbcbcddddcccbbbcccdefedcbaacbbcbbbbbbbbababaaaa############.###aa#a##aaa#aaaaaacbba##abbcbaaa#aaa#aa#########a#######a##aa#a#abbcbcc#a############aa####aaaaaaaaaa#######aa###aabaa##bbaaaa#a##aa######dea#####aaaaaa#behhdccbccacbbbbbbbcbbbaabbabbbcdcccdddbbbba#aaaaabbddb#######bcaaaaaa######aaaabbbaaaaaa", "aa#aa##########aaa########aabbbbbedbaabddcb#aaaa#aaaa####cccaacdeeggecccccccbbabbbbbbbbccddcccbbbbcbcddeedcbaaabbabbbbcbbbabaaaa###########.#####aba#######aaaaaabbba#aabbbbaa###aa##a#####.#a#.#.####aa##aa#aaabccbca#aa#..########a######aaa##aaa#########aaa#aaaaaabcaaaa##a##a###a#a#bdb#aaaaaaaaaaabcfhfccccabbcbbbbcbcbbbaabaabbabcddcdcccbba##a#a#abddb########aaaaa#aaa####aaaaaaaabbaaa", "aaa#aa##########aa#a#a#######abbabgebaabacca#ba#aaabaa#########a##bdeddeedddcbbbbbbbcbabacdddcccccbbbcdcdcdcabbbbbbababbbccbabaa###############aaabb####aa##aaaaabbbaaaa#abbbaa###aaaa###a###a##....###a##aa##aaabbbca##aa#.#######aaa##aa######aaa#########abaabaaaaaacbaaaaaa##a###a##a#afb##a##aabbbaaaaeggecebcbbbabbbcbbabaabbbbbbabbdddccccccabaaaaaaccc#####a#aaaa#a#####aaaaaaabbbaaabaa", "aaaaa############aa#a########.#abbcffcabbceccaaaaaaaaa###a###aa#######aaeebccccccbbbbcbbccbdddccccccbbbccbbbbbbbcbbabbbbbccbbbbaaa########.#aaa#a##aba#aa##aaabbbabbbaaa###abaaa#########aa##a############aa###aabcc#aa#aaa#######.##aaba#aaaaaa##aaaaa######baaaaaaa#aaaaaaaaaa###aaaaaa###ebaaaaaaaaaaaaabbfhgedbbbbbcbbbbbbabbbbbbbabbbbddecbcbbbbbbcbbbceaa#####aabca#a#a#a##a#aaaaaabbbbbaa", "aaaaaaa####aaaa#aa###########..#aabdddbbcccccaaaaaaaaaa##a##aaa###aa#####eddedddcddccbccbccccbbcbbcedbbcccccbbbbbbbbababbbcbbcbaaaaa############a#a#aa#aaaaabbaabaabaaa#aaa#abaaa#######aaaa#a###########.#aab##aacc#aa####a######..##aa#aaabbaaa##aaaaaaabbaabaccbaa###aaaaaaaaaa##aaaaa##a#ccbaaaaaa###aaaadgggfeababbcbcbcbbaabbbbaaabbbccddbcbbbbbcdccccca#a#a###aaaaaaaaaaaa#aaaaaaababccba", "aaabaaa#a#######a#aaa####aa###.###bcdcbcbabddbaacbbababaa#a##aaaa#aa#aacdccbddddddbbbbbaa#aaa######bfggfdcccbabbbbabaaabcbccabbaaaa#########a#aaaaa#######aabaaabbabbaa####aaaabaaa##aa##aaa#b####.#########abb#aaee##a###.##.##.###..####abccccbaaaaaaaaabcdaabbccba##a#aa#aaaaa#a#aa#aaaaaaaabebaaaaa#a##aabbfghhgedaaabbbccababcccbbbaabccbcccbbcbbcdcdcaaa########aaaaaaaaaaa#aaaaaaababbccb", "abaaaaaaaaaa######aaa########aa####bbccbbaabceaa#cbbbbbba#a##aaaa#aa###debacb#aacabaa##aa###########.#afhgeecbccbbbabaacbcccbbbbbbaa#a#########aa#aaaa####aaaaaabbbbbbbaa###aaabbba###a##aaa###.#######ba##aaadbaabeaa##aa#..###.##########abaaabdbaaababababbaabddbaa##aaaaaaaaaaa#aaaaaaaaaaa#aecaaaaa#aa#aaabdghhhfecccbcbbabbacccccbbbbbcbbbbbcbabbdcbcba########aaabaaaa##a###aaaaaaaaaabbb", "baaabbaaaaaaaaaaaa###########aaa####acccbaaaabcbcabbbbbbba#####aaaba#acbcaa#aaaa#abaa############.#####.dhihgeefccbbbbaabccbbbbbbaaaa##########a#aa#aa####aaa#aabaabcbbaa####a#aaaa###a#aaa################abbeebbbdd##a#######..####.######aaaaabcbbbbbbbbbbb#abcccbaaa#aaa#aaaaaa###aaabaaaaaaa#bcbaaaaaaaaaaaabehhhfedaaabaaabbccccbabbbbccbbabccbbbdcbbaaa#######a#aabaaaaa#aabaaaaaaaaaaabb", "bbaaaaaaaaaaaaaaaaaaa#########a#a####bbcbaaaaabeecbbaaabbaba###a#aaa##cedb#aaabaaaaa##a#########.##.###a#bfgedeffdccccbaaacdccccbbaa###########aaa######aaba###aabaabbbaaaa#####aa#a##abbaa####.##.####aaa#acbddddfega#a#######.######.##a#aaaa#aaaaaaaabccddebaba#bcba##aaaaaaaaab#aaaaabbbcaabaaaaccaaaaaaaabaabbehhfgebaaaaaaacdcccaabbcbbcbbbbbcdcbbcaaa#a######aa#abbaaaaaa#abbaaaaa#aaaaab", "bbbaaaaabbbaaabaa#aaaa###.#######a####abb#aa#a#cfecaabbaaaba#######aaa#bddcdaaabaaaa#a#aa######.########ba.a####bfddcccbbacdccccccaa############aaa######adb###aaaaaaabaaaaaa###aaaa##abaaa#####..#####aaaaabbcdeedfgd#aa########.#######a##aa#aaaa#a###a#abeedecc##aaba#aaaaaaaa#bbaaaaabbbbaaaaaaaaaccbaabaaababbadgggfdb#aaaaaabcbbbbbbccccdcaabbcdcccbaaa#######aaaaaaaa##aa###aaaaaaaaaaaba", "bbbbaa#aaaabaaaaaaaaaba#a######.#######abbbca##acdedcaabca#a#.###a######bddcfcaabaaa##a##a#####...##aa####a####a#abbccddcbbddedccccbaa####a######aaa#####acb###aaaaaaaaaaaaaa###########aaa####.####a##aaaaacdeceeeedc##aa########..#########aaaaa##a###aaaaaabcdedcb##aa#aaaaaaaaacbaaaaabbbbaaaaaaaaadfdaabaaaabbbbcdggfebaaaaaaacccbbbbbbccdcccbbbdcecba#####a####abbaaa#######a#aaabbaabaabb", "bbaacbabaabaaaabbaaabbaabb#.####.#######abbcba#aabecdbaccaa#a#.##aa##a###acacecbaaaaaa##########..######..abaa#aa####aceeddceggeddccbaa##########a#aaaa##aaa##a##aaaaaaaaaaaaa#########aaa####a#aaa####aaaabbdffffgebca#ab#######.#..#aa######aa###aa####aaaa#baabbdcc##b##aaaaaaaaabaaaaaabbbbaaaaaaaabcegcabaababbbbabgfgfdaaaaaabbabbbabbbcdddbcbccccdbaaa#a##a###aaaaaaa#########abbbbccbaab", "baaabbaaababaabbaaaaaaaaaaa##############abbaa##aadd##abbaaaa#.##aaa##a####aabcbaaa#aaa###a######..####.#..cdcbbbaa###abdcdedfghffddcbba###########aaaaaaaaaaaaaaaaaaaaaaa#aaaa########a#aaa#####aaa#a#aabbccddghhhfcca#aa##########...##########aa#aa###aaa##aaaa#a#bb####aaaaba#a#aaaaaaaabbcbbaaabaaabbefdabaabbbbbbbbfgggfdcaaaaabbbbbbbccdbdbcbcccbcbba##aaaaaa###aa#aaaa########bbabbbbaaa", "aa#a#aaaaaaaaaaaaaaaaaabbabaa#######.#.####aaaaaaabdeb#aababaa####aaa#abba#####aaaaa###a##bdba##a######....acdbabbaaaa#####cddaeggffedcba##########aaaa###aaa#abaaaababaaaaaaaaa##a###abaaaa###.#bbaaaaabdcddeefhhifdda#bb#aa##aa######..########ab##a###a##a#aaaa#abaabaaa#aaaaaaaaaaaa#aaaababbbbaaaaaaabcffbbbabaabbbaacefggdba#aabbbbcbacddccecbbbcccbba##aaaaaaaaaaa#a##a#a#######aaaabaa#a", "ba###aaaaa#cbaaaaa#abababa#a################aabbbbbbbea#aaabbaa#####a##adc##aaaaaaba##a####a########.#####...aca###########.####cffdcdecaaa#######aaabaa##aaaaaaa#aaabbbaaaaaabaaaba##babba######accbbbbbfccdeegdgfggeb#dc#####aaa#####...#######aaaa#aa##a#aaabaaa#bbaaaaa##aaaaaaaaaaaaaaabaabbbbbaaaaababbegdbbaaababbaabffffecb#aabbbbcbbcdddecbaabcbaaba#aaaaaaaaaaaaa###a########a#abbaabc", "a#######a###aa#abaaaabbccba###.##############abcbcbbcbea#aaaaaaa#######.##ba#a#aa#a#a#a##a####.###########..###ba##############a#aeedbadfcdddcbb##aaaaaaa#aa#aaaa#aaccbbbaabbbbbabcbbcdccb######abcdbddeeefddddb#afdcfebdca#####aaa######.#####aaca####abaa#aa#abcb#accaaaa##aa#aabbaaaaaaaaaaaabbbaaaaaaabbbbbgdbaaabbbbaaaccffgfdcaabbccccccddddfcbaaaaaaaaa#aaabbaaaaaa#a#aab####aa##aaa#bcc#", "aa###########aa#aaaaabbabbaaaa##..###########abdcccccbcdcaaaaaa#a##########aabb#abaa##########...#.########.######################.bfdaaccefddddbaaaaaaaaaaaaaa#aaababcccbbbbbccbbcddcabca####aaacdcabeggfdda.##.#cc#aefdbaaa###aaa###.##.####aaaaa#a###abd##a###ababbdc#aa#aaaaaaaabaaaaaaaaaaabbcbbaaaaaaabbbbgfbaaabbbbaabbbcefffddbabbcdccccedcabaaaaaaaaaaaaaaaaaaaaaaaaaaa#####aaa#aaaaaaa", "aaaa##########a######.#a#abbaa##########a####abdedcccccccba##########a######aaaa#abaaaaa#######..################aa#aa###############ddabedcgededbbbaabbabaaaaaaaaaaabbccccccbccdddba###abacbbcccba####aaaaaaaa##.###acfcaaa##aa#a############aa#####a#a##aea#aaa#aabbcda##aaa#aa#aaaaaaabaaaaaaababcbaaaaaaaabbbgfbabbbabaabcdcbdefffdbbcccccccdda#aaaaaaa##abaabbaaaaaaaabbbaaaa####a##aaaabaa", "aaaaabaa#######a###a##.###abbaa###############acdeccbbccdga##########a######.#aabaaaaaaaaa#a############.###aa###aaaaa###############.cdbbdefhhhfdccccbbbaaabaaaabbbbbccccdddcdccdb#####bbcbcddba####aa####a#a#####.##aedaaaa###aaa#######..#########a###a#bbbbbaaabbbbaba#aaaaaaa#aa#aaaabbaaababbabccbaaaabaabbbggdabbbbcbbbddcbcbdffdcaccccacccd#aaaaaaaaaa#abbbaaaaaaaabbabbabaa#aa####aabaa", "aaaa#aaa##########a###.##aaaaaaa####.##aa#####abccdcaabccffa##########a###aa####aabaaabaa#aaa####a######..###a#####aaa############aa###bdddeeddfgfeeeddcabaaabbbbbbbbbbcdddddeeeecaa####abbaaaa#######a#a########.###aaadaaaa#####aa########.#..##.##a######aaabbba#bbca##a###aaaaaaaaaaaabbaaaabbbaabddcaaaaaaaaabfgdaaabbbabdacdbcbdfffdbbdccbc#cbaa##aaaaaaa#aaaaaababaaaa#abbaaaaa#aaaaaaa#a", "###a#aaaaaaa######accbaaab#####aaaa####a#######accccabacccfe##.############aa####aa###aaa#aa####.#########.##########a############abca##bfcfabbbcaafffffdbbbbbbbbbabbcccdeeedefcaaaaaa##aaaaaaaa################a#.###abbcaa#aa#aaaaa#######....########aa####a#abba#bbbbaaaaaaaaaaaaaaaaaaabcabbbbbbabeedaaaaaaaaacfgecaabbabbacdbabcffffccccdda##aaaaaaaaababaaaaaaabaaaaaaaaaabaabaa##abb####", "a########aaa#######cddebba########aaaaaa#######abccccbabcdefea#.########aaaaabb##aaa#####aaa##.....#.##.##############a#####.#####aabcbaabfc######.afggggcbbbcbcccbbbccceeeeffhgccbaaa#aaabbaa#a######aaa########a#.##aacdba##ab#aabb##.#.####...########aa#####aaaaaaaabbaaaaaaaaaaaaaaaaaaccbabbbbbbabefdaaaaaaaaabeffabaaababdedabbcfffecccddaaaaaaaaababaaaa#aaaabbbaaaaaaaabbaaa#aa##ba###b", "#####aa#####aaaabbaaaacdb.#a#########aaa########abcbbbbbcdeeeefc.######aaaabaacbaaaaa##########..#..#....##############a###########abbbba#bd#a######aabbcfedccdddccccdddeeeeefgiedeebaaaaaabaaaa#aaaaa#aaaa###########aabcca##aabaaabba#....#....##.###.#aaa#######a#abaabbaaaaaaaaaaaaaaaaaaddbbbabaabbbddaaaaaaaa##adfecbbbbacddedbbccdffdccddaaa#aaa#bbaabca##a#aaabbaaaaaaaaaaaabb#aaaa###a#", "####aaba######aa#abbaaaba###aa#############.####aabcabcbbdegfebc.########abbbaaaaaaaaaa#########.....#.#.######.#######aa#####.#.##aaabbbbbc##a#######..##ehfeeeedddcedeffeeeeehf#abcecccbabbbbbaabaaaaaaaa########a###aacdba#aaaabaaaaa#..##..##.#..####aaa##a####aa#aaaabaaaaaaaaaaa#aaaaaabeeccbababbbbbaaaaaaaaaaaabcffbbbbcdccdcbbbcdfgfedcabaaaa##bbababa#####abbaaaaaaaaaaaaaaaa#aaaaaa##", "#a###aabaaaa###ba###ab##ba###a#############..###aaabcaabbdedefgb####aaa###aaaaaaaaabaaaa###########...#.############################aabbbadcaaa#####.######bfhhgggffffffffeeeefhhcaa##acfffeedddbaabaaaabaa########a####abebaaaa#a#a#aa############.###..#aa##a###aba##aaaaba#aaaaaaaaaaaaaaaaccdcdcbbbbabbbaaaaaaaaaaaaacfeaabbbbccdabccbdfffed#aaaaabaaaaaa#aa###aaaaabaaaaaaaaaaaaaaaaaaaaa##", "###aaa#aaaa#a##.a##a#aba#aa###########.#.#....####abcbbbbccdffegb...##aa###abaaaaaaaa#a#aa#######aaa###.####.#####################a##abbcfda#aaa###########.#acfhihhhijiiiihgfhhgcaaaa#..acccddccecccbaaabcb#######aa###abcdbaaaaa#aaa#aa##########.##########aa##aaa#aaaa########aaaaaabaaabbaaababaacbbabbbaaaaaabaaaaa#cefdabbbabbcbbbccdfggeb#aaaaaa###aaa#a###aabbaaaaaaaaa#aaaaaaaaaaaaaa#", "#aaaaaaaaaa##aaaaaaaa#aaaaaa##.###aa###.###...####aabdbbabbcfeced.#########aaaba#aaaaaa##ca#######aaaa######.########.########a#####aaabdhgfeaaaa#############.#aaba#addfghiiiiheb###aaaa###.####bdbcdcdcbbca##a##a##a##aabbdbaa####aaaaaaa#############a#.##aaaaaaaaa##aaa##a#a#acbaabbabbbaaaaaaaabbbbbaabbbaaaabaaaaa#a#bfgebaaababbbbbbbcggfeaaaaaaaaaaaaaaaa####aabaaaba###aaaabaaaaaaaaaaa", "a##ba#abaaaaaaaa####aa###bbaa##.#######b#####.#.###aacbbaabcdeccc##.########aabbba#a##aaa#bba######aaaaa#################.######aa##aabbfhhihdabaa##############aa######.##a#bgfb###aaaaaa########cbacccdfeecaa###aa##a#aaabcdbab##ababaaaaa##########aaa#####aaaaaaaa#a#aaba##aabfdaa#aaaaabbbabaaababdbbbbbbbbbbbbbaaaaaaa#dffcbaabbbbbbbbbcefgdba#abaaaaaaaaa#aa##abbbaaacba##a###aaaaaa##aaa", "aaaaaaaaaaaaaaaaaa#####a##aaaa########ab##.####..###aadccbbacdcaa###.######aabaaabb#aaaa###############aa#####a#####.##############aabbbehhhfcaaaa#####.########aaaa##aaa##a#.#caa####aa##########cdbbbbbcedefdcbbaa##aaaababbdbaaaaaaaaa#aba#########aa######aaaaaa#a#aa##aaa##addbbaaaaa#aaaaabaaaaaaccccdcbbabbbcbaabaaaaa#cfgdbabbbbabbbbbcfgedda#aaaaaaaaaab#a##aabbbaaaba#aa###a#aaaaaa#aa", "aaaaaabaaaaaaaa#accb#########babaa###aaa##.##a##.####abcbccabdeaaab#..######aaaaaaa#####################aaa####a#####.############aaaabdgihgcbaaa################aaaaaaaaa#aa###a######a##########dbaaaaaaaacbcefgfddcccddegdcbdbaabaaaaaaaaaaa######aaa####aaaaaaaaa#############aaaaaaaaaaaacaaaaaaaaabbbbdeccdccbbbbaabaaaaabefecbbbabbbbcbcegededcaabaaaabaaaaaa##aabbbaaaa#aa#aaa#bbaaaaa#a", "a##a#aaaaaa###aa#bbcbaa##aaa#aaaca##abb########a#####aacbbccbdeaaaba#########aaa##a#a####.################ba#########.##..######.bbabaaehhhgbaaaa#################aab#aabaa#aa###a##########a.###.ab#aa#abababbbcbcdcaacecccdefdc##abaaaaa##aa########aaba#aaa#a#aaaaba#a#aa#a##.##abaaaaaaaaabbabbaaaaaaaaaaccbbbcdbbbbaaabbbabbdgfdbbbabcbcccdddeeedcaaaaaaaabaaaaa##aabbaaaaa##aa####aaaaaaa#", "####aaaaaaa######abbcca##aaaaa##abbabba#a#####aaa######aabccedfaaaab#########aaa###.#######################b########.#ba#...##.#acbccccfgggebaaaa##a###############aababaaaa#a##a#a####a##a########c#aaaaaaaabbaaaaabccdebabbbdgeaaabbbaaaaa##a#######aaab##a##aaaaaabaaa###aaaa####ba#a##aaaaaabbaaaaabbaaaaacbbbcbbbcbbaaabbbbcbcfgecbcbbbccddccceddccaaaaaa#bbaaaaaaaaaaaa#aaa##a#aa#a#aa####", "##a###aaaaa#######aaaaaaaaaaaaa#aabbcaaaaa#a###aa########aabeeea###aaa#######aabb#####a######.#######aa##.######aaaabedccbbb##bbbbaabbbbccdeaa##a##a########aaa#####aabbbba#a#aaa#a####a###########caba###ababbbaabbabcdcddcbabehcaaaaaaaaaa############ab##aaaaaaaaaaaaaa#baaaaa###bb#a##aaaabbbbbaaaaabbbaabbbbcccbabbbaaaabbccccbfffcccbccccbccccddeedaab#aaaabaaabaaabaaa###aaa###bb##a#####", "aaaa##aaaaa#aa#######a#abbaaaab######aaaaa#aaaa#aa#######aabdefb#aaa#bc#######abcb#####a#################aa#a..###aabcdfffggfdcbbbbbaaaaaabdeaaa###########aaaa#####aabbbbbaaa#aaa#####aa#a##.#####aaaaaa##abaabcbbbaaabaabbbbcdefaaaabaaaaaa##a######aaa######aaaaa#aaaaaa##aaaa###aa#aaabbbabbaabbaaaaaaaabbbbbacccbaaaaaabbccdccdefegffdccecbccccdeeddcbaaaaaaabbbcbaaabaaaaaa#######aa######", "#aaaa##aaaa#############abaaaaaba##aaaaaaaabaaaaaba#####a##abdgca#aaadeb########bba#####aa#aaaaaa###aaa#ab#aa#.###.#acfhfddgccbaa#aaaaaa#abcfaaaa#######aaabbaaa#####aaaaaaaaa#aaaaa#aaaa##########aaaa#aa##aaa#acccabaaba#a###acdbaaaaaaaaaaa###a##.##aaaa###a###aaaaaaaaa###aaaa#abb#aaaabbbbbbbabaaaaaaaaaacbbbccbbbbaabaaacccccdfdbdfgeefcddabccbcedddccbbaaaaaabbbababbaa#aaaa#a##ab##a####", "##aaaa#############aa#####abaaabda##abaaaababbaaaaba####aa#abbdeaaaaaadf###############a#aaabbbbba#aa#aaaa#baba.#accbffffgddcbbaa#####aa##acfeabaaaaa###aabcdcbba######aaaaaaaaaaaaaaa#aaa##########dbaa########bbdcaab#abaaa##abceaaaa#a#aaaaaa#a###.######a#####aabaabb#aa#####a#bcbaaaaa#aaaabbbbbaaaaaaaaaaccccbccabacaaaabceeeeggdcdfffccccca#bbcbddeccccca#abbbbbbbaaabaaa#a#aaaaab#######", "##aaaa####.##########baaa##aaaaabda#aaaabbaaccbaaaa#####aaaaabbcbbaaabdgfe###aaa#######a##aaabbabbb#a#a#aabdceeedcabcaeddcfhecdb#########aacdhcbccbbbbbbbbdehhedba##aaaabbbbbaaaaaabbaaaaaaa########cba#######a#abbda#aabcbaa##aabceaaa######aaa##aa########aaa##aaaaaa#aaa###.###aabaaa#aaa#aa##abbbaa#baaaaaaabbbbbbdbbabaaaacaddacbbbbddccccbbda#cbbcdcddeccccbaabbbbca#aabaaaaaaaaaaaaa#####", "#aa###a####.##########aa#a##aaabaccaba#aabbaccbaaaaaaaaaaaaaabbccabaabeffeebbcb#.####.#aaabbaabbccccccccdddcec.#aaaaaaadccbbcccca.#######aabdhecdddeeeddeefecbbeedcaaaaabbbbbbabbbbcbbaaaaaaaaaba##aba####a####aacdccaa#ccbbaa##aabcdaa########a##aa########aaaa##aaaaa##aaa#########aaa##aa#aba#aabbbaaaaaa#aaaaaabaaaccbaaaaabccababbbb###bcbcbbecabbccdcddcdcccaaababbbbaaaaaaaa#aaaaaaaaa###", "#aa#aa##########a######a#####aaaaabc#abaaaabbcbbaa#a##aa#baaabbbbbabbcfffgghebdcbbacacbbbbbbbcbccdccfdaaabdedcaaabaaaaacccbbbbbbcb########abcfgedeffeeeegfcbbcbadgdddaabbbbbbbbbbcccccbbaabababbbaacbaa#########abcccbabccbbbaa##aabcb#a#######aa######a#a##abbbbabaa###a#aa########.bbaaa#aaaaaa#aaabbbccbaaaaabbbbbbbaaaaaaaaabbbccccaaa###bcdbabcbbbabcdddcbddccbbaaaabcccabaaaa#aabaaaaaaba#", "#aaaaa#######a####a###aa##.###aaaaabc#abaaabbcbba###aa####a#aaabbbaabcdcdeccdecccccba##aaabbaaaaaa##beaaabacfdeaabdecb#bdcbbbbbbaca#######abcdegeeeeffgfdabbccddeehhhfdbbbddeeccdcccdccbbbbbbcccbcca##a###a########aa#.aceccbbaa#aa#acb###.#####aa#####aba###abcdcbcbaaaaaaa#####a###bc#abaaaa#aaa#ababbbbccbaaaaabbcccbcbaaaaaabccdacccb#a###abddbbbbbbabbcebcbbdcccbbaabbabcabaaaaabcbaaaa#aaa", "aaaaaaaaaaa####aa#####aaaaa.###a#aaaccaaabaabccaa##aa#######aaaaaaaaadc##abaaaaa###a#######a#########cb#aaaacdddb#bbdda#becbbbbbbac#######abceffhffffda##babcccdeeddbddeecdcdebdeeccdddeddcccdeba#b###aa##a#########a###bedbbbbaa#a##aca###.#####aa####aaa####bbcdddbaaaaaaaaa#######adbbabaaa##aaaaaaacbabbccbaabaabbccccaaabbcbdcbcecccaa#a#a#adcabbbbbcbbcbccaabccdcbbbbcacbaabbaabcbaaaabaab", "bdbaaaabbaaaa#aa##a#aba#############abcaabababcba##aa#########aaaaaaabdb##aaaaaa###a##################b####aaccdeaabcbbaaeddbabbbabb#######bdfhghhgda###aabbcccecbbbdcccefdbbcbcb#eefgghggfeegdaa##a###aa#######aaa#####bedcabbaa#####acb##########a##aaaa####acbccccaaabaabbbba####a##dbba#aaaaa##aaaabdababbccbabaabbcddcbacbbccdacdbba#####aaaabcbbbbbbbccbbababbcddcbabbbabaaabcaaabaaacabaa", "aacdbaa##.##a##aa#aa#aba###.#########abca##aabbbca#..###########aaa##aab######aaaa#########aaa#a###aa#######aaccdfbabbaaaeeddbbcbbbdbaa#abcdfhjigca######abccbadb###cfbcbbecabbba#begfhggddcggdbbaaa##############a#aa#.cddccbaaaa#####ab##########aaaaaba####accbbbbaaabaabbbabb#######aba###aaa#aa#aaabcaaaaabccbabbcccdedcbdbbacdcdccaa##a#aaaaabcbbbbbacccbaaaabaccccbaaaaaaaabbbbaaaaababba", "aababbaa#####a##a##a###a####.##########aba###abbbbba####.#.#######a###aab######aa#a#########aaa#####aaaaa#####bbceebbbba#ceedccedcegdcbcddedbcbed#######aabccdbdda##adeeb##abbaaaaacbadeddfdghdcbbbaaa###########abbbcdbbdcbbca##aa#####bd###.#.###aaaaaaaba##abbbbbbbaaaaaaaabbaaa#######aa###aaa#aaaaaabcaabb##abcbbaabcedccdcbaaccccba####a#aaababcbaaaabbccbbaaababccbaa##aa##aaabaaaaaaabaa", "aabaaaaa#a#####a###aa##########..######aaba####aaaabb#.###############aaab##.###a#a#######aaaaaaaaa#a#aa###a##aacdceddfgfcfffgdccdeeefggdbaabbbbdcaa###aaabbcddeb##a#adfeaaaaaaaaa#bbaaccbeedhecbabbaaa#########.adccbcdbdbbcbba#######a#cda########abbaaaba##abbacbbaabaaaaabaaaaaa########aba##aaaaaaaaabcaaa#a##abca#aaabdefecbaadbbbaa##aa#aaaaaabdcbaaaaabcbaa#aaaabbbaaaaaaaaaaaaaaaaaaaaa", "aaabbaaa#########a##aaa###########.##.##aaaa#####aa#cba################abcb.####aaaaaa##aaaabbabaabbbaaa##aaaaaccgghggecdfihhg#a####a#a#abbccccacdcabbbbbacccdfeba#####aaaaaaa###a#ababbccadcgedccbaaa############ccbabccbcacabaa#####a#bacd###.####aaaaaaa###aaabbccaaaaaabbabbaaaa###.##..#bbb###aaaa#aaaaaaa########a#aabccceecbbdbbbbaa#aaaaaabbaadccbaabaabba#####aaaabaabaaa##aaba#aaa#aaa", "aaaa#aa##############bba##########..#.############aaaaaa#####.##########abca..####abaaaaabbbcccbbccddbbabbbbbcdefebdfd##a#.bedaa#########aabbbcbcddddcbbbcdeffd#########aaaaaaaa#aa#baaabcbacegedbbaaa##########bcdbaabbcccbbbaaaaa#####abbcca####.##aaa####aaabbcccdbaaaaaaabaaaaaaaa####.###abba##aaaa#aa##a############aaaa##cfebdcabcb###a##aaaabbabacbaaaaaba#a####aaa#aaaaaaa####aaaaaaaaa", "abbaaaa####a##########aa###################aaa####abaa#a################aabc#.#####aaaabbbcdddcdfffefgffeddfgdcdcb####aaaa###bb#######a##aabacdcddbdccacdefecc#a##a#####aaaaaaaaaa##aaaaabbbabfgdcbaa########aaacbbbbabbbbcdaba##a#####a#abccda####aaaaa#aaa#abaaaccbbbaaaababbaa##aaa#########bbba##abaa#####aa#a##aaa#a###aaa##defdcabbbaa##aa#aaaabbbaaccaaaaab######aaba#aaaaab####abaaaaaaa", "aaabaaa#################abba###############aaaaa##aaaaa#a###############aacaca.#####aabbbbccddfda#adeca#####b###aa#aa#aaaa##aaba#a####aa#aabccdccedebaacccb####aaaa###a###abaaabaaaaa#aaaaaababdgdbb##########cabbdbbbaaaaaccaaaaaaa##aaa##acdc#.#aaaaa##a##aabaa#ccaaabaabbaaacbb##abaa######..abca##aaaa#####aa#aaaaaa######abaabdggcaaa#aaaaaaaaaaacba##bbaaaabba#aa#aaaaa##aaaba###aa#aaaaa#", "#########.#################aaaa#.#.##aaa###aaa##aaa##a##aa###############abbbba#.##.#aabbbbcefc####...#####aa#####aa###aa####aa#######a#aaacbacbbdddbbccdfecbcc###aa####aa#aaaaaa###aaaaaaa##aaacfdaaa#####aaaabbabbbbaaabbabbaaa###aaaaaaa#abce..##ababc####aaaaabdaabbbbbbaaabbbaaa#a##.#######abaa#aaaba##aaaaa#a##aaa###aaa##ababehcaaaa##aaaaaaaadc####abaaaaaba###aaaaaaa###aaaaa#aaa#####", "####a######################aab#....##aacaaa#aabbaaaaa#####a##############aabbbcb##.###abbcceca###################aaaaaa#a#aa##a#aaaaaabaabbbbbacaaabbabaafddcbcb###aaa#aab##aaaa######a#######a##cfeaaa#####abcbbbbaaaaaabbabba###aaaaa#aaaabaaee#.##ddaaa####aaaaacaaabdcbbbbaabaaba#aa##.#######aaaa#aaabaaaaaaa##aaa#a##a#aaaaaaabbcgebbba#aaaaabaabbaba###aaaaabbaaaaaaaa#aaa##aa#a##baa#a##", "####a##aa##################aabda#.#####bcaa#abaabaaaaaa###################aaabcdb.####bbbdea##########.###########aaaaa##aaaaa##aaabbbbcbccbbaaaaaaaabbbaaaacdcbbbaaaaaaaabaa#aaa################abecaa####aadcabcaaaaaaabbaab#####aab#aaaaabaaade#..#ca.#a####abcbbb#abbccaaabbbabbbb#a############aa#aaaaaaaaaacaa##aaa##a#aaaaaacabccfebbbbaaaaabbbbaaba####ababacbaaabaaaa##a#aaaaaa##aaa###", "#####aaaa###.#a######a#######aab##..####abbbbbbbbaaa#aaa####aaaaa##########aabddea.###abda#################a#########a#####aaa###aaabbcdcbdbbaaaaaaaaabbbaaaaacddcbaaaa###abaa######..############abeda###ababbbccbaa#aaaaaabaa##a###ab#aa#aaaaaacec##ab.########babbaaaabbababababbcda###############a#aa###aaabcbbaaaaa###aaaa#ababbcdcdecaabaaababbaaa#######aaabbbbaaaaaabaaaa######a#aaaaa#", "a#######aa#a######aa#a#aaa###aaac#########abddccbbaaaaaaa####aa#aa########.abehghhc##abca##aaa##################################a#aabccb#aabaaaaaabbbaaaaaabaaabbbdba#aa###aaa##################aa#abefccaabbbcbabbaaaa#aaaaaaaa#aa###abaa##aaaabbcfdaba.#a######bacc##aaaabaababaabcbca##.#####a#####a#aaa#####aaaaab##aa##aaaa#aaaabccebbffbaaaaaabcaa###a#####bbbbbbbaaaaabaa#aa######aa#aa#a", "#baa#aaaaa###a#a#aaaaaaa####b#aaba#########aacbdcccaaa##a###aaa#aa##########bbfikjicacc###aa#aaaa#############a###################aaabccca##aaaaaabbaaaaabbbbaa#aabcbbaa####a#################a#aabaabdfbdcccbbbbbbbbaaaaaaaabbaaaaa#a#aaa#aaaaaabbcfdbb#######a#aaac##a#ababaaaabbcdaaaa##########a#aaaa#a#aa##a#aaaaaa#aaaaaaaaaaabbccdcaaegcbaaaaacaa#####a####bbbbbbbaaaabba##a###aaaaaa####", "####aa#aaaa##a#aaaaaaaaa##a#####aba##########aadcbbba####a####a#aa##########abcdfhiigc#a##aaaaaaaa#aa#####################a#######aadccccaba##aa#abaaaabbbcaabaaba#aaaaaa####a###a#a###.#####acbbcbaabcehfdccccbbbbbbbaaaaaaabaaaaaabaaaa###a#aaaabbcddca####.#####aa##aaacbabbbbaabcba#bc############aaa##aa##aaaaa#baaaaaa#aaaaaaaabccdeba#cgfbaaabca#a###aa#a###bcbbbbbbaabbba##b###aaaa#a###", "###a#aaaaa#aa######aaaaaaaa######aaaa#######a##aaaa####.###aaaaa#a###########abacdhiiga##abbaaaaaaaa##############a########a##a##abbcabc#abbaaaaaaaaaaaaaacaaabaa###a###aa###a###aaa########bbbbcbbbbddceihebbcbbbbbabbaaaaaaaa#aaaaaab#a#####aaaabbcccfb#.########aa##abaaaaaaabbaaaabbcbc#####a######ba##aaa###aa###aa##abbaa#aaaabbbdcccbbabdhebcbaaaaa####a#####accbbbbcbaacba#aa###a#aaa###", "#a####a#aaaaa#aaaaaaaaaaaaaa#######aba#######a####ab########aaaa##a#a##.#..#####aehhjihb#abacba#aaaaaa############a#a########aa#aabdcc####abaa##a##aaaaaa#ababa#a##aaaa#######a#aaaaaaaa##aacaabcccbcbabbcghgdbbabbbccba##aaaaaaaaaaaabaaa####aaaabcbcdccaa#########.##aaaaaaaaabababbabaa#######a#a##abbba#a######a###aa#aaaaaabbaabbcdbbbbabbadffbbaaaaaa#a##a####aabcbbbccabbabaaaba##baaaa##", "##aa###a#aaa#a##aaabbaaaaaaaaa##aa###a#############bba#.###aa#aaaaaa#######.####adfehjif###aaaaaaaabbaaa#a########aaa###a######abbbbcca.###a###########a###aa###a#############aaabbbbbaaceb#aaabbbccbaaabbbdggdcbbabbbbaa###aaaaaaaaaaba#aa#a###aabbbbcdc#####aa#######aaaabbbaaabbbbbbba#aa#######a##aabbaa#######aa###aa#aaaaaabbbbbccaaccbbbccdfgedaaaaaaaaaaaa##aaaccbcccbbccba##aa##abaaa##", "########a#aaaaa#aaaaaaaaaaaaa#aa#ba###########a####aaaaa#.##aaaaaaa##a#a########bbceeijfc####bbababaaaaaaa#########aa##a#aaaaabbadcccba####.############aaa#aa#############a##abbabbbaa##ceaaa#aaaabbbaaaaabbdgfbbbbbabba####aaaaaa#aaaaa#####a#aabbbccdccca#aaaa######aaaaababbaaabcabba##ba##a##a#aaaaaaaaa#######a#a##aaaaaaaabbbcccaabbddcaabbabdffdbbbaaa#aa####aabbccbbcbbddbaaa####acbaa#", "#######aa#a#aabbaaaaabaaaaaaaaaa##aa#a#############abaaaa####abb###aaa#a########babcfhiiea###acbbabbaaaaaaaaa####aaba#aaaaa#aaabaccbcbaa###############aaaa###a##############aabaaaaaa####bbbabaaaabbbbaaaabbbcffbbbbbbbbaa##aa##a###aaaa####aa##aabccefcadda##aaaabb#aaaaaaaaaabbbbbbbba##abb######aaaabbba###############aa#aabbcccbabbaabdccccaabacfggccbaaaaaa##a#aabccbbcaabdbacba####bbaaa", "aaa####aaaaaaaaaaaaababaaaaaaaaaaa#aa##############abbbbaaaaa##bbbaaaaaaa######ab#bccehiic###abcaabbbaaaa#aaaaaaaa#aaaaaaaaabcbccacba########.##########aa###############a#aaa#aa#a##a#####acbddcbaaabbbbbaaaabbefcbbbabaaaaaaaa######aaa###aa#####abcdghedcbbbbbcccdcbbaaaaaaaabbbbbbabaa#.acca#a###aaaaaaa########a##a###aaabbcdcaaaaaabbaccddaaaaacaadggfdbaaaaa#aaaaaabccbbaacbaababaaaabbaa", "aaa#a#####aaaaaabaaaabbbaaa#aaaaaaa###aa#######.#a###abbbaabbbbaaaaaaaaaaaa####a##ababchie###aabbbaaaaaa#aaaaa#aaaaaaaaaaaabccccbccb####a#############aa######.###########aa###aa#aaaa#a###abcccdbbbbaaaabbaaaabbceebbaabbaaaaa#########aaa##aa#####acdfdefebcddcbbdffdcbaabbaabbbbbcdbbaaa##abca#####aaaa#a##a#aa####a#a##aabbdedaaaaaa#aaccbeda#aabbaaaacefgfdbaaaa#aaaaabcccbccabaaabbaaaacc#", "##a##aa###aaabbbaaaaabcbaaa#aaaaaaa#a##########a#####aabbaaabaabaaaaaabcccca########aaacfhc##aaabccba#aaaaaabbaaa##abbababbcccbeecba#####a########a####a#a#####.##########b######a##a##aa###aababaaabbaaaaabaaaaaabdfcababbaaaa##############.#######bddcbdeffcbbba##dihdcbaaaaacaabbbdcaaabaa#aba#####aaa######aa##a###aa#abcdccdb#aa###aaaccdcbaaaaaaabbaaabehhebaaaaaaabaccbcbbbaaaaaaaaaaacb", "a##aa#####aaaabbbaaaaaababaaa#abaaa#############.###aaaabcaabaaaabbbbacdedaaaa######a##bccdccaaaaaacdcaaababbbaababbbccbcbbcdcceedc####a##a###########a#aaa######..####.####.###aa######abbaaaabaaaaaaaaaaaaaaaaaaaacfeedbbaa############.######aaaa#abbaaaaccbabaaa###igdccbbbaaaaaaabcbabcbcb##a######a####a#aaaaa####aaaacb#abdcaaa#a###a#acddcbaabaaaaaaaaadfhhedaaabbabbcccbbaaaaaaaaaaaaaa", "ba##a##a#aaaaa#aaabaaaaaaacaabcbaaaa#aa#########.#########aaaaaa##ababdefcab#aa########aabdfgbaaaaaacdcaaabaaaaabbbbabbcbbbcccddaaaa####aa#aa########a#aa#########..##.##..###.###aaba###aaaaa#abaaaaaaa#aa#aaaaaa#aaaegdcbbbaa###########.######aaa##aaaaab#abaaaaaa#.febaaabcccbcbbcbbaaadbcecbaa#####a#aaaaa###aaa#aaaaabaaaabccaaaaaa#aa###adbbbcbbaaaabaaaabbchifbabcccabbccaacbaaa##a#aaba", "#ba########a###aaaaaaa#a#aaa#abaaaaabaa##a#aa###############aab####aaaaabccaaa##a#.#####abcdfb#aaaaaaaaabaabbbcbbbbbababbcdddfedcb#a##aaa#aaaaa###aaaa##aaa##.######.###.###########a#########aaaabbaaaaaaa###aaa##a###bfedcbbaaa############a####a######a#aaabcbbbaaa#gdaaa###bcddcecccca#addefgfddca###a##aaaaaaa##aabaacb####bbdcaaaaaa#aa###ccbbbccbaaaaaaaaabaadhieabaabbccdcbabbaa#####aaa", "#aab####aa###aaaaaaaaaaaaaaaa#aaaaaaa#####aaa#a##.############aa#abaaaaaaabaaaaa########abccdfcaaaaaaabbbaa#abbcbbaacabbbbcddecdcc####aaa#aaaaa#aaaaaaa##aaaa###..######.#####a########aaa#a####aaaaa#aaaaa########aa####dedbbbaaa##############a###a#####ababccbaaaaa#gcaaaa####bdebbbbbca#bddcbaabccaa##a##aa#aaaaaaabbaca####abdbaaaaaaaaaa#a#ccbbbbbbbaaabbaabba#adhgcbaccccccdccba######aaa", "a##aa#a###aaaaaaaaaaaaaaaaaaaaaaaaa#aa###aaaaa###.#############a##abababbaaaaaba######aaabbcddhcaaab##baaababaabaaabbabbbbcdddffeeb###aaabcaaaaaaaa###aaa#aa####.######a#######b#####aaacb#######ababaa#aaa##aa########a#aaeecbbbaa##################a##a##bbaabb#aaaa#cd#aaaaaaaace.aaa#bdccdcaaabcacbaba###aaaaaaaabaabccaa#aaabbd#aaaaaaaaaaa#bcccbbbcbbaaaaaaabbaabbhidbbcccbdeddaaa#aa#aa#a", "aaaa#aaaa##aaaaaaaaaa#aaaaaaaaaaa######aa#aaa####..#########.###aaabbbcbbbaaaaaaba#####aabbcccegcbaaaaaaaacbaabbaaabaaaabcccdeeffddaaaaabcbbbcfffecdcba#abb#############aa#a##acbbcba#bbaa########aabba###a##########aa#aaa#eedccbaaa#####a#a###########aaa#aaa#bcaaaaaafaaaaaaaaacfa##a#aaaba#abaaccbcbbccbaaaaaaabbbbbbaaaa#a#abccc#aaaaabaaaaaadcbbbcbcabbbbaaaaabaaccfjgbccbcccccaa##aabaa#a", "#a#aa#aabbaa#aaaaaa##abaaaaaaaaa##aaabaa##aa#a###.#.##############aabbbcacbaca#aaca#####aabbccdeedbaabbaaaabbabababaaaabbccdddffedffb###bbccefebccbdeda#aaabbaaa#######aaaaa###aabcca#adaaa#####aba#aaaa##aa################.cedcbbbbaaaaaaaaa##a######aa####aa#bbaaaaaadc#aaaaaabbee####abaaa#aa##abaaabbabdcccdcbbaccbcb##aaaaabbcdbaaaaababaaaacbccbbccbaaabbbbaabababadjiedccccbbbaaaa#aa#a#", "aaaaa###aaaa##aaaaa####abaa#aaa#a###aaaa######aa#################a##abbbcccbbbaaabba##.#aabbbbddedd#aacb#aaaaaaaaaaaaabbbccdddggffghecbbaabbbddabaa#aaaabaaa#bbbaaaaa##a##aba###aaabb##bbaa####aaaa###########a########.#####aaeecbaabbaaaaaaaaaaaaaa###aaa##a##aa###aaabeabaaaaaabchca###a#aa#a###a##aa####bca#abdecbcdbaaba#aaabbdcaaaaaaaabbaaaaccbbbccdbabaaabbbabbbabacjkjgfdccbaaaabbaaa##", "#a#aaaa###caa#####aaadb#aaa#aaaa#aaa##aaa###aaaa#a####a##a######a#a##aabbbbabba##aabaa##aaaabacdececaaaba#aaaabaaaa#aaaaccdeeefgeeefbcbbbcbbbcbaaaaaaabaaaaaa##abba##a#####aaa###aaaa##.#ba##.###aa############.##.#############dedcbaabbaaaaaaabaa###a###aa##aa#aaaaaaa#dbbbbbbbaacgg#b####a####a##aaabaaabbcaa#abacdcaaaabaaaaabbccaaaaaaaabbbbcbabcacccccbabbaabbbabcbbaaejklhfcbcbbaaaa#aaaa", "####aaaaa##aaaaabaaaaabbaaa##aaaa###aabbaa###aa#aaaa###aa#######aa#a##bcccaaabbaa#acaa###aaaabbcdcdcbaabaaaaaabaa##aaaabbccdfffghffdaabbaabccddbabaaaaaaaaaaaaaaaaa##a#######a####aaa###.aba######a#################a############bfedbaabbbbbaaaaabaa##a#########abbbba##dcbabbbaaabcgdc#####aabaa###a#bbbbbbbbbbaaabbcbbabbbaaaabbbdebaabbbaabcbbbbacbabbabbbbabbbaababbbbbghillgcbbbbbaabbaaa#", "###aaaaaaccdcaaaaaaba##aaaaa##aabaabaaab########aaaba####a###a##aaaaaabccbba##bbba#bca###aaaaabdcddcda#abaaabaaaaccaaabbbccefgfghffaaaabbaaabefbcbaaaaaaaaaaaabaaaa##aa#########a########aaa###a##############.##.#.############a#abdebabcdcbbcbaabba############acdea#abecbaabbbaabbdfc##aaaa#a#aaa##abbbcaba#adebaecabbaccdcbbabbcbdddbabbbabccccbbacbbbbbabccbbbbbaaaabcbcfijjkjfddcbabdebaaa", "db#bdccbbcb##aabbbbaa###aaabbbbaccaaaabca####.#####baba##a#aaaaa#aba#accbbbbaaaaaaaacbaaaaaaaaacccdccc##abaabbaaabdbabbcccdffffhggbaaaaabdbaaaababbaaaaa#a#a#aaaaba#a#a################aabaaaaa###########.#####...#####.##.####aaaa#bedcccaaaaabbaaaaa##a#####aaaaddaabdebabbbbbabbbbgcaa#a#aaaa###aaabdaddabaadcfdfgdacbaabcbbbcccbdcdffdacdcedccbbbacbbbbcccccbbbbabacabbdgigbbgjjedcbbbccaaa", "#bbbaaaaaabaaabbbea#aaa#abbbbabaaaaaaaaba#############b####aaaaaabaa###abbbbbaaaaaaaacbaaaaaaabbcccccdd##cbcbcaaaaaaabcdeffgggiigabbbbbaabcaaaaaaaaaaaaaa#aaa##aaaaaaa################aaba###baaaa#######.#####....#########.#a##aa##a#adfca###abbaaaaaaa#####a####bdbacfdaaaaaabbaacedfa#aa#########abefeddcccdebccfggfedaaccbacddecdccdeddccefddcccccccabaabbabaabbaabacbbhijgdbacfkjeedcba#a#", "###aaaaa#abbaaaaaaa#a####bcaaaba###a#aaaa######a####aa######aaababaaaa##aabbaaaaaaaaabcaabbaaaaabcbccccbcbaaaaababbcccdefgfgghkgbaabbcbccbaaaaaabaaaaaaaa#aaaa#aaaaaaaaa####a########aaabba#aaaa#####a#.###.######.#####.####.##a#abaaa#aaddaaabbaaaaaaaa#########aabgggfbaaaaaabbbabbcfea#a#####aa##afghhfggghhgccddffhfffcccbccdfgeeeceec#aabcddcdddccebaaabaaabaaacbbbb#ejhjgbbceceikibbceba#", "aaa##a#aabbabbaaaaaaab####bc#aaaa#aaaaaa#ab##aaaa##a#aa######aa#baaaaaaaaaaaaaaaa#aaaaacbaabaaaabbcccccdbaaaabbbbccddeeefeegjheb#a#aabaccdcaaaaaaabbabaa#aa##aaaaaaaaaaaa#######a###aaaabba#abaa####..###.###.####..#####.#######aa##ba#####bcbaaabbaaaaaa########abdfggebabaaaaaabbbbbchfaaa######abbfegggefgghgffeecefggfhheecdddeeefdcefcabaabccbaabcbcbaaaaaaabbabbbbbbfghggdbcbcbbgkjfbbecb", "#aa#a###aababbbaaaaaaac###.acaaaba#aba####ac#aba###aaaaaaa#aa##a#a########aaaaa#aaaaabbbbbaabbaaabbbccccebaaaabbccddddedegggfhbaaa##aaabcccaaa#aaabbbbcbaaa#####aaaaaa#aaaaa#####a###aaaaaabbdaaa########...##.###..########.#####aa#aba###a#accbaaaaaaa#######aaaaabccdeeccbbaabaabbbbegfgeca#####adefffefgggfghggfeeccegihijigedbccfeceddfeaaabcacbbaaabbaaabaaaabbbbbcbchgghfgdabbaa#bgkjgcdd", "d#a#a####aaaabbbabaaaaaa####abaabaaaaaaa###acdbaa#a###aaaaaaaa###########aa#a####aaa#abbbbbaabaaaaaabcbccdaaaaabccddeefefhgefgbaaaaaaabaabbaa##ababbaaabcca#aa#aaaaaa##aabaaa####a####aacba#bcb#aa#.####.#...##.##..################a########a#adbaaaabaa#aa##aaaaabbbcdeddddcbabebbcbbffeefdec##adeeefeffefghgghghhgfedfheabfghhfdcegecbbbbccaaaabcaaaaaabaaabaabbbbabbcdfffgffffabbbbbcabgkjec", "cdaa##aa#aaababbbaabbaaaa####bbabcaaaaaaa##.acaaaaaaaa#aaaaa#ba###########aaa#a###aaaababbaabaaaaaaaabcccdgbbbccccddeffefgfeffbaa###a#aaaaaa#aaaaaaabbbccaaabaaaaa##a###aaabfd#####aaaabbaba#aa########.###.##.###############################bacedcbbbbabaaaaaaaaabcccccddedddbbdeecdefeededdeeffdegffeddefgfgggggcb##abbca###bbefeefeddcdcbeeaaaaab#a###babbbbbababcbccfgfeeefegcbaaabbca#afkh", "gdcbaaaaaabbbaaabaaabbbbaaa###bbcbaa#aaaa#####a###aaaaaa#aaa#aaaaa##a#####a#aa#aa#a#aaaabbaaacaaabaaaabccdfgddddddccdfhhffddfbaaa####aaaaaaa##a#aaaaaabbdb#aaaaba#a#######aacegdbaa#aaabaabbb########.#.##.##..#...####.#######################babedededcbaaaaaaaaabccddeedefecfffeeffddddddeddeeeddeggfddeeffbaaaaaaaabdb#baa#a##cbdfeaaabbcdfbaaaaa####a##abbbbaabbbbdcgfgeeedeefabba#aaaaaabg", "gjgccbaaaaabbbbbbbbaacbaaaaa###aaaaaaaaaaa####aaa#####aaa##aaa#a#a#######aaaaaa##aaaaaaaabba#acaacbaaa#acccfgdefefcdecfhhddbcaaa#a#####aaa#aa###aaaaaaabbeebaaaaaaa####.###aaacdcbaaaa#aaabba#############.#.#.#...###########..###############aacddeeededceeedccefggfgggfedggghfdfecdddccccddeeeeefddfffddddbabbbaaaaabefcdb#aa##aaabcaaaaa#bdgb#abaa#######ba#bbaabaaeegfgfeeeecfcaaa#aa#aaaa#", "#bgifcbaaabbbcbbbbaabbbaba#a#aa##aaaaaaaa######aaaa##a#aabaaaaaaaaabaaaba##aaba###aaaaaaaaabbabbabaa#a#abcceffeecb#cddeeggcdb##a##aa##aa#########aaaaaaa#bedaaaaaa##########abaa#aaaaaa#aaabaa#####a####################..######.#a##.#########aabcccbcda##afgggffdbbbabdhheghifedddeecbccdcdefffeeffdfggfdbaaaaa#aababbacdddb#bb#aaa#a####ababbdebbbaaa####a#babbaaacddfgffeefeeddcbabbaaaa#aaa", "a##ehiecbbbccdccbbbbaabbaaa#aaa##aabaaaaaaa####aaaa#####aaba#aabcbbbaabbba##abaaa######aa#abbacbaaaaaaaaabcccdfcaa##bbbbceabaa######aa##a##aa####aaaaaaaa#abaaaaaa###a######abbbaba##aaa#a####aaa###a############.########################a####aa#dcddcdb#a#dedeedcaa#baacgegiifedddddddcdddefeffggfgeedbba#aaaabbaabaaaaabceebbdaaaaa######aaaaabdddb#aaaaaabacbbbaabdfffgfgfeeeeddgcbaaaaa####", "#b##adiifdbcefedccccbaabaaaa#aaaaaaaaaaaaaaaa##abaa######aabbaabbcbbaaaaaaa#abaaa#######aaaaabcca#aaa##aaaabbccc#########a###aa##a###aa########aaa##aaa#aaa#aa#aba##a#######aabbabcaa#ababbca##aa####a#####a.#########################a###a##acba.ddeecccba#cfeeedcaaaaabccbaigfeeeddddcbcdcddfeffggeedaabaaaabaaabbabaaaaa##cffedeaa#a#aaa#aaaaaa#abfebabaaaaaacadcaaffecffffgfffeeggaaabaa####", "#caaa#.ahjgffefgggffecbbbabaaaaaaaa#aaaaaaaaababaa#aa#a#aaaabaaaacccaaaaaa#a#aaabaa######aaababaaaaaaaaa#aaaabccb####aaa##ab###aa#####a#a####.#aabaaaa########a##aba########acbbaaaaaaaaaabbbaaa################a###a####aa############aaccb#adcbbdddccbcdebdedccba#a#aabdcbaggeeddedcbbbccdeeffffhggfcbaaaabbbcaabaaaba####a#debceea#aaabaaaaaba#aaa#cfgcaa##aabcbcbdffedfeeeefefeedhcaaaa#a###", "####aa##.behhgfeeeddefedbbbbaaabaaaaabaaaaaaaabaaaa#aaaa#a#abbaaabbcbbaaaaaaaaaaaba####aa#aaabaaaa##a#aa#a#aaabbcc.##ab##aabca##aaaa############aabaaaaa#a#a#####aaa#bb#.####bccbaa##aaaa###aaaaa######a#######bbabba####bb###a#a###a###bcccccdcdccddcbbabcdcddccba####bdddb#bdcecdedcbbbbbcceeeeehhcdaaaababcbcaaaaabaaa#####ab#aabb###bb##abcaa###a##adfeba###aabaaefefffedddeedefefhbaaa###.#", "#####aaaa###chikjiigedcegcccbabbaaaaaabbaaaaabaa#aaa#a#a##aaaaaaaaabaa#aaaaaaabbbaa######aaaaabaaaaaa##aaba##aaabab.###aaaaaabaa#aa#a#############a###aaba########aa#cbb####abcbaaa##aaa#a######a#.####aa###bbccbbdccbaaabb###a#aaaaa###cbbbaccccbbcccaaaabbccccbbaaa#accdcb##bacgeeedccccbccdeeefggebdaaaaabbbbbbaaabaa#####a#a#aa#####aaaa##ca#####a####beeca#b#abadgefffedeedfdcffeff#a#a###.", "..######a#aaadd#acdhihecdgecbcaa#aa####ba#aaa##aa##aaa###aaaaaaa##ababaaa#aaaaabbbaa######aaaaaaaabaaaa##baa##a#a#b######aaaaaaaaa#################a#aa#bcb#####aba##a######bbbcbaabcaa#################a#abcdbdefededcbcbaa##aaa#a###bcbababbccbbbbbcaaaaabcccbaabaaaabcdbba###bhhfhgeddccbccddfhhhfbbaaaaaabbbccaaaabaa####aa#a#####b####aa#aa#ab###a##aaabefd#a#abbfgfeeeeeedeeddefggbaaa####", "##.######aaba#abaaaabeiiebceddcbaaaaa###aaba#########a##aaaaaaaa###aaaaaaaaabaabbbbaaa###aaaaabbbaaabbaaaaa###a###bb#####aa###########a######a#####aa#baaaba##abcedcbaa##a##bcccbaaaddccaa##############a##bbceffgfededdedcbaa#a#aaa#bcabaaabbbccbbbbbbaaaabbcbbbbaaaaabbcda#a##ehgfeeeeecddbcddfhhgcbbbbbbaaaabcbbbaaaaa###.#a#a#a####aaa###aa##a########aabbbedbacfegggfeeefeddccddgihdaaa####", "##.###a####aaaa#bacbaa#chidccdfdbbabaaa#ababaaa###a###aa#aaaaaaaaaba#aaaabccccbcccccabb###aabaabbbcbaabaa########aaab.####aaa##################a####b##aaaabb#aacdddcbb#######bccaaaabdbba#####aa#a#########abccccccddcffhigcbaaa#aa#acaabaabbbbaaabbbbbaaaabbbbaaaaaabcccdda#a#higheddefedeecdffffeeaaabbbbaaabcbaabaaaa#########a####aaaa######a#######aaabdcbadgfdeddegfgfeedcccccehigaaa####", "###########aa#####aacdb##ejgcbbfedcaaaaaacbabaa#####aaaa#aaaaaaaaaaa##abbbbbbaaabbcddddbccdcccbababaaaaaab#########aba..####aa###################aa########aa##aaaabbbba##a####ccaababdaa#aa#####aa##########aaaaabbccdfgjjihdcaa#aaaacbaabbababbaabbbabaabbbbbbbbbbbbbcccddebadhggfffeeffffeeeffdccddaaaabaaabbabbbbaaaa######..######aaaaaa#a###a#aaa###aaaccc#ceggedddcffffedcbabccdfgebaa###", "#########aabaaa####a#aabbachjgbacdedcccbabaaaaaaa#####aa#######aaaaaa#aaaaaaabaaaabbccdccddcbbbabaaaaaabbaa########aabb.#######a##################aaa##########aa##abaaaaa######bbaaaaba#a#a#.##.#a#aa###aa###aaaaaabcddgijijjigeba#abdcbbcdcabbbbaabbabaaabbbbaaabbbbbcacddee#dfeeeffeccdghhfffebccccaaaaababbbbaaabba#a########.###a##aaaa##aa##aaaaa####aababbddceggfedcdffedcbaabcdeeffaaaa#", "#######a#aaaaaa#a#####aaaabcdiibaaacecddcbaaaaaaaaaa##aaa########a#aa###aaaaaaaaaaaaabcccbbaaaaaaaaabaabbaaa######aaaaca.###.##a#a####a########aaaaaaa##...###a###a##a#aaaa#####bdaaaaaa########a########a##a##aaaaabbbbegfeedeghgeccddeeefgcbbaaaabbbbaaaabbbaababbbbcccbceeebegdddeffedbdeiihecbcbdbaabaaababcbbaaabaaa#a#.############aaaa##b#a##aaaaa##aabbbbccdceghgeddefedcaaaaccdedfaaaa#", "########bcaaaaa##########aaaa#gidaaabedcccbbbaabdbaa####aba#a#############aaaa###aaaaaaacbbaaaaabbabbbbbcbbabaa######aabb..##.####aa#aaa######aaaaaaa####a#.####aa##ba#aaaba#####dbaaaaa######aaa#aa######aa###aaa#aaabccebabaabbdfhhhgfghggdbaaabbcaaabbaaabaaaaaaabccccccedchigdcdddcedccabghdbaaabcaaabaaaaabbbbcbbaa##a########a##.#aaaaaaaaa#aaaaaaaca#acbbbbbcccdefeddeecdcbaababcfdfeaa##", "########baaaaba#aaaa#####a####aciib#aacdddbabbaabbb#aa#####aa#############aaaa##aaaabaaaabaa##aabababbbbccbbbcb#######aaaa#...##.#####aa########aaaaa######a############a#aaaab##abbaaaa#######cb############aa#aa#aaaaabaaa#######bfhigihhfbaabaaaaaabaaaabbaaaabaaaccbccdcchiihhdbcddcddccbbeeaaaabbbaaaababaabbbeeeaa#####.###.aaaa#aaaaaa#aaa#aaaaaa#bbadccbbbbccccbcddddcbcccbaaaaddddge###", "########a##abbaaa#########a#aaabcfjhaaabcdecaabaaaaaaa#######a########a#aa#abaa#####aaabaabaa##ba#abbccbaccaaca########abcb..######################aa###ceb#######aaa#####a#aaa###acaa#aa#######b############a#a##aaaaaabaa########abacfhhfcbbaaaabaaabaaaaccaaaaaaaacbcbbcffgfgcegeddeddcdccbcd#aaababbbaaababcaabaaccba########a#abaa##aaaa##aaaaaaaaaababcbbbaccbbcbccdddcbbbcbbcbbadcdeehd##", "########bb####aaba#########a####aabfjfbbcbcfdbabaaaaaaba######aa######aaaaaaaaa##a#####aaa######aaaabacbbaaabaa#########aadc...#######.##########aaaaaa#ddeb#a####aaaabeb######a###bbaaaa##b####aa#.##########a#a#a#aaaabaaa##b###.adbaabeecbaaaaaababaaaaabcabaaaabbbbbcdcfgeddgbbggeedddcccccc####aabaaaaabbaabaaa#acda############aaaaaa#aaabaaaaaaaaaabcbabbbabcbbbbcddccbcbbbabbbbccdfggf#a", "aaaa####bc##a#aaaaaaa###.#####.####aciiecccbceebaabbabbb######a#a####a##aaaaaaa########aaa#######aaabcbbabbaaaaa#########acfc..####.#.###.###aa###a#a#aaabcaaaa###aaaa##########a##bdcaaaa#ba###baa##########aaa####aaa#bbababdcbaacbbbaaaabbaaa##aaaaaaa#aabbbaaabbbbbbcdcccddcdec#adfedddcccbe#####aaaaaaaaaabbbaaa#bdb##.#######.####aaaaa###aaaaa##aaabccbbbaababbbbbcdccccbcbbbcbbbdcefghc#", "########a#####aa#bbaaaba######...####adhifegfddfdcabccbaa###aaaaaaa######aaaa##aa##a###b##########aa#aaaaaabaaa######a###abdfb..#######.##.#####aaa#a###baaa####aaa#########a####a#bddcbaaaa####aaaa####ad##aaaaaa#######abadddccccdcba##a#ababa###aaaaaaaaabaaabbbbbcbbcbbccdccbaba##afedddccbfa######a#aaaaaabbabaaaaab#####.##..#..a###aaaaa#aabbaaaaaabcccbbbabbbbbbbbddccbbcbbbcbbcfdeeffha", "##############aababaaaa##########.##.#..chjjhjifffdeccdbaa#aaa###aa#####.##aa#######.#######a#########aaaaaaaaaac########acchc.....#..###########aa##aa#abaaa##aba##a######aaaa##a##bdcbaaaa#####a#aa###bd###aaaa#aa##a####adgdcbbcddbb###aaa#a#####aaa##aaa##abbaabbbbcbbbcccddeccc#a#bhggfedaec##########aa#aaababaaaaaa#####.##.##.####aaaaaaaaaaaaaaaabdcbbbababbabbbabddcbbbbbbccbbdifdefge", "a###a##########abb#aaab#a#######...#####.##a#acgkigfeefdcaaa##aa#aaba####..######.#a###a#aa#aa##.#######aaaaaa##ba#####aaabbeha...###.###.#######a##aaa#aaa#a#aaaa###aa#a###aa###a###cdcaaa######a#####abb####aaaaa####a####deebbbccdbba##aaa#aa####aabaa#a#aabbbaaaaabcbcbbccbcedbba###cdffffeefba###########aaaaaabcaba#####.####.#######a#aaaaaaaaaaaaacdccabbababbabbaabcccbbbbbbbccdeeedefh", "f#######aa##a##aaa#aa#bba#########..############afkjgfgfeeeba#aaa##a#######.####.#.#####abbbaa##########aaaa##a#a#######abbcdhe#...######.##a####aa#a###aa#a#aaaaa######aaa###########bdbbaaa####a######aa##.##aaab####aabdecdcbaabbbaba##aaa#########abaaa##abbbaaaaabbbcdbaccbcebaa####adghfedeeba#############aaaaabbcb##########.######aa#aaaaaaa###bcdccbbabbbacbaabbbbbbdcccbbbbbcccccddeh", "hc#####aa######aa####aaaa#####a###.......##aa##a###gijhhhggeb##baaaa####...#####.#..a###acccaaa##########aa#####aaa####aacdddhf#..###.#..####aaaaaaaaaa###a#aa#aaaaa#####aabb##########cecaaa####a##############aabb##aabacddbcbbabbbaaaaaaaa##a#######baaaaa#abbaaa#abbbabcbbbcdgd####a##adcgfecdeb######a########aaaa#baaba########.######aaaaabbbbbbcbccbbbbbbbbbaaaaabbbbbbccbcbbbbcccccdeed", "egb##baaaaa####a##aa#aaa#a#######.#..###.###########adfilkhfca#abaaa#####..##....#....###bbccaa##a##aa####aaaaa##a##a##abbcfhjfb#..#####.######aaaaaaa######aa##a#abbbba###aba#aa#######cecaaaa###a#.#######aa##aa#aa###aaabcbcbbcbbaaabb##aaaaa#######abaaaaaabbaaa#abbbbbabbabdfeaaaa##a#ca#eecccfcaaaaaaaaa#a#a######aaaaabca########a####aaaabababbbbbbbbbbbbbbbaaaaaaabababccccbcccdccbdffd", "cfhd#acaaaa##a#######a#a##a###a##.....######.##########bddjkidca#########..###....######acaacbbb#a###ab##aaaaaaaaaaaaa#aabcfgejfa#.###a######a##aaaa#aaa#a###aa##a#abbcba#####aa####a###aeedbaaa##aa####...#aaaa#bcaccbaaaabcdccabcbbbaaca#aaaaa#########aaaaaaabaaaaabbbbbbbaaabbecbbcaaaaaa#adecccedcaaaaaaaaa##a###########abaa######a####aaaabdbbbbbbbaabbbbbabbaaaaaaaabbaabccbccbccdccdefg", "fedfea#a####a##a#a#######a####a#.##..#.####...########aaaaaeikhea#####################aaacbabbdfdbbaa#aaabbcbbaabaaaaaaabcdfbbeica..#a########aabaaaaaba#a###aa#######aaa#####aaa#.aa###adffdbaaa##ca####.#########abbcdeeeefcdcbabbbbbaacbbaaaaaa##a##a##baa##aa###aaaabbabbaabaadfb#bbbbbaa###feccbeecbbabaabaaaaaaa#aa###a####a########a##aaaaabbbbbbcbabbaaaaaabbbaaaaaaabbbabccccccddddeeee", "fggehdaaa######a##########aaaaa#.##.####..#..##.#######aabbaadjljgda.#################aaaccbccddcccccccccccccdcbbccbcbaabbcfdcbgf#...#aa######abcbaaaaabaaaaa############.##aa##a########dffedcbaa#cc##########a####bbbbcdffeedaaabbbbbcbabbaaaaaaa#######abaaaaaaaaaaaabbabbaa#a#bdcbbbaaaaa###cfeeehhecabbbbbbaaaaaa##aaa##a###a########aa#aaaa#bbcbbbabbbbaaaaabbbbbabaaaaaaaabbbbbcccddddeee", "edehhg#aaa######a#a#####a##abbaa###.###################aaabbcaacjllkhbaa#######a######bbaefddddcbbbaaaababefeedddccffdccdfgeeeefec#...#ab#.####abccbbba#aaaaaa###########..###a##########bfdfdccaaacfb.######aababaaaccccbdffebbbbcbbaacccbabbabaaaa######aaaaaaaaab#aaabaaaabaaaabbeffcaaaa####aeeeefiihfcabbbbbbabaaaaaaaa##a######aaaa####abbabbabcbaaaaccbbbbbbbbcbcaaaaaaaaaaaacbbcdddddede", "eefgghcaa#######a##aa######abbbcc#.############.###a#aaaaaaaaccbafjllkjecbaaaaaaaa##aabcccgefeecccbba#aaaa.acffffffcacdccbbbfffefda#.##########aabcedba##aa#a#####a#####..#####aa###.####bceecccbaabdfa##aabbbaabbbbdcbbccdcceebabbbaaabcdcbbbbbaaaa######a##aaaaaaacaaaaabbaba###acdeegcbbb#####aeffgfgijkgcbbbbbbbbabbaaaaa##a#aaa#abaaaa##aacdbabbccbaaa#bbbbaabaabccbaaaabbaaaaabbbccdeedddd", "deeffdfd#####a######a#######aaaca#a############bdca###aca##aaaceddfijjnligdcbbcbaaaaabcddchgedddbccaaa#aaaaa##accfbbbaa####bdhfedhd#.###########bbcccdba###aaa#####a##a#.#####a####.####.#abedebdcbbcfe#####adcbcddbbdbaaacbcbccbbbaaa#bbcbbbbbbaba#a############aaaaaaaaaabaaaaaaabdfcccbbba#####aceffgiijihedccbbbbbabbaaaaaaaaaaaaaaaaa#####aabaaabbbaaaaaabbaabbbbbcabaaaaaaaaabbbbcccdddddd", "ddddecbdca###a###a##baa#aa##abaaba#a###.#####.#aabaaa#aaa##aa#acdhilmklmlmkheegecbbbbccbcefgedcdcbbbbaaaaa#aba#a#cdabcbaaa#achihggfa############abdb#bcaa##aaa#########a###.######..########beddecbcdffc###.#acdfffdabcca#aabacbbbbbaa#abbbbbbbbbaa#############a#aaa#baaaaaba###aaadfd#babacababbbcegfhhiihgfdddcccbbbaabbaaaaaaaaaaba#aaa###a#aaaaaaaaaaaabbabbaabaaabcbbbaaaaaaababbccdddddcd", "deddddcacaba###a####aaaaaa#aaaa#aaa###aa#########a##aa#aaa##aba#.cfehhjkjllmllihfedcccbbdefgdcccecbbbccbaaaaaaaaabdbbbcbaaaabhjjhggea#.####a##a#accaa#cdaa#aaa#.#############a##a##.###a####.cedccccefbbaa#####deffeaacdaaaa#aabbbbbaaaaaabbaaabbaba#####a.###a###a#a#aaaaaaa#a##aaacdecaaaabaa#aa#bdgfeeefhhfdccccddcbbaaababaaa##aaaaaaaaa###aaaaaaaaaaaaaaaabbaaababbbbabbbaaaaaabbbbcdcdccdd", "dddcccdbbbcba#bb#aa###aa##a##a####a##.####aaa##a#aa##a#a#ba######.fffkjlhkkljmmmlieeddccefaeeeccdedbcdccbcbaaaaaabaccbccaaaabeijjigieba.#######aacbaa#accaaaaa##########a#a###aaa#############decabdeeeaba###..adeddcaabcbba##aabbbaaaaaaaaaaaaaaaaa#####a###########aa#abaaaa##a#abbcdeba#b#aa#####cefedcbbdeedcccdddcbbbaabbaaaaaaaaaaabaaa###aaaa#aaaaa###aaaaaaaaaabbbaabbcbaaaaaabcccccccdd", "ddccbcccbcedaddaaaaaaaaaa#aa#a######...###########aaaaaaaaaa####..cfhjjkmlmklkklmnjfeedeefebdeddegheeedddccbbbaaabbccbcbbaabbbgjkjjhifda.#######aaaaa###abaaaa####aaa###########aa##########..adccaddcecbabbaa##dedddcbabcbca#aaaabbaaaaaaaaaaaaaaaaaa###############aabaa##a####aacbcddebaaa########cffecdcbceeefdddddcbbbaabbbaaaabaaaaaaaaaa###aaa#a#aaaaaaaaaaaaaaaabbbaaaacbbaaabbbbcdcdccb", "cdcccccbbcdbaacbbbbbbaaa#aa#aaaa#####..#..##.#####a#aaa####aa######eigfcfgijjjlmmmmnlhfhiggdddeefgegfgffdeddcdcbaaccccbcbaaabbcfjkkkijgfb#######a#aa######a#############a###aaaaaba############abcc#ddcccbdecdcaddddddecbbbccaa###aabaaabaaaaaa#aaa#########.####a##a##a#aa#a######abccdgbb#ba#a######cffgfdefffehgdddeccccbaabbbaaabbabaaaaaaaaa###aa##aaaaaaaaaaaaaaaaaaaaaaaabbba#aabbacddccc", "cddcccbbcccaabbabaacbaaaaa#aa#aa#.#...#...#..###a###a#########aa##adeaaa#abedefijlkmnnlkkjdddfdcebb#degfaefgfeddcbdcddbacbbbbbbdjjklkkihgc#aa#####aa################aaa##a#aaabaaaaa###########aabdbedcabdddeeddddedcccddccbbbca###aaaaabba#a#####a#a###aaa###.###a#######aaaaa###aabbbbcdaaabaa##a####aeghhhggghhhfedddcccccbbbbbbbbbbbbbbaaaaaa####aaba#aca#aaaaaaaaaaaaaaaaaaaaabaaaaabbbcddd", "dddcccbbdedaabdaaaabbabbbbaaaaaa#.##.##.#.#####################aaaddbbaa#aa##a##aceejnllkkhfhfccfbbaaaabafabdeffgfcdddcabbbbabacgjkkllkhjhbaa#####aa############a##aaaa###aaa#aa#a#####.####a##aa#deedcabdeeeedeeddeedbccdcccdcb####aaabbbaaa#####a##a##a####################aa####aabbbcdea##a########aaabehiiiiiihfedfdccccccbacbbabbbcbbbbaaaaaaaa##ab##bbaaaaaaaaaabaaaaaaaabbbaaaaaabbbbbdd", "ddccdbcbedcaabbbbaaaaaabbababbaa#################a##########a###a#ecbaababaaaa#####abkllllljgbaaccbababbabaaaa#cedfheedcabbbbbbbchkkkklkhggeba###aba####.####a####a##aa##aaaaaaa##aa####.####a####dfdcba#bdeeeeeefedddcbbcdbbadcba###abaaacaaa###a##a###aa#####.####a######.##a####abbbbccbbc#ab##a#aa#ca###cfggihhihffffedcccccbbabccccdccbbbaaaaaaa#aa#aa#aaababaaabbaaaaaaaaaaaaaa#aa#abbcccc", "dedcccbcecaaacbababbbaabbbbbcbaaa#..###.#########a##############.cdabbbbbbbba###aabcddilmmljeaaabcbbbbbbbbbbbabaabcefgfecbbbbbbcdfjjkkkmkhfgecbaaabb########a######aaaaa####aaa###################befcbaabbadfeeeeffededcbbccabccccaa#aaa#abaa#######a########...###########.##..###abbbbcbbf#aa###abaa#a#####acfgffgfggefddcccccbbabcecbbbcbbaaaaaaaa##aa#aaaaababbbabbbbbcbbabaaaaa##aaaaabbcc", "cddecccccdcaaaaaabbbbaaaabbbbaaaa########.####################..aaababaaacbba#abddbcdfeejmllf#aabbbaabbbbbbaaaaaaa#afffdedcbbbddffjfijjkkkhgfed####aba#######a####aaaa#aa#####a######a############adffddcaa#befefedeeddccccbcbaacbaabbaa###aba####a###############.###########.######aabcddcefbb###bbaaaaaabba#cffffghhgfffedccccccbcbbebbbbbbbaaaaaaaa####aaba#aaaabbbbbbcbaaaaabbcbaaaaaaaabcc", "dddddfebdfeba##aaaaaaabbbbabaaaa####.#########################.abbaaaaaaaaabbaaabba##aceeilmme#aaaaaaaabbbbaaaaabbbbbefgeddcddddegiighiiggjggfdba##aaaa##############ba#b###aaaa#######a##a#aaa####dfgffgcaabefeeededccccdddcbbbbbaaacbab###aaaaaa########a#a########.#########..####aaabdcdecbdc#aa###aabbcccaacegggfgghggfeeeddddcccbccbbbbaaaaaaaaaaba#aaaabaaaaaaaaaaaaaaaaaaabbaaaaabbabbbc", "bcdeeeeedeeda##aaaaaaaccbbaaaaaaa####..##.#########a##########aaaaaaaaaaaaababba#aa####abbdhkmgbbbaaaaabbabaaaaababbbaehfcdeeeegghkkjjigdeehfeccaaaabcba########a####aaa#####aa####a####aa###baba##adfgfffdeeffdcddddddbcccdccbbbbbbb##bdb###aadb#a##############.##.######.##########abcdcedecegdb#a#aaabbcddaa#adfghfghgffefeefeeddcccccbbcbaaaaaaaaaaa#aa###aaaaaa#aaaab##aaaabbbabaaaabaaabb", "cbceeeefffffd#aaaaaaaaaddbaaaaaaaa#############.#############cbbaabaaaaaaabaaaaaaaaa###aaa#achlkigdaabbabbbbaabcaacaababccdbbdedcdfehkkjgeceheccda#aabbba###.######a#aaa#####aa######.#a#aa##aa#aa##adgggfeeggffdcccddcccbbcbccbbbaaa####ca##abcba#aa##########.#####a######.#.#######abbcbddbdfhgeaaa##abbcdcaaa##aaceghdfgffffffeeddddcccbbbaaaaaaaaaaaa##aa#aaaaaaaaaaab##a#baabbabbbaaaababb", "ccddefgfefffd#a##aaaaaabccbabaabaaa##########...############acbaabaabaaaaaaa#aaa#aabaaaa#aaaabgkjiifbabbabbaaaabaaabbabaaaaaaabcc#####cgkmjgfhfcbcaaaabcbaa########a#aa###a###########.####a######aa##bghfefgeddeccbbbccccccbcdcaaa#a##a#aa#a#aaaacbaa##.############aa########.#######bbbccddddggfbaa###abbcbaaaa#aaabeeeeggghgggffeedcccbbbbbcbaaaaaaaaaa###aaaba#aaaabbaa#a#abbbbbbabdbbaaaab", "bcceddefhgfcbaa#a#aaa###aaabbbaaaaa#######################aababaaaaa#aaaaaaaaaaa#aaaaaaaa#aa###cefllgabaaaaabbbaaaaabaaabbabaaa#ba######bfjljhghcac##aaacaa########a###############aa#.##a#############afgfgfedcccccbbccccccddcccaa##a####aa#aaaaaabaa#################a#a##.#########aaabccccddeegfbaa###abbaaa#aaaaaabdfceghhhhhhgfedddcbbbbbbbbaaaaaaaaaa###a##aaaaaaabbbaaacbbabbbbbcccdaaaa", "bbcccdefhiea###a##aaa######aaaa#aacb##############a####aaabcbbabbaaaaabaaaaaaaaa##a#aaabaaaaaaaaabekljbaaabbaabaabaaaaaaaabbaaaa#a#aa#####aekkhhiba###aabbbb#####a.#########a#a#####a#######aa####.#aba##gggfeedccbbbbbbcbaabccbcbaa##a###aa##abaaa#aa###..###########.###a##.#######aaaabbbcdddcefgaaaaa##abaabaaaabbaabdeffghighhgfffeeccbababbbbbaaaaa#aaaa#a####aaaaaabbaabbbbbbbcccbcccdbaa", "bcccccdefgeaaaaaaaaa#a#a#a##aaa#a#aba#######a#.###aa######bcaaaaaaaaaaabaaaaaaaa###aaaaaabbaa#aaabbchkkc#aaaaaaaaaaaaaaaaaaaaa#a#aaa#a#######dkklibca#aaabcdca#a#aa#################a######aaaa######aab#cghhgfddcbbbbaabaaaaabbca##a##abaaa##abaaba#a#aa############...##.###.#..####aaacbbcdccdcdedbaaa#a#acbaaa#aaaaaaabcffffghhhfggfeddbcbbbaaaabbaaaaaaaaaaa#aa#aa#aaabbbcccbbbbbbbbbbcdccb", "bbbccccdfcec##aaaaaa####a####aa#aa#aca##a####baa#######a##bbbaaaaaaaabbbbbaaaa#aaaa##aaaaabbba#aaaaaadijgaabaabbaaaaaa###aaaaaaaaaaaaaa#######behlidcdbaaabbcecaa######a###aaa###########a####a#######aaacghihgfedcbaaaaaaaaaababbbaa###aaa####a#aba##a#a#####..######......#...#.#.####aaccbcccdcdehhdaa####bcba###aaaaaaabaaadfeeegihgecdedcbcbaaaabbaaabaaaaaaa##aaaa#aaabcbbbccbbbbbbbbbcbbb", "babbcdddddde######aaa###########aaaabda##a####abaaa#####abbaaaaaaaaaaaaaaabbbaaa#aa##aaaaaaaaabaaaaaabcdkib#aaaabbaaaaaa####aaaaa#aaaaaa##a##a##acgjhfgefcbbacccbaa####a######aaaa########a#############bfffhjigedddbaaaaaabaabbbbccaa####aa###a##aa#################a##.....#..#########aabbbbcccddfheaaa####bba####abba#aaaa##bca.#bghfedecbccbbbaaaaaabaaaaaaaaa#a#aaaaabbbbbbbbbbbbbbbbbbaba", "bbabbdcdddcec#####aaaa#a####a###abaaaaaa##bda##aaa######aaaaa#######aabbbaaaaaa##a##aa#a#aaaaaaaabaabacbdjjbaaaaaabaaaaaa##########a#aa##aaa##a#a##cfhhededabbdcbcca##########aaaaa############a######a##dffgjiiheedcbaa###bbaabbbddba#########aaa####################a###..###..##..###aaaabbbbcbcfffebaaaa#aabaa##a#aaaaaaa#####aa#.bdegfeccbbaabbaaaaaaaaaaaaaa#aaaaaaaababccbcbaabbbbbbcbbab", "dbbbbcdcdcdcea###a####a#aab#aaaa##aaaaaaa##a####aaa###.##aa###########aaaabaa#aaaaaaaaaaaaa#aaaaaaabbaabbbhkfcaaaaabbaaaaa##########aaa###aaba######.ekjgddbabbaabccbba########aaa####.#######aa##aaa#####dgfgghgggedcbbaaa#aabbbcbedba#######aaa#a####################aa#.......##..####aabbbbcbcdefeebb#aaa#aaa##ab###aaa#######a###.##cgefdccbbabbbaaaaaaa#aaaa#a#aaaabbccbbcbbbaabbbbcbccbbb", "bcabbcceffabbc########aaa#aaaaaaba#aaaaaaaa########.#####aa######aa####aabbbaaaaaaa##aaaaaa###aa#aa#aaaaabbfkjhdaaaabaaa#aa##aa#####aa#a#a#aaaa######aikjjhbaaabbaacbaaa###############.###################bfhggggggfedcabaaaaabbcdeccaa########aa##########aa######a#a##a##..#.#...#####aabbbbbcccecdgccb##a####a##a############aaa######agfedccccbbaaaababaaaaaaa####aabbaaaaabbababbbccccbbcb", "ababbccdffdbbbba###aa#aaaaaaa#baaaaaaaaaaaa#########.####ab###########aaaaaaabcbbbaa###aaaa#ba###aaa###abbbbflljeaaaaaaaaa###########aa##aaaaa#######.afikkiba#abbaaba##########a############################ehffgggfeedcccbaabababcccbaa######aa##aa###.###aa####...#########...########abbbbcbbbcdecfgdaa#######################aa##a####bfeeddccbbbbbaaaaaabaaa#abaaaaaaaaabaaaabbbbbbccccccc", "adbbbbcdddecbaba#a#######a#a##aaaaaaaaa#aa##########.###aac##########a##aa#aaaabcbbaaaa##aaa####aa#aaba#abbbbdillhcaaaaa####aa####aa#aaaa##aa#########.#chkli#aaaaabbaaa########a#aa###a###############.###aa#fggffgffedeecbbbaaabbbbcbaaa#####aa###a############################.######aababbcbbbccedcfccaaaaaaaa###############.####a#####bffeddccbbaaaaaaaabaaa###aabaaaaaaaaaaababbbbbbbcccc", "ccbbccddeeeccaaca##a####aaaaaa##aaaaa#a#aaaa#########.###ab####.#a###aaa##aaa#aaaabbaaaaaaaaaaba#abaaaaaaaaaaachkklfbaaaa##########a##abaaa############..#bimiaaaaaabaaba##########aa#babaa##############.##a##aegfcbdeedfedbbbabbabbcbbbaa#####a#####aa######################.#########aabbbbbcbbacddddccaaa#aaaaaa###a#####################afgeecdccbaaaaaaa#abccbaaaaaaa#aaaaaaaaaaaabbbccbcc", "ccedcdddeeeccbbbcba#a###aaa#a#a#aaa#####aa#a#############ab#####.#####aa#a#aabaaaabbbbabbba##aa###acb#aaaaaaaaacfihkida##a#a###.####aaaaaaaa##a###aa######.ahljc#abaaaaaaa###.####a######abaaa############.#####.bababeedegdcbccbcbabaaabba#a##aa####aba#aba#a###################.####a##ababbbcbbbcdddedea#aaa#a####aa#######.###.######a##a##fgfedddbbaaaa#bcdccbbba####aaaaaaaabbabbbbbbbcbbc", "cddeddddeefddcbbcc#a#aa#aaaaaaa#aaaa####aaa######aa######ab#a########aa#a#aaaaaaaaaaabbaabba#aab###abb######aaabbcfheihc######a#####aa#aaaaaaa####aaaaaa###.aikjcaaaaaaaa#################aaccbaa#a################aaaaaaabdddcbccbaaaaaaaaaaa##b####abbcccb##.###a#############..###aaaaaabbbbbccbbccccddecaaa#aaaa###a########################effedccaabbaccbbaaaacc####a#aaaa#aabbbbbbbbbbbcc", "dcdcdcdeddfecdcbcdaa#aaa##a###a###aa##############aaaa###aba#############aaaabaaabaaaabbabbaaa#aba####a##a###aaabccefadhhb##aaa#####aaaaa#aa#a##aaa#aaa#####.aflkcaaaabaa####################ddcbaaa#################a#aaa#bdddbbcbaaaabaaaaaaa#a####a#baa####a###a###aa#############aaaabccccbcccbbcdcdedefb##a###aa##aa###############a##aa####efddcbcecbccabbaa#aacc###a##aa#aaaabbababbbbccc", "ccdddcbcfhfddcdcbbc#####a#aaa##a########a#a#aaa#####aaa##abaaa##.#######aabbaabbaaaaaaaababbaaa#aaaaa###a#a#a#aaabccdha#diga##aba#####ca##aa####aaaaa#a#######acildaababbaa###########a#######abccbaa#########.#########a###cdedbbdcbbabba#aaa###a####aaaa#aab###a##a#aa######aaa######aabbccccccccccddddeddfca#aa##aaa#aaa#####a####.###aa#a##a#cfeddedacaaabcaa###aacc###########aaaaaabbbbbcc", "ccccddccdeffdcccdccb########aa##########a#aaabaa#####aa##ab#aa###########aaaaaaababaaaaaaaabaabcabba############aaabcffb.afjfa#aba####a#a########a#a########aa#abhjb#aaaba#a##########a#######aabcccbb####.#..###aba#########abddbcecbbcbba#aaa########aaaa#a#a###aaa########aaaaa#####aabccdcddccccccccddedcec###ba#a####a#a##########.######aa#adedcbbaabaaabbaa###aabca##aaa#a##aaaaaaabbbbbc", "cccccdcedcddfebbdcbdb#######################abcbba#######bbaa######.######aaaaaabbabaaaa##aaabababaaaaa########aaaabbcfiea#bgjeaaa######aa#a#############a####a#acgigaaabb##########.##a#######aaa#adcba##########ba#a#a#####a#adfcddbcccbaa#aaa######aaaaaa##aa#aabbab#aa####aaaa#####aaabbccdddcdcbbbbcccddegd##baaaaa#########a################abbcccbbbbabbbba#####abca##aaa####aa#aaabbbbbb", "bbbccddcdcddefdbcdadcaaa#####################aabbbba#a#aabba#aa##########aaaaaabbaaaaaaaaa#a#aaabbbbbaaaa###a#aaaaaaaabfifa##ejgbaaa########a##################acbcfigba#aa###########a#########a#aaabbbba#######.#a#a#######aaaaffddccbccba##aaa##########a######aabaaa#.####aa######aaabbbccdeeefggecdedcdfedcbaacbaaaa##a#a####a############a##aa#accdcbcbbbbbba#####aaca#aaaaaaa###a#aaabaab", "bbbbcccccddddfecbccbdc#a############a###aaaa#aaa#aa##aabcccc###########aa#aaaaaabaaaaaaaaaa#aaa#aaabbbbbbaa###a#aabaaabbbhie#.bfhfbaaaa###aaaaaaaaa#######a####aaabdhifbaa########aabaa###a######aa#####bccaa#####.#####a########afgeddccdcba###aa########a#a#######aa######.##########aabcbcccdffghihgdcddcbacbbeabaaaaaa#a###################a##aaaa#bcddcdcbbbab##a##aaaba#aabcaa####a#aaaaba", "bbbbbbcccccdefedbbcacdc####aa##a#.##a#.##abb######a##aabbccc###########aa#aaaabbbbaaabaaaaaaaaaaaaaaabbbccbaa##aaabaabba##diic##adhebaaaa#aaa#aa##aa##########aabaaagjjf#a######a#aaaaaaa#a#######aa#a###bdddaa#a###.#a###########adcdddddcba#aaaaa#a###a##a##ba#b###aa####.###aa#####a#abcdcbbcdghihhgdcaaaaaabcfdccaaaaa#aa###################a##a#a##acbcdcbbcba#a#####aaba##abaaaa###aaaaaaa", "aaaaabbbbbcddeedccebaccb###a####a####a#..aba##########aaaaccb.############aaaabbaabbaabbaaaaaaaaaa#baaaccbbaaaa#aaaaaaaa####fjfb###egebaabcb##aaa##############aaa#achkjbaa######aaaaaba#a#aa###a###########abba###################abaceddcbaaaaaaaa#####a#####a####a##a######.###a##abaaccddedeeffdghfaaaaaaaabbdfcabbaaaaa###############.#########a###bccbedcbdaa######a#abaaaba########a#aaa", "#a#aaaabbbbbbcdedcccbabbb##aa######.######ba#############abcc##############aaaaababaaaaabbaaaaaaaaaaaaabbcbbccba#aaaaaaaaaaa#beihb##afgdbbcba#aaaaa######a######aa#abcilheba#####aaaaabaaaaaa#########a####a##a#aaa###############a#aaadedbbaaaaaaaaa##aa##a#######a##aab######.##aaaababceefcddcb#.#gfaaa#aaaaabcfgcaaaaaba########.#####################aabddcbcabaa##a##aaabaaaa######a######", "##a#aaaabbaabbccdcbcbbbacb###a###########.aba#######aa###aacf#######.#######aaaaaabcaaa#acaabbaaaaaaaaabababbbcdcbaabba#abaaaaabfje#a#aehdaaaaaaaaba#####ab#a####aabaabijiebaa##aaaaaabaaaba##aa#####a#a###########a###a###########aaaaaabbbaaaaaabaaa#aaaaa#####a##abaaaaaa########abbabcdgeba##.##.bdaaa#a#aaaacfgcaaaaaa########.a########.#######a#aa###abccbbbaaaa#aa#abbab#abaa####aa#####", "#####aaabbaaaabcbccccbbbcca###a############a#########aa##aaacb###.#.########aaaaaaaaabcbaaabaaaaaaaabaaaaaaaaaabcaaaaabaaaaabaabaejhbaa#aggcaaaaaaaaa####abb#a###aa##aabhigddbababba#acbabaaa###aa####a#c#a#############a#a########aaaaaaaabbaaaaaaaaaa#aa##a#####aaaaaa###aaa######aabbabege##b#######aa#a##aaaaaceecbaaa############################aaaa##aaacbbbaaa##aaa#aaaaa##aa#####a#####", "####aaaaaaaabbabbdcbcdccbbba#aa####a##a####a######..##aaaaabab###.###########aaaaaaabbbbbbaaaaa#aaaabcbaabaaabbaaaaaaabbaaabbabab#bghcaba#dhfaabaaaaaa#aa###aa##aaaaaaaabeegbccbaaabcbbbaababa######aa#aaaaa##aa#.######aaa#########b#aaaaaabaaaaaaaaaaa#a##aa#aaa#aaabbab##a####ab#aabbbbcfhaaca##############abbabddbbaa####################.###a##a#aaaaa#aabbbbbaaaaaa###aaaaaaaa#######a###", "#####aaaaaabbbbbccdbccdcbcca##########a#####aa##a######a#aaaabc###############aaacaabbabbbbbaaaaaaabccbbaaaaaaababcaa#bbaaaaaaaa#ba#eiebabaafhb#aaa###a#a####aaabbaa#baabbbigcebaaabcbbcdbbbcca#a##a###acbbaa#ab##########aaaa########aababbbaaaaabaaaaa##a###a#aa###aaaca##a#aa.bc#abbdccbdga#####.###########abbbbcdebaa##a##a##########a####.###a#aa###aaa##aabbabbba#a#####aaaaaa########aa#", "#####bbbabbbabbcddddcccbbbcca#a##aa###a#################aaaaabb#a####.########aaaacaaaaaacaaaaabcaaabbcdcbbbcbabbbabbaaaaaaaaa####aa#cijdbababhfa#aa###aa##a##a#aaaaa#aabbbflggfaabacbaabbbaacbba##aa#abccbbaa###aaa#####a#aaaba###a#aaaaabbacbaaaaaaaaaaaa###aaaaaaaaaacaaaa#bbab#abbcccccbdc#################aabdceedebaa#########################b#####aa#####bbbabbaa#a####a#aa##ba########a", "aa##aaabbbbccbbcccddcdccabbdfa####a###########aa######a#a#aacc#######.#########aaabababbaaaabbaaaaaaaabbbbaaaaaaabaabbbaaabaaaaacba#a#beijbaaaaehfa###########aa#abaaaabbbbdhjghffedccaaabaabaabbaaaacbcbcccbaa#aaaaaaaa#aaaaaaaa####aaaabbaadebbaaaaaaaaaaa###aaabaa#a#aaaaabbbbbbbabcdcccefe####.##.#######.##a#aacccccaa#aa#####.###############aaa###.#a###a##bbbbbaa#a########aaaaa##a#####", "###ab#ababbccbcbccdddccccbbbeda##aaa######aa###abaa####a###abdb#a###.######aaa#aaabbbaaaaaa#abbbaa#aaaaabdaabbcbabb#aaaaaaaabaaacbcba####ejdbbbacgjd##aa#aa#####aaabbaabaabbejiiiihhggfbaabbbaabcba#bcdcdddddcaabbbbcbaaaaabaaaaaaa##aaabbbbcdedbcbaaaaabbaa#aa#aabbaaaaaaabccbbbbbcdccddffebb####################aabccccca###########.#########a####aaa####a##aa#abbaaaaaa########aaa####a#####", "#aaaaabbbabbcccccdedccccedccdebabaa#aa###########baa##.##aaa#aca#######.#####aaa#aaabaaaaaabaaaacbaaaaaaabaaaabcbaabaa##aaabaaaaabaaaa###.cjgcbbbadiib##aaaaa####aaabbaaaaabdhlijjiiihfefcbaabbbbbbababdedfddedccbccdccbccdccccbaa#aaaaababcccdddcccbaaabbaaba#aaaabbaabbaccdddcdefffedeeed..################.######abcbdfbab#a###########################a#a#####aaaaaaaa##aaaa######a##.#a####", "###aaaaabcbabccccdcddcccccbbccebaaaa##############a#a####aaa##abb##############aabaaababaaabaaaabbaaaaaaaaaaaaaabbcbabbaabaaaaaaaaaaaa####.afhdbbaabfihb.#aa###aa###aaba#aaacclljjiijigddecbaabccbabbbdbadcbeffffeffgghhhighgfhgffcaaababdbbbbcfddddcbbbbbccabaaaaaaababddehggfegjiedaaaa#a####a##############.######bcdcddbaaa##a###################a#a#####aa####aaaa#aaa#a########a#######aaa", "aa##aaaabaaabbbdddccdbcddcccccdd##a#aa##aa########a######aaba###ab##############abaaaaacbaaaabaaaaaaaaaaaaaabbaabbaccbaaaaaaaaaaaaaa#########bfgbaabbdije.######aa#abbaaaaaaabellkkkkllkiiigfdcdcbabbcbcdcbcgijkjhhhhijjic#dcbcbddghffeeeihiggfgddedcccbcdcdcbcbcbabadeeffghhhebegdddb#########a#a####################babbbcbbb##a##################aa##a####aa#a###aa#a#aaa##a#######aaaaa##aa#", "a#aaaaabaaaaaabcdcceccefcadgeceebba###a#aaa########a#####aabaa#aabda########a####aaaaaaabbaaaabaaaaaabbaaaabbbbaaaaaabbcbaaaabaaaaaaa#aa######.eiebbbbcfihc#.###abaaa#aa##aaaabellkjlkjklmnnmlkgfccbbdddeefghjijkkllkhd#cfeabcbbcbbdgjjhgecccehieeededccceeedddddefcdffcedbacdec#bbaba#########aaaba#########.#######aaaacccdbbaa####################aa##a####aaaaa#aaaaa#a####aa######aa#aa##aa", "a#aaaabaaaaaaaabcccdddggedbdfccecaaa###aaba#a#######aa#.##aabba#aabc###########aaaaabcbaaaabaabaabbbabaaaaaabbcccaaaabbbbbbaaabaaaaaa#aa#aba###.bigbbbccdilid.##aaaaaa####aabbbcekmljgdfiijikmlmnkgdeefeeegieeddgdcghgdbabcfdebcccceffggfcbbbbbcefgedddcceeefdedcbccefgb####babedcaa##aa#######aabcda##.#############aaaaabcdcdbaa#########a########a###a###aabbbbaa#aa#aaaaa##aa######aaa##aaa#", "##aaaaabbaaaaaaabcdceeffedccfgedcaaa##aaaa###a#a#####aa..##abaaaabbd#########aaaaa#a#bbbbbbaaaaaaabbbbbaaaaaabccbbaaabaabbbbab#aaaaaaaaa#aaaaa###ahibbcdccgjkg####a#aa####aabbcddegkhddgihhghiibdilmljjjjiiihfaaa##aeeedcbbdghfdbbdfedfedccbbbbdbffhfededeefhhfc#####cea#####aaabdfda.a######.##abdfb##########.###a##aaaabadefecb#a##########aaa####a##aa####acbbbaa##aaaaaaaaaaa#####a######a#", "a##aaaaaabaaaaaabacddeddfdccefffd#aaaaabbaa#a#####a#.aaa###aaaa#abbdb########aaaaba#aaaaababbaabbbbbbbbbaaaaaaa#abcbaaababbbbcb#aa#abaaa###########fhdcccdcehihb###aa######a#bccdefggiglkjjhiihba#cglkjhiihgebcaaaaaa#aacdbbdefhfdbbeedbccbbbabdcbgjifefedeggfgfa#aa#a.aa######aaaacffba####.###abdeca######a###########aabbegffgedaaa##########aa####a##aaa#####aaaab#aaa##aaa#aa######a#######", "##aaaaa#aaaaaaaaabbcdddceddeeecdfbaaaaabbbaa#####ab#########aaaaaabbc########aababbaaaaaaaabbbaaaabcbbabbaaabaaaaaaabbbbaaabaabbbcaaaaaaa##########.bhfcccdddefigc#abaa#aaaaaacccdegeiihkihhjhbbaa#.#a##a#..##aaaaaaaaaaaacaabaacefedefbbedcbaccdbcfgiihhfdec.addb#ba###aa######aaaaadgeca#######aceaaa#################aaabdgeeghffb########a######aa####abaa#####a#aaaaaaa#aa###a#.######aaaa#", "a##a####aa#aaaaaaabccbccdedefebbef#baaaaaabaa#####a#aaa####aaa##aaaada########aaabbbaaaaabbaaaaccbbcabbbbaaaabaaaaaaaabbbbabbbbaabcb#a##a#########a##bifdccdddefgjeaaabaaaa##accbbcddfhehijhdb#aaaaa#a####a#abaa#aa##aa#aaaaaabbbaabefigffefdbcccdcbaacbbdhhfeaacbabb##a##########aaaaadhgb#####aabecaa########a###########baegfefgfeca##a#######a##aaaaa#aaaaa####aa#aabbaa#aaa###a#.#####a#aaa", "#aa#####a#a#aaaaaaacccbbccdcdedbcfcaaabbbaaaaa####a###a###abdb####aaeda######a#aa#aabbbabbaaaaacddbaaaaabaaaaaaabcbaabbbaabbbbbbababa####aa###aaa#####dihecccdedeejgaabcbaaaaabcbbbcdeheggeabaaa####aa########aa###aaaaaaaaaaaaaaccbaabdegedddddddccbbbba#abaabcbbaaaa##a##.#.#####a#a#abefb#####abdfaaa#####aaaa#a########aaadfeeffffc#######a######aa#aaaaaaa#aa##aa#aaabaaaaaa#######.###a#aa", "aaaaaa#aaaaaabaaaaabbcbbabbbcceedffdbaabcaaaa##abaa##aa###acefa####abdaa###.####a##aabbbcbcbaaaaabba##aaabaaaabaabbbaabbbaabbbbabbcbba#a##aa###aaa#####bhjgccdddefdhheabbaaababcbbabcdehfcaaaaaaaaa#aaaa#######aa###a##aaaaaabcdaabbbbabbbefedeccddcbbbaababbbcccca#a####aa#############aaceda###aabfebaa####aaaaa##########aaadefedegca########aaa##aaa#aaaaaaa##aaa##aaaaaaa#bcba#########aa##", "#aaa#aaa#aaaababcbbbbccbaaabbbbdgffgbaabbbaaaa#aaa####a##abbgea##aa##bca#########a#a#bcbabbbbaaaaaaaa##aabaababbbaabaabbbbbbbbbaaaabbaa##a#####aaa######adhidddddfhdfigbcba#aaaaaaaacbcfdabaaaaaa#aaaaaaa#######bb#####aaa##aabccaaabdcaaaeeefeddefcbbbbaaaabcbbbcdba#####a####..#######a##abdb#aabcefdaa####a#aaaaa#######aaaaaabacefc#########a###aaaaaa##aaaaaaaaaaaaabaaaa##aaaa###.#####aa#", "#############aabaaaabcbbaaaabbcceeeeeaaabbaa##a###ab#####abddb#####a##cb#######aa#a##aabbbbbbbaaaaabaaa##bbabbbaaabaabbbacbcbbbcbbbbaaa###a######aa##a#baaagkecdeegfeehfcbba##aaaaaaaaccdcbaccbaaaa#aaa##aaa#########a##a###aaabcaaaadeddbbdcdeigfdbcccbaa##cbabcbcdaaa####aaa######.######aa#debaacfdcaa#####aaaabaa########a##aabccdd#############aaaaaaa###aaaaaaaaaaaaaa###aaaaaa#########aa", "#############aabbbcbbccbaaaabbccddeedca#abaaa#aa###a##.##aaaa#######aaaca############aaaaaabaabaaaaaa##a#aaaaabbaaaaabbbabbbcbbccbccbaba##########a##aaabaabejfddddehddhgdbbba##aaaaabbbcccaabaaaaa#a#a##a#aaa###############aabcaaaaaegeddcecacdghfdccbaaa#cbabcbac#######bba#################bcdcbeebaaa###aaaa#aa#a###a####abaabdcdcba#a##a####aa###aaaaa##aaaa#aaaaaaaaaaa#aaa##aa#########a", "aca##########a#aaabdbcccbaaaabbccddeedbaaaaaa#aa#########abca#######a#aca############aaaaaaaaaaaaaaaaaaaaaaaaabbabaabbbbbabbbcbbbbcabbbba##########aa###aabbbeidbbccehefhhcbbaaa#aaabbaaabbcaaa#abcaaaaaaaaaaaaa#####.########aaabaacbedfdbbbdccccfhebaabaaa##a#acaba######daa###.######a####aa##acfdfdaa####aaaaaaaa###aca#aaaabaabccdeaaa###aa#aaaa##a#aaaaaa#abaaaaaaaabaaa##############.aab", "aa#bb#####.######aaabcccbbaaaabbbcddeebaaaa########.#####abca##########abaa####a#####aaaaaaaaaaaaaa#aaaaaaaaabcbbaaaaaaaabbbbbbbbbccabbaa#a#########a#####aaaachdbccdefehgiebbbaaaaabaaabccacbaaaacbaaaaaaa#aaaaaa#############a#baaaaceddbaabcbebbefdcaaaaa###ba#baa#####.aba##############a#a##aacfghdcaaaa#abaaaaaa######acbababbbdbaa###aaa#aaaa#a#aa#aa#aa##abaaaaaaabaaaaa##############ba", "a#aa#a#####.###a#aaabbcccbbbaabbbccccge#aa#######.#######abbba#######aaabbaa####bba###aaaaaaaaaaaaa#######aaaaabbbbabaabbaabbbbcbbbcbabbbaaa#a##a##########aaaabeccccddfgefhgaccaa#abbabbbbabbbba#aa#aaaaaaaaaaaaa#######a#####aaaaaabacdccabbbcecaacdfecbbaaaa#aaabaaa#####aa########aaab####a###aabeggbaaaaaaaaaaaaa#a##a###aaaabcccccaa###aaaaaaa#aa#aaaaaaaa#abaaaabaaaaaaa#a###########a#aa", "###aaaa###a######aaaacccbbbbbbbabccccehb#a########..#####abbca#######aaaacaa####cca###aaaaaaaaaaaaa#######aaaabaaaacdbaaabbbbbbbaabbbbcbccaa############a#aaaaabaccbdccegeccffbbaa######.#abaabbbaaaaaaaa#aaa#aaaaaaa#a##########aaaabbcc#abbabaabaddcbceebbba#aaaaaba######a############aba###a##aaaccggbaaaaaaabaaaaabaaaaa#a#bbabbccdb#aa###aa#aa#aaa#a#aaabaaaaab###abbabaaa###a#a########aa", "###aa#a######.######aacccbbbbbabbbccccfheaaaa#############bbcaa#######aaabcaa#####aa####aaaaaabaaaaa#aaa##aaabaaaaaacdcbaabcbbcbbbabbaabbbbca#a######aaa##a##a#aaacabccdeggacge.#aa####a#baaaabbabaaaaababbaaaaaaaaaaaa#########aaaaaaabda#aaabbbacbcdbbcdeca#a#aaaaa#a#aa#aa#############aa#####a#aaabcfgcabaaaaabaaaa#aaa#####babbbcccc##aa#a#aa#aaaa###aa#aaaaaaaaaaa#aabbaaaa###a#a#####abba", "###aa##aa##########a#acbcccbbbbbbbbbcceffebaa#############accbaaa######a#bdcaaa####aa##aaaaaaaaabaaaaaaaa#abbbaaaababcddccbcccccbaabaaabbbbbca####a######aaaaa##a##bbabcbdgefeed########a#a###ab#aabbbaaaaaaaaaaabaaabba#####a#.#a##aaaabca##abbbaccbbdcbcdedb#aaaaabaaa###aaa#########aa#aaaaaaaaaaaaabceecc##aaaaaa#a#aa########abbacccc##aaa#aa##aaaa###aabaaaaabaaaaaaabaaaa####aa#####a#a#a", "b###aaaaa#######.##a##abbdcbaabbbbaabccdegea########a#####abcbba###aa####acccaa######a#####aaaacbbbabbccbbaaccaaaaabbbcccbcbccbbaaaababaaaaabc###a#aa#####a#aa#a#aabdaaacbbafhgbfa.#####aaaaaaaaa#aabaaaaaaaaaaaabbbaaba###a###########baba##aaaabacaabccbccdeeaaaa#aaab####.########.##aabbbaaaaaaaaaaabccaccba##abbaa###a##a###a#aabbccca#aaa#a#abaaaaaaaaacaaaa#aaaabbaaaaa#aaaa#a#######a##a", "baabaa#######aaa#####aabbccbbaaabbaaabccdfeba#######aaa###abcabbaa##aaa####ddbaa######a###aaaaaaaaaabbcbbbbbccaaaaaabbbbbcccccbbbaaaaaaaaaa#abca##a#aaaaaa##aaaaaaabcaaaabaabgicce##.#a##aa#a#aaaaabaccbaabaaaaaaaaabbbaaa#aabb##########aa#aaaaaaaaaaabccccddfebaaaaabbaa################bbbbbbaaaaaaaabbbc##acbbaaaaaa####a#####aabbbcccb###aaaaaabbaaaa#a##aa####aba#bbaaaaaaabaaa#######a##a", "baaaaa#######aa#######aabccbabaabbbaabbbcdgdb#a########a##abdbbaaaa##aaa##abdcbaa#############aaaabbbbbbbbbabccaaaaaaaacbbbcccbccccbbaaaaaaaabbca#aaa#a#aaaaaacbabaa#aaaaaccbbjgabc###bb######abaaabbcccbabbbaaaaaaaaaaaaa##aaaaaa#######aa###aabcbaaaabbbccdeeefebaccbbbbb#.####a####.###abaabbbbbcbaa#aaabca.##acccbaaaa########aaababbcba##abaaaaaaaaaaaaaaaa#aaa#baaababa#bbaaaaaaa#######aa", "aa##aaa###############a#abcbabbaaaabaabbbcffcaa##aa##aaaa#abbbbaaaaaaa##a##abdbaa##############aaaaabbaacbabbbcaaaaaaaabbbaaabacbccbbbaaa#aaa#aabb#aaaaaaaaaaabbbbaaaa##aabbbadiabbc.##c#######aaaaaabbccbbabbaaababaaaaaaaaaa##aa#######a#####aabbaaaabcbbbcddcefhgceeaabba##############abbbbbbcbaa###.###aca####aacdba#a#a######aaaabbcbbaa##aaaaaaaaaaaa#aaaaaaaaaaaaaa#bababaaaabaaaaaaa#ab", "cb####aa################abcbbbaaaaabbaabbbdgdb##a#aa#aaaaa#abaabaaa#bba####aaddba#######a#########a#abbaaccccccbaaaaabaabccbbabaabcbbbbaaa#aa###acda####aaaabaaabbcbbaaaaa#bcbcebbccd#.aba######aaa#a#acbaaabbbbbaaabbdbbca##ba###abc.#.####.##a#bbaaaaaaccccdecdefghgfccccb#.####.#...###aaaabbabddba###...##bb#####a#bcba##########aaabbccaa###aaaaaaaaaaaaa##a#aa#aaaaaaaa##ababbaabaaaaaaaab", "ec##########a##aa#.#####abbcbbaaa#aa#ababccfffcaaa#aabaaaaaabbaaaaa#aba###aabbfdaa###.#############a#aaabbccbbccaabbaabbbbbbbbabaaabbbbbaaa#a###aacdba##aa#abbacbbcbbbaabaaabbceabccde.#c#aa######aaa#aaa#aaababbabaabbdefecd#aaaaaaec#.#########aaaaaa#aacdcbdbabdfegddffdba##.#.###.###aabbbbabbccbba###.#.##bc#######abbba########aaabbbddcaa##aaa##aaaaaaaaaa#aaa#aaaa#aaaaaababaabbaaaa##ab", "bca######.#####aa#######abbbbac#a##aa##abcdcehfaaaabbbaa#abcbbbaaa#aaba#####acegdaa####.############aaaaabbbbccccbabababcbbbbbaabbcbbabaa##aaa###aacebba###bffcdbcbbcbbcaaaabbbhbabbcee.##aa##aaa#acaabbaaaaaaabccaaaaaabdefge##aaaacea###########a######abdfdabaaaaababaceeb###.#...#.##aaabbbabbbaabaaa###..##bea###a##a#aca#a#a#####aaababb####aaaa##aaaaaaaaaaaabaaaaa#aaaaaababaaaaaaa###ab", ".#a###########.b########aacaaaacaaaaaaa##acdffgbaaabaaa##aaehdbaaaa#aaaa#####acfgbaa#########.########aaaabbabcdecbaabbabbbbbbbaaababaaaa######a##aaddbaaaaab##a##abccccccbbaabfhaababgd.######aa#aaaaaaaaaaaaabacdddbaaaaaaddeda#aa#ba######..##a########abdcaaaaababcabbbcddb#a###..#.##aaabccbbaaaaa#########abed#########cb#a#a####a#aaaaacb###a#aaa##aaaaaaaaaaaabaa#aaaaabaaaababaaa######", "#########aaa###a########abbaaaaaaa#a#aaaaaacdegeaabaaccbaa#acefcaa###aabba###aadfdbbaa####.#############ababaaabcccaaaaabbbbbbbabaaabbbbaaa#####aaaabdeaabbba########aabdedcbabbffaababhd########a#aaaaaaaaaaaaaaacedbabaaba#bfggcaaa#########..#.########aabcb#aaaaaabaababccddba#..##.####aaabbaaaaaa##...#####acecb########abba#aa#a#aaaaabbca##aa#aa#aabbaaaaaaaaaaaaaaaaaaabaaaaaabaaa#aa##", "##########aa###a#####aaaaaaa##aaaacc#a###aabbcefbabbcfcddddbabgfa#a#aaaadbaa##abdedcaaaaaa#############a#aaaabbbbaacbbabbaabbaaababbaabababa##a##aaaaaccbbbb########.###abbacdcccgbabbbcida####aa#a#baaaaaaaa##aaabccaaaaaacbbabggb#a#####aa##..##aa######aabbcbaaaaaaaba#aabbcccca#.########aaaaaaaaa###...#######abdec########abb#aaaaaaaaaaabcbaaa#####aabbbb#aaaaaa#abba#aaaaaabaaaaaaaaabb#", "###########aaaaba###aaaaaa####aaabdebca###aabbcfgfbacdccdeheaadgea###a##dcabaaaabdedcbaa##################aaaaabbbccbaabcbaabbbbabbabbbaaabaa#####aa#abddbcb##a########a##.##accdeedbcccejcbaa####aaaaaa#a#aaaa###aabbbbaa#bdbb#chfa####a########.###########babbaaaaaabaa#aaaaabbcdc#..######aa#aaaaaa###.#..#####a#abdeba#######bbbbaaa#aaaaaabcca#aaaa#aaaabbbaabaaaaaaaba#aa#bbaabbaaaa#####", "######a##a###a#aaaaa#aabaaa##aaacddbbcaa##aaaabdifdadeeddfffaabdddbaaaaabd#aaaaaacfedcaa#################aa###aaaacccbbabbbbaaabbbbbbbbbaaaaa######a#aaacdddaaa#########a######aabbicceedghcbb##aa#aaaaaa#aaa#a####aaabbaa#adffbafgd####aa###################aaaaaaaaaaaaa#ababaaabbbcb#.####aaaa#a#a#a##..########a#aabbcdd#.###a##bbaaaaaaaaabbbbba######aaaacbb#abaaabaa#a#aaaabaabbbabaa####", "######aaaaa####aaaaba#abaaa###a#bddccaaa######abcfgghhhfdfffcacbabdecca#bca#aba##aeffeba##############.########aaaaccbbbabcbbbaaaababbbbbbbaaaa######aaaabeeaa#aaa######a###a#aaaabfgdbbddhhccb###aaaaaabaaa###aa##aaaaaaaa#bffgd#cda##a#a######a#a###########aaaa#aaaaabb#abaaaa#aaaabbca####aa#aaaa####.#############aaabcdc#####a#abba###aaabababc#aaa##aaabcaaaaabaaaaaaacaaaabaabbbbbaaa###", "a######aaaa##a#aabbaaaaacba##a##acccddbaa#a##aaaaacccdefefefdacaaaacgebcdb#a##aacbbegfdba#aba##############aa###aaabcdbccbbabcbbbbbbbaabbabaaa###a###aaaabcdb#baa#a###########aaabddgcdcbbcfidbcb#aaaaabaaa#a#a#abaa###a#aa##dfffeaa#####a#####aa##b.######.###aaaaaaaaaacbacaabaaaa#aaaacccaa####################a########abceca###aa#abaa#aaabaaaacda#aa###aacaaaaaabaaa#aaabaaaacbbbbacaaaaaa", "aa##a###aaaa#a##aaaaabbbbbbba####bbbacbaaaa##aaaaaabccbdedcefaccaaa#accccaa##aaabcddfgefeeffea################aaaaaabbcbcbbcbabbbaabbaacaaaa#a#######a#aaaacfcaaa##a############aacdee#a####eifccc#aaa#ccaa###aaa#ba###a###a#befffd######aaab###aa############aaaaaaaaaabbcbcdbbaa###abbaaabccdca...#######aa#a####a######aaaabcdc######aaaaaaaaaaabbcdbaaa##aababaa##aabaaaaaabaa#abbbbaaba#aaa", "#aaaaa##a#.###a#aaaaaceccbbbab##aaaaaaaaaba#aaaa#aaabccbcdddgfdaaaa######aa##a#aaaeggihgeefeddeca###############aaaaababcbbbbaabaaaaabacbaaa##a#####ba#aaabadgeaa#a##a####a##a##aabbeeaa#####bhibaca##aadbaaaaaca###########aadfddfda###abaabb#aaba#####a######baa#aaaa#abdc#bccbaaaa###ba#aaabdfeec#########aa#aaaa####aa#aaaaabde###a###aaaaba#aaaabbccbaaaaaaaaaa#a#aaabaaabbaaaababbbbaabaaa", "##aa####a#####aaaaabcccbbbcbbaa##aaaaaaaaabb#baa##aaabbcccdefgiecbaaa##aabba###a#affghihfccdddddeca################aaabaaaabaaaaaaaaa#aaaabaa########aaaabaabcgcaaaadda#aa#######aacdde#######aegbbdbaa#adbbaabcaa#aa#########acfeeecaaaaaaaabbaaaba###########aaaaaaaaabddfbaaababaaaaaaa##aba#acefgca###aa#####abb######aaaaaaabcfa##a###aaaabdaaaabbbbdb###aa#aaaaaaaaaabcbbbbbbabaabbbbbbaa#", "####aaaa#a#####aaabccccbaabcbcca##aaababbabbabaaaaaabcccbacddefffdccabccdedaaaabdeeffgggeccddccdcdca#a##############aaacaaaabaabaaaaaaaaaaaaaaaa###aa###aaaaacdgcaaabaaa#######a##abdchaa######.cfcbcb#a.bffcbbbab###aaaa###a###ceedddabcbaaaabbabbaaaa##..#####aa##aaaa#acecbbcbaaaaabaaaa##aba#aecbccdcabaaa##abbaa#a##aaaa##aaaabdd##aa##aaa#aaababbbbbdb#a##aabaaaaaaaaaaaaabbbbbbcbbbbcbbaa", "aaabaaaa####aaaacccbbcbbbaaaabdaaaaabcaabcbbbbbaa##abcddcbcdefedffedbdccdeec#aafffdddeffcccbcdcccccccaa#############aaaab##aacaaaaaaaaaaaaaaaaaaa###aba#aaababdefaaaaaaa##a###aaaaabccgcaa#######bgcdeca##bhgbabaac##a#aaa##a###befddfdddbddbaacabbbbaa####.#######a#aaaaaacbaabbbaa##ababa##aa##acaaaabbcb#aa#a#aaa##aa#####a#a#aaaabeca#aaaaaaaaabaabbbbbdb#aaa#abaaaaaaaaaaaaaaaaaabcbaababaa", "aaaaaa#aa#####abbbcbbabcccbbaaabbccccdbabccbbbbbaaabbcddcbceeeddeggddfbcdeec###dffedddeddcccedccccbbcdb#################aa#aaabaaaa#baabaaa#aaa######aaaaaaaabbcdfaaaaaaa#a####a#aaaabge##########bhcbccaabdeeaaaa###a###aaaaaabceedefeeedeeccabbabcbbaaaaa##.#.#######aaaabbb#aaaaaaaaaabaa##a##aaa#acbcabca###aa####aa#########a##aaaedb#abaaaaaaabbabababccb#aaaaba#aaaaaaaaaaaaaaaaabbbbbaaa", "aaabaaaaaa###aaabbbbbaaaacbbbbbcccddefdaabbbbccbbbbabbccbcdddddeeeffefcedffedbabeeecddcbcccbdbbbabbbabba#aaaaa##a######aa#a##aaaaa#a##aaaaaaaaa###aa##aa###aaabbdedaaaaab#a####aaaaabbgha#a########becaccdfgddda#aa#aaaabaaa#a#addeecdcdfeeeddcacbbbcbbaaaaaa###########aabacbaaaaabaaba#baba#aa##bbbdbacaabcb##aaaaaaaaaa#########a#aaabddbaaaaababbbbbaaabcccbabaaaabaaaaaaaaaabaaabaaaabbbbaa", "abbabbaaaaaaaaaaaabbabaaaaabbcbbcdedfggccbaaabbbbccccbccddeddccdddcddecddeffddecddccacbaacbbbbaabaabaaaaaaaaaaaaaba####a###ba#ba#aa#####aa#aaaaa############aabbcdebbbaaaa########ababdhf#a#########afecfffebceaa###aaa#aaaaa##abeeddddeegffdcfdbbabcccbaaaaba###########aaaabaaaabbaaabbbaabbaaaaacdcaacaaaabca##aaa#aa#aa#aa#######aaaaacee#bbaababbbbbbbbbccdcaaaabbaaaabbbaaaaaaaaaabaaaaaab", "babbaaabaaa#aaa#aaaaaaaaaaaabbbbcdbadccdbbbaabbbbbcbbccdeeedeabcccccccccdeedfddcccdbcbaaaaaaabbbaaaaaaaaaccaaa#aa##aaaabbaab#a####aa####aa##aaa###############abcdedbcba#####aaaa#aabbdhie.#####a#####fgffececeda###aaa#aaaaaa#cddecddcddefeegefeccbccccbaa##aaa#.#####.##aaaabaa#aaaaa#aab#bcccbbccbbaab#aaaabcbbaa#aaaa#a#a######aaa##aaabdfdbbbbabbbbbbbbbbccccaaaaaaaaaaabbbbbaaaaaaaaaaba#b", "bbaaabbaaaaaaaaaaabaabbbaaaabbabcedcbbabccaaaaabbbaabbceffcccbbcbbbbbbbbddcdddbbbabbbbaa####aaabaaaaa##aacfeaa######a##aaabbbaaa##aa#a#####bcca#a##aab##aaa#aaaacccgdbbb#######aaaaabbbdhhb###########aeifddbbceda#aaa##aaabaabefffcdddccdeeeedeffefeddccbaa##aaa###.###..aa##aba##aaa#aaabaaabccddcccaabaababaabcca###aa#aaaaa####aa#####aaacffbbbbbbbbbbbbbbbbcdcaaaabbaaaaaabbaacbaaaaaabbbab", "babbbabbaaaaaaaaaaaaabbbaaaaabbbceddcbaaabbbbbaaaaaaabcdffdcabbccbbaaaabbbbbbbbaaaaaabaaa#a##aaaaaaa####aadd######a########abbaaaa##a#####a#aa########aaaaaa#aabbbbdgcaaa###aa##aaaaabadfgb######aa###aadidcdbaceca#aaaaaa#abcdeeeccdeddccddeadeefffffffecbaba#######.###.##aa#abaaaaaaaaabcaaabaabcbd#abaabbbbaaabdba#a#a##a###aaaa#########aacefdbbbbbbbbbbbbcbcccaaaabaaabbaabaaccaaabbaabbaa", "baababbbbabaaaa#a##aaabbbaaaaabccehdbaaaaaaabbaaaa##aabdgieccccbcbaaaaabaaaaaaaaaabaaaaaaaaabaaaaa###a###aaa################aaaaaacba######a#a##########aaaa#abbbbbcdhb##a####aaaaaaaacbfe.##aaaaa#####aadhcbbaaefbdb##aaccddfgedbddccccbbcdedceceggfeefefdcbaaaa#####.###.###aaaaaaaaa##aba#aaaaababdb#aa#aaabaa###bcbaa#######aa#############abdffcabbbabbcbbcbcbcdcbbaaabbbbbbbaacabaaaaaaaaa", "bbbbabbbbbbbaaaaabdcabdcaaaaaabbcdffcbaabaaabbbaaaaa##bcgjfbbbcdddcbbbbbbbbbaaabaabbbaaaaaaaaaaaba#########a#a###############aaaaaabaa#######a######aa#a##aaaabcbabbcceda#aaaaaaaaaaabbbec.a#aaaaaaa####aadhcabbbeecbaaadefggfeddcddcccccbccdccdddeghggeeeddcbaaaaa############abbaabaa#aaaaaaaaba#ba#aaaa#abaaaaa##aabbb###aa#a#a##a##########abbcffdcabbcbbbcccbbccccbaaaaaabbbbaabbabaaaaabba", "bbbbbbbbbbbbbbaaabfdcccbcbaaaaacdceebaa####aaabbbbaa##bdghfcbaaacdddccccccccccbbababbbaaaaaaabbbaa#a##aa#a#b##a#aa###a#######abaa###aaaa##a################aaaaabbbcbbcffaaa#cbaaaaaaaacec.#####aadea##a#aabgdababdfda#adfggeddccccbbbaccbbcbcddddgghigffffbabbaaaa##########ab#aaaaaaaaaaaaa####aaaabaaaaaaaaaa####a##aaca##a######a#########acbbbbcdefdabbaabccbbbbccccbcbaaabbbaaaababaaaabcc", "bcbbbbbbbbbcbbbbbcecccbaccedaaabddcaaa#######aabcbbbaabdfhfdcaa###acdcabdfeeedcccccbbcbbaaaaaaacbaa###aaaa#aaa#####a#aa##aa###ba###aaaaaaaba############aa#aaaaaaaaaabbbfgaa#adbaaa#aaaaehaa###aa#adea#a#aaabgbabacefdb#dfffedccbbaaaaaaccbbcdecdggihihhfdffcbbaaaa###aa###..#aa####baaabaaaaaa#####aaaaaaaa#aba#a###abaa#cbaa##.##aa####aa##aa#baaaacccefdbbabbcccbbbdccdbaabbbbbbbaaabbaaaaabc", "cabaabbbbbbcbcccccddb##abaccbabbdbcaa#a##a####aabdcdbbcdddghcbaaa####bcacigggecbbbcbcbbabcaaaaaabaaa#a##abb#########a##aaaaaaaaaa###aaaaaaa########aa##aaaa#####aaaaa#acegfaaa#aac##aaaachfc###aa###aabb###a#bbabccddefdceffedbcaaaaa#aaabbbbcdegihhhhgggdcffecabaaaa##a##.###abca#aaa##aaaaaaaa######a###b###baa####aaaaaaaaabca###############aaaabbbbbbdfebbabcccbcdcbbdcbbaababbabaabaaaabbb", "febaaaabbbbcdcccccb#####abbabbcccbbaaa####aa#a#abdeccbddeeehgcaa#a#aa#addhifdddbbccbcccbbbbaaaaaababaaa#aaba####a##a#a##aaaa#aaaaa#a##baaaaaaa#####b###aaaaaa##a##aaaabcefihefc##aaaaaabbdha####aaaa#ab######aaaabbccdefegffdcccaa#a##aaaaaabbehhhhffffcddbdcdbbba#ac######..###bb###a#abaaaaaabba#####aaa######a#aa#####a#####bbca###########a##aaabbbaaaabdfdbaccbccbcbbccdcbbbbaaaabaaaaaaabb", "dedbbbbbbccbcdccddb#####bbbaacccacbaaaa###aaaaaaacfdcbcdegghigbaa#aaaaaadfhgedcccccbbbbbbbbbbbbbbbbaaaaaabbba########aa#aaaa#abaaa####aaaaaa############aaaaaaa###aaaabcfghgihfbcb#abaaabbge####aaaaab######a#aaaaaaccdeeddfdbcbaaa##a##aabaafhgggfedccccdccbaaabaaaaaa#########a#####a##aabaabcaa#aaa#a#####.####a###########a#aaaba##a####a#aba#aaaabbaaaaabdeecccbbcbbccccdcbabaaabbbaaaabbba", "bccdcbbbcccccbcdfda#####acbabcbaabaaa#a###aa#aabbbefedcdffiihhcaaaaaaaabacfffefedcbbbbbaaaabbbbbbbbcaaaaaabaaa####a###a##aaaaaaaaba#####aabaa###########a#a####a###baabccghfhiieaa##aaaaabdga##a#a#aaaa######aabbaaabbbcddegdcbbaa##aaaaaaabbfedfddecbbbbbbaabbabbaaaaaaaaaa####aa####a#a#aaaabcbaaaaaaaa##############.######a#a#aabbba#a####a#aaaabaaabaaabbabcfedcbbbcbccccccbabbabaaaaabbccb", "bbccccbbcccccdddeca####aabbccca##aaaa##a#####abbbbeeffeeccfjjifbaabaaabbbcdecdeffdbcbbbaabbbccccbbdcbaaaaa###########a#a#aaaaaba#a######aaabcaaabaa###aa#aaa######acedbcdfihfhifba####aaaadhc###aaa###########a#bbaaabbccccfecaaacca##aaaaaccffdfccedbbab#a#aaaabbaaabababaa###########aaa###bbaa#aaa#abaa##########.########aa####a#aabba#a###a###aaaaabaabaaabbbcdfedbcccbcccccabbbbbbabbbbbbc", "bcdcbbcccccddddddba####abbbbdca#a###a###aa####aaabcededcbbgiijjhcabbaaaaaccddddcceedddddddeeefedbbcbcccbbbbaaa#a###aaaaa###aaaacaaa##a###a##acca############acaaaaa#abbccdghccggfcaba#aaaacggdaaa###############abbbaabbdeefedbaaaadda##aabbchedeefedbaaab#####aabbaabacbabaaaa########aa#a###aa####aaabba##a##.#############a#a####aaa##abdba#########aabbaabbabbaabdeddcbbbcccccbbbbaabbbccbba", "bbddccbccdccdcebcbb#####abccbcd######aa##a######abcddcdddeggiihhhdaaaabcccceedccbbcbbccbccdeeeggfeddccdeccbbaaaaaaa#a##aaa###aaaba#a##aa######a#####a######aaaaaaabaaababcehb#adcbdbba#aaabdceaa#################abbbbbacgeeecca###bedcaa#adfhccdffbbbba###a####aaaaabbbbaaaba###aaaa##########aa#.##aaaaa#aa#b######a#######aaaa##aaaa###abcdb######a#aabcbaabaabbaaabcdedbbbcddcbbbbcabbbccbbb", "bcdfdddcccdddcecbb####a#aabccabaa#####aaaaa#####abbccdedeedcijfggfabaabbbbccddccbbbabaaaaaaaaabbbgihihffedccbbbbbbbba#a#aa####aaaaaaa##aa#######a###aaaa########abaabbbbaccega#cdaaabaaaaabbfea#a#################abbbbbaeedddcbaaabacceccefihdccedcbaa##########aaaaaaabbbaaaa#####aaa##a############aa####aaaa######a#####aa##a##aaa###aaa#a#abc#aa###aabcaaaabbbbbbbbbbcddcbccddcbbbbabcccdcc", "ccbcffhfdddddccadbaa#####aabbaaba##########a##aaabbaacdddfeehjifgha#aabcbacddccbbbbbabbaaa#aabcccefgdddeffeecdedbbbbcba###aa####a##aaaaa##a###aa###aba#aa######a#aaabbba#abbfcbcccccbaaa#abbfjg#aa###########aaabbaaabbcbdedcdbbaaabbbcceghhiiedcedbbaa######a###aaaa#abaaaaaaaa##aaa##a##############aa####aaaaa#####ab#####aa##a###aa#aa#a#####aaaa##aaaaabbbbabbbbbbbbbbbbdddccddccbcbbbcccdd", "eecbdggfdddedcacda####a###abbaaca######aa##aaa#aabcababcdeeedgigdfgbbcbbbbbcccbbbbbaaaaaaaaaccddddefdecccbbcbbddcbccddedcaaa#a#aa##########a########adbaa#########aabbbcbcabbdcdcbbbcbaa##abbfiaaa##############baaabbbbccedcccbaa#abbbbbefgihfdcccbaaaa###a######aaba#abaaaaaabaa#aaaaaa######...#a#.#####aa#aaaa########a##aaa###a###aa#aa#aaaa#aabbabaaaaabcbbbbbbbbbbbbbbbccdeddcccbdccccdde", "eedfhhfcba#abb##a#####a#aabcaaccbc#####a#aa#aa###ccbbbabcdfffhgifehfebbbabbcccbbbbbbbbaaaa#ccdcddfghfeccccbbbbabcddegcbccdcaaaaaa###a###a######a#a##accba#########aaaabbccbbcbcehb###cbba##bdehe###############aa##aabbbccdcbccba##aacccbcceffedcbbaaa#####a######aaba##aaaa#ababcbbbbcbaa########.#.##a####a####aa######aaa###aa####a###a##a#aaa####aaadbbaaacccbbbbbbccbcbcccbcceeeeededcdbccd", "dgghigdb##a#a########baaa#abbcbdbbb#####aa#aaaaaaabaababcdegiihdggffdcbaabbbbabbbbbabaaaaa#ccdccdegedccbbbbbbcbbbbaadbabaacdb###aa###############aaaab#aa##a#######aaaaababbbabbfieaaaa#aaa#chke.#########..#aaaaaaaaababbccbbcbaa#aabbcbabcdeedcba###a#####a#a##.###baabbaaaaaaaabbaaba#########....#.#######ab#a#######a######a#########a##aabba###aaabbbbbbacdcbbbbcbcccccbdddeededegeddddcdc", "dhghhfa##a######a######aabaacccedaaa#######aaaaaaaababbbccdghgfedgfgcabaaaaaaabababaabaaaaabdcceeeecdbbbababbbbccbbbbbabdbabcba#a############aa##aaaaab#aa###########aababcbbaabeggh######aaagj##############aa#####abbaabbbbbabbbabcabbaaaabcddccba#######.###########ccaaa###aa##aaaa###a###..##....#.aa##a############aaa#####a#####a###aaa#aaaa#aaacaabbbbbbeccccbbccddccdegghhgfeegd#bddccc", "ffhhhe###########a#####b#bcadddcbaaaa#####abcca#aaaaaaaaabdhihgddfgfgcaaaaaaabbbabbbaabaaaabedcefecbbbbbbabbbaaabbacdca#aaa#bbdb#aaa#########aa####aa#a###a#####.###aaaaadbbaabaddcggbaaaa#bbdia#a##########aaa###aaabaaaabbbbbbaacefebaa#aaaabcccbaaaa###########.#.##ad#####.##aaa#aa#aa#####...#...###ab#ba######a###a##ab#####a###aaa##aa#aaaaaaaabbbbbbbbbbceddeeccbccccddfhijjhggghb#bba##", "#afhgcaa###########a#a##aabcddca###aa######abbbabaaaaabaaaeiiihgbbgeddaaaaaaaaabbaabbbaaaaabdcccddddccabbbbacaaaaabbbaaabaa##acdd###a######..a#a#####a#aa##a########a##aaecb#abbbcccfgaaaaaaaeia#a#a##############aabbaaaababbababdgeca####aaaaabcbbba#####a####.#######da##############aaaa#######.##.#.#ba########.#a#aa##abba##aa#aa#aa###aaaaaaaaaabbbbbcbccccefgeeccbccbbbbdfiihgggeb#aaaa#", "##bhgd###############ab#ababcdd###aaaa####aaaaaaaaababaaaadhhigebabfddcaaaaaaaaaaaabaaaaaaabcbbbcbbcecbbbabbbaaaabbaaaaaba###abadea#########.#a##########aa#a###a###a####aabbabbaadccghbbbaaabfi#a##a###aa####a##a#aaabaaaaaaaabbacfdba##a#aaa#aaaabbb######a######.##a#######aa#a##a#a####aa#####a#.#a####aa#########aaaaa##aaa###aa#aaaaa#aaaaabaaaabcbbbbccccceeceeeefedddcbbceeffhgfebaa####", "##.dhdb#########ab###bdababaddc######a###.#a######aabacaaaadghfdbbabecdba###aaa#aaaaccabaaacababbbbbbbcbcbbcbaaaaababaaaba####abbcfbaa#aaa###.###ab#####aaaa##a######aa#ba#aabbbabdcabefbcaababhe#a##aa##aa###a#####aabba#aaaaabbbefcba###aaaa#aaaaaaaa#########a#.##############aa#bb#aaa##a####.###########aaaaa#######aaaa###a####a##aabaabaaaaaaaaaabbbcccddebbbbdedefdcccccbceeghgfdaaba#aa", "aa#aeea##########c####ba###aca#####aba#############abcabaa#acdefccbacdbdc##aaaaa###aabdbaaabbcccbbbbbbbccbabcabaabbabbaaaaa###addbcdba#a################a####aaaa#aaaaaaaa#aaacbabdcbbbehca#abbeh#aa######aa######aa#aacfbaaaaaabbdgdbaa###aaaa#aaaa########.###aa#a.###########aaa#bbaaaaaa####a#.##.#######aba#####a#############a#aaaaabbba#bbbbaaaaabbcddddddbaabcedccbaadfdcceeggdbaaaaaaa#", "aa##ada#a########aaaa###a###a######abaa#########aa#abbbaaaabbcddeeebcdbabb#aaaaaa####aaaabcccbccbaabbbabccbaaaaaaaabbaaaaaaa##aabcccfeb##############a####ab#aaa##aaabbaacababaaaabcdbccffc##abeh.##aa###a#########aaaaacbabaaaccddfgdbaaa##aaaaaaa#######.##.#######.#########aaabaab########a#a##.#########aaa#####aa##a#aa###bdaaba#aa#aabaaaabbbabbbbcddefecbcbaabbdcbaabcecccefgcaaaaaaaaa#", "aaa#aaaa#aaaaa#####aaaaaa###########a#####a##ab#a##aacabaaabcccbdhedfdbbabc#aaaaaaaba##aaaeheaaaaaaabbbacddbbaaabbbaaaaaaabc#aa#a###cfgb#a#########aa###aaaccaaaaaaaacbabcdaacbaaabcddcccgfcaabeg.#a#aa#a###aaaa####aaaaabaaaaaaceefhfdbaa###aaaaaa########.####.###.####.####aa#abcbaaa####aaa#############aaaaaaaa#aaaa#ba#babffb#acb#aaaabaaabbccabbcccfgdaa##bcbbaaacbcbacebbbcddbbaaa#a####", "accccedaa#aa#aaa##a#aabda#################a#a#a##aaaabbbabbcccdcccfcfecbaaceca#aacdbcccba#ahgabaaaaababbbccccbaabbbbbbbaaabcb###aca#aabcc##a##########a###a#abaaa#aaabbddddbbbcbaaaaabcdddhecccg######ba#a##.#a###aaceca#cbaaaaacdefhgfcaaa#aaaabba#########..#####...#.#######aaabccbaaa####aa########.####abb##aa#aaa#a#ba#abbefba##bbbaaaaaabbccc#ccddeffcaaaa#baaaaabebbbbcbbbbcbbbbbaa##a##", "#abeeebaaa###aa###aa###aaa###################aa###a#aabbbbcddddccefegfcca#adhbaacccaaabcbcdecaaa##aaacabdabdcbaabbabbaaababbcb#aabb#aa##dea##aa#######aaa##a##aabaaaacacdfebbbbbbabccccfeddfgfed...#a##aa###########acdbabbb#aa#acddegfecbaaaaaaabaa#########...#####.#########a#abbbabba##aa#####.##....#####a##aaaaaaaa#baaaceeebaaaaeedbbbabbbccb#cedddcccbaaaaaaabaa#bebbbbbbbbbbbbbaaaa####", "##aadba#aa##a#######abbda################a#######aaaa#ababccdeeddffhhgccbaabefdbbaaa#aabcbbabca#aaaababbbbcccbaaacaabaaabaaaabbaaaab#aaaaefaaaaaaa#.###a#a#a######bbbaabccabbdcbabbcbcdbbaaaefeiiffa####a#######a##aaaaabbcba#baabdddefffdcaaaaaaaaaa##########...##############aabbbbbdabaaa###.....########aaaaaaaaaaaaabcccbdfebaaaaaacfdccbcddc##baabcbabaaaaaaaaabaaaedbcbcccccbbccbaaaaaaa", "a##aba#a####.######a##bgb#######a########aa#######aaa##aabbcceedddeghiebaaabccebaaaaaaaabaabaaabbaaabbaaabbbbbaaabbaaaaaaaaabbccbbcba#####cfebbabbbacaaaaaa#aaaa###acbbbbbbbbcbaabbbccbaaab#.aceffdfghfa#a####aa#aa##acbacbbbaaaaabcedcddedbaaabaaaaaa#######..#.################aabccccdbbb####.#..#..#.#..########aa#aaa#aaabdddbcababbbdeddedeeb####aaaaaa#ba#aababcbbbaeccbcbcbcbbbbaaaa###a", "ba#a#####a#############cb#########aa##a###a####ab#aabaaaabbbbedcdccehihcbbbbbbccaaa#a#aaaaabbaaaabbbcbbaaabbbccaaabbaaaaaaaaaabbbbacda####aaedbaaabddba#aaab###aa####aaddcceebabbbcbcdca#aaba#aaabaabfmka##aabaaaaaa#abbabbbbaaa#acccdddccedbbbbaaaaaaaa##a####.#.###############aabddcbbcaaa####.#......aa###aa####aaaa#aa##aacccccbbbabbcdedddea####a##aa#a#bccbccbcbbaaaadddccbbbbbbaa#aa####", "ab##aaaa######a##########aa###b##aaaaa##a#a#####ababbbaababbbccccdcdgjifbbabbcccca#aaaaaaaaacaaaaabcccbaaa#bbbcaaaaaaaaaaaaaaaaccbaabbaa#a#a#bcbbaa##a###aaba######aaaaaaddfhgccddddacacaaaaa#aaaaaaabhnk.aabbb##aa####aa#acaabb#aabccddeecccbbbabaa##aa###aa#######.######a###aaaabdddcdedda#########...#####aaaaaaaaa##a###aabcbbccbbbbcddeeefc##a####aaaaaacdccbbaababaaabccdccccbbbbaa#a####", "#####a#aaaaa###aaa######ba###aa#bba#aa#abca##bb#abaabbbbbbaabbbbdccceihgecbcdccbcd#ababa##aaabaaaaaabccbaabbddbbaa#aaaaaaaaaaaaaccbaaa#a######aabdcb##aaa##a#a#####aaaa##aabffebccddcb#aa#######aaaaaadlnd#aabbabaaaaa##aaaa####aaaabccdeedbb#aa##a###############.##..#.#####aaaaabccdeecdaa#####.########.###aaa#aa###aaaa#aaabcbccccbbccddeef##aaaaa####aaaccbaabaaaaaaaaba#bcddcbbbbbb#aaa#a", "abaa###aaaaa##a#a##a#############a#a#ababda#aaaaaaaabbaabbbbcbbbddbddgifhedbcccbbcc##aabbaa#aaaaaaabaabbbccccdebaa##aa#aaaaaaaaaabedaaaa##########becaaaaa#a#########aaa##abceffdccb##aa########a#abbabilk#a#a######ab#aa#aa#####aaabbcddedbaa#a######a#####################a#aaaaaabdddfgfc##########...a#a###aaa#a#aa##a###aaaabbbbbcbbbcceghfaaaaaaaabbabccbbbaaaaaaaa#abba#aacedcccbaaaaa#aa", "bbaa##aa#aaaa#aaaaaaaaa#aaa##########abaaaa#baaaaabbbbbabbbbccccddbddggghhfdbbcaabbbbbaabbaaaa#aaabbaaabbb#bbbaaa#####a#aaaaaaaaaabb##aa##########aabdcbabaaaa####aa###aa#abbcdhhcaba#baaa#######aaaaabhlmc#a#####aaaaa#a##abba#aabaaabcdgfbb################################aabbaabbccdhigca#########.########aaa########aa#a##aaabbbbccbccdgfha#caaa.##fedbbcbaaaaaaaaa#aaa###aaadecccbbaaaaaa", "#aa###aaa#a#aaabbbbbcbaa##a#######aaabaababaa#aaaaabbbbbaaababccdecdfhhiihgfdbccbbcbabaaaaaadca##abbaaaaaaa#bb##aaa####aa#aaa#aaaabbda.##########aaaabddcbbaa#a##aa#aaa##aaabbdecca#a#aa#a########aaaaaeili##a######abaa###aaaaaacfeaabddcdbaa##############################aaabbbbbbcdfgjieba####.#####aa#aa############aaaaa###aaabcbbcbbcefggcbbfeedbedbcbabbaaaaaaaaaaaaaaa#aaa#cdcddcbbaaaa", "aa#a###aa#a##a#aaaabbccaa#aaa########bacbaaaaaaaaaaaabcbbbbbbcedcdccfhfhkhggfdbbccbbabaabaabdda###aaa#aaaaaaacb#########aaaaaa#aaaabec##########aaaaaaabddcbaaaaaaaaaaaa##aabacbaaaba#####a##a######aaabgklbaaa#####aaaaaaaaaaabbbfdaacddeddcbaaa#########aaab##########a##aaaabbcbbbbeffhjifdcb#####.##acbb#aaaa###########aaaa#aaacbcbbcbcegfaccgghgffdcbbaabbbaaa#aaaaaaaaaba#aaaabeecccbaaaa", "aaaa########aaaabbabbbbcbbbaaaa#####.##aaaaaaaaaaaaabbbbaaaaadedcdccegijkifddebccbbccaabaaa##aa######aaaaaaba#aa#########aaaaaaaaa#bccda#######aaaaabbaaabddcba#aaaaaaaaaaaaabcdaaaaa##abaaa#a#a#a##aaaafhlg.aa#a#a###ba##b#acaabcdfaaaccdccedba##########adcbca#########a#aaabbcddccbdefggiigecb########aaaa#abba###########aaaaaa#bdbccbccef#abdeddeeddccba#bbbbbaaaaaaaaaaabcaaaaaa#eedccbbba", "aa#aaaaa###aaaaaaaaabbbbbbbbaaaa#######aabaaaaaaaaaabbaaaaabbbfeccccdfiljigcdeccccbccbccbbaaaa#######a#aa##aaa#####..#..#aaabaaaaaaabacb######aaaaaaabbaaaacddcbaaa##cbabaaaaabcbaaaaa###a##a####a##aababchl#.###a#####aaaaaa#aabbdeaaacbbbbdfdccbabb####a#ddbbbba##########abbbccdcccddefghhfcaaa######aab#abaaddaa########ab###aaaacccccdefd#dbgebcccdcaabbbaaaaaaababbbaaabacaaaaaba#eeddcbba", "aa#aaaaba#a#a##aaababbccbabbbbba########aa#a#aaaaaaaababbaaaaadcccaddfhkjigdcdecccbbcdcecbaaaa######aca####aa#####a#####.#aaaaa#aabababb######aaaaaabbabaaaaabcdcbaaaaaaaaaabbbcaaaa#a####aa####a#aaaaaababjh.####a#####aaa##aaaabdabaaaabbabdeeeddddcb#.##debaaabaaaba####aaabbccdcccddeffgfgcaa##aa###aaaaaccaddca########a#a###aaaccbbceffbaacgeaabbbbabaaaaaaaaaaabaaaabbcaaabaaaabbbccdedcb", "ba#a#aaaaa####aaaaaaaaaaccbcbbaa#######aaaa###aa##aaaaaaaabbbabbcbbefffhjihfcbfcbcbbbcfhgcaaa#####a#deaa##aaaa###############a##a###aaaaa###aaaabbaaaababbbbbbbbedcbaa#abbbbbcccaa##a######aa##aaa##abaa#aabja##.#######a#a###aaabecaaaaaaacccbcaaaabbdddefedcbaa###aaaa#aaaabbbcccccccddfggghdba####aababababcbbddba###a###a#aaa##aabbcccegfbaabcaaaaaaabbaaaaabbaabaacaabbbabbadbaaaaabba#aefc", "ba#a#aa#######aaaaaaabaabbebdbbb######aa####a###a####aaaabbaabcabcccddffjhfdbaefcdbbbbdjkjebaa#####bccb##baba#####aa######a###a#a####aaaaa##a##aabaaaaaaabbbbbbabefdbbcbbbcbbbcbaa####aa#######aaaaadaaaaabbdg###a#a####a#aa#aabccccaaaaaabcdbccaaaaabbdeeedcdcba###aa#aabaaabbbcbcccddddeffffdbaa####abccbb#bbccdbccaa###a#aaaa#a#aabbdcdfgdaaaccaaaaaa#aaaaababbaaabbbbbabbbbbcbcbaaaabaa###be", "fcb#############aa#aaaaaaadegdacbaa###aa####aaa#a####aaaabbaaabaabddccehieabaabecccbbbbbikkgca####acbb###baba#####aa####aaaaaaaa######aa###aaaaaaabaaaaaaaacbbbbbbeffedccbcddddbaaa##aaaa###a##aaa#adba#aaabbie.#.#aa##aaaaaaacecaaaba###a##aabdb#a#aaccccccccbbba###aaa###aaabbbbcccdddedegcddcbbaaaabbabbabbaabbaaddbaa#####aa##aaabbddefgcabagbaaaaaaaaaaaabbaaacabaaaaabbbbabbaaaaaaaaaaaa#a", "bdeba#########aaaaa###aaaaacfebbbbaa###aa#####aa########aaababaacbdeccehhbaaaaaddcbbbbbcgijhea####acb########a##aa#a##a#aaaaabaaaa####aaab###aaaaaaaaaababbccbbbbacbedffedcdeeaaaab#aaa#aa##a##aa#a###aa#aabackc.#.##aaaaaabdefb#a#aaaaa#a####abc####abcbbeecbbaaabb#aaaaaaaabbbbcbcdededdefdcaccbca##aaaa###aaaaabaaeccaaa###aaa#aaabcccdffbbacfc#a#a#aaaaaaabbaaaaeabcbbabbbbcbbabb#aaaaaaa#aa", "##aba######aaaaaaaa##a#aaa#fdaabbccb###################a#aaaabbabccccdehibabbbbcfdcbbbabgihc#a####abbaa##a###aa##a#aaaa##aaa##aaaaba###daaa###abcaaabaaabbbbbccbcbcdcdddggfedbcbaaaaa##a#####aaaa#aa#####abbbbdjb.a##aaaaabeecabba##aabda######aa####aaabbdcdcbaa#bcbbaaaaaaaabbbcccddedefffdcbccbab####a#####a#aaabaabeeba######aaacbcddegebbacccba##a#aaaaaaaaaaaaccbbbbbabaaa#aaabbaaaaaaaaaa", "aa##baa####aaabaaaaa#####aacaababbccbaa##################aaaaaaaabbccbegifaaaabbcecbbbbaadgb#####aeeabc#.######aa##aaaaa#aaaaa###abaa##edaaaa##aabbaaaabbbbbbbccbbdccccdddehhdabbaaaaaa##a###aaaabb######cebcbcgj#aa##abdfggcbbbaaaabdfea####aaaaa##aa###aaa#aaaa#aaabbaaaaaaaabbccddeeddeffeeeefcabaa#aa#####aa#aabbbacccbaaaaaaaabcccdegfbbbceaacb#####aaaaaaaaaaaacccabaaaaa#a#abbccaabbaaaa#", "#aaa#daaaaaaaabbbaaaa####abbaabaabcbbbbb##aa################aaaaabbbddehecacbaaaabecbbbbabaa#####adcca#########a#a##daaaaacaaaaaa###aa#aca#aa##aaaabbbaabccbbbbcddaccdeddecfhgcabaaa#ab#a####a####aaa#aaaabbbcbcijdchihgighedbcbbcdfdabbbbccaaaaaa###caa#aaaa#a#a##aaaaaaaaaaaaabcccdddddeeedeeeffbaaaaaa##aa###aaabbbabcdeabaaaabbbbcdegibabbfaabca####a#acca#aaaaaaababbbaaaa##aaababbaaabaaaa", "#####adcbbbaabbbaaaa#a#a#####aaaabbaaabcbaa#################aa#aaaaabddgeadbcaaaaabccbbbbba#####a#a##aaaaa###aa#aa#bccaabaac#aaa#####a#..#####aaaaaabcbaaabbbbcdccdcddedceefgfccbaaaaaa#aa###aa##accaaaaaaaabbbbdjkfdfgjjhgfeeeeeedcaabaabaaaaa#####ab#a#aaaa###a####aaaaaaaaaaabbccddccccdccdeeegfbcbcaaa#aaba#aaabdcbbbababbbaabbcccdghg#aadbaabbaa###a##acdaaa#a#aa#baaaaaaaaa#a#aaaccbaabaaa", "a##a#aaedbbcbabaaaa##a##aa####aaaababbaabacaaa###a#######a####aaaaaaaccehbbbbcbaaaaacdbbbcb#a#a#a#.####aaa##a#aaaaaaabaaaaab##aaaaaaaa#####aaa##aa##abbaaabbbccbccbcdcdcddeffcaabaaaabba#aa####a##bcbaaaabababbbbejib#abccdcbbccba##a##aaaa##a######a##aaaaa#a###a#####aaaaaaaaabbccccccccccccdeegfcdabbaaaaaaa#aaaabccbbbaccbabbbcddefedea#cd##a#aaab#aaa##bcb###aaa##abaaaa#####aaaaabbcbaabbb", "aa##aa#bhgccbbccbbaaaaa########aaaaabcbaaaabbaaaa###aa#####a#a#aaaabbbbcega##acbabababecccdabaa##########aaaaaaaaaaaaaabaaa####aaaaaaaa##.##abaaa#aaaaabbbbbbbbcdbbccddcdcegeaaaab#aaaaaaaaa####aabbabbcbbbcaaabbcegiaaaaaa##abbcbca##.###aaaaa####aaa##abbaa#aaaaa####aaaabbaaabbbbccccbcccdddedfddcaaaaaaaaaaaaabbccdbbbcecbbccdefged#a###fa######aaaaaaaabaa#######aab#aaaa#aa#aaaaaabcccabaa", "aa##aadafhhfeccbbbaa#aaa##a####a#aaaaaaaaaaaaaaaaabaaaabaa#aa###aaaaaabbcfd#a#acbaaaaabeecdcc#############abbaaaaaaaababbba###aaaaaaa#a#####aa#aaaaaa#aaaabbbabcccehgeecdegebaaaaaaaaa#aaa#aa###aaaaababccbbaa#aabceggaaaaaa#aaaabcb####a###aaba######a#a#####aaaaba#####aabbaaaabcbbbbcbbacceeddeebabdbabbaaaaaababcdccdccdcbbccefecb#####cc#########aaaaaaaaaa##ba#aaaaabbbbaaa#aaaaaabcccdgdb", "##aaacdggggghgdbbbbbaaaaa#aa###a###aa##aaaaaaaaaaaaabcbbaaaaaa#aaaaaaabbbdfd#aaacdaaaaaadgefc#######a#a###abb##a#aaabaaaaaa#######aaa#a########aaaaa##aabbbbbbbbccefhfeeegfbbba#aaaaaaaaaaaa####aa##abbcdacbaa##aabcehfaaaa###aaababa##.##a#aaaca#a#aaaaaa#aaaa#aabcc#####aaaabbbbbadcabbbbbbceedefcaabcecaaabaaababccdcdddccbbcceda#####baeaa#aaa#####ab##aaaaa##aaa##abbbbbbbbaaaaaaaaabbbagig", "f#aaaehhfffeffhfbccbbaaaaaaa####a#aaaaa###aaa#a#abaabccabcbabbbbabbaabbbbcehdaaaaaaaaaab#dgeaa##a###########aa####aaaaaaa######a####aaaa###a###aaaaa###aabbbbbacccdedddfgebcbaaaaabbbaabaaba#########abcbdabaaa#aabcdeibaaa######aaaca######aabbb####aaaaaaaaaaa##bbdb####aabbbbaaaacdcaabbbbcceddeccccaba#aaabaaaabccddddddceddeec#aca#aabebaaa#######aaaba#######aaaaabbbabbbbbaaaaaaaaaba#dii", "hd#aaejiedefeeddedccbaaaaaa########aaa#######a#a#aaaabbaacbbababccbbabbbbbceidbaaaaaaaacbcgeca#############aaaaaaaaaaaba######.a############a##aaaaaaaaaaaacbbbccccedbcfcbbbbaaabbbbaaaaaaababaaa#baaaabababbabaaaaabdfhaaaaa#aa##b#bbaa#####abb##a##aaaabbba#aaaaaacda#####abbbbaa####a#abaabccbdecdbbaaaaaaaaaaaabccceeedcdfgffeba#aa#aa#bcaaa##########aa##a####aaaaa#aaabbbbaaaaabbbcbbbeefh", "ggecdhjkiefeeddcdefdababaaa########aa##a########abaabaabcdabbcdccbcbabbbbccchiecaa#abbbaaaadeca#####a#######aabaaaaaabba###a##.#############a##aaaaaaaaaaabbbccdddbbeccdbbcbbbabbbbbbcbbaaaabccaaaabaabcabbabaaaabaabcefeabaaaaa####aaccb####aaa###a###aabbab#a#aaa##aaa#####acbba#a######aaaabbbbfefdaaaacaaaaaaaabbbcefffeefbed########a##dbaaa#######a#############a########aaaaaaaaaccfgfhdf", "efddegijmkfeeeddccdgdbcccbaaa####a#aaa#####a####a###aabbcbabacccdccbbbbbcbbdfijhbaaaaabb###cedbaa###aaa#####aabbccbaaaaa###accb###a##########aaaaaaaaaaaabcbbccddddcddaaaabbbabbbbbbcbaabbbbbaaaabbaaaaabbbbaaa#ccaabbddheabaaaaa####abca#####ba##a####abcaaaaaaaaaa#aaaa#####bbaaa##aaaa##aaabbaaadfdbaabcbaaaaaaabbacehhhhcaaaa#####a#ab##ccaa########aa#############ba#a#aaaa#aaabdaaeffghgff", "eddcbcdefijgeedcccbbdeccccbaaaaaaaaaa#a#########aaa##a#abcaacccccccbcbbccccdefikibaaaaaaaabbdddca#a#a#aa####aaabbbaaaa##a##aaaba##aa##a######aaaaaaaaaaabbbbbccccddddaabbaabcdbbbccbacbabcbbccbaa#aaaa###baaaaa#a#aaabcdfjb#aaaaaa####abaa.####a##aa####bcbbaaaaaaaa#####aa##abaaa#a##aaaaaaaaaaaaabecbaababaaaaabbbcbcehhcaaa##aaa#######b#.cbabaa#####aa##a#####a#########aa#a#aaabdefffggfefe", "ddcaaabdefhihecdbbbbacdecccbbaaaaaaaa############aa##aa#ababbcbcbbbababccdceeegijgaaaaaba###bfcdc##aaaaa######aaaaaaaaa#aaaaaacba#aaa#a#ba#aa#aaaaaaaababcbbbbbcedabbaabbaaabbbabbdccbbbaabbbbbaaa#aaaaa##aaaaaa#####abcehka##aaa#####aaaa###..a#aba#####abcaaaaaaa#a##a##a###ba########aaaa####aa#deaaa#aaaaaaabbbbbccefcbaba##abaaaa.#a#ba##dc#a#a####abaabb#a##aa##a###a###aaaaabaceecddhhedd", "cccbabbcdfffhheccbbbbbcdfccbbbbaaaaaa###############a##aaaabacbbbbaaaacccddcdefhjjhbaaaabaa##dfbbc###aa#aa######aabaabaabbbbbabdb#aa#a###bba#a##aaaabbabbbbbcbbcedbaaaaaaaaabbbbbcbccbcebbbbaaaaaaaaaa#####aaa####aa#aabdegj.############a##a##a#aba####a##baaaaaa#a###aa#aa########a##a#aaaa####a#eeaa###aaaaaaaaabbcdgfdbaa####aabbcb#aabc###cda#aa##aababcbb#a#aa###a##aab#aaaaababdecbcdheed", "cbbaccbcddeffeedcbbbbbbccffdbbcbabbaaa#aa########a###ca#abaabbbabaaaaabcccddcdgiikjgbaaaaba##afcacba###aa########abbbbaabbbbbbbcbbbb#aa#a###aa##aaaaababbbbcbccdca#a##aaaaabaaabcccbbcbcbaabba##aaaaaba#####aa####aabbbddcdjd.#########.#..#######aba######aaaaaba########aa#######aaa#aba#aaa###aacaaaa##aabaaaaaaabbcefcbbaaaaa##aaacabaaaa###bca#####aaaaacaa#a###a##a#aaa#a#aabbbbcddcccegdd", "cbbabbbbccddeedddcbbbbbbbbdfheccccbaaaa###########aa#bd##baaaabaaaaaababcddcccggijjjbaaabbaa##bcbabba##aa#######aaaaaaabbbbbbbbbcccaaaa##a##aaa##aaaabbbdbcbbcdfbaaa#aaabbbbbbbbbcccbccdedaaa#aaaabbaaaa#a#aa####a#abcccdccfi###########....#######aa##aaaaaaaaaaa##########a###a##aa#aa#aaa#####aaa#aaaa##abbbaaaaabcdefbbaaaaabaa####aa####a#a#dba#####bb##b###########aaaaa#aaabbaabbbccddede", "baabbbbbccccdeedcccbbccbcbbcdiheccbbbaaaaa#aab##aa###aa###aaaacbaaaaaababccccdfhjjjl#abbbaaba#abeaabb######a#####bbaa#aaaabbbcbbabbaa###aa####a###aaaabacdcccdceaaaaaaaaaababbbbbbbcbbbcbdba###aabbbaaa#aa##########aabbabccgb.###.#########.########a#aaaa#abaa#########a##aa#####bcaabaaba###aaaaaaaa#####aaaaaabbbdhidabaaaaaaaa###########a###ebbb###aaa####a###aa#aabcaabbaaababaaabbbbbdcb", "abcbbbbbbbccbbcddbcbbbbbbbbbcfeghfccbbabaaaaabaaaa####a#b##aaaabbaa#aaaaabccbceefhegdedaaaaaaa#abdaaba#aa##a#####aaaabaaaaaaabbbaacc###aa#aa####a#aaaaaaabcccddfbba#aaaaaabbbbabbccccccbcbdaa#####ac#####a##########aa#aabcbdh..#########.#####.####aaa#aaa###abb###########accaa###a##aaabbbba#a##a#abba####aaaaaccegcbbaaaaaaa#aa###.##a########aeaaaa###a#a######aaa##aaaaaaaabbaabbaacaacced", "cadbbbbbbcbccbbacbbbbbbbbabccdeehgffccbcbaaabaaaaaa###a####aaa#aaaaaaaaaaabccbdeeffeehgcaabaaa##adb#aca##aaa#####aaabaaaaaaaaaabaacdb##aaaaaaa#abbaaabbbabbdecffbaaaaaaaaaaaaaabbaccbcbcccdcaa#############aabb######aaaaabbbehd..###d#.#.######.####adbaaaa##abba########aaaaaaaaaaaaa#aaaaaaa#a#aa#abaaa####aaacdeheaaaaaaaaa##aa#aa#####a####a#.cdaa######a##a###########aa##aabb#aabaaabbadf", "cabdabbbabcccdccbccbbbbbbaabdcdefdcfgccbbbbaabcbaaa###aa##aca####aaa##aabbbccccddffhihhfbaba#c###bdaaagaaa#a######aabaabaaaaaaaa#a#aa####aaaa#aabbaaaabbbbbcddfeca###aaaaabbaabbabbcbccbbbccdada###aa######aaba####a###abaabcafjlf..defe##...#########bbaaa###aab#a#######aaabcb#aaaaaca##aaaa####a##aab###a##aabdfiida###aaaaa##ca#aa#####a####a###ecaaa########a##a#####a####a###aaaaaaaaaabab", "ccbbbbabbaaabccdcbbbbbbaaaabcdbbbeeadgeccbbbbabbbaaa##aa#abedbaa####a####bbbcbccddehhhfdaa###da#a#ddaabhaa###########a#abaabbaa######a####aaaaaaaaaabbbbbbcbdeefcb###aaaaaaaaaabbbbccccbbaabbcaaa############aacbaabaaaaaaabccbdejkbd..bgccdcba########aa######aaa#a#######aaaccaba#bcaaba#a##aaa#####abba#aa#aabdgkjkihgdb#.cedcbb#.###dc########b##ebaaaa#########################aaa#aaaaaaba", "abeecbbaababbbabbdbabbbbbaaabcccbdcb#ehedccbbaabbbaaa#abaaaedba###########acbbbcceeeggdaaa#bacaa#aadabbdf#######.#######aaaaaa######bca###aaaaaaaaaabbbbbbbccfffbaaaa#aaaaa#aaaabbccabbcccbbbbaaaaa#######a#aa#acaaaaaaaaaaaabccceglh.#....#baacca..####ab########aaa####a##ababbbba#ceaaaaaa###a######aa##acbbbbchgcddfgjihddigefegfffba#affeecbbaaabda#aa######a#a################aaaa#aaaaaab", "babfdcbcbabaabababbbaaaaaaaabcccdbaaaacifddcbbbbbbbabaabaacecabaaaaa######aaabbcdeeedifba#adcbaaba#bcabbfe#aa####aaa###a#abaaaa######aaaac#aaaaaaaabbbdbbbbcceebbba##aaaaaaa#aaabbbbbbcccdcabaaaaab##a#aaaaaaa######abaaaaa#abbbbddei#####a####.#ee######aa######aaaba######abaaaa#a##bc##aa#a####a###a#aaaabcbbbceecbbcbdeffgfdccccdefeefgffedcefeb##cdbcba########a###########a###aaaabaaaaaaa" }; SIMPLE = T BITPIX = 8 NAXIS = 2 NAXIS1 = 384 NAXIS2 = 384 HISTORY Written by XV 3.10a END 3"3wUD3D3"3""3"3"333""""""""3DDDU3""""DªwUUD3333333"3""3""DfD"3""""""""33DUfffUªw3""UD3""3"3D"33wf"""""""3""""""""D""""""""333U3333DDff333"""""""""""333333DDDUD"3"""""3"""""""""3""""""3333UUfª"�ff"""""3""3"""""3D"""""""""3D333DffD33D3UfwwˆwUDDDDUfwffwˆwwfUDfwf3DU3D3"""""""3""""""""3ffD33""3"333"33U3"33333"""3DDD3UD3f™fUDD33""333""""3"""fU3""D333DDfffˆˆU"""3"D""""U"33Uw�""""""3D"""""""""""3333333DDwww3"""""""""""""33DD"33DDD3333"""""""""D""""""""""""3DDDfˆÝ™�����3""DD"��"3"""""3"3333"Df""""""""""D3333D™ˆDUUwˆ»ª™UUªˆfwfˆwww3""wwffD33"""3U"""""""""""""""3DD3333"33"""3DDUD333333""""3DU333ff"UˆfDD3333"333""""""3fU3"""333D3DDUUf™™™wU""U""UU""3™""""3""33"""""""""""""333333D3UffwD3""""""""""3333DDDD33""33D"""""D3""3"""""""3DD3Uf»Ì3U��3ˆDDUD3""""""""""DD"3"3D""3""""""33"""""3UˆÌ»Ìª™ˆU3�DfUD33�UD3f3"""""""""""""3"D"3U"333"3DDDUDD3DD333333""3UDUfwUDwˆDD3333""3D3""""""D""""""333DDDDUUww™ª™™w3"3"D3U"""ˆ""""""3""3"""""""""""""""""33""""33333DUUwfD""""""33""33"33D3DD333DDU"U"""""3"""3""3D"w»Ýw��Ufwf���33"""""3""""3D3"""""D""""""""3"""3UwªªU""""""D"""""fD"""""""""""""""""3"3D"U333333D3DD33"D33333333"3DDUff™ˆwwDD3D3"""3"""""""""""""""""""""3DD3Uffwwff™ˆD""3""""U3"D"""""""3""""""""""3""DU3""""""""33"""333"33UfDww3""""""""""""""33"DD3D3DDDUD""""33"""""333f™U��U���"U3"""""33"""""""""""""""""""""""""3""""""DUf™f"""""""""""""""�DU""""""""33""3"""33"Uw"3D3333333DD33DUU3D333333333Dwfˆ™wDD33"3"""""3"""""3""""33"""""""3DD3Dffw™fˆUfU""""""""3U""3""""""""3"""""""333""DD""""""""""""3DDDUUw33"""""""3333"33DDDDDD3D3U"""D"""""3D3U™����"""""""33"DD""""""3333""""33""""""DDfˆD33"""""""""�""f"""""""""""""""""33""33""D""DDfU3""33333DDDDUffUDDD33DD3D33DUª™fDD333"""""""3""""""""D3""""""3"3DDDDUw™»»»Ý"333""3""3f""33"33""""""333D33"33"""""""""3"DUDDDUDf""""""""""3"3333333D333D3U3"""333"""""""33"3DDˆ3���""""""3"""""3D""3""3"""""""""""""""333U™ªU"3"""""""""f333""""""""3D""33"""3"3"""33333UD3D33"3333DDUUffUUUD33333333Uw™fDDDD3""""""3U3""""3""""""3"3DUUDDDˆˆª»»»3"""33""3D3"33""""""""""333333333DDD""""""""""""333U3D33DUw3""""""333333333DDD3DDUfU"""""""33"""""""""3DDDUDDwª����""""""""""""""""""""""""""""""333"""""3DUfw33"""""3""""""U3"333""""""""33""333DDUUfUfD33"DD3DUUfwwffUD333333DDwwU33D3"33""""""D""3""333"3"""""3DDDUUDUˆªªÌ»ˆ3""""3""wD"D3""""3333""3333333D3333""""""""""3"3333D3DDUD"""""""3"""3DDD33D3D3""33""""""3"""""333UUDU»U����"3""""""3"""""""3""""""D""""""3"""""""33DfwD33""""""""D"3""""3D""""""D"""""""""""3333DUUDDDfˆUUDDD3"33DUwww™™fDD33333DUwDD3333"""""""""""3"D3333""""DDDUUDUfw™»»™3""""3""Uw33D""""""3""3""33333"3U3"""33""""""33"33333D33DfU3"""""""""33333D3DD3Df3333"""""""""""""""""3Ufˆ»�""""3""3""""""""""""""""""ff"""""""""""33DUˆwU3""""33D3""3DDU"""""3"3D33""""""3"""""3"3UfD3DU™ffUUUD"""3Ufw™ª™fDU3333"DUfDDD33"""""""""""""3"33D3D333"3"3DDUDfffˆª»ˆ"""""3"3wDUD""""""""""""""""""""D3"""""3"""""""""""3"3D33333DfU"33""33"""333"33UDD333""33333"""""""""""""""3Df™Ì""""""""��""3""3D""""""""""3"""""""Uf""""""""""33333DDfwD3"3""3""""�"3"UD"""3""33""""""""""3"DffDUU™™fUUfUUD3DUfwª»ˆffUDDD33UfDDDD3""""""""""""""""3D""DDDDDDD3D33DDDDUfwªÌª3""""""""33UUUD""""""""333""""""""3"""""""""""""""33333DDDDUUUU""33""3DU333DD3"D3"3D33DD3""""""3"""""""""3DUw»3"""""""3""�"""3D33"""""""""""3"""""""""""""""""3fD3""3"3"""""333D3Df™™D""""""3�D3"3""""""""""""3UfwwwˆˆwfwffwUUfˆª»îÌwfffUUDDUˆU3DDD3"""""""""""33D3"3"DDDUDD33333D33Uwª»™3"""""33DfU3"""""""33DD3""""""DD3"""""""""""""3D33DDUUUUDUU""""333"333333D3""33333""""33"""""3333"""DD""33UU™f"3""""""3D"3"""3D""""""""""""""33""""""""""33"""UwU3""3D3"""""""33"Df™™™™D""""""3DD""""3"""""""""3U""fwwˆ™ˆwwˆˆfDU™»ÌªfwffUUDUfwU"3"3"""""""3""3""3DU"33DUDD3D3"3333DDD™ªfD"""333""""UfD""""3""""""33""�""""""""""""333DDUUU33fDDU33D333"333333D33""""3DD""""3""3D"33"3""""3""3Dfwf"3"""""""DD3""""""33"3""""""""D33""""""3333wfwU""""D""""""""333Dfwwwffw3fU"U3""""""""""""""DDwˆw™Uw™U""f»ªfUfwffUUfUDD3"""""""""""""""33""D33"3"3DD33"33333DfªU3""""""""D3DˆfD""""""""""""3"�""""""""""""""D333DDDDfU3DwD3333"""3333"""""""3"3"""3""""3"3"33"3"""""3Uw™"""""""333"""33"""""333"""""""DU""3333""""3""3DD3UfDU33""""""""""""3DDDfffUDUwˆwwf3"""""3D""""""""""""""3333"""""333D333ffw™w"""f™™wwwfww™w3DD33""""""""""""""""""3""3DD"3D3"3333"33""3333Df™U""""""""""3Uˆf"""""""""""""""""""""""""33333"DDDUfUUUwˆf3D3"""""333""3""3""3D3U"3"""""3DUfª3""""""D"""333"""""""""""33U3""3333""""DUD""3333DDfUUfDDDD"3""""3""""3DDUUUUUUDfUUffD"D"""3f3""""""3""""""333"33333"""""""""3"Uªª"""DUˆˆˆˆˆ™ˆU33333"""""""""""""""""""""""3D33"""""""""""""333UwU"""DU""""""UˆfwD"""33""""3"""""""""""""""""33333333DDfw™wfffˆw333""""""""""""""""33DU"D3""""3Df™w"""""""3"3"�""""D""""""""""""""3DD""""33333"UD"333333DffUfwD""3DfD"""3"""3"3DDUDUUUDD33DDfU"3"f""""""3"""""""""33333333"""""""""333"ˆªˆ""""U"w™™wfDD333""""""""""""""""""""""""3""""3""""""""""33DwU""D3"""""3ffDUDD"33""""""""3"333"""""""""""""""""""""333"3DDDf™ˆffDUfˆf3"""""""""""""""""""3"3DD33""""3Dfˆˆ""""""""""3D3"""3"""""""3"""33""""3D3333D33"DDffUUff3"3U3"33""""""3"3DUDDUDDUD33DDfwfD3DD""""""""""3""""""3333"""""""""3DDDUˆU3""""3™ˆDD33DD33""""""""""3D3""""33""""""""""""3333Dfˆ""D3"3"3"3fDDDU"3""""""""""""""""3"""""""""""�"3""""""""33333333DU33DDUUDUDfˆf""""3"""""""""""33"33D333D"""33Dfˆª"""""""33D3D"�"""""""""33"""""""""""33"""3333DDDD3DDDUUUfUwUUD"""""""""""""33DDU333DfD33DDUfwˆfU"w"""""""""3""""3""""""""""""3DDD"3""""""fU33D3"3"""""""""""3"33""3"D""""""""""""DDf™3333D3"""""DU333D3"""�"""""""""""3"""""3""""""""""""""33"""333DD3DD3DUDUDUUfwwD""3""""33""""3D3""""3"3"3333f»ª3"3DDUD33DD3""""""""""""""""""""""""33DDDDDDDDDDDDUffˆwDU"33"""""""""""3DD333"DD3"333DUUfwfUf"DU""""3"""3D3""""3"""""""""33D3""333"UD333""333""""""""""33"""3D3"""""""""3UUˆf"U3D"""""3DD33333""""""""""""3DD""3""D""""��""""""3D3"""3333DUDDUDUUfUDffwˆwDD3"""""""""""DD""""""""3333U»ÌwUwˆ»»™ˆwffffffUD""3""3""""""3"""""""""""""""""33DDUUDDDDUDDUfffˆw3D3D"""""3""""3UD333"3"333""33DDDUˆ™ˆ""U3""33""""DU""""""3"""""""""""""DD3""3""""""U""""""""333"""""33""3""3D33333"""""""333UUf™fD"D3""""3fD3333"3"""UDD"""U"""""D"""""""""D"""""""333""3DD3333DUU"DDUfUUfDw™ˆD"3""""3"""""""""333D3Dª»UD™ª™ˆªˆ™fU3D33DUwU"3333DD""""""D"""""""""""""""""""""3DDDUUUUUfffUfffww3"""""""""""333"3DUf"3""""3333DUfˆª3"33w""3D"""DD""""""""3"333"""""""3"33"""3""""""3"""""3"""""""D""3"33DD3""""""""""33DD3fˆªw""""33DfD3333""Uˆ3"ff"3D�"""""""""""""3""fU""""""33""""3333333DD33UDDDDUUUf™™U"33"""""""""""33Df3D3Dˆ»"""3UwˆˆD333""""3Uwf""""""""""""""""""33""""""""33DDUUffUUfwwffffwD"3""""""""333"DDD3""""""""3DDDUfˆw333Df""D3""""""""""""DDD"3"""""""33DD""33"""""3"""""""""""""wU""33DD3"""""33"3DDDDUf™ª3"3333DwUD333"3ˆª™D""33"""""""""""""""""3"U""""3D"""3"""33333DD3D3DUDUUUˆˆwfU3D3"""""""""""""3333U»3�""""""3ffD"33"""3U""""""33UDUD3""3D33""""""""333DDDUUfUfwwwUD3DD3"3"""""3""3ff3""""D3DUUfˆf33"DDD3""""""""""""""DD33333"3""""""33""""""""""3Uf3"""""""""""Dwf3333"""""""""3"3""D3UfDDf™™3"""""UUD33333Dˆª»™f""D3""""""""""3"""""""3""""""""""3"33DD3333"D3fUwwfUDUff""""3"""""""""""""3"DÌD��""""""3Ufw3""""""""3D"3D33ffD33"""33""""""""3333D3DUfUfUUfwUD"DD3D""""""""""3""fDD"""""""""3DDDUww33"DwD"""""""""33""""f"3D33"3333D33"33"""""""""wD3"""""""""UfˆU"D3""""""""""""33"""3""3UUDDf™ªf"3""3fDDD33333ªÌ̈D""D333"3""""""""""""""""""""3""""""""D333333fwwfUDD3DUUUU3""""""""""""U3""""33ªf��"""""""""DfD"""3""""3U3"""DDDDDDDD333"""""""3333DDDUUUfUfˆDUUD33""""33"33"33""33""UU3"""""""33UUfwˆD"3"ˆ3""""""""""""33"""D"3"""""3333"33"""""""""""""3"""""""""""3""33f3U333""""""""33""3D"3DDDUUww»™wU3"fwDU3333U»Ì»f3""3DD33"3""""""""""""""3"""""""333333"3fwU33D333D333D3"""""""""U"""""33Uˆ"""""""3DDDD""""""3DU3DD"""""33UfffUDUD3"""""3"""333D3DDDUUUUfwwwwU3"""3DD3333DDU3DD""""""""""33UDUwˆU"""DD"""""""""""3"33"""33333"33333D3D3""""3""3f3"""""""""""""""""DD3D33""""""""""""""""333"33D33fwww™»ª™wD3wD3D333Dw™ˆD""""Uf"""""""""""""""""33""""3"33333333fUD3"""33333DDD"""""""""3""""3»"�"""""3fD"""""""DDD3D""""33UUUfwfUD3""""""""""333DDDDDDDUUwˆˆˆ™U3"""3"3"3"3D33UU3""""""""33DDDfˆw3""3D"""""""33"""""33""3""D""333"33"U3"""""33""fwD""""""3""""""3"33DD3"33333""""""""""""3"33"""""UDDD"UUw™Ì»ªˆUDUfDDD33DUDfD3"""""D""""�"""""""3"3"33""""""33"3"""""3DUD3""""""""""333D""""""""""""""3"3»™�""""""""3U"3""""33"3UfffUUUUD3�Uf3"""3"""3""""33DDUDDDUUfwwˆwˆD"""""""""DD"UUD""""""DD33Dfww3""Dˆf""3333"3"""""""""""3""""33D"""3""""333DDUfUD3""""""""""""""""33333333""""""3""""""""""33"""""333wfDDDDUwªÝ»ªˆDUfDDDD3DD3DD33""""""""""����"""3"""""""3"D3"""""""33""""DUUD3"""D3"3"""""3D3""""""""""3"3D™Ý�"""""""""33Uf"""D3333UwUDD3"33"UU3333""333DDUDDDUUfwˆ™™wD"""""3"3""UU"""3""""DDDDDUfwUU3ˆf3DDDUD""333"""""""3"333"""3"D"""""3"ffUUD33"""""""""33"3333D333""""�"""""""""""""3333"""""UfUDUDDfˆª»ÌªwUUf3DD33DD""3"""""""""""3""""""""""""3DDU""""""33"""3UUD3""""""""""""""3DU""""""3""""""""""w™Ýˆ�""""3"3"D""3DUw"""DDUDDfU3""UD3D"""""33DUUDD3UfwˆˆªªˆfD3"""""33"""""""3U3DD3DDfw"3UfUUffUUDD3"33333"""""""""""3D""""""ffUDD333""""""""""""33DD"""""3"D3""""""""""""3D333333DfUDUDDw™w™Ì™ˆˆwU33DD33"3""3""3UU"""""""""""D3""""""""""3fD"""""""3UUD3""""""""""""""3"D3"""3""""""3ˆÌÝ3""""""""""""""333wU""DUUfUUD3""""""3"""""33D3333fww™»ªwUD3�"D33"""""""""""D3D33D3Dfˆw"DDˆˆ™ˆwwUD33""333""""""""""""3"""""3ffDDD3"""""""""""""33333D3""""""3""3"3"""""""33333"""3"3DDUfDUw™™ªª™ˆwU3DD33D3"3""""""UD""33"""""""33""""""""""""33U"�""""3UUD33"""""""""""33UfDD""""""""""fªÝª""3""""""""Dwf""3UUDU3"""""333333DUwˆ»ªf3"�""""""""""""3D33D33DfwˆˆD33wffU3fU3D3"33""""""""""""""""""DUDUUD33""""33"""""""""""""""""""""3""""3"""""33333"3333DDDDUU3UUˆˆˆ™™wU33D""33333""33"""""""33"""333333""""""""""""""33""""3UD3"3"""""""""33DU™™D"3"3""""""""3™ÝîD""""""""33"""3"""3DUˆw33""33""33DDU™ªˆD"�"""""""""3333DD3DDUˆw™"D"""�wfU33D3"""""""""""""""UfDDD33"""""""3"""""""""""""3"3U"""""""""33""3333D333UU3UUˆªw™fU3DDD33DD""33"""""""""3""333DDDDUf3""""""""""""""3fU""""3fD""""""""""3DfwwUDD3""""33"3ªÝÌ"""3"""""""33DUUfU3"""""""""""3UUUwˆwD���"""""""""""""33333D333DDfˆ™w""""""""33"3DD333"""""""""33"""DfUDDD3""""""""""""""""3"""33""""3D"33"3""333333""3333UDDDfª™ˆfD3DUDD3DU"3"3""""3""""""3DD3""33UU33"""""""""""""""DD3""""""3UD3"""""""""""3wwf3DDUUD3""""""""UÝÿU""33"3"""""""""""""3DDUffU33"""����"""""3DDUffDU""��""""""""""""3D3DDDD33DDUUffw""""""""DD3""3""""""""3"3DUUD333333"""""3"""""""3""""""""3"333""3"333DDDDUDUˆ»ªw33"33DDDD""""""""""D"""""3DDD3"""333D""""""""""""""""DD3""33""""3D33"""""3"""""""UUw™ˆDDUUUU"D"D""""""""""""3™ÿÌ�""333"""""D""33""3DDUUffDDD333"3""""""�"""""3UUUDUfUU"���""""""""""""3D33DD3333DUUfffwD"""""""DUDD33""3"3"""3DDUDDDD3333"""3"""D3"""""3""3""""3333fUDUDDf™ª™D333333DD"""""""""33""""333D33"""333DD"""33""""""""""3333"DU"""fU3"""3UU3""""3""""UUDDff3"333D3DUD"""3""""3""3wîÌ"""3"""""""33"3333""""DDDUUUDDfU3333"""""""""��""3UUD33D"""�������""""""""""""DDDDD333"33DUfUUUf"""""3DD3DD3D33""""UUUDD333333""""""3""�"3ˆ3""""""""33DDffUUUfˆ™ªf3"""3DDf3""""""""3""3"""33"""33"""33333"""33"""""""""33DD33D3"Dwf33"333"D"""""""""""D33333333D3""333DD3"""3�"DfwwUwˆ™w"""""""D3"D333"""""3DfUDUUfU3"""3""""""���""3DDDDU333��������""""""""3UUU3D"3"333UfUUfUff3""""""3"""3"3D333"fDD3D3D3D3333"""""""U3"""""33U"""""""3"3DDUffUUww™™ˆDD3""3fwU33"""""3D33"3D"""""3"3333DDD3"""D""3"""3""""33""""3""""fw"""""""�"""333""3DD"33UD3"33D3DU33"""fwfªªww""""""""33D3"3""3UUUfwwwUD""""""""""���""33333U"3"""�����"""""""""""""3DDD3Uwf3""""""DwUDD3DUUD3""3D3"3"""""""""3"""fU3D3DDDDD33DD3""""""""3fff3"""""""""""""""3333DUUUUDDfwfˆwDD""U™3""DDD"""3D3DUfD""""""D"3U"3UD3""33"33"""3"33D3""33""Uf"""""""""3""""D"DUwf333333"3DDDDwfUUwˆwfU���""""DU3"333"""DUUfˆwfD3"""""""3""����""333"33"""�����"""""""""3"""Dfff3""""ffU333"333DD3DfUUUDDD3"""""""3""3f3333333333333"""""DDDDfU""""""""""3U""""""""333"33DDDUDDDwDwfD3""DfD"""DU3DDD3""™ˆ"3"""""3"333DDDD3""3333333"""3D3"D"""3DD""""3""""""33UUUU333D3"""""3DUUU™fDDDˆ3""�"""DfD"D3"""""DUfw™ˆwD"""""""33"������"""3DD3"""""�"33""""""3""33fw3"333""""""33DDDDDUUfwwD""""3"""""3f3333D3333D33333""""""""""""""""""""""""3"""D"3"""3DDD3U™fUwU33"3D"""""""3""""f™f"""""""333"DUU33"""333"""""""3D"""Dwˆ3""""""DD""""""""D3"3DU""D3"""3DUUDDDˆwD""3fˆ�"""""""""""""3""""""Dffw™wU3""""""""����"""3D3""""""""""""""""""3"3"3ww3"D3""""3"""33DD"33DDDwˆU""3D33"""D3D3"Df333DUU33"""""""U"""""""""3"""""333""""33DUUfff3DU3"33""""""""""3DDD3DD3""333"3DD3""""""""33"""""""""3DDDwf3""3""""""33""D"3"3""""3DU3DDwwD"3f™�""""""""D3"3"""DDUUwˆU3""""""""""���"""3""3""�""""""""3U""3"""""3""""333"3333DUUfwfD3D3""33UD3""3DfDDDfwˆD""""""""""""ff"D3""D""3""3D"3"""DUfwDD3"DU3UD"""""""3U3"""33DDD3333333DD3"3D"3""33"33""""""UU3DU3""""""""""""""""""D3"3UD333f™D""33f™""""""""Dw3""""""33UˆU3""""""""""�"""�"""33"""""""��"3""""""""333"3333"""""33DUUUUUU3""3DfUDD3""UwUDDffˆˆU3"""""""�U™U3"33U"3"3"UUD"�"""3"D""""Uˆ™wU33"3fDU3""""""""DD"3"""D"3"3333333D3D33D3"""""3"3"""3""33Dw3"""""�"3"""""""3"""333"3UD"3fw3D""3"3™f""""""""33""""""333fwD3""""""""""""""�""33""""�"""""""""""""3""3""""""""""333DDDUUf3333UfUfwUDDDDD3Dffˆ™ˆwU""3"""3™ˆU"3"3"3DUU"""""""""""""3"3""""U™™ªˆf3"3wUUD""""""""""""3"""""""3D333D33DfD333"333""""33"""""3""3"Uf"�""""""""33"33""UDDˆ™333"""3wª"""""""""3""""""""33"DwU3"""""""""333"�"""""""""�"""""""""""""""""""""""3""""3D3333DDDDDffDffffwfUUUD33Dffww™ˆwf3"""w™ˆD""""""3DUUD""""333"3"""""3"""fªªª™ˆ33ˆfUU"""""""""33""333"""""3UDDDUUUUDD"3333"D"""""333"""3"""DUU"��"""""""""fD3"333DDDwˆ"""""""fª"""""33""""3"33"3"3UˆfD""""""3D333""�U"""""���3"�""""33"""""""""""""""""33333D3DDDDfwˆffDD3DD3333Uwªª™ˆˆˆf3""""ww™™™f"33D"UUUD3"""""3DD""""""""""3U™ª™ˆUUwˆwˆD"""""""333"333""3""""3fUDfwfD333333"333"""33"DUD""""33U3"""""""""�"""""U33""3"UUDˆˆ3""""33Uª""""""""3""""333333""Dfwf3""""""3DDD3""""��"U�"""""""������"33""""3""""""""""""""3333333333DfUUffDD3DDDDUUw™ª»»™ˆˆˆ™333"U™ˆ™™w"""""3""DDDfU"""""""""""3"333DDUˆ™ˆwfUˆwˆD"3"""""""3"3"3""3"""""3UDDffffDU333"3"3333DD33333"3U3"3D3"""""""""3""""3"3D33""3fˆˆ™"""ˆ»"""33""33333"333"3D"33""""3DUUDD3"�DD""""""""""�������""""""""""""""""""D""333333fDDDD33DDUUDDUfˆˆ™™ˆwffˆU3UUDDDUˆˆ™ªˆU3""3""""33D3U333"""""""""3""3"3DUfˆªª™UˆˆwwUD3""3333"33333"3"""""DDUDDUfˆfUDD333333D3333""U3"3""DU3""""""3""""""""3"333"33wªf"""""""D™Ìf���"""""""""3"33DD33D3""""33D3"3DUffUD3""""�3""33""""""""33""3"�����"3""""""33""""333333"DUD3333D3DDDDD3UUUffUfUfˆfUUUUDUDffUw™™wD3""33""""3D""DD3D"""""DD333"3DUwww™ˆªwf™wf333"33DDD33333333""""DDUDUUwˆ™wfDDDD3333"3DUUfˆD3DDUD"""""""""""DD3"""""33DD33D3Df™3D33"3Uf™f""""333DDUD3DD3"""DDD3DDfwwfUD33""""""3""""""3"3D3333D3""��""""""""""""""""""U33"""DDD333333DD3D3DDD3DDfffffUfUDU3DDUffD3UˆˆwUUUfUD"DU"""33""D""""""""3D"3"3DUfffUˆªˆUwˆ33D33333DDD33333"""""""""DDUUUUfwUfDDD33D33UUD3DDUUfUD""""""""U3""""333D3D"33UDUD333D3"""33wª"""3"""3333DDfUDDD3"""33333fwˆª™wUDDD3"""""""3""3""""""3""""""""���"�"""""""""""""""""""""33"3"""""3D333333333333333DDUfUUDDD3UDDDDUUfDD3Dww™wUUUUUDD"U3""""33""3"""""33""DUUUwff™»ªwˆ™"""3D3"DUUDD33333"33"""""3DDDfwˆUUUfwwffDUfU3333D3"""""""""""""3"""""""333""33wD3DDDDD3""""33w»ˆ"""""33"""33D3UfUDU33"""333DDfˆ™™ªªfUDfU33""""""""3""""""""""""""""""""3"""""""""""""""""3333"333333333333UUUDDUUDD3D333DDDUU3DUwUUUDDDUUUDfD33"""3DD"3""""""""33DDUfUffUDª»wˆˆw"3""3333DDUUDD333"3"""""""""333ˆª™ª™wwfUDD33333333"""""""""""""""""""3""3333"DDfˆ"DU"""3"""""33wf"""33333"ffUUUD3"""3"DDfDDfwª™UDDfUD3"""""""""333""""""""""""""""""""""""""3D""""3D""""3333333333DUUD3DDUUD3333"3DDDUDD33UUDD3DDUDDUDf3D33"3DD3DU""""3DUUDUUUfˆˆªª™™™U""""3DDDDffUDD33D33DD3DDUfffˆˆwfUUDDUfDD33""""""""""""""3"""""""""""""3"""3"3Df™3"UD3U33""""3UDf"""33333"DˆfffDD"3fUD"""Uw™DDUww3333"""""""3333"""3"""""""�"""""""3""""""""""3DU3"""3D3""3""33"""3DUfU333DUUD3333D"333DD3333DUD33DDDDDUUUUUU3""3333UD""""""""3DfUfUD33ˆªª»»™D"33"""""DDUUUUDDffUUUUUUUfffwfU33D3DDD3333"""""""""""""D""""""DD""D""""""33DDUˆ™DDˆˆwD"3"""""DˆˆU""""333""33UffwfU3""""UU"""33D™fUffwfU3"""3""33""3"D3"3""""""""""""33""�""""""3U3"""33""33"33""3UfUUD333DDDDD3333""333DD33"33DDDD33DDDDDUUUfD"""33DDD"""""""3333ffwwffDDw»»ªw3""3"""333DUfDUfwwU3D333""333DDDD33UD3""""""""""""3"""""3D"""3""""""""DfU3DUwª™w™ªw3"""""U™D""""33"""33DDDDwfD"""DD""""""DDwwUwDDfU33"3"""""33"""3"3"3"""""33""""""3""�"""""33""""""""3""3"""333DUwfU3DDD3DDDDD"333333"333333D3DDUD333DDDDD3DUwU""D3"3D3""3""""""""333fwfUDUwwªª™™D""""""""3"DwwwfwfUD33333""""33333333D""""""3"""""""""""""3"""3"""""3""3DDˆ™w™ªªf"""""""3Uˆ"""""""""33"""333DUUfˆUD33"""""""""33wfUwUUfD333333""33"33""""""""""""""""""3D3""""""""�""""333"""""""3"""3"""33"3DwfUD333D3DDDDDD3"33"3"""""33DD3UfU333333DD3DUDDUU3333""DDD"D3"""""""""""DwUD3DUfˆˆ™ªˆ3""""""""Uw™ˆfUDDDDD3333333333333333""""""333""""""""3""""""""""""""""""""3Dwˆ™ˆª™w3D3"3"""33ˆf"""""3"""""""DDUffUUwU3D3""""""3""w™ˆˆˆwfUDDDDUDD3"""3""""""""""3""3D""""""�"""""3""""3"""""33"""""3UffDDD33D33DDDDUD3"3"""333""""333"wf3""""3333DUDDDDD3"33"33DDD33"""""""3UfDD3UUfff™ˆD""""""UU™ªwUUU33DD3DDD3333""""""3"3"""""3""""""""""""""3"""""""3"""""""""""3Dfwª™fwD""""""33U™""""""3""""33DDUfwfˆwwUDDD"""""""""33f™™™™wwwwDUU3UDU333""D��33""3""""""33""""""""33D"""""333""""3UwU3"DD3DD3D33DDUD3333""""3"""""""33D"3""333333D3DDDDDUU3"3"DD3"33U3D""""""3UDU33DUUUˆ™D3"""3D"DªˆˆˆfD333D3D33"3D""""""3"""""33""""""""""""""""""""""""""""""Dfˆw"""""D""""D™wD""""33"33"3DDUUfwUDfwwfU3D""""""""3333DUfˆª™™™™ˆˆˆUDwwfD"3"""""�"3D"""""""""""""33"""""""""""3D"""""333333Uwf33"3DDD3DUD33UD33""3"33"3""3""""3333D333333333D33333DfDDD3"DDfU"""3UUD"""""3D333""3Uw™wUD"""DUD"3UwfffUDDDDD33D33"""""""D3""""""""""""""3""""""""3"""""""""""""333wˆ"""U3"""""""f™"""""Uf"""""3ˆ3"3"DfwU3UwwwfUDD33""""""DD33DUfDUˆˆª™ª™™wUwwD33""""""��""3"""3"""""""""""""""3"""3""D3""�""""""3""""DDDfwU33"33DDD333UDDU3""3333333"""33"""""3D33333333333333"""3wUDDD3D3"""""DUDff3"""""3333""3Uˆ™wD3"""DUUUDDDDDDDDDD33"3"333"""""""333""""""3"""""3""""""""""""333D33Dww"""D3""""""""DfD�""Uf""""3ˆU"3"3UwU""UwˆˆfUUDDDD333"DD33D3DUUUUˆˆ™ªˆwwww3"33"""""3"""""""""""""""""3"""""""""""""D""""D3333DUfwU"33""3DD3333DDDD3D3"""333""""3"3""""3DD3333"3333333"""""3UD"3UD""""""33DUwwD3""3"""333"""""3Dˆ»w333DUUUD333333333"""3""333"""""""""""3"""""""""3""""""""""3D3"33DDfU""""""""""""333fD�""""""""""U™D"333ffD3"""UfwˆˆwfUUDUUDDDDD3DDUDDUUUfˆ™ˆˆfffUUD3""""""33""3""""""""""3"3""""""3"""""""333""""""33DwwUD"33D333DDD33DDDD3""""""3333""33"3"""""33"3""3"3333"3""""""""333"""""3DDf™U3"""""""33""""""3UˆªfDDDD3D3"""""3""""""""""3"""""""""3"""""""""""""""D3""""""""33333DU™3"""""""""D3wf�"""""""U™D33""fw3U3""DDUUwˆfU3UUDDDD33DUfUDfDfˆˆwffwfwUD3""""��""""""""""3""""""3"3U3"""""3""3D3"""""3UwwD"333"33D33D3D3DUD33"""3333333""D"3"""""""""3"333"33"""""""""""""333"""""333DfUUD3"""33333"""""""3DUwwUD"33DD33""""33333333""""""3"""""""""""""UU""33""""""""""""""""3333UˆD""""""""""3"Uwˆ3""""UªUDU3"DfD""""""""3DUfffDDUfUUDDUUf"UffwwwwwwwfD3"3"��"""3"""""""""3D"""3""3D3U"3""3333"""3U3""""""""""DfwU333333333333D3DDD""""3"""33""3""DD"""33""33""33"""33"""""""""""3""333""""33"3DfUD33"3DD"""""333""33DfwwDDD33D33333333UUDUUU333"3333"""""3"""""""Dwf""""""333""""""3DD""""3"""""""DDDˆU333"""""333U™™3"fªwUU33DfU"""""""3""3fwwwDUUUDDUffffUfwwfwfUUDD3"""""���"""3"""""""3"""3DDUUDDD""3""3"3""3DD"""""""""""""Dww3333333333333333DUD""""33""""""33""D3""""""333"33"33"""3""""""""""""""""""3333DU3"UDDU333""33333D33DDUfffUf"3DDDDDDDDDUffUwUUDDDU3D3"""""""333"""""""""DD"""""""""33""3"""""""""3DUfU3D3"""""""33U™ªf�"wˆwwfDfDfU""""""""""DUUfDUUDUUfwffˆfwfDD3DDDD3"""""��""""3"""""""""33DDD33DD33""3""""3D33""""""""""""""3UwU3333"3333333333DDDD"""""""""""33333""""""""""3"3"33"33""""""""""""33"3"""""33D33DUfUwˆˆDD3"""3333DDDD3DDUUfUUDDUUUDUUfDUUfwwUUfDUUDD"D3""D3333""3""3"""""""""""""3""3"3""""""""""""33DUf333"""""3"3U™w""wfDwwwf3Df"""""""""""3ffUUUUffˆwwUDwU33"3DDD3""""3"""""3""""33"""333""33"""""DUD""D""""3D"""""""""""""""Dff33""3"333333333DDUD""""33""""333""""""""""3""""""3"""3"""""""""33333""""D33333DDDUUfwU""3333DD3333"33DD3DUUUUUfffwwfwDfUwwfU3"3fffDUUD3DDD3U333"333"33""""""""""""""""""""""""""""""""33UfU"""""3""""""33ˆ™""3fD"DDUwˆUUU"""""""3"""""UUffDUDUwfffUUD"D333D33""""""""3"D3"""""3""3"3"3"""333U3"D""3D3""""""""""""""3UU3"""""3"33333"""3DDD3"3""""3""""""""""3"""3""""3333"""""""""""333D33"3DDD33"""33DDDDU3"3DD33333"""33DUUD3DfffUUfˆˆUUw3DUffDUwwfUUUfUUDDDfUDDDD33DU3"""""3""""3""3""""""""""""""33DUw"""""""""""""3ˆf3™D3DD""3Uff"""""""""""3DffUfwfffUffDD"33"3D33"""""��""""333""""""""""3"""""""D3D"3D"""""""""fU3"3"""""""33"3"3"3DD3""""3""""""""""""""""""33333""""""3""""""""DDD33D333""""3U"""""3D""3D33333"""3DUUD3DUfwfUwwfU3UDDUffD""wwwUUUfwwDDD3DUDDDDDDD""""""3""D""""""""""""""""""""3""""3"3Ufw"""""""""""""3DDˆD""3ˆDUfD"3™ˆ3"3""D"""""3fwUUwUUU3UU3""D"3333""�"""""""D3""333"""3"3""""D""""33D3""""""""""""""3fD""""""""""3""33333U3""""3""""""""""""""""""3D3""3"3""""""""""3DDDD3""3D3DD""""3"33"33"3""""""3DDD3"DUUfwwwUDD"3DDUfU""""3UffwwˆˆˆfDDUUDDUDUD"""""D""""3""3"""""""""""""""""""""""DUˆD"""3"""""3UD™""�DwD3D3"�3wwD333"3"""""DffUUU"3D3""""33"33""""��"""""""DfD33D3"""""3"""""3""fD3DDUD"3""""33"""""""""""3UU""""""""3"33333U3"""3"""""""""""""333333D3333D33""""""""""3DDD333D33"""""""""""333"""""33DDDUfwˆªfD3"""""33"""wwˆ™ª™wDDUUUUUfD""""3""""3"""""""""""""3""""""3""3DˆD""""UU"""""DUUf"fˆ33U3"""U33""3D"""""DwfffD""""""""33"""3""""""""""3UUw3"""3"3""""""""3""DfwˆD""""33"""""""3Dw""""""3U""""3333U3""""""""""""3D333333"3""333333""""""""�""""""DfDD333"3"""""""""3""""""""3DD3DUUUˆwU""""""""""fˆˆª™ˆffwfUUfD""""""3"3D3333""3"""""3"D3""""3""""3"Uˆf""""""""33ff""3™ª3"D"""U3"""""D"""UwUUwU""3""33""3""3"""""""3UD3DD3""""3""""3UwffD"""""""""""""3Uf"""""3"""""33DD3""""""""""""""3"""33""""3"3333""3""""""""""""""""3333333"333"D3""""""""""3DD3UfUDfw"DD""""DDDD"""""3DUUwˆfwffwwf"""""""33D3D33D3"333""33""D""""""""""DwD""""""DUff"fªwDDD"""DD"""""3"""3fwwwU"""3""""""""""""33D3DU33"""33"""3DDUD"���""""""""3DUD"""""""""""33DU3"""""3"3""""3""""""3"""3333""3""""""""""""33"""""D3"""DDDUU3""""""""DDDUfwfwfwU"D""""Dˆf3DU3"""D33fˆwU3""3""""""3DU3DD33"3D3333333""33"3""""""""3DU33""""""3UUˆDUD33DwªU3D3"""""3""""""3"""""Uwwwf"""""3��""""""""""D3"D""3""""""""DDD""""3DfD""""3"""""3""""DU"""""D""""""3""""""3""""D3333"D"""""""""""""""3""3""""3UUDD""""3Dwˆˆ™™™wUwwwD"D3"3UfDD"3D""3""fwwf3"�""""DD333"3D333""""3"3333333""""""""3ff"""""""""""3wˆU33UU™™DD3""""""3"""""""""""""3wwˆUDU""""""""""""""33"3""""""""33D"""""""�"""3DUD""33""""3"3"3D""""""3D"""""3"""""""D""""3""33333"""""""""""""3""""""DUU33D""""""3UªwU"UffUUwww""3UUU3"""""3U""""""DwfUD""""""""DDD33"3333"""333333333"""""""""DUUU""""""33ªDDffUˆ™D33"""""""""""""""33"""Uww3"wˆU""""""""""""""""3"3"""333D3�"""""""��"""33DUU�"33"""""""""33333"""""D33"3"""3"""""""3""333"3""""""3""""""""""3Uf3D"""33Dwˆw3"DUDDUf™f""Uˆf""UD"3""""3UfUD3"""""""333DD3""3D3""3333"33"333"""3"""""3UU3D3""�"DDUffU3DDDf»D3"""""""""""""""3333""3U33D™w""�3"33""""""3"""""""33DUD��""""""""���""3Uf3"3333"""""""""3DD"""""""""333""3"""""""3"""33""33""""""""""""""""""DD"""33Dfw3"33DwDUUUU3"3ˆw""""""U3"""3UfUD"""""""""""3333""D33"33""33"""3"33""3"3"3"""""""DD3333�"33"DUDDDˆ3"333DªU""""3"""""""""""3DD""""""D33"3ˆˆ3"""��""""33D3"""""""3"""33DDDD"�"""""""""���"3UfD"33"""""""""""3D3"""""3333"""""""33"""""""3"""""""""33"""""33""""""""""""""DUfˆf""3""DD3"""DfwD""""33"""UwU33""�"3"3"""3DDD"""""3333333"3"""3333"""""""3Uf""333"""3UfUD3"33ww""3"3™U""""""""""""""""DfU3"3""3"3wˆˆD"""���""3D3""""""3""3"3DDUU3"���"""33""""""���"DfD3"33"""""""""33D"""""""33"""""""""""""""""""3""""""3"""""�"�3""D""""D""""""""DUwwˆ3"""3"""""f™U3"""""""""Dwˆ3""�""""33"3DUfD3""33"3333333"""3"3"""""""UU3"""""3""3DDDDDD33""3w™""3"3ˆU�"""""""""""""""3"DUUU3""""""UUfU"""3"��""3UD"""""3"3D"333DUU3"���"""3DD33""""""3fUD3""""""""D3""""""""""""""""3"""""""3""""3"3"""3D"�"""3333"D""""3DUDf™w""""333"""3D333"""""3""DfˆU""�"""""3333DDDD3"3"3"3D33333""33D33"3"""""""Df33"3wwDU3D33D33D""""333™3"33Dff�""""""D""33"""""""3DD""""""3Ufwˆf""""Df"""3UwU"3"""""3"3"Dff3�����"""333"333""3"""��3f""""D""""""3"33""""""""""""""""3"""""""""""3"3""""""""3fD"""�"33D33""""""3"3DDwwwD"""""3""""""33""""""3"""33wU""�""""33DD33DD""33""33333333"3"""33333""""""DU3""""33"D33D333""3"""33Df"3DDUf�D"""""""""""3"33"3""33UfwfDU""""""fD�""""""""DUD3U3"3UwfˆUUwwU3"���""3333"33DD33"��3D"333""""333UUD""""""""""""""""""""""""""""3"3""33"""""3D3"""3D333"""""33""333UˆU3"""""""""3""3"""33"""UU3""""33""DDDDDD3"""""3""3DD33"3""3D3333""""""DU"""""3"""33D33"""""3D3Df33DDU�"3""""""D3"""33333"""33U33D"3""3D���"33""""""DDDDUfDUfwˆ™ˆwDDDD3�����""""33"3UU3"���33"3D3""""33DD"""""""""""""""""""""""""""3"33""3""""""""3"""""""3D3"33""""3""333DwwD"""""""""3333"""""""""3U3"""""""33""D3"333D""""""""333"""3"D3DD333""""""""33"""""""""""3333""""""333"Uª"33D�D""""""33DD33"33"""3"3"""""""""""""""33""""3D333DUUDfw™ˆDff""33""333333D3""�"D"""DU3"""""""33D33""""""""""""""""""""""""""""3"3"3""""3""""""""33"""""""""3DD3"3""333""333DUˆU3"""3U33""""""""3UD3""""""333333333"3DD""""""""D333DDD3DDDD33""""""""33D"""""""""""D3"3"""""""DD33»ˆ"3D33"3"""33DDD3"333"""""""""""""""""""""""3D3""""333DDUfffwf3"DD33333�"�"3""33333D3"""""3D"�"DDD3"""""""3"33D3""3"""""""""""""""""""3"""3"3"33"""""""""3""3"""""""33DD33"""33"""3DDUwf3"""""3D"33"""""UU3"""""""""""""33D33333DD""""""33333DDDDD333"""""""""""3D"""""""""""""""3D""""3""3ˆªDDf�"""""""""3"DD3""3"""""""""333"""""33"""""""""""""3DDDDUUwf3"""""33""333333""""""""333D"D33"""""""""333DDD3""""""33""""""""3"33"""""""3"""""3"""""�""33UD3""3333""3DDUfˆf"""3D33""""DDD"""""""D333"33DD33""DD"""""333DDD3D3DD33""""3"3"""""3D"""""""""3U"""D33"w™ˆ3w"�"""""""""""3""""""""""""333""3""3"3"""""3"D""3DD3DDUff"""""""3��""333"""""""""""3DD"DD3""33"""""""33DDD""""""3"""""""""D""""""""33""""""""""""""""""D3DDD333333333DDfwwf3"""DD3""""3UD""""""""""""""3"""""""""333""""3"3DUUDD3DDDDD3""3"""33333D""""""""33"3D3UˆfwffU"""3""333"""""""""""3"""33""�"""""3D""333"DD33UD3DUfU3"""""3"""""""""""""""""""""3DffDD""""""""""33"DDDD"""""""""""3"""""3"""""""3""""""""""""�""DDD33333"333DDDDw™f""""33D"""""3D""""""""""3"""""""""""3""""""DUD3""3D33D333"33""3333D""""""""""D"3DDUfˆˆ"Dˆf�"""3""""33"3"""""3"33"""""""""""""""""""3U""""333"D3DU33DUfD""""""""""""""""""3DwˆD"3"""""3"""""""3"333DDDD""""""""""""""""""""""""33"""""""33""""""""""DDD3333333"3DDDDf™3"��"33D"""""D""DD""""""""""""""""""3""""DU3"""3333333""3333D3DD""""""""3"DD3UDDfˆfDDww33""�"3""333"""""""""""""""""""""""33DD"33"3""3"UUD3Dff333""""""3"""3"""""DDˆˆ3"""""""3"""""3""""""33"33DDU3"""""""""""""3"""""3"33"3"""""""""""�""""33DDD333""333DDDDˆf""�"333""""33""33"""""""""""""""""""3333"3""33""3333D333D3"333"""""""""3fDDDDUUwˆfw™ˆ"DD"""33"3333"3333"""""""""""""""""""""""3"DUDD"333DfD""DUwfD33"""""""3""""""""3"""3fˆˆ3"""""""""""""""""""3DDDDD""""""""""""""""""""3""""3"""""""""""""33�"""3DDD33""""333DUUff3""""�"3D""3""""""""""""""""""""""""""3D33""""""""333333333DD"33""""""""D™U3DDUfwf™ˆªf333"""""3"""3DD"D3""""D3""""""""""""""3""""DfUU3""3D3f33fwUD"""""3"3""�"3"""""Dwˆ™UD"""""3"""""""D3"3"333U3"""""""""""""""""3"""""""3"""""3""D"""""3U3DDD3""""33DDUUffU3"""""""""3D"""D""""""""""""""""""""""""""33"3""33333"333D3333D"3333"""""333fªU33DDf™fw™™D33""""""33"""33D""""3D"""""""""""""�"""3""D3fUwU333UDDDDw™f3""3"""""D"3"U""�""""DwUwU"""""""""""D"""""3""3DDUf"""""""""""""""""3""""""""3"""�""3""333D33DD3""""33DDUUffUD""3""""""�"""""""D"""""""3""3""""""""""""33"""""333"333D33DD3DD3"3"""""3""3f»wUUUUf™UU™ˆU333""""""333DDD""3"""""""""""""3D"""""fˆfUUDfD"DUˆ™wUDD3"""D3"3D3"D33"3DUD3ff3""""""""""""3""3UDUD3"""""""""""""""""""""""""""""""""3""""3D33""""33DDfffff"""33""""3"3UU3"D3"""""3333333"""""3"""33"333"""3""333"D3D333D3333"""""""3"""ˆÌfDUffˆwff™wD33"""""""""DDUD3"DD3"""""""""""""""3D""""UfUU33UDUfªˆwU3DDD3""D3"3D3DU""""""�""Uf3""DwUD""""""3"""""3DDUU"""""""""""""""""""""""""""""""""""""""3"3D3333DD3"""3333Uˆwwˆ3""333"""""""""33ˆf"""3D"""3D3"3333""""""""""3""3"333""3""333333333""""33"""""""U™ªUUUUUw™Uwªˆ3D3"""""""""D3DwU"3"""""""""""""33"""""3DD"""3UD"""fffwfUUfwD3333""""3D333DU3""��""3U3""3DfwU""""""""""""""3"DfwD""""""""""""""""""""3""""""""�""""""""""""""3"""""33D33"333DDffUwwU3""3D"""""3"""""Dfw""3U""�"""333D3D3"""""33""""3""""3""333""333""3333"33D33"""""""3™»ˆDDUUUfwU™™f"33"""3"3D33"3DUf™wD""""""""""""""""""""""3DU""3333"333fwfUfDDUUD333""3"333DDDD""""""DfU"""3wf3""""""""""UfwfUfˆD""""""""""""""""""""""""3D3""""""""""""""DDD33DDUDUfU3DwD"""333""""""""3U3""fU""""""333"33"""""DUU3"""""3"""""""3D3""333""333333"3"3""""""Uª™fDDDUfUff»ˆ""3D3"""""3D333DUf™fˆˆf"3"""""""""""""""""""""DD3""3UfˆfUUUUUUUDD3333""3""3D33"""""��"""3fw3"3Uw"""""""""""UwffwwwwD"""""""""""""""""3""""""�""""""""""""""3DD3DDUfUfwf33fw3""""""3"""""""""""""U""""333"""""33""""DD33D"3333""""3""""""""3333"3333""3D3"""3ªwUDDUUUfwˆ»f"""3"""""DD33DUUw™f™ª»™U3""""""""3""""""""""""333""3fwªˆwwfwU3DDDUD3""D33U™™wf""D3"33""""""U™ˆ3""3fD"""3"fˆwfwˆwfD"""""""""""""""""33""""""�""""""""""""""""""33DUUUDfUUfffDUw3"""""333"""3""""""33D""3"33""""""""333""""3D33"33"""3"""""""3333"""3""333D"""""""�3™wDDDUUUfwªˆD"3""""""""DDDUfˆfªª™Ìª™™»™33""�""��""""""""""""D""3""DfwfUfw33fUD3"DDU3Dwˆªª™™wUfD�"UU33""""""""UˆfD""Df""""""3Uˆffˆ™ww3""""3"""""""""""""�"""""""""""3""""""3"DUUfUUwUDDfwwwU"""""33""""�""""""""33U3""""3""""""3"33""333333333""""""""3D3"""3"3333D3"""3"""w™UDDDUDf™ª™3"""3DDUfwˆˆªˆÝÌ»»™ªª™3"DˆÝÌ»™ªª™ˆf3D""""""""DU33Ufw™wU33ffU3DD333"3UD3ˆ»ªwfwfUfˆˆwˆw""""�""""""Dww3"�"3UfD""""33fˆwwˆfU"""""""""""""3""""""""""""""33"""""""3DUDffwwfUDDwˆfUD"""""""""""��"3""""33U""""""333333"""""""33333""""""3DD33"""3""3333"3"""""""""""""""™ª33DUDDˆ»Ìˆ"""""33DUUfˆÌ™UUˆª™™ˆ™ªª3UªÝîÝ»»»»ªªª™w""""fffUD33Uˆ™wU33UwfUwfUDD3333U3ww™wfUfUffw™™wDDf""""3UwU"�"�"3Uw3�"""""3"UfwfD3""""""""D333""""""""""""""""""""3""""""""3DDDUUUˆˆfU3UwDDfD"""""3""""�""33"""3D"""""3D3""""3""3""333"3""""""33DDD""""333333"""3"""""""""3"�3ªˆ333DDUªÝªU�""""""""333DfÌîÝ»ˆUwªª»ªÌîÝîÿ̈UffwfffˆªffUUˆUDˆ™ˆU3"3DwUf3DDDDfwwˆˆwD33333DfwˆfUUUDDfffwUfUD3DDfwˆ33"3fUD""""""3DU"�"""""3DUDU3"""""""3333"""""""""""""""""""""""3""""""3DUDDfDDfwD"UˆfDff33""""""""3""""3U"""""""""33""""3""""""33""""3333""""""33D3""""3"""""""""�fªf3333Dwª™D�"3"""""""""3fÝÝÌ»ÝÌ»ÌÝîÿÿîÝ̈wDD33UUUffwˆ™»ª»ÌÌÝÝÌ™UDwf"3D33D33Uˆ»»™ˆfDDDf™ªfffUfUDDDfffUUUUUfwDUwwDfU3"DUfD33"3""""3"�""""DDDU33""""""""""""""""""""""""""""""3"""333UUUDDU3DUUDDDDDUU""""""""3""3"3"""""D3""""3""""""""""""""33""33"DD3""""""""""""""3wˆ3""33Uª»f�"""33"""""""3fÝÝÌÌÌÌÝÝ̪ªªˆwUDUD3"33D3DUD3Dˆª»Ì»™™™™ª»»ªDUD3D3UUˆ™wwfffª™ªˆˆwˆUUfUDDD3DUDUD3D3D3"3"Uffwwˆ™™™f3fˆUUU3""3"333D333""""""""""""""""""""""""""3D3"3DDDDUDUUDDDDD33DDf3""""""""""33""3"""3"3"""3""""33""""""""""""""33D3"33""3""""""""""""�"w™U33""3wª™3�""""""3""""DDÝÝ»»ªª»ªˆUUfD3""3DD3"333U3"UD3fwwwwfwwˆˆ™™™ªˆ™ˆw™ˆwwD"""3"3U3333DwUUUUD33333DD"3"""""""3"3UUf™ˆˆwfˆ»ªfU""""""�3DUDUU3"""""""""""""""""""""""""333"33DDDDDUfUDDDDfUDDUf3"3""""3""�""""D"�""""""3""""""3""""D3"""""""3""""3D3""3"""""3"""""3""""�D»ˆD333"Uªª3""""""""33"""""3U™Ýª»»ªªª™wfwD3""333333"3"3UfUwUUfUDD3DDUDD3DDUDDDD3"""""""3"3DDDUUUDDD3"""33""3"""""33""33"DDUUUDUfwwwfUfffU���"3D3Uw3"3""""""""""""""""�""3"3"33DD3D3DDUUUDDDD333fU"""""""3""""3U3"�""""""333"""""""333"""""""3U""33D3"33""""""""3"""D3D3"f»U333"Dˆ»U"""""""33""3""33f»ªªªª™™ˆˆw3""333""3D3"3DUDUUUUUD""3333D3"""""3""""""""""3333DUfU3D3"""""33""""""33"""""""3DD33333DUDDUUwwf33""3DDDDD"�""""""""33"""""""""""""""3333DD33DDDUUDUDD"33Uw""""""""DD�"""3"3"33""""33""""""""3333"""""""3""333"""3"""""D3""3fª»3""""f™w""""3""""3333U™»ˆ™wwfUDD"""3""3""33""""D3D3DDD3""""""""""""""""""""""33""Uf33""""""""""""""3""""""""3333333"3DUDDDfwf���"""DDDDD""""�"""�""33333"""""""""333"333"33DUUUUDDD333DD""""""""""33"�""""D""""""D"""""3D"""33DUD333D3"333"33"""""""""""Dª»U3"3"3™w""""""""""""""333w݈ˆw""3"D3""333""D33""""3DD33"""""""""3"""""""33"D3""""""""""""""""""""""D""""33"3"33DDDDD3UD""3UDffUf3""3""333"33""""""3""""""""33333DDU3DDUD3DD""""""""""3D"""D""33"33333"""""""3DD33"""""""3"3D""33""""""""3"fªf3"3""w™3""""""""33""3""333ªˆDf3"""3D33DU333DD""""D33"""3""""""3"333"""""3""""""""""""D""""�3D"33UDD3Uˆ"�"3333DUf3"""""�""""""""33"333""""""""""""""""""33"33UD3DUDD333""""""��"""""3"3�"""""""333333"""""""""3D3""3"""33"""""""33"""33"3"33ˆ™D"3"U™w""3""""""""""""""""""3ffˆ3DD3"""3D333""3"3""""""""""�"""3""""""3""""""""""""""""""""33"3""3""3333Dw™""D""33"3UU33""�"""""""""33333""""""""""""""""""33""""3D3DDDD333DD""""""""D3��"""""""""3D3"""3""""""""3""""""""""3D"""""3"""""3""3"f»™3"""ˆˆD""""""""""33"""""3™ªˆUU3"3"33""D3"3""""""D"""""""""""33""""""""""""""""""""""""33"3fˆf3""""""""DffD3""""""""""D333"""""""""""""""""""33""33DDUD3D333"D3"�"3"""""Dw�""""""3D""""D""33"""""""""3"3"333DUD3""33""3"""""3w»f""f™U""""""""3""3"""3""3ª»ªf3""""""""3"""3"""""""""""""333""""""3""""""""""3"""""""33"3DUˆf3"��3U""""""""DwˆD""""""�"�""""3DD333"""""""33"3"3"""""""""333333DUfUDDD3"333""�3""3DD"""""3"3"""""33"""""""""""""33D33DD3""""""""""""3fª™3"wˆU33D3""""""""""3DªÝ™f3""""""3""""""""""""""""UfU33"""""""""""""""3�""""3"3DffwDUUD3�ˆw""""""""3DwˆD"""""3"�""3UUD3D"3""""""3""""""""""33333DUUffUDDf3"DD3"""��"3"""""DD3�""""33""33""33""""""""""3"""DD33""""""""""""w»w3fˆf3""3D3"""""""D™Ì»3"""""""3""""""33""3"DfUUD3""""""""""""�""3""DDUUfUffwwUˆ™w""""""""33UwD"33"""""�"3DD3fUD3U""""3"""3"""""333333DDDDDUfwfU33D"DUD"""�"�"33"""33DDD""""""3333"""3"""""""""""""""333DD3"""""3""33"UªªD"U™f3"""""""""""""3"""ˆ»»w"""""""""""""3UUU"""�""UDUUUUUD3"""""""""3"3""�""""3DUD33DUˆ™ª™™ˆUD""""""3DwUDD"""""""""""D3DUD33D3""""3""3"""""""""""3333DDDDDUUUUwfD3DD3UD"""""""""""""3DDDD""""""""3""""""""""""""""333333"""""3"""333™ªf�3w™w3"""""""""""""""""3U™ªw3""""3"""""3DD""�""wˆfUUDDUD3"""""""�""3D3DDDUwwˆ™ª™ˆUDUUD3"D33f"3""""""""""""3DUUDUD333"3""""3"""3D"""""""3"333DDUUDUDUUfwU3DU"UD"""""3333""""33"""""""""33"""""""""""""33333"""""""""""""3wªw"f»ˆ3"""""D3Dwªˆ3""""""""3333"�""""""wwUUDD3DD3"""""""3"""�"""""333DDUfffwˆˆfDUfUDUwfUD3""D3"""""""""""DDUD3D333333"""D""""""""""""3""3DDDDDUDfUDUUwf33UD3U3"3D33"33""�""""""33"3"""""""3"3"3"""""""""33Dwªf"3ˆ»f"""""""""Dˆªˆ"""33�"""""UD3"3"""""UwDUU3DDD3"""""""""""""""33"3"""""""""33DDUUUDUD3333DDDUUfˆU3"""""""33DDD3333"3333""3D"""""""""333333DDDDUUDDUfwwUDDDUDD3""""""3"""""3"""""""""3"3""""""""3""3D"33""""3Dww3�"w»w""3""""""""3™»3"""3"""""3DDD33���"3""3UU3DfD33D33""""""""""""""""""""3DDUDUUDDDDDDDDUUfUDfD3""""�"""UfUD33""3"""33""""3D""""""""""""33333DDDUUUD3Dw™wUUDUD33D""""""""""""""3"""�""33""33""""""""3"33""""""""""""""3DDU™"Uªˆ""3"D""""""""""DªÝU""3"33""""3DD3""�"DUfU33UD33"33"""""""""""3"""""""""33DDDDDDDDDDUUUUfUUwD""""""""""�""""DwfUUfU"D"""3D""""DD""""""33333DDUDUDUDUfUUwfDUD3DU""""""""""""""3"""""3"""3""""33"33""""3""""""3DDfw"U™™3"""""""""""""""""�"wÝÌD""""3""UUD3"""""""3UUU33D3""""3"""""""""3""""""""""3DDDD3DDD33DUDUfUfw3""""""""fwUUD3DfD3DD"33""""DD"""""""33"3"3333DDDDUUfUUUUffwUUD33DD""""""""""""""""""""3"""""""""""""""33""33"""3"33"""33Dw™fª™D""""""""""""""""�"ªÌ»D""""""""""DD3""""""""""3UUUD3DD3"""""""""""3"33DDD3�"��""""""33333DD33DDDDUUfD""""""""fwwfUDD""33"DD33""""DD"""""""33333333333DDDDfUDUUUfffDD333D3""""""""""""""3�"""""3""""3333"333""""D3"""""""""Dwª™ÌªU"""�"""""""""""�"™Ý»D"3"""""""�""3"""��3"3"3ffUfˆUD3DD3D3"3"""33"""""3""3""�""3"333D333DUUUfUf"""""""��""wˆwfUUU33""""3DUDD333"""""""""33"3333333D33DDD33DDUUfffDD""D""""""""""""""""""�"3�"""""""""""33""""""""""3""3"""""""""""D™ÌÌÝw3""""""3"""��3ªîª""""""3""3"""3"3""�""fˆwD3UffUwfU333"33"33D333"""""�""33333D33"DUUUUDD"""""""""""wˆffDUDD3""""""""3DD3"""""""""""""""""""333DD3DD"U3333DUUUfD3"3"""""""""""""""�""D"""""""3D33"""""""""""3""3333UªÝÝ™D"""""""""""""""�D™Ìݪ"""""33"""""""�""wˆˆwwˆwwfUffD333"""3333D3""""""�""3"33D333DDfUDwDD""""""""�"3wwfUUDD33""""""""3"""""3"""""""""""3"3333333DDDD"3"33DDUwwU3333""""""""""3""""""""""""�"3"""""""3D333""""""3"""""3333wÝÝ»f""""""""""""""""�"wªÌ̪3""33""3""f™wwˆˆˆwffUDDD3""3"3"3DDD3""""""�""������"3333D333DUfDwˆU"""""3wffUUDD33333""""""3""""3"""""""""3""""333333DDDDDDD3D"33DDfww"33D"""""""""3"""""""""�""""""333""""""""""""""""""""""33wÌ»™U""""3""""""""""""""""ªÌ»»™3"""33""D3"""�3w™ˆˆˆˆˆˆwfUD"3"""""33DUfDD"""""""""������""33333DDDfDUˆDD3"""""""ˆwfUDDDD33""""3"3"""""""""33"""""33"3"333DDDD33D3U3333DUDUDUDf"""""3"""""""""""""""�""""""3""""""""""""""""""""""33""333™ÌwD"""""33""""""""""3"�fÌ»ˆUU3"33""3DD33""""�"""""Uˆwˆˆ™ˆˆˆfUD33"""""333D3fU3"""""""���������""3333D3DUfwff33"""""""3""""�DˆfwUDD33"333""""""""""""""""33DD33D333""3333D3DD33333"33UDUUUDfD"""""""3""""""3U"""""""""""333""""""""""""""""""3""3"D3U»»3""""""3""""""""""""""Dw™™fUfU"33UD3DD""""""""Uwwˆ»ªª™ffUD3""33""333UU3"""""������""""3333D3Dwwwf3""""""3""""""""""""�3UfˆwfDD33""33""""""""""""""""""""""3"3DD3D3""333333D33"33"33DUUUUUUf"""""""3U"""3""""33"""""""""""""""333""""""""""""""3""""""3DU̪3""""33""""""""""""""""""""Dˆ»™wˆfwD33"DDD3""""""""3www™»ªˆfUUU3""""""3""3333DD""""""""�������""3333DDDUUw™f"""33""33"""""3D"�3ˆ™wfUfD3DD333""""""3"""""""""""""""333333333333333333"3"333DDDDUwDfD""""""""""""D""3"""333""""""""33333"""""""""""""333"""""""Uª»ˆ""3""33""""""""""""""""""""3f™ÝªUDU3"""33DfD"""""""""""Dˆ™ª™ˆwfUD3""""""""""3"333"""""""3"""�������������""DD3DDDUDUf™™U""3D3""""""""3"""Uwfffˆª™ˆfDUfUD3D3""""33"""3""""""""""""""3D333DD333333333D3333DDDDDUfwˆf"""""""""""""""""3""�""3D"""""""""""3""""""""""""""33"""""33D™ÌÌD""""""""""""""""""""""""""UÌÌݪ3D""""3DUD"""""""""""3Dˆ™™ˆwUUD3333""3"""""33D"""3""""3""3""""�������"""D33DUDDUDUfU3"""""D3""""""""""3Dwwwwˆ™™™wˆˆwfUU3D333""""33""""""""""""""""""333DDD3333333333DUDD333DDDUfw™ªf"""""""""""D3""""3D33"33"""""3"""""""""""""3"""""""""3fÌÝ»3"""33""3""3""""""""33""""""""fÌÌ™™ª3"""3333"�"""""�"3"ˆˆˆwffUDD333333D3""3DD3D3""""""3"""""���"�""""333DUUUDfwˆ""""""3""3""""33""3Ufwwˆ™ªˆ™™ˆwwwffDD3"3"33333""""""""""""""""33""3333333DDD3DDDU3""3DDfUUfw™ˆwD3"""""""""333"""""""3"3""""""""""""""""""""""""""DfwÝ݈"3"""""333"""""3"""33"3"""3"3w»Ý»™ˆ™D"D"""D"""""�""wˆwˆwfUDDDDD33DDDDDDUUDDD"""""""""""3""""�"""3DDDDUUffˆw3"""33"""""""""3UwDfˆ™™™™™™ˆwfUUUD33333333""""""""""""""""""333"""D33"33333DDDU""""DDUUfwˆwfwwwU"""""""3DD3"3""3"""���"D3""3""3""""""""""""3""""""""3ˆÌ»ªªw3"33"33""""3"""33"3"""""""3DDDˆÌw™wD3D""""3D3""""""�"""3ˆ™wfwˆfUUfDD333DDDDDD3DUD""""""""""""D3""�""�333DDUUUUˆˆw3"""33D3"""""""3ffffˆˆˆ™ˆˆˆwwffUDDD33333D3"""""""""""""3"""""33""""333333"3U33""""3D3DffffwwwwwU"""""""""UU3""""""""�D33""3"""""""3"""""""""""""D™Ý̪ˆU""33"3333""3D""D""3"3DDU33UfUDUwf™ÌÌ»ˆfDf™fDDU"""333"�""""""�""""""""UˆˆˆwffˆˆwwUDDDUUDDD33D3DD333"""D""3D3"""�"��"33D3UU3Uw™ˆf""""33DUD"""""Dfˆ™UwˆwwwwwwffUUUUDDD333"""""""""""""""""""""""""3"3""33"333""""3"333DUfffffUffU""""""""DD33"""""""���""""""""""""""3"33""""33U™Ìîˆ333"""""33"3"""""3"333"f™wDUffffˆˆ™ÌÌ»»ªˆUff™wfDD""""3D3""""""""""3"3""UwˆwwwUffwwUDUUUUUU3DDDUDD33333333U3""U3"���"3DUDfUfDfˆU3""""33DUU"""Uwˆ™wˆ™ˆwwfwffwffUUDDDDD33D3"""""""""""""""""""""""3""""333"3""""3"""33UUUUUwf3Uwf3""""""""3333"3""""��"33"""""""""33"""33""DffªÝîîf""""""""3333"""""33333fwˆfUUDUUUUfˆªªˆ™ªªˆˆ»ˆˆwU3"""""3"3"""""""""UwˆwwˆD""3fwfffUfUDDDDUUUD33333"""D3"3""""""""���"""3UDUfD3UD""""33DDD""Dfˆˆˆwˆˆ™ˆˆwfffUUUUDDD3DD3333""""""""""3"""""3"""""""""""""""""""33"""""33"333DDUUfDDDDDUD""""""3333""""3333""""���"""3"3"""D33""3UU3DUwff»îÝÝw""333""333333""""""""wwwUfUD333UUww»wª»»ÌÌÌ™ˆwfU"3"""""""""""UwwUUD""3fwfwfUffUUDDDD3D3""D3""33"""3""��""3DUUDfw3333""""""33"Dwwwwˆ™™ˆwwwfUDDDDDD3D33f3333333""""""""""3"""""333333D3"""""33D3""""""""3DDUfUDDD3DfD"""D3"3"333""33333D3"""���"�DU"33333333"""3DUUªÝîîÝ»f"""3D33333333333"3""3DfwˆwfD333333DUw»»ÌÌÌîÌ™wˆfD3"""33"""""""""3fwD3""33"UwffffwwfUfUD33DD"3DDDD""""""3"""������"3333D33w"""3""""DwˆwwˆwˆˆfwUUDDDDD33"3DfD333D33"""""""""""""""3"333"33333D33"3""""""""""33DDUUDDU3D3fUD""3333""""""33"3"33"""""fD3""3"3"""""3ÌÝÝÝÝÝ»ˆ3""DD3"3"33"3""""DfUw™ffUD"3333333D™ÌÌÌÌÝÌ™ˆˆf3""3"�"""""""""""""�"UwUD3"3UffffffwfUUUD33DU33"UD3""3"""D"""""""�"�""3333DD33D"3"""D"Dwˆˆª™™ª™wwwwfUDDDDD33"3DDDDUDD333""""""""""""""3"3"""33"""""""""""""""""33DDDDUUUDDD33UfU""3U""""33"3333""""""����"""UU33""""""Dff»ÿÝÝÌÌ™w™wDDw33""""3"w"3UfwwˆwDUUUD"3333"3"Dˆ»ÌÌÝÝÌ™»™3"""""""""""""""�"""UffUD"3UffffUffUUffU3DDUDDDUD3"""333""""""""""333DUf"""""3f™ªªªªªª™wfUwUDDDDDD3"D33"333D3333"""""""""333""""""""""3""""""""333""""""33333UUDUUDDD33DDD""33"3""D3"""""""""���������"""""Uf""""3fUfwª»ÝÌîÿÿÝÌÌ»UUUwUDf33Ufˆw"fwˆwfUUD3UDUU3"D333333U»»ÌÝÌ̪™ˆD"""""""""""3"""""""3U3fUD"3UUUffUUUUfUDDDUUDD333D""""""33"""""""�""""""""3333DU"""3""""fˆ™™™ˆˆˆ™™™wfUUUDDDDD33333333333333""""""""3""D""""""""""""""""""""""3"""""333DUUUDUDDDDD33DU3""D333333"""""""""�����""""""fªˆwDwˆª»»»ÝîîîîÿÝ™w™ªˆˆUUUffwˆfˆwˆwwUfUUDUD3""DDDD3D3"""33Dw»ÌÌ̪»ˆw3""""""""""3""3DDUUDDD3UfDUD"UUUUUUfD333DD""""3"""3"""""""""�"""""""3DDUˆ333""DwwˆwUfwwwf™ˆUUUfDDDD3""333"""33"3"""""""""""""""""""""""""""""""""""333"""33"DUUDDDUUDD3DDD3DfU"UU"""""""""""""���""""""""""��Dw™»»ÌîÝîÌÝÌÌÝîÿ»wffUffwf3UfUUfˆ™fffUUUDD333"""33DD3D33""333ˆ»Ì»»™ªwU"�""""""3"""""""""��"UDD"UUDfD3"33""UfUUUD3"3D3D"""""33""""""""""""""""""""3"""""D3DUUf3"""DwwfDUD3DfffwUUUUUD333""333""""3""""""""""""""""""""""""""""""333""""D33"""3333DUDUDD3UUUDDDU333D3"33"""""""�""""""""3"�www̻ݙÌÌÝ»îîîݪffUUDDfw"fffDDUfU3DUDD3D3""""""3"DD3DD""""3fª»»ªˆªf3"�""D3"""DD""""""""""UfD"3Ufff"3"��"UfUUD""3D33"""333"""""""""""""""""""""3""""""33DUf3"3""DfwfUD33UffUDDDUUUD333""33"""""""""""3""""""""""""""""""""""333""33D3""""""3DDDDDDDUUUfUUUUD"D"3""""""""""""""""""""""""3"�Dwf™™»Ì»ÝÝîÝݪ™wfUDDD33UfwˆUDDDfD333DD3"""""""""3U333D3""""3™»»™ˆˆf"�"""DD""DU"""""�""�"�DfUDDDDfw33""Ufwwf""DU""""""33333""""""33"""33"3""�""""""""""""""DUfD""""3""""3Uˆwfffw™™wUDDDDUUD33"""3"3""""""""""""""""""""""""""""33"""3"3333"333""""""3333DUDUDDUUUUUUfD3UD"""3"""""3""3""��""3"""""""""DU™ªÝîÌÝîÝîÌ™ffˆfD3333DD3DfwˆfUDUD3333""""""3""DU"3D3""""D™ª™ˆˆw""3U33D""""""���3fUUfD3DUwwD�"DUwwwU"3DD"""3"D33333"""333333333""""""3"""""3""""UwU3"3"D"3"333Dfˆw™™ªª™ˆwUUUDDD333""33""""""""""3"""""""""""""""""33"33""3"""3D333"""""""3"33DDUUUUUDUUffwwUwU"""""D""3UD""D""""DfUUwª»»ÿݪˆUD33D3"""""3DUUD™ˆfUUU3DD"""""""""DDw333""3U™wfU™U�33DDDU3""""""�"��"3fUf3UD33Dwf"UD3DUU33U3"""D3D3DD333"""33D333333"3""""""""""""3"""""""3UwDDD333""Dfwwˆªª»ª™fUDD33333"33"""""""""""""""""""3"""333""""""33""33333D"3"""""""""3333DDDUUUUUUffwˆˆ™D""""""333DD��"""""""""DD3"w»ÝÝÌ»fD3""""""""""3DDDˆfwffDDD33"""""�"DwwwwwwD"DUDD333wwwfwU"�""3DfU3"""""��""�3DffDDD3""3Uw"""333""3333UD33DDUDDff3"333"""3DUD33333""""""""""""D"""""33"3""DUffˆD333"fwwˆwˆª»ÌˆD33333333"33""""""""""3""""""DU3"33DD3"""3333""3""3DD3""""33"""""333DDUffUUUUfUf™™ˆ"""""""33""�"""33D""D»ÝÝÌ™3"""33"fwUUUUD333""""3"3fwffUUUDDwwUDDUwˆffffwfD���"3�"3DD333"""""""��"3wUwUDD"""Dw3�""3"3"""DDDD3Uwwf3333D33""DDD3"33"3"""""""""""""3"""3""""3""""33fwwD"""""ffffwªª™wD"333333"3""""""""""""""33"33"3D3""""DD33333333D3D""""""""""""D33DUUUUUfUfwˆˆf™U"""""""""�������""33""U»Ý»ˆU"�"""DD3DDUUDDDDDDDDDDDDDUD33DD3D3""33DwUD3ˆw���"""3D3"""""3"""""�"""UwwfUD3""DD"3333DUwwffU"""33333D3"33""""""""3""""""""""""33"33"""3UD333"""""Dwfff™™fD"333333"""""""""""""""""33D333"3333"""""33333"3""""""""33333DDDUUUUfffwfUwf"""""""�������"""""fªÌ™f""""D3"33UwU33"""""33D33""3"""""""3DUw33fªD"��"""3"""""3""""""""""�"""UwwU3"""D"�"33DUffffwDUD3"33333""D33""""""""3""""""""33"33""3""Uw333333""wfDD3ffD33"3""3"""""""""""""""""333333D3"33""""""333"""""""333"3DDDDDDUUUUffffDw™U"D"""""""""������3UU»ÌªUD"������"D""D333""3"""""""""""""""3Dwˆf»w"�""""""""""""""33D3"""""ffU3"""""���""""3D"DD3""""3DUDD"3D333""D"""""""""""""3"""""3333333"""33fD33D"""""""UfDDDfUD"""""""""""3"""""""3U3333333""33333"33""""""""33""3DD3DD3DDUDDUfwˆfˆ33""""""""""""����"UwªÝÌ™wD""3"""����������33DD"""""""""""""33Dw™»w3���"""""""""""3333""3"""DfD"""""�"""""""""3D3D33D33"""33""""""3""""""33""""33333"33"3Uwf"""""D"ffDDDwD""""""""""""""""3D""""""3"3"333333333333333"""""""3"3"3DDDD3DDDUDD3UwwU™D"""""""""�������"""ˆª»™™™ˆˆf33""""������""DDD""""""""""DUUU™w�����""""""""""""""""""""33DfD""""""33""3"DUU3D33"333"""""""""3""""""33""""333"3D333DUˆU""UDˆwfDUf3"""""3""3"�"""""333333D3DD333333333"""""333333DD3D3333DDDDDUffUw""""""""33"��"wÌ»ˆwˆwfff3"""""���"333"""""""""33DU™f����"""""""""""""""3U33""""""�"""3""3UfDUD3""333"3"""""3""""333"""""333DU3"DD3Df3"""Uˆ™wfUff3""""""33D3�"""""""""3DUDD33"333"D3""333333UDDD33333DDDDDUUf™"""33"""3"����""DˆÌªˆwffwUD"""""""3"���""""""�""""""3""""33f™"�����""""""""""""""""""DUD"""""33""""""Uff333DDU33""""""""3"""""333"""""3D3D33DD3DfU33"DUwwwwffw3"""""""3D"3"��""""""""""""""DUDD"33"3"33"33""3DDD3333333DDUfffUfw™""3"3""""����D™»»™»ªwwwUfDDU3"""""""�""�"""""""""""D"DD™D�������"""""3""""3"""""""3UD3"""""""3U""""""""UˆUD33DUU33"""""""""""33""3333D333DDDUUfDDD"3™ˆˆwfU"fD"""""3"3""""""���""""""""""""""""3UD333"3"33"333"3UUD333333DD33UªwUfwˆf"""33"""3"���"U™ªwfˆwUUwUD"3DD3""""""""""""""""3""""""""3"""""3Uw3����""""3""""""""3UUD3"""""""""U"""""""3"UUUDDDDUD3"""3"3""""""""""3"""33333D33D33DDUDD3"3""wfUUUDD3w""""""""33"3"""""3�����""""""""33""""""3DDD333"33333333UUDD33D333D33DwUffww™"""""3D""""""""��"DªªfDDD3Dff3""33"333""""""""""""""""3D33"33""""""DwD�����"""""""3D"""""""""3UD""""3"3""""""""33"3"3UD3""D333""""33""""""""""""333"""333333DUDDDUUDUfD"UwfUUUDDD3f""""""""""333"""3U3��"""""""""""""3DD333""3"33333DUDDDD3D333D333UDfwˆ™D33""3""""3w»w33D3DwU3"3""""""3""""""""""""""""""""3"D33"""3""""UD����""""""UUf3"""""3f3"33""""3""�"""""""3"""3�"U3""3ffD3""""""3"3"""""3D"3""""33333DUDwˆfUUˆ33ˆˆffUUUDDDDDD""3"""""33""3""""DU""""""""""3""""""""""3D3"333"3D3333DUUDD3D333"3333DDUwˆˆw"""33"""""""3Dw»™"""3DUfD""3""""""""""""3"""""3""3""3""33DD3"DD""D""3D3��""Df3""""""""D""""3""""""""3"""3"Dw™™wD33""""3"""3""""DD""""""""D3D33DwwˆwˆDfˆfUUfUUDUDD3DU"""3"333"""3"3D""3""DD3"""3""""""""""""""""3"3D333"DD33D3DDUUUD333D33D33"UDUff™U3""""3"""""""Dªª3""DUUU3"33""333""""""""""""3""""3""""3"3"3333DD333D3""""����"""""""""""""3"33""""D3"""""""""3"""3w™ªˆª™™w3""3""""""3""""33""""3"""DD3DDUDD™ªª™™U3DUUDUUDD33ff""""333""""3"3""333fff""��"""""""""""""""""""33"UDD3333DDDD3DUUUUD3DDD3""""UUUUˆf3D"""""""""ˆªU"""3fUDDD333""3U3"""3"""""""""""""D33"""""33"33333D33"3""""33���"""""""""""""�""3""""3"U3""""""""""""""""""3DDf3"3""33Uw™™™ˆwˆ™ˆˆU3"""33D"""33"""3"""""""3DDDDDDfUD™ªˆUDUUUDfUDD"3ˆ™U3"""3D"""3"""""3333D33""""�""""""""""""""""D""D33333DDDUfwfUUffDUD3""3"3DwUwf""""""""""""""3DUªª3"""DfDUUD3"""""""""""""""""""""""""""""3DDD33"""""""""3""33"""""""D"��""""""""""���"""""""3U""""""""""""""3333fˆwffUfˆ™ˆfDDUUfffwˆD33""""3333""""333""3"3333DDD3Dfff3fˆUUUfwwfU3Ufªª™fD3D3U3""3"""3"3D33"""3""""�""""3""""""""3333DDUDfˆ™ˆfUUfwfUD""""DDUfUw""""""3""""""33"D™»ˆ3"DUfUDDD3"3""""""""""""""""""""""3""""33DDUDDUUD333"3""""""33""""33�"""""""3"""""33""""3"""��"""""""""""3DUUˆª»ª»»ªˆf3""3UD33DUD"3333""33"3"""3333"""33333D"DUUffUwfffwwfDDUˆ™™wwwf3DDDD"""""3"3333"""33""�""""""""""""""3"33UUDfˆˆwfUDUwwfUD3""3DUffww""""""""DU3f»ˆD33wfUD""""""D3"3""""""""""""""""""333333"""33DUUUU3DDUDDD3"3"3""""""3"3"��""""""""""3333""DD""3"3U"""""""""""33DDUwˆ»»ª™UD""""""D3""33"3"33""333"3""3333333333333DDDUUf3"U™ˆˆwwwffwwwwfffwwUDDUU""""3"""33"3333""""��""""""""""""""DDDDfˆˆfUUUDwwwwfUD3"3DDUwˆf3""�"""""3"D3""D™ªUDDUwU33"3""""3"3"""""""""""""""3"""""3DDDD3DDDDD"33""3""333D3""3"""""3�""""3""""33""DUUUD333DD""""3U33"""""3DDDDDDUUDww™ªˆD3""""""D""3""3333"""33333""""3333""""""3DDDUU""™ªˆ™fUUfwfUffDUwwwwff"""3333"""3D3""3"""""""""""""3UD3"UˆwUfUUfˆwˆwffUDDDDDf™ªˆ"""�""3""3""""3fªªf3DfUUD3"""""""3"""""""""""""""""""3""3333""""""""333"""33""""""33""""""3"""3""3DfUD3"""3DDD3"""UUDD"""33DfwwˆwfUfUUfUD3""""""3D"3"""333DD333333""""33D3333"""""33DU""f™ˆwfffffDUU3DUUw™™ˆD333333""""3D333"""""�"""""""""""333fU3"DwfˆˆˆwfffwfUUDDUUˆª™U"""��""""UU"DU™ª™fDUˆfD3D""""3"""""""""""""""""3"3""""""""333""""""""""3""""3""""3""""""""""""3D3"3""333D3""3D""""3DU3UfwfUfUD3D3""""""3D3"3"33DD33333D"""""3DDD3""3""""3DU33"3™™w™ˆfUUDD3DDUUw™™™w33""""""333DD""""3"""""3"""""3""""3fwU""33wˆwffffffUffUUfwˆˆ3"""""""D™ªÌ»ªªˆfUDfˆDDD3"33""""""33"""""3""""""""""""""""3"""""""""333"""""""3""""""""3""""3"3�""""""3""""""""3"""D33"3D3""""""""�""33DD33UDD3"""33""""""D333"DDDD33DDD""""33DDDD33""""DDUD33"DˆfffUDDDD3DDUfffwˆˆf3U"""""333333"""3""""""""""D""3ffD"3"3"UˆfwwwfUffUwUDwwfww""�""�3f™™ˆwfffUUfwfU3333"""3"""""3""""""""3""""""""""33"""33D33"""""""""""3""""""3"""""""""""33DD�"3""3D"""""""3""""""""""33�3DD3""""""""""""33"33"33"""3DDDDDUDUDDUUD33"3DUDUUDD3"3UUU33UDfDUfUD33333DDfffff™™DU""""3"3D3D"""""3""""3""3333"3D""""Uwf3"""3""fwfwwwfUUUffUfwfw™3"""�D"""�"™»ˆwwfwˆˆˆwwfD333"3"""""""""""""""""3"3"""""""""3""""DDD""""""""""3"""""3"3"""""""""""""3DD3""""3""""�""3""""""3""D33""""""""""333"""""""""DD3"UD33UUUDD3DUf3UfUDD3""""3UD3"ˆˆffUUfUD333DDUffwwww™ˆˆwD3""""333D""3"""3""Uf3Dff""""3"""""3""""DwˆD""""3D3D3UwwfUwffffwfwffU™D"""""3"UªªwU3DfwfUDDDD3""3"""""""""""""""""""""3""""33""33D33""""""""3""""""""3DD""""""""33DDD""""""""""""""""""3""""33"3D"""3"33D"""""�"""D3"�UUffDDD3"DwfffUD"""""3DD3"ªˆwfffUUUUD3DUDUUwfwwˆˆffU""3""""3"""33"3"""""DwwfUf"""""""""""""3wf3"3""""""D"UD""wwfDwwwwˆwwwffˆˆ"""3"""f™ªfD333DDUDD3333""33""""""""3"""""""""""""3"""3D333""333""3""""""33"D3"""""""""3DDDUwD""3333Df"3""""""""""""""""3""""""""333"3"""""""""�"""UDUUDU3"UfUffUD""3""DˆfˆªªwfUUUUUUUDUUUfwfwwˆˆwˆffU33"""""33""3"""""3Dff33U""""""""""3UUU3""""""3"D333""3UwwwˆwˆwffffUUˆD3"""""3ˆªwD3"""333D3333""333"3"""""""""""""""""""3"""""""""3"""3"""3""""""""""33"33"3""""3DDfwwffD3DUUffˆˆDU3""""""""""""3fU"""""""3"""""""""""3"""���"�""3DDD3DU""wˆˆˆwwU333"3U™™fˆ™ªwfUUUffD3DDUDUfwwwffwwUwˆˆwU3"""""""3"33"DUUU333"""""3"33Uf333""""3"33"""DUUwˆwwffwffUUD3"33"""""""ˆ»ˆDD3"""""33333333""D3"""""""""""""""""""""""""""""""""""""""""33""D""D3""""DDDwˆUfwfwDUfDw™™UU3D""""""""""""""""33ff3"""""""�"""DUD3"""""""33"��������""DUUfffUfUDfffUDDfwˆˆwˆˆˆwfUˆˆˆ™wUwfDUUUDDDDUUfffffwUUwwwUUUU3"333"""""3fwDU3"""""3D"""""3Uˆ3"3""3"33""3""ffˆwˆwffffDwD"""""""""ˆUD3""""""333"""3"""3333"""33D3""""""""""""""""""""""""""""""""33"""D"""3""""3DDUwˆUUUUUUDDUw™™wwUUw3"""""""""""""""""33U3""""3""""DfˆU3"""""3""333���������3"3fUfUfUD3"""""""""3DDUUffUfwfDwwwffwwUUUUUUfUUfffUUfˆˆwUUffww3""""""""3U33"""D3Uwf"""33DUw3"""""""3333""3333UDˆwˆfffUffw"33"""""""3ˆDU"""""""3"333""33""""33"3D"""""""�"D"""""""""""""3"""""""""3"33""3""""""""3DDDUˆ333DDDDUUfwwfwˆwfww3""""""""""""""""333DD"""3"""""""""3wU""""33"3"""���3"DfUD3333"3"""""""""3DDDDDUUfUUU33UffDUfwffUfUUffwwUfˆwwfUUfwˆwˆˆˆˆˆD3"33D"33fwffwfUUDUD3ff"""""3"3"33333"3"3D3DDwˆwfffwfˆD3"""33D""wÌ™U""""""333"3"""""""3""3""""""""DU3""""""""""""""""""33333""3""""""3D3DDU"""""3DDUUffwfw™ˆfwˆ3"""""""3""33"""3"33"""3DD"""""""""""3""""""D3"3D3""��������"""U3""""3"""""""""333DUfUUUUD3"3f33D33wwffwUfD"Ufffwfwwfwˆ™ˆˆ™ˆ™™ˆwfUw™f"3wˆ™™wUDfˆfD3333DD""""3D""""""3"""3""3333"33DUwwwˆwwww"33333D"3ˆÌ»fD"""""3"333"""""""D�"D"""3""3""D"3""""""""""""""""""""""33333""33"""333DDDDf3""""33DDUUUUfUfˆˆˆw™3""""""3DDD""""""3333D3"""""""""""""""""""""33U"""�������"""3"""DD3""""""""""""3DDUffDD33""3""3333fˆwˆfD""Ufwwwfwˆˆˆwˆ™ˆˆwffDDfˆª™ª»ªˆfU3DDwfDfUUwf"""3D"D33"""33"""3""""33333D3D™ˆˆ™wˆU"33""3ˆÌ»ˆDUU""""""33"33"""""""33D"""""""""""3"""""""""3"""""""""""""""""""""D3""3""""33DDDDDU3""""3333DDUUfffwffˆ»™f3"""3"DDUD"""""""33"3"""""""""""""""""""""33""3""�������""3"3D3"""33"""""""3Uwˆˆf3"3""""""33333D™w""""33wfˆˆˆfwˆˆ™ˆwwffDfwˆˆw™™ffDUUUfffwUDfwD"3""3DD3""3D3D3"""""""33"333333wˆ™ˆˆU3D3D33ˆÌ»w33fD3""""""33""""""""3D"""3""""""""""""3"3""""""33"""""""""3D""33"""""3D3DDDD3D3"""""3"33DDDUfwˆwˆˆ™Ìˆ3""33D3DD3""""""3"""""""""""""""""""""""""33""""""�����""3"""""UU"""33""""""""""3ˆˆˆw3""""""333"33Dwf"""""wˆ™™wˆˆˆ™™ˆDDUUww™wwwDDD3DDUwˆfffDffD""3DUUDUUUDDf3"""3"""3"""D3333f»™»ˆ33DfDfªÌª33Df3"333""""""3"""333f"""""3333"3""""""""3"3""""""3"""33333""""""""D3"""""""33DDDDDUUD3D3D"""""""3DUfwwˆˆˆªªˆ"33333""3D""""""""""""""""""""""""""3"3""""������"""""UwD""33""""""""3U3"DwU""""""33""DfUw""""3fwfUUDDDUf3DDwˆˆwfU""DD3"DUUfDUDDUfUUDDfwUUDDDDDDD"3""33"3""33""3"D33™ª»ˆU3"DwÌ»ffUD3""U33UDD33D3""3333"""""3333"DD""""3D"�3"3""""""""3""DD3333""""""""D3"""""""""DDDUDDD"3""33"""3U3"33DDDUwwww™ˆˆ3"""""3U3""""3"33"""""""""""3"""""3"""""������""""3fUDDD"""""33""""""""""UU""3Uf3"33333"3333ˆD""""""""""3U"UU"3""UDwUwˆU"D3""3D333DDD3UDUwwU"DUDfUDD333"D3333DDDDD3333"3"D"33Uˆªˆ33ˆ»»fUD333DD"""""""""DDUD""""""3""""""""3""3"""3"""3"""""""""3DD33"333"3D""""""3UDUUDU""3"""3""""DD"""333DDfwˆwˆ™ww""""33"""3fw3D3""""""""""""3"""""""""""���""3Uf3"3DUD33D3""33""DUf""3fD3""333""33UwD"""""""""333D"3""Uf3"fD"33"DDUD33"33D3UUU3"333"3DDDD33"D33333"3DD33333""""3D3Dwª»»Ì»wUUD3"3Uf3"""""""""""""3"""""33"""""""""33"""""""""""""3DDD"""33"""D""""""33DUDUD3""3""""""3""""""33DDUwwwˆ™wwU""33""3DDUU3"3""""""""""""""""""""""�"3"""3wfU3""33333"""""3""""3333"UD3"333"""3DˆUD""3"""3333333333"""33D33"333""""333Uf3""333""3D3333"D3"33"3333"333""3"33333ˆ™ªÝ݈D33333""33""""""""D"""""U3""""""""""""""""""""""""3333"33"""3""""""3"DUfDfD"""3"""""3""""""""DDUfffwˆfffw3D333D333D3"""""""3"""""""33"""""""""�3"�""��UfUD3""33"""""""3""""""""""""""U3333333""Dˆˆ3"""""3"""33D"""3"DUD""""3"""""33DD""""""""3333D3"3D"DDDDD3"33""333"3D33""f»ÌÝ™wD3D33"""""""""""""""""""""""3""""""""""""""333DDD333"""33"�""3333UUfUU""D3"""""""""""""333DDUUUˆˆwwˆ™fD33""333UU"3""""""3"""333"""""""3""""3333"""""""�""ffD3""33"""""""""""""""""""""""3f"3""""""3D™D""""""""3D""3UfD3DU3""3""""33UD""""""""33""""DD333DDU3"3"""333"333"3"D»Ì»ˆwUDD3""""33""""""""33"""""""""3""""""""""""3"""""��""333D"D3"D"""D"""33DDUffU3""33""""33"3"3"3""""33DDUUUwwfUww333DDfwf3DD3UfU""""33""""""""""3DD""U""""3"""""""�DfUD3333""""""""""""""33""""""UD""""""33ff"3""""""3"""33"3UDDDUD33"DD3D3"""""33DU3"""""3"3""""D3DD33DD3"""3333""3"3"3"U»ªfUDDDD333"""""""""""""""""""""""""""""""""""""""""���"""333D333""""""3"""33DDDfˆD3""""""""D3""33"""3""""3DDDUffwwUU"""""3D333DwwwfDUD3""33""""D33D3"33""""33"""""""ffUDD3"""""""""""3D""""""w"""""""""Dw"""""3""3""DD3D33DD3"""""""333333""""""3DDD"""""3""""""UD333D3D"3333"""""3""DDw»ˆ3DD3DDDDD""""3"""""""""""""""""""""""""""""""""""""""�""3"3"33"""""3""""33DUU™D"""33"""3"3""3"""33"3333DUUUwwff3"""3D"""""""""""""�"3"""D3"3"3""""""""""ffD333""""33""33""""DU""""""""Df�"""3UDDUD"""3D"D3"3"""""""""3""3DD"""""33U"""""""""""3DDD333D33"""""""33""33™ªU33DDD3UfUU""""""""""3"""""""""""""""""""""""""""""�"""3"""""""3""""""3DDUwD"""""""333"""33D33""D"3333DUUfDUDD"""""""""""""""""""���"""""""""""""""""UfU333""""""3"3DD3"""""ˆD""""3Uf33333D"3UUD3""3DD""""""""""""33"D""3U3"""""""""""DD3333333"""33""33""U™ˆD3"DDDDDDUDD3""""3""""""""""""""3"""""3"""""""3"""""3DD""""�"3DUw3"""""""""3""333D33333"3"33DUUUwfUD3""""""""""""""""���"""""33"""""""""""3wfUD33"""""""""3D333"""ˆU"""3DUUDfDDDD""UUfwˆwUUD"""""""""""3""D333UD""""""""DD333DD3"""""""""3""U™ªf"3""33DDUD3"33"""""3"""""""""""3"""""""D""3D3""""""�"""""""3"3UfwD"3""""3Uwˆ3""""""DUD"""3"""""3333"33D333DDDUU"""""""""""������""3"""""""3""""""""""""""""""fˆUD333""�""""""""3"3""""""�wf3"""3DDD3D33D33"""U3DfD3""""""""""""""""3""""3DD"""""""""U333D33""""3""""33D™ªw3"3DDD"33DD""D3""""""3""""""""333""""""3"3""""3"""�""""3D""3""""3333"DUfU"""""3DDUDD""""""DUD"""3"333""3"333DD3D33DUDDffUD""""""����"""33""""3""""""""""""""""""""DwffU33""�"""""33""""DD3"3"""ªˆUDD333"""""""3D3"3D3D3""""""""""""D3"3UD""""""DUUD3""3"""""""""Uw™™fU"""33"33DDD33""""""""""""""""""""333"""""3D3""""""""""""""33"""3""3""""""3DDDD""""Dw™D"""3DD3"""""""33""""33"3"33DDD3ffD3"""""�3""""""3"3"""33"""""3""""""3UwD"3"33""""�3UUD3UfwwD333"Uª™UD3"""""D""333UD"""3"""3""""""""""3DUDDU3"""""DDUD3"""""""33"""3f™™f3"""""""3"DD3D333"""""""""""D3""""""""""3""""333""""""""""""�""333""3333""""""""""""""3"3D™ªf""333"""""""""""""""""""""""3DDDD3DD3"""�""""""""""3DDDU3333""""33""""33Dff33""33"""""""""""DUwUfwf3DUUD33UwwUD3""33""33333DU33""""3D"""""""""""""33UfU""""""""DD3fU"""33""""DfwˆwU3"""""""""3DDD3DD"3"""33""""DD""""""""""""""""3"3""""""""""""""3333"""""333""""""""33DDf™ªªD"3D""333"""""""""""""""""""""3D3DD"D3"�"""""""""""D3UUD3"""33333""""33fwD333"3""""""""""""""3DUˆ™fUD33333DDDUD33""""""""333333"3""�"DD""""""""""""""33DUD""""""33"DDUU"""""D""UˆˆwU3"""""""""""3DD33""D3""3"3""""33"""""""33"""""3""""""""""""""3"""""33""""3"3Dw™ªªf""D33"33"""""""""""3"""""""""3"DD3D3"""""""""3""""""333"3""""3333""""333Dww33333333"""""""""""""3DDfwD"UU"""""33""""""""""33333333""33""""333"""""33DDD3"33""3UDDDD""3"DwˆˆDD3"""""""""3DD33D""3U3"D3"33""""""""""""""""""""""""3"""""""�"""""""""33Dffª»wD33"3"3"""""""""""""""33"UDDD3"�"""""""33"333""Df"""""""333"""""33Uˆw33333"33"""""""""""""""333DDUDDD""""""""""3"33"""3D"33"3""""""""""""""""""""""333DDD""33UUD""33"3UwwU333"""""""33DD33D33UU3""""D3""""""""""""33""""""""""""33"�""""""""�"Uwf™»ªw""""""""33"""""""""3333DD"�""""""""33333""Df3"""333DD3"""333UˆˆUD33"3333""""""""""""3""""""3333DUD""""""333"""3333333""""""33""""""""""""33333DD""DD333DDUwˆfU"""""""""""""""DD3DDD33DD3""""3"""""""""""""""""""""""""3"""3""""""���"f™™»ª™3"3"D3"""""""""""""3UDD"3""""""""""3"3"""""""""""""""""D""3DDD3D3"33Dˆ™ˆU33"333DD3"""""""""""""3"""""""3D3DUDD""�"""""""""3"3"33"3"""""333"""""""""""33""33DU3333"33"Uww33""""""""""3D333DD"33"3"""3"3"""""""""""""""""""""""""""""�"""""""3"DU™ªªˆ""33""""""""""""33D"3D"33""""""""""""""D"""3"""""""""3333D3333UUDfª™f33D33333"33""""""""""""""3"""""33DDDw3�"""3"""""""33""""33D3D"3"""""""""33""""""333UDDD33"3U™f3D3"""""""DD3333D3""D3"""""""""""""""""""""""""3"""UD333""""""3DUw™ªªˆD""""""""""""""UDDDD"3""""3""""333D""3""3""""""""""�"D33D3""3Df™wUDDDD3333333"""""""3""""""3"""""""""33DUUD"�"""""D3"3333""3D3"3D""""""""""3""""""""""""""3DDUf3"Dˆw3"""3D"""""3D333333""333"3"""""3""""""""""""""""3""3"""D3UDDD"""""""""33wªÌ»ªD"DD""""""""""3DDD"""""""33"""""3333""""3D33""""""3""3Uw3UDDD33333333""""""""33"""""""""""""""33DwU33""""D""3"3""""33DU""""""""""""""""""""""""""""""33DDUD""fˆD3"""""D"""3333333""""33"""""""""""""""""""""D"3UUDD33"""""""""""�"3f™ˆ™™D"3D"""""""3DD3""3""""""333""""""3"""333U3"""""""""3fwDD""333D3"33"""""""""""""""3""""""33DwU"3"�"3"DD""""3""3"3""3D3D"�""""""""""3""""""""""3DDf33ww3""""""3D"""3333333"""""3"""""""""""""�""""3��"33333333"""""""""""""3UUf"�"3U"""""""""33DUD3U33"""""""""333"""""DUUD3"""""3""��"3fU""3"333DD3""""""""3""""3""""""""DfD"3�3"33""""33"3"3"3"33DU"""""""3D33""""""""""3"33DUDUfD""3"""3"33""""""3333""""""3"""""""""""""""3U"�3D"""3""3"""""""""3DU3�333Uf"�"""""""""""""3333D3DD33""""""""333""""DUD333""""""""3""""""3fD""""UD"3D"""""""33""3""3"""""3"""Uf��D"�""3D333"33DD"""333"3333"""""""""""""D""""""""""""D"3DDwf3333"""""3333""3""3"3"D3"""3"""""""""""""""""3����""D"""""33""""""""333D3�"33DDfD"""""""""""""""""3""33333"D"""33"3""wUUD3D3"""""3""""""Dwf""""3D3333""""""33"33""""""""""3""ff�UU""""""""D"""3UD3333""3""3"""�"""""""3"""""""""""""""""""33Dˆf333""""""3""33"3""""""33""""""""""""""3"""�""""��"""""""""""""3333"��""3333DfwD���""""""""""""D3"D33UUU33DDUwfD3DD""""""""""""""""""""DwU"""""""33"3333"""33"33"""""""""""3Df��"3"3D"""""3U""333333"""333""""�"3"""""3""""""""""""""3"3f™D""""""""""""UD"3"""""3"""""""""""""""""""3""""33""""""""""""""D"D"�""3333DDUUwU""UfD"3""""""""""3""""""3DDUDDfUf3""DDD3""""""3"""3"""""""""""3"3UˆU33D"33U333"""""DD"""""""""""DUD�""""""""3""DD"""3""33"""D33"3""��"3D""""""""""""""3""3UˆˆD""""""""""""""D3"33""""33"""""""""""3"""""""""33"""""""""""3"""""3D�""""333DUUUDUwwwfwˆwwfUUwˆUDUD3""""33"""3"DUDUU3UDD"DUfwfDD"""""""""""""""""333"3wˆUD3"""""D3333"3333DU"3""""3DDU""""""""""3"""DD333""""3"33"""""333""3""""""""""""UfwUD"333""""""""333""DD"""""3""3""""""3"3"""""""""""""33"���""""""�"3D"��"3"""""333DDD33DDUU33"33333DUfwf3UwU"�3fU""""333D3DUUUUD333DUfwwU""""""""""3"""3D3"DfˆfU33"""3DU3""33DDD333""""""33DD"�""""""33DDDU3"""""""3""""""""�"33""""""""""""Dwf3UD"3D3"""""33"3"D3"""""3""""""""""""""""""""""""33"""""""��""""""D3""3D3�""""""""""33"3""333""""""""DDˆˆ™ˆˆfDUwª™™ˆ""""33DDDD"DUD"33333"DDDUwf3""""""""""3"33DD"UDˆfUDD3"""DD3"3DD3D"D"3"""3"DU�""""""""""33DD""""""33"33""""���333""""""""""""""3DDDffD33U3333""""""""33""UDD3""3""33"""""3""3"""""3"""""""""3"""""""""��""3"""""33�"""3�"""""""""""""""""DUDfUUwˆwDwwwˆUDDUfffwˆˆU3""3333UD"""""33DUUf3""Uwf"""""""""33""DD3ffU™fD3"33"""�"UDD3DU3U33D33""DU""33"""3""33"D33""3"""""3"""""""3""""""""""3D"""""3D""""3UfwfD3""U333""""""""""3UD3"""""3D3""""""333"""""""""""""""""""""""3"33""""""�"3""33333"��"""3"""""""""""33Dff3333"DffUDDfUDfˆUD3DUUfU3D3fU""3DDU3UU""Uff3"33"""""D3"UfUUwUˆ™UD333""""333DU33UD33D"""3U��"""""""3""3333333""""""""33""""""""""""""3D""33"3D33""3DfUDDUD3""DDDD3"""""3"3D3""""33DD33"""3"3DD3"""""""3"""""""3""""DU3""�""""""3"�"3D"""333D"��"""""3""""""""""""DDUw3"33"""ffUU33D333U3"""3DUw™»ªˆD""3DD3"U3Dw3D33fD"333"3fˆw™ˆˆUUDˆˆU33""""""�DUUDD3"""""3"""""3""DD3333"""3""333"33"3"""""""""3D"""""3DD3"33DDDUfUD3U33"DUDUDD""""""""3D33333"DDD3""""3"DDDD3""""""""3333"""""3"33"3U3""""33""""""""3""3D""3"3"3D3""""""""""3U3"""""""3""DDUf""3D33""fUU3"333"333Uw™ˆ™™ˆU"""33DDDfD333UDDDfwU33D3D3ffwˆˆ™ˆˆwffˆU""""""""3fUD"33"""D3""""""D3DDDD"""3""3333""U33""""""""""3U"3"33DD3"3""33DUUD3"D33DDU"DU33"""""3D3333333DD33"3"33DUUD3"333"3"""3D"""3"""D"3""""""""""""""""""""�""""DD"""3""3DD"""""""""""""UD"3"""""""D3""""DUUU333UU"3fD333333"D"3Dfww™wwwwU"3"3DDDUffUU3UUffDUDUf3UffDDUUUfUUDDDUf3"3""""3fU3333""""D"�"""""33DUUU3""""""""""U33"3""""""""""D3"33DD3""3""33DDDD"""33D3UD3DfDDD"""""UD"33333D33D3DD""3DDUD3333D"D3""33""3D3""""3""3"""""""""�"""""3D"3"""33D33"""""""333""3DUDUfDDUfDDDDD3""""33""""""3f"""3"DwUf""3UfD33UD333333"D""3DUfˆffffwwˆwU"33DDUUff™™™wU333UUffDDUDDDUDD333333DDD3DD"""""�"DfDD33"""""D3�"""3""3DUD3D3""""""""3D"3""""""""3"3333DD3"""""33DDD3D3""""""3DDU"DDD3""3UU333333"33Df3D33UDDD33""33"3D"3"""""3D3""""""""""""""""""3D"3""""33D33"""""3"""33333"33Dwwwˆˆ™f3UD33"D"D3333333D3DDUDDwU"""3UfUD"""3"""""DDD333333D3"3DwˆfUfwwffffˆwD33D3"UˆUUU""3333333333DDDDD33""3"3"333""D3"""3DDD3"3DD333""""3D3""""""3333"3"""""�33""""""""""""333DD3"""""3333333"""""""""333DDDD"""3DU3"3D333"3DUUUD3UUDD33""""3DDD"3""""""3""""""3""""�""""""3"DD"3"""33"DD3""""""""""""""33DD"3""3fwwff33D3��"""33""33DDDDDDDDUUUDfD�"""""""UDD33DDDD"�""3U™fDUUUfffUUffwfD33ffUD"""""333333"3333D33"""""""""3""3""""DUDD""DD33""""3DU"""""""""""""""""""""""3"""333""""""""""""3"""DD3"""""3DD"3"33333D3D33fD"33DDUDUUDUDDD"""3"3333"""""""""""""""""""""�3""""""""3U"""""33""DD3"""""""""33D33"""3Uˆwf"""""""33"333""""3UDfffUD"3D"fUUDw™fDU3""DU™D3DD33333333Uf™™fU3"""""33333""""""33"""""""D3"""33U"""3D3""""3Df""""""""""""""""""""�""3"""""""""333""3"""""""333333U33"3""""D"UU"D3333UUDDDD33U"D33DUDUUfDDDD3""3333D"""3""""""""""""""""""""3"""3U""3""""3"33""""3""""33Uf""""""Uw""""33333"""""""3"3"�"DD3wwwwˆUUD33"""""Dwf"3"""""""3DUD33"""""""""""""""""""U3""33UD""3"3""""3Df""""""""""""�"""3""33"""3D3"""""""""33333""""""""""DDDD3DD"3"D""""3DffffˆˆUDUwwwDDDDD"33D3UUfDDDDD""3333333"""3"""""""""3"""""""""3"""""3"""""""""3"""""3"""3UˆD""""Uf333"""""""""""""3""��"Dw™wUUˆDD3"""""""""3Dw"""""""33"""""""""""""""""""""""""""""""DDD"3""3"""DU3""""""""""""�"""""""""""""""""""33""""3333333"3""""""""""D333DD3333""3"""DDDDDUwU3UwˆffwDUU"3DD3DfUUUDD33""""""333"3"33""""""""3""""""""""""""33""""3"""""""""""""3Ufw3"""3D"3D3""""��""3DUwwwˆˆwUD33333""""""3Uf"""""""""33333"""""""""�"""""""3""3D333"""3""3333DUfw""""3""""""""""""""""""""""""""""""333"33""33""""""""33333"DDD3""""""33DDUDDUfwfˆwwUDDfD3DDDDUffUUD3"""""""333D3"""3"""""""""""""""""""""""""""""33D""""""""""3fff""""""33"�""�""""3fUDD3333333""3333DDUf"""""""""3333"""""""D"3""3"333""33"3DUDUUD3"3f™D"""""""""""3""""""""""""""3"""""33"""""33333"""""333""3333DDD3"333""""33DDDD3wwwDDD3DDDD3DDDDUUffU""3""""3"""3"""3""""""33"""""""""33DD"""""""33"33"""""""3DDfUw""""3"""�3�3"����"D3DDDDwˆˆˆf3"""""""3"3"""""""""D""""""""33"""""3DDUf3"333Uˆf"""333"""""""""3"""""""3"""""""3""""""""33"""""33"""""D333D333D33"""3333D3DwˆfD3D333DDUUDDDfUUDD""""""33"""""""""""""""""""""""""""""""33D3""""""""D""33"""D33DD3Uf"""3""""""�3"����33"3""f™™™ˆ3""""""3""3""""""��"3"""3"3"333D3DUD""DfDDDUfwUD"3"""""""""3"""""""""3"""""�"3"""""""""33"33""""""""""DD333DU3333"""333"33UˆwU333"3D3DDDUUUfffUD""""""""3"""""""33""""""""""""""""""""3"""""""""DD33"3"""""�"�"3D3DD"3Uf"""3��"""""""""""�""""3Uˆª™ˆD3""""""""""""""""U3""""""""D3DfwˆwUUDDDUUfˆUD3U3""3"""""""""""""""""""""""""""""""""""D"""""""""3333UfDDUDD3333""3"""""3fwfD333"3333D3DfˆfUfUD""3""""3""""""""333"""""""""33""""""""""""""""""""""""""""""3���""UDD33"DUD""�""3"""33"""""""�""333f™™™wD""""�""""""""�D""""DU33333DfUfwUD33""""""3"33U3""""""""""3""""""""""""""""UU33""""""""""3""""""DDDDUD33"333D3""3"""""DwˆU3"3333"33333DwˆfUU"""""""""""3"""333"""3"""""""""""""3""3""""""""""33""�3��""D33""3DUfDDD�""333"""""33""""""�""""33w™™ª™U"3""""�"3ˆw3""""""D3"DDDUwffD""""""""3DU3"3"3"3"""""""""""""""""""3"""3wU"""""""333"3"""3"3U3333333333333"""""""UwwD3""333333333DfwˆU3""3""""""""""""333"""D3"""""""""""""""""""""""""""""""""""�""����""3U33"33DwfDfU�"""3"""""""D"""""��""""3U™ˆwf""""�""3""UUwˆ™ªªªª™f3""""�3U3DUDUD33D""""""33U3""""""""""�"""""""""""""""D3""33"333""""""""33333""333""""3""""""3wˆf3"""3"3333333Dˆˆwf""""""""""""""""""3"""3"""""3"""""""""""""""""""�"""3"""������"3D3333DDUwwfˆ3���"""3""""""""""""""��""33DwU""""�"Dw™ª™™™ª»ªªªª™ˆw™™ˆD""""��"DDDUUDDfDDD3"""3D3"""3DU3""""""""""�"""""""""""""""3"""33"""3"3""D33"333""""""3"""""DfwU"333"33D333DDUwˆˆf3""""""""""""33""""""""""""""""""""""""""3""""3""33""��"""3D""33UfUfwˆ3""""""""""""3""""����""333"UD"""�3w™™ˆˆˆwwwwwwwwffffw™™D"""DwwwffUUU3""3""""3""""3f3""""""""���""""3"""""3"""""""""""""""""DDUDUD3333"333"""""""""""""Dwf""3333DDU"3DD3UwwwfU"""""3"""""""""""""3"""""""""""""""""""""""3""""33"""3"""�""3D"3D33Ufˆwf3D�"333""""""""""��������""��"""33333D"��f™wffffUUUDfUfwwfffff™w"3DfDDD3"33333""3"""""""""""DU3"""""3"""""�������""""""""""3"""""""""""""""""3ffDD3"3"33333""""""""""""3Dww3333DUDDUD333DUwˆwfUD"3""""33"3"3""33""""""""""""""""""""""""""""33""""DU3�"""""3D33333DUffffwD�""""3""D3"""""��������""3333"3U"""33DwfUDDUUUDDDDUUUfffffwˆªfUff3""""""3"""""""""""""""3DD"""3"""33"����������"""""3""33""""""""""""""""""UU333"3""333UU"""""""""UwfD3333"DUUfU33DDUwwUDDUU""""""33""3D"""""33""""""""""""33"""""""""DUUf33""""""""3DDDD3"3DUfwf"�"""""33""""""�������"�""3D3""3wD�"wˆˆˆˆD333D3DDD333DDDffffww™ˆDD3""""""33"""""""�""DU3""3""33�����""""""""""33""""""""""""""""""DD3"333333"3fwU"""""""""3fww"3"""3"3UfU"33DwwwfDDDUU"""""""""3"3""""""""333""""""""33"""""3"3"""""""""DD3"""3""""""DDDD"3"DDDwf�"""""""""��""3D"3wDw"333D""wwwwwU333333333"33DDDUfffUfwD"""""""""""""""�"33D"""""""""����""""33"3333"""""""""""""""""""3D"333333"3ffU"""""""""DwˆfD""33"33"DU3"3DwwwwDDDDUU""""""""""3"3"""""""3""""""""""3""3"""33""""""""�"""""""�"""3DDUD""3DDww""""""3"""3""""""��""""""3UUUffUUwˆwfffUUD"3"""3333333333DUUUUUffffD"""33""""""�"""U""""""����""""333"33D""""""""""""""33""""333""3UUD"""""""""3wˆU"""333"3U"DU3D3UwwwU33UDD3DD3"""""""""""""""3"3"""""33""""""""""""""""""3""""�"33"""DUfDD33DDUˆ""�""3""""""""""�"""""""�DU33Ufw™™™wUDDDD333"""3""""33333DDDDUUUDUDDU333D3DUU3"""""�"fU"""""""��""33333"""3333"3""""""""""""""33"""3"33"3DD3""""3""333ˆˆU"3333D333UUD3D3UwwUD"DDDD"DDDU"""""""""""333""""""""33"33"3""""""3"""""""�""33""""3UfUDDDDDDD3"""""""3"""""��""""UU"3fUDˆfUfU333""33"3"""""""""""33DDDDDD3DDUUU3""3"D33DDD3"""""""""�"DwD"""""""""""f""""""33DU"""""""""""""3"""""""3"3D3""""""""333ˆw3"333"3""3DUD3UfwwwU33DDDDDDDUU"""""""""3""33""""""""333"""""""""3"""""""""""33"33""""��"3UDDDDD3DUD"""""""""33"3""������3wU""DDfwUUUU3"""""""""""""""""3"3DDD33333DD33DUUD"3D""""DUD"3fˆˆwUU"��DD"fwU3""""""��"""""""3U""3"33UD""""""""""3"""""""""""33D33"""""""3333ˆw3"""3333""333DfwwwUU3"33DUDDDDfUD"3""""""""""""""""""""""""""""""""""""""""""3""""33DD3"�"3D3D33D3f""""""""�3""""""""���3"""ffU3"UwDUUUD33"""""""""""""""DD333""33333"3D33DUDD3"3DU3UUfffwUUUU3"wUDwf3UD""""�""D""3"""""3D3"DD""""""""33""""""""""""333"""""""33333ˆU3"""3333"""DDwwˆwUD""33DDDDDDUUUUwD3""""""""""""33"""""""""3"""""3DD3""""""D3""""""3"3"3""""3333333f""""33""""UD""""""3"""����"D"�DwwUDUfD""""""3""""""""""""333""""""3"""3"3"33""DD33333wDDUffˆUˆwˆˆf3UD"""���""""""""""3"""33""""""""""""""""""""3""33333"""""3"33fˆU33"""3"33""3wwwwfD3""3333D33DUUUfD3""3D3""3"""""""""""""""""33""3D"""""""""""""""""""""33"3""��"""""""3Uf3""3"3""""""33"""""""3U3""����"DU3"33""""DUU"fˆˆwwfUD3"""""""""3""""3"3"""""""""""3""""�33"""""3UDUUffw™™ªwUU"33""""��"3""""""""3""3"""""""""""""""""""3"3333"""""""3Dww333"3""333""DfwˆˆU3"""3333D3"DUUDDfD333DDD33"""""""""""""""""""3"""3"""33"""3"3""33""""""""""""33""""UU"33""""�""""""3D3"""""""�����DUD333"""3UDUfUwˆ™wwUUD33""""""""""""""""""""""""""""""""""""""33DDUUˆ™™™wDD"""���""""""""""""33""""3""""""""""33D33"""3"""33fwU"3""33333333wˆˆˆwUD"""""3333333DDU3U3D3DDD3D33"""""""""""""33"3333"""33""D3"3""3""""33"""33""33��"33D3"""3fDU3"DD"""�""""D"DfD3""""""����"3"""""DffUUDfˆˆfUUDD3"""""""""""""""""""""""""""""""""""33Uwwwwˆf3D""3���""""""""""3""33UDD3"""""""""3""""""3333""""""""3DfˆD"3""3"3333"3ˆwˆwU""""""33"333"333DUUU3D3DDDDU3"""""""""""""3333DD3""33333""""""3"""""""""3""�"333D""DUfUD""3D""�"3UUDwD""3"""""���"""""33DDUUD33UUfUDDDD3"""""""D3"""""""""""""""""�""""""DUfDffffUD""��""""""""""""3DUfUD3"""""""""""D3"""""3333"""""""""UwU""3""""3333DUˆˆwf3"""""""DDD333333DDUDDD333UDfD3"""33"""""""33""3""33333"""""333"""3""""""�""33"""DwfD""33"""3""""3UUDU"""3"""""""�3"�"3wUUDDD33"DUDDDDDD""""""U3"""""""3"""""""""""3"""��"""""33DUffUwˆU""�""""""""""3ffUfDD""3"""""""""33"""""3333"""""""""DD3""3"""3"33"UˆˆˆwU3""""""3D333333DDDDUD""33DUDDD3""""""""""""""""""""""""3"33"""""""""""""""""""""33D3"""""3ffD33"""33"3"""""DfU3"""3""""""��"3wˆfUfwwUDDDD3"""DUDDDD33"""""""3"""3""333""""""""33""��""""D3UUUUwfˆ""��"""""""""""""3DDUUf3"3"3D3""""""""""3"""""333D""3""""DD""""""""3""33f™™wˆf3"""""""DUDDD""33D33D33333DUD33D"""""""33"""""""33""""""""""33"""33""""""""""""""""DDD3""""3D3D"3333333""""3""D3D"""""""3""��U™ª™ˆffwDD3333""3DD333333""""""""""""""3""3D33""""""""""""33ff333UU"���"""""3D33333333333"3DDD3"""""""""""""""3"""""""3D3""""""""""""3f™™™wfU"""3"""33DDDD3"3333DD33"3DD333UD33""""""3"""""""3"""""""""""33"3"""""""""""""""33DD33""3Df""D333333""""""""Uf3"D3""D"3""""�"w™ˆffD3DD333"3""D3DDD333333"""""""""""""""3333333"""""333"""""�3""""U3""3f""""���"3"""3U3"""3"3"3"33""3UU3"""""""""""""""""""""""""fD""""""""""3Uˆ™™™wfDDD3D33"33"DDDDD33333D33333D3"33UD3D3""""3"""""""""""""""333"""3""""""""""�3DUD3D3"3UU3""D33"3"3"""""""""""DUDD3UUUUUU33333"""""3wˆˆwUDDD3"3333"3"""3D3DD"33""""""""""""3"""33"33""""""3""""""""3�"33""ff"�����"3DDDD3"""""""""3DU""33DD3""""""""""""""""""""3f3""""""""33wˆ™™ˆfU"""333DD"3"3DDD333""3DD3DDD33D33DUDUD"""""""""""""""""""""3"33DD3"""""""""""""��""3UUU33DDDDD""""""""""""""""fUUfUUUDUUDD3DD3DDDD33D33DfU33DDDDD33333333"3"333D33D3""""""""""""""33""3""3"""""""3""""""""�""3""DD"""��"""""33""""""""""33""3"DD3""""""""""""""""""DD3""""""""""Uˆˆˆwf"3"33D3D3D33""3333"""333DDUU3D33333DUDDDDD""""""""""""""""""""""3"3DD3"""""""""�"33DwwD"33DfDD""""""""""""""ff3DDDDDD3333D33DD3UUUDDDDDD333DD3333333D33"33333DD3333"""�"""""3""""""333"333""""3""""""""""3DD"""""�""3""""""""""""3"""""""""""""""""""""""f3"""""""""""""33w™ˆfU33333D333333"3333333"3333UUfD3D333333D333Df""""3D"""""""""""33333""""""""""""33"3ˆf3""3"DD"3""""3"""3UfUUffUUUD3333333D3"3"DUUUDDDDD333DUDUDUD"333333"3"333DD3"3"""""33"""""""333"""""333""""""""����""""""333D"""�"""""""""3""3""""""D3""""""""""w3"""333""""fˆˆfDf3D333"333D33"3""333333"33UUUDDDDDD"3""""""DDD"""""""""""""333"""3"""""""""""33333fU3""3UUD3""""""""DDD""DUffˆˆfDDDDDDD33"33333333DDUUDDD3333D3DUUffUD3"""33"3333D333"3""""�"3"""""""333"""3333"""""�"��"""""""3DD3D"""��""""""""""""""""3D""""""""3U3"""""""""""3Dw™wDDDD"33D3333D3D333""3""33"3DUUDUDDD33""""3UU3""""""""""""""""33"""""""""""33333f"3"3Df"""""3DDUUDUUfUDDDDDDDDD3D3DD333D3DUUUUDDD333DDDUfwfUD3""D33D33333333"3"3""""�""""""""""""D33""33D3""""""""""""""33D3DD"""""""""""""""""3""33"""""""Uf"""""""3f™™UDD3DD"D3333333D333""33"333DUDDDUUU3333""""""33UU33D""""""""""333"""""""""""""""""3333f3"33Dff3"""""3"DU333DDDUDD333333DD33"3D333D3DUUDDDDDDUUUUUUDDUD"333D3DD333UUD3333333""""�"""""""""""""""""""3333"""3""""""3""�""3�""""""33UU3""""�"""""""""""""333"D""D"""""3ww""""""Dˆ™™wDD3D3D33D3333333D""""3"3"33UDDDDUU33DDDD""""""33DDff""""33"D""""""""""""""""""""""""""""3DDUw"33DUU3DDDUDU""DDUfD3333333""3DD3"""33DDD333DD3DDDDUUDDDDDDUUDD333333DDD33333DDDUUU3"333"3""""�33"""D"""""""""""""""333""3""3"""33""3"33"�"""""""""3DUD3""""""""""""""""�"333"""3"3""""Dˆf""""""3wªªˆUDDDD3DDDD3333""3333""""""3DD33DDDDU"3D3DD"""""333DDUf3U3"""""""""""""""""""""""""3DUDwf"""D3UDDwD333UUU33333"""""""""3D3""333DDD333D33DDDDDDDDD33D3DDD33333DDD33"33"DUUfUD""33"3"""""""D3""DwU"""""3"3333""""3333""3""""3""""33"""""""""""33DDU"""""33""""""""""""3333""""""Uf""""""""3DˆªˆˆUUDDDDDDDD"33333"33"3"""3D""DDDDD33DU3""D33"3333"3D3DUUUU"3"""""""""""""""""""�""3DDwˆ3""33DwfU""""3"""""""""""""DD3DD3"""3DDD33DD333333D3333333D33333D"3DDD3"3"3DDUfDD3"3333"""""""""""""""3fU""""""3"""""3"DD3"""D"""""""""""""""""DD33"3"""""""""""""""""DU""3"""""DfD"""""""""""""w™wwfUUD33"33D33"33333333""33UfUUwfUU3"333UD"33"33"3"333D3D3DDUUwwDU""""""""""""""""3DUwU""""3DUw""""""""""33DD"33""""333DDDDD3D3"33DD33333333333DD33DDD333DUDUfUfD"3333""""""""33"""""3"""3""""""3DDD3"33""""""""""""""""DDDDU"3""""""3"""""""""D"""""Dww"""""""""""""f™wfffUD333333D3""3333333""UfffwfUD3""33"33DD3"33UD3D""3UDDDDDDffUww3""""""""""""""""""DDff3"333DU"""""""333"33"33333DDDDDDDDD3D33DUD3""33D3DDDDD33333D"3333UUfˆf3333333D"""""""3""""3""""3D33"""3""3""""""""""""""DDDDD3DD"""""""3"""""""""""""""UUD333""""""""""wªfffUUDDD33333"""3""33"""3UfUDDD3""""3"""""33""333DUf3""DD33UUUD33DUD""""�3""""""""""3"33""3DDD3""""DUU3""""""""""3333333D3333DUD3D3DD3DDDDUU3"3"3DDDDDDDDD3333"""3333DD3UD3333"3D33"""""""""""""""D3"3""3""33D3"�3"""""""3DUDDDDD3"""""3"""""""""�UD3333333""""""""3ˆ™ˆwwfUDDDDDD33D"33"""33D3UfU333333""""""""""3"""3DDUfD3D"333D33333D3ff""""""D3""33D333"""3DD""""33D3""33"""3""3DDUD3"333DD3DfUDDDDDDDDDDDDfU33DU333DD3D33D3D3333333333"3333DDD33""""""""""�"""""""""33D""""333"3D"""��"""""""3DD"33UU3""3""��""""""33""""""�3UU333333333"""""3w™™ˆwffUUUDD3DD3U"3"""333DDUUD333333"""""""""""3"D33DDf3"3"3D333333D3Df�"""""fU3333"""""3UUD"""""UD""""""3"3"333DDDDwˆˆD3DDDDDwˆfDDDDUUUwwfUwfDUUD3333DD33DDUDUU333333D333""33DD"3""D3"""��"""""""33""""""""DD"�""""""""3333"UDU"""33""""33""""""""""""�"ˆfDD33333333333D3f™ªˆwwffUUUUUDD3DDD33""""DDUD333333""""""""""""""33D3DDU3""UwUD3333333D3DfwDD3""""""3D33""""""""33DU3"""""ww"""""""""33""""3DUfUU"3"fwDUUUfwDˆwUUUUfˆ™DDDwwUU3"""33333DD3DDU3D3"333333D33333UD"333UU33D"""""""""""3U3""""""D"���"""""""333UfDD""""""33"""""""""�3ˆªfUDDDUDDDDDDDDU™ªˆUfffffUDUUUDD3Df3""""""Dff3333333"3"3""""""""""""3DDDDDwfUD333333333333"3Dwwwf"""""""""""""""�"33DD""""3ˆw3"3"3"""""D3"""""333"3fUffwfDDˆfUDUUf™™w"Df3"UfD""""3DDD3333D3"33333D33D3DDDDDD"3DDU3"33"""""D3DD3""�""""3DDfDD3""""""""""D33"D""""""""��Uªª™wwwwwwUfUUUUfwªªˆ""fUUUU33DUUUDDUDD3"""3DfU333""3"3""""""""""""""""3UD3""33"3"333333333333DDfffˆD�"""""""""�3DD3333f™™""333"""33"33D3"3""""3fDUU"wˆfDUUff™ˆ™fˆU"3UfD""3fU3D""D33UU333333D333333U3""DDDD3"""""""3D"3""�""""3DD3D3"""3""DD3D"3"""""""""����Uªª™ªªª™wˆfwwfww™ª»ªUUUDUDDDDDDUUUUDD33""3UUD"""""""3"""""""""""""""33D33"33"3"3333333"33D3DDUUUfUfwD�"""""""""""""""�"DU"Df»»wU33333"3D3""33D33"""""""3"fD3UwfUUUfw™™ˆfwf"DfU3"wfD33D3fD33DD3333"3333333DD"33DUD""�""""D"�"""""DDDD33D""""""3fUD""3""""""3"""3D��wªˆfw™ªÌ»ª™™™™ªª»ªª™U33DU3DDD3DDDUUf3D3333DU3""""""""""""""""""""""33D3333333"3333333"33333DDUUfUffUww"""""""""""""""""""�"3DU""™ÌÌ»ˆ33DDD33333D33D3333""""""3UUfUDDDD33"DwwD33"DDD"DUD"33UDDU3"3"""""33333""3333D3""��"3"3""""�"""3D3DU333""���""3"""3DUD""3""""""333"�3ˆ»™"Dfˆª»»»»»»™fUwˆf"D333DD333DDDDDUDDD333DD""3""""""""""""""""""""""3D3"3"""3"""33333""3"333333DDUUUUfUwwDffU3"""""""3"""33"3�""ffDU™wª»wDDDUUDDD3333DD333DD"""�""3DDDD3D3D33333ww""3Df3"3333DD3D""33"""""3DD33333333333""""""""""""3"3"""""""33D"D"""3��"33"""""3D"D3D"""""""""�3ˆª™ªªwDUˆª»»»ªªU"""3f"3UD3DDDDUUUUUUfDUfD333DD33"""""""33"""""""""""33333"333""""33333"""3333333DDUUUfUUUfwfww""""""""""""""3"��"ˆÌˆwfDwªÌˆUUDDDUDDD3DDD3D3D33U3"3DD"""33DDDD3""33fwwwD""""3Uw33333333DD"""3"""""""3D333"3333""""""""""33""""""�""""""""Dw"��"""""DUD333"3D3""""3�D™ªªª™wDUUfˆ™™ˆUDDU"3U"""UUDUUDffwffwwffffU33DDD33""""""""""""""""""""""3333"""""""3""33""""3"3333333DDDUDDUD33Dff"""""""""""3UˆÌÌ»ˆDDwªªwUwUffDDUUUUDUDDDDD3D""""""""""333""3"3fˆˆU3"""""UwD333333DDD3"3D3"""""3D"333D3""""""""""""DD33""""""""""""�3""3D33DUUw3"""""33""3""""""U»»»ªw3Df3DDUD3"33"D3D3"UUDDUDUfffwˆwwwffD3DD333""""""""""""""""""""""33"""""""3""33333""3"3"333333333DDDD3333DDfU"""""""3""""""3"fªªªÌ™DD3UUfwffwwˆfDDDUDDUfwwfwUUD"""3""""3""33""""3DU™w3333"""DUfD33""333D3333""""333333""""""""""""""""""""DD3D3"""""""""""""""""""3DDDDDUw3�""""""""""""""""""�"f»»ªw3Dww"D333""""D33DDUUU"DUUffwˆwwwffUUUD"33"""""""""""""""""""""D33"""""""33"333D""3""""33"3333"33333333333UwD"""""""""""DD"D»»™™»f3D3""""Dfˆf3UD3U3�D3D""""""""""""""""""33DUˆªfD33"""333D3DUD33333""""""3""3D3"""""""""""""""""""""""3DUU3D333"""""""""""""""""3""�"""33DUUUww"�""�""""""""""3""""D™™ªª™D��Dfww3"3"""3"""""3DD""DD""DD33fˆwwwfUfUUDD3"""""""""""""""""""3D33"""""""""""""3"""""""""""""""""""""""3DDDfwf""""""""""""""DD3"fª™wˆˆˆD3"333"""""D33DfDffD"""""""3""""""""333UDDDUf33D33"3"DfUfD333"3""""""""3333""""""""""""""""3333"D333333"""""""DDUU3333333"""""""""""""""""""33Dfff""""""""""33"""""""ˆ»Ì™ˆw3�""3UU"""""""""3U33"""""DwwwwfffffDD3"""""""""""""""""""3D3"""""""""""""""3"""""""""""""""""""""""33333Uwf3""""""""""3DD3UwˆffwfDD"3"333""3""333"""�"""""""33""""333D3D33DD"D33UfUˆ™fDD33"33"""""""""33""""""""""""""""""D333""3"3333"""""""3UffD"""3D3"""""""""""3"""""�3""""33Dff3""D333"333""""""""""""""U»Ì»33��"33D"""3D3""""33D""""""""3""DwwwwwfUwwDD3""""""""""""""""""""3D33"""""""""""3"""3""""""""""""""""3333DDˆD""""""3DDUUUfwUfffD333333""333333333""3"""""""""""""""DD3"""33"33D33DDw3D""""3"33333""""""""""""333"33"3""3"""""""""33"3""""3DUwf"""""3333""""""""""""""""33"""""3DfU33""""3UD33DD3"""""""""""""3ˆ»»ˆ""3"""U3"""333DD3"""""33"""3fUwwfwwwwUD33"""""""""""""""""""DD333""""""""""""3"333""""""""""""""""""333ˆ™D"""""""""3DUUUwwUUUfffU33333D3333D333""3"""""""D""""""""""""""""DU""""3"""""DDUf"""""3333DD3333"""""333"3"3DUUUDDD33""""""""333""""""3Ufff""""""3"333333"""""""""""""3""""""""3fD"""""""3"3DDDD3D3"3""""""""Uª»U3""""""3333UU3"""""33"3UUUDwfwwwwfDD33""""""""""""""""3DD3D"3""""""""33"""3"3"""""""""""""""""""""3D™ˆ""""""3333DUwwfUUff3UD33333D33D3D3""""""�""""3333""""""""""""""33"""""DUUw3D3"33DD3DD333""33""3""3"UwU33""""3D"""""""""333"3"33DffU""""33"3333333333"""""""""�"""""""DU"333""""""""3333DDUDUU3""33"""""3™ˆf"�"""""""3"333Df3"3"33"3UfDD333DfwwffD3"""""""""3"""""""3DDD3333"""""""3"33333""""3""""""""""""3UU™ˆ"""3""3DDDffUUffUD"333D33D333333"""""""""""33D3""""""""""""""""""""33DUUD3333333333333"333333""33Uˆw3""""""33"""""""""333DDffU"""""33"333"333333""""""33""3"""33D""3D3""333"""33""3UUD"""""""U»™""""""""���"""33DDDwU"33333UUDDD33DD"DwwDD3"""""""""3"3"""3DDDD3"3"""""""""""3UD""33""""""""""3DUU™ˆ"""3"""33DUfUUUUUUUU33DDD3D3333"""""""3"33""""""""""""""33""33UfD3DDDDDD333DDDD3D333D33UUffD"""""3DD"""""""3333DUfU33"33"""""33333333"""""""33"""""""333"""33""3"""""""""3Uw3""Dˆ™™Df3""""3""�����"""3DUDff33333UUD3DD3DUD"3DfU33""""""""3""""""DUU333""""""""""""""""DD3"""""3"""""""""""DDUffU"""3333DUfUUUUDDDDD3DD3DD333"""�""""""""""""""""""""3333333DDUUDUD33333DU333"UfDDDDD3D3"""""3"""""DD33DDw™D"D333"33"33333333"""333""333""""�""3D3""""33"""""""3"Dw3U™™D�UU3"33D"�����"""3DUDDfD33DDfU33DDDfU3"33UD3""""""""3"""3""""DDD""3""""""""""""3"""33D"""""""""""""3"333DffU"�"""""333DUfUUDDD3DDDDDUD33"3"""""""""""""""""""""""33""33333wwUDD333"33""""33333"3D333""""""""""""""3D33DUwU""Df33333"""333333333"""""33"3"""""""3DUD""""33""""""333UD"Uˆ™wDU""""""33""��"""3DUfDfU33DUfD333DDf3""3"DU"""""3333333"""""3UD3"""3""""""""""3"""3D"""""""""""""""""""3"3DDUDffD3""3DDDUUfUUU3"DDD3DDUD3333""""""""""""""""""""""""""33333"3Dˆ»wUDD333""""""""""""33"DDD3""""""""3""""333UwU3""3UfD333"3""333333333333"3"33""""""�""DU3""""""""""33DD3"""wªªw"3D"""""3D33"""""3DUffwD3DfUDDDDDfww"""""DU3"""333""33"3"""3D33""""""""""""33""""3"""""""""""""""DD333DDDUfww�"""""33UffUffUUU"DD333D3DDD3""""""33"DD""""""""""""""""3"33333D33DwUDDDD33""3"""""3""333DD33""""""""""3"""""""""DwD"""3D33"""3"33D""333"33333"""D3"3""""�""3U3""""""�"""33"U3"""fªª33D"""3"UD3"""3DDUˆˆ™ˆwfUUUUffUfˆU"""3UfU33"""33"33"""""D3""""""""""""""3333"""""""""""""""3""3333DD333DUfDfw"D""""3DUUUUUUU333DD"3DUDD3""""""33"""""""""""""""""D333"""""DDUUU3"""""""""""333D3"""""""""3"""""33"3U"""""3ffD33D3D3DD3333"3333333"3333""""""""""D""3""3"""""3333""""""""fˆw3""UD""""3UU3"""""""3DUwˆwwˆªˆˆwwwfUfwf"""3wwDD3"""33"""3"""""D3""""""""""""""33"3""""""""""""3D3""33DDDD33UUfUff"""""3""""3D33DDUfUD333"3UUUD3"33333"""""""3"""""""""""""""""""""""3D33"""""""""3D""""3""""""3D3D3"""""33""""""""33D""""""33ˆfD3333DD33333"3D"33D3333""""""""3""""""3""3"""""""""3wwD""""""3f3DUD3"""""""33DDUfwwfffˆª™wUUUUwwD""""3fwfDD""3333333""""3U3""""""""""""DDD333""""""""""3333333DDDDDDDDUUˆw""""""""DD3DUUD33"3D3DUUD333D3""""""""""""3""""""""""""""""""""""""""""""33DD""""""""""33""""""""""""3DDDD3"""""""3""""""""""""""3333""33"DD3UUfUD33333"333D3D33D"""""""D3D3""""""""""""""""""UªU"""""fD""UUD33""""33DUUfwUUfwUUˆªfUDDDDww3"""""fwfDD333333333""3"DU333"""""""""""DD33"�""""3"""""""""33"3D3DD3D3DDDfˆD3""3"D33DUUD3333"DUUDD3"33"""""""""""""""33"""""""3"""""3"""""""""33DDD33"3""""""""""""""""""""""33DD333""""""""""333""""""""33""33D3""33DDDDD33333"333"3333"""""33DfU3"""""""""""""""""U™»D"""""""DU33UUD3333""33DDfwˆfDDfwwˆwD3DfDDfU"33"""DwwUDD333333333""3DD33""""""""""""33""3""""""""""""3"""333D3D333Dfwf3"""3"333DDD333""DU3DD333""""""""""""""3333"3"""33"""""""""""""333UDDD3"""""""""""""""""3D3"33"3""""""""3"DD3""""""""""""3DUU3"""""333DDDD3""3333""3333"""""""""3Dfff"""""""3"""""""""�Dˆ»ˆ3""""""""wD""DUDUD3D33D33DDUffwffˆ™wfDDDD3DUUD""3"""fwwfDDDD33333"""DUD""3""""""""""""""3""""""""""""""3333D"3"3333DUUUf3""""33D3333""""33DD3333"""""""""3D""""""""3333""3""DD33"3""""""""""""33"3UD3"""""""""""""""""""333""333"3"""""""""""D33""""""""""3D3"""""3"D3DDDD"3""3""D3D3""""""""""""3UDDU3""33"""""""""3"UÝ»w""""""""UU""UD3DD3333DDDDUDDf™ª™wUUDDDDDD33Uw""""333DffwfUUUD3333"""fD""""""""""""""""3""""""""""""3333"D33333"""DDDUU""""3fD"33"""""3"3DUDDD333DU3""""33""""""""3D333""3"""33""3"""""""""""3fD3""""""""""""""""""""""""""33D3"""""""3"""""""""""""3""""""333333UD33"333D33"""""""""""""3DDDDD3""333""""""""3""""""™ÝÌw""""""""w33fD""""3DD3DUUUDfˆ™fD33DDDD333DDUU33"3""DDfUUUUUDD33"""Dw3"""""""""""""""D""""""""""""3""""D"33"""3333UUf"""""3D33"33""""""33D3DD3"33"""""""""""""33"333""""""33"3"""""""""""UD3""""""""""""""""33"""3""""333D3""""""""""""""""""""""""""""""""3333333D3"3"333D3333""""""""""""DDUUDUU3""3""""""��"""""33"""U»ÝÝ»D"""""""""wUwf3""""3DDDDUUfˆwU3""333333"3UU333333333"UDffUDUDDD33"3Uf3""""""""""""""3"3"""""""""""""""""""""""""""3DUwf333"333DD333"""3"3""33DDD3"""""""""""""3""""3D33DD3"""""""""""""""""""""3DD3"""""""3""3"""""3UD""D"""""3""33"3""""""""33""""""""""""""""3333333DD333"D3D3"33333""""""""""""D3DDDDU333"""�"""""3"""""wÌÝÝ»™wD""""""""UDˆwD33"""3DDDDUˆˆD3"""""""""DU""33333333D3UUffUUDDDD33DfD3"""""""""""""""3""""""""""""""""""3""""""3""33Uˆˆˆ™™w3Uf333""""""33DDDDD33"""""""3""""3DDD"""3DDff3""""""""""""""""""UU33"""3"""""""""""""33"33"""""""3D33""""""""""""""""""""""333DD3""3DD3D33333""""""""""""3""""DD3fU�""""""""DfÌÝ»ª™™™U3"""""""3UffU3""""""3DfwwU""""""3UU"3333DDDD3DfUwfUU3333UUU33"""3"3"""""""�""3""""""""""3"""""3"""""3"33"333Uw™»ªwffD3"3"""""3"3DDDD33""""""""""DUU3""3333""""""""""""""""""3"UfUD""33""""""""""""""""""3"3D3D"""""""""""""""""""D3""333D3"3DDD3333D3"33"""""""""33"""""33"U3""""""3"D3ˆÌ̪™™ˆˆwfU"""""""DffD3"""""3wwˆfD""""""""DUD""""D33DD3D3fffwwwU"3UwfD"3"""3"33""""""""""3""""""""""""""""""""3"""3""33333DUfˆˆ™wwU"33"""""33"D333"3"""""""""""D3""""3""""""3"3"""""""""""""""""""3"33DDD""3"""""""""""""""3""""DDD3""""""""""""""""3"3U333"3D3"333333333D33""""""""""3"""""D3DU""""�""""""33DDwÌ»ˆw™™ªwUwU"""3"33wwD33333"DˆU""""""""""""""UUD3"""3DDDDU33UffwfUUwUwfD33"D""""33"""""""""""""""""""3"""""""3""""3"333DDDUUUUˆª™D"33""""3"333DD33D3"""""""""33""""""3"""""3"33333""""""""33D"""333333333D3""""""3"""""""""""""""33333"""""""""""""D33D3"33"3D"333DUU3"""33""""""""33""""""""33DU3"""""""""333Dwª™ˆ™™™ª™™™U"333333ffDDDD3Uf™w""""""""""""3fUDD3""""3DUDUUD3wfwwUUffUDD333333"33""""""""3"3"""""""""""""""""3"""""333333333333DUww"3"""""""3DDD333""3"""""""""""""""""""""""3"""3"""333DUwwfwˆwwUDDDUUUDDDDD3""3"""D3"3"""""33"""""""""333D"""""""""""""""3""""""DDD3""""3D3""DD33UDD333"3"33""3DD3""""""""""3Uf"3""""""""33Dfˆ™ˆ™™ª™ªª™™ˆD333333fˆUDUfU™™UU"""""""""""""3UDDDDDD"""3333DUUUUwfwwU33"3D333333333""""""""""D3"""""""""""""""""""""""""""3333""33DDUU3333"""""33"3"""""3""""""""""3"""""3"""""""""3"3333DDUUUfffwUwwwfUDD3333DDDDD"""""D3"3""3""3"""""""""3DD3""""""""3"""""""""""DD""3"""U3"3UUUUwfUfUD33D"""3DUUD""""""""333DUD"""""""""33D܈™™™™™ˆªªˆfD"333DDwwfUˆªªU""""""""""""""3wfD3DDDD333"333UUUUUUDD3"""DUD33D3333333"""""""""3"""""""""""""""""3333"""""33""""3"33UUD3333"""""""""""""""""""""""""3"""""""""""3D33""333"3333DDUUUUUUfwU3DUDDUfDUUD""""33"""""3""""333DDD33""""""""""""""""""""DU3""3""UD"3DDUUUDDDDDUffUUUUUU3"""""""""""333D"""""""3Dfˆfwˆw™™ˆˆªªª™UU33DD33wfˆª™w3""""""""""UˆwfwfD3UUDDDDUUDfUDDfwUD3"3DUD""3333333""""""""""""""""""""3"""""""""""""""""3"""3D3""""""""""3333UUU333"""""""""""""""""""333"33D33"3DUffUD333"""""""333DDUUUDDDD33DD3UD3DD"""""""""""33DDUDD333""""""3""""""""""3D"""3""UwDDD3DDD3DDDDDUDDDDU33"""""""""""""333D3"""""""33Dw™ffwwˆ™™ˆ™™ª»ªwD33333f™»™D333"""""""""wˆU33DfwfDUDUDDUUUUUUffUD3"33D33"33D333""""""""3""""""""""""3""""""""""""""""""""""3D"""""3"""""33DDD3D"333"""""3"""""""""""33UDDDD333Dffwf3D""""""""""""333DDD""3""""""""""3""""""""""""3DDDDDD333"""""""""3"""""""""D3"3"3"fffU3333DUU3D3DD3DDDD"""""""""""""""""3333D3"""""333ˆ™Ufffˆˆˆˆˆˆ™ˆˆwfU333DUªÌˆ33333""""""""""""3™f""3DDUUfˆUDDDDUUUDDwwwUU33"333D33333333333"""""""""""""""3"""""""""""33"3""""""""DD""""""""""3DDD3"D"""3""""""""""""""""""33"""3DD333DUU33UD3""""""3""""""3333"""""3""""""""""""""""""""33DDDDUD333""""""""3""""""""333"3""Dwwww333333333333DDDD3"""""""""""""""""""33DDD"""""""3DˆwDUfffwˆˆˆˆˆˆˆfwwD33f™Ì»f33D33""""""""""U™f"333DUUUDfˆw3DDUwwwˆˆˆfUDDDD33333"333"""""""""3"""""""""""""""""3""""""""""""""""""""D3"""3"3"33DDDUfD3"""""""""""""3""""""3U333DfDUD3"""""""""""""""""""""3DD33""""""""""""3D""""33DDDDDDUDDD3333D3D"3333"""""""3""""33fwwUUf"3D3333DDDDDUDD333""""""3""""""""""3"33333D33"""""""3fwD3UffUUfwwwwwwfUUw3D™»ªfDDDD333""""""""""""DwD"3333DUUUDUf™ˆˆwwffUUˆwfD33DD333DD3D33"""""""""3""""""""""""""33"""""""""""""""33""""333333DDDDUU3""""�""3""""""3UUDD3DUUU3""""""""3"""333""""33"33"3"""""D3D33""3"33DDDDUUUUUfffwˆwffUDDU3""""""""""""UfwfUfD3"33333DUUUU3DUUD""3""""""33333""33DDUDDD333D3""""""333wU33DDUUUUfwwwwfwˆˆffU»™fUDUDDD33"""""""""""33D"""""33DUDDDUffwˆUDDDUfwfDD3333333DD3333"""""""333""""""""""333D"3""""""""""""3""""3""333333UDDD""�""3U3""""DDUU33UD3"33""""""""333333"""3""""3"""�""""""""""333"""3""33333DDUUUffwfwwUUfwUDD""""""""""""3"ffwUfUfDD3"333UUU33DDDD"33333333DUDDD3DDDDDDDDD3"""""""""3"DˆD"33DDDUUUfwwwfUˆª»wf™UDDDDDDD333"""""""""3D3""""""33DDUDUUUfwˆfDUUffwfUDD333"3DD3333""""""3333"""""""""3D3"33"""""""""""""""3""3D333D33""""33D3""DDDDD3DD""D3D"""""""""""""""3DD"3333"""333""3"""""""""""D"333"DUD3DUUwwwwUˆffwfwfUUD3""""""3""""""UUwUDwUDDDDDDUD3D3DDDfD33"3DDUUUUUD3333DDDDDD333Df3""""""33wˆ3"DDD3DDDUDUUUffUˆ»Ìª™DDUUDDDDD33""""3""3""UD"""33DDD3DUUDDfwUDUffffUUUD"D3DDDDDD3"3"""3333333""""�""""3"D33"""""""""""33"33D3D3DU3"��""""DUU3"3D33DDD"3DUUD""33"""""""""333D""""33"""""3""""""""""""3""""""D333DUwwfUUfDDUwwwwfUU3"""""33""""3""3fˆf3UwfUUfwwfUUUUDUUUD"33"D3D3DD3""33"DDD3DU333DU3""""33333ww33DDDD3DDDDDDUUUfUwÌ̪UUUUUUUDDD33"""""33"3U3""3DDDU3DDDDUUwDDDUwˆffUDD333D3DDDD33"33DDD333333"""""""""D"D3"""""""""""""3""333333Uw"""""""DwwU"3D3DUD33"Uw3D33"""""""""""""3""""3"3""""""""""""""""""""3UfUUDDUUUUUUwwffffD""""333"""333DˆˆUDwfffffˆwUDD3"3DD33"""333D"""""333DU3333DD333U3""""33DDf3"33DDDD3DDDDDUUDUw™»™fUUUUUUUUUDD33""""""3UU""""33UUDD33UUUfUDDUˆfffUDD33DDUDD3DD3D3DDDD333"""""�"""33""333D3""""""""""""""""""33"DDUUf3""""""""3UUfwDDD3"3UDDDD3""""""""""""3""333""""""""""""""""""""""""3DUUUUDUfffUfwˆwfwfDU""33"""""33333"Uwf3DwUwˆwwfffD"""""""3"""D"3U3"""333DUD33333333DD3""33"fˆD"3DDDDUDDDDDUUUDwª™wUDDUUUUUUUUUDDD3"""""UU3"""""3DDDD3D3DDUUU™wDwˆfDDD3333D3DD3DD3DD3DDD3333"""""""""""3DD3D3"""""""""""""""""""33"UUfU"""�"""3""""DDDfwDDD3DUDD3D33""""""3D3""""""""""""""""""""""""""""""""DDUUDDDUUUUUDDffwwUDDUDD3"""""3333DwˆˆUUUwwwˆˆwf3""""""""""3"""3DD3333333"3DD33333D3U3""3333ˆ™3"DDDDDDDDDDDUUUwªˆU3DUUUUUUfUUUUDDD333"33wf"3""""""3DDDDD3D3UUUfDfˆwwwDDD"33DDDD33DDUDDDDD3333"""""""""3"3"""""""""""""""""""""""33DDD33U3"�"""3""""""3UwU33DDD33Uf33""""3""""""""""3"""""3""""3""""""""""3DDD""33333D333UwwwˆfDDf3"""3333D33fwwfUDDwˆ™™f3""""""33""""""""3""33"33333"D3333D3UU""33"3ˆ™"333DDDD33DDUUUUˆ™U""3DUUUUffUUUUUDDD33"3UwU"""""""""""3DDDDDD33DDUUD3fwUwwUD333DUDD33DDUUDDDDD333""""33DD3""3""""""""""33""""""""33DD3D"3"""""D3""3""33UD33DUD33fwD3"3D33""""""""""""""3""""33"""D3""""""""""""3UD3"""""""""3"Dffwffwwww3"""33"3DDf™ªˆwffUUfwU3"3"""""333"3""3"""""333333"3DD3"3UfUU""""33"D™™33D3DDDD33DDDUfˆ™f333"DDUUUUUUUUUUDDDD3"DfD3"3"""""""""""333DD3333DDDUDUˆwUwf33333DDD3D3DUUDDDDDD33"""""""33""""""""3""""""333UU33"3"�""""D3"""""3333DDD3UDUU33D3D"""D"""3""3D"""""""""""""""33"""""""""""3D33""""""33DffUUUf™ˆwU"""3"DD3w™ªª™wwD""""DD3"""""""D"3"""33""3D3333333D3UfwwfUwU3"D""3"w»ˆ33D3DDD3DDDDUfwªªD3333"DDDUUUUUUUUDDDD33Dw33333"3""""""""""333D3333DDDDUfˆwfDwU3""3U"3333DDDUDDD3333""""""""""""""""""""""33333""3""""""""3""""""""""33DDDD3DDD""333""""""333""""3""""""3"33""""""""3"""""""""3""""""D3"""""""""3DUfUUfwfw™™f"33333UwˆwˆfUDw"""333333""""""D"3""3"""33"3""33UfffDD"3UDD333D""D™ªw333DDDDD3DDDUUf»Ìf"3333DDDDUUUUUUUUUUDDDff3"33""3"""""""""""333D33DDDUUfwˆfUwfUUUDDD3""3DUDDD3D3D""3""""��"""""""""""""""""""3"3DD""3""""""""""""""""""3DDD33DUf33""3""33"""33""""""""""3""""""""3""""""333""""""""""""3"3"""""""""""3DUUUUfwfU™™ˆ3333Dfw3DUfUDfU"333"3"333D333333"""33""33333D3DUU333DUDf3333UD"3f™™f3333DDDDDDDDfUU™wUU33333DDDDUUUUUUUUUUDUwU""""""3"33"""""""""""3333DDUUDUwfUfUwwUUUUD3D"3DUUDD33D33"""""""""""""""""""""""""""33DD""3"""""""""""""""33333DUfDD33"""""33"""33""3"""""""""3"""""""""33"""""""""""3"""""33"""""3DUffUUfwˆ™™™f333wf33UUUDD33333"""3UD3D3D3"D3"""33"3D33DDDUU33DfwfDUD333DUUf™ˆˆˆD33D3DDDDDDDUUUww33U33333DDDDUUUUUUUUUUfˆD33""3"""333""""""333DUfwUfD"UUfUDUUU3"D"UfUDD33333"3""""�""""""""""""3""3"""""""""""""3DU3"""""""""""""""""3DUD33DDUDUDD3D"3"""""333""""""""3"""3""""""""333""""""333"""""""""33DfUfUUUUUfˆ™ˆˆDUwfUwwUUD333"""33333DD"33333D"""""3DD333333fDDfwU3DU3D3Dfwfw™ˆˆ™U33D3DDDDDDDUDfwfU3"UDD33DDDDDUUUUUUUUfˆˆD333""D""333"""""""3UDUffUfw3""UfUUDUD33DUfUDD333D3""""""""""""""3"""""""""""""""""""3""33"DU3"D3""3"""""""""""3UDD3DDUffwf33"DD3"""3D3""""""3"3U333D"333333""3""3""3"3"""""""""33DUUfUUUfffw™ˆ™wUUDDU™fD333""""3"333"33"3D3""""""33DD333333ffwU333UU3UUwwUˆˆª™ªf333D33DDDDDfUfªD3D33DUDDDDDDDDUUUUUUDwªwDD3333"33"333"""""""3DfUUUfwf3�3UDUfDD3DDDUUUD3"3333"""""""""3"""""""""""""""""""3""""""""33"33DfwˆfD3DD"""""""3DUD3DUDwfUffD33"3""""""3""3""""""3"""DUD""DU""D3D""""""""3D""""3"""""""""""333UUUfUUw™™™™™™wDDDwwwwU3""3D3U3"3333333333"""""33DDD3333DwUfU33"UfUUffwUfw™wwfD33D3DDDDDDfUUˆª333333UfDDD33DDDDUUUU™ªUDDDD33""D"""33"""3DDfUUUfU"DUDfD3DDDDUUUUD33333"33""""""3"""""""""""""""""""3"""""""""3DDUUwˆwUUfwˆf""""33DD33DDUDDD33333"""""""3""""""3"�3""""3DDU"3U3"33333DDD3"""""""""""""""""33"3DDUwff™ª™wˆˆwU3DffUUUfUUwUDD33D3333333333"""3"DDDD33DDUUUfD"3"3fUfwwwww™ˆU"""3DD3DDDDDUUU3w™w333D33"DÌUffDDUUUDDw™ˆ3DDDD333""3"""33""""333UfUUfU"�"fUUD3""DDDDDDDD33333"3"""""""""""3""33""""""""""3"""""""333"""""333fwwwwUDUDUfwwU"�"""""3"3DD333UDDDDD"333"""""""""""""""""��""""""DD33UD33DDU3DDU""""""""""3""""""""""333DUffw™ˆfDDfU33DUfUffUˆf33333333DUD333""3"""3"DDDUUDDDD3UD""33"UUUffwwwˆw3"3333DDDDDDDDUUU3ˆˆ3""3333"3™fwDDDUUUUª™UDDDDDDDD333"3"3"""""""333DUffww"�"3DwfU"3DD3DDD"3D333333"3"""""""""""""3""""""""""""3""""3"""3""""333"DfwwfD3DDUUDDUfD�""""""""""DDDDUUDUDDD33""""""""""""""3"""33DD"DU""UDDUUUDD3"""33"""3"""3""""""""""""3"333Ufwwªªf3DDDUUUffUDDDUDw3D3333""3D333333""""3DUffwffUUfU3"""3D3UDDfwwwww"333333333DUDUUUUUfw3""3333"3"fªUDDUUDf»ˆ33DDDDDDDD3333"""3"""""3"""3DDDDUwwf3""33""UUDDDUDD"3DDDDD33333""""""""""""""""""""3"""3"3"""""""33"33""3333UUfD33UDDDUUffˆ"��"""3"""3D333DUUDD333D"""""""""3"""""3"33333DD""3DDDUUff3""""""""3"""3"""""""""3D3Ufˆˆª™wDDDDUUUwwUD3DDDUwD3D333333DD3333"3""3DUwf3D33D"""3333DUDUwwwff""333DD33DDDUffUUffU"""3"""""D™ˆDDDwª»f33DDDDDDDDD33"""""333""33""33D33DwfD""""""UDUU33UDDD"33DDD333"33""""""""""""""""""""""""3""""333333"33D333UUD"3DUUUUfwˆw"""DfUDD"""""""DD33DUDDD3333""""""""""""3""""�""""3"3"3D3"3"DD3DDUfU"""""""""3DD"D3"""""D3DDDUww™ªˆfDDDDUffUUUDD3DUUwwUfwD3"333DUfD3"3333DUUfDUU33"""33"333DDDUUffww"33"3333DDDDDUfDUfU3""""33"""""™ªwˆªÌwD3DDDDDDDDDDD33"""33D333DD3333DDDU™f"""fUwf3DDDD33D3DDDDDDD3""""""3"""""""""""3"3"""3""""333"3"""33333DUfD33DUfUfwˆ™D"3DfUD3"""""""3"33DDDD3333D3"""3"3""""3"""""""""33""""33""33UD33DU3333""""""3DUU3D33"""""3DUDDDffw™ˆ33UDDffffDDDDDDUUffwfffDDD"DDD3D3"33DDUfwU3Df3""""3""3"333DUDUwwwU"33333DDDDDDDfD"Uf""""3""""3""D̪»ÌªU333D3DDDDDDDD3D3333""33DDDDDDDDUUfˆwU""DffUD33D""DDDDD3DDDDD3""""""""""3""""""""""""�3""""""3"""""""33333DDUD33DUUfUwˆw3"33""""3"""""""""33"33"33"DD"""3"""""""""""""33""""3"""D3UUD3DD"""""""""""DUf"3D33""""""3DDDDUffˆwD3DUUUffUDUDDUUDDDDwfUUUD33DD333333DDUUfUfDDDUD""""""""3"DfUDUUD3"3""3DDDDDDDDDfDDU""""""3""DUˆ™™wfDDDDD33DDDDDDDD3D333""333DDDDDUUDUUDf"D"DUDDUDD333333333DD3DUD""""""""""""""3""""""""""""""""""""333333DD3U333DUfwwwˆ"""""3""""""""""""3""33""DDUD""D33""3""""""""""""3"""""""3D"""3UUD"DU""""3"D3333UUUUD3"""""""""33UDDDUfˆw33DUDUfwDDUUDDDD3D33wUDDfD"3DD3D333DUUUD3wwUDDD3""D3""3D33ffD""""""3DfUUUDDDDUUwf3""""""33f™™wDDD3DDDDD33DDDDDD3D3D33"""333DUDDfUUD33"33"3D33DUD33333333""DDDDD""""""""""""3D3""3""""""""""""""""""""""""3""33D3333333Uwwwwfff""""3D""""33"""333"""3"3DDDU""DU33"3"""""""""""D"""""""""""""""3DUDDD"""""""""U3D3333"DD""""""""D33DDUDUwˆˆ333DDDUfDDDUUD333"DUwU3DUf333DDDUDDDDDUD3fwDD3"""""3D33DD"3UwD"""""""33UUUDDDDDDfwf"""""""""Uwˆ™™™U33DDDDD3D33DDUDD333D""""3333UDDUUff3"33U"�"D"33UUDD"3D3333333UUDD"""""""""""3UD""""""""""""""""""""""""3333DD33U33DDfwwwfDDU""3""""""3"""""""3""3U33D3"33"DDDDfU"""""""""""""""U3"""""""""""""""333D3DDDU3"""""3UD3"D3DUD""""""""3""DD33DDUUU™ˆD"3DDDUfD3D33D33"3"UfU33DUfUDUUffDDUUUfffUD33D3""333"33DUUUUfD""""""33DDDDD3DDUwwD""""""""w™fww™ˆfDDfwD33D3DDDDDDD3333"""3333DD33UUfU3"33DD�""3DDUDDD3D333"333"UUDD"3"333"""3"UU3"""""""""""""""""""""""3333DD3D3333UfwffDDfD"""""""3"""""""""""3333333""33"DD3Dfff33""33""3"""3333""""""3"""3"""""3"33DDˆˆD3""3DD333DD3D"""""3U33"33"33DUUUˆ™3"33DDUUD333D33333DDˆwD3DDDfUUUUfUUfUUUD3"3"3"""""""DDUfwwfU3""""""""DDDDD333DDww3""""""3w™ˆˆ™™™™ˆˆ™fD3DD3DDDDDDDD3333"""3333D333DUD33"33D3"3D""3DDDDDD"333333333UUU3"""""3"3DU3"""3""""""""""""""""""""3333DD333"33UfUUD33f""33D3"""""""""33"""""3"3333"3333Uf3DDDDD333"3"""""""""""""""33"""33"33U3D333"""UD3D3U3"33""""3D3"""3DUDw™ˆU"333DDUD3D333333"3DˆUD3U33UfUfff™wˆU33333""""""""3UUUUˆffUD""""""333UDDDDDD3Dff"""""""Dwˆ™™ˆfUDDˆˆfw3DDDDDDDDDD333333""33DDDDDDDU""3""DD3"""""UfUDD3D3"""3333D33DUU3"""3333""U33""33""""3""""""""""""""3"""33"UDD"""333DDDDD33UD3D333"""""""""33""""33D333DDD3UU3DUDD3333D"33""""""""""""""""3"""3"33DD33U3"3DD"3UU3333"""""3U33""3333DUf™ª™3""3333DUD3333""3"33fUD33"DDUUUfffwfU"33"3""""""""3ffffwwD""""333D333333DDfU""""""3wwˆwfUDDDw™D3Uf3D3DDUDDDD33""""""33DDDDDUU3""3UD3�""""""3UUUD333"""3"33333D3U3"333333"3"333"""""""""""""3"3""""""3D333"333333DDD333f"3D33"""""""""""3"3"""33333D3DUDDDUD333D333333""""""""""""""""3"33Uf""""D33333UUD3""""3""""3333DDDˆ™™™fUfD"3"3D3""""""3"3D33333DD3UUDfˆˆwwfDDD333"""3D"""""UUUfUD3"""""333"3333DDDUU""""""3DfwfUUDUUDDfwUUUwUDDDDDDDDD33""""""3DDDDUUU""33U""3333UUD33""""""3D333DUUUDD""""""3""""""""""""""""3""""""""""""3""D3"333333D3333Uw33""""3""3""3""3""""""""3333333DUUD3"3DD"""33""""""""""""""3"""""D333wwf""""3"33"33333""33""""3333DDDˆ™ˆ™ˆfww3"""33""""""33"3DD333333DUUUfwˆˆfDDD3"3"""333"D3"33UUUfD3""""3""3"33DDDUD"3""""""3DffUD"""""3333DDUUfwUDDUDD3D33"""""33DDUDDU3"33U"""DUUDDD"""""""""3DD3333Uffw33"""3"""""""""""""""""""""""""""""""3"D3"33333D3333Dwˆ3""""""33"3""""33"""""""""3D3"D33UUD"""3333333""""""""""""""""3U3D33fUfwD"""3"""""3"""""3"""""3"333Dwˆˆˆwffwf""""""""""""3D33333333DUDUUUfwˆf"3333""3DD""3""DfUUff"""""""""333"33DUfU3"333""""""""DwfD"""""3""333333DUwU3DD33333""""""333DU3""""3U3""DUDDD3"""3""3DD333333"333DffUDD3D33""""3"""""""""""3""""""""""""33"""3D33333"33Uwf"""""3"33D33""3""""""""""""3""33DDD3"3333333D3""""""""""""""D333"3fff3"3UU3"""3"""""""3"33333Df™™ˆffwwUD"""""""""""3333"333333DUDUUUwˆw™D33D333D3"""""3DDDU33"3""""3D33""3DUffD"""333333""3UUfD""""""""3333333DDwD3D3333333"""""333DD"""3"DD""DUD333333""""33DD""3333333"33DffD"33""""""""""""""""33""""""""""""333""3DD33D3"""DˆU""""""3"333"3333""""""""33"3DUUDDU3DUD3D333"""""""""""3"""3"""""""33""D""3UU"3DfwD""3"""""""333333UUˆª™™wwwˆf"""""""""""""333D333333333DUUfffUDfDDUDDDDD"""""3D3UU3""""3"""D333333UUf3333DD333"333fU3""""""""""""33"33DDfD3333DD3333""3333DD"""33DD"�3DD"33"D3"3"3""3UD"333"33"333D3UfD"3""""""""""3""""""3"""3"3""""""33333333D3333"D3fU3"""33""""3D3333""""""""""3333DDDD3DUUUU3"""""""""""3""33""""""""333"3D3""3DD3UUwf3""3"3"""""33333DUUwªªªˆˆˆfU3""""""""""3D3"3DD3333333DDDUUUUDDDffDDDDD33""""3DDUU333""""""""""3D333DDDUDD3D3"3D3"3DffD3"333333""""3""333DUU33333333""333D3333"""3D3UD��DDDD3""33""""3UU3"333D"3333DDDDffD"""""""""""""""""""""""""""""""3D3333333DD3333DUU"""""D3""""3UU33"""""""""""""33DD33DUDDUUD"3""""""""""""""3D"""33"""3""333333"3DDDUwfUD"""""""""3333DUUUˆ™™ˆwfUD3"""""""""3D333DD3333333D3DDUDDDDD3ff3DD333"""""DDDDDD3""""""""3"""333UU3333DDD3DDD3"Dff"D333D3DD3"""33"3333DfDD33333"3333333"3""3333DD�"�3D3D3"""""3fUDD3333333""3DDUUfU"""""3ffU""""""""""""""""""""""33"3"33"3333D333DDDD33"""""33"3""3UUD333"""""""33D3D33DfDDD333"3"""""""""""33""3""D"""3"3333333DUDwˆU333"""3"""""333DDUwfw™wˆfUfD""""3"""""D3"3f33333333DDD3D3333UU3fU3UUD""""""3UDD""3"""""""33333"UUDD"""3D33UD33D3UU"3333333DD"""""""""3DUUD33333333333333""""33""3f"33""""""""3DDU3333"33D333DDDDUDD3""fwwU3D"""""""""""""""""3""""""""3""33DD33DDf33D""""""""3333DUD333""""""""33333333UUUDD333"""""""""33"""""""3""333"33ffUfffwU""""33"""33"3DUUf™ˆªwwwUD3"""""""""""DDUfUUD"333D333DD3"33DDUDfffDUD""""33DDD""""""""""""""3"DUUU3""3""3333DDDDDwU3""33""33D"""""""3"33DDDDD3333333DD3DD""D33333U""""""3""""""""3"DD3"""""333333DDDfwwDUffUD3333""""""""""""""""3""""""""""333D33D3""""""""333DDDUUD33""""""""""""333333DUfU3333"3""""333""""""""33""333UwffU3"""""""3333DDUfw3wfD333"""""U3"DUfDUwD3""3D3333D333333DUfww3DDD"33DU333"""""3"""""DDDD3"""""3333""3UwfU""""3"33333"""""""3"33DfUDDD3333"DDDD3"""DD33"3f3""""""""""""""""3"D3D"""""""3333DDUfˆwfDDDDDD3D3"""""""""""""""""333DDD3""""""""""""33UfUUD3"3""""""""33"3D33333UUUD3"""""""3"""""""""""""""33"33UfwwwDD33"""""""""3DUDffDˆˆUD33""""""D333DUUUUU"33333"333"3333333DDwffU333333D33""""D"3"333UD3D3"33"3""3""3ffUD""""""""3D33"""""""33DUwUUUDD3333D3DD3"333"""3DU""""""""""""""3"""""""D3""""""3"33DUfwUU33D3DD3""""""""""3""""33DDD3"""""""""""3""3DD333""""""""""3"""33"33333UUfDDD""""""33""""""""""""""""""3DD3DDDf3"DwU3"""""""3DUUUDwˆwDD3""""3D33D33UDDDDD"33"3""3"3333333333DUDDUU3"333333""""3"333"DUDDDD""3D33D"3UUUU33"""33"333"""""""""333UUDUUfD3DD333UD3"333""33DU""3"""""33""""""3DwwUDDD33333333"""""""""3""""33D3""""""""""""""33DD33""""""333""""""""""3333"3"DUUUDD""""""""""""""""""""""3D"33D3333"3"3"3"""""""3DDUfff™ªw3"3""""33D33D"DD3D333""3333"3"""33333333DDDDDUU3DD33333""""333""33DDD3UD33U33UUDUDDD3"3""3""""""""""""""""33DDDUUfDDD33"DDD333""333DfD""""""""""""3DDUUD333"3333333"""""""""3"3""33D3""""333""33D3333""""""""33"""""""DD"33"3""3UfD33"""""""""3"""""""""33UD""3UD3D""D3"33"3""3DDUfwwˆ™wU"3"""""D3333D3"3D"3D3""""333"3""""33333DDD333DDUwfUDD333""""3"33"DDD3D333UU3UDDDDD3333""""33""33"""""3""3333DDUDDffUDDDD"D3""""3333UU3""""33""""""""""""33UUfDDUUDD333"3333Df3"""""""""""""""33333DD"DDD3"""DD33333"""3"33"3"""""""""""""33D3"""""3UDD33"""""""""""""""3"3D33"""""3Uf333"""""""""""3DDUUffwˆˆªf""""""""D"3""333"3333""""33"""""""333"33DD3""333Uwˆˆ™f333"""33"""333D3DDUD333DUUDDD333"33"333"33"3"""""""D33"3D33DDDDUUUUDD3DDD""""""33UD3D"""D33""""""""""""33DfUUfUDDD3""""DDDUD"""333"3""""3"""333"""333333DD3333"""DDD33D33"""333333"3"""3""""""3D3"""""33DD3D3"""""""""""""""3Uˆf3"""333DD"D3"""""333"""3DDUUDUffwwˆªˆ3""""""3""3D"""3"3333""33"D3"""33""""3"3DD3"33"33Uwwfw™UD""""""33"""3"3D3UffDDDfDDDD3"3"3333"33"33""""""33""33D3DDDDDUDUUUUDDDDUD""""3"3DUf"3"�"""3""33""""3"""""3fUUUDDDDD""""33D"3f""""33DD3""""33"""333""""333"""D3D3D33UDD3""33"D33333"""""""""33""""3"""""333D333D"""""""""3"""""""33UDD3""3DDUUUfD""""3DDU33"DDDUUDUfwUwˆªªwD3"33"""33""""3"3333333"33""3""""D333D33"""""""Dffffwww3"""""""""33D333UUDUUUUD3D33"""3333"3"33"3"""3"3"3333DDDUDDUUDUUDDDDUfD"""""3DDw33"""""33""D"3f"""""�"""""DwffDUDDDDD"333"3"DˆˆD"33"""33""""""33""""33"3"333333DDD33333DDD333""""""""""3"33"""""""3""""3DU3"3""""""""""3""3"""3"33333"3333D3DUUU33"""3DffD"3DDDDDDUUUwfUˆ»ˆU3"""3"""333""3"""3""3"DD""""""""33DD333"""3"""3DUUfwˆwf3333""""""33DDDDD33wfDD333"""3"3333333DD3""333"33DUDDUD3UUDUUDDDUDUUD3""""""3Dw3"U""""33"D33DD""""""3UD"3DD33"3"3""""DUwfUfU33""""""3""""""33"3""3"3D33D3D333"33"""""""""""3"""D3""""""""""""DU""""""""""""""""""""3333""""DD333D3333"""""""ffD"3DDD3DDUfUDUwˆªˆf""""D3"""3""D3"""""""3D333"""""""""3DD""""""""""DDDDfwwww3"33"""""3DDDDDUUDUfU3333""3D"333DD3DD3D3D333333333DfD3DDDDDfDDDDUDD33"""""""3Df33"""""""3"3D"DU""33""3wUD""3D3""3""3DwwUU3"3UD""""""""""""""33"3333333D333D3""""""""""""""""3""3"""""""""33""3""""3"""""""""""3"D"""3DD333D333D33"3Uw33DDDDDDUfwfDUˆªªUU""33""""3"Dwf""""""3DDD3"""""""3"""D"""""""""3DDUUDwˆwˆ3"3""""""33DDD3DD3DUU33"D"33333333"""D3""""3D3"33333D33D3DD3DDUDDUDDUD3""333""3"""Uf""3"""3"""33D3"DU3�"33DDD�""""""ff"""""""33"3UUwˆw3"""3DU"""""""""""""3"33""33333"3DD3"3"3""""""""""""33"""""""""""""""3D3""""""""3"""""""33"3"""""DD"""3U3DD3DD3""D""DDUUDDDDDDDUUfffwªÌ»f"3DD"""3wªw3"""33333"""""""""333"3D"""""""DD3DDDDfwwfDD"""""333D"33"D3UU33""3U3"""""""""""""""333""333333333D33DDDDUDUDDD"33333""3"UD""""33"""3""3D3DD""U3""""""""""""DˆU3""""DwwwU""""""33U3""""""""""""""33"333"""333""""""3"""""""""""""3""""""""""""""3""""DD"""""""3""""""3"""3"""33"3"3"DD3D33DDD""3"""""33DDUDDDDDDUffˆˆˆwªˆ""33"""wwwD3""33""""""""""""33""""""333D3333DUffˆwf3""3""3"D333D3DD""33"3""""""""""""""3"33"33D3DU33DDD3UUDUDDD"3D33"3"33""w3"""33""D"""3333"UU3""�""33""""3wwD"""""""3D"33"""""""333D"""""""""3"33333""""33D3"""""""""""""""""3"""3"3""""""""""""DD"33"""""""33""""3D333"33"ff33DD3D3"DU""""""3333DD33D3DUfˆªwUwˆªw3"""""ˆªˆ™""""""33"""""""""3""""D"""""333333"3DUUUfwf3""33""3DDDD333D3"UD3D3""33"""""""""""3"3"DDD3""U3"33DDfUDDD33DD33"3""""""Uf"33""""333"Df33�"�""""""""""DwD"""""""3""3""""""""33""""""""""""""""""""3"3U"""33333"3"3""""""""""""33"""3""""""""""""D3333333""""""""""""""D333333"3UD"333DU3"DDU3"""""""3"33D33UUUfUDDUUfwª™"""""™ªªªwwU"""""3"""""""D"""3D""""333D""""3DDUUUfD"3"""""D333"33DDDDDD33U3UwU""33""""""""""""3333333"""3UDUUDD3333"333DD""333""3wU"""3""""""33333UU3""""""""""""3DU33"""""""""33""""""33"""""""""""""""""""3""""""""3333"""3""""""""""333""""""""""""""""33D3333"3D3""D3"""""3"""3DDDDDD3""3fD"333DUU3"DUf3""""""3"""33UwˆfUD3"DDUDˆªD"""Uˆ™U3UUU""""""""""3"""""""333333""""3DDDffD3UU3""33DD"3D33333"DDDU33U"33"""""""""""""3333DDDUD3D33DDDDDD3D""3"33U3"333"33ˆ""3""""""DDDUDUU3ffU3""""3"""""UfD3""3"""""""33"33"""3"""""""""""""""""333"""33""33""33"""""""33""333"""""""""3"""DD33"333333"""""33D33333333D3"""3U333333UUDD3333""""33"3333DfwfwUD3""U3DUU»fUf3ˆw3"3fDUD""""""""""""33D"33""""33DDffU3D3""""3UDDD3"3"""3333"33DD33""""""""""""""33333D3DD"3DDDDDUDDD3333"33"3"333""3wf""""""""3DD33"""fUUUD"UD""""UwD"""""""""""""""""3D"""33"""""3""""""""""""""""""""""""3"""3"""3D"3"""""""3D3""3""""""""""""""DD3"""333""""""3"3UD"""3333DDD333U3"333"DUDDˆfD"U333DUDDUUfUUDDDDD3""3D33Dˆ»™™»ˆf3""DUDDD"""""""""""""""""""33""33""""3DDUUfDD333""3D333D333""D33"U3"3DDDUU3""""""""3333"3333DU333"33DUUD333DD""333DD33""""Uª"3333333""333"DUffU3U""3DfU"""33"3""""""""3""""""""3""""D"""""""""""""""""""""""""3"3"""""3D"""""""33D3"""""""""""""�""""3""3DD3""3333""""""33"fwU""3333DD333"UU"""3"Uffww™™™wwUfUUUffD3333DDD33"3D3"33Dw»»ÝÌf"""""DU"UD""""""""""33""""33"3D""""3"3DUUDfU3""D3"""""""3"333"D333DDDUwww3""""""D3""3D3"3DD33D333333D33DDfU333DDUDD3""3Dˆ33DD333"3"333DDDUfUfUD3"���"UUD3"""33333333"""""33"""""33""33""""""""""""3"""""""""3"3"33DU3D33""""""""""""""""""""""""""""""""3DD3"33"""""""""""""3w"""33D33333"3Uf3""3UwwUUfUfwfUDDfDDDUD33333DD3DD333333DDfÌÝU""3"""3DD3w"""""""""""3"""""""""3""""""33DDwˆw""3"333"""""""33""3""DD""3DDD3D3""""""""3""333DD333""333333UUUˆ™U333DDD3"3DUf3DDD3""333"33D3"fDUUUU3""�"DUfD"""""""""""""""""33""33"""D3"""""""""""""""3""3"""""""3""""333333D3"33""33"""""3""""""""DD3"""3""""""DD3333"""3"""""""""""UD3""33"333"33UD""DˆwUUUUDUUUD"UwD""""3D33"3""""""3D"333U»Ýª"D3"3"3D3UwDUff""""""33""""""3""""3UUfˆˆD"3D3""""""""""""33333D33333""""""""""""3D3DD33""""3""3wˆwªfDDDDD33"""DDªD333D3"""3"""33DfDDDDUD"""DU3""""""3""""""""3D""33""3D""""""""""""""""""3"""""""3""""D3D3"DU3"""3""""""3"""""33DUUDD3""3D""""""3D3"""""""3DDD"""""""3"""3333333""D3"3ffUUUUDD3D33DDD3"3""""3""3"""""""""3333ˆÝîU3D3""3f3UˆU3DfD33""3U3""""33""""""""""33UDfffUDDUD33""""""""33D333"3"""33"3"33""""""""""""3DUDD333"3D333Dwª»w3DUD"33"3D3ªw"33"""3""""wDDD33D""U3����""""3""""""""3""""""3U33""""33""""3"""""3""""""""""""""33"3333""333""""3333333DfwwfDDD3""33"""""3""""""""UDD""3"""3333"33"333"3DD3DDwU3DD33333D""3D""3"""33""""""""""""333DˆÝݪ"DD333UUˆ"3DUU33""Df""""""""""""""3DUUfffwwwˆU33""""3""333333DU"3UD3D"""3"""""""""""""3D3333"Uw333"f»™™f33DD"""""DDwª�"3""3"""3"fD33DD3"wD���33""""""""""""""""""3DU""""""3""""""""3"""333""3""""3"3D33D33333D3"""33DDDDUUˆˆˆf3""UD"""""3DDDD""""""""""""""33""333"""""333D33Dw™™ˆwDDD3333DD3""33"""""""3""""""3""""33Df™ÌÝ»»U"3"DDD3ˆ3""DDU3"Uf""""3""""""D3""DDUfUUUfwwwf"3"""""""DDDDDDD333DDD""3""""""""""""""3D33"""3333""fwDDU3""""""DUfª""""333""""DUDDDDD3Df"�33"""""""""�""3"�"3D3"""3""333""""""""""""""33"""""""""""3"3D33D33""333UUUfˆ™™f3""3"3"""""3""3DfD3""3D""""""""3"33"3"""33"33""33D™™wUDDDD3D3fD"""3"""""""""""""""""3Uˆ»Ì̪»ª»U"33UD"3w""3DfD33fD"""""3"""33""""UUUfUUUfffwfDD"""""3DDDUD3D3333DD3333"""""""33""""333333"""""""33333""""Dfˆ™""""333""UDDUfU3DD�""""""""��"""3U3""33"333"""""""""""""""D3"""3"33U3"33"3D33D3D3DD33Ufˆ»Ìˆ3"""""""""""""""""D3DD3D"333""""""3D"""""333333"333D3""3wwDD3DD3DD33D3""""3""""""""""""""33ªÌÌ»™ª»ªD"333DDw"""DUf3D3U""""""""""""D"DDD"3DDDUDDDDUUUwUD3""""333"3DD33D333DDDD""""33""3"""33333""""""""""DD""D"""3DwªD�"""3UUffUU3��"""""""""""""""3U3333D"333"""""""""""""3"""333""3333U33"""3DDDDDDUDfw™™Ì™U""""""""""""""3DDDDDDU3"3D3""""""""""""""33"33333DD"3fwUDD"3D33"3"DDD3"""3""""""3Dfªªªª™ª»f33"33""f""3DfUD""3""""""3""""3""3D"3"33DDDDDDUffffDD""""""""""""3333333DDD333UD33DU"""""33""""""D3""3DD"""3Dwªˆ��"DUUˆfwUU"""""""""""""""""DUD3"33"""333D"""""""""333"""33""333D3D3"33"3DUffwˆ™»Ì»ˆD��"""""""""""""""DfUDD33D3""""""33""333""""3D""333333"w™wDD333333"3"D3"D3"""""""33DUfˆ™™™D"ˆ3"3"3""DD3"DUwD"""""""""3""""D"""3""3"33DDDDDDD3DUwU"""""""""""""""333333DDDDDD33D3D""""""""3"""""3U"DDDff3""""3f™»""��"ffD33"""33"""D"""""""""3UU3333333333DD33"3333"33"33"3D3D3Dfw™wfUUDDfw™™ª»™ffD3���"""""""""3"""""""DwfU33D33"""""""""3""3"""""3D3D333"33D™wUDDD33"333"""3""3D3"""""""""3DUUffw™fDUˆ3"33"""U"33Dw3"""""33"""""""""""3333D333DDUfU""""""""""""3"""33"333fUU33"""""D"""""3"""""UD"3"33"3Uf™U��"�DˆUD33��""""""3D3""""D""""""3"333DwDD333DUDDDDfD333D333DUDDUUD3DUwffD3™™»ª™™ˆwwD�"""�""""""""33"""""���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/reparent.rb�����������������������������������������������0000644�0001750�0001750�00000005171�11701304107�020564� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header reparent.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: reparent.rb,v 1.6 2005/07/18 17:13:33 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ReparentSample < SampleWindow def initialize super("reparent") vbox = Gtk::VBox.new(false, 0) add(vbox) box2 = Gtk::HBox.new(false, 5) box2.set_border_width(10) vbox.pack_start(box2, true, true, 0) label = Gtk::Label.new("Hello World") frame = Gtk::Frame.new("Frame 1") box2.pack_start(frame, true, true, 0) framebox1 = Gtk::VBox.new(false, 5) framebox1.border_width = 5 frame.add(framebox1) button = Gtk::Button.new("switch") button.signal_connect("clicked"){ label.reparent(framebox1) } framebox1.pack_start(button, false, true, 0) framebox1.add(label) label.signal_connect("parent_set"){ |child, old_parent| puts "set_parent for \"#{child.class}\":" puts " new parent: \"#{if child.parent then child.parent.class else 'NULL' end}\"," puts " old parent: \"#{if old_parent then old_parent.class else 'NULL' end}\"," puts " data: 42\n" } frame = Gtk::Frame.new("Frame 2") box2.pack_start(frame, true, true, 0) framebox2 = Gtk::VBox.new(false, 5) framebox2.border_width = 5 frame.add(framebox2) button = Gtk::Button.new("switch") button.signal_connect("clicked"){ label.reparent(framebox2) } framebox2.pack_start(button, false, true, 0) vbox.pack_start(Gtk::HSeparator.new, false, true) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, false, true, 10) button.can_default = true button.grab_default end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/3DRings.xpm�����������������������������������������������0000644�0001750�0001750�00000007504�11701304107�020420� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char * DRings_xpm[] = { "48 48 65 1", " c None", ". c #104010404103", "X c #1040208130C2", "o c #104014515144", "O c #000010402081", "+ c #1040104030C2", "@ c #208120815144", "# c #28A241035965", "$ c #30C230C26185", "% c #208130C24103", "& c #104010402081", "* c #104000002081", "= c #000010401040", "- c #492441036185", "; c #596559659E79", ": c #30C220815144", "> c #0820186128A2", ", c #000000001040", "< c #2081104030C2", "1 c #514459659658", "2 c #514455556185", "3 c #104000001040", "4 c #000008200000", "5 c #618569A6AEBA", "6 c #618569A69658", "7 c #410345148E38", "8 c #104020814103", "9 c #79E782079658", "0 c #208120814103", "q c #596571C69E79", "w c #4103514471C6", "e c #2081208130C2", "r c #6185618571C6", "t c #28A228A25965", "y c #596561858617", "u c #96589E79BEFB", "i c #28A230C271C6", "p c #38E345145144", "a c #79E78207A699", "s c #30C2492469A6", "d c #410330C25965", "f c #410351446185", "g c #AEBAAAAAD75C", "h c #38E338E34103", "j c #EFBEEBADEFBE", "k c #208130C25144", "l c #9658A289DF7D", "z c #208110404103", "x c #28A228A26185", "c c #8E388A28BEFB", "v c #208118612081", "b c #38E3451479E7", "n c #4924618579E7", "m c #86178617B6DA", "M c #30C220814103", "N c #104030C25144", "B c #4103410371C6", "V c #86178A28D75C", "C c #DF7DDB6CE79D", "Z c #BEFBC30BD75C", "A c #410330C271C6", "S c #30C228A230C2", "D c #082008201861", "F c #186130C238E3", "G c #0000208130C2", " .Xo ", " O+O@#$% ", " &*=+X-;: ", " >&=,=<11#2 ", " +O34,X567& ", " 8X+=,90q9w. ", " +e<>3r tyu-& ", " Xi%.= paus+ ", " Od-@= fga$h ", " @y7X, Xrjak ", " 2:eaw+ $ag;@ ", " .X@8@k@o@X+ +pl9tO ", " +zX@x$$isikt8o02crv ", " 8@%ip7757ywbs$Ohn6#. ", " &0%$p7r215ybw1pzp2-0= ", " 8tk$#yw21665n;1+%-p$O ", " O<e7pbryq5am9ay6XMpM>3& ", " 9.NtpBw16amclVcm1t%kX*88 ", " +&etd7r6y9ulgglm6>e>3s@83 ", " +0k$y-y69cgCCCZVam%+#ik8X ", " O&oi$d725amgCjCZu962ybtx8+p ", " &X0x$sBym9VZCCCZca;yBbi%08& ", " =++@sApMy5muZZgum6y2wds:>+& ", " #tp;1;yB#i25cVucma5;w-pti@8& ", " .#2alumnBp:@1r59y9y6ywBS$%0X+= ", " %$wmZVu;#tX8X07r1656y2wbp$k@%@OD ", " 0Byc9a;h%0>&D&hBrr2r1bwB-AF:0<&*= ", " kBf;yr#@X+&<%MkhsBwBwpsB#Bktkt8+Oh ", " xt7B-t8*,3O.X00:$i#dBd#bptFek0X.+* ", " Xt#b#@=, =&O+X0Ft%ibsp$p$ki%l5sX&= ", " &<kvX&4 +O*&<X0e:%$pAti%:edugn0= ", " +X@&+, V,O&>+Xt>tktktv0%@k;Cls+ ", " =+O*4*X:p;9cy3&&8ve0FMtt$ee0>z7cZ6k ", " D=D4,=.k$sBs$ee=+X0Fk%-#t%0X&O0nu9bG ", " ,,434*&ze@F<eeeeee><tdhdSMe<&&XAaawx ", " 4,4,=+><peeeeee&=<%M%$hSF0X&O&kw5r%Z ", " D&vSFMF<>&D =0S-2i& ", " +>puB> >0h7s. ", " SM5VqM &0t#$8 ", " XpVV70 &0kMk. ", " XdyB%z *X<%@+ ", " &k$b0X+=8X08o ", " &e:e+=*X.X+& ", " +X.O+X0O.=, ", " +>&+0>3&* ", " &X0k+O, ", " >v,3 ", " "}; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/check-y.xpm�����������������������������������������������0000644�0001750�0001750�00000000533�11701304107�020465� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char *openfile[] = { /* width height num_colors chars_per_pixel */ " 10 9 5 1", /* colors */ ". c None", "# c #000000", "i c #ff0fff", "y c #ff1f00", "# c #9f9f9f", /* pixels */ "..........", "........yy", ".......yy.", "......yy..", ".yyy.yy...", "..yyyy....", "...yy.....", "..........", "..........", }; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/colorselect.rb��������������������������������������������0000644�0001750�0001750�00000001404�11701304107�021255� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin colorselect.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project $Id: colorselect.rb,v 1.5 2005/07/17 16:55:27 mutoh Exp $ =end require 'sample' class ColorSelectionSample < Gtk::ColorSelectionDialog include Sample extend SampleClass def initialize super("color selection dialog") @destroyed = false signal_connect("destroy"){destroy} colorsel.set_has_opacity_control(true) set_window_position(Gtk::Window::POS_MOUSE) colorsel.signal_connect("color_changed"){ colorsel.current_color } ok_button.signal_connect("clicked"){ color = colorsel.current_color colorsel.set_current_color(color) } cancel_button.signal_connect("clicked"){destroy} end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/menu.rb���������������������������������������������������0000644�0001750�0001750�00000003376�11701304107�017715� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header menu.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: menu.rb,v 1.6 2005/07/18 17:13:32 mutoh Exp $ =end require 'sample' class MenuSample < SampleWindow def initialize super("menus") signal_connect("delete_event") do true end box = Gtk::VBox.new(false, 10) add(box) menubar = Gtk::MenuBar.new box.pack_start(menubar, false, true, 0) menu = create_menu(2, true) menuitem = Gtk::MenuItem.new("test\nline2") menuitem.set_submenu(menu) menubar.append(menuitem) menuitem = Gtk::MenuItem.new("foo") menuitem.set_submenu(create_menu(3, true)) menubar.append(menuitem) menuitem = Gtk::MenuItem.new("bar") menuitem.set_submenu(create_menu(4, true)) menuitem.right_justified = true menubar.append(menuitem) optionmenu = Gtk::OptionMenu.new optionmenu.set_menu(create_menu(1, false)) optionmenu.history = 4 box.add(optionmenu) box.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} box.add(button) button.set_flags(Gtk::Widget::CAN_DEFAULT) button.grab_default end private def create_menu(depth, tearoff) return nil if depth < 1 menu = Gtk::Menu.new group = nil if tearoff then menuitem = Gtk::TearoffMenuItem.new menu.append(menuitem) end for i in 0..4 j = i + 1 buf = sprintf("item %2d - %d", depth, j) menuitem = Gtk::RadioMenuItem.new(group, buf) group = menuitem.group menu.append(menuitem) menuitem.set_sensitive(false) if i == 3 submenu = create_menu(depth - 1, true) menuitem.set_submenu(submenu) unless submenu.nil? end menu end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/layout.rb�������������������������������������������������0000644�0001750�0001750�00000005202�11701304107�020254� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header layout.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: layout.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ Rewritten by Minoru Inachi <inachi@earth.interq.or.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class LayoutSample < SampleWindow def initialize super("Gtk::Layout") set_default_size(200, 200) scrolledwindow = Gtk::ScrolledWindow.new add(scrolledwindow) @layout = Gtk::Layout.new(nil, nil) scrolledwindow.add(@layout) # We set step sizes here since GtkLayout does not set # them itself. @layout.hadjustment.step_increment = 10.0 @layout.vadjustment.step_increment = 10.0 @layout.set_events(Gdk::Event::EXPOSURE_MASK) @layout.signal_connect("expose_event") do | w, event | layout_expose_handler(event) end @layout.set_size(1600, 128000) for i in 0..15 do for j in 0..15 do buf = "Button #{i}, #{j}" if ((i + j) % 2) != 0 then button = Gtk::Button.new(buf) else button = Gtk::Label.new(buf) end @layout.put(button, j*100, i*100) button.show end end for i in 16..1279 do buf = "Button #{i}, 0" if (i % 2) != 0 then button = Gtk::Button.new(buf) else button = Gtk::Label.new(buf) end @layout.put(button, 0, i * 100) end end private def layout_expose_handler(event) imin = (event.area.x) / 10 imax = (event.area.x + event.area.width + 9) / 10 jmin = (event.area.y) / 10 jmax = (event.area.y + event.area.height + 9) / 10 for i in imin..imax-1 do for j in jmin..jmax-1 do if ((i+j) % 2) != 0 then @layout.bin_window.draw_rectangle( @layout.style.black_gc, true, 10 * i, 10 * j, 1 + i % 10, 1 + j % 10) end end end false end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/entry.rb��������������������������������������������������0000644�0001750�0001750�00000003270�11701304107�020103� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header entry.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002,2003 Ruby-GNOME2 Project Team $Id: entry.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ =end require 'sample' class EntrySample < SampleWindow def initialize cbitems = [ "item0", "item1 item1", "item2 item2 item2", "item3 item3 item3 item3", "item4 item4 item4 item4 item4", "item5 item5 item5 item5 item5 item5", "item6 item6 item6 item6 item6", "item7 item7 item7 item7", "item8 item8 item8", "item9 item9" ] super("entry") box = Gtk::VBox.new(false, 5) add(box) entry = Gtk::Entry.new entry.text = "hello world" entry.select_region(0, 5) box.add(entry) cb = Gtk::Combo.new cb.set_popdown_strings(cbitems) cb.entry.text = "hello world" cb.entry.select_region(0, -1) box.add(cb) editable_check = Gtk::CheckButton.new("Editable") box.add(editable_check) editable_check.signal_connect("toggled"){ entry.editable = editable_check.active? } editable_check.active = true visible_check = Gtk::CheckButton.new("Visible") box.add(visible_check) visible_check.signal_connect("toggled"){ entry.visibility = visible_check.active? } visible_check.active = true sensitive_check = Gtk::CheckButton.new("Sensitive") box.add(sensitive_check) sensitive_check.signal_connect("toggled"){ entry.sensitive = sensitive_check.active? } sensitive_check.active = true box.pack_start(Gtk::HSeparator.new, false, true, 5) button = Gtk::Button.new("close") button.signal_connect("clicked"){ destroy } box.add(button) end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/savedposition.rb������������������������������������������0000644�0001750�0001750�00000004265�11701304107�021636� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin savedposition.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: savedposition.rb,v 1.7 2005/07/21 17:47:19 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class SavedPositionSample < SampleWindow Pos = [ 0, 0 ] def initialize super("Saved Position") move(Pos[0], Pos[1]) set_default_size(200, 100) set_border_width = 5 vbox = Gtk::VBox.new add(vbox) hbox1 = Gtk::HBox.new hbox1.border_width = 5 vbox.add(hbox1) label = Gtk::Label.new("X Origin : ") label.set_alignment(0, 0.5) hbox1.add(label) x_label = Gtk::Label.new("") hbox1.add(x_label) hbox2 = Gtk::HBox.new hbox2.set_border_width(5) vbox.add(hbox2) label = Gtk::Label.new("Y Origin : ") label.set_alignment(0, 0.5) hbox2.add(label) y_label = Gtk::Label.new("") hbox2.add(y_label) signal_connect("configure_event") do x, y = window.root_origin Pos[0] = x Pos[1] = y x_label.text = x.to_s y_label.text = y.to_s false end vbox.pack_start(Gtk::HSeparator.new, false, true, 10) button = Gtk::Button.new("Close") button.signal_connect("clicked"){destroy} vbox.add(button) button.can_default = true button.grab_default end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/Modeller.xpm����������������������������������������������0000644�0001750�0001750�00000007557�11701304107�020722� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char * InterfaceModeller_app_2_Tile_xpm[] = { "48 48 66 1", " c None", ". c #86174D344103", "X c #69A651445144", "o c #8617410330C2", "O c #69A6410338E3", "+ c #30C218611861", "@ c #AEBA6DB66185", "# c #71C638E328A2", "$ c #69A634D328A2", "% c #30C228A228A2", "& c #79E73CF330C2", "* c #BEFB9E799E79", "= c #8E3869A66185", "- c #514424921861", "; c #A699A289B6DA", ": c #A6999E79A699", "> c #71C65D756185", ", c #9E799A69A699", "< c #8E3882078E38", "1 c #861779E78617", "2 c #A6999A69AEBA", "3 c #8E388A289658", "4 c #71C675D679E7", "5 c #96588A289E79", "6 c #30C230C238E3", "7 c #C71BC71BC71B", "8 c #9E79A289AEBA", "9 c #AEBAAAAABEFB", "0 c #96589248A699", "q c #A699AAAAB6DA", "w c #AEBAAAAAB6DA", "e c #D75CD34CD75C", "r c #EFBEE79DEFBE", "t c #BEFBB6DABEFB", "y c #B6DABAEAC71B", "u c #AEBAAEBAB6DA", "i c #E79DDB6CDF7D", "p c #96588E389658", "a c #596559656185", "s c #AEBA8E388E38", "d c #CF3CCB2BCF3C", "f c #9E799A699E79", "g c #86177DF78E38", "h c #69A6659571C6", "j c #AEBAAEBABEFB", "k c #96589E799E79", "l c #B6DAA699A699", "z c #E79DC71BC71B", "x c #B6DAB6DAB6DA", "c c #861786179658", "v c #B6DAB2CABEFB", "b c #BEFBAAAAAEBA", "n c #C71BBEFBC71B", "m c #514441034103", "M c #41033CF34103", "N c #492428A228A2", "B c #AEBAA289B6DA", "V c #618530C22081", "C c #69A630C228A2", "Z c #69A630C22081", "A c #596528A22081", "S c #492428A22081", "D c #618528A22081", "F c #596520811861", "G c #69A628A22081", "H c #FFFF14514103", " .X ", " .oO+ ", " @.o#++ ", " @.o$%+ ", " @.&#++ ", " @.o#++ ", " @.o$++ ", " @.&#++ ", " .O#++ ", " *=-$++ ", " ;:>+++ ", " ;,<1% ", " 2,34 ", " 2;,51 ", " 2,,,,6 ", " 7777 28888,6 ", " 77777777 2829,,,06 ", " 9qwwe7rrrrr77rr 828,9tyt,6 ", " uuwriirrieiiieii77pa< 82,8,,,8,06 ", " s=1ttiieeeeded77eufgh>j,8,8,k,0,6 ", " =@lzieeeeee77eeex:fpcg4>9,,,,qjv6 ", " =O=blt7eeee7deenw:ffp<gha:t979;06 ", " =OO@=@zieeee7ex:::fffff0,v72444h6 ", " =OOo&Osst7iee7wkf:f:ff;t721444ham ", " =#&&&&OO@di7eu:ff:fferiv114444hmMX ", " =O&&&..o.sdp33fff:errrii7cc1hhh6mmNX= ", " =O&&&@.o.@sberrrrrriiuxuxnB;44aMmVCO#OX ", " =O&&o@..o.zrrrie777nnxtuxx:x;n:>mV##&&O$mX ", " =O&&o....zrrieieuxunx7txx:nnfwpMmVZ#$ZZZVVN ", " =O&oooo.*rrde77ewxnxxtnw:f4M%M%+NA#$Z$ZZVmN> ", " =Oo&ooo@iree7inxn7nnuuff4h%M>m%S-AZ$CCZDZmSX ", " =O&o.o.@rrn7eulun7xxuwp4mm6ahM%--AZCCZDDDANX ", " =Ooooo.*rixenuwwn7nxupph%M>>h6mAADVVZVVDDANX ", " =O&o.o.zrexwwnwuxxnughX%mahhmMN-AZCCVVDDAAN> ", " *XOoo.*iin7n777xxxtphaM+ama>MSNFVCZZVVDAAAS> ", " 1O..izewxux7nuuux4%++%hha>%N-DDCZZVDAAAASX ", " 1.=ituu:uButnxxuX%>hh>M%++NADZZZVDADAA--X ", " :e7f::lnn7*ppnx6ahm6++mNN-ADCZVDDAAAA-SX ", " 7nupp:wxxg%MMau6%++NmmmADADVVVVVDAA---NX ", " 7uBgh1wwxg6h>m%:MmmVNAVDZVZCVZZDAAAAF-S+X ", " nfgaM%pnwhX6%mXb6$DVVZC$C#C$ZZDVAAA---+NX ", " 27a%MaM47:mN.OoolmODGZ####$$ZZVDDA-----SSX ", " 2gmg<m6p7wmmOo...O$GZ####$$CZVVDAAA----++X ", " qBcaM <gxgmXmo.@.o&$$##$$$CZZZDADA-A-++-NX ", " M6> paMa HX.@@@oZ$###$$CZVDDAAAA---SS+X ", " 43 p=&@@&&$##$CCCVVVAAA--+S+S+%X ", " k =o@.##$VVmmmNNNSSSSSS%XXXX ", " s>OSSNmN>>aaa177777 "}; �������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/toolbar.rb������������������������������������������������0000644�0001750�0001750�00000004771�11701304107�020413� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header toolbar.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Id: toolbar.rb,v 1.7 2005/07/21 17:47:19 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ToolbarSample < SampleWindow def initialize super("Toolbar test") toolbar = Gtk::Toolbar.new toolbar.append("Horizontal", "Horizontal toolbar layout", "Toolbar/Horizontal", Gtk::Image.new("test.xpm")){ toolbar.orientation = Gtk::ORIENTATION_HORIZONTAL } toolbar.append("Vertical", "Vertical toolbar layout", "Toolbar/Vertical", Gtk::Image.new("test.xpm")){ toolbar.orientation = Gtk::ORIENTATION_VERTICAL } toolbar.append_space toolbar.append("Icons", "Only show toolbar icons", "Toolbar/IconsOnly", Gtk::Image.new("test.xpm")){ toolbar.toolbar_style = Gtk::Toolbar::ICONS } toolbar.append("Text", "Only show toolbar text", "Toolbar/TextOnly", Gtk::Image.new("test.xpm")){ toolbar.toolbar_style = Gtk::Toolbar::TEXT } toolbar.append("Both", "Show toolbar icons and text", "Toolbar/Both", Gtk::Image.new("test.xpm")){ toolbar.toolbar_style = Gtk::Toolbar::BOTH } toolbar.append_space toolbar.append(Gtk::Entry.new, "This is an unusable Gtk::Entry ;)", "Hey don't click me!!!") toolbar.append_space toolbar.append("Enable", "Enable tooltips", nil, Gtk::Image.new("test.xpm")){ toolbar.tooltips = true } toolbar.append("Disable", "Disable tooltips", nil, Gtk::Image.new("test.xpm")){ toolbar.tooltips = false } add(toolbar) end end �������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/FilesQueue.xpm��������������������������������������������0000644�0001750�0001750�00000005503�11701304107�021213� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char * FilesQueue_xpm[] = { "44 31 64 1", " c None", ". c #E79DE38DDF7D", "X c #CF3CC71BCF3C", "o c #71C675D671C6", "O c #B6DAB2CAB6DA", "+ c #CF3CD34CCF3C", "@ c #DF7DE38DE79D", "# c #FFFFFBEEFFFF", "$ c #EFBEEFBEEFBE", "% c #DF7DDB6CDF7D", "& c #BEFBBAEAC71B", "* c #BEFBBAEABEFB", "= c #BEFBC30BC71B", "- c #71C66DB671C6", "; c #D75CD34CD75C", ": c #9E799A699E79", "> c #E79DE38DE79D", ", c #CF3CCB2BC71B", "< c #B6DAB2CABEFB", "1 c #BEFBBAEAB6DA", "2 c #B6DAB6DAB6DA", "3 c #618561856185", "4 c #C71BBAEABEFB", "5 c #AEBAAAAAAEBA", "6 c #965892488E38", "7 c #A699A699A699", "8 c #38E338E338E3", "9 c #F7DEF7DEF7DE", "0 c #E79DEFBEEFBE", "q c #DF7DE38DDF7D", "w c #C71BC71BC71B", "e c #C71BC30BBEFB", "r c #BEFBC30BBEFB", "t c #B6DAAAAAAEBA", "y c #410345144103", "u c #D75CDB6CD75C", "i c #C71BCB2BC71B", "p c #BEFBCB2BBEFB", "a c #9E79A289A699", "s c #86178E388E38", "d c #CF3CCF3CD75C", "f c #CF3CD75CCF3C", "g c #C71BC30BCF3C", "h c #28A22CB228A2", "j c #000000000000", "k c #D75CD34CDF7D", "l c #10400C300820", "z c #E79DEBADEFBE", "x c #DF7DDB6CD75C", "c c #514459655965", "v c #8617861779E7", "b c #DF7DD34CD75C", "n c #CF3CCB2BCF3C", "m c #618555555965", "M c #861786178617", "N c #30C234D330C2", "B c #EFBEEBADE79D", "V c #DF7DDB6CE79D", "C c #D75CE38DD75C", "Z c #514449245144", "A c #186120812081", "S c #79E77DF779E7", "D c #6185659569A6", "F c #9E7992489E79", " .XoOX+ ", " @#$%&*=-o;: ", " @>,=O<12*&:-<3X ", " >%&1*4*2*OO**56758790 ", " 9qX+we=r*&e<<<251t5555yu9 ", " $qu++;ipi=p*=p**2tOOO27a5s<- ", " #9udfXi;,gi&**4**4r*Ot5t55tehj ", " 0qku+u;+d,gg=*=r*&**&<255t<*yl1 ", " $$zq@%xk%uf;,w,i=i=e**r=12tO1=8cvj ", " $@%>.%.%%%xbkx,w+ni,wwrwe*4*1=;8mMNj ", " zz@Bz>>>V%%%C+u;;dfnnfwggi&=&X+yZsNll ", " af#9@B0>q>qqq>xk.;;;kfX+XnXw=g,fycMhhN5 ", " al5#9$$>qzBV.%x%%b;x+fnf+,X,iiqym6NAo-j ", " #roS%#$zz>>V%%xkk%f;;+df,XnwnVZD:8AS-j* ", " D-9Oy*9$Bz>q%qx%%u;x;;dknX+d>Zm:hhSDjr ", " a3o+>S3z#90@@z.%>qCC%uu;ff%@Zm:NhMoj= ", " wlvvo#:3599$>B>q>%%%%+f;fk$ymaalMvjr ", " 0.a--S49mct9$z@.qkkqC;xu%@Zm5AlvSj* ", " ohu%3:Z:9@y609q@@>..>Cx>$Zm5NhMvjr ", " -j797Zv5705y=#$0>>V.%>#Z378AMMj* ", " Zj9Xo-McBXDv%90.%%#9cc78AsMj* ", " 8hM#M-DSF96cvz0>z#c35Nhs6j1 ", " jl9#o63vx#-D###mmt8N66j* ", " 5jc@fZF3o%+ZFDm<8A6FjO ", " :j50sSay<$ss2Nh:FjO ", " 6880&SDMF.rNNFFj1 ", " 8jr#:SFScA6ajO ", " Alr$DSysajO ", " >jy#51:jO ", " %Dy*gjO ", " alla "}; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/testgtkrc�������������������������������������������������0000644�0001750�0001750�00000006216�11701304107�020355� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# pixmap_path "<dir 1>:<dir 2>:<dir 3>:..." # # include "rc-file" # # style <name> [= <name>] # { # <option> # } # # widget <widget_set> style <style_name> # widget_class <widget_class_set> style <style_name> # testgtkrc2 sets all the buttons in the main window to blue by default include "testgtkrc2" #include "/usr/local/share/themes/Pixmap/gtk/gtkrc" #include "/usr/local/share/themes/Redmond95/gtk/gtkrc" #include "/usr/local/share/themes/Metal/gtk/gtkrc" #include "/usr/local/share/themes/Notif/gtk/gtkrc" #include "/usr/local/share/themes/Default/gtk/gtkrc" #pixmap_path "." style "defaultfont" { # fontset = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*,*" font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*" } # common default class "GtkWidget" style "defaultfont" style "window" { # bg_pixmap[NORMAL] = "marble.xpm" } style "scale" { fg[NORMAL] = { 1.0, 0, 0 } bg_pixmap[NORMAL] = "<parent>" } style "button" = "default" { # fg[PRELIGHT] = { 1.0, 1.0, 1.0 } # bg[PRELIGHT] = { 0, 0, 0.75 } # bg[PRELIGHT] = { 0.75, 0, 0x00 } } style "toggle_button" = "button" { fg[NORMAL] = { 1.0, 0, 0 } fg[ACTIVE] = { 1.0, 0, 0 } # bg_pixmap[ACTIVE] = "check-y.xpm" # bg_pixmap[NORMAL] = "check-n.xpm" } style "text" { bg_pixmap[NORMAL] = "marble.xpm" text[NORMAL] = { 1.0, 1.0, 1.0 } fg[NORMAL] = { 1.0, 1.0, 1.0 } base[NORMAL] = { 0.0, 0.0, 0.0 } } style "slider" { fg[NORMAL] = { 1.0, 1.0, 1.0 } bg[NORMAL] = { 0.0, 0.0, 1.0 } bg[ACTIVE] = { 0.0 ,0.0, 0.5 } bg[PRELIGHT] = { 0.75 ,0.75, 1.0 } } style "ruler" { font = '-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*' } style "curve" { fg[NORMAL] = { 58000, 0, 0 } # red } style "red-bar" { bg[PRELIGHT] = { 0.95, .55, 0.55 } } # override testgtk2, introduce the green color in the button list style 'button_list' = 'button' { font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*" bg[PRELIGHT] = { 0, 0.75, 0x00 } } widget "main window.*GtkScrolledWindow.*GtkButton*" style "button_list" class "GtkScrollbar" style "red-bar" widget_class "GtkWindow" style "window" widget_class "GtkDialog" style "window" widget_class "GtkFileSelection" style "window" widget_class "*Gtk*Scale" style "scale" widget_class "*GtkCheckButton*" style "toggle_button" widget_class "*GtkRadioButton*" style "toggle_button" widget_class "*GtkButton*" style "button" widget_class "*Ruler" style "ruler" widget_class "*GtkText" style "text" widget "*GtkCurve" style "curve" binding "test1" { bind "<ctrl>1" { "debug-msg" ("jup!") } } binding "test2" { bind "<ctrl>1" { "debug-msg" ("hallo and") "debug-msg" ("huhu") } } # possible priorities are (in ascending order): # lowest # gtk (used by gtk for internal class bindings) # application (for hard coded bindings on application basis) # rc (used implicitel by rc files) # highest class "GtkCList" binding "test1" # implicit : rc #class "GtkWindow" binding : highest "test2" # override "rc" priority binding "clist-test" { bind "j" { "scroll-vertical" (step-backward, 0.0) } bind "k" { "scroll-vertical" (step-forward, 0.0) } } class "GtkCList" binding "clist-test" ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/testgtk.rb������������������������������������������������0000644�0001750�0001750�00000011021�11701304107�020420� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin header testgtk.rb - testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2006 Ruby-GNOME2 Project Team $Id: testgtk.rb,v 1.16 2006/06/17 13:18:12 mutoh Exp $ Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end $:.unshift(File.dirname(__FILE__)) require 'gtk2' require 'sample' require 'button' require 'checkbutton' require 'togglebutton' require 'radiobutton' require 'buttonbox' require 'toolbar' require 'statusbar' require 'reparent' require 'pixmap' require 'tooltips' require 'labels' require 'layout' require 'menu' require 'scrolledwindow' require 'entry' require 'spinbutton' require 'colorselect' require 'dialog' require 'range' require 'rulers' require 'notebook' require 'shapedwindow' require 'wmhints' require 'progressbar' require 'gammacurve' require 'savedposition' require 'filesel' require 'fontselection' # # Main Window # def create_main_window buttons = [ ["button box", ButtonBoxSample], ["buttons", ButtonSample], ["check buttons", CheckButtonSample], ["color selection", ColorSelectionSample], ["dialog", DialogSample], ["entry", EntrySample], ["file selection", FileSelectionSample], ["font selection", FontSelectionSample], ["gamma curve", GammaCurveSample], ["labels", LabelSample], ["layout", LayoutSample], ["menus", MenuSample], ["notebook", NotebookSample], ["pixmap", PixmapSample], ["progress bar", ProgressBarSample], ["radio buttons", RadioButtonSample], ["range controls", RangeSample], ["reparent", ReparentSample], ["rulers", RulerSample], ["saved position", SavedPositionSample], ["scrolled windows", ScrolledWindowSample], ["shapes", ShapesSample], ["spinbutton", SpinButtonSample], ["statusbar", StatusbarSample], ["toggle buttons", ToggleButtonSample], ["toolbar", ToolbarSample], ["tooltips", TooltipsSample], ["WM hints", WMHintsSample], ] nbuttons = buttons.size window = Gtk::Window.new window.name = "main window" window.set_default_size(200, 400) window.move(20, 20) window.signal_connect("destroy"){Gtk.main_quit} box1 = Gtk::VBox.new(false, 0) window.add(box1) label = Gtk::Label.new("Gtk+ v#{Gtk::MAJOR_VERSION}.#{Gtk::MINOR_VERSION}.#{Gtk::MICRO_VERSION}") box1.pack_start(label, false, false, 0) label = Gtk::Label.new("Ruby/GTK2 v#{Gtk::BINDING_VERSION.join(".")}") box1.pack_start(label, false, false, 0) scrolled_window = Gtk::ScrolledWindow.new(nil, nil) scrolled_window.border_width = 10 scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) box1.pack_start(scrolled_window, true, true, 0) box2 = Gtk::VBox.new(false, 0) box2.border_width = 10 scrolled_window.add_with_viewport(box2); box2.focus_vadjustment = scrolled_window.vadjustment buttons.each do |title, sample_class| button = Gtk::Button.new(title) unless sample_class.nil? button.signal_connect("clicked"){|obj| sample_class.invoke } else button.sensitive = false end box2.pack_start(button, true, true, 0) end box1.pack_start(Gtk::HSeparator.new, false, true, 0) button = Gtk::Button.new("close") button.signal_connect("clicked") do window.destroy Gtk.main_quit end box1.pack_start(button, false, true, 5) window.show_all end def main srand Gtk::RC.parse("testgtkrc") create_main_window Gtk.main end if $DEBUG $stderr.sync = true Thread.start do loop do STDERR.print("+") GC.start sleep(1) end end $stderr.puts("#{$0}: started GC-thread for debugging.") # timeout Gtk.timeout_add(1000) do $stderr.print("*") true end end main puts("#{$0}: done.") ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/spinbutton.rb���������������������������������������������0000644�0001750�0001750�00000012576�11701304107�021160� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header spinbutton.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: spinbutton.rb,v 1.7 2005/07/30 10:24:57 mutoh Exp $ Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class SpinButtonSample < SampleWindow def get_value(spin, label, data) if (data == 1) buf = sprintf("%d", spin.value_as_int) else buf = sprintf("%0.*f", spin.digits, spin.value) end label.text = buf end def initialize super("Gtk::SpinButton") main_vbox = Gtk::VBox.new(false, 5) main_vbox.set_border_width(10) add(main_vbox) frame = Gtk::Frame.new("Not accelerated") main_vbox.pack_start(frame, true, true, 0) vbox = Gtk::VBox.new(false, 0) vbox.set_border_width(5) frame.add(vbox) # Day, month, year spinners hbox = Gtk::HBox.new(false, 0) vbox.pack_start(hbox, true, true, 5) vbox2 = Gtk::VBox.new(false, 0) hbox.pack_start(vbox2, true, true, 5) label = Gtk::Label.new("Day :") label.set_alignment(0, 0.5) vbox2.pack_start(label, false, true, 0) adj = Gtk::Adjustment.new(1.0, 1.0, 31.0, 1.0, 5.0, 0.0) spinner = Gtk::SpinButton.new(adj, 0, 0) spinner.wrap = true vbox2.pack_start(spinner, false, true, 0) vbox2 = Gtk::VBox.new(false, 0) hbox.pack_start(vbox2, true, true, 5) label = Gtk::Label.new("Month :") label.set_alignment(0, 0.5) vbox2.pack_start(label, false, true, 0) adj = Gtk::Adjustment.new(1.0, 1.0, 12.0, 1.0, 5.0, 0.0) spinner = Gtk::SpinButton.new(adj, 0, 0) spinner.wrap = true vbox2.pack_start(spinner, false, true, 0) vbox2 = Gtk::VBox.new(false, 0) hbox.pack_start(vbox2, true, true, 5) label = Gtk::Label.new("Year :") label.set_alignment(0, 0.5) vbox2.pack_start(label, false, true, 0) adj = Gtk::Adjustment.new(1998.0, 0.0, 2100.0, 1.0, 100.0, 0.0) spinner = Gtk::SpinButton.new(adj, 0, 0) spinner.wrap = true spinner.set_size_request(55, -1) vbox2.pack_start(spinner, false, true, 0) frame = Gtk::Frame.new("Accelerated") main_vbox.pack_start(frame, true, true, 0) vbox = Gtk::VBox.new(false, 0) vbox.set_border_width(5) frame.add(vbox) hbox = Gtk::HBox.new(false, 0) vbox.pack_start(hbox, false, true, 5) vbox2 = Gtk::VBox.new(false, 0) hbox.pack_start(vbox2, true, true, 5) label = Gtk::Label.new("Value :") label.set_alignment(0, 0.5) vbox2.pack_start(label, false, true, 0) adj = Gtk::Adjustment.new(0.0, -10000.0, 10000.0, 0.5, 100.0, 0.0) spinner1 = Gtk::SpinButton.new(adj, 1.0, 2) spinner1.set_wrap(true) spinner1.set_size_request(100, -1) spinner1.set_update_policy(Gtk::SpinButton::UPDATE_ALWAYS) vbox2.pack_start(spinner1, false, true, 0) vbox2 = Gtk::VBox.new(false, 0) hbox.pack_start(vbox2, true, true, 5) label = Gtk::Label.new("Digits :") label.set_alignment(0, 0.5) vbox2.pack_start(label, false, true, 0) adj = Gtk::Adjustment.new(2, 1, 5, 1, 1, 0) spinner2 = Gtk::SpinButton.new(adj, 0.0, 0) spinner2.wrap = true adj.signal_connect("value_changed"){ spinner1.digits = spinner2.value_as_int } vbox2.pack_start(spinner2, false, true, 0) hbox = Gtk::HBox.new(false, 0) vbox.pack_start(hbox, false, true, 5) button = Gtk::CheckButton.new("Snap to 0.5-ticks") button.signal_connect("clicked"){ spinner1.snap_to_ticks = button.active? } vbox.pack_start(button, true, true, 0) button.set_active(true) button2 = Gtk::CheckButton.new("Numeric only input mode") button2.signal_connect("clicked"){ spinner1.numeric = button2.active? } vbox.pack_start(button2, true, true, 0) button2.active = true val_label = Gtk::Label.new("") hbox = Gtk::HBox.new(false, 0) vbox.pack_start(hbox, false, true, 5) button3 = Gtk::Button.new("Value as Int") button3.signal_connect("clicked"){get_value(spinner1, val_label, 1)} hbox.pack_start(button3, true, true, 5) button4 = Gtk::Button.new("Value as Float") button4.signal_connect("clicked"){get_value(spinner1, val_label, 2)} hbox.pack_start(button4, true, true, 5) vbox.pack_start(val_label, true, true, 0) val_label.text = "0" hbox = Gtk::HBox.new(false, 0) main_vbox.pack_start(hbox, false, true, 0) button5 = Gtk::Button.new("Close") button5.signal_connect("clicked"){destroy} hbox.pack_start(button5, true, true, 5) end end ����������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/testgtkrc2������������������������������������������������0000644�0001750�0001750�00000000670�11701304107�020435� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# pixmap_path "<dir 1>:<dir 2>:<dir 3>:..." # # include "rc-file" # # style <name> [= <name>] # { # <option> # } # # widget <widget_set> style <style_name> # widget_class <widget_class_set> style <style_name> # this file gets included from testgtkrc style 'main_buttons' = 'button' { font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*" bg[PRELIGHT] = { 0, 0, 0.75 } } widget "main window.*GtkButton*" style "main_buttons" ������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/sample.rb�������������������������������������������������0000644�0001750�0001750�00000002717�11701304107�020230� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header sample.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: sample.rb,v 1.9 2005/07/21 17:47:19 mutoh Exp $ =end require 'gtk2' module Sample def destroy super @destroyed = true end def destroyed? @destroyed end end module SampleClass def invoke @singleton = nil unless defined? @singleton @singleton = new if @singleton.nil? or @singleton.destroyed? unless @singleton.visible? @singleton.show_all else @singleton.destroy end end end class SampleWindow < Gtk::Window include Sample extend SampleClass def initialize(title) super(title) @destroyed = false signal_connect("destroy") do destroy end end end class SampleDialog < Gtk::Dialog include Sample extend SampleClass def initialize(title) super(title) @destroyed = false signal_connect("destroy") do destroy end end end OptionMenuItem = Struct.new("OptionMenuItem", :name, :block) def build_option_menu(items, history) omenu = Gtk::OptionMenu.new menu = Gtk::Menu.new group = nil items.size.times do |i| menu_item = Gtk::RadioMenuItem.new(group, items[i].name) menu_item.signal_connect("activate") do |widget| items[i].block.call(widget) end group = menu_item.group menu.append(menu_item) menu_item.active = true if i == history menu_item.show end omenu.menu = menu omenu.history = history omenu end �������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/radiobutton.rb��������������������������������������������0000644�0001750�0001750�00000003356�11701304107�021301� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header radiobutton.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/18 17:13:32 $ $Id: radiobutton.rb,v 1.7 2005/07/18 17:13:32 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class RadioButtonSample < SampleWindow def initialize super("radio buttons") set_border_width(10) vbox = Gtk::VBox.new(false, 10) add(vbox) button1 = Gtk::RadioButton.new("button1") vbox.add(button1) button2 = Gtk::RadioButton.new(button1, "button2") vbox.add(button2) button3 = Gtk::RadioButton.new(button1, "button3") vbox.add(button3) vbox.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, false, true) button.can_default = true button.grab_default end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/filesel.rb������������������������������������������������0000644�0001750�0001750�00000003574�11701304107�020374� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header filesel.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: filesel.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class FileSelectionSample < Gtk::FileSelection include Sample extend SampleClass def initialize super("file selection dialog") @destroyed = false signal_connect("destroy") do destroy end set_window_position(Gtk::Window::POS_MOUSE) hide_fileop_buttons ok_button.signal_connect("clicked") do puts filename destroy end cancel_button.signal_connect("clicked") do destroy end button = Gtk::Button.new("Hide Fileops") button.signal_connect("clicked") do hide_fileop_buttons end action_area.pack_start(button, false, false, 0) button = Gtk::Button.new("Show Fileops") button.signal_connect("clicked") do show_fileop_buttons end action_area.pack_start(button, false, false, 0) end end ������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/notebook.rb�����������������������������������������������0000644�0001750�0001750�00000016462�11701304107�020571� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header notebook.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: notebook.rb,v 1.11 2005/07/18 17:13:32 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' $book_open_xpm = [ "16 16 4 1", " c None s None", ". c black", "X c #808080", "o c white", " ", " .. ", " .Xo. ... ", " .Xoo. ..oo. ", " .Xooo.Xooo... ", " .Xooo.oooo.X. ", " .Xooo.Xooo.X. ", " .Xooo.oooo.X. ", " .Xooo.Xooo.X. ", " .Xooo.oooo.X. ", " .Xoo.Xoo..X. ", " .Xo.o..ooX. ", " .X..XXXXX. ", " ..X....... ", " .. ", " " ] $book_closed_xpm = [ "16 16 6 1", " c None s None", ". c black", "X c red", "o c yellow", "O c #808080", "# c white", " ", " .. ", " ..XX. ", " ..XXXXX. ", " ..XXXXXXXX. ", ".ooXXXXXXXXX. ", "..ooXXXXXXXXX. ", ".X.ooXXXXXXXXX. ", ".XX.ooXXXXXX.. ", " .XX.ooXXX..#O ", " .XX.oo..##OO. ", " .XX..##OO.. ", " .X.#OO.. ", " ..O.. ", " .. ", " " ] class NotebookSample < SampleWindow def initialize super("notebook") vbox = Gtk::VBox.new(false, 0) add(vbox) @notebook = Gtk::Notebook.new @notebook.signal_connect("switch_page") do |widget, page, num_page| unless destroyed? page_switch(widget, page, num_page) end end @notebook.tab_pos = Gtk::POS_TOP vbox.add(@notebook) @notebook.border_width = 10 @notebook.realize @book_open, @book_open_mask = Gdk::Pixmap::create_from_xpm_d(@notebook.window, nil, $book_open_xpm) @book_closed, @book_closed_mask = Gdk::Pixmap::create_from_xpm_d(@notebook.window, nil, $book_closed_xpm) create_pages(1, 5) vbox.add(Gtk::HSeparator.new) cbutton1 = Gtk::CheckButton.new("popup menu") vbox.add(cbutton1) cbutton1.signal_connect("clicked"){ @notebook.enable_popup = cbutton1.active? } hbox = Gtk::HBox.new(false, 5) hbox.border_width = 10 vbox.pack_start(hbox, false, false, 0) label = Gtk::Label.new("Notebook Style :") hbox.add(label) omenu = build_option_menu([ OptionMenuItem.new("Standard", proc { standard_notebook }), OptionMenuItem.new("No tabs", proc { notabs_notebook }), OptionMenuItem.new("Scrollable", proc { scrollable_notebook }) ], 0) hbox.add(omenu) button = Gtk::Button.new("Show all Pages") hbox.add(button) button.signal_connect('clicked'){ @notebook.each do |w| w.show end } hbox = Gtk::HBox.new(true, 10) hbox.set_border_width(10) vbox.pack_start(hbox, false, true, 0) button = Gtk::Button.new("prev") button.signal_connect("clicked"){ @notebook.prev_page } hbox.pack_start(button, true, true, 0) button = Gtk::Button.new("next") button.signal_connect("clicked"){ @notebook.next_page } hbox.pack_start(button, true, true, 0) button = Gtk::Button.new("rotate") button.signal_connect("clicked"){ @notebook.tab_pos = (@notebook.tab_pos.to_i + 1) % 4 } hbox.pack_start(button, true, true, 0) vbox.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, false, false, 5) button.can_default = true button.grab_default end def standard_notebook @notebook.set_show_tabs(true) @notebook.set_scrollable(false) if @notebook.children.size == 15 10.times do @notebook.remove_page(5) end end end def notabs_notebook @notebook.set_show_tabs(false) if @notebook.children.size == 15 10.times do @notebook.remove_page(5) end end end def scrollable_notebook @notebook.set_show_tabs(true) @notebook.set_scrollable(true) if @notebook.children.size == 5 create_pages(6, 15) end end def create_pages(start_page, end_page) start_page.upto(end_page) do |i| buffer = "Page #{i}" child = Gtk::Frame.new(buffer) child.border_width = 10 vbox = Gtk::VBox.new(true, 0) vbox.border_width = 10 child.add(vbox) hbox = Gtk::HBox.new(true, 0) vbox.pack_start(hbox, false, true, 5) button1 = Gtk::CheckButton.new("Fill Tab") hbox.pack_start(button1, true, true, 5) button1.active = true button1.signal_connect('toggled'){ expand, fill, pack = @notebook.query_tab_label_packing(child) @notebook.set_tab_label_packing(child, expand, button1.active?, pack) } button2 = Gtk::CheckButton.new("Expand Tab") hbox.pack_start(button2, true, true, 5) button2.signal_connect('toggled'){ expand, fill, pack = @notebook.query_tab_label_packing(child) @notebook.set_tab_label_packing(child, button2.active?, fill, pack) } button3 = Gtk::CheckButton.new("Pack end") hbox.pack_start(button3, true, true, 5) button3.signal_connect('toggled'){ expand, fill, pack = @notebook.query_tab_label_packing(child) @notebook.set_tab_label_packing(child, expand, fill, if button3.active? then Gtk::PACK_END else Gtk::PACK_START end) } button = Gtk::Button.new("Hide Page") vbox.pack_end(button, false, false, 5) button.signal_connect('clicked'){ child.hide } child.show_all label_box = Gtk::HBox.new(false, 0) pixwid = Gtk::Image.new(@book_closed, @book_closed_mask) label_box.pack_start(pixwid, false, true, 0) pixwid.set_padding(3, 1) label = Gtk::Label.new(buffer) label_box.pack_start(label, false, true, 0) label_box.show_all menu_box = Gtk::HBox.new(false, 0) pixwid = Gtk::Image.new(@book_closed, @book_closed_mask) menu_box.pack_start(pixwid, false, true, 0) pixwid.set_padding(3, 1) label = Gtk::Label.new(buffer) menu_box.pack_start(label, false, true, 0) menu_box.show_all @notebook.append_page_menu(child, label_box, menu_box) end end def set_page_pixmaps(notebook, page_num, pix, mask) child = notebook.get_nth_page(page_num) label = notebook.get_tab_label(child).children[0].set(pix, mask) end def page_switch(notebook, page, page_num) old_page_num = notebook.page return if (page_num == old_page_num) set_page_pixmaps(notebook, page_num, @book_open, @book_open_mask) if (old_page_num != -1) set_page_pixmaps(notebook, old_page_num, @book_closed, @book_closed_mask) end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/gammacurve.rb���������������������������������������������0000644�0001750�0001750�00000003463�11701304107�021075� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header gammacurve.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: gammacurve.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class GammaCurveSample < SampleWindow include Math def initialize super("Gtk::GammaCurve") set_border_width(10) @curve = Gtk::GammaCurve.new add(@curve) @count = 0 end def update max = 127 + (@count % 2) * 128 @curve.curve.set_range(0, max, 0, max) vec = [] max.times do |i| vec[i] = (127 / sqrt(max)) * sqrt(i) end @curve.curve.set_vector(max, vec) @count += 1 end attr_reader :count def GammaCurveSample.invoke @singleton = new if @singleton.nil? or @singleton.destroyed? @singleton.update unless @singleton.visible? @singleton.show_all end if @singleton.count == 4 @singleton.destroy end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/buttonbox.rb����������������������������������������������0000644�0001750�0001750�00000005576�11701304107�021001� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header buttonbox.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: buttonbox.rb,v 1.6 2005/07/17 16:55:26 mutoh Exp $ Rewritten by Minoru Inachi <inachi@earth.interq.or.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ButtonBoxSample < SampleWindow def initialize super("Button Boxes") signal_connect("destroy"){destroy} set_border_width(10) main_vbox = Gtk::VBox.new add(main_vbox) frame_horz = Gtk::Frame.new("Horizontal Button Boxes") main_vbox.pack_start(frame_horz, true, true, 10) vbox = Gtk::VBox.new vbox.border_width = 10 frame_horz.add(vbox) vbox.pack_start(create_bbox(true, "Spread", 40, Gtk::ButtonBox::SPREAD)) vbox.pack_start(create_bbox(true, "Edge", 40, Gtk::ButtonBox::EDGE), true, true, 5) vbox.pack_start(create_bbox(true, "Start", 40, Gtk::ButtonBox::START), true, true, 5) vbox.pack_start(create_bbox(true, "End", 40, Gtk::ButtonBox::END), true, true, 5) frame_vert = Gtk::Frame.new("Vertical Button Boxes") main_vbox.pack_start(frame_vert, true, true, 10) hbox = Gtk::HBox.new hbox.border_width = 10 frame_vert.add(hbox) hbox.pack_start(create_bbox(false, "Spread", 30, Gtk::ButtonBox::SPREAD)) hbox.pack_start(create_bbox(false, "Edge", 30, Gtk::ButtonBox::EDGE), true, true, 5) hbox.pack_start(create_bbox(false, "Start", 30, Gtk::ButtonBox::START), true, true, 5) hbox.pack_start(create_bbox(false, "End", 30, Gtk::ButtonBox::END), true, true, 5) end def create_bbox(horizontal, title, spacing, layout) frame = Gtk::Frame.new(title) if horizontal then bbox = Gtk::HButtonBox.new else bbox = Gtk::VButtonBox.new end bbox.border_width = 5 frame.add(bbox) bbox.set_layout_style(layout) bbox.set_spacing(spacing) button = Gtk::Button.new("OK") bbox.add(button) button = Gtk::Button.new("Cancel") bbox.add(button) button = Gtk::Button.new("Help") bbox.add(button) frame end end ����������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/tooltips.rb�����������������������������������������������0000644�0001750�0001750�00000002162�11701304107�020616� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin tooltips.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: tooltips.rb,v 1.6 2005/07/21 17:47:19 mutoh Exp $ =end require 'sample' class TooltipsSample < SampleWindow def initialize super("Tooltips") set_default_size(200, -1) set_border_width(5) tooltips = Gtk::Tooltips.new button = Gtk::ToggleButton.new("button1") tooltips.set_tip(button,"This is button 1", "ContextHelp/buttons/1") button2 = Gtk::ToggleButton.new("button2") tooltips.set_tip(button2, "This is button 2. This is also a really long tooltip which probably won't fit on a single line and will therefore need to be wrapped. Hopefully the wrapping will work correctly.", "ContextHelp/buttons/2_long") vbox = Gtk::VBox.new(false, 10) vbox.add(button) vbox.add(button2) vbox.add(Gtk::HSeparator.new) button4 = Gtk::Button.new("close") button4.signal_connect("clicked"){destroy} vbox.pack_start(button4) tooltips.set_tip(button4, "Push this button to close window", "ContextHelp/buttons/Close") add(vbox) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/statusbar.rb����������������������������������������������0000644�0001750�0001750�00000005126�11701304107�020754� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header statusbar.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/21 17:47:19 $ $Id: statusbar.rb,v 1.6 2005/07/21 17:47:19 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class StatusbarSample < SampleWindow def initialize super("statusbar") set_border_width(5) @counter = 1 vbox = Gtk::VBox.new(false, 5) add(vbox) statusbar = Gtk::Statusbar.new vbox.pack_end(statusbar, true, true, 0) statusbar.signal_connect("text_popped"){|o, mid, text| @counter = 1 if text puts "poped" } statusbar.signal_connect("text_pushed"){|o, mid, text| # do nothing... as of gtk 1.2.6 puts "pushed" } button_push = Gtk::Button.new("push something") vbox.add(button_push) button_push.signal_connect("clicked"){ @counter += 1 statusbar.push(1, "something #{@counter}") } button_pop = Gtk::Button.new("pop") vbox.add(button_pop) button_pop.signal_connect("clicked"){ statusbar.pop(1) } button_steal = Gtk::Button.new("steal #4") vbox.add(button_steal) button_steal.signal_connect("clicked"){ statusbar.remove(1, 4) } button_context = Gtk::Button.new("test contexts") vbox.add(button_context) button_context.signal_connect("clicked"){ ["any context", "idle messages", "some text", "hit the mouse", "hit the mouse2"].each do |str| puts "Gtk::StatusBar: context=\"#{str}\", context_id=#{statusbar.get_context_id(str)}" end } vbox.add(Gtk::HSeparator.new) button_close = Gtk::Button.new("close") button_close.signal_connect("clicked"){destroy} vbox.add(button_close) end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/sample/testgtk/check-n.xpm�����������������������������������������������0000644�0001750�0001750�00000000533�11701304107�020452� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char *openfile[] = { /* width height num_colors chars_per_pixel */ " 10 9 5 1", /* colors */ ". c None", "# c #000000", "y c #666666", "i c #ff1f00", "# c #9f9f9f", /* pixels */ "..........", "........yy", ".......yy.", "......yy..", ".yyy.yy...", "..yyyy....", "...yy.....", "..........", "..........", }; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/extconf.rb���������������������������������������������������������������0000644�0001750�0001750�00000002223�11701304107�015437� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "gtk2" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/Rakefile�����������������������������������������������������������������0000644�0001750�0001750�00000003133�12257552167�015134� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require 'gnome2-raketask' package = GNOME2Package.new do |_package| _package.summary = "Ruby/GTK2 is a Ruby binding of GTK+-2.x." _package.description = "Ruby/GTK2 is a Ruby binding of GTK+-2.x." _package.dependency.gem.runtime = ["atk", "pango", "gdk_pixbuf2"] _package.win32.packages = [] _package.win32.dependencies = [] _package.win32.build_dependencies = [ "glib2", "atk", "pango", "gdk_pixbuf2", ] _package.external_packages = [ { :name => "gtk+", :download_site => :gnome, :label => "gtk+", :version => "2.24.22", :compression_method => "xz", :windows => { :configure_args => [], :need_autoreconf => true, :patches => [ "gtk+-2.24.22-add-missing-exeext.diff", ], :built_file => "bin/libgtk-win32-2.0-0.dll", }, }, { :name => "hicolor-icon-theme", :download_base_url => "http://icon-theme.freedesktop.org/releases", :label => "gtk-hi-color-icon-theme", :version => "0.13", :windows => { :configure_args => [], :build_concurrently => false, :built_file => "share/icons/hicolor/index.theme", } }, ] end package.define_tasks namespace :win32 do desc "create default gtkrc" task :gtkrc do gtkrc_path = File.join("vendor", "local", "etc", "gtk-2.0", "gtkrc") mkdir_p(File.dirname(gtkrc_path)) File.open(gtkrc_path, "w") do |gtkrc| gtkrc.puts('gtk-theme-name = "MS-Windows"') end end namespace :builder do task :after => ["win32:gtkrc"] end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/��������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�014446� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_color.rb���������������������������������������������������0000644�0001750�0001750�00000000423�11701304107�017752� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGdkColor < Test::Unit::TestCase def test_to_s color = Gdk::Color.new(0xffff, 0x1234, 0xabcd) if Gtk.check_version?(2, 12, 0) assert_equal("#ffff1234abcd", color.to_s) else assert_match(/\A#<Gdk::Color:.*>\z/, color.to_s) end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_accel_key.rb�����������������������������������������������0000644�0001750�0001750�00000001647�12124610262�020606� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkAccelKey < Test::Unit::TestCase def test_flags key = Gtk::AccelKey.new assert_equal(0, key.flags) end end �����������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_list_store.rb����������������������������������������������0000644�0001750�0001750�00000003730�12102213526�021047� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkListStore < Test::Unit::TestCase include GtkTestUtils ID = 0 NAME = 1 COLUMNS = { ID => Integer, NAME => String, } def setup columns = COLUMNS.keys.sort.collect do |key| COLUMNS[key] end @store = Gtk::ListStore.new(*columns) end def test_set_values only_gtk_version(2, 12) iter = @store.append assert_nothing_raised do @store.set_values(iter, [0, '1']) end assert_equal([0, '1'], [iter[0], iter[1]]) iter = @store.append assert_nothing_raised do @store.set_values(iter, [2, '3']) end assert_equal([2, '3'], [iter[0], iter[1]]) assert_nothing_raised do @store.set_values(iter, []) end assert_equal([2, '3'], [iter[0], iter[1]]) end def test_set_values_with_hash only_gtk_version(2, 12) iter = @store.append assert_nothing_raised do @store.set_values(iter, {ID => 0, NAME => 'me'}) end assert_equal([0, 'me'], [iter[ID], iter[NAME]]) iter = @store.append assert_nothing_raised do @store.set_values(iter, {NAME => 'you', ID => 2}) end assert_equal([2, 'you'], [iter[ID], iter[NAME]]) assert_nothing_raised do @store.set_values(iter, {NAME => "she"}) end assert_equal([2, 'she'], [iter[ID], iter[NAME]]) assert_nothing_raised do @store.set_values(iter, {}) end assert_equal([2, 'she'], [iter[ID], iter[NAME]]) end def test_iter_gc n_iterators = count_objects(Gtk::TreeIter) 50.times do |i| iter = @store.append iter[ID] = i iter[NAME] = i.to_s end 100.times do @store.iter_first end iter = @store.iter_first while @store.remove(iter); end iter = nil assert_equal(0, @store.to_enum(:each).to_a.size) GC.start assert_equal(n_iterators, count_objects(Gtk::TreeIter)) end private def count_objects(klass) n_objects = ObjectSpace.each_object(Gtk::TreeIter) do # do nothing end n_objects end end ����������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_accel_group_entry.rb���������������������������������������0000644�0001750�0001750�00000001676�12124610262�022375� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkAccelGroupEntry < Test::Unit::TestCase def test_accel_path entry = Gtk::AccelGroupEntry.new assert_nil(entry.accel_path) end end ������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_unix_print.rb����������������������������������������������0000644�0001750�0001750�00000000623�11701304107�021055� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkUnixPrint < Test::Unit::TestCase def test_classes if GLib.os_unix? assertion = :assert_const_defined else assertion = :assert_not_const_defined end send(assertion, Gtk, :PageSetupUnixDialog) send(assertion, Gtk, :Printer) send(assertion, Gtk, :PrintCapabilities) send(assertion, Gtk, :PrintJob) send(assertion, Gtk, :PrintUnixDialog) end end �������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_widget.rb��������������������������������������������������0000644�0001750�0001750�00000001253�11701304107�020141� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkWidget < Test::Unit::TestCase include GtkTestUtils def setup @widget = Gtk::Invisible.new end def test_set_window attrs = Gdk::WindowAttr.new(100, 100, :only, :temp) window = Gdk::Window.new(nil, attrs, 0) @widget.window = window assert_equal(window, @widget.window) end def test_modify_color_component_with_nil_color assert_nothing_raised do @widget.modify_base(:normal, nil) end assert_nothing_raised do @widget.modify_text(:normal, nil) end assert_nothing_raised do @widget.modify_fg(:normal, nil) end assert_nothing_raised do @widget.modify_bg(:normal, nil) end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/gtk-test-utils.rb���������������������������������������������������0000644�0001750�0001750�00000000501�11701304107�017645� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������require 'tempfile' module GtkTestUtils private def only_gtk_version(major, minor, micro=nil) micro ||= 0 unless Gtk.check_version?(major, minor, micro) omit("Require GTK+ >= #{major}.#{minor}.#{micro}") end end def only_x11 omit("Only for X11 backend") unless Gdk.windowing_x11? end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_icon_theme.rb����������������������������������������������0000644�0001750�0001750�00000001415�12257552167�021012� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkIconTheme < Test::Unit::TestCase include GtkTestUtils def setup @theme = Gtk::IconTheme.default end def test_choose_icon only_gtk_version(2, 12) assert_nil(@theme.choose_icon("non-existent", 100)) icon = @theme.choose_icon("face-cool", 10) assert_not_nil(icon) assert_match(/face-cool/, icon.filename) assert_not_nil(@theme.choose_icon("face-cool", 29, [:use_builtin, :no_svg])) end def test_contexts only_gtk_version(2, 12) assert_operator(@theme.contexts, :include?, "MimeTypes") end class TestIcons < self def test_no_argument assert_operator(@theme.icons, :include?, "face-cool") end def test_context assert_operator(@theme.icons("Actions"), :include?, "find") end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_entry.rb���������������������������������������������������0000644�0001750�0001750�00000000724�11701304107�020021� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkEntry < Test::Unit::TestCase include GtkTestUtils def setup @entry = Gtk::Entry.new end def test_cursor_hadjustment only_gtk_version(2, 12) assert_nil(@entry.cursor_hadjustment) adjustment = Gtk::Adjustment.new(0.0, 0.0, 100.0, 100.0, 1.0, 1.0) @entry.cursor_hadjustment = adjustment assert_equal(adjustment, @entry.cursor_hadjustment) end end ��������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_rectangle.rb�����������������������������������������������0000644�0001750�0001750�00000001705�12124610262�020606� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGdkRectangle < Test::Unit::TestCase def test_width rectangle = Gdk::Rectangle.new(0, 10, 20, 30) assert_equal(20, rectangle.width) end end �����������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_display.rb�������������������������������������������������0000644�0001750�0001750�00000002204�11701304107�020300� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGdkDisplay < Test::Unit::TestCase include GtkTestUtils def test_supports_predicates display = Gdk::Display.default assert_boolean(display.supports_shapes?) assert_boolean(display.supports_input_shapes?) only_gtk_version(2, 12, 0) assert_boolean(display.supports_composite?) end def test_startup_notification_id only_gtk_version(2, 12, 0) only_x11 display = Gdk::Display.default assert_nil(display.startup_notification_id) end def test_broadcast_startup_message omit("Not yet implemented (GNOME bug #528020)") only_gtk_version(2, 16, 0) only_x11 id = "#{$$}_TIME_#{Time.now.to_i}" screen = Gdk::Screen.default.number.to_s assert_nothing_raised do Gdk::Display.default.broadcast_startup_message("new", "ID" => id, "NAME" => "Hello World", "SCREEN" => screen) Gdk::Display.default.broadcast_startup_message("remove", "ID" => id) end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_event.rb���������������������������������������������������0000644�0001750�0001750�00000000341�11701304107�017754� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGdkEvent < Test::Unit::TestCase include GtkTestUtils def test_motion_request only_gtk_version(2, 12, 0) motion = Gdk::EventMotion.new assert_nothing_raised do motion.request end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_recent_filter_info.rb��������������������������������������0000644�0001750�0001750�00000001762�12124610262�022525� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkRecentFilterInfo < Test::Unit::TestCase include GtkTestUtils def test_contains info = Gtk::RecentFilterInfo.new assert_equal(Gtk::RecentFilter::Flags.new, info.contains) end end ��������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_builder.rb�������������������������������������������������0000644�0001750�0001750�00000010602�11701304107�020302� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkBuilder < Test::Unit::TestCase include GtkTestUtils def test_constants only_gtk_version(2, 12, 0) assert_kind_of(Gtk::BuilderError, Gtk::BuilderError::INVALID_TAG) end def test_new only_gtk_version(2, 12, 0) assert_nothing_raised do Gtk::Builder.new end end def test_add_from_file only_gtk_version(2, 12, 0) builder = Gtk::Builder.new assert_nothing_raised do builder.add_from_file(ui_definition_file.path) end assert_kind_of(Gtk::Dialog, builder["dialog1"]) end def test_add_from_string only_gtk_version(2, 12, 0) builder = Gtk::Builder.new assert_nothing_raised do builder.add_from_string(ui_definition) end assert_kind_of(Gtk::VBox, builder["vbox1"]) end def test_add_with_file only_gtk_version(2, 12, 0) builder = Gtk::Builder.new assert_nothing_raised do builder.add(ui_definition_file.path) end assert_kind_of(Gtk::HButtonBox, builder["hbuttonbox1"]) end def test_add_with_string only_gtk_version(2, 12, 0) builder = Gtk::Builder.new assert_nothing_raised do builder.add(ui_definition) end assert_kind_of(Gtk::Button, builder["ok_button"]) end def test_add_chain only_gtk_version(2, 12, 0) builder = Gtk::Builder.new assert_nothing_raised do builder << ui_definition_file.path << ui_definition_simple end assert_kind_of(Gtk::Dialog, builder["dialog1"]) assert_kind_of(Gtk::Window, builder["main-window"]) end def test_objects only_gtk_version(2, 12, 0) builder = Gtk::Builder.new assert_nothing_raised do builder << ui_definition_file.path << ui_definition_simple end assert_equal(["dialog1", "vbox1", "hbuttonbox1", "ok_button", "main-window"].sort, builder.objects.collect {|object| object.builder_name}.sort) end def test_translation_domain only_gtk_version(2, 12, 0) builder = Gtk::Builder.new assert_nil(builder.translation_domain) builder.translation_domain = "ruby-gnome2" assert_equal("ruby-gnome2", builder.translation_domain) end def test_connect_signals only_gtk_version(2, 12, 0) handler_names = [] builder = Gtk::Builder.new builder.connect_signals do |name| handler_names << name Proc.new {} end assert_equal([].sort, handler_names.sort) builder << ui_definition ok_button = builder["ok_button"] builder.connect_signals do |name| handler_names << name Proc.new {} end assert_equal(["ok_button_clicked"].sort, handler_names.sort) end def test_connect_signals_with_no_signal_ui_definition only_gtk_version(2, 12, 0) handler_names = [] builder = Gtk::Builder.new builder.connect_signals do |name| handler_names << name Proc.new {} end assert_equal([].sort, handler_names.sort) builder << ui_definition_simple builder.connect_signals do |name| handler_names << name Proc.new {} end assert_equal([].sort, handler_names.sort) end def test_get_type_from_name only_gtk_version(2, 12, 0) builder = Gtk::Builder.new assert_nil(builder.get_type("XXX")) assert_equal(Gtk::VBox, builder.get_type("GtkVBox")) end private def ui_definition <<-EOX <interface> <object class="GtkDialog" id="dialog1"> <child internal-child="vbox"> <object class="GtkVBox" id="vbox1"> <property name="border-width">10</property> <child internal-child="action_area"> <object class="GtkHButtonBox" id="hbuttonbox1"> <property name="border-width">20</property> <child> <object class="GtkButton" id="ok_button"> <property name="label">gtk-ok</property> <property name="use-stock">TRUE</property> <signal name="clicked" handler="ok_button_clicked"/> </object> </child> </object> </child> </object> </child> </object> </interface> EOX end def ui_definition_simple <<-EOX <interface> <object class="GtkWindow" id="main-window"> </object> </interface> EOX end def ui_definition_with_signal <<-EOX <interface> <object class="GtkWindow" id="main-window"> </object> </interface> EOX end def ui_definition_file xml = Tempfile.new("Gtk::Builder") xml.print(ui_definition) xml.close xml end end ������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_recent_data.rb���������������������������������������������0000644�0001750�0001750�00000001660�12124610262�021133� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkRecentData < Test::Unit::TestCase def test_mime_type data = Gtk::RecentData.new assert_nil(data.mime_type) end end ��������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_keymap.rb��������������������������������������������������0000644�0001750�0001750�00000000305�11701304107�020121� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGdkKeymap < Test::Unit::TestCase include GtkTestUtils def test_have_bidi_layouts? only_gtk_version(2, 12, 0) assert_boolean(Gdk::Keymap.default.have_bidi_layouts?) end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_buildable.rb�����������������������������������������������0000644�0001750�0001750�00000002656�11701304107�020611� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkBuildable < Test::Unit::TestCase include GtkTestUtils def setup @buildable = Gtk::HBox.new end def test_name only_gtk_version(2, 12, 0) assert_equal("", @buildable.name) @buildable.name = "YYY" assert_equal("YYY", @buildable.name) @buildable.name = nil assert_equal("", @buildable.name) end def test_add_child only_gtk_version(2, 12, 0) assert_equal([], @buildable.children) builder = Gtk::Builder.new entry = Gtk::Entry.new @buildable.add_child(builder, entry) assert_equal([entry], @buildable.children) end def test_set_buildable_property only_gtk_version(2, 12, 0) assert_nil(@buildable.parent) builder = Gtk::Builder.new parent = Gtk::HBox.new @buildable.set_buildable_property(builder, "parent", parent) assert_equal(parent, @buildable.parent) end def test_construct_child only_gtk_version(2, 12, 0) assert_nil(@buildable.parent) @buildable = Gtk::UIManager.new @buildable.add_ui(<<-EOU) <ui> <toolbar name='Toolbar'> </toolbar> </ui> EOU builder = Gtk::Builder.new assert_kind_of(Gtk::Toolbar, @buildable.construct_child(builder, "Toolbar")) end def test_get_internal_child only_gtk_version(2, 12, 0) assert_nil(@buildable.parent) @buildable = Gtk::Dialog.new builder = Gtk::Builder.new assert_kind_of(Gtk::VBox, @buildable.get_internal_child(builder, "vbox")) end end ����������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_about_dialog.rb��������������������������������������������0000644�0001750�0001750�00000000526�11701304107�021311� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkAboutDialog < Test::Unit::TestCase include GtkTestUtils def setup @dialog = Gtk::AboutDialog.new end def test_program_name only_gtk_version(2, 12, 0) assert_equal(File.basename($0), @dialog.program_name) @dialog.program_name = "my-program" assert_equal("my-program", @dialog.program_name) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_window.rb��������������������������������������������������0000644�0001750�0001750�00000001061�11701304107�020142� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGdkWindow < Test::Unit::TestCase include GtkTestUtils def setup @window = Gtk::Invisible.new.window end def test_set_composited only_gtk_version(2, 12, 0) assert_nothing_raised do @window.composited = false end end def test_set_opacity only_gtk_version(2, 12, 0) assert_nothing_raised do @window.opacity = 0.5 end end def test_set_startup_id only_gtk_version(2, 12, 0) assert_nothing_raised do @window.startup_id = "startup-id" @window.startup_id = nil end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_selection_data.rb������������������������������������������0000644�0001750�0001750�00000001022�11701304107�021606� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestSelectionData < Test::Unit::TestCase def setup @window = Gtk::Invisible.new.window end def test_type_integer name = "ID" value = 10 Gdk::Property.change(@window, name, Gdk::Selection::TYPE_INTEGER, :replace, value) assert_equal([Gdk::Selection::TYPE_INTEGER, [value]], Gdk::Property.get(@window, name, Gdk::Selection::TYPE_INTEGER, false)[0, 2]) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_rc_style.rb������������������������������������������������0000644�0001750�0001750�00000000560�11701304107�020502� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkRcStyle < Test::Unit::TestCase include GtkTestUtils def setup @style = Gtk::RcStyle.new end def test_color_flags assert_equal(Gtk::RC::Flags.new, @style.color_flags(:normal)) @style.set_color_flags(:normal, [:fg, :bg]) assert_equal(Gtk::RC::Flags::FG | Gtk::RC::Flags::BG, @style.color_flags(:normal)) end end ������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gc.rb����������������������������������������������������������0000644�0001750�0001750�00000000764�11701304107�016410� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������require 'test/unit' require 'gtk2' class TestGC < Test::Unit::TestCase priority :must def test_closure 10.times do invisible = Gtk::Invisible.new invisible.signal_connect("destroy") {} GC.start end end def test_inheritance_and_gc button = Class.new(Gtk::Button) box = Gtk::HBox.new n = 10 n.times do box.add(button.new) end GC.start assert_equal([button] * 10, box.children.collect {|item| item.class}) end end ������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_geometry.rb������������������������������������������������0000644�0001750�0001750�00000001671�12124610262�020477� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGdkGeometry < Test::Unit::TestCase def test_min_width geometry = Gdk::Geometry.new assert_equal(0, geometry.min_width) end end �����������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_gc.rb������������������������������������������������������0000644�0001750�0001750�00000000200�11701304107�017216� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGdkGC < Test::Unit::TestCase include GtkTestUtils def test_constant assert_const_defined(Gdk, :GC) end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/run-test.rb���������������������������������������������������������0000755�0001750�0001750�00000001703�12002536277�016550� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") atk_base = File.join(ruby_gnome2_base, "atk") pango_base = File.join(ruby_gnome2_base, "pango") gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2") gtk_base = File.join(ruby_gnome2_base, "gtk2") [[glib_base, "glib2"], [atk_base, "atk"], [pango_base, "pango"], [gdk_pixbuf_base, "gdk_pixbuf2"], [gtk_base, "gtk2"]].each do |target, module_name| if system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require 'glib-test-init' $LOAD_PATH.unshift(File.join(gtk_base, "test")) require 'gtk-test-utils' require 'gtk2' exit Test::Unit::AutoRunner.run(true) �������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_image.rb���������������������������������������������������0000644�0001750�0001750�00000000335�11701304107�017740� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkImage < Test::Unit::TestCase include GtkTestUtils def test_stock image = Gtk::Image.new(Gtk::Stock::GO_FORWARD, Gtk::IconSize::DIALOG) assert_equal(Gtk::Stock::GO_FORWARD, image.stock) end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_allocation.rb����������������������������������������������0000644�0001750�0001750�00000001711�12124610262�021004� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkAllocation < Test::Unit::TestCase def test_width allocation = Gtk::Allocation.new(0, 10, 20, 30) assert_equal(20, allocation.width) end end �������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_pango.rb���������������������������������������������������0000644�0001750�0001750�00000000402�11701304107�017735� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGdkPango < Test::Unit::TestCase include GtkTestUtils def test_emboss_color_attribute only_gtk_version(2, 12, 0) color = Gdk::PangoAttrEmbossColor.new(Gdk::Color.parse("red")) assert_equal([65535, 0, 0], color.value.to_a) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_menu_item.rb�����������������������������������������������0000644�0001750�0001750�00000000435�11701304107�020641� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkMenuItem < Test::Unit::TestCase include GtkTestUtils def test_new_with_label item = Gtk::MenuItem.new("Label") assert_equal("Label", item.label) end def test_new_with_nil_label item = Gtk::MenuItem.new(nil) assert_equal("", item.label) end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_tree_path.rb�����������������������������������������������0000644�0001750�0001750�00000000763�11701304107�020636� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkTreePath < Test::Unit::TestCase include GtkTestUtils def test_compare assert_equal(-1, tree_path("0") <=> tree_path("1")) assert_equal(0, tree_path("0") <=> tree_path("0")) assert_equal(1, tree_path("1") <=> tree_path("0")) end def test_equal assert_equal(tree_path("0"), tree_path("0")) assert_not_equal(tree_path("0"), tree_path("1")) assert_not_equal(tree_path("0"), "0") end private def tree_path(path) Gtk::TreePath.new(path) end end �������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk_window_attribute.rb����������������������������������������0000644�0001750�0001750�00000000474�11701304107�022234� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkWindowAttribute < Test::Unit::TestCase include GtkTestUtils def test_initialize attrs = Gdk::WindowAttr.new(100, 100, :only, :temp) assert_equal([100, 100, Gdk::Window::INPUT_ONLY, Gdk::Window::TEMP], [attrs.width, attrs.height, attrs.wclass, attrs.window_type]) end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gtk_border.rb��������������������������������������������������0000644�0001750�0001750�00000001670�12124610262�020140� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkBorder < Test::Unit::TestCase def test_left border = Gtk::Border.new(10, 15, 20, 25) assert_equal(10, border.left) end end ������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk2/test/test_gdk.rb���������������������������������������������������������0000644�0001750�0001750�00000000646�11701304107�016563� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGdk < Test::Unit::TestCase include GtkTestUtils def test_notify_startup_complete assert_nothing_raised do Gdk.notify_startup_complete end notify_with_id = Proc.new do Gdk.notify_startup_complete("startup-id") end if Gtk.check_version?(2, 12, 0) assert_nothing_raised(¬ify_with_id) else assert_raise(NotImplementedError, ¬ify_with_id) end end end ������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/COPYING.LIB�������������������������������������������������������������������0000644�0001750�0001750�00000063642�12257552167�014273� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/��������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665515�014602� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/ext/����������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�015356� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/ext/goocanvas/������������������������������������������������������0000755�0001750�0001750�00000000000�12147676243�017360� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/ext/goocanvas/rbgoocanvas.c�����������������������������������������0000644�0001750�0001750�00000003402�12147676243�022027� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2007 Vincent Isambart <vincent.isambart@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgoocanvas.h" static void rgoo_canvas_mark(gpointer object) { GooCanvas *canvas = object; GooCanvasItem *root_item; rbgobj_gc_mark_instance(object); root_item = goo_canvas_get_root_item(canvas); if (root_item) { rbgobj_gc_mark_instance(root_item); } } static void rgoo_canvas_item_mark(gpointer object) { GooCanvasItem *item = object; gint i, n_children; rbgobj_gc_mark_instance(object); n_children = goo_canvas_item_get_n_children(item); for (i = 0; i < n_children; i++) { GooCanvasItem *child; child = goo_canvas_item_get_child(item, i); rbgobj_gc_mark_instance(child); } } void Init_goocanvas(void) { rbgobj_register_mark_func(GOO_TYPE_CANVAS, rgoo_canvas_mark); rbgobj_register_mark_func(GOO_TYPE_CANVAS_ITEM, rgoo_canvas_item_mark); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/ext/goocanvas/extconf.rb��������������������������������������������0000644�0001750�0001750�00000004127�12147676243�021357� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin extconf.rb for Ruby/GooCanvas extension library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent.expand_path top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "goocanvas" package_id = "goocanvas-2.0" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end [ "glib2", "atk", "pango", "gdk_pixbuf2", "gdk3", "gtk3", "gobject-introspection", ].each do |package| directory = "#{package}#{version_suffix}" build_base_path = "#{directory}/tmp/#{RUBY_PLATFORM}" package_library_name = package.gsub(/-/, "_") build_dir = "#{build_base_path}/#{package_library_name}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end rcairo_options = {} rcairo_source_dir_names = ["rcairo"] if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM rcairo_source_dir_names.unshift("rcairo.win32") end rcairo_source_dir_names.each do |rcairo_source_dir_name| rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name if rcairo_source_dir.exist? rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s break end end check_cairo(rcairo_options) or exit(false) setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id) exit(false) end create_pkg_config_file("Ruby/GooCanvas", package_id) $defs << "-DRUBY_GOO_CANVAS_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/ext/goocanvas/goocanvas.def�����������������������������������������0000644�0001750�0001750�00000000030�11701304107�021767� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXPORTS Init_goocanvas ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/ext/goocanvas/rbgoocanvas.h�����������������������������������������0000644�0001750�0001750�00000002025�12147676243�022034� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGOOCANVAS_H__ #define __RBGOOCANVAS_H__ #include <rbgobject.h> #include <goocanvas.h> extern void Init_goocanvas(void); #endif /* __RBGOOCANVAS_H__ */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/ext/goocanvas/depend������������������������������������������������0000644�0001750�0001750�00000000251�12064346475�020537� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-goocanvas.pc $(pkgconfigdir); \ fi �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/README��������������������������������������������������������������0000644�0001750�0001750�00000001420�12257552167�015455� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ruby/GooCanvas ============== Ruby/GooCanvas is a Ruby binding of GooCanvas. Requirements ------------ Ruby: http://www.ruby-lang.org/ GooCanvas: http://live.gnome.org/GooCanvas Install ------- 0. install ruby-1.9.x or later and GooCanvas. 1. ruby extconf.rb 2. make 3. su 4. make install Copying ------- Copyright (c) 2008 Ruby-GNOME2 Project Team Copyright (c) 2007 Vincent Isambart Copyright (c) 2007 Kouhei Sutou <kou@cozmixng.org> Copyright (c) 2007 Manu This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ Thanks ------ * Andrew Whyte - improved rbgoocanvasitem.c. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/lib/����������������������������������������������������������������0000755�0001750�0001750�00000000000�12147676243�015346� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/lib/goo/������������������������������������������������������������0000755�0001750�0001750�00000000000�12147676243�016132� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/lib/goo/canvas-item.rb����������������������������������������������0000644�0001750�0001750�00000002246�12147676243�020672� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Goo module CanvasItem alias_method :remove_child_raw, :remove_child private :remove_child_raw def remove_child(child_or_position) if child_or_position.is_a?(CanvasItem) child = child_or_position position = find_child(child) else position = child_or_position child = get_child(position) end remove_child_raw(position) end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/lib/goocanvas.rb����������������������������������������������������0000644�0001750�0001750�00000004010�12147676243�017646� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gtk3" require "gobject-introspection" base_dir = Pathname.new(__FILE__).dirname.dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) if vendor_dir.exist? begin require "gobject-introspection" vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) rescue LoadError end end module Goo LOG_DOMAIN = "GooCanvas" GLib::Log.set_log_domain(LOG_DOMAIN) class << self def const_missing(name) init if const_defined?(name) const_get(name) else super end end def init loader = Loader.new(self) loader.load("GooCanvas") begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/goocanvas.so" rescue LoadError require "goocanvas.so" end require "goo/canvas-item" class << self remove_method(:init) remove_method(:const_missing) end end end class Loader < GObjectIntrospection::Loader private def load_field(info, i, field_info, klass) return if field_info.name == "parent" super end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/�������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�016061� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/toroid.png���������������������������������������������������0000644�0001750�0001750�00000041025�11701304107�020047� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���€���N���èÜ���gAMA�† 1è–_�� �IDATxÚì¼{°åÙUß÷Y{ÿç}Î}ßîÛ}»{¦gz^fô–’�ñ2 ÀÈ@•ãØeBʱƒ‹ÂŽ$•„`W*6±qQeRñŠ$e„ ‰Œ4Òh4šg÷ôû¾ï=ïßï·÷^ùcÿúv+ÈPe —„rº~unß¾}Ï9¿½öZßïw}×þÂ=Éu¡yʼnáæ»Úú -äÐíðÌî“áƒã«áP\ïŒ}ó¹·&?¼ñ ½ÏŠÑjŠ‹Ÿr¹öYÿÛã=ÿ\«oάž5µzf­;à,AÝp—ç&ao¸§/ÂË®”Ð/{í/ÿû×ÃÝúúz·)–L,)†DÔI‰W§^f&Õn¶!oXÿŽä¯/}“¾©sJûi$u¨Ì…ÙóÉöåÈGDýöÃ?(ß·xO8‘g«ˆõBu˜º/Ú+ûÝ3w=$ç6î w·ZØ<ÅH�??; Åx;Ù¾y‘«Wž“§_|ªúøÞ–>5ëUWR¯…*þë%¾öÀ˜¼6Ù0¯HNÉC麞M–Ù´ ]²‰A䢿i¶Ç/úOµï×oZùnygçnŸg™’)$Ò�z”pãqA«À…o:‹‹’Šz^N™îÀÉ3ž¥“J+SR«$‰BX✠!Ì¡Z¶“âÚ‹úòÍËá…íkæùý]e<Ôkã‘Ù.fº[~RzU…þÿð'ҥГ®Y'§- 9­]VÉi±žÞkÞ%¹d‰~:ÐÜ6›()Fl0ÈLÕ!ÍÕ·6Õ4*™ÄEO$ É$áúï‹N¯VÜ÷nKï´'óHb F·ŸJ¸þÇ+ßaää=^£¤rÄ `UÔx07P‰h8¯ÁŸ)åÄÈ|$:>R7RŒM1›0ŸMÅMÌöçž ÿÕ¥+î!hù �wÔHK‹MsWþ}æþôM<`_¯+,KW -rO*ÔV"VUPIªRgÄU%k@Þ…¼¹;5uH2Eöÿ Õ›¯ä®o³zâÑ€u"™Ía牔ËTñèwZÖ/x”YH!5*™7:=)D¥TLĪj¨ EŒUÔ+åf#a6R&G0"£4am©qðkï+àâUÿᯕ�Hþý¾œBBOúÉýöõÍÿLk½Õfà»jµ„´Î³Ç—€µ¨­D­R¥"$J’@¿Ñ“ÛanGnŒh   uŒ(·2®¬’Á]°ôâ+E‚¢©ÈÁó)Ï| äþ·&,ßãñN1 !ŒPŽv®t®²Ø…•$5 ň›€ŸA¨™•çAT‘�¾‚ùŽŽÜ(o|E±ø–צ?yéª\!ܺ+©eui`9†'ŠŠ½¿X †”޹ÏÞÕy»<Üý.ä¯ ›vC/bš$©"v² ÆÔ¹ÉÄ£^Q*ÂBw‰³{x®|š¹<¨'Äà)…ëØTY~µA“€ŸA’€›Z.~ÔÓ[7œ|%T¥’ a¼ó…yûw½í.ÖVöf—U8WBYÀ|¤ø:-eq�s#¸9”‰¢f3¨ ¡‘+½&<rŸ<ø›m9=œèË"byë…Sæ§¿ý æÍïÿÿÓO¾èÿ·¯„bæÔ¯—�¨S}מO^¹ðSú¶¥²çZ'ªE\ÑTãg£@<bT$8Õ0SÕ— AP§h@œ÷ú—¸b/’X%Œ"„T$€*{Ÿ=ãtåÕBç¬PMI@lnôú',/¼áÇlËãf"Iªj­áåϤ<ý¡’·¼½/o~Æ:yaû¡ô„ 3´˜Â|ãƒø<²H75zb ÄR`çšÈh¨JPÚ9,u [Ýýªû“úüsþ×–äÏÐÍ™½ùž Û;黿r�üù,þŸ_�¤ôådû›Í»Nþ¼¾ª÷@8™%>΍ Š .ŠÖ‹ëƒ"&ÒDŦàPµYª(Tokã¯PP5@‚ˆ7:|>4]„ÞCà5@¤9ê& ן(Y<gX8#”%¨4 {/¦òô‡+=ʃ¯nèÎü"óÙS)ê-ÐP@1×lÃp%:h6×µ4^PQïTXêA¯$QÍÞñzó·ÒLþÓÜ„µå†Ê£ç„\Ð¥~X2¾”�ÖÐ]ëÈ[{-»ðÒNxéuøÕ„¯n�¤20§{ï”ןøA}ãê»üf«A7šVÁ£øXúÄ#¡D‹)â T4n”ÑĨ´Ú35A5­uJP (Zÿ75uÊϼèè9•᫚º÷!Í5£Õž'ñ¨Í 7þ0*å®×7™O§0Ûf{ >ý¾B7ÎyõÛ›º;Ù"”AÄ¡‰ ¨”*¼ƒ¢„ñw¡“Ã#÷‹v›*Z¡½¶ "¨ž\Jh§ÞÀÚ ,·³€/à¡uát ¯´,ËVX ÊÍÔ²rÿ ó‹ßu¿ù¾3+Öü·¿¯;/î†|íe�ÁH+;ÍÝ‹o³ß|ú'ô ' §Zm[!U0 $hOÌã VÈR$” t>ƒj> •¢ó :hË`]1:C²‚v£A 6x¬zŒõ¤VÉQÅä¥@ñ%…€äg`é9Õ¬”0FÏPí$ÜülÉÒ™„Á†a:„<RÚ<ñXãyÅ77™ëXÊQÀÔTÒ�IĤ˜ 4Ÿ ‰Uª*fƒ­›0ú+žNŽ´2¬¨¬ö«`ƒp°/„Ji[xìœ%—@`¥#ƒÕ}¬¨TîZ–¿óÈjxí+Õ¶rÏZÛ<ôâ®ÿÚ �Ts÷â_–wÝó·ô­çqë-h$°(Æ!¢à]̼‰HÍ¡(,ØÒI‘™Aý1ò˜+¾ôd+’Y“ñÕL·Ig±…MbJÔULwæøënÔpúçsZK9‡— 2í¼É¥?(ðSX¾/¡ò®€NËpñ‰ŠýKއÞjHÚ%Ã#) 5æØ’ÄÔLÞUZ)„©pñY%(LÆ0 éš V±¢hP ¬t * ×·#`=»j8Ñ„~îÞÔ_(+ÖZøÁ™6ô×à,©‘ͯ% ºÒz}ãÙŸá/½ò»ü™vJ/ƒ†Ô:Äy£I;Ë¡,™NGÅ ¬äã‚G Ðha—2q£Tf ³Àl<¥³Ñ¡»ºÊáËÛ¾|D–Cžƒ `ç`4!ëÃÒÙ6³Ã ÕZˆý—×Í5èœV†û%yãë³+X\‡“÷ “O( O ™/ ;Jq¤d: èw¡ÛTò3–§>‹’ó0)V•Ü€/#8YìZúŒF–­GÃÀCkBUM~ö÷Œ±Tš@K` B˜+š(˹v¾6ÀÐþwš÷<öõu›÷„h'µlb"6Ó€Þ˜1¯fHžH J¨@Ôh,¨U�çÑYÀ·…Π.K˜íî@éa.PxÆÕ4N54=ߢÜr¸aÀ¸È’ldñF&,®v&pt³$µ± í<Wˆ‚öϼ¯(gJ#µ\þœ'T°ñÓ1¤¶)L†°ýRÀO Õ@ò>š%pëê-º]عî fÁh¤móY¸ mh§Š(rmÌ•µ¦pf ñ^Õ×µˆƒÔCfÀUÊt6 l´Ìƒš !1´ºoZnÛ2mfïÒ‘ûõ¹—mEýŸ_�dfÕ¼úÜß“ÿàUï ÷­dÚo@#‰�Ì(ÆyÌþ½4?AÝ™5Êå&t-’:‚ *âj“è ª€zU“Ê£SÇxTH¾ÜÒl½OiagÓ�SÕùt '³ið«ŠN4’$‰uÉŠ0h·¤ÝÈuë™}üÒ9m_öûhÒ…Þ˜î‰a÷9åà’²´),žR†{±r5º¢»/ÃÎ%…z0è¡‹‹°Ø‡^ š)ä‰gó´áâ³±²MÆ@P1=<T¥ß4d&ªDŸ~Ñ‚²ÑVr\RÌ-Û‡!.ŸZÕh 9pWÊÃï8g-ˆv–›òºÅL;mè%Jà [Óì¿üðe÷ß}þ@É)Ó¯z�H+;'o¸ðó¼ãÁð›‹)y."‰ªZð*æ Ró©‹â¯ŽUO®+gׄnMld²*J(#rÇbº=±ÒRµ)º·+!Q¥œ EPÏJÉN6±kAz-(C…"sÕ༘ShX¬Å&A;¦)›Ùººr¦;—w¥¸®´‚+ãmÖ2bÑj(â3tç¹� «ç–ó Åí¶D®#[ÏÅÅ_\„þ"Ú¶J«…všH3C3 Üwo.ÜipȬ4*j”àe:Q´ ¢;CØ:P! km$QIQUˆÎ˨eˆG}@fL}Ü\-uÙw/˜ïdµ0É ÚšxYo‡¥sçíÏþÞsþñm÷¦žË_½�H튼úÞ_ä ½;t»¨ÕÄ€™:•?ƒ{á@9}ºÈ;JiA]YÄ+ÁA¨¾Ô€GŒEV–UŠÝÞUf%fAK?A6SäDŒ}¾RŽP¦æh*áœ! PŠØD÷G‡Œ®Q½´ÝÒž0})fˆÍÐæºè|H@÷/*åÚ´³ªŒ÷U3#íÀî ª~ ý>,¬Bo€£Z•¨/ÛQÍ3hˆ°¹á´ÙÆ#ÕÉLÛFË¡:§°´Ø 5¥lÍÑ4Àz;©¬Š4SC š�:¯`¢J&B•]VJQõ6*—©¢D$®ýãgí{ûIræý×üOMƒ^üª€¬/~?§O~Gp É÷-¤^rãÿÜ>ô Û…¤!H¦xIš(¦.pÞG€ç+4T¨ñÐJ1ƒ:¯Ðy%̽2W´RÌ©ieÎ;ôY[À8‚ppËPõá0Œ7‘¼6Ö„ê0à&Q8H ëªÃ@5†7b`qS(¦J5¼ö.©†h¿ ‹kÐíCUŠîì)Z°§4ï…ÅvJ–´¡¬®¤ŒG%á#øLpF'³ VWÐdO¯ïL)Ê@ÓB'1PÅþEÐ^ÛOŠW´ôQš‹b@mÝ–ÎTé�¶3ò ¹6”Vâùáæ[Œýçÿû÷£“À¥×�°Òi=<ÐÎÀµa’Ö*í”pùPht”^M°™¢ $9ÌGȤB­Äö >DàW:(+NÕ¶ «(JÕI “�…'X‹,eМ#XT=\VÌè!ø+ˆkŠzUR…þ£Ý³Š›(:ŽòƒI¡¹l(gŠ0¹ðSht¡µ$2Ù jœaÿF <ˆ•«¿ ýEa>‚á®rtfÃÈ ÂTX´Y=Õ#̯ÉÊúÒ‹ppgšÕ}�Q!mvñL¹¹;ÃH-X¯„2ªzÞ#‰ zï‚å¥Ý€WQÕÈ**ê«ö%ØZ4µÄb€\[©2B½¦Ú÷¬…7íé?ú­­êoÌ•í—�Äd‘’•0sñkL±Œj™C3‡¼Åø` i"ƒtv=BõDâ;Nn¡™ (ïÐQ@-fc - 8ÂTQW!Yy†v+äõYÈ%ÅìsT¥¹!ôÎ yO 3Eg‚T5KèF¦Pí+nW)Gu»bÝPLÑòP(ÅQDäÝ%è/ “ì^V·az˜FCÈ“ ßw–vs¤§NNùcFØß+YëóxP\åÐ<eo"ê7J¥Jâk9/Z:e³¸«c¸xnï‰P–øóhü:êß1» ¡$Tch¶á'ÖÃ{ŒZóë[þ¯zþÛ€×Yñ%©ZºHËJe eí ó˘ÕӄíÚ>“Æ»,,,L‘dO€€ÉSÔähYÀÄÇà æ +»ÚÃßÁÈÅ,pI±÷fø£)º"Ø!=/dS!Q¥Ù€¬!a{Iê4îþ¬#T#Å*n¥\›AÞÆÛžêüB½ý˜•ý­¨…R9%EO”O}ªâÑW¾Ì=›pb9ÌÆÊî®çDßDdªJ9ž ý&£ém¿(¢¯$€R” N9×É æEÜáDl€ NyÙNPð ˆ Db+…̃9R.È.Ùw?=2Ÿxjþå–�sGzÿ3õ>cĤÉYV—¿•f3'Ï…,Ò\°‰ˆIDÓ\tqUÌêi!kÄO’ Y*dM‘VW¨ÆÂþHØÃÖÝ™ˆ©¼HÇ ê„Ñ\˜T¬æ•H'ixÑ›áÀ 3'¤"ÒK„ªm‘¾Jº¨’. Í…Tl*¢U™#Ì™#â‘$1)o¨ø  ! Ýe7U™l!Õñ%b ²´&’5D¶¯"Dº=dyÕˆ¯DÊ™Š€Èl†„¢”Sk^š©È“Ÿ 2ª¬÷œ[ùÈNœGZSY;yBÞÿ¡kâ=br¦%’)RÈdŽŒgÈd†x‡/’HoŽô‹xµçH³Dò I $©/3Gt†ØÁÇ÷eØ Ò˜©´½ÚåvòÈSýÔ$èå?;I¤Ù:#'¾Ûœ¿û;í`1‘……Óne©©iJA©q‹†(âP:B»ëwÃ|ÓÝ: €6{à–€ 4 ä-ð%¡˜Á1¶›Ú=œÂÜCÁì‰rbˆ^ÁXPæÈB ]SAsE-hRë�±iL½õÇI¢œ\lGÙ2U­ƒ«ëâÿ1Dw‘ˆáÊóñÐj)UÍžçž ×^4ì^):(<õLàž3Î't[ÂŽÂK7<¯Û˜*‚°·=aïúÎE„_yØAZ÷I©Ì„aÝIg°ì ÑÓh<¸ú3ÙÅÓ$Äd›ÖϾSÄûP¤‚Ï"ÖH¦ÊciX{WÇþÍ_=tŸõ>ÿ2€HnN|¯yýkþG^õÈù³çÎû“'ϺյÅÐ[4Ú[‚Á*2XGºËHÞ l ÆÆ¼Ú`²6ªØ=IS$ï‚›B#…Nz¡ßEMt^!& Ó)ìÏ`æ¡ðHC°@¸6£ ÆÑç%« j& Ø,êPâZ¤™s˜ î„ h ª�‰5 o(aë:uåj·“°C™¨˜h "±Qõëv”'-ó±a:X ,„éî=+^¾(l®¤<ó’§,…nèŠã3ϱ“„Ä)êb ¼t�/ìA9†f mUüíT|œ‚¿Õÿ®D @Ôxƒ8©í–ÐAN&æÌ§—ö‚~îß�Òï½Å¼òÁìW–OkšŒ‹+¦.æ¶äf2H[Ðè#i—Úï˜M¡Ù‰‹XA²&Æ4ñ±X¶B3vY$O¯H1F¯`T«‚F¡s­nˆ ÈP éa)nkkt\S"3ûwª«‘ PÖpÚIãôêðÏëœÐ4òqQ'/¼ðIý»ÕTZy“3h´­$ÒòôV¤ìo+eíñ£»øìiËÓ_ò%,¶…jnÙy¿goÔ%X…ùfláh =`ÑDÕzÑ+¥B)h•œ%¸ãSLHÍPlT¸êK1«ññB"J_5©Ä,~¦âñ*’ù?�öÔúOúõÕoÅXù²Å{¡¾ê ¨õ…É!i!šGŸG*`È»HÖ_`²”´Ý#„It\f©` ìàp‹‘ pu¶'0/A ÒOÂV‰ŒÙ–«ú¸ºÊ i¬ ¶;dß ×-Å'Í ÿZ£ø/ë¡I¤4Ka&êíÎèEù­OûÿüàùðËn"×ij•̇×ùÝë_Ô¿wx=¼|ÀÇ Æ4ÛæQrQ0b0(F…vÓÓïgìn)ÞE)úèHY]HØÝ !AèfÂÖ~äú½Äru/DÔN$?ÓYô4Ú)žjL÷®ª™ …Áz‹h‚b‰Í”%EH0äXXLíÅÀ`±Ø`À¬¨œ3l¾¨b^ úÁÛ–ì;ËÿɵŸÐW>ø5kZ½¨è5ºÐhǶ[–ÇÞh£y3~5 iÄç,ƒ$EÄCK¡×ÀtZˆ¡2bse­ýgu*»H""óáñ?‚ÃèdÑb>úìõs×ìƒ:°VÎ70ýúøáEý˜¯Ãã4å!óˆü]s{’“%sœnéKáÏ”/†ßõúY<Å1’MXP LRܶYýI‡úßOrºÓ7ok¶õ‚5JšB«-핹°yÆÜSL9}´ë2#‘mt²¸$‡žD`©™°µçSËî¡?�\,SI? qÇ» :sXu«©Un©7Ÿ­ÖÔÏ)–B³ƒŒ€e®9Ð�š^´àiËÁ2?~Mù­/"F'Å“¢Ù–.œ9!­>Úì@ÚŒu]Rp)xkkâ¡åжö®ÊZMsdR•ˆMY\;Áð0°dÐZãº:$UÜá˜ðôKàçÐO¡È1­¶óÏMÿºÙÈþ†·É÷èN°Æ'CÿŒþœ…ÇeªO…Oé{ÃgYvIHÄáµd Ïì+˜çÇž~™¿î+Xî¾Â¿Us½r0÷ÿâàËØØ„^³6º=ypiÙ~ïÒ¢¾¾‘éÊh® ãƒA”‘C%òù½©?vö™P'Ïœ‹LRÁ`+•F¥˜€DÏD}ëŒE°uy ƒG€œÊÏ<vÜr5礼֚wÿ– PÖ Öœ8õ—åáWý°y×:i[5É¢×ÊÝBµìd,p™xd‚tº” M[A€$%„ ¶æô×'ñeÁéÆ*m̳¹¾¼÷,\ºáêØ EŽYh¿Â©„§§ÿ±5Í<d|»¾Pýž^v¿)ÜÞ@xÆÌ"¢ý÷<m¼ãp<ÒÃñˆ§o\s¿ž&¬. ì[;]ûp·­w7Ò°ÚÉÌÃy–ÄD†$z[%ÔŸâjËkÓs‹%¬û¸Ïç3R*RKƒ„–€'àðuAÐ;’x­ !$$t Ï Gˆ *ÈwXÿÝ$üƒ1¼hd°ø6yÍëE—Ö7D¢?ÏG‘Ù‡x¹[WÍI*ï¼WÈá#R+j2p ] <¶>àÅQÉ ™³î,S©8xücWü¿züoKCF]çIRƒÿÜö¿dì^ÐC÷q;f__,þ©NÕ¯Õéµd2™†§õñÝð­ýÍí=~ßÓÏsÖ¬Ð4±3-‘u*¨c"¶Jf°V –]rFäLH™R’ТŊôèÒÄ×hÈ­ý÷ÜXRšJ‚à X¬&,ˆk~œpý&ü¡%Ií½þû°zâAŒ´æ!ÄH áÿËEb±ª|Ôñ‹ 3L±¤ÝFå–]7a:*X§d”§Œ¡Šm·Åä·>ü¸ÿГ[¦ÕËf1{§šfêGáKÿ e8Âq¤‡þc:Û_/ó«ªT!0+*¹ºs~ç`$Ÿ-*³SyB+— QLÛ‘ôI%tÆÐ †QHØ×œ‚„S§pƒÃÒ¥É&6èÓ"EñÑ[£­—Yê HIÈÈŽ‹H‚Ôÿ®—ÿ?ª¿˜fóœö{÷RÍëjàjO~a©õu×Á×*KÓ¼—H@«:04´ŸïaL+Ñ<g•IøÄs#Vî…]­nr€¿¹{• »ó÷ó™Ý¹Ýhÿˆ?Øÿ0cƒ?­f}„!0?†}0äƒÖHwcQ~êîeùk ÇÄMA åÐÁØPKˆwÌÕVép6è2À²D“MvØgJÉ´Æ e s„œ””Ê(úéT<$Õ==æ$Z¹#qn‚sæ‘,›$¿4¦r_{¯ke"¸ˆ œ¾èÂGØÉ!i¢WF˜N‡Ð13ÃT2n¼0Âo&„PÂ|Žd¬GEƒ þÿô‡G@õëuÅÿ4IÝû ‡Wwõ†SóɵŽù‘Óm~('ä$Z&§·¸üm>Ò çNp?+œ¥CK xRpŒ™%S<C…¡¨ƒ Ä’ÓÀS¢€’3ÐéBYI´˜¿lŽžfÐ{¯u·ÁßîÜY‹HŠÖÒ/Zã€y=1žÄ¯Û±*}t2E®îÃÙ,~#¨1Oæp·Ç̇H9½ÃÀ"‚ù ùÐ[ŸÐNÃG§|d¯i>xß’ýù>þ<¡vÎ×bŽ�:œç4÷Ê:gµO”Ô²OÀaˆ[Ò‘“˜RQ2¯¹‚E(ëKÉPÚÜylÁ ´LWæ6Aµ 7¶ìŸyOH;BÖ¤{ùI$¨Ob‹7Iã/¨f‘°Î¦0ÚL³µ‰fË itüìåEÔú(Kœ÷ó[¦7‡ÉV^ÞþÂ×ã©_ÇÞLÿgvØ}hÁþ˶øUDZ´Øä4ägu‘žft°ä˜è´' ¸z.Т…�K àqK…¥ÄÖ Yûì#YlÑ4m쉄$]‘ÞÊ·SµÛ’d u!mD5ðö…ÄDÚæöa|[ËçÐîyn짆&²¿‡fZ=Œ K¤Â^:D?ú‘úÏ^þç߈‹s‚ú½B?ô¹=ù+÷çæX£ußiÎp¿ÜÅ9]¡«9-,†–IÈR‹º’à«Úœ°rr¡ "¥¼78,=Dµˆ”³Ž±=I6Y?ó3ººùƒê¼a2Œz¹tãî7½ø,¦žÁª¥ zt�Ó ¤ë0xìbÝ .믌°µ‹4r¨2 è,G« ߘ>qóÓZèßài%Ÿ™…ÅϽBºï=Å€))N ÒKÕÈ1™¥˜4DõŽH˜`¸gO äõ÷ )9 Û 2 �� �IDATG$™±Mš‰a{!‘“§~*XÓÀ•à˸£M ‹Q¥VÔõµv'x‡½ŒŽ¢*¸xÚ܈æuÇ= Ùº‰ú÷Ñp*z²M…Ÿ¶0ç~ä§eöÏÂá³ÿó7jH0'_gîþ'oÔ o?VHhSa™HB‚Á“’«a:-F3rÓ€¼7£Ô„‰‚àè’6–)‹d ê.Ad·È ’«²$éB"ÁÏ:Q•¨Š˜Ú;.R;iDÍR¢Tªº})Át]|èÄÝ_wºÄW°û4açY$í<ŒbÁQW0m¬vÍêƒ?ÌáÅ÷EnYíB˜~ƒ,üÂ2ý7?$gÿÚÛÂCï\eAh‘“’i<+­÷k‚`UH<äÖÒ_X y×Xéãwö(¿ô³ñtŽ×ŠŠŠ@…Ô B$”3¦4‘º™H4°l2|ŒõÞ»EEô–Ë¡,¢åë–Û‚ô˜ÊlLîÅïwï‡t)Ö|*ЍG®†°ûy°wCþ0ª­H1C¦­›ö¡ÿ »ðýïÓ¤›èüéÏêøÓ?‹[Á(àq·^Àth¾úQsÏñ:}ð›Oéò`@‹ IÝà‘º«w« Tk (…wìïîbö0‰!1&ÙÈHP„Fþ• OA ñ”¤Øú7ǵLÔØD¯^þ¯m«¹é+‰¯©HYlêcÜü”s° Ð:Çd5:_PA†— ;Ÿ߄ޛQY7sþ2¿ ÕKàÀOîoHëî×iâ‘îC¯?¼¤ÓÏýÿ8Ì .zNãì½OÈÊ›^É}?zAϬ¯é2!ÜïcªŽJ@=/ ‘xB-áÆ+%ÅÕç‡x¤þ;x<Ž’Š‚’1S–Qlý: J„!ê ?žÿÒÙ»ü/…¥•7`“ïâ(Z;%5˜â°-f‰|ÉVÑ`ë±oAª)ºódwj¼ µ'cÒho‘r=|©vÐêØ»ëSæ¨mÓìuúÅ Õ˜.ôßnÆOÅ´ñuµô¶AãôÙøñWË#ï9«§Ö–ôúÚ2999 )‚ÅÔ•ÙÔ>­;~Cˆr¯úZ®¸ÿêñzÆ6 8‡Ç¨pTÌ)˜1#¥ Q÷c6<p„#Añ:}Áéé÷صõ÷êúÉU³p¯z'xsûŒ :=BËq\ìÖ]`·%a9|žpô°Ù…˜9´¬Crpô˜m¡U r¤a½[ê|i ÉN¢¶#œùûÊcï‡Â¿xáWaúÔ×CfHÉV7eã?z-þȽÜýàRX¤ENƒ,žp‰!­þ–ry}Äè·í `IR…Ô1)‘àhêík%àx<GEIÁ„3&ÜU­K1”8¿sÛP;þÆõÿU’ÞëtqáßMˆoU8ºÓ¿´¡q%”O-â'èÞççÐtd)–… µY³B§×k[V’•øî¥NkæepÏWŸs×/«n¾FtÕXV–,÷ýMõÿÐñä'W_9ø‚R*n3ÄñÑPÄZCõÕ«ÝæÃXÒ^“Ö©ÝÍ%–_u·œÿKòÀC«º”¥biHF†%Qs¼»©åÎN¿Ÿ}žp¼¯ ™³t›}Öî:Ït~@yã*2’†[Ţ¡x<%Ž%m U¿˜1<‚2R ªO&w:BÍ`íÇtpâÛPcpe4Z†ÚâK8¼RêQÓ¹]"ÔAq„–‡ñ{ö4*Í:<c?ÁTGøj\¯¡UûQ,P!Å pK˜»Aé{Ѿ1t°4±ô’„M^ýý†ñ÷*;#ähWÐÑ%•Ò£*cõŒv^q Ÿ«8øT7ÿmVß`Ú ã[ ”¯Œæ³SÜõcçåþן—ûÞÐÍåe–]Z45îøD9îÑY<Š€*”’@‰â±øcžw©ê?pZQ ògi/XènRé>ÃÙ ž¦æØ:'(‚¯U€R¨B©uDðÜ7½®åÓÇ`šýoÕçF%É ®¨Ç¶kpW•0Þ®õ€fôú:3¨Dx5m!É&Ò,u�…b¯öH Šë†‚f¨_Á—“ø h_ ‹×Ç7°´Ih‘²i²¾Õ¤S©<bµvȨWC‰P©Ê¡ñÄáŸþð¡~úª˜\i²pÿ@îyg³oq wgl?¹­OÿFÅðIÀ[²åuøÉsòšïï™Å³3Ýyñº~é£Wô ¿:eô…:»’Ÿ>Ë}?ù󎕾iuQ—¤§MiÔ²ËíôêÅwuZ_ðb%öõ^“àŽÝ«¦„áø'=OY͙ޓ!ä$tX &39­ÈHÉ´½CÕqoQkü¯<'Ó«Û¡x!©ã½Á≿BÒX¾½@î¶�®6žß:á–9dvõÈbTCýÖµ0¤®¬u‚:`<µ¡?ÉÀœŒ¾ç0„ÚåfȲÚüx«ræµ2%!ÆGL]+U,ŠÅ‰è€†ô—rî={rúMéÖº>z®Çæ ©MAf8ÆïzÉþèûgÕ{å?÷˜¼ûÛÃÉ,õ¡|´½W½h?õ=O„¼o[/ÿ“”lðJyëß ßûÎ3á®d>9YMå"ÏDÈRKž ꮘ¢¡n²ÕKZs…M1â³O¥3RM1žªnã(Ž@‰£D™s,M0•„-½AÉœœ@VÛDÒc·p,á)† ôjROO4è­¼5‘xª€«µ€<¾´8­Q"@×ô6ýó_ªEž<î~êVr "…&ª·ìPõ1š*1�È¢üÌ)`¿v¹ÅÅ75N–Ú{+,)YÒ$‹:0I”AQ™2áy&úyrmÈÝò=]ÝÈHë[a4ÇɘàÍý§äÕ¿~Z-ÐwšÚ“xã\d"IÈÏÒ{z]ξ÷$÷òZý¶ÁIÎÐ"#'#¿C¸IÛ¬=ܦyÚR] l}n—ñxDzÜðŒaà uPV•̤œhlRå£ÙM˜OÉI(T(q¾£ÄGe” B“œ¶ælÈnêÛlž6q’8Ã@å¦uü‘ßûWÆImcQñ¾ *wìêŠ!´jëŠs¨D©8$1ÃxƒñžPë~A½ÃCH¡n!³P/¸Ff Ð["RZ«=ÐüFÆ·ní-¬Ì± .±–~¯ËB»Éè`Âl2%hÁ\.2æ Dg¬ð*œ£©½º>ÞªŽÊÄ\ã¢~˜9GœÓojÝË·´Z´ï`ä€ò<WÃóVÎè#ƒ‡y++l’ï÷[ŽÝøÛE,ÍNNçÞó!Yz×;”EAQ¸zéͱA4VyWó÷ÀÌ̦3šÚdåô9B1gº½…)GdÞ0!Ô€ï–3ÐcL™3ÆÒÕ”eèÒà[Ì™Ô}€8A|šƒë7)¿í n†{!ëYTb¹›ïÇ…¢ž³æÖ€ˆ/ò1P¬=o„zv Üj"Y”V´6žBX¯;TY­6„–V̓M]ÒceLî诧Vèv,~ž2œ_ãМR¯°À–y;VI޽òU­ ¥rQ?ÄH¯rš×p7o£A¿N²áøuöÍ%ž ŸÂãXæxkœ%§q Ô„Û&Ž[‡•–EÀíAZ(Ü Ý×7O 8ºóbŠÑhܬj€©µtãk_j`:3z~Ÿn·O¯±Â,X¦êé…8í3Äãj¡Ç×A`Æz¤tIÙ`…#rfᨨpŠóÑ­÷Í 7ï°…kÁáµAwý]¤­“qÇJ�³È÷«iMéÊIj[7Mmãx¹¥Ö.a]ˆôQ‡õÞ0FXÂШÝoqúV­·w0æ[>7©—3xÇÁþÃÑEFþ)ÆîIZ,sJ¾“®n’ÕAÄñBÅXpÄ‹ü.C½Ìpžo£Iï}Ûz7W2ä‹ú!ÆÑg… ¼‰ÜKBV´/wâË7 ÃÃ7þHi\SÌšg4,u˜í5(GsŠù3ÕZÑÓ;ø¼¯3‚g¦Êt8戜¾iÒb‰9‡tê»rˆ2gNEY½˜ÝFZ¤ Èh’‘УbJÅœ?6ׯü±ßù­©ò1 ÐùäÓrtã÷Xºû¯ªÖ;¼"å,“iÛ±-¸!*¬$¸[H_oëÖêu­$Õ�=ÄžCÝç£>ìûzXlø0­waCÇ^k#5&Œ8ô—(ü3$–xŒµÆäz‚P¸c¤}«æZ„ Wù(úÎpŽ·ÓbpL¸äŽI™—äÙ ×II8Ë#œä,Y-Çêñn¿sçûš†ö®—T×'‰§@%(,§ÛhÑj4hhÓoô™íMíì#e ¨Ë«…Ü€gŽ2eÆ4LТKO‚cÊ@:TZÖ,b^†€­ƒ`LB—”N]�wì,ün¸øÏÆø/|…éàPèþå_”Öò»Èû§Pê�í@¶ŽšØø¸1&Td‰Å—¡nÿúhçÓ óÚ^g€6Á>ò¥8Ãp¡‡aC†¡]/Â0Ns„Ç×£PI]ýbUHIXäa6g¹ÿ® &û ®½<©å9KÁSrMþon†OÒf•{x}ÎÕþì©…œmóy^ˆA8Áœãµu ¸šOƒÇÖÕøn*c†ìs}½ÎˆCæŒQõ$$X„l–Òœe4i0¸ÑeÉô8Ù_caiþQ‡ÑlŸ‘ð”T8<Šg LÓ£É2`O·éJ«}fL9dÎŒy]bqmÖùu,³ù‡õ…_{RwI£óÆÃ]qQ.ÿ«üœŠmà¦0¹í{�‹I„baŠº9yšbÚ ³£)ž[6ðøC°qáƒÔ—Aå4È è•z·ú­v²;F“zßNªú9`iÑ!ç4Xgc°ÉæÉ;7 v¶ê±ñh†mDz/Oq#|”Œ§y =ÎÕÌÕ>mƒRÉ„çõ™3a™MNË#tt¹Fì‘fšúÅ ›0a‡—Ùâ»\§dNFJ‹ :´iÑ$''­‹™2£âJØâæÁ6-2ÖíK2`Qi²Öu;PQðÌfL™2eY»,É2»ºÌY¡Ã!; õ†ŒŽæ¸9Jñ7ötò‰-}覎?îÐÃ?å|€P…áõ_6ÅoÕþÉo!8˜\‚ù![F’^ þ ÔMÀWœ:9à†ŒøÙ%Ð)TÛÀ…Èó@€ØGcëŸY�—M †&ЦZÚã÷Yt¹Ç¤–Ñ"3Mfá‹Ï!SxrÇÀ„˜”#ù</ùßÁ`8Å7q‚ÇGQSG‰=2Q^ä£ìè‹ät9Ãclè}€P1«KQ”v,)аËM®ñ,×x92Rº,Ð¥Ï"‹téÒ¡M“M2Ò:,£([ÔŠý˜«~l³@‹5Yg•œ„}öØ­+½Ç1A3aÊ„U°Â 7ñ&,JªOÊî³ lŒû|´[kuçŽÿSˆ@5Œõय़•¬uV³Ås¸aråÿmïÜ~,¹®2þÛ{×åTkŸ¾MOÏÍ3ž±ã8‰8 ‘P^#ñ„ïˆ'$þÞx!)<$D„" 8& ljc;vìñØÌÅsŸ¾÷¹Uª:uÝ<Ô>§{‚œÄŽ’(-ÕôE­>š³¾½öÚß÷­µAõŒITÔ£]g;Äáþ“}ÙáÎà"áø%3Çd·žÛªuXÍÉ x¬=È_R*¶¨°Íáh hšªßA™£L µ±± $”UN\efUj#‹J£­I:EÂw‚¯�9'Å'8m?ƒÌJ¢š‚FÎA2àwô+X8lð›<…k\÷Ù¢±BbSRpÈ6wy“1;”äxtèÑc‰%z,×�mZ²+mmaK¬4¢¬¥[­kj'aʈBÆÜb‹.+ti­5{ì“@BLDLNŸŽè눱,Ã竇½2¿‘äÿ»èÝGÄ”ùeIí³Z Ð.¢q1;DÇAÔ¡R§è.õ¹p¾AgL¶¾GU&µG@\�Ú† ÂôP“>º Õu›zföiiV"Çza÷ÀÎSŽ„¹qÈæ –K"±…ÃJ¯AîÞá­É—Iô>kâi>Üý v¾DVÆTæu-,l\b¹Á×Ù¡Ïi.ÈßdM<F¡gä$hJ, (¡8ä>wy‹[hÀ§Å+¬²É*,‹UÖ½ ÚVO5PHÊ*¯]×°„…‹K›&=:øx@E@DÈÉ’h!¨˜2%&aFFÊŒ” A—;r|³ºú…„òÞ{=Ô5­æÉºÊJáö>IU8Âê!¬:ºgÜ=XëdÅ*çÎzlnøÜ¿ñ"i41‡£õúYÔsbHCånc$¹I‹…I³ó¬2½­ó×üؤ‡Ü|_,:ä66¶]1,¯q-øWb}À æCÝß¡­NLcJ¦F€Qx–O)§\«žeÀ-šô9¯žá’ÿq²¬U+CLy¢‰«\ª;Üå*‡X(|ÚôXc… NÈ Î¶79Ñ]¥È4ñ,dšO˜–S=aª"]‡7"$%&%¡¤D!iѤK)3&L©Èé ‡1c†LˆMÁ7cFJŠ‹¢-<û-îßÙeôâ{•2Õt.çÓ«BW}Ñhýº.´À?ˆ j{-2y¥|.^ôÙ¾õãƒmsyO8[Kµ8– E\9@ Á�ÁÔx®ˆ— ýØûøSÊX˜Äl#q(™2ª®°_¾@Θ'9kšç,ãqDÎ M†Dá ›^_q#y‘=} ÅøpïU› ›P#¾ßaXmq¯úBH |:,±Â:kö:OlžÆ*Ãñ”0›0%&$6MÍ1!ѱÏ3J2l¬Eá(ЄDää´°€’!“’™R±¢ECÎdâ^Ѿ\ÕlÛO�ÐzF|] ×Q<EåØÒê¢g[†¾ŠÑö“ŒG6Yáá9‚Ý»¯02Y W»š³„Æwˆ… dÙìS‘ÙŽR{-™¦#¾Z¤{…‹eÞ¨Œm&|«TÄtxŒu>A_]"žeä:4«YãIŸþ’ÇÛ“Ëì”ß§¢¢Ç).5ža³y†ýј” Pàá³¾ÔeÂ7gWÁwñéÐg…“œîžâC7F»ƒ!A5"d@Șˆ‰ ~h‚?%2ßGL 0fBÀ”œ Ÿ6m,”GŒÅH Ë7¹µ;cæg¤r®ýƒ¶%—_Õ·¾Q?=�j”¤áw(ã‰ÕoHg½A ª¼¦‹Õ:¥î2™„\f6¹I™ŒIÔ6jÀÜ 4ï¯÷r…ÄC™Ž·ºÈ~ Q-ó ×n…‹B>ì×HÙ4>k¬ð4mCWš\‡”ÌTØ4p¥Ãnvƒ­â5r|z¬‹'8ç=M0™逊6.kþ2‰˜p+¼NȰ¶UãâÓ¥ÏINú'¸ôø{böCBDŒ‰™2%gfhÞÂp Å‚ÈM‰™1ejÀ0%$$ 'Em|,$) /Ë·_ÿ/ýê^p„ú†VNfUTz_Ž\­îÿ}Q¯À÷��UB¼D²ÿ†€KÂZÚÔ¥qp3Ë…OœX­)“kF 6‚ËF‹Ñ–GìEÅŠ.ÏBÖÈÀö±1  ‰¦ä€”‡Ì¸Gɺ½j%ž¤ËE©s,\|Fúvª×Éáà³ÌYNŠbÓrHF€…¢+úä"ã~| h “ø{¬²aŸäìê;÷Âcv ˜ßµiš¯OŸ%–Ì¿mšxX(4%!&Œ™0aB@H„Bâ‹.‘ˆy]\¿þ¦~ç¯Cf¯î1þR(¢­yº+ÆÞÐ÷þvDüÒ{­~œûJòàÙjð{¢ýÔßkõw5ZR܇ø%ðÛä¥@ŠÇAn@õ�A_jªy&8RôŽfZÉí«è!ˆ"˜/NÊHÀÒKÆ„”¢ ©HP¦žnsžç�H™P ¨° ÏpŸÞ6Aöi±Ê2qi–$ Q€Ç2)‡Ùm"µŸ—&-–é²FÇ^f{/f˜ï2å€Ô�§E‹UVéÉMíÓÐÆÆ|ÒOeøÃ”˜€=¶Øf‹-¶Øa›3<ìÓfÄ!gô&§X¦«—8+7W¨FA”»zòwû„_DcUTS³Oò>f€ã;B~@6zQçc(ÿ B Ê ÖõÕQÆßÅŒ1’o·ÀbŽFvÅH•b†:4ŒÈ5­‘󶦄Š)š #´û©P¸ôhr†§Q4(˜S§òšDj‘2`Ä R€Æ£GŸs,s’”˜C49-–PØŒÙ&dŸ’ …¢G“=ÖéÊ>EžrXn1à -Úœàgü3|äÂyVídb#«ÂjáT8Xx8´ðéÓceú´Ðäl³Ã¡0&"6ˤA!3ïyý½/¥»Gs)t¦Ñ3ŽÝHúÁ��@C²ÁP%Vû#éQŒ¢b )û5\˜Z€áº€½8ï«ÅVP0T†õ«yê¢0E03}° ÚôÄלË2-6ñ9Â"gLΒĤý&)Bn3ãÐØxô8à !‘DìÒ¤ƒGÀ”æÔP§þ6]Vé°ŒÖ%{ÜgÀ›œå¢û$O?Ëé‹=&û3ÊÒŒ"]¸�Ž?‹êiætir[Þ=«ÿûãÛì}½ÕùL§ëYQÒ°õ­êµŒ™ýÔcs~2�ÔZoB¾ ÊøPþÇ¢G•dM¡Ö!» :5Vº ö Ò4Åß|ÚUµh‰Ì]=屟åHsæŸó�ÂpõJrpèà±NƒeŠ‚ Êc+?gBÄC2Æh l<z¬pm"êÔïÑÆ£IÌ€˜!3c«²MøWè°‚@3b›hÒä —XS§h;-Ò8eÿΔ4,c­ä¢k÷ÑžŸy‘{dêN)˜qMܼñоòW1ÉÛ#=¹\’ö…OÄÄ*“yþruõóéOfx}?�°�BE]!;ü¦@÷!^eàCC –ëŒP<4äM ë‹•Å~ä?�‚#Rè8AT-„…‹C›˸t€‚Œ!)û”ĵ^€OΘ„r&F3Wøôèp†6ḵ‡KŸ#b†æÔ ±qqñh±D‡e$‚î²Ë N³Éy|š]‘æ1iZ¢«ù‰Eßâܽ(þ»AP_‡ZOÌ”—yí•«\ÿg *(‡ÂÿŠñÕ±“7õ¯ì3þ·÷‚¨�� qŸbôÅáWEñð&åaÑè!ÏÖ kåžIw3`dæV¸ “†4ǽG_6p¾Ú+’£ó¿M…kôµC2T¤XøX8D¤ Í) @!qhÒfƒ6'(˜2e 3Ææ8*‘¸øxth±Œ…EÈ.9«b“>«‹Yz±¥Õ,‡-,š~ƒ^¯IÃr¹@hÀ8>àµ.lk·ßDL¸,¾óõ[úÞWªy]%¤×Lž~K¿ORï��t†Îv©&/RÜùùÍ¡+ŸÖn=gpÄ|<¦æ�HÌÊ—‹U/é??¶ê«cÅ"Æ"jcá™â°fζLaW „mŽ¡QÓs&«´Ù0,Û}$1©)ë×­•.-–pp˜r�”¬°†oì–•á(Žx ‰k½%.=³Êéßjâ㦔ùÑøÇÅÜ8cwó틽â9ñÚÓÃï¾ÛjûqªüŸ!�á RôäUŠëWÐÉ!ϬK<©«pñ֌К#_n‚ÁñLP›‚7/!51ÌØ£ 6[BË¤ÔˆŠ„ŠÔôÕI,x´i±†�¦l69 ¹á)êê¢aØy ›#,MÚÔ“ƒkoïÑ”>i^GâHE¯ÛÂõ%·BvoÌ¢™Ùãsrj'Of¸üÜ|=#➸=zŽo}!bzëgÑ»üÿýÆYäé?êÉ?¥§tY+€µP˜©–,N`±ŒM ×¼•Gõ‚8 3rnjVv­è)c=Ó|µa„ä&-V±ñÉÌqÏ2ü:‹ŒƒÑ-†ÂññÉ™¢(iàa™Vîšž²±Ì‘®nʰÍ× WÚõ_¯j=£$%©ìVƒ.*,c\‹C¾Áå¸\½ðç9ùà�Ç^FzˆÎï qî4þÇÑîI´Ûœ[ª…YsõÞ]·„Y‹ Ê…wþˆÆt Ìûæíù ¥ùÊ Ÿ,RÐ̦.ql×upñiÒÁÁ1ÙEã`›MÁ2Á¯ƒn›Ÿ9XÆõ#ñ» '!!`,wË7xå­;úÆ›#ö¯Oôd+fz7¯Ý3•€žDØ%Õ­ŒlW×wˆòK€Gz)}pÏwZŸ¬~üupš[ lKàESX´°i€X48Ï·iVëQe}|fæ¼óÖ¡G‡‡¦&·Žqó)Ü6M\Z¸¦ˆ”بZj^�À2YÅY�¡&z@“‘“PŠDÅöôe._þnõí¿H™Ý®¹ú=†Gÿ²à]škQ' ñQðNKÚOIÖ“tOIÚí–¢!¥aŽ£„éÆ9bXÆysµÂÁ¥e `‡”ĦˆTÆq4·œÔ¦M,¹Ñê´îÌݦÿÏ1™ÅÆ6¯]wùä"$Ãwx뛯Ußýüˆñ·5åÏÝŒÁÏ݇°œ·²��´IDAT@6ë‹ÞìžÀ»¨Xú´Åò36«[´úІ¥Kµ XçgîºÚ·pp±P$$ì (MÈ{†z÷nàâ9¡±hãÐÀ6¿a›5?ßû-*R—‡Üìsw3Žqðö¡Þ{i¤Ÿ˜Þ+ߣ4û+�üÈô'=÷k+ŸµYû—µXtÜy 3v,s|S”"Î#}ÿfÊÐuX:ï` ‡&¶Ñ³–mäzÆî”Œ1 ×xy]€šU¬“½¤"Ay«¯?o?»UÝúÚŒé÷5åìgµÿ’à‡ÂÕ”4?fÓûŒÃÚï9t6,Z]…%$*­D2œé­W§ÜûbNxE¢ÖZlþY›3ŸkÐ[uð…ezz•°µÐe‘ˆÃÛn¿žë íqêSVÏ4h)W4ð„ÂÒˆ2ωö§bp¸§ï¼¶§ïþË”Á‹%ed.I~—·Uÿ �ì‡êKœÓ’ƪaÔ’Št¿$½;ïç7Äuèüv‹“Ú »fÓôlá®gŒ¿è­Ÿ²ÿ|IrS#¤ƒ÷”G÷£6M…Ýwp…ºH¿•èàfJü°¤Ø{4还ÿ ’JåøÐí����IEND®B`‚�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/flower.png���������������������������������������������������0000644�0001750�0001750�00000001462�11701304107�020046� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���������ísO/���gAMA�† 1è–_��éIDATxÚm“MhTwÅÿñ½ùR3/ãÌ›d"ãKÒÅ€‘D‘DcœJ‘Aƒ‹ nŠ´Ji]‰  Š+.DPA²(]tÓU»üè$ RFZDÖOìÄ’8yÉ8óòæ}L湈 ½ËË=ç\î=GÜ»4ÄgkÇy¯#ÕÅìoߊ¼¹›LøîgÇ$€‚/Ë:%æýßtM“Ã�¼ê;ëu–+t þ@(äÚ•‹ ÇŠûN†~…À²,ï»oŽ Ë~\× nÖÙýåW«j¥7%ýû”UóŽlÎ �騋±´HéM‰¶ö6ŒÒ Œé Œ¹'oÑí “Cµ,³Ó“„~â‰(0€¸záœg7<Zb †ú·Y¸üaוq¬ /-ÐFè<ˆcÙ�ü~ãW¶{B:üýq"­ ²ì§ô÷(Èî'‡rm˜ýó/”ž=¤{úp]Ç“øñq›'•õ9�bªJ£l!`íúàªúük ©e]§4=Éí[9¢­ë‡Fö{í •'ÏO¨<ûåîÛ �K5‹òF”#¬ÑÒܺyž¾@Ÿ×Ùºu >€ZÝ&žP …Chûγ¼aÅçAJ3 ËJ7±CGé;0‚cV™¸“GŸ×Ñ´Õv¤´¶‰-ýC„Â!dÙÔ’¤Ñµ‡É‡L&KçÝD”‘V…ªÙ@ÓR$Ûâ´'T¾î. i8ùDÜ›Ùè_>Cö¯å‰1FGG©Tª´(*ý»v ‡¨›uŒj€Sƒ55ˆ½+Fš›™âô™3,.¾cjj�5¡’ËQ­è$S]UƒÜX³nA�–m©àËöÍQ7m*• ŠÒBgç&âñ8ÍFƒ›cw˜|ý3�ëÂa4-µúÞ©·9Noa6ÓÞÒ; p r@FÆÉ„¤¯#™ n®hsº[@ñc˜ ¾,®×DÚ‚(«©»ï¨|YŽõŒ‹Ûåm Ç~€)ø²ô6Çx%%½ä¬n����IEND®B`‚��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/demo-fifteen.rb����������������������������������������������0000644�0001750�0001750�00000012226�12257552167�020753� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- indent-tabs-mode: nil -*- =begin header demo-fifteen.rb - Canvas test rewritten in Ruby/GNOME Rewritten by Emmanuel Pinault <seatmanu@yahoo.com> Original Copyright: Author : Richard Hestilow <hestgray@ionet.net> Copyright (C) 1998 Free Software Foundation 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. =end class CanvasSampleFifteen < Gtk::Box PIECE_SIZE = 50 SCRAMBLE_MOVES = 32 def initialize super(:vertical, 4) border_width = 4 show() alignment = Gtk::Alignment.new(0.5, 0.5, 0.0, 0.0) pack_start(alignment, :expand => true, :fill => true, :padding => 0) alignment.show() frame = Gtk::Frame.new frame.set_shadow_type(:in); alignment.add(frame) frame.show() # Create the canvas and board @canvas = Goo::Canvas.new() @canvas.set_size_request(PIECE_SIZE * 4 + 1, PIECE_SIZE * 4 + 1) #@canvas.set_scroll_region(0, 0, PIECE_SIZE * 4 + 1, PIECE_SIZE * 4 + 1) frame.add(@canvas) @canvas.show() @board = Array.new(16) 0.upto(14) do |i| @board[i] = Piece.new(:parent => @canvas.root_item) @board[i].setup(self, i) end @board[15] = nil; # Scramble button button = Gtk::Button.new(:label => "Scramble") pack_start(button, :expand => false, :fill => false, :padding => 0) button.signal_connect("clicked") do |button| scramble() end button.show() end def test_win 0.upto(14) do |i| if @board[i].nil? || @board[i].num != i return end end dialog = Gtk::MessageDialog.new(:parent => parent.parent, :flags => :destroy_with_parent, :type => :info, :buttons_type => :ok, :message => "You stud, you win!") dialog.set_modal(true) dialog.run dialog.hide end def piece_enter_notify(item) item.text.set_property(:fill_color, "white") end def piece_leave_notify(item) item.text.set_property(:fill_color, "black") end def piece_button_press(item) y = item.pos / 4 x = item.pos % 4 move = true if (y > 0) && @board[(y - 1) * 4 + x].nil? dx = 0.0 dy = -1.0 y -= 1 elsif (y < 3) && @board[(y + 1) * 4 + x].nil? dx = 0.0 dy = 1.0 y += 1 elsif (x > 0) && @board[y * 4 + x - 1].nil? dx = -1.0 dy = 0.0 x -= 1 elsif (x < 3) && @board[y * 4 + x + 1].nil? dx = 1.0 dy = 0.0 x += 1 else move = false end if move newpos = y * 4 + x @board[item.pos] = nil @board[newpos] = item item.pos = newpos item.translate(dx * PIECE_SIZE, dy * PIECE_SIZE) test_win() end end def scramble srand() # First, find the blank spot pos = 0 0.upto(15) do |i| if @board[i].nil? pos = i break end end # "Move the blank spot" around in order to scramble the pieces 0.upto(SCRAMBLE_MOVES) do dir = rand(4).to_i x = y = 0 if (dir == 0) && (pos > 3) # up y = -1 elsif (dir == 1) && (pos < 12) # down y = 1 elsif (dir == 2) && ((pos % 4) != 0) # left x = -1 elsif (dir == 3) && ((pos % 4) != 3) # right x = 1 else redo end oldpos = pos + y * 4 + x; @board[pos] = @board[oldpos]; @board[oldpos] = nil @board[pos].pos = pos @board[pos].translate(-x * PIECE_SIZE, -y * PIECE_SIZE) pos = oldpos end end class Piece < Goo::CanvasGroup attr_reader :text, :num, :pos attr_writer :pos def initialize(*arg) super(*arg) end def setup(app, i) y = i / 4 x = i % 4 translate( x * PIECE_SIZE,y * PIECE_SIZE) Goo::CanvasRect.new(:parent => self, :x => 0, :y => 0, :width => PIECE_SIZE, :height => PIECE_SIZE, :line_width => 1.0, :fill_color => get_piece_color(x, y), :stroke_color => "black") @text = Goo::CanvasText.new(:parent => self, :text => i.to_s, :x => PIECE_SIZE / 2.0, :y => PIECE_SIZE / 2.0, :width => -1, :anchor => :center, :font=>"Sans bold 24", :fill_color => "black") @num = i @pos = i self.signal_connect("enter_notify_event") do |item, event| app.piece_enter_notify(item) end self.signal_connect("leave_notify_event") do |item, event| app.piece_leave_notify(item) end self.signal_connect("button_press_event") do |item, event| app.piece_button_press(item) end end private def get_piece_color(x, y) r = ((4 - x) * 255) / 4; g = ((4 - y) * 255) / 4; b = 128; return sprintf("#%02x%02x%02x", r, g, b) end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/table-demo.rb������������������������������������������������0000755�0001750�0001750�00000020561�12147676243�020426� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # goocanvas/demo/table-demo.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "goocanvas" DEMO_RECT_ITEM = 0 DEMO_TEXT_ITEM = 1 DEMO_WIDGET_ITEM = 2 def create_demo_item(table, demo_item_type, row, column, rows, columns, text) case demo_item_type when DEMO_RECT_ITEM item = Goo::CanvasRect.new(:parent => table, :x => 0, :y => 0, :width => 38, :height => 19, :fill_color => "red") when DEMO_TEXT_ITEM item = Goo::CanvasText.new(:parent => table, :text => text, :x => 0, :y => 0, :width => -1, :anchor => :nw) when DEMO_WIDGET_ITEM widget = Gtk::Button.new(:label => text) item = Goo::CanvasWidget.new(:parent => table, :widget => widget, :x => 0, :y => 0, :width => -1, :height => -1) end table.set_child_property(item, "row", row) table.set_child_property(item, "column", column) table.set_child_property(item, "rows", rows) table.set_child_property(item, "columns", columns) table.set_child_property(item, "x-expand", true) table.set_child_property(item, "x-fill", true) table.set_child_property(item, "y-expand", true) table.set_child_property(item, "y-fill", true) item.signal_connect('button_press_event') do |item, target, event| puts "#{text} received 'button-press' signal at #{event.x}, #{event.y} (root: #{event.x_root}, #{event.y_root})" true end end def create_table(parent, row, column, embedding_level, x, y, rotation, scale, demo_item_type) # Add a few simple items. table = Goo::CanvasTable.new(:parent => parent, :row_spacing => 4.0, :column_spacing => 4.0) table.translate(x, y) table.rotate(rotation, 0, 0) table.scale(scale, scale) if row parent.set_child_property(table, "row", row) parent.set_child_property(table, "column", column) parent.set_child_property(table, "x-expand", true) parent.set_child_property(table, "x_fill", true) end if embedding_level > 0 level = embedding_level - 1 create_table(table, 0, 0, level, 50, 50, 0, 0.7, demo_item_type) create_table(table, 0, 1, level, 50, 50, 45, 1.0, demo_item_type) create_table(table, 0, 2, level, 50, 50, 90, 1.0, demo_item_type) create_table(table, 1, 0, level, 50, 50, 135, 1.0, demo_item_type) create_table(table, 1, 1, level, 50, 50, 180, 1.5, demo_item_type) create_table(table, 1, 2, level, 50, 50, 225, 1.0, demo_item_type) create_table(table, 2, 0, level, 50, 50, 270, 1.0, demo_item_type) create_table(table, 2, 1, level, 50, 50, 315, 1.0, demo_item_type) create_table(table, 2, 2, level, 50, 50, 360, 2.0, demo_item_type) else create_demo_item(table, demo_item_type, 0, 0, 1, 1, "(0,0)") create_demo_item(table, demo_item_type, 0, 1, 1, 1, "(1,0)") create_demo_item(table, demo_item_type, 0, 2, 1, 1, "(2,0)") create_demo_item(table, demo_item_type, 1, 0, 1, 1, "(0,1)") create_demo_item(table, demo_item_type, 1, 1, 1, 1, "(1,1)") create_demo_item(table, demo_item_type, 1, 2, 1, 1, "(2,1)") create_demo_item(table, demo_item_type, 2, 0, 1, 1, "(0,2)") create_demo_item(table, demo_item_type, 2, 1, 1, 1, "(1,2)") create_demo_item(table, demo_item_type, 2, 2, 1, 1, "(2,2)") end table end def create_demo_table(root, x, y, width, height) table = Goo::CanvasTable.new(:parent => root, :row_spacing => 4.0, :column_spacing => 4.0, :width => width, :height => height) table.translate(x, y) square = Goo::CanvasRect.new(:parent => table, :x => 0.0, :y => 0.0, :width => 50.0, :height => 50.0, :fill_color => "red") table.set_child_property(square, "row", 0) table.set_child_property(square, "column", 0) table.set_child_property(square, "x_shrink", true) square.signal_connect('button_press_event') do |item, target, event| puts "Red square received 'button-press' signal at #{event.x}, #{event.y} (root: #{event.x_root}, #{event.y_root})" true end circle = Goo::CanvasEllipse.new(:parent => table, :x => 0.0, :y => 0.0, :radius_x => 25.0, :radius_y => 25.0, :fill_color => "blue") table.set_child_property(circle, "row", 0) table.set_child_property(circle, "column", 1) table.set_child_property(circle, "x_shrink", true) circle.signal_connect('button_press_event') do |item, target, event| puts "Blue circle received 'button-press' signal at #{event.x}, #{event.y} (root: #{event.x_root}, #{event.y_root})" true end points = Goo::CanvasPoints.new(3) points.set_point(0, 25.0, 0.0) points.set_point(1, 0.0, 50.0) points.set_point(2, 50.0, 50.0) triangle = Goo::CanvasPolyline.new(:parent => table, :close_path => true, :points => points, :fill_color => "yellow") table.set_child_property(triangle, "row", 0) table.set_child_property(triangle, "column", 2) table.set_child_property(triangle, "x_shrink", true) triangle.signal_connect('button_press_event') do |item, target, event| puts "Yellow triangle received 'button-press' signal at #{event.x}, #{event.y} (root: #{event.x_root}, #{event.y_root})" true end end window = Gtk::Window.new(:toplevel) window.set_default_size(640, 600) window.signal_connect('delete_event') { Gtk.main_quit } vbox = Gtk::Box.new(:vertical, 4) vbox.border_width = 4 vbox.show window.add(vbox) hbox = Gtk::Box.new(:horizontal, 4) vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) hbox.show scrolled_win = Gtk::ScrolledWindow.new scrolled_win.shadow_type = :in scrolled_win.show vbox.pack_start(scrolled_win, :expand => true, :fill => true, :padding => 0) canvas = Goo::Canvas.new canvas.set_size_request(600, 450) canvas.set_bounds(0, 0, 1000, 1000) scrolled_win.add(canvas) root = canvas.root_item create_demo_table(root, 400, 200, -1, -1) create_demo_table(root, 400, 260, 100, -1) create_table(root, nil, nil, 0, 10, 10, 0, 1.0, DEMO_TEXT_ITEM) create_table(root, nil, nil, 0, 180, 10, 30, 1.0, DEMO_TEXT_ITEM) create_table(root, nil, nil, 0, 350, 10, 60, 1.0, DEMO_TEXT_ITEM) create_table(root, nil, nil, 0, 500, 10, 90, 1.0, DEMO_TEXT_ITEM) table = create_table(root, nil, nil, 0, 30, 150, 0, 1.0, DEMO_TEXT_ITEM) table.width = 300.0 table.height = 100.0 create_table(root, nil, nil, 1, 200, 200, 30, 0.8, DEMO_TEXT_ITEM) table = create_table(root, nil, nil, 0, 10, 700, 0, 1.0, DEMO_WIDGET_ITEM) table.width = 300.0 table.height = 200.0 canvas.show window.show Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/demo-features.rb���������������������������������������������0000644�0001750�0001750�00000011401�12257552167�021143� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # goocanvas/demo/demo-features.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class CanvasSampleFeatures < Gtk::Box def initialize super(:vertical, 4) set_border_width(4) show create_canvas_features(self) end private def create_canvas_features(box) instructions(box) root = frame_and_canvas(box) parent1 = first_parent_and_box(root) parent2 = second_parent_and_box(root) big_circle_to_be_reparented(parent1, parent2) a_group_to_be_reparented(parent1, parent2) end def instructions(box) label = Gtk::Label.new(<<-EOT) Reparent test: click on the items to switch them between parents EOT box.pack_start(label, :expand => false, :fill => false, :padding => 0) label.show end def frame_and_canvas(box) alignment = Gtk::Alignment.new(0.5, 0.5, 0.0, 0.0) box.pack_start(alignment, :expand => false, :fill => false, :padding => 0) alignment.show frame = Gtk::Frame.new frame.shadow_type = :in alignment.add(frame) frame.show canvas = Goo::Canvas.new root = canvas.root_item canvas.set_size_request(400, 200) canvas.set_bounds(0, 0, 400, 200) frame.add(canvas) canvas.show root end def first_parent_and_box(root) parent1 = Goo::CanvasGroup.new(:parent => root) Goo::CanvasRect.new(:parent => parent1, :x => 0, :y => 0, :width => 200, :height => 200, :fill_color => "tan") parent1 end def second_parent_and_box(root) parent2 = Goo::CanvasGroup.new(:parent => root) parent2.translate(200, 0) Goo::CanvasRect.new(:parent => parent2, :x => 0, :y => 0, :width => 200, :height => 200, :fill_color => "#204060") parent2 end def big_circle_to_be_reparented(parent1, parent2) item = Goo::CanvasEllipse.new(:parent => parent1, :center_x => 100, :center_y => 100, :radius_x => 90, :radius_y => 90, :stroke_color => "black", :fill_color => "mediumseagreen", :line_width => 3.0) item.signal_connect("button-press-event") do |widget, event| on_button_press(widget, event, parent1, parent2) end end def a_group_to_be_reparented(parent1, parent2) group = Goo::CanvasGroup.new(:parent => parent2) group.translate(100, 100) Goo::CanvasEllipse.new(:parent => group, :center_x => 0, :center_y => 0, :radius_x => 50, :radius_y => 50, :stroke_color => "black", :fill_color => "wheat", :line_width => 3.0) Goo::CanvasEllipse.new(:parent => group, :center_x => 0, :center_y => 0, :radius_x => 25, :radius_y => 25, :fill_color => "steelblue") group.signal_connect("button-press-event") do |widget, event| on_button_press(widget, event, parent1, parent2) end end def on_button_press(item, event, parent1, parent2) puts "In on_button_press" parent = item.parent item.remove if parent == parent1 parent2.add_child(item, -1) else parent1.add_child(item, -1) end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/demo.rb������������������������������������������������������0000755�0001750�0001750�00000005465�12257552167�017347� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # -*- indent-tabs-mode: nil -*- =begin header demo.rb - Canvas test rewritten in Ruby/GooCanvas Rewritten by Emmanuel Pinault <seatmanu@yahoo.com> Original Copyright: Author : Richard Hestilow <hestgray@ionet.net> Copyright (C) 1998 Free Software Foundation 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. =end base_dir = File.dirname(__FILE__) src_dir = File.expand_path(File.join(base_dir, "..", "src")) lib_dir = File.join(src_dir, "lib") $LOAD_PATH.unshift(src_dir) $LOAD_PATH.unshift(lib_dir) $LOAD_PATH.unshift(base_dir) require 'goocanvas' require 'demo-primitives' require 'demo-arrowhead' require 'demo-fifteen' require 'demo-features' require 'demo-events' require 'demo-focus' require 'demo-animation' class GooCanvasSample < Gtk::Window def initialize super(:toplevel) signal_connect("destroy") do |widget, event| Gtk::main_quit() end signal_connect("key_press_event") do |widget, event| if event.state.control_mask? and event.keyval == Gdk::Keyval::GDK_q destroy true else false end end set_default_size(640, 600) notebook = Gtk::Notebook.new add(notebook) notebook.show notebook.append_page(CanvasSamplePrimitives.new(false), Gtk::Label.new("Primitives")) notebook.append_page(CanvasSampleArrowhead.new, Gtk::Label.new("Arrowhead")) notebook.append_page(CanvasSampleFifteen.new, Gtk::Label.new("Fifteen")) notebook.append_page(CanvasSampleFeatures.new, Gtk::Label.new("Reparent")) notebook.append_page(CanvasSampleEvents.new, Gtk::Label.new("Events")) notebook.append_page(CanvasSampleFocus.new, Gtk::Label.new("Focus")) notebook.append_page(CanvasSampleAnimation.new, Gtk::Label.new("Animation")) # notebook.append_page(CanvasSampleRichText.new, # Gtk::Label.new("Rich Text")) # notebook.append_page(CanvasSampleBezierCurve.new, # Gtk::Label.new("Bezier Curve")) show end end canvas = GooCanvasSample.new Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/demo-animation.rb��������������������������������������������0000644�0001750�0001750�00000014226�12257552167�021314� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # goocanvas/demo/demo-animation.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class CanvasSampleAnimation < Gtk::Box def initialize super(:vertical, 4) set_border_width(4) show create_animation_page(self) end private def create_animation_page(vbox) hbox = Gtk::Box.new(:horizontal, 4) vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) hbox.show start_button = Gtk::Button.new(:label => "Start Animation") hbox.pack_start(start_button, :expand => false, :fill => false, :padding => 0) start_button.show stop_button = Gtk::Button.new(:label => "Stop Animation") hbox.pack_start(stop_button, :expand => false, :fill => false, :padding => 0) stop_button.show scrolled_win = Gtk::ScrolledWindow.new scrolled_win.shadow_type = :in vbox.pack_start(scrolled_win, :expand => true, :fill => true, :padding => 0) scrolled_win.show canvas = Goo::Canvas.new canvas.set_size_request(600, 450) canvas.set_bounds(0, 0, 1000, 1000) canvas.show scrolled_win.add(canvas) items = setup_canvas(canvas) start_button.signal_connect("clicked") do start_animation_clicked(*items) end stop_button.signal_connect("clicked") do stop_animation_clicked(*items) end end def setup_canvas(canvas) root = canvas.root_item # Absolute. ellipse1 = Goo::CanvasEllipse.new(:parent => root, :center_x => 0, :center_y => 0, :radius_x => 25, :radius_y => 15, :fill_color => "blue") ellipse1.translate(100, 100) ellipse1.signal_connect("animation_finished") do |_, event| on_animation_finished(event, ellipse1) end rect1 = Goo::CanvasRect.new(:parent => root, :x => -10, :y => -10, :width => 20, :height => 20, :fill_color => "blue") rect1.translate(100, 200) rect3 = Goo::CanvasRect.new(:parent => root, :x => -10, :y => -10, :width => 20, :height => 20, :fill_color => "blue") rect3.translate(200, 200) # Relative. ellipse2 = Goo::CanvasEllipse.new(:parent => root, :center_x => 0, :center_y => 0, :radius_x => 25, :radius_y => 15, :fill_color => "red") ellipse2.translate(100, 400) rect2 = Goo::CanvasRect.new(:parent => root, :x => -10, :y => -10, :width => 20, :height => 20, :fill_color => "red") rect2.translate(100, 500) rect4 = Goo::CanvasRect.new(:parent => root, :x => -10, :y => -10, :width => 20, :height => 20, :fill_color => "red") rect4.translate(200, 500) [ellipse1, rect1, rect3, ellipse2, rect2, rect4] end def start_animation_clicked(ellipse1, rect1, rect3, ellipse2, rect2, rect4) # Absolute. ellipse1.set_simple_transform(100, 100, 1, 0) ellipse1.animate(500, 100, 2, 720, true, 2000, 40, Goo::CanvasAnimateType::BOUNCE) rect1.set_simple_transform(100, 200, 1, 0) rect1.animate(100, 200, 1, 350, true, 40 * 36, 40, Goo::CanvasAnimateType::RESTART) rect3.set_simple_transform(200, 200, 1, 0) rect3.animate(200, 200, 3, 0, true, 400, 40, Goo::CanvasAnimateType::BOUNCE) # Relative. ellipse2.set_simple_transform(100, 400, 1, 0) ellipse2.animate(400, 0, 2, 720, false, 2000, 40, Goo::CanvasAnimateType::BOUNCE) rect2.set_simple_transform(100, 500, 1, 0) rect2.animate(0, 0, 1, 350, false, 40 * 36, 40, Goo::CanvasAnimateType::RESTART) rect4.set_simple_transform(200, 500, 1, 0) rect4.animate(0, 0, 3, 0, false, 400, 40, Goo::CanvasAnimateType::BOUNCE) end def stop_animation_clicked(*items) items.each do |item| item.stop_animation end end def on_animation_finished(event, ellipse1) puts "Animation finished stopped: #{event}" # Test starting another animation. */ #ellipse1.animate(500, 100, 2, 720, true, 2000, 40, # Goo::CanvasAnimateType::BOUNCE) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/widgets-demo.rb����������������������������������������������0000755�0001750�0001750�00000021324�12147676243�021003� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # goocanvas/demo/widgets-demo.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "goocanvas" num_added_widgets = 0 added_widget_items = [] canvas = nil move_item = nil def create_focus_box(canvas, x, y, width, height, color) root = canvas.root_item item = Goo::CanvasRect.new(:parent => root, :x => x, :y => y, :width => width, :height => height, :stroke_pattern => nil, :fill_color => color, :line_width => 5.0, :can_focus => true) item.signal_connect('focus_in_event') do puts "#{color} received focus-in event" # Note that this is only for testing. Setting item properties to indicate # focus isn't a good idea for real apps, as there may be multiple views. item.stroke_color = 'black' false end item.signal_connect('focus_out_event') do puts "#{color} received focus-out event" # Note that this is only for testing. Setting item properties to indicate # focus isn't a good idea for real apps, as there may be multiple views. item.stroke_pattern = nil false end item.signal_connect('button_press_event') do puts "#{color} received button-press event" item.canvas.grab_focus(item) true end item.signal_connect('key_press_event') do puts "#{color} received key-press event" false end end def add_button(hbox, button_name, &click_action) w = Gtk::Button.new(:label => button_name) hbox.pack_start(w, :expand => false, :fill => false, :padding => 0) w.show w.signal_connect('clicked', &click_action) end # Create the window and widgets. window = Gtk::Window.new(:toplevel) window.set_default_size(640, 600) window.show window.signal_connect('delete_event') { Gtk.main_quit } vbox = Gtk::Box.new(:vertical, 4) vbox.border_width = 4 vbox.show window.add(vbox) hbox = Gtk::Box.new(:horizontal, 4) vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) hbox.show add_button(hbox, 'Add Widget') do if num_added_widgets % 2 == 1 widget = Gtk::Label.new("Hello World") else widget = Gtk::Entry.new end root = canvas.root_item witem = Goo::CanvasWidget.new(:parent => root, :widget => widget, :x => num_added_widgets * 50, :y => num_added_widgets * 50, :width => 200, :height => 50) added_widget_items.push(witem) num_added_widgets += 1 end add_button(hbox, 'Remove Widget') do root = canvas.root_item witem = added_widget_items.pop if witem root.remove_child(witem) num_added_widgets -= 1 end end move_index = 0 Moves = [ [ 50, 50, -1, -1 ], [ 300, 100, -1, -1 ], [ 200, 200, -1, -1 ], [ 400, 100, -1, -1 ], ] add_button(hbox, 'Move Widget') do move_item.x = Moves[move_index][0] move_item.y = Moves[move_index][1] move_item.width = Moves[move_index][2] move_item.height = Moves[move_index][3] move_index = (move_index + 1) % 4 end # here we have to do a little more complicated than in C because Ruby/Gtk+'s enums are not ints and we can't do + 1 on them moving_anchor = Goo::CanvasAnchorType::CENTER.to_i add_button(hbox, 'Change Anchor') do puts "Setting anchor to: #{Goo::CanvasAnchorType.new(moving_anchor).name}" move_item.anchor = moving_anchor moving_anchor += 1 if moving_anchor > Goo::CanvasAnchorType::EAST.to_i moving_anchor = Goo::CanvasAnchorType::CENTER.to_i end end add_button(hbox, 'Change Widget') do witem = added_widget_items.last if witem if witem.widget.instance_of?(Gtk::Entry) witem.widget = Gtk::Label.new("Hello World") else witem.widget = Gtk::Entry.new end end end hbox = Gtk::Box.new(:horizontal, 4) vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) hbox.show add_button(hbox, 'Hide Canvas') { canvas.hide } add_button(hbox, 'Show Canvas') { canvas.show } add_button(hbox, 'Hide Item') { move_item.visibility = :invisible } add_button(hbox, 'Show Item') { move_item.visibility = :visible } add_button(hbox, 'Change Transform') { move_item.translate(25, 25) } scrolled_win = Gtk::ScrolledWindow.new scrolled_win.shadow_type = :in scrolled_win.show vbox.pack_start(scrolled_win, :expand => true, :fill => true, :padding => 0) canvas = Goo::Canvas.new canvas.set_size_request(600, 450) canvas.set_bounds(0, 0, 1000, 1000) scrolled_win.add(canvas) root = canvas.root_item # Add a few simple items. label = Gtk::Label.new("Hello World") witem = Goo::CanvasWidget.new(:parent => root, :widget => label, :x => 50, :y => 50, :width => 200, :height => 100) entry = Gtk::Entry.new move_item = Goo::CanvasWidget.new(:parent => root, :widget => entry, :x => 50, :y => 250, :width => 200, :height => 50) entry = Gtk::Entry.new entry.text = "Size: -1 x -1" witem = Goo::CanvasWidget.new(:parent => root, :widget => entry, :x => 50, :y => 300, :width => -1, :height => -1) entry = Gtk::Entry.new entry.text = "Size: 100 x -1" witem = Goo::CanvasWidget.new(:parent => root, :widget => entry, :x => 50, :y => 350, :width => 100, :height => -1) # Use a textview so we can see the width & height of the widget. scrolled_win = Gtk::ScrolledWindow.new scrolled_win.shadow_type = :in scrolled_win.set_policy(:never, :never) textview = Gtk::TextView.new buffer = textview.buffer buffer.text = "Size: -1 x 100" textview.show scrolled_win.add(textview) scrolled_win.set_size_request(160, 50) witem = Goo::CanvasWidget.new(:parent => root, :widget => scrolled_win, :x => 50, :y => 400, :width => -1, :height => 100) # Create a vbox item with several child entry widgets to check focus traversal. vbox = Gtk::Box.new(:vertical, 4) entry = Gtk::Entry.new entry.show vbox.pack_start(entry, :expand => false, :fill => false, :padding => 0) entry = Gtk::Entry.new entry.show vbox.pack_start(entry, :expand => false, :fill => false, :padding => 0) entry = Gtk::Entry.new entry.show vbox.pack_start(entry, :expand => false, :fill => false, :padding => 0) witem = Goo::CanvasWidget.new(:parent => root, :widget => vbox, :x => 50, :y => 600, :width => -1, :height => -1) # Create a few normal canvas items that take keyboard focus. create_focus_box(canvas, 110, 80, 50, 30, 'red') create_focus_box(canvas, 300, 160, 50, 30, 'orange') create_focus_box(canvas, 500, 50, 50, 30, 'yellow') canvas.show # Pass control to the GTK+ main event loop. Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/demo-focus.rb������������������������������������������������0000644�0001750�0001750�00000010715�12257552167�020453� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # goocanvas/demo/demo-focus.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class CanvasSampleFocus < Gtk::Box def initialize super(:vertical, 4) set_border_width(4) show create_focus_page(self) end private def create_focus_page(vbox) label = Gtk::Label.new(<<-EOT) Use Tab, Shift+Tab or the arrow keys to move the keyboard focus between the canvas items. EOT vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) label.show scrolled_win = Gtk::ScrolledWindow.new scrolled_win.shadow_type = :in scrolled_win.show vbox.pack_start(scrolled_win, :expand => true, :fill => true, :padding => 0) canvas = Goo::Canvas.new canvas.can_focus = true canvas.set_size_request(600, 450) canvas.set_bounds(0, 0, 1000, 1000) canvas.show scrolled_win.add(canvas) setup_canvas(canvas) end def setup_canvas(canvas) create_focus_box(canvas, 109, 80, 50, 30, "red") create_focus_box(canvas, 300, 160, 50, 30, "orange") create_focus_box(canvas, 500, 50, 50, 30, "yellow") create_focus_box(canvas, 70, 400, 50, 30, "blue") create_focus_box(canvas, 130, 200, 50, 30, "magenta") create_focus_box(canvas, 200, 160, 50, 30, "green") create_focus_box(canvas, 450, 450, 50, 30, "cyan") create_focus_box(canvas, 300, 350, 50, 30, "grey") create_focus_box(canvas, 900, 900, 50, 30, "gold") create_focus_box(canvas, 800, 150, 50, 30, "thistle") create_focus_box(canvas, 600, 800, 50, 30, "azure") create_focus_box(canvas, 700, 250, 50, 30, "moccasin") create_focus_box(canvas, 500, 100, 50, 30, "cornsilk") create_focus_box(canvas, 200, 750, 50, 30, "plum") create_focus_box(canvas, 400, 800, 50, 30, "orchid") end def create_focus_box(canvas, x, y, width, height, color) root = canvas.root_item item = Goo::CanvasRect.new(:parent => root, :x => x, :y => y, :width => width, :height => height, :stroke_pattern => nil, :fill_color => color, :line_width => 5.0, :can_focus => true) item.signal_connect("focus-in-event") do |widget| on_focus_in(widget, color) end item.signal_connect("focus-out-event") do |widget| on_focus_out(widget, color) end item.signal_connect("button-press-event") do |widget| on_button_press(widget, color) end item.signal_connect("key-press-event") do on_key_press(color) end end def on_focus_in (item, color) puts "#{color} received focus-in event" # Note that this is only for testing. Setting item properties to indicate # focus isn't a good idea for real apps, as there may be multiple views. item.stroke_color = "black" false end def on_focus_out(item, color) puts "#{color} received focus-out event" # Note that this is only for testing. Setting item properties to indicate # focus isn't a good idea for real apps, as there may be multiple views. item.stroke_pattern = nil false end def on_button_press(item, color) puts "#{color} received button-press event" item.canvas.grab_focus(item) false end def on_key_press(color) puts "#{color} received key-press event" false end end ���������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/demo-events.rb�����������������������������������������������0000644�0001750�0001750�00000016401�12257552167�020636� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # goocanvas/demo/demo-events.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class CanvasSampleEvents < Gtk::Box def initialize super(:vertical, 4) border_width = 4 show create_events_page(self) end private def create_events_page(vbox) # Instructions label = Gtk::Label.new(<<-EOT) Move the mouse over the items to check they receive the right motion events. The first 2 items in each group are 1) invisible and 2) visible but unpainted. EOT vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) label.show # Frame and canvas alignment = Gtk::Alignment.new(0.5, 0.5, 0.0, 0.0) vbox.pack_start(alignment, :expand => false, :fill => false, :padding => 0) alignment.show frame = Gtk::Frame.new frame.shadow_type = :in alignment.add(frame) frame.show canvas = Goo::Canvas.new canvas.set_size_request(600, 450) canvas.set_bounds(0, 0, 600, 450) frame.add(canvas) canvas.show create_events_area(canvas, 0, :none, "none") create_events_area(canvas, 1, :visible_painted, "visible-painted") create_events_area(canvas, 2, :visible_fill, "visible-fill") create_events_area(canvas, 3, :visible_stroke, "visible-stroke") create_events_area(canvas, 4, :visible, "visible") create_events_area(canvas, 5, :painted, "painted") create_events_area(canvas, 6, :fill, "fill") create_events_area(canvas, 7, :stroke, "stroke") create_events_area(canvas, 8, :all, "all") end def create_events_area(canvas, area_num, pointer_events, label) row = area_num / 3 col = area_num % 3 x = col * 200 y = row * 150 root = canvas.root_item dash = Goo::CanvasLineDash.new(5.0, 5.0) # Create invisible item. rect = Goo::CanvasRect.new(:parent => root, :x => x + 45, :y => y + 35, :width => 30, :height => 30, :fill_color => "red", :visibility => :invisible, :line_width => 5.0, :pointer_events => pointer_events) view_id = sprintf("%s invisible", label) setup_item_signals(rect, view_id) # Display a thin rect around it to indicate it is there. rect = Goo::CanvasRect.new(:parent => root, :x => x + 42.5, :y => y + 32.5, :width => 36, :height => 36, # TODO: [BUG] Segmentation fault #:line_dash => dash, :line_width => 1.0, :stroke_color => "gray") # Create unpainted item. rect = Goo::CanvasRect.new(:parent => root, :x => x + 85, :y => y + 35, :width => 30, :height => 30, :stroke_pattern => nil, :line_width => 5.0, :pointer_events => pointer_events) view_id = sprintf("%s unpainted", label) setup_item_signals(rect, view_id) # Display a thin rect around it to indicate it is there. rect = Goo::CanvasRect.new(:parent => root, :x => x + 82.5, :y => y + 32.5, :width => 36, :height => 36, # TODO: [BUG] Segmentation fault #:line_dash => dash, :line_width => 1.0, :stroke_color => "gray") # Create stroked item. rect = Goo::CanvasRect.new(:parent => root, :x => x + 125, :y => y + 35, :width => 30, :height => 30, :line_width => 5.0, :pointer_events => pointer_events) view_id = sprintf("%s stroked", label) setup_item_signals(rect, view_id) # Create filled item. rect = Goo::CanvasRect.new(:parent => root, :x => x + 60, :y => y + 75, :width => 30, :height => 30, :fill_color => "red", :stroke_pattern => nil, :line_width => 5.0, :pointer_events => pointer_events) view_id = sprintf("%s filled", label) setup_item_signals(rect, view_id) # Create stroked & filled item. rect = Goo::CanvasRect.new(:parent => root, :x => x + 100, :y => y + 75, :width => 30, :height => 30, :fill_color => "red", :line_width => 5.0, :pointer_events => pointer_events) view_id = sprintf("%s stroked & filled", label) setup_item_signals(rect, view_id) Goo::CanvasText.new(:parent => root, :text => label, :x => x + 100, :y => y + 130, :width => -1, :anchor => :center, :font => "Sans 12", :fill_color => "blue") end def setup_item_signals(item, item_id) item.signal_connect("motion_notify_event") do |widget, event| if item_id printf("%s item received 'motion-notify' signal\n", item_id) end false end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/demo-primitives.rb�������������������������������������������0000644�0001750�0001750�00000054534�12257552167�021536� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # -*- indent-tabs-mode: nil -*- =begin header Rewritten by Emmanuel Pinault <seatmanu@yahoo.com> Original Copyright: Author : Richard Hestilow <hestgray@ionet.net> Copyright (C) 1998 Free Software Foundation 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. =end class CanvasSamplePrimitives < Gtk::VBox VERTICES = 10 RADIUS = 60.0 def initialize(aa) super(false, 4) @dragging = false self.border_width = 4 show label = Gtk::Label.new("Drag an item with button 1. " + "Click button 2 on an item to lower it, " + "or button 3 to raise it.") pack_start(label, false, false, 0) label.show hbox = Gtk::HBox.new(false, 4) pack_start(hbox, false, false, 0) hbox.show # Create the canvas canvas = Goo::Canvas.new canvas.automatic_bounds = true canvas.bounds_from_origin = false canvas.bounds_padding = 4.0 canvas.background_color_rgb = 0xc3c3ff canvas.set_bounds(0, 0, 604, 454) # Scale label = Gtk::Label.new("Scale:") hbox.pack_start(label, false, false, 0) label.show adjustment = Gtk::Adjustment.new(1.00, 0.05, 50.00, 0.05, 0.50, 0.50) button = Gtk::SpinButton.new(adjustment, 0.0, 2) adjustment.signal_connect('value_changed') do |adj,| canvas.scale = adj.value end button.set_size_request(50, -1) hbox.pack_start(button, false, false, 0) button.show label = Gtk::Label.new("Scale X:") hbox.pack_start(label, false, false, 0) label.show adjustment = Gtk::Adjustment.new(1.00, 0.05, 50.00, 0.05, 0.50, 0.50) button = Gtk::SpinButton.new(adjustment, 0.0, 2) adjustment.signal_connect('value_changed') do |adj,| canvas.scale_x = adj.value end button.set_size_request(50, -1) hbox.pack_start(button, false, false, 0) button.show label = Gtk::Label.new("Scale Y:") hbox.pack_start(label, false, false, 0) label.show adjustment = Gtk::Adjustment.new(1.00, 0.05, 50.00, 0.05, 0.50, 0.50) button = Gtk::SpinButton.new(adjustment, 0.0, 2) adjustment.signal_connect('value_changed') do |adj,| canvas.scale_y = adj.value end button.set_size_request(50, -1) hbox.pack_start(button, false, false, 0) button.show hbox = Gtk::HBox.new(false, 4) pack_start(hbox, false, false, 0) hbox.show # Center button = Gtk::CheckButton.new('Center scroll region') hbox.pack_start(button, false, false, 0) button.signal_connect("toggled") do |_button,| canvas.center_scroll_region = _button.active end # button.show # Move Ellipse button = Gtk::Button.new("Move Ellipse") hbox.pack_start(button, false, false, 0) button.show last_state = 0 button.signal_connect("clicked") do |_button,| $ellipse2.transform = nil case last_state when 0 $ellipse2.center_x = 300.0 $ellipse2.center_y = 70.0 $ellipse2.radius_x = 45.0 $ellipse2.radius_y = 30.0 $ellipse2.fill_color = 'red' $ellipse2.stroke_color = 'midnightblue' $ellipse2.line_width = 4.0 $ellipse2.title = 'A red ellipse' when 1 $ellipse2.center_x = 390.0 $ellipse2.center_y = 150.0 $ellipse2.radius_x = 45.0 $ellipse2.radius_y = 40.0 $ellipse2.fill_color = 'brown' $ellipse2.stroke_color = 'midnightblue' $ellipse2.line_width = 4.0 $ellipse2.title = 'A brown ellipse' when 2 $ellipse2.center_x = 0.0 $ellipse2.center_y = 0.0 $ellipse2.radius_y = 30.0 $ellipse2.set_simple_transform(100, 100, 1, 0) when 3 $ellipse2.set_simple_transform(200, 100, 2, 0) when 4 $ellipse2.set_simple_transform(200, 200, 1, 45) when 5 $ellipse2.set_simple_transform(50, 50, 0.2, 225) else $ellipse2.center_x = 335.0 $ellipse2.center_y = 70.0 $ellipse2.radius_x = 45.0 $ellipse2.radius_y = 30.0 $ellipse2.fill_color = 'purple' $ellipse2.stroke_color = 'midnightblue' $ellipse2.line_width = 4.0 $ellipse2.title = 'A purple ellipse' end last_state = (last_state + 1) % 7 end # Animate Ellipse button = Gtk::Button.new("Animate Ellipse") hbox.pack_start(button, false, false, 0) button.show button.signal_connect('clicked') do $ellipse2.animate(100, 100, 1, 90, true, 1000, 40, Goo::CanvasItem::ANIMATE_BOUNCE) end # Stop Animation button = Gtk::Button.new("Stop Animation") hbox.pack_start(button, false, false, 0) button.show button.signal_connect('clicked') do $ellipse2.stop_animation end # Create PDF button = Gtk::Button.new("Write PDF") hbox.pack_start(button, false, false, 0) button.show button.signal_connect('clicked') do puts "In write_pdf_clicked" Cairo::PDFSurface.new("demo.pdf", 9 * 72, 10 * 72) do |surface| Cairo::Context.new(surface) do |context| # Place it in the middle of our 9x10 page. context.translate(20, 130) canvas.render(context, nil, 1.0) context.show_page end end end button = Gtk::Button.new("Change Bounds") hbox.pack_start(button, false, false, 0) button.show bounds = [ [-100, -100, 200, 200], [100, 100, 200, 200], [0, 0, 300, 300], [0, 0, 604, 454], ] bounds_n = 0 button.signal_connect("clicked") do |_button,| if bounds_n < 4 automatic_bounds = false bounds_from_origin = false canvas.set_bounds(*bounds[bounds_n]) elsif bounds_n == 4 automatic_bounds = true bounds_from_origin = true end canvas.automatic_bounds = automatic_bounds canvas.bounds_from_origin = bounds_from_origin canvas.bounds_padding = 50 bounds_n = (bounds_n + 1) % 6 end hbox = Gtk::HBox.new(false, 4) pack_start(hbox, false, false, 0) hbox.show # Scroll to label = Gtk::Label.new("Scroll To:") hbox.pack_start(label, false, false, 0) label.show button = Gtk::Button.new("50,50") hbox.pack_start(button, false, false, 0) button.show button.signal_connect('clicked') {canvas.scroll_to(50, 50)} button = Gtk::Button.new("250,250") hbox.pack_start(button, false, false, 0) button.show button.signal_connect('clicked') {canvas.scroll_to(250, 250)} button = Gtk::Button.new("500,500") hbox.pack_start(button, false, false, 0) button.show button.signal_connect('clicked') {canvas.scroll_to(500, 500)} # Scroll anchor label = Gtk::Label.new("Anchor:") hbox.pack_start(label, false, false, 0) label.show group = nil [ ['NW', Gtk::ANCHOR_NW], ['NE', Gtk::ANCHOR_NE], ['W', Gtk::ANCHOR_W], ['C', Gtk::ANCHOR_CENTER], ['E', Gtk::ANCHOR_E], ['SW', Gtk::ANCHOR_SW], ['S', Gtk::ANCHOR_S], ['SE', Gtk::ANCHOR_SE], ].each do |name, anchor| if group button = Gtk::RadioButton.new(group, name) else button = Gtk::RadioButton.new(name) end group, = button.group hbox.pack_start(button, false, false, 0) button.show button.signal_connect('toggled') do |_button| canvas.anchor = anchor if _button.active? end end # Layout the stuff scrolled_window = Gtk::ScrolledWindow.new scrolled_window.show pack_start(scrolled_window, true, true, 0) canvas.show scrolled_window.add(canvas) # Add all the canvas items. setup_canvas(canvas) end def image_path(name) File.join(File.dirname(__FILE__), name) end def setup_item_signals(item) dragging = false drag_x = nil drag_y = nil item.signal_connect('motion_notify_event') do |item, target, event| if dragging && (event.state & Gdk::Window::BUTTON1_MASK == Gdk::Window::BUTTON1_MASK) item.translate(event.x - drag_x, event.y - drag_y) end true end item.signal_connect('button_press_event') do |item, target, event| case event.button when 1 if event.state & Gdk::Window::SHIFT_MASK == Gdk::Window::SHIFT_MASK item.parent.remove_child(item) else drag_x = event.x drag_y = event.y fleur = Gdk::Cursor.new(Gdk::Cursor::FLEUR) canvas = item.canvas canvas.pointer_grab(item, Gdk::Event::POINTER_MOTION_MASK | Gdk::Event::BUTTON_RELEASE_MASK, fleur, event.time) dragging = true end when 2 item.lower(nil) when 3 item.raise(nil) end true end item.signal_connect('button_release_event') do |item, target, event| canvas = item.canvas canvas.pointer_ungrab(item, event.time) if canvas dragging = false true end end def setup_heading(root, text, pos) x = (pos % 3) * 200 + 100 y = (pos / 3) * 150 + 5 item = Goo::CanvasText.new(root, text, x, y, -1, Gtk::ANCHOR_N, :font => "Sans 12") item.skew_y(30, x, y) end def setup_divisions(root) group = Goo::CanvasGroup.new(root, nil) group.translate(2, 2) item = Goo::CanvasRect.new(group, 0, 0, 600, 450, :line_width => 4.0) item = Goo::CanvasPolyline.new_line(group, 0, 150, 600, 150, :line_width => 4.0) item = Goo::CanvasPolyline.new_line(group, 0, 300, 600, 300, :line_width => 4.0) item = Goo::CanvasPolyline.new_line(group, 200, 0, 200, 450, :line_width => 4.0) item = Goo::CanvasPolyline.new_line(group, 400, 0, 400, 450, :line_width => 4.0) setup_heading(group, 'Rectangles', 0) setup_heading(group, 'Ellipses', 1) setup_heading(group, 'Texts', 2) setup_heading(group, 'Images', 3) setup_heading(group, 'Lines', 4) setup_heading(group, 'Polygons', 7) end # FIXME: I think we may need to check byte order. def create_stipple(color_name, stipple_data) color = Gdk::Color.parse(color_name) stipple_data[2] = stipple_data[14] = (color.red >> 8) stipple_data[1] = stipple_data[13] = (color.green >> 8) stipple_data[0] = stipple_data[12] = (color.blue >> 8) surface = Cairo::ImageSurface.new(stipple_data.pack('C*'), Cairo::FORMAT_ARGB32, 2, 2, 8) pattern = Cairo::SurfacePattern.new(surface) pattern.extend = Cairo::EXTEND_REPEAT return pattern end def setup_rectangles(root) stipple_data = [ 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 ] item = Goo::CanvasRect.new(root, 20, 30, 50, 30, :stroke_color => "red", :line_width => 8.0) setup_item_signals(item) pattern = create_stipple("mediumseagreen", stipple_data) item = Goo::CanvasRect.new(root, 90, 40, 90, 60, :fill_pattern => pattern, :stroke_color => 'black', :line_width => 4.0) setup_item_signals(item) item = Goo::CanvasRect.new(root, 10, 80, 70, 60, :fill_color => "steelblue") setup_item_signals(item) item = Goo::CanvasRect.new(root, 20, 90, 70, 60, :fill_color_rgba => 0x3cb37180, :stroke_color => "blue", :line_width => 2.0) setup_item_signals(item) item = Goo::CanvasRect.new(root, 110, 80, 50, 30, :radius_x => 20.0, :radius_y => 10.0, :stroke_color => "yellow", :fill_color_rgba => 0x3cb3f180) setup_item_signals(item) #TODO # item = goo_demo_item_new(root, 30, 20, 50, 30, # :fill_color => "yellow") # setup_item_signals(item) end def setup_ellipses(root) stipple_data = [ 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 ] ellipse1 = Goo::CanvasEllipse.new(root, 245, 45, 25, 15, :stroke_color => 'goldenrod', :line_width => 8.0) setup_item_signals(ellipse1) $ellipse2 = Goo::CanvasEllipse.new(root, 335, 70, 45, 30, :fill_color => 'wheat', :stroke_color => 'midnightblue', :line_width => 4.0, :title => 'An ellipse') setup_item_signals($ellipse2) pattern = create_stipple('cadetblue', stipple_data) ellipse3 = Goo::CanvasEllipse.new(root, 245, 110, 35, 30, :fill_pattern => pattern, :stroke_color => 'black', :line_width => 1.0) setup_item_signals(ellipse3) end def polish_diamond(root) group = Goo::CanvasGroup.new(root, :line_width => 1.0, :line_cap => Cairo::LINE_CAP_ROUND) group.translate(270, 230) setup_item_signals(group) VERTICES.times do |i| a = 2.0 * Math::PI * i / VERTICES x1 = RADIUS * Math.cos(a) y1 = RADIUS * Math.sin(a) ((i + 1)...VERTICES).each do |j| a = 2.0 * Math::PI * j / VERTICES x2 = RADIUS * Math.cos(a) y2 = RADIUS * Math.sin(a) item = Goo::CanvasPolyline.new_line(group, x1, y1, x2, y2) end end end SCALE = 7.0 def make_hilbert(root) hilbert = "urdrrulurulldluuruluurdrurddldrrruluurdrurddldrddlulldrdldrrurd".split(//) stipple_data = [ 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 ] points = [ 340.0, 290.0 ] i = 0 hilbert.each do |c| case c when 'u' points[i+2] = points[i+0] points[i+3] = points[i+1] - SCALE when 'd' points[i+2] = points[i+0] points[i+3] = points[i+1] + SCALE when 'l' points[i+2] = points[i+0] - SCALE points[i+3] = points[i+1] when 'r' points[i+2] = points[i+0] + SCALE points[i+3] = points[i+1] end i += 2 end pattern = create_stipple("red", stipple_data) item = Goo::CanvasPolyline.new(root, false, points, :line_width => 4.0, :stroke_pattern => pattern, :line_cap => Cairo::LINE_CAP_SQUARE, :line_join => Cairo::LINE_JOIN_MITER) setup_item_signals(item) end def setup_lines(root) polish_diamond(root) make_hilbert(root) # Arrow tests polyline1 = Goo::CanvasPolyline.new(root, false, [ 340.0, 170.0, 340.0, 230.0, 390.0, 230.0, 390.0, 170.0, ], :stroke_color => 'midnightblue', :line_width => 3.0, :start_arrow => true, :end_arrow => true, :arrow_tip_length => 3.0, :arrow_length => 4.0, :arrow_width => 3.5) setup_item_signals(polyline1) polyline2 = Goo::CanvasPolyline.new(root, false, [ 356.0, 180.0, 374.0, 220.0, ] , :stroke_color => "blue", :line_width => 1.0, :start_arrow => true, :end_arrow => true, :arrow_tip_length => 5.0, :arrow_length => 6.0, :arrow_width => 6.0) setup_item_signals(polyline2) polyline3 = Goo::CanvasPolyline.new(root, false, [ 356.0, 220.0, 374.0, 180.0, ], :stroke_color => "blue", :line_width => 1.0, :start_arrow => true, :end_arrow => true, :arrow_tip_length => 5.0, :arrow_length => 6.0, :arrow_width => 6.0) setup_item_signals(polyline3) # Test polyline without any coords. polyline4 = Goo::CanvasPolyline.new(root, false, []) setup_item_signals(polyline4) # Test polyline with 1 coord and arrows. polyline5 = Goo::CanvasPolyline.new(root, false, [ 356.0, 220.0 ], :start_arrow => true, :end_arrow => true) setup_item_signals(polyline5) end def setup_polygons(root) stipple_data = [ 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 ] points = [ 210.0, 320.0, 210.0, 380.0, 260.0, 350.0, ] pattern = create_stipple("blue", stipple_data) polyline1 = Goo::CanvasPolyline.new(root, true, points, :line_width => 1.0, :fill_pattern => pattern, :stroke_color => "black") setup_item_signals(polyline1) points = [ 270.0, 330.0, 270.0, 430.0, 390.0, 430.0, 390.0, 330.0, 310.0, 330.0, 310.0, 390.0, 350.0, 390.0, 350.0, 370.0, 330.0, 370.0, 330.0, 350.0, 370.0, 350.0, 370.0, 410.0, 290.0, 410.0, 290.0, 330.0, ] polyline2 = Goo::CanvasPolyline.new(root, true, points, :fill_color => 'tan', :stroke_color => 'black', :line_width => 3.0) setup_item_signals(polyline2) end def make_anchor(root, x, y) transform = Cairo::Matrix.new(0.8, 0.2, -0.3, 0.5, x, y) group = Goo::CanvasGroup.new(root) group.translate(x, y) group.transform = transform $transforms ||= [] $transforms << transform item = Goo::CanvasRect.new(group, -2.5, -2.5, 4, 4, :line_width => 1.0) setup_item_signals(item) group end def setup_texts(root) stipple_data = [ 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 ] pattern = create_stipple('blue', stipple_data) item = Goo::CanvasText.new(make_anchor(root, 420, 20), 'Anchor NW', 0, 0, -1, Gtk::ANCHOR_NW, :font => 'Sans Bold 24', :fill_pattern => pattern) setup_item_signals(item) item = Goo::CanvasText.new(make_anchor(root, 470, 75), "Anchor center\nJustify center\nMultiline text\nb8bit text ÅÄÖåäö", 0, 0, -1, Gtk::ANCHOR_CENTER, :font => "monospace bold 14", :alignment => Pango::ALIGN_CENTER, :fill_color => 'firebrick') setup_item_signals(item) textitem = Goo::CanvasText.new(make_anchor(root, 420, 240), "This is a very long paragraph that will need to be wrapped over several lines so we can see what happens to line-breaking as the view is zoomed in and out.", 0, 0, 180, Gtk::ANCHOR_W, :font => 'Sans 12', :fill_color => 'goldenrod') setup_item_signals(textitem) textitem = Goo::CanvasText.new(root, "Ellipsized text.", 20, 420, 115, Gtk::ANCHOR_W, :font => 'Sans 12', :fill_color => "blue", :ellipsize => Pango::ELLIPSIZE_END) setup_item_signals(textitem) end def setup_invisible_texts(root) Goo::CanvasText.new(root, "Visible above 0.8x", 500, 330, -1, Gtk::ANCHOR_CENTER, :visibility => Goo::CanvasItem::VISIBLE_ABOVE_THRESHOLD, :visibility_threshold => 0.8) Goo::CanvasRect.new(root, 410.5, 322.5, 180, 15, :line_width => 1.0, :visibility => Goo::CanvasItem::VISIBLE_ABOVE_THRESHOLD, :visibility_threshold => 0.8) Goo::CanvasText.new(root, "Visible above 1.5x", 500, 350, -1, Gtk::ANCHOR_CENTER, :visibility => Goo::CanvasItem::VISIBLE_ABOVE_THRESHOLD, :visibility_threshold => 1.5) Goo::CanvasRect.new(root, 410.5, 342.5, 180, 15, :line_width => 1.0, :visibility => Goo::CanvasItem::VISIBLE_ABOVE_THRESHOLD, :visibility_threshold => 1.5) Goo::CanvasText.new(root, "Visible above 3.0x", 500, 370, -1, Gtk::ANCHOR_CENTER, :visibility => Goo::CanvasItem::VISIBLE_ABOVE_THRESHOLD, :visibility_threshold => 3.0) Goo::CanvasRect.new(root, 410.5, 362.5, 180, 15, :line_width => 1.0, :visibility => Goo::CanvasItem::VISIBLE_ABOVE_THRESHOLD, :visibility_threshold => 3.0) # This should never be seen. Goo::CanvasText.new(root, "Always Invisible", 500, 390, -1, Gtk::ANCHOR_CENTER, :visibility => Goo::CanvasItem::INVISIBLE) Goo::CanvasRect.new(root, 410.5, 350.5, 180, 15, :line_width => 1.0, :visibility => Goo::CanvasItem::INVISIBLE) end def plant_flower(root, x, y, anchor) surface = Cairo::ImageSurface.from_png(image_path('flower.png')) w = surface.width h = surface.height pattern = Cairo::SurfacePattern.new(surface) image = Goo::CanvasImage.new(root, nil, x, y, :pattern => pattern, :width => w, :height => h) setup_item_signals(image) end def setup_images(root) im = Gdk::Pixbuf.new(image_path('toroid.png')) w = im.width h = im.height image = Goo::CanvasImage.new(root, im, 100.0 - w / 2, 225.0 - h / 2, :width => w, :height => h) setup_item_signals(image) plant_flower(root, 20.0, 170.0, Gtk::ANCHOR_NW) plant_flower(root, 180.0, 170.0, Gtk::ANCHOR_NE) plant_flower(root, 20.0, 280.0, Gtk::ANCHOR_SW) plant_flower(root, 180.0, 280.0, Gtk::ANCHOR_SE) end def setup_canvas(canvas) root = canvas.root_item root.signal_connect("button_press_event") { puts "background received 'button-press' signal" } # Setup canvas items setup_divisions(root) setup_rectangles(root) setup_ellipses(root) setup_lines(root) setup_polygons(root) setup_texts(root) setup_images(root) setup_invisible_texts(root) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/demo-arrowhead.rb��������������������������������������������0000644�0001750�0001750�00000030701�12257552167�021305� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class CanvasSampleArrowhead < Gtk::Box LEFT = 50.0 RIGHT = 350.0 MIDDLE = 150.0 DEFAULT_WIDTH = 2 DEFAULT_SHAPE_A = 4 DEFAULT_SHAPE_B = 5 DEFAULT_SHAPE_C = 4 def initialize() super(:vertical, 4) border_width = 4 show() w = Gtk::Label.new <<-END This demo allows you to edit arrowhead shapes. Drag the little boxes to change the shape of the line and its arrowhead. You can see the arrows at their normal scale on the right hand side of the window. END pack_start(w, :expand => false, :fill => false, :padding => 0) w.show w = Gtk::Alignment.new(0.5, 0.5, 0.0, 0.0) pack_start(w, :expand => true, :fill => true, :padding => 0) w.show frame = Gtk::Frame.new frame.shadow_type = :in w.add(frame) frame.show canvas = Goo::Canvas.new root = canvas.root_item canvas.set_size_request(500, 350) canvas.set_bounds(0, 0, 500, 350) frame.add(canvas) canvas.show canvas.instance_variable_set(:@width, DEFAULT_WIDTH) canvas.instance_variable_set(:@shape_a, DEFAULT_SHAPE_A) canvas.instance_variable_set(:@shape_b, DEFAULT_SHAPE_B) canvas.instance_variable_set(:@shape_c, DEFAULT_SHAPE_C) # Big arrow points = Goo::CanvasPoints.new(2) points.set_point(0, LEFT, MIDDLE) points.set_point(1, RIGHT, MIDDLE) item = Goo::CanvasPolyline.new(:parent => root, :points => points, :stroke_color => "mediumseagreen", :end_arrow => true) canvas.instance_variable_set(:@big_arrow, item) # Arrow outline item = Goo::CanvasPolyline.new(:parent => root, :close_path => true, :points => Goo::CanvasPoints.new(0), :stroke_color => "black", :line_width => 2.0, :line_cap => Cairo::LINE_CAP_ROUND, :line_join => Cairo::LINE_JOIN_ROUND) canvas.instance_variable_set(:@outline, item) # Drag boxes create_drag_box(canvas, root, "width_drag_box") create_drag_box(canvas, root, "shape_a_drag_box") create_drag_box(canvas, root, "shape_b_c_drag_box") # Dimensions create_dimension(canvas, root, "width_arrow", "width_text", :e) create_dimension(canvas, root, "shape_a_arrow", "shape_a_text", :n) create_dimension(canvas, root, "shape_b_arrow", "shape_b_text", :n) create_dimension(canvas, root, "shape_c_arrow", "shape_c_text", :w) # Info create_info(canvas, root, "width_info", LEFT, 260) create_info(canvas, root, "shape_a_info", LEFT, 280) create_info(canvas, root, "shape_b_info", LEFT, 300) create_info(canvas, root, "shape_c_info", LEFT, 320) # Division line points = Goo::CanvasPoints.new(2) points.set_point(0, RIGHT + 50, 0) points.set_point(1, RIGHT + 50, 1000) Goo::CanvasPolyline.new(:parent => root, :points => points, :fill_color => "black", :line_width => 2.0) # Sample arrows create_sample_arrow(canvas, root, "sample_1", RIGHT + 100, 30, RIGHT + 100, MIDDLE - 30) create_sample_arrow(canvas, root, "sample_2", RIGHT + 70, MIDDLE, RIGHT + 130, MIDDLE) create_sample_arrow(canvas, root, "sample_3", RIGHT + 70, MIDDLE + 30, RIGHT + 130, MIDDLE + 120) # Done! set_arrow_shape(canvas) end def set_dimension(canvas, arrow_name, text_name, x1, y1, x2, y2, tx, ty, dim) points = Goo::CanvasPoints.new(2) points.set_point(0, x1, y1) points.set_point(1, x2, y2) arrow = canvas.instance_variable_get("@#{arrow_name}") arrow.points = points text = canvas.instance_variable_get("@#{text_name}") text.text = dim.to_s text.x = tx text.y = ty end def move_drag_box(item, x, y) item.x = x - 5.0 item.y = y - 5.0 end def set_arrow_shape(canvas) width = canvas.instance_variable_get(:@width) shape_a = canvas.instance_variable_get(:@shape_a) shape_b = canvas.instance_variable_get(:@shape_b) shape_c = canvas.instance_variable_get(:@shape_c) # Big arrow big_arrow = canvas.instance_variable_get(:@big_arrow) big_arrow.line_width = 10.0 * width big_arrow.arrow_tip_length = shape_a big_arrow.arrow_length = shape_b big_arrow.arrow_width = shape_c # Outline points0 = RIGHT - 10 * shape_a * width points1 = MIDDLE - 10 * width / 2 points2 = RIGHT - 10 * shape_b * width points3 = MIDDLE - 10 * (shape_c * width / 2.0) points4 = RIGHT points5 = MIDDLE points6 = points2 points7 = MIDDLE + 10 * (shape_c * width / 2.0) points8 = points0 points9 = MIDDLE + 10 * width / 2 points = Goo::CanvasPoints.new(5) points.set_point(0, points0, points1) points.set_point(1, points2, points3) points.set_point(2, points4, points5) points.set_point(3, points6, points7) points.set_point(4, points8, points9) outline = canvas.instance_variable_get(:@outline) outline.points = points # Drag boxes move_drag_box(canvas.instance_variable_get(:@width_drag_box), LEFT, MIDDLE - 10 * width / 2.0) move_drag_box(canvas.instance_variable_get(:@shape_a_drag_box), RIGHT - 10 * shape_a * width, MIDDLE) move_drag_box(canvas.instance_variable_get(:@shape_b_c_drag_box), RIGHT - 10 * shape_b * width, MIDDLE - 10 * (shape_c * width / 2.0)) # Dimensions set_dimension(canvas, "width_arrow", "width_text", LEFT - 10, MIDDLE - 10 * width / 2.0, LEFT - 10, MIDDLE + 10 * width / 2.0, LEFT - 15, MIDDLE, width) set_dimension(canvas, "shape_a_arrow", "shape_a_text", RIGHT - 10 * shape_a * width, MIDDLE + 10 * (shape_c * width / 2.0) + 10, RIGHT, MIDDLE + 10 * (shape_c * width / 2.0) + 10, RIGHT - 10 * shape_a * width / 2.0, MIDDLE + 10 * (shape_c * width / 2.0) + 15, shape_a) set_dimension(canvas, "shape_b_arrow", "shape_b_text", RIGHT - 10 * shape_b * width, MIDDLE + 10 * (shape_c * width / 2.0) + 35, RIGHT, MIDDLE + 10 * (shape_c * width / 2.0) + 35, RIGHT - 10 * shape_b * width / 2.0, MIDDLE + 10 * (shape_c * width / 2.0) + 40, shape_b) set_dimension(canvas, "shape_c_arrow", "shape_c_text", RIGHT + 10, MIDDLE - 10 * shape_c * width / 2.0, RIGHT + 10, MIDDLE + 10 * shape_c * width / 2.0, RIGHT + 15, MIDDLE, shape_c) # Info width_info = canvas.instance_variable_get(:@width_info) width_info.text = "line-width: #{width}" shape_a_info = canvas.instance_variable_get(:@shape_a_info) shape_a_info.text = "arrow-tip-length: #{shape_a} (* line-width)" shape_b_info = canvas.instance_variable_get(:@shape_b_info) shape_b_info.text = "arrow-length: #{shape_b} (* line-width)" shape_c_info = canvas.instance_variable_get(:@shape_c_info) shape_c_info.text = "arrow-length: #{shape_c} (* line-width)" # Sample arrows sample_1 = canvas.instance_variable_get(:@sample_1) sample_1.line_width = width sample_1.arrow_tip_length = shape_a sample_1.arrow_length = shape_b sample_1.arrow_width = shape_c sample_2 = canvas.instance_variable_get(:@sample_2) sample_2.line_width = width sample_2.arrow_tip_length = shape_a sample_2.arrow_length = shape_b sample_2.arrow_width = shape_c sample_3 = canvas.instance_variable_get(:@sample_3) sample_3.line_width = width sample_3.arrow_tip_length = shape_a sample_3.arrow_length = shape_b sample_3.arrow_width = shape_c end def create_dimension(canvas, root, arrow_name, text_name, anchor) item = Goo::CanvasPolyline.new(:parent => root, :close_path => false, :points => Goo::CanvasPoints.new(0), :fill_color => "black", :start_arrow => true, :end_arrow => true) canvas.instance_variable_set("@#{arrow_name}", item) item = Goo::CanvasText.new(:parent => root, :text => nil, :x => 0, :y => 0, :width => -1, :anchor => anchor, :fill_color => "black", :font => "Sans 12") canvas.instance_variable_set("@#{text_name}", item) end def create_info(canvas, root, info_name, x, y) item = Goo::CanvasText.new(:parent => root, :text => nil, :x => x, :y => y, :width => -1, :anchor => :nw, :fill_color => "black", :font => "Sans 14") canvas.instance_variable_set("@#{info_name}", item) end def create_sample_arrow(canvas, root, sample_name, x1, y1, x2, y2) points = Goo::CanvasPoints.new(2) points.set_point(0, x1, y1) points.set_point(1, x2, y2) item = Goo::CanvasPolyline.new(:parent => root, :points => points, :start_arrow => true, :end_arrow => true) canvas.instance_variable_set("@#{sample_name}", item) end def create_drag_box(canvas, root, box_name) item = Goo::CanvasRect.new(:parent => root, :x => 0, :y => 0, :width => 10, :height => 10, :fill_color => 'black', :stroke_color => 'black', :line_width => 1.0) canvas.instance_variable_set("@#{box_name}", item) item.signal_connect('enter_notify_event') do item.fill_color = 'red' true end item.signal_connect('leave_notify_event') do item.fill_color = 'black' true end item.signal_connect('button_press_event') do |item, target, event| # fixed "`initialize': ruby wrapper for this GObject* already exists." fleur = @fleur ||= Gdk::Cursor.new(:fleur) # Symbol is not allowed. Because "undefined method `|' for :pointer_motion_mask:Symbol" canvas.pointer_grab(item, Gdk::Event::Mask::POINTER_MOTION_MASK | Gdk::Event::Mask::BUTTON_RELEASE_MASK, fleur, event.time) true end item.signal_connect('button_release_event') do |item, target, event| canvas.pointer_ungrab(item, event.time) true end item.signal_connect('motion_notify_event') do |item, target, event| catch :done do throw :done, false unless event.state & :button1_mask == :button1_mask if item == canvas.instance_variable_get(:@width_drag_box) y = event.y width = ((MIDDLE - y) / 5).round throw :done, false if width < 0 canvas.instance_variable_set(:@width, width) set_arrow_shape(canvas) elsif item == canvas.instance_variable_get(:@shape_a_drag_box) x = event.x width = canvas.instance_variable_get(:@width) shape_a = ((RIGHT - x) / 10 / width).round throw :done, false if (shape_a < 0) || (shape_a > 30) width = canvas.instance_variable_set(:@shape_a, shape_a) set_arrow_shape(canvas) elsif item == canvas.instance_variable_get(:@shape_b_c_drag_box) change = false width = canvas.instance_variable_get(:@width) x = event.x shape_b = ((RIGHT - x) / 10 / width).round if (shape_b >= 0) && (shape_b <= 30) canvas.instance_variable_set(:@shape_b, shape_b) change = true end y = event.y shape_c = ((MIDDLE - y) * 2 / 10 / width).round if shape_c >= 0 canvas.instance_variable_set(:@shape_c, shape_c) change = true end set_arrow_shape(canvas) if change end true end end end end ���������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/scalability-demo.rb������������������������������������������0000755�0001750�0001750�00000012540�12147676243�021635� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # goocanvas/demo/scalability-demo.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "goocanvas" # the values behind the comments are the ones used in the C version # but as with them it takes more than 20 sec on my computer for the window # to show upm I decreased them a little N_GROUP_COLS = 15 #25 N_GROUP_ROWS = 10 #20 N_COLS = 10 N_ROWS = 10 PADDING = 10 ONLY_ONE = false def setup_canvas(canvas) root = canvas.root_item root.font = 'Sans 8' item_width = 400 item_height = 19 cell_width = item_width + PADDING * 2 cell_height = item_height + PADDING * 2 group_width = N_COLS * cell_width group_height = N_ROWS * cell_height total_width = N_GROUP_COLS * group_width total_height = N_GROUP_ROWS * group_height # We use -ve offsets to test if -ve coords are handled correctly. left_offset = -total_width / 2 top_offset = -total_height / 2 style = Goo::CanvasStyle.new color = Gdk::Color.parse("mediumseagreen") pattern = Cairo::SolidPattern.new(color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0) # NOTE: "Goo::CanvasStyle#fill_pattern=" doesn't work. (undefined method) # Substitution is "Goo::CanvasRect#fill_color=". #style.fill_pattern = pattern style2 = Goo::CanvasStyle.new color = Gdk::Color.parse("steelblue") pattern = Cairo::SolidPattern.new(color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0) # NOTE: "Goo::CanvasStyle#fill_pattern=" doesn't work. (undefined method) # Substitution is "Goo::CanvasRect#fill_color=". #style2.fill_pattern = pattern total_items = 0 N_GROUP_COLS.times do |group_i| N_GROUP_ROWS.times do |group_j| group_x = left_offset + (group_i * group_width); group_y = top_offset + (group_j * group_height); group = Goo::CanvasGroup.new(:parent => root) total_items += 1 group.translate(group_x, group_y) N_COLS.times do |i| N_ROWS.times do |j| item_x = (i * cell_width) + PADDING item_y = (j * cell_height) + PADDING rotation = i % 10 * 2 rotation_x = item_x + item_width / 2 rotation_y = item_y + item_height / 2 current_id = "#{group_x + item_x}, #{group_y + item_y}" item = Goo::CanvasRect.new(:parent => group, :x => item_x, :y => item_y, :width => item_width, :height => item_height) # NOTE: "Goo::CanvasStyle#fill_pattern=" doesn't work. (undefined method) # "Goo::CanvasRect#fill_color=" is substitution. item.fill_color = (j % 2) == 1 ? "mediumseagreen" : "steelblue" #item.style = (j % 2) == 1 ? style : style2 item.rotate(rotation, rotation_x, rotation_y) item.signal_connect('motion_notify_event') do puts "#{current_id} item received 'motion-notify' signal" end item = Goo::CanvasText.new(:parent => group, :text => current_id, :x => item_x + item_width / 2, :y => item_y + item_height / 2, :width => -1, :anchor => Goo::CanvasAnchorType::CENTER) item.rotate(rotation, rotation_x, rotation_y) total_items += 2 break if ONLY_ONE end break if ONLY_ONE end break if ONLY_ONE end break if ONLY_ONE end puts "Total items: #{total_items}" [ total_width, total_height, left_offset, top_offset ] end def create_canvas # Create the canvas. canvas = Goo::Canvas.new canvas.set_size_request(600, 450) start = Time.new total_width, total_height, left_offset, top_offset = setup_canvas(canvas) puts "Create Canvas Time Used: #{Time.new - start}" start = Time.new canvas.set_bounds(left_offset, top_offset, left_offset + total_width, top_offset + total_height) canvas.show first_time = true canvas.signal_connect("draw") do if first_time puts "Update Canvas Time Used: #{Time.new - start}" first_time = false end false end canvas end window = Gtk::Window.new(:toplevel) window.set_default_size(640, 600) window.show window.signal_connect('delete_event') { Gtk.main_quit } scrolled_win = Gtk::ScrolledWindow.new scrolled_win.show window.add(scrolled_win) GC.disable canvas = create_canvas scrolled_win.add(canvas) GC.enable Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/units-demo.rb������������������������������������������������0000755�0001750�0001750�00000010241�12147676243�020473� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # goocanvas/demo/units-demo.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require 'goocanvas' DATA = { :pixel => [ 100, 100, 200, 20, 10, 200, 310, 24 ], :points => [ 100, 100, 200, 20, 10, 200, 310, 24 ], :inch => [ 1, 1, 3, 0.5, 0.16, 3, 4, 0.3 ], :mm => [ 30, 30, 100, 10, 5, 80, 60, 10 ], } def setup_canvas(canvas, units, units_name) d = DATA[units] root = canvas.root_item item = Goo::CanvasRect.new(:parent => root, :x => d[0], :y => d[1], :width => d[2], :height => d[3]) item.signal_connect('motion_notify_event') do puts("item received 'motion-notify' signal") end item = Goo::CanvasText.new(:parent => root, :text => "This box is #{d[2]}x#{d[3]} #{units_name}", :x => d[0] + d[2] / 2.0, :y => d[1] + d[3] / 2.0, :width => -1, :anchor => :center, :font => "Sans #{d[4]}px") item = Goo::CanvasText.new(:parent => root, :text => "This font is #{d[7]} #{units_name} high", :x => d[5], :y => d[6], :width => -1, :anchor => :center, :font => "Sans #{d[7]}px") end def create_canvas(units, units_name) vbox = Gtk::Box.new(:vertical, 4) vbox.show hbox = Gtk::Box.new(:horizontal, 4) vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) hbox.show canvas = Goo::Canvas.new w = Gtk::Label.new('Zoom:') hbox.pack_start(w, :expand => false, :fill => false, :padding => 0) w.show adj = Gtk::Adjustment.new(1, 0.05, 100, 0.05, 0.5, 0.5) w = Gtk::SpinButton.new(adj, 0, 2) adj.signal_connect('value_changed') do |new_adj| canvas.scale = new_adj.value end w.set_size_request(50, -1) hbox.pack_start(w, :expand => false, :fill => false, :padding => 0) w.show scrolled_win = Gtk::ScrolledWindow.new vbox.pack_start(scrolled_win, :expand => true, :fill => true, :padding => 0) scrolled_win.show # Create the canvas. canvas.set_size_request(600, 450) setup_canvas(canvas, units, units_name) canvas.set_bounds(0, 0, 1000, 1000) canvas.units = units canvas.anchor = :center canvas.show scrolled_win.add(canvas) vbox end window = Gtk::Window.new(:toplevel) window.set_default_size(640, 600) window.show window.signal_connect('delete_event') { Gtk.main_quit } notebook = Gtk::Notebook.new notebook.show window.add(notebook) notebook.append_page(create_canvas(:pixel, 'pixels'), Gtk::Label.new('Pixels')) notebook.append_page(create_canvas(:points, 'points'), Gtk::Label.new('Points')) notebook.append_page(create_canvas(:inch, 'inches'), Gtk::Label.new('Inches')) notebook.append_page(create_canvas(:mm, 'millimeters'), Gtk::Label.new('Millimeters')) Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/sample/simple-demo.rb�����������������������������������������������0000755�0001750�0001750�00000004703�12147676243�020630� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # goocanvas/demo/simple-demo.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require 'goocanvas' # Create the window and widgets. window = Gtk::Window.new(:toplevel) window.set_default_size(640, 600) window.show window.signal_connect('delete_event') { Gtk.main_quit } scrolled_win = Gtk::ScrolledWindow.new scrolled_win.shadow_type = :in scrolled_win.show window.add(scrolled_win) canvas = Goo::Canvas.new canvas.set_size_request(600, 450) canvas.set_bounds(0, 0, 1000, 1000) canvas.show scrolled_win.add(canvas) root = canvas.root_item rect_item = Goo::CanvasRect.new(:parent => root, :x => 100, :y => 100, :width => 400, :height => 400, :line_width => 10.0, :radius_x => 20.0, :radius_y => 10.0, :stroke_color => 'yellow', :fill_color => 'red') rect_item.signal_connect('button_press_event') do puts("rect item received button press event") end text_item = Goo::CanvasText.new(:parent => root, :text => 'Hello World', :x => 300, :y => 300, :width => -1, :anchor => :center, :font => 'Sans 24') text_item.rotate(45, 300, 300) Gtk.main �������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/extconf.rb����������������������������������������������������������0000644�0001750�0001750�00000002230�11701304107�016546� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "goocanvas" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/goocanvas/Rakefile������������������������������������������������������������0000644�0001750�0001750�00000000667�12257552167�016256� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require 'gnome2-raketask' package = GNOME2Package.new do |_package| _package.summary = "Ruby/GooCanvas is a Ruby binding of GooCanvas." _package.description = "Ruby/GooCanvas is a Ruby binding of GooCanvas." _package.dependency.gem.runtime = ["gtk3", "gobject-introspection"] _package.win32.packages = ["goocanvas"] _package.win32.dependencies = [] end package.define_tasks �������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/��������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665517�014615� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/patches/������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�016240� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/patches/libtheora-1.1.1-use-lf-in-def.diff��������������������������0000644�0001750�0001750�00000007403�12257552167�024034� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������diff -ru libtheora-1.1.1.orig/win32/xmingw32/libtheoradec-all.def libtheora-1.1.1/win32/xmingw32/libtheoradec-all.def --- libtheora-1.1.1.orig/win32/xmingw32/libtheoradec-all.def 2009-07-14 08:55:00.000000000 +0900 +++ libtheora-1.1.1/win32/xmingw32/libtheoradec-all.def 2013-12-23 23:45:03.464282578 +0900 @@ -1,58 +1,58 @@ -EXPORTS -; Old alpha API - theora_version_string @ 1 - theora_version_number @ 2 - - theora_decode_header @ 3 - theora_decode_init @ 4 - theora_decode_packetin @ 5 - theora_decode_YUVout @ 6 - - theora_control @ 7 - - theora_packet_isheader @ 8 - theora_packet_iskeyframe @ 9 - - theora_granule_shift @ 10 - theora_granule_frame @ 11 - theora_granule_time @ 12 - - theora_info_init @ 13 - theora_info_clear @ 14 - - theora_clear @ 15 - - theora_comment_init @ 16 - theora_comment_add @ 17 - theora_comment_add_tag @ 18 - theora_comment_query @ 19 - theora_comment_query_count @ 20 - theora_comment_clear @ 21 - -; New theora-exp API - th_version_string @ 22 - th_version_number @ 23 - - th_decode_headerin @ 24 - th_decode_alloc @ 25 - th_setup_free @ 26 - th_decode_ctl @ 27 - th_decode_packetin @ 28 - th_decode_ycbcr_out @ 29 - th_decode_free @ 30 - - th_packet_isheader @ 31 - th_packet_iskeyframe @ 32 - - th_granule_frame @ 33 - th_granule_time @ 34 - - th_info_init @ 35 - th_info_clear @ 36 - - th_comment_init @ 37 - th_comment_add @ 38 - th_comment_add_tag @ 39 - th_comment_query @ 40 - th_comment_query_count @ 41 - th_comment_clear @ 42 +EXPORTS +; Old alpha API + theora_version_string @ 1 + theora_version_number @ 2 + + theora_decode_header @ 3 + theora_decode_init @ 4 + theora_decode_packetin @ 5 + theora_decode_YUVout @ 6 + + theora_control @ 7 + + theora_packet_isheader @ 8 + theora_packet_iskeyframe @ 9 + + theora_granule_shift @ 10 + theora_granule_frame @ 11 + theora_granule_time @ 12 + + theora_info_init @ 13 + theora_info_clear @ 14 + + theora_clear @ 15 + + theora_comment_init @ 16 + theora_comment_add @ 17 + theora_comment_add_tag @ 18 + theora_comment_query @ 19 + theora_comment_query_count @ 20 + theora_comment_clear @ 21 + +; New theora-exp API + th_version_string @ 22 + th_version_number @ 23 + + th_decode_headerin @ 24 + th_decode_alloc @ 25 + th_setup_free @ 26 + th_decode_ctl @ 27 + th_decode_packetin @ 28 + th_decode_ycbcr_out @ 29 + th_decode_free @ 30 + + th_packet_isheader @ 31 + th_packet_iskeyframe @ 32 + + th_granule_frame @ 33 + th_granule_time @ 34 + + th_info_init @ 35 + th_info_clear @ 36 + + th_comment_init @ 37 + th_comment_add @ 38 + th_comment_add_tag @ 39 + th_comment_query @ 40 + th_comment_query_count @ 41 + th_comment_clear @ 42 diff -ru libtheora-1.1.1.orig/win32/xmingw32/libtheoraenc-all.def libtheora-1.1.1/win32/xmingw32/libtheoraenc-all.def --- libtheora-1.1.1.orig/win32/xmingw32/libtheoraenc-all.def 2009-07-14 08:55:00.000000000 +0900 +++ libtheora-1.1.1/win32/xmingw32/libtheoraenc-all.def 2013-12-23 23:45:09.084147371 +0900 @@ -1,17 +1,17 @@ -EXPORTS -; Old alpha API - theora_encode_init @ 1 - theora_encode_YUVin @ 2 - theora_encode_packetout @ 3 - theora_encode_header @ 4 - theora_encode_comment @ 5 - theora_encode_tables @ 6 -; New theora-exp API - th_encode_alloc @ 7 - th_encode_ctl @ 8 - th_encode_flushheader @ 9 - th_encode_ycbcr_in @ 10 - th_encode_packetout @ 11 - th_encode_free @ 12 - TH_VP31_QUANT_INFO @ 13 - TH_VP31_HUFF_CODES @ 14 +EXPORTS +; Old alpha API + theora_encode_init @ 1 + theora_encode_YUVin @ 2 + theora_encode_packetout @ 3 + theora_encode_header @ 4 + theora_encode_comment @ 5 + theora_encode_tables @ 6 +; New theora-exp API + th_encode_alloc @ 7 + th_encode_ctl @ 8 + th_encode_flushheader @ 9 + th_encode_ycbcr_in @ 10 + th_encode_packetout @ 11 + th_encode_free @ 12 + TH_VP31_QUANT_INFO @ 13 + TH_VP31_HUFF_CODES @ 14 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/patches/libmad-0.15.1b-fix-mingw-build.diff�������������������������0000644�0001750�0001750�00000002245�11704226436�024200� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������diff -ruN libmad-0.15.1b.orig/AUTHORS libmad-0.15.1b/AUTHORS --- libmad-0.15.1b.orig/AUTHORS 1970-01-01 09:00:00.000000000 +0900 +++ libmad-0.15.1b/AUTHORS 2012-01-07 19:35:23.810029179 +0900 @@ -0,0 +1 @@ +for autoconf. diff -ruN libmad-0.15.1b.orig/ChangeLog libmad-0.15.1b/ChangeLog --- libmad-0.15.1b.orig/ChangeLog 1970-01-01 09:00:00.000000000 +0900 +++ libmad-0.15.1b/ChangeLog 2012-01-07 19:36:28.244351603 +0900 @@ -0,0 +1 @@ +for autoconf. diff -ruN libmad-0.15.1b.orig/Makefile.am libmad-0.15.1b/Makefile.am --- libmad-0.15.1b.orig/Makefile.am 2004-02-17 11:02:03.000000000 +0900 +++ libmad-0.15.1b/Makefile.am 2012-01-07 19:30:38.245466821 +0900 @@ -101,7 +101,7 @@ version_info = $(version_current):$(version_revision):$(version_age) -libmad_la_LDFLAGS = -version-info $(version_info) +libmad_la_LDFLAGS = -version-info $(version_info) -no-undefined mad.h: config.status config.h Makefile.am \ $(srcdir)/COPYRIGHT $(srcdir)/mad.h.sed $(exported_headers) diff -ruN libmad-0.15.1b.orig/NEWS libmad-0.15.1b/NEWS --- libmad-0.15.1b.orig/NEWS 1970-01-01 09:00:00.000000000 +0900 +++ libmad-0.15.1b/NEWS 2012-01-07 19:35:28.429908891 +0900 @@ -0,0 +1 @@ +for autoconf. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/ext/����������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�015367� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/ext/gstreamer/������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�017402� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/ext/gstreamer/rbgst.h�����������������������������������������������0000644�0001750�0001750�00000002012�12257552167�020667� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include <gst/gst.h> #include <rb-gobject-introspection.h> extern void Init_gstreamer (void); G_GNUC_INTERNAL extern void rb_gst_init_element_factory (void); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/ext/gstreamer/rbgst.c�����������������������������������������������0000644�0001750�0001750�00000012623�12257552167�020673� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgst.h" static gboolean name_equal(GIArgInfo *info, const gchar *target_name) { GITypeInfo type_info; GIBaseInfo *interface_info; const gchar *namespace; const gchar *name; gboolean equal_name_p = FALSE; g_arg_info_load_type(info, &type_info); interface_info = g_type_info_get_interface(&type_info); namespace = g_base_info_get_namespace(interface_info); name = g_base_info_get_name(interface_info); if (strcmp(namespace, "Gst") == 0 && strcmp(name, target_name) == 0) { equal_name_p = TRUE; } g_base_info_unref(interface_info); return equal_name_p; } static gboolean rg_gst_bus_func_callback(GstBus *bus, GstMessage *message, gpointer user_data) { RBGICallbackData *callback_data = user_data; VALUE rb_keep; ID id_call; CONST_ID(id_call, "call"); rb_keep = rb_funcall(callback_data->rb_callback, id_call, 2, GOBJ2RVAL(bus), BOXED2RVAL(message, GST_MINI_OBJECT_TYPE(message))); if (callback_data->metadata->scope_type == GI_SCOPE_TYPE_ASYNC) { rb_gi_callback_data_free(callback_data); } return RVAL2CBOOL(rb_keep); } static gpointer rg_gst_bus_func_callback_finder(GIArgInfo *info) { if (!name_equal(info, "BusFunc")) { return NULL; } return rg_gst_bus_func_callback; } static gboolean rg_gst_bus_sync_handler_callback(GstBus *bus, GstMessage *message, gpointer user_data) { RBGICallbackData *callback_data = user_data; VALUE rb_bus_sync_reply; ID id_call; CONST_ID(id_call, "call"); rb_bus_sync_reply = rb_funcall(callback_data->rb_callback, id_call, 2, GOBJ2RVAL(bus), BOXED2RVAL(message, GST_MINI_OBJECT_TYPE(message))); if (callback_data->metadata->scope_type == GI_SCOPE_TYPE_ASYNC) { rb_gi_callback_data_free(callback_data); } return RVAL2GENUM(rb_bus_sync_reply, GST_TYPE_BUS_SYNC_REPLY); } static gpointer rg_gst_bus_sync_handler_callback_finder(GIArgInfo *info) { if (!name_equal(info, "BusSyncHandler")) { return NULL; } return rg_gst_bus_sync_handler_callback; } static void rg_gst_tag_foreach_func_callback(const GstTagList *list, const gchar *tag, gpointer user_data) { RBGICallbackData *callback_data = user_data; ID id_call; CONST_ID(id_call, "call"); rb_funcall(callback_data->rb_callback, id_call, 2, /* * XXX: Use gst_tag_list_copy() instead if we don't trust * users. Users should not use destructive methods such as * #insert. If many users use these methods, we shuold use * gst_tag_list_copy(). */ BOXED2RVAL((GstTagList *)list, GST_MINI_OBJECT_TYPE(list)), CSTR2RVAL(tag)); if (callback_data->metadata->scope_type == GI_SCOPE_TYPE_ASYNC) { rb_gi_callback_data_free(callback_data); } } static gpointer rg_gst_tag_foreach_func_callback_finder(GIArgInfo *info) { if (!name_equal(info, "TagForeachFunc")) { return NULL; } return rg_gst_tag_foreach_func_callback; } static void rg_gst_value_list_r2g(VALUE from, GValue *to) { int i, n; if (NIL_P(from)) { return; } from = rbg_to_array(from); n = RARRAY_LEN(from); for (i = 0; i < n; i++) { VALUE rb_element; const RGObjClassInfo *class_info; GValue element = G_VALUE_INIT; rb_element = rb_ary_entry(from, i); class_info = RVAL2CINFO(rb_element); g_value_init(&element, class_info->gtype); rbgobj_rvalue_to_gvalue(rb_element, &element); gst_value_list_append_value(to, &element); } } static VALUE rg_gst_value_list_g2r(const GValue *from) { guint i, n; VALUE rb_values; n = gst_value_list_get_size(from); rb_values = rb_ary_new(); for (i = 0; i < n; i++) { const GValue *value; VALUE rb_value; value = gst_value_list_get_value(from, i); rb_value = rbgobj_gvalue_to_rvalue(value); rb_ary_push(rb_values, rb_value); } return rb_values; } void Init_gstreamer (void) { rb_gi_callback_register_finder(rg_gst_bus_func_callback_finder); rb_gi_callback_register_finder(rg_gst_bus_sync_handler_callback_finder); rb_gi_callback_register_finder(rg_gst_tag_foreach_func_callback_finder); rbgobj_register_r2g_func(GST_TYPE_LIST, rg_gst_value_list_r2g); rbgobj_register_g2r_func(GST_TYPE_LIST, rg_gst_value_list_g2r); rb_gst_init_element_factory(); } �������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/ext/gstreamer/extconf.rb��������������������������������������������0000644�0001750�0001750�00000003616�12137115065�021370� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin extconf.rb for Ruby/GStreamer extention library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "gstreamer" package_id = "gstreamer-1.0" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end ["glib2", "gobject-introspection"].each do |package| directory = "#{package}#{version_suffix}" build_base_path = "#{directory}/tmp/#{RUBY_PLATFORM}" package_library_name = package.gsub(/-/, "_") build_dir = "#{build_base_path}/#{package_library_name}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id, :debian => "libgstreamer1.0-dev", :redhat => "gstreamer-devel", :homebrew => "gstreamer", :macports => "gstreamer") exit(false) end unless PKGConfig.have_package("gobject-introspection-1.0") exit(false) end create_pkg_config_file("Ruby/GStreamer", package_id) $defs << "-DRUBY_GST_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/ext/gstreamer/rbgst-element-factory.c�������������������������������0000644�0001750�0001750�00000004041�12257552167�023762� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgst.h" #define RG_TARGET_NAMESPACE cElementFactory #define SELF(object) (GST_ELEMENT_FACTORY(RVAL2GOBJ(object))) static VALUE cStaticPadTemplate; static VALUE rg_static_pad_templates(VALUE self) { GstElementFactory *factory = SELF(self); const GList *templates; VALUE rb_templates; rb_templates = rb_ary_new(); templates = gst_element_factory_get_static_pad_templates(factory); for (; templates; templates = g_list_next(templates)) { GstStaticPadTemplate *template = templates->data; VALUE rb_template; rb_template = rb_funcall(cStaticPadTemplate, rb_intern("new"), 0); memcpy(DATA_PTR(rb_template), template, sizeof(GstStaticPadTemplate)); rb_ary_push(rb_templates, rb_template); } return rb_templates; } void rb_gst_init_element_factory(void) { VALUE mGst; VALUE RG_TARGET_NAMESPACE; mGst = rb_const_get(rb_cObject, rb_intern("Gst")); RG_TARGET_NAMESPACE = rb_const_get(mGst, rb_intern("ElementFactory")); cStaticPadTemplate = rb_const_get(mGst, rb_intern("StaticPadTemplate")); rb_remove_method(RG_TARGET_NAMESPACE, "static_pad_templates"); RG_DEF_METHOD(static_pad_templates, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/ext/gstreamer/depend������������������������������������������������0000644�0001750�0001750�00000000251�12064346475�020561� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-gstreamer.pc $(pkgconfigdir); \ fi �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/COPYING.LIB���������������������������������������������������������0000644�0001750�0001750�00000063642�12257552167�016264� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�015357� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�016154� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/element-factory.rb������������������������������������������0000644�0001750�0001750�00000002027�12257552167�021600� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gst class ElementFactory def long_name get_metadata("long-name") end def klass get_metadata("klass") end def description get_metadata("description") end def author get_metadata("author") end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/registry.rb�������������������������������������������������0000644�0001750�0001750�00000002100�12257552167�020342� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gst class Registry alias_method :plugins, :plugin_list def get_features(name_or_type) if name_or_type.is_a?(GLib::Type) type = name_or_type get_feature_list(type) else name = name_or_type get_feature_list_by_plugin(name) end end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/controller-loader.rb����������������������������������������0000644�0001750�0001750�00000001527�12257552167�022135� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gst class ControllerLoader < GObjectIntrospection::Loader end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/element.rb��������������������������������������������������0000644�0001750�0001750�00000002546�12257552167�020141� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gst class Element def stop set_state(State::NULL) end def ready set_state(State::READY) end def pause set_state(State::PAUSED) end def play set_state(State::PLAYING) end alias_method :link_element, :link def link_elements(*elements) elements.each do |element| link_element(element) end end alias_method :link, :link_elements def >>(element) link_element(element) element end alias_method :flags_raw, :flags def flags ElementFlags.new(flags_raw) end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/structure.rb������������������������������������������������0000644�0001750�0001750�00000002002�12257552167�020533� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gst class Structure def fields n_fields.times.collect do |i| field_name = nth_field_name(i) value = get_value(field_name) value.extend(ValueMethods) [field_name, value] end end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/base-loader.rb����������������������������������������������0000644�0001750�0001750�00000001521�12257552167�020656� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gst class BaseLoader < GObjectIntrospection::Loader end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/bin.rb������������������������������������������������������0000644�0001750�0001750�00000002047�12137115065�017241� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gst class Bin alias_method :add_element, :add def add_elements(*elements) elements.each do |element| add_element(element) end end alias_method :add, :add_elements def <<(element) add_element(element) self end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/bus.rb������������������������������������������������������0000644�0001750�0001750�00000002653�12142464437�017273� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gst class Bus alias_method :add_watch_full, :add_watch def add_watch(priority=GLib::PRIORITY_DEFAULT, &block) add_watch_full(priority, &block) end def sync_handler(&block) @sync_handler = lambda do |bus, message| begin block.call(bus, message) rescue Exception $stderr.puts("An exception is raised in " + "#{self.class}\##{__method__} callback: #{block}") $stderr.puts("#{$!.class}: #{$!.message}") $stderr.puts($@) BusSyncReply::DROP end end set_sync_handler(&@sync_handler) end private :set_sync_handler end end �������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/caps.rb�����������������������������������������������������0000644�0001750�0001750�00000001612�12257552167�017427� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gst class Caps def structures size.times.collect do |i| get_structure(i) end end end end ����������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst/plugin-feature.rb�������������������������������������������0000644�0001750�0001750�00000001605�12257552167�021432� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Gst class PluginFeature alias_method :rank_raw, :rank def rank Rank.new(rank_raw) end end end ���������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/lib/gst.rb����������������������������������������������������������0000644�0001750�0001750�00000011662�12257552167�016507� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "English" require "gobject-introspection" base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) if vendor_dir.exist? require "cairo" require "gdk_pixbuf2" require "pango" end module Gst LOG_DOMAIN = "GStreamer" GLib::Log.set_log_domain(LOG_DOMAIN) class << self def const_missing(name) init() if const_defined?(name) const_get(name) else super end end def method_missing(name, *args, &block) init() if respond_to?(name) __send__(name, *args, &block) else super end end def init(*argv) loader = Loader.new(self, argv) loader.load("Gst") require "gst/bin" require "gst/bus" require "gst/caps" require "gst/element" require "gst/element-factory" require "gst/plugin-feature" require "gst/registry" require "gst/structure" init_base init_controller class << self remove_method(:init) remove_method(:const_missing) remove_method(:method_missing) end end private def init_base require "gst/base-loader" base_loader = BaseLoader.new(self) base_loader.load("GstBase") end def init_controller require "gst/controller-loader" controller_loader = ControllerLoader.new(self) controller_loader.load("GstController") end end class Loader < GObjectIntrospection::Loader def initialize(base_module, init_arguments) super(base_module) @init_arguments = init_arguments end private def pre_load(repository, namespace) call_init_function(repository, namespace) define_value_modules end def call_init_function(repository, namespace) init_check = repository.find(namespace, "init_check") arguments = [ 1 + @init_arguments.size, [$0] + @init_arguments, ] succeeded, argc, argv, error = init_check.invoke(:arguments => arguments) @init_arguments.replace(argv[1..-1]) raise error unless succeeded end def define_value_modules @value_functions_module = Module.new @value_methods_module = Module.new @base_module.const_set("ValueFunctions", @value_functions_module) @base_module.const_set("ValueMethods", @value_methods_module) end def post_load(repository, namespace) require_extension self.class.start_callback_dispatch_thread end def require_extension begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/gstreamer.so" rescue LoadError require "gstreamer.so" end end def load_function_info(info) case info.name when "init" # ignore when /\Avalue_/ method_name = $POSTMATCH load_value_function_info(info, method_name) else super end end def load_value_function_info(info, method_name) value_functions_module = @value_functions_module define_module_function(value_functions_module, method_name, info) @value_methods_module.module_eval do define_method(method_name) do |*arguments, &block| value_functions_module.send(method_name, self, *arguments, &block) end end end RENAME_MAP = { "uri_protocol_is_valid" => "valid_uri_protocol?", "uri_protocol_is_supported" => "supported_uri_protocol?", "uri_is_valid" => "valid_uri?", "uri_has_protocol" => "uri_has_protocol?", } def rubyish_method_name(function_info) RENAME_MAP[function_info.name] || super end UNLOCK_GVL_METHODS = { "Gst::Element#set_state" => true, "Gst::Element#get_state" => true, "Gst::Element#query_state" => true, "Gst::Element#send_event" => true, } def should_unlock_gvl?(function_info, klass) UNLOCK_GVL_METHODS["#{klass}\##{function_info.name}"] || super end end end ������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/sample/�������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�016072� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/sample/text-color-example.rb����������������������������������������0000755�0001750�0001750�00000005413�12147676243�022156� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # -*- coding: utf-8 -*- # # text-color-example.rb # # Builds a pipeline with [videotestsrc ! textoverlay ! ximagesink] and # modulates color, text and text pos. # # Needs gst-plugin-base installed. # # This sample code is a port of # gstreamer/tests/examples/controller/text-color-example.c. It is # licensed under the terms of the GNU Library General Public License, # version 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gst" bin = Gst::Pipeline.new("pipeline") clock = bin.clock src = Gst::ElementFactory.make("videotestsrc", nil) raise "need videotestsrc from gst-plugins-base" if src.nil? src.pattern = 10 # checkers-8 text = Gst::ElementFactory.make("textoverlay", nil) raise "need textoverlay from gst-plugins-base" if text.nil? text.text = "GStreamer rocks!" text.font_desc = "Sans, 30" text.halignment = 4 # position text.valignment = 3 # position sink = Gst::ElementFactory.make("ximagesink", nil) raise "need ximagesink from gst-plugins-base" if sink.nil? bin << src << text << sink src >> text >> sink # setup control sources cs = Gst::LFOControlSource.new cs.frequency = 0.11 cs.amplitude = 0.2 cs.offset = 0.5 text.add_control_binding(Gst::DirectControlBinding.new(text, "xpos", cs)) cs = Gst::LFOControlSource.new cs.frequency = 0.04 cs.amplitude = 0.4 cs.offset = 0.5 text.add_control_binding(Gst::DirectControlBinding.new(text, "ypos", cs)) cs_r = Gst::LFOControlSource.new cs_r.frequency = 0.19 cs_r.amplitude = 0.5 cs_r.offset = 0.5 cs_g = Gst::LFOControlSource.new cs_g.frequency = 0.27 cs_g.amplitude = 0.5 cs_g.offset = 0.5 cs_b = Gst::LFOControlSource.new cs_b.frequency = 0.13 cs_b.amplitude = 0.5 cs_b.offset = 0.5 text.add_control_binding(Gst::ARGBControlBinding.new(text, "color", nil, cs_r, cs_g, cs_b)) # run for 10 seconds clock_id = clock.new_single_shot_id(clock.time + (30 * Gst::SECOND)) bin.play wait_ret, jitter = Gst::Clock.id_wait(clock_id) $stderr.puts "Clock.id_wait returned: #{wait_ret}" if wait_ret != Gst::ClockReturn::OK bin.stop �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/sample/typefind.rb��������������������������������������������������0000755�0001750�0001750�00000005656�12147676243�020260� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # -*- coding: utf-8 -*- # # This sample code is a port of # gstreamer/tests/examples/typefind/typefind.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Here is the original copyright header: # Copyright (C) <2005> Stefan Kost # Copyright (C) <2006> Tim-Philipp Müller # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gst" require "rexml/document" def event_loop(pipe) running = true bus = pipe.bus while running do message = bus.poll(Gst::MessageType::ANY, Gst::CLOCK_TIME_NONE) raise "message nil" if message.nil? case message.type when Gst::MessageType::EOS running = false when Gst::MessageType::WARNING warning, debug = message.parse_warning puts "Debugging info: #{debug || 'none'}" puts "Warning: #{warning.message}" when Gst::MessageType::ERROR error, debug = message.parse_error puts "Debugging info: #{debug || 'none'}" puts "Error: #{error.message}" running = false end end end if ARGV.length < 1 puts "usage: #{$0} <filename>" exit(false) end # create a new pipeline to hold the elements pipeline = Gst::Pipeline.new("pipeline") raise "'pipeline' gstreamer plugin missing" if pipeline.nil? # create a file reader filesrc = Gst::ElementFactory.make("filesrc", "file_source") raise "'filesrc' gstreamer plugin missing" if filesrc.nil? filesrc.location = ARGV.first typefind = Gst::ElementFactory.make("typefind", "typefind") raise "'typefind' gstreamer plugin missing" if typefind.nil? sink = Gst::ElementFactory.make("fakesink", "sink") raise "'fakesink' gstreamer plugin missing" if sink.nil? # add objects to the main pipeline pipeline << filesrc << typefind << sink typefind.signal_connect("have-type") do |element, probability, caps| caps_str = caps.to_s xml = REXML::Document.new xml << REXML::XMLDecl.new capabilities = xml.add_element("Capabilities") cap1 = capabilities.add_element("Cap1") cap1.add_text(caps_str) xml.write($stdout, 2) puts end filesrc >> typefind >> sink # start playing pipeline.play # Run event loop listening for bus messages until EOS or ERROR event_loop(pipeline) # stop the bin pipeline.stop ����������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/sample/queue.rb�����������������������������������������������������0000755�0001750�0001750�00000005445�12147676243�017556� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # -*- coding: utf-8 -*- # # This sample code is a port of # gstreamer/tests/examples/queue/queue.c. It is licensed under # the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gst" # This example uses the queue element to create a buffer between 2 elements. # The scheduler automatically uses 2 threads, 1 to feed and another to consume # data from the queue buffer # Event loop to listen to events posted on the Gst::Bus from the pipeline. Exits # on EOS or ERROR events def event_loop(pipe) running = true bus = pipe.bus while running message = bus.poll(Gst::MessageType::ANY, -1) case message.type when Gst::MessageType::EOS running = false when Gst::MessageType::WARNING warning, debug = message.parse_warning puts "Debugging info: #{debug || 'none'}" puts "Warning: #{warning.message}" when Gst::MessageType::ERROR error, debug = message.parse_error puts "Debugging info: #{debug || 'none'}" puts "Error: #{error.message}" running = false end end end if ARGV.length < 1 puts "usage: #{$0} <filename>" exit(false) end # create a new pipeline to hold the elements pipeline = Gst::Pipeline.new("pipeline") raise "'pipeline' gstreamer plugin missing" if pipeline.nil? # create a disk reader filesrc = Gst::ElementFactory.make("filesrc", "disk_source") raise "'filesrc' gstreamer plugin missing" if filesrc.nil? filesrc.location = ARGV.first decode = Gst::ElementFactory.make("mad", "decode") raise "'mad' gstreamer plugin missing" if decode.nil? queue = Gst::ElementFactory.make("queue", "queue") raise "'queue' gstreamer plugin missing" if queue.nil? # and an audio sink audiosink = Gst::ElementFactory.make("alsasink", "play_audio") raise "'alsasink' gstreamer plugin missing" if audiosink.nil? # add objects to the main pipeline pipeline << filesrc << decode << queue << audiosink filesrc >> decode >> queue >> audiosink # start playing pipeline.play # listen for EOS event_loop(pipeline) pipeline.stop ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/sample/mp3parselaunch.rb��������������������������������������������0000755�0001750�0001750�00000004053�12147676243�021351� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # -*- coding: utf-8 -*- # # This sample code is a port of # gstreamer/tests/examples/launch/mp3parselaunch.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gst" def event_loop(pipe) running = true bus = pipe.bus while running message = bus.poll(Gst::MessageType::ANY, Gst::CLOCK_TIME_NONE) raise "message nil" if message.nil? case message.type when Gst::MessageType::EOS running = false when Gst::MessageType::WARNING warning, debug = message.parse_warning puts "Debugging info: #{debug || 'none'}" puts "Warning: #{warning.message}" when Gst::MessageType::ERROR error, debug = message.parse_error puts "Debugging info: #{debug || 'none'}" puts "Error: #{error.message}" running = false end end end if ARGV.length < 1 puts "usage: #{$0} <mp3 file>" exit(false) end bin, error = Gst.parse_launch("filesrc name=my_filesrc ! mad ! autoaudiosink") if bin.nil? $stderr.puts "Parse error: #{error.message}" exit(false) end filesrc = bin.get_by_name("my_filesrc") filesrc.location = ARGV[0] # start playing bin.play # Run event loop listening for bus messages until EOS or ERROR event_loop(bin) # stop the bin bin.stop �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/sample/gst-inspect.rb�����������������������������������������������0000755�0001750�0001750�00000027546�12257552167�020700� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/evn ruby # # This sample code is a port of gstreamer/tools/gst-inspect.c. It is # licensed under the terms of the GNU Library General Public License, # version 2 or (at your option) later. # # The followin is the original code's copyright notation: # Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> # 2000 Wim Taymans <wtay@chello.be> # 2004 Thomas Vander Stichele <thomas@apestaart.org> # # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "optparse" require "ostruct" require "gst" def parse(argv) options = OpenStruct.new options.print_all = false options.print_auto_install_info = false opts = OptionParser.new do |opts| opts.banner += " [ELEMENT-NAME|PLUGIN-NAME]" opts.version = Gst.version opts.separator("") opts.on("-a", "--print-all", "Print all elements") do options.print_all = true end opts.on("--print-plugin-auto-install-info", "Print a machine-parsable list of features", "the specified plugin provides.", "Useful in connection with external", "automatic plugin installation mechanisms") do options.print_auto_install_info = true end end opts.parse!(argv) [options, argv.first] end class Inspector def initialize @prefix = "" end def print_list(print_all) plugins = {} n_features = 0 each_feature do |plugin, feature| plugins[plugin.name] = nil n_features += 1 if print_all if feature.is_a?(Gst::ElementFactory) print_element_factory(feature, true) end else print_feature(plugin, feature) end end puts puts("Total count: #{plugins.size} plugins, #{n_features} features") end def print_element(name) factory = Gst::ElementFactory.find(name) print_element_factory(factory, false) end private def puts(*args) if args.empty? super(@prefix) else super(*(args.collect {|arg| "#{@prefix}#{arg}"})) end end def prefix(new_prefix) prefix, @prefix = @prefix, new_prefix yield ensure @prefix = prefix end def each_feature registry = Gst::Registry.get registry.plugins.sort_by {|plugin| plugin.name}.each do |plugin| features = registry.get_features(plugin.name) features.sort_by {|feature| feature.name}.each do |feature| yield(plugin, feature) end end end def print_factory_details_info(factory) puts("Factory Details:", " Rank:\t\t#{factory.rank.nick} (#{factory.rank.to_i})", " Long name:\t#{factory.long_name}", " Class:\t#{factory.klass}", " Description:\t#{factory.description}", " Author(s):\t#{factory.author}", "") end def print_plugin_info(name) return if name.nil? registry = Gst::Registry.get plugin = registry.find_plugin(name) return if plugin.nil? puts("Plugin Details:", " Name:\t\t\t#{plugin.name}", " Description:\t\t#{plugin.description}", " Filename:\t\t#{plugin.filename || '(null)'}", " Version:\t\t#{plugin.version}", " License:\t\t#{plugin.license}", " Source module:\t#{plugin.source}") release_date = plugin.release_date_string if release_date puts(" Source release date:\t#{release_date}") end puts(" Binary package:\t#{plugin.package}", " Origin URL:\t\t#{plugin.origin}", "") end def print_hierarchy(element) ancestors = [] type = element.gtype while type ancestors << type type = type.parent end ancestors.reverse.each_with_index do |klass, i| if i.zero? mark = "" else mark = " " + (" " * (i - 1)) + "+----" end puts("#{mark}#{klass.name}") end puts end def print_interfaces(element) interfaces = element.gtype.interfaces return if interfaces.empty? puts("Implemented Interfaces:") interfaces.each do |interface| puts(" #{interface.name}") end puts end def print_caps(caps) if caps.any? puts("ANY") return end if caps.empty? puts("EMPTY") return end caps.structures.each do |structure| puts(structure.name) structure.fields.each do |name, value| puts(" %15s: %s" % [name, value.serialize]) end end end def print_pad_template_info(template) prefix("#{@prefix} ") do puts("#{template.direction.nick.upcase} template: '#{template.name_template}'") prefix("#{@prefix} ") do if template.presence == Gst::PadPresence::REQUEST puts("Availability: On request") else puts("Availability: #{template.presence.nick.capitalize}") end end end caps = template.caps return if caps.nil? prefix("#{@prefix} ") do puts("Capabilities:") prefix("#{@prefix} ") do print_caps(caps) end end puts end def print_pad_templates_info(element, factory) puts("Pad Templates:") templates = factory.static_pad_templates if templates.empty? puts(" none") return end templates.each do |template| print_pad_template_info(template) end end def print_element_flag_info(element) puts("Element Flags:") puts(" no flags set") puts return unless element.is_a?(Gst::Bin) puts("Bin Flags:") puts(" no flags set") puts end def print_implementation_info(element) puts("Element Implementation:") puts(" not supported") puts end def print_clocking_info(element) if !element.flags.require_clock? and !element.flags.provide_clock? and element.clock.nil? puts("Element has no clocking capabilities.") return end puts("Clocking Interaction:") puts(" element requires a clock") if element.flags.require_clock? if element.flags.provide_clock? clock = element.clock if clock.nil? puts(" element is supported tot provide a clock but returned nil") else puts(" element provides a clock: #{clock.name}") end end puts end def print_index_info(element) if element.flags.indexable? puts("Indexing capabilities:") puts(" element can do indexing") else puts("Element has no indexing capabilities.") end puts end def uri_type(element) case element.uri_type when Gst::URIType::SRC "source" when Gst::URIType::SINK "sink" else "unknown" end end def print_uri_handler_info(element) if element.is_a?(Gst::URIHandler) puts("URI handling capabilities:") puts(" Element can act as #{uri_type(element)}.") protocols = element.protocols if protocols.empty? puts(" No supported URI protocols") else puts(" Supported URI protocols:") protocols.each do |protocol| puts(" #{protocol}") end end else puts("Element has no URI handling capabilities.") end puts end def print_pad_info(element) puts("Pads:") pads = element.pads if pads.empty? puts(" none") return end pads.each do |pad| prefix("#{@prefix} ") do puts("#{pad.direction.nick.upcase}: '#{pad.name}'") prefix("#{@prefix} ") do template = pad.template puts("Pad Template: '#{template.name}'") if template caps = pad.caps break if caps.nil? puts("Capabilities:") prefix("#{@prefix} ") do print_caps(caps) end end end end puts end def print_element_properties_info(element) puts("Element Properties:") properties = element.class.properties if properties.empty? puts(" none") return end properties.each do |name| param = element.class.property(name) puts(" %-20s: %s" % [param.name, param.blurb]) flags = [] flags << "readable" if param.readable? flags << "writable" if param.writable? # flags << "controllable" if param.controllable? prefix("#{@prefix}#{' ' * 23} ") do puts("flags: #{flags.join(', ')}") description = "" type_name = param.value_type.name description << "#{type_name}." if param.readable? case param.gtype when GLib::Type["GParamObject"] # do nothing else default_value = element.get_property(name) description << " Default: #{default_value.inspect}" end else description << " Write only" end puts(description) end end puts end def print_signal_info(element, signal) args = ["object(#{element.class})"] signal.param_types.each_with_index do |name, i| args << "arg#{i}(#{name})" end args = args.join(", ") signature = "{|#{args}| ...} # => #{signal.return_type}" puts(" #{signal.name.inspect}: #{signature}") end def print_signals_info(element) signals = [] actions = [] element.class.signals.each do |name| signal = element.class.signal(name) next if signal.owner >= Gst::Element if signal.action? actions << signal else signals << signal end end [[signals, "Signals"], [actions, "Actions"]].each do |target_signals, description| unless target_signals.empty? puts("Element #{description}:") target_signals.each do |signal| print_signal_info(element, signal) end end end puts end def print_children_info(element) return unless element.is_a?(Gst::Bin) children = element.children return if children.empty? puts("Children:") children.each do |child| puts(" #{child.name}") end end def print_element_factory(factory, print_names) factory = factory.load if factory.nil? puts("element plugin (#{factory.name}) couldn't be loaded\n") return end element = factory.create prefix(print_names ? "#{factory.name}: " : "") do print_factory_details_info(factory) print_plugin_info(factory.plugin.name) print_hierarchy(element) print_interfaces(element) print_pad_templates_info(element, factory) puts print_element_flag_info(element) print_implementation_info(element) print_clocking_info(element) print_index_info(element) print_uri_handler_info(element) print_pad_info(element) print_element_properties_info(element) print_signals_info(element) print_children_info(element) end end def print_feature(plugin, feature) prefix("#{plugin.name}: #{feature.name}") do case feature when Gst::ElementFactory puts(": #{feature.long_name}") when Gst::TypeFindFactory if feature.extensions.empty? message = "no extensions" else message = feature.extensions.join(", ") end puts(": #{message}") else puts(" (#{feature.gtype})") end end end end options, element_name = parse(ARGV) inspector = Inspector.new if element_name inspector.print_element(element_name) else inspector.print_list(options.print_all) end ����������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/sample/audio-example.rb���������������������������������������������0000755�0001750�0001750�00000004463�12147676243�021163� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # -*- coding: utf-8 -*- # # audio-example.rb # # Builds a pipeline with [ audiotestsource ! autoaudiosink ] and sweeps # frequency and volume. # # Needs gst-plugin-base + gst-plugins-good installed. # # This sample code is a port of # gstreamer/tests/examples/controller/audio-example.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gst" bin = Gst::Pipeline.new("pipeline") clock = bin.clock src = Gst::ElementFactory.make("audiotestsrc", nil) raise "need audiotestsrc from gst-plugins-base" if src.nil? sink = Gst::ElementFactory.make("autoaudiosink", nil) raise "need autoaudiosink from gst-plugins-good" if sink.nil? bin << src << sink src >> sink # setup control sources cs1 = Gst::InterpolationControlSource.new cs2 = Gst::InterpolationControlSource.new src.add_control_binding(Gst::DirectControlBinding.new(src, "volume", cs1)) src.add_control_binding(Gst::DirectControlBinding.new(src, "freq", cs2)) # set interpolation mode cs1.mode = Gst::InterpolationMode::LINEAR cs2.mode = Gst::InterpolationMode::LINEAR # set control values cs1.set(0 * Gst::SECOND, 0.0) cs1.set(5 * Gst::SECOND, 1.0) cs2.set(0 * Gst::SECOND, 220.0 / 20000.0) cs2.set(3 * Gst::SECOND, 3520.0 / 20000.0) cs2.set(6 * Gst::SECOND, 440.0 / 20000.0) # run for 7 seconds clock_id = clock.new_single_shot_id(clock.time + (7 * Gst::SECOND)) bin.play wait_ret, jitter = Gst::Clock.id_wait(clock_id) $stderr.puts "Clock::id_wait returned: #{wait_ret}" if wait_ret != Gst::ClockReturn::OK bin.stop �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/sample/framestep1.rb������������������������������������������������0000755�0001750�0001750�00000010251�12147676243�020470� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # -*- coding: utf-8 -*- # # This sample code is a port of # gstreamer/tests/examples/stepping/framestep1.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gst" def event_loop(pipe) running = true bus = pipe.bus while running message = bus.timed_pop_filtered(Gst::CLOCK_TIME_NONE, Gst::MessageType::ANY) raise "message nil" if message.nil? case message.type when Gst::MessageType::EOS puts "got EOS" running = false when Gst::MessageType::WARNING warning, debug = message.parse_warning puts "Debugging info: #{debug || 'none'}" puts "Warning: #{warning.message}" when Gst::MessageType::ERROR error, debug = message.parse_error puts "Debugging info: #{debug || 'none'}" puts "Error: #{error.message}" running = false when Gst::MessageType::STEP_DONE format, amount, rate, flush, intermediate, duration, eos = message.parse_step_done if format == Gst::Format::DEFAULT puts "step done: #{gst_time(duration)} skipped in #{gst_time(amount)} frames" else puts "step done: #{gst_time(duration)} skipped" end running = false end end end def gst_time(time) Time.at(time / 1000000000.0).utc.strftime("%H:%M:%S.%N") end # create a new bin to hold the elements bin = Gst::Pipeline.new("pipeline") raise "'pipeline' gstreamer plugin missing" if bin.nil? # create a fake source videotestsrc = Gst::ElementFactory.make("videotestsrc", "videotestsrc") raise "'videotestsrc' gstreamer plugin missing" if videotestsrc.nil? videotestsrc.num_buffers = 10 # and a fake sink appsink = Gst::ElementFactory.make("appsink", "appsink") raise "'appsink' gstreamer plugin missing" if appsink.nil? appsink.emit_signals = true appsink.sync = true appsink.signal_connect("new-preroll") do |appsink| # signalled when a new preroll buffer is available sample = appsink.pull_preroll puts "have new-preroll sample #{sample}, timestamp #{gst_time(sample.buffer.pts)}" Gst::FlowReturn::OK end # add objects to the main pipeline bin << videotestsrc << appsink # link the elements videotestsrc >> appsink # go to the PAUSED state and wait for preroll puts "prerolling first frame" bin.pause bin.get_state(Gst::CLOCK_TIME_NONE) # step two frames, flush so that new preroll is queued puts "stepping three frames" unless bin.send_event(Gst::Event.new(Gst::Format::BUFFERS, 2, 1.0, true, false)) raise "Failed to send STEP event!" end # blocks and returns when we received the step done message event_loop(bin) # wait for step to really complete bin.get_state(Gst::CLOCK_TIME_NONE) result, pos = bin.query_position(Gst::Format::TIME) puts "stepped two frames, now at #{gst_time(pos)}" # step 3 frames, flush so that new preroll is queued puts "stepping 120 milliseconds" unless bin.send_event(Gst::Event.new(Gst::Format::TIME, 120 * Gst::MSECOND, 1.0, true, false)) raise "Failed to send STEP event!" end # blocks and returns when we received the step done message event_loop(bin) # wait for step to really complete bin.get_state(Gst::CLOCK_TIME_NONE) result, pos = bin.query_position(Gst::Format::TIME) puts "stepped 120ms frames, now at #{gst_time(pos)}" puts "playing until EOS" bin.play # Run event loop listening for bus messages until EOS or ERROR event_loop(bin) puts "finished" # stop the bin bin.stop �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/sample/stream-status.rb���������������������������������������������0000755�0001750�0001750�00000005670�12147676243�021246� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # -*- coding: utf-8 -*- # # This sample code is a port of # gstreamer/tests/examples/streams/stream-status.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gst" def event_loop(bus, pipe) loop do message = bus.poll(Gst::MessageType::ANY, Gst::CLOCK_TIME_NONE) raise "message nil" if message.nil? case message.type when Gst::MessageType::EOS puts "received EOS" return when Gst::MessageType::WARNING warning, debug = message.parse_warning puts "#{message} #{warning.message}" when Gst::MessageType::ERROR error, debug = message.parse_error puts "#{message} #{error.message}" return end end end # create a new bin to hold the elements bin = Gst::Pipeline.new("pipeline") raise "'pipeline' gstreamer plugin missing" if bin.nil? # create a source fakesrc = Gst::ElementFactory.make("fakesrc", "fakesrc") raise "'fakesrc' gstreamer plugin missing" if fakesrc.nil? # and a sink fakesink = Gst::ElementFactory.make("fakesink", "fakesink") raise "'fakesink' gstreamer plugin missing" if fakesink.nil? # add objects to the main pipeline bin << fakesrc << fakesink # link the elements fakesrc >> fakesink # get the bus, we need to install a sync handler bin.bus.sync_handler do |bus, message| case message.type when Gst::MessageType::STREAM_STATUS type, owner = message.parse_stream_status val = message.stream_status_object puts "type: #{type}" puts "source: #{message.src.path_string}" puts "owner: #{owner.path_string}" puts "object: type #{val.type.name}, value #{val.value}" # see if we know how to deal with this object if val.type == Gst::Task task = val.value end case type when Gst::StreamStatusType::CREATE puts "created task #{task}" when Gst::StreamStatusType::ENTER # puts "raising task priority" # setpriority(PRIO_PROCESS, 0, -10) when Gst::StreamStatusType::LEAVE end end Gst::BusSyncReply::PASS end # start playing bin.play # run event loop listening for bus messages until EOS or ERROR event_loop(bus, bin) # stop the bin bin.stop ������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/sample/helloworld.rb������������������������������������������������0000755�0001750�0001750�00000003700�12147676243�020575� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # gstreamer/tests/examples/helloworld/helloworld.c. It is licensed # under the terms of the GNU Library General Public License, version # 2 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gst" if ARGV.length < 1 puts "usage: #{$0} <media file or uri>" exit(false) end playbin = Gst::ElementFactory.make("playbin") if playbin.nil? puts "'playbin' gstreamer plugin missing" exit(false) end # take the commandline argument and ensure that it is a uri if Gst.valid_uri?(ARGV.first) uri = ARGV.first else uri = Gst.filename_to_uri(ARGV.first) end playbin.uri = uri # create and event loop feed gstreamer bus messages to it loop = GLib::MainLoop.new bus = playbin.bus bus.add_watch do |bus, message| case message.type when Gst::MessageType::EOS puts "End-of-stream" loop.quit when Gst::MessageType::ERROR error, debug = message.parse_error puts "Debugging info: #{debug || 'none'}" puts "Error: #{error.message}" loop.quit end true end # start play back and listed to events playbin.play begin loop.run rescue Interrupt puts "Interrupt" rescue => error puts "Error: #{error.message}" ensure playbin.stop end ����������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/README.md�����������������������������������������������������������0000644�0001750�0001750�00000001433�12257552167�016071� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Ruby/GStreamer Ruby/GStreamer is a Ruby binding for GStreamer. ## Requirements * Ruby/GLib2 and Ruby/GObjectIntrospection in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [GStreamer](http://gstreamer.freedesktop.org/) ## Install gem install gstreamer ## License Copyright (c) 2002-2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ### Exceptions Ruby scripts and image files in sample/ are ported and copied from GStreamer. Headers in samples/*.rb describes that the location of the original file of the Ruby script and image files. The original files are licensed under the LGPL v2.1 or later. ## Project Website http://ruby-gnome2.sourceforge.jp/ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/extconf.rb����������������������������������������������������������0000644�0001750�0001750�00000002230�11701304107�016557� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "gstreamer" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gstreamer/Rakefile������������������������������������������������������������0000644�0001750�0001750�00000015321�12257664725�016264� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require 'gnome2-raketask' package = GNOME2Package.new do |_package| _package.summary = "Ruby/GStreamer is a Ruby binding for GStreamer." _package.description = "Ruby/GStreamer is a Ruby binding for GStreamer." _package.dependency.gem.runtime = ["glib2", "gobject-introspection"] _package.win32.packages = [] _package.win32.dependencies = [] _package.win32.build_dependencies = [ "glib2", "atk", "pango", "gdk_pixbuf2", "gtk2", "gobject-introspection", ] xiph_download_url_base = "http://downloads.xiph.org/releases" freedesktop_download_url_base = "http://gstreamer.freedesktop.org/src" sf_net_download_url_base = "http://downloads.sourceforge.net/project" libmad_version = "0.15.1b" _package.external_packages = [ { :name => "libjpeg", :base_name => "jpeg-9", :archive_base_name => "jpegsrc.v9.tar.gz", :download_base_url => "http://www.ijg.org/files", :label => "libjpeg", :windows => { :configure_args => [], :built_file => "bin/libjpeg-9.dll", }, }, { :name => "sqlite-autoconf", :download_base_url => "http://www.sqlite.org/2013", :label => "SQLite", :version => "3080200", :compression_method => "gz", :windows => { :configure_args => [], :built_file => "bin/libsqlite3-0.dll", }, }, { :name => "libsoup", :download_site => :gnome, :label => "libsoup", :version => "2.45.3", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", "--without-apache-httpd", ], :build_concurrently => false, :built_file => "bin/libsoup-2.4-1.dll", }, }, { :name => "libogg", :download_base_url => "#{xiph_download_url_base}/ogg", :label => "Ogg", :version => "1.3.1", :windows => { :configure_args => [], :built_file => "bin/libogg-0.dll", }, }, { :name => "libvorbis", :download_base_url => "#{xiph_download_url_base}/vorbis", :label => "Vorbis", :version => "1.3.3", :windows => { :configure_args => [], :built_file => "bin/libvorbis-0.dll", }, }, { :name => "libtheora", :download_base_url => "#{xiph_download_url_base}/theora", :label => "Theora", :version => "1.1.1", :windows => { :configure_args => [ "--disable-examples" ], :build_concurrently => false, :patches => [ "libtheora-1.1.1-use-lf-in-def.diff", ], :built_file => "bin/libtheora-0.dll", }, }, # { # :name => "libmad", # :download_base_url => "#{sf_net_download_url_base}/mad/libmad/#{libmad_version}", # :label => "MAD", # :version => libmad_version, # :windows => { # :configure_args => ["CFLAGS=-O3 -march=i686"], # :need_autoreconf => true, # :patches => ["libmad-0.15.1b-fix-mingw-build.diff"], # }, # }, { :name => "flac", :download_base_url => "#{xiph_download_url_base}/flac", :label => "FLAC", :version => "1.3.0", :compression_method => "xz", :windows => { :configure_args => ["--disable-cpplibs"], :built_file => "bin/libFLAC-8.dll", }, }, { :name => "speex", :download_base_url => "#{xiph_download_url_base}/speex", :label => "Speex", :version => "1.2rc1", :windows => { :configure_args => [], :built_file => "bin/libspeex-1.dll", }, }, { :name => "gstreamer", :download_base_url => "#{freedesktop_download_url_base}/gstreamer", :label => "GStreamer", :version => "1.2.1", :compression_method => "xz", :windows => { :configure_args => [ "--enable-check", "--enable-introspection", ], :build_concurrently => false, :built_file => "bin/libgstreamer-1.0-0.dll", }, }, { :name => "gst-plugins-base", :download_base_url => "#{freedesktop_download_url_base}/gst-plugins-base", :label => "GStreamer plugins (base)", :version => "1.2.1", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :build_concurrently => false, :built_file => "lib/gstreamer-1.0/libgstgio.dll", }, }, { :name => "gst-plugins-good", :download_base_url => "#{freedesktop_download_url_base}/gst-plugins-good", :label => "GStreamer plugins (good)", :version => "1.2.1", :compression_method => "xz", :windows => { :configure_args => [ "--disable-shout2", ], :built_file => "lib/gstreamer-1.0/libgstcairo.dll", }, }, { :name => "gst-plugins-bad", :download_base_url => "#{freedesktop_download_url_base}/gst-plugins-bad", :label => "GStreamer plugins (bad)", :version => "1.2.1", :compression_method => "xz", :windows => { :configure_args => ["--disable-librfb"], :cc_args => [ "-std=c99", ], :built_file => "lib/gstreamer-1.0/libgstfaac.dll", }, }, # { # :name => "gst-plugins-ugly", # :download_base_url => "#{freedesktop_download_url_base}/gst-plugins-ugly", # :label => "GStreamer plugins (ugly)", # :version => "1.2.1", # :compression_method => "xz", # :windows => { # :configure_args => [], # }, # }, { :name => "gst-libav", :download_base_url => "#{freedesktop_download_url_base}/gst-libav", :label => "GStreamer libav", :version => "1.2.1", :compression_method => "xz", :windows => { :configure_args => [ "--with-libav-extra-configure=" + "--cross-prefix=#{_package.win32.build_host}- " + "--target-os=mingw32 " + "--arch=i686 " + "--pkg-config=pkg-config " + "--disable-gpl", ], :built_file => "lib/gstreamer-1.0/libgstlibav.dll", }, :bundled_packages => [ { :name => "libav", :path => "gst-libs/ext/libav", :license_files => [ "LICENSE", "CREDITS", "COPYING.GPLv2", "COPYING.GPLv3", "COPYING.LGPLv2.1", "COPYING.LGPLv3", ], } ], }, ] _package.cross_compiling do |spec| if /mingw|mswin/ =~ spec.platform.to_s spec.add_runtime_dependency("pango", ">= #{_package.version}") spec.add_runtime_dependency("gdk_pixbuf2", ">= #{_package.version}") end end end package.define_tasks ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/����������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665515�014304� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/COPYING.LIB�����������������������������������������������������������0000644�0001750�0001750�00000063642�12077252561�015750� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�015050� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter.rb��������������������������������������������������������0000644�0001750�0001750�00000011011�12257552167�017051� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gobject-introspection" require "cairo-gobject" base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) if vendor_dir.exist? require "atk" require "pango" require "gdk_pixbuf2" end module Clutter LOG_DOMAIN = "Clutter" GLib::Log.set_log_domain(LOG_DOMAIN) class << self def const_missing(name) init() if const_defined?(name) const_get(name) else super end end def init(argv=[]) loader = Loader.new(self, argv) loader.load("Clutter") require "clutter/actor" require "clutter/actor-iter" require "clutter/animatable" require "clutter/cairo" require "clutter/color" require "clutter/event" require "clutter/point" require "clutter/text" require "clutter/threads" class << self remove_method(:init) remove_method(:const_missing) end end end class Loader < GObjectIntrospection::Loader class InitError < StandardError end def initialize(base_module, init_arguments) super(base_module) @init_arguments = init_arguments @key_constants = {} @other_constant_infos = [] @event_infos = [] end private def pre_load(repository, namespace) init = repository.find(namespace, "init") arguments = [ 1 + @init_arguments.size, [$0] + @init_arguments, ] error, argc, argv = init.invoke(:arguments => arguments) @init_arguments.replace(argv) if error.to_i <= 0 raise InitError, "failed to initialize Clutter: #{error.name}" end @keys_module = Module.new @base_module.const_set("Keys", @keys_module) @threads_module = Module.new @base_module.const_set("Threads", @threads_module) end def post_load(repository, namespace) @other_constant_infos.each do |constant_info| name = constant_info.name next if @key_constants.has_key?("KEY_#{name}") @base_module.const_set(name, constant_info.value) end load_events end def load_events @event_infos.each do |event_info| define_struct(event_info, :parent => Event) end event_map = { EventType::KEY_PRESS => KeyEvent, EventType::KEY_RELEASE => KeyEvent, EventType::MOTION => MotionEvent, EventType::ENTER => CrossingEvent, EventType::LEAVE => CrossingEvent, EventType::BUTTON_PRESS => ButtonEvent, EventType::BUTTON_RELEASE => ButtonEvent, EventType::SCROLL => ScrollEvent, EventType::STAGE_STATE => StageStateEvent, EventType::TOUCH_UPDATE => TouchEvent, EventType::TOUCH_END => TouchEvent, EventType::TOUCH_CANCEL => TouchEvent, } self.class.register_boxed_class_converter(Event.gtype) do |event| event_map[event.type] || Event end end def load_struct_info(info) if info.name.end_with?("Event") @event_infos << info else super end end def load_function_info(info) name = info.name case name when "init" # ignore when /\Athreads_/ define_module_function(@threads_module, $POSTMATCH, info) else super end end def load_constant_info(info) case info.name when /\AKEY_/ @key_constants[info.name] = true @keys_module.const_set(info.name, info.value) else @other_constant_infos << info end end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter/����������������������������������������������������������0000755�0001750�0001750�00000000000�12147676243�016532� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter/animatable.rb���������������������������������������������0000644�0001750�0001750�00000002141�12077252561�021145� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Clutter module Animatable alias_method :set_final_state_without_conversion, :set_final_state def set_final_state(property_name, value) property = self.class.property(property_name) value = GLib::Value.new(property.value_type, value) set_final_state_without_conversion(property_name, value) end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter/color.rb��������������������������������������������������0000644�0001750�0001750�00000004656�12147676243�020210� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Clutter class Color private_class_method(:from_hls) if respond_to?(:from_hls) private_class_method(:from_pixel) if respond_to?(:from_pixel) private_class_method(:from_string) if respond_to?(:from_string) class << self def new(*args) if [Symbol] == args.collect(&:class) name = args[0] get_static(name) else if args.empty? args = [0, 0, 0, 1] unless private_method_defined?(:initialize_alloc) end super(*args) end end def rgb(red, green, blue, alpha=255) rgba(red, green, blue, alpha) end def rgba(red, green, blue, alpha) new(red, green, blue, alpha) end def hls(hue, luminance, saturation, alpha=255) hlsa(hue, luminance, saturation, alpha) end def hlsa(hue, luminance, saturation, alpha) if respond_to?(:from_hls, true) color = from_hls(hue, luminance, saturation) else color = new color.from_hls(hue, luminance, saturation) end color.alpha = alpha color end def pixel(pixel) if respond_to?(:from_pixel, true) color = from_pixel(pixel) else color = new color.from_pixel(pixel) end color end def parse(string) if respond_to?(:from_string, true) succeeded, color = from_string(string) else color = new succeeded = color.from_string(string) end unless succeeded raise ArgumentError, "invalid color string: <#{string}>" end color end end end end ����������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter/threads.rb������������������������������������������������0000644�0001750�0001750�00000002635�12077252561�020512� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Clutter module Threads class << self alias_method :add_timeout_full, :add_timeout def add_timeout(interval_or_priority, interval=nil, &block) if interval.nil? priority, interval = GLib::PRIORITY_DEFAULT, interval_or_priority add_timeout_full(priority, interval, &block) else priority = interval_or_priority add_timeout_full(priority, interval, &block) end end alias_method :add_idle_full, :add_idle def add_idle(priority=nil, &block) priority ||= GLib::PRIORITY_DEFAULT_IDLE add_idle_full(priority, &block) end end end end ���������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter/point.rb��������������������������������������������������0000644�0001750�0001750�00000001703�12077252561�020204� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Clutter class Point alias_method :initialize_original, :initialize def initialize(x=nil, y=nil) initialize_original init(x, y) if x and y end end end �������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter/event.rb��������������������������������������������������0000644�0001750�0001750�00000001501�12077252561�020170� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Clutter class Event STOP = true end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter/actor-iter.rb���������������������������������������������0000644�0001750�0001750�00000002016�12077252561�021122� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Clutter class ActorIter private :init def initialize(root) super() init(root) end def each loop do have_next, child = self.next break unless have_next yield(child) end end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter/cairo.rb��������������������������������������������������0000644�0001750�0001750�00000001726�12077252561�020155� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Cairo class Context def set_source_clutter_color(color) Clutter.cairo_set_source_color(self, color) end alias_method :source_clutter_color=, :set_source_clutter_color end end ������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter/actor.rb��������������������������������������������������0000644�0001750�0001750�00000002247�12077252561�020167� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Clutter class Actor # TODO: use prepend after Ruby 1.9 support is dropped. alias_method :save_easing_state_without_block, :save_easing_state def save_easing_state if block_given? save_easing_state_without_block begin yield ensure restore_easing_state end else save_easing_state_without_block end end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/lib/clutter/text.rb���������������������������������������������������0000644�0001750�0001750�00000001627�12077252561�020044� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module Clutter class Text # Remove deprecated property accessors remove_method :position remove_method :set_position end end ���������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/���������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�015563� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/drop-action.rb�������������������������������������������������0000755�0001750�0001750�00000013223�12147676243�020333� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/drop-action.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" TARGET_SIZE = 200 HANDLE_SIZE = 128 stage = Clutter::Stage.new stage.title = "Drop Action" stage.signal_connect("destroy") do Clutter.main_quit end target1 = Clutter::Actor.new target1.background_color = Clutter::Color.new(:scarlet_red_light) target1.set_size(TARGET_SIZE, TARGET_SIZE) target1.opacity = 64 target1.add_constraint(Clutter::AlignConstraint.new(stage, :y_axis, 0.5)) target1.x = 10 target1.reactive = true on_target_over = lambda do |action, actor, over_p| final_opacity = over_p ? 128 : 64 target = action.actor target.save_easing_state do target.easing_mode = :linear target.opacity = final_opacity end end target1.add_action_with_name("drop", Clutter::DropAction.new) drop_action = target1.get_action("drop") drop_action.signal_connect("over-in") do |_action, actor| on_target_over.call(_action, actor, true) end drop_action.signal_connect("over-out") do |_action, actor| on_target_over.call(_action, actor, false) end drag = nil drop_successful = false add_drag_object = lambda do |target| if drag.nil? drag = Clutter::Actor.new drag.background_color = Clutter::Color.new(:sky_blue_light) drag.set_size(HANDLE_SIZE, HANDLE_SIZE) drag.set_position((TARGET_SIZE - HANDLE_SIZE) / 2.0, (TARGET_SIZE - HANDLE_SIZE) / 2.0) drag.reactive = true action = Clutter::DragAction.new action.signal_connect("drag-begin") do |_action, _actor, event_x, event_y, modifiers| x, y = _actor.position handle = Clutter::Actor.new handle.background_color = Clutter::Color.new(:sky_blue_dark) handle.set_size(128, 128) handle.set_position(event_x - x, event_y - y) stage.add_child(handle) _action.drag_handle = handle _actor.save_easing_state do _actor.easing_mode = :linear _actor.opacity = 128 end drop_successful = true end action.signal_connect("drag-end") do |_action, _actor, event_x, event_y, modifiers| handle = _action.drag_handle printf("Drag ended at: %.0f, %.0f\n", event_x, event_y) _actor.save_easing_state do _actor.easing_mode = :linear _actor.opacity = 255 end handle.save_easing_state do if drop_successful handle.easing_mode = :linear handle.opacity = 0 else parent = _actor.parent parent.save_easing_state do parent.easing_mode = :linear parent.opacity = 255 end x_pos, y_pos = _actor.transformed_position handle.easing_mode = :ease_out_bounce handle.set_position(x_pos, y_pos) handle.opacity = 0 end end handle.signal_connect("transitions-completed") do |_actor| _actor.destroy end end drag.add_action(action) end parent = drag.parent if parent == target target.save_easing_state do target.easing_mode = :linear target.opacity = 255 end return end if parent and parent != stage parent.remove_child(drag) parent.save_easing_state do parent.easing_mode = :linear parent.opacity = 64 end end target.add_child(drag) target.save_easing_state do target.easing_mode = :linear target.opacity = 255 end end on_target_drop = lambda do |_action, actor, event_x, event_y| succeeded, actor_x, actor_y = actor.transform_stage_point(event_x, event_y) printf("Dropped at %.0f, %.0f (screen: %.0f, %.0f)\n", actor_x, actor_y, event_x, event_y) drop_successful = TRUE; add_drag_object.call(actor) end drop_action.signal_connect("drop", &on_target_drop) dummy = Clutter::Actor.new dummy.background_color = Clutter::Color.new(:orange_dark) dummy.set_size(640 - (2 * 10) - (2 * (TARGET_SIZE + 10)), TARGET_SIZE) dummy.add_constraint(Clutter::AlignConstraint.new(stage, :x_axis, 0.5)) dummy.add_constraint(Clutter::AlignConstraint.new(stage, :y_axis, 0.5)) dummy.reactive = true target2 = Clutter::Actor.new target2.background_color = Clutter::Color.new(:chameleon_light) target2.set_size(TARGET_SIZE, TARGET_SIZE) target2.opacity = 64 target2.add_constraint(Clutter::AlignConstraint.new(stage, :y_axis, 0.5)) target2.x = 640 - TARGET_SIZE - 10 target2.reactive = true target2.add_action_with_name("drop", Clutter::DropAction.new) drop_action = target2.get_action("drop") drop_action.signal_connect("over-in") do |_action, actor| on_target_over.call(_action, actor, true) end drop_action.signal_connect("over-out") do |_action, actor| on_target_over.call(_action, actor, false) end drop_action.signal_connect("drop", &on_target_drop) stage.add_child(target1) stage.add_child(dummy) stage.add_child(target2) add_drag_object.call(target1) stage.show Clutter.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/drag-action.rb�������������������������������������������������0000755�0001750�0001750�00000011421�12147676243�020302� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/drag-action.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "optparse" require "clutter" drag_axis = :none x_drag_threshold = 0 y_drag_threshold = 0 parser = OptionParser.new parser.on("--x-threshold=PIXELS", Integer, "Set the horizontal drag threshold", "(#{x_drag_threshold})") do |pixels| x_drag_threshold = pixels end parser.on("--y-threshold=PIXELS", Integer, "Set the vertical drag threshold", "(#{y_drag_threshold})") do |pixels| y_drag_threshold = pixels end axises = { :none => :axis_none, :x => :x_axis, :y => :y_axis, } parser.on("--axis=AXIS", axises.keys, "Set the drag axis", "[#{axises.keys.join(', ')}]", "(#{drag_axis})") do |axis| drag_axis = axis end parser.parse! drag_axis = axises[drag_axis] stage = Clutter::Stage.new stage.title = "Drag Test" stage.set_size(800, 600) stage.signal_connect("destroy") do Clutter.main_quit end handle = Clutter::Actor.new handle.background_color = Clutter::Color.new(:sky_blue) handle.set_size(128, 128) handle.set_position((800 - 128) / 2, (600 - 128) / 2) handle.reactive = true stage.add_child(handle) handle.signal_connect("enter-event") do |actor, event| transition = actor.get_transition("curl") if transition.nil? transition = Clutter::PropertyTransition.new("@effects.curl.period") transition.duration = 250 actor.add_transition("curl", transition); end transition.from = 0.0 transition.to = 0.25 transition.rewind transition.start Clutter::Event::STOP end handle.signal_connect("leave-event") do |actor, event| transition = actor.get_transition("curl") if transition.nil? transition = Clutter::PropertyTransition.new("@effects.curl.period") transition.duration = 250 actor.add_transition("curl", transition) end transition.from = 0.25 transition.to = 0.0 transition.rewind transition.start Clutter::Event::STOP end action = Clutter::DragAction.new action.set_drag_threshold(x_drag_threshold, y_drag_threshold) action.drag_axis = drag_axis action.signal_connect("drag-begin") do |_action, actor, event_x, event_y, modifiers| copy_p = modifiers.shift_mask? if copy_p drag_handle = Clutter::Actor.new drag_handle.set_size(48, 48) drag_handle.background_color = Clutter::Color.new(:sky_blue_dark) stage.add_child(drag_handle) drag_handle.set_position(event_x, event_y) else drag_handle = actor end _action.drag_handle = drag_handle transition = actor.get_transition("disable") if transition.nil? transition = Clutter::PropertyTransition.new("@effects.disable.factor") transition.duration = 250 actor.add_transition("disable", transition) end transition.from = 0.0 transition.to = 1.0 transition.rewind transition.start end action.signal_connect("drag-end") do |_action, actor, event_x, event_y, modifiers| drag_handle = _action.drag_handle if actor != drag_handle drag_handle.save_easing_state do drag_handle.easing_mode = :linear drag_handle.opacity = 0 end drag_handle.signal_connect("transitions-completed") do drag_handle.destroy end parent = actor.parent succeeded, real_x, real_y = parent.transform_stage_point(event_x, event_y) actor.save_easing_state do actor.easing_mode = :ease_out_cubic actor.set_position(real_x, real_y) end end transition = actor.get_transition("disable") if transition.nil? transition = Clutter::PropertyTransition.new("@effects.disable.factor") transition.duration = 250 actor.add_transition("disable", transition) end transition.from = 1.0 transition.to = 0.0 transition.rewind transition.start end handle.add_action(action) handle.add_effect_with_name("disable", Clutter::DesaturateEffect.new(0.0)) handle.add_effect_with_name("curl", Clutter::PageTurnEffect.new(0.0, 45.0, 12.0)) stage.show Clutter.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/rounded-rectangle.rb�������������������������������������������0000755�0001750�0001750�00000005361�12147676243�021522� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/rounded-rectangle.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" stage = Clutter::Stage.new stage.title = "Rectangle with rounded corners" stage.background_color = Clutter::Color.new(:black) stage.set_size(500, 500) stage.show canvas = Clutter::Canvas.new canvas.set_size(300, 300) actor = Clutter::Actor.new actor.content = canvas actor.content_gravity = :center actor.set_content_scaling_filters(:trilinear, :linear) actor.set_pivot_point(0.5, 0.5) actor.add_constraint(Clutter::BindConstraint.new(stage, :size, 0.0)) stage.add_child(actor) transition = Clutter::PropertyTransition.new("rotation-angle-y") transition.from = 0.0 transition.to = 360.0 transition.duration = 2000 transition.repeat_count = -1 actor.add_transition("rotateActor", transition) stage.signal_connect("destroy") do Clutter.main_quit end canvas.signal_connect("draw") do |_canvas, cairo_context, surface_width, surface_height| x = 1.0 y = 1.0 width = surface_width - 2.0 height = surface_height - 2.0 aspect = 1.0 corner_radius = height / 20.0 radius = corner_radius / aspect degrees = Math::PI / 180.0 cairo_context.save do cairo_context.operator = :clear cairo_context.paint end cairo_context.new_sub_path cairo_context.arc(x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees) cairo_context.arc(x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees) cairo_context.arc(x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees) cairo_context.arc(x + radius, y + radius, radius, 180 * degrees, 270 * degrees) cairo_context.close_path cairo_context.set_source_rgb(0.5, 0.5, 1) cairo_context.fill Clutter::Event::STOP end canvas.invalidate Clutter.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/constraints.rb�������������������������������������������������0000755�0001750�0001750�00000005706�12147676243�020472� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/constraints.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" stage = Clutter::Stage.new stage.name = "stage" stage.title = "Snap Constraint" stage.user_resizable = true stage.background_color = Clutter::Color.get_static(:aluminium_1) stage.signal_connect("destroy") do Clutter.main_quit end layer_a = Clutter::Actor.new layer_a.background_color = Clutter::Color.new(:scarlet_red) layer_a.name = "layerA" layer_a.set_size(100.0, 25.0) stage.add_child(layer_a) layer_a.add_constraint(Clutter::AlignConstraint.new(stage, :both, 0.5)) layer_b = Clutter::Actor.new layer_b.background_color = Clutter::Color.new(:butter_dark) layer_b.name = "layerB" stage.add_child(layer_b) layer_b.add_constraint(Clutter::BindConstraint.new(layer_a, :x, 0.0)) layer_b.add_constraint(Clutter::BindConstraint.new(layer_a, :width, 0.0)) layer_b.add_constraint(Clutter::SnapConstraint.new(layer_a, :top, :bottom, 10.0)) layer_b.add_constraint(Clutter::SnapConstraint.new(stage, :bottom, :bottom, -10.0)) layer_c = Clutter::Actor.new layer_c.background_color = Clutter::Color.new(:chameleon_light) layer_c.name = "layerC" stage.add_child(layer_c) layer_c.add_constraint(Clutter::BindConstraint.new(layer_a, :x, 0.0)) layer_c.add_constraint(Clutter::BindConstraint.new(layer_a, :width, 0.0)) layer_c.add_constraint(Clutter::SnapConstraint.new(layer_a, :bottom, :top, -10.0)) layer_c.add_constraint(Clutter::SnapConstraint.new(stage, :top, :top, 10.0)) stage.show Clutter.main ����������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/flow-layout.rb�������������������������������������������������0000755�0001750�0001750�00000006314�12147676243�020401� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/flow-layout.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "optparse" require "clutter" random_size_p = false n_rects = 20 vertical_p = false homogeneous_p = false x_spacing = 0 y_spacing = 0 fixed_size_p = false parser = OptionParser.new parser.on("--[no-]random-size", "Randomly size the rectangles", "(#{random_size_p})") do |boolean| random_size_p = boolean end parser.on("--n-rects=N", Integer, "Number of rectangles", "(#{n_rects})") do |n| n_rects = n end parser.on("--[no-]vertical", "Set vertical orientation", "(#{vertical_p})") do |boolean| vertical_p = boolean end parser.on("--[no-]homogeneous", "Whether the layout should be homogeneous", "(#{homogeneous_p})") do |boolean| homogeneous_p = boolean end parser.on("--x-spacing=PIXEL", Integer, "Horizontal spacing between elements", "(#{x_spacing})") do |pixel| x_spacing = pixel end parser.on("--y-spacing=PIXEL", Integer, "Vertical spacing between elements", "(#{y_spacing})") do |pixel| y_spacing = pixel end parser.on("--[no-]fixed-size", "Fix the layout size", "(#{fixed_size_p})") do |boolean| fixed_size_p = boolean end parser.parse! stage = Clutter::Stage.new stage.background_color = Clutter::Color.new(:sky_blue_light) stage.title = "Flow Layout" stage.user_resizable = true stage.signal_connect("destroy") do Clutter.main_quit end layout = Clutter::FlowLayout.new(vertical_p ? :vertical : :horizontal) layout.homogeneous = homogeneous_p layout.column_spacing = x_spacing layout.row_spacing = y_spacing box = Clutter::Actor.new box.layout_manager = layout box.background_color = Clutter::Color.new(:aluminium_2) stage.add_child(box) unless fixed_size_p box.add_constraint(Clutter::BindConstraint.new(stage, :size, 0.0)) end box.set_position(0, 0) box.name = "box" n_rects.times do |i| color = Clutter::Color.hls(360.0 / n_rects * i, 0.5, 0.8) rect = Clutter::Actor.new rect.background_color = color if random_size_p width = rand(50..100) height = rand(50..100) else width = height = 50.0 end rect.set_size(width, height) rect.name = "rect%02d" % i box.add_child(rect) end stage.show Clutter.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/image-content.rb�����������������������������������������������0000755�0001750�0001750�00000005100�12147676243�020641� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/image-content.c. The # image file used in this sample code is copied from # clutter/tests/data/redhand.png. They are licensed under the terms # of the GNU Lesser General Public License, version 2.1 or (at your # option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" require "gdk_pixbuf2" gravities = Clutter::ContentGravity.values current_gravity_index = gravities.size - 1 stage = Clutter::Stage.new stage.name = "Stage" stage.title = "Content Box" stage.user_resizable = true stage.signal_connect("destroy") do Clutter.main_quit end stage.show box = Clutter::Actor.new box.name = "Image" box.margin_top = 12 box.margin_right = 12 box.margin_bottom = 12 box.margin_left = 12 box.add_constraint(Clutter::BindConstraint.new(stage, :size, 0.0)) stage.add_child(box) pixbuf = Gdk::Pixbuf.new(File.expand_path("redhand.png", File.dirname(__FILE__))) image = Clutter::Image.new image.set_data(pixbuf.pixels, pixbuf.has_alpha? ? :rgba_8888 : :rgb_888, pixbuf.width, pixbuf.height, pixbuf.rowstride) box.set_content_scaling_filters(:trilinear, :linear) box.content_gravity = gravities[current_gravity_index] box.content = image text = Clutter::Text.new text.add_constraint(Clutter::AlignConstraint.new(stage, :both, 0.5)) stage.add_child(text) update_text = lambda do current_gravity = gravities[current_gravity_index] text.text = "Content gravity: #{current_gravity.nick}" end update_text.call action = Clutter::TapAction.new action.signal_connect("tap") do |_action, actor| current_gravity_index = (current_gravity_index + 1) % gravities.size actor.save_easing_state do actor.content_gravity = gravities[current_gravity_index] end update_text.call end box.reactive = true box.add_action(action) Clutter.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/redhand.png����������������������������������������������������0000644�0001750�0001750�00000020072�12077252561�017672� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���È���Õ���¿Û���bKGD�ÿ�ÿ�ÿ ½§“��� pHYs�� �� �šœ���tIMEÖ 3x<û,��ÇIDATxÚí]y|M×Ú~Ö>ÉÉ(£‘ ‰"HQŠV«>ý ·ÕQ)U´U:hÕÐÉPz鍿R®Jµu]½\×PBiÌBE’DDæ99ÓZß9½Ÿ«ÅÙûì³÷Öóûå—ÎÞk­w­g=ï»öZï888888888888888888888888œDé)¥þ„ø»ü,rU‰ú0ÆâøßÑH„¶#Ûœ#„TÙ‰mª!ç8A¬€Édò'„Œ „Ü` €(�ÂÝú@9€�cÉ‚ äÉ4ãŒ$„ p¿¹.w³ƒ ÀY�)Œ±ƒ‚ ü$“m"!EÚ†Èý½.�RT´ 3×ç €49mãô0™Lý)¥ëc&f=(cl+¥´¿T’RJ§RJ/›ße-JcŸPJ#¬°ÍV™êbo¶¹L)}—RêÏYpûÎß'“±ÿl0ì³t0˜;ÿ]ÆX³ Lf¢øsÛüeœ(4øVuþíCÄ]ãe¦ J)¥SïàºDØ¢mC)N)-µÛ¸6ø­³ÔØ?!êÇ Æ[±÷Ö“R:Ö†³´ÛüÝ^lã*äxE%ƒß<c~|Ó�8ÉÔÅes° Jé;jÛ†RúÎM*¦¶mNþn—XÅ¢”®%„L´“¶¬cŒu'„ô´ƒº”3Æ~&„<n†aŒm%„ d'¶¹_„óNMJéW„I<úâpf’Éñ.'‡"„ ”¶u:¡”'„$C…¯ðN‡“Œ±‡A¨r ‚˜L&?BH!$˜÷-‡LØJyÂ)\,BÈל2ãqÆØp‡WJé0BˆÕûl˜É„Ê3gP‘šŠÚK— //ƒ60>íÛ#°wo&&‚¸»+b�}i)JFuZ `¬«ƒÆË žaaðëÜÁýûÃ+<\‘º0£•§N¡<5uÙÙÐWT�@“m:t@PŸ>èÑÄÍM‘ú芋Qvèª~û ùù0Õ×Cãå¯ðpøué‚àþýáÙª•EeB:8:A.BÚK-ˆêõÈÛ¸¹«W£¡ �`ìv2Ï–-ÑvÂDNž ··M^›•…KK–àÆîÝ zýí 俆à¾}=s&ï¹Ç&u156âêúõ¸²v- ïl›°0D¾ðÚ¾ð4^^6©Oõ… ¸´x1J~þùζqwGóóöÛðOH°¶Ø±„$‡$¥t !d“ÔBJSRpaæLÔåäˆzγuktZ°�¡Ã†É:3æÍCþ¦Mwìü?J:l:/^ m°|^fñž=HŸ3õyâ6äz…‡£ÓÂ…h9t¨lu1ÖÖââ{ï¡à‡ÀŒFËm£Ñ ì±ÇÐiÑ"¸ûKþXn—*b)ANJý�weÝ:\üà0ƒAZÞ|Ño½ëÎt7nàÔøñ¨<uJò;¼£¢øÍ7ðµÒŸbÈY±™ ‚™L’m=c:LŸnµm pê¹çPýÛo’ßá‹ÄM›àé4*B, G<!$MÒ”°l2?üðö.ƒD½ü2âæÍ“kTTàסCE«ØŸÁ=0}wî„Oé^Ö_ÿŠËŸ.m^z qóçK~¾±¨G‡EãµkV×Å£E ôݽ[jܶ2ØÑV±ÆJröîEÖ¢E² ��È]½ß/m²6pvÒ$YÈ�†Š œ?†*iË÷×üQ6r�@îš5ÈO’6ñRg&L…¿ö§Æƒ©¾^ÊãI=c£AÌ{xÄ  ª*œ›6M²ëp;—äÂÛoKêÈܵkQzèìA~†„Y[WR‚óÓ§ËFŽÿØfÖ,Ô_Jùò_ âäIyƒüó瑵x±4—¦ét¥c„Rꠇؗæ,_Þ´|kƒÕž¬?GÖÊJd/]jã|÷j³²Ä ÈO?…±¶VöºP½Y}$z¶Ï]½Ú&¶¹º~}Ój¥x t‚BD“ÃPY‰+k×Ú¬Â×¶lAC~¾¨Eƒù{‚Ü`F#²¿øB”¯/Õ²Ôu«ÍÌ´|"[¹¦º:›Ô…êtÈþòK)&8 A�ˆ>ç|c×.©þ§Åƒ²pûv‹_øØÔ€E;wZÜÞëÉÉ¢––EÛ†R\ÛºÕâßÚÚ6ד“E-›ÑÑ¢ûÂÒ”›WÚÒ2òóQ—mÓº˜Pqâ„ÃÙ¦63º7lZCEªÎ‰Ï Äëê0Aºè�í›WºÆÂµz%ê"¦œ%l“žnÑâˆb¶9/éÈG°£DôRKca¡Í+­¯¨€©±Ñ.êbi9ŒR4Ù¼.T¯‡¾´ôîu–iY×^ú@-‚ˆþ<k´QÐ÷ׯ‚rl Iª‹œK»Vöb¶ihpj‚ˆïQ…%å0Jª ³»Xj;ê'—R—„#…êÌœœ Œ~ @¯óm‹!NM® \A¸‚pá „+W® \A¸‚pá „+W>sá „+W® \A¸‚páuvAáàpipËU],ÅLÃ],Æç¤sð +W¤sá „+W® \A¸‚pá Â„ÏÆ\A¸‚pá „+W® .¯ T¯‡©®NJ^Z® v†»]—ÊÄïÞÃÂX[ S}=¨Á�P ¢Ñ@ðô„›Í.Üä ¢.A¸‚X�}yùíïC©ª‚Ž+A8x Âc§›¸‚páà „ƒ+W® vBÇíJþò©hPèrW€SºXUgÎàø¨Q¸ºaƒKvêÉÑ£‘þÎ;w¾Š›»X®§ ׯãÜë¯ãè°a(;rÄeÂR½WÖ®Åáþý‘·q£MoÖuuqú3ƒ¹«Váð€(ؼÌ`à= @WR‚ßfÌÀ¯<‚ª3gx ⊠R›™‰ÔGÅÅ>€¡ªŠ³âÏ\ÎsçðëˆÈ^º”O®ƒ0JquÃ2Çóž¼›Û¥Ó!sáB{â Ô_¹Âc áæ¨O›2¥‡ÛEœA4h||àæë ÁÝÄÍ D£3ÁŒF˜›6264¨^ßò£Gqäá‡áÓ®Ÿ5d ˆÝÒ¿ôÐ!ÅËt „O»vhÖ©šuìïˆxµm Z-A�„¦[v)5™@u:˜ÐXXˆ†¼<Ô忢æâEÔ\¼ˆú+W@uÊmi4TV¢òôiƒ8³‚(Bˆ€�$&¢ùÀêÕ ¾11ÐøøˆRh4и»Cãé wx††" Gÿr ¨JKCù¯¿¢4%5éé|åÉAârë¤Ú  „<ôZ‰ >}àÖ¬™mÝ3A€68!ƒ!dÐ ÄÌž ]QŠ÷îÅõädT?îÐdá1ˆ€h4êÓáÏ>‹–C†Øœw#ŒgX"ÆCÄsÏ¡>?×¶lÁµ-[š‚kƒ(6ÝÝÑrÈ´õUøwëfÉwD¢ßz í_}E?ý„ìeËP“žî06æ1ˆBÐj:bÚOŠfqq‘•DÐj6jB‡Gñž=È^¶ìÿ8ä·»KÅ „ äÁqßþýHX¹Í:ur¸”=‚V‹ÐaÃÐwçNôøúkxµiÃc â4.–Wx8º¯]‹Ä¤$øÆÆ:>×ÝÜ:|8ú8€¨)S xxpK‚8Eœõò˸ïÀ´1¢iéÕ™‚H??ÄÍ‹¾ÿú‚úôá>w±,‡gXz}ÿ=âæÍƒ»¿¿Sw¤_—.èµu+:¼ù&ˆ»;w±¸‚Ü!ƒ¡ß¿ÿàþý]jñ!fæL$&%Á£eK>ýóäÏ]ª˜Ù³‘¸i“Ë’°›ÉÇ v§'V®D‡7Þ°+7C-÷òžÍ›Ñúñǹ ðp÷÷GϤ$´9’÷êïëáø/¿DääÉ<qeñhÙ½þþw40€³âÖêæ†¸ùó3kVÓNcQpø­&-Z ÷¶mðŽæ½y»Nt˜>OO\œ7OÑ3)<Q“Ý~~HÜ´‰“ÃBD½ü2ÚOÊ á 1ˆàáëÖÁ¿{wÞ‹–ˆ™3áÏ<ÃcgVâæ†ø¥KÑüþûù k;]>þ-† áÆ vIÿö¯¾Š°Çã½'µÓµZ$¬XŸx âl ܯ¢ß|“râ·„Õ«¡ñôäÆp–Ä#$ÝV¬pù€rÁ?>çÍã1ˆ3¸XD£Aü—_Â3,Œl1nZÁ],Gw±Ú<û,B|h¹'A@çÅ‹¡ æÆpTKÛ¼9bÞy‡÷–­ìŒØ9s¸‹å¨ Òñ½÷  t,Ë:˜k>z4ùlq ì~«I`ïÞhýÔSvi<S]ªÓÓQuö,ê._F]v6 ••0ÔÔ€ MéH}|àÙª|:t€ol,{ö„WD„Ýl$ :}ôŽ f4òÄB‚¨îwúðC»Údg¬©Añ¾}(ܶ •'NÜù’š?k“›¼#"Ðbð`„¿®]í†,þݺ!üé§‘Ÿ”Ä¥ÃB‚¨JÿlÊWeh,*ÂÕµk‘¿y3ôeeÒgT£u99È]³WÖ®…_×®h÷Ê+hùÈ#´ZÕÛÙ~Ú4üðƒl×$ðÄfòAÐþõ×ÕWŒÚZd.Z„Cýú!{Ù2«Èñ²PŠª´4œ™<Gz%ûö©»xGE!ŒŸ©±˜ ªÑ?¸_?ÞsªÆ)Þ»¿ „ì/¾€±¦Æ¦eÕddàä˜183itÅÅêªÈk¯Éæöñï ¶ê$ÕƒêõȘ?§ÆS4.£×wìÀ‘!CPvø°jí÷EËÿù.°Óï ¾±±h®RÂcu5NŽƒœåËe]Íï\»†Ï<ƒ¼Um'Nä1ˆ½*HÄØ±ª¤Õ•”àØO ôàAÕm@õz\˜9—?ûL•¸$èÞ{ÙíËc±Òj¦B&Žß•ÞB3J‘µx1rW­R~D.Ã÷'ƒÈœ÷ïmPâ³õé^°ÏléŒ!cÁnݪxÑ­FŒp¸äÞNƒØrgéípiñb”¦¤Øm'1“ çgÌ@MF†¢åzGEÁ¿kWƒØ ˆ 䡇-³dÿ~ä¬\i÷eª«ÃÙÉ“›nÊU-~˜+ˆ½Ä ~ññð QnÐÕ×ãÂÌ™`&“CtVMF²¿üRÑ2›Äc{q±”Nü–½t)êóòªÃrW¬@]v¶bå$$Xug#w±dD`ïÞŠ•¥+)Aîš5×a¦ÆF\þôSåÜ^77ôìÉ],Õ],B=p嫯`ª¯wÈN+LNVô `¯^ÜÅR^áápWèPÕé÷Í7ÛiÌ`ÀÕõë+ÏÚ•,ƒÈ wî¬X£‹÷졢¡;®pÛ6Ù¶¤ß Í:uâ1ˆÚPòbÍk*|t“=†*.Fé/¿(¦î® jÆ Þʸ'F#ÊŽqŠÎSlÏ!ð–xÝ4A䚥ڶU¤œª´4««‚ Jn‰·÷ûØ>ñTè>ÁJ{Üo%5/‚êtŠ”%õ¾GƒÈ¥V°ê._v‚0“ u99Š”¥ôRƒÜÚJD¡¥”jÔ ŒÇ rÄ€b ©}yW­ö¸jx»ˆA³µkkª•jÔ”D<¹Õ R’¼)˜8êõNE¥Úco™ 6‘â*)õE�4ÞÞNÕJµ‡Jì#ƒÈ ÅTA‚¸ùú:A”j³)¯j1ˆ$_•1˜êêi°Rß[”‚gh¨2±ŽÄÄy<¹îþþ’žÓ+´ãl©l”j³­þ©F©”ô¥¥Š4XÉM‘6?||»’NΜÄ.¤»K$HCa¡" VòÔ¢­Ô«—bWCHígÒEgQ–ºg§áêUEì¡ØÎa[#XÁô¬ vv_)‚¤K€RP—›«X£[ âø=GZ ¬HQT§CcQ'ˆò(u[tÍÅ‹Š5ºõO8|Çùwë¦X<U“™©Z"o{Wã¢$2RREj32KÒìß­›UÇHíáO?­XY5éé’Ÿuêe^AD§ýh+)p4TU¡V©­è„ ÝÔ©Ûi!!Š¤Ê‰ÎÐÈ­ �pBÌ 5>>’OV?®XÃÃFŽ„wT”CvZä‹/*ºeFÉ~qD‚œûR©J*RS•‹qÝÝ7w®Ãe/÷nÛ‘“&)Vž¡²Rñ¤ÙEÆØ±/ ˜�®äàA0Jk|Ë¡C[ ’Ë5ìôá‡Ðxy)VdiJŠU¹‹]a³âQ±/•š‰OwãªûMQtY²ÚæÍ#0æÅ—¨K~þ® Ùc�ð—|íÆ®]ŠÀ3, Ý–-³ûóÍââÐyÑ"EËdŠ÷ìá¹ã¡À%Q/Õj%o鸾c‡âwò…<ø :¾÷žÝÆ#-[¢çßþ¦øY–²£G]v–€ƒRÔ]¾Œªsç7DÔ”)h÷Ê+vG÷€�$~û­*+n…ÿø‡ a“ lwgŒ‰^É ±ââ•ü¤$UŒûî»èðÆŠm�´D9zmÙÿøxÅË6VWãúO?ÁÕaéH}ŸoLŒä³ …Û·«’\bfÍB§>‚àá¡jÇøÆÆ¢Ï?Â?!A•ò ·oWì›ÃD„ bã@ú…œÆêjU¯'hûüóè½}»äm3Ö’´õ“O¢ï®]ðiß^•ö3£¹«WËó.:“.:i5r¤äŠå®ZSc£j† LLD¿={9q¢ä”7bᎄ¯¾B·eˬºöÌZ\ß±CÑkÞœ‚ Œ±d±/o¿.]$ULwã 6oV=@î´hîݹ-~ÄÍÍ&åhÑaútô?xPõ»É¥Š_êL ":ýH›1c$W.gùr»È¦áß­“’Ðw×.„?õÜdq¥|cbûÞ{šŠ˜Y³àæç§z[‹÷ì±j÷®³Áâ)Q„:³Š<.¦€°Q£1¾¤û� ÿí·hûüóva,ÿ„Ä/[CUJöíCiJ ÊEcQÑ݉L4ÞÞð‹‹Cpÿþ<Ý»ÛÕJf4âÒÇËS9ø2¯(Ÿ1ö#!DAÜýý6jò7m’TÁ¬¿þ¡Ã†)zº¥m 5 ŒRè®_G}~>êsr ¯¨€±¶T§ƒ›Üš5ƒg«Vðn×®éF‰Y_”@ÞÆ¨>žËÆÍócJ©!ä �Q›—j³²pxÀ�Éß~ñÜ/¶)tÅÅ8tß}0TVÊúÞ¨_DÜ‚bÁ»õ°jA?Ö(ꋘyÛÉßÅâƒ+vÍ^Û²å n…wEdÌŸ/;9¬ÀBHÙ-™Œ±dÆØ<Jé Ji3»#ˆÙÍZ!¥ ö¯½&yu†QŠ ³f)v›’«¡ì—_Ph£‹MeüÒÀ�ïBöB cÉ”ÒG)¥^vCóGCÑÓy`b¢äýY@Ó¹èŒùóùh–ú²2¤M›¦è9™à `!d!$—Rú<¥ÔMu‚˜g…åRž‹yûm«ö9]Y·E;wòQ-×ìN)νö¯]sô¦´$„¬'„¤RJU �’ˆÎꟀVZQÆpþ7P¯P’9gGîªUÎvÞ£'!dcìo”ÒPÕ"B-cì)Ïv|÷]«Î5*+qöÅajhà#Ü ”§¦"ë£l^ŽJßAÆBPJ»¨B3VHQÏÖ­­N¹Syú4Ò¦LQôâgBmf&Nïìw~t$„üJ)½O‚˜UäS)϶Ÿ6 ¾11Vµ¾hçN\˜=ÛƒKUÑxíNŒ }y¹+4×—ò/kHbíÉ åRTDðð@—O>±z›EÞ7ßàÒ’%ŠÑuT**pbôh4äç+· ~ßüN’~ŠÄ êÓãÇ[ÝúËŸŽœ•+9I,ˆÝNŽ«hd;S’ݔҖŠÄ€Žï¿o}fÆ1o2,°*“S»UׯãØc¹t†D3IŠýVb5AÌ*2Gʳ//$¬\)ËñÖœåËq~út—½lòv¨ËÎFêÈ‘Šç³ãÀ]Tî$ÙÖàc�$ÉÁÕõëqaölYܤC† aÕ*§»ÍV *OŸÆ©çžƒ®¸Xµ:40�­þòi“¯§'´ÁÁðކgh¨œÖ:B2%¥ô^BÈa� ìBÚ´i¸¶e‹<Z‹îkÖ8ü’'+J‘¿i.¾ÿ¾s|/">íÛ#ô‘G1~<¼Âí}ãw„ÑŠĬ"k�L–ò¬©¡©#G¢êìYYê¢ññAç… Ñúé§í&0VWã··ßFá¶mNÙ>"'L@»W_µêl c¬£ ™Š„RÚŒr €¤‹ ¯_ǯÿû¿h((­NáO=…N ÚÅqV[£êìYœ2uJݳ¢făë×[ó=Í"‘}�¥t(!Dr‚Ýšôt¤Ž CU•luòlÝqsç"tøp§Tcu5.}ú)®~ýµK-R¸ qófJ¼M€1Ö\„2E b.x3€g¤>_~ô(NŒ-éûòÀˆûðCøFG;M¬QôÏââ8ÃŽ\IðhÑ}wï–—Ì$„,Qœ fWë$�ÉúWrà�N=÷œì‡¤4žžh;q"¢^z -Z8(3*ÏœÁ¥%K\þz�ðïÞ}wí’²3ã0!d€â1“¤/!䤬j™Qüïã̤I6I çæë‹6Ï>‹¨—^‚gë֣ǎ!{éR”8ÀwÜ„nË—£õ“OJñvÜA0)N3I^$„X•ò4%§Æ·YžX—Z?ù$"'N„Ot´]Æ(T¯GiJ rW®DÙ‘#œ ¯ðpÜ숻»ØG „T… f†~Àª+YËSSqzÜ8è+*lVO"ìÝû?·8iUW‹úœnߎk?ü€ú¼<΂» qÓ&)7p½IùL5‚˜ã‘=�úXóžÚ¬,œ3õW®ØÜÐ//48-~!<�V­Qª×£æâE”ìß»w£*-»Q"1nºˆO|7—2O5‚˜IÒ†r €UÙßt%%8=a*ŽSÌè¿§ ìÕ ½zÁ¯kWxGFBðð°Š4Ìh„±¶µ™™¨<}Ç£òÔ)4ñ‘.5XG¿}ûÄ>62WU‚˜IÒÉìëYEª×ãâûïãê† ªÍ®ooxGF«Mx·iÐPhá§'­ÄÍ Ô`�Õé`ª«ƒ¾¼ú²24¢>/ ùùh((�3ùÈ– å˜1“¤3!$@°µïº¶e .Ìž cM MƒÙÍ C e%ˆ¢K6‚ \`ŒM`õ9ÙÖO>‰~{÷" gO>28𯗠îqQ|MS„ïcÏÊAŸvíÐ'9Ñ3f¨~e‡úð •”é‡ÙAn"É9H"hµˆž1ýöîE`¯^|”¸0šÅÅ9¾‚ÜD’ïä" �4ëØ}’“Ñõ³Ïw ‡Uh>p ¤ÐøŽqÚbŒ ð D^©p'ªªýù縺aO0ç*ñ‡‡¥¥A$öÑ;~IW}_!ä_Œ± 1ñßÁÝßçÎÅ€#G1nœb—pr¨‡¶&H!�œ¶kùÎQÚ…²€ìþQ}^®|õ ¾ûŽ/ ;!Üqj*ÜÅo:Méé1“IJ€M¢m}Eò“’Ÿ”Ô´e…oãpxÝ¿þ¡<"åñO!3† 7‘d €I¶r™É„²_~Aþ·ß¢xï^›íæ°¹ŽØ9sš.g’†n„sE›ˆ2š²"/ cM Š÷íCÑŽ(=|¸ÉãÊbÿA¹V‹Žsç"râD©¯8E¹ëY]»¾£×—¬p"åét¨8~%û÷£ìèQÔ¤§óDtvßèht^¼Á÷Y•¸},!$É¡ r“Ëõ€· ðª›±¦UgÏ¢*- Õé騹põ¹¹ Osª‚;å…¨—_F›Ñ£¥ŒºÙ„ë(ö¡”ö#„l� jƪף±¨h((€¾´´i§ny9Luu z}Ó¿»Äjh<=¡ ot4‚î½~]»Êu.Ç"õp(‚ܤ&¯�X�+κs¸4öB,¾“œ8b )¥] !Ÿ�ì¨màP�!Ÿ_vÈ,j‚ œ'„ AÓ½Ù—x¿sX�`šr8,Aþ?n#ÿ$„Ä�x–…ã.xŸò­è1æTSDÓ9“Ôä9ìk !’’ª;¥ÿn&Ê\�íyŒâòXG™$ÙKqfËPJï#„Œð<øª—«Æ+¬rã]ÁR”RBÈ�¯sUq dxÞ|¡8AĹ_]Œ0@;8øBÇTã3� !²ÜŸáÒ3)¥4‚2Àý�þÂÝ0‡&ÆÏhJásXÎsWã¿Õ¥?€nfÂ$�ˆâ cßs€ �6ÊM NËc—x3a"´5ÿ4ÿ„+Žò„Èà €r¹Rœ ¶SåpÎÖ„ààààààààààààààààààààààààpü·RÃDsV÷ê����IEND®B`‚����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/basic-actor.rb�������������������������������������������������0000755�0001750�0001750�00000006376�12147676243�020316� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/basic-actor.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" stage = Clutter::Stage.new stage.signal_connect("destroy") do |*args| Clutter.main_quit end vase = Clutter::Actor.new vase.name = "vase" vase.layout_manager = Clutter::BoxLayout.new vase.background_color = Clutter::Color.get_static(:sky_blue_light) vase.add_constraint(Clutter::AlignConstraint.new(stage, :both, 0.5)) stage.add_child(vase) SIZE = 128 flower = Clutter::Actor.new flower.name = "flower.1" flower.set_size(SIZE, SIZE) flower.margin_left = 12 flower.background_color = Clutter::Color.get_static(:red) flower.reactive = true vase.add_child(flower) toggled = true flower.signal_connect("button-press-event") do |actor, event| if toggled end_color = Clutter::Color.get_static(:blue) else end_color = Clutter::Color.get_static(:red) end actor.save_easing_state do actor.easing_duration = 500 actor.easing_mode = :linear actor.background_color = end_color end toggled = !toggled Clutter::Event::STOP end flower = Clutter::Actor.new flower.name = "flower.2" flower.set_size(SIZE, SIZE) flower.margin_top = 12 flower.margin_left = 6 flower.margin_right = 6 flower.margin_bottom = 12 flower.background_color = Clutter::Color.get_static(:yellow) flower.reactive = true vase.add_child(flower) on_crossing = lambda do |actor, event| if event.type == Clutter::EventType::ENTER zpos = -250.0 else zpos = 0.0 end actor.save_easing_state do actor.easing_duration = 500 actor.easing_mode = :ease_out_bounce actor.z_position = zpos end Clutter::Event::STOP end flower.signal_connect("enter-event", &on_crossing) flower.signal_connect("leave-event", &on_crossing) flower = Clutter::Actor.new flower.name = "flower.3" flower.set_size(SIZE, SIZE) flower.margin_right = 12 flower.background_color = Clutter::Color::get_static(:green) flower.set_pivot_point(0.5, 0.0) flower.reactive = true vase.add_child(flower); flower.signal_connect("button-press-event") do |actor, event| actor.save_easing_state do actor.easing_duration = 1000 actor.set_rotation_angle(:y_axis, 360.0) end id = actor.signal_connect("transition-stopped::rotation-angle-y") do actor.save_easing_state do actor.set_rotation_angle(:y_axis, 0.0) end actor.signal_handler_disconnect(id) end Clutter::Event::STOP end stage.show Clutter.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/grid-layout.rb�������������������������������������������������0000755�0001750�0001750�00000015326�12147676243�020362� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/grid-layout.c. # The original header: # Copyright 2012 Bastian Winkler <buz@netbuz.org> # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software Foundation. # # This program is distributed in the hope it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for # more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. # Boston, MA 02111-1307, USA. # # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License, version 2.1, as published by the Free Software Foundation. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "optparse" require "clutter" random_size_p = false random_align_p = false default_expand_p = true use_box_p = false vertical_p = false parser = OptionParser.new parser.on("--[no-]random-size", "Randomly size the rectangles", "(#{random_size_p})") do |boolean| random_size_p = boolean end parser.on("--[no-]random-align", "Randomly set the align values", "(#{random_align_p})") do |boolean| random_align_p = boolean end parser.on("--no-expand", "Don't expand all actors by default", "(#{default_expand_p})") do |boolean| default_expand_p = boolean end parser.on("--[no-]box", "Use the layout in a Clutter::BoxLayout style", "(#{use_box_p})") do |boolean| use_box_p = boolean end parser.on("--[no-]vertical", "Use a vertical orientation when used with --box", "(#{vertical_p})") do |boolean| vertical_p = boolean end parser.parse! stage = Clutter::Stage.new stage.user_resizable = true stage_layout = Clutter::BoxLayout.new stage_layout.orientation = :vertical stage.layout_manager = stage_layout grid_layout = Clutter::GridLayout.new if vertical_p grid_layout.orientation = :vertical end box = Clutter::Actor.new box.background_color = Clutter::Color.new(:light_gray) box.x_expand = true box.y_expand = true box.layout_manager = grid_layout stage_layout.pack(box, true, true, true, :center, :center) add_actor = lambda do |left, top, width, height| color = Clutter::Color.hls(rand(0.0...360.0), 0.5, 0.5) color.alpha = 255 layout = Clutter::BinLayout.new(:center, :center) rect = Clutter::Actor.new rect.layout_manager = layout rect.background_color = color rect.reactive = true if random_size_p rect.set_size(rand(40..80), rand(40..80)) else rect.set_size(60, 60) end rect.x_expand = default_expand_p rect.y_expand = default_expand_p unless default_expand_p rect.x_align = :center rect.y_align = :center end if random_align_p aligns = Clutter::ActorAlign.values rect.x_align = aligns[rand(aligns.size)] rect.y_align = aligns[rand(aligns.size)] end text = Clutter::Text.new("Sans 8px", "") text.line_alignment = :center rect.add_child(text) changed = lambda do |actor, pspec| layout = box.layout_manager meta = layout.get_child_meta(box, actor) label = <<-EOL.chomp attach: #{meta.left_attach},#{meta.top_attach} span: #{meta.width},#{meta.height} expand: #{actor.x_expand?},#{actor.y_expand?} align: #{actor.x_align.nick},#{actor.y_align.nick}" EOL text.text = label end rect.signal_connect("button-release-event") do |actor, event| x_align = actor.x_align y_align = actor.y_align x_expand_p = actor.x_expand? y_expand_p = actor.y_expand? processed = true aligns = Clutter::ActorAlign.values case event.button when Clutter::BUTTON_PRIMARY if event.has_shift_modifier? actor.x_expand = !actor.x_expand? else actor.x_align = aligns[(actor.x_align.to_i + 1) % aligns.size] end when Clutter::BUTTON_SECONDARY if event.has_shift_modifier? actor.y_expand = !actor.y_expand? else actor.y_align = aligns[(actor.y_align.to_i + 1) % aligns.size] end else processed = false end processed end rect.signal_connect("notify::x-expand", &changed) rect.signal_connect("notify::y-expand", &changed) rect.signal_connect("notify::x-align", &changed) rect.signal_connect("notify::y-align", &changed) layout = box.layout_manager if use_box_p box.add_child(rect) else layout.attach(rect, left, top, width, height) end changed.call(rect, nil) end add_actor.call(0, 0, 1, 1) add_actor.call(1, 0, 1, 1) add_actor.call(2, 0, 1, 1) add_actor.call(0, 1, 1, 1) add_actor.call(1, 1, 2, 1) add_actor.call(0, 2, 3, 1) add_actor.call(0, 3, 2, 2) add_actor.call(2, 3, 1, 1) add_actor.call(2, 4, 1, 1) instructions = Clutter::Text.new("Sans 12px", <<-EOI.chomp) Press r\t\342\236\236\tSwitch row homogeneous Press c\t\342\236\236\tSwitch column homogeneous Press s\t\342\236\236\tIncrement spacing (up to 12px) Press q\t\342\236\236\tQuit Left/right click\t\t\342\236\236\tChange actor align Shift left/right click\t\342\236\236\tChange actor expand EOI instructions.margin_top = 4 instructions.margin_left = 4 instructions.margin_bottom = 4 stage_layout.pack(instructions, false, true, false, :start, :center) stage.signal_connect("destroy") do Clutter.main_quit end stage.signal_connect("key-release-event") do |actor, event| layout = box.layout_manager processed = true case event.key_symbol when Clutter::Keys::KEY_c homogeneous_p = layout.column_homogeneous? layout.column_homogeneous = !homogeneous_p when Clutter::Keys::KEY_r homogeneous_p = layout.row_homogeneous? layout.row_homogeneous = !homogeneous_p when Clutter::Keys::KEY_s spacing = (layout.column_spacing + 1) % 12 layout.column_spacing = spacing layout.row_spacing = spacing when Clutter::Keys::KEY_q Clutter.main_quit else processed = false end processed end stage.show Clutter.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/box-layout.rb��������������������������������������������������0000755�0001750�0001750�00000013022�12147676243�020214� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/box-layout.c. # The original header: # Copyright 2009 Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software Foundation. # # This program is distributed in the hope it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for # more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. # Boston, MA 02111-1307, USA. # # Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License, version 2.1, as published by the Free Software Foundation. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" stage = Clutter::Stage.new stage.title = "Box Layout" stage.user_resizable = true layout = Clutter::BoxLayout.new layout.orientation = :vertical stage.layout_manager = layout box = Clutter::Actor.new box.background_color = Clutter::Color.get_static(:light_gray) box.x_expand = true box.y_expand = true layout = Clutter::BoxLayout.new box.layout_manager = layout stage.add_child(box) instructions_label = [ "Press v\t\342\236\236\tSwitch horizontal/vertical", "Press h\t\342\236\236\tToggle homogeneous", "Press p\t\342\236\236\tToggle pack start/end", "Press s\t\342\236\236\tIncrement spacing (up to 12px)", "Press +\t\342\236\236\tAdd a new actor", "Press a\t\342\236\236\tToggle animations", "Press q\t\342\236\236\tQuit" ].join("\n") instructions = Clutter::Text.new("Sans 12px", instructions_label) instructions.x_expand = true instructions.y_expand = false instructions.x_align = :start instructions.margin_top = 4 instructions.margin_left = 4 instructions.margin_bottom = 4 stage.add_child(instructions) add_actor = lambda do |_box, position| color = Clutter::Color.hls(rand * 360, 0.5, 0.5) layout = Clutter::BinLayout.new(:center, :center) rect = Clutter::Actor.new rect.layout_manager = layout rect.background_color = color rect.reactive = true rect.set_size(32, 64) rect.x_expand = true rect.y_expand = true rect.x_align = :center rect.y_align = :center text = Clutter::Text.new("Sans 8px", "") text.line_alignment = :center rect.add_child(text) rect.signal_connect("button-release-event") do |_rect, event| x_align = _rect.x_align y_align = _rect.y_align x_expand = _rect.x_expand? y_expand = _rect.y_expand? case event.button when Clutter::BUTTON_PRIMARY aligns = Clutter::ActorAlign.values if event.has_shift_modifier? y_align = aligns[(aligns.index(y_align) + 1) % aligns.size] else x_align = aligns[(aligns.index(x_align) + 1) % aligns.size] end when Clutter::BUTTON_SECONDARY if event.has_shift_modifier? y_expand = !y_expand else x_expand = !x_expand end end _rect.x_align = x_align _rect.y_align = y_align _rect.x_expand = x_expand _rect.y_expand = y_expand true end changed = lambda do |actor, pspec| x_align = actor.x_align y_align = actor.y_align x_expand = actor.x_expand? y_expand = actor.y_expand? label = ["#{x_expand},#{y_expand}", x_align.nick, y_align.nick].join("\n") end rect.signal_connect("notify::x-align", &changed) rect.signal_connect("notify::y-align", &changed) rect.signal_connect("notify::x-expand", &changed) rect.signal_connect("notify::y-expand", &changed) changed.call(rect, nil) _box.insert_child_at_index(rect, position) end 5.times do |i| add_actor.call(box, i) end stage.signal_connect("destroy") do Clutter.main_quit end stage.signal_connect("key-release-event") do |_stage, event| layout = box.layout_manager handled = true case event.key_symbol when Clutter::Keys::KEY_a iter = Clutter::ActorIter.new(box) iter.each do |child| duration = child.easing_duration if duration.zero? duration = 250 else duration = 0 end child.easing_duration = duration end when Clutter::Keys::KEY_v orientation = layout.orientation if orientation == Clutter::Orientation::HORIZONTAL orientation = :vertical else orientation = :horizontal end layout.orientation = orientation when Clutter::Keys::KEY_h layout.homogeneous = !layout.homogeneous? when Clutter::Keys::KEY_p layout.pack_start = !layout.pack_start? when Clutter::Keys::KEY_s spacing = layout.spacing if spacing > 12 spacing = 0 else spacing += 1 end layout.spacing = spacing when Clutter::Keys::KEY_plus add_actor.call(box, rand(box.n_children)) when Clutter::Keys::KEY_q Clutter.main_quit else handled = false end handled end stage.show Clutter.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/scroll-actor.rb������������������������������������������������0000755�0001750�0001750�00000005453�12147676243�020526� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/scroll-actor.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" stage = Clutter::Stage.new stage.title = "Scroll Actor" stage.user_resizable = true stage.signal_connect("destroy") do Clutter.main_quit end selected_item_index = nil select_item_at_index = lambda do |scroll, index| menu = scroll.first_child if selected_item_index item = menu.get_child_at_index(selected_item_index) item.color = Clutter::Color.new(:white) end index = index % menu.n_children item = menu.get_child_at_index(index) succeeded, x, y = item.position scroll.save_easing_state do scroll.scroll_to_point(Clutter::Point.new(x, y)) end item.color = Clutter::Color.new(:sky_blue_light) selected_item_index = index end stage.signal_connect("key-press-event") do |actor, event| scroll = stage.first_child case event.key_symbol when Clutter::Keys::KEY_Up select_item_at_index.call(scroll, selected_item_index - 1) when Clutter::Keys::KEY_Down select_item_at_index.call(scroll, selected_item_index + 1) end Clutter::Event::STOP end scroll = Clutter::ScrollActor.new scroll.name = "scroll" scroll.set_position(0.0, 18.0) scroll.add_constraint(Clutter::AlignConstraint.new(stage, :x_axis, 0.5)) scroll.add_constraint(Clutter::BindConstraint.new(stage, :height, -36.0)) scroll.scroll_mode = :vertically layout_manager = Clutter::BoxLayout.new layout_manager.orientation = :vertical layout_manager.spacing = 12.0 menu = Clutter::Actor.new menu.layout_manager = layout_manager menu.background_color = Clutter::Color.new(:black) n_items = 11 n_items.times do |i| text = Clutter::Text.new text.font_name = "Sans Bold 24" text.text = "Option #{i + 1}" text.color = Clutter::Color.new(:white) text.margin_left = 12.0 text.margin_right = 12.0 menu.add_child(text) end scroll.add_child(menu) select_item_at_index.call(scroll, 0) stage.add_child(scroll) stage.show Clutter.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/pan-action.rb��������������������������������������������������0000755�0001750�0001750�00000005521�12147676243�020147� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/pan-action.c. The # image file used in this sample code is copied from # clutter/tests/data/redhand.png. They are licensed under the terms # of the GNU Lesser General Public License, version 2.1 or (at your # option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" require "gdk_pixbuf2" stage = Clutter::Stage.new stage.name = "Pan Action" stage.user_resizable = true scroll = Clutter::Actor.new scroll.name = "scroll" scroll.add_constraint(Clutter::AlignConstraint.new(stage, :x_axis, 0)) scroll.add_constraint(Clutter::BindConstraint.new(stage, :size, 0)) content = Clutter::Actor.new content.set_size(720, 720) pixbuf = Gdk::Pixbuf.new(File.expand_path("redhand.png", File.dirname(__FILE__))) image = Clutter::Image.new image.set_data(pixbuf.pixels, pixbuf.has_alpha? ? :rgba_8888 : :rgb_888, pixbuf.width, pixbuf.height, pixbuf.rowstride) content.set_content_scaling_filters(:trilinear, :linear) content.content_gravity = :resize_aspect content.content = image scroll.add_child(content) pan_action = Clutter::PanAction.new pan_action.interpolate = true pan_action.signal_connect("pan") do |action, actor, interpolated_p| if interpolated_p delta_x, delta_y = action.interpolated_delta event_name = "INTERPOLATED" else delta_x, delta_y = action.get_motion_delta(0) event = action.get_last_event(0) event_name = event.class.name end puts("[#{event_name}] panning dx:#{delta_x} dy:#{delta_y}"); Clutter::Event::STOP end scroll.add_action(pan_action) scroll.reactive = true stage.add_child(scroll) info = Clutter::Text.new(nil, "Press <space> to reset the image position.") stage.add_child(info) info.set_position(12, 12) stage.signal_connect("destroy") do Clutter.main_quit end stage.signal_connect("key-press-event") do |actor, event| case event.key_symbol when Clutter::Keys::KEY_space scroll.save_easing_state do scroll.easing_duration = 1000 scroll.child_transform = nil end end Clutter::Event::STOP end stage.show Clutter.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/bin-layout.rb��������������������������������������������������0000755�0001750�0001750�00000013643�12147676243�020205� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/basic-actor.c. The # image file used in this sample code is copied from # clutter/tests/data/redhand.png. They are licensed under the terms # of the GNU Lesser General Public License, version 2.1 or (at your # option) later. # # Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" require "gdk_pixbuf2" stage = Clutter::Stage.new stage.title = "BinLayout" stage.background_color = Clutter::Color.get_static(:aluminium_2) stage.set_size(640, 480) stage.show stage.signal_connect("destroy") do Clutter.main_quit end layout = Clutter::BinLayout.new(:center, :center) box = Clutter::Actor.new box.layout_manager = layout box.add_constraint(Clutter::AlignConstraint.new(stage, :both, 0.5)) box.set_position(320, 240) box.reactive = true box.name = "box" stage.add_child(box) canvas = Clutter::Canvas.new canvas.signal_connect("draw") do |_canvas, cairo_context, width, height| puts("Painting at #{width}x#{height}") cairo_context.save do cairo_context.operator = :clear cairo_context.paint end bg_round_radius = 12 x = y = 0 cairo_context.move_to(bg_round_radius, y) cairo_context.line_to(width - bg_round_radius, y) cairo_context.curve_to(width, y, width, y, width, bg_round_radius) cairo_context.line_to(width, height - bg_round_radius) cairo_context.curve_to(width, height, width, height, width - bg_round_radius, height) cairo_context.line_to(bg_round_radius, height) cairo_context.curve_to(x, height, x, height, x, height - bg_round_radius) cairo_context.line_to(x, bg_round_radius) cairo_context.curve_to(x, y, x, y, bg_round_radius, y) cairo_context.close_path bg_color = Clutter::Color.new(0xcc, 0xcc, 0xcc, 0x99) cairo_context.set_source_clutter_color(bg_color) cairo_context.stroke x += 4 y += 4 width -= 4 height -= 4 cairo_context.move_to(bg_round_radius, y) cairo_context.line_to(width - bg_round_radius, y) cairo_context.curve_to(width, y, width, y, width, bg_round_radius) cairo_context.line_to(width, height - bg_round_radius) cairo_context.curve_to(width, height, width, height, width - bg_round_radius, height) cairo_context.line_to(bg_round_radius, height) cairo_context.curve_to(x, height, x, height, x, height - bg_round_radius) cairo_context.line_to(x, bg_round_radius) cairo_context.curve_to(x, y, x, y, bg_round_radius, y) cairo_context.close_path pattern = Cairo::LinearPattern.new(0, 0, 0, height) pattern.add_color_stop_rgba(1, 0.85, 0.85, 0.85, 1) pattern.add_color_stop_rgba(0.95, 1, 1, 1, 1) pattern.add_color_stop_rgba(0.05, 1, 1, 1, 1) pattern.add_color_stop_rgba(0, 0.85, 0.85, 0.85, 1) cairo_context.set_source(pattern) cairo_context.fill true end canvas.set_size(200, 200) bg = Clutter::Actor.new bg.name = "background" bg.set_size(200, 200) bg.content = canvas bg.x_expand = true bg.y_expand = true bg.x_align = :fill bg.y_align = :fill box.add_child(bg) box.signal_connect("transitions-completed") do |actor| canvas.set_size(actor.width, actor.height) end pixbuf = Gdk::Pixbuf.new(File.expand_path("redhand.png", File.dirname(__FILE__))) image = Clutter::Image.new image.set_data(pixbuf.pixels, pixbuf.has_alpha? ? :rgba_8888 : :rgb_888, pixbuf.width, pixbuf.height, pixbuf.rowstride) icon = Clutter::Actor.new icon.name = "icon" icon.set_size(196, 196) icon.x_expand = true icon.y_expand = true icon.x_align = :center icon.y_align = :center icon.content_gravity = :resize_aspect icon.set_content_scaling_filters(:trilinear, :linear) icon.content = image box.add_child(icon) color = Clutter::Color.new(rand(255), rand(255), rand(255), 224) emblem = Clutter::Actor.new emblem.name = "emblem" emblem.set_size(48, 48) emblem.background_color = color emblem.x_expand = true emblem.y_expand = true emblem.x_align = :end emblem.y_align = :end emblem.reactive = true emblem.opacity = 0 box.add_child(emblem) action = Clutter::ClickAction.new emblem.add_action(action) expanded_p = false action.signal_connect("clicked") do |_action, _emblem| box.save_easing_state do box.easing_mode = :ease_out_bounce box.easing_duration = 500 if expanded_p box.set_size(200, 200) else box.set_size(400, 400) end end expanded_p = !expanded_p end action.signal_connect("long-press") do |_action, _emblem, state| case state when Clutter::LongPressState::QUERY puts("*** long press: query ***") expanded_p when Clutter::LongPressState::CANCEL puts("*** long press: cancel ***") true when Clutter::LongPressState::ACTIVATE puts("*** long press: activate ***") true else true end end box.signal_connect("enter-event") do |_box, event| emblem.save_easing_state do emblem.easing_mode = :linear emblem.opacity = 255 end Clutter::Event::STOP end box.signal_connect("leave-event") do |_box, event| emblem.save_easing_state do emblem.easing_mode = :linear emblem.opacity = 0 end Clutter::Event::STOP end label = Clutter::Text.new label.name = "text" label.text = "A simple test" label.x_expand = true label.x_align = :center label.y_expand = true label.y_align = :start box.add_child(label) Clutter.main ���������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/canvas.rb������������������������������������������������������0000755�0001750�0001750�00000006534�12147676243�017376� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/canvas.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" stage = Clutter::Stage.new stage.title = "2D Clock" stage.user_resizable = true stage.background_color = Clutter::Color.get_static(:sky_blue_light) stage.set_size(300, 300) stage.show canvas = Clutter::Canvas.new canvas.set_size(300, 300) actor = Clutter::Actor.new actor.content = canvas actor.set_content_scaling_filters(:trilinear, :linear) stage.add_child(actor) actor.add_constraint(Clutter::BindConstraint.new(stage, :size, 0)) idle_resize_id = nil actor.signal_connect("allocation-changed") do |_actor, allocation, flags| idle_resize_id ||= Clutter::Threads.add_timeout(1000) do width, height = _actor.size _actor.content.set_size(width.ceil, height.ceil) idle_resize_id = nil GLib::Source::REMOVE end end stage.signal_connect("destroy") do Clutter.main_quit end canvas.signal_connect("draw") do |_canvas, cairo_context, width, height| now = Time.now seconds = now.sec * Math::PI / 30 minutes = now.min * Math::PI / 30 hours = now.hour * Math::PI / 6 cairo_context.save do cairo_context.operator = :clear cairo_context.paint end cairo_context.operator = :over cairo_context.scale(width, height) cairo_context.line_cap = :round cairo_context.line_width = 0.1 # the black rail that holds the seconds indicator cairo_context.set_source_clutter_color(Clutter::Color.get_static(:black)) cairo_context.translate(0.5, 0.5) cairo_context.arc(0, 0, 0.4, 0, Math::PI * 2) cairo_context.stroke # the seconds indicator color = Clutter::Color.get_static(:white) color.alpha = 128 cairo_context.set_source_clutter_color(color) cairo_context.move_to(0, 0) cairo_context.arc(Math.sin(seconds) * 0.4, -Math.cos(seconds) * 0.4, 0.05, 0, Math::PI * 2) cairo_context.fill # the minutes hand color = Clutter::Color.get_static(:chameleon_dark) color.alpha = 196 cairo_context.set_source_clutter_color(color) cairo_context.move_to(0, 0) cairo_context.line_to(Math.sin(minutes) * 0.4, -Math.cos(minutes) * 0.4) cairo_context.stroke # the hours hand cairo_context.move_to(0, 0) cairo_context.line_to(Math.sin(hours) * 0.2, -Math.cos(hours) * 0.2) cairo_context.stroke true end canvas.invalidate Clutter::Threads.add_timeout(100, 1000) do canvas.invalidate GLib::Source::CONTINUE end Clutter.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/sample/easing-modes.rb������������������������������������������������0000755�0001750�0001750�00000010340�12257552167�020464� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter/examples/easing-mode.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "optparse" require "clutter" duration = 1 parser = OptionParser.new parser.on("--duration=SECONDS", Integer, "Duration of the animation", "(#{duration})") do |_duration| duration = _duration end parser.parse! current_mode_index = 0 easing_modes = Clutter::AnimationMode.values.reject do |mode| mode == Clutter::AnimationMode::CUSTOM_MODE end help_text = lambda do format = <<-EOT.chomp <b>Easing mode: %s (%d of %d)</b> Left click to tween Middle click to jump Right click to change the easing mode EOT current_mode = easing_modes[current_mode_index] format % [current_mode.nick, current_mode_index, easing_modes.size] end stage = Clutter::Stage.new stage.title = "Easing Modes" stage.background_color = Clutter::Color.new(:sky_blue_light) stage.signal_connect("destroy") do Clutter.main_quit end main_stage = stage stage_width, stage_height = stage.size bouncer_width = 50 bouncer_height = 50 canvas = Clutter::Canvas.new canvas.signal_connect("draw") do |_canvas, cairo_context, width, height| cairo_context.operator = :clear cairo_context.paint cairo_context.operator = :over radius = [width, height].max cairo_context.arc(radius / 2, radius / 2, radius / 2, 0.0, 2.0 * Math::PI) bouncer_color = Clutter::Color.new(:scarlet_red_dark) pattern = Cairo::RadialPattern.new(radius / 2, radius / 2, 0, radius, radius, radius) pattern.add_color_stop_rgba(0, bouncer_color.red / 255.0, bouncer_color.green / 255.0, bouncer_color.blue / 255.0, bouncer_color.alpha / 255.0) pattern.add_color_stop_rgba(0.85, bouncer_color.red / 255.0, bouncer_color.green / 255.0, bouncer_color.blue / 255.0, 0.25); cairo_context.set_source(pattern) cairo_context.fill Clutter::Event::STOP end canvas.set_size(bouncer_width, bouncer_height) rectangle = Clutter::Actor.new rectangle.name = "bouncer" rectangle.set_size(bouncer_width, bouncer_height) rectangle.set_pivot_point(0.5, 0.5) rectangle.set_translation(bouncer_width / -2.0, bouncer_height / -2.0, 0.0) rectangle.reactive = true rectangle.content = canvas stage.add_child(rectangle) rectangle.set_position(stage_width / 2, stage_height / 2) label = Clutter::Text.new stage.add_child(label) label.markup = help_text.call label.line_alignment = :right label.add_constraint(Clutter::AlignConstraint.new(stage, :x_axis, 0.95)) label.add_constraint(Clutter::AlignConstraint.new(stage, :y_axis, 0.95)) easing_mode_label = label stage.signal_connect("button-press-event") do |actor, event| case event.button when Clutter::BUTTON_SECONDARY current_mode_index = (current_mode_index + 1) % easing_modes.size label.markup = help_text.call when Clutter::BUTTON_MIDDLE rectangle.set_position(event.x, event.y) when Clutter::BUTTON_PRIMARY current_mode = easing_modes[current_mode_index] rectangle.save_easing_state do rectangle.easing_mode = current_mode rectangle.easing_duration = duration * 1000 rectangle.set_position(event.x, event.y) end end Clutter::Event::STOP end stage.show Clutter.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/README.md�������������������������������������������������������������0000644�0001750�0001750�00000001367�12257552167�015570� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Ruby/Clutter Ruby/Clutter is a Ruby binding of Clutter. ## Requirements * Ruby/GObjectIntrospection in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [Clutter](http://blogs.gnome.org/clutter/) ## Install gem install clutter ## License Copyright (c) 2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ### Exceptions Ruby scripts and image files in sample/ are ported and copied from Clutter. Headers in sample/*.rb describes that the location of the original file of the Ruby script and image files. The original files are licensed under the LGPL v2.1 or later. ## Project Website http://ruby-gnome2.sourceforge.jp/ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/Rakefile��������������������������������������������������������������0000644�0001750�0001750�00000010204�12257552167�015744� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- # # Copyright (C) 2012-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $LOAD_PATH.unshift("./../glib2/lib") require "gnome2/rake/package-task" package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/Clutter is a Ruby binding of Clutter." package.description = "Ruby/Clutter is a Ruby binding of Clutter." package.dependency.gem.runtime = ["cairo-gobject", "gobject-introspection"] package.dependency.gem.development = ["test-unit-notify"] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = [ "glib2", "atk", "pango", "gdk_pixbuf2", "gobject-introspection", ] package.windows.gobject_introspection_dependencies = [ "atk", "pango", ] package.external_packages = [ # Build note: # We need to modify /usr/i686-w64-mingw32/include/GL/ directory because # MinGW w64 bundles old OpenGL headers. Here are changes to build Cogl: # # (1) Put the latest glext.h that can be downloaded from # http://www.opengl.org/registry/api/glext.h into # /usr/i686-w64-mingw32/include/GL/ directory: # # % wget http://www.opengl.org/registry/api/glext.h # % sudo cp glext.h /usr/i686-w64-mingw32/include/GL/ # % sudo chown root:root /usr/i686-w64-mingw32/include/GL/glext.h # # (2) Add missing declarations and includes to # /usr/i686-w64-mingw32/include/GL/gl.h: # # Before: # ... # typedef double GLdouble; # typedef double GLclampd; # typedef void GLvoid; # # #define GL_VERSION_1_1 1 # ... # # After # ... # typedef double GLdouble; # typedef double GLclampd; # typedef void GLvoid; # # typedef ptrdiff_t GLintptr; # typedef ptrdiff_t GLsizeiptr; # typedef char GLchar; # #include <GL/glext.h> # # #define GL_VERSION_1_1 1 # ... { :name => "cogl", :download_site => :gnome, :label => "Cogl", :version => "1.16.0", :compression_method => "xz", :windows => { :configure_args => [ "--disable-glibtest", "--enable-introspection", ], }, }, { :name => "json-glib", :download_site => :gnome, :label => "JSON-GLib", :version => "0.16.2", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], }, }, { :name => "clutter", :download_site => :gnome, :label => "Clutter", :version => "1.16.2", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :build_concurrently => false, }, } ] package.cross_compiling do |spec| if /mingw|mswin/ =~ spec.platform.to_s spec.add_runtime_dependency("atk", "= #{package.version}") spec.add_runtime_dependency("pango", "= #{package.version}") spec.add_runtime_dependency("gdk_pixbuf2", "= #{package.version}") end end end package_task.define Rake::Task["native:clutter:i386-mingw32"].prerequisites.clear namespace :dependency do desc "Install depenencies" task :install do # TODO: Install gir1.2-clutter-1.0 on Debian. end end task :build => "dependency:install" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/test/�����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�015261� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/test/clutter-test-utils.rb��������������������������������������������0000644�0001750�0001750�00000002017�12257552167�021403� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "test-unit" require "test/unit/notify" module ClutterTestUtils def omit_if_clutter_color_hash_expect_arguments unless Clutter::Color.method(:hash).parameters.empty? omit("This test can't be run on this environment.") end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter/test/run-test.rb������������������������������������������������������0000755�0001750�0001750�00000003734�12257552167�017401� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2012-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject") gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection") clutter_base = File.join(ruby_gnome2_base, "clutter") modules = [ [glib_base, "glib2"], [cairo_gobject_base, "cairo-gobject"], [gobject_introspection_base, "gobject-introspection"], [clutter_base, "clutter"], ] modules.each do |target, module_name| if File.exist?("Makefile") and system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require "glib-test-init" $VERBOSE = false # TODO: remove me $LOAD_PATH.unshift(File.join(gobject_introspection_base, "test")) require "gobject-introspection-test-utils" $LOAD_PATH.unshift(File.join(clutter_base, "test")) require "clutter-test-utils" require "clutter" Clutter.init([]) exit Test::Unit::AutoRunner.run(true, clutter_base) ������������������������������������ruby-gnome2-all-2.1.0/clutter/test/test-clutter-color.rb��������������������������������������������0000644�0001750�0001750�00000003307�12257552167�021364� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class ClutterColorTest < Test::Unit::TestCase include ClutterTestUtils def test_rgb omit_if_clutter_color_hash_expect_arguments assert_equal("#ff0000ff", Clutter::Color.rgb(255, 0, 0).to_s) end def test_rgba omit_if_clutter_color_hash_expect_arguments assert_equal("#ff00007f", Clutter::Color.rgb(255, 0, 0, 127).to_s) end def test_hls omit_if_clutter_color_hash_expect_arguments assert_equal("#20dfdfff", Clutter::Color.hls(180, 0.5, 0.75).to_s) end def test_hlsa omit_if_clutter_color_hash_expect_arguments assert_equal("#20dfdf7f", Clutter::Color.hls(180, 0.5, 0.75, 127).to_s) end def test_pixel omit_if_clutter_color_hash_expect_arguments assert_equal("#20dfdf7f", Clutter::Color.pixel(0x20dfdf7f).to_s) end def test_parse omit_if_clutter_color_hash_expect_arguments assert_equal("#20dfdf7f", Clutter::Color.parse("rgba(32, 223, 223, 0.5)").to_s) end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/exec_make.rb������������������������������������������������������������������0000644�0001750�0001750�00000001540�11701304107�015044� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin exec_make.rb is called by top-level Makefile. $Id: exec_make.rb,v 1.5 2005/01/31 10:34:33 mutoh Exp $ Copyright (C) 2003-2005 Ruby-GNOME2 Project Team =end argv = ARGV strict = false if ARGV[0] == "--strict" || ARGV[0] == "-s" strict = true argv = ARGV[1..-1] end SUBDIRS = argv[0].split(" ") EXECUTE = argv[1..-1].join(' ') success = [] failure = [] SUBDIRS.each do |subdir| Dir.chdir(subdir) begin ret = system(EXECUTE) ensure Dir.chdir("..") end if ret success << subdir else failure << subdir end end success << "NONE" if success.size == 0 failure << "NONE" if failure.size == 0 puts "\n" puts "-----" puts "SUCCEEDED: #{success.join(' ')}" if success.size > 0 puts "FAILED: #{failure.join(' ')}" if failure.size > 0 puts "-----" puts "Done." if strict && (failure.select { |x| x != "NONE" }.length > 0) exit(1) end ����������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/extconf.rb��������������������������������������������������������������������0000644�0001750�0001750�00000006320�12257552167�014614� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin top-level extconf.rb for Ruby-GNOME2 $Id: extconf.rb,v 1.17 2007/10/22 12:19:17 ktou Exp $ Copyright (C) 2003-2005 Ruby-GNOME2 Project Team =end require 'English' require 'mkmf' require 'fileutils' require 'pathname' priorlibs = [ "glib2", "gobject-introspection", "gio2", "gdk_pixbuf2", "pango", "atk", "gtk2", "gdk3", "gtk3", ] unsupported_libraries = [ "gstreamer-no-gi" ] # # detect sub-directories # $ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['RUBY_INSTALL_NAME'] + RbConfig::CONFIG['EXEEXT']) $ruby = arg_config("--ruby", $ruby) rm = "rm -f" if /mswin/ =~ RUBY_PLATFORM rm = "del" end $srcdir = File.dirname(__FILE__) $topsrcdir = $configure_args["--topsrcdir"] ||= $srcdir $topdir = $configure_args["--topdir"] ||= Dir.pwd $strict = $configure_args["--strict"] ? "--strict" : "" $srcdir = File.expand_path($srcdir) $topsrcdir = File.expand_path($topsrcdir) $topdir = File.expand_path($topdir) subdirs = ARGV.select{|v| /^--/ !~ v} if subdirs.size == 0 subdirs = Dir.glob($topsrcdir+"/*/extconf.rb") subdirs.collect! do |subdir| subdir[0..$topsrcdir.size] = "" File.dirname(subdir) end priorlibs &= subdirs subdirs -= priorlibs subdirs = priorlibs + subdirs #Change the order end subdirs -= unsupported_libraries # # generate sub-directory Makefiles # target_modules = [] ignore_modules = [] ruby, *ruby_args = Shellwords.shellwords($ruby) if ARGV.grep(/\A--ruby=/) extra_args = ["--ruby=#{$ruby}"] + ARGV.reject {|arg| /\A--ruby=/ =~ arg} else extra_args = ARGV.dup end subdirs.each do |subdir| STDERR.puts("#{$0}: Entering directory `#{subdir}'") FileUtils.mkdir_p(subdir) topdir = File.join(*([".."] * subdir.split(/\/+/).size)) dir = $topsrcdir dir = File.join(topdir, dir) unless Pathname.new(dir).absolute? srcdir = File.join(dir, subdir) args = ruby_args + ["-C", subdir, File.join(srcdir, "extconf.rb"), "--topsrcdir=#{dir}", "--topdir=#{topdir}", *extra_args] ret = system(ruby, *args) STDERR.puts("#{$0}: Leaving directory '#{subdir}'") if ret target_modules << subdir else ignore_modules << subdir end end puts "\n-----" unless target_modules.empty? puts "Target libraries: #{target_modules.join(', ')}" end unless ignore_modules.empty? puts "Ignored libraries: #{ignore_modules.join(', ')}" end # # generate top-level Makefile # def run_make_in_sub_dir(sub_dir, target) if /mswin/ =~ RUBY_PLATFORM " $(COMMAND) '#{sub_dir}' $(MAKE) #{target}" else " (cd '#{sub_dir}' && $(MAKE) #{target})" end end File.open("Makefile", "w") do |makefile| makefile.print(<<-EOM) TOPSRCDIR = #{$topsrcdir} COMMAND = #{$ruby} #{$topsrcdir}/exec_make.rb #{$strict} RM = #{rm} EOM ["all", "install", "site-install", "clean", "distclean"].each do |target| makefile.print(<<-EOM) #{target}: EOM target_modules.each do |target_module| sub_target = "#{target}-#{target_module}" makefile.print(<<-EOM) #{target}: #{sub_target} #{sub_target}: #{run_make_in_sub_dir(target_module, target)} EOM end end makefile.print(<<-EOM) distclean: distclean-toplevel distclean-toplevel: $(RM) Makefile mkmf.log EOM end puts "-----" puts "Done." $makefile_created = true ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/�������������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665515�013472� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�014246� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552170�015132� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-renderer-accel.c�������������������������������������0000644�0001750�0001750�00000002621�12102213527�022163� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCellRendererAccel #define _SELF(s) (RVAL2GTKCELLRENDERERACCEL(s)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_accel_new()); return Qnil; } void Init_gtk_cellrendereraccel(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_ACCEL, "CellRendererAccel", mGtk); RG_DEF_METHOD(initialize, 0); G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_ACCEL_MODE, "Mode", RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-file-filter.c���������������������������������������������0000644�0001750�0001750�00000007227�12102213527�020604� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Ruby-GNOME2 Project Team * Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cFileFilter #define _SELF(self) RVAL2GTKFILEFILTER(self) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_file_filter_new()); return Qnil; } static VALUE rg_set_name(VALUE self, VALUE name) { gtk_file_filter_set_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_name(VALUE self) { return CSTR2RVAL(gtk_file_filter_get_name(_SELF(self))); } static VALUE rg_add_mime_type(VALUE self, VALUE mime) { gtk_file_filter_add_mime_type(_SELF(self), RVAL2CSTR(mime)); return self; } static VALUE rg_add_pattern(VALUE self, VALUE pattern) { gtk_file_filter_add_pattern(_SELF(self), RVAL2CSTR(pattern)); return self; } /* Should return true/false */ static gboolean filter_func(const GtkFileFilterInfo *info, gpointer func) { return CBOOL2RVAL(rb_funcall((VALUE)func, id_call, 5, GTKFILEFILTERFLAGS2RVAL(info->contains), CSTR2RVAL(info->filename), CSTR2RVAL(info->uri), CSTR2RVAL(info->display_name), CSTR2RVAL(info->mime_type))); } static VALUE rg_add_pixbuf_formats(VALUE self) { gtk_file_filter_add_pixbuf_formats(_SELF(self)); return self; } static VALUE rg_add_custom(VALUE self, VALUE needed) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_file_filter_add_custom(_SELF(self), RVAL2GTKFILEFILTERFLAGS(needed), (GtkFileFilterFunc)filter_func, (gpointer)func, NULL); return self; } static VALUE rg_needed(VALUE self) { return GTKFILEFILTERFLAGS2RVAL(gtk_file_filter_get_needed(_SELF(self))); } static VALUE rg_filter_p(VALUE self, VALUE contains, VALUE filename, VALUE uri, VALUE display_name, VALUE mime_type) { GtkFileFilterInfo info; info.contains = RVAL2GTKFILEFILTERFLAGS(contains); info.filename = RVAL2CSTR(filename); info.uri = RVAL2CSTR(uri); info.display_name = RVAL2CSTR(display_name); info.mime_type = RVAL2CSTR(mime_type); return CBOOL2RVAL(gtk_file_filter_filter(_SELF(self), &info)); } void Init_gtk_file_filter(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FILE_FILTER, "FileFilter", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_name, 1); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(add_mime_type, 1); RG_DEF_METHOD(add_pattern, 1); RG_DEF_METHOD(add_pixbuf_formats, 0); RG_DEF_METHOD(add_custom, 1); RG_DEF_METHOD(needed, 0); RG_DEF_METHOD_P(filter, 5); G_DEF_CLASS(GTK_TYPE_FILE_FILTER_FLAGS, "Flags", RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-renderer-spin.c��������������������������������������0000644�0001750�0001750�00000002471�12102213527�022070� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCellRendererSpin #define _SELF(s) (RVAL2GTKCELLRENDERERSPIN(s)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_spin_new()); return Qnil; } void Init_gtk_cellrendererspin(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_SPIN, "CellRendererSpin", mGtk); RG_DEF_METHOD(initialize, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-settings.c������������������������������������������������0000644�0001750�0001750�00000016007�12102213527�020236� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cSettings static VALUE prop_func_table; static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_settings_get_default()); } static VALUE rg_s_get_for_screen(G_GNUC_UNUSED VALUE self, VALUE screen) { return GOBJ2RVAL(gtk_settings_get_for_screen(RVAL2GDKSCREEN(screen))); } /* * Gtk::Settings.install_property(...) do |spec, str| * #parse str * new_val = .... # parse value from string. * new_val # return new_val or nil if you can't convert the value. * end */ static gboolean rc_property_parser(const GParamSpec *pspec, const GString *rc_string, GValue *property_value) { VALUE spec = GOBJ2RVAL((gpointer)pspec); VALUE func = rb_hash_aref(prop_func_table, spec); VALUE ret = rb_funcall(func, id_call, 2, spec, CSTR2RVAL(rc_string->str)); if (NIL_P(ret)) { return FALSE; } else if (RVAL2CBOOL(ret)){ rbgobj_rvalue_to_gvalue(ret, property_value); return TRUE; } else { rb_raise(rb_eArgError, "Gtk::Settings#install_property() block should return new value or nil"); } } static VALUE rg_s_install_property(VALUE self, VALUE spec) { GParamSpec* pspec = RVAL2GPARAMSPEC(spec); if (rb_block_given_p()){ VALUE func = rb_block_proc(); rb_hash_aset(prop_func_table, spec, func); gtk_settings_install_property_parser(pspec, (GtkRcPropertyParser)rc_property_parser); } else { gtk_settings_install_property(pspec); } return self; } static VALUE settings_rc_property_parse(G_GNUC_UNUSED VALUE self, VALUE rbspec, VALUE rbstring, GtkRcPropertyParser parser) { GParamSpec *spec = RVAL2GPARAMSPEC(rbspec); GString *string = g_string_new(RVAL2CSTR(rbstring)); GValue property = G_VALUE_INIT; gboolean parsed; g_value_init(&property, spec->value_type); parsed = parser(spec, string, &property); g_string_free(string, TRUE); return parsed ? GVAL2RVAL_UNSET(&property) : Qnil; } static VALUE rg_s_rc_property_parse_color(VALUE self, VALUE rbspec, VALUE rbstring) { return settings_rc_property_parse(self, rbspec, rbstring, gtk_rc_property_parse_color); } static VALUE rg_s_rc_property_parse_enum(VALUE self, VALUE rbspec, VALUE rbstring) { return settings_rc_property_parse(self, rbspec, rbstring, gtk_rc_property_parse_enum); } static VALUE rg_s_rc_property_parse_flags(VALUE self, VALUE rbspec, VALUE rbstring) { return settings_rc_property_parse(self, rbspec, rbstring, gtk_rc_property_parse_flags); } static VALUE rg_s_rc_property_parse_requisition(G_GNUC_UNUSED VALUE self, VALUE rbspec, VALUE rbstring) { GParamSpec *spec = RVAL2GPARAMSPEC(rbspec); GString *string = g_string_new(RVAL2CSTR(rbstring)); GValue property = G_VALUE_INIT; gboolean parsed; GtkRequisition *requisition; gint width; gint height; g_value_init(&property, GTK_TYPE_REQUISITION); parsed = gtk_rc_property_parse_requisition(spec, string, &property); g_string_free(string, TRUE); if (!parsed) return Qnil; requisition = g_value_get_boxed(&property); width = requisition->width; height = requisition->height; g_value_unset(&property); return rb_assoc_new(INT2NUM(width), INT2NUM(height)); } static VALUE settings_rc_property_parse_border_result(VALUE value) { return GTKBORDER2RVAL(g_value_get_boxed((GValue *)value)); } static VALUE settings_rc_property_parse_border_ensure(VALUE value) { g_value_unset((GValue *)value); return Qnil; } static VALUE rg_s_rc_property_parse_border(G_GNUC_UNUSED VALUE self, VALUE rbspec, VALUE rbstring) { GParamSpec *spec = RVAL2GPARAMSPEC(rbspec); GString *string = g_string_new(RVAL2CSTR(rbstring)); GValue property = G_VALUE_INIT; gboolean parsed; g_value_init(&property, GTK_TYPE_BORDER); parsed = gtk_rc_property_parse_border(spec, string, &property); g_string_free(string, TRUE); if (!parsed) return Qnil; return rb_ensure(settings_rc_property_parse_border_result, (VALUE)&property, settings_rc_property_parse_border_ensure, (VALUE)&property); } static VALUE rg_set_property_value(VALUE self, VALUE rbname, VALUE rbvalue, VALUE origin) { GtkSettings *settings = RVAL2GTKSETTINGS(self); GtkSettingsValue svalue = { (gchar *)RVAL2CSTR(origin), G_VALUE_INIT }; const gchar *name = RVAL2CSTR(rbname); g_value_init(&svalue.value, RVAL2GTYPE(rbvalue)); rbgobj_rvalue_to_gvalue(rbvalue, &svalue.value); gtk_settings_set_property_value(settings, name, &svalue); g_value_unset(&svalue.value); return self; } /* We don't need them, Use set_property_value() instead. void gtk_settings_set_string_property (GtkSettings *settings, const gchar *name, const gchar *v_string, const gchar *origin); void gtk_settings_set_long_property (GtkSettings *settings, const gchar *name, glong v_long, const gchar *origin); void gtk_settings_set_double_property (GtkSettings *settings, const gchar *name, gdouble v_double, const gchar *origin); */ void Init_gtk_settings(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SETTINGS, "Settings", mGtk); rb_global_variable(&prop_func_table); prop_func_table = rb_hash_new(); RG_DEF_SMETHOD(default, 0); RG_DEF_SMETHOD(get_for_screen, 1); RG_DEF_SMETHOD(install_property, 1); RG_DEF_SMETHOD(rc_property_parse_color, 2); RG_DEF_SMETHOD(rc_property_parse_enum, 2); RG_DEF_SMETHOD(rc_property_parse_flags, 2); RG_DEF_SMETHOD(rc_property_parse_requisition, 2); RG_DEF_SMETHOD(rc_property_parse_border, 2); RG_DEF_METHOD(set_property_value, 3); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-file-chooser-button.c�������������������������������������0000644�0001750�0001750�00000003212�12102213527�022260� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cFileChooserButton static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE title, action; GtkWidget* widget; rb_scan_args(argc, argv, "11", &title, &action); if (TYPE(title) == T_STRING) { widget = gtk_file_chooser_button_new(RVAL2CSTR(title), RVAL2GTKFILECHOOSERACTION(action)); } else { widget = gtk_file_chooser_button_new_with_dialog(RVAL2GTKWIDGET(title)); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_filechooserbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_BUTTON, "FileChooserButton", mGtk); RG_DEF_METHOD(initialize, -1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-icon-view.c�����������������������������������������������0000644�0001750�0001750�00000017675�12102213527�020312� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cIconView #define _SELF(s) (RVAL2GTKICONVIEW(s)) static ID id_model; static ID id_select_path; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE model; rb_scan_args(argc, argv, "01", &model); if (NIL_P(model)){ RBGTK_INITIALIZE(self, gtk_icon_view_new()); } else { G_CHILD_SET(self, id_model, model); RBGTK_INITIALIZE(self, gtk_icon_view_new_with_model(RVAL2GTKTREEMODEL(model))); } return Qnil; } static VALUE rg_get_path_at_pos(VALUE self, VALUE x, VALUE y) { return GTKTREEPATH2RVAL(gtk_icon_view_get_path_at_pos(_SELF(self), NUM2INT(x), NUM2INT(y))); } static void iview_foreach_func(GtkIconView *iview, GtkTreePath *path, gpointer *func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(iview), GTKTREEPATH2RVAL(path)); } static VALUE rg_selected_each(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_icon_view_selected_foreach(_SELF(self), (GtkIconViewForeachFunc)iview_foreach_func, (gpointer)func); return self; } static VALUE rg_select_path(VALUE self, VALUE path) { G_CHILD_SET(self, id_select_path, path); gtk_icon_view_select_path(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_unselect_path(VALUE self, VALUE path) { G_CHILD_UNSET(self, id_select_path); gtk_icon_view_unselect_path(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_path_is_selected_p(VALUE self, VALUE path) { return CBOOL2RVAL(gtk_icon_view_path_is_selected(_SELF(self), RVAL2GTKTREEPATH(path))); } static VALUE rg_selected_items(VALUE self) { GList* list = gtk_icon_view_get_selected_items(_SELF(self)); VALUE ret = BOXEDGLIST2RVAL(list, GTK_TYPE_TREE_PATH); g_list_foreach(list, (GFunc)gtk_tree_path_free, NULL); g_list_free(list); return ret; } static VALUE rg_item_activated(VALUE self, VALUE path) { gtk_icon_view_item_activated(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_create_drag_icon(VALUE self, VALUE path) { return GOBJ2RVAL(gtk_icon_view_create_drag_icon(_SELF(self), RVAL2GTKTREEPATH(path))); } static VALUE rg_enable_model_drag_dest(VALUE self, VALUE rbtargets, VALUE rbactions) { GtkIconView *icon_view = _SELF(self); GdkDragAction actions = RVAL2GDKDRAGACTION(rbactions); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_icon_view_enable_model_drag_dest(icon_view, targets, n, actions); g_free(targets); return self; } static VALUE rg_enable_model_drag_source(VALUE self, VALUE rbstart_button_mask, VALUE rbtargets, VALUE rbactions) { GtkIconView *icon_view = _SELF(self); GdkModifierType start_button_mask = RVAL2GDKMODIFIERTYPE(rbstart_button_mask); GdkDragAction actions = RVAL2GDKDRAGACTION(rbactions); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_icon_view_enable_model_drag_source(icon_view, start_button_mask, targets, n, actions); g_free(targets); return self; } static VALUE rg_cursor(VALUE self) { GtkTreePath* path; GtkCellRenderer* cell; gboolean cursor_set = gtk_icon_view_get_cursor(_SELF(self), &path, &cell); return cursor_set ? rb_assoc_new(GTKTREEPATH2RVAL(path), GOBJ2RVAL(cell)) : Qnil; } static VALUE rg_get_dest_item(VALUE self, VALUE drag_x, VALUE drag_y) { GtkTreePath* path; GtkIconViewDropPosition pos; gboolean item_at_pos = gtk_icon_view_get_dest_item_at_pos(_SELF(self), NUM2INT(drag_x), NUM2INT(drag_y), &path, &pos); return item_at_pos ? rb_assoc_new(GTKTREEPATH2RVAL(path), GTKICONVIEWDROPPOSITION2RVAL(pos)) : Qnil; } static VALUE rg_drag_dest_item(VALUE self) { GtkTreePath* path; GtkIconViewDropPosition pos; gtk_icon_view_get_drag_dest_item(_SELF(self), &path, &pos); return rb_assoc_new(GTKTREEPATH2RVAL(path), GTKICONVIEWDROPPOSITION2RVAL(pos)); } static VALUE rg_get_item(VALUE self, VALUE x, VALUE y) { GtkTreePath* path; GtkCellRenderer* cell; gboolean item_at_pos = gtk_icon_view_get_item_at_pos(_SELF(self), NUM2INT(x), NUM2INT(y), &path, &cell); return item_at_pos ? rb_assoc_new(GTKTREEPATH2RVAL(path), GOBJ2RVAL(cell)) : Qnil; } static VALUE rg_visible_range(VALUE self) { GtkTreePath* start_path; GtkTreePath* end_path; gboolean valid_paths = gtk_icon_view_get_visible_range(_SELF(self), &start_path, &end_path); return valid_paths ? rb_assoc_new(GTKTREEPATH2RVAL(start_path), GTKTREEPATH2RVAL(end_path)) : Qnil; } static VALUE rg_scroll_to_path(VALUE self, VALUE path, VALUE use_align, VALUE row_align, VALUE col_align) { gtk_icon_view_scroll_to_path(_SELF(self), RVAL2GTKTREEPATH(path), RVAL2CBOOL(use_align), NUM2DBL(row_align), NUM2DBL(col_align)); return self; } static VALUE rg_set_cursor(VALUE self, VALUE path, VALUE cell, VALUE start_editing) { gtk_icon_view_set_cursor(_SELF(self), RVAL2GTKTREEPATH(path), NIL_P(cell) ? NULL : RVAL2GTKCELLRENDERER(cell), RVAL2CBOOL(start_editing)); return self; } static VALUE rg_set_drag_dest_item(VALUE self, VALUE path, VALUE pos) { gtk_icon_view_set_drag_dest_item(_SELF(self), NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path), RVAL2GTKICONVIEWDROPPOSITION(pos)); return self; } static VALUE rg_unset_model_drag_dest(VALUE self) { gtk_icon_view_unset_model_drag_dest(_SELF(self)); return self; } static VALUE rg_unset_model_drag_source(VALUE self) { gtk_icon_view_unset_model_drag_source(_SELF(self)); return self; } void Init_gtk_iconview(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_VIEW, "IconView", mGtk); id_model = rb_intern("model"); id_select_path = rb_intern("select_path"); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(get_path_at_pos, 2); RG_DEF_ALIAS("get_path", "get_path_at_pos"); RG_DEF_METHOD(selected_each, 0); RG_DEF_METHOD(select_path, 1); RG_DEF_METHOD(unselect_path, 1); RG_DEF_METHOD_P(path_is_selected, 1); RG_DEF_METHOD(selected_items, 0); RG_DEF_METHOD(item_activated, 1); RG_DEF_METHOD(create_drag_icon, 1); RG_DEF_METHOD(enable_model_drag_dest, 2); RG_DEF_METHOD(enable_model_drag_source, 3); RG_DEF_METHOD(cursor, 0); RG_DEF_METHOD(get_dest_item, 2); RG_DEF_METHOD(drag_dest_item, 0); RG_DEF_METHOD(get_item, 2); RG_DEF_METHOD(visible_range, 0); RG_DEF_METHOD(scroll_to_path, 4); RG_DEF_METHOD(set_cursor, 3); RG_DEF_METHOD(set_drag_dest_item, 2); RG_DEF_METHOD(unset_model_drag_dest, 0); RG_DEF_METHOD(unset_model_drag_source, 0); G_DEF_CLASS(GTK_TYPE_ICON_VIEW_DROP_POSITION, "Type", RG_TARGET_NAMESPACE); } �������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-page-setup-unix-dialog.c����������������������������������0000644�0001750�0001750�00000005442�12102213527�022667� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #ifdef HAVE_GTK_UNIX_PRINT #include <gtk/gtkunixprint.h> #define RG_TARGET_NAMESPACE cPageSetupUnixDialog #define _SELF(s) (RVAL2GTKPAGESETUPUNIXDIALOG(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, rb_title, rb_parent; const gchar *title; GtkWindow *parent; GtkWidget *dialog; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "title", &rb_title, "parent", &rb_parent, NULL); title = RVAL2CSTR_ACCEPT_NIL(rb_title); parent = NIL_P(rb_parent) ? NULL : RVAL2GTKWINDOW(rb_parent); dialog = gtk_page_setup_unix_dialog_new(title, parent); RBGTK_INITIALIZE(self, dialog); return Qnil; } static VALUE rg_set_page_setup(VALUE self, VALUE page_setup) { gtk_page_setup_unix_dialog_set_page_setup(_SELF(self), RVAL2GTKPAGESETUP(page_setup)); return self; } static VALUE rg_page_setup(VALUE self) { return GOBJ2RVAL(gtk_page_setup_unix_dialog_get_page_setup(_SELF(self))); } static VALUE rg_set_print_settings(VALUE self, VALUE print_settings) { gtk_page_setup_unix_dialog_set_print_settings(_SELF(self), RVAL2GTKPRINTSETTINGS(print_settings)); return Qnil; } static VALUE rg_print_settings(VALUE self) { return GOBJ2RVAL(gtk_page_setup_unix_dialog_get_print_settings(_SELF(self))); } #endif void Init_gtk_page_setup_unix_dialog(VALUE mGtk) { #ifdef HAVE_GTK_UNIX_PRINT VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PAGE_SETUP_UNIX_DIALOG, "PageSetupUnixDialog", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_page_setup, 1); RG_DEF_METHOD(page_setup, 0); RG_DEF_METHOD(set_print_settings, 1); RG_DEF_METHOD(print_settings, 0); #endif } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-drag-gdk-drag-context.c�����������������������������������0000644�0001750�0001750�00000007226�12102213527�022456� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cDragContext #define _SELF(self) (RVAL2GDKDRAGCONTEXT(self)) static VALUE rg_finish(VALUE self, VALUE success, VALUE del, VALUE time) { gtk_drag_finish(_SELF(self), RVAL2CBOOL(success), RVAL2CBOOL(del), NUM2UINT(time)); return self; } static VALUE rg_source_widget(VALUE self) { return GOBJ2RVAL(gtk_drag_get_source_widget(_SELF(self))); } static VALUE rg_set_icon(VALUE self, VALUE icon) { if (TYPE(icon) == T_HASH) { VALUE stock_id, icon_name, gicon, pixbuf, surface, widget, hot_x, hot_y, buffer; rbg_scan_options(icon, "stock_id", &stock_id, "icon_name", &icon_name, "gicon", &gicon, "pixbuf", &pixbuf, "surface", &surface, "widget", &widget, "hot_x", &hot_x, "hot_y", &hot_y, NULL); if (!NIL_P(stock_id)) gtk_drag_set_icon_stock(_SELF(self), RVAL2GLIBID(stock_id, buffer), NUM2INT(hot_x), NUM2INT(hot_y)); else if (!NIL_P(icon_name)) gtk_drag_set_icon_name(_SELF(self), RVAL2CSTR(icon_name), NUM2INT(hot_x), NUM2INT(hot_y)); #if GTK_CHECK_VERSION(3, 2, 0) else if (!NIL_P(gicon)) gtk_drag_set_icon_gicon(_SELF(self), RVAL2GICON(gicon), NUM2INT(hot_x), NUM2INT(hot_y)); #endif else if (!NIL_P(pixbuf)) gtk_drag_set_icon_pixbuf(_SELF(self), RVAL2GDKPIXBUF(pixbuf), NUM2INT(hot_x), NUM2INT(hot_y)); else if (!NIL_P(surface)) gtk_drag_set_icon_surface(_SELF(self), RVAL2CRSURFACE(surface)); else if (!NIL_P(widget)) gtk_drag_set_icon_widget(_SELF(self), RVAL2GTKWIDGET(widget), NUM2INT(hot_x), NUM2INT(hot_y)); else rb_raise(rb_eArgError, "Invalid arguments."); } else { gtk_drag_set_icon_surface(_SELF(self), RVAL2CRSURFACE(icon)); } return self; } static VALUE rg_set_icon_default(VALUE self) { gtk_drag_set_icon_default(_SELF(self)); return self; } void Init_gtk_drag_gdk_drag_context(void) { VALUE RG_TARGET_NAMESPACE = GTYPE2CLASS(GDK_TYPE_DRAG_CONTEXT); RG_DEF_METHOD(finish, 3); RG_DEF_METHOD(source_widget, 0); RG_DEF_METHOD(set_icon, 1); RG_DEF_METHOD(set_icon_default, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-handle-box.c����������������������������������������������0000644�0001750�0001750�00000003034�12102213527�020413� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cHandleBox static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_handle_box_new()); return Qnil; } void Init_gtk_handle_box(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HANDLE_BOX, "HandleBox", mGtk); RG_DEF_METHOD(initialize, 0); rb_undef_method(RG_TARGET_NAMESPACE, "shadow"); rb_undef_method(RG_TARGET_NAMESPACE, "shadow="); rb_undef_method(RG_TARGET_NAMESPACE, "set_shadow"); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-invisible.c�����������������������������������������������0000644�0001750�0001750�00000003010�12102213527�020350� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cInvisible #define _SELF(s) RVAL2GTKINVISIBLE(s) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE screen; rb_scan_args(argc, argv, "01", &screen); if (argc == 0){ RBGTK_INITIALIZE(self, gtk_invisible_new()); } else { RBGTK_INITIALIZE(self, gtk_invisible_new_for_screen( RVAL2GDKSCREEN(screen))); } return Qnil; } void Init_gtk_invisible(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_INVISIBLE, "Invisible", mGtk); RG_DEF_METHOD(initialize, -1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-icon-theme.c����������������������������������������������0000644�0001750�0001750�00000016500�12102213527�020424� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cIconTheme #define _SELF(i) RVAL2GTKICONTHEME(i) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_icon_theme_new()); return Qnil; } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_icon_theme_get_default()); } static VALUE rg_s_get_for_screen(G_GNUC_UNUSED VALUE self, VALUE screen) { return GOBJ2RVAL(gtk_icon_theme_get_for_screen(RVAL2GDKSCREEN(screen))); } static VALUE rg_set_screen(VALUE self, VALUE screen) { gtk_icon_theme_set_screen(_SELF(self), RVAL2GDKSCREEN(screen)); return self; } static VALUE rg_set_search_path(VALUE self, VALUE rbpath) { GtkIconTheme *theme = _SELF(self); long n; const gchar **path = RVAL2STRS(rbpath, n); gtk_icon_theme_set_search_path(theme, path, n); g_free(path); return self; } static VALUE rg_search_path(VALUE self) { gchar **path; gtk_icon_theme_get_search_path(_SELF(self), &path, NULL); return STRV2RVAL_FREE(path); } static VALUE rg_append_search_path(VALUE self, VALUE path) { gtk_icon_theme_append_search_path(_SELF(self), RVAL2CSTR(path)); return self; } static VALUE rg_prepend_search_path(VALUE self, VALUE path) { gtk_icon_theme_prepend_search_path(_SELF(self), RVAL2CSTR(path)); return self; } static VALUE rg_set_custom_theme(VALUE self, VALUE theme_name) { gtk_icon_theme_set_custom_theme(_SELF(self), RVAL2CSTR_ACCEPT_NIL(theme_name)); return self; } static VALUE rg_has_icon_p(VALUE self, VALUE icon_name) { return CBOOL2RVAL(gtk_icon_theme_has_icon(_SELF(self), RVAL2CSTR(icon_name))); } static VALUE rg_lookup_icon(VALUE self, VALUE icon, VALUE size, VALUE flags) { GtkIconInfo* info; if (TYPE(icon) == T_STRING) { info = gtk_icon_theme_lookup_icon(_SELF(self), RVAL2CSTR(icon), NUM2INT(size), RVAL2GTKICONLOOKUPFLAGS(flags)); } else { info = gtk_icon_theme_lookup_by_gicon(_SELF(self), RVAL2GICON(icon), NUM2INT(size), RVAL2GTKICONLOOKUPFLAGS(flags)); } /* TODO: need gtk_icon_info_free? */ return GTKICONINFO2RVAL(info); } static VALUE rg_load_icon(VALUE self, VALUE icon_name, VALUE size, VALUE flags) { GError *error = NULL; GdkPixbuf *pixbuf; pixbuf = gtk_icon_theme_load_icon(_SELF(self), RVAL2CSTR(icon_name), NUM2INT(size), RVAL2GTKICONLOOKUPFLAGS(flags), &error); if (!pixbuf) RAISE_GERROR(error); return GOBJ2RVAL(pixbuf); } static VALUE rg_icons(int argc, VALUE *argv, VALUE self) { VALUE context; GList *icons; rb_scan_args(argc, argv, "01", &context); icons = gtk_icon_theme_list_icons(_SELF(self), RVAL2CSTR_ACCEPT_NIL(context)); return CSTRGLIST2RVAL_FREE(icons, g_list_free, g_free); } static VALUE rg_get_icon_sizes(VALUE self, VALUE icon_name) { VALUE ary = rb_ary_new(); gint* sizes = gtk_icon_theme_get_icon_sizes(_SELF(self), RVAL2CSTR(icon_name)); gint* tmp_sizes = sizes; while (*tmp_sizes) { rb_ary_push(ary, INT2NUM(*tmp_sizes)); tmp_sizes++; } g_free(sizes); return ary; } static VALUE rg_example_icon_name(VALUE self) { return CSTR2RVAL_FREE(gtk_icon_theme_get_example_icon_name(_SELF(self))); } static VALUE rg_rescan_if_needed(VALUE self) { return CBOOL2RVAL(gtk_icon_theme_rescan_if_needed(_SELF(self))); } static VALUE rg_s_add_builtin_icon(VALUE self, VALUE icon_name, VALUE size, VALUE pixbuf) { gtk_icon_theme_add_builtin_icon(RVAL2CSTR(icon_name), NUM2INT(size), RVAL2GDKPIXBUF(pixbuf)); return self; } static VALUE rg_choose_icon(int argc, VALUE *argv, VALUE self) { VALUE rb_icon_names, rb_size, rb_flags; gint size; const gchar **icon_names; GtkIconLookupFlags flags; GtkIconInfo *info; rb_scan_args(argc, argv, "21", &rb_icon_names, &rb_size, &rb_flags); if (RVAL2CBOOL(rb_obj_is_kind_of(rb_icon_names, rb_cString))) { icon_names = ALLOCA_N(const gchar *, 2); icon_names[0] = RVAL2CSTR(rb_icon_names); icon_names[1] = NULL; } else if (RVAL2CBOOL(rb_obj_is_kind_of(rb_icon_names, rb_cArray))) { icon_names = RVAL2STRV(rb_icon_names); } else { rb_raise(rb_eArgError, "expected (name, size), (name, size, flags), " "([name1, name2, ...], size) or " "([name1, name2, ...], size, flags): %s", RBG_INSPECT(rb_ary_new4(argc, argv))); } size = NUM2INT(rb_size); if (NIL_P(rb_flags)) { flags = GTK_ICON_LOOKUP_GENERIC_FALLBACK; } else { flags = RVAL2GTKICONLOOKUPFLAGS(rb_flags); } info = gtk_icon_theme_choose_icon(_SELF(self), icon_names, size, flags); return GTKICONINFO2RVAL(info); } static VALUE rg_contexts(VALUE self) { return CSTRGLIST2RVAL_FREE(gtk_icon_theme_list_contexts(_SELF(self)), g_list_free, g_free); } void Init_gtk_icon_theme(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_THEME, "IconTheme", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_SMETHOD(default, 0); RG_DEF_SMETHOD(get_for_screen, 1); RG_DEF_METHOD(set_screen, 1); RG_DEF_METHOD(set_search_path, 1); RG_DEF_METHOD(search_path, 0); RG_DEF_METHOD(append_search_path, 1); RG_DEF_METHOD(prepend_search_path, 1); RG_DEF_METHOD(set_custom_theme, 1); RG_DEF_METHOD_P(has_icon, 1); RG_DEF_METHOD(lookup_icon, 3); RG_DEF_METHOD(load_icon, 3); RG_DEF_METHOD(icons, -1); RG_DEF_METHOD(get_icon_sizes, 1); RG_DEF_METHOD(example_icon_name, 0); RG_DEF_METHOD(rescan_if_needed, 0); RG_DEF_SMETHOD(add_builtin_icon, 3); RG_DEF_METHOD(choose_icon, -1); RG_DEF_METHOD(contexts, 0); G_DEF_ERROR(GTK_ICON_THEME_ERROR, "IconThemeError", mGtk, rb_eRuntimeError, GTK_TYPE_ICON_THEME_ERROR); G_DEF_CLASS(GTK_TYPE_ICON_LOOKUP_FLAGS, "LookupFlags", RG_TARGET_NAMESPACE); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-recent-action.c�������������������������������������������0000644�0001750�0001750�00000004721�12102213527�021131� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRecentAction static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE name, options, label, tooltip, stock_id, buffer, manager; GtkAction *action = NULL; rb_scan_args(argc, argv, "11", &name, &options); rbg_scan_options(options, "label", &label, "tooltip", &tooltip, "stock_id", &stock_id, "manager", &manager, NULL); if (NIL_P(manager)) action = gtk_recent_action_new(RVAL2CSTR(name), RVAL2CSTR_ACCEPT_NIL(label), RVAL2CSTR_ACCEPT_NIL(tooltip), RVAL2GLIBID_ACCEPT_NIL(stock_id, buffer)); else action = gtk_recent_action_new_for_manager(RVAL2CSTR(name), RVAL2CSTR_ACCEPT_NIL(label), RVAL2CSTR_ACCEPT_NIL(tooltip), RVAL2GLIBID_ACCEPT_NIL(stock_id, buffer), RVAL2GTKRECENTMANAGER(manager)); G_INITIALIZE(self, action); return Qnil; } void Init_gtk_recentaction(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_ACTION, "RecentAction", mGtk); RG_DEF_METHOD(initialize, -1); } �����������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-message-dialog.c������������������������������������������0000644�0001750�0001750�00000005037�12102213527�021260� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cMessageDialog #define _SELF(s) (RVAL2GTKMESSAGEDIALOG(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, rb_parent, rb_flags, rb_type, rb_buttons_type, rb_message; GtkWindow *parent; GtkDialogFlags flags; GtkMessageType type; GtkButtonsType buttons_type; const gchar *message; GtkWidget *dialog; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "parent", &rb_parent, "flags", &rb_flags, "type", &rb_type, "buttons_type", &rb_buttons_type, "message", &rb_message, NULL); parent = NIL_P(rb_parent) ? NULL : RVAL2GTKWINDOW(rb_parent); flags = NIL_P(rb_flags) ? 0 : RVAL2GTKDIALOGFLAGS(rb_flags); type = NIL_P(rb_type) ? GTK_MESSAGE_INFO : RVAL2GTKMESSAGETYPE(rb_type); buttons_type = NIL_P(rb_buttons_type) ? GTK_BUTTONS_OK : RVAL2GTKBUTTONSTYPE(rb_buttons_type); message = NIL_P(rb_message) ? "" : RVAL2CSTR(rb_message); dialog = gtk_message_dialog_new(parent, flags, type, buttons_type, "%s", message); RBGTK_INITIALIZE(self, dialog); return Qnil; } static VALUE rg_set_markup(VALUE self, VALUE str) { gtk_message_dialog_set_markup(_SELF(self), RVAL2CSTR(str)); return self; } void Init_gtk_message_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MESSAGE_DIALOG, "MessageDialog", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_markup, 1); G_DEF_CLASS(GTK_TYPE_BUTTONS_TYPE, "ButtonsType", RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-icon-info.c�����������������������������������������������0000644�0001750�0001750�00000005644�12257552167�020305� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cIconInfo #define _SELF(i) (RVAL2GTKICONINFO(i)) static VALUE rg_base_size(VALUE self) { return INT2NUM(gtk_icon_info_get_base_size(_SELF(self))); } static VALUE rg_filename(VALUE self) { return CSTR2RVAL(gtk_icon_info_get_filename(_SELF(self))); } static VALUE rg_builtin_pixbuf(VALUE self) { return GOBJ2RVAL(gtk_icon_info_get_builtin_pixbuf(_SELF(self))); } static VALUE rg_load_icon(VALUE self) { GError* error = NULL; GdkPixbuf* pixbuf = gtk_icon_info_load_icon(_SELF(self), &error); VALUE ret; if (error) RAISE_GERROR(error); ret = GOBJ2RVAL(pixbuf); g_object_unref(pixbuf); return ret; } static VALUE rg_set_raw_coordinates(VALUE self, VALUE raw_coordinates) { gtk_icon_info_set_raw_coordinates(_SELF(self), RVAL2CBOOL(raw_coordinates)); return self; } static VALUE rg_embedded_rect(VALUE self) { GdkRectangle rectangle; gboolean ret = gtk_icon_info_get_embedded_rect(_SELF(self), &rectangle); if (ret) return GDKRECTANGLE2RVAL(&rectangle); else return Qnil; } static VALUE rg_attach_points(VALUE self) { GdkPoint* points; gint n_points, i; gboolean ret = gtk_icon_info_get_attach_points(_SELF(self), &points, &n_points); VALUE ary = Qnil; if (ret){ ary = rb_ary_new(); for (i = 0; i < n_points; i++){ rb_ary_push(ary, rb_assoc_new(INT2NUM(points[i].x), INT2NUM(points[i].y))); } g_free(points); } return ary; } static VALUE rg_display_name(VALUE self) { return CSTR2RVAL(gtk_icon_info_get_display_name(_SELF(self))); } void Init_gtk_icon_info(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_INFO, "IconInfo", mGtk); RG_DEF_METHOD(base_size, 0); RG_DEF_METHOD(filename, 0); RG_DEF_METHOD(builtin_pixbuf, 0); RG_DEF_METHOD(load_icon, 0); RG_DEF_METHOD(set_raw_coordinates, 1); RG_DEF_METHOD(embedded_rect, 0); RG_DEF_METHOD(attach_points, 0); RG_DEF_METHOD(display_name, 0); } ��������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-store.c����������������������������������������������0000644�0001750�0001750�00000022753�12102213527�020474� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2012 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTreeStore #define _SELF(s) (RVAL2GTKTREESTORE(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { gint cnt; GtkTreeStore* store; GType* buf; if (argc == 0) rb_raise(rb_eArgError, "need more than 1 class type."); buf = ALLOCA_N(GType, argc); for (cnt = 0; cnt < argc; cnt++) { buf[cnt] = CLASS2GTYPE(argv[cnt]); } store = gtk_tree_store_newv(argc, buf); G_INITIALIZE(self, store); return Qnil; } static VALUE rg_set_column_types(int argc, VALUE *argv, VALUE self) { gint cnt; GType* buf; if (argc == 0) rb_raise(rb_eArgError, "need more than 1 class type."); buf = ALLOCA_N(GType, argc); for (cnt = 0; cnt < argc; cnt++) { buf[cnt] = CLASS2GTYPE(argv[cnt]); } gtk_tree_store_set_column_types(_SELF(self), argc, buf); return self; } static VALUE rg_set_value(VALUE self, VALUE iter, VALUE column, VALUE value) { GType gtype = gtk_tree_model_get_column_type(RVAL2GTKTREEMODEL(self), NUM2INT(column)); GValue gval = G_VALUE_INIT; g_value_init(&gval, gtype); rbgobj_rvalue_to_gvalue(value, &gval); G_CHILD_ADD(self, iter); G_CHILD_ADD(iter, value); gtk_tree_store_set_value(_SELF(self), RVAL2GTKTREEITER(iter), NUM2INT(column), &gval); g_value_unset(&gval); return self; } static VALUE rg_remove(VALUE self, VALUE iter) { G_CHILD_REMOVE(self, iter); return CBOOL2RVAL(gtk_tree_store_remove(_SELF(self), RVAL2GTKTREEITER(iter))); } static VALUE rg_insert(int argc, VALUE *argv, VALUE self) { VALUE parent, position, values, ret; GtkTreeIter iter; GtkTreeStore* model = _SELF(self); rb_scan_args(argc, argv, "21", &parent, &position, &values); if (NIL_P(values)){ gtk_tree_store_insert(model, &iter, NIL_P(parent) ? NULL : RVAL2GTKTREEITER(parent), NUM2INT(position)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); } else { gint *c_columns; GValue *c_values; long size, i; size = NUM2INT(rb_funcall(values, rb_intern("size"), 0)); c_columns = ALLOCA_N(gint, size); c_values = ALLOCA_N(GValue, size); if(TYPE(values)==T_ARRAY) { for(i=0; i<size; i++) { GType gtype; GValue gval = G_VALUE_INIT; c_columns[i] = i; gtype = gtk_tree_model_get_column_type(RVAL2GTKTREEMODEL(self), c_columns[i]); g_value_init(&gval, gtype); rbgobj_rvalue_to_gvalue(rb_ary_shift(values), &gval); c_values[i] = gval; } } else if(TYPE(values)==T_HASH) { VALUE r_columns; r_columns = rb_funcall(values, rb_intern("keys"), 0); for(i=0; i<size; i++) { GType gtype; GValue gval = G_VALUE_INIT; c_columns[i] = NUM2INT (rb_ary_entry(r_columns, i)); gtype = gtk_tree_model_get_column_type(RVAL2GTKTREEMODEL(self), c_columns[i]); g_value_init(&gval, gtype); rbgobj_rvalue_to_gvalue(rb_hash_aref(values, INT2NUM(c_columns[i])), &gval); c_values[i] = gval; } } else { rb_raise(rb_eArgError, "values must be of type Hash or Array"); } gtk_tree_store_insert_with_valuesv(model, &iter, NIL_P(parent) ? NULL : RVAL2GTKTREEITER(parent), NUM2INT(position), c_columns, c_values, size); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); for(i=0; i<size; i++) { G_CHILD_ADD(ret, rbgobj_gvalue_to_rvalue(&(c_values[i]))); g_value_unset(&(c_values[i])); } } return ret; } static VALUE rg_insert_before(VALUE self, VALUE parent, VALUE sibling) { VALUE ret; GtkTreeIter iter; GtkTreeStore* model = _SELF(self); gtk_tree_store_insert_before(model, &iter, NIL_P(parent) ? NULL : RVAL2GTKTREEITER(parent), NIL_P(sibling) ? NULL : RVAL2GTKTREEITER(sibling)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_insert_after(VALUE self, VALUE parent, VALUE sibling) { VALUE ret; GtkTreeIter iter; GtkTreeStore* model = _SELF(self); gtk_tree_store_insert_after(model, &iter, NIL_P(parent) ? NULL : RVAL2GTKTREEITER(parent), NIL_P(sibling) ? NULL : RVAL2GTKTREEITER(sibling)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_prepend(VALUE self, VALUE parent) { VALUE ret; GtkTreeIter iter; GtkTreeStore* model = _SELF(self); gtk_tree_store_prepend(model, &iter, NIL_P(parent)?NULL:RVAL2GTKTREEITER(parent)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_append(VALUE self, VALUE parent) { VALUE ret; GtkTreeIter iter; GtkTreeStore* model = _SELF(self); gtk_tree_store_append(model, &iter, NIL_P(parent)?NULL:RVAL2GTKTREEITER(parent)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_ancestor_p(VALUE self, VALUE iter, VALUE descendant) { return gtk_tree_store_is_ancestor(_SELF(self), RVAL2GTKTREEITER(iter), RVAL2GTKTREEITER(descendant)); } static VALUE rg_iter_depth(VALUE self, VALUE iter) { return INT2NUM(gtk_tree_store_iter_depth(_SELF(self), RVAL2GTKTREEITER(iter))); } static VALUE rg_clear(VALUE self) { G_CHILD_REMOVE_ALL(self); gtk_tree_store_clear(_SELF(self)); return self; } static VALUE rg_iter_is_valid_p(VALUE self, VALUE iter) { return (NIL_P(iter)) ? Qfalse : CBOOL2RVAL(gtk_tree_store_iter_is_valid(_SELF(self), RVAL2GTKTREEITER(iter))); } static VALUE rg_reorder(VALUE self, VALUE rbparent, VALUE rbnew_order) { GtkTreeStore *store = _SELF(self); GtkTreeIter *parent = RVAL2GTKTREEITER(rbparent); gint n_children = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), parent); long n; gint *new_order = RVAL2GINTS(rbnew_order, n); if (n != n_children) { g_free(new_order); rb_raise(rb_eArgError, "new order array must contain the same number of elements as the number of children in the parent: %ld != %d", n, n_children); } gtk_tree_store_reorder(store, parent, new_order); g_free(new_order); return self; } static VALUE rg_swap(VALUE self, VALUE iter1, VALUE iter2) { gtk_tree_store_swap(_SELF(self), RVAL2GTKTREEITER(iter1), RVAL2GTKTREEITER(iter2)); return self; } static VALUE rg_move_before(VALUE self, VALUE iter, VALUE position) { gtk_tree_store_move_before(_SELF(self), RVAL2GTKTREEITER(iter), NIL_P(position) ? NULL : RVAL2GTKTREEITER(position)); return self; } static VALUE rg_move_after(VALUE self, VALUE iter, VALUE position) { gtk_tree_store_move_after(_SELF(self), RVAL2GTKTREEITER(iter), NIL_P(position) ? NULL : RVAL2GTKTREEITER(position)); return self; } void Init_gtk_tree_store(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_STORE, "TreeStore", mGtk); rbgtk_register_treeiter_set_value_func(GTK_TYPE_TREE_STORE, (rbgtkiter_set_value_func)>k_tree_store_set_value); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_column_types, -1); RG_DEF_METHOD(set_value, 3); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(insert, -1); RG_DEF_METHOD(insert_before, 2); RG_DEF_METHOD(insert_after, 2); RG_DEF_METHOD(prepend, 1); RG_DEF_METHOD(append, 1); RG_DEF_METHOD_P(ancestor, 2); RG_DEF_METHOD(iter_depth, 1); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD_P(iter_is_valid, 1); RG_DEF_METHOD(reorder, 2); RG_DEF_METHOD(swap, 2); RG_DEF_METHOD(move_before, 2); RG_DEF_METHOD(move_after, 2); } ���������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-renderer-toggle.c������������������������������������0000644�0001750�0001750�00000002504�12102213527�022375� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCellRendererToggle #define _SELF(s) (RVAL2GTKCELLRENDERERTOGGLE(s)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_toggle_new()); return Qnil; } void Init_gtk_cellrenderertoggle(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_TOGGLE, "CellRendererToggle", mGtk); RG_DEF_METHOD(initialize, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-iter.c�����������������������������������������������0000644�0001750�0001750�00000016365�12102213527�020305� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTreeIter #define _SELF(i) (RVAL2GTKTREEITER(i)) static VALUE treeiter_set_value_table = Qnil; void rbgtk_register_treeiter_set_value_func(GType gtype, rbgtkiter_set_value_func func) { if (NIL_P(treeiter_set_value_table)) { treeiter_set_value_table = rb_hash_new(); rb_global_variable(&treeiter_set_value_table); } rb_hash_aset(treeiter_set_value_table, INT2NUM(gtype), Data_Wrap_Struct(rb_cData, NULL, NULL, func)); } static VALUE rg_first_bang(VALUE self) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; VALUE ret = CBOOL2RVAL(gtk_tree_model_get_iter_first(model, iter)); iter->user_data3 = model; return ret; } static VALUE rg_next_bang(VALUE self) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; gboolean ret = gtk_tree_model_iter_next(model, iter); if (! ret){ gtk_tree_model_get_iter_first(model, iter); } iter->user_data3 = model; return CBOOL2RVAL(ret); } static VALUE rg_get_value(VALUE self, VALUE column) { GValue value = G_VALUE_INIT; GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; VALUE ret = Qnil; gtk_tree_model_get_value(model, iter, NUM2INT(column), &value); if (G_VALUE_TYPE(&value) != G_TYPE_INVALID){ ret = GVAL2RVAL(&value); g_value_unset(&value); } return ret; } static VALUE rg_first_child(VALUE self) { GtkTreeIter child; GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; gboolean ret = gtk_tree_model_iter_children(model, &child, iter); child.user_data3 = model; return ret ? GTKTREEITER2RVAL(&child) : Qnil; } static VALUE rg_path(VALUE self) { VALUE retval = Qnil; GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; GtkTreePath* path = gtk_tree_model_get_path(model, iter); retval= GTKTREEPATH2RVAL(path); gtk_tree_path_free(path); return retval; } static VALUE rg_has_child_p(VALUE self) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; return CBOOL2RVAL(gtk_tree_model_iter_has_child(model, iter)); } static VALUE rg_n_children(VALUE self) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; return INT2NUM(gtk_tree_model_iter_n_children(model, iter)); } static VALUE rg_nth_child(VALUE self, VALUE n) { GtkTreeIter child; GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; gboolean ret = gtk_tree_model_iter_nth_child(model, &child, iter, NUM2INT(n)); child.user_data3 = model; return ret ? GTKTREEITER2RVAL(&child) : Qnil; } static VALUE rg_parent(VALUE self) { GtkTreeIter parent; GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; gboolean ret = gtk_tree_model_iter_parent(model, &parent, iter); parent.user_data3 = model; return ret ? GTKTREEITER2RVAL(&parent) : Qnil; } static VALUE rg_set_value(VALUE self, VALUE column, VALUE value) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; VALUE obj = rb_hash_aref(treeiter_set_value_table, INT2NUM(G_TYPE_FROM_INSTANCE(model))); rbgtkiter_set_value_func func; GType gtype = gtk_tree_model_get_column_type(model, NUM2INT(column)); GValue gval = G_VALUE_INIT; if (NIL_P(obj)) rb_raise(rb_eTypeError, "Gtk::TreeModel is invalid."); Data_Get_Struct(obj, void, func); g_value_init(&gval, gtype); rbgobj_rvalue_to_gvalue(value, &gval); func(model, iter, NUM2INT(column), &gval); g_value_unset(&gval); return self; } static VALUE rg_operator_treeiter_set_value_eql(VALUE self, VALUE column, VALUE value) { rg_set_value(self, column, value); return value; } static VALUE rg_operator_treeiter_eql(VALUE self, VALUE other) { gint i, num1, num2; GtkTreeIter* iter1 = _SELF(self); GtkTreeIter* iter2; GtkTreeModel* model1; GtkTreeModel* model2; GtkTreePath* path1; GtkTreePath* path2; if (!rb_obj_is_kind_of(other, GTYPE2CLASS(GTK_TYPE_TREE_ITER))) return Qfalse; iter2 = _SELF(other); model1 = (GtkTreeModel*)iter1->user_data3; model2 = (GtkTreeModel*)iter2->user_data3; if (model1 != model2) return Qfalse; num1 = gtk_tree_model_get_n_columns(model1); num2 = gtk_tree_model_get_n_columns(model2); if (num1 != num2) return Qfalse; path1 = gtk_tree_model_get_path(model1, iter1); path2 = gtk_tree_model_get_path(model2, iter2); if (gtk_tree_path_compare(path1, path2) != 0) { gtk_tree_path_free(path1); gtk_tree_path_free(path2); return Qfalse; } else { gtk_tree_path_free(path1); gtk_tree_path_free(path2); } for (i = 0; i < num1; i++){ GValue gval1 = G_VALUE_INIT; GValue gval2 = G_VALUE_INIT; VALUE ret1, ret2; gtk_tree_model_get_value(model1, iter1, i, &gval1); gtk_tree_model_get_value(model2, iter2, i, &gval2); ret1 = GVAL2RVAL(&gval1); ret2 = GVAL2RVAL(&gval2); g_value_unset(&gval1); g_value_unset(&gval2); if (rb_equal(ret1, ret2) == Qfalse) return Qfalse; } return Qtrue; } static VALUE rg_to_str(VALUE self) { GtkTreeIter* iter = _SELF(self); GtkTreeModel* model = (GtkTreeModel*)iter->user_data3; gchar* s = gtk_tree_model_get_string_from_iter (model, iter); VALUE result = CSTR2RVAL(s); g_free(s); return result; } void Init_gtk_treeiter(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_ITER, "TreeIter", mGtk); RG_DEF_METHOD_BANG(first, 0); RG_DEF_METHOD_BANG(next, 0); RG_DEF_METHOD(get_value, 1); RG_DEF_ALIAS("[]", "get_value"); RG_DEF_METHOD(first_child, 0); RG_DEF_METHOD(path, 0); RG_DEF_METHOD_P(has_child, 0); RG_DEF_METHOD(n_children, 0); RG_DEF_METHOD(nth_child, 1); RG_DEF_METHOD(parent, 0); RG_DEF_METHOD(set_value, 2); RG_DEF_METHOD_OPERATOR("[]=", treeiter_set_value_eql, 2); RG_DEF_METHOD_OPERATOR("==", treeiter_eql, 1); RG_DEF_METHOD(to_str, 0); RG_DEF_ALIAS("to_s", "to_str"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-entry-completion.c����������������������������������������0000644�0001750�0001750�00000006720�12102213527�021707� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cEntryCompletion #define _SELF(self) (RVAL2GTKENTRYCOMPLETION(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_entry_completion_new()); return Qnil; } static VALUE rg_entry(VALUE self) { return GOBJ2RVAL(gtk_entry_completion_get_entry(_SELF(self))); } static gboolean entryc_match_func(GtkEntryCompletion *completion, const gchar *key, GtkTreeIter *iter, gpointer func) { iter->user_data3 = gtk_entry_completion_get_model(completion); return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 3, GOBJ2RVAL(completion), CSTR2RVAL(key), GTKTREEITER2RVAL(iter))); } static VALUE rg_set_match_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_entry_completion_set_match_func(_SELF(self), (GtkEntryCompletionMatchFunc)entryc_match_func, (gpointer)func, NULL); return self; } static VALUE rg_complete(VALUE self) { gtk_entry_completion_complete(_SELF(self)); return self; } static VALUE rg_insert_prefix(VALUE self) { gtk_entry_completion_insert_prefix(_SELF(self)); return self; } static VALUE rg_insert_action_text(VALUE self, VALUE index, VALUE text) { gtk_entry_completion_insert_action_text(_SELF(self), NUM2INT(index), RVAL2CSTR(text)); return self; } static VALUE rg_insert_action_markup(VALUE self, VALUE index, VALUE markup) { gtk_entry_completion_insert_action_markup(_SELF(self), NUM2INT(index), RVAL2CSTR(markup)); return self; } static VALUE rg_delete_action(VALUE self, VALUE index) { gtk_entry_completion_delete_action(_SELF(self), NUM2INT(index)); return self; } static VALUE entryc_set_text_column(VALUE self, VALUE column) { gtk_entry_completion_set_text_column(_SELF(self), NUM2INT(column)); return self; } static VALUE rg_completion_prefix(VALUE self) { return CSTR2RVAL(gtk_entry_completion_get_completion_prefix(_SELF(self))); } void Init_gtk_entry_completion(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ENTRY_COMPLETION, "EntryCompletion", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(entry, 0); RG_DEF_METHOD(set_match_func, 0); RG_DEF_METHOD(complete, 0); RG_DEF_METHOD(insert_prefix, 0); RG_DEF_METHOD(insert_action_text, 2); RG_DEF_METHOD(insert_action_markup, 2); RG_DEF_METHOD(delete_action, 1); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "text_column", entryc_set_text_column, 1); RG_DEF_METHOD(completion_prefix, 0); } ������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-activatable.c���������������������������������������������0000644�0001750�0001750�00000002146�12102213527�020654� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mActivatable #define _SELF(self) (RVAL2GTKACTIVATABLE(self)) void Init_gtk_activatable(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_ACTIVATABLE, "Activatable", mGtk); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-bin.c�����������������������������������������������������0000644�0001750�0001750�00000002562�12102213527�017147� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cBin #define _SELF(self) (RVAL2GTKBIN(self)) static VALUE rg_child(VALUE self) { return GOBJ2RVAL(gtk_bin_get_child(_SELF(self))); } void Init_gtk_bin(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BIN, "Bin", mGtk); RG_DEF_METHOD(child, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-combo-box-text.c������������������������������������������0000644�0001750�0001750�00000006645�12102213527�021254� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cComboBoxText #define _SELF(self) (RVAL2GTKCOMBOBOXTEXT(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, entry; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "entry", &entry, NULL); if (RVAL2CBOOL(entry)) widget = gtk_combo_box_text_new_with_entry(); else widget = gtk_combo_box_text_new(); RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_append(VALUE self, VALUE id, VALUE text) { gtk_combo_box_text_append(_SELF(self), RVAL2CSTR_ACCEPT_NIL(id), RVAL2CSTR(text)); return self; } static VALUE rg_append_text(VALUE self, VALUE text) { gtk_combo_box_text_append_text(_SELF(self), RVAL2CSTR(text)); return self; } static VALUE rg_active_text(VALUE self) { return CSTR2RVAL_FREE(gtk_combo_box_text_get_active_text(_SELF(self))); } static VALUE rg_insert(VALUE self, VALUE position, VALUE id, VALUE text) { gtk_combo_box_text_insert(_SELF(self), NUM2INT(position), RVAL2CSTR_ACCEPT_NIL(id), RVAL2CSTR(text)); return self; } static VALUE rg_insert_text(VALUE self, VALUE position, VALUE text) { gtk_combo_box_text_insert_text(_SELF(self), NUM2INT(position), RVAL2CSTR(text)); return self; } static VALUE rg_prepend(VALUE self, VALUE id, VALUE text) { gtk_combo_box_text_prepend(_SELF(self), RVAL2CSTR_ACCEPT_NIL(id), RVAL2CSTR(text)); return self; } static VALUE rg_prepend_text(VALUE self, VALUE text) { gtk_combo_box_text_prepend_text(_SELF(self), RVAL2CSTR(text)); return self; } static VALUE rg_remove(VALUE self, VALUE position) { gtk_combo_box_text_remove(_SELF(self), NUM2INT(position)); return self; } static VALUE rg_remove_all(VALUE self) { gtk_combo_box_text_remove_all(_SELF(self)); return self; } void Init_gtk_comboboxtext(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_COMBO_BOX_TEXT, "ComboBoxText", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(append, 2); RG_DEF_METHOD(append_text, 1); RG_DEF_METHOD(active_text, 0); RG_DEF_METHOD(insert, 3); RG_DEF_METHOD(insert_text, 2); RG_DEF_METHOD(prepend, 2); RG_DEF_METHOD(prepend_text, 1); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(remove_all, 0); } �������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-window.c��������������������������������������������������0000644�0001750�0001750�00000033644�12102213527�017713� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2002-2011 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cWindow #define _SELF(s) (RVAL2GTKWINDOW(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg; GtkWindowType tp = GTK_WINDOW_TOPLEVEL; const gchar *title = NULL; GtkWidget* window = NULL; if (rb_scan_args(argc, argv, "01", &arg) == 1) { if (TYPE(arg) == T_STRING) { StringValue(arg); title = RVAL2CSTR(arg); } else { tp = RVAL2GTKWINDOWTYPE(arg); } } window = gtk_window_new(tp); if (title != NULL) gtk_window_set_title(GTK_WINDOW(window), title); RBGTK_INITIALIZE(self, window); return Qnil; } static VALUE rg_set_wmclass(VALUE self, VALUE wmclass_name, VALUE wmclass_class) { gtk_window_set_wmclass(_SELF(self), RVAL2CSTR_ACCEPT_NIL(wmclass_name), RVAL2CSTR_ACCEPT_NIL(wmclass_class)); return self; } static VALUE rg_add_accel_group(VALUE self, VALUE accel) { gtk_window_add_accel_group(_SELF(self), RVAL2GTKACCELGROUP(accel)); G_CHILD_ADD(self, accel); return self; } static VALUE rg_remove_accel_group(VALUE self, VALUE accel) { gtk_window_remove_accel_group(_SELF(self), RVAL2GTKACCELGROUP(accel)); G_CHILD_REMOVE(self, accel); return self; } static VALUE gwin_activate_focus(VALUE self) { return CBOOL2RVAL(gtk_window_activate_focus(_SELF(self))); } static VALUE gwin_activate_default(VALUE self) { return CBOOL2RVAL(gtk_window_activate_default(_SELF(self))); } static VALUE rg_set_default_size(VALUE self, VALUE w, VALUE h) { gtk_window_set_default_size(_SELF(self), NUM2INT(w), NUM2INT(h)); return self; } static VALUE rg_set_geometry_hints(VALUE self, VALUE geometry_widget, VALUE geometry, VALUE geom_mask) { gtk_window_set_geometry_hints(_SELF(self), RVAL2GTKWIDGET(geometry_widget), RVAL2GDKGEOMETRY(geometry), RVAL2GDKWINDOWHINTS(geom_mask)); return self; } static VALUE rg_s_toplevels(G_GNUC_UNUSED VALUE self) { GList* list = gtk_window_list_toplevels(); VALUE ret = GOBJGLIST2RVAL(list); g_list_foreach(list, (GFunc)g_object_ref, NULL); g_list_free(list); return ret; } static VALUE rg_add_mnemonic(VALUE self, VALUE keyval, VALUE target) { gtk_window_add_mnemonic(_SELF(self), NUM2INT(keyval), RVAL2GTKWIDGET(target)); return self; } static VALUE rg_remove_mnemonic(VALUE self, VALUE keyval, VALUE target) { gtk_window_remove_mnemonic(_SELF(self), NUM2INT(keyval), RVAL2GTKWIDGET(target)); return self; } static VALUE rg_mnemonic_activate(VALUE self, VALUE keyval, VALUE modifier) { return CBOOL2RVAL(gtk_window_mnemonic_activate(_SELF(self), NUM2INT(keyval), RVAL2GDKMODIFIERTYPE(modifier))); } static VALUE rg_focus(VALUE self) { return GOBJ2RVAL(gtk_window_get_focus(_SELF(self))); } static VALUE rg_set_focus(VALUE self, VALUE win) { gtk_window_set_focus(_SELF(self), NIL_P(win) ? NULL : RVAL2GTKWIDGET(win)); return self; } static VALUE rg_set_default(VALUE self, VALUE win) { gtk_window_set_default(_SELF(self), NIL_P(win) ? NULL : RVAL2GTKWIDGET(win)); return self; } static VALUE rg_present(int argc, VALUE *argv, VALUE self) { VALUE timestamp; if (rb_scan_args(argc, argv, "01", ×tamp) == 1) { gtk_window_present_with_time(_SELF(self), NUM2UINT(timestamp)); } else { gtk_window_present(_SELF(self)); } return self; } static VALUE rg_iconify(VALUE self) { gtk_window_iconify(_SELF(self)); return self; } static VALUE rg_deiconify(VALUE self) { gtk_window_deiconify(_SELF(self)); return self; } static VALUE rg_stick(VALUE self) { gtk_window_stick(_SELF(self)); return self; } static VALUE rg_unstick(VALUE self) { gtk_window_unstick(_SELF(self)); return self; } static VALUE rg_maximize(VALUE self) { gtk_window_maximize(_SELF(self)); return self; } static VALUE rg_unmaximize(VALUE self) { gtk_window_unmaximize(_SELF(self)); return self; } static VALUE rg_fullscreen(VALUE self) { gtk_window_fullscreen(_SELF(self)); return self; } static VALUE rg_unfullscreen(VALUE self) { gtk_window_unfullscreen(_SELF(self)); return self; } static VALUE rg_set_keep_above(VALUE self, VALUE setting) { gtk_window_set_keep_above(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_set_keep_below(VALUE self, VALUE setting) { gtk_window_set_keep_below(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_begin_resize_drag(VALUE self, VALUE edge, VALUE button, VALUE root_x, VALUE root_y, VALUE timestamp) { gtk_window_begin_resize_drag(_SELF(self), RVAL2GDKWINDOWEDGE(edge), NUM2INT(button), NUM2INT(root_x), NUM2INT(root_y), NUM2UINT(timestamp)); return self; } static VALUE rg_begin_move_drag(VALUE self, VALUE button, VALUE root_x, VALUE root_y, VALUE timestamp) { gtk_window_begin_move_drag(_SELF(self), NUM2INT(button), NUM2INT(root_x), NUM2INT(root_y), NUM2UINT(timestamp)); return self; } static VALUE rg_set_mnemonic_modifier(VALUE self, VALUE modifier) { gtk_window_set_mnemonic_modifier(_SELF(self), RVAL2GDKMODIFIERTYPE(modifier)); return self; } static VALUE rg_s_default_icon_list(G_GNUC_UNUSED VALUE self) { return GOBJGLIST2RVAL_FREE(gtk_window_get_default_icon_list(), g_list_free, NULL); } static VALUE rg_default_size(VALUE self) { int width, height; gtk_window_get_default_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_icon_list(VALUE self) { return GOBJGLIST2RVAL_FREE(gtk_window_get_icon_list(_SELF(self)), g_list_free, NULL); } static VALUE rg_mnemonic_modifier(VALUE self) { return GDKMODIFIERTYPE2RVAL(gtk_window_get_mnemonic_modifier(_SELF(self))); } static VALUE rg_position(VALUE self) { int root_x, root_y; gtk_window_get_position(_SELF(self), &root_x, &root_y); return rb_ary_new3(2, INT2NUM(root_x), INT2NUM(root_y)); } static VALUE rg_size(VALUE self) { int width, height; gtk_window_get_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_group(VALUE self) { return GOBJ2RVAL(gtk_window_get_group(_SELF(self))); } static VALUE rg_move(VALUE self, VALUE x, VALUE y) { gtk_window_move(_SELF(self), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_parse_geometry(VALUE self, VALUE geometry) { return CBOOL2RVAL(gtk_window_parse_geometry(_SELF(self), RVAL2CSTR(geometry))); } static VALUE rg_reshow_with_initial_size(VALUE self) { gtk_window_reshow_with_initial_size(_SELF(self)); return self; } static VALUE rg_resize(VALUE self, VALUE width, VALUE height) { gtk_window_resize(_SELF(self), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_s_set_default_icon_list(G_GNUC_UNUSED VALUE self, VALUE rblist) { GList *list = RVAL2GDKPIXBUFGLIST(rblist); gtk_window_set_default_icon_list(list); g_list_free(list); return rblist; } static VALUE rg_s_set_default_icon(VALUE self, VALUE icon_or_filename) { if (TYPE(icon_or_filename) == T_STRING){ GError* err; gboolean ret = gtk_window_set_default_icon_from_file(RVAL2CSTR(icon_or_filename), &err); if (! ret) RAISE_GERROR(err); } else { gtk_window_set_default_icon(RVAL2GDKPIXBUF(icon_or_filename)); } return self; } static VALUE rg_s_set_default_icon_name(VALUE self, VALUE name) { gtk_window_set_default_icon_name(RVAL2CSTR(name)); return self; } static VALUE gwin_set_icon(VALUE self, VALUE icon_or_filename) { if (TYPE(icon_or_filename) == T_STRING){ GError* err; gboolean ret = gtk_window_set_icon_from_file(_SELF(self), RVAL2CSTR(icon_or_filename), &err); if (! ret) RAISE_GERROR(err); } else { gtk_window_set_icon(_SELF(self), RVAL2GDKPIXBUF(icon_or_filename)); } return self; } static VALUE rg_set_icon_list(VALUE self, VALUE rblist) { GtkWindow *window = _SELF(self); GList *list = RVAL2GDKPIXBUFGLIST(rblist); gtk_window_set_icon_list(window, list); g_list_free(list); /* TODO: Shouldn't we return self? */ return rblist; } static VALUE rg_s_set_auto_startup_notification(VALUE self, VALUE setting) { gtk_window_set_auto_startup_notification(RVAL2CBOOL(setting)); return self; } static void mark_toplevels(G_GNUC_UNUSED void *_) { GList* list = gtk_window_list_toplevels(); GList* p; for (p = list; p; p = g_list_next(p)) rbgobj_gc_mark_instance(p->data); g_list_free(list); } static VALUE rg_s_default_icon_name(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gtk_window_get_default_icon_name()); } static VALUE rg_activate_key(VALUE self, VALUE event) { return CBOOL2RVAL(gtk_window_activate_key(_SELF(self), RVAL2GDKEVENTKEY(event))); } static VALUE rg_default_widget(VALUE self) { return GOBJ2RVAL(gtk_window_get_default_widget(_SELF(self))); } static VALUE rg_resize_grip_area(VALUE self) { GdkRectangle rect; gboolean result; result = gtk_window_get_resize_grip_area(_SELF(self), &rect); return result ? GDKRECTANGLE2RVAL(&rect) : Qnil; } static VALUE rg_has_group_p(VALUE self) { return CBOOL2RVAL(gtk_window_has_group(_SELF(self))); } static VALUE rg_propagate_key_event(VALUE self, VALUE event) { return CBOOL2RVAL(gtk_window_propagate_key_event(_SELF(self), RVAL2GDKEVENTKEY(event))); } static VALUE rg_resize_to_geometry(VALUE self, VALUE width, VALUE height) { gtk_window_resize_to_geometry(_SELF(self), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_set_default_geometry(VALUE self, VALUE width, VALUE height) { gtk_window_set_default_geometry(_SELF(self), NUM2INT(width), NUM2INT(height)); return self; } void Init_gtk_window(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_WINDOW, "Window", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_wmclass, 2); RG_DEF_METHOD(add_accel_group, 1); RG_DEF_METHOD(remove_accel_group, 1); G_REPLACE_ACTION(RG_TARGET_NAMESPACE, "activate_focus", gwin_activate_focus, 0); G_REPLACE_ACTION(RG_TARGET_NAMESPACE, "activate_default", gwin_activate_default, 0); RG_DEF_METHOD(set_default_size, 2); RG_DEF_METHOD(set_geometry_hints, 3); RG_DEF_SMETHOD(toplevels, 0); RG_DEF_METHOD(add_mnemonic, 2); RG_DEF_METHOD(remove_mnemonic, 2); RG_DEF_METHOD(mnemonic_activate, 2); RG_DEF_METHOD(focus, 0); RG_DEF_METHOD(set_focus, 1); RG_DEF_METHOD(set_default, 1); RG_DEF_METHOD(present, -1); RG_DEF_METHOD(iconify, 0); RG_DEF_METHOD(deiconify, 0); RG_DEF_METHOD(stick, 0); RG_DEF_METHOD(unstick, 0); RG_DEF_METHOD(maximize, 0); RG_DEF_METHOD(unmaximize, 0); RG_DEF_METHOD(fullscreen, 0); RG_DEF_METHOD(unfullscreen, 0); RG_DEF_METHOD(set_keep_above, 1); RG_DEF_METHOD(set_keep_below, 1); RG_DEF_METHOD(begin_resize_drag, 5); RG_DEF_METHOD(begin_move_drag, 4); RG_DEF_METHOD(set_mnemonic_modifier, 1); RG_DEF_METHOD(default_size, 0); RG_DEF_SMETHOD(default_icon_list, 0); RG_DEF_METHOD(icon_list, 0); RG_DEF_METHOD(mnemonic_modifier, 0); RG_DEF_METHOD(position, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(group, 0); RG_DEF_METHOD(move, 2); RG_DEF_METHOD(parse_geometry, 1); RG_DEF_METHOD(reshow_with_initial_size, 0); RG_DEF_METHOD(resize, 2); RG_DEF_SMETHOD(set_default_icon_list, 1); RG_DEF_SMETHOD(set_default_icon, 1); RG_DEF_SMETHOD(set_default_icon_name, 1); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "icon", gwin_set_icon, 1); RG_DEF_METHOD(set_icon_list, 1); RG_DEF_SMETHOD(set_auto_startup_notification, 1); RG_DEF_SMETHOD(default_icon_name, 0); RG_DEF_METHOD(activate_key, 1); RG_DEF_METHOD(default_widget, 0); RG_DEF_METHOD(resize_grip_area, 0); RG_DEF_METHOD_P(has_group, 0); RG_DEF_METHOD(propagate_key_event, 1); RG_DEF_METHOD(resize_to_geometry, 2); RG_DEF_METHOD(set_default_geometry, 2); G_DEF_CLASS(GTK_TYPE_WINDOW_POSITION, "Position", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_WINDOW_TYPE, "Type", RG_TARGET_NAMESPACE); { static VALUE toplevels_marker; toplevels_marker = rb_data_object_alloc(rb_cData, NULL, mark_toplevels, NULL); rb_global_variable(&toplevels_marker); } } ��������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-radio-tool-button.c���������������������������������������0000644�0001750�0001750�00000007743�12102213527�021767� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRadioToolButton #define _SELF(self) (RVAL2GTKRADIOTOOLBUTTON(self)) static VALUE RG_TARGET_NAMESPACE; struct rbgtk_rval2gtkradiotoolbuttongslist_args { VALUE ary; long n; GSList *result; }; static VALUE rbgtk_rval2gtkradiotoolbuttongslist_body(VALUE value) { long i; struct rbgtk_rval2gtkradiotoolbuttongslist_args *args = (struct rbgtk_rval2gtkradiotoolbuttongslist_args *)value; for (i = 0; i < args->n; i++) args->result = g_slist_append(args->result, RVAL2GTKRADIOMENUITEM(RARRAY_PTR(args->ary)[i])); return Qnil; } static G_GNUC_NORETURN VALUE rbgtk_rval2gtkradiotoolbuttongslist_rescue(VALUE value) { g_slist_free(((struct rbgtk_rval2gtkradiotoolbuttongslist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GSList * rbgtk_rval2gtkradiotoolbuttongslist(VALUE value) { struct rbgtk_rval2gtkradiotoolbuttongslist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgtk_rval2gtkradiotoolbuttongslist_body, (VALUE)&args, rbgtk_rval2gtkradiotoolbuttongslist_rescue, (VALUE)&args); return args.result; } #define RVAL2GTKRADIOTOOLBUTTONGSLIST(value) rbgtk_rval2gtkradiotoolbuttongslist(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE group_or_stock_id, rbstock_id; GtkToolItem *widget; if (rb_scan_args(argc, argv, "02", &group_or_stock_id, &rbstock_id) > 0) { GSList *group = NULL; const gchar *stock_id = TYPE(rbstock_id) == T_SYMBOL ? rb_id2name(SYM2ID(rbstock_id)) : RVAL2CSTR_ACCEPT_NIL(rbstock_id); if (TYPE(group_or_stock_id) == T_ARRAY) /* TODO: This has a potential for leaking. */ group = RVAL2GTKRADIOTOOLBUTTONGSLIST(group_or_stock_id); else if (rb_obj_is_kind_of(group_or_stock_id, RG_TARGET_NAMESPACE)) group = gtk_radio_tool_button_get_group(_SELF(group_or_stock_id)); if (stock_id == NULL) widget = gtk_radio_tool_button_new(group); else widget = gtk_radio_tool_button_new_from_stock(group, stock_id); } else { widget = gtk_radio_tool_button_new(NULL); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rbtn_get_group(VALUE self) { return GOBJGSLIST2RVAL(gtk_radio_tool_button_get_group(_SELF(self))); } static VALUE rbtn_set_group(VALUE self, VALUE rbgroup) { GtkRadioToolButton *button = _SELF(self); GSList *group = TYPE(rbgroup) == T_ARRAY ? /* TODO: This might leak. */ RVAL2GTKRADIOTOOLBUTTONGSLIST(rbgroup) : gtk_radio_tool_button_get_group(_SELF(rbgroup)); gtk_radio_tool_button_set_group(button, group); return self; } void Init_gtk_radiotoolbutton(VALUE mGtk) { RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RADIO_TOOL_BUTTON, "RadioToolButton", mGtk); RG_DEF_METHOD(initialize, -1); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "group", rbtn_get_group, 0); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "group", rbtn_set_group, 1); } �����������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-list-store.c����������������������������������������������0000644�0001750�0001750�00000024132�12102213527�020501� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cListStore #define _SELF(s) (RVAL2GTKLISTSTORE(s)) static ID id_to_a, id_size; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { gint cnt; GtkListStore* store; GType* buf; if (argc == 0) rb_raise(rb_eArgError, "need more than 1 class type."); buf = ALLOCA_N(GType, argc); for (cnt = 0; cnt < argc; cnt++) { buf[cnt] = CLASS2GTYPE(argv[cnt]); } store = gtk_list_store_newv(argc, buf); G_INITIALIZE(self, store); return Qnil; } static VALUE rg_set_column_types(int argc, VALUE *argv, VALUE self) { gint cnt; GType* buf; if (argc == 0) rb_raise(rb_eArgError, "need more than 1 class type."); buf = ALLOCA_N(GType, argc); for (cnt = 0; cnt < argc; cnt++) { buf[cnt] = CLASS2GTYPE(argv[cnt]); } gtk_list_store_set_column_types(_SELF(self), argc, buf); return self; } static VALUE rg_set_value(VALUE self, VALUE iter, VALUE column, VALUE value) { GType gtype = gtk_tree_model_get_column_type(RVAL2GTKTREEMODEL(self), NUM2INT(column)); GValue gval = G_VALUE_INIT; g_value_init(&gval, gtype); rbgobj_rvalue_to_gvalue(value, &gval); G_CHILD_ADD(iter, value); gtk_list_store_set_value(_SELF(self), RVAL2GTKTREEITER(iter), NUM2INT(column), &gval); g_value_unset(&gval); return self; } typedef struct _ValuesInfo { gint i; VALUE iter; GtkTreeModel *model; gint *g_columns; GValue *g_values; } ValuesInfo; static int collect_value(VALUE key, VALUE value, ValuesInfo *info) { GType g_type; gint column; column = NUM2INT(key); info->g_columns[info->i] = column; g_type = gtk_tree_model_get_column_type(info->model, column); g_value_init(&(info->g_values[info->i]), g_type); rbgobj_rvalue_to_gvalue(value, &(info->g_values[info->i])); G_CHILD_ADD(info->iter, value); info->i++; return ST_CONTINUE; } static void hash_to_values(VALUE hash, VALUE iter, GtkTreeModel *model, gint *g_columns, GValue *g_values, G_GNUC_UNUSED gint length) { ValuesInfo info; info.i = 0; info.iter = iter; info.model = model; info.g_columns = g_columns; info.g_values = g_values; rb_hash_foreach(hash, collect_value, (VALUE)(&info)); } static void array_to_values(VALUE array, VALUE iter, GtkTreeModel *model, gint *g_columns, GValue *g_values, gint length) { gint i; for (i = 0; i < length; i++) { GType g_type; g_columns[i] = i; g_type = gtk_tree_model_get_column_type(model, i); g_value_init(&g_values[i], g_type); rbgobj_rvalue_to_gvalue(RARRAY_PTR(array)[i], &g_values[i]); G_CHILD_ADD(iter, RARRAY_PTR(array)[i]); } } static VALUE rg_set_values(VALUE self, VALUE iter, VALUE values) { GValue *g_values; GtkListStore *store; GtkTreeModel *model; gint *g_columns; gint i, length; length = NUM2INT(rb_funcall(values, id_size, 0)); if (length == 0) return self; g_columns = ALLOCA_N(gint, length); g_values = ALLOCA_N(GValue, length); MEMZERO(g_values, GValue, length); store = _SELF(self); model = GTK_TREE_MODEL(store); if (RVAL2CBOOL(rb_obj_is_kind_of(values, rb_cHash))) { hash_to_values(values, iter, model, g_columns, g_values, length); } else if (RVAL2CBOOL(rb_obj_is_kind_of(values, rb_cArray))) { array_to_values(values, iter, model, g_columns, g_values, length); } else { rb_raise(rb_eArgError, "must be array or hash of values"); } gtk_list_store_set_valuesv(store, RVAL2GTKTREEITER(iter), g_columns, g_values, length); for (i = 0; i < length; i++) g_value_unset(&g_values[i]); return self; } static VALUE rg_remove(VALUE self, VALUE iter) { G_CHILD_REMOVE(self, iter); return CBOOL2RVAL(gtk_list_store_remove(_SELF(self), RVAL2GTKTREEITER(iter))); } struct lstore_insert_args { GtkListStore *store; GtkTreeIter iter; gint position; VALUE ary; long i; long n; gint *columns; GValue *values; }; static VALUE lstore_insert_body(VALUE value) { struct lstore_insert_args *args = (struct lstore_insert_args *)value; GtkTreeModel *model = GTK_TREE_MODEL(args->store); for (args->i = 0; args->i < args->n; args->i++) { VALUE ary = rb_ary_to_ary(RARRAY_PTR(args->ary)[args->i]); args->columns[args->i] = NUM2INT(RARRAY_PTR(ary)[1]); g_value_init(&args->values[args->i], gtk_tree_model_get_column_type(model, args->columns[args->i])); rbgobj_rvalue_to_gvalue(RARRAY_PTR(ary)[0], &args->values[args->i]); } gtk_list_store_insert_with_valuesv(args->store, &args->iter, args->position, args->columns, args->values, args->n); return Qnil; } static VALUE lstore_insert_ensure(VALUE value) { long i; struct lstore_insert_args *args = (struct lstore_insert_args *)value; for (i = 0; i < args->i; i++) g_value_unset(&args->values[i]); g_free(args->values); g_free(args->columns); return Qnil; } /* Gtk::ListStore#insert(pos, val1 => 0, val2 => 2, ... ) */ static VALUE rg_insert(int argc, VALUE *argv, VALUE self) { VALUE position, values, result; struct lstore_insert_args args; args.store = _SELF(self); rb_scan_args(argc, argv, "11", &position, &values); args.position = NUM2INT(position); if (NIL_P(values)){ gtk_list_store_insert(args.store, &args.iter, args.position); } else { args.ary = rb_funcall(values, id_to_a, 0); args.n = RARRAY_LEN(args.ary); args.columns = g_new(gint, args.n); args.values = g_new0(GValue, args.n); rb_ensure(lstore_insert_body, (VALUE)&args, lstore_insert_ensure, (VALUE)&args); } args.iter.user_data3 = args.store; result = GTKTREEITER2RVAL(&args.iter); return result; } static VALUE rg_insert_before(VALUE self, VALUE sibling) { VALUE ret; GtkTreeIter iter; GtkListStore* model = _SELF(self); gtk_list_store_insert_before(model, &iter, NIL_P(sibling) ? NULL : RVAL2GTKTREEITER(sibling)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); return ret; } static VALUE rg_insert_after(VALUE self, VALUE sibling) { VALUE ret; GtkTreeIter iter; GtkListStore* model = _SELF(self); gtk_list_store_insert_after(model, &iter, NIL_P(sibling) ? NULL : RVAL2GTKTREEITER(sibling)); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); return ret; } static VALUE rg_prepend(VALUE self) { VALUE ret; GtkTreeIter iter; GtkListStore* model = _SELF(self); gtk_list_store_prepend(model, &iter); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); return ret; } static VALUE rg_append(VALUE self) { VALUE ret; GtkTreeIter iter; GtkListStore* model = _SELF(self); gtk_list_store_append(model, &iter); iter.user_data3 = model; ret = GTKTREEITER2RVAL(&iter); return ret; } static VALUE rg_clear(VALUE self) { G_CHILD_REMOVE_ALL(self); gtk_list_store_clear(_SELF(self)); return self; } static VALUE rg_iter_is_valid_p(VALUE self, VALUE iter) { return (NIL_P(iter)) ? Qfalse : CBOOL2RVAL(gtk_list_store_iter_is_valid(_SELF(self), RVAL2GTKTREEITER(iter))); } static VALUE rg_reorder(VALUE self, VALUE rbnew_order) { GtkListStore *store = _SELF(self); long n; gint *new_order = RVAL2GINTS(rbnew_order, n); gtk_list_store_reorder(store, new_order); g_free(new_order); return self; } static VALUE rg_swap(VALUE self, VALUE iter1, VALUE iter2) { gtk_list_store_swap(_SELF(self), RVAL2GTKTREEITER(iter1), RVAL2GTKTREEITER(iter2)); return self; } static VALUE rg_move_before(VALUE self, VALUE iter, VALUE position) { gtk_list_store_move_before(_SELF(self), RVAL2GTKTREEITER(iter), NIL_P(position) ? NULL : RVAL2GTKTREEITER(position)); return self; } static VALUE rg_move_after(VALUE self, VALUE iter, VALUE position) { gtk_list_store_move_after(_SELF(self), RVAL2GTKTREEITER(iter), NIL_P(position) ? NULL : RVAL2GTKTREEITER(position)); return self; } void Init_gtk_list_store(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_LIST_STORE, "ListStore", mGtk); id_to_a = rb_intern("to_a"); id_size = rb_intern("size"); rbgtk_register_treeiter_set_value_func(GTK_TYPE_LIST_STORE, (rbgtkiter_set_value_func)>k_list_store_set_value); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_column_types, -1); RG_DEF_METHOD(set_value, 3); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(insert, -1); RG_DEF_METHOD(insert_before, 1); RG_DEF_METHOD(insert_after, 1); RG_DEF_METHOD(prepend, 0); RG_DEF_METHOD(append, 0); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD_P(iter_is_valid, 1); RG_DEF_METHOD(reorder, 1); RG_DEF_METHOD(swap, 2); RG_DEF_METHOD(move_before, 2); RG_DEF_METHOD(move_after, 2); RG_DEF_METHOD(set_values, 2); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-imcon-text.c����������������������������������������������0000644�0001750�0001750�00000007227�12102213527�020471� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cIMContext #define _SELF(self) (RVAL2GTKIMCONTEXT(self)) static VALUE rg_set_client_window(VALUE self, VALUE gdkwindow) { gtk_im_context_set_client_window(_SELF(self), RVAL2GDKWINDOW(gdkwindow)); return self; } static VALUE rg_preedit_string(VALUE self) { gchar* str; PangoAttrList* attrs; gint cursor_pos; gtk_im_context_get_preedit_string(_SELF(self), &str, &attrs, &cursor_pos); return rb_ary_new3(3, CSTR2RVAL(str), PANGOATTRLIST2RVAL(attrs), INT2NUM(cursor_pos)); } static VALUE rg_filter_keypress(VALUE self, VALUE event) { return CBOOL2RVAL(gtk_im_context_filter_keypress(_SELF(self), (GdkEventKey*)RVAL2GEV(event))); } static VALUE rg_focus_in(VALUE self) { gtk_im_context_focus_in(_SELF(self)); return self; } static VALUE rg_focus_out(VALUE self) { gtk_im_context_focus_out(_SELF(self)); return self; } static VALUE rg_reset(VALUE self) { gtk_im_context_reset(_SELF(self)); return self; } static VALUE rg_set_cursor_location(VALUE self, VALUE area) { gtk_im_context_set_cursor_location( _SELF(self), RVAL2GDKRECTANGLE(area)); return self; } static VALUE rg_set_use_preedit(VALUE self, VALUE use_preedit) { gtk_im_context_set_use_preedit(_SELF(self), RVAL2CBOOL(use_preedit)); return self; } static VALUE rg_set_surrounding(VALUE self, VALUE text, VALUE cursor_index) { StringValue(text); gtk_im_context_set_surrounding(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text), NUM2INT(cursor_index)); return self; } static VALUE rg_surrounding(VALUE self) { gchar* text; gint cursor_index; gboolean result = gtk_im_context_get_surrounding(_SELF(self), &text, &cursor_index); return result ? rb_ary_new3(2, CSTR2RVAL(text), INT2NUM(cursor_index)) : Qnil; } static VALUE rg_delete_surrounding(VALUE self, VALUE offset, VALUE n_chars) { return CBOOL2RVAL(gtk_im_context_delete_surrounding(_SELF(self), NUM2INT(offset), NUM2INT(n_chars))); } void Init_gtk_imcontext(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_IM_CONTEXT, "IMContext", mGtk); RG_DEF_METHOD(set_client_window, 1); RG_DEF_METHOD(preedit_string, 0); /* Is it better to name as "filter_keypress?" ?*/ RG_DEF_METHOD(filter_keypress, 1); RG_DEF_METHOD(focus_in, 0); RG_DEF_METHOD(focus_out, 0); RG_DEF_METHOD(reset, 0); RG_DEF_METHOD(set_cursor_location, 1); RG_DEF_METHOD(set_use_preedit, 1); RG_DEF_METHOD(set_surrounding, 2); RG_DEF_METHOD(surrounding, 0); RG_DEF_METHOD(delete_surrounding, 2); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-stock.c���������������������������������������������������0000644�0001750�0001750�00000030350�12102213527�017516� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 KUBO Takehiro * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mStock /* check whether sym is a Symbol or not in advance. */ #define CSTR2SYM(str) ID2SYM(rb_intern(str)) static VALUE rg_s_add(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE stock_id, label, modifier, keyval, translation_domain, buffer; GtkStockItem item; rb_scan_args(argc, argv, "23", &stock_id, &label, &modifier, &keyval, &translation_domain); item.stock_id = (gchar *)RVAL2GLIBID(stock_id, buffer); item.label = (gchar *)RVAL2CSTR(label); item.modifier = NIL_P(modifier) ? 0 : NUM2UINT(modifier); item.keyval = NIL_P(keyval) ? 0 : NUM2UINT(keyval); item.translation_domain = (gchar *)RVAL2CSTR_ACCEPT_NIL(translation_domain); gtk_stock_add(&item, 1); return Qnil; } static VALUE rg_s_lookup(G_GNUC_UNUSED VALUE self, VALUE stock_id) { VALUE buffer; const gchar *id = RVAL2GLIBID(stock_id, buffer); GtkStockItem item; if (gtk_stock_lookup(id, &item)) { return rb_ary_new3(5, CSTR2SYM(item.stock_id), CSTR2RVAL(item.label), UINT2NUM(item.modifier), UINT2NUM(item.keyval), CSTR2RVAL(item.translation_domain)); } rb_raise(rb_eArgError, "no such stock-id: %s", id); } static VALUE rg_s_ids(G_GNUC_UNUSED VALUE self) { GSList *ids = gtk_stock_list_ids(); GSList *l; VALUE ary = rb_ary_new(); for (l = ids; l != NULL; l = g_slist_next(l)) { rb_ary_push(ary, CSTR2SYM(l->data)); g_free(l->data); } g_slist_free(ids); return ary; } static gchar * translate_func(const gchar *path, gpointer func) { VALUE ret = rb_funcall((VALUE)func, id_call, 1, CSTR2RVAL(path)); return (gchar *)RVAL2CSTR(ret); } static VALUE rg_s_set_translate_func(VALUE klass, VALUE domain) { VALUE func = rb_block_proc(); G_RELATIVE(klass, func); gtk_stock_set_translate_func(RVAL2CSTR(domain), (GtkTranslateFunc)translate_func, (gpointer)func, NULL); return Qnil; } void Init_gtk_stock(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "Stock"); rb_undef_method(RG_TARGET_NAMESPACE, "new"); RG_DEF_SMETHOD(add, -1); RG_DEF_SMETHOD(lookup, 1); RG_DEF_SMETHOD(ids, 0); RG_DEF_SMETHOD(set_translate_func, 1); /* Stock IDs (not all are stock items; some are images only) */ rb_define_const(RG_TARGET_NAMESPACE, "ABOUT", CSTR2SYM(GTK_STOCK_ABOUT)); rb_define_const(RG_TARGET_NAMESPACE, "ADD", CSTR2SYM(GTK_STOCK_ADD)); rb_define_const(RG_TARGET_NAMESPACE, "APPLY", CSTR2SYM(GTK_STOCK_APPLY)); rb_define_const(RG_TARGET_NAMESPACE, "BOLD", CSTR2SYM(GTK_STOCK_BOLD)); rb_define_const(RG_TARGET_NAMESPACE, "CANCEL", CSTR2SYM(GTK_STOCK_CANCEL)); rb_define_const(RG_TARGET_NAMESPACE, "CAPS_LOCK_WARNING", CSTR2SYM(GTK_STOCK_CAPS_LOCK_WARNING)); rb_define_const(RG_TARGET_NAMESPACE, "CDROM", CSTR2SYM(GTK_STOCK_CDROM)); rb_define_const(RG_TARGET_NAMESPACE, "CLEAR", CSTR2SYM(GTK_STOCK_CLEAR)); rb_define_const(RG_TARGET_NAMESPACE, "CLOSE", CSTR2SYM(GTK_STOCK_CLOSE)); rb_define_const(RG_TARGET_NAMESPACE, "COLOR_PICKER", CSTR2SYM(GTK_STOCK_COLOR_PICKER)); rb_define_const(RG_TARGET_NAMESPACE, "CONVERT", CSTR2SYM(GTK_STOCK_CONVERT)); rb_define_const(RG_TARGET_NAMESPACE, "CONNECT", CSTR2SYM(GTK_STOCK_CONNECT)); rb_define_const(RG_TARGET_NAMESPACE, "COPY", CSTR2SYM(GTK_STOCK_COPY)); rb_define_const(RG_TARGET_NAMESPACE, "CUT", CSTR2SYM(GTK_STOCK_CUT)); rb_define_const(RG_TARGET_NAMESPACE, "DELETE", CSTR2SYM(GTK_STOCK_DELETE)); rb_define_const(RG_TARGET_NAMESPACE, "DIALOG_AUTHENTICATION", CSTR2SYM(GTK_STOCK_DIALOG_AUTHENTICATION)); rb_define_const(RG_TARGET_NAMESPACE, "DIALOG_ERROR", CSTR2SYM(GTK_STOCK_DIALOG_ERROR)); rb_define_const(RG_TARGET_NAMESPACE, "DIALOG_INFO", CSTR2SYM(GTK_STOCK_DIALOG_INFO)); rb_define_const(RG_TARGET_NAMESPACE, "DIALOG_QUESTION", CSTR2SYM(GTK_STOCK_DIALOG_QUESTION)); rb_define_const(RG_TARGET_NAMESPACE, "DIALOG_WARNING", CSTR2SYM(GTK_STOCK_DIALOG_WARNING)); rb_define_const(RG_TARGET_NAMESPACE, "DIRECTORY", CSTR2SYM(GTK_STOCK_DIRECTORY)); rb_define_const(RG_TARGET_NAMESPACE, "DISCARD", CSTR2SYM(GTK_STOCK_DISCARD)); rb_define_const(RG_TARGET_NAMESPACE, "DISCONNECT", CSTR2SYM(GTK_STOCK_DISCONNECT)); rb_define_const(RG_TARGET_NAMESPACE, "DND", CSTR2SYM(GTK_STOCK_DND)); rb_define_const(RG_TARGET_NAMESPACE, "DND_MULTIPLE", CSTR2SYM(GTK_STOCK_DND_MULTIPLE)); rb_define_const(RG_TARGET_NAMESPACE, "EDIT", CSTR2SYM(GTK_STOCK_EDIT)); rb_define_const(RG_TARGET_NAMESPACE, "FILE", CSTR2SYM(GTK_STOCK_FILE)); rb_define_const(RG_TARGET_NAMESPACE, "EXECUTE", CSTR2SYM(GTK_STOCK_EXECUTE)); rb_define_const(RG_TARGET_NAMESPACE, "FIND", CSTR2SYM(GTK_STOCK_FIND)); rb_define_const(RG_TARGET_NAMESPACE, "FIND_AND_REPLACE", CSTR2SYM(GTK_STOCK_FIND_AND_REPLACE)); rb_define_const(RG_TARGET_NAMESPACE, "FLOPPY", CSTR2SYM(GTK_STOCK_FLOPPY)); rb_define_const(RG_TARGET_NAMESPACE, "FULLSCREEN", CSTR2SYM(GTK_STOCK_FULLSCREEN)); rb_define_const(RG_TARGET_NAMESPACE, "GOTO_BOTTOM", CSTR2SYM(GTK_STOCK_GOTO_BOTTOM)); rb_define_const(RG_TARGET_NAMESPACE, "GOTO_FIRST", CSTR2SYM(GTK_STOCK_GOTO_FIRST)); rb_define_const(RG_TARGET_NAMESPACE, "GOTO_LAST", CSTR2SYM(GTK_STOCK_GOTO_LAST)); rb_define_const(RG_TARGET_NAMESPACE, "GOTO_TOP", CSTR2SYM(GTK_STOCK_GOTO_TOP)); rb_define_const(RG_TARGET_NAMESPACE, "GO_BACK", CSTR2SYM(GTK_STOCK_GO_BACK)); rb_define_const(RG_TARGET_NAMESPACE, "GO_DOWN", CSTR2SYM(GTK_STOCK_GO_DOWN)); rb_define_const(RG_TARGET_NAMESPACE, "GO_FORWARD", CSTR2SYM(GTK_STOCK_GO_FORWARD)); rb_define_const(RG_TARGET_NAMESPACE, "GO_UP", CSTR2SYM(GTK_STOCK_GO_UP)); rb_define_const(RG_TARGET_NAMESPACE, "HARDDISK", CSTR2SYM(GTK_STOCK_HARDDISK)); rb_define_const(RG_TARGET_NAMESPACE, "HELP", CSTR2SYM(GTK_STOCK_HELP)); rb_define_const(RG_TARGET_NAMESPACE, "HOME", CSTR2SYM(GTK_STOCK_HOME)); rb_define_const(RG_TARGET_NAMESPACE, "INDENT", CSTR2SYM(GTK_STOCK_INDENT)); rb_define_const(RG_TARGET_NAMESPACE, "INFO", CSTR2SYM(GTK_STOCK_INFO)); rb_define_const(RG_TARGET_NAMESPACE, "INDEX", CSTR2SYM(GTK_STOCK_INDEX)); rb_define_const(RG_TARGET_NAMESPACE, "ITALIC", CSTR2SYM(GTK_STOCK_ITALIC)); rb_define_const(RG_TARGET_NAMESPACE, "JUMP_TO", CSTR2SYM(GTK_STOCK_JUMP_TO)); rb_define_const(RG_TARGET_NAMESPACE, "JUSTIFY_CENTER", CSTR2SYM(GTK_STOCK_JUSTIFY_CENTER)); rb_define_const(RG_TARGET_NAMESPACE, "JUSTIFY_FILL", CSTR2SYM(GTK_STOCK_JUSTIFY_FILL)); rb_define_const(RG_TARGET_NAMESPACE, "JUSTIFY_LEFT", CSTR2SYM(GTK_STOCK_JUSTIFY_LEFT)); rb_define_const(RG_TARGET_NAMESPACE, "JUSTIFY_RIGHT", CSTR2SYM(GTK_STOCK_JUSTIFY_RIGHT)); rb_define_const(RG_TARGET_NAMESPACE, "LEAVE_FULLSCREEN", CSTR2SYM(GTK_STOCK_LEAVE_FULLSCREEN)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_FORWARD", CSTR2SYM(GTK_STOCK_MEDIA_FORWARD)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_NEXT", CSTR2SYM(GTK_STOCK_MEDIA_NEXT)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_PAUSE", CSTR2SYM(GTK_STOCK_MEDIA_PAUSE)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_PLAY", CSTR2SYM(GTK_STOCK_MEDIA_PLAY)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_PREVIOUS", CSTR2SYM(GTK_STOCK_MEDIA_PREVIOUS)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_RECORD", CSTR2SYM(GTK_STOCK_MEDIA_RECORD)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_REWIND", CSTR2SYM(GTK_STOCK_MEDIA_REWIND)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_STOP", CSTR2SYM(GTK_STOCK_MEDIA_STOP)); rb_define_const(RG_TARGET_NAMESPACE, "MISSING_IMAGE", CSTR2SYM(GTK_STOCK_MISSING_IMAGE)); rb_define_const(RG_TARGET_NAMESPACE, "NETWORK", CSTR2SYM(GTK_STOCK_NETWORK)); rb_define_const(RG_TARGET_NAMESPACE, "NEW", CSTR2SYM(GTK_STOCK_NEW)); rb_define_const(RG_TARGET_NAMESPACE, "NO", CSTR2SYM(GTK_STOCK_NO)); rb_define_const(RG_TARGET_NAMESPACE, "OK", CSTR2SYM(GTK_STOCK_OK)); rb_define_const(RG_TARGET_NAMESPACE, "OPEN", CSTR2SYM(GTK_STOCK_OPEN)); rb_define_const(RG_TARGET_NAMESPACE, "ORIENTATION_LANDSCAPE", CSTR2SYM(GTK_STOCK_ORIENTATION_LANDSCAPE)); rb_define_const(RG_TARGET_NAMESPACE, "ORIENTATION_PORTRAIT", CSTR2SYM(GTK_STOCK_ORIENTATION_PORTRAIT)); rb_define_const(RG_TARGET_NAMESPACE, "ORIENTATION_REVERSE_LANDSCAPE", CSTR2SYM(GTK_STOCK_ORIENTATION_REVERSE_LANDSCAPE)); rb_define_const(RG_TARGET_NAMESPACE, "ORIENTATION_REVERSE_PORTRAIT", CSTR2SYM(GTK_STOCK_ORIENTATION_REVERSE_PORTRAIT)); rb_define_const(RG_TARGET_NAMESPACE, "PAGE_SETUP", CSTR2SYM(GTK_STOCK_PAGE_SETUP)); rb_define_const(RG_TARGET_NAMESPACE, "PASTE", CSTR2SYM(GTK_STOCK_PASTE)); rb_define_const(RG_TARGET_NAMESPACE, "PREFERENCES", CSTR2SYM(GTK_STOCK_PREFERENCES)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT", CSTR2SYM(GTK_STOCK_PRINT)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT_ERROR", CSTR2SYM(GTK_STOCK_PRINT_ERROR)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT_PAUSED", CSTR2SYM(GTK_STOCK_PRINT_PAUSED)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT_PREVIEW", CSTR2SYM(GTK_STOCK_PRINT_PREVIEW)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT_REPORT", CSTR2SYM(GTK_STOCK_PRINT_REPORT)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT_WARNING", CSTR2SYM(GTK_STOCK_PRINT_WARNING)); rb_define_const(RG_TARGET_NAMESPACE, "PROPERTIES", CSTR2SYM(GTK_STOCK_PROPERTIES)); rb_define_const(RG_TARGET_NAMESPACE, "QUIT", CSTR2SYM(GTK_STOCK_QUIT)); rb_define_const(RG_TARGET_NAMESPACE, "REDO", CSTR2SYM(GTK_STOCK_REDO)); rb_define_const(RG_TARGET_NAMESPACE, "REFRESH", CSTR2SYM(GTK_STOCK_REFRESH)); rb_define_const(RG_TARGET_NAMESPACE, "REMOVE", CSTR2SYM(GTK_STOCK_REMOVE)); rb_define_const(RG_TARGET_NAMESPACE, "REVERT_TO_SAVED", CSTR2SYM(GTK_STOCK_REVERT_TO_SAVED)); rb_define_const(RG_TARGET_NAMESPACE, "SAVE", CSTR2SYM(GTK_STOCK_SAVE)); rb_define_const(RG_TARGET_NAMESPACE, "SAVE_AS", CSTR2SYM(GTK_STOCK_SAVE_AS)); rb_define_const(RG_TARGET_NAMESPACE, "SELECT_ALL", CSTR2SYM(GTK_STOCK_SELECT_ALL)); rb_define_const(RG_TARGET_NAMESPACE, "SELECT_COLOR", CSTR2SYM(GTK_STOCK_SELECT_COLOR)); rb_define_const(RG_TARGET_NAMESPACE, "SELECT_FONT", CSTR2SYM(GTK_STOCK_SELECT_FONT)); rb_define_const(RG_TARGET_NAMESPACE, "SORT_ASCENDING", CSTR2SYM(GTK_STOCK_SORT_ASCENDING)); rb_define_const(RG_TARGET_NAMESPACE, "SORT_DESCENDING", CSTR2SYM(GTK_STOCK_SORT_DESCENDING)); rb_define_const(RG_TARGET_NAMESPACE, "SPELL_CHECK", CSTR2SYM(GTK_STOCK_SPELL_CHECK)); rb_define_const(RG_TARGET_NAMESPACE, "STOP", CSTR2SYM(GTK_STOCK_STOP)); rb_define_const(RG_TARGET_NAMESPACE, "STRIKETHROUGH", CSTR2SYM(GTK_STOCK_STRIKETHROUGH)); rb_define_const(RG_TARGET_NAMESPACE, "UNDELETE", CSTR2SYM(GTK_STOCK_UNDELETE)); rb_define_const(RG_TARGET_NAMESPACE, "UNDERLINE", CSTR2SYM(GTK_STOCK_UNDERLINE)); rb_define_const(RG_TARGET_NAMESPACE, "UNDO", CSTR2SYM(GTK_STOCK_UNDO)); rb_define_const(RG_TARGET_NAMESPACE, "UNINDENT", CSTR2SYM(GTK_STOCK_UNINDENT)); rb_define_const(RG_TARGET_NAMESPACE, "YES", CSTR2SYM(GTK_STOCK_YES)); rb_define_const(RG_TARGET_NAMESPACE, "ZOOM_100", CSTR2SYM(GTK_STOCK_ZOOM_100)); rb_define_const(RG_TARGET_NAMESPACE, "ZOOM_FIT", CSTR2SYM(GTK_STOCK_ZOOM_FIT)); rb_define_const(RG_TARGET_NAMESPACE, "ZOOM_IN", CSTR2SYM(GTK_STOCK_ZOOM_IN)); rb_define_const(RG_TARGET_NAMESPACE, "ZOOM_OUT", CSTR2SYM(GTK_STOCK_ZOOM_OUT)); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tool-itemgroup.c������������������������������������������0000644�0001750�0001750�00000003763�12102213527�021371� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cToolItemGroup #define _SELF(self) (RVAL2GTKTOOLITEMGROUP(self)) static VALUE rg_initialize(VALUE self, VALUE label) { RBGTK_INITIALIZE(self, gtk_tool_item_group_new(RVAL2CSTR(label))); return Qnil; } static VALUE rg_get_drop_item(VALUE self, VALUE x, VALUE y) { return GOBJ2RVAL(gtk_tool_item_group_get_drop_item(_SELF(self), NUM2INT(x), NUM2INT(y))); } static VALUE rg_n_items(VALUE self) { return UINT2NUM(gtk_tool_item_group_get_n_items(_SELF(self))); } static VALUE rg_get_nth_item(VALUE self, VALUE index) { return GOBJ2RVAL(gtk_tool_item_group_get_nth_item(_SELF(self), NUM2UINT(index))); } static VALUE rg_insert(VALUE self, VALUE item, VALUE position) { gtk_tool_item_group_insert(_SELF(self), RVAL2GTKTOOLITEM(item), NUM2INT(position)); return self; } void Init_gtk_toolitemgroup(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOOL_ITEM_GROUP, "ToolItemGroup", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(get_drop_item, 2); RG_DEF_METHOD(get_nth_item, 1); RG_DEF_METHOD(insert, 2); RG_DEF_METHOD(n_items, 0); } �������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tool-shell.c����������������������������������������������0000644�0001750�0001750�00000004734�12102213527�020464� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mToolShell #define _SELF(self) (RVAL2GTKTOOLSHELL(self)) static VALUE rg_ellipsize_mode(VALUE self) { return PANGOELLIPSIZEMODE2RVAL(gtk_tool_shell_get_ellipsize_mode(_SELF(self))); } static VALUE rg_icon_size(VALUE self) { return GTKICONSIZE2RVAL(gtk_tool_shell_get_icon_size(_SELF(self))); } static VALUE rg_orientation(VALUE self) { return GTKORIENTATION2RVAL(gtk_tool_shell_get_orientation(_SELF(self))); } static VALUE rg_relief_style(VALUE self) { return GTKRELIEFSTYLE2RVAL(gtk_tool_shell_get_relief_style(_SELF(self))); } static VALUE rg_style(VALUE self) { return GTKTOOLBARSTYLE2RVAL(gtk_tool_shell_get_style(_SELF(self))); } static VALUE rg_text_alignment(VALUE self) { return DBL2NUM(gtk_tool_shell_get_text_alignment(_SELF(self))); } static VALUE rg_text_orientation(VALUE self) { return GTKORIENTATION2RVAL(gtk_tool_shell_get_text_orientation(_SELF(self))); } static VALUE rg_text_size_group(VALUE self) { return GOBJ2RVAL(gtk_tool_shell_get_text_size_group(_SELF(self))); } static VALUE rg_rebuild_menu(VALUE self) { gtk_tool_shell_rebuild_menu(_SELF(self)); return self; } void Init_gtk_toolshell(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_TOOL_SHELL, "ToolShell", mGtk); RG_DEF_METHOD(ellipsize_mode, 0); RG_DEF_METHOD(icon_size, 0); RG_DEF_METHOD(orientation, 0); RG_DEF_METHOD(relief_style, 0); RG_DEF_METHOD(style, 0); RG_DEF_METHOD(text_alignment, 0); RG_DEF_METHOD(text_orientation, 0); RG_DEF_METHOD(text_size_group, 0); RG_DEF_METHOD(rebuild_menu, 0); } ������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-recent-chooser-dialog.c�����������������������������������0000644�0001750�0001750�00000004467�12102213527�022562� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRecentChooserDialog #define _SELF(self) (RVAL2GTKRECENTCHOOSERDIALOG(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, rb_title, rb_parent, rb_manager, rb_button_ary; const gchar *title; GtkWindow *parent; GtkRecentManager *manager; GtkWidget *dialog; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "title", &rb_title, "parent", &rb_parent, "manager", &rb_manager, "buttons", &rb_button_ary, NULL); title = RVAL2CSTR_ACCEPT_NIL(rb_title); parent = NIL_P(rb_parent) ? NULL : RVAL2GTKWINDOW(rb_parent); manager = NIL_P(rb_manager) ? NULL : RVAL2GTKRECENTMANAGER(rb_manager); if (manager) { dialog = gtk_recent_chooser_dialog_new_for_manager(title, parent, manager, NULL, NULL); } else { dialog = gtk_recent_chooser_dialog_new(title, parent, NULL, NULL); } RBGTK_INITIALIZE(self, dialog); if (!NIL_P(rb_button_ary)) rb_funcall2(self, rb_intern("add_buttons"), RARRAY_LEN(rb_button_ary), RARRAY_PTR(rb_button_ary)); return Qnil; } void Init_gtk_recent_chooser_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_CHOOSER_DIALOG, "RecentChooserDialog", mGtk); RG_DEF_METHOD(initialize, -1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-font-chooser-widget.c�������������������������������������0000644�0001750�0001750�00000002553�12102213527�022266� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #if GTK_CHECK_VERSION(3, 2, 0) #define RG_TARGET_NAMESPACE cFontChooserWidget #define _SELF(self) (RVAL2GTKFONTCHOOSERWIDGET(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_font_chooser_widget_new()); return Qnil; } #endif void Init_gtk_fontchooserwidget(VALUE mGtk) { #if GTK_CHECK_VERSION(3, 2, 0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FONT_CHOOSER_WIDGET, "FontChooserWidget", mGtk); RG_DEF_METHOD(initialize, 0); #endif } �����������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-container.c�����������������������������������������������0000644�0001750�0001750�00000054143�12257552167�020404� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cContainer #define _SELF(self) (RVAL2GTKCONTAINER(self)) #define RubyGtkContainerHookModule "RubyGtkContainerHook__" /* We don't need this. #define GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID(object, property_id, pspec) */ static VALUE type_to_prop_setter_table; static VALUE type_to_prop_getter_table; static VALUE rg_resize_container_p(VALUE self) { return CBOOL2RVAL(GTK_IS_RESIZE_CONTAINER(_SELF(self))); } static VALUE rg_remove(VALUE self, VALUE other) { G_CHILD_REMOVE(self, other); gtk_container_remove(_SELF(self), RVAL2GTKWIDGET(other)); return self; } static VALUE rg_check_resize(VALUE self) { gtk_container_check_resize(_SELF(self)); return self; } static VALUE rg_each(int argc, VALUE *argv, VALUE self) { VALUE callback; rb_scan_args(argc, argv, "01", &callback); if (NIL_P(callback)) { callback = rb_block_proc(); } gtk_container_foreach(_SELF(self), exec_callback, (gpointer)callback); return self; } static VALUE rg_each_forall(int argc, VALUE *argv, VALUE self) { VALUE callback; rb_scan_args(argc, argv, "01", &callback); if (NIL_P(callback)) { callback = rb_block_proc(); } gtk_container_forall(_SELF(self), exec_callback, (gpointer)callback); return self; } static VALUE rg_children(VALUE self) { return GOBJGLIST2RVAL_FREE(gtk_container_get_children(_SELF(self)), g_list_free, NULL); } static VALUE rg_set_reallocate_redraws(VALUE self, VALUE needs_redraws) { gtk_container_set_reallocate_redraws(_SELF(self), RVAL2CBOOL(needs_redraws)); return self; } static VALUE rg_set_focus_child(VALUE self, VALUE child) { gtk_container_set_focus_child(_SELF(self), RVAL2GTKWIDGET(child)); return self; } static VALUE rg_set_focus_vadjustment(VALUE self, VALUE adjustment) { gtk_container_set_focus_vadjustment(_SELF(self), NIL_P(adjustment) ? NULL : RVAL2GTKADJUSTMENT(adjustment)); return self; } static VALUE rg_set_focus_hadjustment(VALUE self, VALUE adjustment) { gtk_container_set_focus_hadjustment(_SELF(self), NIL_P(adjustment) ? NULL : RVAL2GTKADJUSTMENT(adjustment)); return self; } static VALUE rg_focus_vadjustment(VALUE self) { return GOBJ2RVAL(gtk_container_get_focus_vadjustment(_SELF(self))); } static VALUE rg_focus_hadjustment(VALUE self) { return GOBJ2RVAL(gtk_container_get_focus_hadjustment(_SELF(self))); } static VALUE rg_resize_children(VALUE self) { gtk_container_resize_children(_SELF(self)); return self; } static VALUE rg_child_type(VALUE self) { return GTYPE2CLASS(gtk_container_child_type(_SELF(self))); } /* void gtk_container_child_get (GtkContainer *container, GtkWidget *child, const gchar *first_prop_name, ...); void gtk_container_child_set (GtkContainer *container, GtkWidget *child, const gchar *first_prop_name, ...); */ static void rbgtkcontainer_register_child_property_setter(GType gtype, const char *name, RValueToGValueFunc func) { GObjectClass* oclass; GParamSpec* pspec; VALUE table = rb_hash_aref(type_to_prop_setter_table, INT2FIX(gtype)); if (NIL_P(table)){ table = rb_hash_new(); rb_hash_aset(type_to_prop_setter_table, INT2FIX(gtype), table); } oclass = g_type_class_ref(gtype); pspec = gtk_container_class_find_child_property(oclass, name); rb_hash_aset(table, rb_intern(g_param_spec_get_name(pspec)), Data_Wrap_Struct(rb_cData, NULL, NULL, func)); g_type_class_unref(oclass); } static void rbgtkcontainer_register_child_property_getter(GType gtype, const char *name, GValueToRValueFunc func) { GObjectClass* oclass; GParamSpec* pspec; VALUE table = rb_hash_aref(type_to_prop_getter_table, INT2FIX(gtype)); if (NIL_P(table)){ table = rb_hash_new(); rb_hash_aset(type_to_prop_getter_table, INT2FIX(gtype), table); } oclass = g_type_class_ref(gtype); pspec = gtk_container_class_find_child_property(oclass, name); rb_hash_aset(table, rb_intern(g_param_spec_get_name(pspec)), Data_Wrap_Struct(rb_cData, NULL, NULL, func)); } static VALUE rg_child_get_property(VALUE self, VALUE child, VALUE prop_name) { GParamSpec* pspec; const char* name; if (SYMBOL_P(prop_name)) { name = rb_id2name(SYM2ID(prop_name)); } else { name = RVAL2CSTR(prop_name); } pspec = gtk_container_class_find_child_property( G_OBJECT_GET_CLASS(RVAL2GOBJ(self)), name); if (!pspec) rb_raise(rb_eArgError, "No such property: %s", name); else { GValueToRValueFunc getter = NULL; GValue gval = G_VALUE_INIT; VALUE ret; { VALUE table = rb_hash_aref(type_to_prop_getter_table, INT2FIX(pspec->owner_type)); if (!NIL_P(table)){ VALUE obj = rb_hash_aref(table, rb_intern(g_param_spec_get_name(pspec))); if (!NIL_P(obj)) Data_Get_Struct(obj, void, getter); } } g_value_init(&gval, G_PARAM_SPEC_VALUE_TYPE(pspec)); gtk_container_child_get_property(RVAL2GTKCONTAINER(self), RVAL2GTKWIDGET(child), name , &gval); ret = getter ? getter(&gval) : GVAL2RVAL(&gval); G_CHILD_ADD(child, ret); g_value_unset(&gval); return ret; } } static VALUE rg_child_set_property(VALUE self, VALUE child, VALUE prop_name, VALUE val) { GParamSpec* pspec; const char* name; if (SYMBOL_P(prop_name)) { name = rb_id2name(SYM2ID(prop_name)); } else { name = RVAL2CSTR(prop_name); } pspec = gtk_container_class_find_child_property( G_OBJECT_GET_CLASS(RVAL2GOBJ(self)), name); if (!pspec) rb_raise(rb_eArgError, "No such property: %s", name); else { RValueToGValueFunc setter = NULL; GValue gval = G_VALUE_INIT; g_value_init(&gval, G_PARAM_SPEC_VALUE_TYPE(pspec)); { VALUE table = rb_hash_aref(type_to_prop_setter_table, INT2FIX(pspec->owner_type)); if (!NIL_P(table)){ VALUE obj = rb_hash_aref(table, rb_intern(g_param_spec_get_name(pspec))); if (!NIL_P(obj)) Data_Get_Struct(obj, void, setter); } } if (setter) setter(val, &gval); else { if (!NIL_P(val)) rbgobj_rvalue_to_gvalue(val, &gval); } G_CHILD_ADD(child, val); gtk_container_child_set_property(RVAL2GTKCONTAINER(self), RVAL2GTKWIDGET(child), name, &gval); g_value_unset(&gval); return self; } } static VALUE rg_add(int argc, VALUE *argv, VALUE self) { VALUE other, properties; GtkWidget *child; rb_scan_args(argc, argv, "11", &other, &properties); child = RVAL2GTKWIDGET(other); gtk_widget_freeze_child_notify(child); gtk_container_add(_SELF(self), child); G_CHILD_ADD(self, other); if (gtk_widget_get_parent(child) && (! NIL_P(properties))){ int i; VALUE ary; Check_Type(properties, T_HASH); ary = rb_funcall(properties, rb_intern("to_a"), 0); for (i = 0; i < RARRAY_LEN(ary); i++) { rg_child_set_property(self, other, RARRAY_PTR(RARRAY_PTR(ary)[i])[0], RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); } } gtk_widget_thaw_child_notify(child); return self; } /* void gtk_container_child_get_valist (GtkContainer *container, GtkWidget *child, const gchar *first_property_name, va_list var_args); void gtk_container_child_set_valist (GtkContainer *container, GtkWidget *child, const gchar *first_property_name, va_list var_args); */ /* deprecated static VALUE rg_propagate_expose(VALUE self, VALUE child, VALUE event) { gtk_container_propagate_expose(_SELF(self), RVAL2GTKWIDGET(child), (GdkEventExpose *)RVAL2GEV(event)); return self; } */ static VALUE rg_focus_chain(VALUE self) { gboolean set_explicitly; GList *glist = NULL; set_explicitly = gtk_container_get_focus_chain(_SELF(self), &glist); if (!set_explicitly) { return Qnil; } return GOBJGLIST2RVAL_FREE(glist, g_list_free, NULL); } struct rval2gtkwidgetglist_args { VALUE ary; long n; GList *result; }; static VALUE rbg_rval2gtkwidgetglist_body(VALUE value) { long i; struct rval2gtkwidgetglist_args *args = (struct rval2gtkwidgetglist_args *)value; for (i = 0; i < args->n; i++) args->result = g_list_append(args->result, RVAL2GTKWIDGET(RARRAY_PTR(args->ary)[i])); return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gtkwidgetglist_rescue(VALUE value) { g_list_free(((struct rval2gtkwidgetglist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GList * rbg_rval2gtkwidgetglist(VALUE value) { struct rval2gtkwidgetglist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbg_rval2gtkwidgetglist_body, (VALUE)&args, rbg_rval2gtkwidgetglist_rescue, (VALUE)&args); return args.result; } #define RVAL2GTKWIDGETGLIST(value) rbg_rval2gtkwidgetglist(value) static VALUE rg_set_focus_chain(VALUE self, VALUE rbfocusable_widgets) { GtkContainer *container = _SELF(self); GList *focusable_widgets = RVAL2GTKWIDGETGLIST(rbfocusable_widgets); gtk_container_set_focus_chain(container, focusable_widgets); g_list_free(focusable_widgets); return self; } static VALUE rg_unset_focus_chain(VALUE self) { gtk_container_unset_focus_chain(_SELF(self)); return self; } static VALUE rg_s_child_property(VALUE self, VALUE property_name) { GObjectClass* oclass; const char* name; GParamSpec* prop; VALUE result; if (SYMBOL_P(property_name)) { name = rb_id2name(SYM2ID(property_name)); } else { name = RVAL2CSTR(property_name); } oclass = g_type_class_ref(CLASS2GTYPE(self)); prop = gtk_container_class_find_child_property(oclass, name); if (!prop){ g_type_class_unref(oclass); rb_raise(rb_eNameError, "no such property: %s", name); } result = GOBJ2RVAL(prop); g_type_class_unref(oclass); return result; } static VALUE rg_s_install_child_property(int argc, VALUE *argv, VALUE self) { const RGObjClassInfo* cinfo = rbgobj_lookup_class(self); GtkContainerClass* gclass; VALUE spec, prop_id; GParamSpec* pspec; rb_scan_args(argc, argv, "11", &spec, &prop_id); pspec = RVAL2GPARAMSPEC(spec); if (cinfo->klass != self) rb_raise(rb_eTypeError, "%s isn't registerd class", rb_class2name(self)); gclass = GTK_CONTAINER_CLASS(g_type_class_ref(cinfo->gtype)); gtk_container_class_install_child_property(gclass, NIL_P(prop_id) ? 1 : NUM2UINT(prop_id), pspec); return self; } static VALUE rg_s_child_properties(int argc, VALUE *argv, VALUE self) { GObjectClass* oclass = g_type_class_ref(CLASS2GTYPE(self)); guint n_properties; GParamSpec** props; VALUE inherited_too; VALUE ary; guint i; if (rb_scan_args(argc, argv, "01", &inherited_too) == 0) inherited_too = Qtrue; props = gtk_container_class_list_child_properties(oclass, &n_properties); ary = rb_ary_new(); for (i = 0; i < n_properties; i++){ if (RVAL2CBOOL(inherited_too) || GTYPE2CLASS(props[i]->owner_type) == self) rb_ary_push(ary, CSTR2RVAL(props[i]->name)); } g_free(props); g_type_class_unref(oclass); return ary; } /**********************************************************************/ static VALUE proc_mod_eval; static GQuark q_ruby_setter; static GQuark q_ruby_getter; static VALUE cont_initialize(int argc, VALUE *argv, VALUE self) { VALUE params_hash; GObject* gobj; rb_scan_args(argc, argv, "01", ¶ms_hash); if (!NIL_P(params_hash)) Check_Type(params_hash, T_HASH); gobj = rbgobj_gobject_new(RVAL2GTYPE(self), params_hash); RBGTK_INITIALIZE(self, gobj); return Qnil; } // FIXME: use rb_protect static void get_prop_func(GObject* object, G_GNUC_UNUSED guint property_id, GValue* value, GParamSpec* pspec) { ID ruby_getter = (ID)g_param_spec_get_qdata(pspec, q_ruby_getter); if (!ruby_getter) { gchar* name = g_strdup(g_param_spec_get_name(pspec)); gchar* p; for (p = name; *p; p++) { if (*p == '-') *p = '_'; } ruby_getter = rb_intern(name); g_param_spec_set_qdata(pspec, q_ruby_getter, (gpointer)ruby_getter); g_free(name); } { VALUE ret = rb_funcall(GOBJ2RVAL(object), ruby_getter, 0); rbgobj_rvalue_to_gvalue(ret, value); } } // FIXME: use rb_protect static void set_prop_func(GObject* object, G_GNUC_UNUSED guint property_id, const GValue* value, GParamSpec* pspec) { ID ruby_setter = (ID)g_param_spec_get_qdata(pspec, q_ruby_setter); if (!ruby_setter) { gchar* name = g_strconcat(g_param_spec_get_name(pspec), "=", NULL); gchar* p; for (p = name; *p; p++) { if (*p == '-') *p = '_'; } ruby_setter = rb_intern(name); g_param_spec_set_qdata(pspec, q_ruby_setter, (gpointer)ruby_setter); g_free(name); } rb_funcall(GOBJ2RVAL(object), ruby_setter, 1, GVAL2RVAL(value)); } // FIXME: use rb_protect static void get_child_prop_func(GtkContainer *container, GtkWidget *child, G_GNUC_UNUSED guint property_id, GValue *value, GParamSpec *pspec) { ID ruby_getter = (ID)g_param_spec_get_qdata(pspec, q_ruby_getter); if (!ruby_getter) { gchar* name = g_strconcat("get_", g_param_spec_get_name(pspec), NULL); gchar* p; for (p = name; *p; p++) { if (*p == '-') *p = '_'; } ruby_getter = rb_intern(name); g_param_spec_set_qdata(pspec, q_ruby_getter, (gpointer)ruby_getter); g_free(name); } { VALUE ret = rb_funcall(GOBJ2RVAL(container), ruby_getter, 1, GOBJ2RVAL(child)); rbgobj_rvalue_to_gvalue(ret, value); } } // FIXME: use rb_protect static void set_child_prop_func(GtkContainer *container, GtkWidget *child, G_GNUC_UNUSED guint property_id, const GValue *value, GParamSpec *pspec) { ID ruby_setter = (ID)g_param_spec_get_qdata(pspec, q_ruby_setter); if (!ruby_setter) { gchar* name = g_strconcat("set_", g_param_spec_get_name(pspec), NULL); gchar* p; for (p = name; *p; p++) { if (*p == '-') *p = '_'; } ruby_setter = rb_intern(name); g_param_spec_set_qdata(pspec, q_ruby_setter, (gpointer)ruby_setter); g_free(name); } rb_funcall(GOBJ2RVAL(container), ruby_setter, 2, GOBJ2RVAL(child), GVAL2RVAL(value)); } // FIXME: use rb_protect static void class_init_func(gpointer g_class, G_GNUC_UNUSED gpointer class_data) { GObjectClass* g_class1 = G_OBJECT_CLASS(g_class); GtkContainerClass* g_class2 = GTK_CONTAINER_CLASS(g_class); g_class1->set_property = set_prop_func; g_class1->get_property = get_prop_func; g_class2->set_child_property = set_child_prop_func; g_class2->get_child_property = get_child_prop_func; #if 0 VALUE class_init_proc = (VALUE)class_data; rb_funcall(proc_mod_eval, rb_intern("call"), 2, GTYPE2CLASS(G_TYPE_FROM_CLASS(g_class)), class_init_proc); #endif } static VALUE rg_s_type_register(int argc, VALUE* argv, VALUE self) { VALUE type_name, flags; volatile VALUE class_init_proc = Qnil; GType parent_type; GTypeInfo* info; rb_scan_args(argc, argv, "03", &type_name, &info, &flags); /* TODO: Replace this copy-paste job with the real thing in glib2. */ { const RGObjClassInfo* cinfo = rbgobj_lookup_class(self); if (cinfo->klass == self) rb_raise(rb_eTypeError, "already registered"); } { VALUE superclass = rb_funcall(self, rb_intern("superclass"), 0); const RGObjClassInfo* cinfo = CLASS2CINFO(superclass); if (cinfo->klass != superclass) rb_raise(rb_eTypeError, "super class must be registered to GLib"); parent_type = cinfo->gtype; } if (NIL_P(type_name)){ VALUE s = rb_funcall(self, rb_intern("name"), 0); if (strlen(StringValuePtr(s)) == 0) rb_raise(rb_eTypeError, "can't determine type name"); type_name = rb_funcall( rb_eval_string("lambda{|x| x.gsub(/::/,'') }"), rb_intern("call"), 1, s); } { GTypeQuery query; g_type_query(parent_type, &query); /* TODO: This should not require a new GTypeInfo, as GLib doesn't * retain a copy. */ info = g_new0(GTypeInfo, 1); info->class_size = query.class_size; info->base_init = NULL; info->base_finalize = NULL; info->class_init = class_init_func; info->class_finalize = NULL; info->class_data = (gpointer)class_init_proc; info->instance_size = query.instance_size; info->n_preallocs = 0; info->instance_init = NULL; info->value_table = NULL; } { GType type = g_type_register_static(parent_type, StringValuePtr(type_name), info, NIL_P(flags) ? 0 : NUM2INT(flags)); G_RELATIVE(self, class_init_proc); rbgobj_register_class(self, type, TRUE, TRUE); { RGObjClassInfo* cinfo = (RGObjClassInfo*)rbgobj_lookup_class(self); cinfo->flags |= RBGOBJ_DEFINED_BY_RUBY; } { GType parent = g_type_parent(type); const RGObjClassInfo* cinfo = GTYPE2CINFO(parent); VALUE m = rb_define_module_under(self, RubyGtkContainerHookModule); if (! (cinfo->flags & RBGOBJ_DEFINED_BY_RUBY)) { rbg_define_method(m, "initialize", cont_initialize, -1); } rb_include_module(self, m); } return Qnil; } } /**********************************************************************/ static void cont_mark_callback(GtkWidget *w, G_GNUC_UNUSED gpointer data) { rbgobj_gc_mark_instance(w); } static void cont_mark(void* p) { gtk_container_forall(GTK_CONTAINER(p), cont_mark_callback, NULL); } /**********************************************************************/ void Init_gtk_container(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_GC_FUNC(GTK_TYPE_CONTAINER, "Container", mGtk, cont_mark, NULL); RG_DEF_METHOD_P(resize_container, 0); RG_DEF_METHOD(add, -1); RG_DEF_ALIAS("<<", "add"); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(check_resize, 0); RG_DEF_METHOD(each, -1); RG_DEF_METHOD(each_forall, -1); RG_DEF_METHOD(children, 0); RG_DEF_METHOD(set_reallocate_redraws, 1); RG_DEF_METHOD(set_focus_child, 1); RG_DEF_METHOD(set_focus_vadjustment, 1); RG_DEF_METHOD(set_focus_hadjustment, 1); RG_DEF_METHOD(focus_vadjustment, 0); RG_DEF_METHOD(focus_hadjustment, 0); RG_DEF_METHOD(resize_children, 0); RG_DEF_METHOD(child_type, 0); RG_DEF_METHOD(child_get_property, 2); RG_DEF_METHOD(child_set_property, 3); /* deprecated RG_DEF_METHOD(propagate_expose, 2); */ RG_DEF_METHOD(focus_chain, 0); RG_DEF_METHOD(set_focus_chain, 1); RG_DEF_METHOD(unset_focus_chain, 0); RG_DEF_SMETHOD(child_property, 1); RG_DEF_SMETHOD(child_properties, -1); RG_DEF_SMETHOD(install_child_property, -1); q_ruby_getter = g_quark_from_static_string("__ruby_getter"); q_ruby_setter = g_quark_from_static_string("__ruby_setter"); RG_DEF_SMETHOD(type_register, -1); rb_global_variable(&proc_mod_eval); proc_mod_eval = rb_eval_string("lambda{|obj,proc| obj.module_eval(&proc)}"); rb_global_variable(&type_to_prop_setter_table); rb_global_variable(&type_to_prop_getter_table); type_to_prop_setter_table = rb_hash_new(); type_to_prop_getter_table = rb_hash_new(); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-modelfilter.c����������������������������������������0000644�0001750�0001750�00000013543�12102213527�021643� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTreeModelFilter #define _SELF(s) (RVAL2GTKTREEMODELFILTER(s)) static ID id_child_model; static ID id_root; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE child_model, root; GtkTreeModel* widget; rb_scan_args(argc, argv, "11", &child_model, &root); G_CHILD_SET(self, id_child_model, child_model); if (NIL_P(root)){ widget = gtk_tree_model_filter_new(RVAL2GTKTREEMODEL(child_model), (GtkTreePath*)NULL); } else { G_CHILD_SET(self, id_root, root); widget = gtk_tree_model_filter_new(RVAL2GTKTREEMODEL(child_model), (GtkTreePath*)RVAL2GTKTREEPATH(root)); } G_INITIALIZE(self, widget); return Qnil; } static gboolean visible_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer func) { VALUE ret; iter->user_data3 = model; ret = rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(model), GTKTREEITER2RVAL(iter)); return RVAL2CBOOL(ret); } static VALUE rg_set_visible_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_model_filter_set_visible_func(_SELF(self), (GtkTreeModelFilterVisibleFunc)visible_func, (gpointer)func, NULL); return self; } static void modify_func(GtkTreeModel *model, GtkTreeIter *iter, GValue *value, gint column, gpointer func) { VALUE ret; iter->user_data3 = model; ret = rb_funcall((VALUE)func, id_call, 3, GOBJ2RVAL(model), GTKTREEITER2RVAL(iter), INT2NUM(column)); rbgobj_rvalue_to_gvalue(ret, value); } /* * Should return value * * e.g. * filter.set_modify_func(String) do |model, iter, column| * "foo" * end */ static VALUE rg_set_modify_func(int argc, VALUE *argv, VALUE self) { VALUE func = rb_block_proc(); gint i; GType* types; if (argc == 0) rb_raise(rb_eArgError, "need more than 1 class type."); types = ALLOCA_N(GType, argc); G_RELATIVE(self, func); for (i = 0; i < argc; i++){ types[i] = CLASS2GTYPE(argv[i]); } gtk_tree_model_filter_set_modify_func(_SELF(self), argc, types, (GtkTreeModelFilterModifyFunc)modify_func, (gpointer)func, NULL); return self; } static VALUE rg_set_visible_column(VALUE self, VALUE column) { gtk_tree_model_filter_set_visible_column(_SELF(self), NUM2INT(column)); return self; } static VALUE rg_model(VALUE self) { return GOBJ2RVAL(gtk_tree_model_filter_get_model(_SELF(self))); } static VALUE rg_convert_child_iter_to_iter(VALUE self, VALUE child_iter) { GtkTreeIter filter_iter; GtkTreeModelFilter* modelfilter = _SELF(self); gtk_tree_model_filter_convert_child_iter_to_iter(modelfilter, &filter_iter, RVAL2GTKTREEITER(child_iter)); filter_iter.user_data3 = gtk_tree_model_filter_get_model(modelfilter); return GTKTREEITER2RVAL(&filter_iter); } static VALUE rg_convert_iter_to_child_iter(VALUE self, VALUE filtered_iter) { GtkTreeIter child_iter; GtkTreeModelFilter* modelfilter = _SELF(self); gtk_tree_model_filter_convert_iter_to_child_iter(modelfilter, &child_iter, RVAL2GTKTREEITER(filtered_iter)); child_iter.user_data3 = gtk_tree_model_filter_get_model(modelfilter); return GTKTREEITER2RVAL(&child_iter); } static VALUE rg_convert_child_path_to_path(VALUE self, VALUE child_path) { return GTKTREEPATH2RVAL(gtk_tree_model_filter_convert_child_path_to_path( _SELF(self), RVAL2GTKTREEPATH(child_path))); } static VALUE rg_convert_path_to_child_path(VALUE self, VALUE filter_path) { return GTKTREEPATH2RVAL(gtk_tree_model_filter_convert_path_to_child_path( _SELF(self), RVAL2GTKTREEPATH(filter_path))); } static VALUE rg_refilter(VALUE self) { gtk_tree_model_filter_refilter(_SELF(self)); return self; } static VALUE rg_clear_cache(VALUE self) { gtk_tree_model_filter_clear_cache(_SELF(self)); return self; } void Init_gtk_treemodelfilter(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_MODEL_FILTER, "TreeModelFilter", mGtk); id_child_model = rb_intern("child_model"); id_root = rb_intern("root"); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_visible_func, 0); RG_DEF_METHOD(set_modify_func, -1); RG_DEF_METHOD(set_visible_column, 1); RG_DEF_METHOD(model, 0); RG_DEF_METHOD(convert_child_iter_to_iter, 1); RG_DEF_METHOD(convert_iter_to_child_iter, 1); RG_DEF_METHOD(convert_child_path_to_path, 1); RG_DEF_METHOD(convert_path_to_child_path, 1); RG_DEF_METHOD(refilter, 0); RG_DEF_METHOD(clear_cache, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-accel-group-entry.c���������������������������������������0000644�0001750�0001750�00000005072�12124610262�021737� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAccelGroupEntry #define _SELF(s) (RVAL2GTKACCELGROUPENTRY(s)) static GtkAccelGroupEntry * agentry_copy(const GtkAccelGroupEntry *agentry) { GtkAccelGroupEntry *new_agentry; g_return_val_if_fail (agentry != NULL, NULL); new_agentry = g_new(GtkAccelGroupEntry, 1); *new_agentry = *agentry; return new_agentry; } GType gtk_accel_group_entry_get_type(void) { static GType our_type = 0; if(our_type == 0) our_type = g_boxed_type_register_static("GtkAccelGroupEntry", (GBoxedCopyFunc)agentry_copy, (GBoxedFreeFunc)g_free); return our_type; } /* struct _GtkAccelGroupEntry { GtkAccelKey key; GClosure *closure; GQuark accel_path_quark; }; */ static VALUE rg_initialize(VALUE self) { GtkAccelGroupEntry key; memset(&key, 0, sizeof(GtkAccelGroupEntry)); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_ACCEL_GROUP_ENTRY, &key)); return Qnil; } static VALUE rg_accel_key(VALUE self) { return GTKACCELKEY2RVAL(&_SELF(self)->key); } static VALUE rg_closure(VALUE self) { return GCLOSURE2RVAL(_SELF(self)->closure); } static VALUE rg_accel_path(VALUE self) { const gchar *quark_str = g_quark_to_string(_SELF(self)->accel_path_quark); return quark_str ? CSTR2RVAL(quark_str) : Qnil; } void Init_gtk_accel_group_entry(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCEL_GROUP_ENTRY, "AccelGroupEntry", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(accel_key, 0); RG_DEF_METHOD(closure, 0); RG_DEF_METHOD(accel_path, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-icon-source.c���������������������������������������������0000644�0001750�0001750�00000010706�12102213527�020624� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cIconSource #define _SELF(s) (RVAL2GTKICONSOURCE(s)) static VALUE rg_initialize(VALUE self) { GtkIconSource *icon_source; icon_source = gtk_icon_source_new(); G_INITIALIZE(self, icon_source); return Qnil; } static VALUE rg_direction(VALUE self) { return GTKTEXTDIRECTION2RVAL(gtk_icon_source_get_direction(_SELF(self))); } static VALUE rg_direction_wildcarded_p(VALUE self) { return CBOOL2RVAL(gtk_icon_source_get_direction_wildcarded(_SELF(self))); } static VALUE rg_filename(VALUE self) { return CSTR2RVAL(gtk_icon_source_get_filename(_SELF(self))); } static VALUE rg_pixbuf(VALUE self) { GdkPixbuf *pixbuf; pixbuf = gtk_icon_source_get_pixbuf(_SELF(self)); return pixbuf ? GOBJ2RVAL(pixbuf) : Qnil; } static VALUE rg_size(VALUE self) { return GTKICONSIZE2RVAL(gtk_icon_source_get_size(_SELF(self))); } static VALUE rg_size_wildcarded_p(VALUE self) { return CBOOL2RVAL(gtk_icon_source_get_size_wildcarded(_SELF(self))); } static VALUE rg_state(VALUE self) { return GTKSTATETYPE2RVAL(gtk_icon_source_get_state(_SELF(self))); } static VALUE rg_state_wildcarded_p(VALUE self) { return CBOOL2RVAL(gtk_icon_source_get_state_wildcarded(_SELF(self))); } static VALUE rg_set_direction(VALUE self, VALUE direction) { gtk_icon_source_set_direction(_SELF(self), RVAL2GTKTEXTDIRECTION(direction)); return self; } static VALUE rg_set_direction_wildcarded(VALUE self, VALUE setting) { gtk_icon_source_set_direction_wildcarded(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_set_filename(VALUE self, VALUE filename) { gtk_icon_source_set_filename(_SELF(self), RVAL2CSTR(filename)); return self; } static VALUE rg_set_pixbuf(VALUE self, VALUE pixbuf) { gtk_icon_source_set_pixbuf(_SELF(self), RVAL2GDKPIXBUF(pixbuf)); return self; } static VALUE rg_set_size(VALUE self, VALUE size) { gtk_icon_source_set_size(_SELF(self), RVAL2GTKICONSIZE(size)); return self; } static VALUE rg_set_size_wildcarded(VALUE self, VALUE setting) { gtk_icon_source_set_size_wildcarded(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_set_state(VALUE self, VALUE state) { gtk_icon_source_set_state(_SELF(self), RVAL2GTKSTATETYPE(state)); return self; } static VALUE rg_set_state_wildcarded(VALUE self, VALUE setting) { gtk_icon_source_set_state_wildcarded(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_icon_name(VALUE self) { return CSTR2RVAL(gtk_icon_source_get_icon_name(_SELF(self))); } static VALUE rg_set_icon_name(VALUE self, VALUE icon_name) { gtk_icon_source_set_icon_name(_SELF(self), RVAL2CSTR_ACCEPT_NIL(icon_name)); return self; } void Init_gtk_icon_source(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_SOURCE, "IconSource", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(direction, 0); RG_DEF_METHOD_P(direction_wildcarded, 0); RG_DEF_METHOD(filename, 0); RG_DEF_METHOD(pixbuf, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD_P(size_wildcarded, 0); RG_DEF_METHOD(state, 0); RG_DEF_METHOD_P(state_wildcarded, 0); RG_DEF_METHOD(set_direction, 1); RG_DEF_METHOD(set_direction_wildcarded, 1); RG_DEF_METHOD(set_filename, 1); RG_DEF_METHOD(set_pixbuf, 1); RG_DEF_METHOD(set_size, 1); RG_DEF_METHOD(set_size_wildcarded, 1); RG_DEF_METHOD(set_state, 1); RG_DEF_METHOD(set_state_wildcarded, 1); RG_DEF_METHOD(icon_name, 0); RG_DEF_METHOD(set_icon_name, 1); } ����������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-modelsort.c������������������������������������������0000644�0001750�0001750�00000006747�12102213527�021355� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTreeModelSort #define _SELF(s) (RVAL2GTKTREEMODELSORT(s)) static ID id_model; static VALUE rg_initialize(VALUE self, VALUE model) { G_CHILD_SET(self, id_model, model); G_INITIALIZE(self, gtk_tree_model_sort_new_with_model(RVAL2GTKTREEMODEL(model))); return Qnil; } static VALUE rg_convert_child_path_to_path(VALUE self, VALUE child_path) { return GTKTREEPATH2RVAL(gtk_tree_model_sort_convert_child_path_to_path( _SELF(self), RVAL2GTKTREEPATH(child_path))); } static VALUE rg_convert_child_iter_to_iter(VALUE self, VALUE child_iter) { GtkTreeIter sort_iter; GtkTreeModelSort* modelsort = _SELF(self); gtk_tree_model_sort_convert_child_iter_to_iter(modelsort, &sort_iter, RVAL2GTKTREEITER(child_iter)); sort_iter.user_data3 = gtk_tree_model_sort_get_model(modelsort); return GTKTREEITER2RVAL(&sort_iter); } static VALUE rg_convert_path_to_child_path(VALUE self, VALUE sorted_path) { return GTKTREEPATH2RVAL(gtk_tree_model_sort_convert_path_to_child_path( _SELF(self), RVAL2GTKTREEPATH(sorted_path))); } static VALUE rg_convert_iter_to_child_iter(VALUE self, VALUE sorted_iter) { GtkTreeIter child_iter; GtkTreeModelSort* modelsort = _SELF(self); gtk_tree_model_sort_convert_iter_to_child_iter(modelsort, &child_iter, RVAL2GTKTREEITER(sorted_iter)); child_iter.user_data3 = gtk_tree_model_sort_get_model(modelsort); return GTKTREEITER2RVAL(&child_iter); } static VALUE rg_reset_default_sort_func(VALUE self) { gtk_tree_model_sort_reset_default_sort_func(_SELF(self)); return self; } static VALUE rg_clear_cache(VALUE self) { gtk_tree_model_sort_clear_cache(_SELF(self)); return self; } static VALUE rg_iter_is_valid_p(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_tree_model_sort_iter_is_valid(_SELF(self), RVAL2GTKTREEITER(iter))); } void Init_gtk_tmodelsort(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_MODEL_SORT, "TreeModelSort", mGtk); id_model = rb_intern("model"); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(convert_child_path_to_path, 1); RG_DEF_METHOD(convert_child_iter_to_iter, 1); RG_DEF_METHOD(convert_path_to_child_path, 1); RG_DEF_METHOD(convert_iter_to_child_iter, 1); RG_DEF_METHOD(reset_default_sort_func, 0); RG_DEF_METHOD(clear_cache, 0); RG_DEF_METHOD_P(iter_is_valid, 1); } �������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-style-properties.c����������������������������������������0000644�0001750�0001750�00000006355�12257552167�021756� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cStyleProperties #define _SELF(self) (RVAL2GTKSTYLEPROPERTIES(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_style_properties_new()); return Qnil; } static VALUE rg_clear(VALUE self) { gtk_style_properties_clear(_SELF(self)); return self; } static VALUE rg_get_property(VALUE self, VALUE property, VALUE state) { GValue value = G_VALUE_INIT; gboolean exist; VALUE rb_value = Qnil; exist = gtk_style_properties_get_property(_SELF(self), RVAL2CSTR(property), RVAL2GTKSTATEFLAGS(state), &value); if (exist) { rb_value = GVAL2RVAL_UNSET(&value); } return rb_value; } static VALUE rg_lookup_color(VALUE self, VALUE name) { return GOBJ2RVAL(gtk_style_properties_lookup_color(_SELF(self), RVAL2CSTR(name))); } static VALUE rg_map_color(VALUE self, VALUE name, VALUE color) { gtk_style_properties_map_color(_SELF(self), RVAL2CSTR(name), RVAL2GTKSYMBOLICCOLOR(color)); return self; } static VALUE rg_merge(VALUE self, VALUE other, VALUE replace) { gtk_style_properties_merge(_SELF(self), _SELF(other), RVAL2CBOOL(replace)); return self; } static VALUE rg_set_property(VALUE self, VALUE property, VALUE state, VALUE value) { gtk_style_properties_set_property(_SELF(self), RVAL2CSTR(property), RVAL2GTKSTATEFLAGS(state), RVAL2GVALUE(value)); return self; } static VALUE rg_unset_property(VALUE self, VALUE property, VALUE state) { gtk_style_properties_unset_property(_SELF(self), RVAL2CSTR(property), RVAL2GTKSTATEFLAGS(state)); return self; } void Init_gtk_styleproperties(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_STYLE_PROPERTIES, "StyleProperties", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD(get_property, 2); RG_DEF_METHOD(lookup_color, 1); RG_DEF_METHOD(map_color, 2); RG_DEF_METHOD(merge, 2); RG_DEF_METHOD(set_property, 3); RG_DEF_METHOD(unset_property, 2); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-file-chooser-dialog.c�������������������������������������0000644�0001750�0001750�00000004324�12102213527�022211� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cFileChooserDialog #define _SELF(self) RVAL2GTKFILECHOOSERDIALOG(self) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, rb_title, rb_parent, rb_action, rb_button_ary; const gchar *title; GtkWindow *parent; GtkFileChooserAction action; GtkWidget *dialog; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "title", &rb_title, "parent", &rb_parent, "action", &rb_action, "buttons", &rb_button_ary, NULL); title = RVAL2CSTR_ACCEPT_NIL(rb_title); parent = NIL_P(rb_parent) ? NULL : RVAL2GTKWINDOW(rb_parent); action = NIL_P(rb_action) ? GTK_FILE_CHOOSER_ACTION_OPEN : RVAL2GTKFILECHOOSERACTION(rb_action); dialog = gtk_file_chooser_dialog_new(title, parent, action, NULL, NULL); RBGTK_INITIALIZE(self, dialog); if (!NIL_P(rb_button_ary)) rb_funcall2(self, rb_intern("add_buttons"), RARRAY_LEN(rb_button_ary), RARRAY_PTR(rb_button_ary)); return Qnil; } void Init_gtk_file_chooser_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_DIALOG, "FileChooserDialog", mGtk); RG_DEF_METHOD(initialize, -1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-font-button.c���������������������������������������������0000644�0001750�0001750�00000002745�12102213527�020661� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cFontButton static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE fontname; GtkWidget* widget; rb_scan_args(argc, argv, "01", &fontname); if (NIL_P(fontname)){ widget = gtk_font_button_new(); } else { widget = gtk_font_button_new_with_font(RVAL2CSTR(fontname)); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_fontbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FONT_BUTTON, "FontButton", mGtk); RG_DEF_METHOD(initialize, -1); } ���������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-check-menu-item.c�����������������������������������������0000644�0001750�0001750�00000003753�12102213527�021355� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCheckMenuItem static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, use_underline; GtkWidget *widget = NULL; if (rb_scan_args(argc, argv, "02", &label, &use_underline) > 0) { if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)){ widget = gtk_check_menu_item_new_with_mnemonic(RVAL2CSTR(label)); } else { widget = gtk_check_menu_item_new_with_label(RVAL2CSTR(label)); } } else { widget = gtk_check_menu_item_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_toggled(VALUE self) { gtk_check_menu_item_toggled(RVAL2GTKCHECKMENUITEM(self)); return self; } void Init_gtk_check_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CHECK_MENU_ITEM, "CheckMenuItem", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(toggled, 0); } ���������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-binding-set.c���������������������������������������������0000644�0001750�0001750�00000011231�12257552167�020614� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" /*****************************************/ static GtkBindingSet* gtk_bindingset_copy(const GtkBindingSet* bin) { /* GtkBindingSet should not be copied */ return (GtkBindingSet*)bin; } static void gtk_bindingset_free(G_GNUC_UNUSED GtkBindingSet* bin) { /* GtkBindingSet should not be freed */ } GType gtk_bindingset_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkBindingSet", (GBoxedCopyFunc)gtk_bindingset_copy, (GBoxedFreeFunc)gtk_bindingset_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cBindingSet #define _SELF(s) (RVAL2GTKBINDINGSET(s)) static VALUE rg_initialize(VALUE self, VALUE set_name) { G_INITIALIZE(self, gtk_binding_set_new(RVAL2CSTR(set_name))); return Qnil; } static VALUE rg_s_find(G_GNUC_UNUSED VALUE self, VALUE set_name) { return GTKBINDINGSET2RVAL(gtk_binding_set_find(RVAL2CSTR(set_name))); } static VALUE rg_activate(VALUE self, VALUE keyval, VALUE modifiers, VALUE object) { return CBOOL2RVAL(gtk_binding_set_activate(_SELF(self), NUM2UINT(keyval), RVAL2GDKMODIFIERTYPE(modifiers), RVAL2GOBJ(object))); } static VALUE rg_add_signal(int argc, VALUE *argv, VALUE self) { VALUE keyval, modifiers, signame, rest; long i; VALUE param; GSList *slist, *free_slist; slist = NULL; rb_scan_args(argc, argv, "3*", &keyval, &modifiers, &signame, &rest); for (i = 0; i < RARRAY_LEN(rest); i++) { GtkBindingArg *arg; arg = g_new0 (GtkBindingArg, 1); slist = g_slist_prepend (slist, arg); param = RARRAY_PTR(rest)[i]; if (TYPE(param) == T_FLOAT) { arg->arg_type = G_TYPE_DOUBLE; arg->d.double_data = NUM2DBL(param); } else if (rb_respond_to (param, rb_intern("to_int"))) { arg->arg_type = G_TYPE_LONG; arg->d.long_data = NUM2LONG(param); } else if (param == Qfalse) { arg->arg_type = G_TYPE_LONG; arg->d.long_data = 0; } else if (param == Qtrue) { arg->arg_type = G_TYPE_LONG; arg->d.long_data = 1; } else if (rb_respond_to (param, rb_intern("to_str"))) { arg->arg_type = G_TYPE_STRING; arg->d.string_data = (gchar *)RVAL2CSTR(param); } else { rb_raise(rb_eTypeError, "can not convert %s into String, Numeric, " "GLib::Enum/GLib::Flags or true/false", rb_class2name(CLASS_OF(param))); } } slist = g_slist_reverse (slist); gtk_binding_entry_add_signall (_SELF(self), NUM2UINT(keyval), RVAL2GDKMODIFIERTYPE(modifiers), RVAL2CSTR(signame), slist); free_slist = slist; while (slist) { g_free (slist->data); slist = slist->next; } g_slist_free (free_slist); return self; } static VALUE rg_entry_remove(VALUE self, VALUE keyval, VALUE modifiers) { gtk_binding_entry_remove(_SELF(self), NUM2UINT(keyval), RVAL2GDKMODIFIERTYPE(modifiers)); return self; } static VALUE rg_entry_skip(VALUE self, VALUE keyval, VALUE modifiers) { gtk_binding_entry_skip(_SELF(self), NUM2UINT(keyval), RVAL2GDKMODIFIERTYPE(modifiers)); return self; } void Init_gtk_bindings(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BINDING_SET, "BindingSet", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_SMETHOD(find, 1); RG_DEF_METHOD(activate, 3); RG_DEF_METHOD(add_signal, -1); RG_DEF_ALIAS("entry_add_signal", "add_signal"); RG_DEF_METHOD(entry_remove, 2); RG_DEF_METHOD(entry_skip, 2); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-print-unix-dialog.c���������������������������������������0000644�0001750�0001750�00000005521�12102213527�021747� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #ifdef HAVE_GTK_UNIX_PRINT #include <gtk/gtkunixprint.h> #define RG_TARGET_NAMESPACE cPrintUnixDialog #define _SELF(s) (RVAL2GTKPRINTUNIXDIALOG(s)) #ifndef GTK_TYPE_PRINT_CAPABILITIES # define GTK_TYPE_PRINT_CAPABILITIES (gtk_print_capabilities_get_type()) #endif static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, rb_title, rb_parent; const gchar *title; GtkWindow *parent; GtkWidget *dialog; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "title", &rb_title, "parent", &rb_parent, NULL); title = RVAL2CSTR_ACCEPT_NIL(rb_title); parent = NIL_P(rb_parent) ? NULL : RVAL2GTKWINDOW(rb_parent); dialog = gtk_print_unix_dialog_new(title, parent); RBGTK_INITIALIZE(self, dialog); return Qnil; } static VALUE rg_add_custom_tab(VALUE self, VALUE child, VALUE tab_label) { gtk_print_unix_dialog_add_custom_tab(_SELF(self), RVAL2GTKWIDGET(child), RVAL2GTKWIDGET(tab_label)); return self; } static VALUE rg_set_manual_capability(VALUE self, VALUE rb_capabilities) { GtkPrintCapabilities capabilities; capabilities = RVAL2GTKPRINTCAPABILITIES(rb_capabilities); gtk_print_unix_dialog_set_manual_capabilities(_SELF(self), capabilities); return self; } #endif void Init_gtk_print_unix_dialog(VALUE mGtk) { #ifdef HAVE_GTK_UNIX_PRINT VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_UNIX_DIALOG, "PrintUnixDialog", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(add_custom_tab, 2); RG_DEF_METHOD(set_manual_capability, 1); RG_DEF_ALIAS("settings", "print_settings"); RG_DEF_ALIAS("set_settings", "set_print_settings"); G_DEF_CLASS(GTK_TYPE_PRINT_CAPABILITIES, "Capabilities", RG_TARGET_NAMESPACE); #endif } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-selection.c������������������������������������������0000644�0001750�0001750�00000013312�12102213527�021314� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTreeSelection #define _SELF(s) (RVAL2GTKTREESELECTION(s)) static VALUE rg_set_mode(VALUE self, VALUE type) { gtk_tree_selection_set_mode(_SELF(self), RVAL2GTKSELECTIONMODE(type)); return self; } static VALUE rg_mode(VALUE self) { return GTKSELECTIONMODE2RVAL(gtk_tree_selection_get_mode(_SELF(self))); } static gboolean selection_func(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(selection), GOBJ2RVAL(model), GTKTREEPATH2RVAL(path), CBOOL2RVAL(path_currently_selected))); } static VALUE rg_set_select_function(VALUE self) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_selection_set_select_function(_SELF(self), (GtkTreeSelectionFunc)selection_func, (gpointer)func, NULL); return self; } static VALUE rg_tree_view(VALUE self) { return GOBJ2RVAL(gtk_tree_selection_get_tree_view(_SELF(self))); } static VALUE rg_selected(VALUE self) { GtkTreeIter iter; GtkTreeModel* model; gboolean ret = gtk_tree_selection_get_selected(_SELF(self), &model, &iter); iter.user_data3 = model; return ret ? GTKTREEITER2RVAL(&iter) : Qnil; } static void foreach_func(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) { iter->user_data3 = model; rb_funcall((VALUE)data, id_call, 3, GOBJ2RVAL(model), GTKTREEPATH2RVAL(path), GTKTREEITER2RVAL(iter)); } static VALUE rg_selected_each(VALUE self) { volatile VALUE func = rb_block_proc(); gtk_tree_selection_selected_foreach(_SELF(self), (GtkTreeSelectionForeachFunc)foreach_func, (gpointer)func); return self; } static VALUE rg_select_path(VALUE self, VALUE path) { gtk_tree_selection_select_path(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_unselect_path(VALUE self, VALUE path) { gtk_tree_selection_unselect_path(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_path_is_selected_p(VALUE self, VALUE path) { return CBOOL2RVAL(gtk_tree_selection_path_is_selected(_SELF(self), RVAL2GTKTREEPATH(path))); } static VALUE rg_select_iter(VALUE self, VALUE iter) { gtk_tree_selection_select_iter(_SELF(self), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_unselect_iter(VALUE self, VALUE iter) { gtk_tree_selection_unselect_iter(_SELF(self), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_iter_is_selected_p(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_tree_selection_iter_is_selected(_SELF(self), RVAL2GTKTREEITER(iter))); } static VALUE rg_select_all(VALUE self) { gtk_tree_selection_select_all(_SELF(self)); return self; } static VALUE rg_unselect_all(VALUE self) { gtk_tree_selection_unselect_all(_SELF(self)); return self; } static VALUE rg_select_range(VALUE self, VALUE start_path, VALUE end_path) { gtk_tree_selection_select_range(_SELF(self), RVAL2GTKTREEPATH(start_path), RVAL2GTKTREEPATH(end_path)); return self; } static VALUE rg_selected_rows(VALUE self) { GtkTreeModel* model; GList* list = gtk_tree_selection_get_selected_rows(_SELF(self), &model); VALUE ret = BOXEDGLIST2RVAL(list, GTK_TYPE_TREE_PATH); g_list_foreach(list, (GFunc)gtk_tree_path_free, (gpointer)NULL); g_list_free(list); return ret; } static VALUE rg_count_selected_rows(VALUE self) { return INT2NUM(gtk_tree_selection_count_selected_rows(_SELF(self))); } static VALUE rg_unselect_range(VALUE self, VALUE start_path, VALUE end_path) { gtk_tree_selection_unselect_range(_SELF(self), RVAL2GTKTREEPATH(start_path), RVAL2GTKTREEPATH(end_path)); return self; } void Init_gtk_treeselection(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_SELECTION, "TreeSelection", mGtk); RG_DEF_METHOD(set_mode, 1); RG_DEF_METHOD(mode, 0); RG_DEF_METHOD(set_select_function, 0); RG_DEF_METHOD(tree_view, 0); RG_DEF_METHOD(selected, 0); RG_DEF_METHOD(selected_each, 0); RG_DEF_METHOD(select_path, 1); RG_DEF_METHOD(unselect_path, 1); RG_DEF_METHOD_P(path_is_selected, 1); RG_DEF_METHOD(select_iter, 1); RG_DEF_METHOD(unselect_iter, 1); RG_DEF_METHOD_P(iter_is_selected, 1); RG_DEF_METHOD(select_all, 0); RG_DEF_METHOD(unselect_all, 0); RG_DEF_METHOD(select_range, 2); RG_DEF_METHOD(selected_rows, 0); RG_DEF_METHOD(count_selected_rows, 0); RG_DEF_METHOD(unselect_range, 2); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/init.c����������������������������������������������������������0000644�0001750�0001750�00000002242�12102213526�016225� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2001 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" extern void Init_gtk3(void); void Init_gtk3(void) { Init_gtk(); Init_conversions(); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-spinner.c�������������������������������������������������0000644�0001750�0001750�00000002706�12102213527�020055� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cSpinner #define _SELF(s) (RVAL2GTKSPINNER(s)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_spinner_new()); return Qnil; } static VALUE rg_start(VALUE self) { gtk_spinner_start(_SELF(self)); return self; } static VALUE rg_stop(VALUE self) { gtk_spinner_stop(_SELF(self)); return self; } void Init_gtk_spinner(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SPINNER, "Spinner", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(start, 0); RG_DEF_METHOD(stop, 0); } ����������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-orientable.c����������������������������������������������0000644�0001750�0001750�00000001755�12102213527�020526� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" void Init_gtk_orientable(VALUE mGtk) { G_DEF_INTERFACE(GTK_TYPE_ORIENTABLE, "Orientable", mGtk); } �������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-aspect-frame.c��������������������������������������������0000644�0001750�0001750�00000004057�12102213527�020747� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAspectFrame static VALUE rg_initialize(VALUE self, VALUE label, VALUE xalign, VALUE yalign, VALUE ratio, VALUE obey_child) { RBGTK_INITIALIZE(self, gtk_aspect_frame_new(RVAL2CSTR_ACCEPT_NIL(label), NUM2DBL(xalign), NUM2DBL(yalign), NUM2DBL(ratio), RVAL2CBOOL(obey_child))); return Qnil; } static VALUE rg_set(VALUE self, VALUE xalign, VALUE yalign, VALUE ratio, VALUE obey_child) { gtk_aspect_frame_set(RVAL2GTKASPECTFRAME(self), NUM2DBL(xalign), NUM2DBL(yalign), NUM2DBL(ratio), RVAL2CBOOL(obey_child)); return self; } void Init_gtk_aspect_frame(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ASPECT_FRAME, "AspectFrame", mGtk); RG_DEF_METHOD(initialize, 5); RG_DEF_METHOD(set, 4); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-viewport.c������������������������������������������������0000644�0001750�0001750�00000003001�12102213527�020243� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cViewport static VALUE rg_initialize(VALUE self, VALUE hadj, VALUE vadj) { GtkAdjustment *h_adj = RVAL2GTKADJUSTMENT(hadj); GtkAdjustment *v_adj = RVAL2GTKADJUSTMENT(vadj); RBGTK_INITIALIZE(self, gtk_viewport_new(h_adj, v_adj)); return Qnil; } void Init_gtk_viewport(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VIEWPORT, "Viewport", mGtk); RG_DEF_METHOD(initialize, 2); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-target-list.c���������������������������������������������0000644�0001750�0001750�00000006560�12102213527�020640� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTargetList #define _SELF(r) (RVAL2GTKTARGETLIST(r)) static VALUE rg_initialize(VALUE self, VALUE rbtargets) { long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); GtkTargetList *list = gtk_target_list_new(targets, n); g_free(targets); G_INITIALIZE(self, list); return Qnil; } static VALUE rg_add(VALUE self, VALUE target, VALUE flags, VALUE info) { gtk_target_list_add(_SELF(self), RVAL2ATOM(target), FIX2UINT(flags), FIX2UINT(info)); return self; } static VALUE rg_add_table(VALUE self, VALUE rbtargets) { GtkTargetList *list = _SELF(self); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_target_list_add_table(list, targets, n); g_free(targets); return self; } static VALUE rg_add_text_targets(VALUE self, VALUE info) { gtk_target_list_add_text_targets(_SELF(self), NUM2UINT(info)); return self; } static VALUE rg_add_image_targets(VALUE self, VALUE info, VALUE writable) { gtk_target_list_add_image_targets(_SELF(self), NUM2UINT(info), RVAL2CBOOL(writable)); return self; } static VALUE rg_add_uri_targets(VALUE self, VALUE info) { gtk_target_list_add_uri_targets(_SELF(self), NUM2UINT(info)); return self; } static VALUE rg_add_rich_text_targets(VALUE self, VALUE info, VALUE deserializable, VALUE buffer) { gtk_target_list_add_rich_text_targets(_SELF(self), NUM2UINT(info), RVAL2CBOOL(deserializable), RVAL2GTKTEXTBUFFER(buffer)); return self; } static VALUE rg_remove(VALUE self, VALUE target) { gtk_target_list_remove(_SELF(self), RVAL2ATOM(target)); return self; } static VALUE rg_find(VALUE self, VALUE target) { guint info; gboolean ret = gtk_target_list_find(_SELF(self), RVAL2ATOM(target), &info); return ret ? INT2NUM(info) : Qnil; } void Init_gtk_target_list(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TARGET_LIST, "TargetList", mGtk); rbgobj_boxed_not_copy_obj(GTK_TYPE_TARGET_LIST); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(add, 3); RG_DEF_METHOD(add_table, 1); RG_DEF_METHOD(add_text_targets, 1); RG_DEF_METHOD(add_image_targets, 2); RG_DEF_METHOD(add_uri_targets, 1); RG_DEF_METHOD(add_rich_text_targets, 3); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(find, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-file-system-error.c���������������������������������������0000644�0001750�0001750�00000003764�12102213527�021774� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005,2006 Ruby-GNOME2 Project Team * Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cFileSystemError void Init_gtk_filesystemerror(VALUE mGtk) { #ifdef GTK_FILE_SYSTEM_ERROR VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_ERROR2(GTK_FILE_SYSTEM_ERROR, "FileSystemError", mGtk, rb_eRuntimeError); rb_define_const(RG_TARGET_NAMESPACE, "NONEXISTENT", INT2NUM(GTK_FILE_SYSTEM_ERROR_NONEXISTENT)); rb_define_const(RG_TARGET_NAMESPACE, "NOT_FOLDER", INT2NUM(GTK_FILE_SYSTEM_ERROR_NOT_FOLDER)); rb_define_const(RG_TARGET_NAMESPACE, "INVALID_URI", INT2NUM(GTK_FILE_SYSTEM_ERROR_INVALID_URI)); rb_define_const(RG_TARGET_NAMESPACE, "BAD_FILENAME", INT2NUM(GTK_FILE_SYSTEM_ERROR_BAD_FILENAME)); rb_define_const(RG_TARGET_NAMESPACE, "FAILED", INT2NUM(GTK_FILE_SYSTEM_ERROR_FAILED)); rb_define_const(RG_TARGET_NAMESPACE, "ALREADY_EXSITS", INT2NUM(GTK_FILE_SYSTEM_ERROR_ALREADY_EXISTS)); #endif } ������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-const.c���������������������������������������������������0000644�0001750�0001750�00000007067�12102213527�017532� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" void Init_gtk_const(VALUE mGtk) { rb_define_const(mGtk, "BINDING_VERSION", rb_ary_new3(3, INT2FIX(RBGTK_MAJOR_VERSION), INT2FIX(RBGTK_MINOR_VERSION), INT2FIX(RBGTK_MICRO_VERSION))); rb_define_const(mGtk, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(GTK_MAJOR_VERSION), INT2FIX(GTK_MINOR_VERSION), INT2FIX(GTK_MICRO_VERSION))); rb_define_const(mGtk, "VERSION", rb_ary_new3(3, INT2FIX(gtk_major_version), INT2FIX(gtk_minor_version), INT2FIX(gtk_micro_version))); rb_define_const(mGtk, "MAJOR_VERSION", INT2FIX(gtk_major_version)); rb_define_const(mGtk, "MINOR_VERSION", INT2FIX(gtk_minor_version)); rb_define_const(mGtk, "MICRO_VERSION", INT2FIX(gtk_micro_version)); rb_define_const(mGtk, "BINARY_AGE", INT2FIX(gtk_binary_age)); rb_define_const(mGtk, "INTERFACE_AGE", INT2FIX(gtk_interface_age)); G_DEF_CLASS(GTK_TYPE_ACCEL_FLAGS, "AccelFlags", mGtk); G_DEF_CLASS(GTK_TYPE_ATTACH_OPTIONS, "AttachOptions", mGtk); G_DEF_CLASS(GTK_TYPE_CORNER_TYPE, "CornerType", mGtk); G_DEF_CLASS(GTK_TYPE_DELETE_TYPE, "DeleteType", mGtk); G_DEF_CLASS(GTK_TYPE_DIRECTION_TYPE, "DirectionType", mGtk); G_DEF_CLASS(GTK_TYPE_EXPANDER_STYLE, "ExpanderStyle", mGtk); G_DEF_CLASS(GTK_TYPE_JUSTIFICATION, "Justification", mGtk); G_DEF_CLASS(GTK_TYPE_MESSAGE_TYPE, "MessageType", mGtk); G_DEF_CLASS(GTK_TYPE_MOVEMENT_STEP, "MovementStep", mGtk); G_DEF_CLASS(GTK_TYPE_ORIENTATION, "Orientation", mGtk); G_DEF_CLASS(GTK_TYPE_PACK_TYPE, "PackType", mGtk); G_DEF_CLASS(GTK_TYPE_PATH_PRIORITY_TYPE, "PathPriorityType", mGtk); G_DEF_CLASS(GTK_TYPE_PATH_TYPE, "PathType", mGtk); G_DEF_CLASS(GTK_TYPE_POLICY_TYPE, "PolicyType", mGtk); G_DEF_CLASS(GTK_TYPE_POSITION_TYPE, "PositionType", mGtk); G_DEF_CLASS(GTK_TYPE_RELIEF_STYLE, "ReliefStyle", mGtk); G_DEF_CLASS(GTK_TYPE_RESIZE_MODE, "ResizeMode", mGtk); G_DEF_CLASS(GTK_TYPE_RESPONSE_TYPE, "ResponseType", mGtk); G_DEF_CLASS(GTK_TYPE_SCROLL_STEP, "ScrollStep", mGtk); G_DEF_CLASS(GTK_TYPE_SCROLL_TYPE, "ScrollType", mGtk); G_DEF_CLASS(GTK_TYPE_SELECTION_MODE, "SelectionMode", mGtk); G_DEF_CLASS(GTK_TYPE_SHADOW_TYPE, "ShadowType", mGtk); G_DEF_CLASS(GTK_TYPE_STATE_FLAGS, "StateFlags", mGtk); G_DEF_CLASS(GTK_TYPE_STATE_TYPE, "StateType", mGtk); /* deprecated G_DEF_CLASS(GTK_TYPE_SUBMENU_DIRECTION, "SubmenuDirection", mGtk); G_DEF_CLASS(GTK_TYPE_SUBMENU_PLACEMENT, "SubmenuPlacement", mGtk); */ G_DEF_CLASS(GTK_TYPE_SORT_TYPE, "SortType", mGtk); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-im-multicontext.c�����������������������������������������0000644�0001750�0001750�00000002774�12102213527�021546� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cIMMulticontext #define _SELF(self) (RVAL2GTKIMMULTICONTEXT(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_im_multicontext_new()); return Qnil; } static VALUE rg_append_menuitems(VALUE self, VALUE menushell) { gtk_im_multicontext_append_menuitems(_SELF(self), RVAL2GTKMENUSHELL(menushell)); return self; } void Init_gtk_im_multicontext(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_IM_MULTICONTEXT, "IMMulticontext", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(append_menuitems, 1); } ����ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-view.c�����������������������������������������������0000644�0001750�0001750�00000055035�12142464343�020321� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTreeView #define _SELF(s) (RVAL2GTKTREEVIEW(s)) static VALUE rb_mGtk; static ID id_model; static ID id_selection; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE model; GtkWidget *widget; if (rb_scan_args(argc, argv, "01", &model) == 1) { G_CHILD_SET(self, id_model, model); widget = gtk_tree_view_new_with_model(RVAL2GTKTREEMODEL(model)); } else { widget = gtk_tree_view_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_selection(VALUE self) { VALUE ret = GOBJ2RVAL(gtk_tree_view_get_selection(_SELF(self))); G_CHILD_SET(self, id_selection, ret); return ret; } static VALUE rg_columns_autosize(VALUE self) { gtk_tree_view_columns_autosize(_SELF(self)); return self; } static VALUE rg_append_column(VALUE self, VALUE column) { G_CHILD_ADD(self, column); return INT2NUM(gtk_tree_view_append_column(_SELF(self), RVAL2GTKTREEVIEWCOLUMN(column))); } static VALUE rg_remove_column(VALUE self, VALUE column) { G_CHILD_REMOVE(self, column); return INT2NUM(gtk_tree_view_remove_column(_SELF(self), RVAL2GTKTREEVIEWCOLUMN(column))); } static void cell_data_func(GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer func) { iter->user_data3 = model; rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(column), GOBJ2RVAL(cell), GOBJ2RVAL(model), GTKTREEITER2RVAL(iter)); } static VALUE rg_insert_column(int argc, VALUE *argv, VALUE self) { VALUE args[4]; rb_scan_args(argc, argv, "22", /* NORMAL ATTRIBUTES DATA_FUNC */ &args[0], /* column position position */ &args[1], /* position title title */ &args[2], /* renderer renderer */ &args[3]); /* attributes */ if (argc == 2) { G_CHILD_ADD(self, args[0]); return INT2NUM(gtk_tree_view_insert_column(_SELF(self), RVAL2GTKTREEVIEWCOLUMN(args[0]), NUM2INT(args[1]))); } else if (argc == 3) { int ret; VALUE func = rb_block_proc(); G_RELATIVE(self, argv[2]); G_RELATIVE(self, func); ret = gtk_tree_view_insert_column_with_data_func(_SELF(self), NUM2INT(args[0]), RVAL2CSTR(args[1]), RVAL2GTKCELLRENDERER(args[2]), (GtkTreeCellDataFunc)cell_data_func, (gpointer)func, NULL); return INT2NUM(ret); } else if (argc == 4) { int i; int col; int ret; const gchar *name; VALUE ary; GtkCellRenderer* renderer = RVAL2GTKCELLRENDERER(args[2]); GtkTreeViewColumn* column = gtk_tree_view_column_new(); Check_Type(args[3], T_HASH); /* TODO: Should this really be done before we know that everything * below worked without error? */ G_CHILD_ADD(self, args[2]); G_CHILD_ADD(self, args[3]); gtk_tree_view_column_set_title(column, RVAL2CSTR(args[1])); gtk_tree_view_column_pack_start(column, renderer, TRUE); ret = gtk_tree_view_insert_column(_SELF(self), column, NUM2INT(args[0])); ary = rb_funcall(args[3], rb_intern("to_a"), 0); for (i = 0; i < RARRAY_LEN(ary); i++) { VALUE val = RARRAY_PTR(RARRAY_PTR(ary)[i])[0]; if (SYMBOL_P(val)) { name = rb_id2name(SYM2ID(val)); } else { name = RVAL2CSTR(val); } col = NUM2INT(RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); gtk_tree_view_column_add_attribute(column, renderer, name, col); } return INT2NUM(ret); } else { rb_raise(rb_eArgError, "Wrong number of arguments: %d", argc); } return Qnil; } static VALUE rg_get_column(VALUE self, VALUE num) { return GOBJ2RVAL(gtk_tree_view_get_column(_SELF(self), NUM2INT(num))); } static VALUE rg_columns(VALUE self) { return GOBJGLIST2RVAL_FREE(gtk_tree_view_get_columns(_SELF(self)), g_list_free, NULL); } static VALUE rg_move_column_after(VALUE self, VALUE column, VALUE base_column) { gtk_tree_view_move_column_after(_SELF(self), RVAL2GTKTREEVIEWCOLUMN(column), NIL_P(base_column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(base_column)); return self; } static gboolean column_drop_func(GtkTreeView *treeview, GtkTreeViewColumn *column, GtkTreeViewColumn *prev_column, GtkTreeViewColumn *next_column, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(treeview), GOBJ2RVAL(column), GOBJ2RVAL(prev_column), GOBJ2RVAL(next_column))); } static VALUE rg_set_column_drag_function(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_view_set_column_drag_function(_SELF(self), (GtkTreeViewColumnDropFunc)column_drop_func, (gpointer)func, NULL); return self; } static VALUE rg_scroll_to_point(VALUE self, VALUE x, VALUE y) { gtk_tree_view_scroll_to_point(_SELF(self), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_scroll_to_cell(VALUE self, VALUE path, VALUE column, VALUE use_align, VALUE row_align, VALUE col_align) { gtk_tree_view_scroll_to_cell(_SELF(self), NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path), NIL_P(column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(column), RVAL2CBOOL(use_align), NUM2DBL(row_align), NUM2DBL(col_align)); return self; } static VALUE rg_set_cursor(VALUE self, VALUE path, VALUE focus_column, VALUE start_editing) { gtk_tree_view_set_cursor(_SELF(self), RVAL2GTKTREEPATH(path), NIL_P(focus_column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(focus_column), RVAL2CBOOL(start_editing)); return self; } static VALUE rg_cursor(VALUE self) { GtkTreePath* path; GtkTreeViewColumn* focus_column; gtk_tree_view_get_cursor(_SELF(self), &path, &focus_column); return rb_ary_new3(2, path ? GTKTREEPATH2RVAL(path) : Qnil, GOBJ2RVAL(focus_column)); } static VALUE rg_expand_all(VALUE self) { gtk_tree_view_expand_all(_SELF(self)); return self; } static VALUE rg_collapse_all(VALUE self) { gtk_tree_view_collapse_all(_SELF(self)); return self; } static VALUE rg_expand_row(VALUE self, VALUE path, VALUE open_all) { return CBOOL2RVAL(gtk_tree_view_expand_row(_SELF(self), RVAL2GTKTREEPATH(path), RVAL2CBOOL(open_all))); } static VALUE rg_expand_to_path(VALUE self, VALUE path) { gtk_tree_view_expand_to_path(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_collapse_row(VALUE self, VALUE path) { return CBOOL2RVAL(gtk_tree_view_collapse_row(_SELF(self), RVAL2GTKTREEPATH(path))); } static void mapping_func(GtkTreeView *treeview, GtkTreePath *path, gpointer func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(treeview), GTKTREEPATH2RVAL(path)); } static VALUE rg_map_expanded_rows(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_view_map_expanded_rows(_SELF(self), (GtkTreeViewMappingFunc)mapping_func, (gpointer)func); return self; } static VALUE rg_row_expanded_p(VALUE self, VALUE path) { return CBOOL2RVAL(gtk_tree_view_row_expanded(_SELF(self), RVAL2GTKTREEPATH(path))); } static VALUE rg_get_path_at_pos(VALUE self, VALUE x, VALUE y) { GtkTreePath* path; GtkTreeViewColumn* column; gint cell_x, cell_y; gboolean ret; ret = gtk_tree_view_get_path_at_pos(_SELF(self), NUM2INT(x), NUM2INT(y), &path, &column, &cell_x, &cell_y); return ret ? rb_ary_new3(4, path ? GTKTREEPATH2RVAL(path) : Qnil, column ? GOBJ2RVAL(column) : Qnil, INT2NUM(cell_x), INT2NUM(cell_y)) : Qnil; } static VALUE rg_get_cell_area(VALUE self, VALUE path, VALUE column) { GdkRectangle rect; gtk_tree_view_get_cell_area(_SELF(self), NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path), NIL_P(column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(column), &rect); return GDKRECTANGLE2RVAL(&rect); } static VALUE rg_get_background_area(VALUE self, VALUE path, VALUE column) { GdkRectangle rect; gtk_tree_view_get_background_area(_SELF(self), NIL_P(path) ? NULL : RVAL2GTKTREEPATH(path), NIL_P(column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(column), &rect); return GDKRECTANGLE2RVAL(&rect); } static VALUE rg_visible_rect(VALUE self) { GdkRectangle rect; gtk_tree_view_get_visible_rect(_SELF(self), &rect); return GDKRECTANGLE2RVAL(&rect); } static VALUE rg_visible_range(VALUE self) { GtkTreePath* start_path; GtkTreePath* end_path; gboolean valid_paths = gtk_tree_view_get_visible_range(_SELF(self), &start_path, &end_path); return valid_paths ? rb_assoc_new(GTKTREEPATH2RVAL(start_path), GTKTREEPATH2RVAL(end_path)) : Qnil; } static VALUE rg_bin_window(VALUE self) { return GOBJ2RVAL(gtk_tree_view_get_bin_window(_SELF(self))); } static VALUE rg_convert_bin_window_to_tree_coords(VALUE self, VALUE bx, VALUE by) { gint tx, ty; gtk_tree_view_convert_bin_window_to_tree_coords(_SELF(self), NUM2INT(bx), NUM2INT(by), &tx, &ty); return rb_ary_new3(2, INT2NUM(tx), INT2NUM(ty)); } static VALUE rg_convert_bin_window_to_widget_coords(VALUE self, VALUE bx, VALUE by) { gint wx, wy; gtk_tree_view_convert_bin_window_to_widget_coords(_SELF(self), NUM2INT(bx), NUM2INT(by), &wx, &wy); return rb_ary_new3(2, INT2NUM(wx), INT2NUM(wy)); } static VALUE rg_convert_tree_to_bin_window_coords(VALUE self, VALUE tx, VALUE ty) { gint bx, by; gtk_tree_view_convert_tree_to_bin_window_coords(_SELF(self), NUM2INT(tx), NUM2INT(ty), &bx, &by); return rb_ary_new3(2, INT2NUM(bx), INT2NUM(by)); } static VALUE rg_convert_tree_to_widget_coords(VALUE self, VALUE tx, VALUE ty) { gint wx, wy; gtk_tree_view_convert_tree_to_widget_coords(_SELF(self), NUM2INT(tx), NUM2INT(ty), &wx, &wy); return rb_ary_new3(2, INT2NUM(wx), INT2NUM(wy)); } static VALUE rg_convert_widget_to_bin_window_coords(VALUE self, VALUE wx, VALUE wy) { gint bx, by; gtk_tree_view_convert_widget_to_bin_window_coords(_SELF(self), NUM2INT(wx), NUM2INT(wy), &bx, &by); return rb_ary_new3(2, INT2NUM(bx), INT2NUM(by)); } static VALUE rg_convert_widget_to_tree_coords(VALUE self, VALUE wx, VALUE wy) { gint tx, ty; gtk_tree_view_convert_widget_to_tree_coords(_SELF(self), NUM2INT(wx), NUM2INT(wy), &tx, &ty); return rb_ary_new3(2, INT2NUM(tx), INT2NUM(ty)); } static VALUE rg_enable_model_drag_dest(VALUE self, VALUE rbtargets, VALUE rbactions) { GtkTreeView *view = _SELF(self); GdkDragAction actions = RVAL2GDKDRAGACTION(rbactions); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_tree_view_enable_model_drag_dest(view, targets, n, actions); g_free(targets); return self; } static VALUE rg_enable_model_drag_source(VALUE self, VALUE rbstart_button_mask, VALUE rbtargets, VALUE rbactions) { GtkTreeView *view = _SELF(self); GdkModifierType start_button_mask = RVAL2GDKMODIFIERTYPE(rbstart_button_mask); GdkDragAction actions = RVAL2GDKDRAGACTION(rbactions); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES_ACCEPT_NIL(rbtargets, &n); if (targets == NULL) return self; gtk_tree_view_enable_model_drag_source(view, start_button_mask, targets, n, actions); g_free(targets); return self; } static VALUE rg_unset_rows_drag_source(VALUE self) { gtk_tree_view_unset_rows_drag_source(_SELF(self)); return self; } static VALUE rg_unset_rows_drag_dest(VALUE self) { gtk_tree_view_unset_rows_drag_dest(_SELF(self)); return self; } static VALUE rg_set_drag_dest_row(VALUE self, VALUE path, VALUE pos) { gtk_tree_view_set_drag_dest_row(_SELF(self), NIL_P(path)?NULL:RVAL2GTKTREEPATH(path), RVAL2GTKTREEVIEWDROPPOSITION(pos)); return self; } static VALUE rg_drag_dest_row(VALUE self) { GtkTreePath* path = NULL; GtkTreeViewDropPosition pos; gtk_tree_view_get_drag_dest_row(_SELF(self), &path, &pos); return rb_ary_new3(2, path ? GTKTREEPATH2RVAL(path) : Qnil, GTKTREEVIEWDROPPOSITION2RVAL(pos)); } static VALUE rg_get_dest_row_at_pos(VALUE self, VALUE drag_x, VALUE drag_y) { GtkTreePath* path; GtkTreeViewDropPosition pos; gboolean ret; ret = gtk_tree_view_get_dest_row_at_pos(_SELF(self), NUM2INT(drag_x), NUM2INT(drag_y), &path, &pos); return ret ? rb_ary_new3(2, path ? GTKTREEPATH2RVAL(path) : Qnil, GTKTREEVIEWDROPPOSITION2RVAL(pos)) : Qnil; } static VALUE rg_create_row_drag_icon(VALUE self, VALUE path) { return GOBJ2RVAL(gtk_tree_view_create_row_drag_icon(_SELF(self), RVAL2GTKTREEPATH(path))); } /* We don't need this. GtkTreeViewSearchEqualFunc gtk_tree_view_get_search_equal_func (GtkTreeView *tree_view); */ static gboolean search_equal_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer func) { iter->user_data3 = model; return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(model), INT2NUM(column), CSTR2RVAL(key), GTKTREEITER2RVAL(iter))); } static VALUE rg_set_search_equal_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_view_set_search_equal_func(_SELF(self), (GtkTreeViewSearchEqualFunc)search_equal_func, (gpointer)func, NULL); return self; } /* * Optional Signals */ static VALUE treeview_signal_func(G_GNUC_UNUSED guint num, const GValue *values) { GtkTreeView* view = g_value_get_object(&values[0]); GtkTreeIter* iter = g_value_get_boxed(&values[1]); iter->user_data3 = gtk_tree_view_get_model(view); return rb_ary_new3(3, GOBJ2RVAL(view), GTKTREEITER2RVAL(iter), GVAL2RVAL(&values[2])); } static VALUE rg_set_cursor_on_cell(VALUE self, VALUE path, VALUE focus_column, VALUE focus_cell, VALUE start_editing) { gtk_tree_view_set_cursor_on_cell(_SELF(self), RVAL2GTKTREEPATH(path), NIL_P(focus_column) ? NULL : RVAL2GTKTREEVIEWCOLUMN(focus_column), NIL_P(focus_cell) ? NULL : RVAL2GTKCELLRENDERER(focus_cell), RVAL2CBOOL(start_editing)); return self; } /* How can I implement this? GtkTreeViewRowSeparatorFunc gtk_tree_view_get_row_separator_func (GtkTreeView *tree_view); */ static gboolean row_separator_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer func) { VALUE ret; iter->user_data3 = model; ret = rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(model), GTKTREEITER2RVAL(iter)); return CBOOL2RVAL(ret); } static VALUE rg_set_row_separator_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_view_set_row_separator_func(_SELF(self), row_separator_func, (gpointer)func, (GDestroyNotify)NULL); return self; } static VALUE rg_search_entry(VALUE self) { return GOBJ2RVAL(gtk_tree_view_get_search_entry(_SELF(self))); } static VALUE rg_set_search_entry(VALUE self, VALUE entry) { gtk_tree_view_set_search_entry(_SELF(self), RVAL2GTKENTRY(entry)); return self; } /* Can't define this. GtkTreeViewSearchPositionFunc gtk_tree_view_get_search_position_func (GtkTreeView *tree_view); */ struct callback_arg { VALUE callback; VALUE tree_view; VALUE search_dialog; }; static VALUE invoke_callback(VALUE data) { struct callback_arg *arg = (struct callback_arg *)data; rb_funcall(arg->callback, id_call, 2, arg->tree_view, arg->search_dialog); return Qnil; } static void search_position_func(GtkTreeView *tree_view, GtkWidget *search_dialog, gpointer func) { struct callback_arg arg; arg.callback = (VALUE)func; arg.tree_view = GOBJ2RVAL(tree_view); arg.search_dialog = GOBJ2RVAL(search_dialog); G_PROTECT_CALLBACK(invoke_callback, &arg); } static void remove_callback_reference(gpointer data) { G_CHILD_REMOVE(rb_mGtk, (VALUE)data); } static VALUE rg_set_search_position_func(VALUE self) { VALUE func = rb_block_proc(); G_CHILD_ADD(rb_mGtk, func); gtk_tree_view_set_search_position_func(_SELF(self), (GtkTreeViewSearchPositionFunc)search_position_func, (gpointer)func, (GDestroyNotify)remove_callback_reference); return self; } void Init_gtk_treeview(VALUE mGtk) { rb_mGtk = mGtk; VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_VIEW, "TreeView", mGtk); id_selection = rb_intern("selection"); id_model = rb_intern("model"); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(selection, 0); RG_DEF_METHOD(columns_autosize, 0); RG_DEF_METHOD(append_column, 1); RG_DEF_METHOD(remove_column, 1); RG_DEF_METHOD(insert_column, -1); RG_DEF_METHOD(get_column, 1); RG_DEF_METHOD(columns, 0); RG_DEF_METHOD(move_column_after, 2); RG_DEF_METHOD(set_column_drag_function, 0); RG_DEF_METHOD(scroll_to_point, 2); RG_DEF_METHOD(scroll_to_cell, 5); RG_DEF_METHOD(set_cursor, 3); RG_DEF_METHOD(cursor, 0); RG_DEF_METHOD(expand_all, 0); RG_DEF_METHOD(collapse_all, 0); RG_DEF_METHOD(expand_row, 2); RG_DEF_METHOD(collapse_row, 1); RG_DEF_METHOD(expand_to_path, 1); RG_DEF_METHOD(map_expanded_rows, 0); RG_DEF_METHOD_P(row_expanded, 1); RG_DEF_METHOD(get_path_at_pos, 2); RG_DEF_ALIAS("get_path", "get_path_at_pos"); RG_DEF_METHOD(get_cell_area, 2); RG_DEF_METHOD(get_background_area, 2); RG_DEF_METHOD(visible_rect, 0); RG_DEF_METHOD(visible_range, 0); RG_DEF_METHOD(bin_window, 0); RG_DEF_METHOD(convert_bin_window_to_tree_coords, 2); RG_DEF_METHOD(convert_bin_window_to_widget_coords, 2); RG_DEF_METHOD(convert_tree_to_bin_window_coords, 2); RG_DEF_METHOD(convert_tree_to_widget_coords, 2); RG_DEF_METHOD(convert_widget_to_bin_window_coords, 2); RG_DEF_METHOD(convert_widget_to_tree_coords, 2); RG_DEF_METHOD(enable_model_drag_dest, 2); RG_DEF_METHOD(enable_model_drag_source, 3); RG_DEF_METHOD(unset_rows_drag_source, 0); RG_DEF_METHOD(unset_rows_drag_dest, 0); RG_DEF_METHOD(set_drag_dest_row, 2); RG_DEF_METHOD(drag_dest_row, 0); RG_DEF_METHOD(get_dest_row_at_pos, 2); RG_DEF_ALIAS("get_dest_row", "get_dest_row_at_pos"); RG_DEF_METHOD(create_row_drag_icon, 1); RG_DEF_METHOD(set_search_equal_func, 0); RG_DEF_METHOD(set_cursor_on_cell, 4); RG_DEF_METHOD(set_row_separator_func, 0); RG_DEF_METHOD(search_entry, 0); RG_DEF_METHOD(set_search_entry, 1); RG_DEF_METHOD(set_search_position_func, 0); G_DEF_CLASS(GTK_TYPE_TREE_VIEW_DROP_POSITION, "DropPosition", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_TREE_VIEW_GRID_LINES, "GridLines", RG_TARGET_NAMESPACE); /* Option Signals */ G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row-collapsed", (GValToRValSignalFunc)treeview_signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row-expanded", (GValToRValSignalFunc)treeview_signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "test-collapse-row", (GValToRValSignalFunc)treeview_signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "test-expand-row", (GValToRValSignalFunc)treeview_signal_func); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-dragsource.c�����������������������������������������0000644�0001750�0001750�00000002037�12102213527�021467� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" void Init_gtk_treedragsource(VALUE mGtk) { G_DEF_INTERFACE(GTK_TYPE_TREE_DRAG_SOURCE, "TreeDragSource", mGtk); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-text-buffer.c���������������������������������������������0000644�0001750�0001750�00000070016�12102213527�020631� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTextBuffer #define _SELF(s) (RVAL2GTKTEXTBUFFER(s)) static VALUE rb_mGtk; #define RVAL2ITER(self, position) RVAL2GTKTEXTITER(rg_get_iter_at(self, position)) #define RVAL2STARTITER(self, iter, out) \ rval2iter_with_default(&(self), &(iter), &(out), gtk_text_buffer_get_start_iter) #define RVAL2ENDITER(self, iter, out) \ rval2iter_with_default(&(self), &(iter), &(out), gtk_text_buffer_get_end_iter) static VALUE rg_get_iter_at(VALUE self, VALUE position) { GtkTextIter iter; switch (TYPE(position)) { case T_HASH: { VALUE line, offset, index, mark, anchor; rbg_scan_options(position, "line", &line, "offset", &offset, "index", &index, "mark", &mark, "anchor", &anchor, NULL); if (!NIL_P(line)) if (!NIL_P(offset)) gtk_text_buffer_get_iter_at_line_offset(_SELF(self), &iter, NUM2INT(line), NUM2INT(offset)); else if (!NIL_P(index)) gtk_text_buffer_get_iter_at_line_index(_SELF(self), &iter, NUM2INT(line), NUM2INT(index)); else gtk_text_buffer_get_iter_at_line(_SELF(self), &iter, NUM2INT(line)); else if (!NIL_P(offset)) gtk_text_buffer_get_iter_at_offset(_SELF(self), &iter, NUM2INT(offset)); else if (!NIL_P(mark)) gtk_text_buffer_get_iter_at_mark(_SELF(self), &iter, RVAL2GTKTEXTMARK(mark)); else if (!NIL_P(anchor)) gtk_text_buffer_get_iter_at_child_anchor(_SELF(self), &iter, RVAL2GTKTEXTCHILDANCHOR(anchor)); else rb_raise(rb_eArgError, "Invalid arguments."); break; } case T_FIXNUM: { gtk_text_buffer_get_iter_at_offset(_SELF(self), &iter, NUM2INT(position)); break; } default: { GType gtype = RVAL2GTYPE(position); if (g_type_is_a(gtype, GTK_TYPE_TEXT_ITER)) return position; else if (g_type_is_a(gtype, GTK_TYPE_TEXT_MARK)) gtk_text_buffer_get_iter_at_mark(_SELF(self), &iter, RVAL2GTKTEXTMARK(position)); else if (g_type_is_a(gtype, GTK_TYPE_TEXT_CHILD_ANCHOR)) gtk_text_buffer_get_iter_at_child_anchor(_SELF(self), &iter, RVAL2GTKTEXTCHILDANCHOR(position)); else rb_raise(rb_eArgError, "Invalid arguments."); break; } } return GTKTEXTITER2RVAL(&iter); } static GtkTextIter * rval2iter_with_default(VALUE *self, VALUE *iter, GtkTextIter *out, void (*default_func)(GtkTextBuffer *, GtkTextIter *)) { if (NIL_P(*iter)) { default_func(_SELF(*self), out); return out; } else { return RVAL2ITER(*self, *iter); } } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE table; rb_scan_args(argc, argv, "01", &table); if (NIL_P(table)) G_INITIALIZE(self, gtk_text_buffer_new(NULL)); else { G_CHILD_SET(self, rb_intern("tagtable"), table); G_INITIALIZE(self, gtk_text_buffer_new(RVAL2GTKTEXTTAGTABLE(table))); } return Qnil; } static VALUE rg_line_count(VALUE self) { return INT2NUM(gtk_text_buffer_get_line_count(_SELF(self))); } static VALUE rg_char_count(VALUE self) { return INT2NUM(gtk_text_buffer_get_char_count(_SELF(self))); } static VALUE txt_set_text(VALUE self, VALUE text) { StringValue(text); gtk_text_buffer_set_text(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text)); return self; } static VALUE rg_backspace(VALUE self, VALUE iter, VALUE interactive, VALUE default_editable) { return CBOOL2RVAL(gtk_text_buffer_backspace(_SELF(self), RVAL2ITER(self, iter), RVAL2CBOOL(interactive), RVAL2CBOOL(default_editable))); } static VALUE rg_insert_at_cursor(VALUE self, VALUE text) { StringValue(text); gtk_text_buffer_insert_at_cursor(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text)); return self; } static VALUE rg_insert_interactive(VALUE self, VALUE iter, VALUE text, VALUE editable) { StringValue(text); return CBOOL2RVAL(gtk_text_buffer_insert_interactive(_SELF(self), RVAL2ITER(self, iter), RSTRING_PTR(text), RSTRING_LEN(text), RVAL2CBOOL(editable))); } static VALUE rg_insert_interactive_at_cursor(VALUE self, VALUE text, VALUE editable) { StringValue(text); return CBOOL2RVAL(gtk_text_buffer_insert_interactive_at_cursor(_SELF(self), RSTRING_PTR(text), RSTRING_LEN(text), RVAL2CBOOL(editable))); } static VALUE rg_insert_range(VALUE self, VALUE iter, VALUE start, VALUE end) { gtk_text_buffer_insert_range(_SELF(self), RVAL2ITER(self, iter), RVAL2ITER(self, start), RVAL2ITER(self, end)); return self; } static VALUE rg_insert_range_interactive(VALUE self, VALUE iter, VALUE start, VALUE end, VALUE editable) { return CBOOL2RVAL(gtk_text_buffer_insert_range_interactive(_SELF(self), RVAL2ITER(self, iter), RVAL2ITER(self, start), RVAL2ITER(self, end), RVAL2CBOOL(editable))); } static VALUE rg_delete(int argc, VALUE *argv, VALUE self) { VALUE start, end; GtkTextIter start_iter, end_iter; rb_scan_args(argc, argv, "02", &start, &end); gtk_text_buffer_delete(_SELF(self), RVAL2STARTITER(self, start, start_iter), RVAL2ENDITER(self, end, end_iter)); return self; } static VALUE rg_delete_interactive(int argc, VALUE *argv, VALUE self) { VALUE start, end, editable; GtkTextIter start_iter, end_iter; rb_scan_args(argc, argv, "03", &start, &end, &editable); return CBOOL2RVAL(gtk_text_buffer_delete_interactive(_SELF(self), RVAL2STARTITER(self, start, start_iter), RVAL2ENDITER(self, end, end_iter), RVAL2CBOOL(editable))); } static VALUE rg_get_text(int argc, VALUE *argv, VALUE self) { VALUE start, end, include_hidden_chars; GtkTextIter start_iter, end_iter; gchar* ret; rb_scan_args(argc, argv, "03", &start, &end, &include_hidden_chars); ret = gtk_text_buffer_get_text(_SELF(self), RVAL2STARTITER(self, start, start_iter), RVAL2ENDITER(self, end, end_iter), RVAL2CBOOL(include_hidden_chars)); return CSTR2RVAL_FREE(ret); } static VALUE txt_get_text_all(VALUE self) { return rg_get_text(0, NULL, self); } static VALUE rg_get_slice(int argc, VALUE *argv, VALUE self) { VALUE start, end, include_hidden_chars; GtkTextIter start_iter, end_iter; gchar* ret; rb_scan_args(argc, argv, "03", &start, &end, &include_hidden_chars); ret = gtk_text_buffer_get_slice(_SELF(self), RVAL2STARTITER(self, start, start_iter), RVAL2ENDITER(self, end, end_iter), RVAL2CBOOL(include_hidden_chars)); return CSTR2RVAL_FREE(ret); } static VALUE rg_slice(VALUE self) { return rg_get_slice(0, NULL, self); } static VALUE rg_create_child_anchor(VALUE self, VALUE iter) { VALUE ret = GOBJ2RVAL(gtk_text_buffer_create_child_anchor(_SELF(self), RVAL2ITER(self, iter))); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_create_mark(VALUE self, VALUE name, VALUE where, VALUE left_gravity) { VALUE ret = GOBJ2RVAL(gtk_text_buffer_create_mark(_SELF(self), RVAL2CSTR_ACCEPT_NIL(name), RVAL2ITER(self, where), RVAL2CBOOL(left_gravity))); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_add_mark(VALUE self, VALUE mark, VALUE where) { gtk_text_buffer_add_mark(_SELF(self), RVAL2GTKTEXTMARK(mark), RVAL2ITER(self, where)); return self; } static VALUE rg_delete_mark(VALUE self, VALUE mark) { if (rb_obj_is_kind_of(mark, GTYPE2CLASS(GTK_TYPE_TEXT_MARK))){ G_CHILD_REMOVE(self, mark); gtk_text_buffer_delete_mark(_SELF(self), RVAL2GTKTEXTMARK(mark)); } else { G_CHILD_REMOVE(self, GOBJ2RVAL(gtk_text_buffer_get_mark(_SELF(self), RVAL2CSTR(mark)))); gtk_text_buffer_delete_mark_by_name(_SELF(self), RVAL2CSTR(mark)); } return self; } static VALUE rg_get_mark(VALUE self, VALUE name) { return GOBJ2RVAL(gtk_text_buffer_get_mark(_SELF(self), RVAL2CSTR(name))); } /* static VALUE rg_get_insert(VALUE self) { return GOBJ2RVAL(gtk_text_buffer_get_insert(_SELF(self))); } */ static VALUE rg_selection_bound(VALUE self) { return GOBJ2RVAL(gtk_text_buffer_get_selection_bound(_SELF(self))); } static VALUE rg_place_cursor(VALUE self, VALUE where) { gtk_text_buffer_place_cursor(_SELF(self), RVAL2ITER(self, where)); return self; } static VALUE rg_select_range(VALUE self, VALUE ins, VALUE bound) { gtk_text_buffer_select_range(_SELF(self), RVAL2ITER(self, ins), RVAL2ITER(self, bound)); return self; } static VALUE rg_modified_p(VALUE self) { return CBOOL2RVAL(gtk_text_buffer_get_modified(_SELF(self))); } static VALUE rg_set_modified(VALUE self, VALUE setting) { gtk_text_buffer_set_modified(_SELF(self), RVAL2CBOOL(setting)); return setting; } static VALUE rg_add_selection_clipboard(VALUE self, VALUE clipboard) { G_CHILD_ADD(self, clipboard); gtk_text_buffer_add_selection_clipboard(_SELF(self), RVAL2GTKCLIPBOARD(clipboard)); return self; } static VALUE rg_remove_selection_clipboard(VALUE self, VALUE clipboard) { G_CHILD_REMOVE(self, clipboard); gtk_text_buffer_remove_selection_clipboard(_SELF(self), RVAL2GTKCLIPBOARD(clipboard)); return self; } static VALUE rg_deserialize(VALUE self, VALUE content_buffer, VALUE format, VALUE iter, VALUE data) { GError* error = NULL; gboolean ret; StringValue(data); ret = gtk_text_buffer_deserialize(_SELF(self), _SELF(content_buffer), RVAL2ATOM(format), RVAL2ITER(self, iter), (const guint8*)RSTRING_PTR(data), (gsize)RSTRING_LEN(data), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_deserialize_can_create_tags_p(VALUE self, VALUE format) { return CBOOL2RVAL(gtk_text_buffer_deserialize_get_can_create_tags(_SELF(self), RVAL2ATOM(format))); } static VALUE rg_deserialize_set_can_create_tags(VALUE self, VALUE format, VALUE can_create_tags) { gtk_text_buffer_deserialize_set_can_create_tags(_SELF(self), RVAL2ATOM(format), RVAL2CBOOL(can_create_tags)); return self; } static VALUE rg_deserialize_formats(VALUE self) { gint i; gint n_formats; GdkAtom* atoms = gtk_text_buffer_get_deserialize_formats(_SELF(self), &n_formats); VALUE ary = rb_ary_new(); for (i = 0; i < n_formats; i++){ rb_ary_push(ary, GDKATOM2RVAL(atoms[i])); } return ary; } static VALUE rg_serialize_formats(VALUE self) { gint i; gint n_formats; GdkAtom* atoms = gtk_text_buffer_get_serialize_formats(_SELF(self), &n_formats); VALUE ary = rb_ary_new(); for (i = 0; i < n_formats; i++){ rb_ary_push(ary, GDKATOM2RVAL(atoms[i])); } return ary; } struct callback_arg { VALUE callback; int argc; VALUE *argv; }; static VALUE invoke_callback(VALUE data) { struct callback_arg *arg = (struct callback_arg *)data; return rb_funcall2(arg->callback, id_call, arg->argc, arg->argv); } static gboolean deserialize_func(GtkTextBuffer *register_buffer, GtkTextBuffer *content_buffer, GtkTextIter *iter, const guint8 *data, gsize length, gboolean create_tags, gpointer func, G_GNUC_UNUSED GError **error) { VALUE result; VALUE argv[5]; struct callback_arg arg; argv[0] = GOBJ2RVAL(register_buffer); argv[1] = GOBJ2RVAL(content_buffer); argv[2] = GTKTEXTITER2RVAL(iter); argv[3] = RBG_STRING_SET_UTF8_ENCODING(rb_str_new((char*)data, length)); argv[4] = CBOOL2RVAL(create_tags); arg.callback = (VALUE)func; arg.argc = 5; arg.argv = argv; result = G_PROTECT_CALLBACK(invoke_callback, &arg); return NIL_P(rb_errinfo()) ? RVAL2CBOOL(result) : FALSE; } static void remove_callback_reference(gpointer callback) { G_CHILD_REMOVE(rb_mGtk, (VALUE)callback); } static VALUE rg_register_deserialize_format(VALUE self, VALUE mime_type) { VALUE block = rb_block_proc(); GdkAtom atom; G_CHILD_ADD(rb_mGtk, block); atom = gtk_text_buffer_register_deserialize_format(_SELF(self), (const gchar*)RVAL2CSTR(mime_type), (GtkTextBufferDeserializeFunc)deserialize_func, (gpointer)block, (GDestroyNotify)remove_callback_reference); return GDKATOM2RVAL(atom); } static VALUE rg_register_deserialize_target(VALUE self, VALUE tagset_name) { return GDKATOM2RVAL(gtk_text_buffer_register_deserialize_tagset(_SELF(self), RVAL2CSTR_ACCEPT_NIL(tagset_name))); } static guint8* serialize_func(GtkTextBuffer *register_buffer, GtkTextBuffer *content_buffer, GtkTextIter *start, GtkTextIter *end, gsize *length, gpointer func) { VALUE result; VALUE argv[4]; struct callback_arg arg; argv[0] = GOBJ2RVAL(register_buffer); argv[1] = GOBJ2RVAL(content_buffer); argv[2] = GTKTEXTITER2RVAL(start); argv[3] = GTKTEXTITER2RVAL(end); arg.callback = (VALUE)func; arg.argc = 4; arg.argv = argv; /* This should return data as String */ result = G_PROTECT_CALLBACK(invoke_callback, &arg); StringValue(result); *length = RSTRING_LEN(result); return (guint8*)(NIL_P(rb_errinfo()) ? RSTRING_PTR(result) : NULL); } static VALUE rg_register_serialize_format(VALUE self, VALUE mime_type) { VALUE block = rb_block_proc(); GdkAtom atom; G_CHILD_ADD(rb_mGtk, block); atom = gtk_text_buffer_register_serialize_format(_SELF(self), (const gchar*)RVAL2CSTR(mime_type), (GtkTextBufferSerializeFunc)serialize_func, (gpointer)block, (GDestroyNotify)remove_callback_reference); return GDKATOM2RVAL(atom); } static VALUE rg_register_serialize_target(VALUE self, VALUE tagset_name) { return GDKATOM2RVAL(gtk_text_buffer_register_serialize_tagset(_SELF(self), RVAL2CSTR_ACCEPT_NIL(tagset_name))); } static VALUE rg_serialize(VALUE self, VALUE content_buffer, VALUE format, VALUE start, VALUE end) { gsize length; guint8* ret = gtk_text_buffer_serialize(_SELF(self), _SELF(content_buffer), RVAL2ATOM(format), RVAL2ITER(self, start), RVAL2ITER(self, end), &length); return RBG_STRING_SET_UTF8_ENCODING(rb_str_new((char*)ret, length)); } static VALUE rg_unregister_deserialize_format(VALUE self, VALUE format) { gtk_text_buffer_unregister_deserialize_format(_SELF(self), RVAL2ATOM(format)); return self; } static VALUE rg_unregister_serialize_format(VALUE self, VALUE format) { gtk_text_buffer_unregister_serialize_format(_SELF(self), RVAL2ATOM(format)); return self; } static VALUE rg_cut_clipboard(VALUE self, VALUE clipboard, VALUE default_editable) { G_CHILD_ADD(self, clipboard); gtk_text_buffer_cut_clipboard(_SELF(self), RVAL2GTKCLIPBOARD(clipboard), RVAL2CBOOL(default_editable)); return self; } static VALUE rg_copy_clipboard(VALUE self, VALUE clipboard) { G_CHILD_ADD(self, clipboard); gtk_text_buffer_copy_clipboard(_SELF(self), RVAL2GTKCLIPBOARD(clipboard)); return self; } static VALUE rg_paste_clipboard(VALUE self, VALUE clipboard, VALUE location, VALUE default_editable) { G_CHILD_ADD(self, clipboard); gtk_text_buffer_paste_clipboard(_SELF(self), RVAL2GTKCLIPBOARD(clipboard), NIL_P(location) ? NULL : RVAL2ITER(self, location), RVAL2CBOOL(default_editable)); return self; } static VALUE rg_selection_bounds(VALUE self) { GtkTextIter start, end; gboolean ret = gtk_text_buffer_get_selection_bounds(_SELF(self), &start, &end); return rb_ary_new3(3, GTKTEXTITER2RVAL(&start), GTKTEXTITER2RVAL(&end), CBOOL2RVAL(ret)); } static VALUE rg_delete_selection(int argc, VALUE *argv, VALUE self) { VALUE interactive, default_editable; rb_scan_args(argc, argv, "20", &interactive, &default_editable); return CBOOL2RVAL(gtk_text_buffer_delete_selection(_SELF(self), RVAL2CBOOL(interactive), RVAL2CBOOL(default_editable))); } static VALUE rg_end_user_action(VALUE self) { gtk_text_buffer_end_user_action(_SELF(self)); return self; } static VALUE rg_begin_user_action(VALUE self) { gtk_text_buffer_begin_user_action(_SELF(self)); if (rb_block_given_p()) rb_ensure(rb_yield, self, rg_end_user_action, self); return self; } static VALUE rg_start_iter(VALUE self) { GtkTextIter iter; gtk_text_buffer_get_start_iter(_SELF(self), &iter); return GTKTEXTITER2RVAL(&iter); } static VALUE rg_end_iter(VALUE self) { GtkTextIter iter; gtk_text_buffer_get_end_iter(_SELF(self), &iter); return GTKTEXTITER2RVAL(&iter); } static VALUE rg_move_mark(VALUE self, VALUE mark, VALUE where) { if (rb_obj_is_kind_of(mark, GTYPE2CLASS(GTK_TYPE_TEXT_MARK))) gtk_text_buffer_move_mark(_SELF(self), RVAL2GTKTEXTMARK(mark), RVAL2ITER(self, where)); else gtk_text_buffer_move_mark_by_name(_SELF(self), RVAL2CSTR(mark), RVAL2ITER(self, where)); return self; } static VALUE rg_create_tag(VALUE self, VALUE tag_name, VALUE properties) { GtkTextTag *tag; VALUE ret; tag = gtk_text_tag_new(RVAL2CSTR_ACCEPT_NIL(tag_name)); gtk_text_tag_table_add (gtk_text_buffer_get_tag_table(_SELF(self)), tag); G_SET_PROPERTIES(GOBJ2RVAL(tag), properties); ret = GOBJ2RVAL(tag); G_CHILD_ADD(self, ret); return ret; } static VALUE rg_insert(int argc, VALUE *argv, VALUE self) { VALUE where, value, tags; gint start_offset; GtkTextIter start; int i; rb_scan_args(argc, argv, "2*", &where, &value, &tags); G_CHILD_ADD(self, where); G_CHILD_ADD(self, value); if (rb_obj_is_kind_of(value, GTYPE2CLASS(GDK_TYPE_PIXBUF))){ gtk_text_buffer_insert_pixbuf(_SELF(self), RVAL2ITER(self, where), RVAL2GDKPIXBUF(value)); } else if (rb_obj_is_kind_of(value, GTYPE2CLASS(GTK_TYPE_TEXT_CHILD_ANCHOR))){ gtk_text_buffer_insert_child_anchor(_SELF(self), RVAL2ITER(self, where), RVAL2GTKTEXTCHILDANCHOR(value)); } else { start_offset = gtk_text_iter_get_offset(RVAL2ITER(self, where)); StringValue(value); gtk_text_buffer_insert(_SELF(self), RVAL2ITER(self, where), RSTRING_PTR(value), RSTRING_LEN(value)); if (RARRAY_LEN(tags) == 0) return self; /* TODO: Do we really want to do this before we know that everything * below passed without any errors? */ G_CHILD_ADD(self, tags); gtk_text_buffer_get_iter_at_offset(_SELF(self), &start, start_offset); for(i = 0; i < RARRAY_LEN(tags); i++) { GtkTextTag *tag; if (rb_obj_is_kind_of(RARRAY_PTR(tags)[i], GTYPE2CLASS(GTK_TYPE_TEXT_TAG))) { tag = RVAL2GOBJ(RARRAY_PTR(tags)[i]); } else { tag = gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(_SELF(self)), RVAL2CSTR(RARRAY_PTR(tags)[i])); if (tag == NULL) { g_warning ("%s: no tag with name '%s'!", G_STRLOC, RVAL2CSTR(RARRAY_PTR(tags)[i])); return self; } } gtk_text_buffer_apply_tag(_SELF(self), tag, &start, RVAL2ITER(self, where)); } } return self; } static VALUE rg_apply_tag(int argc, VALUE *argv, VALUE self) { VALUE tag, start, end; GtkTextIter start_iter, end_iter; rb_scan_args(argc, argv, "12", &tag, &start, &end); if (rb_obj_is_kind_of(tag, GTYPE2CLASS(GTK_TYPE_TEXT_TAG))) gtk_text_buffer_apply_tag(_SELF(self), RVAL2GTKTEXTTAG(tag), RVAL2STARTITER(self, start, start_iter), RVAL2ENDITER(self, end, end_iter)); else gtk_text_buffer_apply_tag_by_name(_SELF(self), RVAL2CSTR(tag), RVAL2STARTITER(self, start, start_iter), RVAL2ENDITER(self, end, end_iter)); return self; } static VALUE rg_remove_tag(int argc, VALUE *argv, VALUE self) { VALUE tag, start, end; GtkTextIter start_iter, end_iter; rb_scan_args(argc, argv, "12", &tag, &start, &end); if (rb_obj_is_kind_of(tag, GTYPE2CLASS(GTK_TYPE_TEXT_TAG))) gtk_text_buffer_remove_tag(_SELF(self), RVAL2GTKTEXTTAG(tag), RVAL2STARTITER(self, start, start_iter), RVAL2ENDITER(self, end, end_iter)); else gtk_text_buffer_remove_tag_by_name(_SELF(self), RVAL2CSTR(tag), RVAL2STARTITER(self, start, start_iter), RVAL2ENDITER(self, end, end_iter)); return self; } static VALUE rg_remove_all_tags(int argc, VALUE *argv, VALUE self) { VALUE start, end; GtkTextIter start_iter, end_iter; rb_scan_args(argc, argv, "02", &start, &end); gtk_text_buffer_remove_all_tags(_SELF(self), RVAL2STARTITER(self, start, start_iter), RVAL2ENDITER(self, end, end_iter)); return self; } static VALUE rg_bounds(VALUE self) { GtkTextIter start, end; gtk_text_buffer_get_bounds(_SELF(self), &start, &end); return rb_ary_new3(2, GTKTEXTITER2RVAL(&start), GTKTEXTITER2RVAL(&end)); } void Init_gtk_textbuffer(VALUE mGtk) { rb_mGtk = mGtk; VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_BUFFER, "TextBuffer", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(line_count, 0); RG_DEF_METHOD(char_count, 0); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "text", txt_set_text, 1); RG_DEF_METHOD(insert, -1); RG_DEF_METHOD(backspace, 3); RG_DEF_METHOD(insert_at_cursor, 1); RG_DEF_METHOD(insert_interactive, 3); RG_DEF_METHOD(insert_interactive_at_cursor, 2); RG_DEF_METHOD(insert_range, 3); RG_DEF_METHOD(insert_range_interactive, 4); RG_DEF_METHOD(delete, -1); RG_DEF_METHOD(delete_interactive, -1); RG_DEF_METHOD(get_text, -1); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "text", txt_get_text_all, 0); RG_DEF_METHOD(get_slice, -1); RG_DEF_METHOD(slice, 0); RG_DEF_METHOD(create_child_anchor, 1); RG_DEF_METHOD(create_mark, 3); RG_DEF_METHOD(add_mark, 2); RG_DEF_METHOD(delete_mark, 1); RG_DEF_METHOD(get_mark, 1); /* Comment out because this method's name is very bad. Use Gtk::TextBuffer#get_mark("insert") instead. RG_DEF_METHOD(get_insert, 0); */ RG_DEF_METHOD(selection_bound, 0); RG_DEF_METHOD(place_cursor, 1); RG_DEF_METHOD(select_range, 2); RG_DEF_METHOD_P(modified, 0); RG_DEF_METHOD(set_modified, 1); RG_DEF_METHOD(add_selection_clipboard, 1); RG_DEF_METHOD(remove_selection_clipboard, 1); RG_DEF_METHOD(deserialize, 4); RG_DEF_METHOD_P(deserialize_can_create_tags, 1); RG_DEF_METHOD(deserialize_set_can_create_tags, 2); RG_DEF_METHOD(deserialize_formats, 0); RG_DEF_METHOD(serialize_formats, 0); RG_DEF_METHOD(register_deserialize_format, 1); RG_DEF_METHOD(register_deserialize_target, 1); RG_DEF_METHOD(register_serialize_format, 1); RG_DEF_METHOD(register_serialize_target, 1); RG_DEF_METHOD(serialize, 4); RG_DEF_METHOD(unregister_deserialize_format, 1); RG_DEF_METHOD(unregister_serialize_format, 1); RG_DEF_METHOD(cut_clipboard, 2); RG_DEF_METHOD(copy_clipboard, 1); RG_DEF_METHOD(paste_clipboard, 3); RG_DEF_METHOD(selection_bounds, 0); RG_DEF_METHOD(delete_selection, -1); RG_DEF_METHOD(begin_user_action, 0); RG_DEF_METHOD(end_user_action, 0); RG_DEF_METHOD(start_iter, 0); RG_DEF_METHOD(end_iter, 0); RG_DEF_METHOD(get_iter_at, 1); RG_DEF_METHOD(bounds, 0); RG_DEF_METHOD(move_mark, 2); RG_DEF_METHOD(create_tag, 2); RG_DEF_METHOD(apply_tag, -1); RG_DEF_METHOD(remove_tag, -1); RG_DEF_METHOD(remove_all_tags, -1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-numerable-icon.c������������������������������������������0000644�0001750�0001750�00000003167�12102213527�021301� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cNumerableIcon #define _SELF(self) (RVAL2GTKNUMERABLEICON(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE base_icon, context; GIcon *icon; rb_scan_args(argc, argv, "11", &base_icon, &context); if (NIL_P(context)) icon = gtk_numerable_icon_new(RVAL2GICON(base_icon)); else icon = gtk_numerable_icon_new_with_style_context(RVAL2GICON(base_icon), RVAL2GTKSTYLECONTEXT(context)); G_INITIALIZE(self, icon); return Qnil; } void Init_gtk_numerableicon(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_NUMERABLE_ICON, "NumerableIcon", mGtk); RG_DEF_METHOD(initialize, -1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-toggle-action.c�������������������������������������������0000644�0001750�0001750�00000003744�12102213527�021136� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cToggleAction #define _SELF(self) (RVAL2GTKTOGGLEACTION(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE name, options, label, tooltip, stock_id, buffer; rb_scan_args(argc, argv, "11", &name, &options); rbg_scan_options(options, "label", &label, "tooltip", &tooltip, "stock_id", &stock_id, NULL); G_INITIALIZE(self, gtk_toggle_action_new(RVAL2CSTR(name), RVAL2CSTR_ACCEPT_NIL(label), RVAL2CSTR_ACCEPT_NIL(tooltip), RVAL2GLIBID_ACCEPT_NIL(stock_id, buffer))); return Qnil; } static VALUE rg_toggled(VALUE self) { gtk_toggle_action_toggled(_SELF(self)); return self; } void Init_gtk_toggle_action(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOGGLE_ACTION, "ToggleAction", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(toggled, 0); } ����������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-printer.c�������������������������������������������������0000644�0001750�0001750�00000010046�12102213527�020056� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #ifdef HAVE_GTK_UNIX_PRINT #include <gtk/gtkunixprint.h> #ifndef GTK_TYPE_PRINT_BACKEND #define GTK_TYPE_PRINT_BACKEND (gtk_print_backend_get_type ()) #define GTK_PRINT_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_BACKEND, GtkPrintBackend)) GType gtk_print_backend_get_type (void) G_GNUC_CONST; #endif #define RG_TARGET_NAMESPACE cPrinter #define _SELF(s) (RVAL2GTKPRINTER(s)) static VALUE rb_mGtk; static VALUE rg_initialize(VALUE self, VALUE name, VALUE backend, VALUE rb_virtual) { GtkPrinter *printer; printer = gtk_printer_new(RVAL2CSTR(name), RVAL2GTKPRINTBACKEND(backend), RVAL2CBOOL(rb_virtual)); G_INITIALIZE(self, printer); return Qnil; } static VALUE rg_description(VALUE self) { return CSTR2RVAL(gtk_printer_get_description(_SELF(self))); } static VALUE rg_active_p(VALUE self) { return CBOOL2RVAL(gtk_printer_is_default(_SELF(self))); } static VALUE rg_default_p(VALUE self) { return CBOOL2RVAL(gtk_printer_is_default(_SELF(self))); } static VALUE rg_operator_p_compare(VALUE self, VALUE other) { if (rb_obj_is_kind_of(other, GTYPE2CLASS(GTK_TYPE_PRINTER))){ return INT2NUM(gtk_printer_compare(_SELF(self), _SELF(other))); } else { rb_raise(rb_eTypeError, "%s isn't a kind of Gtk::Printer", rb_class2name(other)); } } struct callback_arg { VALUE callback; int argc; VALUE *argv; }; static VALUE invoke_callback(VALUE data) { struct callback_arg *arg = (struct callback_arg *)data; return rb_funcall2(arg->callback, id_call, arg->argc, arg->argv); } static gboolean each_printer(GtkPrinter *printer, gpointer data) { VALUE result; VALUE argv[1]; struct callback_arg arg; argv[0] = GOBJ2RVAL(printer); arg.callback = (VALUE)data; arg.argc = 1; arg.argv = argv; result = G_PROTECT_CALLBACK(invoke_callback, &arg); return NIL_P(rb_errinfo()) ? TRUE : RVAL2CBOOL(result); } static void remove_callback_reference(gpointer data) { VALUE callback = (VALUE)data; G_CHILD_REMOVE(rb_mGtk, callback); } static VALUE rg_s_each(int argc, VALUE *argv, VALUE self) { VALUE wait, block; rb_scan_args(argc, argv, "01", &wait); block = rb_block_proc(); G_CHILD_ADD(rb_mGtk, block); gtk_enumerate_printers(each_printer, (gpointer)block, remove_callback_reference, RVAL2CBOOL(wait)); return self; } #endif void Init_gtk_printer(VALUE mGtk) { #ifdef HAVE_GTK_UNIX_PRINT rb_mGtk = mGtk; VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINTER, "Printer", mGtk); rb_include_module(RG_TARGET_NAMESPACE, rb_mComparable); G_DEF_CLASS(GTK_TYPE_PRINT_BACKEND, "PrintBackend", mGtk); RG_DEF_SMETHOD(each, -1); RG_DEF_METHOD(initialize, 3); RG_DEF_METHOD(description, 0); RG_DEF_METHOD_P(active, 0); RG_DEF_METHOD_P(default, 0); RG_DEF_METHOD_OPERATOR("<=>", p_compare, 1); G_DEF_CLASS3("GtkPrintBackendCups", "PrintBackendCups", mGtk); G_DEF_CLASS3("GtkPrintBackendFile", "PrintBackendFile", mGtk); G_DEF_CLASS3("GtkPrintBackendLpr", "PrintBackendLpr", mGtk); #endif } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-allocation.c����������������������������������������������0000644�0001750�0001750�00000007372�12124610262�020531� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" static GtkAllocation * gtk_allocation_copy(const GtkAllocation *alloc) { GtkAllocation *result = g_new (GtkAllocation, 1); *result = *alloc; return result; } GType gtk_allocation_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkAllocation", (GBoxedCopyFunc)gtk_allocation_copy, (GBoxedFreeFunc)g_free); return our_type; } #define RG_TARGET_NAMESPACE cAllocation #define _SELF(r) (RVAL2GTKALLOCATION(r)) static VALUE rg_initialize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { GtkAllocation allocation; allocation.x = NUM2INT(x); allocation.y = NUM2INT(y); allocation.width = NUM2INT(width); allocation.height = NUM2INT(height); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_ALLOCATION, &allocation)); return Qnil; } static VALUE rg_intersect(VALUE self, VALUE other) { GtkAllocation dest; gboolean ret = gdk_rectangle_intersect(_SELF(self), _SELF(other), &dest); return ret ? GTKALLOCATION2RVAL(&dest) : Qnil; } static VALUE rg_union(VALUE self, VALUE other) { GtkAllocation dest; gdk_rectangle_union(_SELF(self), _SELF(other), &dest); return GTKALLOCATION2RVAL(&dest); } /* Struct accessors */ static VALUE rg_x(VALUE self) { return INT2NUM(_SELF(self)->x); } static VALUE rg_y(VALUE self) { return INT2NUM(_SELF(self)->y); } static VALUE rg_width(VALUE self) { return INT2NUM(_SELF(self)->width); } static VALUE rg_height(VALUE self) { return INT2NUM(_SELF(self)->height); } static VALUE rg_set_x(VALUE self, VALUE x) { _SELF(self)->x = NUM2INT(x); return self; } static VALUE rg_set_y(VALUE self, VALUE y) { _SELF(self)->y = NUM2INT(y); return self; } static VALUE rg_set_width(VALUE self, VALUE width) { _SELF(self)->width = NUM2INT(width); return self; } static VALUE rg_set_height(VALUE self, VALUE height) { _SELF(self)->height = NUM2INT(height); return self; } static VALUE rg_to_a(VALUE self) { GtkAllocation* a = _SELF(self); return rb_ary_new3(4, INT2FIX(a->x), INT2FIX(a->y), INT2FIX(a->width), INT2FIX(a->height)); } static VALUE rg_to_rect(VALUE self) { return GDKRECTANGLE2RVAL(_SELF(self)); } void Init_gtk_allocation(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ALLOCATION, "Allocation", mGtk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(intersect, 1); RG_DEF_ALIAS("&", "intersect"); RG_DEF_METHOD(union, 1); RG_DEF_ALIAS("|", "union"); RG_DEF_METHOD(x, 0); RG_DEF_METHOD(y, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(set_x, 1); RG_DEF_METHOD(set_y, 1); RG_DEF_METHOD(set_width, 1); RG_DEF_METHOD(set_height, 1); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD(to_rect, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-text-attributes.c�����������������������������������������0000644�0001750�0001750�00000016134�12102213527�021547� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTextAttributes #define _SELF(s) (RVAL2GTKTEXTATTRIBUTES(s)) static VALUE rg_initialize(VALUE self) { GtkTextAttributes *attr; attr = gtk_text_attributes_new(); G_INITIALIZE(self, attr); return Qnil; } static VALUE rg_appearance(VALUE self) { GtkTextAppearance app = _SELF(self)->appearance; return GTKTEXTAPPEARANCE2RVAL(&app); } static VALUE rg_set_appearance(VALUE self, VALUE val) { GtkTextAppearance* app = RVAL2GTKTEXTAPPEARANCE(val); _SELF(self)->appearance = *app; return self; } static VALUE rg_justification(VALUE self) { return GTKJUSTIFICATION2RVAL(_SELF(self)->justification); } static VALUE rg_set_justification(VALUE self, VALUE val) { _SELF(self)->justification = RVAL2GTKJUSTIFICATION(val); return self; } static VALUE rg_direction(VALUE self) { return GTKDIRECTIONTYPE2RVAL(_SELF(self)->direction); } static VALUE rg_set_direction(VALUE self, VALUE val) { _SELF(self)->direction = RVAL2GTKDIRECTIONTYPE(val); return self; } static VALUE rg_font(VALUE self) { VALUE val; if (_SELF(self)->font == NULL) return Qnil; val = PANGOFONTDESCRIPTION2RVAL(_SELF(self)->font); G_CHILD_SET(self, rb_intern("font"), val); return val; } static VALUE rg_set_font(VALUE self, VALUE val) { G_CHILD_SET(self, rb_intern("font"), val); _SELF(self)->font = RVAL2PANGOFONTDESCRIPTION(val); return self; } static VALUE rg_font_scale(VALUE self) { return rb_float_new(_SELF(self)->font_scale); } static VALUE rg_set_font_scale(VALUE self, VALUE val) { _SELF(self)->font_scale = NUM2DBL(val); return self; } static VALUE rg_left_margin(VALUE self) { return INT2NUM(_SELF(self)->left_margin); } static VALUE rg_set_left_margin(VALUE self, VALUE val) { _SELF(self)->left_margin = NUM2INT(val); return self; } static VALUE rg_indent(VALUE self) { return INT2NUM(_SELF(self)->indent); } static VALUE rg_set_indent(VALUE self, VALUE val) { _SELF(self)->indent = NUM2INT(val); return self; } static VALUE rg_right_margin(VALUE self) { return INT2NUM(_SELF(self)->right_margin); } static VALUE rg_set_right_margin(VALUE self, VALUE val) { _SELF(self)->right_margin = NUM2INT(val); return self; } static VALUE rg_pixels_above_lines(VALUE self) { return INT2NUM(_SELF(self)->pixels_above_lines); } static VALUE rg_set_pixels_above_lines(VALUE self, VALUE val) { _SELF(self)->pixels_above_lines = NUM2INT(val); return self; } static VALUE rg_pixels_below_lines(VALUE self) { return INT2NUM(_SELF(self)->pixels_below_lines); } static VALUE rg_set_pixels_below_lines(VALUE self, VALUE val) { _SELF(self)->pixels_below_lines = NUM2INT(val); return self; } static VALUE rg_pixels_inside_wrap(VALUE self) { return INT2NUM(_SELF(self)->pixels_inside_wrap); } static VALUE rg_set_pixels_inside_wrap(VALUE self, VALUE val) { _SELF(self)->pixels_inside_wrap = NUM2INT(val); return self; } static VALUE rg_tabs(VALUE self) { VALUE val; if (_SELF(self)->tabs == NULL) return Qnil; val = PANGOTABARRAY2RVAL(_SELF(self)->tabs); G_CHILD_SET(self, rb_intern("tabs"), val); return val; } static VALUE rg_set_tabs(VALUE self, VALUE val) { G_CHILD_SET(self, rb_intern("tabs"), val); _SELF(self)->tabs = RVAL2PANGOTABARRAY(val); return self; } static VALUE rg_wrap_mode(VALUE self) { return GTKWRAPMODE2RVAL(_SELF(self)->wrap_mode); } static VALUE rg_set_wrap_mode(VALUE self, VALUE val) { _SELF(self)->wrap_mode = RVAL2GTKWRAPMODE(val); return self; } static VALUE rg_language(VALUE self) { VALUE val; if (_SELF(self)->language == NULL) return Qnil; val = PANGOLANGUAGE2RVAL(_SELF(self)->language); G_CHILD_SET(self, rb_intern("language"), val); return val; } static VALUE rg_set_language(VALUE self, VALUE val) { G_CHILD_SET(self, rb_intern("language"), val); _SELF(self)->language = RVAL2PANGOLANGUAGE(val); return self; } static VALUE rg_invisible_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->invisible); } static VALUE rg_set_invisible(VALUE self, VALUE val) { _SELF(self)->invisible = RVAL2CBOOL(val); return self; } static VALUE rg_bg_full_height_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->bg_full_height); } static VALUE rg_set_bg_full_height(VALUE self, VALUE val) { _SELF(self)->bg_full_height = RVAL2CBOOL(val); return self; } static VALUE rg_editable_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->editable); } static VALUE rg_set_editable(VALUE self, VALUE val) { _SELF(self)->editable = RVAL2CBOOL(val); return self; } static VALUE rg_copy_values(VALUE self, VALUE dest) { gtk_text_attributes_copy_values(_SELF(self), _SELF(dest)); return self; } void Init_gtk_text_attributes(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_ATTRIBUTES, "TextAttributes", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(copy_values, 1); RG_DEF_METHOD(appearance, 0); RG_DEF_METHOD(set_appearance, 1); RG_DEF_METHOD(justification, 0); RG_DEF_METHOD(set_justification, 1); RG_DEF_METHOD(direction, 0); RG_DEF_METHOD(set_direction, 1); RG_DEF_METHOD(font, 0); RG_DEF_METHOD(set_font, 1); RG_DEF_METHOD(font_scale, 0); RG_DEF_METHOD(set_font_scale, 1); RG_DEF_METHOD(left_margin, 0); RG_DEF_METHOD(set_left_margin, 1); RG_DEF_METHOD(indent, 0); RG_DEF_METHOD(set_indent, 1); RG_DEF_METHOD(right_margin, 0); RG_DEF_METHOD(set_right_margin, 1); RG_DEF_METHOD(pixels_above_lines, 0); RG_DEF_METHOD(set_pixels_above_lines, 1); RG_DEF_METHOD(pixels_below_lines, 0); RG_DEF_METHOD(set_pixels_below_lines, 1); RG_DEF_METHOD(pixels_inside_wrap, 0); RG_DEF_METHOD(set_pixels_inside_wrap, 1); RG_DEF_METHOD(tabs, 0); RG_DEF_METHOD(set_tabs, 1); RG_DEF_METHOD(wrap_mode, 0); RG_DEF_METHOD(set_wrap_mode, 1); RG_DEF_METHOD(language, 0); RG_DEF_METHOD(set_language, 1); RG_DEF_METHOD_P(invisible, 0); RG_DEF_METHOD(set_invisible, 1); RG_DEF_METHOD_P(bg_full_height, 0); RG_DEF_METHOD(set_bg_full_height, 1); RG_DEF_METHOD_P(editable, 0); RG_DEF_METHOD(set_editable, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-scrolled-window.c�����������������������������������������0000644�0001750�0001750�00000006665�12102213527�021523� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cScrolledWindow #define _SELF(self) (RVAL2GTKSCROLLEDWINDOW(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2; GtkAdjustment *h_adj = NULL; GtkAdjustment *v_adj = NULL; rb_scan_args(argc, argv, "02", &arg1, &arg2); if (!NIL_P(arg1)) h_adj = RVAL2GTKADJUSTMENT(arg1); if (!NIL_P(arg2)) v_adj = RVAL2GTKADJUSTMENT(arg2); RBGTK_INITIALIZE(self, gtk_scrolled_window_new(h_adj, v_adj)); return Qnil; } static VALUE rg_set_policy(VALUE self, VALUE hpolicy, VALUE vpolicy) { gtk_scrolled_window_set_policy(_SELF(self), RVAL2GTKPOLICYTYPE(hpolicy), RVAL2GTKPOLICYTYPE(vpolicy)); return self; } static VALUE rg_policy(VALUE self) { GtkPolicyType hpolicy, vpolicy; gtk_scrolled_window_get_policy(_SELF(self), &hpolicy, &vpolicy); return rb_ary_new3(2, GTKPOLICYTYPE2RVAL(hpolicy), GTKPOLICYTYPE2RVAL(vpolicy)); } static VALUE rg_add_with_viewport(VALUE self, VALUE other) { gtk_scrolled_window_add_with_viewport(_SELF(self), RVAL2GTKWIDGET(other)); G_CHILD_ADD(self, other); return self; } static VALUE rg_hscrollbar(VALUE self) { return GOBJ2RVAL(gtk_scrolled_window_get_hscrollbar(_SELF(self))); } static VALUE rg_vscrollbar(VALUE self) { return GOBJ2RVAL(gtk_scrolled_window_get_vscrollbar(_SELF(self))); } static VALUE rg_set_placement(VALUE self, VALUE corner_type) { gtk_scrolled_window_set_placement(_SELF(self), RVAL2GTKCORNERTYPE(corner_type)); return self; } static VALUE rg_unset_placement(VALUE self) { gtk_scrolled_window_unset_placement(_SELF(self)); return self; } static VALUE rg_placement(VALUE self) { return GTKCORNERTYPE2RVAL(gtk_scrolled_window_get_placement(_SELF(self))); } void Init_gtk_scrolled_window(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SCROLLED_WINDOW, "ScrolledWindow", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_policy, 2); RG_DEF_METHOD(policy, 0); RG_DEF_METHOD(add_with_viewport, 1); RG_DEF_METHOD(hscrollbar, 0); RG_DEF_METHOD(vscrollbar, 0); RG_DEF_METHOD(unset_placement, 0); RG_DEF_METHOD(placement, 0); RG_DEF_METHOD(set_placement, 1); } ���������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-accessible.c����������������������������������������������0000644�0001750�0001750�00000003172�12102213527�020472� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAccessible #define _SELF(self) (RVAL2GTKACCESSIBLE(self)) static VALUE rg_connect_widget_destroyed(VALUE self) { gtk_accessible_connect_widget_destroyed(RVAL2GTKACCESSIBLE(self)); return self; } static VALUE rg_widget(VALUE self) { return GOBJ2RVAL(gtk_accessible_get_widget(_SELF(self))); } static VALUE rg_set_widget(VALUE self, VALUE widget) { gtk_accessible_set_widget(_SELF(self), RVAL2GTKWIDGET(widget)); return self; } void Init_gtk_accessible(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCESSIBLE, "Accessible", mGtk); RG_DEF_METHOD(connect_widget_destroyed, 0); RG_DEF_METHOD(widget, 0); RG_DEF_METHOD(set_widget, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-editable.c������������������������������������������������0000644�0001750�0001750�00000007760�12102213527�020155� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mEditable static VALUE rg_select_region(VALUE self, VALUE start, VALUE end) { gtk_editable_select_region(RVAL2GTKEDITABLE(self), NUM2INT(start), NUM2INT(end)); return self; } static VALUE rg_selection_bounds(VALUE self) { gint start, end; gboolean ret; ret = gtk_editable_get_selection_bounds(RVAL2GTKEDITABLE(self), &start, &end); return ret ? rb_ary_new3(2, INT2NUM(start), INT2NUM(end)) : Qnil; } static VALUE rg_insert_text(VALUE self, VALUE new_text, VALUE pos) { gint p = NUM2INT(pos); StringValue(new_text); gtk_editable_insert_text(RVAL2GTKEDITABLE(self), RSTRING_PTR(new_text), RSTRING_LEN(new_text), &p); return INT2NUM(p); } static VALUE rg_delete_text(VALUE self, VALUE start, VALUE end) { gtk_editable_delete_text(RVAL2GTKEDITABLE(self), NUM2INT(start), NUM2INT(end)); return self; } static VALUE rg_get_chars(VALUE self, VALUE start, VALUE end) { return CSTR2RVAL_FREE( gtk_editable_get_chars(RVAL2GTKEDITABLE(self), /* check s */ NUM2INT(start), NUM2INT(end))); /* check start,end */ } static VALUE rg_delete_selection(VALUE self) { gtk_editable_delete_selection(RVAL2GTKEDITABLE(self)); return self; } static VALUE rg_position(VALUE self) { return INT2NUM(gtk_editable_get_position(RVAL2GTKEDITABLE(self))); } static VALUE rg_set_position(VALUE self, VALUE position) { gtk_editable_set_position(RVAL2GTKEDITABLE(self), NUM2INT(position)); return self; } static VALUE rg_set_editable(VALUE self, VALUE editable) { gtk_editable_set_editable(RVAL2GTKEDITABLE(self), RVAL2CBOOL(editable)); return self; } static VALUE rg_editable_p(VALUE self) { return CBOOL2RVAL(gtk_editable_get_editable(RVAL2GTKEDITABLE(self))); } static VALUE rg_cut_clipboard(VALUE self) { gtk_editable_cut_clipboard(RVAL2GTKEDITABLE(self)); return self; } static VALUE rg_copy_clipboard(VALUE self) { gtk_editable_copy_clipboard(RVAL2GTKEDITABLE(self)); return self; } static VALUE rg_paste_clipboard(VALUE self) { gtk_editable_paste_clipboard(RVAL2GTKEDITABLE(self)); return self; } void Init_gtk_editable(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_EDITABLE, "Editable", mGtk); RG_DEF_METHOD(select_region, 2); RG_DEF_METHOD(selection_bounds, 0); RG_DEF_METHOD(insert_text, 2); RG_DEF_METHOD(delete_text, 2); RG_DEF_METHOD(get_chars, 2); RG_DEF_METHOD(delete_selection, 0); RG_DEF_METHOD(position, 0); RG_DEF_METHOD(set_position, 1); RG_DEF_METHOD(set_editable, 1); RG_DEF_METHOD_P(editable, 0); RG_DEF_METHOD(copy_clipboard, 0); RG_DEF_METHOD(cut_clipboard, 0); RG_DEF_METHOD(paste_clipboard, 0); } ����������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-clip-board.c����������������������������������������������0000644�0001750�0001750�00000025504�12102213527�020414� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2006 Ruby-GNOME2 Project * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cClipboard #define _SELF(s) RVAL2GTKCLIPBOARD(s) static VALUE rg_s_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { GtkClipboard *clipboard; if (argc == 1){ VALUE selection; rb_scan_args(argc, argv, "10", &selection); clipboard = gtk_clipboard_get(RVAL2ATOM(selection)); } else { VALUE display, selection; rb_scan_args(argc, argv, "20", &display, &selection); clipboard = gtk_clipboard_get_for_display(RVAL2GDKDISPLAYOBJECT(display), RVAL2ATOM(selection)); } return GOBJ2RVAL(clipboard); } static VALUE rg_display(VALUE self) { return GOBJ2RVAL(gtk_clipboard_get_display(_SELF(self))); } static void clipboard_get_func(GtkClipboard *clipboard, GtkSelectionData *selection_data, G_GNUC_UNUSED guint info, gpointer func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(clipboard), GTKSELECTIONDATA2RVAL(selection_data)); } struct clipboard_set_args { VALUE self; VALUE targets; VALUE func; }; static VALUE clipboard_set_body(VALUE value) { struct clipboard_set_args *args = (struct clipboard_set_args *)value; GtkClipboard *clipboard = _SELF(args->self); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(args->targets, &n); gboolean result = gtk_clipboard_set_with_data(clipboard, targets, n, (GtkClipboardGetFunc)clipboard_get_func, (GtkClipboardClearFunc)NULL, (gpointer)args->func); g_free(targets); return CBOOL2RVAL(result); } static G_GNUC_NORETURN VALUE clipboard_set_rescue(VALUE value) { struct clipboard_set_args *args = (struct clipboard_set_args *)value; G_CHILD_REMOVE(args->self, args->func); rb_exc_raise(rb_errinfo()); } static VALUE rg_set(VALUE self, VALUE targets) { struct clipboard_set_args args = { self, targets, rb_block_proc() }; G_CHILD_ADD(self, args.func); return rb_rescue(clipboard_set_body, (VALUE)&args, clipboard_set_rescue, (VALUE)&args); } /* Do not implement this. Use Gtk::Clipboard#set_with_data instead. gboolean gtk_clipboard_set_with_owner (GtkClipboard *clipboard, const GtkTargetEntry *targets, guint n_targets, GtkClipboardGetFunc get_func, GtkClipboardClearFunc clear_func, GObject *owner); static VALUE rg_owner(VALUE self) { GObject *gobj; gobj = gtk_clipboard_get_owner(_SELF(self)); return gobj ? GOBJ2RVAL(gobj) : Qnil; } */ static VALUE rg_clear(VALUE self) { gtk_clipboard_clear(_SELF(self)); return self; } static VALUE rg_set_text(VALUE self, VALUE text) { StringValue(text); gtk_clipboard_set_text(_SELF(self), RVAL2CSTR(text), RSTRING_LEN(text)); return self; } static VALUE rg_set_image(VALUE self, VALUE pixbuf) { gtk_clipboard_set_image(_SELF(self), RVAL2GDKPIXBUF(pixbuf)); return self; } static void clipboard_received_func(GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(clipboard), GTKSELECTIONDATA2RVAL(selection_data)); } static VALUE rg_request_contents(VALUE self, VALUE target) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_clipboard_request_contents(_SELF(self), RVAL2ATOM(target), (GtkClipboardReceivedFunc)clipboard_received_func, (gpointer)func); return self; } static void clipboard_text_received_func(GtkClipboard *clipboard, const gchar *text, gpointer func) { VALUE vtext = Qnil; if (text) { vtext = CSTR2RVAL(text); } rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(clipboard), vtext); } static VALUE rg_request_text(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_clipboard_request_text(_SELF(self), (GtkClipboardTextReceivedFunc)clipboard_text_received_func, (gpointer)func); return self; } static void clipboard_image_received_func(GtkClipboard *clipboard, GdkPixbuf *pixbuf, gpointer func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(clipboard), GOBJ2RVAL(pixbuf)); } static VALUE rg_request_image(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_clipboard_request_image(_SELF(self), (GtkClipboardImageReceivedFunc)clipboard_image_received_func, (gpointer)func); return self; } static void clipboard_target_received_func(GtkClipboard *clipboard, GdkAtom *atoms, gint n_atoms, gpointer func) { gint i; VALUE ary = rb_ary_new(); for (i = 0; i < n_atoms; i++){ rb_ary_push(ary, GDKATOM2RVAL(atoms[i])); } rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(clipboard), ary); } static VALUE rg_request_targets(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_clipboard_request_targets(_SELF(self), (GtkClipboardTargetsReceivedFunc)clipboard_target_received_func, (gpointer)func); return self; } static void clipboard_rich_text_received_func(GtkClipboard *clipboard, GdkAtom format, const guint8 *text, gsize length, gpointer func) { rb_funcall((VALUE)func, id_call, 3, GOBJ2RVAL(clipboard), GDKATOM2RVAL(format), rb_str_new((char*)text, length)); } static VALUE rg_request_rich_text(VALUE self, VALUE buffer) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_clipboard_request_rich_text(_SELF(self), RVAL2GTKTEXTBUFFER(buffer), (GtkClipboardRichTextReceivedFunc)clipboard_rich_text_received_func, (gpointer)func); return self; } static VALUE rg_wait_for_contents(VALUE self, VALUE target) { return GTKSELECTIONDATA2RVAL(gtk_clipboard_wait_for_contents(_SELF(self), RVAL2ATOM(target))); } static VALUE rg_wait_for_text(VALUE self) { gchar *str; str = gtk_clipboard_wait_for_text(_SELF(self)); return str ? CSTR2RVAL(str) : Qnil; } static VALUE rg_wait_for_image(VALUE self) { GdkPixbuf* pixbuf = gtk_clipboard_wait_for_image(_SELF(self)); return GOBJ2RVAL(pixbuf); } static VALUE rg_wait_for_rich_text(VALUE self, VALUE buffer) { GdkAtom format; gsize length; guint8* data = gtk_clipboard_wait_for_rich_text(_SELF(self), RVAL2GTKTEXTBUFFER(buffer), &format, &length); if (data){ VALUE str = rb_str_new((char*)data, length); g_free(data); return rb_assoc_new(str, GDKATOM2RVAL(format)); } else { return rb_assoc_new(Qnil, GDKATOM2RVAL(format)); } } static VALUE rg_wait_is_text_available_p(VALUE self) { return CBOOL2RVAL(gtk_clipboard_wait_is_text_available(_SELF(self))); } static VALUE rg_wait_is_image_available_p(VALUE self) { return CBOOL2RVAL(gtk_clipboard_wait_is_image_available(_SELF(self))); } static VALUE rg_wait_is_rich_text_available_p(VALUE self, VALUE buffer) { return CBOOL2RVAL(gtk_clipboard_wait_is_rich_text_available(_SELF(self), RVAL2GTKTEXTBUFFER(buffer))); } static VALUE rg_wait_for_targets(VALUE self) { gint i; VALUE ary = Qnil; GdkAtom* targets; gint n_targets = 0; gboolean ret = gtk_clipboard_wait_for_targets(_SELF(self), &targets, &n_targets); if (ret){ ary = rb_ary_new(); for (i = 0; i < n_targets; i++){ if ((GdkAtom)targets == (GdkAtom)GDK_NONE){ rb_ary_push(ary, rb_eval_string("Gdk::Atom::NONE")); } else rb_ary_push(ary, GDKATOM2RVAL(targets)); targets++; } /* How can I this ? g_free(&o_targets); */ } return ary; } static VALUE rg_wait_is_target_available_p(VALUE self, VALUE target) { return CBOOL2RVAL(gtk_clipboard_wait_is_target_available(_SELF(self), RVAL2ATOM(target))); } static VALUE rg_set_can_store(VALUE self, VALUE rbtargets) { GtkClipboard *clipboard = _SELF(self); long n = 0; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES_ACCEPT_NIL(rbtargets, &n); gtk_clipboard_set_can_store(clipboard, targets, n); g_free(targets); return self; } static VALUE rg_store(VALUE self) { gtk_clipboard_store(_SELF(self)); return self; } void Init_gtk_clipboard(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CLIPBOARD, "Clipboard", mGtk); RG_DEF_SMETHOD(get, -1); RG_DEF_METHOD(display, 0); RG_DEF_METHOD(set, 1); /* RG_DEF_METHOD(owner, 0); */ RG_DEF_METHOD(clear, 0); RG_DEF_METHOD(set_text, 1); RG_DEF_METHOD(set_image, 1); RG_DEF_METHOD(request_contents, 1); RG_DEF_METHOD(request_text, 0); RG_DEF_METHOD(request_image, 0); RG_DEF_METHOD(request_targets, 0); RG_DEF_METHOD(request_rich_text, 1); RG_DEF_METHOD(wait_for_contents, 1); RG_DEF_METHOD(wait_for_text, 0); RG_DEF_METHOD(wait_for_image, 0); RG_DEF_METHOD(wait_for_rich_text, 1); RG_DEF_METHOD_P(wait_is_text_available, 0); RG_DEF_METHOD_P(wait_is_image_available, 0); RG_DEF_METHOD_P(wait_is_rich_text_available, 1); RG_DEF_METHOD(wait_for_targets, 0); RG_DEF_METHOD_P(wait_is_target_available, 1); RG_DEF_METHOD(set_can_store, 1); RG_DEF_METHOD(store, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk3private.h�������������������������������������������������0000644�0001750�0001750�00000033015�12257552170�020074� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGTK3PRIVATE_H__ #define __RBGTK3PRIVATE_H__ #ifdef HAVE_RUBY_ST_H # include <ruby/st.h> #else # include <st.h> #endif #include <rb_cairo.h> #include <cairo-gobject.h> #include <rbgio2.h> #include <rbpango.h> #include <rbgdk-pixbuf.h> #include <rbgdk3.h> #include "rbgtk3.h" #include "rbgtk3util.h" #ifndef HAVE_RB_ERRINFO # define rb_errinfo() (ruby_errinfo) #endif #ifndef G_VALUE_INIT # define G_VALUE_INIT { 0, { { 0 } } } #endif extern ID id_relative_callbacks; extern ID id_call; G_GNUC_INTERNAL void exec_callback(GtkWidget *widget, gpointer proc); typedef void (*rbgtkiter_set_value_func)(void *model, GtkTreeIter *iter, gint column, GValue *value); G_GNUC_INTERNAL void rbgtk_register_treeiter_set_value_func(GType, rbgtkiter_set_value_func); G_GNUC_INTERNAL void rbgtk_atom2selectiondata(VALUE type, VALUE size, VALUE src, GdkAtom* gtype, void** data, gint* format, gint* length); G_GNUC_INTERNAL void rbgtk_atom2selectiondata_free(GdkAtom gtype, void* data); #define RVAL2GTKTARGETENTRIES(value, n) rbgtk_rval2gtktargetentries(value, n) G_GNUC_INTERNAL GtkTargetEntry *rbgtk_rval2gtktargetentries(VALUE value, long *n); #define RVAL2GTKTARGETENTRIES_ACCEPT_NIL(value, n) rbgtk_rval2gtktargetentries_accept_nil(value, n) G_GNUC_INTERNAL GtkTargetEntry *rbgtk_rval2gtktargetentries_accept_nil(VALUE value, long *n); G_GNUC_INTERNAL void Init_gtk_gdk_event(void); G_GNUC_INTERNAL void Init_gtk_drag_gdk_drag_context(void); G_GNUC_INTERNAL void Init_gtk_style_context_gdk_screen(void); G_GNUC_INTERNAL void Init_gtk_tooltip_gdk_display(void); G_GNUC_INTERNAL void Init_gtk(void); G_GNUC_INTERNAL void Init_gtk_aboutdialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accelerator(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accel_group(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accel_group_entry(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accel_key(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accel_label(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accel_map(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_accessible(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_action(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_actiongroup(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_activatable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_adjustment(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_alignment(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_allocation(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_appchooser(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_appchooserbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_appchooserdialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_appchooserwidget(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_application(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_arrow(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_aspect_frame(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_assistant(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_button_box(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_bin(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_bindings(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_border(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_box(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_buildable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_builder(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_calendar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_celleditable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_celllayout(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrenderer(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrendereraccel(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrenderercombo(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrendererpixbuf(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrendererprogress(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrendererspin(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrendererspinner(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrenderertext(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellrenderertoggle(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cellview(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_check_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_check_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_clipboard(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_colorbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_color_selection(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_color_selection_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_combobox(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_comboboxtext(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_const(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_container(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_cssprovider(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_drag(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_drawing_area(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_editable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_entry(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_entrybuffer(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_entry_completion(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_eventbox(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_expander(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_file_chooser(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_filesystemerror(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_filechooserbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_file_chooser_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_file_chooser_widget(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_file_filter(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_fixed(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_fontbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_fontchooser(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_fontchooserdialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_fontchooserwidget(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_frame(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_grid(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_handle_box(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_hsv(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_factory(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_info(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_set(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_size(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_source(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_icon_theme(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_iconview(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_image(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_image_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_imcontext(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_imcontext_simple(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_im_multicontext(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_infobar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_invisible(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_label(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_layout(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_link_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_list_store(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_lockbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_menu(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_menu_bar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_menu_shell(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_menutoolbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_message_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_misc(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_notebook(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_numerableicon(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_orientable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_overlay(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_page_setup(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_page_setup_unix_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_paned(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_paper_size(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_plug(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_context(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_printer(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_job(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_operation(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_operation_preview(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_settings(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_print_unix_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_progress_bar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_radio_action(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_radio_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_radio_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_radiotoolbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_range(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recentaction(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_chooser(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_chooser_dialog(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_chooser_menu(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_chooser_widget(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_data(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_filter(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_filter_info(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_info(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_recent_manager(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_scale(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_scalebutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_scrollable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_scrollbar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_scrolled_window(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_selection(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_selectiondata(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_separator(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_separator_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_separatortoolitem(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_settings(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_size_group(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_socket(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_spin_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_spinner(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_statusbar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_status_icon(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_stock(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_stylecontext(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_styleproperties(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_styleprovider(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_switch(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_table(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_target_list(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_tearoff_menu_item(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_text_appearance(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_text_attributes(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_textbuffer(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_textchild(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_textiter(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_textmark(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_texttag(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_text_tag_table(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_textview(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_themingengine(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toggle_action(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toggle_button(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toggletoolbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toolbar(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toolbutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toolitem(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toolitemgroup(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_toolshell(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_tooltip(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treedragdest(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treedragsource(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treeiter(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treemodel(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treemodelfilter(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_tmodelsort(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treepath(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treerowreference(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treeselection(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treesortable(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_tree_store(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treeview(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_treeviewcolumn(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_uimanager(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_viewport(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_volumebutton(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_widget(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_widgetpath(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_window(VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_windowgroup(VALUE mGtk); G_GNUC_INTERNAL void Init_conversions(void); #endif /* __RBGTK3PRIVATE_H__ */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-widget.c��������������������������������������������������0000644�0001750�0001750�00000116327�12257552167�017710� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cWidget #define _SELF(self) (RVAL2GTKWIDGET(self)) static VALUE style_prop_func_table; static VALUE rg_unparent(VALUE self) { gtk_widget_unparent(_SELF(self)); return self; } static VALUE rg_show(VALUE self) { gtk_widget_show(_SELF(self)); return self; } static VALUE rg_show_now(VALUE self) { gtk_widget_show_now(_SELF(self)); return self; } static VALUE rg_hide(VALUE self) { gtk_widget_hide(_SELF(self)); return self; } static VALUE rg_show_all(VALUE self) { gtk_widget_show_all(_SELF(self)); return self; } static VALUE rg_map(VALUE self) { gtk_widget_map(_SELF(self)); return self; } static VALUE rg_unmap(VALUE self) { gtk_widget_unmap(_SELF(self)); return self; } static VALUE rg_realize(VALUE self) { gtk_widget_realize(_SELF(self)); return self; } static VALUE rg_unrealize(VALUE self) { gtk_widget_unrealize(_SELF(self)); return self; } static VALUE rg_queue_draw(VALUE self) { gtk_widget_queue_draw(_SELF(self)); return self; } static VALUE rg_queue_resize(VALUE self) { gtk_widget_queue_resize(_SELF(self)); return self; } static VALUE rg_queue_resize_no_redraw(VALUE self) { gtk_widget_queue_resize_no_redraw(_SELF(self)); return self; } static VALUE rg_size_allocate(VALUE self, VALUE alloc) { gtk_widget_size_allocate(_SELF(self), RVAL2GTKALLOCATION(alloc)); return self; } static VALUE rg_add_accelerator(VALUE self, VALUE sig, VALUE accel, VALUE key, VALUE mod, VALUE flag) { gtk_widget_add_accelerator(_SELF(self), RVAL2CSTR(sig), RVAL2GTKACCELGROUP(accel), NUM2INT(key), RVAL2GDKMODIFIERTYPE(mod), RVAL2GTKACCELFLAGS(flag)); return self; } static VALUE rg_remove_accelerator(VALUE self, VALUE accel, VALUE key, VALUE mod) { return CBOOL2RVAL(gtk_widget_remove_accelerator(_SELF(self), RVAL2GTKACCELGROUP(accel), NUM2INT(key), RVAL2GDKMODIFIERTYPE(mod))); } static VALUE rg_set_accel_path(VALUE self, VALUE accel_path, VALUE accel_group) { gtk_widget_set_accel_path(_SELF(self), RVAL2CSTR(accel_path), RVAL2GTKACCELGROUP(accel_group)); return self; } static VALUE rg_accel_closures(VALUE self) { return BOXEDGLIST2RVAL_FREE(gtk_widget_list_accel_closures(_SELF(self)), G_TYPE_CLOSURE, g_list_free, NULL); } static VALUE rg_can_activate_accel_p(VALUE self, VALUE signal_id) { return CBOOL2RVAL(gtk_widget_can_activate_accel(_SELF(self), NUM2UINT(signal_id))); } static VALUE rg_event(VALUE self, VALUE event) { return CBOOL2RVAL(gtk_widget_event(_SELF(self), RVAL2GEV(event))); } static VALUE rg_activate(VALUE self) { return CBOOL2RVAL(gtk_widget_activate(_SELF(self))); } static VALUE rg_reparent(VALUE self, VALUE parent) { gtk_widget_reparent(_SELF(self), _SELF(parent)); return self; } static VALUE rg_intersect(VALUE self, VALUE area) { GdkRectangle intersection; gboolean ret = gtk_widget_intersect(_SELF(self), RVAL2GDKRECTANGLE(area), &intersection); return ret ? GDKRECTANGLE2RVAL(&intersection) : Qnil; } static VALUE rg_grab_default(VALUE self) { gtk_widget_grab_default(_SELF(self)); return self; } static VALUE rg_set_parent_window(VALUE self, VALUE parent_window) { gtk_widget_set_parent_window(_SELF(self), RVAL2GDKWINDOW(parent_window)); return self; } static VALUE rg_parent_window(VALUE self) { return GOBJ2RVAL(gtk_widget_get_parent_window(_SELF(self))); } static VALUE rg_add_events(VALUE self, VALUE events) { gtk_widget_add_events(_SELF(self), NUM2INT(events)); return self; } static VALUE rg_toplevel(VALUE self) { return GOBJ2RVAL(gtk_widget_get_toplevel(_SELF(self))); } static VALUE rg_get_ancestor(VALUE self, VALUE klass) { return GOBJ2RVAL(gtk_widget_get_ancestor(_SELF(self), CLASS2GTYPE(klass))); } static VALUE rg_visual(VALUE self) { return GOBJ2RVAL(gtk_widget_get_visual(_SELF(self))); } static VALUE rg_ancestor_p(VALUE self, VALUE ancestor) { return CBOOL2RVAL(gtk_widget_is_ancestor(_SELF(self), _SELF(ancestor))); } static VALUE rg_translate_coordinates(VALUE self, VALUE dest_widget, VALUE src_x, VALUE src_y) { gint dest_x, dest_y; gboolean ret; VALUE result = Qnil; ret = gtk_widget_translate_coordinates(_SELF(self), _SELF(dest_widget), NUM2INT(src_x), NUM2INT(src_y), &dest_x, &dest_y); if (ret) result = rb_ary_new3(2, INT2FIX(dest_x), INT2FIX(dest_y)); return result; } static VALUE rg_hide_on_delete(VALUE self) { return CBOOL2RVAL(gtk_widget_hide_on_delete(_SELF(self))); } static VALUE rg_set_direction(VALUE self, VALUE dir) { gtk_widget_set_direction(_SELF(self), RVAL2GTKTEXTDIRECTION(dir)); return self; } static VALUE rg_direction(VALUE self) { return GTKTEXTDIRECTION2RVAL(gtk_widget_get_direction(_SELF(self))); } static VALUE rg_s_set_default_direction(VALUE self, VALUE dir) { gtk_widget_set_default_direction(RVAL2GTKTEXTDIRECTION(dir)); return self; } static VALUE rg_s_default_direction(G_GNUC_UNUSED VALUE self) { return GTKTEXTDIRECTION2RVAL(gtk_widget_get_default_direction()); } static VALUE rg_composite_name(VALUE self) { return CSTR2RVAL(gtk_widget_get_composite_name(_SELF(self))); } static VALUE rg_create_pango_context(VALUE self) { return GOBJ2RVALU(gtk_widget_create_pango_context(_SELF(self))); } static VALUE rg_pango_context(VALUE self) { return GOBJ2RVAL(gtk_widget_get_pango_context(_SELF(self))); } static VALUE rg_create_pango_layout(int argc, VALUE *argv, VALUE self) { VALUE text; rb_scan_args(argc, argv, "01", &text); return GOBJ2RVALU(gtk_widget_create_pango_layout(_SELF(self), RVAL2CSTR_ACCEPT_NIL(text))); } static VALUE rg_s_pop_composite_child(VALUE self) { gtk_widget_pop_composite_child(); return self; } static VALUE rg_s_push_composite_child(VALUE self) { gtk_widget_push_composite_child(); return self; } static VALUE rg_queue_draw_area(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { gtk_widget_queue_draw_area(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_set_redraw_on_allocate(VALUE self, VALUE redraw_on_allocate) { gtk_widget_set_redraw_on_allocate(_SELF(self), RVAL2CBOOL(redraw_on_allocate)); return self; } static VALUE rg_set_composite_name(VALUE self, VALUE name) { gtk_widget_set_composite_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_mnemonic_activate(VALUE self, VALUE group_cycling) { return CBOOL2RVAL(gtk_widget_mnemonic_activate(_SELF(self), RVAL2CBOOL(group_cycling))); } /* * Gtk::Widget.install_style_property(...) do |spec, str| * #parse str * new_val = .... # parse value from string. * new_val # return new_val or nil if you can't convert the value. * end */ static gboolean rc_property_parser(const GParamSpec *pspec, const GString *rc_string, GValue *property_value) { VALUE spec = GOBJ2RVAL((gpointer)pspec); VALUE func = rb_hash_aref(style_prop_func_table, spec); VALUE ret = rb_funcall(func, id_call, 2, spec, CSTR2RVAL(rc_string->str)); if (NIL_P(ret)) { return FALSE; } else if (RVAL2CBOOL(ret)){ rbgobj_rvalue_to_gvalue(ret, property_value); return TRUE; } else { rb_raise(rb_eArgError, "Gtk::Widget#install_style_property() block should return new value or nil"); } } static VALUE rg_s_install_style_property(VALUE self, VALUE spec) { const RGObjClassInfo* cinfo = rbgobj_lookup_class(self); GtkWidgetClass* gclass; GParamSpec* pspec = RVAL2GPARAMSPEC(spec); if (cinfo->klass != self) rb_raise(rb_eTypeError, "%s isn't registered class", rb_class2name(self)); gclass = (GtkWidgetClass *)g_type_class_ref(cinfo->gtype); if (rb_block_given_p()){ VALUE func = rb_block_proc(); rb_hash_aset(style_prop_func_table, spec, func); gtk_widget_class_install_style_property_parser(gclass, pspec, (GtkRcPropertyParser)rc_property_parser); } else { gtk_widget_class_install_style_property(gclass, pspec); } return self; } static VALUE rg_s_style_property(VALUE self, VALUE property_name) { GtkWidgetClass* oclass; const char* name; GParamSpec* prop; VALUE result; if (SYMBOL_P(property_name)) { name = rb_id2name(SYM2ID(property_name)); } else { name = RVAL2CSTR(property_name); } oclass = (GtkWidgetClass*)g_type_class_ref(CLASS2GTYPE(self)); prop = gtk_widget_class_find_style_property(oclass, name); if (!prop){ g_type_class_unref(oclass); rb_raise(rb_eval_string("GLib::NoPropertyError"), "no such property: %s", name); } result = GOBJ2RVAL(prop); g_type_class_unref(oclass); return result; } static VALUE rg_s_style_properties(int argc, VALUE *argv, VALUE self) { GtkWidgetClass* oclass = g_type_class_ref(CLASS2GTYPE(self)); guint n_properties; GParamSpec** props; VALUE inherited_too; VALUE ary; guint i; if (rb_scan_args(argc, argv, "01", &inherited_too) == 0) inherited_too = Qtrue; props = gtk_widget_class_list_style_properties(oclass, &n_properties); ary = rb_ary_new(); for (i = 0; i < n_properties; i++){ if (RVAL2CBOOL(inherited_too) || GTYPE2CLASS(props[i]->owner_type) == self) rb_ary_push(ary, CSTR2RVAL(props[i]->name)); } g_free(props); g_type_class_unref(oclass); return ary; } static VALUE rg_region_intersect(VALUE self, VALUE region) { return CRREGION2RVAL(gtk_widget_region_intersect(_SELF(self), RVAL2CRREGION(region))); } static VALUE rg_send_expose(VALUE self, VALUE event) { return INT2NUM(gtk_widget_send_expose(_SELF(self), RVAL2GEV(event))); } static VALUE rg_style_get_property(VALUE self, VALUE prop_name) { GParamSpec* pspec = NULL; const char* name; if (SYMBOL_P(prop_name)) { name = rb_id2name(SYM2ID(prop_name)); } else { name = RVAL2CSTR(prop_name); } pspec = gtk_widget_class_find_style_property((GtkWidgetClass*)g_type_class_ref(RVAL2GTYPE(self)), name); if (!pspec) rb_raise(rb_eval_string("GLib::NoPropertyError"), "No such property: %s", name); else { // FIXME: use rb_ensure to call g_value_unset() GValue gval = G_VALUE_INIT; VALUE ret; g_value_init(&gval, G_PARAM_SPEC_VALUE_TYPE(pspec)); gtk_widget_style_get_property(RVAL2GTKWIDGET(self), name, &gval); ret = GVAL2RVAL(&gval); g_value_unset(&gval); return ret; } } static VALUE rg_accessible(VALUE self) { return GOBJ2RVAL(gtk_widget_get_accessible(_SELF(self))); } static VALUE rg_child_focus(VALUE self, VALUE direction) { return CBOOL2RVAL(gtk_widget_child_focus(_SELF(self), RVAL2GTKDIRECTIONTYPE(direction))); } static VALUE rg_error_bell(VALUE self) { gtk_widget_error_bell(_SELF(self)); return self; } static VALUE rg_keynav_failed(VALUE self, VALUE direction) { return CBOOL2RVAL(gtk_widget_keynav_failed(_SELF(self), RVAL2GTKDIRECTIONTYPE(direction))); } static VALUE rg_child_notify(VALUE self, VALUE child_property) { gtk_widget_child_notify(_SELF(self), RVAL2CSTR(child_property)); return self; } static VALUE rg_freeze_child_notify(VALUE self) { gtk_widget_freeze_child_notify(_SELF(self)); return self; } static VALUE rg_child_visible_p(VALUE self) { return CBOOL2RVAL(gtk_widget_get_child_visible(_SELF(self))); } static VALUE rg_settings(VALUE self) { return GOBJ2RVAL(gtk_widget_get_settings(_SELF(self))); } static VALUE rg_get_clipboard(VALUE self, VALUE selection) { return GOBJ2RVAL(gtk_widget_get_clipboard(_SELF(self), RVAL2ATOM(selection))); } static VALUE rg_display(VALUE self) { return GOBJ2RVAL(gtk_widget_get_display(_SELF(self))); } static VALUE rg_root_window(VALUE self) { return GOBJ2RVAL(gtk_widget_get_root_window(_SELF(self))); } static VALUE rg_screen(VALUE self) { return GOBJ2RVAL(gtk_widget_get_screen(_SELF(self))); } static VALUE rg_has_screen_p(VALUE self) { return CBOOL2RVAL(gtk_widget_has_screen(_SELF(self))); } static VALUE rg_get_size_request(VALUE self) { gint width, height; gtk_widget_get_size_request(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_set_child_visible(VALUE self, VALUE is_visible) { gtk_widget_set_child_visible(_SELF(self), RVAL2CBOOL(is_visible)); return self; } static VALUE rg_set_size_request(VALUE self, VALUE width, VALUE height) { gtk_widget_set_size_request(_SELF(self), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_thaw_child_notify(VALUE self) { gtk_widget_thaw_child_notify(_SELF(self)); return self; } static VALUE rg_mnemonic_labels(VALUE self) { return GOBJGLIST2RVAL_FREE(gtk_widget_list_mnemonic_labels(_SELF(self)), g_list_free, NULL); } static VALUE rg_add_mnemonic_label(VALUE self, VALUE label) { gtk_widget_add_mnemonic_label(_SELF(self), RVAL2GTKWIDGET(label)); return self; } static VALUE rg_remove_mnemonic_label(VALUE self, VALUE label) { gtk_widget_remove_mnemonic_label(_SELF(self), RVAL2GTKWIDGET(label)); return self; } static VALUE rg_set_tooltip_window(VALUE self, VALUE custom_window) { gtk_widget_set_tooltip_window(_SELF(self), RVAL2GTKWINDOW(custom_window)); return self; } static VALUE rg_tooltip_window(VALUE self) { return GOBJ2RVAL(gtk_widget_get_tooltip_window(_SELF(self))); } static VALUE rg_trigger_tooltip_query(VALUE self) { gtk_widget_trigger_tooltip_query(_SELF(self)); return self; } static VALUE rg_composited_p(VALUE self) { return CBOOL2RVAL(gtk_widget_is_composited(_SELF(self))); } static VALUE rg_set_window(VALUE self, VALUE window) { gtk_widget_set_window(_SELF(self), RVAL2GDKWINDOW(window)); return self; } static VALUE rg_toplevel_p(VALUE self) { return CBOOL2RVAL(gtk_widget_is_toplevel(_SELF(self))); } static VALUE rg_realized_p(VALUE self) { return CBOOL2RVAL(gtk_widget_get_realized(_SELF(self))); } static VALUE rg_mapped_p(VALUE self) { return CBOOL2RVAL(gtk_widget_get_mapped(_SELF(self))); } static VALUE rg_drawable_p(VALUE self) { return CBOOL2RVAL(gtk_widget_is_drawable(_SELF(self))); } static VALUE rg_sensitive_with_parent_p(VALUE self) { return CBOOL2RVAL(gtk_widget_get_sensitive(_SELF(self))); } static VALUE rg_has_grab_p(VALUE self) { return CBOOL2RVAL(gtk_widget_has_grab(_SELF(self))); } static VALUE rg_allocation(VALUE self) { GtkAllocation alloc; gtk_widget_get_allocation(_SELF(self), &alloc); return GTKALLOCATION2RVAL(&alloc); } static VALUE rg_set_allocation(VALUE self, VALUE alloc) { gtk_widget_set_allocation(_SELF(self), RVAL2GTKALLOCATION(alloc)); return self; } static VALUE rg_destroy(VALUE self) { gtk_widget_destroy(_SELF(self)); return Qnil; } static VALUE rg_bindings_activate(VALUE self, VALUE keyval, VALUE modifiers) { return CBOOL2RVAL(gtk_bindings_activate(RVAL2GOBJ(self), NUM2UINT(keyval), NUM2UINT(modifiers))); } static VALUE rg_has_window_p(VALUE self) { return CBOOL2RVAL(gtk_widget_get_has_window(_SELF(self))); } static VALUE rg_set_has_window(VALUE self, VALUE has_window) { gtk_widget_set_has_window(_SELF(self), RVAL2CBOOL(has_window)); return self; } static VALUE rg_s_binding_set(VALUE self) { GType gtype; gpointer gclass; GtkBindingSet* binding_set; Check_Type(self, T_CLASS); gtype = CLASS2GTYPE(self); if (!G_TYPE_IS_CLASSED(gtype)) { rb_raise(rb_eTypeError, "%s is not a classed GType", rb_class2name(self)); } gclass = g_type_class_ref(gtype); if (!gclass) { rb_raise(rb_eRuntimeError, "couldn't get class reference"); } if (!G_IS_OBJECT_CLASS(gclass)) { g_type_class_unref(gclass); rb_raise(rb_eTypeError, "%s is not a GObject class", rb_class2name(self)); } binding_set = gtk_binding_set_by_class(gclass); if (!binding_set) { g_type_class_unref(gclass); rb_raise(rb_eRuntimeError, "couldn't get BindingSet from %s", rb_class2name(self)); } g_type_class_unref(gclass); return GTKBINDINGSET2RVAL(binding_set); } static VALUE rg_path(VALUE self) { return GTKWIDGETPATH2RVAL(gtk_widget_get_path(_SELF(self))); } static VALUE widget_signal_size_request(G_GNUC_UNUSED guint num, const GValue *values) { GtkRequisition* req = (GtkRequisition*)g_value_get_boxed(&values[1]); return rb_ary_new3(2, GVAL2RVAL(&values[0]), rb_ary_new3(2, INT2NUM(req->width), INT2NUM(req->height))); } static VALUE widget_signal_size_allocate(G_GNUC_UNUSED guint num, const GValue *values) { GtkAllocation* alloc = (GtkAllocation*)g_value_get_boxed(&values[1]); return rb_ary_new3(2, GVAL2RVAL(&values[0]), GTKALLOCATION2RVAL(alloc)); } static VALUE rg_add_device_events(VALUE self, VALUE device, VALUE events) { gtk_widget_add_device_events(_SELF(self), RVAL2GDKDEVICE(device), RVAL2GDKEVENTMASK(events)); return self; } static VALUE rg_compute_expand(VALUE self, VALUE orientation) { gboolean result; result = gtk_widget_compute_expand(_SELF(self), RVAL2GTKORIENTATION(orientation)); return CBOOL2RVAL(result); } static VALUE rg_device_is_shadowed_p(VALUE self, VALUE device) { return CBOOL2RVAL(gtk_widget_device_is_shadowed(_SELF(self), RVAL2GDKDEVICE(device))); } static VALUE rg_draw(VALUE self, VALUE cr) { gtk_widget_draw(_SELF(self), RVAL2CRCONTEXT(cr)); return self; } static VALUE rg_allocated_height(VALUE self) { return INT2NUM(gtk_widget_get_allocated_height(_SELF(self))); } static VALUE rg_allocated_width(VALUE self) { return INT2NUM(gtk_widget_get_allocated_width(_SELF(self))); } /* TODO: device_enabled_p? */ static VALUE rg_get_device_enabled_p(VALUE self, VALUE device) { return CBOOL2RVAL(gtk_widget_get_device_enabled(_SELF(self), RVAL2GDKDEVICE(device))); } static VALUE rg_get_device_events(VALUE self, VALUE device) { GdkEventMask mask; mask = gtk_widget_get_device_events(_SELF(self), RVAL2GDKDEVICE(device)); return GDKEVENTMASK2RVAL(mask); } static VALUE rg_preferred_height(VALUE self) { gint minimum_height, natural_height; gtk_widget_get_preferred_height(_SELF(self), &minimum_height, &natural_height); return rb_ary_new3(2, INT2NUM(minimum_height), INT2NUM(natural_height)); } static VALUE rg_get_preferred_height_for_width(VALUE self, VALUE width) { gint minimum_height, natural_height; gtk_widget_get_preferred_height_for_width(_SELF(self), NUM2INT(width), &minimum_height, &natural_height); return rb_ary_new3(2, INT2NUM(minimum_height), INT2NUM(natural_height)); } static VALUE rg_preferred_size(VALUE self) { GtkRequisition minimum_size, natural_size; gtk_widget_get_preferred_size(_SELF(self), &minimum_size, &natural_size); return rb_ary_new3(2, rb_ary_new3(2, minimum_size.width, minimum_size.height), rb_ary_new3(2, natural_size.width, natural_size.height)); } static VALUE rg_preferred_width(VALUE self) { gint minimum_width, natural_width; gtk_widget_get_preferred_width(_SELF(self), &minimum_width, &natural_width); return rb_ary_new3(2, INT2NUM(minimum_width), INT2NUM(natural_width)); } static VALUE rg_get_preferred_width_for_height(VALUE self, VALUE height) { gint minimum_width, natural_width; gtk_widget_get_preferred_width_for_height(_SELF(self), NUM2INT(height), &minimum_width, &natural_width); return rb_ary_new3(2, INT2NUM(minimum_width), INT2NUM(natural_width)); } static VALUE rg_request_mode(VALUE self) { return GTKSIZEREQUESTMODE2RVAL(gtk_widget_get_request_mode(_SELF(self))); } static VALUE rg_state_flags(VALUE self) { return GTKSTATEFLAGS2RVAL(gtk_widget_get_state_flags(_SELF(self))); } static VALUE rg_style_context(VALUE self) { return GOBJ2RVAL(gtk_widget_get_style_context(_SELF(self))); } static VALUE rg_support_multidevice_p(VALUE self) { return CBOOL2RVAL(gtk_widget_get_support_multidevice(_SELF(self))); } #if GTK_CHECK_VERSION(3, 2, 0) static VALUE rg_has_visible_focus_p(VALUE self) { return CBOOL2RVAL(gtk_widget_has_visible_focus(_SELF(self))); } #endif static VALUE rg_in_destruction_p(VALUE self) { return CBOOL2RVAL(gtk_widget_in_destruction(_SELF(self))); } static VALUE rg_input_shape_combine_region(VALUE self, VALUE region) { gtk_widget_input_shape_combine_region(_SELF(self), NIL_P(region) ? NULL : RVAL2CRREGION(region)); return self; } static VALUE rg_override_background_color(VALUE self, VALUE state, VALUE color) { gtk_widget_override_background_color(_SELF(self), RVAL2GTKSTATEFLAGS(state), NIL_P(color) ? NULL : RVAL2GDKRGBA(color)); return self; } static VALUE rg_override_color(VALUE self, VALUE state, VALUE color) { gtk_widget_override_color(_SELF(self), RVAL2GTKSTATEFLAGS(state), NIL_P(color) ? NULL : RVAL2GDKRGBA(color)); return self; } static VALUE rg_override_cursor(VALUE self, VALUE cursor, VALUE secondary_cursor) { gtk_widget_override_cursor(_SELF(self), NIL_P(cursor) ? NULL : RVAL2GDKRGBA(cursor), NIL_P(secondary_cursor) ? NULL : RVAL2GDKRGBA(secondary_cursor)); return self; } static VALUE rg_override_font(VALUE self, VALUE font_desc) { gtk_widget_override_font(_SELF(self), NIL_P(font_desc) ? NULL : RVAL2PANGOFONTDESCRIPTION(font_desc)); return self; } static VALUE rg_override_symbolic_color(VALUE self, VALUE name, VALUE color) { gtk_widget_override_symbolic_color(_SELF(self), RVAL2CSTR(name), NIL_P(color) ? NULL : RVAL2GDKRGBA(color)); return self; } static VALUE rg_queue_compute_expand(VALUE self) { gtk_widget_queue_compute_expand(_SELF(self)); return self; } static VALUE rg_queue_draw_region(VALUE self, VALUE region) { gtk_widget_queue_draw_region(_SELF(self), RVAL2CRREGION(region)); return self; } static VALUE rg_render_icon_pixbuf(VALUE self, VALUE stock_id, VALUE size) { VALUE buffer; GdkPixbuf *pixbuf; pixbuf = gtk_widget_render_icon_pixbuf(_SELF(self), RVAL2GLIBID(stock_id, buffer), RVAL2GTKICONSIZE(size)); return GOBJ2RVAL_UNREF(pixbuf); } static VALUE rg_reset_style(VALUE self) { gtk_widget_reset_style(_SELF(self)); return self; } static VALUE rg_send_focus_change(VALUE self, VALUE event) { gboolean result; result = gtk_widget_send_focus_change(_SELF(self), RVAL2GDKEVENT(event)); return CBOOL2RVAL(result); } static VALUE rg_set_device_enabled(VALUE self, VALUE device, VALUE enabled) { gtk_widget_set_device_enabled(_SELF(self), RVAL2GDKDEVICE(device), RVAL2CBOOL(enabled)); return self; } static VALUE rg_set_device_events(VALUE self, VALUE device, VALUE events) { gtk_widget_set_device_events(_SELF(self), RVAL2GDKDEVICE(device), RVAL2GDKEVENTMASK(events)); return self; } static VALUE rg_set_mapped(VALUE self, VALUE mapped) { gtk_widget_set_mapped(_SELF(self), RVAL2CBOOL(mapped)); return self; } static VALUE rg_set_realized(VALUE self, VALUE realized) { gtk_widget_set_realized(_SELF(self), RVAL2CBOOL(realized)); return self; } static VALUE rg_set_state_flags(VALUE self, VALUE flags, VALUE clear) { gtk_widget_set_state_flags(_SELF(self), RVAL2GTKSTATEFLAGS(flags), RVAL2CBOOL(clear)); return self; } static VALUE rg_set_support_multidevice(VALUE self, VALUE support_multidevice) { gtk_widget_set_support_multidevice(_SELF(self), RVAL2CBOOL(support_multidevice)); return self; } static VALUE rg_set_visual(VALUE self, VALUE visual) { gtk_widget_set_visual(_SELF(self), RVAL2GDKVISUAL(visual)); return self; } static VALUE rg_shape_combine_region(VALUE self, VALUE region) { gtk_widget_shape_combine_region(_SELF(self), NIL_P(region) ? NULL : RVAL2CRREGION(region)); return self; } static VALUE rg_unset_state_flags(VALUE self, VALUE flags) { gtk_widget_unset_state_flags(_SELF(self), RVAL2GTKSTATEFLAGS(flags)); return self; } static VALUE rg_drag_dest_set(VALUE self, VALUE flags, VALUE targets, VALUE actions) { GtkDestDefaults flg = RVAL2GTKDESTDEFAULTS(flags); GdkDragAction acts = RVAL2GDKDRAGACTION(actions); long n; GtkTargetEntry *entries = RVAL2GTKTARGETENTRIES_ACCEPT_NIL(targets, &n); gtk_drag_dest_set(_SELF(self), flg, entries, n, acts); g_free(entries); return self; } static VALUE rg_drag_dest_set_proxy(VALUE self, VALUE proxy_window, VALUE protocol, VALUE use_coordinates) { gtk_drag_dest_set_proxy(_SELF(self), RVAL2GDKWINDOW(proxy_window), RVAL2GDKDRAGPROTOCOL(protocol), RVAL2CBOOL(use_coordinates)); return self; } static VALUE rg_drag_dest_unset(VALUE self) { gtk_drag_dest_unset(_SELF(self)); return self; } static VALUE rg_drag_dest_find_target(int argc, VALUE *argv, VALUE self) { VALUE context, target_list; GdkAtom ret; rb_scan_args(argc, argv, "11", &context, &target_list); ret = gtk_drag_dest_find_target(_SELF(self), RVAL2GDKDRAGCONTEXT(context), NIL_P(target_list) ? NULL : RVAL2GTKTARGETLIST(target_list)); return GDKATOM2RVAL(ret); } static VALUE rg_drag_dest_get_target_list(VALUE self) { GtkTargetList* list = gtk_drag_dest_get_target_list(_SELF(self)); return GTKTARGETLIST2RVAL(list); } static VALUE rg_drag_dest_set_target_list(VALUE self, VALUE target_list) { gtk_drag_dest_set_target_list(_SELF(self), NIL_P(target_list) ? NULL : RVAL2GTKTARGETLIST(target_list)); return self; } static VALUE rg_drag_dest_add_text_targets(VALUE self) { gtk_drag_dest_add_text_targets(_SELF(self)); return self; } static VALUE rg_drag_dest_add_image_targets(VALUE self) { gtk_drag_dest_add_image_targets(_SELF(self)); return self; } static VALUE rg_drag_dest_add_uri_targets(VALUE self) { gtk_drag_dest_add_uri_targets(_SELF(self)); return self; } static VALUE rg_drag_dest_set_track_motion(VALUE self, VALUE track_motion) { gtk_drag_dest_set_track_motion(_SELF(self), RVAL2CBOOL(track_motion)); return self; } static VALUE rg_drag_dest_get_track_motion(VALUE self) { return CBOOL2RVAL(gtk_drag_dest_get_track_motion(_SELF(self))); } static VALUE rg_drag_get_data(VALUE self, VALUE context, VALUE target, VALUE time) { gtk_drag_get_data(_SELF(self), RVAL2GDKDRAGCONTEXT(context), RVAL2ATOM(target), NUM2UINT(time)); return self; } static VALUE rg_drag_highlight(VALUE self) { gtk_drag_highlight(_SELF(self)); return self; } static VALUE rg_drag_unhighlight(VALUE self) { gtk_drag_unhighlight(_SELF(self)); return self; } static VALUE rg_drag_begin(VALUE self, VALUE target_list, VALUE actions, VALUE button, VALUE event) { return GOBJ2RVAL(gtk_drag_begin(_SELF(self), RVAL2GTKTARGETLIST(target_list), RVAL2GDKDRAGACTION(actions), NUM2INT(button), RVAL2GEV(event))); } static VALUE rg_drag_threshold_p(VALUE self, VALUE start_x, VALUE start_y, VALUE current_x, VALUE current_y) { return CBOOL2RVAL(gtk_drag_check_threshold(_SELF(self), NUM2INT(start_x), NUM2INT(start_y), NUM2INT(current_x), NUM2INT(current_y))); } static VALUE rg_drag_source_set(VALUE self, VALUE start_button_mask, VALUE targets, VALUE actions) { GdkModifierType mask = RVAL2GDKMODIFIERTYPE(start_button_mask); GdkDragAction acts = RVAL2GDKDRAGACTION(actions); long n; GtkTargetEntry *entries = RVAL2GTKTARGETENTRIES(targets, &n); gtk_drag_source_set(_SELF(self), mask, entries, n, acts); g_free(entries); return self; } static VALUE rg_drag_source_set_icon(VALUE self, VALUE icon) { if (TYPE(icon) == T_HASH) { VALUE stock_id, icon_name, gicon, pixbuf, buffer; rbg_scan_options(icon, "stock_id", &stock_id, "icon_name", &icon_name, "gicon", &gicon, "pixbuf", &pixbuf, NULL); if (!NIL_P(stock_id)) gtk_drag_source_set_icon_stock(_SELF(self), RVAL2GLIBID(stock_id, buffer)); else if (!NIL_P(icon_name)) gtk_drag_source_set_icon_name(_SELF(self), RVAL2CSTR(icon_name)); #if GTK_CHECK_VERSION(3, 2, 0) else if (!NIL_P(gicon)) gtk_drag_source_set_icon_gicon(_SELF(self), RVAL2GICON(gicon)); #endif else if (!NIL_P(pixbuf)) gtk_drag_source_set_icon_pixbuf(_SELF(self), RVAL2GDKPIXBUF(pixbuf)); else rb_raise(rb_eArgError, "Invalid arguments."); } else { GType gtype = RVAL2GTYPE(icon); if (gtype == GDK_TYPE_PIXBUF) gtk_drag_source_set_icon_pixbuf(_SELF(self), RVAL2GDKPIXBUF(icon)); #if GTK_CHECK_VERSION(3, 2, 0) else if (g_type_is_a(gtype, G_TYPE_ICON)) gtk_drag_source_set_icon_gicon(_SELF(self), RVAL2GICON(icon)); #endif else rb_raise(rb_eArgError, "Invalid arguments."); } return self; } static VALUE rg_drag_source_unset(VALUE self) { gtk_drag_source_unset(_SELF(self)); return self; } static VALUE rg_drag_source_set_target_list(VALUE self, VALUE target_list) { gtk_drag_source_set_target_list(_SELF(self), NIL_P(target_list) ? NULL : RVAL2GTKTARGETLIST(target_list)); return self; } static VALUE rg_drag_source_get_target_list(VALUE self) { return GTKTARGETLIST2RVAL(gtk_drag_source_get_target_list(_SELF(self))); } static VALUE rg_drag_source_add_text_targets(VALUE self) { gtk_drag_source_add_text_targets(_SELF(self)); return self; } static VALUE rg_drag_source_add_image_targets(VALUE self) { gtk_drag_source_add_image_targets(_SELF(self)); return self; } static VALUE rg_drag_source_add_uri_targets(VALUE self) { gtk_drag_source_add_uri_targets(_SELF(self)); return self; } void Init_gtk_widget(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_WIDGET, "Widget", mGtk); rb_global_variable(&style_prop_func_table); style_prop_func_table = rb_hash_new(); RG_DEF_METHOD(unparent, 0); RG_DEF_METHOD(show, 0); RG_DEF_METHOD(show_now, 0); RG_DEF_METHOD(hide, 0); RG_DEF_METHOD(show_all, 0); RG_DEF_METHOD(map, 0); RG_DEF_METHOD(unmap, 0); RG_DEF_METHOD(realize, 0); RG_DEF_METHOD(unrealize, 0); RG_DEF_METHOD(queue_draw, 0); RG_DEF_METHOD(queue_resize, 0); RG_DEF_METHOD(queue_resize_no_redraw, 0); RG_DEF_METHOD(size_allocate, 1); RG_DEF_METHOD(add_accelerator, 5); RG_DEF_METHOD(remove_accelerator, 3); RG_DEF_METHOD(set_accel_path, 2); RG_DEF_METHOD(accel_closures, 0); RG_DEF_METHOD_P(can_activate_accel, 1); RG_DEF_METHOD(event, 1); RG_DEF_METHOD(activate, 0); RG_DEF_METHOD(reparent, 1); RG_DEF_SMETHOD(install_style_property, 1); RG_DEF_SMETHOD(style_property, 1); RG_DEF_SMETHOD(style_properties, -1); RG_DEF_METHOD(intersect, 1); RG_DEF_METHOD(grab_default, 0); RG_DEF_METHOD(set_parent_window, 1); RG_DEF_METHOD(parent_window, 0); RG_DEF_METHOD(add_events, 1); RG_DEF_METHOD(toplevel, 0); RG_DEF_METHOD(get_ancestor, 1); RG_DEF_METHOD(visual, 0); RG_DEF_METHOD_P(ancestor, 1); RG_DEF_METHOD(translate_coordinates, 3); RG_DEF_METHOD(hide_on_delete, 0); RG_DEF_METHOD(set_direction, 1); RG_DEF_METHOD(direction, 0); RG_DEF_METHOD(composite_name, 0); RG_DEF_METHOD(create_pango_context, 0); RG_DEF_METHOD(pango_context, 0); RG_DEF_METHOD(create_pango_layout, -1); RG_DEF_METHOD(queue_draw_area, 4); RG_DEF_METHOD(set_redraw_on_allocate, 1); RG_DEF_METHOD(set_composite_name, 1); RG_DEF_METHOD(mnemonic_activate, 1); RG_DEF_METHOD(region_intersect, 1); RG_DEF_METHOD(send_expose, 1); RG_DEF_METHOD(style_get_property, 1); RG_DEF_METHOD(accessible, 0); RG_DEF_METHOD(child_focus, 1); RG_DEF_METHOD(error_bell, 0); RG_DEF_METHOD(keynav_failed, 0); RG_DEF_METHOD(child_notify, 1); RG_DEF_METHOD(freeze_child_notify, 0); RG_DEF_METHOD_P(child_visible, 0); RG_DEF_METHOD(settings, 0); RG_DEF_METHOD(get_clipboard, 1); RG_DEF_METHOD(display, 0); RG_DEF_METHOD(root_window, 0); RG_DEF_METHOD(screen, 0); RG_DEF_METHOD_P(has_screen, 0); RG_DEF_METHOD(set_child_visible, 1); RG_DEF_METHOD(get_size_request, 0); RG_DEF_METHOD(set_size_request, 2); RG_DEF_METHOD(thaw_child_notify, 0); RG_DEF_METHOD(mnemonic_labels, 0); RG_DEF_METHOD(add_mnemonic_label, 1); RG_DEF_METHOD(remove_mnemonic_label, 1); RG_DEF_METHOD(set_tooltip_window, 1); RG_DEF_METHOD(tooltip_window, 0); RG_DEF_METHOD(trigger_tooltip_query, 0); RG_DEF_METHOD_P(composited, 0); RG_DEF_METHOD(set_window, 1); RG_DEF_METHOD(allocation, 0); RG_DEF_METHOD(set_allocation, 1); RG_DEF_METHOD(destroy, 0); RG_DEF_METHOD(bindings_activate, 2); RG_DEF_METHOD_P(toplevel, 0); RG_DEF_METHOD_P(realized, 0); RG_DEF_METHOD_P(mapped, 0); RG_DEF_METHOD_P(drawable, 0); RG_DEF_METHOD_P(sensitive_with_parent, 0); RG_DEF_METHOD_P(has_grab, 0); RG_DEF_SMETHOD(set_default_direction, 1); RG_DEF_SMETHOD(default_direction, 0); RG_DEF_SMETHOD(pop_composite_child, 0); RG_DEF_SMETHOD(push_composite_child, 0); RG_DEF_SMETHOD(binding_set, 0); RG_DEF_METHOD_P(has_window, 0); RG_DEF_METHOD(set_has_window, 1); RG_DEF_METHOD(path, 0); RG_DEF_METHOD(add_device_events, 2); RG_DEF_METHOD(compute_expand, 1); RG_DEF_METHOD_P(device_is_shadowed, 1); RG_DEF_METHOD(draw, 1); RG_DEF_METHOD(allocated_height, 0); RG_DEF_METHOD(allocated_width, 0); RG_DEF_METHOD_P(get_device_enabled, 1); RG_DEF_METHOD(get_device_events, 1); RG_DEF_METHOD(preferred_height, 0); RG_DEF_METHOD(get_preferred_height_for_width, 1); RG_DEF_METHOD(preferred_size, 0); RG_DEF_METHOD(preferred_width, 0); RG_DEF_METHOD(get_preferred_width_for_height, 1); RG_DEF_METHOD(request_mode, 0); RG_DEF_METHOD(state_flags, 0); RG_DEF_METHOD(style_context, 0); RG_DEF_METHOD_P(support_multidevice, 0); #if GTK_CHECK_VERSION(3, 2, 0) RG_DEF_METHOD_P(has_visible_focus, 0); #endif RG_DEF_METHOD_P(in_destruction, 0); RG_DEF_METHOD(input_shape_combine_region, 1); RG_DEF_METHOD(override_background_color, 2); RG_DEF_METHOD(override_color, 2); RG_DEF_METHOD(override_cursor, 2); RG_DEF_METHOD(override_font, 1); RG_DEF_METHOD(override_symbolic_color, -1); RG_DEF_METHOD(queue_compute_expand, 0); RG_DEF_METHOD(queue_draw_region, 1); RG_DEF_METHOD(render_icon_pixbuf, 2); RG_DEF_METHOD(reset_style, 0); RG_DEF_METHOD(send_focus_change, 1); RG_DEF_METHOD(set_device_enabled, 2); RG_DEF_METHOD(set_device_events, 2); RG_DEF_METHOD(set_mapped, 1); RG_DEF_METHOD(set_realized, 1); RG_DEF_METHOD(set_state_flags, 2); RG_DEF_METHOD(set_support_multidevice, 1); RG_DEF_METHOD(set_visual, 1); RG_DEF_METHOD(shape_combine_region, 1); RG_DEF_METHOD(unset_state_flags, 1); RG_DEF_METHOD(drag_dest_set, 3); RG_DEF_METHOD(drag_dest_set_proxy, 3); RG_DEF_METHOD(drag_dest_unset, 0); RG_DEF_METHOD(drag_dest_find_target, -1); RG_DEF_METHOD(drag_dest_get_target_list, 0); RG_DEF_METHOD(drag_dest_set_target_list, 1); RG_DEF_METHOD(drag_dest_add_text_targets, 0); RG_DEF_METHOD(drag_dest_add_image_targets, 0); RG_DEF_METHOD(drag_dest_add_uri_targets, 0); RG_DEF_METHOD(drag_dest_set_track_motion, 1); RG_DEF_METHOD(drag_dest_get_track_motion, 0); RG_DEF_METHOD(drag_get_data, 3); RG_DEF_METHOD(drag_highlight, 0); RG_DEF_METHOD(drag_unhighlight, 0); RG_DEF_METHOD(drag_begin, 4); RG_DEF_METHOD_P(drag_threshold, 4); RG_DEF_METHOD(drag_source_set, 3); RG_DEF_METHOD(drag_source_set_icon, 1); RG_DEF_METHOD(drag_source_unset, 0); RG_DEF_METHOD(drag_source_set_target_list, 1); RG_DEF_METHOD(drag_source_get_target_list, 0); RG_DEF_METHOD(drag_source_add_text_targets, 0); RG_DEF_METHOD(drag_source_add_image_targets, 0); RG_DEF_METHOD(drag_source_add_uri_targets, 0); G_DEF_CLASS(GTK_TYPE_WIDGET_HELP_TYPE, "HelpType", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_TEXT_DIRECTION, "TextDirection", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_ALIGN, "Align", RG_TARGET_NAMESPACE); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "size-request", (GValToRValSignalFunc)widget_signal_size_request); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "size-allocate", (GValToRValSignalFunc)widget_signal_size_allocate); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-layout.c���������������������������������������������0000644�0001750�0001750�00000010240�12102213527�020621� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mCellLayout #define _SELF(s) (RVAL2GTKCELLLAYOUT(s)) static VALUE rg_pack_start(VALUE self, VALUE cell, VALUE expand) { gtk_cell_layout_pack_start(_SELF(self), RVAL2GTKCELLRENDERER(cell), RVAL2CBOOL(expand)); return self; } static VALUE rg_pack_end(VALUE self, VALUE cell, VALUE expand) { gtk_cell_layout_pack_end(_SELF(self), RVAL2GTKCELLRENDERER(cell), RVAL2CBOOL(expand)); return self; } static VALUE rg_reorder(VALUE self, VALUE cell, VALUE position) { gtk_cell_layout_reorder(_SELF(self), RVAL2GTKCELLRENDERER(cell), NUM2INT(position)); return self; } static VALUE rg_clear(VALUE self) { gtk_cell_layout_clear(_SELF(self)); return self; } static VALUE rg_add_attribute(VALUE self, VALUE cell, VALUE attribute, VALUE column) { const gchar *name; if (SYMBOL_P(attribute)) { name = rb_id2name(SYM2ID(attribute)); } else { name = RVAL2CSTR(attribute); } gtk_cell_layout_add_attribute(_SELF(self), RVAL2GTKCELLRENDERER(cell), name, NUM2INT(column)); return self; } static void layout_data_func(GtkCellLayout *layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer func) { iter->user_data3 = tree_model; rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(layout), GOBJ2RVAL(cell), GOBJ2RVAL(tree_model), GTKTREEITER2RVAL(iter)); } static VALUE rg_set_cell_data_func(VALUE self, VALUE cell) { if (rb_block_given_p()) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_cell_layout_set_cell_data_func(_SELF(self), RVAL2GTKCELLRENDERER(cell), (GtkCellLayoutDataFunc)layout_data_func, (gpointer)func, NULL); } else { gtk_cell_layout_set_cell_data_func(_SELF(self), RVAL2GTKCELLRENDERER(cell), NULL, (gpointer)NULL, NULL); } return self; } static VALUE rg_clear_attributes(VALUE self, VALUE cell) { gtk_cell_layout_clear_attributes(_SELF(self), RVAL2GTKCELLRENDERER(cell)); return self; } static VALUE rg_set_attributes(VALUE self, VALUE cell, VALUE attrs) { gint i; VALUE ary; Check_Type(attrs, T_HASH); rg_clear_attributes(self, cell); ary = rb_funcall(attrs, rb_intern("to_a"), 0); for (i = 0; i < RARRAY_LEN(ary); i++){ rg_add_attribute(self, cell, RARRAY_PTR(RARRAY_PTR(ary)[i])[0], RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); } return self; } static VALUE rg_cells(VALUE self) { return GOBJGLIST2RVAL_FREE(gtk_cell_layout_get_cells(_SELF(self)), g_list_free, NULL); } void Init_gtk_celllayout(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_CELL_LAYOUT, "CellLayout", mGtk); RG_DEF_METHOD(pack_start, 2); RG_DEF_METHOD(pack_end, 2); RG_DEF_METHOD(reorder, 2); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD(add_attribute, 3); RG_DEF_METHOD(set_cell_data_func, 1); RG_DEF_METHOD(clear_attributes, 1); RG_DEF_METHOD(set_attributes, 2); RG_DEF_METHOD(cells, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-print-operation.c�����������������������������������������0000644�0001750�0001750�00000010714�12102213527�021527� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cPrintOperation #define _SELF(s) (RVAL2GTKPRINTOPERATION(s)) static VALUE RG_TARGET_NAMESPACE; static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_print_operation_new()); return Qnil; } static VALUE rg_run(int argc, VALUE *argv, VALUE self) { VALUE action, parent, rb_result; GtkPrintOperationResult result; GError *error = NULL; rb_scan_args(argc, argv, "11", &action, &parent); result = gtk_print_operation_run(_SELF(self), RVAL2GTKPRINTOPERATIONACTION(action), RVAL2GTKWINDOW(parent), &error); rb_result = GTKPRINTOPERATIONRESULT2RVAL(result); if (rb_block_given_p()) { return rb_yield(rb_result); } else { if (result == GTK_PRINT_OPERATION_RESULT_ERROR) RAISE_GERROR(error); return rb_result; } } static VALUE rg_error(VALUE self) { GError *error = NULL; gtk_print_operation_get_error(_SELF(self), &error); return error ? rbgerr_gerror2exception(error) : Qnil; } static VALUE rg_finished_p(VALUE self) { return CBOOL2RVAL(gtk_print_operation_is_finished(_SELF(self))); } static VALUE rg_cancel(VALUE self) { gtk_print_operation_cancel(_SELF(self)); return self; } struct callback_arg { VALUE callback; VALUE page_setup; }; static VALUE invoke_callback(VALUE arg_) { struct callback_arg *arg = (struct callback_arg *)arg_; return rb_funcall(arg->callback, id_call, 1, arg->page_setup); } static void page_setup_done_cb(GtkPageSetup *page_setup, gpointer data) { VALUE callback = (VALUE)data; struct callback_arg arg; G_CHILD_UNSET(RG_TARGET_NAMESPACE, rb_intern("setup_done_cb")); arg.callback = callback; arg.page_setup = GOBJ2RVAL(page_setup); G_PROTECT_CALLBACK(invoke_callback, &arg); } static VALUE rg_s_run_page_setup_dialog(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE parent, page_setup, settings; rb_scan_args(argc, argv, "03", &parent, &page_setup, &settings); if (rb_block_given_p()) { volatile VALUE func = rb_block_proc(); G_CHILD_SET(RG_TARGET_NAMESPACE, rb_intern("setup_done_cb"), func); gtk_print_run_page_setup_dialog_async(RVAL2GTKWINDOW(parent), RVAL2GTKPAGESETUP(page_setup), RVAL2GTKPRINTSETTINGS(settings), page_setup_done_cb, (gpointer)func); return Qnil; } else { return GOBJ2RVALU(gtk_print_run_page_setup_dialog(RVAL2GTKWINDOW(parent), RVAL2GTKPAGESETUP(page_setup), RVAL2GTKPRINTSETTINGS(settings))); } } void Init_gtk_print_operation(VALUE mGtk) { RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_OPERATION, "PrintOperation", mGtk); G_DEF_ERROR(GTK_PRINT_ERROR, "PrintError", mGtk, rb_eRuntimeError, GTK_TYPE_PRINT_ERROR); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(run, -1); RG_DEF_METHOD(error, 0); RG_DEF_METHOD_P(finished, 0); RG_DEF_METHOD(cancel, 0); RG_DEF_SMETHOD(run_page_setup_dialog, -1); G_DEF_CLASS(GTK_TYPE_PRINT_STATUS, "Status", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_PRINT_OPERATION_ACTION,"Action", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_PRINT_OPERATION_RESULT, "Result", RG_TARGET_NAMESPACE); } ����������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-file-chooser.c��������������������������������������������0000644�0001750�0001750�00000023065�12257552167�021000� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2005-2013 Ruby-GNOME2 Project Team * Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mFileChooser #define _SELF(self) RVAL2GTKFILECHOOSER(self) #ifdef HAVE_GTK_GTKFILESYSTEM_H /* For error handling */ # define GTK_FILE_SYSTEM_ENABLE_UNSUPPORTED # include <gtk/gtkfilesystem.h> #endif static VALUE gslist2ary_free(GSList* list) { GSList* l; VALUE ary = rb_ary_new(); for (l = list; l != NULL; l = g_slist_next(l)) { rb_ary_push(ary, CSTR2RVAL_FREE(l->data)); } g_slist_free(list); return ary; } static VALUE rg_set_current_name(VALUE self, VALUE name) { /* doc says the awaited string is UTF-8, so use RVAL2CSTR */ gtk_file_chooser_set_current_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_filename(VALUE self) { return CSTRFILENAME2RVAL_FREE(gtk_file_chooser_get_filename(_SELF(self))); } static VALUE rg_set_filename(VALUE self, VALUE rbfilename) { gchar *filename = RVAL2CSTRFILENAME(rbfilename); gboolean ret = gtk_file_chooser_set_filename(_SELF(self), filename); g_free(filename); if (!ret) rb_raise(rb_eRuntimeError, "Can't set filename"); return self; } static VALUE rg_select_filename(VALUE self, VALUE rbfilename) { gchar *filename = RVAL2CSTRFILENAME(rbfilename); gboolean ret = gtk_file_chooser_select_filename(_SELF(self), filename); g_free(filename); return CBOOL2RVAL(ret); } static VALUE rg_unselect_filename(VALUE self, VALUE rbfilename) { gchar *filename = RVAL2CSTRFILENAME(rbfilename); gtk_file_chooser_unselect_filename(_SELF(self), filename); g_free(filename); return self; } static VALUE rg_select_all(VALUE self) { gtk_file_chooser_select_all(_SELF(self)); return self; } static VALUE rg_unselect_all(VALUE self) { gtk_file_chooser_unselect_all(_SELF(self)); return self; } static VALUE rg_filenames(VALUE self) { return FILENAMEGSLIST2RVAL_FREE(gtk_file_chooser_get_filenames(_SELF(self)), g_slist_free, g_free); } static VALUE rg_set_current_folder(VALUE self, VALUE filename) { gboolean ret = gtk_file_chooser_set_current_folder(_SELF(self), RVAL2CSTR(filename)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set current folder"); return self; } static VALUE rg_current_folder(VALUE self) { return CSTR2RVAL_FREE(gtk_file_chooser_get_current_folder(_SELF(self))); } static VALUE rg_uri(VALUE self) { return CSTR2RVAL_FREE(gtk_file_chooser_get_uri(_SELF(self))); } static VALUE rg_set_uri(VALUE self, VALUE uri) { gboolean ret = gtk_file_chooser_set_uri(_SELF(self), RVAL2CSTR(uri)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set uri"); return self; } static VALUE rg_select_uri(VALUE self, VALUE uri) { return CBOOL2RVAL(gtk_file_chooser_select_uri(_SELF(self), RVAL2CSTR(uri))); } static VALUE rg_unselect_uri(VALUE self, VALUE uri) { gtk_file_chooser_unselect_uri(_SELF(self), RVAL2CSTR(uri)); return self; } static VALUE rg_uris(VALUE self) { return gslist2ary_free(gtk_file_chooser_get_uris(_SELF(self))); } static VALUE rg_set_current_folder_uri(VALUE self, VALUE uri) { gboolean ret = gtk_file_chooser_set_current_folder_uri(_SELF(self), RVAL2CSTR(uri)); if (! ret) rb_raise(rb_eRuntimeError, "Can't set current folder uri"); return self; } static VALUE rg_current_folder_uri(VALUE self) { return CSTR2RVAL_FREE(gtk_file_chooser_get_current_folder_uri(_SELF(self))); } static VALUE rg_preview_filename(VALUE self) { return CSTR2RVAL_FREE(gtk_file_chooser_get_preview_filename(_SELF(self))); } static VALUE rg_preview_uri(VALUE self) { return CSTR2RVAL_FREE(gtk_file_chooser_get_preview_uri(_SELF(self))); } static VALUE rg_add_filter(VALUE self, VALUE filter) { gtk_file_chooser_add_filter(_SELF(self), RVAL2GTKFILEFILTER(filter)); return self; } static VALUE rg_remove_filter(VALUE self, VALUE filter) { gtk_file_chooser_remove_filter(_SELF(self), RVAL2GTKFILEFILTER(filter)); return self; } static VALUE rg_filters(VALUE self) { return GOBJGSLIST2RVAL_FREE(gtk_file_chooser_list_filters(_SELF(self)), g_slist_free, NULL); } static VALUE rg_add_shortcut_folder(VALUE self, VALUE rbfolder) { gchar *folder = RVAL2CSTRFILENAME(rbfolder); GError *error = NULL; gboolean ret = gtk_file_chooser_add_shortcut_folder(_SELF(self), folder, &error); g_free(folder); if (!ret) RAISE_GERROR(error); return self; } static VALUE rg_remove_shortcut_folder(VALUE self, VALUE rbfolder) { gchar *folder = RVAL2CSTRFILENAME(rbfolder); GError *error = NULL; gboolean ret = gtk_file_chooser_remove_shortcut_folder(_SELF(self), folder, &error); g_free(folder); if (!ret) RAISE_GERROR(error); return self; } static VALUE rg_shortcut_folders(VALUE self) { return FILENAMEGSLIST2RVAL_FREE(gtk_file_chooser_list_shortcut_folders(_SELF(self)), g_slist_free, g_free); } static VALUE rg_add_shortcut_folder_uri(VALUE self, VALUE uri) { GError *error = NULL; if (! gtk_file_chooser_add_shortcut_folder_uri(_SELF(self), RVAL2CSTR(uri), &error)) RAISE_GERROR(error); return self; } static VALUE rg_remove_shortcut_folder_uri(VALUE self, VALUE uri) { GError *error = NULL; if (! gtk_file_chooser_remove_shortcut_folder_uri(_SELF(self), RVAL2CSTR(uri), &error)) RAISE_GERROR(error); return self; } static VALUE rg_shortcut_folder_uris(VALUE self) { return gslist2ary_free(gtk_file_chooser_list_shortcut_folder_uris(_SELF(self))); } static VALUE rg_current_folder_file(VALUE self) { return GOBJ2RVAL(gtk_file_chooser_get_current_folder_file(_SELF(self))); } static VALUE rg_file(VALUE self) { return GOBJ2RVAL_UNREF(gtk_file_chooser_get_file(_SELF(self))); } static VALUE rg_files(VALUE self) { return GOBJGSLIST2RVAL_FREE(gtk_file_chooser_get_files(_SELF(self)), g_slist_free, g_object_unref); } static VALUE rg_preview_file(VALUE self) { return GOBJ2RVAL_UNREF(gtk_file_chooser_get_preview_file(_SELF(self))); } static VALUE rg_select_file(VALUE self, VALUE file) { GError *error = NULL; gtk_file_chooser_select_file(_SELF(self), RVAL2GFILE(file), &error); if (error) RAISE_GERROR(error); return self; } static VALUE rg_set_current_folder_file(VALUE self, VALUE file) { gboolean result; GError *error = NULL; result = gtk_file_chooser_set_current_folder_file(_SELF(self), RVAL2GFILE(file), &error); if (error) RAISE_GERROR(error); return CBOOL2RVAL(result); } static VALUE rg_set_file(VALUE self, VALUE file) { GError *error = NULL; gtk_file_chooser_set_file(_SELF(self), RVAL2GFILE(file), &error); if (error) RAISE_GERROR(error); return self; } static VALUE rg_unselect_file(VALUE self, VALUE file) { gtk_file_chooser_unselect_file(_SELF(self), RVAL2GFILE(file)); return self; } void Init_gtk_file_chooser(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_FILE_CHOOSER, "FileChooser", mGtk); RG_DEF_METHOD(set_current_name, 1); RG_DEF_METHOD(set_filename, 1); RG_DEF_METHOD(filename, 0); RG_DEF_METHOD(select_filename, 1); RG_DEF_METHOD(unselect_filename, 1); RG_DEF_METHOD(select_all, 0); RG_DEF_METHOD(unselect_all, 0); RG_DEF_METHOD(filenames, 0); RG_DEF_METHOD(set_current_folder, 1); RG_DEF_METHOD(current_folder, 0); RG_DEF_METHOD(set_uri, 1); RG_DEF_METHOD(uri, 0); RG_DEF_METHOD(select_uri, 1); RG_DEF_METHOD(unselect_uri, 1); RG_DEF_METHOD(uris, 0); RG_DEF_METHOD(set_current_folder_uri, 1); RG_DEF_METHOD(current_folder_uri, 0); RG_DEF_METHOD(preview_filename, 0); RG_DEF_METHOD(preview_uri, 0); RG_DEF_METHOD(add_filter, 1); RG_DEF_METHOD(remove_filter, 1); RG_DEF_METHOD(filters, 0); RG_DEF_METHOD(add_shortcut_folder, 1); RG_DEF_METHOD(remove_shortcut_folder, 1); RG_DEF_METHOD(shortcut_folders, 0); RG_DEF_METHOD(add_shortcut_folder_uri, 1); RG_DEF_METHOD(remove_shortcut_folder_uri, 1); RG_DEF_METHOD(shortcut_folder_uris, 0); RG_DEF_METHOD(current_folder_file, 0); RG_DEF_METHOD(file, 0); RG_DEF_METHOD(files, 0); RG_DEF_METHOD(preview_file, 0); RG_DEF_METHOD(select_file, 1); RG_DEF_METHOD(set_current_folder_file, 1); RG_DEF_METHOD(set_file, 1); RG_DEF_METHOD(unselect_file, 1); G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_ACTION, "Action", RG_TARGET_NAMESPACE); G_DEF_ERROR(GTK_FILE_CHOOSER_ERROR, "FileChooserError", mGtk, rb_eRuntimeError, GTK_TYPE_FILE_CHOOSER_ERROR); G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_CONFIRMATION, "Confirmation", RG_TARGET_NAMESPACE); G_DEF_CLASS3("GtkFileChooserEmbed", "FileChooserEmbed", mGtk); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-app-chooser.c���������������������������������������������0000644�0001750�0001750�00000002570�12102213527�020616� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mAppChooser #define _SELF(self) (RVAL2GTKAPPCHOOSER(self)) static VALUE rg_app_info(VALUE self) { return GOBJ2RVAL_UNREF(gtk_app_chooser_get_app_info(_SELF(self))); } static VALUE rg_refresh(VALUE self) { gtk_app_chooser_refresh(_SELF(self)); return self; } void Init_gtk_appchooser(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_APP_CHOOSER, "AppChooser", mGtk); RG_DEF_METHOD(app_info, 0); RG_DEF_METHOD(refresh, 0); } ����������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-table.c���������������������������������������������������0000644�0001750�0001750�00000012616�12102213527�017467� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTable #define _SELF(self) (RVAL2GTKTABLE(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE row, col, homogeneous; rb_scan_args(argc, argv, "21", &row, &col, &homogeneous); RBGTK_INITIALIZE(self, gtk_table_new(NUM2INT(row), NUM2INT(col), RVAL2CBOOL(homogeneous))); return Qnil; } static VALUE rg_resize(VALUE self, VALUE rows, VALUE columns) { gtk_table_resize(_SELF(self), NUM2UINT(rows), NUM2UINT(columns)); return self; } static VALUE rg_attach(int argc, VALUE *argv, VALUE self) { VALUE child, left, right, top, bottom; VALUE arg0, arg1, arg2, arg3; gint xspc, yspc; GtkAttachOptions xopt, yopt; xopt = yopt = GTK_EXPAND | GTK_FILL; xspc = yspc = 0; rb_scan_args(argc, argv, "54", &child, &left, &right, &top, &bottom, &arg0, &arg1, &arg2, &arg3); if (!NIL_P(arg0)) xopt = RVAL2GTKATTACHOPTIONS(arg0); if (!NIL_P(arg1)) yopt = RVAL2GTKATTACHOPTIONS(arg1); if (!NIL_P(arg2)) xspc = NUM2INT(arg2); if (!NIL_P(arg3)) yspc = NUM2INT(arg3); gtk_table_attach(_SELF(self), RVAL2GTKWIDGET(child), NUM2INT(left),NUM2INT(right), NUM2INT(top),NUM2INT(bottom), xopt, yopt, xspc, yspc); G_CHILD_ADD(self, child); return self; } static VALUE rg_attach_defaults(VALUE self, VALUE widget, VALUE left_attach, VALUE right_attach, VALUE top_attach, VALUE bottom_attach) { gtk_table_attach_defaults(_SELF(self), RVAL2GTKWIDGET(widget), NUM2UINT(left_attach), NUM2UINT(right_attach), NUM2UINT(top_attach), NUM2UINT(bottom_attach)); G_CHILD_ADD(self, widget); return self; } static VALUE tbl_set_row_spacing(VALUE self, VALUE row, VALUE spc) { gtk_table_set_row_spacing(_SELF(self), NUM2UINT(row), NUM2UINT(spc)); return self; } static VALUE rg_get_row_spacing(VALUE self, VALUE row) { return UINT2NUM(gtk_table_get_row_spacing(_SELF(self), NUM2UINT(row))); } static VALUE tbl_set_col_spacing(VALUE self, VALUE col, VALUE spc) { gtk_table_set_col_spacing(_SELF(self), NUM2UINT(col), NUM2UINT(spc)); return self; } static VALUE rg_get_column_spacing(VALUE self, VALUE col) { return UINT2NUM(gtk_table_get_col_spacing(_SELF(self), NUM2UINT(col))); } static VALUE rg_set_row_spacings(VALUE self, VALUE spc) { gtk_table_set_row_spacings(_SELF(self), NUM2UINT(spc)); return self; } static VALUE rg_set_column_spacings(VALUE self, VALUE spc) { gtk_table_set_col_spacings(_SELF(self), NUM2UINT(spc)); return self; } /* deprecated static VALUE rg_row_spacings(VALUE self) { return UINT2NUM(_SELF(self)->row_spacing); } static VALUE rg_column_spacings(VALUE self) { return UINT2NUM(_SELF(self)->column_spacing); } */ static VALUE rg_default_row_spacing(VALUE self) { return UINT2NUM(gtk_table_get_default_row_spacing(_SELF(self))); } static VALUE rg_default_column_spacing(VALUE self) { return UINT2NUM(gtk_table_get_default_col_spacing(_SELF(self))); } static VALUE rg_size(VALUE self) { guint rows, columns; gtk_table_get_size(_SELF(self), &rows, &columns); return rb_ary_new3(2, UINT2NUM(rows), UINT2NUM(columns)); } void Init_gtk_table(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TABLE, "Table", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(resize, 2); RG_DEF_METHOD(attach, -1); RG_DEF_METHOD(attach_defaults, 5); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "row_spacing", tbl_set_row_spacing, 2); rb_undef_method(RG_TARGET_NAMESPACE, "row_spacing="); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "column_spacing", tbl_set_col_spacing, 2); rb_undef_method(RG_TARGET_NAMESPACE, "column_spacing="); RG_DEF_METHOD(get_row_spacing, 1); rb_undef_method(RG_TARGET_NAMESPACE, "row_spacing"); RG_DEF_METHOD(get_column_spacing, 1); rb_undef_method(RG_TARGET_NAMESPACE, "column_spacing"); RG_DEF_METHOD(set_row_spacings, 1); RG_DEF_METHOD(set_column_spacings, 1); /* deprecated RG_DEF_METHOD(row_spacings, 0); RG_DEF_METHOD(column_spacings, 0); */ RG_DEF_METHOD(default_row_spacing, 0); RG_DEF_METHOD(default_column_spacing, 0); RG_DEF_METHOD(size, 0); } ������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-recent-chooser-widget.c�����������������������������������0000644�0001750�0001750�00000003130�12102213527�022570� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRecentChooserWidget #define _SELF(self) (RVAL2GTKRECENTCHOOSERWIDGET(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE manager; GtkWidget* widget; rb_scan_args(argc, argv, "01", &manager); if (NIL_P(manager)){ widget = gtk_recent_chooser_widget_new_for_manager(RVAL2GTKRECENTMANAGER(manager)); } else { widget = gtk_recent_chooser_widget_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_recent_chooser_widget(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_CHOOSER_WIDGET, "RecentChooserWidget", mGtk); RG_DEF_METHOD(initialize, -1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-progress-bar.c��������������������������������������������0000644�0001750�0001750�00000005113�12102213527�021000� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cProgressBar static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_progress_bar_new()); return Qnil; } static VALUE rg_pulse(VALUE self) { gtk_progress_bar_pulse(RVAL2GTKPROGRESSBAR(self)); return self; } void Init_gtk_progress_bar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PROGRESS_BAR, "ProgressBar", mGtk); /* GtkProgressBarOrientation */ /* deprecated G_DEF_CLASS(GTK_TYPE_PROGRESS_BAR_ORIENTATION, "Orientation", RG_TARGET_NAMESPACE); */ RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(pulse, 0); /* undef deprecated properties */ rb_undef_method(RG_TARGET_NAMESPACE, "adjustment"); rb_undef_method(RG_TARGET_NAMESPACE, "adjustment="); rb_undef_method(RG_TARGET_NAMESPACE, "set_adjustment"); rb_undef_method(RG_TARGET_NAMESPACE, "bar_style"); rb_undef_method(RG_TARGET_NAMESPACE, "bar_style="); rb_undef_method(RG_TARGET_NAMESPACE, "set_bar_style"); rb_undef_method(RG_TARGET_NAMESPACE, "discrete_blocks"); rb_undef_method(RG_TARGET_NAMESPACE, "discrete_blocks="); rb_undef_method(RG_TARGET_NAMESPACE, "set_discrete_blocks"); rb_undef_method(RG_TARGET_NAMESPACE, "activity_blocks"); rb_undef_method(RG_TARGET_NAMESPACE, "activity_blocks="); rb_undef_method(RG_TARGET_NAMESPACE, "set_activity_blocks"); rb_undef_method(RG_TARGET_NAMESPACE, "activity_step"); rb_undef_method(RG_TARGET_NAMESPACE, "activity_step="); rb_undef_method(RG_TARGET_NAMESPACE, "set_activity_step"); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-grid.c����������������������������������������������������0000644�0001750�0001750�00000005541�12102213527�017324� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cGrid #define _SELF(self) (RVAL2GTKGRID(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_grid_new()); return Qnil; } static VALUE rg_attach(VALUE self, VALUE child, VALUE left, VALUE top, VALUE width, VALUE height) { gtk_grid_attach(_SELF(self), RVAL2GTKWIDGET(child), NUM2INT(left), NUM2INT(top), NUM2INT(width), NUM2INT(height)); return self; } static VALUE rg_attach_next_to(VALUE self, VALUE child, VALUE sibling, VALUE side, VALUE width, VALUE height) { gtk_grid_attach_next_to(_SELF(self), RVAL2GTKWIDGET(child), NIL_P(sibling) ? NULL : RVAL2GTKWIDGET(sibling), RVAL2GTKPOSITIONTYPE(side), NUM2INT(width), NUM2INT(height)); return self; } #if GTK_CHECK_VERSION(3, 2, 0) static VALUE rg_get_child_at(VALUE self, VALUE left, VALUE top) { return GOBJ2RVAL(gtk_grid_get_child_at(_SELF(self), NUM2INT(left), NUM2INT(top))); } static VALUE rg_insert_column(VALUE self, VALUE position) { gtk_grid_insert_column(_SELF(self), NUM2INT(position)); return self; } static VALUE rg_insert_next_to(VALUE self, VALUE sibling, VALUE side) { gtk_grid_insert_next_to(_SELF(self), RVAL2GTKWIDGET(sibling), RVAL2GTKPOSITIONTYPE(side)); return self; } static VALUE rg_insert_row(VALUE self, VALUE position) { gtk_grid_insert_row(_SELF(self), NUM2INT(position)); return self; } #endif void Init_gtk_grid(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_GRID, "Grid", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(attach, 5); RG_DEF_METHOD(attach_next_to, 5); #if GTK_CHECK_VERSION(3, 2, 0) RG_DEF_METHOD(get_child_at, 2); RG_DEF_METHOD(insert_column, 1); RG_DEF_METHOD(insert_next_to, 2); RG_DEF_METHOD(insert_row, 1); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-text-mark.c�����������������������������������������������0000644�0001750�0001750�00000004014�12102213527�020305� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTextMark #define _SELF(s) (RVAL2GTKTEXTMARK(s)) static VALUE rg_initialize(VALUE self, VALUE name, VALUE left_gravity) { if (NIL_P(name)) G_INITIALIZE(self, gtk_text_mark_new(NULL, RVAL2CBOOL(left_gravity))); else G_INITIALIZE(self, gtk_text_mark_new(RVAL2CSTR(name), RVAL2CBOOL(left_gravity))); return Qnil; } static VALUE rg_set_visible(VALUE self, VALUE setting) { gtk_text_mark_set_visible(_SELF(self), RVAL2CBOOL(setting)); return setting; } static VALUE rg_visible_p(VALUE self) { return CBOOL2RVAL(gtk_text_mark_get_visible(_SELF(self))); } static VALUE rg_deleted_p(VALUE self) { return CBOOL2RVAL(gtk_text_mark_get_deleted(_SELF(self))); } static VALUE rg_buffer(VALUE self) { return GOBJ2RVAL(gtk_text_mark_get_buffer(_SELF(self))); } void Init_gtk_textmark(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_MARK, "TextMark", mGtk); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(set_visible, 1); RG_DEF_METHOD_P(visible, 0); RG_DEF_METHOD_P(deleted, 0); RG_DEF_METHOD(buffer, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-path.c�����������������������������������������������0000644�0001750�0001750�00000011105�12102213527�020261� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTreePath #define _SELF(s) (RVAL2GTKTREEPATH(s)) static ID id_equal; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE path; GtkTreePath* widget; if (argc == 1) { path = argv[0]; if (TYPE(path) == T_STRING){ widget = gtk_tree_path_new_from_string(RVAL2CSTR(path)); } else { widget = gtk_tree_path_new(); gtk_tree_path_append_index(widget, NUM2INT(path)); } if (widget == NULL) rb_raise(rb_eArgError, "Invalid path %s was passed.", RVAL2CSTR(path)); } else { int i; widget = gtk_tree_path_new(); for (i = 0; i < argc; i++) gtk_tree_path_append_index(widget, NUM2INT(argv[i])); } G_INITIALIZE(self, widget); return Qnil; } static VALUE rg_to_str(VALUE self) { gchar* s = gtk_tree_path_to_string(_SELF(self)); VALUE result = CSTR2RVAL(s); g_free(s); return result; } /* Do we need this ? GtkTreePath* gtk_tree_path_new_first (void); Deprecated #define gtk_tree_path_new_root () */ static VALUE rg_append_index(VALUE self, VALUE index) { gtk_tree_path_append_index(_SELF(self), NUM2INT(index)); return self; } static VALUE rg_prepend_index(VALUE self, VALUE index) { gtk_tree_path_prepend_index(_SELF(self), NUM2INT(index)); return self; } static VALUE rg_depth(VALUE self) { return INT2NUM(gtk_tree_path_get_depth(_SELF(self))); } static VALUE rg_indices(VALUE self) { VALUE ary; gint i, length; gint* indices; length = gtk_tree_path_get_depth(_SELF(self)); indices = gtk_tree_path_get_indices(_SELF(self)); if (indices != NULL) { ary = rb_ary_new2(length); for (i = 0; i < length; i++) { rb_ary_push(ary, INT2NUM(indices[i])); } return ary; } else { return Qnil; } } static VALUE rg_operator_treepath_compare(VALUE self, VALUE other) { return INT2NUM(gtk_tree_path_compare(_SELF(self), _SELF(other))); } static VALUE rg_operator_treepath_equal(VALUE self, VALUE other) { if (!RVAL2CBOOL(rb_funcall(CLASS_OF(self), id_equal, 1, CLASS_OF(other)))) { return Qfalse; } return CBOOL2RVAL(gtk_tree_path_compare(_SELF(self), _SELF(other)) == 0); } static VALUE rg_next_bang(VALUE self) { gtk_tree_path_next(_SELF(self)); return self; } static VALUE rg_prev_bang(VALUE self) { return CBOOL2RVAL(gtk_tree_path_prev(_SELF(self))); } static VALUE rg_up_bang(VALUE self) { return CBOOL2RVAL(gtk_tree_path_up(_SELF(self))); } static VALUE rg_down_bang(VALUE self) { gtk_tree_path_down(_SELF(self)); return Qtrue; } static VALUE rg_ancestor_p(VALUE self, VALUE descendant) { return CBOOL2RVAL(gtk_tree_path_is_ancestor(_SELF(self), _SELF(descendant))); } static VALUE rg_descendant_p(VALUE self, VALUE ancestor) { return CBOOL2RVAL(gtk_tree_path_is_descendant(_SELF(self), _SELF(ancestor))); } void Init_gtk_treepath(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_PATH, "TreePath", mGtk); id_equal = rb_intern("=="); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(to_str, 0); RG_DEF_ALIAS("to_s", "to_str"); RG_DEF_METHOD(append_index, 1); RG_DEF_METHOD(prepend_index, 1); RG_DEF_METHOD(depth, 0); RG_DEF_METHOD(indices, 0); RG_DEF_METHOD_OPERATOR("<=>", treepath_compare, 1); RG_DEF_METHOD_OPERATOR("==", treepath_equal, 1); RG_DEF_METHOD_BANG(next, 0); RG_DEF_METHOD_BANG(prev, 0); RG_DEF_METHOD_BANG(up, 0); RG_DEF_METHOD_BANG(down, 0); RG_DEF_METHOD_P(ancestor, 1); RG_DEF_METHOD_P(descendant, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-radio-menu-item.c�����������������������������������������0000644�0001750�0001750�00000011016�12102213527�021365� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi, * dellin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRadioMenuItem struct rbgtk_rval2gtkradiomenuitemgslist_args { VALUE ary; long n; GSList *result; }; static VALUE rbgtk_rval2gtkradiomenuitemgslist_body(VALUE value) { long i; struct rbgtk_rval2gtkradiomenuitemgslist_args *args = (struct rbgtk_rval2gtkradiomenuitemgslist_args *)value; for (i = 0; i < args->n; i++) args->result = g_slist_append(args->result, RVAL2GTKRADIOMENUITEM(RARRAY_PTR(args->ary)[i])); return Qnil; } static G_GNUC_NORETURN VALUE rbgtk_rval2gtkradiomenuitemgslist_rescue(VALUE value) { g_slist_free(((struct rbgtk_rval2gtkradiomenuitemgslist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GSList * rbgtk_rval2gtkradiomenuitemgslist(VALUE value) { struct rbgtk_rval2gtkradiomenuitemgslist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgtk_rval2gtkradiomenuitemgslist_body, (VALUE)&args, rbgtk_rval2gtkradiomenuitemgslist_rescue, (VALUE)&args); return args.result; } #define RVAL2GTKRADIOMENUITEMGSLIST(value) rbgtk_rval2gtkradiomenuitemgslist(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2, arg3; GtkWidget *widget; GSList *list = NULL; const gchar *label = NULL; const gchar *mnemonic = NULL; if (rb_scan_args(argc, argv, "03", &arg1, &arg2, &arg3) > 0 && TYPE(arg1) == T_STRING) { if (NIL_P(arg2) || RVAL2CBOOL(arg2)) mnemonic = RVAL2CSTR(arg1); else label = RVAL2CSTR(arg1); } else { if (!NIL_P(arg2)) { if (NIL_P(arg3) || RVAL2CBOOL(arg3)) mnemonic = RVAL2CSTR(arg2); else label = RVAL2CSTR(arg2); } if (rb_obj_is_kind_of(arg1, GTYPE2CLASS(GTK_TYPE_RADIO_MENU_ITEM))) list = gtk_radio_menu_item_get_group(RVAL2GTKRADIOMENUITEM(arg1)); else if (TYPE(arg1) == T_ARRAY) /* TODO: This might leak. */ list = RVAL2GTKRADIOMENUITEMGSLIST(arg1); else if (!NIL_P(arg1)) rb_raise(rb_eArgError, "invalid argument %s (expect Array or Gtk::RadioMenuItem)", rb_class2name(CLASS_OF(arg1))); } if (label != NULL) widget = gtk_radio_menu_item_new_with_label(list, label); else if (mnemonic != NULL) widget = gtk_radio_menu_item_new_with_mnemonic(list, mnemonic); else widget = gtk_radio_menu_item_new(list); RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rmitem_get_group(VALUE self) { return GOBJGSLIST2RVAL(gtk_radio_menu_item_get_group(RVAL2GTKRADIOMENUITEM(self))); } static VALUE rmitem_set_group(VALUE self, VALUE grp_ary) { GtkRadioMenuItem *rmitem2add, *rmitem_orig; GSList *group; rmitem2add = RVAL2GTKRADIOMENUITEM(self); rmitem_orig = RVAL2GTKRADIOMENUITEM(rb_ary_entry(grp_ary, 0)); group = gtk_radio_menu_item_get_group(rmitem_orig); gtk_radio_menu_item_set_group(rmitem2add, group); return GOBJGSLIST2RVAL(gtk_radio_menu_item_get_group(rmitem2add)); } void Init_gtk_radio_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RADIO_MENU_ITEM, "RadioMenuItem", mGtk); RG_DEF_METHOD(initialize, -1); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "group", rmitem_get_group, 0); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "group", rmitem_set_group, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-recent-manager.c������������������������������������������0000644�0001750�0001750�00000007634�12102213527�021274� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRecentManager #define _SELF(self) (RVAL2GTKRECENTMANAGER(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_recent_manager_new()); return Qnil; } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_recent_manager_get_default()); } static VALUE rg_add_item(int argc, VALUE *argv, VALUE self) { VALUE uri, data; gboolean ret; rb_scan_args(argc, argv, "11", &uri, &data); if (NIL_P(data)){ ret = gtk_recent_manager_add_item(_SELF(self), RVAL2CSTR(uri)); if (! ret) rb_raise(rb_eRuntimeError, "Can't add the uri"); } else { ret = gtk_recent_manager_add_full(_SELF(self), RVAL2CSTR(uri), RVAL2GTKRECENTDATA(data)); if (! ret) rb_raise(rb_eRuntimeError, "Can't add the uri or data"); } return self; } static VALUE rg_remove_item(VALUE self, VALUE uri) { GError* error = NULL; gboolean ret = gtk_recent_manager_remove_item(_SELF(self), RVAL2CSTR(uri), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_lookup_item(VALUE self, VALUE uri) { GError* error = NULL; GtkRecentInfo* info = gtk_recent_manager_lookup_item(_SELF(self), RVAL2CSTR(uri), &error); if (error) RAISE_GERROR(error); return GTKRECENTINFO2RVAL(info); } static VALUE rg_has_item_p(VALUE self, VALUE uri) { return CBOOL2RVAL(gtk_recent_manager_has_item(_SELF(self), RVAL2CSTR(uri))); } static VALUE rg_move_item(VALUE self, VALUE uri, VALUE new_uri) { GError* error = NULL; gboolean ret = gtk_recent_manager_move_item(_SELF(self), RVAL2CSTR(uri), RVAL2CSTR(new_uri), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_items(VALUE self) { return BOXEDGLIST2RVAL_FREE(gtk_recent_manager_get_items(_SELF(self)), GTK_TYPE_RECENT_INFO, g_list_free, gtk_recent_info_unref); } static VALUE rg_purge_items(VALUE self) { GError* error = NULL; gint ret = gtk_recent_manager_purge_items(_SELF(self), &error); if (error) RAISE_GERROR(error); return INT2NUM(ret); } void Init_gtk_recent_manager(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_MANAGER, "RecentManager", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_SMETHOD(default, 0); RG_DEF_METHOD(add_item, -1); RG_DEF_METHOD(remove_item, 1); RG_DEF_METHOD(lookup_item, 1); RG_DEF_METHOD_P(has_item, 1); RG_DEF_METHOD(move_item, 2); RG_DEF_METHOD(items, 0); RG_DEF_METHOD(purge_items, 0); G_DEF_ERROR(GTK_RECENT_MANAGER_ERROR, "RecentManagerError", mGtk, rb_eRuntimeError, GTK_TYPE_RECENT_MANAGER_ERROR); } ����������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-socket.c��������������������������������������������������0000644�0001750�0001750�00000004075�12102213527�017670� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 2002 Neil Conway * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #ifdef HAVE_GTK_SOCKET_GET_TYPE #include <gtk/gtkx.h> #define RG_TARGET_NAMESPACE cSocket #define _SELF(self) RVAL2GTKSOCKET(self) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_socket_new()); return Qnil; } static VALUE rg_add_id(VALUE self, VALUE wid) { gtk_socket_add_id(_SELF(self), #ifdef GDK_NATIVE_WINDOW_POINTER GUINT_TO_POINTER(NUM2ULONG(wid)) #else (guint32)NUM2UINT(wid) #endif ); return self; } static VALUE rg_plug_window(VALUE self) { return GOBJ2RVAL(gtk_socket_get_plug_window(_SELF(self))); } static VALUE rg_id(VALUE self) { Window id = gtk_socket_get_id(_SELF(self)); #ifdef GDK_NATIVE_WINDOW_POINTER return UINT2NUM(GPOINTER_TO_UINT(id)); #else return UINT2NUM(id); #endif } #endif void Init_gtk_socket(VALUE mGtk) { #ifdef HAVE_GTK_SOCKET_GET_TYPE VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SOCKET, "Socket", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(plug_window, 0); RG_DEF_METHOD(add_id, 1); RG_DEF_METHOD(id, 0); #endif } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-status-bar.c����������������������������������������������0000644�0001750�0001750�00000004231�12102213527�020457� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cStatusbar #define _SELF(self) (RVAL2GTKSTATUSBAR(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_statusbar_new()); return Qnil; } static VALUE rg_get_context_id(VALUE self, VALUE text) { return INT2FIX(gtk_statusbar_get_context_id(_SELF(self), RVAL2CSTR(text))); } static VALUE rg_push(VALUE self, VALUE id, VALUE text) { return INT2FIX(gtk_statusbar_push(_SELF(self), NUM2INT(id), RVAL2CSTR(text))); } static VALUE rg_pop(VALUE self, VALUE id) { gtk_statusbar_pop(_SELF(self), NUM2INT(id)); return self; } static VALUE rg_remove(VALUE self, VALUE cid, VALUE mid) { gtk_statusbar_remove(_SELF(self), NUM2INT(cid), NUM2INT(mid)); return self; } void Init_gtk_statusbar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_STATUSBAR, "Statusbar", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(get_context_id, 1); RG_DEF_METHOD(push, 2); RG_DEF_METHOD(pop, 1); RG_DEF_METHOD(remove, 2); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-layout.c��������������������������������������������������0000644�0001750�0001750�00000005210�12102213527�017705� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cLayout #define _SELF(self) (RVAL2GTKLAYOUT(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE hadjustment, vadjustment; GtkWidget* layout; rb_scan_args(argc, argv, "02", &hadjustment, &vadjustment); layout = gtk_layout_new( NIL_P(hadjustment) ? 0 : RVAL2GTKADJUSTMENT(hadjustment), NIL_P(vadjustment) ? 0 : RVAL2GTKADJUSTMENT(vadjustment)); RBGTK_INITIALIZE(self, layout); return Qnil; } static VALUE rg_put(VALUE self, VALUE widget, VALUE x, VALUE y) { gtk_layout_put(_SELF(self), RVAL2GTKWIDGET(widget), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_move(VALUE self, VALUE widget, VALUE x, VALUE y) { gtk_layout_move(_SELF(self), RVAL2GTKWIDGET(widget), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_set_size(VALUE self, VALUE width, VALUE height) { gtk_layout_set_size(_SELF(self), NUM2UINT(width), NUM2UINT(height)); return self; } static VALUE rg_size(VALUE self) { guint width, height; gtk_layout_get_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_bin_window(VALUE self) { return GOBJ2RVAL(gtk_layout_get_bin_window(_SELF(self))); } void Init_gtk_layout(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_LAYOUT, "Layout", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(put, 3); RG_DEF_METHOD(move, 3); RG_DEF_METHOD(set_size, 2); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(bin_window, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-icon-factory.c��������������������������������������������0000644�0001750�0001750�00000004476�12102213527�021002� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cIconFactory #define _SELF(s) (RVAL2GTKICONFACTORY(s)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_icon_factory_new()); return Qnil; } static VALUE rg_add(VALUE self, VALUE stock_id, VALUE icon_set) { VALUE buffer; gtk_icon_factory_add(_SELF(self), RVAL2GLIBID(stock_id, buffer), RVAL2GTKICONSET(icon_set)); return self; } static VALUE rg_add_default(VALUE self) { gtk_icon_factory_add_default(_SELF(self)); return self; } static VALUE rg_lookup(VALUE self, VALUE stock_id) { VALUE buffer; return GTKICONSET2RVAL(gtk_icon_factory_lookup(_SELF(self), RVAL2GLIBID(stock_id, buffer))); } static VALUE rg_s_lookup_default(G_GNUC_UNUSED VALUE self, VALUE stock_id) { VALUE buffer; return GTKICONSET2RVAL(gtk_icon_factory_lookup_default(RVAL2GLIBID(stock_id, buffer))); } static VALUE rg_remove_default(VALUE self) { gtk_icon_factory_remove_default(_SELF(self)); return self; } void Init_gtk_icon_factory(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_FACTORY, "IconFactory", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add, 2); RG_DEF_METHOD(add_default, 0); RG_DEF_METHOD(remove_default, 0); RG_DEF_METHOD(lookup, 1); RG_DEF_SMETHOD(lookup_default, 1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-style-context-gdk-screen.c��������������������������������0000644�0001750�0001750�00000003477�12102213527�023247� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cScreen #define _SELF(self) (RVAL2GDKSCREEN(self)) static VALUE rg_add_provider(VALUE self, VALUE provider, VALUE priority) { gtk_style_context_add_provider_for_screen(_SELF(self), RVAL2GTKSTYLEPROVIDER(provider), NUM2UINT(priority)); return self; } static VALUE rg_remove_provider(VALUE self, VALUE provider) { gtk_style_context_remove_provider_for_screen(_SELF(self), RVAL2GTKSTYLEPROVIDER(provider)); return self; } static VALUE rg_reset_widgets(VALUE self) { gtk_style_context_reset_widgets(_SELF(self)); return self; } void Init_gtk_style_context_gdk_screen(void) { VALUE RG_TARGET_NAMESPACE = GTYPE2CLASS(GDK_TYPE_SCREEN); RG_DEF_METHOD(add_provider, 2); RG_DEF_METHOD(remove_provider, 1); RG_DEF_METHOD(reset_widgets, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-size-group.c����������������������������������������������0000644�0001750�0001750�00000003664�12102213527�020507� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2005 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cSizeGroup #define _SELF(self) (RVAL2GTKSIZEGROUP(self)) static VALUE rg_initialize(VALUE self, VALUE mode) { G_INITIALIZE(self, gtk_size_group_new(RVAL2GTKSIZEGROUPMODE(mode))); return Qnil; } static VALUE rg_add_widget(VALUE self, VALUE widget) { gtk_size_group_add_widget(_SELF(self), RVAL2GTKWIDGET(widget)); return self; } static VALUE rg_remove_widget(VALUE self, VALUE widget) { gtk_size_group_remove_widget(_SELF(self), RVAL2GTKWIDGET(widget)); return self; } static VALUE rg_widgets(VALUE self) { return GOBJGSLIST2RVAL(gtk_size_group_get_widgets(_SELF(self))); } void Init_gtk_size_group(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SIZE_GROUP, "SizeGroup", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(add_widget, 1); RG_DEF_METHOD(remove_widget, 1); RG_DEF_METHOD(widgets, 0); G_DEF_CLASS(GTK_TYPE_SIZE_GROUP_MODE, "Mode", RG_TARGET_NAMESPACE); } ����������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-toggle-tool-button.c��������������������������������������0000644�0001750�0001750�00000003654�12102213527�022147� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cToggleToolButton #define _SELF(self) (RVAL2GTKTOGGLETOOLBUTTON(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg, buffer; GtkToolItem *item = NULL; rb_scan_args(argc, argv, "01", &arg); if (NIL_P(arg)) { item = gtk_toggle_tool_button_new(); } else if (TYPE(arg) == T_HASH) { VALUE stock_id; rbg_scan_options(arg, "stock_id", &stock_id, NULL); if (!NIL_P(stock_id)) item = gtk_toggle_tool_button_new_from_stock(RVAL2GLIBID(stock_id, buffer)); } else { item = gtk_toggle_tool_button_new_from_stock(RVAL2GLIBID(arg, buffer)); } if (!item) rb_raise(rb_eArgError, "Invalid arguments."); RBGTK_INITIALIZE(self, item); return Qnil; } void Init_gtk_toggletoolbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOGGLE_TOOL_BUTTON, "ToggleToolButton", mGtk); RG_DEF_METHOD(initialize, -1); } ������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-alignment.c�����������������������������������������������0000644�0001750�0001750�00000005077�12102213527�020361� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAlignment static VALUE rg_initialize(VALUE self, VALUE xalign, VALUE yalign, VALUE xscale, VALUE yscale) { RBGTK_INITIALIZE(self, gtk_alignment_new(NUM2DBL(xalign), NUM2DBL(yalign), NUM2DBL(xscale), NUM2DBL(yscale))); return Qnil; } static VALUE rg_set(VALUE self, VALUE xalign, VALUE yalign, VALUE xscale, VALUE yscale) { gtk_alignment_set(RVAL2GTKALIGNMENT(self), NUM2DBL(xalign), NUM2DBL(yalign), NUM2DBL(xscale), NUM2DBL(yscale)); return self; } static VALUE rg_padding(VALUE self) { guint top, bottom, left, right; gtk_alignment_get_padding(RVAL2GTKALIGNMENT(self), &top, &bottom, &left, &right); return rb_ary_new3(4, UINT2NUM(top), UINT2NUM(bottom), UINT2NUM(left), UINT2NUM(right)); } static VALUE rg_set_padding(VALUE self, VALUE top, VALUE bottom, VALUE left, VALUE right) { gtk_alignment_set_padding(RVAL2GTKALIGNMENT(self), NUM2UINT(top), NUM2UINT(bottom), NUM2UINT(left), NUM2UINT(right)); return self; } void Init_gtk_alignment(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ALIGNMENT, "Alignment", mGtk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(set, 4); RG_DEF_METHOD(padding, 0); RG_DEF_METHOD(set_padding, 4); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-editable.c�������������������������������������������0000644�0001750�0001750�00000003252�12102213527�021062� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mCellEditable #define _SELF(s) (RVAL2GTKCELLEDITABLE(s)) static VALUE rg_start_editing(VALUE self, VALUE event) { gtk_cell_editable_start_editing(_SELF(self), NIL_P(event) ? NULL : RVAL2GEV(event)); return self; } static VALUE rg_editing_done(VALUE self) { gtk_cell_editable_editing_done(_SELF(self)); return self; } static VALUE rg_remove_widget(VALUE self) { gtk_cell_editable_remove_widget(_SELF(self)); return self; } void Init_gtk_celleditable(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_CELL_EDITABLE, "CellEditable", mGtk); RG_DEF_METHOD(start_editing, 1); RG_DEF_METHOD(editing_done, 0); RG_DEF_METHOD(remove_widget, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-recent-chooser.c������������������������������������������0000644�0001750�0001750�00000012154�12102213527�021315� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mRecentChooser #define _SELF(self) (RVAL2GTKRECENTCHOOSER(self)) static VALUE rb_mGtk; struct callback_arg { VALUE callback; VALUE a, b; }; static VALUE invoke_callback(VALUE data) { struct callback_arg *arg = (struct callback_arg *)data; return rb_funcall(arg->callback, id_call, 1, arg->a, arg->b); } static void remove_callback_reference(gpointer callback) { G_CHILD_REMOVE(rb_mGtk, (VALUE)callback); } static gint sort_func(GtkRecentInfo *a, GtkRecentInfo *b, gpointer func) { struct callback_arg arg; arg.callback = (VALUE)func; arg.a = GTKRECENTINFO2RVAL(a); arg.b = GTKRECENTINFO2RVAL(b); return NUM2INT(G_PROTECT_CALLBACK(invoke_callback, &arg)); } static VALUE rg_set_sort_func(VALUE self) { VALUE func = rb_block_proc(); G_CHILD_ADD(rb_mGtk, func); gtk_recent_chooser_set_sort_func(_SELF(self), (GtkRecentSortFunc)sort_func, (gpointer)func, (GDestroyNotify)remove_callback_reference); return self; } static VALUE rg_set_current_uri(VALUE self, VALUE uri) { GError *error = NULL; gboolean ret = gtk_recent_chooser_set_current_uri(_SELF(self), RVAL2CSTR(uri), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_current_uri(VALUE self) { return CSTR2RVAL(gtk_recent_chooser_get_current_uri(_SELF(self))); } static VALUE rg_current_item(VALUE self) { return GTKRECENTINFO2RVAL(gtk_recent_chooser_get_current_item(_SELF(self))); } static VALUE rg_select_uri(VALUE self, VALUE uri) { GError *error = NULL; gboolean ret = gtk_recent_chooser_select_uri(_SELF(self), RVAL2CSTR(uri), &error); if (! ret) RAISE_GERROR(error); return self; } static VALUE rg_unselect_uri(VALUE self, VALUE uri) { gtk_recent_chooser_unselect_uri(_SELF(self), RVAL2CSTR(uri)); return self; } static VALUE rg_select_all(VALUE self) { gtk_recent_chooser_select_all(_SELF(self)); return self; } static VALUE rg_unselect_all(VALUE self) { gtk_recent_chooser_unselect_all(_SELF(self)); return self; } static VALUE rg_items(VALUE self) { GList* list = gtk_recent_chooser_get_items(_SELF(self)); VALUE ary = rb_ary_new(); while (list) { rb_ary_push(ary, GTKRECENTINFO2RVAL(list->data)); gtk_recent_info_unref(list->data); list = list->next; } g_list_free(list); return ary; } static VALUE rg_uris(VALUE self) { gsize i; gsize size; gchar** uris = gtk_recent_chooser_get_uris(_SELF(self), &size); VALUE ary = rb_ary_new(); for (i = 0; i < size; i++){ rb_ary_push(ary, CSTR2RVAL(uris[i])); } g_strfreev(uris); return ary; } static VALUE rg_add_filter(VALUE self, VALUE filter) { gtk_recent_chooser_add_filter(_SELF(self), RVAL2GTKRECENTFILTER(filter)); return self; } static VALUE rg_remove_filter(VALUE self, VALUE filter) { gtk_recent_chooser_remove_filter(_SELF(self), RVAL2GTKRECENTFILTER(filter)); return self; } static VALUE rg_filters(VALUE self) { return GOBJGSLIST2RVAL_FREE(gtk_recent_chooser_list_filters(_SELF(self)), g_slist_free, NULL); } void Init_gtk_recent_chooser(VALUE mGtk) { rb_mGtk = mGtk; VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_RECENT_CHOOSER, "RecentChooser", mGtk); RG_DEF_METHOD(set_sort_func, 0); RG_DEF_METHOD(set_current_uri, 1); RG_DEF_METHOD(current_uri, 0); RG_DEF_METHOD(current_item, 0); RG_DEF_METHOD(select_uri, 1); RG_DEF_METHOD(unselect_uri, 1); RG_DEF_METHOD(select_all, 0); RG_DEF_METHOD(unselect_all, 0); RG_DEF_METHOD(items, 0); RG_DEF_METHOD(uris, 0); RG_DEF_METHOD(add_filter, 1); RG_DEF_METHOD(remove_filter, 1); RG_DEF_METHOD(filters, 0); G_DEF_ERROR(GTK_RECENT_CHOOSER_ERROR, "RecentChooserError", mGtk, rb_eRuntimeError, GTK_TYPE_RECENT_CHOOSER_ERROR); G_DEF_CLASS(GTK_TYPE_RECENT_SORT_TYPE, "SortType", RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-icon-set.c������������������������������������������������0000644�0001750�0001750�00000004542�12102213527�020120� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cIconSet #define _SELF(s) (RVAL2GTKICONSET(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GtkIconSet *icon_set; VALUE pixbuf; rb_scan_args(argc, argv, "01", &pixbuf); if(NIL_P(pixbuf)) icon_set = gtk_icon_set_new(); else icon_set = gtk_icon_set_new_from_pixbuf(RVAL2GDKPIXBUF(pixbuf)); G_INITIALIZE(self, icon_set); return Qnil; } static VALUE rg_add_source(VALUE self, VALUE source) { gtk_icon_set_add_source(_SELF(self), RVAL2GTKICONSOURCE(source)); return self; } static VALUE rg_sizes(VALUE self) { GtkIconSize *sizes; gint n_sizes; VALUE result; int n; gtk_icon_set_get_sizes(_SELF(self), &sizes, &n_sizes); result = rb_ary_new(); for(n=0; n<n_sizes; n++, sizes++) rb_ary_push(result, GTKICONSIZE2RVAL(*sizes)); return result; } static VALUE rg_render_icon_pixbuf(VALUE self, VALUE context, VALUE size) { return GOBJ2RVAL(gtk_icon_set_render_icon_pixbuf(_SELF(self), RVAL2GTKSTYLECONTEXT(context), RVAL2GTKICONSIZE(size))); } void Init_gtk_icon_set(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ICON_SET, "IconSet", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(add_source, 1); RG_DEF_METHOD(sizes, 0); RG_DEF_METHOD(render_icon_pixbuf, 2); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-entry.c���������������������������������������������������0000644�0001750�0001750�00000012046�12102213527�017536� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cEntry #define _SELF(self) (RVAL2GTKENTRY(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_entry_new()); return Qnil; } static VALUE rg_layout(VALUE self) { return GOBJ2RVAL(gtk_entry_get_layout(_SELF(self))); } static VALUE rg_layout_offsets(VALUE self) { int x, y; gtk_entry_get_layout_offsets(_SELF(self), &x, &y); return rb_ary_new3(2, INT2NUM(x), INT2NUM(y)); } static VALUE rg_set_completion(VALUE self, VALUE completion) { gtk_entry_set_completion(_SELF(self), RVAL2GTKENTRYCOMPLETION(completion)); G_CHILD_SET(self, rb_intern("completion"), completion); return self; } static VALUE rg_completion(VALUE self) { return GOBJ2RVAL(gtk_entry_get_completion(_SELF(self))); } static VALUE rg_layout_index_to_text_index(VALUE self, VALUE layout_index) { return INT2NUM(gtk_entry_layout_index_to_text_index(_SELF(self), NUM2INT(layout_index))); } static VALUE rg_text_index_to_layout_index(VALUE self, VALUE text_index) { return INT2NUM(gtk_entry_text_index_to_layout_index(_SELF(self), NUM2INT(text_index))); } static VALUE rg_cursor_hadjustment(VALUE self) { return GOBJ2RVAL(gtk_entry_get_cursor_hadjustment(_SELF(self))); } static VALUE rg_set_cursor_hadjustment(VALUE self, VALUE adjustment) { gtk_entry_set_cursor_hadjustment(_SELF(self), RVAL2GTKADJUSTMENT(adjustment)); return self; } static VALUE rg_current_icon_drag_source(VALUE self) { return INT2NUM(gtk_entry_get_current_icon_drag_source(_SELF(self))); } static VALUE rg_get_icon_area(VALUE self, VALUE icon_pos) { GdkRectangle icon_area; gtk_entry_get_icon_area(_SELF(self), RVAL2GTKENTRYICONPOSITION(icon_pos), &icon_area); return GOBJ2RVAL(&icon_area); } static VALUE rg_get_icon_at_pos(VALUE self, VALUE x, VALUE y) { return INT2NUM(gtk_entry_get_icon_at_pos(_SELF(self), NUM2INT(x), NUM2INT(y))); } static VALUE rg_text_area(VALUE self) { GdkRectangle text_area; gtk_entry_get_text_area(_SELF(self), &text_area); return GOBJ2RVAL(&text_area); } static VALUE rg_im_context_filter_keypress(VALUE self, VALUE event) { gboolean result; result = gtk_entry_im_context_filter_keypress(_SELF(self), RVAL2GDKEVENTKEY(event)); return CBOOL2RVAL(result); } static VALUE rg_progress_pulse(VALUE self) { gtk_entry_progress_pulse(_SELF(self)); return self; } static VALUE rg_reset_im_context(VALUE self) { gtk_entry_reset_im_context(_SELF(self)); return self; } static VALUE rg_set_icon_drag_source(VALUE self, VALUE icon_pos, VALUE target_list, VALUE actions) { gtk_entry_set_icon_drag_source(_SELF(self), RVAL2GTKENTRYICONPOSITION(icon_pos), RVAL2GTKTARGETLIST(target_list), RVAL2GDKDRAGACTION(actions)); return self; } static VALUE rg_unset_invisible_char(VALUE self) { gtk_entry_unset_invisible_char(_SELF(self)); return self; } 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); RG_DEF_METHOD(set_completion, 1); RG_DEF_METHOD(completion, 0); RG_DEF_METHOD(layout_index_to_text_index, 1); RG_DEF_METHOD(text_index_to_layout_index, 1); RG_DEF_METHOD(cursor_hadjustment, 0); RG_DEF_METHOD(set_cursor_hadjustment, 1); RG_DEF_METHOD(current_icon_drag_source, 0); RG_DEF_METHOD(get_icon_area, 1); RG_DEF_METHOD(get_icon_at_pos, 2); RG_DEF_METHOD(text_area, 0); RG_DEF_METHOD(im_context_filter_keypress, 1); RG_DEF_METHOD(progress_pulse, 0); RG_DEF_METHOD(reset_im_context, 0); RG_DEF_METHOD(set_icon_drag_source, 3); RG_DEF_METHOD(unset_invisible_char, 0); RG_REG_GLIBID_SETTER("primary-icon-stock"); RG_REG_GLIBID_SETTER("secondary-icon-stock"); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/conversions.c���������������������������������������������������0000644�0001750�0001750�00000002166�11704226436�017652� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" static VALUE cairo_context_gvalue2rvalue(const GValue *value) { return CRCONTEXT2RVAL(g_value_get_boxed(value)); } void Init_conversions(void) { rbgobj_register_g2r_func(CAIRO_GOBJECT_TYPE_CONTEXT, cairo_context_gvalue2rvalue); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk3util.h����������������������������������������������������0000644�0001750�0001750�00000002223�11701304107�017360� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGTK3UTIL_H__ #define __RBGTK3UTIL_H__ G_BEGIN_DECLS typedef VALUE (*RBGTKAddButtonFunc)(VALUE self, VALUE button_text, VALUE response_id); G_GNUC_INTERNAL VALUE rbgtk_add_buttons(VALUE self, VALUE buttons, RBGTKAddButtonFunc add_button); G_END_DECLS #endif /* __RBGTK3UTIL_H__ */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-recent-filter-info.c��������������������������������������0000644�0001750�0001750�00000011104�12124610262�022064� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" /*****************************************/ static GtkRecentFilterInfo* rf_copy(const GtkRecentFilterInfo* info) { GtkRecentFilterInfo* new_info; g_return_val_if_fail (info != NULL, NULL); new_info = g_new(GtkRecentFilterInfo, 1); *new_info = *info; return new_info; } static void rf_free(GtkRecentFilterInfo* boxed) { if (boxed) { g_free(boxed->applications); g_free(boxed->groups); g_free(boxed); } } GType gtk_recent_filter_info_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkRecentFilterInfo", (GBoxedCopyFunc)rf_copy, (GBoxedFreeFunc)rf_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cRecentFilterInfo #define _SELF(w) (RVAL2GTKRECENTFILTERINFO(w)) static VALUE rg_initialize(VALUE self) { GtkRecentFilterInfo finfo; memset(&finfo, 0, sizeof(GtkRecentFilterInfo)); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_RECENT_FILTER_INFO, &finfo)); return Qnil; } static VALUE rg_contains(VALUE self) { return GTKRECENTFILTERFLAGS2RVAL(_SELF(self)->contains); } static VALUE rg_set_contains(VALUE self, VALUE contains) { _SELF(self)->contains = RVAL2GTKRECENTFILTERFLAGS(contains); return self; } static VALUE rg_uri(VALUE self) { return CSTR2RVAL(_SELF(self)->uri); } static VALUE rg_set_uri(VALUE self, VALUE val) { _SELF(self)->uri = RVAL2CSTR(val); return self; } static VALUE rg_display_name(VALUE self) { return CSTR2RVAL(_SELF(self)->display_name); } static VALUE rg_set_display_name(VALUE self, VALUE val) { _SELF(self)->display_name = RVAL2CSTR(val); return self; } static VALUE rg_mime_type(VALUE self) { return CSTR2RVAL(_SELF(self)->mime_type); } static VALUE rg_set_mime_type(VALUE self, VALUE val) { _SELF(self)->mime_type = RVAL2CSTR(val); return self; } static VALUE rg_applications(VALUE self) { const gchar** apps = _SELF(self)->applications; VALUE ary = rb_ary_new(); gint i = 0; while (apps[i]) { rb_ary_push(ary, CSTR2RVAL((gchar*)apps[i])); i++; } return ary; } static VALUE rg_set_applications(VALUE self, VALUE applications) { /* NOTE: This can't be right. What guarantees that the entries in * applications will be around? It should be RVAL2STRV_DUP and use * g_strfreev in free above. */ _SELF(self)->applications = RVAL2STRV(applications); return self; } static VALUE rg_groups(VALUE self) { const gchar** grps = _SELF(self)->groups; VALUE ary = rb_ary_new(); gint i = 0; while (grps[i]) { rb_ary_push(ary, CSTR2RVAL((gchar*)grps[i])); i++; } return ary; } static VALUE rg_set_groups(VALUE self, VALUE groups) { _SELF(self)->groups = RVAL2STRV(groups); return self; } static VALUE rg_age(VALUE self) { return INT2NUM(_SELF(self)->age); } static VALUE rg_set_age(VALUE self, VALUE age) { _SELF(self)->age = NUM2INT(age); return self; } void Init_gtk_recent_filter_info(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_FILTER_INFO, "RecentFilterInfo", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(contains, 0); RG_DEF_METHOD(set_contains, 1); RG_DEF_METHOD(uri, 0); RG_DEF_METHOD(set_uri, 1); RG_DEF_METHOD(display_name, 0); RG_DEF_METHOD(set_display_name, 1); RG_DEF_METHOD(mime_type, 0); RG_DEF_METHOD(set_mime_type, 1); RG_DEF_METHOD(applications, 0); RG_DEF_METHOD(set_applications, 1); RG_DEF_METHOD(groups, 0); RG_DEF_METHOD(set_groups, 1); RG_DEF_METHOD(age, 0); RG_DEF_METHOD(set_age, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-assistant.c�����������������������������������������������0000644�0001750�0001750�00000012706�12102213527�020411� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAssistant #define _SELF(s) (RVAL2GTKASSISTANT(s)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_assistant_new()); return Qnil; } static VALUE rg_current_page(VALUE self) { return INT2NUM(gtk_assistant_get_current_page(_SELF(self))); } static VALUE rg_set_current_page(VALUE self, VALUE page_num) { gtk_assistant_set_current_page(_SELF(self), NUM2INT(page_num)); return self; } static VALUE rg_n_pages(VALUE self) { return INT2NUM(gtk_assistant_get_n_pages(_SELF(self))); } static VALUE rg_get_nth_page(VALUE self, VALUE page_num) { return GOBJ2RVAL(gtk_assistant_get_nth_page(_SELF(self), NUM2INT(page_num))); } static VALUE rg_prepend_page(VALUE self, VALUE page) { return INT2NUM(gtk_assistant_prepend_page(_SELF(self), RVAL2GTKWIDGET(page))); } static VALUE rg_append_page(VALUE self, VALUE page) { return INT2NUM(gtk_assistant_append_page(_SELF(self), RVAL2GTKWIDGET(page))); } static VALUE rg_insert_page(VALUE self, VALUE page, VALUE position) { return INT2NUM(gtk_assistant_insert_page(_SELF(self), RVAL2GTKWIDGET(page), NUM2INT(position))); } static gint ass_page_func(gint current_page, gpointer func) { return NUM2INT(rb_funcall((VALUE)func, id_call, 1, INT2NUM(current_page))); } static VALUE rg_set_forward_page_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_assistant_set_forward_page_func(_SELF(self), (GtkAssistantPageFunc)ass_page_func, (gpointer)func, NULL); return self; } static VALUE rg_set_page_type(VALUE self, VALUE page, VALUE type) { gtk_assistant_set_page_type(_SELF(self), RVAL2GTKWIDGET(page), RVAL2GTKASSISTANTPAGETYPE(type)); return self; } static VALUE rg_get_page_type(VALUE self, VALUE page) { return GTKASSISTANTPAGETYPE2RVAL(gtk_assistant_get_page_type(_SELF(self), RVAL2GTKWIDGET(page))); } static VALUE rg_set_page_title(VALUE self, VALUE page, VALUE title) { gtk_assistant_set_page_title(_SELF(self), RVAL2GTKWIDGET(page), RVAL2CSTR(title)); return self; } static VALUE rg_get_page_title(VALUE self, VALUE page) { return CSTR2RVAL(gtk_assistant_get_page_title(_SELF(self), RVAL2GTKWIDGET(page))); } static VALUE rg_set_page_complete(VALUE self, VALUE page, VALUE complete) { gtk_assistant_set_page_complete(_SELF(self), RVAL2GTKWIDGET(page), RVAL2CBOOL(complete)); return self; } static VALUE rg_get_page_complete(VALUE self, VALUE page) { return CBOOL2RVAL(gtk_assistant_get_page_complete(_SELF(self), RVAL2GTKWIDGET(page))); } static VALUE rg_add_action_widget(VALUE self, VALUE child) { gtk_assistant_add_action_widget(_SELF(self), RVAL2GTKWIDGET(child)); return self; } static VALUE rg_remove_action_widget(VALUE self, VALUE child) { gtk_assistant_remove_action_widget(_SELF(self), RVAL2GTKWIDGET(child)); return self; } static VALUE rg_update_buttons_state(VALUE self) { gtk_assistant_update_buttons_state(_SELF(self)); return self; } static VALUE rg_commit(VALUE self) { gtk_assistant_commit(_SELF(self)); return self; } static VALUE rg_next_page(VALUE self) { gtk_assistant_next_page(_SELF(self)); return self; } static VALUE rg_previous_page(VALUE self) { gtk_assistant_previous_page(_SELF(self)); return self; } #if GTK_CHECK_VERSION(3, 2, 0) static VALUE rg_remove_page(VALUE self, VALUE page_num) { gtk_assistant_remove_page(_SELF(self), NUM2INT(page_num)); return self; } #endif void Init_gtk_assistant(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ASSISTANT, "Assistant", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(current_page, 0); RG_DEF_METHOD(set_current_page, 1); RG_DEF_METHOD(n_pages, 0); RG_DEF_METHOD(get_nth_page, 1); RG_DEF_METHOD(prepend_page, 1); RG_DEF_METHOD(append_page, 1); RG_DEF_METHOD(insert_page, 2); RG_DEF_METHOD(set_forward_page_func, 0); RG_DEF_METHOD(set_page_type, 2); RG_DEF_METHOD(get_page_type, 1); RG_DEF_METHOD(set_page_title, 2); RG_DEF_METHOD(get_page_title, 1); RG_DEF_METHOD(set_page_complete, 2); RG_DEF_METHOD(get_page_complete, 1); RG_DEF_METHOD(add_action_widget, 1); RG_DEF_METHOD(remove_action_widget, 1); RG_DEF_METHOD(update_buttons_state, 0); RG_DEF_METHOD(commit, 0); RG_DEF_METHOD(next_page, 0); RG_DEF_METHOD(previous_page, 0); #if GTK_CHECK_VERSION(3, 2, 0) RG_DEF_METHOD(remove_page, 1); #endif G_DEF_CLASS(GTK_TYPE_ASSISTANT_PAGE_TYPE, "PageType", RG_TARGET_NAMESPACE); } ����������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-renderer-progress.c����������������������������������0000644�0001750�0001750�00000002433�12102213527�022761� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Darren Willis * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCellRendererProgress static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_progress_new()); return Qnil; } void Init_gtk_cellrendererprogress(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_PROGRESS, "CellRendererProgress", mGtk); RG_DEF_METHOD(initialize, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-adjustment.c����������������������������������������������0000644�0001750�0001750�00000006040�12102213527�020550� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAdjustment #define _SELF(self) (RVAL2GTKADJUSTMENT(self)) static VALUE rg_initialize(VALUE self, VALUE value, VALUE lower, VALUE upper, VALUE step_inc, VALUE page_inc, VALUE page_size) { RBGTK_INITIALIZE(self, gtk_adjustment_new(NUM2DBL(value), NUM2DBL(lower), NUM2DBL(upper), NUM2DBL(step_inc), NUM2DBL(page_inc), NUM2DBL(page_size))); return Qnil; } static VALUE rg_clamp_page(VALUE self, VALUE lower, VALUE upper) { gtk_adjustment_clamp_page(_SELF(self), NUM2DBL(lower), NUM2DBL(upper)); return self; } static VALUE rg_changed(VALUE self) { gtk_adjustment_changed(_SELF(self)); return self; } static VALUE rg_value_changed(VALUE self) { gtk_adjustment_value_changed(_SELF(self)); return self; } static VALUE rg_configure(VALUE self, VALUE value, VALUE lower, VALUE upper, VALUE step_increment, VALUE page_increment, VALUE page_size) { gtk_adjustment_configure(_SELF(self), NUM2DBL(value), NUM2DBL(lower), NUM2DBL(upper), NUM2DBL(step_increment), NUM2DBL(page_increment), NUM2DBL(page_size)); return self; } #if GTK_CHECK_VERSION(3, 2, 0) static VALUE rg_minimum_increment(VALUE self) { return DBL2NUM(gtk_adjustment_get_minimum_increment(_SELF(self))); } #endif void Init_gtk_adjustment(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ADJUSTMENT, "Adjustment", mGtk); RG_DEF_METHOD(initialize, 6); RG_DEF_METHOD(clamp_page, 2); RG_DEF_METHOD(changed, 0); RG_DEF_METHOD(value_changed, 0); RG_DEF_METHOD(configure, 6); #if GTK_CHECK_VERSION(3, 2, 0) RG_DEF_METHOD(minimum_increment, 0); #endif } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-switch.c��������������������������������������������������0000644�0001750�0001750�00000002330�12102213527�017671� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cSwitch #define _SELF(self) (RVAL2GTKSWITCH(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_switch_new()); return Qnil; } void Init_gtk_switch(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SWITCH, "Switch", mGtk); RG_DEF_METHOD(initialize, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-menu-tool-button.c����������������������������������������0000644�0001750�0001750�00000005177�12102213527�021634� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cMenuToolButton #define _SELF(self) (RVAL2GTKMENUTOOLBUTTON(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg; GtkToolItem *item = NULL; rb_scan_args(argc, argv, "01", &arg); if (NIL_P(arg)) { item = gtk_menu_tool_button_new(NULL, NULL); } else if (TYPE(arg) == T_HASH) { VALUE icon_widget, label, stock_id, buffer; rbg_scan_options(arg, "icon_widget", &icon_widget, "label", &label, "stock_id", &stock_id, NULL); if (!NIL_P(icon_widget)) item = gtk_menu_tool_button_new(RVAL2GTKWIDGET(icon_widget), RVAL2CSTR_ACCEPT_NIL(label)); else if (!NIL_P(stock_id)) item = gtk_menu_tool_button_new_from_stock(RVAL2GLIBID(stock_id, buffer)); } if (!item) rb_raise(rb_eArgError, "Invalid arguments."); RBGTK_INITIALIZE(self, item); return Qnil; } /* deprecated static VALUE rg_set_arrow_tooltip(int argc, VALUE *argv, VALUE self) { VALUE tooltips, tip_text, tip_private; rb_scan_args(argc, argv, "12", &tooltips, &tip_text, &tip_private); gtk_menu_tool_button_set_arrow_tooltip(_SELF(self), RVAL2GTKTOOLTIPS(self), RVAL2CSTR_ACCEPT_NIL(tip_text), RVAL2CSTR_ACCEPT_NIL(tip_private)); return self; } */ void Init_gtk_menutoolbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU_TOOL_BUTTON, "MenuToolButton", mGtk); RG_DEF_METHOD(initialize, -1); /* deprecated RG_DEF_METHOD(set_arrow_tooltip, -1); */ } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-widget-path.c���������������������������������������������0000644�0001750�0001750�00000013372�12102213527�020615� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cWidgetPath #define _SELF(self) (RVAL2GTKWIDGETPATH(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_widget_path_new()); return Qnil; } static VALUE rg_append_type(VALUE self, VALUE type) { gint pos; pos = gtk_widget_path_append_type(_SELF(self), CLASS2GTYPE(type)); return INT2NUM(pos); } static VALUE rg_object_type(VALUE self) { return GTYPE2CLASS(gtk_widget_path_get_object_type(_SELF(self))); } static VALUE rg_has_parent_p(VALUE self, VALUE type) { return CBOOL2RVAL(gtk_widget_path_has_parent(_SELF(self), CLASS2GTYPE(type))); } static VALUE rg_type_p(VALUE self, VALUE type) { return CBOOL2RVAL(gtk_widget_path_is_type(_SELF(self), CLASS2GTYPE(type))); } static VALUE rg_iter_add_class(VALUE self, VALUE pos, VALUE name) { gtk_widget_path_iter_add_class(_SELF(self), NUM2INT(pos), RVAL2CSTR(name)); return self; } static VALUE rg_iter_add_region(VALUE self, VALUE pos, VALUE name, VALUE flags) { gtk_widget_path_iter_add_region(_SELF(self), NUM2INT(pos), RVAL2CSTR(name), RVAL2GTKREGIONFLAGS(flags)); return self; } static VALUE rg_iter_clear_classes(VALUE self, VALUE pos) { gtk_widget_path_iter_clear_classes(_SELF(self), NUM2INT(pos)); return self; } static VALUE rg_iter_clear_regions(VALUE self, VALUE pos) { gtk_widget_path_iter_clear_regions(_SELF(self), NUM2INT(pos)); return self; } static VALUE rg_iter_get_name(VALUE self, VALUE pos) { return CSTR2RVAL(gtk_widget_path_iter_get_name(_SELF(self), NUM2INT(pos))); } static VALUE rg_iter_get_object_type(VALUE self, VALUE pos) { return GTYPE2CLASS(gtk_widget_path_iter_get_object_type(_SELF(self), NUM2INT(pos))); } static VALUE rg_iter_has_class_p(VALUE self, VALUE pos, VALUE name) { return CBOOL2RVAL(gtk_widget_path_iter_has_class(_SELF(self), NUM2INT(pos), RVAL2CSTR(name))); } static VALUE rg_iter_has_name_p(VALUE self, VALUE pos, VALUE name) { return CBOOL2RVAL(gtk_widget_path_iter_has_name(_SELF(self), NUM2INT(pos), RVAL2CSTR(name))); } static VALUE rg_iter_has_region(VALUE self, VALUE pos, VALUE name) { GtkRegionFlags flags; gboolean result; result = gtk_widget_path_iter_has_region(_SELF(self), NUM2INT(pos), RVAL2CSTR(name), &flags); return result ? GTKREGIONFLAGS2RVAL(flags) : Qnil; } static VALUE rg_iter_list_classes(VALUE self, VALUE pos) { return CSTRGSLIST2RVAL_FREE(gtk_widget_path_iter_list_classes(_SELF(self), NUM2INT(pos)), g_slist_free, NULL); } static VALUE rg_iter_list_regions(VALUE self, VALUE pos) { return CSTRGSLIST2RVAL_FREE(gtk_widget_path_iter_list_regions(_SELF(self), NUM2INT(pos)), g_slist_free, NULL); } static VALUE rg_iter_remove_class(VALUE self, VALUE pos, VALUE name) { gtk_widget_path_iter_remove_class(_SELF(self), NUM2INT(pos), RVAL2CSTR(name)); return self; } static VALUE rg_iter_remove_region(VALUE self, VALUE pos, VALUE name) { gtk_widget_path_iter_remove_region(_SELF(self), NUM2INT(pos), RVAL2CSTR(name)); return self; } static VALUE rg_iter_set_name(VALUE self, VALUE pos, VALUE name) { gtk_widget_path_iter_set_name(_SELF(self), NUM2INT(pos), RVAL2CSTR(name)); return self; } static VALUE rg_iter_set_object_type(VALUE self, VALUE pos, VALUE type) { gtk_widget_path_iter_set_object_type(_SELF(self), NUM2INT(pos), CLASS2GTYPE(type)); return self; } static VALUE rg_length(VALUE self) { return INT2NUM(gtk_widget_path_length(_SELF(self))); } static VALUE rg_prepend_type(VALUE self, VALUE type) { gtk_widget_path_prepend_type(_SELF(self), CLASS2GTYPE(type)); return self; } #if GTK_CHECK_VERSION(3, 2, 0) static VALUE rg_to_s(VALUE self) { return CSTR2RVAL(gtk_widget_path_to_string(_SELF(self))); } #endif void Init_gtk_widgetpath(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_WIDGET_PATH, "WidgetPath", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(append_type, 1); RG_DEF_METHOD_P(has_parent, 1); RG_DEF_METHOD(iter_add_class, 2); RG_DEF_METHOD(iter_add_region, 3); RG_DEF_METHOD(iter_clear_classes, 1); RG_DEF_METHOD(iter_clear_regions, 1); RG_DEF_METHOD(iter_get_name, 1); RG_DEF_METHOD(iter_get_object_type, 1); RG_DEF_METHOD_P(iter_has_class, 2); RG_DEF_METHOD_P(iter_has_name, 2); RG_DEF_METHOD(iter_has_region, 2); RG_DEF_METHOD(iter_list_classes, 1); RG_DEF_METHOD(iter_list_regions, 1); RG_DEF_METHOD(iter_remove_class, 2); RG_DEF_METHOD(iter_remove_region, 2); RG_DEF_METHOD(iter_set_name, 2); RG_DEF_METHOD(iter_set_object_type, 2); RG_DEF_METHOD(length, 0); RG_DEF_METHOD(object_type, 0); RG_DEF_METHOD(prepend_type, 1); #if GTK_CHECK_VERSION(3, 2, 0) RG_DEF_METHOD(to_s, 0); #endif RG_DEF_METHOD_P(type, 1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-view-column.c����������������������������������������0000644�0001750�0001750�00000016561�12102213527�021605� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTreeViewColumn #define _SELF(s) (RVAL2GTKTREEVIEWCOLUMN(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { int i; int col; GtkTreeViewColumn *tvc; GtkCellRenderer *renderer; const gchar *name; VALUE ary, val; tvc = gtk_tree_view_column_new(); if (argc > 0){ gtk_tree_view_column_set_title(tvc, RVAL2CSTR(argv[0])); if (argc > 1) { gtk_tree_view_column_pack_start(tvc, RVAL2GTKCELLRENDERER(argv[1]), TRUE); G_CHILD_ADD(self, argv[1]); } } RBGTK_INITIALIZE(self, tvc); if (argc == 3){ ary = rb_funcall(argv[2], rb_intern("to_a"), 0); renderer = RVAL2GTKCELLRENDERER(argv[1]); for (i = 0; i < RARRAY_LEN(ary); i++) { val = RARRAY_PTR(RARRAY_PTR(ary)[i])[0]; if (SYMBOL_P(val)) { name = rb_id2name(SYM2ID(val)); } else { name = RVAL2CSTR(val); } col = NUM2INT(RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); gtk_tree_view_column_add_attribute(_SELF(self), renderer, name, col); } } return Qnil; } static VALUE rg_pack_start(VALUE self, VALUE cell, VALUE expand) { G_CHILD_ADD(self, cell); gtk_tree_view_column_pack_start(_SELF(self), RVAL2GTKCELLRENDERER(cell), RVAL2CBOOL(expand)); return self; } static VALUE rg_pack_end(VALUE self, VALUE cell, VALUE expand) { G_CHILD_ADD(self, cell); gtk_tree_view_column_pack_end(_SELF(self), RVAL2GTKCELLRENDERER(cell), RVAL2CBOOL(expand)); return self; } static VALUE rg_clear(VALUE self) { G_CHILD_REMOVE_ALL(self); gtk_tree_view_column_clear(_SELF(self)); return self; } static VALUE rg_add_attribute(VALUE self, VALUE cell, VALUE attribute, VALUE column) { const gchar *name; if (SYMBOL_P(attribute)) { name = rb_id2name(SYM2ID(attribute)); } else { name = RVAL2CSTR(attribute); } gtk_tree_view_column_add_attribute(_SELF(self), RVAL2GTKCELLRENDERER(cell), name, NUM2INT(column)); return self; } static VALUE rg_set_attributes(VALUE self, VALUE renderer, VALUE attributes) { GtkTreeViewColumn *tvc; GtkCellRenderer *grenderer; const gchar *name; int i, col; VALUE ary, val; Check_Type(attributes, T_HASH); tvc = _SELF(self); grenderer = RVAL2GTKCELLRENDERER(renderer); gtk_tree_view_column_clear_attributes(tvc, grenderer); ary = rb_funcall(attributes, rb_intern("to_a"), 0); for (i = 0; i < RARRAY_LEN(ary); i++) { val = RARRAY_PTR(RARRAY_PTR(ary)[i])[0]; if (SYMBOL_P(val)) { name = rb_id2name(SYM2ID(val)); } else { name = RVAL2CSTR(val); } col = NUM2INT(RARRAY_PTR(RARRAY_PTR(ary)[i])[1]); gtk_tree_view_column_add_attribute(tvc, grenderer, name, col); } return self; } static void cell_data_func(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer func) { iter->user_data3 = model; rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(tree_column), GOBJ2RVAL(cell), GOBJ2RVAL(model), GTKTREEITER2RVAL(iter)); } static VALUE rg_set_cell_data_func(VALUE self, VALUE renderer) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); G_RELATIVE(renderer, func); gtk_tree_view_column_set_cell_data_func(_SELF(self), RVAL2GTKCELLRENDERER(renderer), (GtkTreeCellDataFunc)cell_data_func, (gpointer)func, NULL); return self; } static VALUE rg_clear_attributes(VALUE self, VALUE cell) { gtk_tree_view_column_clear_attributes(_SELF(self), RVAL2GTKCELLRENDERER(cell)); return self; } static VALUE rg_clicked(VALUE self) { gtk_tree_view_column_clicked(_SELF(self)); return self; } static VALUE rg_cell_set_cell_data(VALUE self, VALUE model, VALUE iter, VALUE is_expander, VALUE is_expanded) { gtk_tree_view_column_cell_set_cell_data(_SELF(self), RVAL2GTKTREEMODEL(model), RVAL2GTKTREEITER(iter), RVAL2CBOOL(is_expander), RVAL2CBOOL(is_expanded)); return self; } static VALUE rg_cell_size(VALUE self) { GdkRectangle cell_area; gint x_offset, y_offset, width, height; VALUE cell; /* Is this collect implement for cell_area ? */ cell_area.x = -1; cell_area.y = -1; cell_area.width = -1; cell_area.height = -1; gtk_tree_view_column_cell_get_size(_SELF(self), &cell_area, &x_offset, &y_offset, &width, &height); if (cell_area.x == -1 || cell_area.y == -1 || cell_area.width == -1 || cell_area.height == -1){ cell = Qnil; } else { cell = GDKRECTANGLE2RVAL(&cell_area); } return rb_ary_new3(5, cell, x_offset ? INT2NUM(x_offset) : Qnil, y_offset ? INT2NUM(y_offset) : Qnil, width ? INT2NUM(width) : Qnil, height ? INT2NUM(height) : Qnil); } static VALUE rg_cell_is_visible_p(VALUE self) { return CBOOL2RVAL(gtk_tree_view_column_cell_is_visible(_SELF(self))); } static VALUE rg_focus_cell(VALUE self, VALUE renderer) { gtk_tree_view_column_focus_cell(_SELF(self), RVAL2GTKCELLRENDERER(renderer)); return self; } static VALUE rg_queue_resize(VALUE self) { gtk_tree_view_column_queue_resize(_SELF(self)); return self; } static VALUE rg_tree_view(VALUE self) { return GOBJ2RVAL(gtk_tree_view_column_get_tree_view(_SELF(self))); } void Init_gtk_treeviewcolumn(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_VIEW_COLUMN, "TreeViewColumn", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(pack_start, 2); RG_DEF_METHOD(pack_end, 2); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD(add_attribute, 3); RG_DEF_METHOD(set_attributes, 2); RG_DEF_METHOD(set_cell_data_func, 1); RG_DEF_METHOD(clear_attributes, 1); RG_DEF_METHOD(clicked, 0); RG_DEF_METHOD(cell_set_cell_data, 4); RG_DEF_METHOD(cell_size, 0); RG_DEF_METHOD_P(cell_is_visible, 0); RG_DEF_METHOD(focus_cell, 1); RG_DEF_METHOD(queue_resize, 0); RG_DEF_METHOD(tree_view, 0); G_DEF_CLASS(GTK_TYPE_TREE_VIEW_COLUMN_SIZING, "Sizing", RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-accel-key.c�����������������������������������������������0000644�0001750�0001750�00000005537�12124610262�020242� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAccelKey #define _SELF(s) (RVAL2GTKACCELKEY(s)) #define GTK_TYPE_ACCEL_KEY (gtk_accel_key_get_type()) static GtkAccelKey * accel_key_copy(const GtkAccelKey *key) { GtkAccelKey *new_key; g_return_val_if_fail (key != NULL, NULL); new_key = g_new(GtkAccelKey, 1); *new_key = *key; return new_key; } GType gtk_accel_key_get_type(void) { static GType our_type = 0; if(our_type == 0) our_type = g_boxed_type_register_static("GtkAccelKey", (GBoxedCopyFunc)accel_key_copy, (GBoxedFreeFunc)g_free); return our_type; } /* struct _GtkAccelKey { guint accel_key; GdkModifierType accel_mods; guint accel_flags : 16; }; */ static VALUE rg_initialize(VALUE self) { GtkAccelKey key; memset(&key, 0, sizeof(GtkAccelKey)); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_ACCEL_KEY, &key)); return Qnil; } static VALUE rg_key(VALUE self) { return UINT2NUM(_SELF(self)->accel_key); } static VALUE rg_mods(VALUE self) { return GDKMODIFIERTYPE2RVAL(_SELF(self)->accel_mods); } static VALUE rg_flags(VALUE self) { return INT2FIX(_SELF(self)->accel_flags); } static VALUE rg_set_key(VALUE self, VALUE key) { _SELF(self)->accel_key = NUM2UINT(key); return self; } static VALUE rg_set_mods(VALUE self, VALUE mods) { _SELF(self)->accel_mods = RVAL2GDKMODIFIERTYPE(mods); return self; } static VALUE rg_set_flags(VALUE self, VALUE flags) { _SELF(self)->accel_flags = FIX2INT(flags); return self; } void Init_gtk_accel_key(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCEL_KEY, "AccelKey", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(key, 0); RG_DEF_METHOD(mods, 0); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(set_key, 1); RG_DEF_METHOD(set_mods, 1); RG_DEF_METHOD(set_flags, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-paned.c���������������������������������������������������0000644�0001750�0001750�00000005771�12102213527�017473� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cPaned #define _SELF(self) (RVAL2GTKPANED(self)) static VALUE rg_initialize(VALUE self, VALUE orientation) { RBGTK_INITIALIZE(self, gtk_paned_new(RVAL2GTKORIENTATION(orientation))); return Qnil; } static VALUE rg_add1(VALUE self, VALUE child) { gtk_paned_add1(_SELF(self), RVAL2GTKWIDGET(child)); return self; } static VALUE rg_add2(VALUE self, VALUE child) { gtk_paned_add2(_SELF(self), RVAL2GTKWIDGET(child)); return self; } static void paned_pack(int argc, VALUE *argv, VALUE self, void (*func)(GtkPaned *, GtkWidget *, gboolean, gboolean), gboolean resize_default) { VALUE options, child, resize, shrink; rb_scan_args(argc, argv, "11", &child, &options); rbg_scan_options(options, "resize", &resize, "shrink", &shrink, NULL); func(_SELF(self), RVAL2GTKWIDGET(child), NIL_P(resize) ? resize_default : RVAL2CBOOL(resize), NIL_P(shrink) ? TRUE : RVAL2CBOOL(shrink)); } static VALUE rg_pack1(int argc, VALUE *argv, VALUE self) { paned_pack(argc, argv, self, gtk_paned_pack1, FALSE); return self; } static VALUE rg_pack2(int argc, VALUE *argv, VALUE self) { paned_pack(argc, argv, self, gtk_paned_pack2, TRUE); return self; } static VALUE rg_child1(VALUE self) { return GOBJ2RVAL(gtk_paned_get_child1(_SELF(self))); } static VALUE rg_child2(VALUE self) { return GOBJ2RVAL(gtk_paned_get_child2(_SELF(self))); } static VALUE rg_handle_window(VALUE self) { return GOBJ2RVAL(gtk_paned_get_handle_window(_SELF(self))); } void Init_gtk_paned(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PANED, "Paned", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(add1, 1); RG_DEF_METHOD(add2, 1); RG_DEF_METHOD(pack1, -1); RG_DEF_METHOD(pack2, -1); RG_DEF_METHOD(child1, 0); RG_DEF_METHOD(child2, 0); RG_DEF_METHOD(handle_window, 0); } �������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-status-icon.c���������������������������������������������0000644�0001750�0001750�00000007415�12102213527�020652� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cStatusIcon #define _SELF(w) (RVAL2GTKSTATUSICON(w)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg; GtkStatusIcon *icon = NULL; rb_scan_args(argc, argv, "01", &arg); if (NIL_P(arg)) { icon = gtk_status_icon_new(); } else if (TYPE(arg) == T_HASH) { VALUE stock, icon_name, gicon, file, pixbuf, buffer; rbg_scan_options(arg, "stock", &stock, "icon_name", &icon_name, "gicon", &gicon, "file", &file, "pixbuf", &pixbuf, NULL); if (!NIL_P(stock)) icon = gtk_status_icon_new_from_stock(RVAL2GLIBID(stock, buffer)); else if (!NIL_P(icon_name)) icon = gtk_status_icon_new_from_icon_name(RVAL2CSTR(icon_name)); else if (!NIL_P(gicon)) icon = gtk_status_icon_new_from_gicon(RVAL2GICON(gicon)); else if (!NIL_P(file)) icon = gtk_status_icon_new_from_file(RVAL2CSTR(file)); else if (!NIL_P(pixbuf)) icon = gtk_status_icon_new_from_pixbuf(RVAL2GDKPIXBUF(pixbuf)); } else { GType gtype = RVAL2GTYPE(arg); if (gtype == GDK_TYPE_PIXBUF) icon = gtk_status_icon_new_from_pixbuf(RVAL2GDKPIXBUF(arg)); else if (g_type_is_a(gtype, G_TYPE_ICON)) icon = gtk_status_icon_new_from_gicon(RVAL2GICON(arg)); } if (!icon) rb_raise(rb_eArgError, "Invalid arguments."); G_INITIALIZE(self, icon); return Qnil; } /* deprecated static VALUE rg_set_tooltip(VALUE self, VALUE tooltip_text) { gtk_status_icon_set_tooltip(_SELF(self), RVAL2CSTR(tooltip_text)); return self; } */ static VALUE rg_position_menu(VALUE self, VALUE menu) { gint x, y; gboolean push_in; gtk_status_icon_position_menu(RVAL2GTKMENU(menu), &x, &y, &push_in, (gpointer)(_SELF(self))); return rb_ary_new3(3, INT2NUM(x), INT2NUM(y), CBOOL2RVAL(push_in)); } static VALUE rg_geometry(VALUE self) { GdkScreen* screen; GdkRectangle area; GtkOrientation orientation; gboolean ret = gtk_status_icon_get_geometry(_SELF(self), &screen, &area, &orientation); if (ret) { return rb_ary_new3(3, GOBJ2RVAL(screen), GDKRECTANGLE2RVAL(&area), GTKORIENTATION2RVAL(orientation)); } else { return rb_ary_new3(3, Qnil, Qnil, Qnil); } } void Init_gtk_status_icon(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_STATUS_ICON, "StatusIcon", mGtk); RG_DEF_METHOD(initialize, -1); /* deprecated RG_DEF_METHOD(set_tooltip, 1); */ RG_DEF_METHOD(position_menu, 1); RG_DEF_METHOD(geometry, 0); RG_REG_GLIBID_SETTER("stock"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-font-chooser-dialog.c�������������������������������������0000644�0001750�0001750�00000003347�12102213527�022244� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #if GTK_CHECK_VERSION(3, 2, 0) #define RG_TARGET_NAMESPACE cFontChooserDialog #define _SELF(self) (RVAL2GTKFONTCHOOSERDIALOG(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, rb_title, rb_parent; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "title", &rb_title, "parent", &rb_parent, NULL); /* TODO: accept NULL? */ widget = gtk_font_chooser_dialog_new(RVAL2CSTR(rb_title), RVAL2GTKWINDOW(rb_parent)); RBGTK_INITIALIZE(self, widget); return Qnil; } #endif void Init_gtk_fontchooserdialog(VALUE mGtk) { #if GTK_CHECK_VERSION(3, 2, 0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FONT_CHOOSER_DIALOG, "FontChooserDialog", mGtk); RG_DEF_METHOD(initialize, -1); #endif } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-text-child-anchor.c���������������������������������������0000644�0001750�0001750�00000003306�12102213527�021711� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTextChildAnchor #define _SELF(self) RVAL2GTKTEXTCHILDANCHOR(self) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_text_child_anchor_new()); return Qnil; } static VALUE rg_widgets(VALUE self) { return GOBJGLIST2RVAL_FREE(gtk_text_child_anchor_get_widgets(_SELF(self)), g_list_free, NULL); } static VALUE rg_deleted_p(VALUE self) { return CBOOL2RVAL(gtk_text_child_anchor_get_deleted(_SELF(self))); } void Init_gtk_textchild(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_CHILD_ANCHOR, "TextChildAnchor", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(widgets, 0); RG_DEF_METHOD_P(deleted, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-dialog.c��������������������������������������������������0000644�0001750�0001750�00000012761�12102213527�017640� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cDialog #define _SELF(self) (RVAL2GTKDIALOG(self)) static VALUE rg_add_button(VALUE self, VALUE button_text, VALUE response_id) { VALUE buffer; return GOBJ2RVAL(gtk_dialog_add_button(_SELF(self), SYMBOL_P(button_text) ? RVAL2GLIBID(button_text, buffer) : RVAL2CSTR(button_text), RVAL2GTKRESPONSETYPE(response_id))); } static VALUE rg_add_buttons(int argc, VALUE *argv, VALUE self) { VALUE button_ary; rb_scan_args(argc, argv, "*", &button_ary); rbgtk_add_buttons(self, button_ary, rg_add_button); return self; } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, rb_title, rb_parent, rb_flags, rb_button_ary; const gchar *title; GtkWindow *parent; GtkDialogFlags flags; GtkWidget *dialog; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "title", &rb_title, "parent", &rb_parent, "flags", &rb_flags, "buttons", &rb_button_ary, NULL); title = RVAL2CSTR_ACCEPT_NIL(rb_title); parent = NIL_P(rb_parent) ? NULL : RVAL2GTKWINDOW(rb_parent); flags = NIL_P(rb_flags) ? 0 : RVAL2GTKDIALOGFLAGS(rb_flags); dialog = gtk_dialog_new_with_buttons(title, parent, flags, NULL, NULL); RBGTK_INITIALIZE(self, dialog); if (!NIL_P(rb_button_ary)) rb_funcall2(self, rb_intern("add_buttons"), RARRAY_LEN(rb_button_ary), RARRAY_PTR(rb_button_ary)); return Qnil; } static VALUE rg_run(VALUE self) { if (rb_block_given_p()){ VALUE ret = INT2NUM(gtk_dialog_run(_SELF(self))); rb_yield(ret); return ret; } else { return INT2NUM(gtk_dialog_run(_SELF(self))); } } static VALUE rg_response(VALUE self, VALUE response_id) { gtk_dialog_response(_SELF(self), NUM2INT(response_id)); return self; } static VALUE rg_add_action_widget(VALUE self, VALUE child, VALUE response_id) { gtk_dialog_add_action_widget(_SELF(self), RVAL2GTKWIDGET(child), NUM2INT(response_id)); return self; } static VALUE rg_set_default_response(VALUE self, VALUE response_id) { gtk_dialog_set_default_response(_SELF(self), NUM2INT(response_id)); return self; } static VALUE rg_set_response_sensitive(VALUE self, VALUE response_id, VALUE setting) { gtk_dialog_set_response_sensitive(_SELF(self), NUM2INT(response_id), RVAL2CBOOL(setting)); return self; } static VALUE rg_s_alternative_dialog_button_order_p(G_GNUC_UNUSED VALUE self, VALUE screen) { gboolean ret = gtk_alternative_dialog_button_order(NIL_P(screen) ? NULL : RVAL2GDKSCREEN(screen)); return CBOOL2RVAL(ret); } static VALUE rg_set_alternative_button_order(VALUE self, VALUE rbnew_order) { GtkDialog *dialog = _SELF(self); long n; gint *new_order = RVAL2GINTS(rbnew_order, n); gtk_dialog_set_alternative_button_order_from_array(dialog, n, new_order); g_free(new_order); return self; } static VALUE rg_action_area(VALUE self) { return GOBJ2RVAL(gtk_dialog_get_action_area(_SELF(self))); } static VALUE rg_get_response(VALUE self, VALUE widget) { return INT2NUM(gtk_dialog_get_response_for_widget(_SELF(self), RVAL2GTKWIDGET(widget))); } static VALUE rg_content_area(VALUE self) { return GOBJ2RVAL(gtk_dialog_get_content_area(_SELF(self))); } static VALUE rg_get_widget_for_response(VALUE self, VALUE response_id) { return GOBJ2RVAL(gtk_dialog_get_widget_for_response(_SELF(self), NUM2INT(response_id))); } void Init_gtk_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_DIALOG, "Dialog", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(run, 0); RG_DEF_METHOD(response, 1); RG_DEF_METHOD(add_button, 2); RG_DEF_METHOD(add_buttons, -1); RG_DEF_METHOD(add_action_widget, 2); RG_DEF_METHOD(set_default_response, 1); RG_DEF_SMETHOD_P(alternative_dialog_button_order, 1); RG_DEF_METHOD(set_alternative_button_order, 1); RG_DEF_METHOD(set_response_sensitive, 2); RG_DEF_METHOD(action_area, 0); RG_DEF_METHOD(get_response, 1); RG_DEF_ALIAS("get_response_for_widget", "get_response"); RG_DEF_METHOD(content_area, 0); RG_DEF_METHOD(get_widget_for_response, 1); G_DEF_CLASS(GTK_TYPE_DIALOG_FLAGS, "Flags", RG_TARGET_NAMESPACE); } ���������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tooltip-gdk-display.c�������������������������������������0000644�0001750�0001750�00000002370�12102213527�022274� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cDisplay #define _SELF(self) (RVAL2GDKDISPLAYOBJECT(self)) static VALUE rg_trigger_tooltip_query(VALUE self) { gtk_tooltip_trigger_tooltip_query(_SELF(self)); return self; } void Init_gtk_tooltip_gdk_display(void) { VALUE RG_TARGET_NAMESPACE = GTYPE2CLASS(GDK_TYPE_DISPLAY); RG_DEF_METHOD(trigger_tooltip_query, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-ui-manager.c����������������������������������������������0000644�0001750�0001750�00000012665�12102213527�020431� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cUIManager #define _SELF(self) (RVAL2GTKUIMANAGER(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_ui_manager_new()); return Qnil; } static VALUE rg_insert_action_group(VALUE self, VALUE action_group, VALUE pos) { gtk_ui_manager_insert_action_group(_SELF(self), RVAL2GTKACTIONGROUP(action_group), NUM2INT(pos)); G_CHILD_ADD(self, action_group); return self; } static VALUE rg_remove_action_group(VALUE self, VALUE action_group) { gtk_ui_manager_remove_action_group(_SELF(self), RVAL2GTKACTIONGROUP(action_group)); G_CHILD_REMOVE(self, action_group); return self; } static VALUE rg_action_groups(VALUE self) { return GOBJGLIST2RVAL(gtk_ui_manager_get_action_groups(_SELF(self))); } static VALUE rg_accel_group(VALUE self) { return GOBJ2RVAL(gtk_ui_manager_get_accel_group(_SELF(self))); } static VALUE rg_get_widget(VALUE self, VALUE path) { GtkWidget* widget = gtk_ui_manager_get_widget(_SELF(self), RVAL2CSTR(path)); if (! widget) rb_raise(rb_eArgError, "no widget was found."); return GOBJ2RVAL(widget); } static VALUE rg_get_toplevels(VALUE self, VALUE types) { return GOBJGSLIST2RVAL_FREE(gtk_ui_manager_get_toplevels(_SELF(self), RVAL2GTKUIMANAGERITEMTYPE(types)), g_slist_free, NULL); } static VALUE rg_get_action(VALUE self, VALUE path) { return GOBJ2RVAL(gtk_ui_manager_get_action(_SELF(self), RVAL2CSTR(path))); } static VALUE rg_add_ui(int argc, VALUE *argv, VALUE self) { GError* error = NULL; guint ret; VALUE buffer; if (argc == 1) { VALUE buffer_or_filename; rb_scan_args(argc, argv, "10", &buffer_or_filename); StringValue(buffer_or_filename); buffer = rb_funcall(buffer_or_filename, rb_intern("include?"), 1, CSTR2RVAL("<ui>")); if (RVAL2CBOOL(buffer)){ StringValue(buffer_or_filename); ret = gtk_ui_manager_add_ui_from_string(_SELF(self), RSTRING_PTR(buffer_or_filename), RSTRING_LEN(buffer_or_filename), &error); } else { ret = gtk_ui_manager_add_ui_from_file(_SELF(self), RVAL2CSTR(buffer_or_filename), &error); } } else { VALUE merge_id, path, name, action, type, top; rb_scan_args(argc, argv, "60", &merge_id, &path, &name, &action, &type, &top); ret = NUM2UINT(merge_id); gtk_ui_manager_add_ui(_SELF(self), ret, RVAL2CSTR(path), RVAL2CSTR(name), RVAL2CSTR(action), RVAL2GTKUIMANAGERITEMTYPE(type), RVAL2CBOOL(top)); } if (ret == 0) RAISE_GERROR(error); return UINT2NUM(ret); } static VALUE rg_new_merge_id(VALUE self) { return UINT2NUM(gtk_ui_manager_new_merge_id(_SELF(self))); } static VALUE rg_remove_ui(VALUE self, VALUE merge_id) { gtk_ui_manager_remove_ui(_SELF(self), NUM2UINT(merge_id)); return self; } static VALUE rg_ensure_update(VALUE self) { gtk_ui_manager_ensure_update(_SELF(self)); return self; } static void rbuimanager_mark(void *p) { GtkUIManager *manager; GList *node; manager = GTK_UI_MANAGER(p); for (node = gtk_ui_manager_get_action_groups(manager); node; node = g_list_next(node)) { GtkWidget *action_group = node->data; rbgobj_gc_mark_instance(action_group); } rbgobj_gc_mark_instance(gtk_ui_manager_get_accel_group(manager)); } void Init_gtk_uimanager(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_GC_FUNC(GTK_TYPE_UI_MANAGER, "UIManager", mGtk, rbuimanager_mark, NULL); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(insert_action_group, 2); RG_DEF_METHOD(remove_action_group, 1); RG_DEF_METHOD(action_groups, 0); RG_DEF_METHOD(accel_group, 0); RG_DEF_METHOD(get_widget, 1); RG_DEF_ALIAS("[]", "get_widget"); RG_DEF_METHOD(get_toplevels, 1); RG_DEF_METHOD(get_action, 1); RG_DEF_METHOD(add_ui, -1); RG_DEF_METHOD(new_merge_id, 0); RG_DEF_METHOD(remove_ui, 1); RG_DEF_METHOD(ensure_update, 0); G_DEF_CLASS(GTK_TYPE_UI_MANAGER_ITEM_TYPE, "ItemType", RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-infobar.c�������������������������������������������������0000644�0001750�0001750�00000006576�12102213527�020030� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cInfoBar #define _SELF(self) (RVAL2GTKINFOBAR(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE button_ary; rb_scan_args(argc, argv, "*", &button_ary); RBGTK_INITIALIZE(self, gtk_info_bar_new()); if (!NIL_P(button_ary)) rb_funcall2(self, rb_intern("add_buttons"), RARRAY_LEN(button_ary), RARRAY_PTR(button_ary)); return Qnil; } static VALUE rg_add_action_widget(VALUE self, VALUE child, VALUE response_id) { gtk_info_bar_add_action_widget(_SELF(self), RVAL2GTKWIDGET(child), NUM2INT(response_id)); return self; } static VALUE rg_add_button(VALUE self, VALUE button_text, VALUE response_id) { VALUE buffer; return GOBJ2RVAL(gtk_info_bar_add_button(_SELF(self), SYMBOL_P(button_text) ? RVAL2GLIBID(button_text, buffer) : RVAL2CSTR(button_text), RVAL2GTKRESPONSETYPE(response_id))); } static VALUE rg_add_buttons(int argc, VALUE *argv, VALUE self) { VALUE button_ary; rb_scan_args(argc, argv, "*", &button_ary); rbgtk_add_buttons(self, button_ary, rg_add_button); return self; } static VALUE rg_action_area(VALUE self) { return GOBJ2RVAL(gtk_info_bar_get_action_area(_SELF(self))); } static VALUE rg_content_area(VALUE self) { return GOBJ2RVAL(gtk_info_bar_get_content_area(_SELF(self))); } static VALUE rg_response(VALUE self, VALUE response_id) { gtk_info_bar_response(_SELF(self), NUM2INT(response_id)); return self; } static VALUE rg_set_default_response(VALUE self, VALUE response_id) { gtk_info_bar_set_default_response(_SELF(self), NUM2INT(response_id)); return self; } static VALUE rg_set_response_sensitive(VALUE self, VALUE response_id, VALUE setting) { gtk_info_bar_set_response_sensitive(_SELF(self), NUM2INT(response_id), RVAL2CBOOL(setting)); return self; } void Init_gtk_infobar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_INFO_BAR, "InfoBar", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(add_action_widget, 2); RG_DEF_METHOD(add_button, 2); RG_DEF_METHOD(add_buttons, -1); RG_DEF_METHOD(action_area, 0); RG_DEF_METHOD(content_area, 0); RG_DEF_METHOD(response, 1); RG_DEF_METHOD(set_default_response, 1); RG_DEF_METHOD(set_response_sensitive, 2); } ����������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-recent-info.c���������������������������������������������0000644�0001750�0001750�00000012621�12102213527�020605� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRecentInfo #define _SELF(self) (RVAL2GTKRECENTINFO(self)) static VALUE rg_uri(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_uri(_SELF(self))); } static VALUE rg_display_name(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_display_name(_SELF(self))); } static VALUE rg_description(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_description(_SELF(self))); } static VALUE rg_mime_type(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_mime_type(_SELF(self))); } static VALUE rg_added(VALUE self) { time_t t = gtk_recent_info_get_added(_SELF(self)); return rb_funcall(rb_cTime, rb_intern("at"), 1, INT2NUM(t)); } static VALUE rg_modified(VALUE self) { time_t t = gtk_recent_info_get_modified(_SELF(self)); return rb_funcall(rb_cTime, rb_intern("at"), 1, INT2NUM(t)); } static VALUE rg_visited(VALUE self) { time_t t = gtk_recent_info_get_visited(_SELF(self)); return rb_funcall(rb_cTime, rb_intern("at"), 1, INT2NUM(t)); } static VALUE rg_private_hint_p(VALUE self) { return CBOOL2RVAL(gtk_recent_info_get_private_hint(_SELF(self))); } static VALUE rg_application_info(VALUE self, VALUE app_name) { const gchar *app_exec; guint count; time_t t; gboolean ret = gtk_recent_info_get_application_info(_SELF(self), RVAL2CSTR(app_name), &app_exec, &count, &t); VALUE ary = rb_ary_new(); if (ret){ rb_ary_push(ary, CSTR2RVAL(app_exec)); rb_ary_push(ary, UINT2NUM(count)); rb_ary_push(ary, rb_funcall(rb_cTime, rb_intern("at"), 1, INT2NUM(t))); } return ary; } static VALUE rg_applications(VALUE self) { gsize i; gsize length; gchar** str = gtk_recent_info_get_applications(_SELF(self), &length); VALUE ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, CSTR2RVAL(str[i])); } g_strfreev(str); return ary; } static VALUE rg_last_application(VALUE self) { return CSTR2RVAL(gtk_recent_info_last_application(_SELF(self))); } static VALUE rg_groups(VALUE self) { gsize i; gsize length; gchar** str = gtk_recent_info_get_groups(_SELF(self), &length); VALUE ary = rb_ary_new(); for(i = 0; i < length; i++){ rb_ary_push(ary, CSTR2RVAL(str[i])); } g_strfreev(str); return ary; } static VALUE rg_has_group_p(VALUE self, VALUE group_name) { return CBOOL2RVAL(gtk_recent_info_has_group(_SELF(self), RVAL2CSTR(group_name))); } static VALUE rg_has_application_p(VALUE self, VALUE app_name) { return CBOOL2RVAL(gtk_recent_info_has_application(_SELF(self), RVAL2CSTR(app_name))); } static VALUE rg_get_icon(VALUE self, VALUE size) { return GOBJ2RVAL(gtk_recent_info_get_icon(_SELF(self), NUM2INT(size))); } static VALUE rg_short_name(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_short_name(_SELF(self))); } static VALUE rg_uri_display(VALUE self) { return CSTR2RVAL(gtk_recent_info_get_uri_display(_SELF(self))); } static VALUE rg_age(VALUE self) { return INT2NUM(gtk_recent_info_get_age(_SELF(self))); } static VALUE rg_local_p(VALUE self) { return CBOOL2RVAL(gtk_recent_info_is_local(_SELF(self))); } static VALUE rg_exist_p(VALUE self) { return CBOOL2RVAL(gtk_recent_info_exists(_SELF(self))); } static VALUE rg_operator_ri_match(VALUE self, VALUE other) { return CBOOL2RVAL(gtk_recent_info_match(_SELF(self), _SELF(other))); } void Init_gtk_recent_info(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_INFO, "RecentInfo", mGtk); RG_DEF_METHOD(uri, 0); RG_DEF_METHOD(display_name, 0); RG_DEF_METHOD(description, 0); RG_DEF_METHOD(mime_type, 0); RG_DEF_METHOD(added, 0); RG_DEF_METHOD(modified, 0); RG_DEF_METHOD(visited, 0); RG_DEF_METHOD_P(private_hint, 0); RG_DEF_METHOD(application_info, 1); RG_DEF_METHOD(applications, 0); RG_DEF_METHOD(last_application, 0); RG_DEF_METHOD(groups, 0); RG_DEF_METHOD_P(has_group, 1); RG_DEF_METHOD_P(has_application, 1); RG_DEF_METHOD(get_icon, 1); RG_DEF_METHOD(short_name, 0); RG_DEF_METHOD(uri_display, 0); RG_DEF_METHOD(age, 0); RG_DEF_METHOD_P(local, 0); RG_DEF_METHOD_P(exist, 0); RG_DEF_METHOD_OPERATOR("==", ri_match, 1); } ���������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-toggle-button.c�������������������������������������������0000644�0001750�0001750�00000005357�12102213527�021176� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cToggleButton static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, use_underline; GtkWidget *widget; if (rb_scan_args(argc, argv, "02", &label, &use_underline) > 0) { if (TYPE(label) == T_STRING){ if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)){ widget = gtk_toggle_button_new_with_mnemonic(RVAL2CSTR(label)); } else { widget = gtk_toggle_button_new_with_label(RVAL2CSTR(label)); } } else if (TYPE(label) == T_SYMBOL){ widget = gtk_toggle_button_new_with_label(rb_id2name(SYM2ID(label))); gtk_button_set_use_stock(GTK_BUTTON(widget), TRUE); } else { rb_raise(rb_eArgError, "invalid argument %s (expect Symbol(Gtk::Stock constants) or String)", rb_class2name(CLASS_OF(label))); } } else { widget = gtk_toggle_button_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_set_mode(VALUE self, VALUE mode) { gtk_toggle_button_set_mode(RVAL2GTKTOGGLEBUTTON(self), RVAL2CBOOL(mode)); return self; } static VALUE rg_mode_p(VALUE self) { return CBOOL2RVAL(gtk_toggle_button_get_mode(RVAL2GTKTOGGLEBUTTON(self))); } static VALUE rg_toggled(VALUE self) { gtk_toggle_button_toggled(RVAL2GTKTOGGLEBUTTON(self)); return self; } void Init_gtk_toggle_button(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOGGLE_BUTTON, "ToggleButton", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_mode, 1); RG_DEF_METHOD_P(mode, 0); RG_DEF_METHOD(toggled, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk3util.c����������������������������������������������������0000644�0001750�0001750�00000003573�11701304107�017364� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" struct add_buttons_args { VALUE self; VALUE buttons; RBGTKAddButtonFunc add_button; }; static VALUE add_buttons_body(VALUE value) { struct add_buttons_args *args = (struct add_buttons_args *)value; VALUE button; long i; long n = RARRAY_LEN(args->buttons); for (i = 0; i < n; i++) { button = rb_ary_to_ary(RARRAY_PTR(args->buttons)[i]); args->add_button(args->self, RARRAY_PTR(button)[0], RARRAY_PTR(button)[1]); } return args->self; } static VALUE add_buttons_ensure(VALUE value) { g_object_thaw_notify(RVAL2GOBJ(((struct add_buttons_args *)value)->self)); return Qnil; } VALUE rbgtk_add_buttons(VALUE self, VALUE buttons, RBGTKAddButtonFunc add_button) { struct add_buttons_args args = { self, buttons, add_button }; if (NIL_P(RARRAY_PTR(buttons)[0])) return self; g_object_freeze_notify(RVAL2GOBJ(self)); return rb_ensure(add_buttons_body, (VALUE)&args, add_buttons_ensure, (VALUE)&args); } �������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-combo-box.c�����������������������������������������������0000644�0001750�0001750�00000010113�12102213527�020253� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cComboBox #define _SELF(self) (RVAL2GTKCOMBOBOX(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, rb_entry, rb_model, rb_area; gboolean entry; GtkTreeModel *model; GtkCellArea *area; GtkWidget *widget; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "entry", &rb_entry, "model", &rb_model, "area", &rb_area, NULL); entry = RVAL2CBOOL(rb_entry); model = NIL_P(rb_model) ? NULL : RVAL2GTKTREEMODEL(rb_model); area = NIL_P(rb_area) ? NULL : RVAL2GTKCELLAREA(rb_area); if (entry) { if (model) widget = gtk_combo_box_new_with_model_and_entry(model); else if (area) widget = gtk_combo_box_new_with_area_and_entry(area); else widget = gtk_combo_box_new_with_entry(); } else { if (model) widget = gtk_combo_box_new_with_model(model); else if (area) widget = gtk_combo_box_new_with_area(area); else widget = gtk_combo_box_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_active_iter(VALUE self) { GtkTreeIter iter; VALUE val = Qnil; gboolean ret = gtk_combo_box_get_active_iter(_SELF(self), &iter); if (ret){ iter.user_data3 = (gpointer)gtk_combo_box_get_model(_SELF(self)); val = GTKTREEITER2RVAL(&iter); } return val; } static VALUE rg_set_active_iter(VALUE self, VALUE iter) { gtk_combo_box_set_active_iter(_SELF(self), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_popup_accessible(VALUE self) { return GOBJ2RVAL(gtk_combo_box_get_popup_accessible(_SELF(self))); } static gboolean row_separator_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer *func) { iter->user_data3 = model; return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(model), GTKTREEITER2RVAL(iter))); } static VALUE rg_set_row_separator_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_combo_box_set_row_separator_func(_SELF(self), (GtkTreeViewRowSeparatorFunc)row_separator_func, (gpointer)func, NULL); return self; } static VALUE rg_title(VALUE self) { return CSTR2RVAL(gtk_combo_box_get_title(_SELF(self))); } /* TODO: merge to popup? */ static VALUE rg_popup_for_device(VALUE self, VALUE device) { gtk_combo_box_popup_for_device(_SELF(self), RVAL2GDKDEVICE(device)); return self; } static VALUE rg_set_title(VALUE self, VALUE title) { gtk_combo_box_set_title(_SELF(self), RVAL2CSTR(title)); return self; } 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); RG_DEF_METHOD(popup_accessible, 0); RG_DEF_METHOD(set_row_separator_func, 0); RG_DEF_METHOD(title, 0); RG_DEF_METHOD(popup_for_device, 1); RG_DEF_METHOD(set_title, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-image.c���������������������������������������������������0000644�0001750�0001750�00000012052�12142464343�017464� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cImage #define _SELF(s) (RVAL2GTKIMAGE(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE image; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "01", &image); if (NIL_P(image)) { widget = gtk_image_new(); } else if (TYPE(image) == T_HASH) { VALUE stock, icon_name, icon_set, gicon, file, pixbuf, animation, size, buffer; rbg_scan_options(image, "stock", &stock, "icon_name", &icon_name, "icon_set", &icon_set, "gicon", &gicon, "file", &file, "pixbuf", &pixbuf, "animation", &animation, "size", &size, NULL); if (!NIL_P(stock)) widget = gtk_image_new_from_stock(RVAL2GLIBID(stock, buffer), RVAL2GTKICONSIZE(size)); else if (!NIL_P(icon_name)) widget = gtk_image_new_from_icon_name(RVAL2CSTR(icon_name), RVAL2GTKICONSIZE(size)); else if (!NIL_P(icon_set)) widget = gtk_image_new_from_icon_set(RVAL2GTKICONSET(icon_set), RVAL2GTKICONSIZE(size)); else if (!NIL_P(gicon)) widget = gtk_image_new_from_gicon(RVAL2GICON(gicon), RVAL2GTKICONSIZE(size)); else if (!NIL_P(file)) widget = gtk_image_new_from_file(RVAL2CSTR(file)); else if (!NIL_P(pixbuf)) widget = gtk_image_new_from_pixbuf(RVAL2GDKPIXBUF(pixbuf)); else if (!NIL_P(animation)) widget = gtk_image_new_from_animation(RVAL2GDKPIXBUFANIMATION(animation)); } else { GType gtype = RVAL2GTYPE(image); if (gtype == GDK_TYPE_PIXBUF) widget = gtk_image_new_from_pixbuf(RVAL2GDKPIXBUF(image)); else if (g_type_is_a(gtype, GDK_TYPE_PIXBUF_ANIMATION)) widget = gtk_image_new_from_animation(RVAL2GDKPIXBUFANIMATION(image)); } if (!widget) rb_raise(rb_eArgError, "Invalid arguments."); RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_clear(VALUE self) { gtk_image_clear(_SELF(self)); return self; } static GtkIconSize icon_size_from_ruby(GtkImage *image, VALUE rb_size) { GtkIconSize size; if (NIL_P(rb_size)) { g_object_get(image, "icon-size", &size, NULL); if (size == GTK_ICON_SIZE_INVALID) { size = GTK_ICON_SIZE_BUTTON; } } else { size = RVAL2GTKICONSIZE(rb_size); } return size; } static VALUE rg_set_from_icon_set(int argc, VALUE *argv, VALUE self) { GtkImage *image; VALUE rb_icon_set, rb_size; image = RVAL2GTKIMAGE(self); rb_scan_args(argc, argv, "11", &rb_icon_set, &rb_size); gtk_image_set_from_icon_set(image, RVAL2GTKICONSET(rb_icon_set), icon_size_from_ruby(image, rb_size)); return self; } static VALUE rg_set_from_stock(int argc, VALUE *argv, VALUE self) { GtkImage *image; VALUE rb_stock, rb_size; VALUE rb_buffer; image = RVAL2GTKIMAGE(self); rb_scan_args(argc, argv, "11", &rb_stock, &rb_size); gtk_image_set_from_stock(image, RVAL2GLIBID(rb_stock, rb_buffer), icon_size_from_ruby(image, rb_size)); return self; } static VALUE rg_set_from_gicon(int argc, VALUE *argv, VALUE self) { GtkImage *image; VALUE rb_gicon, rb_size; image = RVAL2GTKIMAGE(self); rb_scan_args(argc, argv, "11", &rb_gicon, &rb_size); gtk_image_set_from_gicon(image, RVAL2GICON(rb_gicon), icon_size_from_ruby(image, rb_size)); return self; } void Init_gtk_image(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_IMAGE, "Image", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(clear, 0); RG_DEF_METHOD(set_from_icon_set, -1); RG_DEF_METHOD(set_from_stock, -1); RG_DEF_METHOD(set_from_gicon, -1); G_DEF_CLASS(GTK_TYPE_IMAGE_TYPE, "Type", RG_TARGET_NAMESPACE); RG_REG_GLIBID_SETTER("stock"); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-style-context.c�������������������������������������������0000644�0001750�0001750�00000023362�12102213527�021222� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cStyleContext #define _SELF(self) (RVAL2GTKSTYLECONTEXT(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_style_context_new()); return Qnil; } static VALUE rg_add_class(VALUE self, VALUE class_name) { gtk_style_context_add_class(_SELF(self), RVAL2CSTR(class_name)); return self; } static VALUE rg_add_provider(VALUE self, VALUE provider, VALUE priority) { gtk_style_context_add_provider(_SELF(self), RVAL2GTKSTYLEPROVIDER(provider), NUM2UINT(priority)); return self; } static VALUE rg_add_region(VALUE self, VALUE region_name, VALUE flags) { gtk_style_context_add_region(_SELF(self), RVAL2CSTR(region_name), RVAL2GTKREGIONFLAGS(flags)); return self; } static VALUE rg_get_background_color(VALUE self, VALUE state) { GdkRGBA color; gtk_style_context_get_background_color(_SELF(self), RVAL2GTKSTATEFLAGS(state), &color); return GDKRGBA2RVAL(&color); } static VALUE rg_get_border(VALUE self, VALUE state) { GtkBorder border; gtk_style_context_get_border(_SELF(self), RVAL2GTKSTATEFLAGS(state), &border); return GTKBORDER2RVAL(&border); } static VALUE rg_get_border_color(VALUE self, VALUE state) { GdkRGBA color; gtk_style_context_get_border_color(_SELF(self), RVAL2GTKSTATEFLAGS(state), &color); return GDKRGBA2RVAL(&color); } static VALUE rg_get_color(VALUE self, VALUE state) { GdkRGBA color; gtk_style_context_get_color(_SELF(self), RVAL2GTKSTATEFLAGS(state), &color); return GDKRGBA2RVAL(&color); } static VALUE rg_get_font(VALUE self, VALUE state) { PangoFontDescription *desc; desc = gtk_style_context_get_font(_SELF(self), RVAL2GTKSTATEFLAGS(state)); return PANGOFONTDESCRIPTION2RVAL(desc); } static VALUE rg_junction_sides(VALUE self) { GtkJunctionSides sides; sides = gtk_style_context_get_junction_sides(_SELF(self)); return GTKJUNCTIONSIDES2RVAL(sides); } static VALUE rg_get_margin(VALUE self, VALUE state) { GtkBorder margin; gtk_style_context_get_margin(_SELF(self), RVAL2GTKSTATEFLAGS(state), &margin); return GTKBORDER2RVAL(&margin); } static VALUE rg_get_padding(VALUE self, VALUE state) { GtkBorder padding; gtk_style_context_get_padding(_SELF(self), RVAL2GTKSTATEFLAGS(state), &padding); return GTKBORDER2RVAL(&padding); } static VALUE rg_path(VALUE self) { return GTKWIDGETPATH2RVAL(gtk_style_context_get_path(_SELF(self))); } static VALUE rg_get_property(VALUE self, VALUE property, VALUE state) { GValue value = G_VALUE_INIT; VALUE ret = Qnil; gtk_style_context_get_property(_SELF(self), RVAL2CSTR(property), RVAL2GTKSTATEFLAGS(state), &value); if (G_VALUE_TYPE(&value) != G_TYPE_INVALID){ ret = GVAL2RVAL(&value); g_value_unset(&value); } return ret; } static VALUE rg_state(VALUE self) { GtkStateFlags state; state = gtk_style_context_get_state(_SELF(self)); return GTKSTATEFLAGS2RVAL(state); } static VALUE rg_get_style_property(VALUE self, VALUE property_name) { GValue value = G_VALUE_INIT; VALUE ret = Qnil; gtk_style_context_get_style_property(_SELF(self), RVAL2CSTR(property_name), &value); if (G_VALUE_TYPE(&value) != G_TYPE_INVALID){ ret = GVAL2RVAL(&value); g_value_unset(&value); } return ret; } static VALUE rg_has_class_p(VALUE self, VALUE class_name) { return CBOOL2RVAL(gtk_style_context_has_class(_SELF(self), RVAL2CSTR(class_name))); } static VALUE rg_has_region(VALUE self, VALUE region_name) { GtkRegionFlags flags; gboolean result; result = gtk_style_context_has_region(_SELF(self), RVAL2CSTR(region_name), &flags); return result ? GTKREGIONFLAGS2RVAL(flags) : Qnil; } static VALUE rg_invalidate(VALUE self) { gtk_style_context_invalidate(_SELF(self)); return self; } static VALUE rg_classes(VALUE self) { return CSTRGLIST2RVAL_FREE(gtk_style_context_list_classes(_SELF(self)), g_list_free, NULL); } static VALUE rg_regions(VALUE self) { return CSTRGLIST2RVAL_FREE(gtk_style_context_list_regions(_SELF(self)), g_list_free, NULL); } static VALUE rg_lookup_color(VALUE self, VALUE color_name) { GdkRGBA color; gboolean result; result = gtk_style_context_lookup_color(_SELF(self), RVAL2CSTR(color_name), &color); return result ? GDKRGBA2RVAL(&color) : Qnil; } static VALUE rg_lookup_icon_set(VALUE self, VALUE stock_id) { VALUE buffer; return GTKICONSET2RVAL(gtk_style_context_lookup_icon_set(_SELF(self), RVAL2GLIBID(stock_id, buffer))); } static VALUE rg_pop_animatable_region(VALUE self) { gtk_style_context_pop_animatable_region(_SELF(self)); return self; } static VALUE rg_push_animatable_region(VALUE self, VALUE region_id) { gtk_style_context_push_animatable_region(_SELF(self), (gpointer)region_id); if (rb_block_given_p()) rb_ensure(rb_yield, self, rg_pop_animatable_region, self); return self; } static VALUE rg_remove_class(VALUE self, VALUE class_name) { gtk_style_context_remove_class(_SELF(self), RVAL2CSTR(class_name)); return self; } static VALUE rg_remove_provider(VALUE self, VALUE provider) { gtk_style_context_remove_provider(_SELF(self), RVAL2GTKSTYLEPROVIDER(provider)); return self; } static VALUE rg_remove_region(VALUE self, VALUE region_name) { gtk_style_context_remove_region(_SELF(self), RVAL2CSTR(region_name)); return self; } static VALUE rg_restore(VALUE self) { gtk_style_context_restore(_SELF(self)); return self; } static VALUE rg_save(VALUE self) { gtk_style_context_save(_SELF(self)); return self; } static VALUE rg_set_background(VALUE self, VALUE window) { gtk_style_context_set_background(_SELF(self), RVAL2GDKWINDOW(window)); return self; } static VALUE rg_set_junction_sides(VALUE self, VALUE sides) { gtk_style_context_set_junction_sides(_SELF(self), RVAL2GTKJUNCTIONSIDES(sides)); return self; } static VALUE rg_set_path(VALUE self, VALUE path) { gtk_style_context_set_path(_SELF(self), RVAL2GTKWIDGETPATH(path)); return self; } static VALUE rg_set_state(VALUE self, VALUE state) { gtk_style_context_set_state(_SELF(self), RVAL2GTKSTATEFLAGS(state)); return self; } static VALUE rg_state_is_running(VALUE self, VALUE state) { gdouble progress; gboolean result; result = gtk_style_context_state_is_running(_SELF(self), RVAL2GTKSTATEFLAGS(state), &progress); return result ? DBL2NUM(progress) : Qnil; } void Init_gtk_stylecontext(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_STYLE_CONTEXT, "StyleContext", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add_class, 1); RG_DEF_METHOD(add_provider, 2); RG_DEF_METHOD(add_region, 2); RG_DEF_METHOD(classes, 0); RG_DEF_METHOD(get_background_color, 1); RG_DEF_METHOD(get_border, 1); RG_DEF_METHOD(get_border_color, 1); RG_DEF_METHOD(get_color, 1); RG_DEF_METHOD(get_font, 1); RG_DEF_METHOD(get_margin, 1); RG_DEF_METHOD(get_padding, 1); RG_DEF_METHOD(get_property, 2); RG_DEF_METHOD(get_style_property, 1); RG_DEF_METHOD_P(has_class, 1); RG_DEF_METHOD(has_region, 1); RG_DEF_METHOD(invalidate, 0); RG_DEF_METHOD(junction_sides, 0); RG_DEF_METHOD(lookup_color, 1); RG_DEF_METHOD(lookup_icon_set, 1); RG_DEF_METHOD(path, 0); RG_DEF_METHOD(pop_animatable_region, 0); RG_DEF_METHOD(push_animatable_region, 1); RG_DEF_METHOD(regions, 0); RG_DEF_METHOD(remove_class, 1); RG_DEF_METHOD(remove_provider, 1); RG_DEF_METHOD(remove_region, 1); RG_DEF_METHOD(restore, 0); RG_DEF_METHOD(save, 0); RG_DEF_METHOD(set_background, 1); RG_DEF_METHOD(set_junction_sides, 1); RG_DEF_METHOD(set_path, 1); RG_DEF_METHOD(set_state, 1); RG_DEF_METHOD(state, 0); RG_DEF_METHOD(state_is_running, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-recent-data.c���������������������������������������������0000644�0001750�0001750�00000010252�12124610262�020562� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" /*****************************************/ static GtkRecentData* rd_copy(const GtkRecentData* data) { GtkRecentData* new_data; g_return_val_if_fail (data != NULL, NULL); new_data = g_new(GtkRecentData, 1); *new_data = *data; return new_data; } static void rd_free(GtkRecentData* boxed) { if (boxed){ g_free(boxed->groups); g_free(boxed); } } GType gtk_recent_data_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkRecentData", (GBoxedCopyFunc)rd_copy, (GBoxedFreeFunc)rd_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cRecentData #define _SELF(w) (RVAL2GTKRECENTDATA(w)) static VALUE rg_initialize(VALUE self) { GtkRecentData data; memset(&data, 0, sizeof(GtkRecentData)); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_RECENT_DATA, &data)); return Qnil; } static VALUE rg_display_name(VALUE self) { return CSTR2RVAL(_SELF(self)->display_name); } static VALUE rg_set_display_name(VALUE self, VALUE val) { _SELF(self)->display_name = (gchar *) RVAL2CSTR(val); return self; } static VALUE rg_description(VALUE self) { return CSTR2RVAL(_SELF(self)->description); } static VALUE rg_set_description(VALUE self, VALUE val) { _SELF(self)->description = (gchar *) RVAL2CSTR(val); return self; } static VALUE rg_mime_type(VALUE self) { return CSTR2RVAL(_SELF(self)->mime_type); } static VALUE rg_set_mime_type(VALUE self, VALUE val) { _SELF(self)->mime_type = (gchar *) RVAL2CSTR(val); return self; } static VALUE rg_app_name(VALUE self) { return CSTR2RVAL(_SELF(self)->app_name); } static VALUE rg_set_app_name(VALUE self, VALUE val) { _SELF(self)->app_name = (gchar *) RVAL2CSTR(val); return self; } static VALUE rg_app_exec(VALUE self) { return CSTR2RVAL(_SELF(self)->app_exec); } static VALUE rg_set_app_exec(VALUE self, VALUE val) { _SELF(self)->app_exec = (gchar *) RVAL2CSTR(val); return self; } static VALUE rg_groups(VALUE self) { gchar** grps = _SELF(self)->groups; VALUE ary = rb_ary_new(); gint i = 0; while (grps[i]) { rb_ary_push(ary, CSTR2RVAL((gchar*)grps[i])); i++; } return ary; } static VALUE rg_set_groups(VALUE self, VALUE groups) { _SELF(self)->groups = RVAL2STRV_DUP(groups); return self; } static VALUE rg_private_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->is_private); } static VALUE rg_set_private(VALUE self, VALUE is_private) { _SELF(self)->is_private = RVAL2CBOOL(is_private); return self; } void Init_gtk_recent_data(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_DATA, "RecentData", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(display_name, 0); RG_DEF_METHOD(set_display_name, 1); RG_DEF_METHOD(description, 0); RG_DEF_METHOD(set_description, 1); RG_DEF_METHOD(mime_type, 0); RG_DEF_METHOD(set_mime_type, 1); RG_DEF_METHOD(app_name, 0); RG_DEF_METHOD(set_app_name, 1); RG_DEF_METHOD(app_exec, 0); RG_DEF_METHOD(set_app_exec, 1); RG_DEF_METHOD(groups, 0); RG_DEF_METHOD(set_groups, 1); RG_DEF_METHOD_P(private, 0); RG_DEF_METHOD(set_private, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-accel-label.c���������������������������������������������0000644�0001750�0001750�00000003174�12102213526�020522� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 2001 Neil Conway * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAccelLabel static VALUE rg_initialize(VALUE self, VALUE string) { RBGTK_INITIALIZE(self, gtk_accel_label_new(RVAL2CSTR(string))); return Qnil; } static VALUE rg_accel_width(VALUE self) { return INT2NUM(gtk_accel_label_get_accel_width(RVAL2GTKACCELLABEL(self))); } static VALUE rg_refetch(VALUE self) { gtk_accel_label_refetch(RVAL2GTKACCELLABEL(self)); return Qfalse; // always returns false } void Init_gtk_accel_label(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCEL_LABEL, "AccelLabel", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(accel_width, 0); RG_DEF_METHOD(refetch, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-menu-shell.c����������������������������������������������0000644�0001750�0001750�00000005617�12102213527�020454� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cMenuShell #define _SELF(self) (RVAL2GTKMENUSHELL(self)) static VALUE rg_append(VALUE self, VALUE child) { gtk_menu_shell_append(_SELF(self),RVAL2GTKWIDGET(child)); G_CHILD_ADD(self, child); return self; } static VALUE rg_prepend(VALUE self, VALUE child) { gtk_menu_shell_prepend(_SELF(self), RVAL2GTKWIDGET(child)); G_CHILD_ADD(self, child); return self; } static VALUE rg_insert(VALUE self, VALUE child, VALUE pos) { gtk_menu_shell_insert(_SELF(self), RVAL2GTKWIDGET(child), NUM2INT(pos)); G_CHILD_ADD(self, child); return self; } static VALUE rg_deactivate(VALUE self) { gtk_menu_shell_deactivate(_SELF(self)); return self; } static VALUE rg_select_item(VALUE self, VALUE menu_item) { gtk_menu_shell_select_item(_SELF(self), RVAL2GTKWIDGET(menu_item)); return self; } static VALUE rg_select_first(VALUE self, VALUE search_sensitive) { gtk_menu_shell_select_first(_SELF(self), RVAL2CBOOL(search_sensitive)); return self; } static VALUE rg_deselect(VALUE self) { gtk_menu_shell_deselect(_SELF(self)); return self; } static VALUE rg_activate_item(VALUE self, VALUE menu_item, VALUE force_deactivate) { gtk_menu_shell_activate_item(_SELF(self), RVAL2GTKWIDGET(menu_item), RVAL2CBOOL(force_deactivate)); return self; } void Init_gtk_menu_shell(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU_SHELL, "MenuShell", mGtk); RG_DEF_METHOD(append, 1); RG_DEF_METHOD(prepend, 1); RG_DEF_METHOD(insert, 2); RG_DEF_METHOD(deactivate, 0); RG_DEF_METHOD(select_item, 1); RG_DEF_METHOD(select_first, 1); RG_DEF_METHOD(deselect, 0); RG_DEF_METHOD(activate_item, 2); G_DEF_CLASS(GTK_TYPE_MENU_DIRECTION_TYPE, "DirectionType", RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/extconf.rb������������������������������������������������������0000644�0001750�0001750�00000006025�12257552167�017136� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin extconf.rb for Ruby/GTK extention library =end require 'pathname' source_dir = Pathname(__FILE__).dirname base_dir = source_dir.parent.parent.expand_path top_dir = base_dir.parent.expand_path top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "gtk3" package_id = "gtk+-3.0" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end have_func("rb_errinfo") ["glib2", "gio2", "atk", "pango", "gdk_pixbuf2", "gdk3"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end rcairo_options = {} rcairo_source_dir_names = ["rcairo"] if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM rcairo_source_dir_names.unshift("rcairo.win32") end rcairo_source_dir_names.each do |rcairo_source_dir_name| rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name if rcairo_source_dir.exist? rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s break end end unless check_cairo(rcairo_options) exit(false) end setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id, :debian => "libgtk-3-dev", :fedora => "gtk3-devel", :homebrew => "gtk+3", :macports => "gtk3") exit(false) end have_header("st.h") have_header("ruby/st.h") STDOUT.print("checking for targets... ") STDOUT.flush targets = PKGConfig.variable(package_id, "targets").split(/\s+/) STDOUT.print(targets.join(" "), "\n") gtk_header = "gtk/gtk.h" have_func('gtk_plug_get_type', gtk_header) have_func('gtk_socket_get_type', gtk_header) have_func('pango_render_part_get_type', gtk_header) have_header('gtk/gtkfilesystem.h') do |src| "#define GTK_FILE_SYSTEM_ENABLE_UNSUPPORTED\n#{src}" end xlib_header = "X11/Xlib.h" if targets.include?("x11") and have_header('X11/Xlib.h') and have_library("X11") have_func("XReadBitmapFileData", xlib_header) have_func("XGetErrorText", xlib_header) end if !targets.include?("win32") and PKGConfig.have_package('gtk+-unix-print-3.0') $defs.push("-DHAVE_GTK_UNIX_PRINT") end create_pkg_config_file("Ruby/GTK3", package_id, ruby_gnome2_version) ensure_objs $defs << "-DRUBY_GTK3_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-renderer-text.c��������������������������������������0000644�0001750�0001750�00000003053�12102213527�022100� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCellRendererText #define _SELF(s) (RVAL2GTKCELLRENDERERTEXT(s)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_text_new()); return Qnil; } static VALUE rg_set_fixed_height_from_font(VALUE self, VALUE number_of_rows) { gtk_cell_renderer_text_set_fixed_height_from_font(_SELF(self), NUM2INT(number_of_rows)); return self; } void Init_gtk_cellrenderertext(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_TEXT, "CellRendererText", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_fixed_height_from_font, 1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-css-provider.c��������������������������������������������0000644�0001750�0001750�00000006612�12102213527�021017� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCssProvider #define _SELF(self) (RVAL2GTKCSSPROVIDER(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_css_provider_new()); return Qnil; } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_css_provider_get_default()); } static VALUE rg_s_get_named(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE name, variant; GtkCssProvider *provider; rb_scan_args(argc, argv, "11", &name, &variant); provider = gtk_css_provider_get_named(RVAL2CSTR(name), RVAL2CSTR_ACCEPT_NIL(variant)); return GOBJ2RVAL(provider); } static VALUE rg_load(VALUE self, VALUE arg) { gboolean result; GError *error = NULL; if (TYPE(arg) == T_HASH) { VALUE data, file, path; rbg_scan_options(arg, "data", &data, "file", &file, "path", &path, NULL); if (!NIL_P(data)) { StringValue(data); result = gtk_css_provider_load_from_data(_SELF(self), RSTRING_PTR(data), RSTRING_LEN(data), &error); } else if (!NIL_P(file)) { result = gtk_css_provider_load_from_file(_SELF(self), RVAL2GFILE(file), &error); } else if (!NIL_P(path)) { result = gtk_css_provider_load_from_path(_SELF(self), RVAL2CSTR(path), &error); } else { rb_raise(rb_eArgError, "Invalid arguments."); } } else { result = gtk_css_provider_load_from_file(_SELF(self), RVAL2GFILE(arg), &error); } if (error) RAISE_GERROR(error); return CBOOL2RVAL(result); } static VALUE rg_to_s(VALUE self) { return CSTR2RVAL(gtk_css_provider_to_string(_SELF(self))); } void Init_gtk_cssprovider(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CSS_PROVIDER, "CssProvider", mGtk); RG_DEF_SMETHOD(default, 0); RG_DEF_SMETHOD(get_named, -1); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(load, 1); RG_DEF_METHOD(to_s, 0); } ����������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-hsv.c�����������������������������������������������������0000644�0001750�0001750�00000004673�12102213527�017204� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cHSV #define _SELF(self) (RVAL2GTKHSV(self)) static VALUE rg_s_to_rgb(G_GNUC_UNUSED VALUE self, VALUE h, VALUE s, VALUE v) { gdouble r, g, b; gtk_hsv_to_rgb(NUM2DBL(h), NUM2DBL(s), NUM2DBL(v), &r, &g, &b); return rb_ary_new3(3, DBL2NUM(r), DBL2NUM(g), DBL2NUM(b)); } static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_hsv_new()); return Qnil; } static VALUE rg_color(VALUE self) { gdouble h, s, v; gtk_hsv_get_color(_SELF(self), &h, &s, &v); return rb_ary_new3(3, DBL2NUM(h), DBL2NUM(s), DBL2NUM(v)); } static VALUE rg_metrics(VALUE self) { gint size, ring_width; gtk_hsv_get_metrics(_SELF(self), &size, &ring_width); return rb_ary_new3(2, INT2NUM(size), INT2NUM(ring_width)); } static VALUE rg_adjusting_p(VALUE self) { gboolean result; result = gtk_hsv_is_adjusting(_SELF(self)); return CBOOL2RVAL(result); } static VALUE rg_set_color(VALUE self, VALUE h, VALUE s, VALUE v) { gtk_hsv_set_color(_SELF(self), NUM2DBL(h), NUM2DBL(s), NUM2DBL(v)); return self; } static VALUE rg_set_metrics(VALUE self, VALUE size, VALUE ring_width) { gtk_hsv_set_metrics(_SELF(self), NUM2INT(size), NUM2INT(ring_width)); return self; } void Init_gtk_hsv(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_HSV, "HSV", mGtk); RG_DEF_SMETHOD(to_rgb, 3); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(color, 0); RG_DEF_METHOD(metrics, 0); RG_DEF_METHOD_P(adjusting, 0); RG_DEF_METHOD(set_color, 3); RG_DEF_METHOD(set_metrics, 2); } ���������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-volume-button.c�������������������������������������������0000644�0001750�0001750�00000002610�12102213527�021211� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cVolumeButton static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_volume_button_new()); return Qnil; } void Init_gtk_volumebutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_VOLUME_BUTTON, "VolumeButton", mGtk); RG_DEF_METHOD(initialize, 0); } ������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-link-button.c���������������������������������������������0000644�0001750�0001750�00000003333�12102213527�020642� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cLinkButton #define _SELF(self) (RVAL2GTKLINKBUTTON(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE uri, label; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "11", &uri, &label); if (NIL_P(label)){ widget = gtk_link_button_new(RVAL2CSTR(uri)); } else { widget = gtk_link_button_new_with_label(RVAL2CSTR(uri), RVAL2CSTR(label)); } RBGTK_INITIALIZE(self, widget); return Qnil; } static void link_func(GtkLinkButton *button, const gchar *link, gpointer func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(button), CSTR2RVAL(link)); } void Init_gtk_link_button(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_LINK_BUTTON, "LinkButton", mGtk); RG_DEF_METHOD(initialize, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-rowreference.c���������������������������������������0000644�0001750�0001750�00000007566�12102213527�022033� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTreeRowReference #define _SELF(s) RVAL2GTKTREEROWREFERENCE(s) static ID id_proxy; static ID id_model; static ID id_path; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE proxy, model, path; GtkTreeRowReference* ref; if (argc == 3){ rb_scan_args(argc, argv, "3", &proxy, &model, &path); G_CHILD_SET(self, id_proxy, proxy); ref = gtk_tree_row_reference_new_proxy(RVAL2GOBJ(proxy), RVAL2GTKTREEMODEL(model), RVAL2GTKTREEPATH(path)); } else { rb_scan_args(argc, argv, "2", &model, &path); ref = gtk_tree_row_reference_new(RVAL2GTKTREEMODEL(model), RVAL2GTKTREEPATH(path)); } if (ref == NULL) rb_raise(rb_eArgError, "Invalid arguments were passed."); G_CHILD_SET(self, id_model, model); G_CHILD_SET(self, id_path, path); G_INITIALIZE(self, ref); return Qnil; } static VALUE rg_path(VALUE self) { VALUE ret = GTKTREEPATH2RVAL(gtk_tree_row_reference_get_path(_SELF(self))); G_CHILD_SET(self, id_path, ret); return ret; } static VALUE rg_model(VALUE self) { VALUE ret = GOBJ2RVAL(gtk_tree_row_reference_get_model(_SELF(self))); G_CHILD_SET(self, id_model, ret); return ret; } static VALUE rg_valid_p(VALUE self) { return CBOOL2RVAL(gtk_tree_row_reference_valid(_SELF(self))); } static VALUE rg_s_inserted(VALUE self, VALUE proxy, VALUE path) { gtk_tree_row_reference_inserted(RVAL2GOBJ(proxy), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_s_deleted(VALUE self, VALUE proxy, VALUE path) { gtk_tree_row_reference_deleted(RVAL2GOBJ(proxy), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_s_reordered(VALUE self, VALUE rbproxy, VALUE rbpath, VALUE rbiter, VALUE rbnew_order) { GObject *proxy = RVAL2GOBJ(rbproxy); GtkTreePath *path = RVAL2GTKTREEPATH(rbpath); GtkTreeIter *iter = RVAL2GTKTREEITER(rbiter); /* TODO: How do we implement this check? gint columns = gtk_tree_model_get_n_columns(proxy); */ long n; gint *new_order = RVAL2GINTS(rbnew_order, n); /* if (n != columns) { g_free(new_order); rb_raise(rb_eArgError, "new order array must contain same number of elements as the number of columns in the store: %ld != %d", n, columns); } */ gtk_tree_row_reference_reordered(proxy, path, iter, new_order); g_free(new_order); return self; } void Init_gtk_treerowreference(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TREE_ROW_REFERENCE, "TreeRowReference", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(path, 0); RG_DEF_METHOD(model, 0); RG_DEF_METHOD_P(valid, 0); RG_DEF_SMETHOD(inserted, 2); RG_DEF_SMETHOD(deleted, 2); RG_DEF_SMETHOD(reordered, 4); id_proxy = rb_intern("proxy"); id_model = rb_intern("model"); id_path = rb_intern("path"); } ������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-action-group.c��������������������������������������������0000644�0001750�0001750�00000032643�12257552167�021032� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" static ID id_action_procs; static ID id_toggle_action_procs; #define RG_TARGET_NAMESPACE cActionGroup #define _SELF(self) (RVAL2GTKACTIONGROUP(self)) static VALUE rg_initialize(VALUE self, VALUE name) { G_INITIALIZE(self, gtk_action_group_new(RVAL2CSTR(name))); return Qnil; } static VALUE rg_get_action(VALUE self, VALUE action_name) { return GOBJ2RVAL(gtk_action_group_get_action(_SELF(self), RVAL2CSTR(action_name))); } static VALUE rg_actions(VALUE self) { /* TODO: need free? */ return GOBJGLIST2RVAL_FREE(gtk_action_group_list_actions(_SELF(self)), g_list_free, NULL); } static VALUE rg_add_action(int argc, VALUE *argv, VALUE self) { VALUE action, accelerator; rb_scan_args(argc, argv, "11", &action, &accelerator); gtk_action_group_add_action_with_accel(_SELF(self), RVAL2GTKACTION(action), RVAL2CSTR_ACCEPT_NIL(accelerator)); G_CHILD_ADD(self, action); return self; } static VALUE rg_remove_action(VALUE self, VALUE action) { gtk_action_group_remove_action(_SELF(self), RVAL2GTKACTION(action)); G_CHILD_REMOVE(self, action); return self; } static void activate_action(GtkAction *action, VALUE self) { VALUE proc = rb_hash_aref(rb_ivar_get(self, id_action_procs), CSTR2RVAL(gtk_action_get_name(action))); if (!NIL_P(proc)) rb_funcall(proc, id_call, 2, self, GOBJ2RVAL(action)); } struct rbg_rval2gtkactionentries_args { VALUE ary; long n; GtkActionEntry *result; VALUE procs; }; static VALUE rbg_rval2gtkactionentries_body(VALUE value) { long i; struct rbg_rval2gtkactionentries_args *args = (struct rbg_rval2gtkactionentries_args *)value; for (i = 0; i < args->n; i++) { VALUE entry; long n; RARRAY_PTR(args->ary)[i] = rb_ary_dup(rb_ary_to_ary(RARRAY_PTR(args->ary)[i])); entry = RARRAY_PTR(args->ary)[i]; n = RARRAY_LEN(entry); args->result[i].callback = G_CALLBACK(activate_action); if (n < 1 || n > 6) rb_raise(rb_eArgError, "entry does not contain right number of entries %ld (1..6)", n); args->result[i].name = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[0]); switch (n) { case 6: /* TODO: Call #to_proc on entry 5? */ rb_hash_aset(args->procs, RARRAY_PTR(entry)[0], RARRAY_PTR(entry)[5]); case 5: args->result[i].tooltip = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[4]); case 4: args->result[i].accelerator = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[3]); case 3: args->result[i].label = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[2]); case 2: args->result[i].stock_id = RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(RARRAY_PTR(entry)[1]); break; default: break; } } return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gtkactionentries_rescue(VALUE value) { g_free(((struct rbg_rval2gtkactionentries_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GtkActionEntry * rbg_rval2gtkactionentries(volatile VALUE *value, long *n, VALUE procs) { struct rbg_rval2gtkactionentries_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new0(GtkActionEntry, args.n + 1); args.procs = procs; rb_rescue(rbg_rval2gtkactionentries_body, (VALUE)&args, rbg_rval2gtkactionentries_rescue, (VALUE)&args); *n = args.n; return args.result; } #define RVAL2GTKACTIONENTRIES(value, n, procs) rbg_rval2gtkactionentries(&(value), &(n), procs) static VALUE rg_add_actions(VALUE self, VALUE rbentries) { GtkActionGroup *group = _SELF(self); VALUE action_procs = rb_ivar_defined(self, id_action_procs) == Qtrue ? rb_ivar_get(self, id_action_procs) : rb_hash_new(); long n; GtkActionEntry *entries = RVAL2GTKACTIONENTRIES(rbentries, n, action_procs); rb_ivar_set(self, id_action_procs, action_procs); gtk_action_group_add_actions(group, entries, n, (gpointer)self); g_free(entries); return self; } static void activate_toggle_action(GtkAction *action, VALUE self) { VALUE proc = rb_hash_aref(rb_ivar_get(self, id_toggle_action_procs), CSTR2RVAL(gtk_action_get_name(action))); if (!NIL_P(proc)) rb_funcall(proc, id_call, 2, self, GOBJ2RVAL(action)); } struct rbg_rval2gtktoggleactionentries_args { VALUE ary; long n; GtkToggleActionEntry *result; VALUE procs; }; static VALUE rbg_rval2gtktoggleactionentries_body(VALUE value) { long i; struct rbg_rval2gtktoggleactionentries_args *args = (struct rbg_rval2gtktoggleactionentries_args *)value; for (i = 0; i < args->n; i++) { VALUE entry; long n; RARRAY_PTR(args->ary)[i] = rb_ary_dup(rb_ary_to_ary(RARRAY_PTR(args->ary)[i])); entry = RARRAY_PTR(args->ary)[i]; n = RARRAY_LEN(entry); args->result[i].callback = G_CALLBACK(activate_toggle_action); if (n < 1 || n > 7) rb_raise(rb_eArgError, "entry does not contain right number of entries %ld (1..7)", n); args->result[i].name = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[0]); switch (n) { case 7: args->result[i].is_active = RVAL2CBOOL(RARRAY_PTR(entry)[6]); case 6: /* TODO: Call #to_proc on entry 5? */ rb_hash_aset(args->procs, RARRAY_PTR(entry)[0], RARRAY_PTR(entry)[5]); case 5: args->result[i].tooltip = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[4]); case 4: args->result[i].accelerator = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[3]); case 3: args->result[i].label = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[2]); case 2: args->result[i].stock_id = RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(RARRAY_PTR(entry)[1]); break; default: break; } } return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gtktoggleactionentries_rescue(VALUE value) { g_free(((struct rbg_rval2gtktoggleactionentries_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GtkToggleActionEntry * rbg_rval2gtktoggleactionentries(volatile VALUE *value, long *n, VALUE procs) { struct rbg_rval2gtktoggleactionentries_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new0(GtkToggleActionEntry, args.n + 1); args.procs = procs; rb_rescue(rbg_rval2gtktoggleactionentries_body, (VALUE)&args, rbg_rval2gtktoggleactionentries_rescue, (VALUE)&args); *n = args.n; return args.result; } #define RVAL2GTKTOGGLEACTIONENTRIES(value, n, procs) rbg_rval2gtktoggleactionentries(&(value), &(n), procs) static VALUE rg_add_toggle_actions(VALUE self, VALUE rbentries) { GtkActionGroup *group = _SELF(self); VALUE toggle_action_procs = rb_ivar_defined(self, id_toggle_action_procs) == Qtrue ? rb_ivar_get(self, id_toggle_action_procs) : rb_hash_new(); long n; GtkToggleActionEntry *entries = RVAL2GTKTOGGLEACTIONENTRIES(rbentries, n, toggle_action_procs); rb_ivar_set(self, id_toggle_action_procs, toggle_action_procs); gtk_action_group_add_toggle_actions(group, entries, n, (gpointer)self); g_free(entries); return self; } static void activate_radio_action(GtkAction *action, GtkRadioAction *current, VALUE proc) { if (!NIL_P(proc)) rb_funcall(proc, id_call, 2, GOBJ2RVAL(action), GOBJ2RVAL(current)); } struct rbg_rval2gtkradioactionentries_args { VALUE ary; long n; GtkRadioActionEntry *result; }; static VALUE rbg_rval2gtkradioactionentries_body(VALUE value) { long i; struct rbg_rval2gtkradioactionentries_args *args = (struct rbg_rval2gtkradioactionentries_args *)value; for (i = 0; i < args->n; i++) { VALUE entry; long n; RARRAY_PTR(args->ary)[i] = rb_ary_dup(rb_ary_to_ary(RARRAY_PTR(args->ary)[i])); entry = RARRAY_PTR(args->ary)[i]; n = RARRAY_LEN(entry); switch (n) { case 6: args->result[i].value = NUM2INT(RARRAY_PTR(entry)[5]); case 5: args->result[i].tooltip = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[4]); case 4: args->result[i].accelerator = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[3]); case 3: args->result[i].label = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[2]); case 2: args->result[i].stock_id = RVAL2CSTR_ACCEPT_SYMBOL_ACCEPT_NIL(RARRAY_PTR(entry)[1]); case 1: args->result[i].name = RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[0]); break; default: rb_raise(rb_eArgError, "entry does not contain right number of entries %ld (1..6)", n); } } return Qnil; } static G_GNUC_NORETURN VALUE rbg_rval2gtkradioactionentries_rescue(VALUE value) { g_free(((struct rbg_rval2gtkradioactionentries_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GtkRadioActionEntry * rbg_rval2gtkradioactionentries(volatile VALUE *value, long *n) { struct rbg_rval2gtkradioactionentries_args args; args.ary = *value = rb_ary_dup(rb_ary_to_ary(*value)); args.n = RARRAY_LEN(args.ary); args.result = g_new0(GtkRadioActionEntry, args.n + 1); rb_rescue(rbg_rval2gtkradioactionentries_body, (VALUE)&args, rbg_rval2gtkradioactionentries_rescue, (VALUE)&args); *n = args.n; return args.result; } #define RVAL2GTKRADIOACTIONENTRIES(value, n) rbg_rval2gtkradioactionentries(&(value), &(n)) static VALUE rg_add_radio_actions(int argc, VALUE *argv, VALUE self) { GtkActionGroup *group = _SELF(self); VALUE rbentries, rbvalue, proc; long n; GtkRadioActionEntry *entries; gint value; rb_scan_args(argc, argv, "12", &rbentries, &rbvalue, &proc); value = NIL_P(rbvalue) ? -1 : NUM2INT(rbvalue); if (NIL_P(proc) && rb_block_given_p()) { proc = rb_block_proc(); /* TODO: How do we remove this proc when all the radio actions passed * have been removed? */ G_RELATIVE(self, proc); } entries = RVAL2GTKRADIOACTIONENTRIES(rbentries, n); gtk_action_group_add_radio_actions(group, entries, n, value, G_CALLBACK(activate_radio_action), (gpointer)proc); g_free(entries); return self; } static gchar * translate_func(const gchar *path, gpointer func) { VALUE ret = rb_funcall((VALUE)func, id_call, 1, CSTR2RVAL(path)); return (gchar *)RVAL2CSTR(ret); } static VALUE rg_set_translate_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_action_group_set_translate_func(_SELF(self), (GtkTranslateFunc)translate_func, (gpointer)func, NULL); return self; } static VALUE rg_set_translation_domain(VALUE self, VALUE domain) { gtk_action_group_set_translation_domain(_SELF(self), RVAL2CSTR_ACCEPT_NIL(domain)); return self; } static VALUE rg_translate_string(VALUE self, VALUE str) { return CSTR2RVAL(gtk_action_group_translate_string(_SELF(self), RVAL2CSTR(str))); } static void action_group_mark(void *p) { GtkActionGroup *group; GList *actions, *node; group = GTK_ACTION_GROUP(p); actions = gtk_action_group_list_actions(group); for (node = actions; node; node = g_list_next(node)) { GtkWidget *action = node->data; rbgobj_gc_mark_instance(action); } g_list_free(actions); } void Init_gtk_actiongroup(VALUE mGtk) { 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); RG_DEF_METHOD(translate_string, 1); } ���������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-action.c��������������������������������������������������0000644�0001750�0001750�00000012272�12102213527�017653� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAction #define _SELF(self) (RVAL2GTKACTION(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE name, options, label, tooltip, stock_id, buffer; rb_scan_args(argc, argv, "11", &name, &options); rbg_scan_options(options, "label", &label, "tooltip", &tooltip, "stock_id", &stock_id, NULL); G_INITIALIZE(self, gtk_action_new(RVAL2CSTR(name), RVAL2CSTR_ACCEPT_NIL(label), RVAL2CSTR_ACCEPT_NIL(tooltip), RVAL2GLIBID_ACCEPT_NIL(stock_id, buffer))); return Qnil; } static VALUE rg_is_sensitive_p(VALUE self) { return CBOOL2RVAL(gtk_action_is_sensitive(_SELF(self))); } static VALUE rg_is_visible_p(VALUE self) { return CBOOL2RVAL(gtk_action_is_visible(_SELF(self))); } static VALUE rg_activate(VALUE self) { gtk_action_activate(_SELF(self)); return self; } static VALUE rg_create_icon(VALUE self, VALUE icon_size) { return GOBJ2RVAL(gtk_action_create_icon(_SELF(self), RVAL2GTKICONSIZE(icon_size))); } static VALUE rg_create_menu_item(VALUE self) { return GOBJ2RVAL(gtk_action_create_menu_item(_SELF(self))); } static VALUE rg_create_menu(VALUE self) { return GOBJ2RVAL(gtk_action_create_menu(_SELF(self))); } static VALUE rg_create_tool_item(VALUE self) { return GOBJ2RVAL(gtk_action_create_tool_item(_SELF(self))); } static VALUE rg_proxies(VALUE self) { return GOBJGSLIST2RVAL(gtk_action_get_proxies(_SELF(self))); } static VALUE rg_connect_accelerator(VALUE self) { gtk_action_connect_accelerator(_SELF(self)); return self; } static VALUE rg_disconnect_accelerator(VALUE self) { gtk_action_disconnect_accelerator(_SELF(self)); return self; } static VALUE rg_set_accel_path(VALUE self, VALUE accel_path) { gtk_action_set_accel_path(_SELF(self), RVAL2CSTR(accel_path)); return self; } static VALUE rg_set_accel_group(VALUE self, VALUE accel_group) { gtk_action_set_accel_group(_SELF(self), NIL_P(accel_group) ? NULL : RVAL2GTKACCELGROUP(accel_group)); return self; } static VALUE rg_accel_path(VALUE self) { return CSTR2RVAL(gtk_action_get_accel_path(_SELF(self))); } static VALUE rg_accel_closure(VALUE self) { return GCLOSURE2RVAL(gtk_action_get_accel_closure(_SELF(self))); } static void action_mark(void *p) { GtkAction *action; GSList *node; action = GTK_ACTION(p); for (node = gtk_action_get_proxies(action); node; node = g_slist_next(node)) { GtkWidget *proxy = node->data; rbgobj_gc_mark_instance(proxy); } } static VALUE rg_unblock_activate(VALUE self) { gtk_action_unblock_activate(_SELF(self)); return self; } static VALUE rg_block_activate(VALUE self) { gtk_action_block_activate(_SELF(self)); if (rb_block_given_p()) rb_ensure(rb_yield, self, rg_unblock_activate, self); return self; } void Init_gtk_action(VALUE mGtk) { 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); RG_DEF_METHOD(create_menu, 0); RG_DEF_METHOD(create_tool_item, 0); RG_DEF_METHOD(proxies, 0); RG_DEF_METHOD(connect_accelerator, 0); RG_DEF_METHOD(disconnect_accelerator, 0); RG_DEF_METHOD(set_accel_path, 1); RG_DEF_METHOD(set_accel_group, 1); RG_DEF_METHOD(accel_path, 0); RG_DEF_METHOD(accel_closure, 0); RG_DEF_METHOD(block_activate, 0); RG_DEF_METHOD(unblock_activate, 0); RG_REG_GLIBID_SETTER("stock-id"); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-border.c��������������������������������������������������0000644�0001750�0001750�00000005524�12124610262�017656� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cBorder #define _SELF(self) (RVAL2GTKBORDER(self)) static VALUE rg_initialize(VALUE self, VALUE left, VALUE right, VALUE top, VALUE bottom) { GtkBorder border; border.left = NUM2INT(left); border.right = NUM2INT(right); border.top = NUM2INT(top); border.bottom = NUM2INT(bottom); G_INITIALIZE(self, g_boxed_copy(GTK_TYPE_BORDER, &border)); return Qnil; } static VALUE rg_left(VALUE self) { return INT2NUM(_SELF(self)->left); } static VALUE rg_set_left(VALUE self, VALUE val) { _SELF(self)->left = NUM2INT(val); return self; } static VALUE rg_right(VALUE self) { return INT2NUM(_SELF(self)->right); } static VALUE rg_set_right(VALUE self, VALUE val) { _SELF(self)->right = NUM2INT(val); return self; } static VALUE rg_top(VALUE self) { return INT2NUM(_SELF(self)->top); } static VALUE rg_set_top(VALUE self, VALUE val) { _SELF(self)->top = NUM2INT(val); return self; } static VALUE rg_bottom(VALUE self) { return INT2NUM(_SELF(self)->bottom); } static VALUE rg_set_bottom(VALUE self, VALUE val) { _SELF(self)->bottom = NUM2INT(val); return self; } static VALUE rg_to_a(VALUE self) { GtkBorder* border = _SELF(self); return rb_ary_new3(4, INT2NUM(border->left), INT2NUM(border->right), INT2NUM(border->top), INT2NUM(border->bottom)); } void Init_gtk_border(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BORDER, "Border", mGtk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD(left, 0); RG_DEF_METHOD(set_left, 1); RG_DEF_METHOD(right, 0); RG_DEF_METHOD(set_right, 1); RG_DEF_METHOD(top, 0); RG_DEF_METHOD(set_top, 1); RG_DEF_METHOD(bottom, 0); RG_DEF_METHOD(set_bottom, 1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tool-item.c�����������������������������������������������0000644�0001750�0001750�00000012237�12102213527�020310� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cToolItem #define _SELF(self) (RVAL2GTKTOOLITEM(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_tool_item_new()); return Qnil; } static VALUE rg_set_homogeneous(VALUE self, VALUE homogeneous) { gtk_tool_item_set_homogeneous(_SELF(self), RVAL2CBOOL(homogeneous)); return self; } static VALUE rg_homogeneous_p(VALUE self) { return CBOOL2RVAL(gtk_tool_item_get_homogeneous(_SELF(self))); } static VALUE rg_set_expand(VALUE self, VALUE expand) { gtk_tool_item_set_expand(_SELF(self), RVAL2CBOOL(expand)); return self; } static VALUE rg_expand_p(VALUE self) { return CBOOL2RVAL(gtk_tool_item_get_expand(_SELF(self))); } static VALUE rg_set_use_drag_window(VALUE self, VALUE use_drag_window) { gtk_tool_item_set_use_drag_window(_SELF(self), RVAL2CBOOL(use_drag_window)); return self; } static VALUE rg_use_drag_window_p(VALUE self) { return CBOOL2RVAL(gtk_tool_item_get_use_drag_window(_SELF(self))); } static VALUE rg_icon_size(VALUE self) { return GTKICONSIZE2RVAL(gtk_tool_item_get_icon_size(_SELF(self))); } static VALUE rg_orientation(VALUE self) { return GTKORIENTATION2RVAL(gtk_tool_item_get_orientation(_SELF(self))); } static VALUE rg_toolbar_style(VALUE self) { return GTKTOOLBARSTYLE2RVAL(gtk_tool_item_get_toolbar_style(_SELF(self))); } static VALUE rg_relief_style(VALUE self) { return GTKRELIEFSTYLE2RVAL(gtk_tool_item_get_relief_style(_SELF(self))); } static VALUE rg_retrieve_proxy_menu_item(VALUE self) { return GOBJ2RVAL(gtk_tool_item_retrieve_proxy_menu_item(_SELF(self))); } static VALUE rg_get_proxy_menu_item(VALUE self, VALUE menu_item_id) { return GOBJ2RVAL(gtk_tool_item_get_proxy_menu_item(_SELF(self), RVAL2CSTR(menu_item_id))); } static VALUE rg_set_proxy_menu_item(VALUE self, VALUE menu_item_id, VALUE menu_item) { gtk_tool_item_set_proxy_menu_item(_SELF(self), RVAL2CSTR(menu_item_id), RVAL2GTKWIDGET(menu_item)); return self; } static VALUE rg_rebuild_menu(VALUE self) { gtk_tool_item_rebuild_menu(_SELF(self)); return self; } static VALUE rg_ellipsize_mode(VALUE self) { return PANGOELLIPSIZEMODE2RVAL(gtk_tool_item_get_ellipsize_mode(_SELF(self))); } static VALUE rg_text_alignment(VALUE self) { return DBL2NUM(gtk_tool_item_get_text_alignment(_SELF(self))); } static VALUE rg_text_orientation(VALUE self) { return GTKORIENTATION2RVAL(gtk_tool_item_get_text_orientation(_SELF(self))); } static VALUE rg_text_size_group(VALUE self) { return GOBJ2RVAL(gtk_tool_item_get_text_size_group(_SELF(self))); } static VALUE rg_set_tooltip(VALUE self, VALUE tooltip) { if (TYPE(tooltip) == T_HASH) { VALUE text, markup; rbg_scan_options(tooltip, "text", &text, "markup", &markup, NULL); if (!NIL_P(text)) gtk_tool_item_set_tooltip_text(_SELF(self), RVAL2CSTR(text)); else if (!NIL_P(markup)) gtk_tool_item_set_tooltip_markup(_SELF(self), RVAL2CSTR(markup)); else rb_raise(rb_eArgError, "Invalid arguments."); } else { rb_raise(rb_eArgError, "Invalid arguments."); } return self; } static VALUE rg_toolbar_reconfigured(VALUE self) { gtk_tool_item_toolbar_reconfigured(_SELF(self)); return self; } void Init_gtk_toolitem(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOOL_ITEM, "ToolItem", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_homogeneous, 1); RG_DEF_METHOD_P(homogeneous, 0); RG_DEF_METHOD(set_expand, 1); RG_DEF_METHOD_P(expand, 0); RG_DEF_METHOD(set_use_drag_window, 1); RG_DEF_METHOD_P(use_drag_window, 0); RG_DEF_METHOD(icon_size, 0); RG_DEF_METHOD(orientation, 0); RG_DEF_METHOD(toolbar_style, 0); RG_DEF_METHOD(relief_style, 0); RG_DEF_METHOD(retrieve_proxy_menu_item, 0); RG_DEF_METHOD(get_proxy_menu_item, 1); RG_DEF_METHOD(set_proxy_menu_item, 2); RG_DEF_METHOD(rebuild_menu, 0); RG_DEF_METHOD(ellipsize_mode, 0); RG_DEF_METHOD(text_alignment, 0); RG_DEF_METHOD(text_orientation, 0); RG_DEF_METHOD(text_size_group, 0); RG_DEF_METHOD(set_tooltip, 1); RG_DEF_METHOD(toolbar_reconfigured, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tooltip.c�������������������������������������������������0000644�0001750�0001750�00000006471�12102213527�020074� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTooltip /* GTK_TOOLTIP type-cast is private because it should be useless */ #define _SELF(self) (RVAL2GOBJ(self)) static VALUE rg_set_markup(VALUE self, VALUE markup) { gtk_tooltip_set_markup(_SELF(self), RVAL2CSTR(markup)); return self; } static VALUE rg_set_text(VALUE self, VALUE text) { gtk_tooltip_set_text(_SELF(self), RVAL2CSTR(text)); return self; } static VALUE rg_set_icon(VALUE self, VALUE icon) { if (NIL_P(icon)) { gtk_tooltip_set_icon(_SELF(self), NULL); } else if (TYPE(icon) == T_HASH) { VALUE stock_id, icon_name, gicon, size, buffer; rbg_scan_options(icon, "stock_id", &stock_id, "icon_name", &icon_name, "gicon", &gicon, "size", &size, NULL); if (!NIL_P(stock_id)) gtk_tooltip_set_icon_from_stock(_SELF(self), RVAL2GLIBID(stock_id, buffer), RVAL2GTKICONSIZE(size)); else if (!NIL_P(icon_name)) gtk_tooltip_set_icon_from_icon_name(_SELF(self), RVAL2CSTR(icon_name), RVAL2GTKICONSIZE(size)); else if (!NIL_P(gicon)) gtk_tooltip_set_icon_from_gicon(_SELF(self), RVAL2GICON(gicon), RVAL2GTKICONSIZE(size)); else rb_raise(rb_eArgError, "Invalid arguments."); } else { GType gtype = RVAL2GTYPE(icon); if (gtype == GDK_TYPE_PIXBUF) gtk_tooltip_set_icon(_SELF(self), RVAL2GDKPIXBUF(icon)); else rb_raise(rb_eArgError, "Invalid arguments."); } return self; } static VALUE rg_set_custom(VALUE self, VALUE custom_widget) { gtk_tooltip_set_custom(_SELF(self), RVAL2GTKWIDGET(custom_widget)); return self; } void Init_gtk_tooltip(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOOLTIP, "Tooltip", mGtk); RG_DEF_METHOD(set_markup, 1); RG_DEF_METHOD(set_text, 1); RG_DEF_METHOD(set_icon, 1); RG_DEF_METHOD(set_custom, 1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-recent-chooser-menu.c�������������������������������������0000644�0001750�0001750�00000003110�12102213527�022247� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRecentChooserMenu #define _SELF(self) (RVAL2GTKRECENTCHOOSERMENU(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE manager; GtkWidget* menu; rb_scan_args(argc, argv, "01", &manager); if (NIL_P(manager)){ menu = gtk_recent_chooser_menu_new_for_manager(RVAL2GTKRECENTMANAGER(manager)); } else { menu = gtk_recent_chooser_menu_new(); } RBGTK_INITIALIZE(self, menu); return Qnil; } void Init_gtk_recent_chooser_menu(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_CHOOSER_MENU, "RecentChooserMenu", mGtk); RG_DEF_METHOD(initialize, -1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-text-tag-table.c������������������������������������������0000644�0001750�0001750�00000005036�12102213527�021220� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTextTagTable #define _SELF(self) (RVAL2GTKTEXTTAGTABLE(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_text_tag_table_new()); return Qnil; } static VALUE rg_add(VALUE self, VALUE tag) { G_CHILD_ADD(self, tag); gtk_text_tag_table_add(_SELF(self), RVAL2GTKTEXTTAG(tag)); return self; } static VALUE rg_remove(VALUE self, VALUE tag) { G_CHILD_REMOVE(self, tag); gtk_text_tag_table_remove(_SELF(self), RVAL2GTKTEXTTAG(tag)); return self; } static VALUE rg_lookup(VALUE self, VALUE name) { VALUE ret = Qnil; GtkTextTag* tag = gtk_text_tag_table_lookup(_SELF(self), RVAL2CSTR(name)); if (tag){ ret = GOBJ2RVAL(tag); G_CHILD_ADD(self, ret); } return ret; } static gboolean txt_tt_foreach_func(GtkTextTag *tag, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 1, GOBJ2RVAL(tag))); } static VALUE rg_each(VALUE self) { volatile VALUE func = rb_block_proc(); gtk_text_tag_table_foreach(_SELF(self), (GtkTextTagTableForeach)txt_tt_foreach_func, (gpointer)func); return self; } static VALUE rg_size(VALUE self) { return INT2NUM(gtk_text_tag_table_get_size(_SELF(self))); } void Init_gtk_text_tag_table(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_TAG_TABLE, "TextTagTable", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add, 1); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(lookup, 1); RG_DEF_ALIAS("[]", "lookup"); RG_DEF_METHOD(each, 0); RG_DEF_METHOD(size, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-toolbar.c�������������������������������������������������0000644�0001750�0001750�00000006132�12102213527�020036� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cToolbar #define _SELF(self) (RVAL2GTKTOOLBAR(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_toolbar_new()); return Qnil; } static VALUE rg_get_drop_index(VALUE self, VALUE x, VALUE y) { return INT2NUM(gtk_toolbar_get_drop_index(_SELF(self), NUM2INT(x), NUM2INT(y))); } static VALUE rg_get_item_index(VALUE self, VALUE item) { return INT2NUM(gtk_toolbar_get_item_index(_SELF(self), RVAL2GTKTOOLITEM(item))); } static VALUE rg_n_items(VALUE self) { return INT2NUM(gtk_toolbar_get_n_items(_SELF(self))); } static VALUE rg_get_nth_item(VALUE self, VALUE n) { return GOBJ2RVAL(gtk_toolbar_get_nth_item(_SELF(self), NUM2INT(n))); } static VALUE rg_relief_style(VALUE self) { return GTKRELIEFSTYLE2RVAL(gtk_toolbar_get_relief_style(_SELF(self))); } static VALUE rg_insert(VALUE self, VALUE item, VALUE pos) { gtk_toolbar_insert(_SELF(self), RVAL2GTKTOOLITEM(item), NUM2INT(pos)); return self; } static VALUE rg_set_drop_highlight_item(int argc, VALUE *argv, VALUE self) { VALUE tool_item, index_; rb_scan_args(argc, argv, "11", &tool_item, &index_); gtk_toolbar_set_drop_highlight_item(_SELF(self), NIL_P(tool_item) ? NULL : RVAL2GTKTOOLITEM(tool_item), NIL_P(tool_item) ? 0 : NUM2INT(index_)); return self; } static VALUE rg_unset_icon_size(VALUE self) { gtk_toolbar_unset_icon_size(_SELF(self)); return self; } static VALUE rg_unset_style(VALUE self) { gtk_toolbar_unset_style(_SELF(self)); return self; } void Init_gtk_toolbar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOOLBAR, "Toolbar", mGtk); G_DEF_CLASS(GTK_TYPE_TOOLBAR_SPACE_STYLE, "SpaceStyle", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_TOOLBAR_STYLE, "Style", RG_TARGET_NAMESPACE); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(get_drop_index, 2); RG_DEF_METHOD(get_item_index, 1); RG_DEF_METHOD(get_nth_item, 1); RG_DEF_METHOD(insert, 2); RG_DEF_METHOD(n_items, 0); RG_DEF_METHOD(relief_style, 0); RG_DEF_METHOD(set_drop_highlight_item, -1); RG_DEF_METHOD(unset_icon_size, 0); RG_DEF_METHOD(unset_style, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-scale.c���������������������������������������������������0000644�0001750�0001750�00000005435�12102213527�017470� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cScale #define _SELF(self) (RVAL2GTKSCALE(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE orientation, arg1, arg2, arg3; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "13", &orientation, &arg1, &arg2, &arg3); if (NIL_P(arg1) || RVAL2GTYPE(arg1) == GTK_TYPE_ADJUSTMENT) { widget = gtk_scale_new(RVAL2GTKORIENTATION(orientation), NIL_P(arg1) ? NULL : RVAL2GTKADJUSTMENT(arg1)); } else { widget = gtk_scale_new_with_range(RVAL2GTKORIENTATION(orientation), NUM2DBL(arg1), NUM2DBL(arg2), NUM2DBL(arg3)); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_layout(VALUE self) { return GOBJ2RVAL(gtk_scale_get_layout(_SELF(self))); } static VALUE rg_layout_offsets(VALUE self) { gint x, y; gtk_scale_get_layout_offsets(_SELF(self), &x, &y); return rb_assoc_new(INT2NUM(x), INT2NUM(y)); } static VALUE rg_add_mark(int argc, VALUE *argv, VALUE self) { VALUE value, position, markup; rb_scan_args(argc, argv, "21", &value, &position, &markup); gtk_scale_add_mark(_SELF(self), NUM2DBL(value), RVAL2GTKPOSITIONTYPE(position), RVAL2CSTR_ACCEPT_NIL(markup)); return self; } static VALUE rg_clear_marks(VALUE self) { gtk_scale_clear_marks(_SELF(self)); return self; } void Init_gtk_scale(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SCALE, "Scale", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(layout, 0); RG_DEF_METHOD(layout_offsets, 0); RG_DEF_METHOD(add_mark, -1); RG_DEF_METHOD(clear_marks, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-renderer-spinner.c�����������������������������������0000644�0001750�0001750�00000002442�12102213527�022573� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCellRendererSpinner #define _SELF(s) (RVAL2GTKCELLRENDERERSPINNER(s)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_spinner_new()); return Qnil; } void Init_gtk_cellrendererspinner(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_SPINNER, "CellRendererSpinner", mGtk); RG_DEF_METHOD(initialize, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk.c���������������������������������������������������������0000644�0001750�0001750�00000046245�12257552170�016422� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2001 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #include <locale.h> #define RG_TARGET_NAMESPACE mGtk static VALUE RG_TARGET_NAMESPACE; static VALUE rbgtk_eGtkInitError; ID id_relative_callbacks; ID id_call; static ID id__windows__; static ID id__quit_callbacks__, id__timeout_callbacks__; static ID id__idle_callbacks__, id__snooper_callbacks__; typedef struct _callback_info_t { VALUE callback; ID key; guint id; } callback_info_t; static void remove_from_windows(G_GNUC_UNUSED GtkWidget *window, VALUE obj) { VALUE klass, windows; klass = rb_obj_class(obj); windows = rb_ivar_get(klass, id__windows__); if (!NIL_P(windows)) { rb_hash_delete(windows, obj); } } void rbgtk_initialize_gtkobject(VALUE obj, GObject *gtkobj) { gtkobj = g_object_ref(gtkobj); g_object_ref_sink(gtkobj); G_INITIALIZE(obj, gtkobj); if (GTK_IS_WINDOW(gtkobj) || GTK_IS_MENU_SHELL(gtkobj)) { VALUE klass; klass = rb_obj_class(obj); if (rb_ivar_defined(klass, id__windows__) == Qfalse) { rb_ivar_set(klass, id__windows__, rb_hash_new()); } rb_hash_aset(rb_ivar_get(klass, id__windows__), obj, Qnil); g_signal_connect_after(gtkobj, "destroy", G_CALLBACK(remove_from_windows), (gpointer)obj); } } void exec_callback(GtkWidget *widget, gpointer proc) { rb_funcall((VALUE)proc, id_call, 1, GOBJ2RVAL(widget)); } /* * Gtk module */ /* We can't use rbgtk_poll() on native Win32. Because GPollFD doesn't have file descriptor but HANDLE. */ #define USE_POLL_FUNC static VALUE rg_s_events_pending_p(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gtk_events_pending()); } /* deprecated static VALUE rg_s_set_locale(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gtk_set_locale()); } */ static VALUE rg_s_disable_setlocale(G_GNUC_UNUSED VALUE self) { gtk_disable_setlocale(); return Qnil; } static VALUE rg_s_default_language(G_GNUC_UNUSED VALUE self) { return PANGOLANGUAGE2RVAL(gtk_get_default_language()); } typedef void (*SignalFunc) (int); static gboolean _initialized = FALSE; static VALUE rg_s_init(int argc, VALUE *argv, VALUE self) { gint i, gargc; VALUE argary; char** gargv; VALUE progname; if (_initialized) return self; else _initialized = TRUE; rb_scan_args(argc, argv, "01", &argary); if (NIL_P(argary)){ argary = rb_const_get(rb_cObject, rb_intern("ARGV")); gargc = RARRAY_LEN(argary); } else { Check_Type(argary, T_ARRAY); gargc = RARRAY_LEN(argary); } gargv = ALLOCA_N(char *, gargc + 1); progname = rb_gv_get("$0"); gargv[0] = (char *)RVAL2CSTR(progname); for (i = 0; i < gargc; i++) if (TYPE(RARRAY_PTR(argary)[i]) == T_STRING) gargv[i+1] = (char *)RVAL2CSTR(RARRAY_PTR(argary)[i]); else gargv[i+1] = (char *)""; gargc++; { gboolean is_initialized; is_initialized = gtk_init_check(&gargc, &gargv); if (! is_initialized) { const char *display_name_arg = gdk_get_display_arg_name(); display_name_arg = display_name_arg ? display_name_arg : g_getenv("DISPLAY"); rb_raise(rbgtk_eGtkInitError, "Cannot open display: %s", display_name_arg ? display_name_arg : " "); } setlocale(LC_NUMERIC, "C"); } return self; } /* We don't need them. gtk_init() */ static VALUE rg_s_main(G_GNUC_UNUSED VALUE self) { gtk_main(); return Qnil; } static VALUE rg_s_main_level(G_GNUC_UNUSED VALUE self) { return INT2FIX(gtk_main_level()); } static VALUE rg_s_main_quit(G_GNUC_UNUSED VALUE self) { gtk_main_quit(); return Qnil; } static VALUE rg_s_main_iteration(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gtk_main_iteration()); } static VALUE rg_s_main_iteration_do(G_GNUC_UNUSED VALUE self, VALUE blocking) { return CBOOL2RVAL(gtk_main_iteration_do(RVAL2CBOOL(blocking))); } static VALUE rg_s_main_do_event(G_GNUC_UNUSED VALUE self, VALUE event) { gtk_main_do_event(RVAL2GEV(event)); return event; } /* We don't need them. gtk_true() gtk_false() */ static VALUE rg_s_grab_add(G_GNUC_UNUSED VALUE self, VALUE widget) { gtk_grab_add(RVAL2GTKWIDGET(widget)); return Qnil; } static VALUE rg_s_current(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_grab_get_current()); } static VALUE rg_s_grab_remove(G_GNUC_UNUSED VALUE self, VALUE widget) { gtk_grab_remove(RVAL2GTKWIDGET(widget)); return Qnil; } static gint gtk_m_key_snoop_func(GtkWidget *grab_widget, GdkEventKey *event, gpointer func) { VALUE ret = rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(grab_widget), GEV2RVAL((GdkEvent*)event)); return RVAL2CBOOL(ret); } static VALUE rg_s_key_snooper_install(VALUE self) { VALUE func = rb_block_proc(); VALUE id = INT2FIX(gtk_key_snooper_install( (GtkKeySnoopFunc)gtk_m_key_snoop_func, (gpointer)func)); G_RELATIVE2(self, func, id__snooper_callbacks__, id); return id; } static VALUE rg_s_key_snooper_remove(VALUE self, VALUE id) { gtk_key_snooper_remove(NUM2UINT(id)); G_REMOVE_RELATIVE(self, id__snooper_callbacks__, id); return Qnil; } static VALUE rg_s_current_event(G_GNUC_UNUSED VALUE self) { return GEV2RVAL(gtk_get_current_event()); } static VALUE rg_s_current_event_time(G_GNUC_UNUSED VALUE self) { return INT2NUM(gtk_get_current_event_time()); } static VALUE rg_s_current_event_state(G_GNUC_UNUSED VALUE self) { GdkModifierType state; gboolean ret = gtk_get_current_event_state(&state); return ret ? GDKMODIFIERTYPE2RVAL(state) : Qnil; } static VALUE rg_s_propagate_event(G_GNUC_UNUSED VALUE self, VALUE widget, VALUE event) { gtk_propagate_event(RVAL2GTKWIDGET(widget), RVAL2GEV(event)); return Qnil; } static VALUE rg_s_check_version(G_GNUC_UNUSED VALUE self, VALUE major, VALUE minor, VALUE micro) { const gchar *ret; ret = gtk_check_version(FIX2INT(major), FIX2INT(minor), FIX2INT(micro)); return ret ? CSTR2RVAL(ret) : Qnil; } static VALUE rg_s_check_version_p(G_GNUC_UNUSED VALUE self, VALUE major, VALUE minor, VALUE micro) { const gchar *ret; ret = gtk_check_version(FIX2INT(major), FIX2INT(minor), FIX2INT(micro)); return CBOOL2RVAL(ret == NULL); } static VALUE rg_s_show_uri(G_GNUC_UNUSED VALUE self, VALUE rb_uri_or_options) { VALUE rb_screen = Qnil; VALUE rb_uri = Qnil; VALUE rb_timestamp = Qnil; GdkScreen *screen = NULL; const gchar *uri = NULL; guint32 timestamp = GDK_CURRENT_TIME; GError *error = NULL; if (TYPE(rb_uri_or_options) == T_HASH) { rbg_scan_options(rb_uri_or_options, "screen", &rb_screen, "uri", &rb_uri, "timestamp", &rb_timestamp, NULL); } else { rb_uri = rb_uri_or_options; } screen = RVAL2GOBJ(rb_screen); uri = StringValueCStr(rb_uri); if (!NIL_P(rb_timestamp)) { timestamp = NUM2UINT(rb_timestamp); } if (!gtk_show_uri(screen, uri, timestamp, &error)) { RAISE_GERROR(error); } return self; } void Init_gtk(void) { id_call = rb_intern("call"); id__windows__ = rb_intern("__windows__"); id__quit_callbacks__ = rb_intern("__quit_callbacks__"); id__timeout_callbacks__ = rb_intern("__timeout_callbacks__"); id__idle_callbacks__ = rb_intern("__idle_callbacks__"); id__snooper_callbacks__ = rb_intern("__snooper_callbacks__"); RG_TARGET_NAMESPACE = rb_define_module("Gtk"); rb_ivar_set(RG_TARGET_NAMESPACE, id_relative_callbacks, Qnil); rbgtk_eGtkInitError = rb_define_class_under(RG_TARGET_NAMESPACE, "InitError", rb_eRuntimeError); RG_DEF_SMETHOD_P(events_pending, 0); /* deprecated RG_DEF_SMETHOD(set_locale, 0); */ RG_DEF_SMETHOD(disable_setlocale, 0); RG_DEF_SMETHOD(default_language, 0); RG_DEF_SMETHOD(init, -1); RG_DEF_SMETHOD(main, 0); RG_DEF_SMETHOD(main_level, 0); RG_DEF_SMETHOD(main_quit, 0); RG_DEF_SMETHOD(main_iteration, 0); RG_DEF_SMETHOD(main_iteration_do, 1); RG_DEF_SMETHOD(main_do_event, 1); RG_DEF_SMETHOD(grab_add, 1); RG_DEF_SMETHOD(current, 0); RG_DEF_SMETHOD(grab_remove, 1); RG_DEF_SMETHOD(key_snooper_install, 0); RG_DEF_SMETHOD(key_snooper_remove, 1); RG_DEF_SMETHOD(current_event, 0); RG_DEF_SMETHOD(current_event_time, 0); RG_DEF_SMETHOD(current_event_state, 0); RG_DEF_SMETHOD(propagate_event, 2); RG_DEF_SMETHOD(check_version, 3); RG_DEF_SMETHOD_P(check_version, 3); RG_DEF_SMETHOD(show_uri, 1); rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_RESIZE", INT2FIX(GTK_PRIORITY_RESIZE)); Init_gtk_gdk_event(); Init_gtk_drag_gdk_drag_context(); Init_gtk_style_context_gdk_screen(); Init_gtk_tooltip_gdk_display(); Init_gtk_aboutdialog(RG_TARGET_NAMESPACE); Init_gtk_accelerator(RG_TARGET_NAMESPACE); Init_gtk_accel_group(RG_TARGET_NAMESPACE); Init_gtk_accel_group_entry(RG_TARGET_NAMESPACE); Init_gtk_accel_key(RG_TARGET_NAMESPACE); Init_gtk_accel_label(RG_TARGET_NAMESPACE); Init_gtk_accel_map(RG_TARGET_NAMESPACE); Init_gtk_accessible(RG_TARGET_NAMESPACE); Init_gtk_action(RG_TARGET_NAMESPACE); Init_gtk_actiongroup(RG_TARGET_NAMESPACE); Init_gtk_activatable(RG_TARGET_NAMESPACE); Init_gtk_adjustment(RG_TARGET_NAMESPACE); Init_gtk_alignment(RG_TARGET_NAMESPACE); Init_gtk_allocation(RG_TARGET_NAMESPACE); Init_gtk_appchooser(RG_TARGET_NAMESPACE); Init_gtk_appchooserbutton(RG_TARGET_NAMESPACE); Init_gtk_appchooserdialog(RG_TARGET_NAMESPACE); Init_gtk_appchooserwidget(RG_TARGET_NAMESPACE); Init_gtk_application(RG_TARGET_NAMESPACE); Init_gtk_arrow(RG_TARGET_NAMESPACE); Init_gtk_aspect_frame(RG_TARGET_NAMESPACE); Init_gtk_assistant(RG_TARGET_NAMESPACE); Init_gtk_button_box(RG_TARGET_NAMESPACE); Init_gtk_bin(RG_TARGET_NAMESPACE); Init_gtk_bindings(RG_TARGET_NAMESPACE); Init_gtk_border(RG_TARGET_NAMESPACE); Init_gtk_box(RG_TARGET_NAMESPACE); Init_gtk_buildable(RG_TARGET_NAMESPACE); Init_gtk_builder(RG_TARGET_NAMESPACE); Init_gtk_button(RG_TARGET_NAMESPACE); Init_gtk_calendar(RG_TARGET_NAMESPACE); Init_gtk_celleditable(RG_TARGET_NAMESPACE); Init_gtk_celllayout(RG_TARGET_NAMESPACE); Init_gtk_cellrenderer(RG_TARGET_NAMESPACE); Init_gtk_cellrendereraccel(RG_TARGET_NAMESPACE); Init_gtk_cellrenderercombo(RG_TARGET_NAMESPACE); Init_gtk_cellrendererpixbuf(RG_TARGET_NAMESPACE); Init_gtk_cellrendererprogress(RG_TARGET_NAMESPACE); Init_gtk_cellrendererspin(RG_TARGET_NAMESPACE); Init_gtk_cellrendererspinner(RG_TARGET_NAMESPACE); Init_gtk_cellrenderertext(RG_TARGET_NAMESPACE); Init_gtk_cellrenderertoggle(RG_TARGET_NAMESPACE); Init_gtk_cellview(RG_TARGET_NAMESPACE); Init_gtk_check_button(RG_TARGET_NAMESPACE); Init_gtk_check_menu_item(RG_TARGET_NAMESPACE); Init_gtk_clipboard(RG_TARGET_NAMESPACE); Init_gtk_colorbutton(RG_TARGET_NAMESPACE); Init_gtk_color_selection(RG_TARGET_NAMESPACE); Init_gtk_color_selection_dialog(RG_TARGET_NAMESPACE); Init_gtk_combobox(RG_TARGET_NAMESPACE); Init_gtk_comboboxtext(RG_TARGET_NAMESPACE); Init_gtk_const(RG_TARGET_NAMESPACE); Init_gtk_container(RG_TARGET_NAMESPACE); Init_gtk_cssprovider(RG_TARGET_NAMESPACE); Init_gtk_dialog(RG_TARGET_NAMESPACE); Init_gtk_drag(RG_TARGET_NAMESPACE); Init_gtk_drawing_area(RG_TARGET_NAMESPACE); Init_gtk_editable(RG_TARGET_NAMESPACE); Init_gtk_entry(RG_TARGET_NAMESPACE); Init_gtk_entrybuffer(RG_TARGET_NAMESPACE); Init_gtk_entry_completion(RG_TARGET_NAMESPACE); Init_gtk_eventbox(RG_TARGET_NAMESPACE); Init_gtk_expander(RG_TARGET_NAMESPACE); Init_gtk_file_chooser(RG_TARGET_NAMESPACE); Init_gtk_filesystemerror(RG_TARGET_NAMESPACE); Init_gtk_filechooserbutton(RG_TARGET_NAMESPACE); Init_gtk_file_chooser_dialog(RG_TARGET_NAMESPACE); Init_gtk_file_chooser_widget(RG_TARGET_NAMESPACE); Init_gtk_file_filter(RG_TARGET_NAMESPACE); Init_gtk_fixed(RG_TARGET_NAMESPACE); Init_gtk_fontbutton(RG_TARGET_NAMESPACE); Init_gtk_fontchooser(RG_TARGET_NAMESPACE); Init_gtk_fontchooserdialog(RG_TARGET_NAMESPACE); Init_gtk_fontchooserwidget(RG_TARGET_NAMESPACE); Init_gtk_frame(RG_TARGET_NAMESPACE); Init_gtk_grid(RG_TARGET_NAMESPACE); Init_gtk_handle_box(RG_TARGET_NAMESPACE); Init_gtk_hsv(RG_TARGET_NAMESPACE); Init_gtk_icon_factory(RG_TARGET_NAMESPACE); Init_gtk_icon_info(RG_TARGET_NAMESPACE); Init_gtk_icon_set(RG_TARGET_NAMESPACE); Init_gtk_icon_size(RG_TARGET_NAMESPACE); Init_gtk_icon_source(RG_TARGET_NAMESPACE); Init_gtk_icon_theme(RG_TARGET_NAMESPACE); Init_gtk_iconview(RG_TARGET_NAMESPACE); Init_gtk_image(RG_TARGET_NAMESPACE); Init_gtk_image_menu_item(RG_TARGET_NAMESPACE); Init_gtk_imcontext(RG_TARGET_NAMESPACE); Init_gtk_imcontext_simple(RG_TARGET_NAMESPACE); Init_gtk_im_multicontext(RG_TARGET_NAMESPACE); Init_gtk_infobar(RG_TARGET_NAMESPACE); Init_gtk_invisible(RG_TARGET_NAMESPACE); Init_gtk_label(RG_TARGET_NAMESPACE); Init_gtk_layout(RG_TARGET_NAMESPACE); Init_gtk_link_button(RG_TARGET_NAMESPACE); Init_gtk_list_store(RG_TARGET_NAMESPACE); Init_gtk_lockbutton(RG_TARGET_NAMESPACE); Init_gtk_menu(RG_TARGET_NAMESPACE); Init_gtk_menu_bar(RG_TARGET_NAMESPACE); Init_gtk_menu_item(RG_TARGET_NAMESPACE); Init_gtk_menu_shell(RG_TARGET_NAMESPACE); Init_gtk_menutoolbutton(RG_TARGET_NAMESPACE); Init_gtk_message_dialog(RG_TARGET_NAMESPACE); Init_gtk_misc(RG_TARGET_NAMESPACE); Init_gtk_notebook(RG_TARGET_NAMESPACE); Init_gtk_numerableicon(RG_TARGET_NAMESPACE); Init_gtk_orientable(RG_TARGET_NAMESPACE); Init_gtk_overlay(RG_TARGET_NAMESPACE); Init_gtk_page_setup(RG_TARGET_NAMESPACE); Init_gtk_page_setup_unix_dialog(RG_TARGET_NAMESPACE); Init_gtk_paned(RG_TARGET_NAMESPACE); Init_gtk_paper_size(RG_TARGET_NAMESPACE); Init_gtk_plug(RG_TARGET_NAMESPACE); Init_gtk_print_context(RG_TARGET_NAMESPACE); Init_gtk_printer(RG_TARGET_NAMESPACE); Init_gtk_print_job(RG_TARGET_NAMESPACE); Init_gtk_print_operation(RG_TARGET_NAMESPACE); Init_gtk_print_operation_preview(RG_TARGET_NAMESPACE); Init_gtk_print_settings(RG_TARGET_NAMESPACE); Init_gtk_print_unix_dialog(RG_TARGET_NAMESPACE); Init_gtk_progress_bar(RG_TARGET_NAMESPACE); Init_gtk_radio_action(RG_TARGET_NAMESPACE); Init_gtk_radio_button(RG_TARGET_NAMESPACE); Init_gtk_radio_menu_item(RG_TARGET_NAMESPACE); Init_gtk_radiotoolbutton(RG_TARGET_NAMESPACE); Init_gtk_range(RG_TARGET_NAMESPACE); Init_gtk_recentaction(RG_TARGET_NAMESPACE); Init_gtk_recent_chooser(RG_TARGET_NAMESPACE); Init_gtk_recent_chooser_dialog(RG_TARGET_NAMESPACE); Init_gtk_recent_chooser_menu(RG_TARGET_NAMESPACE); Init_gtk_recent_chooser_widget(RG_TARGET_NAMESPACE); Init_gtk_recent_data(RG_TARGET_NAMESPACE); Init_gtk_recent_filter(RG_TARGET_NAMESPACE); Init_gtk_recent_filter_info(RG_TARGET_NAMESPACE); Init_gtk_recent_info(RG_TARGET_NAMESPACE); Init_gtk_recent_manager(RG_TARGET_NAMESPACE); Init_gtk_scale(RG_TARGET_NAMESPACE); Init_gtk_scalebutton(RG_TARGET_NAMESPACE); Init_gtk_scrollable(RG_TARGET_NAMESPACE); Init_gtk_scrollbar(RG_TARGET_NAMESPACE); Init_gtk_scrolled_window(RG_TARGET_NAMESPACE); Init_gtk_selection(RG_TARGET_NAMESPACE); Init_gtk_selectiondata(RG_TARGET_NAMESPACE); Init_gtk_separator(RG_TARGET_NAMESPACE); Init_gtk_separator_menu_item(RG_TARGET_NAMESPACE); Init_gtk_separatortoolitem(RG_TARGET_NAMESPACE); Init_gtk_settings(RG_TARGET_NAMESPACE); Init_gtk_size_group(RG_TARGET_NAMESPACE); Init_gtk_socket(RG_TARGET_NAMESPACE); Init_gtk_spin_button(RG_TARGET_NAMESPACE); Init_gtk_spinner(RG_TARGET_NAMESPACE); Init_gtk_statusbar(RG_TARGET_NAMESPACE); Init_gtk_status_icon(RG_TARGET_NAMESPACE); Init_gtk_stock(RG_TARGET_NAMESPACE); Init_gtk_stylecontext(RG_TARGET_NAMESPACE); Init_gtk_styleproperties(RG_TARGET_NAMESPACE); Init_gtk_styleprovider(RG_TARGET_NAMESPACE); Init_gtk_switch(RG_TARGET_NAMESPACE); Init_gtk_table(RG_TARGET_NAMESPACE); Init_gtk_target_list(RG_TARGET_NAMESPACE); Init_gtk_tearoff_menu_item(RG_TARGET_NAMESPACE); Init_gtk_text_appearance(RG_TARGET_NAMESPACE); Init_gtk_text_attributes(RG_TARGET_NAMESPACE); Init_gtk_textbuffer(RG_TARGET_NAMESPACE); Init_gtk_textchild(RG_TARGET_NAMESPACE); Init_gtk_textiter(RG_TARGET_NAMESPACE); Init_gtk_textmark(RG_TARGET_NAMESPACE); Init_gtk_texttag(RG_TARGET_NAMESPACE); Init_gtk_text_tag_table(RG_TARGET_NAMESPACE); Init_gtk_textview(RG_TARGET_NAMESPACE); Init_gtk_themingengine(RG_TARGET_NAMESPACE); Init_gtk_toggle_action(RG_TARGET_NAMESPACE); Init_gtk_toggle_button(RG_TARGET_NAMESPACE); Init_gtk_toggletoolbutton(RG_TARGET_NAMESPACE); Init_gtk_toolbar(RG_TARGET_NAMESPACE); Init_gtk_toolbutton(RG_TARGET_NAMESPACE); Init_gtk_toolitem(RG_TARGET_NAMESPACE); Init_gtk_toolitemgroup(RG_TARGET_NAMESPACE); Init_gtk_toolshell(RG_TARGET_NAMESPACE); Init_gtk_tooltip(RG_TARGET_NAMESPACE); Init_gtk_treedragdest(RG_TARGET_NAMESPACE); Init_gtk_treedragsource(RG_TARGET_NAMESPACE); Init_gtk_treeiter(RG_TARGET_NAMESPACE); Init_gtk_treemodel(RG_TARGET_NAMESPACE); Init_gtk_treemodelfilter(RG_TARGET_NAMESPACE); Init_gtk_tmodelsort(RG_TARGET_NAMESPACE); Init_gtk_treepath(RG_TARGET_NAMESPACE); Init_gtk_treerowreference(RG_TARGET_NAMESPACE); Init_gtk_treeselection(RG_TARGET_NAMESPACE); Init_gtk_treesortable(RG_TARGET_NAMESPACE); Init_gtk_tree_store(RG_TARGET_NAMESPACE); Init_gtk_treeview(RG_TARGET_NAMESPACE); Init_gtk_treeviewcolumn(RG_TARGET_NAMESPACE); Init_gtk_uimanager(RG_TARGET_NAMESPACE); Init_gtk_viewport(RG_TARGET_NAMESPACE); Init_gtk_volumebutton(RG_TARGET_NAMESPACE); Init_gtk_widget(RG_TARGET_NAMESPACE); Init_gtk_widgetpath(RG_TARGET_NAMESPACE); Init_gtk_window(RG_TARGET_NAMESPACE); Init_gtk_windowgroup(RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-application.c���������������������������������������������0000644�0001750�0001750�00000003733�12102213527�020703� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cApplication #define _SELF(self) (RVAL2GTKAPPLICATION(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE application_id, flags; rb_scan_args(argc, argv, "11", &application_id, &flags); G_INITIALIZE(self, gtk_application_new(RVAL2CSTR(application_id), NIL_P(flags) ? 0 : RVAL2GAPPLICATIONFLAGS(flags))); return Qnil; } static VALUE rg_add_window(VALUE self, VALUE window) { gtk_application_add_window(_SELF(self), RVAL2GTKWINDOW(window)); return self; } static VALUE rg_windows(VALUE self) { return GOBJGLIST2RVAL(gtk_application_get_windows(_SELF(self))); } static VALUE rg_remove_window(VALUE self, VALUE window) { gtk_application_remove_window(_SELF(self), RVAL2GTKWINDOW(window)); return self; } void Init_gtk_application(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_APPLICATION, "Application", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(add_window, 1); RG_DEF_METHOD(windows, 0); RG_DEF_METHOD(remove_window, 1); } �������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-misc.c����������������������������������������������������0000644�0001750�0001750�00000004066�12102213527�017333� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cMisc #define _SELF(s) (RVAL2GTKMISC(s)) static VALUE rg_set_alignment(VALUE self, VALUE xalign, VALUE yalign) { gtk_misc_set_alignment(_SELF(self), NUM2DBL(xalign), NUM2DBL(yalign)); return self; } static VALUE rg_set_padding(VALUE self, VALUE xpad, VALUE ypad) { gtk_misc_set_padding(_SELF(self), NUM2DBL(xpad), NUM2DBL(ypad)); return self; } static VALUE rg_alignment(VALUE self) { gfloat xalign, yalign; gtk_misc_get_alignment(_SELF(self), &xalign, &yalign); return rb_ary_new3(2, rb_float_new(xalign), rb_float_new(yalign)); } static VALUE rg_padding(VALUE self) { gint xpad, ypad; gtk_misc_get_padding(_SELF(self), &xpad, &ypad); return rb_ary_new3(2, INT2NUM(xpad), INT2NUM(ypad)); } void Init_gtk_misc(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MISC, "Misc", mGtk); RG_DEF_METHOD(set_alignment, 2); RG_DEF_METHOD(set_padding, 2); RG_DEF_METHOD(alignment, 0); RG_DEF_METHOD(padding, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-print-operation-preview.c���������������������������������0000644�0001750�0001750�00000003575�12102213527�023215� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cPrintOperationPreview #define _SELF(s) (RVAL2GTKPRINTOPERATIONPREVIEW(s)) static VALUE rg_render_page(VALUE self, VALUE page_number) { gtk_print_operation_preview_render_page(_SELF(self), NUM2INT(page_number)); return self; } static VALUE rg_end_preview(VALUE self) { gtk_print_operation_preview_end_preview(_SELF(self)); return self; } static VALUE rg_selected_p(VALUE self, VALUE page_number) { gboolean selected; selected = gtk_print_operation_preview_is_selected(_SELF(self), NUM2INT(page_number)); return CBOOL2RVAL(selected); } void Init_gtk_print_operation_preview(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_OPERATION_PREVIEW, "PrintOperationPreview", mGtk); RG_DEF_METHOD(render_page, 1); RG_DEF_METHOD(end_preview, 0); RG_DEF_METHOD_P(selected, 1); } �����������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-builder.c�������������������������������������������������0000644�0001750�0001750�00000011060�12102213527�020016� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #include <glib-enum-types.h> /* From Ruby/GLib2 */ #define RG_TARGET_NAMESPACE cBuilder #define _SELF(self) (RVAL2GTKBUILDER(self)) static ID id___connect_signals__; static void builder_mark(gpointer object) { GtkBuilder *builder = object; GSList *objects; objects = gtk_builder_get_objects(builder); g_slist_foreach(objects, (GFunc)rbgobj_gc_mark_instance, NULL); g_slist_free(objects); } static VALUE rg_initialize(VALUE self) { GtkBuilder *builder; builder = gtk_builder_new(); G_INITIALIZE(self, builder); return Qnil; } static VALUE rg_add_from_file(VALUE self, VALUE filename) { GError *error = NULL; if (gtk_builder_add_from_file(_SELF(self), RVAL2CSTR(filename), &error) == 0) RAISE_GERROR(error); return self; } static VALUE rg_add_from_string(VALUE self, VALUE string) { GError *error = NULL; StringValue(string); if (gtk_builder_add_from_string(_SELF(self), RSTRING_PTR(string), RSTRING_LEN(string), &error) == 0) RAISE_GERROR(error); return self; } static VALUE rg_add(VALUE self, VALUE filename_or_xml) { const char xml_detect_re_str[] = "(?:\\A<|[\\r\\n])"; VALUE xml_detect_re; xml_detect_re = rb_reg_new(xml_detect_re_str, strlen(xml_detect_re_str), 0); if (NIL_P(rb_reg_match(xml_detect_re, filename_or_xml))) return rg_add_from_file(self, filename_or_xml); else return rg_add_from_string(self, filename_or_xml); } static VALUE rg_get_object(VALUE self, VALUE name) { return GOBJ2RVAL(gtk_builder_get_object(_SELF(self), RVAL2CSTR(name))); } static VALUE rg_objects(VALUE self) { return GOBJGSLIST2RVAL_FREE(gtk_builder_get_objects(_SELF(self)), g_slist_free, NULL); } static void connect_signals(GtkBuilder *builder, GObject *object, const gchar *signal_name, const gchar *handler_name, GObject *connect_object, GConnectFlags flags, gpointer user_data) { VALUE signal_connector = (VALUE)user_data; rb_funcall(GOBJ2RVAL(builder), id___connect_signals__, 6, signal_connector, GOBJ2RVAL(object), CSTR2RVAL(signal_name), CSTR2RVAL(handler_name), GOBJ2RVAL(connect_object), GCONNECTFLAGS2RVAL(flags)); } static VALUE rg_connect_signals(VALUE self) { VALUE signal_connector; signal_connector = rb_block_proc(); G_CHILD_ADD(self, signal_connector); gtk_builder_connect_signals_full(_SELF(self), connect_signals, (gpointer)signal_connector); G_CHILD_REMOVE(self, signal_connector); return self; } static VALUE rg_get_type(VALUE self, VALUE name) { return GTYPE2CLASS(gtk_builder_get_type_from_name(_SELF(self), RVAL2CSTR(name))); } void Init_gtk_builder(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE; id___connect_signals__ = rb_intern("__connect_signals__"); RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_GC_FUNC(GTK_TYPE_BUILDER, "Builder", mGtk, builder_mark, NULL); G_DEF_CLASS(GTK_TYPE_BUILDER_ERROR, "BuilderError", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add_from_file, 1); RG_DEF_METHOD(add_from_string, 1); RG_DEF_METHOD(add, 1); RG_DEF_ALIAS("<<", "add"); RG_DEF_METHOD(get_object, 1); RG_DEF_ALIAS("[]", "get_object"); RG_DEF_METHOD(objects, 0); RG_DEF_METHOD(connect_signals, 0); RG_DEF_METHOD(get_type, 1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-calendar.c������������������������������������������������0000644�0001750�0001750�00000006137�12102213527�020152� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCalendar #define _SELF(self) (RVAL2GTKCALENDAR(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_calendar_new()); return Qnil; } static VALUE rg_select_month(VALUE self, VALUE month, VALUE year) { gtk_calendar_select_month(_SELF(self), NUM2INT(month)-1, NUM2INT(year)); return self; } static VALUE rg_select_day(VALUE self, VALUE day) { gtk_calendar_select_day(_SELF(self), NUM2INT(day)); return self; } static VALUE rg_mark_day(VALUE self, VALUE day) { gtk_calendar_mark_day(_SELF(self), NUM2INT(day)); return self; } static VALUE rg_unmark_day(VALUE self, VALUE day) { gtk_calendar_unmark_day(_SELF(self), NUM2INT(day)); return self; } static VALUE rg_clear_marks(VALUE self) { gtk_calendar_clear_marks(_SELF(self)); return self; } static VALUE rg_date(VALUE self) { VALUE ret; guint year, month, day; gtk_calendar_get_date(_SELF(self), &year, &month, &day); ret = rb_ary_new(); rb_ary_push(ret, INT2FIX(year)); rb_ary_push(ret, INT2FIX(month+1)); rb_ary_push(ret, INT2FIX(day)); return ret; } static VALUE rg_display_options(VALUE self) { return GTKCALENDARDISPLAYOPTIONS2RVAL(gtk_calendar_get_display_options(_SELF(self))); } static VALUE rg_set_display_options(VALUE self, VALUE flags) { gtk_calendar_set_display_options(_SELF(self), RVAL2GTKCALENDARDISPLAYOPTIONS(flags)); return self; } void Init_gtk_calendar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CALENDAR, "Calendar", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(select_month, 2); RG_DEF_METHOD(select_day, 1); RG_DEF_METHOD(mark_day, 1); RG_DEF_METHOD(unmark_day, 1); RG_DEF_METHOD(clear_marks, 0); RG_DEF_METHOD(date, 0); RG_DEF_METHOD(display_options, 0); RG_DEF_METHOD(set_display_options, 1); G_DEF_CLASS(GTK_TYPE_CALENDAR_DISPLAY_OPTIONS, "DisplayOptions", RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-renderer.c�������������������������������������������0000644�0001750�0001750�00000010143�12257552167�021135� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCellRenderer #define _SELF(s) (RVAL2GTKCELLRENDERER(s)) static VALUE rg_get_preferred_size(VALUE self, VALUE widget) { GtkRequisition minimum_size, natural_size; gtk_cell_renderer_get_preferred_size(_SELF(self), RVAL2GTKWIDGET(widget), &minimum_size, &natural_size); return rb_ary_new3(2, GTKREQUISITION2RVAL(&minimum_size), GTKREQUISITION2RVAL(&natural_size)); } /* TODO static VALUE rg_render(VALUE self, VALUE window, VALUE widget, VALUE background_area, VALUE cell_area, VALUE expose_area, VALUE flags) { gtk_cell_renderer_render(_SELF(self), RVAL2GDKWINDOW(window), RVAL2GTKWIDGET(widget), RVAL2GDKRECTANGLE(background_area), RVAL2GDKRECTANGLE(cell_area), RVAL2GDKRECTANGLE(expose_area), RVAL2GTKCELLRENDERERSTATE(flags)); return self; } */ static VALUE rg_activate(VALUE self, VALUE event, VALUE widget, VALUE path, VALUE background_area, VALUE cell_area, VALUE flags) { gboolean ret = gtk_cell_renderer_activate(_SELF(self), (GdkEvent*)RVAL2GEV(event), RVAL2GTKWIDGET(widget), RVAL2CSTR(path), RVAL2GDKRECTANGLE(background_area), RVAL2GDKRECTANGLE(cell_area), RVAL2GTKCELLRENDERERSTATE(flags)); return CBOOL2RVAL(ret); } static VALUE rg_start_editing(VALUE self, VALUE event, VALUE widget, VALUE path, VALUE background_area, VALUE cell_area, VALUE flags) { GtkCellEditable* edit = gtk_cell_renderer_start_editing(_SELF(self), (GdkEvent*)RVAL2GEV(event), RVAL2GTKWIDGET(widget), RVAL2CSTR(path), RVAL2GDKRECTANGLE(background_area), RVAL2GDKRECTANGLE(cell_area), RVAL2GTKCELLRENDERERSTATE(flags)); return edit ? GOBJ2RVAL(edit) : Qnil; } static VALUE rg_stop_editing(VALUE self, VALUE canceled) { gtk_cell_renderer_stop_editing(_SELF(self), RVAL2CBOOL(canceled)); return self; } static VALUE rg_fixed_size(VALUE self) { int width, height; gtk_cell_renderer_get_fixed_size(_SELF(self), &width, &height); return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); } static VALUE rg_set_fixed_size(VALUE self, VALUE width, VALUE height) { gtk_cell_renderer_set_fixed_size(_SELF(self), NUM2INT(width), NUM2INT(height)); return self; } void Init_gtk_cellrenderer(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER, "CellRenderer", mGtk); RG_DEF_METHOD(get_preferred_size, 1); /* TODO RG_DEF_METHOD(render, 6); */ RG_DEF_METHOD(activate, 6); RG_DEF_METHOD(start_editing, 6); RG_DEF_METHOD(stop_editing, 1); RG_DEF_METHOD(fixed_size, 0); RG_DEF_METHOD(set_fixed_size, 2); G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_STATE, "State", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_MODE, "Mode", RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-page-setup.c����������������������������������������������0000644�0001750�0001750�00000013143�12102213527�020446� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cPageSetup #define _SELF(s) (RVAL2GTKPAGESETUP(s)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_page_setup_new()); return Qnil; } static VALUE rg_dup(VALUE self) { return GOBJ2RVALU(gtk_page_setup_copy(_SELF(self))); } static VALUE rg_orientation(VALUE self) { return GTKPAGEORIENTATION2RVAL(gtk_page_setup_get_orientation(_SELF(self))); } static VALUE rg_set_orientation(VALUE self, VALUE orientation) { gtk_page_setup_set_orientation(_SELF(self), RVAL2GTKPAGEORIENTATION(orientation)); return self; } static VALUE rg_paper_size(VALUE self) { return GTKPAPERSIZE2RVAL(gtk_page_setup_get_paper_size(_SELF(self))); } static VALUE rg_set_paper_size(VALUE self, VALUE paper_size) { gtk_page_setup_set_paper_size(_SELF(self), RVAL2GTKPAPERSIZE(paper_size)); return self; } static VALUE rg_get_top_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_top_margin(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_set_top_margin(VALUE self, VALUE margin, VALUE unit) { gtk_page_setup_set_top_margin(_SELF(self), NUM2DBL(margin), RVAL2GTKUNIT(unit)); return self; } static VALUE rg_get_bottom_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_bottom_margin(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_set_bottom_margin(VALUE self, VALUE margin, VALUE unit) { gtk_page_setup_set_bottom_margin(_SELF(self), NUM2DBL(margin), RVAL2GTKUNIT(unit)); return self; } static VALUE rg_get_left_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_left_margin(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_set_left_margin(VALUE self, VALUE margin, VALUE unit) { gtk_page_setup_set_left_margin(_SELF(self), NUM2DBL(margin), RVAL2GTKUNIT(unit)); return self; } static VALUE rg_get_right_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_right_margin(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_set_right_margin(VALUE self, VALUE margin, VALUE unit) { gtk_page_setup_set_right_margin(_SELF(self), NUM2DBL(margin), RVAL2GTKUNIT(unit)); return self; } static VALUE rg_set_paper_size_and_default_margins(VALUE self, VALUE size) { gtk_page_setup_set_paper_size_and_default_margins(_SELF(self), RVAL2GTKPAPERSIZE(size)); return self; } /* These take orientation, but not margins into consideration */ static VALUE rg_get_paper_width(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_paper_width(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_get_paper_height(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_paper_height(_SELF(self), RVAL2GTKUNIT(unit))); } /* These take orientation, and margins into consideration */ static VALUE rg_get_page_width(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_page_width(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_get_page_height(VALUE self, VALUE unit) { return rb_float_new(gtk_page_setup_get_page_height(_SELF(self), RVAL2GTKUNIT(unit))); } void Init_gtk_page_setup(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PAGE_SETUP, "PageSetup", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(dup, 0); RG_DEF_METHOD(orientation, 0); RG_DEF_METHOD(set_orientation, 1); RG_DEF_METHOD(paper_size, 0); RG_DEF_METHOD(set_paper_size, 1); RG_DEF_METHOD(get_top_margin, 1); RG_DEF_METHOD(set_top_margin, 2); RG_DEF_METHOD(get_bottom_margin, 1); RG_DEF_METHOD(set_bottom_margin, 2); RG_DEF_METHOD(get_left_margin, 1); RG_DEF_METHOD(set_left_margin, 2); RG_DEF_METHOD(get_right_margin, 1); RG_DEF_METHOD(set_right_margin, 2); RG_DEF_METHOD(set_paper_size_and_default_margins, 1); /* These take orientation, but not margins into consideration */ RG_DEF_METHOD(get_paper_width, 1); RG_DEF_METHOD(get_paper_height, 1); /* These take orientation, and margins into consideration */ RG_DEF_METHOD(get_page_width, 1); RG_DEF_METHOD(get_page_height, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-text-tag.c������������������������������������������������0000644�0001750�0001750�00000004135�12102213527�020132� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTextTag static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE name; rb_scan_args(argc, argv, "01", &name); G_INITIALIZE(self, gtk_text_tag_new(RVAL2CSTR_ACCEPT_NIL(name))); return Qnil; } static VALUE rg_priority(VALUE self) { return INT2NUM(gtk_text_tag_get_priority(RVAL2GTKTEXTTAG(self))); } static VALUE rg_set_priority(VALUE self, VALUE priority) { gtk_text_tag_set_priority(RVAL2GTKTEXTTAG(self), NUM2INT(priority)); return priority; } static VALUE rg_event(VALUE self, VALUE event_object, VALUE event, VALUE iter) { gboolean ret = gtk_text_tag_event(RVAL2GTKTEXTTAG(self), RVAL2GOBJ(event_object), RVAL2GEV(event), RVAL2GTKTEXTITER(iter)); return CBOOL2RVAL(ret); } void Init_gtk_texttag(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_TAG, "TextTag", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(priority, 0); RG_DEF_METHOD(set_priority, 1); RG_DEF_METHOD(event, 3); G_DEF_CLASS(GTK_TYPE_WRAP_MODE, "WrapMode", RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-menu.c����������������������������������������������������0000644�0001750�0001750�00000011301�12102213527�017332� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cMenu #define _SELF(self) (RVAL2GTKMENU(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_menu_new()); return Qnil; } static VALUE rg_set_screen(VALUE self, VALUE screen) { gtk_menu_set_screen(_SELF(self), RVAL2GDKSCREEN(screen)); return self; } static VALUE rg_reorder_child(VALUE self, VALUE child, VALUE position) { gtk_menu_reorder_child(_SELF(self), RVAL2GTKWIDGET(child), NUM2INT(position)); return self; } static VALUE rg_attach(VALUE self, VALUE child, VALUE left_attach, VALUE right_attach, VALUE top_attach, VALUE bottom_attach) { gtk_menu_attach(_SELF(self), RVAL2GTKWIDGET(child), NUM2UINT(left_attach), NUM2UINT(right_attach), NUM2UINT(top_attach), NUM2UINT(bottom_attach)); return self; } static void menu_pos_func(GtkMenu *menu, gint *px, gint *py, gboolean *push_in, gpointer data) { VALUE arr = rb_funcall((VALUE)data, id_call, 4, GOBJ2RVAL(menu), INT2FIX(*px), INT2FIX(*py), CBOOL2RVAL(*push_in)); if (TYPE(arr) == T_ARRAY && (RARRAY_LEN(arr) == 2 || RARRAY_LEN(arr) == 3)){ *px = NUM2INT(RARRAY_PTR(arr)[0]); *py = NUM2INT(RARRAY_PTR(arr)[1]); if (RARRAY_LEN(arr) == 3) *push_in = RVAL2CBOOL(RARRAY_PTR(arr)[2]); } else { rb_raise(rb_eArgError, "block should return [x, y, push_in]"); } } /* the proc should return [x, y, push_in] */ static VALUE rg_popup(VALUE self, VALUE pshell, VALUE pitem, VALUE button, VALUE activate_time) { GtkWidget *gpshell = NULL; GtkWidget *gpitem = NULL; GtkMenuPositionFunc pfunc = NULL; gpointer data = NULL; VALUE func; if (rb_block_given_p()) { func = rb_block_proc(); pfunc = (GtkMenuPositionFunc)menu_pos_func; data = (gpointer)func; G_RELATIVE(self, func); } if (!NIL_P(pshell)){ gpshell = RVAL2GTKWIDGET(pshell); } if (!NIL_P(pitem)) { gpitem = RVAL2GTKWIDGET(pitem); } gtk_menu_popup(_SELF(self), gpshell, gpitem, pfunc, data, NUM2UINT(button), NUM2UINT(activate_time)); return self; } static VALUE rg_popdown(VALUE self) { gtk_menu_popdown(_SELF(self)); return self; } static VALUE rg_reposition(VALUE self) { gtk_menu_reposition(_SELF(self)); return self; } static VALUE menu_detacher; static void detach_func(GtkWidget *attach_widget, GtkMenu *menu) { rb_funcall((VALUE)menu_detacher, id_call, 2, GOBJ2RVAL(attach_widget), GOBJ2RVAL(menu)); } static VALUE rg_attach_to_widget(VALUE self, VALUE attach_widget) { menu_detacher = rb_block_proc(); G_RELATIVE(self, menu_detacher); gtk_menu_attach_to_widget(_SELF(self), RVAL2GTKWIDGET(attach_widget), (GtkMenuDetachFunc)detach_func); return self; } static VALUE rg_detach(VALUE self) { gtk_menu_detach(_SELF(self)); return self; } static VALUE rg_s_get_for_attach_widget(G_GNUC_UNUSED VALUE self, VALUE widget) { return GOBJGLIST2RVAL(gtk_menu_get_for_attach_widget(RVAL2GTKWIDGET(widget))); } void Init_gtk_menu(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU, "Menu", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_screen, 1); RG_DEF_METHOD(reorder_child, 2); RG_DEF_METHOD(attach, 5); RG_DEF_METHOD(popup, 4); RG_DEF_METHOD(popdown, 0); RG_DEF_METHOD(reposition, 0); RG_DEF_METHOD(detach, 0); RG_DEF_SMETHOD(get_for_attach_widget, 1); RG_DEF_METHOD(attach_to_widget, 1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-arrow.c���������������������������������������������������0000644�0001750�0001750�00000003553�12102213527�017532� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cArrow static VALUE rg_initialize(VALUE self, VALUE arrow_t, VALUE shadow_t) { RBGTK_INITIALIZE(self, gtk_arrow_new(RVAL2GTKARROWTYPE(arrow_t), RVAL2GTKSHADOWTYPE(shadow_t))); return Qnil; } static VALUE rg_set(VALUE self, VALUE arrow_t, VALUE shadow_t) { gtk_arrow_set(RVAL2GTKARROW(self), RVAL2GTKARROWTYPE(arrow_t), RVAL2GTKSHADOWTYPE(shadow_t)); return self; } void Init_gtk_arrow(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ARROW, "Arrow", mGtk); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(set, 2); G_DEF_CLASS(GTK_TYPE_ARROW_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_ARROW_PLACEMENT, "Placement", RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-theming-engine.c������������������������������������������0000644�0001750�0001750�00000014562�12102213527�021300� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cThemingEngine #define _SELF(self) (RVAL2GTKTHEMINGENGINE(self)) static VALUE rg_s_load(G_GNUC_UNUSED VALUE self, VALUE name) { return GOBJ2RVAL(gtk_theming_engine_load(RVAL2CSTR(name))); } static VALUE rg_get_background_color(VALUE self, VALUE state) { GdkRGBA color; gtk_theming_engine_get_background_color(_SELF(self), RVAL2GTKSTATEFLAGS(state), &color); return GDKRGBA2RVAL(&color); } static VALUE rg_get_border(VALUE self, VALUE state) { GtkBorder border; gtk_theming_engine_get_border(_SELF(self), RVAL2GTKSTATEFLAGS(state), &border); return GTKBORDER2RVAL(&border); } static VALUE rg_get_border_color(VALUE self, VALUE state) { GdkRGBA color; gtk_theming_engine_get_border_color(_SELF(self), RVAL2GTKSTATEFLAGS(state), &color); return GDKRGBA2RVAL(&color); } static VALUE rg_get_color(VALUE self, VALUE state) { GdkRGBA color; gtk_theming_engine_get_color(_SELF(self), RVAL2GTKSTATEFLAGS(state), &color); return GDKRGBA2RVAL(&color); } static VALUE rg_direction(VALUE self) { GtkTextDirection direction; direction = gtk_theming_engine_get_direction(_SELF(self)); return GTKTEXTDIRECTION2RVAL(direction); } static VALUE rg_get_font(VALUE self, VALUE state) { PangoFontDescription *desc; desc = gtk_theming_engine_get_font(_SELF(self), RVAL2GTKSTATEFLAGS(state)); return PANGOFONTDESCRIPTION2RVAL(desc); } static VALUE rg_junction_sides(VALUE self) { GtkJunctionSides sides; sides = gtk_theming_engine_get_junction_sides(_SELF(self)); return GTKJUNCTIONSIDES2RVAL(sides); } static VALUE rg_get_margin(VALUE self, VALUE state) { GtkBorder margin; gtk_theming_engine_get_margin(_SELF(self), RVAL2GTKSTATEFLAGS(state), &margin); return GTKBORDER2RVAL(&margin); } static VALUE rg_get_padding(VALUE self, VALUE state) { GtkBorder padding; gtk_theming_engine_get_padding(_SELF(self), RVAL2GTKSTATEFLAGS(state), &padding); return GTKBORDER2RVAL(&padding); } static VALUE rg_path(VALUE self) { return GTKWIDGETPATH2RVAL(gtk_theming_engine_get_path(_SELF(self))); } static VALUE rg_get_property(VALUE self, VALUE property, VALUE state) { GValue value = G_VALUE_INIT; VALUE ret = Qnil; gtk_theming_engine_get_property(_SELF(self), RVAL2CSTR(property), RVAL2GTKSTATEFLAGS(state), &value); if (G_VALUE_TYPE(&value) != G_TYPE_INVALID){ ret = GVAL2RVAL(&value); g_value_unset(&value); } return ret; } static VALUE rg_screen(VALUE self) { return GOBJ2RVAL(gtk_theming_engine_get_screen(_SELF(self))); } static VALUE rg_state(VALUE self) { GtkStateFlags state; state = gtk_theming_engine_get_state(_SELF(self)); return GTKSTATEFLAGS2RVAL(state); } static VALUE rg_get_style_property(VALUE self, VALUE property_name) { GValue value = G_VALUE_INIT; VALUE ret = Qnil; gtk_theming_engine_get_style_property(_SELF(self), RVAL2CSTR(property_name), &value); if (G_VALUE_TYPE(&value) != G_TYPE_INVALID){ ret = GVAL2RVAL(&value); g_value_unset(&value); } return ret; } static VALUE rg_has_class_p(VALUE self, VALUE style_class) { return CBOOL2RVAL(gtk_theming_engine_has_class(_SELF(self), RVAL2CSTR(style_class))); } static VALUE rg_has_region(VALUE self, VALUE style_region) { GtkRegionFlags flags; gboolean result; result = gtk_theming_engine_has_region(_SELF(self), RVAL2CSTR(style_region), &flags); return result ? GTKREGIONFLAGS2RVAL(flags) : Qnil; } static VALUE rg_lookup_color(VALUE self, VALUE color_name) { GdkRGBA color; gboolean result; result = gtk_theming_engine_lookup_color(_SELF(self), RVAL2CSTR(color_name), &color); return result ? GDKRGBA2RVAL(&color) : Qnil; } static VALUE rg_state_is_running(VALUE self, VALUE state) { gdouble progress; gboolean result; result = gtk_theming_engine_state_is_running(_SELF(self), RVAL2GTKSTATEFLAGS(state), &progress); return result ? DBL2NUM(progress) : Qnil; } void Init_gtk_themingengine(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_THEMING_ENGINE, "ThemingEngine", mGtk); RG_DEF_SMETHOD(load, 1); RG_DEF_METHOD(direction, 0); RG_DEF_METHOD(get_background_color, 1); RG_DEF_METHOD(get_border, 1); RG_DEF_METHOD(get_border_color, 1); RG_DEF_METHOD(get_color, 1); RG_DEF_METHOD(get_font, 1); RG_DEF_METHOD(get_margin, 1); RG_DEF_METHOD(get_padding, 1); RG_DEF_METHOD(get_property, 2); RG_DEF_METHOD(get_style_property, 1); RG_DEF_METHOD_P(has_class, 1); RG_DEF_METHOD(has_region, 1); RG_DEF_METHOD(junction_sides, 0); RG_DEF_METHOD(lookup_color, 1); RG_DEF_METHOD(path, 0); RG_DEF_METHOD(screen, 0); RG_DEF_METHOD(state, 0); RG_DEF_METHOD(state_is_running, 1); } ����������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-text-view.c�����������������������������������������������0000644�0001750�0001750�00000024740�12102213527�020335� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTextView #define _SELF(self) (RVAL2GTKTEXTVIEW(self)) #define RVAL2ITER(self, position) rval2iter(self, position) static GtkTextIter * rval2iter(VALUE self, VALUE position) { if (!g_type_is_a(RVAL2GTYPE(position), GTK_TYPE_TEXT_ITER)) position = rb_funcall(rb_funcall(self, rb_intern("buffer"), 0), rb_intern("get_iter_at"), 1, position); return RVAL2GTKTEXTITER(position); } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE buffer; GtkWidget* widget; rb_scan_args(argc, argv, "01", &buffer); if (NIL_P(buffer)) widget = gtk_text_view_new(); else { G_CHILD_SET(self, rb_intern("buffer"), buffer); widget = gtk_text_view_new_with_buffer(RVAL2GTKTEXTBUFFER(buffer)); } RBGTK_INITIALIZE(self, widget); return self; } static VALUE rg_scroll_to_mark(VALUE self, VALUE mark, VALUE within_margin, VALUE use_align, VALUE xalign, VALUE yalign) { gtk_text_view_scroll_to_mark(_SELF(self), RVAL2GTKTEXTMARK(mark), NUM2DBL(within_margin), RVAL2CBOOL(use_align), NUM2DBL(xalign), NUM2DBL(yalign)); return self; } static VALUE rg_scroll_to_iter(VALUE self, VALUE iter, VALUE within_margin, VALUE use_align, VALUE xalign, VALUE yalign) { return CBOOL2RVAL(gtk_text_view_scroll_to_iter(_SELF(self), RVAL2ITER(self, iter), NUM2DBL(within_margin), RVAL2CBOOL(use_align), NUM2DBL(xalign), NUM2DBL(yalign))); } static VALUE rg_scroll_mark_onscreen(VALUE self, VALUE mark) { gtk_text_view_scroll_mark_onscreen(_SELF(self), RVAL2GTKTEXTMARK(mark)); return self; } static VALUE rg_move_mark_onscreen(VALUE self, VALUE mark) { return CBOOL2RVAL(gtk_text_view_move_mark_onscreen(_SELF(self), RVAL2GTKTEXTMARK(mark))); } static VALUE rg_place_cursor_onscreen(VALUE self) { return CBOOL2RVAL(gtk_text_view_place_cursor_onscreen(_SELF(self))); } static VALUE rg_visible_rect(VALUE self) { GdkRectangle rect; gtk_text_view_get_visible_rect(_SELF(self), &rect); return GDKRECTANGLE2RVAL(&rect); } static VALUE rg_get_iter_location(VALUE self, VALUE iter) { GdkRectangle rect; gtk_text_view_get_iter_location(_SELF(self), RVAL2ITER(self, iter), &rect); return GDKRECTANGLE2RVAL(&rect); } static VALUE rg_get_line_at_y(VALUE self, VALUE y) { GtkTextIter target_iter; gint line_top; gtk_text_view_get_line_at_y(_SELF(self), &target_iter, NUM2INT(y), &line_top); return rb_ary_new3(2, GTKTEXTITER2RVAL(&target_iter), INT2NUM(line_top)); } static VALUE rg_get_line_yrange(VALUE self, VALUE iter) { int y, height; gtk_text_view_get_line_yrange(_SELF(self), RVAL2ITER(self, iter), &y, &height); return rb_ary_new3(2, INT2NUM(y), INT2NUM(height)); } static VALUE rg_get_iter_at_location(VALUE self, VALUE x, VALUE y) { GtkTextIter iter; gtk_text_view_get_iter_at_location(_SELF(self), &iter, NUM2INT(x), NUM2INT(y)); return GTKTEXTITER2RVAL(&iter); } static VALUE rg_get_iter_at_position(VALUE self, VALUE x, VALUE y) { GtkTextIter iter; gint trailing; gtk_text_view_get_iter_at_position(_SELF(self), &iter, &trailing, NUM2INT(x), NUM2INT(y)); return rb_assoc_new(GTKTEXTITER2RVAL(&iter), INT2NUM(trailing)); } static VALUE rg_buffer_to_window_coords(VALUE self, VALUE wintype, VALUE buffer_x, VALUE buffer_y) { int window_x, window_y; gtk_text_view_buffer_to_window_coords(_SELF(self), RVAL2GTKTEXTWINDOWTYPE(wintype), NUM2INT(buffer_x), NUM2INT(buffer_y), &window_x, &window_y); return rb_ary_new3(2, INT2NUM(window_x), INT2NUM(window_y)); } static VALUE rg_window_to_buffer_coords(VALUE self, VALUE wintype, VALUE window_x, VALUE window_y) { int buffer_x, buffer_y; gtk_text_view_window_to_buffer_coords(_SELF(self), RVAL2GTKTEXTWINDOWTYPE(wintype), NUM2INT(window_x), NUM2INT(window_y), &buffer_x, &buffer_y); return rb_ary_new3(2, INT2NUM(buffer_x), INT2NUM(buffer_y)); } static VALUE rg_get_window(VALUE self, VALUE wintype) { GdkWindow* win = NULL; win = gtk_text_view_get_window(_SELF(self), RVAL2GTKTEXTWINDOWTYPE(wintype)); return win ? GOBJ2RVAL(win): Qnil; } static VALUE rg_get_window_type(VALUE self, VALUE gdkwin) { return GTKTEXTWINDOWTYPE2RVAL(gtk_text_view_get_window_type(_SELF(self), RVAL2GDKWINDOW(gdkwin))); } static VALUE rg_set_border_window_size(VALUE self, VALUE wintype, VALUE size) { gtk_text_view_set_border_window_size(_SELF(self), RVAL2GTKTEXTWINDOWTYPE(wintype), NUM2INT(size)); return self; } static VALUE rg_get_border_window_size(VALUE self, VALUE wintype) { return INT2NUM(gtk_text_view_get_border_window_size( _SELF(self), RVAL2GTKTEXTWINDOWTYPE(wintype))); } static VALUE rg_forward_display_line(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_text_view_forward_display_line(_SELF(self), RVAL2ITER(self, iter))); } static VALUE rg_backward_display_line(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_text_view_backward_display_line(_SELF(self), RVAL2ITER(self, iter))); } static VALUE rg_forward_display_line_end(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_text_view_forward_display_line_end(_SELF(self), RVAL2ITER(self, iter))); } static VALUE rg_backward_display_line_start(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_text_view_backward_display_line_start(_SELF(self), RVAL2ITER(self, iter))); } static VALUE rg_starts_display_line(VALUE self, VALUE iter) { return CBOOL2RVAL(gtk_text_view_starts_display_line(_SELF(self), RVAL2ITER(self, iter))); } static VALUE rg_move_visually(VALUE self, VALUE iter, VALUE count) { return CBOOL2RVAL(gtk_text_view_move_visually(_SELF(self), RVAL2ITER(self, iter), NUM2INT(count))); } static VALUE rg_add_child_at_anchor(VALUE self, VALUE child, VALUE anchor) { G_CHILD_ADD(self, child); gtk_text_view_add_child_at_anchor(_SELF(self), RVAL2GTKWIDGET(child), RVAL2GTKTEXTCHILDANCHOR(anchor)); return self; } static VALUE rg_add_child_in_window(VALUE self, VALUE child, VALUE which_window, VALUE xpos, VALUE ypos) { G_CHILD_ADD(self, child); gtk_text_view_add_child_in_window(_SELF(self), RVAL2GTKWIDGET(child), RVAL2GTKTEXTWINDOWTYPE(which_window), NUM2INT(xpos), NUM2INT(ypos)); return self; } static VALUE rg_move_child(VALUE self, VALUE child, VALUE xpos, VALUE ypos) { G_CHILD_ADD(self, child); gtk_text_view_move_child(_SELF(self), RVAL2GTKWIDGET(child), NUM2INT(xpos), NUM2INT(ypos)); return self; } static VALUE rg_default_attributes(VALUE self) { return GTKTEXTATTRIBUTES2RVAL(gtk_text_view_get_default_attributes(_SELF(self))); } static VALUE rg_get_cursor_locations(int argc, VALUE *argv, VALUE self) { VALUE iter; GdkRectangle strong, weak; rb_scan_args(argc, argv, "01", &iter); gtk_text_view_get_cursor_locations(_SELF(self), NIL_P(iter) ? NULL : RVAL2ITER(self, iter), &strong, &weak); return rb_ary_new3(2, GDKRECTANGLE2RVAL(&strong), GDKRECTANGLE2RVAL(&weak)); } static VALUE rg_im_context_filter_keypress(VALUE self, VALUE event) { return CBOOL2RVAL(gtk_text_view_im_context_filter_keypress(_SELF(self), RVAL2GDKEVENTKEY(event))); } static VALUE rg_reset_im_context(VALUE self) { gtk_text_view_reset_im_context(_SELF(self)); return self; } void Init_gtk_textview(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_VIEW, "TextView", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(scroll_to_mark, 5); RG_DEF_METHOD(scroll_to_iter, 5); RG_DEF_METHOD(scroll_mark_onscreen, 1); RG_DEF_METHOD(move_mark_onscreen, 1); RG_DEF_METHOD(place_cursor_onscreen, 0); RG_DEF_METHOD(visible_rect, 0); RG_DEF_METHOD(get_iter_location, 1); RG_DEF_METHOD(get_line_at_y, 1); RG_DEF_METHOD(get_line_yrange, 1); RG_DEF_METHOD(get_iter_at_location, 2); RG_DEF_METHOD(get_iter_at_position, 2); RG_DEF_METHOD(buffer_to_window_coords, 3); RG_DEF_METHOD(window_to_buffer_coords, 3); RG_DEF_METHOD(get_window, 1); RG_DEF_METHOD(get_window_type, 1); RG_DEF_METHOD(set_border_window_size, 2); RG_DEF_METHOD(get_border_window_size, 1); RG_DEF_METHOD(forward_display_line, 1); RG_DEF_METHOD(backward_display_line, 1); RG_DEF_METHOD(forward_display_line_end, 1); RG_DEF_METHOD(backward_display_line_start, 1); RG_DEF_METHOD(starts_display_line, 1); RG_DEF_METHOD(move_visually, 2); RG_DEF_METHOD(add_child_at_anchor, 2); RG_DEF_METHOD(add_child_in_window, 4); RG_DEF_METHOD(move_child, 3); RG_DEF_METHOD(default_attributes, 0); RG_DEF_METHOD(get_cursor_locations, -1); RG_DEF_METHOD(im_context_filter_keypress, 1); RG_DEF_METHOD(reset_im_context, 0); G_DEF_CLASS(GTK_TYPE_TEXT_WINDOW_TYPE, "WindowType", RG_TARGET_NAMESPACE); rb_define_const(RG_TARGET_NAMESPACE, "PRIORITY_VALIDATE", INT2FIX(GTK_TEXT_VIEW_PRIORITY_VALIDATE)); } ��������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-separator-tool-item.c�������������������������������������0000644�0001750�0001750�00000002412�12102213527�022300� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cSeparatorToolItem static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_separator_tool_item_new()); return Qnil; } void Init_gtk_separatortoolitem(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SEPARATOR_TOOL_ITEM, "SeparatorToolItem", mGtk); RG_DEF_METHOD(initialize, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-font-chooser.c��������������������������������������������0000644�0001750�0001750�00000004315�12102213527�021003� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #if GTK_CHECK_VERSION(3, 2, 0) #define RG_TARGET_NAMESPACE mFontChooser #define _SELF(self) (RVAL2GTKFONTCHOOSER(self)) static VALUE rg_font_face(VALUE self) { return GOBJ2RVAL(gtk_font_chooser_get_font_face(_SELF(self))); } static VALUE rg_font_family(VALUE self) { return GOBJ2RVAL(gtk_font_chooser_get_font_family(_SELF(self))); } static VALUE rg_font_size(VALUE self) { return INT2NUM(gtk_font_chooser_get_font_size(_SELF(self))); } static gboolean filter_func(const PangoFontFamily *family, const PangoFontFace *face, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(family), GOBJ2RVAL(face))); } static VALUE rg_set_filter_func(VALUE self) { VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_font_chooser_set_filter_func(_SELF(self), (GtkFontFilterFunc)filter_func, (gpointer)func, NULL); return self; } #endif void Init_gtk_fontchooser(VALUE mGtk) { #if GTK_CHECK_VERSION(3, 2, 0) VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_FONT_CHOOSER, "FontChooser", mGtk); RG_DEF_METHOD(font_face, 0); RG_DEF_METHOD(font_family, 0); RG_DEF_METHOD(font_size, 0); RG_DEF_METHOD(set_filter_func, 0); #endif } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-radio-action.c��������������������������������������������0000644�0001750�0001750�00000007435�12102213527�020754� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRadioAction #define _SELF(self) (RVAL2GTKRADIOACTION(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE name, value, options, label, tooltip, stock_id, buffer; rb_scan_args(argc, argv, "21", &name, &value, &options); rbg_scan_options(options, "label", &label, "tooltip", &tooltip, "stock_id", &stock_id, NULL); G_INITIALIZE(self, gtk_radio_action_new(RVAL2CSTR(name), RVAL2CSTR_ACCEPT_NIL(label), RVAL2CSTR_ACCEPT_NIL(tooltip), RVAL2GLIBID_ACCEPT_NIL(stock_id, buffer), NUM2INT(value))); return Qnil; } static VALUE raction_get_group(VALUE self) { return GOBJGSLIST2RVAL(gtk_radio_action_get_group(_SELF(self))); } struct rbgtk_rval2gtkradioactiongslist_args { VALUE ary; long n; GSList *result; }; static VALUE rbgtk_rval2gtkradioactiongslist_body(VALUE value) { long i; struct rbgtk_rval2gtkradioactiongslist_args *args = (struct rbgtk_rval2gtkradioactiongslist_args *)value; for (i = 0; i < args->n; i++) args->result = g_slist_append(args->result, RVAL2GTKRADIOACTION(RARRAY_PTR(args->ary)[i])); return Qnil; } static G_GNUC_NORETURN VALUE rbgtk_rval2gtkradioactiongslist_rescue(VALUE value) { g_slist_free(((struct rbgtk_rval2gtkradioactiongslist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GSList * rbgtk_rval2gtkradioactiongslist(VALUE value) { struct rbgtk_rval2gtkradioactiongslist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgtk_rval2gtkradioactiongslist_body, (VALUE)&args, rbgtk_rval2gtkradioactiongslist_rescue, (VALUE)&args); return args.result; } #define RVAL2GTKRADIOACTIONGSLIST(value) rbgtk_rval2gtkradioactiongslist(value) static VALUE raction_set_group(VALUE self, VALUE rbgroup) { GtkRadioAction *action = _SELF(self); /* TODO: This might leak. Use gtk_radio_action_join_group() in 3.0. */ if (TYPE(rbgroup) == T_ARRAY) gtk_radio_action_set_group(action, RVAL2GTKRADIOACTIONGSLIST(rbgroup)); else if (NIL_P(rbgroup)) gtk_radio_action_set_group(action, NULL); else gtk_radio_action_set_group(action, gtk_radio_action_get_group(RVAL2GTKRADIOACTION(rbgroup))); return self; } void Init_gtk_radio_action(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RADIO_ACTION, "RadioAction", mGtk); RG_DEF_METHOD(initialize, -1); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "group", raction_get_group, 0); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "group", raction_set_group, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-app-chooser-button.c��������������������������������������0000644�0001750�0001750�00000004116�12102213527�022125� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAppChooserButton #define _SELF(self) (RVAL2GTKAPPCHOOSERBUTTON(self)) static VALUE rg_initialize(VALUE self, VALUE content_type) { RBGTK_INITIALIZE(self, gtk_app_chooser_button_new(RVAL2CSTR(content_type))); return Qnil; } static VALUE rg_append_custom_item(VALUE self, VALUE name, VALUE label, VALUE icon) { gtk_app_chooser_button_append_custom_item(_SELF(self), RVAL2CSTR(name), RVAL2CSTR(label), RVAL2GICON(icon)); return self; } static VALUE rg_append_separator(VALUE self) { gtk_app_chooser_button_append_separator(_SELF(self)); return self; } static VALUE rg_set_active_custom_item(VALUE self, VALUE name) { gtk_app_chooser_button_set_active_custom_item(_SELF(self), RVAL2CSTR(name)); return self; } void Init_gtk_appchooserbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_APP_CHOOSER_BUTTON, "AppChooserButton", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(append_custom_item, 3); RG_DEF_METHOD(append_separator, 0); RG_DEF_METHOD(set_active_custom_item, 1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-scale-button.c��������������������������������������������0000644�0001750�0001750�00000004473�12102213527�021002� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cScaleButton #define _SELF(s) (RVAL2GTKSCALEBUTTON(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2, arg3, arg4, arg5; GtkWidget *widget; gdouble min = 0; gdouble max = 100; gdouble step = 2; rb_scan_args(argc, argv, "14", &arg1, &arg2, &arg3, &arg4, &arg5); if (!NIL_P(arg2)) min = NUM2DBL(arg2); if (!NIL_P(arg3)) max = NUM2DBL(arg3); if (!NIL_P(arg4)) step = NUM2DBL(arg4); widget = gtk_scale_button_new(RVAL2GTKICONSIZE(arg1), min, max, step, NULL); RBGTK_INITIALIZE(self, widget); if (!NIL_P(arg5)) { const gchar **icons = RVAL2STRV(arg5); gtk_scale_button_set_icons(_SELF(self), icons); g_free(icons); } return Qnil; } static VALUE rg_minus_button(VALUE self) { return GOBJ2RVAL(gtk_scale_button_get_minus_button(_SELF(self))); } static VALUE rg_plus_button(VALUE self) { return GOBJ2RVAL(gtk_scale_button_get_plus_button(_SELF(self))); } void Init_gtk_scalebutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SCALE_BUTTON, "ScaleButton", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(minus_button, 0); RG_DEF_METHOD(plus_button, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-selection.c�����������������������������������������������0000644�0001750�0001750�00000011440�12102213527�020357� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mSelection static VALUE rg_s_owner_set(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { gboolean ret; if (argc == 3){ VALUE widget, selection, time; rb_scan_args(argc, argv, "30", &widget, &selection, &time); ret = gtk_selection_owner_set(RVAL2GTKWIDGET(widget), RVAL2ATOM(selection), NUM2INT(time)); } else { VALUE display, widget, selection, time; rb_scan_args(argc, argv, "40", &display, &widget, &selection, &time); ret = gtk_selection_owner_set_for_display(RVAL2GDKDISPLAYOBJECT(display), RVAL2GTKWIDGET(widget), RVAL2ATOM(selection), NUM2INT(time)); } return CBOOL2RVAL(ret); } static VALUE rg_s_add_target(VALUE self, VALUE widget, VALUE selection, VALUE target, VALUE info) { gtk_selection_add_target(RVAL2GTKWIDGET(widget), RVAL2ATOM(selection), RVAL2ATOM(target), NUM2INT(info)); return self; } static VALUE rg_s_add_targets(VALUE self, VALUE rbwidget, VALUE rbselection, VALUE rbtargets) { GtkWidget *widget = RVAL2GTKWIDGET(rbwidget); GdkAtom selection = RVAL2ATOM(rbselection); long n; GtkTargetEntry *targets = RVAL2GTKTARGETENTRIES(rbtargets, &n); gtk_selection_add_targets(widget, selection, targets, n); g_free(targets); return self; } static VALUE rg_s_clear_targets(VALUE self, VALUE widget, VALUE selection) { gtk_selection_clear_targets(RVAL2GTKWIDGET(widget), RVAL2ATOM(selection)); return self; } static VALUE rg_s_convert(G_GNUC_UNUSED VALUE self, VALUE widget, VALUE selection, VALUE target, VALUE time) { gboolean ret = gtk_selection_convert(RVAL2GTKWIDGET(widget), RVAL2ATOM(selection), RVAL2ATOM(target), NUM2INT(time)); return CBOOL2RVAL(ret); } static VALUE rg_s_remove_all(VALUE self, VALUE widget) { gtk_selection_remove_all(RVAL2GTKWIDGET(widget)); return self; } static VALUE rg_s_include_image_p(G_GNUC_UNUSED VALUE self, VALUE rbtargets, VALUE rbwritable) { gboolean writable = RVAL2CBOOL(rbwritable); long n; GdkAtom *targets = RVAL2GDKATOMS(rbtargets, &n); gboolean result; result = gtk_targets_include_image(targets, n, writable); g_free(targets); return result; } static VALUE rg_s_include_text_p(G_GNUC_UNUSED VALUE self, VALUE rbtargets) { long n; GdkAtom *targets = RVAL2GDKATOMS(rbtargets, &n); gboolean result; result = gtk_targets_include_text(targets, n); g_free(targets); return result; } static VALUE rg_s_include_uri_p(G_GNUC_UNUSED VALUE self, VALUE rbtargets) { long n; GdkAtom *targets = RVAL2GDKATOMS(rbtargets, &n); gboolean result; result = gtk_targets_include_uri(targets, n); g_free(targets); return result; } static VALUE rg_s_include_rich_text_p(G_GNUC_UNUSED VALUE self, VALUE rbtargets, VALUE rbbuffer) { GtkTextBuffer *buffer = RVAL2GTKTEXTBUFFER(rbbuffer); long n; GdkAtom *targets = RVAL2GDKATOMS(rbtargets, &n); gboolean result; result = gtk_targets_include_rich_text(targets, n, buffer); g_free(targets); return result; } void Init_gtk_selection(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "Selection"); RG_DEF_SMETHOD(owner_set, 3); RG_DEF_SMETHOD(add_target, 4); RG_DEF_SMETHOD(add_targets, 3); RG_DEF_SMETHOD(clear_targets, 2); RG_DEF_SMETHOD(convert, 4); RG_DEF_SMETHOD(remove_all, 1); RG_DEF_SMETHOD_P(include_image, 2); RG_DEF_SMETHOD_P(include_text, 1); RG_DEF_SMETHOD_P(include_uri, 1); RG_DEF_SMETHOD_P(include_rich_text, 2); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-text-iter.c�����������������������������������������������0000644�0001750�0001750�00000045113�12102213527�020323� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masahiro Sakai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTextIter #define _SELF(s) (RVAL2GTKTEXTITER(s)) #define RVAL2ITER(self, position) rval2iter(self, position) static GtkTextIter * rval2iter(VALUE self, VALUE position) { if (!g_type_is_a(RVAL2GTYPE(position), GTK_TYPE_TEXT_ITER)) position = rb_funcall(rb_funcall(self, rb_intern("buffer"), 0), rb_intern("get_iter_at"), 1, position); return RVAL2GTKTEXTITER(position); } static VALUE rg_buffer(VALUE self) { return GOBJ2RVAL(gtk_text_iter_get_buffer(_SELF(self))); } static VALUE rg_offset(VALUE self) { return INT2NUM(gtk_text_iter_get_offset(_SELF(self))); } static VALUE rg_line(VALUE self) { return INT2NUM(gtk_text_iter_get_line(_SELF(self))); } static VALUE rg_line_offset(VALUE self) { return INT2NUM(gtk_text_iter_get_line_offset(_SELF(self))); } static VALUE rg_line_index(VALUE self) { return INT2NUM(gtk_text_iter_get_line_index(_SELF(self))); } static VALUE rg_visible_line_offset(VALUE self) { return INT2NUM(gtk_text_iter_get_visible_line_offset(_SELF(self))); } static VALUE rg_visible_line_index(VALUE self) { return INT2NUM(gtk_text_iter_get_visible_line_index(_SELF(self))); } static VALUE rg_char(VALUE self) { gchar buf[10]; gint len = g_unichar_to_utf8(gtk_text_iter_get_char(_SELF(self)), buf); buf[len] = '\0'; return CSTR2RVAL(buf); } static VALUE rg_get_slice(VALUE self, VALUE rhs) { return CSTR2RVAL(gtk_text_iter_get_slice(_SELF(self), RVAL2ITER(self, rhs))); } static VALUE rg_get_text(VALUE self, VALUE rhs) { return CSTR2RVAL(gtk_text_iter_get_text(_SELF(self), RVAL2ITER(self, rhs))); } static VALUE rg_get_visible_slice(VALUE self, VALUE rhs) { return CSTR2RVAL(gtk_text_iter_get_visible_slice(_SELF(self), RVAL2ITER(self, rhs))); } static VALUE rg_get_visible_text(VALUE self, VALUE rhs) { return CSTR2RVAL(gtk_text_iter_get_visible_text(_SELF(self), RVAL2ITER(self, rhs))); } static VALUE rg_pixbuf(VALUE self) { VALUE pixbuf = GOBJ2RVAL(gtk_text_iter_get_pixbuf(_SELF(self))); G_CHILD_SET(self, rb_intern("pixbuf"), pixbuf); return pixbuf; } static VALUE rg_marks(VALUE self) { /* need free? */ return GOBJGSLIST2RVAL_FREE(gtk_text_iter_get_marks(_SELF(self)), g_slist_free, NULL); } static VALUE rg_toggled_tags(VALUE self, VALUE toggled_on) { /* need free? */ return GOBJGSLIST2RVAL_FREE(gtk_text_iter_get_toggled_tags(_SELF(self), RVAL2CBOOL(toggled_on)), g_slist_free, NULL); } static VALUE rg_child_anchor(VALUE self) { return GOBJ2RVAL(gtk_text_iter_get_child_anchor(_SELF(self))); } static VALUE rg_begins_tag_p(VALUE self, VALUE tag) { return CBOOL2RVAL(gtk_text_iter_begins_tag(_SELF(self), RVAL2GTKTEXTTAG(tag))); } static VALUE rg_ends_tag_p(VALUE self, VALUE tag) { return CBOOL2RVAL(gtk_text_iter_ends_tag(_SELF(self), RVAL2GTKTEXTTAG(tag))); } static VALUE rg_toggles_tag_p(VALUE self, VALUE tag) { return CBOOL2RVAL(gtk_text_iter_toggles_tag(_SELF(self), RVAL2GTKTEXTTAG(tag))); } static VALUE rg_has_tag_p(VALUE self, VALUE tag) { return CBOOL2RVAL(gtk_text_iter_has_tag(_SELF(self), RVAL2GTKTEXTTAG(tag))); } static VALUE rg_tags(VALUE self) { return GOBJGSLIST2RVAL_FREE(gtk_text_iter_get_tags(_SELF(self)), g_slist_free, NULL); } static VALUE rg_editable_p(VALUE self, VALUE default_setting) { return CBOOL2RVAL(gtk_text_iter_editable(_SELF(self), RVAL2CBOOL(default_setting))); } static VALUE rg_can_insert_p(VALUE self, VALUE default_setting) { return CBOOL2RVAL(gtk_text_iter_can_insert(_SELF(self), RVAL2CBOOL(default_setting))); } static VALUE rg_starts_word_p(VALUE self) { return CBOOL2RVAL(gtk_text_iter_starts_word(_SELF(self))); } static VALUE rg_ends_word_p(VALUE self) { return CBOOL2RVAL(gtk_text_iter_ends_word(_SELF(self))); } static VALUE rg_inside_word_p(VALUE self) { return CBOOL2RVAL(gtk_text_iter_inside_word(_SELF(self))); } static VALUE rg_starts_sentence_p(VALUE self) { return CBOOL2RVAL(gtk_text_iter_starts_sentence(_SELF(self))); } static VALUE rg_ends_sentence_p(VALUE self) { return CBOOL2RVAL(gtk_text_iter_ends_sentence(_SELF(self))); } static VALUE rg_starts_line_p(VALUE self) { return CBOOL2RVAL(gtk_text_iter_starts_line(_SELF(self))); } static VALUE rg_ends_line_p(VALUE self) { return CBOOL2RVAL(gtk_text_iter_ends_line(_SELF(self))); } static VALUE rg_cursor_position_p(VALUE self) { return CBOOL2RVAL(gtk_text_iter_is_cursor_position(_SELF(self))); } static VALUE rg_chars_in_line(VALUE self) { return INT2NUM(gtk_text_iter_get_chars_in_line(_SELF(self))); } static VALUE rg_bytes_in_line(VALUE self) { return INT2NUM(gtk_text_iter_get_bytes_in_line(_SELF(self))); } static VALUE rg_attributes(VALUE self) { GtkTextAttributes attr; if(gtk_text_iter_get_attributes(_SELF(self), &attr) == TRUE){ return GTKTEXTATTRIBUTES2RVAL(&attr); } else { return Qnil; } } static VALUE rg_language(VALUE self) { return CSTR2RVAL(pango_language_to_string(gtk_text_iter_get_language(_SELF(self)))); } static VALUE rg_end_p(VALUE self) { return CBOOL2RVAL(gtk_text_iter_is_end(_SELF(self))); } static VALUE rg_start_p(VALUE self) { return CBOOL2RVAL(gtk_text_iter_is_start(_SELF(self))); } static VALUE rg_forward_char(VALUE self) { return CBOOL2RVAL(gtk_text_iter_forward_char(_SELF(self))); } static VALUE rg_backward_char(VALUE self) { return CBOOL2RVAL(gtk_text_iter_backward_char(_SELF(self))); } static VALUE rg_forward_chars(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_forward_chars(_SELF(self), NUM2INT(i))); } static VALUE rg_backward_chars(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_backward_chars(_SELF(self), NUM2INT(i))); } static VALUE rg_forward_line(VALUE self) { return CBOOL2RVAL(gtk_text_iter_forward_line(_SELF(self))); } static VALUE rg_backward_line(VALUE self) { return CBOOL2RVAL(gtk_text_iter_backward_line(_SELF(self))); } static VALUE rg_forward_lines(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_forward_lines(_SELF(self), NUM2INT(i))); } static VALUE rg_backward_lines(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_backward_lines(_SELF(self), NUM2INT(i))); } static VALUE rg_forward_word_end(VALUE self) { return CBOOL2RVAL(gtk_text_iter_forward_word_end(_SELF(self))); } static VALUE rg_backward_word_start(VALUE self) { return CBOOL2RVAL(gtk_text_iter_backward_word_start(_SELF(self))); } static VALUE rg_forward_word_ends(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_forward_word_ends(_SELF(self), NUM2INT(i))); } static VALUE rg_backward_word_starts(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_backward_word_starts(_SELF(self), NUM2INT(i))); } static VALUE rg_forward_sentence_end(VALUE self) { return CBOOL2RVAL(gtk_text_iter_forward_sentence_end(_SELF(self))); } static VALUE rg_backward_sentence_start(VALUE self) { return CBOOL2RVAL(gtk_text_iter_backward_sentence_start(_SELF(self))); } static VALUE rg_forward_sentence_ends(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_forward_sentence_ends(_SELF(self), NUM2INT(i))); } static VALUE rg_backward_sentence_starts(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_backward_sentence_starts(_SELF(self), NUM2INT(i))); } static VALUE rg_forward_visible_word_ends(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_forward_visible_word_ends(_SELF(self), NUM2INT(i))); } static VALUE rg_backward_visible_word_starts(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_backward_visible_word_starts(_SELF(self), NUM2INT(i))); } static VALUE rg_forward_visible_word_end(VALUE self) { return CBOOL2RVAL(gtk_text_iter_forward_visible_word_end(_SELF(self))); } static VALUE rg_backward_visible_word_start(VALUE self) { return CBOOL2RVAL(gtk_text_iter_backward_visible_word_start(_SELF(self))); } static VALUE rg_forward_visible_cursor_position(VALUE self) { return CBOOL2RVAL(gtk_text_iter_forward_visible_cursor_position(_SELF(self))); } static VALUE rg_backward_visible_cursor_position(VALUE self) { return CBOOL2RVAL(gtk_text_iter_backward_visible_cursor_position(_SELF(self))); } static VALUE rg_forward_visible_cursor_positions(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_forward_visible_cursor_positions(_SELF(self), NUM2INT(i))); } static VALUE rg_backward_visible_cursor_positions(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_backward_visible_cursor_positions(_SELF(self), NUM2INT(i))); } static VALUE rg_forward_visible_line(VALUE self) { return CBOOL2RVAL(gtk_text_iter_forward_visible_line(_SELF(self))); } static VALUE rg_backward_visible_line(VALUE self) { return CBOOL2RVAL(gtk_text_iter_backward_visible_line(_SELF(self))); } static VALUE rg_forward_visible_lines(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_forward_visible_lines(_SELF(self), NUM2INT(i))); } static VALUE rg_backward_visible_lines(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_backward_visible_lines(_SELF(self), NUM2INT(i))); } static VALUE rg_forward_cursor_position(VALUE self) { return CBOOL2RVAL(gtk_text_iter_forward_cursor_position(_SELF(self))); } static VALUE rg_backward_cursor_position(VALUE self) { return CBOOL2RVAL(gtk_text_iter_backward_cursor_position(_SELF(self))); } static VALUE rg_forward_cursor_positions(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_forward_cursor_positions(_SELF(self), NUM2INT(i))); } static VALUE rg_backward_cursor_positions(VALUE self, VALUE i) { return CBOOL2RVAL(gtk_text_iter_backward_cursor_positions(_SELF(self), NUM2INT(i))); } static VALUE rg_forward_to_line_end(VALUE self) { return CBOOL2RVAL(gtk_text_iter_forward_to_line_end(_SELF(self))); } static VALUE rg_forward_to_end(VALUE self) { gtk_text_iter_forward_to_end(_SELF(self)); return self; } static VALUE rg_set_offset(VALUE self, VALUE val) { gtk_text_iter_set_offset(_SELF(self), NUM2INT(val)); return self; } static VALUE rg_set_line(VALUE self, VALUE val) { gtk_text_iter_set_line(_SELF(self), NUM2INT(val)); return self; } static VALUE rg_set_line_offset(VALUE self, VALUE val) { gtk_text_iter_set_line_offset(_SELF(self), NUM2INT(val)); return self; } static VALUE rg_set_line_index(VALUE self, VALUE val) { gtk_text_iter_set_line_index(_SELF(self), NUM2INT(val)); return self; } static VALUE rg_set_visible_line_offset(VALUE self, VALUE val) { gtk_text_iter_set_visible_line_offset(_SELF(self), NUM2INT(val)); return self; } static VALUE rg_set_visible_line_index(VALUE self, VALUE val) { gtk_text_iter_set_visible_line_index(_SELF(self), NUM2INT(val)); return self; } static VALUE rg_forward_to_tag_toggle(int argc, VALUE *argv, VALUE self) { VALUE tag; rb_scan_args(argc, argv, "01", &tag); return CBOOL2RVAL(gtk_text_iter_forward_to_tag_toggle(_SELF(self), NIL_P(tag) ? NULL : RVAL2GTKTEXTTAG(tag))); } static VALUE rg_backward_to_tag_toggle(int argc, VALUE *argv, VALUE self) { VALUE tag; rb_scan_args(argc, argv, "01", &tag); return CBOOL2RVAL(gtk_text_iter_backward_to_tag_toggle(_SELF(self), NIL_P(tag) ? NULL : RVAL2GTKTEXTTAG(tag))); } static gboolean char_predicate_func(guint32 ch, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 1, UINT2NUM(ch))); } static VALUE rg_forward_find_char(int argc, VALUE *argv, VALUE self) { VALUE limit; volatile VALUE func = rb_block_proc(); rb_scan_args(argc, argv, "01", &limit); return CBOOL2RVAL(gtk_text_iter_forward_find_char(_SELF(self), (GtkTextCharPredicate)char_predicate_func, (gpointer)func, NIL_P(limit) ? NULL : RVAL2ITER(self, limit))); } static VALUE rg_backward_find_char(int argc, VALUE *argv, VALUE self) { VALUE limit; volatile VALUE func = rb_block_proc(); rb_scan_args(argc, argv, "01", &limit); return CBOOL2RVAL(gtk_text_iter_backward_find_char(_SELF(self), (GtkTextCharPredicate)char_predicate_func, (gpointer)func, NIL_P(limit) ? NULL : RVAL2ITER(self, limit))); } static VALUE rg_forward_search(int argc, VALUE *argv, VALUE self) { GtkTextIter m_start, m_end; VALUE str, flags, limit; gboolean ret; rb_scan_args(argc, argv, "21", &str, &flags, &limit); ret = gtk_text_iter_forward_search(_SELF(self), RVAL2CSTR(str), RVAL2GTKTEXTSEARCHFLAGS(flags), &m_start, &m_end, NIL_P(limit) ? NULL : RVAL2ITER(self, limit)); return ret ? rb_ary_new3(2, GTKTEXTITER2RVAL(&m_start), GTKTEXTITER2RVAL(&m_end)) : Qnil; } static VALUE rg_backward_search(int argc, VALUE *argv, VALUE self) { GtkTextIter m_start, m_end; VALUE str, flags, limit; gboolean ret; rb_scan_args(argc, argv, "21", &str, &flags, &limit); ret = gtk_text_iter_backward_search(_SELF(self), RVAL2CSTR(str), RVAL2GTKTEXTSEARCHFLAGS(flags), &m_start, &m_end, NIL_P(limit) ? NULL : RVAL2ITER(self, limit)); return ret ? rb_ary_new3(2, GTKTEXTITER2RVAL(&m_start), GTKTEXTITER2RVAL(&m_end)) : Qnil; } static VALUE rg_operator_equal(VALUE self, VALUE other) { return CBOOL2RVAL(gtk_text_iter_equal(_SELF(self), RVAL2ITER(self, other))); } static VALUE rg_operator_compare(VALUE self, VALUE rhs) { return INT2NUM(gtk_text_iter_compare(_SELF(self), RVAL2ITER(self, rhs))); } static VALUE rg_inside_sentence(VALUE self) { return CBOOL2RVAL(gtk_text_iter_inside_sentence(_SELF(self))); } void Init_gtk_textiter(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_ITER, "TextIter", mGtk); rb_include_module(RG_TARGET_NAMESPACE, rb_mComparable); RG_DEF_METHOD(buffer, 0); RG_DEF_METHOD(offset, 0); RG_DEF_METHOD(line, 0); RG_DEF_METHOD(line_offset, 0); RG_DEF_METHOD(line_index, 0); RG_DEF_METHOD(visible_line_offset, 0); RG_DEF_METHOD(visible_line_index, 0); RG_DEF_METHOD(char, 0); RG_DEF_METHOD(get_slice, 1); RG_DEF_METHOD(get_text, 1); RG_DEF_METHOD(get_visible_slice, 1); RG_DEF_METHOD(get_visible_text, 1); RG_DEF_METHOD(pixbuf, 0); RG_DEF_METHOD(marks, 0); RG_DEF_METHOD(child_anchor, 0); RG_DEF_METHOD(toggled_tags, 1); RG_DEF_METHOD_P(begins_tag, 1); RG_DEF_METHOD_P(ends_tag, 1); RG_DEF_METHOD_P(toggles_tag, 1); RG_DEF_METHOD_P(has_tag, 1); RG_DEF_METHOD(tags, 0); RG_DEF_METHOD_P(editable, 1); RG_DEF_METHOD_P(can_insert, 1); RG_DEF_METHOD_P(starts_word, 0); RG_DEF_METHOD_P(ends_word, 0); RG_DEF_METHOD_P(inside_word, 0); RG_DEF_METHOD_P(starts_sentence, 0); RG_DEF_METHOD_P(ends_sentence, 0); RG_DEF_METHOD_P(starts_line, 0); RG_DEF_METHOD_P(ends_line, 0); RG_DEF_METHOD_P(cursor_position, 0); RG_DEF_METHOD(chars_in_line, 0); RG_DEF_METHOD(bytes_in_line, 0); RG_DEF_METHOD(attributes, 0); RG_DEF_METHOD(language, 0); RG_DEF_METHOD_P(end, 0); RG_DEF_METHOD_P(start, 0); RG_DEF_METHOD(forward_char, 0); RG_DEF_METHOD(backward_char, 0); RG_DEF_METHOD(forward_chars, 1); RG_DEF_METHOD(backward_chars, 1); RG_DEF_METHOD(forward_line, 0); RG_DEF_METHOD(backward_line, 0); RG_DEF_METHOD(forward_lines, 1); RG_DEF_METHOD(backward_lines, 1); RG_DEF_METHOD(forward_word_end, 0); RG_DEF_METHOD(backward_word_start, 0); RG_DEF_METHOD(forward_word_ends, 1); RG_DEF_METHOD(backward_word_starts, 1); RG_DEF_METHOD(forward_sentence_end, 0); RG_DEF_METHOD(backward_sentence_start, 0); RG_DEF_METHOD(forward_sentence_ends, 1); RG_DEF_METHOD(backward_sentence_starts, 1); RG_DEF_METHOD(forward_visible_word_ends, 1); RG_DEF_METHOD(backward_visible_word_starts, 1); RG_DEF_METHOD(forward_visible_word_end, 0); RG_DEF_METHOD(backward_visible_word_start, 0); RG_DEF_METHOD(forward_visible_cursor_position, 0); RG_DEF_METHOD(backward_visible_cursor_position, 0); RG_DEF_METHOD(forward_visible_cursor_positions, 1); RG_DEF_METHOD(backward_visible_cursor_positions, 1); RG_DEF_METHOD(forward_visible_line, 0); RG_DEF_METHOD(backward_visible_line, 0); RG_DEF_METHOD(forward_visible_lines, 1); RG_DEF_METHOD(backward_visible_lines, 1); RG_DEF_METHOD(forward_cursor_position, 0); RG_DEF_METHOD(backward_cursor_position, 0); RG_DEF_METHOD(forward_cursor_positions, 1); RG_DEF_METHOD(backward_cursor_positions, 1); RG_DEF_METHOD(forward_to_end, 0); RG_DEF_METHOD(forward_to_line_end, 0); RG_DEF_METHOD(set_offset, 1); RG_DEF_METHOD(set_line, 1); RG_DEF_METHOD(set_line_offset, 1); RG_DEF_METHOD(set_line_index, 1); RG_DEF_METHOD(set_visible_line_offset, 1); RG_DEF_METHOD(set_visible_line_index, 1); RG_DEF_METHOD(forward_to_tag_toggle, -1); RG_DEF_METHOD(backward_to_tag_toggle, -1); RG_DEF_METHOD(forward_find_char, -1); RG_DEF_METHOD(backward_find_char, -1); RG_DEF_METHOD(forward_search, -1); RG_DEF_METHOD(backward_search, -1); RG_DEF_METHOD_OPERATOR("==", equal, 1); RG_DEF_METHOD_OPERATOR("<=>", compare, 1); RG_DEF_METHOD(inside_sentence, 0); G_DEF_CLASS(GTK_TYPE_TEXT_SEARCH_FLAGS, "SearchFlags", RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-scrollbar.c�����������������������������������������������0000644�0001750�0001750�00000003321�12102213527�020354� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cScrollbar #define _SELF(self) (RVAL2GTKSCROLLBAR(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE orientation, adjustment; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "11", &orientation, &adjustment); widget = gtk_scrollbar_new(RVAL2GTKORIENTATION(orientation), NIL_P(adjustment) ? NULL : RVAL2GTKADJUSTMENT(adjustment)); RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_scrollbar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SCROLLBAR, "Scrollbar", mGtk); RG_DEF_METHOD(initialize, -1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-button.c��������������������������������������������������0000644�0001750�0001750�00000005466�12102213527�017720� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cButton #define _SELF(self) (RVAL2GTKBUTTON(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE button; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "01", &button); if (NIL_P(button)) { widget = gtk_button_new(); } else if (TYPE(button) == T_HASH) { VALUE label, mnemonic, stock_id, buffer; rbg_scan_options(button, "label", &label, "mnemonic", &mnemonic, "stock_id", &stock_id, NULL); if (!NIL_P(label)) widget = gtk_button_new_with_label(RVAL2CSTR(label)); else if (!NIL_P(mnemonic)) widget = gtk_button_new_with_mnemonic(RVAL2CSTR(mnemonic)); else if (!NIL_P(stock_id)) widget = gtk_button_new_from_stock(RVAL2GLIBID(stock_id, buffer)); } if (!widget) rb_raise(rb_eArgError, "Invalid arguments."); RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_set_alignment(VALUE self, VALUE xalign, VALUE yalign) { gtk_button_set_alignment(_SELF(self), NUM2DBL(xalign), NUM2DBL(yalign)); return self; } static VALUE rg_alignment(VALUE self) { gfloat xalign, yalign; gtk_button_get_alignment(_SELF(self), &xalign, &yalign); return rb_assoc_new(rb_float_new(xalign), rb_float_new(yalign)); } static VALUE rg_event_window(VALUE self) { return GOBJ2RVAL(gtk_button_get_event_window(_SELF(self))); } void Init_gtk_button(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BUTTON, "Button", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_alignment, 2); RG_DEF_METHOD(alignment, 0); RG_DEF_METHOD(event_window, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-imcon-text-simple.c���������������������������������������0000644�0001750�0001750�00000004206�12102213527�021752� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cIMContextSimple #define _SELF(self) (RVAL2GTKIMCONTEXTSIMPLE(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_im_context_simple_new()); return Qnil; } /* TODO: Why are we taking a third argument? Shouldn't it be determined by the * length of rbdata? */ static VALUE rg_add_table(VALUE self, VALUE rbdata, VALUE rbmax_seq_len, VALUE rbn_seqs) { GtkIMContextSimple *context_simple = _SELF(self); gint max_seq_len = NUM2INT(rbmax_seq_len); gint n_seqs = NUM2INT(rbn_seqs); long n; guint16 *data; if (max_seq_len > GTK_MAX_COMPOSE_LEN) rb_raise(rb_eArgError, "max_seq_len cannot be greater than GTK_MAX_COMPOSE_LEN: %d > %d", max_seq_len, GTK_MAX_COMPOSE_LEN); data = RVAL2GUINT16S(rbdata, n); gtk_im_context_simple_add_table(context_simple, data, max_seq_len, n_seqs); g_free(data); return self; } void Init_gtk_imcontext_simple(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_IM_CONTEXT_SIMPLE, "IMContextSimple", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add_table, 3); rb_define_const(RG_TARGET_NAMESPACE, "MAX_COMPOSE_LEN", GTK_MAX_COMPOSE_LEN); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-label.c���������������������������������������������������0000644�0001750�0001750�00000007616�12102213527�017463� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cLabel #define _SELF(s) (RVAL2GTKLABEL(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, with_mnemonic; GtkWidget* widget = NULL; rb_scan_args(argc, argv, "02", &label, &with_mnemonic); if (NIL_P(with_mnemonic) || ! RVAL2CBOOL(with_mnemonic)){ widget = gtk_label_new(RVAL2CSTR_ACCEPT_NIL(label)); } else { widget = gtk_label_new_with_mnemonic(RVAL2CSTR_ACCEPT_NIL(label)); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_operator_label_set_text_only(VALUE self, VALUE text) { gtk_label_set_text(_SELF(self), RVAL2CSTR(text)); return text; } static VALUE rg_set_text(int argc, VALUE *argv, VALUE self) { VALUE label, with_mnemonic; rb_scan_args(argc, argv, "02", &label, &with_mnemonic); if (NIL_P(with_mnemonic) || ! RVAL2CBOOL(with_mnemonic)){ gtk_label_set_text(_SELF(self), RVAL2CSTR(label)); } else { gtk_label_set_text_with_mnemonic(_SELF(self), RVAL2CSTR(label)); } return self; } static VALUE rg_operator_label_set_markup_only(VALUE self, VALUE text) { gtk_label_set_markup(_SELF(self), RVAL2CSTR(text)); return text; } static VALUE rg_set_markup(int argc, VALUE *argv, VALUE self) { VALUE str, with_mnemonic; rb_scan_args(argc, argv, "02", &str, &with_mnemonic); if (NIL_P(with_mnemonic) || ! RVAL2CBOOL(with_mnemonic)){ gtk_label_set_markup(_SELF(self), RVAL2CSTR(str)); } else { gtk_label_set_markup_with_mnemonic(_SELF(self), RVAL2CSTR(str)); } return self; } static VALUE rg_layout_offsets(VALUE self) { gint x, y; gtk_label_get_layout_offsets(_SELF(self), &x, &y); return rb_ary_new3(2, INT2NUM(x), INT2NUM(y)); } static VALUE rg_text(VALUE self) { return CSTR2RVAL(gtk_label_get_text(_SELF(self))); } static VALUE rg_select_region(VALUE self, VALUE start_offset, VALUE end_offset) { gtk_label_select_region(_SELF(self), NUM2INT(start_offset), NUM2INT(end_offset)); return self; } static VALUE rg_layout(VALUE self) { return GOBJ2RVAL(gtk_label_get_layout(_SELF(self))); } static VALUE rg_selection_bounds(VALUE self) { gint start, end; gboolean ret = gtk_label_get_selection_bounds(_SELF(self), &start, &end); return ret ? rb_ary_new3(2, INT2NUM(start), INT2NUM(end)) : Qnil; } void Init_gtk_label(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_LABEL, "Label", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(text, 0); RG_DEF_METHOD(set_text, -1); RG_DEF_METHOD_OPERATOR("text=", label_set_text_only, 1); RG_DEF_METHOD(set_markup, -1); RG_DEF_METHOD_OPERATOR("markup=", label_set_markup_only, 1); RG_DEF_METHOD(layout_offsets, 0); RG_DEF_METHOD(select_region, 2); RG_DEF_METHOD(layout, 0); RG_DEF_METHOD(selection_bounds, 0); } ������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk3.h��������������������������������������������������������0000644�0001750�0001750�00000004350�11701304107�016465� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGTK3_H__ #define __RBGTK3_H__ #include <gtk/gtk.h> #include <rbgobject.h> #include "rbgtk3conversions.h" #define RBGTK_MAJOR_VERSION RBGLIB_MAJOR_VERSION #define RBGTK_MINOR_VERSION RBGLIB_MINOR_VERSION #define RBGTK_MICRO_VERSION RBGLIB_MICRO_VERSION #define RBGTK_INITIALIZE(obj,gtkobj)\ (rbgtk_initialize_gtkobject(obj, G_OBJECT(gtkobj))) #define GTK_TYPE_ACCEL_GROUP_ENTRY (gtk_accel_group_entry_get_type()) #define GTK_TYPE_ACCEL_KEY (gtk_accel_key_get_type()) #define GTK_TYPE_ALLOCATION (gtk_allocation_get_type()) #define GTK_TYPE_BINDING_SET (gtk_bindingset_get_type()) #define GTK_TYPE_RECENT_DATA (gtk_recent_data_get_type()) #define GTK_TYPE_RECENT_FILTER_INFO (gtk_recent_filter_info_get_type()) #define GTK_TYPE_TEXT_APPEARANCE (gtk_text_appearance_get_type()) extern void rbgtk_initialize_gtkobject(VALUE obj, GObject *gtkobj); extern GType gtk_accel_group_entry_get_type(void); extern GType gtk_accel_key_get_type(void); extern GType gtk_allocation_get_type(void); extern GType gtk_bindingset_get_type(void); extern GType gtk_recent_data_get_type(void); extern GType gtk_recent_filter_info_get_type(void); extern GType gtk_text_appearance_get_type(void); #endif /* __RBGTK3_H__ */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-window-group.c��������������������������������������������0000644�0001750�0001750�00000004444�12102213527�021041� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cWindowGroup #define _SELF(self) (RVAL2GTKWINDOWGROUP(self)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_window_group_new()); return Qnil; } static VALUE rg_add(VALUE self, VALUE window) { gtk_window_group_add_window(_SELF(self), RVAL2GTKWINDOW(window)); return self; } static VALUE rg_remove(VALUE self, VALUE window) { gtk_window_group_remove_window(_SELF(self), RVAL2GTKWINDOW(window)); return self; } static VALUE rg_get_current_device_grab(VALUE self, VALUE device) { return GOBJ2RVAL(gtk_window_group_get_current_device_grab(_SELF(self), NIL_P(device) ? NULL : RVAL2GDKDEVICE(device))); } static VALUE rg_current_grab(VALUE self) { return GOBJ2RVAL(gtk_window_group_get_current_grab(_SELF(self))); } static VALUE rg_windows(VALUE self) { /* TODO: need free? */ return GOBJGLIST2RVAL(gtk_window_group_list_windows(_SELF(self))); } void Init_gtk_windowgroup(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_WINDOW_GROUP, "WindowGroup", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add, 1); RG_DEF_METHOD(remove, 1); RG_DEF_METHOD(get_current_device_grab, 1); RG_DEF_METHOD(current_grab, 0); RG_DEF_METHOD(windows, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-color-selection-dialog.c����������������������������������0000644�0001750�0001750�00000003502�12102213527�022730� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cColorSelectionDialog #define _SELF(s) (RVAL2GTKCOLORSELECTIONDIALOG(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, rb_title; const gchar *title; GtkWidget *dialog; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "title", &rb_title, NULL); title = RVAL2CSTR_ACCEPT_NIL(rb_title); dialog = gtk_color_selection_dialog_new(title); RBGTK_INITIALIZE(self, dialog); return Qnil; } void Init_gtk_color_selection_dialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_COLOR_SELECTION_DIALOG, "ColorSelectionDialog", mGtk); RG_DEF_METHOD(initialize, -1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-range.c���������������������������������������������������0000644�0001750�0001750�00000003763�12102213527�017477� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRange #define _SELF(self) (RVAL2GTKRANGE(self)) static VALUE rg_value(VALUE self) { return rb_float_new(gtk_range_get_value(_SELF(self))); } static VALUE rg_set_increments(VALUE self, VALUE step, VALUE page) { gtk_range_set_increments(_SELF(self), NUM2DBL(step), NUM2DBL(page)); return self; } static VALUE rg_set_range(VALUE self, VALUE min, VALUE max) { gtk_range_set_range(_SELF(self), NUM2DBL(min), NUM2DBL(max)); return self; } static VALUE rg_set_value(VALUE self, VALUE value) { gtk_range_set_value(_SELF(self), NUM2DBL(value)); return self; } 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_CLASS(GTK_TYPE_SENSITIVITY_TYPE, "SensitivityType", RG_TARGET_NAMESPACE); } �������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-button-box.c����������������������������������������������0000644�0001750�0001750�00000005511�12102213527�020475� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cButtonBox #define _SELF(self) (RVAL2GTKBUTTONBOX(self)) static VALUE rg_initialize(VALUE self, VALUE orientation) { RBGTK_INITIALIZE(self, gtk_button_box_new(RVAL2GTKORIENTATION(orientation))); return Qnil; } static VALUE rg_set_child_secondary(VALUE self, VALUE child, VALUE is_secondary) { gtk_button_box_set_child_secondary(_SELF(self), RVAL2GTKWIDGET(child), RVAL2CBOOL(is_secondary)); return self; } static VALUE rg_get_child_secondary(VALUE self, VALUE child) { return CBOOL2RVAL(gtk_button_box_get_child_secondary(_SELF(self), RVAL2GTKWIDGET(child))); } #if GTK_CHECK_VERSION(3, 2, 0) static VALUE rg_get_child_non_homogeneous(VALUE self, VALUE child) { return CBOOL2RVAL(gtk_button_box_get_child_non_homogeneous(_SELF(self), RVAL2GTKWIDGET(child))); } static VALUE rg_set_child_non_homogeneous(VALUE self, VALUE child, VALUE non_homogeneous) { gtk_button_box_set_child_non_homogeneous(_SELF(self), RVAL2GTKWIDGET(child), RVAL2CBOOL(non_homogeneous)); return self; } #endif void Init_gtk_button_box(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BUTTON_BOX, "ButtonBox", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(set_child_secondary, 2); RG_DEF_METHOD(get_child_secondary, 1); #if GTK_CHECK_VERSION(3, 2, 0) RG_DEF_METHOD(get_child_non_homogeneous, 1); RG_DEF_METHOD(set_child_non_homogeneous, 2); #endif G_DEF_CLASS(GTK_TYPE_BUTTON_BOX_STYLE, "Style", RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/gtk3.def��������������������������������������������������������0000644�0001750�0001750�00000000415�11701304107�016446� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXPORTS Init_gtk3 rbgtk_initialize_gtkobject gtk_accel_group_entry_get_type gtk_accel_key_get_type gtk_allocation_get_type gtk_bindingset_get_type gtk_recent_data_get_type gtk_recent_filter_info_get_type gtk_text_appearance_get_type ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-lock-button.c���������������������������������������������0000644�0001750�0001750�00000003011�12102213527�020626� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #if GTK_CHECK_VERSION(3, 2, 0) #define RG_TARGET_NAMESPACE cLockButton #define _SELF(self) (RVAL2GTKLOCKBUTTON(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE permission; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "01", &permission); widget = gtk_lock_button_new(NIL_P(permission) ? NULL : RVAL2GPERMISSION(permission)); RBGTK_INITIALIZE(self, widget); return Qnil; } #endif void Init_gtk_lockbutton(VALUE mGtk) { #if GTK_CHECK_VERSION(3, 2, 0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_LOCK_BUTTON, "LockButton", mGtk); RG_DEF_METHOD(initialize, -1); #endif } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-separator.c�����������������������������������������������0000644�0001750�0001750�00000002732�12102213527�020376� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cSeparator #define _SELF(self) (RVAL2GTKSEPARATOR(self)) static VALUE rg_initialize(VALUE self, VALUE orientation) { RBGTK_INITIALIZE(self, gtk_separator_new(RVAL2GTKORIENTATION(orientation))); return Qnil; } void Init_gtk_separator(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SEPARATOR, "Separator", mGtk); RG_DEF_METHOD(initialize, 1); } ��������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-about-dialog.c��������������������������������������������0000644�0001750�0001750�00000010174�12102213526�020743� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAboutDialog #define _SELF(self) (RVAL2GTKABOUTDIALOG(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_about_dialog_new()); return Qnil; } static void activate_link_func(GtkAboutDialog *about, const gchar *link, gpointer func) { rb_funcall((VALUE)func, id_call, 2, GOBJ2RVAL(about), CSTR2RVAL(link)); } typedef struct { const char *name; gpointer value; } prop_data; #define ABOUT_PROP_NUM (15) static VALUE rg_s_show(VALUE self, VALUE parent, VALUE props) { int i; VALUE ary; prop_data pd[ABOUT_PROP_NUM]; Check_Type(props, T_HASH); ary = rb_funcall(props, rb_intern("to_a"), 0); if (RARRAY_LEN(ary) > ABOUT_PROP_NUM) rb_raise(rb_eArgError, "Too many args."); for (i = 0; i < ABOUT_PROP_NUM; i++){ pd[i].name = (const char*)NULL; pd[i].value = (gpointer)NULL; } for (i = 0; i < RARRAY_LEN(ary); i++){ if (TYPE(RARRAY_PTR(RARRAY_PTR(ary)[i])[0]) == T_SYMBOL){ pd[i].name = rb_id2name(SYM2ID(RARRAY_PTR(RARRAY_PTR(ary)[i])[0])); } else { pd[i].name = RVAL2CSTR(RARRAY_PTR(RARRAY_PTR(ary)[i])[0]); } if (strncmp(pd[i].name, "artists", strlen("artists")) == 0|| strncmp(pd[i].name, "authors", strlen("authors")) == 0|| strncmp(pd[i].name, "documenters", strlen("documenters")) == 0){ GValue gval = G_VALUE_INIT; g_value_init(&gval, G_TYPE_STRV); rbgobj_rvalue_to_gvalue(RARRAY_PTR(RARRAY_PTR(ary)[i])[1], &gval); pd[i].value = g_boxed_copy(G_TYPE_STRV, g_value_get_boxed(&gval)); } else if (strncmp(pd[i].name, "logo", strlen("logo")) == 0 && strlen(pd[i].name) == strlen("logo")){ pd[i].value = g_object_ref(RVAL2GOBJ(RARRAY_PTR(RARRAY_PTR(ary)[i])[1])); } else if (strncmp(pd[i].name, "wrap_license", strlen("wrap_license")) == 0){ pd[i].value = GINT_TO_POINTER(RVAL2CBOOL(RARRAY_PTR(ary)[i])); } else { pd[i].value = g_strdup(RVAL2CSTR(RARRAY_PTR(RARRAY_PTR(ary)[i])[1])); } } gtk_show_about_dialog(RVAL2GTKWINDOW(parent), pd[0].name, pd[0].value, pd[1].name, pd[1].value, pd[2].name, pd[2].value, pd[3].name, pd[3].value, pd[4].name, pd[4].value, pd[5].name, pd[5].value, pd[6].name, pd[6].value, pd[7].name, pd[7].value, pd[8].name, pd[8].value, pd[9].name, pd[9].value, pd[10].name, pd[10].value, pd[11].name, pd[11].value, pd[12].name, pd[12].value, pd[13].name, pd[13].value, pd[14].name, pd[14].value, NULL); return self; } void Init_gtk_aboutdialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ABOUT_DIALOG, "AboutDialog", mGtk); G_DEF_CLASS(GTK_TYPE_LICENSE, "License", RG_TARGET_NAMESPACE); RG_DEF_METHOD(initialize, 0); RG_DEF_SMETHOD(show, 2); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-renderer-pixbuf.c������������������������������������0000644�0001750�0001750�00000002553�12102213527�022415� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCellRendererPixbuf #define _SELF(s) (RVAL2GTKCELLRENDERERPIXBUF(s)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_pixbuf_new()); return Qnil; } void Init_gtk_cellrendererpixbuf(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_PIXBUF, "CellRendererPixbuf", mGtk); RG_DEF_METHOD(initialize, 0); RG_REG_GLIBID_SETTER("stock-id"); } �����������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-entry-buffer.c��������������������������������������������0000644�0001750�0001750�00000004770�12102213527�021012� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cEntryBuffer #define _SELF(self) (RVAL2GTKENTRYBUFFER(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE initial_chars; GtkEntryBuffer *buffer = NULL; rb_scan_args(argc, argv, "01", &initial_chars); if (NIL_P(initial_chars)) { buffer = gtk_entry_buffer_new(NULL, -1); } else { StringValue(initial_chars); buffer = gtk_entry_buffer_new(RSTRING_PTR(initial_chars), RSTRING_LEN(initial_chars)); } G_INITIALIZE(self, buffer); return Qnil; } static VALUE rg_delete_text(VALUE self, VALUE position, VALUE n_chars) { guint result; result = gtk_entry_buffer_delete_text(_SELF(self), NUM2UINT(position), NUM2INT(n_chars)); return UINT2NUM(result); } static VALUE rg_bytes(VALUE self) { return ULONG2NUM(gtk_entry_buffer_get_bytes(_SELF(self))); } static VALUE rg_insert_text(VALUE self, VALUE position, VALUE chars) { guint result; StringValue(chars); result = gtk_entry_buffer_insert_text(_SELF(self), NUM2UINT(position), RSTRING_PTR(chars), RSTRING_LEN(chars)); return UINT2NUM(result); } void Init_gtk_entrybuffer(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ENTRY_BUFFER, "EntryBuffer", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(delete_text, 2); RG_DEF_METHOD(bytes, 0); RG_DEF_METHOD(insert_text, 2); } ��������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-fixed.c���������������������������������������������������0000644�0001750�0001750�00000003456�12102213527�017501� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cFixed #define _SELF(self) (RVAL2GTKFIXED(self)) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_fixed_new()); return Qnil; } static VALUE rg_put(VALUE self, VALUE win, VALUE x, VALUE y) { gtk_fixed_put(_SELF(self), RVAL2GTKWIDGET(win), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_move(VALUE self, VALUE win, VALUE x, VALUE y) { gtk_fixed_move(_SELF(self), RVAL2GTKWIDGET(win), NUM2INT(x), NUM2INT(y)); return self; } void Init_gtk_fixed(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FIXED, "Fixed", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(put, 3); RG_DEF_METHOD(move, 3); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-radio-button.c��������������������������������������������0000644�0001750�0001750�00000006073�12102213527�021007� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRadioButton static VALUE RG_TARGET_NAMESPACE; #define _GROUP(s) (NIL_P(s) ? NULL : RVAL2GTKRADIOBUTTON(s)) static GtkWidget* create_button(VALUE group, VALUE label, VALUE use_underline) { GtkWidget* widget = NULL; if (TYPE(label) == T_STRING){ if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)){ widget = gtk_radio_button_new_with_mnemonic_from_widget(_GROUP(group), RVAL2CSTR(label)); } else { widget = gtk_radio_button_new_with_label_from_widget(_GROUP(group), RVAL2CSTR(label)); } } else if (TYPE(label) == T_SYMBOL){ widget = gtk_radio_button_new_with_label_from_widget(_GROUP(group), rb_id2name(SYM2ID(label))); gtk_button_set_use_stock(GTK_BUTTON(widget), TRUE); } else if (NIL_P(label)){ widget = gtk_radio_button_new_from_widget(_GROUP(group)); } else { rb_raise(rb_eArgError, "invalid argument %s (expect Symbol(Gtk::Stock constants) or String)", rb_class2name(CLASS_OF(label))); } return widget; } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE group_or_label, label_or_use_underline, use_underline; GtkWidget *widget; if (rb_scan_args(argc, argv, "03", &group_or_label, &label_or_use_underline, &use_underline) > 0) { if (rb_obj_is_kind_of(group_or_label, RG_TARGET_NAMESPACE)){ widget = create_button(group_or_label, label_or_use_underline, use_underline); } else { widget = create_button(Qnil, group_or_label, label_or_use_underline); } } else { widget = gtk_radio_button_new(NULL); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_group(VALUE self) { return GOBJGSLIST2RVAL(gtk_radio_button_get_group(RVAL2GTKRADIOBUTTON(self))); } void Init_gtk_radio_button(VALUE mGtk) { RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RADIO_BUTTON, "RadioButton", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(group, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tearoff-menu-item.c���������������������������������������0000644�0001750�0001750�00000002633�12102213527�021722� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cTearoffMenuItem static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_tearoff_menu_item_new()); return Qnil; } void Init_gtk_tearoff_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEAROFF_MENU_ITEM, "TearoffMenuItem", mGtk); RG_DEF_METHOD(initialize, 0); } �����������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-frame.c���������������������������������������������������0000644�0001750�0001750�00000004244�12102213527�017470� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cFrame static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label; rb_scan_args(argc, argv, "01", &label); RBGTK_INITIALIZE(self, gtk_frame_new(RVAL2CSTR_ACCEPT_NIL(label))); return Qnil; } static VALUE rg_set_label_align(VALUE self, VALUE xalign, VALUE yalign) { gtk_frame_set_label_align(RVAL2GTKFRAME(self), NUM2DBL(xalign), NUM2DBL(yalign)); return self; } static VALUE rg_label_align(VALUE self) { gfloat xalign, yalign; gtk_frame_get_label_align(RVAL2GTKFRAME(self), &xalign, &yalign); return rb_ary_new3(2, rb_float_new(xalign), rb_float_new(yalign)); } void Init_gtk_frame(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FRAME, "Frame", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_label_align, 2); RG_DEF_METHOD(label_align, 0); rb_undef_method(RG_TARGET_NAMESPACE, "shadow"); rb_undef_method(RG_TARGET_NAMESPACE, "shadow="); rb_undef_method(RG_TARGET_NAMESPACE, "set_shadow"); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-drag.c����������������������������������������������������0000644�0001750�0001750�00000005301�12102213527�017306� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mDrag struct rbgtk_rval2gtktargetentries_args { VALUE ary; long n; GtkTargetEntry *result; }; static VALUE rbgtk_rval2gtktargetentries_body(VALUE value) { long i; struct rbgtk_rval2gtktargetentries_args *args = (struct rbgtk_rval2gtktargetentries_args *)value; for (i = 0; i < args->n; i++) { VALUE entry = rb_ary_to_ary(RARRAY_PTR(args->ary)[i]); VALUE flags = RARRAY_PTR(entry)[1]; VALUE info = RARRAY_PTR(entry)[2]; args->result[i].target = (gchar *)RVAL2CSTR_ACCEPT_NIL(RARRAY_PTR(entry)[0]); args->result[i].flags = NIL_P(flags) ? 0 : RVAL2GTKTARGETFLAGS(flags); args->result[i].info = NIL_P(info) ? 0 : NUM2INT(info); } return Qnil; } static G_GNUC_NORETURN VALUE rbgtk_rval2gtktargetentries_rescue(VALUE value) { g_free(((struct rbgtk_rval2gtktargetentries_args *)value)->result); rb_exc_raise(rb_errinfo()); } GtkTargetEntry * rbgtk_rval2gtktargetentries(VALUE value, long *n) { struct rbgtk_rval2gtktargetentries_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GtkTargetEntry, args.n + 1); rb_rescue(rbgtk_rval2gtktargetentries_body, (VALUE)&args, rbgtk_rval2gtktargetentries_rescue, (VALUE)&args); *n = args.n; return args.result; } GtkTargetEntry * rbgtk_rval2gtktargetentries_accept_nil(VALUE value, long *n) { if (!NIL_P(value)) return rbgtk_rval2gtktargetentries(value, n); *n = 0; return NULL; } void Init_gtk_drag(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "Drag"); G_DEF_CLASS(GTK_TYPE_DEST_DEFAULTS, "DestDefaults", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_TARGET_FLAGS, "TargetFlags", RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-notebook.c������������������������������������������������0000644�0001750�0001750�00000026115�12102213527�020217� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cNotebook #define _SELF(self) RVAL2GTKNOTEBOOK(self) #define GTK_TYPE_NOTEBOOK_PAGE (gtk_notebookpage_get_type()) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_notebook_new()); return Qnil; } static VALUE rg_append_page(int argc, VALUE *argv, VALUE self) { VALUE child, label; rb_scan_args(argc, argv, "11", &child, &label); gtk_notebook_append_page(_SELF(self), RVAL2GTKWIDGET(child), NIL_P(label) ? NULL : RVAL2GTKWIDGET(label)); G_CHILD_ADD(self, child); return self; } static VALUE rg_append_page_menu(int argc, VALUE *argv, VALUE self) { VALUE child, tab_label, menu_label; rb_scan_args(argc, argv, "12", &child, &tab_label, &menu_label); gtk_notebook_append_page_menu(_SELF(self), RVAL2GTKWIDGET(child), RVAL2GTKWIDGET(tab_label), NIL_P(menu_label) ? NULL : RVAL2GTKWIDGET(menu_label)); return self; } static VALUE rg_prepend_page(int argc, VALUE *argv, VALUE self) { VALUE child, label; rb_scan_args(argc, argv, "11", &child, &label); gtk_notebook_prepend_page(_SELF(self), RVAL2GTKWIDGET(child), NIL_P(label) ? NULL : RVAL2GTKWIDGET(label)); return self; } static VALUE rg_prepend_page_menu(int argc, VALUE *argv, VALUE self) { VALUE child, tab_label, menu_label; rb_scan_args(argc, argv, "12", &child, &tab_label, &menu_label); gtk_notebook_prepend_page_menu(_SELF(self), RVAL2GTKWIDGET(child), RVAL2GTKWIDGET(tab_label), NIL_P(menu_label) ? NULL : RVAL2GTKWIDGET(menu_label)); return self; } static VALUE rg_insert_page(int argc, VALUE *argv, VALUE self) { VALUE pos, child, label; rb_scan_args(argc, argv, "21", &pos, &child, &label); gtk_notebook_insert_page(_SELF(self), RVAL2GTKWIDGET(child), NIL_P(label) ? NULL : RVAL2GTKWIDGET(label), NUM2INT(pos)); return self; } static VALUE rg_insert_page_menu(int argc, VALUE *argv, VALUE self) { VALUE pos, child, tab_label, menu_label; rb_scan_args(argc, argv, "22", &pos, &child, &tab_label, &menu_label); gtk_notebook_insert_page_menu(_SELF(self), RVAL2GTKWIDGET(child), RVAL2GTKWIDGET(tab_label), RVAL2GTKWIDGET(menu_label), NUM2INT(pos)); return self; } static VALUE rg_remove_page(VALUE self, VALUE pos) { gtk_notebook_remove_page(_SELF(self), NUM2INT(pos)); return self; } static VALUE rg_page_num(VALUE self, VALUE child) { return INT2FIX(gtk_notebook_page_num(_SELF(self), RVAL2GTKWIDGET(child))); } static VALUE rg_next_page(VALUE self) { gtk_notebook_next_page(_SELF(self)); return self; } static VALUE rg_prev_page(VALUE self) { gtk_notebook_prev_page(_SELF(self)); return self; } static VALUE rg_reorder_child(VALUE self, VALUE child, VALUE pos) { gtk_notebook_reorder_child(_SELF(self), RVAL2GTKWIDGET(child), NUM2INT(pos)); return self; } static VALUE rg_get_menu_label(VALUE self, VALUE child) { return GOBJ2RVAL(gtk_notebook_get_menu_label(_SELF(self), RVAL2GTKWIDGET(child))); } static VALUE rg_get_nth_page(VALUE self, VALUE page_num) { GtkWidget *page = gtk_notebook_get_nth_page(_SELF(self), NUM2INT(page_num)); return page ? GOBJ2RVAL(page) : Qnil; } static VALUE rg_n_pages(VALUE self) { return INT2NUM(gtk_notebook_get_n_pages(_SELF(self))); } static VALUE rg_get_tab_label(VALUE self, VALUE child) { return GOBJ2RVAL(gtk_notebook_get_tab_label(_SELF(self), RVAL2GTKWIDGET(child))); } static VALUE rg_set_menu_label(VALUE self, VALUE child, VALUE label) { gtk_notebook_set_menu_label(_SELF(self), RVAL2GTKWIDGET(child), NIL_P(label)?NULL:RVAL2GTKWIDGET(label)); return self; } static VALUE rg_set_menu_label_text(VALUE self, VALUE child, VALUE text) { gtk_notebook_set_menu_label_text(_SELF(self), RVAL2GTKWIDGET(child), RVAL2CSTR(text)); return self; } static VALUE rg_set_tab_label(VALUE self, VALUE child, VALUE label) { gtk_notebook_set_tab_label(_SELF(self), RVAL2GTKWIDGET(child), NIL_P(label)?NULL:RVAL2GTKWIDGET(label)); return self; } static VALUE rg_set_tab_label_text(VALUE self, VALUE child, VALUE text) { gtk_notebook_set_tab_label_text(_SELF(self), RVAL2GTKWIDGET(child), RVAL2CSTR(text)); return self; } static VALUE rg_get_menu_label_text(VALUE self, VALUE child) { return CSTR2RVAL(gtk_notebook_get_menu_label_text(_SELF(self), RVAL2GTKWIDGET(child))); } static VALUE rg_get_tab_label_text(VALUE self, VALUE child) { return CSTR2RVAL(gtk_notebook_get_tab_label_text(_SELF(self), RVAL2GTKWIDGET(child))); } static VALUE rg_get_tab_reorderable(VALUE self, VALUE child) { return CBOOL2RVAL(gtk_notebook_get_tab_reorderable(_SELF(self), RVAL2GTKWIDGET(child))); } static VALUE rg_set_tab_reorderable(VALUE self, VALUE child, VALUE reorderable) { gtk_notebook_set_tab_reorderable(_SELF(self), RVAL2GTKWIDGET(child), RVAL2CBOOL(reorderable)); return self; } static VALUE rg_get_tab_detachable(VALUE self, VALUE child) { return CBOOL2RVAL(gtk_notebook_get_tab_detachable(_SELF(self), RVAL2GTKWIDGET(child))); } static VALUE rg_set_tab_detachable(VALUE self, VALUE child, VALUE detachable) { gtk_notebook_set_tab_detachable(_SELF(self), RVAL2GTKWIDGET(child), RVAL2CBOOL(detachable)); return self; } static GtkNotebook* creation_func(GtkNotebook *source, GtkWidget *page, gint x, gint y, gpointer func) { VALUE ret; ret = rb_funcall((VALUE)func, id_call, 4, GOBJ2RVAL(source), GOBJ2RVAL(page), INT2NUM(x), INT2NUM(y)); return NIL_P(ret) ? (GtkNotebook*)NULL : RVAL2GTKNOTEBOOK(ret); } static VALUE rg_set_action_widget(VALUE self, VALUE widget, VALUE pack_type) { gtk_notebook_set_action_widget(_SELF(self), RVAL2GTKWIDGET(widget), RVAL2GTKPACKTYPE(pack_type)); return self; } static VALUE rg_get_action_widget(VALUE self, VALUE pack_type) { return GOBJ2RVAL(gtk_notebook_get_action_widget(_SELF(self), RVAL2GTKPACKTYPE(pack_type))); } /* deprecated typedef struct { VALUE parent; GtkNotebookPage *page; } GtkNotebookPageData; static GtkNotebookPageData * notebookpage_copy(const GtkNotebookPage *page) { GtkNotebookPageData *data; g_return_val_if_fail (page != NULL, NULL); data = g_new(GtkNotebookPageData, 1); data->page = (GtkNotebookPage *)page; return data; } static GType gtk_notebookpage_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkNotebookPageData", (GBoxedCopyFunc)notebookpage_copy, (GBoxedFreeFunc)g_free); return our_type; } static VALUE signal_g2r_func(G_GNUC_UNUSED guint num, const GValue *values) { GtkNotebookPageData npp; npp.parent = GVAL2RVAL(&values[0]); npp.page = (GtkNotebookPage*)g_value_get_pointer(&values[1]); return rb_ary_new3(3, GVAL2RVAL(&values[0]), GTKNOTEBOOKPAGE2RVAL(&npp), GVAL2RVAL(&values[2])); } */ static VALUE rg_tab_hborder(VALUE self) { return UINT2NUM(gtk_notebook_get_tab_hborder(_SELF(self))); } static VALUE rg_tab_vborder(VALUE self) { return UINT2NUM(gtk_notebook_get_tab_vborder(_SELF(self))); } void Init_gtk_notebook(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_NOTEBOOK, "Notebook", mGtk); /* deprecated G_DEF_CLASS(GTK_TYPE_NOTEBOOK_PAGE, "NotebookPage", mGtk); */ RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(append_page, -1); RG_DEF_METHOD(append_page_menu, -1); RG_DEF_METHOD(prepend_page, -1); RG_DEF_METHOD(prepend_page_menu, -1); RG_DEF_METHOD(insert_page, -1); RG_DEF_METHOD(insert_page_menu, -1); RG_DEF_METHOD(remove_page, 1); RG_DEF_METHOD(page_num, 1); RG_DEF_METHOD(next_page, 0); RG_DEF_METHOD(prev_page, 0); RG_DEF_METHOD(reorder_child, 2); RG_DEF_METHOD(get_menu_label, 1); RG_DEF_METHOD(get_nth_page, 1); RG_DEF_METHOD(n_pages, 0); RG_DEF_METHOD(get_tab_label, 1); RG_DEF_METHOD(set_menu_label, 2); RG_DEF_METHOD(set_menu_label_text, 2); RG_DEF_METHOD(set_tab_label, 2); RG_DEF_METHOD(set_tab_label_text, 2); RG_DEF_METHOD(get_menu_label_text, 1); RG_DEF_METHOD(get_tab_label_text, 1); RG_DEF_METHOD(get_tab_reorderable, 1); RG_DEF_METHOD(set_tab_reorderable, 2); RG_DEF_METHOD(get_tab_detachable, 1); RG_DEF_METHOD(set_tab_detachable, 2); RG_DEF_METHOD(set_action_widget, 2); RG_DEF_METHOD(get_action_widget, 1); RG_DEF_METHOD(tab_hborder, 0); RG_DEF_METHOD(tab_vborder, 0); /* GtkNotebookTab */ rb_define_const(RG_TARGET_NAMESPACE, "TAB_FIRST", GTK_NOTEBOOK_TAB_FIRST); rb_define_const(RG_TARGET_NAMESPACE, "TAB_LAST", GTK_NOTEBOOK_TAB_LAST); /* deprecated G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "switch_page", (GValToRValSignalFunc)signal_g2r_func); */ } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-check-button.c��������������������������������������������0000644�0001750�0001750�00000004356�12102213527�020770� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCheckButton static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, use_underline; GtkWidget *widget; if (rb_scan_args(argc, argv, "02", &label, &use_underline) > 0) { if (TYPE(label) == T_STRING){ if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)){ widget = gtk_check_button_new_with_mnemonic(RVAL2CSTR(label)); } else { widget = gtk_check_button_new_with_label(RVAL2CSTR(label)); } } else if (TYPE(label) == T_SYMBOL){ widget = gtk_check_button_new_with_label(rb_id2name(SYM2ID(label))); gtk_button_set_use_stock(GTK_BUTTON(widget), TRUE); } else { rb_raise(rb_eArgError, "invalid argument %s (expect Symbol(Gtk::Stock constants) or String)", rb_class2name(CLASS_OF(label))); } } else { widget = gtk_check_button_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_check_button(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CHECK_BUTTON, "CheckButton", mGtk); RG_DEF_METHOD(initialize, -1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-app-chooser-widget.c��������������������������������������0000644�0001750�0001750�00000002503�12102213527�022073� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAppChooserWidget #define _SELF(self) (RVAL2GTKAPPCHOOSERWIDGET(self)) static VALUE rg_initialize(VALUE self, VALUE content_type) { RBGTK_INITIALIZE(self, gtk_app_chooser_widget_new(RVAL2CSTR(content_type))); return Qnil; } void Init_gtk_appchooserwidget(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_APP_CHOOSER_WIDGET, "AppChooserWidget", mGtk); RG_DEF_METHOD(initialize, 1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-accel-map.c�����������������������������������������������0000644�0001750�0001750�00000007134�12102213526�020220� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAccelMap #define RVAL2MOD(mods) (NIL_P(mods) ? 0 : RVAL2GDKMODIFIERTYPE(mods)) static VALUE rg_s_add_entry(VALUE self, VALUE path, VALUE key, VALUE mods) { gtk_accel_map_add_entry(RVAL2CSTR(path), NUM2UINT(key), RVAL2MOD(mods)); return self; } static VALUE rg_s_lookup_entry(VALUE self, VALUE path) { GtkAccelKey key; if(gtk_accel_map_lookup_entry(RVAL2CSTR(path), &key)) return GTKACCELKEY2RVAL(&key); else return self; } static VALUE rg_s_change_entry(G_GNUC_UNUSED VALUE self, VALUE path, VALUE key, VALUE mods, VALUE replace) { return CBOOL2RVAL(gtk_accel_map_change_entry(RVAL2CSTR(path), NUM2UINT(key), RVAL2MOD(mods), RVAL2CBOOL(replace))); } static VALUE rg_s_load(VALUE self, VALUE filename) { gtk_accel_map_load(RVAL2CSTR(filename)); return self; } static VALUE rg_s_save(VALUE self, VALUE filename) { gtk_accel_map_save(RVAL2CSTR(filename)); return self; } static VALUE rg_s_add_filter(VALUE self, VALUE pattern) { gtk_accel_map_add_filter(RVAL2CSTR(pattern)); return self; } static void accel_map_foreach_func(gpointer func, const gchar *path, guint key, GdkModifierType mods, gboolean changed) { rb_funcall((VALUE)func, id_call, 4, CSTR2RVAL(path), UINT2NUM(key), GDKMODIFIERTYPE2RVAL(mods), CBOOL2RVAL(changed)); } static VALUE rg_s_each(VALUE self) { volatile VALUE func = rb_block_proc(); gtk_accel_map_foreach((gpointer)func, (GtkAccelMapForeach)accel_map_foreach_func); return self; } static VALUE rg_s_each_unfilterd(VALUE self) { volatile VALUE func = rb_block_proc(); gtk_accel_map_foreach_unfiltered((gpointer)func, (GtkAccelMapForeach)accel_map_foreach_func); return self; } static VALUE rg_s_get(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gtk_accel_map_get()); } static VALUE rg_s_lock_path(VALUE self, VALUE accel_path) { gtk_accel_map_lock_path(RVAL2CSTR(accel_path)); return self; } static VALUE rg_s_unlock_path(VALUE self, VALUE accel_path) { gtk_accel_map_unlock_path(RVAL2CSTR(accel_path)); return self; } void Init_gtk_accel_map(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCEL_MAP, "AccelMap", mGtk); RG_DEF_SMETHOD(add_entry, 3); RG_DEF_SMETHOD(lookup_entry, 1); RG_DEF_SMETHOD(change_entry, 4); RG_DEF_SMETHOD(load, 1); RG_DEF_SMETHOD(save, 1); RG_DEF_SMETHOD(add_filter, 1); RG_DEF_SMETHOD(each, 0); RG_DEF_SMETHOD(each_unfilterd, 0); RG_DEF_SMETHOD(get, 0); RG_DEF_SMETHOD(lock_path, 1); RG_DEF_SMETHOD(unlock_path, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-event-box.c�����������������������������������������������0000644�0001750�0001750�00000002565�12102213527�020311� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cEventBox static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_event_box_new()); return Qnil; } void Init_gtk_eventbox(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_EVENT_BOX, "EventBox", mGtk); RG_DEF_METHOD(initialize, 0); } �������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-text-appearance.c�����������������������������������������0000644�0001750�0001750�00000012561�12102213527�021460� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" /*****************************************/ static GtkTextAppearance* app_copy(const GtkTextAppearance* app) { GtkTextAppearance* new_app; g_return_val_if_fail (app != NULL, NULL); new_app = g_new(GtkTextAppearance, 1); *new_app = *app; return new_app; } GType gtk_text_appearance_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GtkTextAppearance", (GBoxedCopyFunc)app_copy, (GBoxedFreeFunc)g_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cTextAppearance #define _SELF(t) (RVAL2GTKTEXTAPPEARANCE(t)) static VALUE rg_initialize(VALUE self) { GtkTextAppearance* app = ALLOC(GtkTextAppearance); memset(app, 0, sizeof(GtkTextAppearance)); G_INITIALIZE(self, app); return Qnil; } static VALUE rg_bg_color(VALUE self) { VALUE val = GDKCOLOR2RVAL(&_SELF(self)->bg_color); G_CHILD_SET(self, rb_intern("bg_color"), val); return val; } static VALUE rg_set_bg_color(VALUE self, VALUE val) { G_CHILD_SET(self, rb_intern("bg_color"), val); _SELF(self)->bg_color = *RVAL2GDKCOLOR(val); return self; } static VALUE rg_fg_color(VALUE self) { VALUE val = GDKCOLOR2RVAL(&_SELF(self)->fg_color); G_CHILD_SET(self, rb_intern("fg_color"), val); return val; } static VALUE rg_set_fg_color(VALUE self, VALUE val) { G_CHILD_SET(self, rb_intern("fg_color"), val); _SELF(self)->fg_color = *RVAL2GDKCOLOR(val); return self; } /* deprecated static VALUE rg_bg_stipple(VALUE self) { VALUE val; if (_SELF(self)->bg_stipple == NULL) return Qnil; val = GOBJ2RVAL(_SELF(self)->bg_stipple); G_CHILD_SET(self, rb_intern("bg_stipple"), val); return val; } static VALUE rg_set_bg_stipple(VALUE self, VALUE val) { _SELF(self)->bg_stipple = RVAL2GOBJ(val); G_CHILD_SET(self, rb_intern("bg_stipple"), val); return self; } static VALUE rg_fg_stipple(VALUE self) { VALUE val; if (_SELF(self)->fg_stipple == NULL) return Qnil; val = GOBJ2RVAL(_SELF(self)->fg_stipple); G_CHILD_SET(self, rb_intern("fg_stipple"), val); return val; } static VALUE rg_set_fg_stipple(VALUE self, VALUE val) { _SELF(self)->fg_stipple = RVAL2GOBJ(val); G_CHILD_SET(self, rb_intern("fg_stipple"), val); return self; } */ static VALUE rg_rise(VALUE self) { return INT2NUM(_SELF(self)->rise); } static VALUE rg_set_rise(VALUE self, VALUE val) { _SELF(self)->rise = NUM2INT(val); return self; } static VALUE rg_underline(VALUE self) { return PANGOUNDERLINE2RVAL(_SELF(self)->underline); } static VALUE rg_set_underline(VALUE self, VALUE val) { _SELF(self)->underline = RVAL2PANGOUNDERLINE(val); return self; } static VALUE rg_strikethrough_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->strikethrough); } static VALUE rg_set_strikethrough(VALUE self, VALUE val) { _SELF(self)->strikethrough = RVAL2CBOOL(val); return self; } static VALUE rg_draw_bg_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->draw_bg); } static VALUE rg_set_draw_bg(VALUE self, VALUE val) { _SELF(self)->draw_bg = RVAL2CBOOL(val); return self; } static VALUE rg_inside_selection_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->inside_selection); } static VALUE rg_set_inside_selection(VALUE self, VALUE val) { _SELF(self)->inside_selection = RVAL2CBOOL(val); return self; } static VALUE rg_text_p(VALUE self) { return CBOOL2RVAL(_SELF(self)->is_text); } static VALUE rg_set_text(VALUE self, VALUE val) { _SELF(self)->is_text = RVAL2CBOOL(val); return self; } void Init_gtk_text_appearance(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TEXT_APPEARANCE, "TextAppearance", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(bg_color, 0); RG_DEF_METHOD(set_bg_color, 1); RG_DEF_METHOD(fg_color, 0); RG_DEF_METHOD(set_fg_color, 1); /* deprecated RG_DEF_METHOD(bg_stipple, 0); RG_DEF_METHOD(set_bg_stipple, 1); RG_DEF_METHOD(fg_stipple, 0); RG_DEF_METHOD(set_fg_stipple, 1); */ RG_DEF_METHOD(rise, 0); RG_DEF_METHOD(set_rise, 1); RG_DEF_METHOD(underline, 0); RG_DEF_METHOD(set_underline, 1); RG_DEF_METHOD_P(strikethrough, 0); RG_DEF_METHOD(set_strikethrough, 1); RG_DEF_METHOD_P(draw_bg, 0); RG_DEF_METHOD(set_draw_bg, 1); RG_DEF_METHOD_P(inside_selection, 0); RG_DEF_METHOD(set_inside_selection, 1); RG_DEF_METHOD_P(text, 0); RG_DEF_METHOD(set_text, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-spin-button.c���������������������������������������������0000644�0001750�0001750�00000007453�12102213527�020665� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cSpinButton #define _SELF(self) (RVAL2GTKSPINBUTTON(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2, arg3; GtkAdjustment *adj = NULL; gfloat climb_rate; gint digits; GtkWidget *widget; rb_scan_args(argc, argv, "03", &arg1, &arg2, &arg3); if (NIL_P(arg1) || RVAL2GTYPE(arg1) == GTK_TYPE_ADJUSTMENT){ if (!NIL_P(arg1)) adj = RVAL2GTKADJUSTMENT(arg1); climb_rate = (NIL_P(arg2))? 0.0: NUM2DBL(arg2); digits = (NIL_P(arg3))? 0: NUM2UINT(arg3); widget = gtk_spin_button_new(adj, climb_rate, digits); } else { widget = gtk_spin_button_new_with_range(NUM2DBL(arg1), NUM2DBL(arg2), NUM2DBL(arg3)); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_configure(VALUE self, VALUE adj, VALUE climb_rate, VALUE digits) { gtk_spin_button_configure(_SELF(self), RVAL2GTKADJUSTMENT(adj), NUM2DBL(climb_rate), NUM2UINT(digits)); return self; } static VALUE rg_set_increments(VALUE self, VALUE step, VALUE page) { gtk_spin_button_set_increments(_SELF(self), NUM2DBL(step), NUM2DBL(page)); return self; } static VALUE rg_set_range(VALUE self, VALUE min, VALUE max) { gtk_spin_button_set_range(_SELF(self), NUM2DBL(min), NUM2DBL(max)); return self; } static VALUE rg_value_as_int(VALUE self) { return INT2NUM(gtk_spin_button_get_value_as_int(_SELF(self))); } static VALUE rg_spin(VALUE self, VALUE direction, VALUE increment) { gtk_spin_button_spin(_SELF(self), RVAL2GTKSPINTYPE(direction), NUM2DBL(increment)); return self; } static VALUE rg_update(VALUE self) { gtk_spin_button_update(_SELF(self)); return self; } static VALUE rg_increments(VALUE self) { gdouble step, page; gtk_spin_button_get_increments(_SELF(self), &step, &page); return rb_ary_new3(2, rb_float_new(step), rb_float_new(page)); } static VALUE rg_range(VALUE self) { gdouble min, max; gtk_spin_button_get_range(_SELF(self), &min, &max); return rb_ary_new3(2, rb_float_new(min), rb_float_new(max)); } void Init_gtk_spin_button(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SPIN_BUTTON, "SpinButton", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(configure, 3); RG_DEF_METHOD(set_increments, 2); RG_DEF_METHOD(set_range, 2); RG_DEF_METHOD(value_as_int, 0); RG_DEF_METHOD(spin, 2); RG_DEF_METHOD(update, 0); RG_DEF_METHOD(increments, 0); RG_DEF_METHOD(range, 0); G_DEF_CLASS(GTK_TYPE_SPIN_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_SPIN_BUTTON_UPDATE_POLICY, "UpdatePolicy", RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-gdk-event.c�����������������������������������������������0000644�0001750�0001750�00000002277�12102213527�020266� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cEvent #define _SELF(self) (RVAL2GEV(self)) static VALUE rg_event_widget(VALUE self) { return GOBJ2RVAL(gtk_get_event_widget(_SELF(self))); } void Init_gtk_gdk_event(void) { VALUE RG_TARGET_NAMESPACE = GTYPE2CLASS(GDK_TYPE_EVENT); RG_DEF_METHOD(event_widget, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-paper-size.c����������������������������������������������0000644�0001750�0001750�00000013014�12102213527�020450� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cPaperSize #define _SELF(s) (RVAL2GTKPAPERSIZE(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GtkPaperSize *size; if (argc <= 1) { VALUE name; rb_scan_args(argc, argv, "01", &name); size = gtk_paper_size_new(RVAL2CSTR_ACCEPT_NIL(name)); } else if (argc == 4) { size = gtk_paper_size_new_from_ppd(RVAL2CSTR(argv[0]), RVAL2CSTR(argv[1]), NUM2DBL(argv[2]), NUM2DBL(argv[3])); } else if (argc == 5) { size = gtk_paper_size_new_custom(RVAL2CSTR(argv[0]), RVAL2CSTR(argv[1]), NUM2DBL(argv[2]), NUM2DBL(argv[3]), RVAL2GTKUNIT(argv[4])); } else { rb_raise(rb_eArgError, "wrong number of arguments (%d for 0, 1, 4 or 5)", argc); } G_INITIALIZE(self, size); return Qnil; } static VALUE rg_operator_equal(VALUE self, VALUE other) { return CBOOL2RVAL(RVAL2CBOOL(rb_equal(rb_obj_class(self), rb_obj_class(other))) && gtk_paper_size_is_equal(_SELF(self), _SELF(other))); } /* The width is always the shortest side, measure in mm */ static VALUE rg_name(VALUE self) { return CSTR2RVAL(gtk_paper_size_get_name(_SELF(self))); } static VALUE rg_display_name(VALUE self) { return CSTR2RVAL(gtk_paper_size_get_display_name(_SELF(self))); } static VALUE rg_ppd_name(VALUE self) { return CSTR2RVAL(gtk_paper_size_get_ppd_name(_SELF(self))); } static VALUE rg_get_width(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_width(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_get_height(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_height(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_custom_p(VALUE self) { return CBOOL2RVAL(gtk_paper_size_is_custom(_SELF(self))); } /* Only for custom sizes: */ static VALUE rg_set_size(VALUE self, VALUE width, VALUE height, VALUE unit) { gtk_paper_size_set_size(_SELF(self), NUM2DBL(width), NUM2DBL(height), RVAL2GTKUNIT(unit)); return self; } static VALUE rg_get_default_top_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_default_top_margin(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_get_default_bottom_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_default_bottom_margin(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_get_default_left_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_default_left_margin(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_get_default_right_margin(VALUE self, VALUE unit) { return rb_float_new(gtk_paper_size_get_default_right_margin(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gtk_paper_size_get_default()); } void Init_gtk_paper_size(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PAPER_SIZE, "PaperSize", mGtk); RG_DEF_SMETHOD(default, 0); rb_define_const(RG_TARGET_NAMESPACE, "A3", CSTR2RVAL(GTK_PAPER_NAME_A3)); rb_define_const(RG_TARGET_NAMESPACE, "A4", CSTR2RVAL(GTK_PAPER_NAME_A4)); rb_define_const(RG_TARGET_NAMESPACE, "A5", CSTR2RVAL(GTK_PAPER_NAME_A5)); rb_define_const(RG_TARGET_NAMESPACE, "B5", CSTR2RVAL(GTK_PAPER_NAME_B5)); rb_define_const(RG_TARGET_NAMESPACE, "LETTER", CSTR2RVAL(GTK_PAPER_NAME_LETTER)); rb_define_const(RG_TARGET_NAMESPACE, "EXECUTIVE", CSTR2RVAL(GTK_PAPER_NAME_EXECUTIVE)); rb_define_const(RG_TARGET_NAMESPACE, "LEGAL", CSTR2RVAL(GTK_PAPER_NAME_LEGAL)); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD_OPERATOR("==", equal, 1); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(display_name, 0); RG_DEF_METHOD(ppd_name, 0); RG_DEF_METHOD(get_width, 1); RG_DEF_METHOD(get_height, 1); RG_DEF_METHOD_P(custom, 0); RG_DEF_METHOD(set_size, 3); RG_DEF_METHOD(get_default_top_margin, 1); RG_DEF_METHOD(get_default_bottom_margin, 1); RG_DEF_METHOD(get_default_left_margin, 1); RG_DEF_METHOD(get_default_right_margin, 1); G_DEF_CLASS(GTK_TYPE_UNIT, "Unit", RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-model.c����������������������������������������������0000644�0001750�0001750�00000015747�12137115065�020453� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mTreeModel #define _SELF(s) (RVAL2GTKTREEMODEL(s)) static VALUE rg_flags(VALUE self) { return GTKTREEMODELFLAGS2RVAL(gtk_tree_model_get_flags(_SELF(self))); } static VALUE rg_n_columns(VALUE self) { return INT2NUM(gtk_tree_model_get_n_columns(_SELF(self))); } static VALUE rg_get_column_type(VALUE self, VALUE index) { return GTYPE2CLASS(gtk_tree_model_get_column_type(_SELF(self), NUM2INT(index))); } static VALUE rg_iter_first(VALUE self) { VALUE val = Qnil; GtkTreeIter iter; GtkTreeModel* model = _SELF(self); gboolean ret = (gtk_tree_model_get_iter_first(model, &iter)); iter.user_data3 = model; if (ret) { val = GTKTREEITER2RVAL(&iter); } return val; } static VALUE rg_get_iter(VALUE self, VALUE path) { VALUE val = Qnil; GtkTreeIter iter; gboolean ret; GtkTreeModel* model = _SELF(self); if (TYPE(path) == T_STRING){ ret = gtk_tree_model_get_iter_from_string(model, &iter, RVAL2CSTR(path)); } else { ret = gtk_tree_model_get_iter(model, &iter, RVAL2GTKTREEPATH(path)); } iter.user_data3 = model; if (ret) { val = GTKTREEITER2RVAL(&iter); } return val; } static VALUE rg_get_path(VALUE self, VALUE iter) { GtkTreePath *path; VALUE rb_path; path = gtk_tree_model_get_path(_SELF(self), RVAL2GTKTREEITER(iter)); rb_path = GTKTREEPATH2RVAL(path); gtk_tree_path_free(path); return rb_path; } static VALUE rg_get_value(VALUE self, VALUE iter, VALUE column) { GValue value = G_VALUE_INIT; VALUE ret = Qnil; gtk_tree_model_get_value(_SELF(self), RVAL2GTKTREEITER(iter), NUM2INT(column), &value); if (G_VALUE_TYPE(&value) != G_TYPE_INVALID){ ret = GVAL2RVAL(&value); g_value_unset(&value); } return ret; } static gboolean treemodel_foreach_func(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, G_GNUC_UNUSED gpointer func) { iter->user_data3 = model; rb_yield(rb_ary_new3(3, GOBJ2RVAL(model), GTKTREEPATH2RVAL(path), GTKTREEITER2RVAL(iter))); return FALSE; } static VALUE rg_each(VALUE self) { gtk_tree_model_foreach(_SELF(self), (GtkTreeModelForeachFunc)treemodel_foreach_func, (gpointer)NULL); return self; } static VALUE rg_row_changed(VALUE self, VALUE path, VALUE iter) { gtk_tree_model_row_changed(_SELF(self), RVAL2GTKTREEPATH(path), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_row_inserted(VALUE self, VALUE path, VALUE iter) { gtk_tree_model_row_inserted(_SELF(self), RVAL2GTKTREEPATH(path), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_row_has_child_toggled(VALUE self, VALUE path, VALUE iter) { gtk_tree_model_row_has_child_toggled(_SELF(self), RVAL2GTKTREEPATH(path), RVAL2GTKTREEITER(iter)); return self; } static VALUE rg_row_deleted(VALUE self, VALUE path) { gtk_tree_model_row_deleted(_SELF(self), RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_rows_reordered(VALUE self, VALUE rbpath, VALUE rbiter, VALUE rbnew_order) { GtkTreeModel *proxy = _SELF(self); GtkTreePath *path = RVAL2GTKTREEPATH(rbpath); GtkTreeIter *iter = RVAL2GTKTREEITER(rbiter); gint columns = gtk_tree_model_get_n_columns(proxy); long n; gint *new_order = RVAL2GINTS(rbnew_order, n); if (n != columns) { g_free(new_order); rb_raise(rb_eArgError, "new order array must contain same number of elements as the number of columns in the store: %ld != %d", n, columns); } gtk_tree_model_rows_reordered(proxy, path, iter, new_order); g_free(new_order); return self; } static VALUE rg_iter_is_valid_p(G_GNUC_UNUSED VALUE self, G_GNUC_UNUSED VALUE iter) { return Qtrue; } static VALUE signal_func(G_GNUC_UNUSED guint num, const GValue *values) { GtkTreeModel* model = g_value_get_object(&values[0]); GtkTreePath* path = g_value_get_boxed(&values[1]); GtkTreeIter* iter = g_value_get_boxed(&values[2]); iter->user_data3 = model; return rb_ary_new3(3, GOBJ2RVAL(model), GTKTREEPATH2RVAL(path), GTKTREEITER2RVAL(iter)); } static VALUE signal_rows_reordered_func(G_GNUC_UNUSED guint num, const GValue *values) { GtkTreeModel* model = g_value_get_object(&values[0]); GtkTreePath* path = g_value_get_boxed(&values[1]); GtkTreeIter* iter = g_value_get_boxed(&values[2]); gint* new_orders = (gint*)g_value_get_pointer(&values[3]); gint len = gtk_tree_model_iter_n_children(model, iter); VALUE orders = Qnil; int i; iter->user_data3 = model; orders = rb_ary_new2(len); for (i = 0; i < len; i++, new_orders++) { rb_ary_push(orders, INT2NUM(*new_orders)); } return rb_ary_new3(4, GOBJ2RVAL(model), GTKTREEPATH2RVAL(path), GTKTREEITER2RVAL(iter), orders); } void Init_gtk_treemodel(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_TREE_MODEL, "TreeModel", mGtk); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(n_columns, 0); RG_DEF_METHOD(get_column_type, 1); RG_DEF_METHOD(iter_first, 0); RG_DEF_METHOD(get_iter, 1); RG_DEF_METHOD(get_path, 1); RG_DEF_METHOD(get_value, 2); RG_DEF_METHOD(each, 0); RG_DEF_METHOD(row_changed, 2); RG_DEF_METHOD(row_inserted, 2); RG_DEF_METHOD(row_has_child_toggled, 2); RG_DEF_METHOD(row_deleted, 1); RG_DEF_METHOD(rows_reordered, 3); RG_DEF_METHOD_P(iter_is_valid, 1); G_DEF_CLASS(GTK_TYPE_TREE_MODEL_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row_changed", (GValToRValSignalFunc)signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row_inserted", (GValToRValSignalFunc)signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "row_has_child_toggled", (GValToRValSignalFunc)signal_func); G_DEF_SIGNAL_FUNC(RG_TARGET_NAMESPACE, "rows_reordered", (GValToRValSignalFunc)signal_rows_reordered_func); } �������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-accelerator.c���������������������������������������������0000644�0001750�0001750�00000004612�12102213526�020660� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mAccelerator static VALUE rg_s_valid(G_GNUC_UNUSED VALUE self, VALUE keyval, VALUE modifiers) { return CBOOL2RVAL(gtk_accelerator_valid(NUM2UINT(keyval), RVAL2GDKMODIFIERTYPE(modifiers))); } static VALUE rg_s_parse(G_GNUC_UNUSED VALUE self, VALUE accelerator) { guint key; GdkModifierType mods; gtk_accelerator_parse(RVAL2CSTR(accelerator), &key, &mods); return rb_ary_new3(2, UINT2NUM(key), GDKMODIFIERTYPE2RVAL(mods)); } static VALUE rg_s_to_name(G_GNUC_UNUSED VALUE self, VALUE key, VALUE mods) { return CSTR2RVAL(gtk_accelerator_name(NUM2UINT(key), RVAL2GDKMODIFIERTYPE(mods))); } static VALUE rg_s_get_label(G_GNUC_UNUSED VALUE self, VALUE key, VALUE mods) { return CSTR2RVAL(gtk_accelerator_get_label(NUM2UINT(key), RVAL2GDKMODIFIERTYPE(mods))); } static VALUE rg_s_set_default_mod_mask(VALUE self, VALUE default_mod_mask) { gtk_accelerator_set_default_mod_mask(RVAL2GDKMODIFIERTYPE(default_mod_mask)); return self; } static VALUE rg_s_default_mod_mask(G_GNUC_UNUSED VALUE self) { return GDKMODIFIERTYPE2RVAL(gtk_accelerator_get_default_mod_mask()); } void Init_gtk_accelerator(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "Accelerator"); RG_DEF_SMETHOD(valid, 2); RG_DEF_SMETHOD(parse, 1); /* name is reserved by Ruby */ RG_DEF_SMETHOD(to_name, 2); RG_DEF_SMETHOD(get_label, 2); RG_DEF_SMETHOD(set_default_mod_mask, 1); RG_DEF_SMETHOD(default_mod_mask, 0); } ����������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-expander.c������������������������������������������������0000644�0001750�0001750�00000003127�12102213527�020203� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cExpander #define _SELF(self) (RVAL2GTKEXPANDER(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE label, with_mnemonic; GtkWidget* widget = NULL; rb_scan_args(argc, argv, "11", &label, &with_mnemonic); if (NIL_P(with_mnemonic) || ! RVAL2CBOOL(with_mnemonic)){ widget = gtk_expander_new(RVAL2CSTR(label)); } else { widget = gtk_expander_new_with_mnemonic(RVAL2CSTR(label)); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_expander(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_EXPANDER, "Expander", mGtk); RG_DEF_METHOD(initialize, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-menubar.c�������������������������������������������������0000644�0001750�0001750�00000002701�12102213527�020023� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cMenuBar static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_menu_bar_new()); return Qnil; } void Init_gtk_menu_bar(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU_BAR, "MenuBar", mGtk); RG_DEF_METHOD(initialize, 0); G_DEF_CLASS(GTK_TYPE_PACK_DIRECTION, "PackDirection", RG_TARGET_NAMESPACE); } ���������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-print-settings.c������������������������������������������0000644�0001750�0001750�00000054274�12102213527�021400� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cPrintSettings #define _SELF(s) (RVAL2GTKPRINTSETTINGS(s)) static VALUE s_string, s_bool, s_double, s_length, s_int; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2; GtkPrintSettings* settings = NULL; GError *error = NULL; rb_scan_args(argc, argv, "02", &arg1, &arg2); if (NIL_P(arg1)){ settings = gtk_print_settings_new(); } else if (NIL_P(arg2)){ settings = gtk_print_settings_new_from_file(RVAL2CSTR(arg1), &error); if (!settings) { RAISE_GERROR(error); } } else { settings = gtk_print_settings_new_from_key_file(RVAL2GKEYFILE(arg1), RVAL2CSTR(arg2), &error); if (!settings) { RAISE_GERROR(error); } } G_INITIALIZE(self, settings); return Qnil; } static VALUE rg_dup(VALUE self) { return GOBJ2RVALU(gtk_print_settings_copy(_SELF(self))); } static VALUE rg_has_key_p(VALUE self, VALUE key) { return CBOOL2RVAL(gtk_print_settings_has_key(_SELF(self), RVAL2CSTR(key))); } static VALUE ps_get(VALUE self, VALUE key) { return CSTR2RVAL(gtk_print_settings_get(_SELF(self), RVAL2CSTR(key))); } static VALUE ps_set(VALUE self, VALUE key, VALUE value) { gtk_print_settings_set(_SELF(self), RVAL2CSTR(key), RVAL2CSTR_ACCEPT_NIL(value)); return self; } static VALUE rg_unset(VALUE self, VALUE key) { gtk_print_settings_unset(_SELF(self), RVAL2CSTR(key)); return self; } static void ps_foreach_cb(const gchar *key, const gchar *value, gpointer data) { rb_funcall((VALUE)data, id_call, 2, CSTR2RVAL(key), CSTR2RVAL(value)); } static VALUE rg_each(VALUE self) { gtk_print_settings_foreach(_SELF(self), ps_foreach_cb, (gpointer)rb_block_proc()); return self; } static VALUE rg_get_bool(VALUE self, VALUE key) { return CBOOL2RVAL(gtk_print_settings_get_bool(_SELF(self), RVAL2CSTR(key))); } static VALUE ps_set_bool(VALUE self, VALUE key, VALUE value) { gtk_print_settings_set_bool(_SELF(self), RVAL2CSTR(key), RVAL2CBOOL(value)); return self; } static VALUE rg_get_double(int argc, VALUE *argv, VALUE self) { VALUE key, default_value; gdouble value; rb_scan_args(argc, argv, "11", &key, &default_value); if (NIL_P(default_value)) value = gtk_print_settings_get_double(_SELF(self), RVAL2CSTR(key)); else value = gtk_print_settings_get_double_with_default(_SELF(self), RVAL2CSTR(key), NUM2DBL(default_value)); return rb_float_new(value); } static VALUE ps_set_double(VALUE self, VALUE key, VALUE value) { gtk_print_settings_set_double(_SELF(self), RVAL2CSTR(key), NUM2DBL(value)); return self; } static VALUE rg_get_length(VALUE self, VALUE key, VALUE unit) { return rb_float_new(gtk_print_settings_get_length(_SELF(self), RVAL2CSTR(key), RVAL2GTKUNIT(unit))); } static VALUE ps_set_length(VALUE self, VALUE key, VALUE value, VALUE unit) { gtk_print_settings_set_length(_SELF(self), RVAL2CSTR(key), NUM2DBL(value), RVAL2GTKUNIT(unit)); return self; } static VALUE rg_get_int(int argc, VALUE *argv, VALUE self) { VALUE key, default_value; gint value; rb_scan_args(argc, argv, "11", &key, &default_value); if (NIL_P(default_value)) value = gtk_print_settings_get_int(_SELF(self), RVAL2CSTR(key)); else value = gtk_print_settings_get_int_with_default(_SELF(self), RVAL2CSTR(key), NUM2INT(default_value)); return INT2NUM(value); } static VALUE ps_set_int(VALUE self, VALUE key, VALUE value) { gtk_print_settings_set_int(_SELF(self), RVAL2CSTR(key), NUM2INT(value)); return self; } static VALUE rg_get(int argc, VALUE *argv, VALUE self) { VALUE key, type, unit_or_default, result; rb_scan_args(argc, argv, "12", &key, &type, &unit_or_default); if (NIL_P(type) || (RVAL2CBOOL(rb_equal(type, s_string)))) { result = ps_get(self, key); } else if (RVAL2CBOOL(rb_equal(type, s_bool))) { result = rg_get_bool(self, key); } else if (RVAL2CBOOL(rb_equal(type, s_double))) { VALUE double_argv[2]; double_argv[0] = key; double_argv[1] = unit_or_default; result = rg_get_double(2, double_argv, self); } else if (RVAL2CBOOL(rb_equal(type, s_length))) { result = rg_get_length(self, key, unit_or_default); } else if (RVAL2CBOOL(rb_equal(type, s_int))) { VALUE int_argv[2]; int_argv[0] = key; int_argv[1] = unit_or_default; result = rg_get_int(2, int_argv, self); } else { VALUE inspected_type; inspected_type = rb_inspect(type); rb_raise(rb_eArgError, "%s must be nil, :string, :bool, :double, :length or :int", RVAL2CSTR(inspected_type)); } return result; } static VALUE rg_set(int argc, VALUE *argv, VALUE self) { VALUE key, value, unit; rb_scan_args(argc, argv, "21", &key, &value, &unit); switch (TYPE(value)) { case T_STRING: ps_set(self, key, value); break; case T_TRUE: case T_FALSE: ps_set_bool(self, key, value); break; case T_FIXNUM: ps_set_int(self, key, value); break; case T_FLOAT: if (NIL_P(unit)) { ps_set_double(self, key, value); } else { ps_set_length(self, key, value, unit); } break; case T_NIL: rg_unset(self, key); break; default: { VALUE inspected_value; inspected_value = rb_inspect(value); rb_raise(rb_eArgError, "%s is invalid value", RVAL2CSTR(inspected_value)); break; } } return self; } static VALUE rg_operator_ps_set_generic_indexer(int argc, VALUE *argv, VALUE self) { if (argc == 3) { VALUE swapped_argv[3]; swapped_argv[0] = argv[0]; swapped_argv[1] = argv[2]; swapped_argv[2] = argv[1]; rg_set(argc, swapped_argv, self); } else if (argc == 2) { rg_set(argc, argv, self); } else { rb_raise(rb_eArgError, "wrong number of arguments (%d for 2 or 3)", argc); } return argv[2]; } /* Helpers: */ static VALUE rg_printer(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_printer(_SELF(self))); } static VALUE rg_set_printer(VALUE self, VALUE printer) { gtk_print_settings_set_printer(_SELF(self), RVAL2CSTR_ACCEPT_NIL(printer)); return self; } static VALUE rg_orientation(VALUE self) { return GTKPAGEORIENTATION2RVAL(gtk_print_settings_get_orientation(_SELF(self))); } static VALUE rg_set_orientation(VALUE self, VALUE orientation) { gtk_print_settings_set_orientation(_SELF(self), RVAL2GTKPAGEORIENTATION(orientation)); return self; } static VALUE rg_paper_size(VALUE self) { return GOBJ2RVAL(gtk_print_settings_get_paper_size(_SELF(self))); } static VALUE rg_set_paper_size(VALUE self, VALUE paper_size) { gtk_print_settings_set_paper_size(_SELF(self), RVAL2GTKPAPERSIZE(paper_size)); return self; } static VALUE rg_paper_width(VALUE self, VALUE unit) { return rb_float_new(gtk_print_settings_get_paper_width(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_set_paper_width(VALUE self, VALUE paper_width, VALUE unit) { gtk_print_settings_set_paper_width(_SELF(self), NUM2DBL(paper_width), RVAL2GTKUNIT(unit)); return self; } static VALUE rg_paper_height(VALUE self, VALUE unit) { return rb_float_new(gtk_print_settings_get_paper_height(_SELF(self), RVAL2GTKUNIT(unit))); } static VALUE rg_set_paper_height(VALUE self, VALUE paper_height, VALUE unit) { gtk_print_settings_set_paper_height(_SELF(self), NUM2DBL(paper_height), RVAL2GTKUNIT(unit)); return self; } static VALUE rg_use_color_p(VALUE self) { return CBOOL2RVAL(gtk_print_settings_get_use_color(_SELF(self))); } static VALUE rg_set_use_color(VALUE self, VALUE use_color) { gtk_print_settings_set_use_color(_SELF(self), RVAL2CBOOL(use_color)); return self; } static VALUE rg_collate_p(VALUE self) { return CBOOL2RVAL(gtk_print_settings_get_collate(_SELF(self))); } static VALUE rg_set_collate(VALUE self, VALUE collate) { gtk_print_settings_set_collate(_SELF(self), RVAL2CBOOL(collate)); return self; } static VALUE rg_reverse_p(VALUE self) { return CBOOL2RVAL(gtk_print_settings_get_reverse(_SELF(self))); } static VALUE rg_set_reverse(VALUE self, VALUE reverse) { gtk_print_settings_set_reverse(_SELF(self), RVAL2CBOOL(reverse)); return self; } static VALUE rg_duplex(VALUE self) { return GTKPRINTDUPLEX2RVAL(gtk_print_settings_get_duplex(_SELF(self))); } static VALUE rg_set_duplex(VALUE self, VALUE duplex) { gtk_print_settings_set_duplex(_SELF(self), RVAL2GTKPRINTDUPLEX(duplex)); return self; } static VALUE rg_quality(VALUE self) { return GTKPRINTQUALITY2RVAL(gtk_print_settings_get_quality(_SELF(self))); } static VALUE rg_set_quality(VALUE self, VALUE quality) { gtk_print_settings_set_quality(_SELF(self), RVAL2GTKPRINTQUALITY(quality)); return self; } static VALUE rg_n_copies(VALUE self) { return INT2NUM(gtk_print_settings_get_n_copies(_SELF(self))); } static VALUE rg_set_n_copies(VALUE self, VALUE n_copies) { gtk_print_settings_set_n_copies(_SELF(self), NUM2INT(n_copies)); return self; } static VALUE rg_number_up(VALUE self) { return INT2NUM(gtk_print_settings_get_number_up(_SELF(self))); } static VALUE rg_set_number_up(VALUE self, VALUE number_up) { gtk_print_settings_set_number_up(_SELF(self), NUM2INT(number_up)); return self; } static VALUE rg_resolution(VALUE self) { return INT2NUM(gtk_print_settings_get_resolution(_SELF(self))); } static VALUE rg_set_resolution(VALUE self, VALUE resolution) { gtk_print_settings_set_resolution(_SELF(self), NUM2INT(resolution)); return self; } static VALUE rg_scale(VALUE self) { return rb_float_new(gtk_print_settings_get_scale(_SELF(self))); } static VALUE rg_set_scale(VALUE self, VALUE scale) { gtk_print_settings_set_scale(_SELF(self), NUM2DBL(scale)); return self; } static VALUE rg_print_pages(VALUE self) { return GTKPRINTPAGES2RVAL(gtk_print_settings_get_print_pages(_SELF(self))); } static VALUE rg_set_print_pages(VALUE self, VALUE print_pages) { gtk_print_settings_set_print_pages(_SELF(self), RVAL2GTKPRINTPAGES(print_pages)); return self; } static VALUE rg_page_ranges(VALUE self) { VALUE rb_ranges; GtkPageRange *ranges; int i, num_ranges; ranges = gtk_print_settings_get_page_ranges(_SELF(self), &num_ranges); rb_ranges = rb_ary_new2(num_ranges); for (i = 0; i < num_ranges; i++) { rb_ary_push(rb_ranges, rb_ary_new3(2, INT2NUM(ranges[i].start), INT2NUM(ranges[i].end))); } g_free(ranges); return rb_ranges; } struct rbgtk_rval2gtkpageranges_args { VALUE ary; long n; GtkPageRange *result; }; static VALUE rbgtk_rval2gtkpageranges_body(VALUE value) { long i; struct rbgtk_rval2gtkpageranges_args *args = (struct rbgtk_rval2gtkpageranges_args *)value; for (i = 0; i < args->n; i++) { VALUE ary = rb_ary_to_ary(RARRAY_PTR(args->ary)[i]); if (RARRAY_LEN(ary) != 2) rb_raise(rb_eArgError, "range %ld should be array of size 2", i); args->result[i].start = NUM2INT(RARRAY_PTR(ary)[0]); args->result[i].end = NUM2INT(RARRAY_PTR(ary)[1]); } return Qnil; } static G_GNUC_NORETURN VALUE rbgtk_rval2gtkpageranges_rescue(VALUE value) { g_free(((struct rbgtk_rval2gtkpageranges_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GtkPageRange * rbgtk_rval2gtkpageranges(VALUE value, long *n) { struct rbgtk_rval2gtkpageranges_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GtkPageRange, args.n + 1); rb_rescue(rbgtk_rval2gtkpageranges_body, (VALUE)&args, rbgtk_rval2gtkpageranges_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } #define RVAL2GTKPAGERANGES(value, n) rbgtk_rval2gtkpageranges(value, n) static VALUE rg_set_page_ranges(VALUE self, VALUE rbpage_ranges) { GtkPrintSettings *settings = _SELF(self); long n; GtkPageRange *page_ranges = RVAL2GTKPAGERANGES(rbpage_ranges, &n); gtk_print_settings_set_page_ranges(settings, page_ranges, n); g_free(page_ranges); return self; } static VALUE rg_page_set(VALUE self) { return GTKPAGESET2RVAL(gtk_print_settings_get_page_set(_SELF(self))); } static VALUE rg_set_page_set(VALUE self, VALUE page_set) { gtk_print_settings_set_page_set(_SELF(self), RVAL2GTKPAGESET(page_set)); return self; } static VALUE rg_default_source(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_default_source(_SELF(self))); } static VALUE rg_set_default_source(VALUE self, VALUE default_source) { gtk_print_settings_set_default_source(_SELF(self), RVAL2CSTR_ACCEPT_NIL(default_source)); return self; } static VALUE rg_media_type(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_media_type(_SELF(self))); } static VALUE rg_set_media_type(VALUE self, VALUE media_type) { gtk_print_settings_set_media_type(_SELF(self), RVAL2CSTR_ACCEPT_NIL(media_type)); return self; } static VALUE rg_dither(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_dither(_SELF(self))); } static VALUE rg_set_dither(VALUE self, VALUE dither) { gtk_print_settings_set_dither(_SELF(self), RVAL2CSTR_ACCEPT_NIL(dither)); return self; } static VALUE rg_finishings(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_finishings(_SELF(self))); } static VALUE rg_set_finishings(VALUE self, VALUE finishings) { gtk_print_settings_set_finishings(_SELF(self), RVAL2CSTR_ACCEPT_NIL(finishings)); return self; } static VALUE rg_output_bin(VALUE self) { return CSTR2RVAL(gtk_print_settings_get_output_bin(_SELF(self))); } static VALUE rg_set_output_bin(VALUE self, VALUE output_bin) { gtk_print_settings_set_output_bin(_SELF(self), RVAL2CSTR_ACCEPT_NIL(output_bin)); return self; } static VALUE rg_to_file(VALUE self, VALUE file_name) { GError *error = NULL; if (!gtk_print_settings_to_file(_SELF(self), RVAL2CSTR(file_name), &error)) { RAISE_GERROR(error); } return self; } static VALUE rg_to_key_file(int argc, VALUE *argv, VALUE self) { VALUE key_file, group_name; rb_scan_args(argc, argv, "11", &key_file, &group_name); gtk_print_settings_to_key_file(_SELF(self), RVAL2GKEYFILE(key_file), RVAL2CSTR_ACCEPT_NIL(group_name)); return self; } void Init_gtk_print_settings(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE; s_string = ID2SYM(rb_intern("string")); s_bool = ID2SYM(rb_intern("bool")); s_double = ID2SYM(rb_intern("double")); s_length = ID2SYM(rb_intern("length")); s_int = ID2SYM(rb_intern("int")); RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_SETTINGS, "PrintSettings", mGtk); rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(dup, 0); RG_DEF_METHOD_P(has_key, 1); RG_DEF_METHOD(get, -1); RG_DEF_ALIAS("[]", "get"); RG_DEF_METHOD(get_bool, 1); RG_DEF_METHOD(get_double, -1); RG_DEF_METHOD(get_length, 2); RG_DEF_METHOD(get_int, -1); RG_DEF_METHOD(set, -1); RG_DEF_METHOD_OPERATOR("[]=", ps_set_generic_indexer, -1); RG_DEF_METHOD(unset, -1); RG_DEF_ALIAS("delete", "unset"); RG_DEF_METHOD(each, 0); rb_define_const(RG_TARGET_NAMESPACE, "PRINTER", CSTR2RVAL(GTK_PRINT_SETTINGS_PRINTER)); rb_define_const(RG_TARGET_NAMESPACE, "ORIENTATION", CSTR2RVAL(GTK_PRINT_SETTINGS_ORIENTATION)); rb_define_const(RG_TARGET_NAMESPACE, "PAPER_FORMAT", CSTR2RVAL(GTK_PRINT_SETTINGS_PAPER_FORMAT)); rb_define_const(RG_TARGET_NAMESPACE, "PAPER_WIDTH", CSTR2RVAL(GTK_PRINT_SETTINGS_PAPER_WIDTH)); rb_define_const(RG_TARGET_NAMESPACE, "PAPER_HEIGHT", CSTR2RVAL(GTK_PRINT_SETTINGS_PAPER_HEIGHT)); rb_define_const(RG_TARGET_NAMESPACE, "N_COPIES", CSTR2RVAL(GTK_PRINT_SETTINGS_N_COPIES)); rb_define_const(RG_TARGET_NAMESPACE, "DEFAULT_SOURCE", CSTR2RVAL(GTK_PRINT_SETTINGS_DEFAULT_SOURCE)); rb_define_const(RG_TARGET_NAMESPACE, "QUALITY", CSTR2RVAL(GTK_PRINT_SETTINGS_QUALITY)); rb_define_const(RG_TARGET_NAMESPACE, "RESOLUTION", CSTR2RVAL(GTK_PRINT_SETTINGS_RESOLUTION)); rb_define_const(RG_TARGET_NAMESPACE, "USE_COLOR", CSTR2RVAL(GTK_PRINT_SETTINGS_USE_COLOR)); rb_define_const(RG_TARGET_NAMESPACE, "DUPLEX", CSTR2RVAL(GTK_PRINT_SETTINGS_DUPLEX)); rb_define_const(RG_TARGET_NAMESPACE, "COLLATE", CSTR2RVAL(GTK_PRINT_SETTINGS_COLLATE)); rb_define_const(RG_TARGET_NAMESPACE, "REVERSE", CSTR2RVAL(GTK_PRINT_SETTINGS_REVERSE)); rb_define_const(RG_TARGET_NAMESPACE, "MEDIA_TYPE", CSTR2RVAL(GTK_PRINT_SETTINGS_MEDIA_TYPE)); rb_define_const(RG_TARGET_NAMESPACE, "DITHER", CSTR2RVAL(GTK_PRINT_SETTINGS_DITHER)); rb_define_const(RG_TARGET_NAMESPACE, "SCALE", CSTR2RVAL(GTK_PRINT_SETTINGS_SCALE)); rb_define_const(RG_TARGET_NAMESPACE, "PRINT_PAGES", CSTR2RVAL(GTK_PRINT_SETTINGS_PRINT_PAGES)); rb_define_const(RG_TARGET_NAMESPACE, "PAGE_RANGES", CSTR2RVAL(GTK_PRINT_SETTINGS_PAGE_RANGES)); rb_define_const(RG_TARGET_NAMESPACE, "PAGE_SET", CSTR2RVAL(GTK_PRINT_SETTINGS_PAGE_SET)); rb_define_const(RG_TARGET_NAMESPACE, "FINISHINGS", CSTR2RVAL(GTK_PRINT_SETTINGS_FINISHINGS)); rb_define_const(RG_TARGET_NAMESPACE, "NUMBER_UP", CSTR2RVAL(GTK_PRINT_SETTINGS_NUMBER_UP)); rb_define_const(RG_TARGET_NAMESPACE, "OUTPUT_BIN", CSTR2RVAL(GTK_PRINT_SETTINGS_OUTPUT_BIN)); rb_define_const(RG_TARGET_NAMESPACE, "OUTPUT_FILE_FORMAT", CSTR2RVAL(GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT)); rb_define_const(RG_TARGET_NAMESPACE, "OUTPUT_URI", CSTR2RVAL(GTK_PRINT_SETTINGS_OUTPUT_URI)); rb_define_const(RG_TARGET_NAMESPACE, "WIN32_DRIVER_VERSION", CSTR2RVAL(GTK_PRINT_SETTINGS_WIN32_DRIVER_VERSION)); rb_define_const(RG_TARGET_NAMESPACE, "WIN32_DRIVER_EXTRA", CSTR2RVAL(GTK_PRINT_SETTINGS_WIN32_DRIVER_EXTRA)); /* Helpers: */ RG_DEF_METHOD(printer, 0); RG_DEF_METHOD(set_printer, 1); RG_DEF_METHOD(orientation, 0); RG_DEF_METHOD(set_orientation, 1); RG_DEF_METHOD(paper_size, 0); RG_DEF_METHOD(set_paper_size, 1); RG_DEF_METHOD(paper_width, 1); RG_DEF_METHOD(set_paper_width, 2); RG_DEF_METHOD(paper_height, 1); RG_DEF_METHOD(set_paper_height, 2); RG_DEF_METHOD_P(use_color, 0); RG_DEF_METHOD(set_use_color, 1); RG_DEF_METHOD_P(collate, 0); RG_DEF_METHOD(set_collate, 1); RG_DEF_METHOD_P(reverse, 0); RG_DEF_METHOD(set_reverse, 1); RG_DEF_METHOD(duplex, 0); RG_DEF_METHOD(set_duplex, 1); RG_DEF_METHOD(quality, 0); RG_DEF_METHOD(set_quality, 1); RG_DEF_METHOD(n_copies, 0); RG_DEF_METHOD(set_n_copies, 1); RG_DEF_METHOD(number_up, 0); RG_DEF_METHOD(set_number_up, 1); RG_DEF_METHOD(resolution, 0); RG_DEF_METHOD(set_resolution, 1); RG_DEF_METHOD(scale, 0); RG_DEF_METHOD(set_scale, 1); RG_DEF_METHOD(print_pages, 0); RG_DEF_METHOD(set_print_pages, 1); RG_DEF_METHOD(page_ranges, 0); RG_DEF_METHOD(set_page_ranges, 1); RG_DEF_METHOD(page_set, 0); RG_DEF_METHOD(set_page_set, 1); RG_DEF_METHOD(default_source, 0); RG_DEF_METHOD(set_default_source, 1); RG_DEF_METHOD(media_type, 0); RG_DEF_METHOD(set_media_type, 1); RG_DEF_METHOD(dither, 0); RG_DEF_METHOD(set_dither, 1); RG_DEF_METHOD(finishings, 0); RG_DEF_METHOD(set_finishings, 1); RG_DEF_METHOD(output_bin, 0); RG_DEF_METHOD(set_output_bin, 1); RG_DEF_METHOD(to_file, 1); RG_DEF_METHOD(to_key_file, -1); G_DEF_CLASS(GTK_TYPE_PAGE_ORIENTATION, "PageOrientation", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_PRINT_DUPLEX, "PrintDuplex", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_PRINT_QUALITY, "PrintQuality", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_PRINT_PAGES, "PrintPages", RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_PAGE_SET, "PageSet", RG_TARGET_NAMESPACE); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-overlay.c�������������������������������������������������0000644�0001750�0001750�00000002734�12102213527�020061� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cOverlay #define _SELF(self) (RVAL2GTKOVERLAY(self)) #if GTK_CHECK_VERSION(3, 2, 0) static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_overlay_new()); return Qnil; } static VALUE rg_add_overlay(VALUE self, VALUE widget) { gtk_overlay_add_overlay(_SELF(self), RVAL2GTKWIDGET(widget)); return self; } #endif void Init_gtk_overlay(VALUE mGtk) { #if GTK_CHECK_VERSION(3, 2, 0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_OVERLAY, "Overlay", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add_overlay, 1); #endif } ������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/depend����������������������������������������������������������0000644�0001750�0001750�00000000504�12064346475�016320� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install-so: install-headers install-headers: $(INSTALL_DATA) $(srcdir)/rbgtk3.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgtk3conversions.h $(RUBYARCHDIR) install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-gtk3.pc $(pkgconfigdir); \ fi ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-scrollable.c����������������������������������������������0000644�0001750�0001750�00000002255�12102213527�020520� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mScrollable #define _SELF(self) (RVAL2GTKSCROLLABLE(self)) void Init_gtk_scrollable(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_SCROLLABLE, "Scrollable", mGtk); G_DEF_CLASS(GTK_TYPE_SCROLLABLE_POLICY, "Policy", RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-file-chooser-widget.c�������������������������������������0000644�0001750�0001750�00000002516�12102213527�022236� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Seiya Nishizawa, Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cFileChooserWidget static VALUE rg_initialize(VALUE self, VALUE action) { RBGTK_INITIALIZE(self, gtk_file_chooser_widget_new(RVAL2GTKFILECHOOSERACTION(action))); return Qnil; } void Init_gtk_file_chooser_widget(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_FILE_CHOOSER_WIDGET, "FileChooserWidget", mGtk); RG_DEF_METHOD(initialize, 1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-accel-group.c���������������������������������������������0000644�0001750�0001750�00000013476�12102213526�020605� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAccelGroup #define _SELF(w) RVAL2GTKACCELGROUP(w) #define RVAL2MOD(mods) (NIL_P(mods) ? 0 : RVAL2GDKMODIFIERTYPE(mods)) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, gtk_accel_group_new()); return Qnil; } static VALUE rg_connect(int argc, VALUE *argv, VALUE self) { VALUE key, mods, flags, path, closure; GClosure *rclosure; if (argc > 2){ rb_scan_args(argc, argv, "31", &key, &mods, &flags, &closure); if (NIL_P(closure)){ rclosure = g_rclosure_new(rb_block_proc(), Qnil, NULL); } else { rclosure = RVAL2GCLOSURE(closure); } g_rclosure_attach(rclosure, self); gtk_accel_group_connect(_SELF(self), NUM2UINT(key), RVAL2MOD(mods), RVAL2GTKACCELFLAGS(flags), rclosure); } else { rb_scan_args(argc, argv, "11", &path, &closure); if (NIL_P(closure)){ rclosure = g_rclosure_new(rb_block_proc(), Qnil, NULL); } else { rclosure = RVAL2GCLOSURE(closure); } g_rclosure_attach(rclosure, self); gtk_accel_group_connect_by_path(_SELF(self), RVAL2CSTR(path), rclosure); } return self; } static VALUE rg_disconnect_key(VALUE self, VALUE key, VALUE mods) { return CBOOL2RVAL(gtk_accel_group_disconnect_key(_SELF(self), NUM2UINT(key), RVAL2MOD(mods))); } static VALUE rg_query(VALUE self, VALUE key, VALUE mods) { GtkAccelGroupEntry *entries; guint n_entries; guint cnt; VALUE result; entries = gtk_accel_group_query(_SELF(self), NUM2UINT(key), RVAL2MOD(mods), &n_entries); if(n_entries == 0){ return Qnil; } else{ result = rb_ary_new2(n_entries); for(cnt=0; cnt<n_entries; cnt++, entries++) rb_ary_push(result, GTKACCELGROUPENTRY2RVAL(entries)); return result; } } static VALUE rg_disconnect(VALUE self, VALUE closure) { return CBOOL2RVAL(gtk_accel_group_disconnect(_SELF(self), RVAL2GCLOSURE(closure))); } static VALUE rg_s_from_accel_closure(G_GNUC_UNUSED VALUE self, VALUE closure) { return GOBJ2RVAL(gtk_accel_group_from_accel_closure( RVAL2GCLOSURE(closure))); } static gboolean gaccelgrp_find_func(GtkAccelKey *key, GClosure *closure, gpointer func) { return RVAL2CBOOL(rb_funcall((VALUE)func, id_call, 2, GTKACCELKEY2RVAL(key), GCLOSURE2RVAL(closure))); } static VALUE rg_find(VALUE self) { GtkAccelKey *result; volatile VALUE func = rb_block_proc(); result = gtk_accel_group_find(_SELF(self), (GtkAccelGroupFindFunc)gaccelgrp_find_func, (gpointer)func); return GTKACCELKEY2RVAL(result); } static VALUE rg_activate(VALUE self, VALUE accel_quark, VALUE acceleratable, VALUE accel_key, VALUE accel_mods) { GQuark quark = 0; if (TYPE(accel_quark) == T_STRING){ quark = g_quark_from_string(RVAL2CSTR(accel_quark)); } else { quark = NUM2UINT(quark); } return CBOOL2RVAL(gtk_accel_group_activate(_SELF(self), quark, RVAL2GOBJ(acceleratable), NUM2UINT(accel_key), RVAL2MOD(accel_mods))); } static VALUE _gaccelgrp_lock_ensure(VALUE self) { gtk_accel_group_unlock(_SELF(self)); return Qnil; } static VALUE rg_lock(VALUE self) { gtk_accel_group_lock(_SELF(self)); if (rb_block_given_p()){ rb_ensure(rb_yield, self, _gaccelgrp_lock_ensure , self); } return self; } static VALUE rg_unlock(VALUE self) { gtk_accel_group_unlock(_SELF(self)); return self; } static VALUE rg_s_activate(G_GNUC_UNUSED VALUE self, VALUE obj, VALUE key, VALUE modtype) { return CBOOL2RVAL(gtk_accel_groups_activate(RVAL2GOBJ(obj), NUM2UINT(key), RVAL2MOD(modtype))); } static VALUE rg_s_from_object(G_GNUC_UNUSED VALUE self, VALUE object) { return GOBJGSLIST2RVAL(gtk_accel_groups_from_object(RVAL2GOBJ(object))); } void Init_gtk_accel_group(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_ACCEL_GROUP, "AccelGroup", mGtk); RG_DEF_SMETHOD(activate, 3); RG_DEF_SMETHOD(from_object, 1); RG_DEF_SMETHOD(from_accel_closure, 1); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(activate, 4); RG_DEF_METHOD(lock, 0); RG_DEF_METHOD(unlock, 0); RG_DEF_METHOD(connect, -1); RG_DEF_METHOD(disconnect, 1); RG_DEF_METHOD(disconnect_key, 2); RG_DEF_METHOD(query, 2); RG_DEF_METHOD(find, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-color-button.c��������������������������������������������0000644�0001750�0001750�00000002744�12102213527�021030� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cColorButton static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE color; GtkWidget* widget; rb_scan_args(argc, argv, "01", &color); if (NIL_P(color)){ widget = gtk_color_button_new(); } else { widget = gtk_color_button_new_with_color(RVAL2GDKCOLOR(color)); } RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_colorbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_COLOR_BUTTON, "ColorButton", mGtk); RG_DEF_METHOD(initialize, -1); } ����������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-buildable.c�����������������������������������������������0000644�0001750�0001750�00000005716�12102213527�020326� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cBuildable #define _SELF(self) (RVAL2GTKBUILDABLE(self)) static VALUE rg_builder_name(VALUE self) { return CSTR2RVAL(gtk_buildable_get_name(_SELF(self))); } static VALUE rg_set_builder_name(VALUE self, VALUE name) { gtk_buildable_set_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_add_child(int argc, VALUE *argv, VALUE self) { VALUE builder, child, type; rb_scan_args(argc, argv, "21", &builder, &child, &type); gtk_buildable_add_child(_SELF(self), RVAL2GTKBUILDER(builder), RVAL2GOBJ(child), RVAL2CSTR_ACCEPT_NIL(type)); return self; } static VALUE rg_set_buildable_property(VALUE self, VALUE rb_builder, VALUE rb_name, VALUE rb_value) { GtkBuilder *builder; const gchar *name; GValue value = G_VALUE_INIT; builder = RVAL2GTKBUILDER(rb_builder); name = RVAL2CSTR(rb_name); rbgobj_initialize_gvalue(&value, rb_value); gtk_buildable_set_buildable_property(_SELF(self), builder, name, &value); return self; } static VALUE rg_construct_child(VALUE self, VALUE builder, VALUE name) { return GOBJ2RVAL(gtk_buildable_construct_child(_SELF(self), RVAL2GTKBUILDER(builder), RVAL2CSTR(name))); } static VALUE rg_get_internal_child(VALUE self, VALUE builder, VALUE child_name) { return GOBJ2RVAL(gtk_buildable_get_internal_child(_SELF(self), RVAL2GTKBUILDER(builder), RVAL2CSTR(child_name))); } void Init_gtk_buildable(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BUILDABLE, "Buildable", mGtk); RG_DEF_METHOD(builder_name, 0); RG_DEF_METHOD(set_builder_name, 1); RG_DEF_METHOD(add_child, -1); RG_DEF_METHOD(set_buildable_property, 3); RG_DEF_METHOD(construct_child, 2); RG_DEF_METHOD(get_internal_child, 2); } ��������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-plug.c����������������������������������������������������0000644�0001750�0001750�00000004234�12102213527�017344� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 2002 Neil Conway * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #ifdef HAVE_GTK_PLUG_GET_TYPE #include <gtk/gtkx.h> #define RG_TARGET_NAMESPACE cPlug static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE socket_id; Window id; if (rb_scan_args(argc, argv, "01", &socket_id) == 0) id = 0; else { #ifdef GDK_NATIVE_WINDOW_POINTER id = GUINT_TO_POINTER(NUM2ULONG(socket_id)); #else id = NUM2UINT(socket_id); #endif } RBGTK_INITIALIZE(self, gtk_plug_new(id)); return Qnil; } static VALUE rg_construct(VALUE self, VALUE socket_id) { #ifdef GDK_NATIVE_WINDOW_POINTER gtk_plug_construct(RVAL2GTKPLUG(self), GUINT_TO_POINTER(NUM2ULONG(socket_id))); #else gtk_plug_construct(RVAL2GTKPLUG(self), (guint32)NUM2UINT(socket_id)); #endif return self; } static VALUE rg_id(VALUE self) { Window id = gtk_plug_get_id(RVAL2GTKPLUG(self)); #ifdef GDK_NATIVE_WINDOW_POINTER return UINT2NUM(GPOINTER_TO_UINT(id)); #else return UINT2NUM(id); #endif } #endif void Init_gtk_plug(VALUE mGtk) { #ifdef HAVE_GTK_PLUG_GET_TYPE VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PLUG, "Plug", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(construct, 1); RG_DEF_METHOD(id, 0); #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-dragdest.c�������������������������������������������0000644�0001750�0001750�00000002031�12102213527�021120� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" void Init_gtk_treedragdest(VALUE mGtk) { G_DEF_INTERFACE(GTK_TYPE_TREE_DRAG_DEST, "TreeDragDest", mGtk); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tree-sortable.c�������������������������������������������0000644�0001750�0001750�00000007271�12102213527�021151� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mTreeSortable #define _SELF(s) (RVAL2GTKTREESORTABLE(s)) static VALUE rg_sort_column_changed(VALUE self) { gtk_tree_sortable_sort_column_changed(_SELF(self)); return self; } static VALUE rg_sort_column_id(VALUE self) { gint sort_column_id; GtkSortType order; if (gtk_tree_sortable_get_sort_column_id(_SELF(self), &sort_column_id, &order)) { VALUE ary; ary = rb_ary_new2(2); rb_ary_push(ary, INT2NUM(sort_column_id)); rb_ary_push(ary, GTKSORTTYPE2RVAL(order)); return ary; } else { return Qnil; /* XXX: or something else? exception? */ } } static VALUE rg_set_sort_column_id(int argc, VALUE *argv, VALUE self) { gint sort_column_id; GtkSortType order; if (argc == 1 || argc == 2) { sort_column_id = NUM2INT(argv[0]); order = (argc == 2) ? RVAL2GTKSORTTYPE(argv[1]) : GTK_SORT_ASCENDING; } else { rb_raise(rb_eArgError, "need 1 or 2 arguments."); } gtk_tree_sortable_set_sort_column_id(_SELF(self), sort_column_id, order); return self; } static gint sort_func(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer func) { a->user_data3 = model; b->user_data3 = model; return NUM2INT(rb_funcall((VALUE)func, id_call, 2, GTKTREEITER2RVAL(a), GTKTREEITER2RVAL(b))); } static VALUE rg_set_sort_func(VALUE self, VALUE sort_column_id) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_sortable_set_sort_func(_SELF(self), NUM2INT(sort_column_id), (GtkTreeIterCompareFunc)sort_func, (gpointer)func, NULL); return self; } static VALUE rg_set_default_sort_func(VALUE self) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); gtk_tree_sortable_set_default_sort_func(_SELF(self), (GtkTreeIterCompareFunc)sort_func, (gpointer)func, NULL); return self; } static VALUE rg_has_default_sort_func_p(VALUE self) { return RVAL2CBOOL(gtk_tree_sortable_has_default_sort_func(_SELF(self))); } void Init_gtk_treesortable(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_TREE_SORTABLE, "TreeSortable", mGtk); RG_DEF_METHOD(sort_column_changed, 0); RG_DEF_METHOD(sort_column_id, 0); RG_DEF_METHOD(set_sort_column_id, -1); RG_DEF_METHOD(set_sort_func, 1); RG_DEF_METHOD(set_default_sort_func, 0); RG_DEF_METHOD_P(has_default_sort_func, 0); rb_define_const(RG_TARGET_NAMESPACE, "DEFAULT_SORT_COLUMN_ID", GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-tool-button.c���������������������������������������������0000644�0001750�0001750�00000004166�12102213527�020667� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cToolButton #define _SELF(self) (RVAL2GTKTOOLBUTTON(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg; GtkToolItem *item = NULL; rb_scan_args(argc, argv, "01", &arg); if (NIL_P(arg)) { item = gtk_tool_button_new(NULL, NULL); } else if (TYPE(arg) == T_HASH) { VALUE icon_widget, label, stock_id, buffer; rbg_scan_options(arg, "icon_widget", &icon_widget, "label", &label, "stock_id", &stock_id, NULL); if (!NIL_P(icon_widget)) item = gtk_tool_button_new(RVAL2GTKWIDGET(icon_widget), RVAL2CSTR_ACCEPT_NIL(label)); else if (!NIL_P(stock_id)) item = gtk_tool_button_new_from_stock(RVAL2GLIBID(stock_id, buffer)); } if (!item) rb_raise(rb_eArgError, "Invalid arguments."); RBGTK_INITIALIZE(self, item); return Qnil; } void Init_gtk_toolbutton(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_TOOL_BUTTON, "ToolButton", mGtk); RG_DEF_METHOD(initialize, -1); RG_REG_GLIBID_SETTER("stock-id"); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk3conversions.h���������������������������������������������0000644�0001750�0001750�00000065022�12257552170�020775� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGTK3CONVERSIONS_H__ #define __RBGTK3CONVERSIONS_H__ #define RVAL2GTKABOUTDIALOG(o) (GTK_ABOUT_DIALOG(RVAL2GOBJ(o))) #define RVAL2GTKACCELGROUP(o) (GTK_ACCEL_GROUP(RVAL2GOBJ(o))) #define RVAL2GTKACCELLABEL(o) (GTK_ACCEL_LABEL(RVAL2GOBJ(o))) #define RVAL2GTKACCESSIBLE(o) (GTK_ACCESSIBLE(RVAL2GOBJ(o))) #define RVAL2GTKACTION(o) (GTK_ACTION(RVAL2GOBJ(o))) #define RVAL2GTKACTIONGROUP(o) (GTK_ACTION_GROUP(RVAL2GOBJ(o))) #define RVAL2GTKADJUSTMENT(o) (GTK_ADJUSTMENT(RVAL2GOBJ(o))) #define RVAL2GTKALIGNMENT(o) (GTK_ALIGNMENT(RVAL2GOBJ(o))) #define RVAL2GTKAPPCHOOSER(o) (GTK_APP_CHOOSER(RVAL2GOBJ(o))) #define RVAL2GTKAPPCHOOSERBUTTON(o) (GTK_APP_CHOOSER_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKAPPCHOOSERDIALOG(o) (GTK_APP_CHOOSER_DIALOG(RVAL2GOBJ(o))) #define RVAL2GTKAPPCHOOSERWIDGET(o) (GTK_APP_CHOOSER_WIDGET(RVAL2GOBJ(o))) #define RVAL2GTKAPPLICATION(o) (GTK_APPLICATION(RVAL2GOBJ(o))) #define RVAL2GTKARROW(o) (GTK_ARROW(RVAL2GOBJ(o))) #define RVAL2GTKASPECTFRAME(o) (GTK_ASPECT_FRAME(RVAL2GOBJ(o))) #define RVAL2GTKASSISTANT(o) (GTK_ASSISTANT(RVAL2GOBJ(o))) #define RVAL2GTKBIN(o) (GTK_BIN(RVAL2GOBJ(o))) #define RVAL2GTKBOX(o) (GTK_BOX(RVAL2GOBJ(o))) #define RVAL2GTKBUILDABLE(o) (GTK_BUILDABLE(RVAL2GOBJ(o))) #define RVAL2GTKBUILDER(o) (GTK_BUILDER(RVAL2GOBJ(o))) #define RVAL2GTKBUTTON(o) (GTK_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKBUTTONBOX(o) (GTK_BUTTON_BOX(RVAL2GOBJ(o))) #define RVAL2GTKCALENDAR(o) (GTK_CALENDAR(RVAL2GOBJ(o))) #define RVAL2GTKCELLAREA(o) (GTK_CELL_AREA(RVAL2GOBJ(o))) #define RVAL2GTKCELLEDITABLE(o) (GTK_CELL_EDITABLE(RVAL2GOBJ(o))) #define RVAL2GTKCELLLAYOUT(o) (GTK_CELL_LAYOUT(RVAL2GOBJ(o))) #define RVAL2GTKCELLRENDERER(o) (GTK_CELL_RENDERER(RVAL2GOBJ(o))) #define RVAL2GTKCELLRENDERERACCEL(o) (GTK_CELL_RENDERER_ACCEL(RVAL2GOBJ(o))) #define RVAL2GTKCELLRENDERERPIXBUF(o) (GTK_CELL_RENDERER_PIXBUF(RVAL2GOBJ(o))) #define RVAL2GTKCELLRENDERERSPIN(o) (GTK_CELL_RENDERER_SPIN(RVAL2GOBJ(o))) #define RVAL2GTKCELLRENDERERSPINNER(o) (GTK_CELL_RENDERER_SPINNER(RVAL2GOBJ(o))) #define RVAL2GTKCELLRENDERERTEXT(o) (GTK_CELL_RENDERER_TEXT(RVAL2GOBJ(o))) #define RVAL2GTKCELLRENDERERTOGGLE(o) (GTK_CELL_RENDERER_TOGGLE(RVAL2GOBJ(o))) #define RVAL2GTKCELLVIEW(o) (GTK_CELL_VIEW(RVAL2GOBJ(o))) #define RVAL2GTKCHECKMENUITEM(o) (GTK_CHECK_MENU_ITEM(RVAL2GOBJ(o))) #define RVAL2GTKCLIPBOARD(o) (GTK_CLIPBOARD(RVAL2GOBJ(o))) #define RVAL2GTKCOLORSELECTION(o) (GTK_COLOR_SELECTION(RVAL2GOBJ(o))) #define RVAL2GTKCOLORSELECTIONDIALOG(o) (GTK_COLOR_SELECTION_DIALOG(RVAL2GOBJ(o))) #define RVAL2GTKCOMBOBOX(o) (GTK_COMBO_BOX(RVAL2GOBJ(o))) #define RVAL2GTKCOMBOBOXTEXT(o) (GTK_COMBO_BOX_TEXT(RVAL2GOBJ(o))) #define RVAL2GTKCONTAINER(o) (GTK_CONTAINER(RVAL2GOBJ(o))) #define RVAL2GTKCSSPROVIDER(o) (GTK_CSS_PROVIDER(RVAL2GOBJ(o))) #define RVAL2GTKDIALOG(o) (GTK_DIALOG(RVAL2GOBJ(o))) #define RVAL2GTKEDITABLE(o) (GTK_EDITABLE(RVAL2GOBJ(o))) #define RVAL2GTKENTRY(o) (GTK_ENTRY(RVAL2GOBJ(o))) #define RVAL2GTKENTRYBUFFER(o) (GTK_ENTRY_BUFFER(RVAL2GOBJ(o))) #define RVAL2GTKENTRYCOMPLETION(o) (GTK_ENTRY_COMPLETION(RVAL2GOBJ(o))) #define RVAL2GTKEXPANDER(o) (GTK_EXPANDER(RVAL2GOBJ(o))) #define RVAL2GTKFILECHOOSER(o) (GTK_FILE_CHOOSER(RVAL2GOBJ(o))) #define RVAL2GTKFILECHOOSERDIALOG(o) (GTK_FILE_CHOOSER_DIALOG(RVAL2GOBJ(o))) #define RVAL2GTKFILEFILTER(o) (GTK_FILE_FILTER(RVAL2GOBJ(o))) #define RVAL2GTKFIXED(o) (GTK_FIXED(RVAL2GOBJ(o))) #define RVAL2GTKFONTCHOOSER(o) (GTK_FONT_CHOOSER(RVAL2GOBJ(o))) #define RVAL2GTKFONTCHOOSERDIALOG(o) (GTK_FONT_CHOOSER_DIALOG(RVAL2GOBJ(o))) #define RVAL2GTKFONTCHOOSERWIDGET(o) (GTK_FONT_CHOOSER_WIDGET(RVAL2GOBJ(o))) #define RVAL2GTKFRAME(o) (GTK_FRAME(RVAL2GOBJ(o))) #define RVAL2GTKGRID(o) (GTK_GRID(RVAL2GOBJ(o))) #define RVAL2GTKHSV(o) (GTK_HSV(RVAL2GOBJ(o))) #define RVAL2GTKICONFACTORY(o) (GTK_ICON_FACTORY(RVAL2GOBJ(o))) #define RVAL2GTKICONTHEME(o) (GTK_ICON_THEME(RVAL2GOBJ(o))) #define RVAL2GTKICONVIEW(o) (GTK_ICON_VIEW(RVAL2GOBJ(o))) #define RVAL2GTKIMAGE(o) (GTK_IMAGE(RVAL2GOBJ(o))) #define RVAL2GTKIMCONTEXT(o) (GTK_IM_CONTEXT(RVAL2GOBJ(o))) #define RVAL2GTKIMCONTEXTSIMPLE(o) (GTK_IM_CONTEXT_SIMPLE(RVAL2GOBJ(o))) #define RVAL2GTKIMMULTICONTEXT(o) (GTK_IM_MULTICONTEXT(RVAL2GOBJ(o))) #define RVAL2GTKINFOBAR(o) (GTK_INFO_BAR(RVAL2GOBJ(o))) #define RVAL2GTKINVISIBLE(o) (GTK_INVISIBLE(RVAL2GOBJ(o))) #define RVAL2GTKLABEL(o) (GTK_LABEL(RVAL2GOBJ(o))) #define RVAL2GTKLAYOUT(o) (GTK_LAYOUT(RVAL2GOBJ(o))) #define RVAL2GTKLINKBUTTON(o) (GTK_LINK_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKLISTSTORE(o) (GTK_LIST_STORE(RVAL2GOBJ(o))) #define RVAL2GTKMENU(o) (GTK_MENU(RVAL2GOBJ(o))) #define RVAL2GTKMENUITEM(o) (GTK_MENU_ITEM(RVAL2GOBJ(o))) #define RVAL2GTKMENUSHELL(o) (GTK_MENU_SHELL(RVAL2GOBJ(o))) #define RVAL2GTKMENUTOOLBUTTON(o) (GTK_MENU_TOOL_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKMESSAGEDIALOG(o) (GTK_MESSAGE_DIALOG(RVAL2GOBJ(o))) #define RVAL2GTKMISC(o) (GTK_MISC(RVAL2GOBJ(o))) #define RVAL2GTKMOUNTOPERATION(o) (GTK_MOUNT_OPERATION(RVAL2GOBJ(o))) #define RVAL2GTKNOTEBOOK(o) (GTK_NOTEBOOK(RVAL2GOBJ(o))) #define RVAL2GTKOVERLAY(o) (GTK_OVERLAY(RVAL2GOBJ(o))) #define RVAL2GTKPAGESETUP(o) (GTK_PAGE_SETUP(RVAL2GOBJ(o))) #define RVAL2GTKPAGESETUPUNIXDIALOG(o) (GTK_PAGE_SETUP_UNIX_DIALOG(RVAL2GOBJ(o))) #define RVAL2GTKPANED(o) (GTK_PANED(RVAL2GOBJ(o))) #define RVAL2GTKPLUG(o) (GTK_PLUG(RVAL2GOBJ(o))) #define RVAL2GTKPRINTBACKEND(o) (GTK_PRINT_BACKEND(RVAL2GOBJ(o))) #define RVAL2GTKPRINTCONTEXT(o) (GTK_PRINT_CONTEXT(RVAL2GOBJ(o))) #define RVAL2GTKPRINTER(o) (GTK_PRINTER(RVAL2GOBJ(o))) #define RVAL2GTKPRINTJOB(o) (GTK_PRINT_JOB(RVAL2GOBJ(o))) #define RVAL2GTKPRINTOPERATION(o) (GTK_PRINT_OPERATION(RVAL2GOBJ(o))) #define RVAL2GTKPRINTOPERATIONPREVIEW(o) (GTK_PRINT_OPERATION_PREVIEW(RVAL2GOBJ(o))) #define RVAL2GTKPRINTSETTINGS(o) (GTK_PRINT_SETTINGS(RVAL2GOBJ(o))) #define RVAL2GTKPRINTUNIXDIALOG(o) (GTK_PRINT_UNIX_DIALOG(RVAL2GOBJ(o))) #define RVAL2GTKPROGRESSBAR(o) (GTK_PROGRESS_BAR(RVAL2GOBJ(o))) #define RVAL2GTKRADIOACTION(o) (GTK_RADIO_ACTION(RVAL2GOBJ(o))) #define RVAL2GTKRADIOBUTTON(o) (GTK_RADIO_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKRADIOMENUITEM(o) (GTK_RADIO_MENU_ITEM(RVAL2GOBJ(o))) #define RVAL2GTKRADIOTOOLBUTTON(o) (GTK_RADIO_TOOL_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKRANGE(o) (GTK_RANGE(RVAL2GOBJ(o))) #define RVAL2GTKRECENTCHOOSER(o) (GTK_RECENT_CHOOSER(RVAL2GOBJ(o))) #define RVAL2GTKRECENTCHOOSERDIALOG(o) (GTK_RECENT_CHOOSER_DIALOG(RVAL2GOBJ(o))) #define RVAL2GTKRECENTCHOOSERMENU(o) (GTK_RECENT_CHOOSER_MENU(RVAL2GOBJ(o))) #define RVAL2GTKRECENTCHOOSERWIDGET(o) (GTK_RECENT_CHOOSER_WIDGET(RVAL2GOBJ(o))) #define RVAL2GTKRECENTFILTER(o) (GTK_RECENT_FILTER(RVAL2GOBJ(o))) #define RVAL2GTKRECENTMANAGER(o) (GTK_RECENT_MANAGER(RVAL2GOBJ(o))) #define RVAL2GTKSCALE(o) (GTK_SCALE(RVAL2GOBJ(o))) #define RVAL2GTKSCALEBUTTON(o) (GTK_SCALE_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKSCROLLABLE(o) (GTK_SCROLLABLE(RVAL2GOBJ(o))) #define RVAL2GTKSCROLLBAR(o) (GTK_SCROLLBAR(RVAL2GOBJ(o))) #define RVAL2GTKSCROLLEDWINDOW(o) (GTK_SCROLLED_WINDOW(RVAL2GOBJ(o))) #define RVAL2GTKSEPARATOR(o) (GTK_SEPARATOR(RVAL2GOBJ(o))) #define RVAL2GTKSETTINGS(o) (GTK_SETTINGS(RVAL2GOBJ(o))) #define RVAL2GTKSIZEGROUP(o) (GTK_SIZE_GROUP(RVAL2GOBJ(o))) #define RVAL2GTKSOCKET(o) (GTK_SOCKET(RVAL2GOBJ(o))) #define RVAL2GTKSPINBUTTON(o) (GTK_SPIN_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKSPINNER(o) (GTK_SPINNER(RVAL2GOBJ(o))) #define RVAL2GTKSTATUSBAR(o) (GTK_STATUSBAR(RVAL2GOBJ(o))) #define RVAL2GTKSTATUSICON(o) (GTK_STATUS_ICON(RVAL2GOBJ(o))) #define RVAL2GTKSTYLECONTEXT(o) (GTK_STYLE_CONTEXT(RVAL2GOBJ(o))) #define RVAL2GTKSTYLEPROPERTIES(o) (GTK_STYLE_PROPERTIES(RVAL2GOBJ(o))) #define RVAL2GTKSTYLEPROVIDER(o) (GTK_STYLE_PROVIDER(RVAL2GOBJ(o))) #define RVAL2GTKSWITCH(o) (GTK_SWITCH(RVAL2GOBJ(o))) #define RVAL2GTKTABLE(o) (GTK_TABLE(RVAL2GOBJ(o))) #define RVAL2GTKTEXTBUFFER(o) (GTK_TEXT_BUFFER(RVAL2GOBJ(o))) #define RVAL2GTKTEXTCHILDANCHOR(o) (GTK_TEXT_CHILD_ANCHOR(RVAL2GOBJ(o))) #define RVAL2GTKTEXTMARK(o) (GTK_TEXT_MARK(RVAL2GOBJ(o))) #define RVAL2GTKTEXTTAG(o) (GTK_TEXT_TAG(RVAL2GOBJ(o))) #define RVAL2GTKTEXTTAGTABLE(o) (GTK_TEXT_TAG_TABLE(RVAL2GOBJ(o))) #define RVAL2GTKTEXTVIEW(o) (GTK_TEXT_VIEW(RVAL2GOBJ(o))) #define RVAL2GTKTHEMINGENGINE(o) (GTK_THEMING_ENGINE(RVAL2GOBJ(o))) #define RVAL2GTKTOGGLEACTION(o) (GTK_TOGGLE_ACTION(RVAL2GOBJ(o))) #define RVAL2GTKTOGGLEBUTTON(o) (GTK_TOGGLE_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKTOGGLETOOLBUTTON(o) (GTK_TOGGLE_TOOL_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKTOOLBAR(o) (GTK_TOOLBAR(RVAL2GOBJ(o))) #define RVAL2GTKTOOLBUTTON(o) (GTK_TOOL_BUTTON(RVAL2GOBJ(o))) #define RVAL2GTKTOOLITEM(o) (GTK_TOOL_ITEM(RVAL2GOBJ(o))) #define RVAL2GTKTOOLITEMGROUP(o) (GTK_TOOL_ITEM_GROUP(RVAL2GOBJ(o))) #define RVAL2GTKTOOLPALETTE(o) (GTK_TOOL_PALETTE(RVAL2GOBJ(o))) #define RVAL2GTKTOOLSHELL(o) (GTK_TOOL_SHELL(RVAL2GOBJ(o))) #define RVAL2GTKTREEMODEL(o) (GTK_TREE_MODEL(RVAL2GOBJ(o))) #define RVAL2GTKTREEMODELFILTER(o) (GTK_TREE_MODEL_FILTER(RVAL2GOBJ(o))) #define RVAL2GTKTREEMODELSORT(o) (GTK_TREE_MODEL_SORT(RVAL2GOBJ(o))) #define RVAL2GTKTREESELECTION(o) (GTK_TREE_SELECTION(RVAL2GOBJ(o))) #define RVAL2GTKTREESORTABLE(o) (GTK_TREE_SORTABLE(RVAL2GOBJ(o))) #define RVAL2GTKTREESTORE(o) (GTK_TREE_STORE(RVAL2GOBJ(o))) #define RVAL2GTKTREEVIEW(o) (GTK_TREE_VIEW(RVAL2GOBJ(o))) #define RVAL2GTKTREEVIEWCOLUMN(o) (GTK_TREE_VIEW_COLUMN(RVAL2GOBJ(o))) #define RVAL2GTKUIMANAGER(o) (GTK_UI_MANAGER(RVAL2GOBJ(o))) #define RVAL2GTKWIDGET(o) (GTK_WIDGET(RVAL2GOBJ(o))) #define RVAL2GTKWINDOW(o) (GTK_WINDOW(RVAL2GOBJ(o))) #define RVAL2GTKWINDOWGROUP(o) (GTK_WINDOW_GROUP(RVAL2GOBJ(o))) #define RVAL2GTKACCELGROUPENTRY(o) ((GtkAccelGroupEntry*)RVAL2BOXED(o, GTK_TYPE_ACCEL_GROUP_ENTRY)) #define GTKACCELGROUPENTRY2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_ACCEL_GROUP_ENTRY)) #define RVAL2GTKACCELKEY(o) ((GtkAccelKey*)RVAL2BOXED(o, GTK_TYPE_ACCEL_KEY)) #define GTKACCELKEY2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_ACCEL_KEY)) #define RVAL2GTKALLOCATION(o) ((GtkAllocation*)RVAL2BOXED(o, GTK_TYPE_ALLOCATION)) #define GTKALLOCATION2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_ALLOCATION)) #define RVAL2GTKBINDINGSET(o) ((GtkBindingSet*)RVAL2BOXED(o, GTK_TYPE_BINDING_SET)) #define GTKBINDINGSET2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_BINDING_SET)) #define RVAL2GTKBORDER(o) ((GtkBorder*)RVAL2BOXED(o, GTK_TYPE_BORDER)) #define GTKBORDER2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_BORDER)) #define RVAL2GTKCSSSECTION(o) ((GtkCssSection*)RVAL2BOXED(o, GTK_TYPE_CSS_SECTION)) #define GTKCSSSECTION2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_CSS_SECTION)) #if GTK_CHECK_VERSION(3, 8, 0) # define RVAL2GTKICONINFO(o) (GTK_ICON_INFO(RVAL2GOBJ(o))) # define GTKICONINFO2RVAL(o) (GOBJ2RVAL(o)) #else # define RVAL2GTKICONINFO(o) ((GtkIconInfo *)RVAL2BOXED(o, GTK_TYPE_ICON_INFO)) # define GTKICONINFO2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_ICON_INFO)) #endif #define RVAL2GTKICONSET(o) ((GtkIconSet*)RVAL2BOXED(o, GTK_TYPE_ICON_SET)) #define GTKICONSET2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_ICON_SET)) #define RVAL2GTKICONSOURCE(o) ((GtkIconSource*)RVAL2BOXED(o, GTK_TYPE_ICON_SOURCE)) #define GTKICONSOURCE2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_ICON_SOURCE)) #define RVAL2GTKPAPERSIZE(o) ((GtkPaperSize*)RVAL2BOXED(o, GTK_TYPE_PAPER_SIZE)) #define GTKPAPERSIZE2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_PAPER_SIZE)) #define RVAL2GTKRECENTDATA(o) ((GtkRecentData*)RVAL2BOXED(o, GTK_TYPE_RECENT_DATA)) #define GTKRECENTDATA2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_RECENT_DATA)) #define RVAL2GTKRECENTFILTERINFO(o) ((GtkRecentFilterInfo*)RVAL2BOXED(o, GTK_TYPE_RECENT_FILTER_INFO)) #define GTKRECENTFILTERINFO2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_RECENT_FILTER_INFO)) #define RVAL2GTKRECENTINFO(o) ((GtkRecentInfo*)RVAL2BOXED(o, GTK_TYPE_RECENT_INFO)) #define GTKRECENTINFO2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_RECENT_INFO)) #define RVAL2GTKREQUISITION(o) ((GtkRequisition *)RVAL2BOXED(o, GTK_TYPE_REQUISITION)) #define GTKREQUISITION2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_REQUISITION)) #define RVAL2GTKSELECTIONDATA(o) ((GtkSelectionData*)RVAL2BOXED(o, GTK_TYPE_SELECTION_DATA)) #define GTKSELECTIONDATA2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_SELECTION_DATA)) #define RVAL2GTKSYMBOLICCOLOR(o) ((GtkSymbolicColor*)RVAL2BOXED(o, GTK_TYPE_SYMBOLIC_COLOR)) #define GTKSYMBOLICCOLOR2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_SYMBOLIC_COLOR)) #define RVAL2GTKTARGETLIST(o) ((GtkTargetList*)RVAL2BOXED(o, GTK_TYPE_TARGET_LIST)) #define GTKTARGETLIST2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_TARGET_LIST)) #define RVAL2GTKTEXTAPPEARANCE(o) ((GtkTextAppearance*)RVAL2BOXED(o, GTK_TYPE_TEXT_APPEARANCE)) #define GTKTEXTAPPEARANCE2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_TEXT_APPEARANCE)) #define RVAL2GTKTEXTATTRIBUTES(o) ((GtkTextAttributes*)RVAL2BOXED(o, GTK_TYPE_TEXT_ATTRIBUTES)) #define GTKTEXTATTRIBUTES2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_TEXT_ATTRIBUTES)) #define RVAL2GTKTEXTITER(o) ((GtkTextIter*)RVAL2BOXED(o, GTK_TYPE_TEXT_ITER)) #define GTKTEXTITER2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_TEXT_ITER)) #define RVAL2GTKTREEITER(o) ((GtkTreeIter*)RVAL2BOXED(o, GTK_TYPE_TREE_ITER)) #define GTKTREEITER2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_TREE_ITER)) #define RVAL2GTKTREEPATH(o) ((GtkTreePath*)RVAL2BOXED(o, GTK_TYPE_TREE_PATH)) #define GTKTREEPATH2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_TREE_PATH)) #define RVAL2GTKTREEROWREFERENCE(o) ((GtkTreeRowReference*)RVAL2BOXED(o, GTK_TYPE_TREE_ROW_REFERENCE)) #define GTKTREEROWREFERENCE2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_TREE_ROW_REFERENCE)) #define RVAL2GTKWIDGETPATH(o) ((GtkWidgetPath*)RVAL2BOXED(o, GTK_TYPE_WIDGET_PATH)) #define GTKWIDGETPATH2RVAL(o) (BOXED2RVAL(o, GTK_TYPE_WIDGET_PATH)) #define RVAL2GTKARROWTYPE(o) (RVAL2GENUM(o, GTK_TYPE_ARROW_TYPE)) #define GTKARROWTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_ARROW_TYPE)) #define RVAL2GTKASSISTANTPAGETYPE(o) (RVAL2GENUM(o, GTK_TYPE_ASSISTANT_PAGE_TYPE)) #define GTKASSISTANTPAGETYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_ASSISTANT_PAGE_TYPE)) #define RVAL2GTKBUTTONSTYPE(o) (RVAL2GENUM(o, GTK_TYPE_BUTTONS_TYPE)) #define GTKBUTTONSTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_BUTTONS_TYPE)) #define RVAL2GTKCORNERTYPE(o) (RVAL2GENUM(o, GTK_TYPE_CORNER_TYPE)) #define GTKCORNERTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_CORNER_TYPE)) #define RVAL2GTKCSSSECTIONTYPE(o) (RVAL2GENUM(o, GTK_TYPE_CSS_SECTION_TYPE)) #define GTKCSSSECTIONTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_CSS_SECTION_TYPE)) #define RVAL2GTKDIRECTIONTYPE(o) (RVAL2GENUM(o, GTK_TYPE_DIRECTION_TYPE)) #define GTKDIRECTIONTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_DIRECTION_TYPE)) #define RVAL2GTKENTRYICONPOSITION(o) (RVAL2GENUM(o, GTK_TYPE_ENTRY_ICON_POSITION)) #define GTKENTRYICONPOSITION2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_ENTRY_ICON_POSITION)) #define RVAL2GTKFILECHOOSERACTION(o) (RVAL2GENUM(o, GTK_TYPE_FILE_CHOOSER_ACTION)) #define GTKFILECHOOSERACTION2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_FILE_CHOOSER_ACTION)) #define RVAL2GTKICONSIZE(o) (RVAL2GENUM(o, GTK_TYPE_ICON_SIZE)) #define GTKICONSIZE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_ICON_SIZE)) #define RVAL2GTKICONVIEWDROPPOSITION(o) (RVAL2GENUM(o, GTK_TYPE_ICON_VIEW_DROP_POSITION)) #define GTKICONVIEWDROPPOSITION2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_ICON_VIEW_DROP_POSITION)) #define RVAL2GTKJUNCTIONSIDES(o) (RVAL2GENUM(o, GTK_TYPE_JUNCTION_SIDES)) #define GTKJUNCTIONSIDES2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_JUNCTION_SIDES)) #define RVAL2GTKJUSTIFICATION(o) (RVAL2GENUM(o, GTK_TYPE_JUSTIFICATION)) #define GTKJUSTIFICATION2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_JUSTIFICATION)) #define RVAL2GTKMESSAGETYPE(o) (RVAL2GENUM(o, GTK_TYPE_MESSAGE_TYPE)) #define GTKMESSAGETYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_MESSAGE_TYPE)) #define RVAL2GTKORIENTATION(o) (RVAL2GENUM(o, GTK_TYPE_ORIENTATION)) #define GTKORIENTATION2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_ORIENTATION)) #define RVAL2GTKPACKTYPE(o) (RVAL2GENUM(o, GTK_TYPE_PACK_TYPE)) #define GTKPACKTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PACK_TYPE)) #define RVAL2GTKPAGEORIENTATION(o) (RVAL2GENUM(o, GTK_TYPE_PAGE_ORIENTATION)) #define GTKPAGEORIENTATION2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PAGE_ORIENTATION)) #define RVAL2GTKPAGESET(o) (RVAL2GENUM(o, GTK_TYPE_PAGE_SET)) #define GTKPAGESET2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PAGE_SET)) #define RVAL2GTKPATHPRIORITYTYPE(o) (RVAL2GENUM(o, GTK_TYPE_PATH_PRIORITY_TYPE)) #define GTKPATHPRIORITYTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PATH_PRIORITY_TYPE)) #define RVAL2GTKPATHTYPE(o) (RVAL2GENUM(o, GTK_TYPE_PATH_TYPE)) #define GTKPATHTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PATH_TYPE)) #define RVAL2GTKPOLICYTYPE(o) (RVAL2GENUM(o, GTK_TYPE_POLICY_TYPE)) #define GTKPOLICYTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_POLICY_TYPE)) #define RVAL2GTKPOSITIONTYPE(o) (RVAL2GENUM(o, GTK_TYPE_POSITION_TYPE)) #define GTKPOSITIONTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_POSITION_TYPE)) #define RVAL2GTKPRINTDUPLEX(o) (RVAL2GENUM(o, GTK_TYPE_PRINT_DUPLEX)) #define GTKPRINTDUPLEX2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PRINT_DUPLEX)) #define RVAL2GTKPRINTOPERATIONACTION(o) (RVAL2GENUM(o, GTK_TYPE_PRINT_OPERATION_ACTION)) #define GTKPRINTOPERATIONACTION2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PRINT_OPERATION_ACTION)) #define RVAL2GTKPRINTOPERATIONRESULT(o) (RVAL2GENUM(o, GTK_TYPE_PRINT_OPERATION_RESULT)) #define GTKPRINTOPERATIONRESULT2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PRINT_OPERATION_RESULT)) #define RVAL2GTKPRINTPAGES(o) (RVAL2GENUM(o, GTK_TYPE_PRINT_PAGES)) #define GTKPRINTPAGES2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PRINT_PAGES)) #define RVAL2GTKPRINTQUALITY(o) (RVAL2GENUM(o, GTK_TYPE_PRINT_QUALITY)) #define GTKPRINTQUALITY2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PRINT_QUALITY)) #define RVAL2GTKPRINTSTATUS(o) (RVAL2GENUM(o, GTK_TYPE_PRINT_STATUS)) #define GTKPRINTSTATUS2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_PRINT_STATUS)) #define RVAL2GTKRELIEFSTYLE(o) (RVAL2GENUM(o, GTK_TYPE_RELIEF_STYLE)) #define GTKRELIEFSTYLE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_RELIEF_STYLE)) #define RVAL2GTKRESPONSETYPE(o) (RVAL2GENUM(o, GTK_TYPE_RESPONSE_TYPE)) #define GTKRESPONSETYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_RESPONSE_TYPE)) #define RVAL2GTKSELECTIONMODE(o) (RVAL2GENUM(o, GTK_TYPE_SELECTION_MODE)) #define GTKSELECTIONMODE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_SELECTION_MODE)) #define RVAL2GTKSHADOWTYPE(o) (RVAL2GENUM(o, GTK_TYPE_SHADOW_TYPE)) #define GTKSHADOWTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_SHADOW_TYPE)) #define RVAL2GTKSIZEGROUPMODE(o) (RVAL2GENUM(o, GTK_TYPE_SIZE_GROUP_MODE)) #define GTKSIZEGROUPMODE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_SIZE_GROUP_MODE)) #define RVAL2GTKSIZEREQUESTMODE(o) (RVAL2GENUM(o, GTK_TYPE_SIZE_REQUEST_MODE)) #define GTKSIZEREQUESTMODE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_SIZE_REQUEST_MODE)) #define RVAL2GTKSORTTYPE(o) (RVAL2GENUM(o, GTK_TYPE_SORT_TYPE)) #define GTKSORTTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_SORT_TYPE)) #define RVAL2GTKSPINTYPE(o) (RVAL2GENUM(o, GTK_TYPE_SPIN_TYPE)) #define GTKSPINTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_SPIN_TYPE)) #define RVAL2GTKSTATETYPE(o) (RVAL2GENUM(o, GTK_TYPE_STATE_TYPE)) #define GTKSTATETYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_STATE_TYPE)) #define RVAL2GTKTEXTDIRECTION(o) (RVAL2GENUM(o, GTK_TYPE_TEXT_DIRECTION)) #define GTKTEXTDIRECTION2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_TEXT_DIRECTION)) #define RVAL2GTKTEXTWINDOWTYPE(o) (RVAL2GENUM(o, GTK_TYPE_TEXT_WINDOW_TYPE)) #define GTKTEXTWINDOWTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_TEXT_WINDOW_TYPE)) #define RVAL2GTKTOOLBARCHILDTYPE(o) (RVAL2GENUM(o, GTK_TYPE_TOOLBAR_CHILD_TYPE)) #define GTKTOOLBARCHILDTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_TOOLBAR_CHILD_TYPE)) #define RVAL2GTKTOOLBARSTYLE(o) (RVAL2GENUM(o, GTK_TYPE_TOOLBAR_STYLE)) #define GTKTOOLBARSTYLE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_TOOLBAR_STYLE)) #define RVAL2GTKTREEVIEWDROPPOSITION(o) (RVAL2GENUM(o, GTK_TYPE_TREE_VIEW_DROP_POSITION)) #define GTKTREEVIEWDROPPOSITION2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_TREE_VIEW_DROP_POSITION)) #define RVAL2GTKUNIT(o) (RVAL2GENUM(o, GTK_TYPE_UNIT)) #define GTKUNIT2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_UNIT)) #define RVAL2GTKWINDOWTYPE(o) (RVAL2GENUM(o, GTK_TYPE_WINDOW_TYPE)) #define GTKWINDOWTYPE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_WINDOW_TYPE)) #define RVAL2GTKWRAPMODE(o) (RVAL2GENUM(o, GTK_TYPE_WRAP_MODE)) #define GTKWRAPMODE2RVAL(o) (GENUM2RVAL(o, GTK_TYPE_WRAP_MODE)) #define RVAL2GTKACCELFLAGS(o) (RVAL2GFLAGS(o, GTK_TYPE_ACCEL_FLAGS)) #define GTKACCELFLAGS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_ACCEL_FLAGS)) #define RVAL2GTKATTACHOPTIONS(o) (RVAL2GFLAGS(o, GTK_TYPE_ATTACH_OPTIONS)) #define GTKATTACHOPTIONS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_ATTACH_OPTIONS)) #define RVAL2GTKCALENDARDISPLAYOPTIONS(o) (RVAL2GFLAGS(o, GTK_TYPE_CALENDAR_DISPLAY_OPTIONS)) #define GTKCALENDARDISPLAYOPTIONS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_CALENDAR_DISPLAY_OPTIONS)) #define RVAL2GTKCELLRENDERERSTATE(o) (RVAL2GFLAGS(o, GTK_TYPE_CELL_RENDERER_STATE)) #define GTKCELLRENDERERSTATE2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_CELL_RENDERER_STATE)) #define RVAL2GTKDESTDEFAULTS(o) (RVAL2GFLAGS(o, GTK_TYPE_DEST_DEFAULTS)) #define GTKDESTDEFAULTS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_DEST_DEFAULTS)) #define RVAL2GTKDIALOGFLAGS(o) (RVAL2GFLAGS(o, GTK_TYPE_DIALOG_FLAGS)) #define GTKDIALOGFLAGS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_DIALOG_FLAGS)) #define RVAL2GTKFILEFILTERFLAGS(o) (RVAL2GFLAGS(o, GTK_TYPE_FILE_FILTER_FLAGS)) #define GTKFILEFILTERFLAGS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_FILE_FILTER_FLAGS)) #define RVAL2GTKICONLOOKUPFLAGS(o) (RVAL2GFLAGS(o, GTK_TYPE_ICON_LOOKUP_FLAGS)) #define GTKICONLOOKUPFLAGS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_ICON_LOOKUP_FLAGS)) #define RVAL2GTKPRINTCAPABILITIES(o) (RVAL2GFLAGS(o, GTK_TYPE_PRINT_CAPABILITIES)) #define GTKPRINTCAPABILITIES2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_PRINT_CAPABILITIES)) #define RVAL2GTKRECENTFILTERFLAGS(o) (RVAL2GFLAGS(o, GTK_TYPE_RECENT_FILTER_FLAGS)) #define GTKRECENTFILTERFLAGS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_RECENT_FILTER_FLAGS)) #define RVAL2GTKREGIONFLAGS(o) (RVAL2GFLAGS(o, GTK_TYPE_REGION_FLAGS)) #define GTKREGIONFLAGS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_REGION_FLAGS)) #define RVAL2GTKSTATEFLAGS(o) (RVAL2GFLAGS(o, GTK_TYPE_STATE_FLAGS)) #define GTKSTATEFLAGS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_STATE_FLAGS)) #define RVAL2GTKTARGETFLAGS(o) (RVAL2GFLAGS(o, GTK_TYPE_TARGET_FLAGS)) #define GTKTARGETFLAGS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_TARGET_FLAGS)) #define RVAL2GTKTEXTSEARCHFLAGS(o) (RVAL2GFLAGS(o, GTK_TYPE_TEXT_SEARCH_FLAGS)) #define GTKTEXTSEARCHFLAGS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_TEXT_SEARCH_FLAGS)) #define RVAL2GTKTOOLPALETTEDRAGTARGETS(o) (RVAL2GFLAGS(o, GTK_TYPE_TOOL_PALETTE_DRAG_TARGETS)) #define GTKTOOLPALETTEDRAGTARGETS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_TOOL_PALETTE_DRAG_TARGETS)) #define RVAL2GTKTREEMODELFLAGS(o) (RVAL2GFLAGS(o, GTK_TYPE_TREE_MODEL_FLAGS)) #define GTKTREEMODELFLAGS2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_TREE_MODEL_FLAGS)) #define RVAL2GTKUIMANAGERITEMTYPE(o) (RVAL2GFLAGS(o, GTK_TYPE_UI_MANAGER_ITEM_TYPE)) #define GTKUIMANAGERITEMTYPE2RVAL(o) (GFLAGS2RVAL(o, GTK_TYPE_UI_MANAGER_ITEM_TYPE)) #endif /* __RBGTK3CONVERSIONS_H__ */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-view.c�����������������������������������������������0000644�0001750�0001750�00000005672�12257552167�020314� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005,2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCellView #define _SELF(self) (RVAL2GTKCELLVIEW(self)) static ID id_model; static ID id_text; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE text; VALUE with_markup = Qnil; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "02", &text, &with_markup); if (NIL_P(text)) { widget = gtk_cell_view_new(); } else { G_CHILD_SET(self, id_text, text); if (TYPE(text) == T_STRING){ if (NIL_P(with_markup) || RVAL2CBOOL(with_markup)){ widget = gtk_cell_view_new_with_markup(RVAL2CSTR(text)); } else { widget = gtk_cell_view_new_with_text(RVAL2CSTR(text)); } } else if (rb_obj_is_kind_of(text, GTYPE2CLASS(GDK_TYPE_PIXBUF))){ widget = gtk_cell_view_new_with_pixbuf(RVAL2GDKPIXBUF(text)); } else { rb_raise(rb_eArgError, "invalid argument %s (expect String or Gdk::Pixbuf)", rb_class2name(CLASS_OF(text))); } } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_set_displayed_row(VALUE self, VALUE path) { gtk_cell_view_set_displayed_row(_SELF(self), NIL_P(path) ? (GtkTreePath*)NULL : RVAL2GTKTREEPATH(path)); return self; } static VALUE rg_displayed_row(VALUE self) { return GTKTREEPATH2RVAL(gtk_cell_view_get_displayed_row(_SELF(self))); } /* Use Gtk::CellView#background_gdk(Gdk::Color) instead. void gtk_cell_view_set_background_color (GtkCellView *cell_view, const GdkColor *color); */ 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); RG_DEF_METHOD(displayed_row, 0); } ����������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-drawing-area.c��������������������������������������������0000644�0001750�0001750�00000002605�12102213527�020736� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cDrawingArea static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_drawing_area_new()); return Qnil; } void Init_gtk_drawing_area(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_DRAWING_AREA, "DrawingArea", mGtk); RG_DEF_METHOD(initialize, 0); } ���������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-menu-item.c�����������������������������������������������0000644�0001750�0001750�00000005403�12102213527�020274� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cMenuItem #define _SELF(s) (RVAL2GTKMENUITEM(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { const gchar *label = NULL; VALUE rb_label, use_underline; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "02", &rb_label, &use_underline); if (!NIL_P(rb_label)) label = RVAL2CSTR(rb_label); if (label) { if (NIL_P(use_underline) || RVAL2CBOOL(use_underline)) { widget = gtk_menu_item_new_with_mnemonic(label); } else { widget = gtk_menu_item_new_with_label(label); } } else { widget = gtk_menu_item_new(); } RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE mitem_set_submenu(VALUE self, VALUE child) { GtkMenuItem *item; GtkWidget *submenu; item = _SELF(self); submenu = gtk_menu_item_get_submenu(item); if (submenu) G_CHILD_REMOVE(self, GOBJ2RVAL(submenu)); gtk_menu_item_set_submenu(item, RVAL2GTKWIDGET(child)); G_CHILD_ADD(self, child); return self; } static VALUE rg_toggle_size_request(VALUE self) { gint requisition; gtk_menu_item_toggle_size_request(_SELF(self), &requisition); return INT2NUM(requisition); } static VALUE rg_toggle_size_allocate(VALUE self, VALUE allocation) { gtk_menu_item_toggle_size_allocate(_SELF(self), NUM2INT(allocation)); return self; } void Init_gtk_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_MENU_ITEM, "MenuItem", mGtk); RG_DEF_METHOD(initialize, -1); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "submenu", mitem_set_submenu, 1); RG_DEF_METHOD(toggle_size_request, 0); RG_DEF_METHOD(toggle_size_allocate, 1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-icon-size.c�����������������������������������������������0000644�0001750�0001750�00000005424�12102213527�020277� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 OGASAWARA, Takeshi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mIconSize static VALUE rg_s_lookup(G_GNUC_UNUSED VALUE self, VALUE size) { gint width, height; if(gtk_icon_size_lookup(RVAL2GTKICONSIZE(size), &width, &height)) return rb_ary_new3(2, INT2FIX(width), INT2FIX(height)); else return Qnil; } static VALUE rg_s_lookup_for_settings(G_GNUC_UNUSED VALUE self, VALUE settings, VALUE size) { gint width, height; if(gtk_icon_size_lookup_for_settings(RVAL2GTKSETTINGS(settings), RVAL2GTKICONSIZE(size), &width, &height)) return rb_ary_new3(2, INT2FIX(width), INT2FIX(height)); else return Qnil; } static VALUE rg_s_register(G_GNUC_UNUSED VALUE self, VALUE name, VALUE width, VALUE height) { /* XXXX FIXME This should be GENUM2RVAL */ return INT2FIX(gtk_icon_size_register(RVAL2CSTR(name), NUM2INT(width), NUM2INT(height))); } static VALUE rg_s_register_alias(G_GNUC_UNUSED VALUE self, VALUE alias, VALUE target) { gtk_icon_size_register_alias(RVAL2CSTR(alias), RVAL2GTKICONSIZE(target)); return Qnil; } static VALUE rg_s_from_name(G_GNUC_UNUSED VALUE self, VALUE name) { return INT2FIX(gtk_icon_size_from_name(RVAL2CSTR(name))); } static VALUE rg_s_get_name(G_GNUC_UNUSED VALUE self, VALUE size) { return CSTR2RVAL(gtk_icon_size_get_name(RVAL2GTKICONSIZE(size))); } void Init_gtk_icon_size(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGtk, "IconSize"); RG_DEF_SMETHOD(lookup, 1); RG_DEF_SMETHOD(lookup_for_settings, 2); RG_DEF_SMETHOD(register, 3); RG_DEF_SMETHOD(register_alias, 2); RG_DEF_SMETHOD(from_name, 1); RG_DEF_SMETHOD(get_name, 1); G_DEF_CLASS(GTK_TYPE_ICON_SIZE, "IconSize", RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-box.c�����������������������������������������������������0000644�0001750�0001750�00000011113�12102213527�017157� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cBox #define _SELF(self) (RVAL2GTKBOX(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE orientation, spacing; rb_scan_args(argc, argv, "11", &orientation, &spacing); RBGTK_INITIALIZE(self, gtk_box_new(RVAL2GTKORIENTATION(orientation), NIL_P(spacing) ? 0 : NUM2INT(spacing))); return Qnil; } static void box_pack_start_or_end(int argc, VALUE *argv, VALUE self, void (*func)(GtkBox *, GtkWidget *, gboolean, gboolean, guint)) { VALUE options, child, expand, fill, padding; rb_scan_args(argc, argv, "11", &child, &options); rbg_scan_options(options, "expand", &expand, "fill", &fill, "padding", &padding, NULL); func(_SELF(self), RVAL2GTKWIDGET(child), NIL_P(expand) ? TRUE : RVAL2CBOOL(expand), NIL_P(fill) ? TRUE : RVAL2CBOOL(fill), NIL_P(padding) ? 0 : NUM2UINT(padding)); G_CHILD_ADD(self, child); } static VALUE rg_pack_start(int argc, VALUE *argv, VALUE self) { box_pack_start_or_end(argc, argv, self, gtk_box_pack_start); return self; } static VALUE rg_pack_end(int argc, VALUE *argv, VALUE self) { box_pack_start_or_end(argc, argv, self, gtk_box_pack_end); return self; } static VALUE rg_reorder_child(VALUE self, VALUE child, VALUE pos) { gtk_box_reorder_child(_SELF(self), RVAL2GTKWIDGET(child), NUM2INT(pos)); return self; } static VALUE rg_query_child_packing(VALUE self, VALUE child) { gboolean expand, fill; guint padding; GtkPackType pack_type; VALUE ary; gtk_box_query_child_packing(_SELF(self), RVAL2GTKWIDGET(child), &expand, &fill, &padding, &pack_type); ary = rb_ary_new2(4); rb_ary_push(ary, expand == FALSE ? Qfalse : Qtrue); rb_ary_push(ary, fill == FALSE ? Qfalse : Qtrue); rb_ary_push(ary, INT2NUM(padding)); rb_ary_push(ary, GTKPACKTYPE2RVAL(pack_type)); return ary; } static VALUE rg_set_child_packing(int argc, VALUE *argv, VALUE self) { VALUE options, child, expand, fill, padding, pack_type; gboolean old_expand, old_fill; guint old_padding; GtkPackType old_pack_type; rb_scan_args(argc, argv, "11", &child, &options); rbg_scan_options(options, "expand", &expand, "fill", &fill, "padding", &padding, "pack_type", &pack_type, NULL); gtk_box_query_child_packing(_SELF(self), RVAL2GTKWIDGET(child), &old_expand, &old_fill, &old_padding, &old_pack_type); gtk_box_set_child_packing(_SELF(self), RVAL2GTKWIDGET(child), NIL_P(expand) ? old_expand : RVAL2CBOOL(expand), NIL_P(fill) ? old_fill : RVAL2CBOOL(fill), NIL_P(padding) ? old_padding : NUM2UINT(padding), NIL_P(pack_type) ? old_pack_type : (GtkPackType)RVAL2GTKPACKTYPE(pack_type)); return self; } void Init_gtk_box(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_BOX, "Box", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(pack_start, -1); RG_DEF_METHOD(pack_end, -1); RG_DEF_METHOD(reorder_child, 2); RG_DEF_METHOD(query_child_packing, 1); RG_DEF_METHOD(set_child_packing, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-style-provider.c������������������������������������������0000644�0001750�0001750�00000004350�12257552167�021405� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE mStyleProvider #define _SELF(self) (RVAL2GTKSTYLEPROVIDER(self)) static VALUE rg_get_icon_factory(VALUE self, VALUE path) { return GOBJ2RVAL(gtk_style_provider_get_icon_factory(_SELF(self), RVAL2GTKWIDGETPATH(path))); } static VALUE rg_get_style(VALUE self, VALUE path) { return GOBJ2RVAL(gtk_style_provider_get_style(_SELF(self), RVAL2GTKWIDGETPATH(path))); } static VALUE rg_get_style_property(VALUE self, VALUE path, VALUE state, VALUE pspec) { GValue value = G_VALUE_INIT; gboolean exist; VALUE property = Qnil; exist = gtk_style_provider_get_style_property(_SELF(self), RVAL2GTKWIDGETPATH(path), RVAL2GTKSTATEFLAGS(state), RVAL2GPARAMSPEC(pspec), &value); if (exist) { property = GVAL2RVAL_UNSET(&value); } return property; } void Init_gtk_styleprovider(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_TYPE_STYLE_PROVIDER, "StyleProvider", mGtk); RG_DEF_METHOD(get_icon_factory, 1); RG_DEF_METHOD(get_style, 1); RG_DEF_METHOD(get_style_property, 3); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-color-selection.c�����������������������������������������0000644�0001750�0001750�00000012762�12102213527�021503� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cColorSelection #define _SELF(self) (RVAL2GTKCOLORSELECTION(self)) static VALUE RG_TARGET_NAMESPACE; static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_color_selection_new()); return Qnil; } static VALUE rg_previous_alpha(VALUE self) { return INT2NUM(gtk_color_selection_get_previous_alpha(_SELF(self))); } static VALUE rg_set_previous_alpha(VALUE self, VALUE alpha) { gtk_color_selection_set_previous_alpha(_SELF(self), NUM2INT(alpha)); return self; } static VALUE rg_set_previous_color(VALUE self, VALUE color) { gtk_color_selection_set_previous_color(_SELF(self), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_previous_color(VALUE self) { GdkColor color; gtk_color_selection_get_previous_color(_SELF(self), &color); return GDKCOLOR2RVAL(&color); } static VALUE rg_adjusting_p(VALUE self) { return CBOOL2RVAL(gtk_color_selection_is_adjusting(_SELF(self))); } static VALUE rg_s_palette_from_string(G_GNUC_UNUSED VALUE self, VALUE str) { GdkColor* gcolors; gint i, n_colors; VALUE ary = Qnil; gboolean ret = gtk_color_selection_palette_from_string(RVAL2CSTR(str), &gcolors, &n_colors); if (ret) { ary = rb_ary_new(); for (i = 0; i < n_colors; i++) { rb_ary_push(ary, GDKCOLOR2RVAL(&gcolors[i])); } } return ary; } struct rbgdk_rval2gdkcolors_args { VALUE ary; long n; GdkColor *result; }; static VALUE rbgdk_rval2gdkcolors_body(VALUE value) { long i; struct rbgdk_rval2gdkcolors_args *args = (struct rbgdk_rval2gdkcolors_args *)value; for (i = 0; i < args->n; i++) args->result[i] = *RVAL2GDKCOLOR(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkcolors_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdkcolors_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GdkColor * rbgdk_rval2gdkcolors(VALUE value, long *n) { struct rbgdk_rval2gdkcolors_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GdkColor, args.n + 1); rb_rescue(rbgdk_rval2gdkcolors_body, (VALUE)&args, rbgdk_rval2gdkcolors_rescue, (VALUE)&args); if (n != NULL) *n = args.n; return args.result; } #define RVAL2GDKCOLORS(value, n) rbgdk_rval2gdkcolors(value, n) static VALUE rg_s_palette_to_string(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE rbcolors; long n; GdkColor *colors; gchar *palette; if (argc > 1) rb_scan_args(argc, argv, "*", &rbcolors); else rb_scan_args(argc, argv, "10", &rbcolors); colors = RVAL2GDKCOLORS(rbcolors, &n); palette = gtk_color_selection_palette_to_string(colors, n); g_free(colors); return CSTR2RVAL_FREE(palette); } static void screen_func(GdkScreen *screen, const GdkColor *colors, gint n_colors) { int i; VALUE func = rb_cvar_get(RG_TARGET_NAMESPACE, rb_intern("__palette_proc__")); VALUE ary = rb_ary_new(); for (i = 0; i < n_colors; i++){ ary = rb_ary_push(ary, GDKCOLOR2RVAL((GdkColor *)&colors[i])); } if (! NIL_P(func)) rb_funcall(func, id_call, 2, GOBJ2RVAL(screen), ary); } static VALUE rg_s_set_change_palette_hook(VALUE self) { VALUE func = rb_block_proc(); rb_cv_set(RG_TARGET_NAMESPACE, "__palette_proc__", func); gtk_color_selection_set_change_palette_with_screen_hook( (GtkColorSelectionChangePaletteWithScreenFunc)screen_func); return self; } static VALUE rg_previous_rgba(VALUE self) { GdkRGBA rgba; gtk_color_selection_get_previous_rgba(_SELF(self), &rgba); return GDKRGBA2RVAL(&rgba); } static VALUE rg_set_previous_rgba(VALUE self, VALUE rgba) { gtk_color_selection_set_previous_rgba(_SELF(self), RVAL2GDKRGBA(rgba)); return self; } void Init_gtk_color_selection(VALUE mGtk) { RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_COLOR_SELECTION, "ColorSelection", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(previous_alpha, 0); RG_DEF_METHOD(set_previous_alpha, 1); RG_DEF_METHOD(set_previous_color, 1); RG_DEF_METHOD(previous_color, 0); RG_DEF_METHOD_P(adjusting, 0); RG_DEF_SMETHOD(palette_to_string, -1); RG_DEF_SMETHOD(palette_from_string, 1); RG_DEF_SMETHOD(set_change_palette_hook, 0); RG_DEF_METHOD(previous_rgba, 0); RG_DEF_METHOD(set_previous_rgba, 1); } ��������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-image-menu-item.c�����������������������������������������0000644�0001750�0001750�00000004532�12102213527�021356� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cImageMenuItem static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE image; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "01", &image); if (NIL_P(image)) { widget = gtk_image_menu_item_new(); } else if (TYPE(image) == T_HASH) { VALUE label, mnemonic, stock_id, accel_group, buffer; rbg_scan_options(image, "label", &label, "mnemonic", &mnemonic, "stock_id", &stock_id, "accel_group", &accel_group, NULL); if (!NIL_P(label)) widget = gtk_image_menu_item_new_with_label(RVAL2CSTR(label)); else if (!NIL_P(mnemonic)) widget = gtk_image_menu_item_new_with_mnemonic(RVAL2CSTR(mnemonic)); else if (!NIL_P(stock_id)) widget = gtk_image_menu_item_new_from_stock(RVAL2GLIBID(stock_id, buffer), NIL_P(accel_group) ? NULL : RVAL2GTKACCELGROUP(accel_group)); } if (!widget) rb_raise(rb_eArgError, "Invalid arguments."); RBGTK_INITIALIZE(self, widget); return Qnil; } void Init_gtk_image_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_IMAGE_MENU_ITEM, "ImageMenuItem", mGtk); RG_DEF_METHOD(initialize, -1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-app-chooser-dialog.c��������������������������������������0000644�0001750�0001750�00000004454�12102213527�022056� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cAppChooserDialog #define _SELF(self) (RVAL2GTKAPPCHOOSERDIALOG(self)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE options, rb_parent, rb_file, rb_flags, rb_content_type; GtkWindow *parent; GtkDialogFlags flags; GtkWidget *widget = NULL; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "parent", &rb_parent, "flags", &rb_flags, "file", &rb_file, "content_type", &rb_content_type, NULL); parent = NIL_P(rb_parent) ? NULL : RVAL2GTKWINDOW(rb_parent); flags = NIL_P(rb_flags) ? 0 : RVAL2GTKDIALOGFLAGS(rb_flags); if (!NIL_P(rb_file)) widget = gtk_app_chooser_dialog_new(parent, flags, RVAL2GFILE(rb_file)); else widget = gtk_app_chooser_dialog_new_for_content_type(parent, flags, RVAL2CSTR(rb_content_type)); RBGTK_INITIALIZE(self, widget); return Qnil; } static VALUE rg_widget(VALUE self) { return GOBJ2RVAL(gtk_app_chooser_dialog_get_widget(_SELF(self))); } void Init_gtk_appchooserdialog(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_APP_CHOOSER_DIALOG, "AppChooserDialog", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(widget, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-separator-menu-item.c�������������������������������������0000644�0001750�0001750�00000002421�12102213527�022267� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cSeparatorMenuItem static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_separator_menu_item_new()); return Qnil; } void Init_gtk_separator_menu_item(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SEPARATOR_MENU_ITEM, "SeparatorMenuItem", mGtk); RG_DEF_METHOD(initialize, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-print-context.c�������������������������������������������0000644�0001750�0001750�00000006235�12102213527�021216� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cPrintContext #define _SELF(s) (RVAL2GTKPRINTCONTEXT(s)) #ifdef HAVE_RB_CAIRO_H #include <rb_cairo.h> /* Rendering */ static VALUE rg_cairo_context(VALUE self) { return CRCONTEXT2RVAL(gtk_print_context_get_cairo_context(_SELF(self))); } #endif static VALUE rg_page_setup(VALUE self) { return GOBJ2RVAL(gtk_print_context_get_page_setup(_SELF(self))); } static VALUE rg_width(VALUE self) { return rb_float_new(gtk_print_context_get_width(_SELF(self))); } static VALUE rg_height(VALUE self) { return rb_float_new(gtk_print_context_get_height(_SELF(self))); } static VALUE rg_dpi_x(VALUE self) { return rb_float_new(gtk_print_context_get_dpi_x(_SELF(self))); } static VALUE rg_dpi_y(VALUE self) { return rb_float_new(gtk_print_context_get_dpi_y(_SELF(self))); } /* Fonts */ static VALUE rg_pango_fontmap(VALUE self) { return GOBJ2RVAL(gtk_print_context_get_pango_fontmap(_SELF(self))); } static VALUE rg_create_pango_context(VALUE self) { return GOBJ2RVALU(gtk_print_context_create_pango_context(_SELF(self))); } static VALUE rg_create_pango_layout(VALUE self) { return GOBJ2RVALU(gtk_print_context_create_pango_layout(_SELF(self))); } /* Needed for preview implementations */ #ifdef HAVE_RB_CAIRO_H static VALUE rg_set_cairo_context(VALUE self, VALUE cr, VALUE dpi_x, VALUE dpi_y) { gtk_print_context_set_cairo_context(_SELF(self), RVAL2CRCONTEXT(cr), NUM2DBL(dpi_x), NUM2DBL(dpi_y)); return self; } #endif void Init_gtk_print_context(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_CONTEXT, "PrintContext", mGtk); /* Rendering */ #ifdef HAVE_RB_CAIRO_H RG_DEF_METHOD(cairo_context, 0); #endif RG_DEF_METHOD(page_setup, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(dpi_x, 0); RG_DEF_METHOD(dpi_y, 0); /* Fonts */ RG_DEF_METHOD(pango_fontmap, 0); RG_DEF_METHOD(create_pango_context, 0); RG_DEF_METHOD(create_pango_layout, 0); /* Needed for preview implementations */ #ifdef HAVE_RB_CAIRO_H RG_DEF_METHOD(set_cairo_context, 3); #endif } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-print-job.c�����������������������������������������������0000644�0001750�0001750�00000007225�12102213527�020304� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #ifdef HAVE_GTK_UNIX_PRINT #include <gtk/gtkunixprint.h> #ifndef GTK_TYPE_PRINT_CAPABILITIES # define GTK_TYPE_PRINT_CAPABILITIES (gtk_print_capabilities_get_type()) #endif #ifdef HAVE_RB_CAIRO_H # include <rb_cairo.h> #endif #define RG_TARGET_NAMESPACE cPrintJob #define _SELF(s) (RVAL2GTKPRINTJOB(s)) static VALUE RG_TARGET_NAMESPACE; static VALUE rg_initialize(VALUE self, VALUE title, VALUE printer, VALUE settings, VALUE page_setup) { GtkPrintJob *job; job = gtk_print_job_new(RVAL2CSTR(title), RVAL2GTKPRINTER(printer), RVAL2GTKPRINTSETTINGS(settings), RVAL2GTKPAGESETUP(page_setup)); G_INITIALIZE(self, job); return Qnil; } static VALUE rg_status(VALUE self) { return GTKPRINTSTATUS2RVAL(gtk_print_job_get_status(_SELF(self))); } static VALUE rg_set_source_file(VALUE self, VALUE filename) { GError *error = NULL; gboolean result; result = gtk_print_job_set_source_file(_SELF(self), RVAL2CSTR(filename), &error); if (!result) RAISE_GERROR(error); return Qnil; } #ifdef HAVE_RB_CAIRO_H static VALUE rg_surface(VALUE self) { cairo_surface_t *surface; GError *error = NULL; surface = gtk_print_job_get_surface(_SELF(self), &error); if (error) RAISE_GERROR(error); return CRSURFACE2RVAL(surface); } #endif struct callback_arg { VALUE callback; VALUE job; GError* error; }; static VALUE invoke_callback(VALUE data) { struct callback_arg *arg = (struct callback_arg *)data; if (arg->error) RAISE_GERROR(arg->error); rb_funcall(arg->callback, id_call, 1, arg->job); return Qnil; } static void complete_func(GtkPrintJob *job, gpointer data, const GError *error) { struct callback_arg arg; arg.callback = (VALUE)data; arg.job = GOBJ2RVAL(job); arg.error = error; G_PROTECT_CALLBACK(invoke_callback, &arg); } static void remove_callback_reference(gpointer data) { G_CHILD_REMOVE(RG_TARGET_NAMESPACE, (VALUE)data); } static VALUE rg_send(VALUE self) { VALUE block = rb_block_proc(); G_CHILD_ADD(RG_TARGET_NAMESPACE, block); gtk_print_job_send(_SELF(self), complete_func, (gpointer)block, remove_callback_reference); return self; } #endif void Init_gtk_print_job(VALUE mGtk) { #ifdef HAVE_GTK_UNIX_PRINT RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_PRINT_JOB, "PrintJob", mGtk); G_DEF_CLASS(GTK_TYPE_PRINT_CAPABILITIES, "PrintCapabilities", mGtk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(status, 0); RG_DEF_METHOD(set_source_file, 1); #ifdef HAVE_RB_CAIRO_H RG_DEF_METHOD(surface, 0); #endif RG_DEF_METHOD(send, 0); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-recent-filter.c�������������������������������������������0000644�0001750�0001750�00000010257�12102213527�021142� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cRecentFilter #define _SELF(self) (RVAL2GTKRECENTFILTER(self)) static VALUE rb_mGtk; static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_recent_filter_new()); return Qnil; } static VALUE rg_name(VALUE self) { return CSTR2RVAL(gtk_recent_filter_get_name(_SELF(self))); } static VALUE rg_set_name(VALUE self, VALUE name) { gtk_recent_filter_set_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_add_mime_type(VALUE self, VALUE mime_type) { gtk_recent_filter_add_mime_type(_SELF(self), RVAL2CSTR(mime_type)); return self; } static VALUE rg_add_pattern(VALUE self, VALUE pattern) { gtk_recent_filter_add_pattern(_SELF(self), RVAL2CSTR(pattern)); return self; } static VALUE rg_add_pixbuf_formats(VALUE self) { gtk_recent_filter_add_pixbuf_formats(_SELF(self)); return self; } static VALUE rg_add_application(VALUE self, VALUE application) { gtk_recent_filter_add_application(_SELF(self), RVAL2CSTR(application)); return self; } static VALUE rg_add_group(VALUE self, VALUE group) { gtk_recent_filter_add_group(_SELF(self), RVAL2CSTR(group)); return self; } static VALUE rg_add_age(VALUE self, VALUE days) { gtk_recent_filter_add_age(_SELF(self), NUM2INT(days)); return self; } struct callback_arg { VALUE callback; VALUE info; }; static VALUE invoke_callback(VALUE arg_) { struct callback_arg *arg = (struct callback_arg *)arg_; return rb_funcall(arg->callback, id_call, 1, arg->info); } static gboolean filter_func(const GtkRecentFilterInfo *info, gpointer func) { VALUE result; struct callback_arg arg; arg.callback = (VALUE)func; arg.info = GTKRECENTFILTERINFO2RVAL((gpointer)info); result = G_PROTECT_CALLBACK(invoke_callback, &arg); return NIL_P(rb_errinfo()) ? TRUE : RVAL2CBOOL(result); } static void remove_callback_reference(gpointer data) { G_CHILD_REMOVE(rb_mGtk, (VALUE)data); } static VALUE rg_add_custom(VALUE self, VALUE needed) { VALUE func = rb_block_proc(); G_CHILD_ADD(rb_mGtk, func); gtk_recent_filter_add_custom(_SELF(self), RVAL2GTKRECENTFILTERFLAGS(needed), (GtkRecentFilterFunc)filter_func, (gpointer)func, (GDestroyNotify)remove_callback_reference); return self; } static VALUE rg_needed(VALUE self) { return GTKRECENTFILTERFLAGS2RVAL(gtk_recent_filter_get_needed(_SELF(self))); } static VALUE rg_filter(VALUE self, VALUE filter_info) { return CBOOL2RVAL(gtk_recent_filter_filter(_SELF(self), RVAL2GTKRECENTFILTERINFO(filter_info))); } void Init_gtk_recent_filter(VALUE mGtk) { rb_mGtk = mGtk; VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_RECENT_FILTER, "RecentFilter", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(set_name, 1); RG_DEF_METHOD(add_mime_type, 1); RG_DEF_METHOD(add_pattern, 1); RG_DEF_METHOD(add_pixbuf_formats, 0); RG_DEF_METHOD(add_application, 1); RG_DEF_METHOD(add_group, 1); RG_DEF_METHOD(add_age, 1); RG_DEF_METHOD(add_custom, 1); RG_DEF_METHOD(needed, 0); RG_DEF_METHOD(filter, 1); G_DEF_CLASS(GTK_TYPE_RECENT_FILTER_FLAGS, "Flags", RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-cell-renderer-combo.c�������������������������������������0000644�0001750�0001750�00000002412�12102213527�022211� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cCellRendererCombo static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_cell_renderer_combo_new()); return Qnil; } void Init_gtk_cellrenderercombo(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_CELL_RENDERER_COMBO, "CellRendererCombo", mGtk); RG_DEF_METHOD(initialize, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/ext/gtk3/rbgtk-selection-data.c������������������������������������������0000644�0001750�0001750�00000016253�12102213527�021275� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtk3private.h" #define RG_TARGET_NAMESPACE cSelectionData #define _SELF(d) (RVAL2GTKSELECTIONDATA(d)) static GdkAtom compound_text; /************************************************************************/ void rbgtk_atom2selectiondata(VALUE type, VALUE size, VALUE src, GdkAtom *gtype, void **data, gint *format, gint *length) { void* dat = NULL; gint fmt, len; GdkAtom ntype = RVAL2ATOM(type); if(ntype == GDK_SELECTION_TYPE_INTEGER){ int *i; i = ALLOC(int); *i = NUM2INT(src); dat = i; fmt = sizeof(int) * 8; len = 1; } else if(ntype == GDK_SELECTION_TYPE_STRING) { dat = (void *)RVAL2CSTR(src); if (NIL_P(size)) { fmt = sizeof(char) * 8; len = RSTRING_LEN(src); } else { len = NUM2UINT(size); fmt = (RSTRING_LEN(src) / len) * 8; } /* TODO } else if(ntype == compound_text){ guchar* str = (guchar*)dat; gdk_string_to_compound_text(RVAL2CSTR(src), &ntype, &fmt, &str, &len); */ } else if(type != Qnil && size != Qnil && src != Qnil) { dat = (void *)RVAL2CSTR(src); fmt = NUM2INT(size); len = (RSTRING_LEN(src) * sizeof(char) / fmt); } else { rb_raise(rb_eArgError, "no supported type."); } *gtype = ntype; *data = dat; *format = fmt; *length = len; } void rbgtk_atom2selectiondata_free(GdkAtom type, void *dat) { if (type == GDK_SELECTION_TYPE_INTEGER || type == GDK_SELECTION_TYPE_ATOM) { xfree(dat); /* TODO } else if(type == compound_text) { gdk_free_compound_text(dat); */ } } /************************************************************************/ static VALUE rg_selection(VALUE self) { return GDKATOM2RVAL(gtk_selection_data_get_selection(_SELF(self))); } static VALUE rg_target(VALUE self) { return GDKATOM2RVAL(gtk_selection_data_get_target(_SELF(self))); } static VALUE rg_data_type(VALUE self) { return GDKATOM2RVAL(gtk_selection_data_get_data_type(_SELF(self))); } static VALUE rg_format(VALUE self) { return INT2NUM(gtk_selection_data_get_format(_SELF(self))); } static VALUE rg_data(VALUE self) { return RBG_STRING_SET_UTF8_ENCODING(rb_str_new((const gchar *)gtk_selection_data_get_data(_SELF(self)), gtk_selection_data_get_length(_SELF(self)))); } static VALUE rg_display(VALUE self) { return GOBJ2RVAL(gtk_selection_data_get_display(_SELF(self))); } static VALUE rg_set(int argc, VALUE *argv, VALUE self) { void* dat; VALUE type, src; gint fmt, len; GdkAtom ntype; VALUE size = Qnil; if(3 == argc) rb_scan_args(argc, argv, "30", &type, &size, &src); else rb_scan_args(argc, argv, "20", &type, &src); rbgtk_atom2selectiondata(type, size, src, &ntype, &dat, &fmt, &len); gtk_selection_data_set(_SELF(self), ntype, fmt, dat, len); rbgtk_atom2selectiondata_free(ntype, dat); return self; } static VALUE rg_set_text(VALUE self, VALUE str) { StringValue(str); if (!gtk_selection_data_set_text(_SELF(self), RSTRING_PTR(str), RSTRING_LEN(str))) rb_raise(rb_eRuntimeError, "the selection wasn't successfully set"); return self; } static VALUE rg_text(VALUE self) { return CSTR2RVAL_FREE((gchar *)gtk_selection_data_get_text(_SELF(self))); } static VALUE rg_set_pixbuf(VALUE self, VALUE pixbuf) { if (!gtk_selection_data_set_pixbuf(_SELF(self), RVAL2GDKPIXBUF(pixbuf))) rb_raise(rb_eRuntimeError, "the selection wasn't successfully set"); return self; } static VALUE rg_pixbuf(VALUE self) { return GOBJ2RVAL(gtk_selection_data_get_pixbuf(_SELF(self))); } static VALUE rg_set_uris(VALUE self, VALUE uris) { gboolean ret; gchar **guris; guris = (gchar **)RVAL2STRV(uris); ret = gtk_selection_data_set_uris(_SELF(self), guris); g_free(guris); if (!ret) rb_raise(rb_eRuntimeError, "the selection wasn't successfully."); return self; } static VALUE rg_uris(VALUE self) { VALUE ary = rb_ary_new(); gchar** uris = gtk_selection_data_get_uris(_SELF(self)); if (uris) { gchar **uri = uris; while (*uri) { rb_ary_push(ary, CSTR2RVAL(*uri)); uri++; } g_strfreev(uris); } return ary; } static VALUE rg_targets(VALUE self) { GdkAtom* targets; gint n_atoms; VALUE result = Qnil; gboolean ret = gtk_selection_data_get_targets(_SELF(self), &targets, &n_atoms); if (ret) { int i; result = rb_ary_new2(n_atoms); for (i = 0; i < n_atoms; i++){ rb_ary_push(result, GDKATOM2RVAL(targets[i])); } } g_free(targets); return result; } static VALUE rg_targets_include_image(VALUE self, VALUE writable) { return CBOOL2RVAL(gtk_selection_data_targets_include_image(_SELF(self), RVAL2CBOOL(writable))); } static VALUE rg_targets_include_text(VALUE self) { return CBOOL2RVAL(gtk_selection_data_targets_include_text(_SELF(self))); } static VALUE rg_targets_include_uri(VALUE self) { return CBOOL2RVAL(gtk_selection_data_targets_include_uri(_SELF(self))); } static VALUE rg_targets_include_rich_text(VALUE self, VALUE buffer) { return CBOOL2RVAL(gtk_selection_data_targets_include_rich_text(_SELF(self), RVAL2GTKTEXTBUFFER(buffer))); } void Init_gtk_selectiondata(VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SELECTION_DATA, "SelectionData", mGtk); rbgobj_boxed_not_copy_obj(GTK_TYPE_SELECTION_DATA); compound_text = gdk_atom_intern("COMPOUND_TEXT", FALSE); RG_DEF_METHOD(selection, 0); RG_DEF_METHOD(target, 0); RG_DEF_METHOD(data_type, 0); RG_DEF_METHOD(format, 0); RG_DEF_METHOD(data, 0); RG_DEF_METHOD(display, 0); RG_DEF_METHOD(set, -1); RG_DEF_METHOD(text, 0); RG_DEF_METHOD(set_text, 1); RG_DEF_METHOD(pixbuf, 0); RG_DEF_METHOD(set_pixbuf, 1); RG_DEF_METHOD(uris, 0); RG_DEF_METHOD(set_uris, 1); RG_DEF_METHOD(targets_include_image, 1); RG_DEF_METHOD(targets, 0); RG_DEF_METHOD(targets_include_text, 0); RG_DEF_METHOD(targets_include_uri, 0); RG_DEF_METHOD(targets_include_rich_text, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/COPYING.LIB��������������������������������������������������������������0000644�0001750�0001750�00000063642�12257552167�015143� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/lib/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�014214� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/lib/gtk3/����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552170�015100� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/lib/gtk3/deprecated.rb���������������������������������������������������0000644�0001750�0001750�00000120167�12257552170�017534� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������module Gtk extend GLib::Deprecatable define_deprecated_const :Combo, :raise => "Use 'Gtk::ComboBoxText' instead." define_deprecated_const :ComboBoxEntry, :raise => "Use 'Gtk::ComboBox' instead." define_deprecated_const :Curve, :raise => "Don't use this widget anymore." define_deprecated_const :FileSelection, :raise => "Use 'Gtk::FileChooserDialog' instead." define_deprecated_const :FontSelection, :raise => "Use 'Gtk::FontChooserWidget' instead." define_deprecated_const :FontSelectionDialog, :raise => "Use 'Gtk::FontChooserDialog' instead." define_deprecated_const :GammaCurve, :raise => "Don't use this widget anymore." define_deprecated_const :HRuler, :raise => "Don't use this widget anymore." define_deprecated_const :InputDialog, :raise => "Don't use this widget anymore." define_deprecated_const :ItemFactory, :raise => "Use 'Gtk::UIManager' instead." define_deprecated_const :OptionMenu, :raise => "Use 'Gtk::ComboBox' instead." define_deprecated_const :RC, :raise => "Use 'Gtk::StyleContext' instead." define_deprecated_const :RcStyle, :raise => "Use 'Gtk::CssProvider' instead." define_deprecated_const :Ruler, :raise => "Don't use this widget anymore." define_deprecated_const :Style, :raise => "Use 'Gtk::StyleContext' instead." define_deprecated_const :Tooltips, :raise => "Use 'Gtk::Tooltip' API." define_deprecated_const :VRuler, :raise => "Don't use this widget anymore." define_deprecated_flags :AccelFlags, 'ACCEL' define_deprecated_flags :AttachOptions define_deprecated_enums :CornerType, 'CORNER' define_deprecated_enums :DeleteType, 'DELETE' define_deprecated_enums :DirectionType, 'DIR' define_deprecated_enums :ExpanderStyle, 'EXPANDER' define_deprecated_enums :Justification, 'JUSTIFY' define_deprecated_enums :MovementStep, 'MOVEMENT' define_deprecated_enums :Orientation, 'ORIENTATION' define_deprecated_enums :PackType, 'PACK' define_deprecated_enums :PathPriorityType, 'PATH_PRIO' define_deprecated_enums :PathType, 'PATH' define_deprecated_enums :PolicyType, 'POLICY' define_deprecated_enums :PositionType, 'POS' define_deprecated_enums :ReliefStyle, 'RELIEF' define_deprecated_enums :ResizeMode, 'RESIZE' define_deprecated_enums :ScrollStep, 'SCROLL' define_deprecated_enums :ScrollType, 'SCROLL' define_deprecated_enums :SelectionMode, 'SELECTION' define_deprecated_enums :ShadowType, 'SHADOW' define_deprecated_enums :StateType, 'STATE' define_deprecated_enums :SortType, 'SORT' define_deprecated_const :AnchorType define_deprecated_const :ANCHOR_CENTER define_deprecated_const :ANCHOR_NORTH define_deprecated_const :ANCHOR_NORTH_WEST define_deprecated_const :ANCHOR_NORTH_EAST define_deprecated_const :ANCHOR_SOUTH define_deprecated_const :ANCHOR_SOUTH_WEST define_deprecated_const :ANCHOR_SOUTH_EAST define_deprecated_const :ANCHOR_WEST define_deprecated_const :ANCHOR_EAST define_deprecated_const :ANCHOR_N define_deprecated_const :ANCHOR_NW define_deprecated_const :ANCHOR_NE define_deprecated_const :ANCHOR_S define_deprecated_const :ANCHOR_SW define_deprecated_const :ANCHOR_SE define_deprecated_const :ANCHOR_W define_deprecated_const :ANCHOR_E define_deprecated_const :UpdateType define_deprecated_const :UPDATE_CONTINUOUS define_deprecated_const :UPDATE_DISCONTINUOUS define_deprecated_const :UPDATE_DELAYED define_deprecated_singleton_method :init_add, :warn => "Don't use this method." define_deprecated_singleton_method :quit_add, :warn => "Don't use this method." define_deprecated_singleton_method :quit_remove, :warn => "Don't use this method." define_deprecated_singleton_method :get_event_widget, :warn => "Use 'Gdk::Event#event_widget'." do |_self, event| event && event.event_widget end define_deprecated_singleton_method :timeout_add, :warn => "Use 'GLib::Timeout.add'." do |_self, interval, &block| GLib::Timeout.add(interval, &block) end define_deprecated_singleton_method :timeout_remove, :warn => "Use 'GLib::Source.remove'." do |_self, id| GLib::Source.remove(id) end define_deprecated_singleton_method :idle_add, :warn => "Use 'GLib::Idle.add'." do |_self, &block| GLib::Idle.add(&block) end define_deprecated_singleton_method :idle_add_priority, :warn => "Use 'GLib::Idle.add'." do |_self, priority, &block| GLib::Idle.add(priority, &block) end define_deprecated_singleton_method :idle_remove, :warn => "Use 'GLib::Source.remove'." do |_self, id| GLib::Source.remove(id) end class AboutDialog extend GLib::Deprecatable define_deprecated_singleton_method :set_email_hook, :warn => "Use 'activate-link' signal." define_deprecated_singleton_method :set_url_hook, :warn => "Use 'activate-link' signal." end class Action extend GLib::Deprecatable define_deprecated_method :connect_proxy, :warn => "Use 'Gtk::Activatable#set_related_action'." define_deprecated_method :disconnect_proxy, :warn => "Use 'Gtk::Activatable#set_related_action'." define_deprecated_method :block_activate_from, :warn => "Don't use this method." define_deprecated_method :unblock_activate_from, :warn => "Don't use this method." define_deprecated_method_by_hash_args :initialize, 'name, label, tooltip = nil, stock_id = nil', 'name, :label => nil, :tooltip => nil, :stock_id => nil', 1 do |_self, name, label, tooltip, stock_id| [name, {:label => label, :tooltip => tooltip, :stock_id => stock_id}] end end class Arrow extend GLib::Deprecatable define_deprecated_enums :Type end class Assistant extend GLib::Deprecatable define_deprecated_enums :PageType, 'PAGE' define_deprecated_method :set_page_header_image, :warn => "Don't use this method." define_deprecated_method :get_page_header_image, :warn => "Don't use this method." define_deprecated_method :set_page_side_image, :warn => "Don't use this method." define_deprecated_method :get_page_side_image, :warn => "Don't use this method." end class BindingSet extend GLib::Deprecatable define_deprecated_method :entry_clear, :entry_remove define_deprecated_method :add_path, :raise => "Don't use this method." end class Box extend GLib::Deprecatable define_deprecated_method :pack_start_defaults, :pack_start define_deprecated_method :pack_end_defaults, :pack_end define_deprecated_method_by_hash_args :pack_start, 'child, expand = true, fill = true, padding = 0', 'child, :expand => true, :fill => true, :padding => 0', 1 do |_self, child, expand, fill, padding| [child, {:expand => expand, :fill => fill, :padding => padding}] end define_deprecated_method_by_hash_args :pack_end, 'child, expand = true, fill = true, padding = 0', 'child, :expand => true, :fill => true, :padding => 0', 1 do |_self, child, expand, fill, padding| [child, {:expand => expand, :fill => fill, :padding => padding}] end define_deprecated_method_by_hash_args :set_child_packing, 'child, expand, fill, padding, pack_type', 'child, :expand => nil, :fill => nil, :padding => nil, :pack_type => nil', 1 do |_self, child, expand, fill, padding, pack_type| [child, {:expand => expand, :fill => fill, :padding => padding, :pack_type => pack_type}] end end class Button extend GLib::Deprecatable define_deprecated_method :enter, :warn => "Don't use this method." define_deprecated_method :leave, :warn => "Don't use this method." define_deprecated_method :pressed, :warn => "Don't use this method." define_deprecated_method :released, :warn => "Don't use this method." define_deprecated_signal :enter, :warn => "Use 'Gtk::Widget::enter-notify-event' signal." define_deprecated_signal :leave, :warn => "Use 'Gtk::Widget::leave-notify-event' signal." define_deprecated_signal :pressed, :warn => "Use 'Gtk::Widget::button-press-event' signal." define_deprecated_signal :released, :warn => "Use 'Gtk::Widget::button-release-event' signal." define_deprecated_method_by_hash_args :initialize, 'label_or_stock_id, use_underline = nil', ':label => nil, :mnemonic => nil, :stock_id => nil' do |_self, label_or_stock_id, use_underline| case label_or_stock_id when String if use_underline [{:mnemonic => label_or_stock_id}] else [{:label => label_or_stock_id}] end when Symbol [{:stock_id => label_or_stock_id}] else [label_or_stock_id] end end end class ButtonBox extend GLib::Deprecatable define_deprecated_enums :Style end class Calendar extend GLib::Deprecatable define_deprecated_flags :DisplayOptions define_deprecated_method :freeze, :warn => "Don't use this method." define_deprecated_method :thaw, :warn => "Don't use this method." end class CellRenderer extend GLib::Deprecatable define_deprecated_enums :Mode, 'MODE' define_deprecated_flags :State define_deprecated_method :editing_canceled, :warn => "Use '#{self}#stop_editing'." do |_self| _self.stop_editing(true) end define_deprecated_method :get_size, :raise => "Use Gtk::Renderer#get_preferred_size." end class CellRendererAccel extend GLib::Deprecatable define_deprecated_enums :Mode, 'MODE' end class CellView extend GLib::Deprecatable define_deprecated_method :cell_renderers, :warn => "Use 'Gtk::CellLayout#cells'." do |_self| _self.cells end define_deprecated_method :get_size_of_row, :raise => "Use Gtk::Renderer#get_preferred_size." end class ColorSelectionDialog extend GLib::Deprecatable define_deprecated_method :colorsel, :color_selection define_deprecated_method_by_hash_args :initialize, 'title', ':title => nil' do |_self, title| [{:title => title}] end end class ComboBox extend GLib::Deprecatable define_deprecated_method :append_text, :raise => "Use 'Gtk::ComboBoxText#append_text'." define_deprecated_method :insert_text, :raise => "Use 'Gtk::ComboBoxText#insert_text'." define_deprecated_method :prepend_text, :raise => "Use 'Gtk::ComboBoxText#prepend_text'." define_deprecated_method :remove_text, :raise => "Use 'Gtk::ComboBoxText#remove'." define_deprecated_method :active_text, :raise => "Use 'Gtk::ComboBoxText#active_text'." define_deprecated_method_by_hash_args :initialize, 'model', ':entry => false, :model => nil, :area => nil' do |_self, model| case model when TreeModel [{:model => model}] when true, false raise GLib::DeprecatedError.new("#{caller[0]}: '#{self}#initialize(is_text_only)' style has been deprecated. Use 'Gtk::ComboBoxText'.") end end end class Dialog extend GLib::Deprecatable define_deprecated_flags :Flags define_deprecated_const :ResponseType, 'Gtk::ResponseType' define_deprecated_enums 'Gtk::ResponseType', 'RESPONSE' define_deprecated_method :vbox, :child define_deprecated_method_by_hash_args :initialize, 'title, parent, flags, *buttons', ':title => nil, :parent => nil, :flags => 0, :buttons => nil' do |_self, title, parent, flags, *buttons| [{:title => title, :parent => parent, :flags => flags, :buttons => buttons}] end end module Drag extend GLib::Deprecatable define_deprecated_flags :DestDefaults, 'DEST_DEFAULT' define_deprecated_flags :TargetFlags, 'TARGET' define_deprecated_singleton_method :finish, :warn => "Use 'Gdk::DragContext#finish'." do |_self, context, success, del, time| context.finish(success, del, time) end define_deprecated_singleton_method :set_icon_default, :warn => "Use 'Gdk::DragContext#set_icon_default'." do |_self, context| context.set_icon_default end define_deprecated_singleton_method :set_icon_name, :warn => "Use 'Gdk::DragContext#set_icon'." do |_self, context, name, hot_x, hot_y| context.set_icon(:name => name, :hot_x => hot_x, :hot_y => hot_y) end define_deprecated_singleton_method :set_icon, :warn => "Use 'Gdk::DragContext#set_icon'." do |_self, context, icon, hot_x, hot_y| case icon when Symbol context.set_icon(:stock_id => icon, :hot_x => hot_x, :hot_y => hot_y) when Gdk::Pixbuf context.set_icon(:pixbuf => icon, :hot_x => hot_x, :hot_y => hot_y) when Gtk::Widget context.set_icon(:widget => icon, :hot_x => hot_x, :hot_y => hot_y) end end define_deprecated_singleton_method :dest_set, :warn => "Use 'Gtk::Widget#drag_dest_set'." do |_self, widget, flags, targets, actions| widget.drag_dest_set(flags, targets, actions) end define_deprecated_singleton_method :dest_set_proxy, :warn => "Use 'Gtk::Widget#drag_dest_set_proxy'." do |_self, widget, proxy_window, protocol, use_coordinates| widget.drag_dest_set_proxy(proxy_window, protocol, use_coordinates) end define_deprecated_singleton_method :dest_unset, :warn => "Use 'Gtk::Widget#drag_dest_unset'." do |_self, widget| widget.drag_dest_unset end define_deprecated_singleton_method :dest_find_target, :warn => "Use 'Gtk::Widget#drag_dest_find_target'." do |_self, widget, context, target_list| widget.drag_dest_find_target(context, target_list) end define_deprecated_singleton_method :dest_get_target_list, :warn => "Use 'Gtk::Widget#drag_dest_get_target_list'." do |_self, widget| widget.drag_dest_get_target_list end define_deprecated_singleton_method :dest_set_target_list, :warn => "Use 'Gtk::Widget#drag_dest_set_target_list'." do |_self, widget, target_list| widget.drag_dest_set_target_list(target_list) end define_deprecated_singleton_method :dest_add_text_targets, :warn => "Use 'Gtk::Widget#drag_dest_add_text_targets'." do |_self, widget| widget.drag_dest_add_text_targets end define_deprecated_singleton_method :dest_add_image_targets, :warn => "Use 'Gtk::Widget#drag_dest_add_image_targets'." do |_self, widget| widget.drag_dest_add_image_targets end define_deprecated_singleton_method :dest_add_uri_targets, :warn => "Use 'Gtk::Widget#drag_dest_add_uri_targets'." do |_self, widget| widget.drag_dest_add_uri_targets end define_deprecated_singleton_method :dest_set_track_motion, :warn => "Use 'Gtk::Widget#drag_dest_set_track_motion'." do |_self, widget, track_motion| widget.drag_dest_set_track_motion(track_motion) end define_deprecated_singleton_method :dest_get_track_motion, :warn => "Use 'Gtk::Widget#drag_dest_get_track_motion'." do |_self, widget| widget.drag_dest_get_track_motion end define_deprecated_singleton_method :get_data, :warn => "Use 'Gtk::Widget#drag_get_data'." do |_self, widget, context, target, time| widget.drag_get_data(context, target, time) end define_deprecated_singleton_method :highlight, :warn => "Use 'Gtk::Widget#drag_highlight'." do |_self, widget| widget.drag_highlight end define_deprecated_singleton_method :unhighlight, :warn => "Use 'Gtk::Widget#drag_unhighlight'." do |_self, widget| widget.drag_unhighlight end define_deprecated_singleton_method :begin, :warn => "Use 'Gtk::Widget#drag_begin'." do |_self, widget, target_list, actions, button, event| widget.drag_begin(target_list, actions, button, event) end define_deprecated_singleton_method :threshold?, :warn => "Use 'Gtk::Widget#drag_threshold?'." do |_self, widget, start_x, start_y, current_x, current_y| widget.drag_threshold?(start_x, start_y, current_x, current_y) end define_deprecated_singleton_method :source_set, :warn => "Use 'Gtk::Widget#drag_source_set'." do |_self, widget, start_button_mask, targets, actions| widget.drag_source_set(start_button_mask, targets, actions) end define_deprecated_singleton_method :source_set_icon, :warn => "Use 'Gtk::Widget#drag_source_set_icon(:stock_id => nil, :pixbuf => nil)'." do |_self, widget, icon| case icon when Symbol widget.drag_source_set_icon(:stock_id => icon) else widget.drag_source_set_icon(:pixbuf => icon) end end define_deprecated_singleton_method :source_set_icon_name, :warn => "Use 'Gtk::Widget#drag_source_set_icon(:icon_name => nil)'." do |_self, widget, icon| widget.drag_source_set_icon(:icon_name => icon) end define_deprecated_singleton_method :source_unset, :warn => "Use 'Gtk::Widget#drag_source_unset'." do |_self, widget| widget.drag_source_unset end define_deprecated_singleton_method :source_set_target_list, :warn => "Use 'Gtk::Widget#drag_source_set_target_list'." do |_self, widget, target_list| widget.drag_source_set_target_list(target_list) end define_deprecated_singleton_method :source_get_target_list, :warn => "Use 'Gtk::Widget#drag_source_get_target_list'." do |_self, widget| widget.drag_source_get_target_list end define_deprecated_singleton_method :source_add_text_targets, :warn => "Use 'Gtk::Widget#drag_source_add_text_targets'." do |_self, widget| widget.drag_source_add_text_targets end define_deprecated_singleton_method :source_add_image_targets, :warn => "Use 'Gtk::Widget#drag_source_add_image_targets'." do |_self, widget| widget.drag_source_add_image_targets end define_deprecated_singleton_method :source_add_uri_targets, :warn => "Use 'Gtk::Widget#drag_source_add_uri_targets'." do |_self, widget| widget.drag_source_add_uri_targets end end module FileChooser extend GLib::Deprecatable define_deprecated_enums :Action, 'ACTION' define_deprecated_enums :Confirmation, 'CONFIRMATION' end class FileChooserDialog extend GLib::Deprecatable define_deprecated_method_by_hash_args :initialize, 'title, parent, action, back, *buttons', ':title => nil, :parent => nil, :action => :open, :buttons => nil' do |_self, title, parent, action, back, *buttons| [{:title => title, :parent => parent, :action => action, :buttons => buttons}] end end class FileFilter extend GLib::Deprecatable define_deprecated_flags :Flags end class HBox extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Box.new(:horizontal, spacing)'." do |_self, homogeneous, spacing| Gtk::Box.new(:horizontal, spacing).set_homogeneous(homogeneous) end end class HButtonBox extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::ButtonBox.new(:horizontal)'." do |_self| Gtk::ButtonBox.new(:horizontal) end end class HPaned extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Paned.new(:horizontal)'." do |_self| Gtk::Paned.new(:horizontal) end end class HScale extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Scale.new(:horizontal, *args)'." do |_self, *args| Gtk::Scale.new(:horizontal, *args) end end class HScrollbar extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Scrollbar.new(:horizontal, adjustment)'." do |_self, adjustment| Gtk::Scrollbar.new(:horizontal, adjustment) end end class HSeparator extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Separator.new(:horizontal)'." do |_self| Gtk::Separator.new(:horizontal) end end class IconSet extend GLib::Deprecatable define_deprecated_method :render_icon, :raise => "Use '#{self}#render_icon_pixbuf'." end module IconSize extend GLib::Deprecatable define_deprecated_enums :IconSize end class IconTheme extend GLib::Deprecatable define_deprecated_flags :LookupFlags, 'LOOKUP' end class IconView extend GLib::Deprecatable define_deprecated_enums :Type end class Image extend GLib::Deprecatable define_deprecated_enums :Type define_deprecated_method :set, :warn => "Use '#{self}#set_stock', '#{self}#set_icon_name', '#{self}#set_icon_set', '#{self}#set_file', '#{self}#set_pixbuf' or '#{self}#set_pixbuf_animation'." define_deprecated_method_by_hash_args :initialize, 'image, size = nil', ':label => nil, :mnemonic => nil, :stock => nil, :size => nil' do |_self, image, size| case image when String if size [{:icon_name => image, :size => size}] else [{:file => image}] end when Symbol [{:stock => image, :size => size}] when Gtk::IconSet [{:icon_set => image, :size => size}] else [image] end end end class ImageMenuItem extend GLib::Deprecatable define_deprecated_method_by_hash_args :initialize, 'label_or_stock_id = nil, use_underline_or_accel_group = nil', ':label => nil, :mnemonic => nil, :stock_id => nil, :accel_group => nil' do |_self, label_or_stock_id, use_underline_or_accel_group| case label_or_stock_id when String if use_underline_or_accel_group [{:mnemonic => label_or_stock_id}] else [{:label => label_or_stock_id}] end when Symbol [{:stock_id => label_or_stock_id, :accel_group => use_underline_or_accel_group}] end end end class LinkButton extend GLib::Deprecatable define_deprecated_singleton_method :set_uri_hook, :warn => "Use 'clicked' signal." end class MenuBar extend GLib::Deprecatable define_deprecated_enums :PackDirection, 'PACK_DIRECTION' end class MenuItem extend GLib::Deprecatable define_deprecated_method :remove_submenu, :warn => "Use '#{self}#set_submenu'." do |_self| _self.set_submenu(nil) end end class MenuShell extend GLib::Deprecatable define_deprecated_enums :DirectionType, 'DIR' end class MenuToolButton extend GLib::Deprecatable define_deprecated_method_by_hash_args :initialize, 'icon_widget_or_stock_id = nil, label = nil', ':icon_widget => nil, :label => nil, :stock_id => nil' do |_self, icon_widget_or_stock_id, label| case icon_widget_or_stock_id when String, Symbol [{:stock_id => icon_widget_or_stock_id}] when Gtk::Widget [{:icon_widget => icon_widget_or_stock_id, :label => label}] end end end class MessageDialog extend GLib::Deprecatable define_deprecated_enums :ButtonsType, 'BUTTONS' define_deprecated_const :Type, 'Gtk::MessageType' define_deprecated_enums 'Gtk::MessageType' define_deprecated_method_by_hash_args :initialize, 'parent, flags, type, buttons_type, message', ':parent => nil, :flags => 0, :type => :info, :buttons_type => :ok, :message => ""' do |_self, parent, flags, type, buttons_type, message| [{:parent => parent, :flags => flags, :type => type, :buttons_type => buttons_type, :message => message}] end end class Notebook extend GLib::Deprecatable define_deprecated_singleton_method :set_window_creation_hook, :warn => "Use 'create-window' signal." define_deprecated_method :query_tab_label_packing, :warn => "Use 'tab-expand' and 'tab-fill' child property." do |_self, child| [_self.child_get_property(child, 'tab-expand'), _self.child_get_property(child, 'tab-fill')] end define_deprecated_method :set_tab_label_packing, :warn => "Use 'tab-expand' and 'tab-fill' child property." do |_self, child, expand, fill, pack_type| _self.child_set_property(child, 'tab-expand', expand) _self.child_set_property(child, 'tab-fill', fill) end end class PageSetupUnixDialog extend GLib::Deprecatable define_deprecated_method_by_hash_args :initialize, 'title, parent', ':title => nil, :parent => nil' do |_self, title, parent| [{:title => title, :parent => parent}] end end class PaperSize extend GLib::Deprecatable define_deprecated_enums :Unit, 'UNIT' end class PrintOperation extend GLib::Deprecatable define_deprecated_enums :Action, 'ACTION' define_deprecated_enums :Result, 'RESULT' define_deprecated_enums :Status, 'STATUS' end class PrintSettings extend GLib::Deprecatable define_deprecated_enums :PageOrientation, 'ORIENTATION' define_deprecated_enums :PageSet, 'PAGE_SET' define_deprecated_enums :PrintDuplex, 'DUPLEX' define_deprecated_enums :PrintPages, 'PAGES' define_deprecated_enums :PrintQuality, 'QUALITY' end class PrintUnixDialog extend GLib::Deprecatable define_deprecated_flags :Capabilities, 'CAPABILITY' define_deprecated_method_by_hash_args :initialize, 'title, parent', ':title => nil, :parent => nil' do |_self, title, parent| [{:title => title, :parent => parent}] end end class Paned extend GLib::Deprecatable %w(child1 child2).product(%w(resize shrink)).each do |child, prop| define_deprecated_method "#{child}_#{prop}?", :warn => "Use '#{prop}' child property." do |_self| _self.child_get_property(_self.send(child), prop) end end define_deprecated_method_by_hash_args :pack1, 'child, resize, shrink', 'child, :resize => false, :shrink => true', 1 do |_self, child, resize, shrink| [child, {:resize => resize, :shrink => shrink}] end define_deprecated_method_by_hash_args :pack2, 'child, resize, shrink', 'child, :resize => true, :shrink => true', 1 do |_self, child, resize, shrink| [child, {:resize => resize, :shrink => shrink}] end end class RadioAction extend GLib::Deprecatable define_deprecated_method_by_hash_args :initialize, 'name, label, tooltip, stock_id, value', 'name, value, :label => nil, :tooltip => nil, :stock_id => nil', 2 do |_self, name, label, tooltip, stock_id, value| [name, value, {:label => label, :tooltip => tooltip, :stock_id => stock_id}] end end class Range extend GLib::Deprecatable define_deprecated_enums :SensitivityType, 'SENSITIVITY' define_deprecated_method :update_policy, :raise => "Don't use this method." define_deprecated_method :set_update_policy, :warn => "Don't use this method." alias :update_policy= :set_update_policy end module RC extend GLib::Deprecatable define_deprecated_flags :Flags define_deprecated_enums :TokenType, 'TOKEN' end class RecentAction extend GLib::Deprecatable define_deprecated_method_by_hash_args :initialize, 'name, label, tooltip = nil, stock_id = nil, manager = nil', 'name, :label => nil, :tooltip => nil, :stock_id => nil, :manager => nil', 1 do |_self, name, label, tooltip, stock_id, manager| [name, {:label => label, :tooltip => tooltip, :stock_id => stock_id, :manager => manager}] end end module RecentChooser extend GLib::Deprecatable define_deprecated_enums :SortType, 'SORT' define_deprecated_method :show_numbers, :warn => "Use 'Gtk::RecentChooserMenu#show_numbers?'." do |_self| false end define_deprecated_method :set_show_numbers, :warn => "Use 'Gtk::RecentChooserMenu#set_show_numbers'." alias :show_numbers= :set_show_numbers end class RecentChooserDialog extend GLib::Deprecatable define_deprecated_method_by_hash_args :initialize, 'title, parent, manager, *buttons', ':title => nil, :parent => nil, :manager => nil, :buttons => nil' do |_self, title, parent, *buttons| manager = buttons.first.is_a?(RecentManager) ? buttons.shift : nil [{:title => title, :parent => parent, :manager => manager, :buttons => buttons}] end end class RecentFilter extend GLib::Deprecatable define_deprecated_flags :Flags end class RecentManager extend GLib::Deprecatable define_deprecated_singleton_method :get_for_screen, :warn => "Use '#{self}.default'." do |_self, screen| _self.default end define_deprecated_method :set_screen, :warn => "Don't use this method." alias :screen= :set_screen end class ProgressBar extend GLib::Deprecatable define_deprecated_method :set_activity_mode, :warn => "Don't use this method." alias :activity_mode= :set_activity_mode define_deprecated_method :activity_mode?, :warn => "Don't use this method." do |_self| false end define_deprecated_method :set_text_xalign, :warn => "Don't use this method." alias :text_xalign= :set_text_xalign define_deprecated_method :text_xalign, :warn => "Don't use this method." do |_self| 0.0 end define_deprecated_method :set_text_yalign, :warn => "Don't use this method." alias :text_yalign= :set_text_yalign define_deprecated_method :text_yalign, :warn => "Don't use this method." do |_self| 0.0 end end class SelectionData extend GLib::Deprecatable define_deprecated_method :type, :data_type end class SizeGroup extend GLib::Deprecatable define_deprecated_enums :Mode end class SpinButton extend GLib::Deprecatable define_deprecated_enums :Type define_deprecated_enums :UpdatePolicy, 'UPDATE' end class TextAttributes extend GLib::Deprecatable define_deprecated_method :realized?, :warn => "Don't use this method." do |_self| false end define_deprecated_method :set_realized, :warn => "Don't use this method." alias :realized= :set_realized end class TextBuffer extend GLib::Deprecatable define_deprecated_method :get_iter_at_line, :warn => "Use '#{self}#get_iter_at(:line => nil)'." do |_self, line| _self.get_iter_at(:line => line) end define_deprecated_method :get_iter_at_line_offset, :warn => "Use '#{self}#get_iter_at(:line => nil, :offset => nil)'." do |_self, line, offset| _self.get_iter_at(:line => line, :offset => offset) end define_deprecated_method :get_iter_at_line_index, :warn => "Use '#{self}#get_iter_at(:line => nil, :index => nil)'." do |_self, line, index| _self.get_iter_at(:line => line, :index => index) end define_deprecated_method :get_iter_at_offset, :warn => "Use '#{self}#get_iter_at(:offset => nil)'." do |_self, offset| _self.get_iter_at(:offset => offset) end define_deprecated_method :get_iter_at_mark, :warn => "Use '#{self}#get_iter_at(:mark => nil)'." do |_self, mark| _self.get_iter_at(:mark => mark) end define_deprecated_method :get_iter_at_child_anchor, :warn => "Use '#{self}#get_iter_at(:anchor => nil)'." do |_self, anchor| _self.get_iter_at(:anchor => anchor) end define_deprecated_method :insert_pixbuf, :insert define_deprecated_method :insert_child_anchor, :insert define_deprecated_method :insert_with_tags, :insert end class TextIter extend GLib::Deprecatable define_deprecated_flags :SearchFlags, 'SEARCH' define_deprecated_method :backword_visible_word_start, :backward_visible_word_start end class TextTag extend GLib::Deprecatable define_deprecated_enums :WrapMode, 'WRAP' end class TextView extend GLib::Deprecatable define_deprecated_enums :WindowType, 'WINDOW' end class ToggleAction extend GLib::Deprecatable define_deprecated_method_by_hash_args :initialize, 'name, label, tooltip = nil, stock_id = nil', 'name, :label => nil, :tooltip => nil, :stock_id => nil', 1 do |_self, name, label, tooltip, stock_id| [name, {:label => label, :tooltip => tooltip, :stock_id => stock_id}] end end class Toolbar extend GLib::Deprecatable define_deprecated_method :append, :warn => "Don't use this method." define_deprecated_method :prepend, :warn => "Don't use this method." define_deprecated_method :item_index, :get_item_index define_deprecated_method :nth_item, :get_nth_item define_deprecated_method :drop_index, :get_drop_index define_deprecated_method :append_space, :warn => "Don't use this method." define_deprecated_method :prepend_space, :warn => "Don't use this method." define_deprecated_method :insert_space, :warn => "Don't use this method." define_deprecated_method :remove_space, :warn => "Don't use this method." end class ToolButton extend GLib::Deprecatable define_deprecated_method_by_hash_args :initialize, 'icon_widget_or_stock_id = nil, label = nil', ':icon_widget => nil, :label => nil, :stock_id => nil' do |_self, icon_widget_or_stock_id, label| case icon_widget_or_stock_id when String, Symbol [{:stock_id => icon_widget_or_stock_id}] when Gtk::Widget [{:icon_widget => icon_widget_or_stock_id, :label => label}] end end end class Tooltip extend GLib::Deprecatable define_deprecated_method :set_icon_from_stock, :warn => "Use '#{self}#set_icon'." do |_self, stock_id, size| _self.set_icon(:stock_id => stock_id, :size => size) end end module TreeModel extend GLib::Deprecatable define_deprecated_flags :Flags end class TreeView extend GLib::Deprecatable define_deprecated_enums :DropPosition, 'DROP' define_deprecated_enums :GridLines, 'GRID_LINES' define_deprecated_method :widget_to_tree_coords, :convert_widget_to_bin_window_coords define_deprecated_method :tree_to_widget_coords, :convert_bin_window_to_widget_coords end class TreeViewColumn extend GLib::Deprecatable define_deprecated_enums :Sizing define_deprecated_method :cell_renderers, :warn => "Use 'Gtk::CellLayout#cells'." do |_self| _self.cells end end class UIManager extend GLib::Deprecatable define_deprecated_flags :ItemType end class VBox extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Box.new(:vertical, spacing)'." do |_self, homogeneous, spacing| Gtk::Box.new(:vertical, spacing).set_homogeneous(homogeneous) end end class VButtonBox extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::ButtonBox.new(:vertical)'." do |_self| Gtk::ButtonBox.new(:vertical) end end class VPaned extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Paned.new(:vertical)'." do |_self| Gtk::Paned.new(:vertical) end end class VScale extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Scale.new(:vertical, *args)'." do |_self, *args| Gtk::Scale.new(:vertical, *args) end end class VScrollbar extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Scrollbar.new(:vertical, adjustment)'." do |_self, adjustment| Gtk::Scrollbar.new(:vertical, adjustment) end end class VSeparator extend GLib::Deprecatable define_deprecated_singleton_method :new, :warn => "Use 'Gtk::Separator.new(:vertical)'." do |_self| Gtk::Separator.new(:vertical) end end class Widget extend GLib::Deprecatable define_deprecated_enums :HelpType, 'HELP' define_deprecated_enums :TextDirection, 'TEXT_DIR' define_deprecated_singleton_method :push_colormap, :warn => "Don't use this method." define_deprecated_singleton_method :pop_colormap, :warn => "Don't use this method." define_deprecated_singleton_method :set_default_colormap, :warn => "Don't use this method." class << self alias :default_colormap= :set_default_colormap end define_deprecated_singleton_method :default_colormap, :raise => "Don't use this method." define_deprecated_singleton_method :default_visual, :raise => "Don't use this method." define_deprecated_singleton_method :default_style, :raise => "Use 'Gtk::StyleContext' and 'Gtk::CssProvider'." define_deprecated_const :Flags, :raise => "Don't use this flags anymore." define_deprecated_method :flags, :raise => "Use the proper method." define_deprecated_method :set_flags, :warn => "Use the proper method." alias :flags= :set_flags define_deprecated_method :unset_flags, :warn => "Use the proper method." define_deprecated_method :no_window?, :warn => "Use '#{self}#has_window?'." do |_self| !_self.has_window? end define_deprecated_method :rc_style?, :has_rc_style? define_deprecated_method :parent_sensitive?, :warn => "Use '#{self}#sensitive?' on the parent widget." do |_self| _self.parent.sensitive? end define_deprecated_method :hide_all, :hide define_deprecated_method :colormap, :raise => "Use '#{self}#visual'." define_deprecated_method :set_colormap, :warn => "Use '#{self}#set_visual'." alias :colormap= :set_colormap define_deprecated_method :shape_combine_mask, :warn => "Don't use this method." define_deprecated_method :input_shape_combine_mask, :warn => "Don't use this method." define_deprecated_method :reset_shapes, :warn => "Don't use this method." define_deprecated_method :set_scroll_adjustments, :warn => "Use 'Gtk::Scrollable#set_hadjustment' and 'Gtk::Scrollable#set_vadjustment'." do |_self, hadj, vadj| _self.set_hadjustment(hadj) _self.set_vadjustment(vadj) true end alias :set_scroll_adjustment :set_scroll_adjustments define_deprecated_method :action, :warn => "Use 'Gtk::Activatable#related_action'." do |_self| _self.related_action end define_deprecated_method :size_request, :warn => "Use '#{self}#preferred_size'." do |_self| _self.preferred_size.last end define_deprecated_method :child_requisition, :warn => "Use '#{self}#preferred_size'." do |_self| _self.preferred_size.last end define_deprecated_method :set_state, :warn => "Use '#{self}#set_state_flags'." alias :state= :set_state define_deprecated_method :ensure_style, :warn => "Use 'Gtk::StyleContext'." define_deprecated_method :reset_rc_styles, :warn => "Use '#{self}#reset_style'." define_deprecated_method :class_path, :raise => "Use '#{self}#widget_path'." define_deprecated_method :modify_style, :warn => "Use 'Gtk::StyleContext'." define_deprecated_method :modifier_style, :raise => "Use 'Gtk::StyleContext'." define_deprecated_method :modify_fg, :warn => "Use '#{self}#override_color'." define_deprecated_method :modify_bg, :warn => "Use '#{self}#override_background_color'." define_deprecated_method :modify_text, :warn => "Use '#{self}#override_color'." define_deprecated_method :modify_base, :warn => "Use '#{self}#override_background_color'." define_deprecated_method :modify_font, :warn => "Use '#{self}#override_font'." define_deprecated_method :modify_cursor, :warn => "Use '#{self}#override_cursor'." define_deprecated_method :render_icon, :warn => "Use '#{self}#render_icon_pixbuf'." do |_self, stock_id, size, detail| _self.render_icon_pixbuf(stock_id, size) end define_deprecated_method :state, :raise => "Use '#{self}#state_flags'." define_deprecated_method :has_rc_style?, :warn => "Use 'Gtk::StyleContext'." do |_self| false end define_deprecated_method :requisition, :raise => "Don't use this method." define_deprecated_method :set_requisition, :warn => "Don't use this method." define_deprecated_method :saved_state, :raise => "Don't use this method." define_deprecated_method :pointer, :raise => "Use 'Gdk::Window#get_device_position'." alias :__set_allocation__ :set_allocation private :__set_allocation__ def set_allocation(*args) case args.size when 1 __set_allocation__(args.first) when 4 warn "#{caller[0]}: '#{self.class}#set_allocation(x, y, width, height)' style has been deprecated. Use '#{self.class}#set_allocation(alloc)' style." __set_allocation__(Gtk::Allocation.new(*args)) else raise ArgumentError.new("need 1 or 4 arguments.") end end define_deprecated_signal :expose_event, :warn => "Use '#{self}::draw' signal." define_deprecated_signal :state_changed, :warn => "Use '#{self}::state-flags-changed' signal." define_deprecated_signal :style_set, :warn => "Use '#{self}::style-updated' signal." end class Window extend GLib::Deprecatable define_deprecated_enums :Position, 'POS' define_deprecated_enums :Type define_deprecated_method :active_focus, :activate_focus define_deprecated_method :active_default, :activate_default end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/lib/gtk3/base.rb���������������������������������������������������������0000644�0001750�0001750�00000003101�12137115065�016325� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin Copyright (c) 2006-2011 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. =end require 'atk' require 'gdk3' base_dir = Pathname.new(__FILE__).dirname.dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/gtk3.so" rescue LoadError require "gtk3.so" end module Gtk LOG_DOMAIN = "Gtk" class Printer def self.printers(wait = false) printers = [] self.each(wait) {|v| printers << v} printers end end class Builder private def canonical_handler_name(name) name.gsub(/[-\s]+/, "_") end def __connect_signals__(connector, object, signal_name, handler_name, connect_object, flags) handler_name = canonical_handler_name(handler_name) if connect_object handler = connect_object.method(handler_name) else handler = connector.call(handler_name) end unless handler $stderr.puts("Undefined handler: #{handler_name}") if $DEBUG return end if flags.after? signal_connect_method = :signal_connect_after else signal_connect_method = :signal_connect end if handler.arity.zero? object.send(signal_connect_method, signal_name) {handler.call} else object.send(signal_connect_method, signal_name, &handler) end end end end GLib::Log.set_log_domain(Gtk::LOG_DOMAIN) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/lib/gtk3.rb��������������������������������������������������������������0000644�0001750�0001750�00000000317�11701304107�015412� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/env ruby =begin Copyright (c) 2006-2011 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. =end require 'gtk3/base' require 'gtk3/deprecated' Gtk.init �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/������������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�014727� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/���������������������������������������������������������0000755�0001750�0001750�00000000000�12257552170�016452� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-operator.rb����������������������������������������0000644�0001750�0001750�00000005074�12137115065�021726� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-operator.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Operator This demo shows how to use GDK and cairo to use Cairo::OPERATOR_* From http://cairographics.org/samples/operator_add.html, http://cairographics.org/samples/operator_atop.html, http://cairographics.org/samples/operator_atop_reverse.html, http://cairographics.org/samples/operator_in.html, http://cairographics.org/samples/operator_in_reverse.html, http://cairographics.org/samples/operator_out.html, http://cairographics.org/samples/operator_out_reverse.html, http://cairographics.org/samples/operator_over.html, http://cairographics.org/samples/operator_over_reverse.html, http://cairographics.org/samples/operator_saturate.html and http://cairographics.org/samples/operator_xor.html =end require 'common' module Demo class CairoOperator < CairoWindow def initialize super('cairo operator') @operator = Cairo::OPERATOR_ADD set_default_size(400, 400) @drawing_area = child remove(@drawing_area) vbox = Gtk::VBox.new vbox.pack_start(@drawing_area, :expand => true, :fill => true) vbox.pack_start(operator_selector, :expand => false, :fill => false) add(vbox) end def draw(cr) cr.save do image = Cairo::ImageSurface.from_png("ruby-gnome2-logo.png") cr.translate(0.5, 0.5) cr.rotate(-45 * Math::PI / 180) cr.scale(0.8 / image.width, 0.8 / image.height) cr.translate(-0.5 * image.width, -0.5 * image.height) cr.set_source(image, 0.0, 0.0) cr.paint end cr.set_operator(@operator) cr.set_source_rgba(1, 0, 0, 0.5) cr.rectangle(0.2, 0.2, 0.5, 0.5) cr.fill cr.set_source_rgba(0, 1, 0) cr.rectangle(0.4, 0.4, 0.4, 0.4) cr.fill cr.set_source_rgba(0, 0, 1) cr.rectangle(0.6, 0.6, 0.3, 0.3) cr.fill end def operator_selector combo = Gtk::ComboBox.new operators = [] Cairo.constants.each do |name| operators << name if /^OPERATOR_/ =~ name end operators.sort.each_with_index do |name, i| combo.append_text(name.to_s) combo.set_active(i) if Cairo.const_get(name) == @operator end combo.signal_connect("changed") do |widget| text = widget.active_text @operator = Cairo.const_get(text) if text @drawing_area.queue_draw end combo end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-image.rb�������������������������������������������0000644�0001750�0001750�00000002402�11701304107�021136� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-image.rb,v 1.2 2005/10/16 12:07:32 mutoh Exp $ =begin = cairo/Image This demo shows how to use GDK and cairo to show image. From http://cairographics.org/samples/image.html. =end require 'common' module Demo class CairoImage < CairoWindow def initialize super('cairo gradient') end def draw(cr) cr.save do loader = Gdk::PixbufLoader.new File.open("background.jpg", "rb") do |f| loader.last_write(f.read) end pixbuf = loader.pixbuf cr.translate(0.5, 0.5) cr.rotate(45 * Math::PI / 180) cr.scale(1.0 / pixbuf.width, 1.0 / pixbuf.height) cr.translate(-0.5 * pixbuf.width, -0.5 * pixbuf.height) cr.set_source_pixbuf(pixbuf, 0, 0) cr.paint end cr.save do image = Cairo::ImageSurface.from_png("ruby-gnome2-logo.png") cr.translate(0.5, 0.5) cr.rotate(60 * Math::PI / 180) cr.scale(0.8 / image.width, 0.8 / image.height) cr.translate(-0.5 * image.width, -0.5 * image.height) cr.set_source(image, 0, 0) cr.paint end end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/images.rb������������������������������������������������0000644�0001750�0001750�00000013107�12137115065�020241� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: images.rb,v 1.5 2006/04/08 12:30:03 mutoh Exp $ =begin = Images Gtk::Image is used to display an image; the image can be in a number of formats. Typically, you load an image into a Gdk::Pixbuf, then display the pixbuf. This demo code shows some of the more obscure cases, in the simple case a call to Gtk::Image.new is all you need. If you want to put image data in your program as a String variable, use the make-inline-pixbuf program that comes with GTK+. This way you won't need to depend on loading external files, your application binary can be self-contained. =end require 'common' module Demo class Images < BasicWindow def initialize @pixbuf_loader = nil @load_timeout = 0 @image_stream = nil super('Images') signal_connect('destroy') do cleanup_callback end self.border_width = 8 vbox = Gtk::VBox.new(false, 8) vbox.border_width = 8 add(vbox) label = Gtk::Label.new label.set_markup('<u>Image loaded from a file</u>') vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) frame = Gtk::Frame.new frame.shadow_type = :in # The alignment keeps the frame from growing when users resize # the window align = Gtk::Alignment.new(0.5, 0.5, 0, 0) align.add(frame) vbox.pack_start(align, :expand => false, :fill => false, :padding => 0) # demo_find_file looks in the the current directory first, # so you can run gtk-demo without installing GTK, then looks # in the location where the file is installed. pixbuf = nil begin filename = Demo.find_file('gtk-logo-rgb.gif') pixbuf = Gdk::Pixbuf.new(filename) rescue # This code shows off error handling. You can just use # Gtk::Image.new instead if you don't want to report # errors to the user. If the file doesn't load when using # Gtk::Image.new, a 'missing image' icon will # be displayed instead. dialog = Gtk::MessageDialog.new(self, Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::ERROR, Gtk::MessageDialog::BUTTONS_CLOSE, "Unable to open image file 'gtk-logo-rgb.gif': #{$1}") dialog.signal_connect('response') do |widget, data| widget.destroy end dialog.show end image = Gtk::Image.new(pixbuf) frame.add(image) # Animation label = Gtk::Label.new label.set_markup('<u>Animation loaded from a file</u>') vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) frame = Gtk::Frame.new frame.shadow_type = :in # The alignment keeps the frame from growing when users resize # the window align = Gtk::Alignment.new(0.5, 0.5, 0, 0) align.add(frame) vbox.pack_start(align, :expand => false, :fill => false, :padding => 0) filename = Demo.find_file('floppybuddy.gif') image = Gtk::Image.new(filename) frame.add(image) # Progressive label = Gtk::Label.new label.set_markup('<u>Progressive image loading</u>') vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) frame = Gtk::Frame.new(nil) frame.shadow_type = :in # The alignment keeps the frame from growing when users resize # the window align = Gtk::Alignment.new(0.5, 0.5, 0, 0) align.add(frame) vbox.pack_start(align, :expand => false, :fill => false, :padding => 0) # Create an empty image for now; the progressive loader # will create the pixbuf and fill it in. image = Gtk::Image.new frame.add(image) start_progressive_loading(image) # Sensitivity control button = Gtk::ToggleButton.new('_Insensitive', true) vbox.pack_start(button, :expand => false, :fill => false, :padding => 0) button.signal_connect('toggled') do |widget| vbox.children.each do |widget| if widget != button widget.sensitive = ! button.active? end end end end def start_progressive_loading(image) @load_timeout = Gtk.timeout_add(150) do progressive_timeout(image) end end def progressive_timeout(image) if @image_stream buf = @image_stream.read(256) @pixbuf_loader.write(buf) if @image_stream.eof? @image_stream.close @image_stream = nil @pixbuf_loader.close @pixbuf_loader = nil end else filename = Demo.find_file('alphatest.png') @image_stream = File.open(filename, 'rb') if @pixbuf_loader != nil @pixbuf_loader.close @pixbuf_loader = nil end @pixbuf_loader = Gdk::PixbufLoader.new @pixbuf_loader.signal_connect('area_prepared') do |loader| pixbuf = loader.pixbuf # Avoid displaying random memory contents, since the pixbuf # isn't filled in yet. pixbuf.fill!(0xaaaaaaff) image.pixbuf = pixbuf end @pixbuf_loader.signal_connect('area_updated') do # We know the pixbuf inside the Gtk::Image has changed, but the image # itself doesn't know this; so queue a redraw. If we wanted to be # really efficient, we could use a drawing area or something # instead of a Gtk::Image, so we could control the exact position of # the pixbuf on the display, then we could queue a draw for only # the updated area of the image. image.queue_draw end end # leave timeout installed return true end def cleanup_callback @pixbuf_loader.close if @pixbuf_loader @pixbuf_loader = nil if @load_timeout != 0 Gtk.timeout_remove(@load_timeout) end end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-fill-and-stroke.rb���������������������������������0000644�0001750�0001750�00000001414�11701304107�023051� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-fill-and-stroke.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Fill And Stroke This demo shows how to use GDK and cairo to fill and stroke. From http://cairographics.org/samples/fill_and_stroke.html. =end require 'common' module Demo class CairoFillAndStroke < CairoWindow def initialize super('cairo fill and stroke') end def draw(cr) cr.move_to(0.5, 0.1) cr.line_to(0.9, 0.9) cr.rel_line_to(-0.4, 0.0) cr.curve_to(0.2, 0.9, 0.2, 0.5, 0.5, 0.5) cr.close_path cr.set_source_rgba(0, 0, 1) cr.fill_preserve cr.set_source_rgba(0, 0, 0) cr.stroke end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/ruby-gnome2-logo.png�������������������������������������0000644�0001750�0001750�00000016040�11701304107�022251� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���P���P���Žò­���bKGD�ÿ�ÿ�ÿ ½§“��� pHYs�� �� ÒÝ~ü���tIMEÓ (1ˆ‰Ù��­IDATxœíœwXT×¾÷¿{Ïf 0Ã�Ò)6@ÔXcIbìõäÄTSŽÇ£Ñ“¨)7on<&1õĘfÔô¨IŒI°`b‰%ìXPÚБ†iLßSöº ÚPLÎû¾÷û<ë™™½WýÌo•½ÊþWÿ«?SÔŸ?ZÙ/mà×\¸, 9| YÓ«))‹vÙX¿Ð]@dD®ªàFQÆ#ËÌñK–rÞÄ÷ÿ ÀÂ/wù^øüãéÆººeúªêIv“I �"™ ¬ÑÎá��øÊƒÊdƒm}äØÏ›)‰ÌÕ]¼ÿÏTçåòü}ÕlMIÉ“6}cš|Èqìí·cðôé&%‹Á9]pè´(ÉÌÄÕ;¡*/w'ysèÂ…'¾ô2ÛUüÿ‘�˲2y7öfJŠúÙ—bxa` ?e’éŽM¯4R™Wq£??ý¬¼â×ìuÚÒÒ•"¿ŒGÅЄ$2Eƒ¸}¢ùƒÍ™Zµ µJ¥.jì¨iÿõrWé0}+jÿе¸¾çûð¬5ëþîr8îdÆd»Ù,a ]ÑOG®Yõ†5Ĩ½ê Äïx8¦îúõ÷´%esâ320yýz§§�œ*U«DI›ïqq˜°bv¯]+åûúMð@b<M}q÷ìéªüÂ@Q±§N¥ƒ““£êÒRiÅéÓ“ :À¹\Ó�(:G‹}+VE—Ÿüu§¹®nü˜iÓ0výzøH$pÖÕ5yj í÷¯îïòÄD�€±¦6®»|ÿÇ�Üsÿë#U…ï2Aܬ7Þ@ôäÉà1 8».ƒ•'N`ïÚµQºòŠ%Ĩ}•’ÈHGñœ|õÕÀê³ç>0+kÆ ’H~øaÐV+\Vk§àÚý¶Z�¬Éäß]¾ÿc�6®sš-‰3×­GxL  8–È%HƒƒQýÆ4õµü-�Ìžq4æŸ÷ùféãOhJJg'Ð4RGe±Àe±t¯–ÊJ�€00@ß]¾ÿ#�f¿ôâˆã/½:cȈó÷›› Žeᬨ€åôi8ÊËábY„BXüÀúò"t�pߪ§g¨‹Šž 0R&ƒ@*W[ë¾éQU9κ:pZ-àt‚–ËÁ<`¨¯_�ø…„”w—÷[°<ëKúÜ_ªÍË‹€ðÔÔÒô¬Œ_¼¤Í_NŒZl;!ƒ¢(ITHìyy V+ l—/ƒX­ �ð�ÐN'(aÐX]#ôL¯ôÇÝ¢ÌO­¦¬6q�‘P°,\õõnÎl†«¾Îòr¸T*³ÄåêQ<œÉɤ¥¡Z¡�Íã9mºÆ Ý•ó–�Ìya£Ï¯¯m¿§>?ƒ­±q Pa¶ú† xôæ©cç"'OoØ PÐ6}ã`ÀGX[ ‡V W]\ÕÕ Nwá�p�„€pÄ* ·z¦™·wºÍÐ82€ �ÌfpÕÕ�ŸN«…«¦.• œÑØg›1œËN¡€E,†òæMˆåò‘LúçXàõ?¬l(.z9<5Í7eî\ØT*œÛ±#ùúžïvhŠ‹çhɘQ©¤þ§Tùùpr`·ƒ×*> €€ €ÃbÑ„¦õL³æÒå;aµ @€NöÈ€+Ð&Þv²ÙP¯P Þj…4"<kÊ/ÖâÀÁ.ËÚï�>¹:áÂŽOVËcb}|ø!Dp ð À¡W^I¡™ àƒ–�.�!„P6xh?º§�°�,�BBªdуížéR4}»/!TZAj²`oå�p]§-XÒxGHRF·rtRðBe'N-†‹‹Ê¸÷^ðÌfØòóa½xaþþŒŒ¤ŠŠçXå-é†D q™ÔJÜ,™N\ÜÏ á#Gäx¤ÍÏûè**Sý�ø5ª3ÇëÄÑpW‹z€“ÅÅ}=î™м)o¿[ !Ü4™Œ{AL‡Ãxà�Àq@ߨר¬Ð�€$-™|”X­54:,N§§Rpƒ­À÷óÓÛOx¦©Õ4F:,?Y ¤p �#•ÆLš° ù^…ëw 4ÕªB!h¥¦;aÍÌÏjeá£RfßÊó´“þЃ٠éÆrtl}�*�¾rù¯ƒgÜ©òL³>ÿjнõuæX�§8Å"mTƨu3ß|½ÌÛòö;@»ÙÀÕÖÂüé§°ÿöxv{ ?·º¸¨M>w‰B2 ôš €í«—€‰¦]ÂÀ€£‰‹în×›Õj�¡çðì�.�¨§i—|Èà-±Ó&÷v¸�¢£ò­ ØÚZ0Ng <�|�„žU¯´#Nìò þÁJQDßÛ*îÞ÷�F,RbÕéà´vpü�à®êÞ¶y<¸ÛÔ³� išóŠØ—p÷Ô·Æ=ý|—ÓWžêw€4÷«€nhÍŽ ��Bxl£ï.iÖÝ{EÁòœ³pwÍàÏ�P3ŒcÀ°aï }ôñvÕ�üCÃt�`C{hYžÀ/� y<—$:r×ÒŸx`ʦw,=.oO<g-,ô  q$&ÎÜ1*}øoÿú?~ž~¤±1‡‰P¨«@û¶Œ�Šâø~"‡g¸ñ‹×Ö‡þßD,RípÀ)�W�d²“Ñãoû¬³|É£†ûˆD¦z¸;ÀÏ�Jx´KþeÒ¼™ëB’2z èÀë–'eýôk0œÔgi%Ç.}úåûç^ÝZyôP‹¿Ñ«Wæðý%×+án_Zt� hÊ.Ž5zÆO “!uÙC§¢ÇݶŒ *ºÈãÙÎñx,_.?“<oÎSÓßÚ\ßYÞB§Ž3Ë <« Gçà� À!�• c•''½3tѼuwmù¨CËöF^õúºk—DŸÜq÷לÝ1rôc!(.7/\.:zô¡3[·FÆL7;gY?Ÿ8þ³ªõ„<B¨q­2o�[PB|»' �H¾÷A€CÕG²~+ýõ·‘¬Vï;濞ù%0r`;‹õ”H&ýTÍçßvÖn÷ƒöƒñz¸;‹�ÿŠ„IŸûëÁ¬owÃ}Sæƒ÷Í{Y$"{ö§ÍF\6±ÕÔ3/¾HþEÓÎ]3grø‰„¼~ô5€äÄ F€¼×¥9ª9íÚÀ¾êÒ»¯·ÄÆì| R @ �ò@ÞÈ+"‘áÝAqŸ}¿haJí/¿ôKûß­ê/_e>žqÇŒÐäd„  §²\£NÁ øÇ«½|å¾¢ý²à~\Å›^Vé+*7”hu#X­òñp÷¦VŠ")É'B¦Œk÷(ÖW¥¯~Þv`ÙCŠ~:,ËU7L/wº|h�zŠ"œO£Hx-*9ùß³þýúá ´1,¾ÿ¡_Òí ¦ºDÈóñ‰K$àÊÊ`ih€íÂØKJÀž9ƒP� vGÚùíŸDÈ�J"Cíñã9NûxÕÙsfa� (ö“‡~Õ/9ï@s>û¢$ç®{r¶l~Øn1ßEfüYÛ•„™32‡-œ9üö;X¤é×4»hªW1'v¨Õ0~ó Ø¬,ƒ”Ë>€p�7õúpŽp#Ð�¦N%ÊSÇößöIž­Q?Ó¬VKcÆÛ;~b923ûµ­•|ÿ}Æúœ3ï>¸¸€ „ÁŽ”s¹ž Ž{¢n%ÆY]vûÍ†Š hÊÊ`±´Ì¥Q�B�ЄP Hðuë°áîy¿R�ï�Î]�ÞÞâUÆL¥Õ”®ªH ¼tÑ×T§bL >æúzƬQóÀ �¾ ŠdNL° ‰·…&Å[SÆpp?¡Ýryµ.üã}÷,ººëÛ½CdÀÝ«6tØ€>àÈZeÝ]}ÉLõñÂú¼¼ôÒc'“«ÎœšŠæ‹Åá„@L\.‘Ëés‡Í� Mó\ŒP §Fçr:µœÝQš4{vvâ¬YÙƒ-Rö%?ÞÈ+€äòyzó¬y¿Øjk'O  €6V¸ €á]yA×Ú“ªróÔ1~ñCIùûöOàñù³´eå“V«¯oh(¤11ð•Ë!’ÉÀ—Já‘T ša@óx „ã`ih€±¶¶5LU•¨Í˃Y«ÏÇÇ.8ð°xض©ëŸ<9kþ-±H¯w&XöPê3¿õÑ7ž@Žß~ ‘ÇË{¡¨!•Šïz?‰îÚ%êòîoC*Oýz—ºD±Ìa± K˜ÈŒ ÄŽ‡À!C ð÷#‚@3î–†�îÅ!BÜ?Û ˆÃ»Á�³ªšK‘·gn^½ ‹ÑhðÛ0ó® 3Þÿ¨ÓÁxoå5@bÔbǤé÷7äào³ùO ÷TÓg�|cc÷­ÎË]ÐÙz­òäQúÆ÷ûåÊk׫ îg †1ôð%K?>BRR@ûø¸·9Ò§iùÝÞµëvËBuå ÎmÛ†¢cÇ\b¹|ïÄgÖ®ÊX³VÝgj­Ô£½1æ²"Þž–-Q^¾²X,’¸~ ã4eòßî;úËç…»ôæfñµÌï–5>ck4DÅŒ‡Q=†¸©ÓÀøŠ=¬ªiWY3œæ{Ý\C«k¤5H§Ùo½… »ws±±Ûþ‘Ÿÿ^pêT=Þ\tjãžúF~jù©_×rGES”X.ÿ,aúïÞñÞ{mÖj Êë¼CËŸ¯Ì½üœ©¾~JDr² ã±Ç0pÆ üüZYº„€Î z†ë亓eqüÍ7q-3Ó6ûíÍIiO¬ªè®öêõî¬Òûøe'NÆ0|›6¡là_æ·¬à£?=ý\ÀÍsçŸÐ(JV0 žºd Rx�¾ááMž:‡×ÆÊ:±¶Žªm‡á›~×âÛ•+ž6rõ²Ó9ïõ¶ÜžêõšÈ 9óìhÙäóV›{Y«Ö†Už?³¹¡ ðžè”Lzê)„ë®RÍ{Tº‚à ¢íîuáO,AŒº«y‰ú›åt`ä@¯v v§~_Túþž…C‹Žüô‘¥A}ÛèY³0fõje2æý)}¬¢†ïÄ_ë?ˆfYN‰$BsñŠl éú `}Îê쎆þ¸o78.qü}÷Ñ©÷ÞëÞÚÊê�´·¢.ªr»êÜÚ_gquäÏfÅq FlÑ©û­ÜýÑÙ­ï%ÈÚIllòÔ+x×] hºÅò:µ(k]µ‹ÝZg'×!`aÒëÁR–2¼W³Ï©_�îýËÂÅ‘c_:¦¡³Ö¬ÁÀ‰›­uu[å<ýxÒ[à êü|4êtˆÌuU>zL·´ÞªÏ�Õ—r}¾½é³:}ú˜»ïFì¨Q Íð€îÛ0�”gõëJO 7ûuX­¸vú4|D"㈖~‡ ûZìõ `Á®Ï©ƒO®™­Q”,KHà¸ë.›Í}³›F½'PÚ…óróSrö,”••D:xð®ŒÕOU÷¥ÌžêÀüÌýRBñ_±X8völðZµy=ÒƒkÝZaÓ5Žã ®©Aö‰à\8iâ›ÈÏGªO�­ãBS½*müôé 17 º©RTÖØÄæfòˆ¯³ðšúz?|.š®š²nÆòGËðѶ¾¹z 0ï‹Oü^÷ì±HD' îî4€­…juô!p8@X„eÝ‚HŠÏoÓŽ¶N£¡¾§³³¡5™Ì'O|~ìÊU'¨Ôѽ'Õ‰z ðÜ{[“6[zbJ <Hë±^=Ç{í¬¨éz;xV+œeepTVÂ¥R, Ph™ ´4ð""ÚÄCA]]Nž9£Ýn4mêÚ¡óç}>xá¢n÷úõF½HÀ¥r,ª ž·Þ6F+ëiåX,°—”À‘Ÿ8nè-‰lv6·ÝZ*uïbu:¡P*‘sù2ÀTÇNšðô°Å‹ö |y¿<¶u¤^¤hÞ(†Ô×ÄbiÏ=ßÞ¶Ýj ò¸ÞÆ N8kká,.§Óâº(»ÅgI ø))h´Zq¥¬ ¥’d²+!ɉk¦nx!'bâÔ[è@›NÅãó!Ü=/ÐκڵƒM~Hþ(�œÑgq1\uu�Çu¸Õ×SœJ…›¾¾È©ª‚ÞjuDGŒ¿cúS3ÿýzù­Z‰k­^´è´r‘hOëë¤çmÝqxVYb³ÁYUWM ˆËÕí[ó}€<«ÕùùT ¼}ò‹s¿ütw@D¬Ûwô¶h=R¯òxŒƒ8 K ÝͲ´ét‚Óë᪮n‰§3xÍ× ÜÓ(E�Š8…B]PLT–|HÂKÉsç•DÄޒ΢3õ  À_o«QÂe±€ñ€Gu��Ç6¸º:pz½×ÕÕ î BZšvú…†^ÿêôW6Ž˜0…Åþ¬Þ§×ê5@‘LVe.¯€Ù`@�צsðì8ÚTk–§×ƒÓé:ç) n«k€{¸€P*­ŒNJ|kâúµÇ/XlÄ)½-FŸÕûa çºêp¹ ×hàß´¾áÙ ·é,“ ÄdrŸMë"îÖP�òà¶<â+VEDî OO}Ú kË’GßÒÖõ U×XHñù–ƒAM5Ù³ä8Àår?=X,€ÓÙm×,îN"€Ž¦í’ˆðœ¤ÄCg/ȱz¥_ÛÛ¬÷«z½¨”ýòƘìÍ[úk4Cgòùàñù è&»j§Óíš«°—‰»�\GÓQq??­TÔ«3Þxeë 9 ûe¾?Õk Lž0¾ú܇[s€¡»þöŽ·üyóµöãÂï;ç}rÓ¼9æÊ 9 ÿôêÚ‘úôÒ‰ï.˜›Ÿ¹ï‡tŽã¥µŠÌÛqœ§œ�.È£i—xÀ€ŸMŸúļ/wVx›bÔByõ¿ìØ/þe'NIL*cÕé†Ïçb&Œ3 œ2Ù<òñÝ¢î‰úð›ÙwË•¹WN •µÉ3�øö1¡�Ç�H¢"ÄMžôؼ»½žü,ܹ+ìô–Í‹5Š’Ñ‚�ÿ8‡Åí²ÛÅ.»]HÑ´SPCóx7E² ½ÿ¹ú«ä‡iw`§7ê@KA ýÅâyëT›nã8Þ/"ìì¾@�V&­»zùØÉ^ëv#ÉÓR™¯¬S›—·®¡ p¡e`À°a†…Á7&™ ¬Õ ›Á€ú‹¡8z!ÉI_ùûßžH_ýdc‹ÜN}šP'Åsç·¼ñé‰7=V ×Ž éÀŸ7Pk�Æ÷¶8PÒí±b,¡·›ôOmyÅZ‘¿xÆC!eÑ"$%Á7(<__P Óf Ï66"û¥—pvëG‹³ßy7@Ÿ7J÷y§úè5O«eqß32Œ½�¿oyk}>ƒêÀyÞ¯�mHdÙ±Œ>ßq·ÝJ?þ1ASZú¼<<<ü¯Ÿヌ¨É“áì>/l2ÓéÀiµà4pj5|XI“&A ŠÉྖè§eÍÑËÝ}ô…¹¢RMŠ–C…�¼¯ÒV�„#Ny|’Æ›4Gg¸X»dÂüù W¢ø}ìéùÙê»%7N‹‹µ_ÚÀ~8|éRMÞw™›ËOÊ8ïp&Ã}>®3u5@5Eù^úbûHbÔén*JS\ BxBÀ)mîuuîð<ªùI‰e¡ùòK8—E«ièC‘[Ô/�)‰ —=pL6àÇ¢ªê¿FHDûƒÓ])À5‡Ã¯êìù'Nnz=MgN:’¡²z?e”œáÍkl)-œNšp/‚++ŒF€a@I¥ ‡ îÆ 4TV‚'ñÓESC?õ½ðý©ËÛÞx#HVó6@J�b𛜠û�² ÛÓÒ6^ÙþQ§£¢ n½30æûw||Hí‚Äöè£Ä’žNÌ1휥əò>@^õó»vã«OCû£ÌýzÜ5uùªy|üJ‹€¯;÷¼]GHk‡¦OÀ8�ƒ�Ô]¹ò\öÛ›?ÈZþHTGé”9iUk§ ‰àwó&¸ŸrsA±l§i�@-Ü'5ƒâ;²× [«ßÏ ß½éÕ¬ÐaCßÔ0Œí7¸O zÓ S�Ä�f�Hà8F_¬¸ïêîo}5mò½ûî_Vuø ©.£¯^¡ÌÍ}Þa4JSXJ©l™Œí, '€\�Œ@`Ëeßutp»7º%ï<õܳ’üýû·ÔßÈ_– `ܧսí‘Y¸Ï ŸÀÒçzÍnµ\uZ,¬H&K³¨5#‡¸\Ì,Šj™Ìí(žÖ*p�€oLô®q«Vþmôúgúe‡Ö-{ãñõ+„…Y'w¨ ‹îMæ8Þtx±u¦,p[M%ÜoÕàà"Ÿ M'້pWÝïØ• ?ù(#aÑ_ûí�Î-{wÖ”¥Ël•yÓfó)¬¬Zäp¹˜éèøIè¬/€ �FÁm•îá‘/:n{:ŠÃà(�«P¨šüTÂn!À¦mÚogÏYÈD†â‚Âe,Ç1ÓÑöN—q4}ú¢ó‰Š®â0Â}:]IÓÎàøøç|¼í{$ó¾^¨ËWIõ‡ö›Ÿ_³æˆËÎZªjj&„5Ýﮇz�™�ªhÚ6røkþ¹æµØ;fü!o‰ ¿ûÊçó‰ã¾)—_} ßä&@�qvà\Ý8®gH.@¶�ä‘H»=uä“ß}Kt«ÊuË:‘ŽDŒZjÿŠUÉ¥ÇOn074Ìôs8ÄäÃ]EûR\p¯¡ä�(¦(Ž (’ø¯ùÛ>Ù+‘Ò³·õ@(ÀfãiúëÅÕåå=cPÖ¦K� `@7a=ÅÁÝË^‚{¨ÂòxyBÂçÉ æ¾vû&ï_áÔ[ý)�À’¯ Î|úa€ZQ2³*çìßX½~ åpe�’àÐäøø½×åà~ÂÑÁ½F\  �%DÒÀ‘£3Þ ’˜}ûóÏ8þˆ½1Àfi¯\Gþ¾ï‚GŽÜf7™çª‹“ !a4Ëú‰¡DpøMŸV¸ŸnL�™fU@TTŽ8(hëÐùóó2Ö¯7ü‘ùÿÓ¶ÉÓ¢àÚOÁ¶o­V'ø‡…¥²&ã0»Ñ$µLRË }ƒåJ‘TZãr:.ý%§RïàJÚÔ+©a³½Õúcâ¥òzÉÁÚ����IEND®B`‚������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/README���������������������������������������������������0000644�0001750�0001750�00000000110�11701304107�017306� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gtk-demo for Ruby/GTK To run, do ruby main.rb in this directory. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/gnu-keys.png���������������������������������������������0000644�0001750�0001750�00000007414�11701304107�020714� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA��± üa��ÃIDATxœí˜kt]e™Ç゙[rré-MÒ&iÚ4Io´Å¦ ´ÒŽÈÀ¨C;D™gPQ†¼T•²Æê×Tg´ule€‚´¢Pš^Ò¦—¤-msk’æ~9IÎmŸ}y÷|ˆ¸)¢ÂÌ—þÖ:Ÿö~÷yþûyþû}Ÿ.q‰K\âê»ü¬2 àC^‰ÅFíd"弋ÏK´¿t᪵ËUËrL+éÍ·RéuÕóæä-©Y<e°o0½oßÞv×¶‡`/pp�ÿ]Šû÷ˆ¿dÑôÅ—\5Ë|dùŠ%‹¯ûÀµúÄÉÈÏ™„nøH²#YÃmçÛk±ýFí¾ÚÌþÚýÛ}߯z�ûÿC€Ì>VV^ºzÍÚU+W­ —”•(=ݽœoí `˜L-(`Fy9&NÀ•šªaYVü왳Év½°mÛ·íª:ÿ/LÖ/zßeŸ½fÍÕ¯ºúÊ�B01o2µjyñù_³è²Å8®ÃPÿçšÏ±î¶uÜpà H)B0Äãqm_µòý[úûû¿ È¿VÀ;ñ@V(\{Ãß^¿îº¿¹fr(6¤  IG{ÏîÜÅæÿøÉx‚3¯céKàÕ½¯¢( �ª*H$â|ñžÏ)ñT¼4h×?å]È‚òî¹üëeýÇn»eŽ®†©‡š¢Y9œkj¢xú4J¦—bè¶þd+W^y%ÕÕÕ¬ÿ‡õhBÃÐ š›š¸ûîÏÐÔÖL  ’™[³|aåÛýéœù³ßIl2F~~þ‡®¿îƒ+÷¨Õ&OÊGÓ Œ@UÓ©®ªâø‘|àA<×ÃÇç _øŽã 8n†S§Oòõ¯n$I1½¤UÂfV^~î<`wn~®ˆ ÅtÓ4'8ŽÉÉÍž-„Z¦éêXYyñÙÞÞÎTÂ’€÷æ�ßÖª¢ÖÜ{ß½Û¿ô¯_šŽq¸®ŽãÇŽR\RȬŠJŠ I§lÚ[Û8yú%e¥¬^½UQÑ5•M›cÏî_‘•“EVvÏ•xŽK"‘ ¯§ï•y‹«n ƒ•/ï®»ñæßø’ò’iK–,ö55ä4kØ÷ê>+cY­Ï=û\mOwÏ0ð ÐÎxçmÿ×O~ú“/œ¿P „¨Be``}û÷ràÀ!ÊÊŠ)-Á¬Ù 3�bÃÃlýÑÙ[»—i%…hšF*™$•Lc†u¬T††c§ÁPðÀôâ’Š;>u{áäÂ)j0Àµ%yyB’Ê` èp㉸õ퇿]WWWwôBç…ÇQ`ô¢òróJnþðÍ'¿ñÐ7†j€B4EÃ4L¤ï³oß«4Ÿk¦§¿‹p$ÂâË/§¿w]»þ‡ÁÁ¦•MÅP5úb$“q¤ëÓÖ|žtÚbáå—±öúkœÒ²r=šeltŒ_=ÿ"GeÓæÇÈÍÍG7t¤¯MÓ0MÓ÷¤×ûäö'ýÃü°þøñãß½¨€ÂÂÂÍ;~¹ãîòòrt]G"ñéIÏAÓ4¡0º®‹ÅhhlàÈázFÆFÈÉ 3:Ã÷$ccc$IFãcœ8zšÊ9ÜzÛG ‡B„B&äMæØ±c<óô.ª««¸é¦›)/+ÇW|Õ¢|f9ápEQP… <ÿÂ.·¾þøÐÓ¿xºúb&ÎÎ8™ÒŠÙøîøîo¨R‘¸ž‹°inm&77JÕÜj–-_Ƽyó9sö4gÎ"•Š“JY8R"}Ÿá¡·ßùqÊʦaè&šj`A4Måà¾ÃlذkÖ\ƒ¦k  ³óéÔ¾ZËÆolDUUt]§¥¥‰_û}ƒ}RL7^L@éG>ú‘2EUPuðéïëãøñÔ××ãù.+®ZJñ´Bz{zùþ¿of$6JEE% Š;î.ß' ÐßÝ˪Õïg΂ùHÏC× ²"Y˜z€@0H__/C±AŽ=Æ¡C‡Ø¹s'K–,aÓc›ض͑#uüÛ}÷ct¦L%O²xɼåÍ@QQQov(»ª­£Gþ&]]]Ì]PÅe‹1µ¨€ìHªªSPXÀ+¯À0LÚšÛhhlॗv“HÅ©¨˜‰c»H–.»ÓÐiiiÆq,²ª*QUáÃí·‚×ΞáÕ½ûÈÍËå¡GbÖÌYƒA�žx|;wî$;7‹p(„¦*˜ƒ–æ–ª‹y øÁŒòïËËÏxãÍdá¢ùÍ0 §xþ…Ý öö³ó™_bÛfù»/›ª¨H_ÒÙy_î|І'˜<©‡¾ù¹9¹¨BcÇŽ§8yº¬ìå3Ë™;g¡P×s ˜&¾ªÁpl˜Ç}Œ£G3½´„RKÌ Òv¶5öVý€�>3½tZ͆O~¼ìƒ7^/fÌ(£«³—¯=¸‘žž>.\ÄàÀwÜùI à­­áÁa&Mš„/}TM#;+ÏÑ#Çøä§?EQQ¢*ÌŸ;ŸË—ãz’ÎŽN¶oŠd*Iii¾2~nìçË÷}™îÞ.**g‰d‹‘ÉØhšŠ¦+HOjo.¡ˆaè‹ïüÇ 7\±rY…¢¨"޲õ¿ŸàÜÙ&6>¼‘¥55<óì.<×¥­¥•-?Üž÷pÓÍ7QZVŠi˜ öóo=BÝá:’©=Ý=¬X¶Çu°,‹¤›K–ÔpõÊUܱAR{`?ßûîwÉÎÉE 'OP6£ן‚"#±QtM! 12Cúž”Ê›K¨âcëo}ðÖõÿwcñ˜¡)ùùˆ ŽR0u ùù‡#<ú­ïp¾½ƒ“'©YZÃ]ÿt††ùâçîå|{EÓ èëígé’+xtÓ&©8¾ëc;6®çŽÑ„@Ó5BÁ0éLšî®nNŸ:…í¤¸ÐÓAr,M"1F*™&™Jáú.©x ¡Hñ´û† L™2eõº[o½ÉJY†›ñ‘Š ŠŠ§¢é:ŠP‘,²³³ÙýÒnÂá0ªªâã³ûÅ_ñ£-[H¦’L)žŒišDó¢?QÏðÈ3€‡‡çz(BAø8¶Ã`j�ES˜R0™¡¡!z{»HéáI#`ɤQ…FBz(¾B$’Õý‡Ìše5wÏš5+0!wÃ#Ãlßþs×aÑâ…0ƒø Ÿ[Ö}”P8‚P¶m£h ;žÚÁÖ­?&šeJáD‚x"®©ô ÷ÒÚÒJUUŽ;~Ðó¸¾;n<E =‰mÛH$ŽkcËñkC'm¥Ñ4•Œkc »äªëVþülXÿ‰õ3²²²ª ¨°ˆû¡‘ažØ¶–Öó }æÎËÜêyøxZËJ±ù[›9Twªê™èšÉàÐé´Ì€ŽÔioo£ªªŠŒ—A À_úøþS3ð=_Ž‹´m!T<W¢**™´ã‡"‘]»ŸÿÍý@vvvQeuå-+V¬Ð…H)I¦’ ÁÔ îúô]$R Z›[i8ÙÀ÷6Ÿ™3 ‡#¼²÷e\Çbîü*‚A“±Ñ$Žç ™$ãI,ËÆ4L`pÀÒtM14Ãt=—ŒÌ ½·nÈtCÕ.RJEA7 2V=`’HŒ1<8x žHÜßt¦Mª�žôVþóŸ¿gáÂ…ª‚|ßÇu\Ò™4ñD|˜4yóÌcÁ‚¤­4ííç™V2P–* 2VÇv¾rܬÛvüŸnûÙaß§µ¤´DF£QÇqþèÍ(ŠB:¢««]ÆFcŽk£é¶mËÓ g;lÇ^?6oLÄ“ã M8ž7kÖ,EH/|ðAH븨BÅ“¶kcÅ-üQ]Ó©YZC$¦§¯‹‘‘>ð%Ž'Ñ4 UÅ?‚ø>D"YÃyù¹ßÿêƒ_¹å?·ð³í? —Ï,kšf:Žƒ”oÌ„m[¸ž+¤ç¢k&�±¡¹¿öàñöópm÷ØïTTT,›]=[(Šòûº”Þx3޾¯SEŒ_Ï8R©Žë’É88®‡çI‚¦ª*šŽ"@Õâñ³+Ë_ŒF£¿êîêþâÕW\ýÜ=Ÿ½§©¹©ù|v4Û ƒ¨ªŠÀ²,\W MÓÑ ƒó-í郵ugóósîrm÷ù7d m¥½Ý½íšªùB<ÏÃr-¤/ñ<!žôpÜ7¦]Ótð\|O¢j vÆÁóÁ“>¾P@(hB;uáÂ…Ï5?=Èx'uÔ÷ýyjûS_ºöškO¬YµæpÝ¡:+>—š6¾MéËÞî>÷™»Úî«Û¾dù‚;O5ž;üæ’{}#»6//oÃ<°xÝmëòMÓŒ¦’)||×ÁõÜ?ªUUUéì¸Àkgèho#ã8Ø™ –e“N¥q‹3§ZÚ\/ó‰“ g_~K·‚ ÌÖTÏ©¾º²²ryAÁT[QeüÀþƒÁ¶ó­Ï&¶e,û7\dª÷º�È>“ÍYðäŽ''UTTT™3šL'ßÒlªªÒ××K}ýA¿³«CøRJ%A ’é”êÄk£Bãöžþg[šÛÿÔŒT²€èïâ˜4«Šhõ¤Ÿz»…o>JhÀBàÎÕkVÏÝúøÖjUSÙLÏóÞ DUUº»;©?vÐëììT¡aYvÆáÈ¡c=gN7==ö'ÿ«yóiT]ÀËm-mÝÛßV 3ÓK¦«Ñìh�áËqª¢Ò×ßCow·’L&0 ƒŽŽ Ní¾C½‰DüŸûzû·ò.LÞþ\¯“Τ’©Ã/íyÉÚûÛ½ÅݺÝeË—…r²sMÑÐ5ž¾.bÃÃ$ ¿áDcêx}ãk+V.þNg{ÏÏcC#4Ãy/x'³QÈV·¬]»¶êÊ«®œYZZêŒ Y{öìQ~û›WR‰ä¶ínaƒÿž¿ù×ùsÇë âw¿¨®ŽkwD"áß&Éöw?¼K\â—¸Ä{Ìÿê;Ô$Í誂����IEND®B`‚����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/menus.rb�������������������������������������������������0000644�0001750�0001750�00000011511�12137115065�020120� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: menus.rb,v 1.4 2005/02/12 23:02:43 kzys Exp $ =begin = Menus There are several widgets involved in displaying menus. The Gtk::MenuBar widget is a horizontal menu bar, which normally appears at the top of an application. The Gtk::Menu widget is the actual menu that pops up. Both Gtk::MenuBar and Gtk::Menu are subclasses of Gtk::MenuShell; a Gtk::MenuShell contains menu items (Gtk::MenuItem). Each menu item contains text and/or images and can be selected by the user. There are several kinds of menu item, including plain Gtk::MenuItem, Gtk::CheckMenuItem which can be checked/unchecked, Gtk::RadioMenuItem which is a check menu item that's in a mutually exclusive group, Gtk::SeparatorMenuItem which is a separator bar, Gtk::TearoffMenuItem which allows a Gtk::Menu to be torn off, and Gtk::ImageMenuItem which can place a Gtk::Image or other widget next to the menu text. A Gtk::MenuItem can have a submenu, which is simply a Gtk::Menu to pop up when the menu item is selected. Typically, all menu items in a menu bar have submenus. The Gtk::OptionMenu widget is a button that pops up a Gtk::Menu when clicked. It's used inside dialogs and such. Gtk::ItemFactory provides a higher-level interface for creating menu bars and menus; while you can construct menus manually, most people don't do that. There's a separate demo for Gtk::ItemFactory. =end require 'common' module Demo class Menus < BasicWindow def initialize super('menus') self.border_width = 0 accel_group = Gtk::AccelGroup.new add_accel_group(accel_group) box1 = Gtk::VBox.new(false, 0) add(box1) menubar = Gtk::MenuBar.new box1.pack_start(menubar, :expand => false, :fill => true, :padding => 0) menu = create_menu(2, true) menuitem = Gtk::MenuItem.new("test\nline2") menuitem.submenu = menu menubar.append(menuitem) menuitem.show menuitem = Gtk::MenuItem.new('foo') menuitem.submenu = create_menu(3, true) menubar.append(menuitem) menuitem.show menuitem = Gtk::MenuItem.new('bar') menuitem.submenu = create_menu(4, true) menuitem.right_justified = true menubar.append(menuitem) menuitem.show box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, :expand => true, :fill => true, :padding => 0) box2.show menu = create_menu(1, false) # menu.accel_group = accel_group menuitem = Gtk::SeparatorMenuItem.new menu.append(menuitem) menuitem.show menuitem = Gtk::CheckMenuItem.new('Accelerate Me') menu.append(menuitem) menuitem.show menuitem.add_accelerator('activate', accel_group, Gdk::Keyval::GDK_F1, 0, Gtk::ACCEL_VISIBLE) menuitem = Gtk::CheckMenuItem.new('Accelerator Locked') menu.append(menuitem) menuitem.show menuitem.add_accelerator('activate', accel_group, Gdk::Keyval::GDK_F2, 0, Gtk::ACCEL_VISIBLE | Gtk::ACCEL_LOCKED) menuitem = Gtk::CheckMenuItem.new('Accelerators Frozen') menu.append(menuitem) menuitem.show menuitem.add_accelerator('activate', accel_group, Gdk::Keyval::GDK_F2, 0, Gtk::ACCEL_VISIBLE) menuitem.add_accelerator('activate', accel_group, Gdk::Keyval::GDK_F3, 0, Gtk::ACCEL_VISIBLE) optionmenu = Gtk::OptionMenu.new optionmenu.menu = menu optionmenu.history = 3 box2.pack_start(optionmenu, :expand => true, :fill => true, :padding => 0) optionmenu.show separator = Gtk::HSeparator.new box1.pack_start(separator, :expand => false, :fill => true, :padding => 0) separator.show box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, :expand => false, :fill => true, :padding => 0) box2.show button = Gtk::Button.new('close') button.signal_connect('clicked') do quit end box2.pack_start(button, :expand => true, :fill => true, :padding => 0) button.flags = Gtk::Widget::CAN_DEFAULT button.grab_default button.show end def create_menu (depth, tearoff) if depth < 1 return nil end menu = Gtk::Menu.new group = nil if tearoff menuitem = Gtk::TearoffMenuItem.new menu.append(menuitem) menuitem.show end 5.times do |i| buf = sprintf('item %2d - %d', depth, i + 1) menuitem = Gtk::RadioMenuItem.new(buf) group = menuitem.group menu.append(menuitem) menuitem.show if i == 3 menuitem.sensitive = false end if submenu = create_menu(depth - 1, true) menuitem.submenu = submenu end end menu.show return menu end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/css_accordion.rb�����������������������������������������0000644�0001750�0001750�00000004425�12257552170�021615� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of gtk3/demos/gtk-demo/css_accordion.c. The # CSS files used in this sample code are copied from gtk3/demos/gtk-demo. # They are licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA =begin = CSS Theming/CSS Accordion A simple accordion demo written using CSS transitions and multiple backgrounds =end require "common" module Demo class CssAccordion < BasicWindow def initialize super("CSS Accordion") set_default_size(600, 300) container = Gtk::Box.new(:horizontal, 0) container.set_halign(:center) container.set_valign(:center) add(container) child = Gtk::Button.new(:label => "This") container.add(child) child = Gtk::Button.new(:label => "Is") container.add(child) child = Gtk::Button.new(:label => "A") container.add(child) child = Gtk::Button.new(:label => "CSS") container.add(child) child = Gtk::Button.new(:label => "Accordion") container.add(child) child = Gtk::Button.new(:label => ":-)") container.add(child) provider = Gtk::CssProvider.new provider.load(:data => File.read("css_accordion.css")) apply_css(self, provider) end def apply_css(widget, provider) widget.style_context.add_provider(provider, GLib::MAXUINT) if widget.is_a?(Gtk::Container) widget.each_forall do |child| apply_css(child, provider) end end end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/sizegroup.rb���������������������������������������������0000644�0001750�0001750�00000007216�12137115065�021027� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: sizegroup.rb,v 1.5 2005/02/12 23:02:43 kzys Exp $ =begin = Size Groups Gtk::SizeGroup provides a mechanism for grouping a number of widgets together so they all request the same amount of space. This is typically useful when you want a column of widgets to have the same size, but you can't use a Gtk::Table widget. Note that size groups only affect the amount of space requested, not the size that the widgets finally receive. If you want the widgets in a Gtk::SizeGroup to actually be the same size, you need to pack them in such a way that they get the size they request and not more. For example, if you are packing your widgets into a table, you would not include the Gtk::FILL flag. =end require 'common' module Demo class SizeGroup < Gtk::Dialog def initialize super('GtkSizeGroup', nil, 0, [Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_NONE]) color_options = %w(Red Green Blue) dash_options = %w(Solid Dashed Dotted) end_options = %w(Square Round Arrow) set_resizable(false) signal_connect('response') do destroy end vbox = Gtk::VBox.new(false, 5) self.vbox.pack_start(vbox, :expand => true, :fill => true, :padding => 0) vbox.set_border_width(5) size_group = Gtk::SizeGroup.new(Gtk::SizeGroup::HORIZONTAL) ## Create one frame holding color options frame = Gtk::Frame.new('Color Options') vbox.pack_start(frame, :expand => true, :fill => true, :padding => 0) table = Gtk::Table.new(2, 2, false) table.set_border_width(5) table.set_row_spacings(5) table.set_column_spacings(10) frame.add(table) add_row(table, 0, size_group, '_Foreground', color_options) add_row(table, 1, size_group, '_Background', color_options) ## And another frame holding line style options frame = Gtk::Frame.new('Line Options') vbox.pack_start(frame, :expand => false, :fill => false, :padding => 0) table = Gtk::Table.new(2, 2, false) table.set_border_width(5) table.set_row_spacings(5) table.set_column_spacings(10) frame.add(table) add_row(table, 0, size_group, '_Dashing', dash_options) add_row(table, 1, size_group, '_Line ends', end_options) # And a check button to turn grouping on and off check_button = Gtk::CheckButton.new('_Enable grouping', true) vbox.pack_start(check_button, :expand => false, :fill => false, :padding => 0) check_button.set_active(true) check_button.signal_connect('toggled', size_group) do |check_button, size_group| new_mode = if check_button.active? Gtk::SizeGroup::HORIZONTAL else Gtk::SizeGroup::VERTICAL end size_group.set_mode(new_mode) end end def add_row(table, row, size_group, label_text, options) label = Gtk::Label.new(label_text, true) label.set_alignment(0, 1) table.attach(label, 0, 1, row, row + 1, Gtk::EXPAND | Gtk::FILL, 0, 0, 0) option_menu = create_option_menu(options) label.set_mnemonic_widget(option_menu) size_group.add_widget(option_menu) table.attach(option_menu, 1, 2, row, row + 1, 0, 0, 0, 0) end def create_option_menu(strings) menu = Gtk::Menu.new strings.each do |str| menu_item = Gtk::MenuItem.new(str) menu_item.show menu.append(menu_item) end option_menu = Gtk::OptionMenu.new option_menu.set_menu(menu) return option_menu end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-text-extents.rb������������������������������������0000644�0001750�0001750�00000002151�11701304107�022531� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-text-extents.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Text Extents This demo shows how to use GDK and cairo to show text extents. From http://cairographics.org/samples/text.html. =end require 'common' module Demo class CairoTextExtents < CairoWindow TEXT = "Ruby" def initialize super('cairo text') end def draw(cr) cr.select_font_face("Sans", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_NORMAL) cr.set_font_size(0.3) extents = cr.text_extents(TEXT) x = 0.1 y = 0.6 cr.move_to(x, y) cr.show_text(TEXT) # draw helping lines cr.set_source_rgba(1, 0.2, 0.2, 0.6) cr.arc(x, y, 0.05, 0, 2 * Math::PI) cr.fill cr.move_to(x, y) cr.rel_line_to(0, -extents.height) cr.rel_line_to(extents.width, 0) cr.rel_line_to(extents.x_bearing, -extents.y_bearing) cr.stroke end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/alphatest.png��������������������������������������������0000644�0001750�0001750�00000063641�11701304107�021143� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR��|�����B‡}>���gAMA��±Ž|ûQ“��� cHRM��o?��r‡��ô$��„Ï��m_��èj��<‹��W§–mª��g,IDATxœbüÿÿ?Ã(£`Œ‚á�ˆi 0 FÁ(£€>� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 9]:= ¨�h´À£`ƒÿþ3Œ–÷£€Z� €G[£`Œ‚Q02�@�¶ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(£`„�€�-ðGÁ(äàÿ£€R�@,í€Q0 F~ÀÈ8Ð.Ã�Ðh Œ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� –vÀ(C D–,ó�Rî ŒŒÚ@Z›È``dø"€èµŠñÿö¥áŸÚ­£` €�büÿÿ?Ý,SLWRÜdhæ$†—7×Ï|4C—Hõÿ¡4Àì UÁˆPvÈãfdd”€Ã3 Ìgm0ø$‡ÄúriUÿR=7 †ˆ(YªŒä^`Üë�Ó8õ ¥FXrøÏð¨¦pIgØñtò((� €èÝÂO�bm(›Fèò5@ü ˆ›qèE7B+:`ÆeD(·ÒÊ œNˆÂÿ°< $ÿƒuþG©"þ³=X!ÔÜ‹@\ŒÃ?£`àÂ|kûˆn û Õ©èÿÿc€$Fpúÿšª@Í'FF¦ÿ ”Á \S¾ºxIgè*ZùcŒR�@�Ñ{ ÿƒ È¿Hührÿ‘Ø ú°ujÆ45ÿ°°ÿca£©cüÇ¢ÿ1#ÿ¹‡áúÚi—€UÁQ4}E;D-”T2¨¬ï?È,H΃Îç–Í‹‰U^²$˜&ºþÃÓ,#,Îÿƒ ÿÿÐt¢a|Hÿ”þwÇT¬¶¤™gFÁ( �½ |X!ú—³0F.ÑÅW"™­’øË€¨@þ¢‰c˜)œ‘äÿƒ!L¨±6 ˜aAîFF¨<Pü/¸¡ÿŸ’É!¥<4ÓƒÅFÁ ÁóyÑ·ÿĨ+^̤ª …9¨ÿÿ?¤G÷\02¢¤+°R〔¶ºiæ¡Q0 H��4>JË™{ÁýIÝe`ëþ*’¸zØÌý .œ½opÆfØÿˆŒ ×ÖN{ äìe\ˆÜ0þVy02BZxŒˆÞh ƒ ‚y¼ÿÿ/Æš:$-À8ÎÆ*¤‚÷òþ‚ óÿÐtñÿ?¬¢‡÷ S<aâÀô![±&„†^£€(�@9¤ƒk(½u¿‡¸0º9è½ °¨u)¨ÿ#*F”{h¸†nhR9@+Ѐí_¤–Ü?D•1 ,˜§ŒË5ŒÿÕái…0øÏ�Nà!<XåîÙA‡mà-{Dú¦ ð´¡�w¡ÏFÁ( �Ð@ é`¶Á†¯�[÷×°˜ñ‹~|­|4šñ/´µo‘ýgD-�®­ú ¨p/LXÔjûÿa>#\´âø?:¤3APþ\u`¡<A’ÿ¡®ÿ!…5^V²D¨ˆi¸<n©0@õ=´×Ç3‘ãýÿ!cÿÿMiëËQ0 €�¢÷*l-+F(þÇ€º’”qÖb1ã/Tþ/’:˜d3±-Ë„-ª„Ðà¥uÿ!«nÀ }ôB€qp�¯Ëù_£U^¸óiaÞˆy£`0@DaÏ*„!+æQ–gáÀ4!.èá ØA€&F¤™°¤JFŒPE!Ȩ!$aðÐÌ“£` �h Zøø†[`ø*°uØæ�ˆ.‚ˆ#&Û Ã6Œ ®­™iåC&h¼°®=#h2©ÛþŸÈa‚Q@˜?TØÏÆ7#dx4Ù‰¿ÿ„{cÿ!%=dѳƒÏé0 †p “¹•_°žÞ?¤tö£`@@�Ñ»…\è2 Ñè-|Xà 䌃ܒÿ&ŽzŒAp˪÷?²{5ÖP;@9ÿ‘{àµüল9£`0€ÀüÙjÀ8™þ´Ñï?h‚yÀHÿψœf€ÿO!Ëv¡;1þCÖØ#mǃ„è9þ‡ôÑl�%ÓÔõá(¤€�ˆI[ôV9¶Vÿu`ëþ3Ð1ò²LBcûÈ-rðúyÈ8,xí4†eW×Ly T¿±Ö©µ[µÇ…®Í  …ý4ð®nX\ƒVÔ0þ‡öÌ0æl°U½±Ï€%ýSxúa„Åÿÿÿð´ÄˆÙãüψXvÌž¾¥­½´òï(Ä€�¨e™¸ gÞˆÇ l…8¶Õ=؆z`4Š ]¢ +À§Làj¡¯«ýYÿœá¡úá]øÿÿGÇðøçÍVÆâÔÿ#<2dXåïFäe•D€ÿ 3Àú “=àÆx|)&Êpt¨<û²üXI02|ò7ÐÎ×£`�h ÇðÑ[æ°ÖýM<fà»Ç5neCÖèªh«6®ÝBp+Ÿ‘á�¸7�Ù‘ Ëðÿá² o´À@7K•‘‘a °æB?‡lŽúm•ÿ‡´îqVî(`eoÌf Æýˆ¥—à¾Z ÖCDT`  yŒˆuøÓw„~¦©çGÁ( �Ð@­ÃÇV@à dBçŽàëàÚeû§<#t­=dw$nðŸa-$c3þ‡e~ÄúlXÆÝi;P�TØ©IÀxâd€o’WÀàÍqÐIzÐ>¬&jã024ë‰M ˆþÈj-ðуà]ÛÈö'ˆ`³€½U`a¿”&ž£€D�@]à£Ý¶î“`¶ñzlC<ÈG9@ÖIÿG¬¡ÿè’ã,ò¯®™ü˜Ñýg@ÚxkEÂímáðÏ¥¤ú¥9'$W`‡VþÃçZ Ã9¤l’[ÙóˆA‡öõñ§ÿð4ňÎúŒˆ¹H¥3sIghõ}< Fy� €rH Ê,[I0¹ Ç×êÇŠaÝpX‹÷X·‡|¦Î?Fä%x£ëðéürgºã­ð\³¾ÁKeaC-ÿa󌈉Wp¯ŒˆI[t°¢'z%P_ Ù4í&Ê!|Hïš dø-í ›E]ߎ‚Q@� Üx…¾Qê$°uÿ–H3`z`‹ßð-Ë„±ajÿ1ÀöÝ@EÀ‹+1ÍÀ�W€­|мu@f�t=>ÔÈ’m"Övê`aï ÷è[”tõzÞ5#R,CS‚ϸdüÏ@z+º£¿0@óèYºÂÉÞ[K»Â¿Pâ§Q0 h �h ×á#ï¬ÝN¤È•˜¶XvÛB®}vÿ¾íòQK³A‡ª10º�i.ÈJè=G-–£-|:ßÜnÀh+aüÏôé $p¼CwÃ"n¸ÊýGì‹Å¶—,°¼;â<uL£€ö� €bHÛÑÈ Öý;ÌÀ¶,Û8>ÖùØŠ Øú{ø>ãºWVOþ¤v3ÀV|ÀVû€ON´¥ðË™á ,³‹ áý>.[=Æ6Ì™¬…·#–7 FÁ�4PC:È-{ØI‚°3t`�×p¶Ö?Rw|”ÎâZõ¨�¨ctC[’›±H˜4Ž,ÇnÔ'Ô,Ç�Z7ÎÈxýÌÒŽNdufÑ•@ñJh?â�Mƒèë'7¿!Ùñ$ÇäQ ]ÚÀ°R�Ò¢@·,Ø7»ìµsj7踂l Ÿ±ÿ˜Ñ¥·¯!ÃíL1Àä`ƒ+`ÅL Þ¾mÓr‰Ú˜ä—3Ýhn!dîbÚØá5Ðq›ÿÿNŸiOð!¾Âù=§Á¯,ƒ9õîªÞ8ÐÆ-Ðå'@¸ÿ‡;æˆ>Ⱦ]ÁÈÀ¹‹ÙŸŒ°ÅóÅ¡X{±ñ•ëò€f©¡t<À &¤]¼hA9Ͷ]âÆ­³š<· ›^¿Ã(éÃøîèŒpßÞê½ 93µÎù1q@MPÚy ˜ù€NÑrynX÷¹«Ì¤ Y]eÏy üÿjDÈ"4ªá#v8ò4²`sK‘.ú¡Œ#�Ð@ éÀ |X|†„Ö=º0€­gÀ"×Òð€ù‰Ø«.¯žôM74T@ùÀLjÿÃÅ Œ"K€£ PµÐnX9 ™Wd„´LÑ#t Š<&¡$Ôy×d¡ElíY v_ÔŒíÌ!Š€Cr;èþVO ­¦pW02,ö ù½³K¿ ýU@75�Å‘ï)f‚¬A‡•ê°«$¡ÁÄ[eOð)ÓŒ—‰q“oÎtg ž|FÈYóHe#Rf‡l¸øÿQügD¤ˆ3tUB!R<â@ÁX¸]ÐÝ0w .Äd€Z+ü¡i tý%®aKÐ*#}H‹Q®ƒúLÐzUŽî?HÉsöYL£%Ž5Bò##ríL– ›!@Fd7í» T±XðoÆáNª€’Ž xt2]A X”0Âv ]м ´ˆrꂃ³ØK|ä2‚J^r� €z v“hlý4¾–<2@WÎ댈$= Ö$0þªæÔ‰Ô.Ã9L`Yâ ´Â ˜¤¹¡Nø‡p”…µ‡�®þ1@/Jeüu,¤ÝldYÆÕ*\v|QÓ7â=€� {Pç ½¿z0ÃþÙ(«¨€…þ—Ôž ³Žtù;lòô?tfÑþEtªÀœÿïÂd+Z`aT›‡4ÿ‚<@ÿ:mÎ�s2Ø*Dó! Hص 7@F8ÿ#ÍAlù+µ!U2ãx óÙ!ÿU ¬Ô†ž¬óÿ±< ÿÐÂRŽCV¡TbP ð^ ¬ÀþÏ€-ýþ‡êSoB€3tñ¼ÂP²ë€*P¤qJ­– „<PÔqœèÞ t¿€<Cþƒ¥¤ kÇ2$ëΠªû«ïÿ3 ×» ‚^þŒ(�@}þY`ëþ=fà§Ç·Nº”ºõ2öû6–OÊ´—WMú¤öB7Ø€Ýô‹~ƒˆbaƒˆ’j =^@.'lœe̙ωb�²E¼¼vq ØíÐe¡ÀCƒe|Ñ¡ˆØ'µrÙ'·µ�íqg€…#Ýæä”Ò)®gÏì’@w4Õ~Î…üe@lNûû± rF<äþ`Ä‘ „çN|²§[ƒÿs Ëa!ád¤@ÿ èÝŒÐuñð…”‹ÿ mHz€ßNs"!1€¸ÿvŒ¤t‡o¼‚v^`Ë}‘Óè_èf/œ~d„ÉK¡Æ¿ðƒ†#Ú< @ÜñâF¬•ʈ{ÿÿEšo‚»º’à÷6K�ŧç4ïÄ/Ä€¢öã¼ÅíÇ2€~Üäf0€zL °ëA¡›â`K›‘÷Å`ú±|6oÛ‡_EŠ #ïê±� �yWŒÓ@횎ñêtÔ¤¢¡¤£ˆ‚"BEAÁ(yIºü#Hy8¾µÇ6§;$ÒP°R%Òí­½ë±£‹gþ²ñªwþ1„RÌ»‰Ï5à† À@BÌB(¹p~µ= à=QåVÉqqóx¦s¯É*š42"�E èÆþåÓ‚‚ÁßâŒ?lÉÃæ¶þS}=Ín_ŽýìuÎgñœS$$›•,¯Ç®UÐßéÛ§Ûȶ.†o¿ê\æ³ôÉ1_¾_ª½ ¢x¸ŽÀ7Á‘äÅA#”%_Á^£O‚ë¹û–È”É*Vµ’v@aôjÄuSña» Þ'}²­eºG£MÀù0Y² IÄ%‘Üjƒ—é*SžíÁ¨ª\Œ}ìL›9éȨà Ÿ®î_7WÓ»óóxxÛöR’zß;½Õ ù‰Û­Øb·SâlŒ'Çö­û”ÁS=iOj„^˜Zìa¿­ðwî(Ä@Þ©ô ‚–öŠ[ hk#¢à£´,ì,ñ^ÁB¼€÷YÇìÎ#³’U´±PóÙIòÏ7a“üòLÛoè>вÃ6`è퟼Æç…RBFB6Ÿ½Vy;lÊ?¡ ~CªµÎ4Yõ9v² ˆ*J1Q.QðŽ!Âçɦ˜;v2XXðŽàŸ²AÑ¥gNô+Y” éº:”©,Cü [JÔ[ýu/ôÿã~~q÷ß! –¡QRP2áI§˜jƒvo·MgÒD9 N'•yg¯dˆI0-z7ù’lBò,˜z|!}i¦˜8i©¹|¿Ò ['D!s§öfÿ}n{ÐúS´A×ÀÜ7­¯q0‘R-æl ‚Þi°ý!=Ç™¦z"uŠb‰ e52,FËséE݃ŸÉêÚp?;÷­bv+”ˆ ‡úÇ$|oÿç'6é<ȳšñׄÿ€¼+Öi †¡và/˜ØYA0ÁwTêÐ ‰ é$`de@]øª*Hü ;+ƉßKr¢J DjÓëÇιî³ïî/ªtXe³þ¶«³î{öÖŸ¡X;(;èo»æ>ñÙéN4Uì4²ùмpÎ;‰Z©‰(Í€m[#Ò†3–/m’”bç¤�ÈwSD|<n^Ÿ†­0ýÓÙí¡³8B•-E¶µÁãÓDìÜþÞjqµèù,/_Îæ÷ió‚ [ÜXkBŽ\‰K\!;nîìSDøæ.a€z¨¿}ï¦Â«&qG\ެÂö&ô•¼@£×"p³uœõ{•D…ÿ&Æb„þs‘F­êšð¹XfËd?8%ÁùĪ�|/¥‰Ö.Ë€Öá…gßFÆù¢"<TWió1*,5Ã`¥I¶Ïüín³üãæÎþÀ)ÀßêP™£UÓ1³mè”)‹/ó@ã#æ\öó\6´F¨Vâ>nÿãÿS� Ô¤í`ëþ™fÀ2,c êÈ?’Šü.øz°$'„K«'~× +�¶nÜa‰J?¼(�HI2€/º†ÙËI¬ð‹W`Ù© „tÕ±¹üür FD9«$ ³‡ˆ5i@QPWýxìà?c8dÈà?R ^fˆâˆé`VΩ]ÿ÷Î.›‹n°Ð?ìš:r†!l êü8´û÷Ù¸'PÀÖ©Ù BcéœoÎôÿÿ!—’À¦4aSxÐÉ\ئgFjdf6‘ ZÓŸp…`Ø@ ‘¿HóÏŒ°yZ&Øô0¢ü„ÿ¶Tk ŒøŽÎfÏ»þƒE-ÌœÿðZ“á|Á't‰"õÃÖ-eÂRPÂ4QM;p{aY"‚ÔÓñ` ²Àöª@ÍSÀG‰ÃRP«ÿCBÚ)ÿᣨЋi`é Ã-/ 3™“äðÅYÿáXÉ÷>*Iz‹n˜€�ä=Â0 …#p$F3,Hœ‰V&ÄÈ à(,&ÄX=Ò$Ïq˯`` [DÚÚ yŸ‹ý †_.äó—sXI[O±lûdžâó±?½›]Ê“e{4oú~_[G܈ •¤.¡§ðÝ”©)Ûæ“.%°Ë%‰hCålD=áþÓ‚ôƫ֫ ÷§ûŽ_m ©òÏ(³uä ¡Âdd~ÓN7“{sî·‹“¿Q…3¨->sÚ ám¥7S³  XVñQ‰+ÂÆ`²˜‚XÊŽ}SÚóWD´èI!±P"1I®` ãhîžlžÝ#¬]éÙOùì„F¶…A…ÂXÂÍåà,ǘL\Šœ Û@‘0UèÏÖ‡n}îm‰ðŸ’4Ÿ#ò²±‰ßÁÄ´„~BVmIdô³~Ô.6`n?ƒdûýþe» @Þµã ÃÐø,ììÌlÜ$vĘXX¹G`D¹ ,åÑøƒRQÁÀ@†ªªÒ4uêgËÏÃ?wÞýíË1¢‚ÅÅ­Åñï=פ-!*ÕGírØ]»ÛO̽QÊÛ.XN}ˆ1*éç D¾›=¿ ´L„dïjÀP²+ÚÏÉcÍHs¬Cç•ðø°¹ ¢´H“ér;¯ {ܯ› úéUñr5(Vtv$[ÄÁÂ&‹ý;ÉäŸË<¥2•Æ%„÷ðøu¬M;¤YÅ*1|ɲ|Ð ž]"I³žÉSžø„¾f}Ú´Ð5Pp–²¯‹’µ0þ§nTdNåÛóõPAþ:w‡®G"3ÞIjµiÜ¿K*»ÉNx°ËÛH o"—¡ê=à£TXŸgHÑö:| ö¹= ïÚq†ah½3p�`ggç\€…ÛpŽǪ&yþ´i+$$†ªjIâ†Ç³ýjÿðßIÎo{{6l}t4¥Óçþ•1ÛI»/æõÐàZÏ[/Û)-,±ÊF}~mÒ5êä K)8Á“ 1«9P@{eù›ÅYKw¨$I0…«E @"+T�¸]‹÷q<]o—©¯VÐê=÷dzeÝìC�L¾p67ÝúTã™IJÊŽŸ2ðôxgbÓŸŒÇ Gß…ŒÓâí}ì!3…É5£t‡Ëg—ÆónköÇo¶òÄ0¢ÆõLÅ}oRÄ™1,qŒšµJë'Ùá^¥mh')!¦ $"»%;)دôš³íû¢,sé$™9(N€•5¡üÔ¤ÑÃ.bC uYýemª×bë‘ìµ´`oxð× ÿ%�ygo„0 Ca«#° 4lÀ� =;P2� ‹0+q+zO „ðwGƒ«¾sâXÒ'ùÅùµÃ?}I÷µ EîüR‡#½âÈÜŽ!Ü*åK^|A¡žUÃðY6ñ°$êêÕ£[ñÙœI¡B‡úi¦¸ö ñ/Õ$ÃÓÙ£{ž®¶Íµ÷(½Ñ¥B¦h*&á¹ïi·Ó´NæëݲoŒã~SþáÆ˜©�Ò7 _Q&`� ýv.o•à]ª…S}‘ðÚkfãå�HSùC-@º£÷ï;J*W0 ŒCÅ6p%�A2¥—ö„–ðp¥-öï@Cú…:J­Õ +yÞøž|³Ú®ÇO&jqíÚ@•’^ѼV|Mž;}�/J•ÕÝs`2JêlO‹Ð¦Aý´ƒà2ðým»@ÞÛ ÄÀ÷tôÔHÔ,À”´´0=s°�ƒ°9üg;É' „hˆ„D}'¾;_,ýO¿ûÛ–)xü_ÿ„J­)`Émÿç¿ØìgõZ“¸QöS}ÀÒ=IŒSèí;xæðõ‹*!1½k@'-žüIŒ`õ|(æú¤Fýç´hÄíŠ2N,®& ¸3X-W»ã¶tËép­;'}ððe ÀǘÅ'Ð<–)•[T´Ó¨–ƒöæž¶9°À»Ð]€ã¬jû�aöÉÐU EÇ2ÌĬ4hWÓU²Bí-.$sϬŸ3„9!±Ù}å±Óéx¢°'—vžÔâ¡@¹;iƒãÄìÈ´£(O4Ñ ãJ$Zðþ{{eK+G­ÿy< ïìq†a(loˆ‰ƒ +ç`cæ œ ‰[!Sšçç±Ð©?Rš¤ýúÅN­ð¿±Ý{ìÞqvê?”r Ø߃¥€Ý‚_ÐQ Z»¢ã¨ÜBÕ™f«m"¸œu6±x-°™{¾Éz{˜gÊÁJ’FUéL<~qŠ"dáþ%…û)öm±ÙåFPúg¹-:§dÄ>°ßfø2F´¸¡oy¹'T;U°osEn@_/|e?ش٠m<>2¸Ëù1V$Pܳû)T°iÝ¥]…vÓ± Ëc»›¬Û¤ôâ ÛqŽFw êÎ2Ëæ$ø¬Wýýñ´Êšh9¿{4$Î)þ:¦pøVµYÓ|„ØÄ3õ1ëý¢u—þ—þßnWÈ»–#bª±Ç«kñj%žíÁ lÀ®wù<Ø,fFoŽ÷ Ùax< üªÁ¯}Fû½7_­ï¦^Èïþ„î熧 'Ú‚04›<„Öä†_Ò?û®’Ã*‰ÈpC8,èZ«´K‘МÈ-ùW«)|F½ÈeB%<CÐUDÕøÓíáxÞWûÝ.§ë$åîÕ?ÑÿÞuåì\¬2ÅŒŒ}Kë @†lºYwE7 ™Ú•yãÞA«=’£U'îû¾®'<ë€3š)(¶'’ôþMÒê°ìÎÂE7 ›Gž’¿Ldjj¡´ê&/“ç"0îQtïÿœPŒ| ó†õ�®œ;#Q«¢² ýÝÿkÿ%�yWp„@ I5¾|Û«°‹°+±Ã– w!ŽŽ/Ç|î.w°Ø_üWÑ|æF'1ä,¿R‚d2б/ü4&ÁH)×Û,$LDfÏ^(rˆH¦ÅÏ U Ç£¶«H¿ß]:à:¥…_¯hÜ™,B¶ˆsi}X'QOÇóåɬ ­3Ü„FŽôÓûïjé/ Ȳôn‚; ºSXE’ŸÈ —Þ“¡³<û÷W¦Ff`ÜN1cN:íÞrÃo(òëJ×ÔûÍ"ü ÷ž¿—"A¦³h×â»ÐÙ öÒç°9«CÆÉÆE¹>wf EV³•„m!AØÕ¹3Q¦í4zhKþÛþv<àæÚ†ah4+0ð @ËT4,A†i¨©Œ°#½çÏù’K i’Üq‰PdéYzÒ/:ürõœ|X¸&Rz¡3^É/DÚ‰µäƒ‡íò™A*ézÒ X¬Z¤hºÆh(N”Ꜻp¾9ªÁ'™6=©ÇÛùñRèÆXaÀ& dær“õ‘Ñ£*—¥ûCtúûÞ{×Ó=žž¾}2ëÃ;„„ {Bì¡`2ùèŒâúUäÄWR I{m)€¦ëlG¹¨®K¨R‰¬ù\Á¨EÀ7luî†lw­Â̱*ä Ð@ÚÎûQ&ý”éBÒ‰uÔ•ÿxS1wëÀæC[2î=kTêºáÿDTSapÆZi>Á”þÉY¤dÅÒ§Ø]{#oõ]šû™ÀõÿÇW�òÎåa¢Þ&.F”CtD=Ž[ZI&8a¸1á”É!1!Ò>},þÑáïQüž ÄKà½ðN?. §u{iDF›+A’ö;=¯�’lË£{Á4þ­«_Còœš^ P1Sƒkdxž/½<Ã9†÷¡³LÏ.ºIª0=eyyŒ«Ÿ»Nþýö¢¤¿¹)éý£[3« ÔÉÀk ¶¡'½PÌY„óâ_¾‚eˆm#|P\‹ Ò¢£~ÞÓÂôÆVDáƒð‡™¢P0ÏÎáiIð½pýñ+:£Cþž,äZ{/4T£sæ1áavýÅ)fó” PÑIï@ªap#¢Ù–R0ÇN>Œä*E1‰Ó]#Üe :<å¿ ç n†a`úbÄL€XŒÂ“ ˜ø0Jîì‹ä´ðDäW©u¢&9Ÿ/v~ð?‘sæÒ2ï*‰H}¯á¯6‡‘=/ ˜%íɦ"ÛÃ3ÓÔ¨ÛGêf BuD¼ÙóÍLk;. s‡ãŒÔ|'ج ·ÈÃ×È0ÀÎÃpóB"l`èÇZ+)xe»ÞÓ¢Ëi~}ví±ÇÞˆÁz)Ù@2«,Ø”œ02qÇ;0kg¾;ƒ—Z ¯õfÞG3'SQŒ¹ìTLþ{e®&vIøþвõLäEcˆr8^”›a?²GÏ6zX„‹T¾&ÎBI¯SÌg=›’Ë�“‰0Ø B‡¹0%&­L›É9 öc{ @Þ!AÒ„ ²Ÿö`–`þ­Ã¿U@ÄÜîÞ†¯#3¼“;2,›»½ã¿fî½N òëÓ‹W:úvsâËR·Hbldi‹H¤ÞáVµÑ4ê{(Ž •@Xa¢\ùjÅYd}jGÛ<ž÷ë{ü ’¼%=> eMògë•“Åþ ©«m×]E29Ÿ.·ckþGýaׯìaX±NfÅ©Ûf)9àríS]ß1Ÿ+ZA¤©ÁØ,tôÎí ÈGˆ&# k‰ÿ(ÅL f©v˜l…ß+Ÿ²ûLÛ)·Ä\ÓPG‚Ûùa 6ç=Q•Tð‰ådᎋÅp‹õ $¬·6LŒòÛvy¨WP>¨~ïë¹ÿô?w7Ã0ÐoÆaø° /FéF¬À™VöÙ—6*Uˆ<Q¥ˆ¤±Ï—;÷þü°m¥qÚgab*Þ}׋0¢ã£Äa™>N’È2û¡@gá*NNLw¹ _蔇í•Áå¢ÂH½9TAëÿKeŸxa4%ša}÷ߘrH™)”$ID"àØ½ŒŸZD_Î×û¡7ýð¸=7¯·u²ÐcвIü>T¢ÄE"Å÷á+G’,õ²˜7ºI³GÌ+{à÷$¼o"Á×;åÁýûÚ?ŒÓ›Ã"1‚ÿÏ §\1¿ž^)S›ô$Ã>N•Ô´ÀG^b—¨© F+ÖÕ7�¦]!kÎ6(Y2.1¹¹>ÿoÇG�r®ea†5$øH>áÃRÛé*í†Øi¦e[b×vµáûð;znW4®CN´@JyêE¨oô¥»Ä+ Ÿ-2&Mi™lÙÇ£ MOW§:}[¢Ó{ âóQQþÑô±OLÀ0N ”ÚDXB %h<š¾™žK4áúz¯Mÿz¦Î,Fˆ¶ÙVë.‹"—!Lƒ A¢Õ>+ûë…JüÊîª@ÊY—é–&8tynoùå@ $l >‰½Á«îb5d8´>®þÚ}ÔŠà‘'2N@ÂuO²Íÿ’#¸q‰Ë9بù˜jõ’µUÃS6ÐS)ÅñÝ:ÂOíF§@Ú¼âÖ y¼ ï r†aXóÄ ù&_àE#LIì¸LÀ ÑË4­šÖ¬MœÌî~Õá#²käÞû¦Ïî܉< úb"ø Ï,¤ÚH™‰Ò õ˜)Êž„OS«Mc´eaYCéŠDktL‡muú·õp »à[D—):�‡*7¯'ûƒB'ª%ióBEõ<¯íò¹Åƒµ^Eƒ%€ g)ïØ„jJ;€9òֻ¢Fd; EƒhŸ}’4zTÒÉù%1+f ÕCÊESwîG„o,»;gFL=/é’±Õ<ñW/ìÕc]&Þۧ|j¢�Zµ­´^Eé( ΢¶Ùm^àëÅ[¯`Sê€3­ûÈ„þ¶= a •hÙ‚(銊è驨žމX�Áéÿm‘ Gƒ‹pbÉÒËgËFúu<üoAzsÞëÓRý-Õ•ô;<šøÃŠZy¿ê~QÒ‰€ˆÈÆ™&\-m´qIÜ‘R Õxm¾×AÁýúhèÒúe­‡µ÷Æ 8rN›ò¶œ÷ëÓt±=žŸ…w]-}—œ» ¼&ê€|½“ œ§¨}<[nçÇÝêðW½Ñä¨7 fu×WÃRWØÛÅ– ®Ô.[}(R³iS|šê´ðÄ<µD]È=óІ\}àØ©B.U®ˆø ªGšpRùÐPÛ$åqøHãHÞ`íÉè¢\„¸áÁ:‹4T7¥°G�©Ú` Î_ڷפ‰4)‹øù±:i„Ù")ñŽ"Jíþí ÿ.�yW„0 ¡¯ð¾Ò—ø/Þ¼øÇˆµ, trÐzrì¥3M É0Ý_üÑG[C  ÚtÕN¨‚û|Q‡;ŒX´`8ÁJ„/"û4Å™¯¸ËÂI3(´ëz<ÜçÛe£^[&rÒ×STvz g#̱ÑŒ½Ì"ºÀ¬ÄÛ¥'Æðø¶ŸAÿ6ƒþùsýxÌ$ÐÆwé¤ý Ê.!Xœ¦ÐÉ’Ýé yÊ2F ÏTW §h E}¸"VI=ª?ª@wŸh„×Ô3Ù½hâìÛ�­›Ì³gE©§?3 ÞÆ÷q¬²à¤¼±½–>Ê*®z(±¶®£ò6¥FÁ¥4â•.*+«& !ŠÁÎÿ"Ñ£áª1þ9à @ÞÜ ±d3ž¬Â ŒÁŸ“°âgªÔ¾øªDÀ ¡FªTõÑ&×´ÊÙ>ç_!”®Ž¤à©Qq¨±ôÕþ °{ËF,¹`‹_ ‹Oö¹L©¿ð¸_ÏÏ¥·¥_”n;tfU™Õ  Æ!ô¸KFJ¹Ž§Ë§›jl›”Cî¸H·2íw&¢¦~yÛøJŸ!ø�.‡W�¯îÌJ—F¤¶JØ9éYLùcs¤WôrfjÓ—6gÐÇ ¬ºöL¥X´â4͹Z´)äcœ”‡¤«Ä»Cn9ê¼`”Ä@ÜEòxbÝDx�Ñs át Ûht†š¾gZZFÄ蟀õ™Ó8í¢½àîJŽ„a Ô]RJÚI )„.ÒI&P�I»"#fÂ#üa†>°W°ÚµÏ�ø\lû²Ìf æ‹ÁyÒÃežÔï|>øòºQUYd"UÃ]8|ØÄ¡—a}ÑÇ</ªÉ©·f«Šˆp?*ûÍþ'¯º‚Üåz»ï›Âú²áÔÃxÅà£È)ï¥7Àü¶Ž>k+ç²y‚V(àýrrªKû¹z¦ßÉ’=2ǃ1Ÿ“u½jññ Tn›:Šá¬´såÏó€R'€p*—Tê/KæYT´×ÿÂŒíg½BÎß”Û"xÿ Mn—*ÞÝ$ÕT‚O°Ûø p=”»9kù@ÞÜ Ã@ûÇl,ÀlÀ¼ƒ?ë ±J ñ/QKûÑG[©UmµîÙNìË/þ\5ÎXvUä|¼—Àƒ†àüƒ+[±‡>r\@Ý] $úR¦Å/ñc»]N÷×áj ÐQÚEºp`¼fYAú'˜�üèj…Óa<ï6+ÖÆ®»oë©c±±Æ­âÙÔ U½çæ¿î„, K( &h•:#ÀÈ(wU–�%"â>³*ÆrÛ�KÚy˜†è°lIõ!«µ÷–Åi·ÈØ–’ŽÉ¸ßò\ô‡Ýó_s4£…LNåx‘ìÉÀάÎh[&¨3þû:üI�ò®ía* °0›ðÁü³[ðϬÀ ­ µï|•Ò¨ýABDÊO+õ‘ºgŸ{vð;Qûâl9 ‹Ä²ƒSã͆`ŸŸàÒ�uhJÂ’Õ†ªbøê8ž¯û:­}ÛåYW倞do†ulá—A�rd¤Wb³5îwW·žV_pVW XdÒ‘R?úLm€)Ÿ§CZìÄ—âÄyg$ºtux½ÊÞ)OAçåšr:‘dV^Èá g(ÐóXRÒ°-R'T4‰„цì\iÚÇŸïX§xï%6µ“±Æÿ‚y!ê·di´Ÿ¢Ï°1Í8G›±çøsV3ºŸ³Ô?oÈ»‚„a(/Á:¼@b žìÁŒÅ—1`…š´¾³(•¢}äÕÖ²’sbû®¿ø=0o§ZE{Û|VÍy0…3çX9‘Õj_)�s’y~Évi’Bøöe¶ï·Çs÷G)ôoe¸ «=¢s¡s±¢ÒA#TI !sÀ¶Õ2n§Ën…Ñ9¨±IyÓ^]Zd•À=]ï¬z$ÈŠ}3¤+2ŸÛˆ]"­¿Æ“+¤²… k@žÎ ¢Â`*Î:%£[{ÅNËýÃ#¬{8á)„ÆÈ[€rç„Ò³³®Gþ*Ïß™vø‚°E¦54—*=¦Ì†•ð[´[N*<E0È¥4!ÒC’RcÉwlÙ^¼ÿ/®§�ä];Â0 ňºs Ö^�‰½#'à=D'NÀ1 ÅïÙqÕV° !2µMÕDnâ_ìç_føk õó ÐT¡†Ã¾Ûpíî4§cœ´0®Ú6±R(XäJ½ø¿ßÌ7Ü4ûÓl‘‹þrèŸýC¥ùÕL627s ®³€ ˆV¡&nŸÍ®=¯—ѳF·3 æP8ë…÷‚ƒ> ¡ûö¦W?k¡4o0¦™SVÕÈ -¹¥12JE#jèù ¯µ£‹ÁXg,Tû€ÂºŒ<3GH‘ÓÖ.Œ3WTš´î¸½©ÿ‰zatM.[Źï0ÙlYK0xžö$¬ ;]ÃâH.@ýk´Ì‡�Ô]Û Â0 t`>‘‚˜„­˜‡$†@Gkû÷‘¨?è/¨ÄIkÎgûü µg‡žÌ>ˈ~ÞåÚë]Ep„oˆñðƒƒ›‹WìbpÄdÓA‡óu×ÿ†®i,Ñ=/M§lzJ¥S ‘t‹©EAßd="ã"2 å19Ëakö› *!û`Dí:lf,>TÑ1§G‚F‚„c±¶6¨Ò :— 7ñ0ÑéöÔÆ#+ZD8Íû‹Ôd-èhMO?xñ¨ö2çšï!¬þŒfãYè ëê{BÖÕ¿µ°ÑLgÔZþÝP|áz |UÁuî#ÑÍD¿Ù£”RýÒ*õm”W�'¾»Jr™Ø\’ð–ü<Ù7®·�ä]±Â0 ´ ŽQ( 蘀ž)‚-˜ˆ2%Cä„cé%ë…»t.’ÆDZ-)/éõ‹ÉA;³6Ël¡³žr¿±Ñ€g¯5Á'™'Æ]^ÜQ$³D ¬gcnj§ë}*oxH;ˆÅ«<,¼«×K&ôk‡g}ÿ·Â7cóçdÍ1{ß~,Á–Æ_‚eO(îÎÇãùöدNÈØ;-’E¹Z$c”ÝYÅžaÚGË|ÁÔÀm IÅ&dJƒ…Ô1dRÁjó!¨.øÒr‡&î‘$±|/s§|sz†R.ÀîØ„C=ž¶ˆ–µ0Ke6ƒ™âPhÆ ¼®”'‡ý!wÔ_ð5Ê8о›øS$':ËE1s¥³tæ¡þ²}àa ÜÀÔ B•;† ¥c V`†h)býKq’Ë]:p‘"qìÈŽßÒ[–ðãÏYvj©ÝYfþ´Ì³$=…¾áü¾k…„X)ÐMÞ¬šHû,¬4íçu[~%srñЈ®þU{ÝWÇ˦Ìö¸žÞíºµ¥½0Iš+$,º+züyí{#%w¯{|ë÷í¬`¾�[3ÆiÔâÚ%À+òínx"2é i:hÕMÞ ‡@éVJž¸uÁ÷ÃGÁX`%iŠ“/„ú3÷H‰4ÙP…ò!üÿ’a¦º ¼>5á–ZòûSÜårñš”…èÈ{4´tÅA1¬}5I·i,_K’"–’µ;O•ÉìA4ÿŸ>PwÅ8Ã0Ð L¼ˆ…G±ð‰>€03ó&žÀÂÆ�2&¶ÏNQ êDBU!MªâÚÎårùG‡ßrö}ÇÞÂõÝ1eYaýŒ\‚wØvq§d°6Ìž¸‘9ä›OäàãYØW{D‘¾æÒê¬5Ö×J/ºq©åf¦òÝRœþK¶½ß¬nRo'W])8ð*œ‚YŒš*Ñ8Nª†.(—q9on–]ʳ6 kW¡dÔ¥PÙ5U˜<£õQƧO1ÃnX*Q 3éÙ82|<›7pðó€€8ìˆÊ\‡«T5m¡_! 4š¦*@(A!±©\G‡ d¦Á˜#1²¡n½8Ëá¨%&©óæ0¦»„ߺ71Çc;¨aaVÿ ®5¢�«%{€ý¡Ÿì0 þrÄ”‡�Ê>òŒ>¶]Mê  »zÀ$tï?R&…obDO|Œ(™�’yÿ#vêR XÇ׃–Zª@&åø 6‰èZƒ°0°pösHîÀ,ôg—¿fÎu@¿|g@«/郚…TèC†þ#Z˜¨“™(•/80z®ýï†Nâ!ÙÛœƒ4© ­LaöÂâèW Êé.Ä$?ôZIøÒOè\Èág°uåЂO@w¶þ‡M¤Â[ì° åð1¤ÞÄÿ`»q sâèn(<¼‚˜[V*ÿ¡sŒ°a)áõ;T?ÂLئFDƒs/#Ü-ȇõaÚ…˜†ÇùȆ5èÊè²O´Epÿ#³ÉØQ?\�@�ò®Ýa†Êô Á t À TÌ@KËìAÇÔܱ=ÂŽ¬÷D.Îq ‡›¤‰?±-?}žüË¿5©c¨Ÿï4+ÐiûAÉ(ÿ–…Í]°i@ÀaÛH?lvÍŠ®4¤tý òXnöó¼C†Ö;$×,Êp@þ7KŸUlá³ÜÇõj{˜ö¿;w…pv¢4iR¿h;•ŽqË ´/Õœ·I'£ƒ3âÕkÝŒô¡zß -Dƒ@ó@&Ê·æ»ÊÐG5(Bjyh©›•ÁΜÆNÊ¢öÒœaÝ@½îtr~° Y­h§EŽJn6 ¤$#EU­Jî™?8JÞæHÉ(ÿš^¿ˆ}Ö?5k– +8¢‡u•Я²Î’k%ýùƒ ZÙß"ü§�ä]ÁÂ0 sF`–àØ…-x³ c°óp&¹X²Ò#m'øÑG>I›DqËþÀÇDnq÷‹ö ¥33å¿¶º+Ÿ9ŽÂéXtAÐÓé’ÿ¥ f-to¯.·cíó ºª¤w=7rð4-j‚›Õõ9ýk‹NzÀ+ôæH‡ÔÉG÷ùC´I÷˜ÒxŽž$=Hrë•qEõ¥­oÂîxI=üEŒÔŠKZ‚Âu Ji…F(…ªÔ~þ§Hið‚ˆ(j_âr:´Sá•EZñ°© ‚óVáƱðÂw|¬»µB:z·@€·‡:ŽJ[G*ÒI^Cÿ>!‚{õ<DˆÎÊÃßd^,1íkoÈ»v#„ajÀ$´À1 ‹pÇ Ð0Kd&`J*#Œ­'ɉÃçRq¸I“8þJ²ôžü«¿5¡C+ÞkõLË‚…žµ9í¨w>.©Š«{Ó’¶OrÔÚFª‚ÓÎr³›§®‚njºóÜ1‹p‚P³ãsÞœ³ô\´¾OBÿ‰Ðè‚wõqSÔK^ÀQ°œBøóœÅ >ðs½,L½¹÷8ëhŒFf+ Tgòw':‚™/÷r‚a³úÁ»¨×©ß{ÜM¡òÄ$‡ ª ,í`àêUIø ï°öœ¶�Ö5!P.æ)¹ë©Z§ˆµèºüÀ*Þo×·ôÞ1ÈËÂ'ï5Q€ìˆ`ÊÝ”4>V\?Å­6o mnA2k·ÎŸ–‡�ä]1Â0 4 /aeGB0ð6žÀ„ÄÎÆÎ x;?`gbd¦&Â>û@-T0!*U’(Nj_ì³ó« ŸðKGéM„×ÒÚÿRáúsÀää$M~sÒ2äëâCô1˜.»EÙ˘}(øM=^šÚzucªÑ¶K vGÉÚ›ÌV£º>v›ù±|öáÊ 9M¦.OÆ øxç׳íÀ_míÌ7Ÿ§*Ë‚ªHö÷:-,dŸvkíôpBò—Q>Y&â7´M§–ˆ34"�Ìî²54.¿Jú§Á0K×—O¨,©\¨•jæØ1ˆ u¸Z j§¾¼Ö‹á©4Ûzÿ<Ÿ«³PUõ1Öbüï>‰{ÊeJ{5–›Ï A-8¬þWÝ‹Ü ïÚmb¨o:X‚"53P1¢§É ”°% ˆIs‰ý|9¢ Ñ ¨ ‚(ÎÏ~Ï~ùŀ߽y$ÄíLæ²ej/û-ç|(ÿú‹?&vY%¸gpµÈô >þ+NëqÜ÷<¾¹ãª¾w›û»ß$d‚2e}r&³å¶Èí§ úñûWYŒTaAT;x®¯d–z-ü6ÂGÿ³FaT1„~l±v¼3i�haSŸÉçeP¾X͇$¦±¯ä€ÐŠ«’-˜Ö¨ CŸHÌžæR‘TzeAÿ9@ïG 4PfÛ³´‘eìä:¼ö"`bÀ^CH:Œ÷ W¹*NñBï™ì9Éjûàl¥dàcâz\š“HšIEð™«dwî€=Ÿ�þ5‡ÿ@C±ÀǿܒpE€PElU§Îr-`¡˜¨ž“%ãÿÿH­>ØnÂÐeŒ‘ŒÂ>v‰˜ÇÖ(�[öî@]& e”ÿë”á-ö;G4ÇkÐð$è_èzkèšmHë :, +ør=%`¡oͨݳJí¿‰âOèò;˜» ã¸ÐzæûØ>†OÛ¦å¾!àuþÂç`”02Àþ‚‡/¤wÛ ]eƒ:D0—ZþGI;ÐÖø´‚å/¢`…o*ƒ 7à‰[èxùXEi”À—b2 sèä+t²¾Ê >y‹Õä9è’L´óäÿÃZ@TÈ›ºð ³à�ý•Ög€vÍ2Ÿ0ÀZøùѳýÛ«€Ø¿€ @þvv|XˆÕä5ù£cø@�@C±ÀG/ıµèÑ+�\•´… ß!K5�L¶çæÂÆóa¥Õ Ëè°3ÈŽÅ$ºç:tó˜jQóØj}‹ØO 9 cø~€·– …ÓÿãG6œ$èPðâçÿðSa¬‹ü¶"„~ï(¨SrNíÒÄfÜî™ÅG€Ô-Ä89ìhÄP¬ÕË€Ôõ†vÑv/˜@Ĭ¥ [Ø\òø3ìþSø†&HK’¨Ø†*Bž—@:Ú—Q0þ‡¥EØå"ˆ^¢‡ƒÓSÐÊqÞ të¼ðEZñòÒ€ô”¡n@ZŠáè+DˆzA|h„‘çŽ ôUY=ë«´š4oÐÄï`À†ßàË,‘—G3üEº Óˆ‰éˆÍ[ð zhú…¯½GêEY®9b[ø�4T¯8„öðÀ‘ÇÈ€˜m…E$#j¤2¢‰C¯Œ0>#Ô@ª%`+ÿ·AxÑ1 ‰ú@k$`%ÌåðÑ#äË8ÿói+ÓèJ{¾]÷r…¨Ï½ü v¤G�»<æ‡ÿ_^;stQ#±p€-Ñ;Œ0w1 …9ý?ÒvÆÀBÿ×ÞÙeÃE»gqMëcj—ƒºð»F‘ÂÁ†t-mŸžó°s!…5Ä-`Ç1BîVd„vV@A„ÿ{$ÁFXã9ðøÐ ü*@P‘»‡8Œ 0yèÄ…e°Ëñµð C9ÿ!÷½Â® þ6ÈùL°ä¿ñ:ò=ã{ú…ކ’Ô!Ã\`ÇCæÌa×þg„Ì“@̇,2€'²@o¥åÞâŽãGf€V…a¦Ãâq;2,£ˆ*X:…Ä5ø¢øµ¢pÏ"¹Ýጠ”xd�€�Š>¬öG.ä°G.’Š8t ,ãÿGÕBpaeßo uÆ0¼Xh´ èÂH1*Ça™º~Ù6ô¼/F ›ÉQpC®ÇeBì †ÝIÍÀpH]?¶¨ñ7ÑŽ„T};Ia×´B,…Þz-ía¢ˆ¢¤ÄÜ%µûÿžÙ¥÷Ðj~ûŸIV3A+®ÿÐâj"ìNÖÿï€üÃć,¸e ±2$Ä�)j™ ÆÁ [x™º†ú€'²j‡µð™ Ë« E;ŠnÈUªr˜Z%£7&ðoªƒ Çü‡"ÁªZXÁc3@ëúÿ0—ÀëRFœ ÈJ"D¥ -]`u4,@¶2AMb€ÕiÈÕ4E™£·Â´új/—tœ­4˜/þs Vb„œËrˇÿ áP _0À–ØBÝ‹fXámÃÁ†ælÀÛ ¡\àƒ�#ýM4y#_,ý’ÁhtÞù•½÷ #J^�™ aqD+f'Ä-Ð w4¢˜…¥s¨û¡ û?¼1Úùz娢¦¤º Ú®ú÷Ñ "ãC‹·°›¸`¥>ü®m3—Ô†=³KP }HA>` Ú�ƒ´ÆaZÿÃ9 ùŽKÛ§åý"ÎÅŒ°1{xÝÇ€ì.hÈý‡99£3B­%¾jg„Í‹ÀúH^€+:…a,´n€vA`aˆ@†q ‘­Ä&3À’ØDh¯ÌfD\ 1kÏ�®„VŠŒpwAkD‡‘ÀpOþÇYP�z*,ž)&<„‡ì‘ÿð9%DhCãZöÿCÔ{ðü#ºe�4\ |\lä–?ZKÞèd€gN¢Û}¤ƒó+z¾©s†¥B@k¥€–É0Âg°r º}ÚÆBjT!õbPF…É{Ç5}"×]¼Z¯ü‡Yü‡7O!N€6ø`-Kˆ�”iê’Öý~ϬÒ÷HFËÿ‡Œ£ÃŠ'$§3¼g�=ÄÀpsûô¼¯¤¹ø?lh ÞO€¶ç‘‹~”b)ë3B—ª’Ñÿ!³ï°ž¤èa‚µøá/¬)ö*¡-Q¼cà°¹(Ö¤†µÈ!þf„ú°ž!ÐHσ Vb/ð!×2B»8¯l‚˜k,cô þab BK¨¸ý¸�Ðp  %ðáM Å?€ÎºßSnö‚#þC÷ @Ý 59ôa‰¥qÄ€=b@� Åÿ1_â’ƒ´à #x³šà¦JÁùÝï€Ô;£ÈÒ@ëAG S¯8¼Ö¶‡¡_Ü.5~�ÞYï€øåÉÅÍÄÝàÿÿš{!€<n…ªB[êðޤDúi‚=ø®é½@ê>lP�ZÖ¾ªý½cFÁ+ŠÜËÈðhèy¤ÁXïˆ>ubdÞ‘c€÷d°¯YÇ †ÿŸ6œF*a7ÐÆ´¤‡¼ð11XƒÔ x*eÆk@eOàÝ>x'áJø;¼²g@ ºÀš¹LO°þÜ”a„7‡¡E<,œ`Îe„WÇPÅt$¡°ÂŠÚɵÚ5+ ͺ@[9 §´óÔ ü®r³ ¸Ìø’!³oÿáE=@‡ëàþ{¤âšÏFì@�‘uo÷( >0‰*ç&FÐx&ïX®—%Œ Ý‹ÀÞãçSKZ)/àGÁ( (j;æL»æÈ£”dès!ͺËM7b3«¢ûœPm"r÷Ÿ Þ/e€MÐ@¬Aïí#·è9-EºóN#�ÐPláKpfY'h7,SÖ£`�`aï ,Zõ KNá]h?Z@C‡¾á]5ݲ®3ÿºÊL6c3º! 1ˆ^ïÀ™‚LùB»2Ƚc4,:r[ø�4×á‚Q0 1(l;j ,‰AÇsC×ïÿ‡ì{øÝäÝˆÈøq¨d]=HZ¯¼ëŒc!“Ï H{B GS£ì­a„Q¤ºöþ? î†+� ÑŒ‚Q@5�,ìùe«%#|3b“täŒ)І5ÆÿH;pQŽFÀ<¾ÒN‡o¢D*¼á;#|ƒÆ™ø¨›¡sM#�Ðh? FÁ( &0O‹CŽo€]tÈdVðBïGÀ(œY­|]SáG)#ìß# ï9À|ûßýŒÚÚo)Òý@Ÿ |� €F üQ0 FÕ�°ŒUb@:Š‚éˆ Äý°–?âP;ø×ð#$d1 GŒ¹"vm(d¸ù2t˜™XŽRa¸O‡`´� €F'mGÁ(T­GØy gÝ@7ÃWùB7s£l/„¯@ý¶…̪‚{èW]þ‡ ÝuÀ�Ýl…¼Šô?|÷æ2Rÿõ}>t�@�ø£`Œê�FØf»ÿˆÕîðeñŒÈœÿð…óð£p ÇA‹lŒ܇ï&`€E“CT#(kí‘¶Û@À%jzy¨€�-ðGÁ(TÐ3yþÁO8‚´é¡Å9ü ¤P Ðcø™à»äà§&`Ü4b€ï:†«�àv"¯ÃGY“ÿ¸¥H—äãG†� ÑŒ‚Q@ð1n™žù?´iÜ*;=±{<ÆyÜb•B)üàR´ƒ°ƒ»ŽÐÀÛC �Ðh? FÁ( x½ qôØ%øÉŒÈ[ba­xÐÚè¸ûØñv ¨á z Ð?`ÚÁ@EnÌcÙiûÿZK‘ú±,#�Ðè*Q0 FUÀ„j›_À‚tføHøMaŒÐûœáà0@oì_὎Οފ>ôÂÆ€|CÖØæ*ˆ™ÿ‘×ÞÃWúÀð Ø~:Å �4Zà‚Q0 ¨þ3>e@¹) roñøê È÷Ï¢^. AªÑ—OJB–b2@6o1¢ßó ½Qí?|Í=ìÞjÐ)µ›[ŠtÒ//� ÑŒ‚Q@5�l™ßþ¿r|#ìÚDøšyX ÒZ‡ÜÕËÞy‹8‘‘ýp3uÄ1Òðݶÿ¡w3Âv×2"] ,ìrk€…=‘·¿ �@£þ(£€j`B•õs`áûºØùð&,Fø l·,ürqpkrçí¥ÎRcø…8ÝçÔ€úX w/@6UÁÔÃ7WÁ þÿHÃ8 ë…ý†Q��4Zà‚Q0 ¨  Þïÿ‘‡\ ýø!f»”açÛü‡ ó€†òAs�ga•weªµ@ž� éü‡ ýg„W*ТTi€ÎÕ_5ZØc€�=Œ‚Q@uPØvLX˜Û q^øŽ(ÈŽ,Äñøhgã©÷@Æá®rÓw0s*ºÎ�Õ 1Àç l¯Ÿ†¸+†ñÿ¦«­Eº˜wâŽ0� ÑŒ‚Q@PÔ~ Ø:gÐ�ÆêÀB™VVƒRÂï5—Þ_€r÷ºËMá7^•uŸeʘ1þgP/ñD\ªÌ�)îÁoø6ñ°µXÿ ]=8@�ø£`Œš‚¢öãlÀ¢YÈ–öÜЋt |ÐÕ†/»+Ì_¢ë)ë:Ã,Ïy`Ë둚õ¿ÚK ß¡«Ä€�-ðGÁ(£`„�€�´£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�h´À£`Œ‚�pwm·Ä Øë&u¤‡H©ñºbÖ10 ‘"å7'ù¼Àðð~ígþ¬xõù|9»uÐå~Ç>}¾ßÝ~$ùéRØÛ¥Â±Å]Ê'åc<…ëÝNÊ7ÛOœÓ0ÝTÑù 5MÖÎ߱qÜk´¸$ŸëÈ¢mË ¹òš=o;m ›=3OdÎ!§ú ú,È5cN\œã,ǹP·ãÐc.çÂ,ë.ÏϽvÎì•ñ. ÇófŒô*Àƒ RÉQã9ß ˆS„ÂIuê(p!¢J¶¡öRÆ«Ÿô~¿ÕG9`làxÛ_²öùˆjg¡üÓ™Ñm~li‘Êôów>k¬¸xª£‡–øy–YkÌÇZ½z®6€2ï– 6 CÍüYåÚ±öß#öd?ðà^fLŸe®œ8\®ÄFÞ`Ẇ³Ä[öÕØÝyê_‰díåA ÿ…}Ûì÷7ùo¿/Ø»‚€A¦ÿ´Ûa…%©xÙe‚Èl›¶i…ô‹?üçɱ#;\y4¸»> ¯®Ye™Â©ÜPo’lÁ·òÇy%(c»E3É—Î'ã!îçäâO£ãp‘n—Ç6*VWKÔSÜr\¨ëêŸú¾ãùô¬8¼d§buÜ«¨=¬¿êß9Þ=‚~'ÿ•÷¸ · v�€`ÿÿÓN’¥ißHÄ…‹Ó*Ê+çï‡6Æmv¨±îr^25øÄ±38Âvu墜Næ×94–Æ;,§¯jå4"¼d0éÁ½¡ižÖ­ù´®“Þá·Š»C'})FýÄQ?�CjÊ[ãºGε铖r¿,S�òË €„ÿÿµWBÚ¡rðâ› U4e|øi íÔœFÓ}s¹n‡7ÕMH_éª&…‹ë¯#²é#Us}VõÍ+Ьú´_´äW÷Ñuç5ÿ ݼÔÔú’¡Øý¶0Ö½Óþ}üG�nÌ�ÿÿµkCਓ‰]µŠ©öUKgFku¸ynŒÚ$ôåOÎÕá¥\%#u¾DŠî\í±'œIë%ÂJ‚pëX'†³w9Ž´7õu÷oswk¤¨xÝš‰Œ[½è÷Õê¥û%| {GÖ‰DUƒjuk8¾#�9V�‚úÿ«;µ9†@uèG3Ór ½úÒY:Õ1û”П[s ÉâPdœÍD ÓÝNK(ÎÚ¡NR÷Ö©0‚Ã&�óEÒU“CÛ)‰U¿]]±’úݦ5Žnm žOZ»¨WÓZº·Þ©›h¾þ)€bHY [«åJL¡L(Ñ[ñàêv£«!”q™‹«õ‡«åƒÞ3@6‹P!F¨òDWOí./¡4±�W8!ÛM_<áK;Ĥ\�[!ãã‹/|-yrÜ€-ì±¥%R�¾Ê››ð¹ŸpžÀ¥™F¯Øq¹‹Úi{È€�ÜšÛ � Cÿÿ¯{•áæ¡‚ ^¢©Û¢Wÿð«ÃQæ—‚(90q$'£m“ÔOû¹dE’‘Ø»…Ĥ:{ðÕºÓ½:¦NXawªbšãI‚ÜoZ›�?!ÙâX¶®ˆM"¤í€ÞõŸ�Ýe À}¹£��Â0Tïi'¡”$MtÄ¿‰y/ Ÿ]n…`ޱ"››žTÝÁõݦDtŠîÝì¤'çãB}˜p• •¡#óÌÔÃÖè€H“·Á#©ÂBî_oµ6eì¨T4Ç>@¥E´Ÿ9ð\q‡”:„ÆÉÑÙ÷e @Žä��‚ õÿOwjc;tÉSkÖJÁ—=|&¿˜Õ‡€ŒÚÉa…ÆØÅT±\Ë$ÁÁDyÃ<_¥ˆÜžÝÇ&2\ÞcRØ[O>x’Ô«oZ ]rÇu윮óq¦ â±qªÖ0ÆIYb¾bªyEJœúüšáoÈ1ƒ� †þÿ_»JÓ·u¸$fÖvóê¿ö$3I²Ïì)a©}“Ò7µEç» u ®**s"ÊD>7@Ú„ÔùGíÕ;hOâì|G™â$ŽÈ÷®:qkG´ÖïöÓ½*¨HßµŠŒO‰Ø½³úQ÷êø»¶`ÇÊq��A˜þÿÓN&¤iK™\dóBD)ÅWø €¹Ç3aHn¿IɘŒc%·²! "ÇÆŸ)= Í \]à+€îª36u×¶bÖ.ALî‘% ¦C+ñ}Êvß‹ûØjb‹K$ ¨§ºpÍä¾XŒÕ±ÛÿY=È€œ3ÖB¨ÿÿÕ®†ðàÚÅAÆ+¹+Â-½ùó´–t§®kª ˜œ?ñ8÷Ó¹N�)Å+'=?í$(ªa3?J¶nÏZ^Hºž’¨ãئˆ”$µöSc!¸KhrQRÿ\_'“Ü_|áÓŒ•Þ×ôª¥Ï­#-][�r­` ýÿ_?:<™ÎíÒ¡ÝŠ’ 37ºõß¾ „„ˆ‰ÂÏëPshu޶º0ŽÜ�V}(~ Ó¹uW2`œ¿=q‹j¯›Œmâ4Ýø ±6%�÷ø¤<N rZq; g4\c¨Œg›AO¢{$žûŸ�ä˜1@!C¹ÿ©]H[ž .ßÉ`¢ Z[xÝÃïÊîˆïŽSô*v¡ÄvÒPâ7þÝ“ŒÔ™0)'_!¦°õöûX’°¤¼ÐÜ:L¤2"ñ$±M"avmÉ0lDx“‹T%“ùTmºuuÖ 7Õø¥�¸1ƒ�@þÿ××Y!:Ô1+Ál{ý¥CI\É”è‡DT%_ö§µˆ[jtÄš„K æ%ïé⩈4截º{žâ@"ææ’ë³³çØn’€f;&R¹¯ R]£ü¹´®ÖæóÃ>Èî­: 1É{ÒƒïÇ@=†Ø01-4bZØ2/)ÝWr3 L/:ŸPKT@Nw™Ð©ŸŸB…)µÂ&†¯Uˆ^yâj\`s¾Š WEGŠß LR[ìøäµæñ\~ÇØMèzÐÜP^*60"[÷ �€ûrI�èýO]ÛA}F4«Ð"ó“΋Ÿ$™KÝ7)$ÊtÂÉîÊÐ5(2Õ;õM¤Á¹b;AU씲Çó]C&÷«>ÆpyÇÈÔ·“¼uˆqËôÔq]1¼îSu6vë˜Ne¯ÊN†µïÖ`õ ¶�äœ1 � ÿÿk'AÂ%Á.: ÚVl‰ƒ/ËL2ðfŽ6 •”·Iw êæjümÓäobH tÚó†Ú¸´=QLc/]d •Ñ6ðU)ùKj“€ãÌ£[íUª¡VÓ‰l¸u4»ïêgªÚÔ_«:_“‹lB¾jK�rÌ€ùÿ«ÓZ# l·RRû ‡Áξt©±‹R]my±›Ê×*»ˆsrñL?E"÷?}ÒèKlôs´‘E*&uqC“ËÙ4bÞLi CCÜNÜ“ºw°åo…{ÆSd«r_ŸöiŠøúöœH¤õ,é_¸9ƒ€a¶ÿÿtO°8³-=ê-Âj0A'—|ñ—ÎnÙ´–o­Ÿ’Q=+SoeþÜó†Jñiÿ¤±g¤g„Ùè´ æ–{ŠkMŒêx^×=‡ã‡¨Ú^ 4ÈSoµ¡œt6¹nù3.ÑÔ¨óޤ.ý �¤™â™5X| ¿µK�òË`„ÿÿu×7C—2F‘@Á1Ç—†Ÿ $} cK#o褙ö›€LÈóžQŸQa;ðÈ�’A܈¿í mÖ'ª1QÜ4h2sªÅò§þ$ð œôþ3ÎÚ[À8ßc†Œõ—†àfÊvfšMÃóÖ|[Ü6¥ßÅ#�9æŽ�ƒÐûßÚµix€“ƒlm´?Á×_:TL­¼S Õ2Êd¿Á.\*b‰sœX¾ƒRt·~ïi5/Õ<É-ÓMjÍå ©°iß5‡ô8»$ÅÕæÑ¶¥|îÛØš G¡QjŽò')!£Â÷Ž�b¡“=èdÏ(£`Œ� €²…? FÁ(£€Ž� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� €F üQ0 FÁ(!� �ùV0ÂØÿìÁ,Ë$i’âa—íâ¬X ê±_¯†½.·¹æ™Ã.bˆã>ŒÍði»k1ËËrâú³ïNE«Âo¶ç©´F'o·—˜ÃGµ~ƒVgÔÂâOx”^W÷åôŒªduuu2]>†±>«˜ÏÙÙª3-Óy›Œ›ib<¾6ìgß-�wgŒ@Aÿÿj¹BËÎ&6°0ÆMP´s|ùÅá×”RÇWðß>ý'ê;S@”«Aû„‡ |ZSzÒNœš)Ž@u•ECuÖi é .ñWÍŽ ã.TÒtþ).#íQÇÌQ[›°‘(.á*j ±‚μ„¾ µ¤³ê8B‰‰¤wB‡ápÖŸýb&~i[�òÎ €„¡÷¿µ-“IÂs‹mLå þù‰y ¬¬ê}±EÐ’e#@7wº[S«ôx¶¢˜|r¤}Û¿§õŽ™ûí,-�*C;ÙÑsh|hÁnkM–õŒÍ—Vȧ•i9¤ºdúÛ|™ ÷Q>qãgqàæŒq� Azÿ[ÿÕ4¥¯ãð ¡eá5Ã'Fn,F¢äÓâ,òÙDÃjØ€‡»¯BS #¦3õ­¶ ôS3N ¡S[bðÉ·#,NwŠC}®y¤ÆGSÝÔÜô?8‘nbþ;’Þqš¬ Ų'qþF>È9c€b†ÞÿÖ•g‚K‡ïV•Z“¸ôÅø›ªKM¦†ÎAt1`´wÖTSkÔ.Gz T{£*/$|QI­ÿFäi;Q_×W€f»twv“ìüunbé»ù"bÛ„B³ͼÃÕž„^KJø¿´O�r­e�„Õÿÿt§@Öt³K‡¼b5Êע׿tÞ;tœ]> \E»;A¥p1<ÝávsœÉqdÁä$µ8Gu—ÑV·Ò³D­ºçŽtŠUÕ *_`kÝ<%T :Ú¸Ì Y +.Œ ~åÛÛõnÑ@Ìq¬öͰ3|ßÊ€»+F�Aÿÿu«Ç ‚Ý5äœ0ضôú”d`µq†âf¸·"žˆB’.”x£QN‰H±$Tù’$çžc[˜ÂM×·”¡2®éÕ>çé¡ÃpKη›ë&3ƒ@^äRwÕ™½2·n“Ûðu ïÜq��Azÿ[»â{E™ Aù´|õ‰yšÊö¦ìà¦A)Ið)—$O L†÷{ØÀ�–±ðSàëqÉOàeïIÊðv!§ó¤vÕgÊÓêD9t£…¹«¡I­ëN [Š91"4©Ç¦³hdò;[[.)�€ ½ÿ­[C̯‚6¹ *Tßøøj@]“™<Ùš ÏmZx6[ȩᦙÀœ °ŒÍâ5ì@¡UÎñ¶Æ 0­p(ß\ 8]ÿÛ»Õçü§Ä’å,‰r“k³µ·±wkó… È/ƒ�a†ýÿ×\«ÊaH\ÈmЉie^ò5ðí€ÒsƒŠ¹DAƒœ4­Ç\ÏœKñ´4½# MS»KTOÉ�ôÝÙKi={ïÚÄbµ©¯)¡4�›ýsÙìÿ˜Æ-”mv}rÖ6Þ¦âÔ˜<íÓ/t @~¤�� ÿÿº«ˆ:A‡vªÜ(}áðo`lcuÂHDl’�Š’~š›BÍPwç”Ýžxnœ sÛÓ;'‘c<ÆPâÜš…ÛŠ“*'˜)¹¨Ýgú£ö“رp&.óÜÄcçØ1¥aÏU2nÿ{›ù_Ô€{+H�„Aÿÿu§`ˆ:½tÈKV´¶å‚^~¼š-" ~Ç¿ýè8î¡Q¸ Ji·É„¤Û§ v6n^HJ#—õß¹›½)…˜Ø+¹p6ŠvM*†is'¶êÆÙ¯MPîÑG’jIE¾SÏiì¨uYâŸ|çӗ8oî8�à ½ÿ©Û©Re=°d‰—Hù¢�±ròãÕ×R¹–ó, -»d¤5´Göu¶y*Rª°U#SELgw$Sу1EÞ³U.ÿš {s#“ºÝøÕîjR¤}t¾åÜSÌß"!d¿‘ ü]ùÊâ(×]…W�îÍ †¡÷¿µ“ Á×$ù`Áj#hÓtðWNíyRdm›éph­Ž”À“™ºâ6‰MÖ"M×ö»Byž%UòÓYbŸ”ZÔ¶ÏÝ)Ýë-Ž#sŤ¸)!ëžÔˆP]ñÕšÎJqO µ^S`ž´%€jãz†"&S R¡î).µØZkø* tsI-¼‰ú@£$ÃÁÌBojÅ“Rx’ÒÛÂð…1²Ð+\qF(Ýáj(à’#§!¦"D–ÃUáJ7¤Æ©€˜|I(âJØÌ!µÇ¬ŸF� zo¼B¦alB5=¾V5.>63ˆmáÒœèÐ |]ktw[°j½ÁôRƒl.uÈþ!'ƒàËŒØh\ò0@¨‰.¯EGL/ gx›81ñˆl>® …X?cãS!QC ±½<d9Ùï¤T ¤úyDü�È1w€a„ÞÿÖQ·ñ0õÒ¡ž2Är~`È×_:O$@PCx«®¾µz  dó› U“ÔÎ=GëjÎDnœœ5nݳ6¼6CGØrhršwÙÔ#‡‘Ü¢SóN´¸sq¸!"Ýü´FÆ-5¢°Þ¹=ZïâÀä�‚0ðÿ¯v¯¤é”ÆË&rSŒ¢¡”úG‡?º[·NÇšätNúF dHq+Š3&çoÕ4%*âéÄ0ˆ€qÅò€o#)5›î•T—³¦yp±´Ý¯Ëˤ$uO a!Ioç6ŠDã»™›ûÞÜÓö zÝxÅN'{FÁ(£`à��4ЧeŽ‚Q0 FÁ( � ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� ÑŒ‚Q0 F� zžV¥±·NŠ5Ì@?)f"R¹êiaüâPMˆ.‡Ožµ¤ØË€ä,|\lråèi%éœ9z釥Ef`6²±jZF� Ñþ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@£þ(£`Œ�@ô:¹NöŒ‚Q0 FÁ(À�h´…? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�ãÿÿÿÚ £`Œ‚Q0 è��h´…? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#�Ðh? FÁ(#��íDÚ×p]Ã����IEND®B`‚�����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-curve-to.rb����������������������������������������0000644�0001750�0001750�00000001532�11701304107�021623� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-curve-to.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Curve To This demo shows how to use GDK and cairo to draw curve. From http://cairographics.org/samples/curve_to.html. =end require 'common' module Demo class CairoCurveTo < CairoWindow X = 0.1 Y = 0.5 X1 = 0.4 Y1 = 0.9 X2 = 0.6 Y2 = 0.1 X3 = 0.9 Y3 = 0.5 def initialize super('cairo curve to') end def draw(cr) cr.move_to(X, Y) cr.curve_to(X1, Y1, X2, Y2, X3, Y3) cr.stroke cr.set_source_rgba(1, 0.2, 0.2, 0.6) cr.set_line_width(0.03) cr.move_to(X, Y) cr.line_to(X1, Y1) cr.move_to(X2, Y2) cr.line_to(X3, Y3) cr.stroke end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-clip.rb��������������������������������������������0000644�0001750�0001750�00000001316�11701304107�021006� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-clip.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Clip This demo shows how to use GDK and cairo to use clip. From http://cairographics.org/samples/clip.html. =end require 'common' module Demo class CairoClip < CairoWindow def initialize super('cairo clip') end def draw(cr) cr.arc(0.5, 0.5, 0.3, 0, 2 * Math::PI) cr.clip cr.new_path cr.rectangle(0, 0, 1, 1) cr.fill cr.set_source_rgba(0, 1, 0) cr.move_to(0, 0) cr.line_to(1, 1) cr.move_to(1, 0) cr.line_to(0, 1) cr.stroke end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-arc-negative.rb������������������������������������0000644�0001750�0001750�00000002162�11701304107�022424� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-arc-negative.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Arc Negative This demo shows how to use GDK and cairo to draw arc in negative. From http://cairographics.org/samples/arc_negative.html. =end require 'common' module Demo class CairoArcNegative < CairoWindow CENTER_X = 0.5 CENTER_Y = 0.5 RADIUS = 0.4 ANGLE1 = 45.0 * (Math::PI / 180.0) # angles are specified ANGLE2 = 180.0 * (Math::PI / 180.0) # in radians def initialize super('cairo arc_negative') end def draw(cr) cr.arc_negative(CENTER_X, CENTER_Y, RADIUS, ANGLE1, ANGLE2) cr.stroke # draw helping lines cr.set_source_rgba(1, 0.2, 0.2, 0.6) cr.arc(CENTER_X, CENTER_Y, 0.05, 0, 2 * Math::PI) cr.fill cr.set_line_width(0.03) cr.arc(CENTER_X, CENTER_Y, RADIUS, ANGLE1, ANGLE1) cr.line_to(CENTER_X, CENTER_Y) cr.arc(CENTER_X, CENTER_Y, RADIUS, ANGLE2, ANGLE2) cr.line_to(CENTER_X, CENTER_Y) cr.stroke end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-text-align-center.rb�������������������������������0000644�0001750�0001750�00000002236�11701304107�023413� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-text-align-center.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Text Align Center This demo shows how to use GDK and cairo to show text in center. From http://cairographics.org/samples/text_align_center.html. =end require 'common' module Demo class CairoTextAlignCenter < CairoWindow TEXT = "Ruby" def initialize super('cairo text align center') end def draw(cr) cr.select_font_face("Sans", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_NORMAL) cr.set_font_size(0.2) extents = cr.text_extents(TEXT) x = 0.5 - (extents.width / 2 + extents.x_bearing) y = 0.5 - (extents.height / 2 + extents.y_bearing) cr.move_to(x, y) cr.show_text(TEXT) # draw helping lines cr.set_source_rgba(1, 0.2, 0.2, 0.6) cr.arc(x, y, 0.05, 0, 2 * Math::PI) cr.fill cr.move_to(0.5, 0) cr.rel_line_to(0, 1) cr.move_to(0, 0.5) cr.rel_line_to(1, 0) cr.stroke end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/gnome-gsame.png������������������������������������������0000644�0001750�0001750�00000010247�11701304107�021347� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA�† 1è–_��^IDATxÚíšYŒdWyÇçœ[{UïÓÝÓ3Ó³Ú3Áa0¶Ù+f1FÆ !äHI”<D‰òDxŽ"EŠ¢D(&Q$ŒDPŽ Þð2›ÇžÍÓ===ÝÕµÝ};çä[Ööx°‰£¼p¥£ª{ëêœïÿíKÁ¯¯__ÿ«Kü?)®q¶ì›àï¿ýtýüÊÚmg×F‡kº7±N¹7ìÞqzy÷Á§>üÁÛã7x–,­ígë„~S�üÝwžoïéߟkÄ0×ÜØ3×éÖ«6Yžš,ñb×MWrâ?ñ[÷?ð®;Þï—¸j¯ÁÉ1ñª´œS¬|ÛúÕ�üÙzþüð¯oY®|ì³·S;s%æÔË>sjÈ\3àÒ–Ï\+Aˆ ÃðáÝËø‹{?ù»+%�y‰¨2ñ•‚ð P/=Sç .>ÓâÙ˜cƘ2­j;ñ_ùÆã 'VFÿò;ïkä wN;û–÷‹›÷ÏÒnjúY›o9¼£Ê-‡¦ÉdG-ÎʽÍÓ¿¹ï†w?úÓŸ=‰ÂB()¥°ÖÚÒ9  4€&0L“Å÷Ð.~¯•$%KL(KùÕ�~âŒ|ð± _ýèѹÏ|þβÕh#B³4§xÛKÜx`©F¼i‘猆¾çíF¨©?òÜIkm«�!…ÆqcŒQ%®7 B§Y`ªô¹£xÞ)ÞuJRcñ–Ò�|ã'g8Òù½wìò¤Õë :Å{S@Ž‚é‰6Ïs:ë.ª&é­Rœ0 îûÄ=yò;ßýþÀzRJ„üßÜÿ¡[Þ²t_«¥îØ}&Ì[iØ‹.»Y÷ø™­•o<òâó/^ÜØ*¸œà[@è{¥w�ò«�\Ú ?Ýjµ§Ž]`Ì*ósÓÌLÍ1Ñô6GU0!u¸¸òÎ['¸<_çk?vÙ=“·§gÚŸTJ=$„õ¿ùÓ{ï¼ëƒ·}yzjòˆª(´ª¢½@$iŒI‡éååewùÎ÷ÝòÞgÏv7øÖ#O?wn}½ Ð/$3QHm«Ð¯d æ*�ÂæÂòȹŽ­M0Qó¹aÏIŒJ˜DpS[1í(”Ðí¾ù=<¶Î³ç3†n$&ñ¥Ôq!„ûÏõù/Ý~Çmïo´[(¥‘J|„SG™”Äi¡j +-êÀ»ë•ù—î¹ûÁÿøù™¯?ü̉B•¦Jv1V%Sr·ú*�äéA£5q*éæ‚8™7d*#Ö†õÌ’:5™óÖ%Á·žöyòl�VàFŠ(—ÓJ©å¯|é÷îÜ1³Ïë®Xì.ŒQµMp4ƒ`³hL`â˜<Œh©ŒÜ~膉jeòo¿ýÄ3…Ô ÂEAtTH(äUF¼të=éTj i-Ö¤˜<åèNGîh–K§ôÝ?ŒøÑ³ß}jDàG“’ÐZØÛv9s7.ÍîR¢"hÔ µºÂ©+œªÁiÍéhªõ:N»‰”!ëT¤Â˜+jìh;Mdµqêâ†[?¦3/¹Úȯ0ÿ¶~Ñ‘j›cóaÞy¨#öN’$`&Ø4ä›?ùÑ ®"ò�INfcnžÊ'2k@VDÍÇ‘(åÐìÔ©7« 2!T«jHcäèj$Ø0Æ’¢-쟞\Ûòâµ-7. ×±alà ]¥Bi>Kç°ÕU!Ejg;šÝÓ¶*ðsÍfœ¡ý„ó[)y’@‚Í�EØ ÇÈ^˜“ˆ‹G³Ù ÕL™^˜B6v@£$Ãæ9J@ª¦ÐYJ£¢@¾cŽÖp@hís×;í}òôj·P¥ `¦°ö8V\ÀI‚‡b+~ÛfÕªR9›™¦ïÖ˜®ç¤Æ0r#ž?chŠ„½­˜—ü°EòbÙ5USÁб2wd›Ð™BÌD¶—EœFá(´Õ -•4ƶæÉu†Œ Ýr™œìa·"nR­ÃÎÍœ>¿²Y1U¿ @É2€»Þqà{¡78æ‡aÒsC^,yœræ\Ä£'\ækWÜ!œWbJCäv¸¹Fœd„IJšj²D£SÎ2ÈB Çê¥#lž’‹µòÇè\ƒ­¢S‡8ÍÐIÂM‡–æJ‘¼VŠÔ@]eýðß³ß8ú®3£‘ÿñ<MšY³v%$O?;àÇ¢LÐõR‚¿ŒVgfwÅ·qèJ Ô+ŠVEˆ©†eº zN£’a³“eBÇ1:rÉ“ˆt´I<è’C¢þ&£n¿»F³/¾Ëc/­\.<PZ³0<g{.t×Û—ý·ÿ:ñ•‘—}Õœ;*^¸[›g`-‚HÄZ€�‹Àh̤vcos­aµEW 1¡JŸ¾2›¬Pï7iâ4:Ш“iC¼1 ú$IŽ•ŠA�žIE·›Ð"ò_¿FF댽ӫ’¹ÿüáäLÝœj¶g/„©>lu2mu¢°©6¡ŠÅZ‘YÿvWÏë…™‰št”h6jLL´Xœ›{wN±gy–¥=;˜ÛwæŽd»#lm'Yæ,ÕÅ}T [“„¾ Í6Ns‚D:b¤jø¹•Ç^ºt¡äûG…¶®)€“ÇŸž{ìàMoùó™‡îö³Ú{µ¬.[œF–xšt+‘ñ(MÝ ë†AE¡l–ØZE‰ºÕT³'�12ÈnFÖ’Þ/"QlÈÒœ02ˆJ+%A³¹¢mÎ ¯D)C~l‰"“oK¥m! õªdn[yǹOõyñÔ£À%!Ä)å‚RjV)5©”jK)kRJØ8ÉL]"† Æi昭ŒnÔil M3"§ÊÒáÝ„±"OZVéöc6F.[ƒ«#7Œ·ÕãïúU¹P‰xSD»qà‹[kSkmbŒ©Œst!Dî@<ߪ´•„Åv¥©:;fª4§êÔêÕZ£G(9 ´åìÏΑ)‡ /Ã#ü$'ÔeZˆ¬bk®Ax>.v^ @^îÖÞ¶Ö¶¬µMkmÍZ+1Ba1™BºIÂT­ÓnÕ+ÌÖ$“:µvg²…jTˆ3p¦$õ(c˜'ähõ‹Ãê3MrÓ&&4à HP¡™iz—6û%ºt �¯Næ®Ä;¥jÈZkó‚èT‘!ª€Xí½…™Úp©55Ýafv†ÙɪVÁhCœE˜4ƒÍMbé"¥ÕŒé‡7N±:!«ÕèÅhk3¬\é JúŸ”r¡øµ$PF;*å µ6|kí˜1ÆL5!D0?9uY>´û…@§1ÃnR”ìIài²Ä’Š:½î6Ü/ʉ㔠Ɉ2Ö¶hQ8¼ôòê¥r®\ÐáÄg¯*h^£Í1b!D`­�ÖÚE`Ñ3U” @=vìüÚáÍ÷Þ´øV»0M†Ø "•’¡Ÿ‘IÇ ƒ$ ¢”¨2ÉÔì.f[‚ `uu{¸ý­‹W[Bk­g¡^ ,Ààü’®ÅØhk­B$ÖÚØZ;²ÖŽ„¯$WÖÚà|íáŸ?Ô¬¿§º7æpGj†¹Àè”<N$†$ÓtC&†»îù{ö.ãTÍV›ÁÀÃ^8qÜþÓ_”:i©[÷ù5»×i½XÀ!LÁ‘ÔZ«­µYq¯­µп°r|va®ÓjµvåÆÅš~jqSð’\l…9ŸøôÙ»™f³ V°ÕpymÕ‹­ëºby÷ι³çÎ÷ò< â½R�ëÕH½Á&˜(sžÍ+’;þÒê© /º2²µ¹a”Mô½€Þ0`kŠ}êsìÝ¿(ŒX]½Ìp4B ‰çû6Ïst®©7ÔšÕ©—/\¼PªFÀ B $¿L…XܹØ|ûÑ£_>zôè}“““³½þ ûØ£ÿýàO<ù­,ËümFŸWuòÌ¥ÇO]{lÿ®Å#3íæ-ªR=И˜^Z˜ßéäIÊå+ë~`6tõ– Ôkurã>­Îd³Z«Ö’8ÉŠ3T©Ì¬\3*_;w.6ï¿ï¾ï¿ÿ¾?:p`ïÞf³9—çzïDgân©Ä®µKkß)Ô†€±ÎfBˆXJ©Ý ZÝzÏt‡îïx÷{nÞ¿wï¼5g1IšàT+dy&²,#I‚0À |ò$›[7 ƒn©[ðH^ÀÑ·ßú‡ºóÎ÷Nœ8ÍêÊ%ý>ZqðàÁÏî^Þsw‰ë~)Ñê !z…®v¡b(„pçæd:HÁÌìá(‡4I±yFµRE IµZ¥Q«’=û.T¶Zp¾ZÄ%^+•xå:ò–›¿!I‘f)I’àù>žï3ò\šÍöGŸÝh)cTÖZ)„§cG ýQÐëõÛõz@»Õ¦ÕêÐï­2rG¸¾Kžk¤kHuNž…IAp¥Ôn×Ë…^¹¤R7a@§Ý¡ßâ¹.Q¢uŽ”’ÎôÔ½À¿Ž];vuÝÒZ«„!T¯Û}j¥QûÐÒâN¤RT+U¦f¦°XüÐC›œ Î0&' B?LKÞRns­Ùu¬^\yJ yÇââív‹~¿ÏІ1qáFCà¦bðpq1à !B@K)m!)¥”W.|Ïòž;}?°QS«Ö¼€Í Ò4Ú°–,JÐVŒ†~© o·åk×w£NÅÑÓ33÷^€ëzb8’¤)qœ„±]Y¹x2‚aÑ%¨b Ÿí !¥TV©TRÇqr)eá±ÎÔÄg´ÑÓiš’§9#o$Ò4EaÓ,QØ<ׄQ¬\|ùœÖÆ+eƽ®z@¨®†ÍÉ$‰öGIòÖáÈÃÑßóLæÊú•“ëëë/cÆ&Já~TäNÉÜÜ\^­Vm¥R1Žãh!eê/4šÍO…Qä ]$‰q]_x^Dèh¢µ1'Ž{&ËóÜo f¯@à&Ëò‡ÜÑ`%‰“Ù4ËjÃáàôË.üèòúú)!D§äF“¹…÷ 4Ón·)½4ÍιýÞãJÚ»ã0nú^@–eB'q’Æaú§_|á9?ºRªš5Æ-ö„oL ÅëŒÀªJìökgÑ£©ÄËÀËÀ…â°4­`aaA�ôû}Õl6fçæÿx¢Ó¾£V«íÜóƒ­n¯ßï_LŽãLçy¾^ì8 œ+Îê½Þ)¥,"à°ì �ÕÂ}€MàR±ù �]gÞU/ºmóCöCŽ™Ò€Ãºß/˜² \KÁy�lAˆ[åÅýø»_ˆ×/MƒÆÞË-u¡Ç½ŸvÉóÄ%õJ©y#�òÒ„D‡v @¶tpP¨Ôë™ûŽK×Qq?6Ô6Ð*y¶¨Ä ¯|ÆtKÕRRUÝVe¥ˆœn·×òØÅ~ÍbÕŠ5.e³mmõqA£•I}y`=ëNéù¸«‘m+À_ϾNi Jg”3Þ¤´÷›òW± ¥ùî¯ô÷’´e)q+·|ÌÿÅ%Ķê;Éû^sÏÿÖ1ÐÁaæ����IEND®B`‚���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-fill-and-stroke2.rb��������������������������������0000644�0001750�0001750�00000001650�11701304107�023135� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-fill-and-stroke2.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Fill And Stroke2 This demo shows how to use GDK and cairo to fill and stroke. From http://cairographics.org/samples/fill_and_stroke2.html. =end require 'common' module Demo class CairoFillAndStroke2 < CairoWindow def initialize super('cairo fill and stroke2') end def draw(cr) cr.move_to(0.5, 0.1) cr.line_to(0.9, 0.9) cr.rel_line_to(-0.4, 0.0) cr.curve_to(0.2, 0.9, 0.2, 0.5, 0.5, 0.5) cr.close_path cr.move_to(0.25, 0.1) cr.rel_line_to(0.2, 0.2) cr.rel_line_to(-0.2, 0.2) cr.rel_line_to(-0.2, -0.2) cr.close_path cr.set_source_rgba(0, 0, 1) cr.fill_preserve cr.set_source_rgba(0, 0, 0) cr.stroke end end end ����������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-dash.rb��������������������������������������������0000644�0001750�0001750�00000001415�11701304107�020776� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-dash.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Dash This demo shows how to use GDK and cairo to show dash. From http://cairographics.org/samples/xxx_dash.html. =end require 'common' module Demo class CairoDash < CairoWindow def initialize super('cairo dash') end def draw(cr) dashes = [ 0.20, # in 0.05, # skip 0.05, # ink 0.05, # skip ] offset = -0.2 cr.set_dash(dashes, offset) cr.move_to(0.5, 0.1) cr.line_to(0.9, 0.9) cr.rel_line_to(-0.4, 0.0) cr.curve_to(0.2, 0.9, 0.2, 0.5, 0.5, 0.5) cr.stroke end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/list_store.rb��������������������������������������������0000644�0001750�0001750�00000011127�12137115065�021163� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: list_store.rb,v 1.5 2005/02/06 18:25:13 kzys Exp $ =begin = Tree View/List Store The Gtk::ListStore is used to store data in list form, to be used later on by a Gtk::TreeView to display it. This demo builds a simple Gtk::ListStore and displays it. See the Stock Browser demo for a more advanced example. =end require 'common' module Demo class ListStore < BasicWindow Bug = Struct.new('Bug', :fixed, :number, :severity, :description) COLUMN_FIXED, COLUMN_NUMBER, COLUMN_SEVERITY, COLUMN_DESCRIPTION, NUM_COLUMNS = *(0..5).to_a DATA = [ [ false, 60482, 'Normal', 'scrollable notebooks and hidden tabs' ], [ false, 60620, 'Critical', 'gdk_window_clear_area (gdkwindow-win32.c) is not thread-safe' ], [ false, 50214, 'Major', 'Xft support does not clean up correctly' ], [ true, 52877, 'Major', 'GtkFileSelection needs a refresh method. ' ], [ false, 56070, 'Normal', "Can't click button after setting in sensitive" ], [ true, 56355, 'Normal', 'GtkLabel - Not all changes propagate correctly' ], [ false, 50055, 'Normal', 'Rework width/height computations for TreeView' ], [ false, 58278, 'Normal', "gtk_dialog_set_response_sensitive doesn't work" ], [ false, 55767, 'Normal', 'Getters for all setters' ], [ false, 56925, 'Normal', 'Gtkcalender size' ], [ false, 56221, 'Normal', 'Selectable label needs right-click copy menu' ], [ true, 50939, 'Normal', 'Add shift clicking to GtkTextView' ], [ false, 6112, 'Enhancement','netscape-like collapsable toolbars' ], [ false, 1, 'Normal', 'First bug :=)' ], ].collect do |ary| Bug.new(*ary) end def initialize super('GtkListStore demo') self.border_width = 8 vbox = Gtk::VBox.new(false, 8) add(vbox) label = Gtk::Label.new('This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though).') vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) sw = Gtk::ScrolledWindow.new(nil, nil) sw.shadow_type = Gtk::SHADOW_ETCHED_IN sw.set_policy(Gtk::POLICY_NEVER, :automatic) vbox.pack_start(sw, :expand => true, :fill => true, :padding => 0) # create tree model model = create_model # create tree view treeview = Gtk::TreeView.new(model) treeview.rules_hint = true treeview.search_column = COLUMN_DESCRIPTION sw.add(treeview) # add columns to the tree view add_columns(treeview) set_default_size(280, 250) end def create_model # create list store store = Gtk::ListStore.new(TrueClass, Integer, String, String) # add data to the list store DATA.each do |bug| iter = store.append bug.each_with_index do |value, index| iter[index] = value end end return store end def add_columns(treeview) # column for fixed toggles renderer = Gtk::CellRendererToggle.new renderer.signal_connect('toggled') do |cell, path| fixed_toggled(treeview.model, path) end column = Gtk::TreeViewColumn.new('Fixed?', renderer, 'active' => COLUMN_FIXED) # set this column to a fixed sizing (of 50 pixels) column.sizing = Gtk::TreeViewColumn::FIXED column.fixed_width = 50 treeview.append_column(column) # column for bug numbers renderer = Gtk::CellRendererText.new column = Gtk::TreeViewColumn.new('Bug number', renderer, 'text' => COLUMN_NUMBER) column.set_sort_column_id(COLUMN_NUMBER) treeview.append_column(column) # column for severities renderer = Gtk::CellRendererText.new column = Gtk::TreeViewColumn.new('Severity', renderer, 'text' => COLUMN_SEVERITY) column.set_sort_column_id(COLUMN_SEVERITY) treeview.append_column(column) # column for description renderer = Gtk::CellRendererText.new column = Gtk::TreeViewColumn.new('Description', renderer, 'text' => COLUMN_DESCRIPTION) column.set_sort_column_id(COLUMN_DESCRIPTION) treeview.append_column(column) end def fixed_toggled(model, path_str) path = Gtk::TreePath.new(path_str) # get toggled iter iter = model.get_iter(path) fixed =iter[COLUMN_FIXED] # do something with the value fixed ^= 1 # set new value iter[COLUMN_FIXED] = fixed end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-clip-rectangle.rb����������������������������������0000644�0001750�0001750�00000001423�11701304107�022747� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-clip-rectangle.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Clip Rectangle This demo shows how to use GDK and cairo to clip as rectangle. From http://cairographics.org/samples/xxx_clip_rectangle.html. =end require 'common' module Demo class CairoClipRectangle < CairoWindow def initialize super('cairo clip rectangle') end def draw(cr) cr.new_path cr.move_to(0.25, 0.25) cr.line_to(0.25, 0.75) cr.line_to(0.75, 0.75) cr.line_to(0.75, 0.25) cr.line_to(0.25, 0.25) cr.close_path cr.clip cr.move_to(0, 0) cr.line_to(1, 1) cr.stroke end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-self-intersect.rb����������������������������������0000644�0001750�0001750�00000001377�11701304107�023015� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-self-intersect.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Self Intersect This demo shows how to use GDK and cairo to show cross. From http://cairographics.org/samples/xxx_self_intersect.html. =end require 'common' module Demo class CairoSelfIntersect < CairoWindow def initialize super('cairo self intersect') end def draw(cr) cr.move_to(0.3, 0.3) cr.line_to(0.7, 0.3) cr.line_to(0.5, 0.3) cr.line_to(0.5, 0.7) cr.set_line_width(0.22) cr.set_line_cap(Cairo::LINE_CAP_ROUND) cr.set_line_join(Cairo::LINE_JOIN_ROUND) cr.stroke end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/printing.rb����������������������������������������������0000644�0001750�0001750�00000007226�11701304107�020624� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2008 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. =begin = Printing Gtk::PrintOperation offers a simple API to support printing in a cross-platform way. =end require 'common' module Demo class Printing < BasicWindow Data = Struct.new(:font_size, :lines_per_page, :lines, :n_pages) HEADER_HEIGHT = 10 * 72 / 25.4 HEADER_GAP = 3 * 72 / 25.4 def initialize super('Printing') button = Gtk::Button.new("Print...") button.signal_connect("clicked") do begin run_print_operation rescue dialog = Gtk::MessageDialog.new(self, :destroy_with_parent, :error, :close, $!.message) dialog.signal_connect("response") do dialog.destroy true end dialog.show end true end add(button) end private def run_print_operation operation = Gtk::PrintOperation.new data = Data.new data.font_size = 12.0 operation.signal_connect("begin-print") do |_operation, context| on_begin_print(_operation, context, data) end operation.signal_connect("draw-page") do |_operation, context, page_number| on_draw_page(_operation, context, page_number, data) end operation.signal_connect("end-print") do |_operation, context| on_end_print(_operation, context, data) end operation.use_full_page = false operation.unit = :points operation.run(:print_dialog, self) end def on_begin_print(operation, context, data) height = context.height - HEADER_HEIGHT - HEADER_GAP data.lines_per_page = (height / data.font_size).floor data.lines = File.readlines(__FILE__) data.n_pages = (data.lines.size - 1) / data.lines_per_page + 1 operation.set_n_pages(data.n_pages) end def on_draw_page(operation, context, page_number, data) cr = context.cairo_context draw_header(cr, operation, context, page_number, data) draw_body(cr, operation, context, page_number, data) end def draw_header(cr, operation, context, page_number, data) width = context.width cr.rectangle(0, 0, width, HEADER_HEIGHT) cr.set_source_rgb(0.8, 0.8, 0.8) cr.fill_preserve cr.set_source_rgb(0, 0, 0) cr.line_width = 1 cr.stroke layout = context.create_pango_layout layout.font_description = "sans 14" layout.text = File.basename(__FILE__) text_width, text_height = layout.pixel_size if (text_width > width) layout.width = width layout.ellipsize = :start text_width, text_height = layout.pixel_size end y = (HEADER_HEIGHT - text_height) / 2 cr.move_to((width - text_width) / 2, y) cr.show_pango_layout(layout) layout.text = "#{page_number + 1}/#{data.n_pages}" layout.width = -1 text_width, text_height = layout.pixel_size cr.move_to(width - text_width - 4, y) cr.show_pango_layout(layout) end def draw_body(cr, operation, context, page_number, data) layout = context.create_pango_layout description = Pango::FontDescription.new("monosapce") description.size = data.font_size * Pango::SCALE layout.font_description = description cr.move_to(0, HEADER_HEIGHT + HEADER_GAP) start_line = page_number * data.lines_per_page data.lines[start_line, data.lines_per_page].each do |line| layout.text = line cr.show_pango_layout(layout) cr.rel_move_to(0, data.font_size) end end def on_end_print(operation, context, data) end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/gnome-fs-directory.png�����������������������������������0000644�0001750�0001750�00000003774�11701304107�022674� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���bKGD�’�–�{lÌ£ù��±IDATxÚí™Û«WÇ?{fNNB½¤!4Q¢-”„Þ^´ "øà¡"D)ø¢þö¡ø¤OÖ&PúÔŠÅJ¡mb4ZŒ&9Òã5i´69÷“ßï7{-öeÖžßœÓ)‰ gÃoΞ={Öw]¾kí5°sì;ÇÿÝñU@?Âùƒ;)¬Ó·Ï¿Á?¯,âpa‚Mâ™'P 7676Y_¿É7¿ñ=vÍïúÚx4~öàì¹×¸ç®ûØÜ\Ç9Qœs¨š_ÂoÊù?üŽ‹/ñôS?¹|ð௼wõß‹·@34xèà¼úË“8QPUTW¹h %ÊŽ"¨‚ŸìåÈ'qàÀ½=úà — <,Þq üþü¯yëÌËÑE‰WUкFP`¯ƒ;Ýð“,¯¼Ï©“/rú­·o‡Ì_~º-€7ß|³ç^ET/YHcAQœ‚ AxM±�7oN8~ì” wݽ/ÇPöµxƒè–ídÇÃ:«kŒFÖ×6Y^]e2sùÏïqê¹ ¹]hye•µµuD4ž‚ªRUUp‰1€�.X Æ pæWoP×óÔuEU9*WÇ•%þVÔMƒŠÄõ<u3GåÂú®ª¨\ª§®Zß²g÷^ªj<[ ¬¬¬°¾¾IÛú¨}A%,^ 8W¸Ð–8uò•;Îùƒ�n\_b}m/ŠŠ"* „ Ž®B–––ùãùwyög?âðÇŽ„ @S°ƒà\ÉÁážXïcšc-8l8^ý4'N<3€åëŒF¼Ík”Ô9—¯‹ù¬ð¥/Ï~æ=öE¼w”uã²…n}¾º~ã?¬¬,!"³X]¹÷>øð‘.ZÀvÂ9®^ùµ›ç[O|›ãÇæ7ç~ލGQT m[TC´ˆHW"»I�¡*xÜ5‡‚ ­÷á9`aaq6ºti—_úÅL>¸ÿ¾»yþ…ç8~ìa®\{¯-•'” €ˆZï ¯+‹D *øÖã€ÖûìŠA¡~6�W¯^ãÄS?äч¢ªwoajB§?u”kïÿ…üý¯ˆ¶A0 ~,’SÔ‡5Äk<‚÷¤ªÇ·ÁE[ Â{Ñ`•3øîwžäó?ÂÇ?H3·g[_UUšfžÓg^êrBNv!Ú¦ª"ƒjÈê‚£ª¢ZÑÔBðÎqçQGåïg´Àç?Îþ{ösaál,B «všU•2+«FwQ3ÇžäµDìšq,Íc¹TD&L±`jÀý‡ŽpùoêEŒÐµ¥ˆM+bA /Vxs†5d  D:N‰Tg;Ýè„E]Ôô”öóô´)…ö;1Š GÉŠè4O#]ý0�Ù\=AûZÍ+ƘžW‚éÆ$þŸéT;m÷ tí} eïg bU €m„J¾Ÿ(Q¥7·+Åûcb,)g³àÉJ]t÷fR¹DáÊÀí’OxIa¥ ¥%m�‹‰2ÈA�1Wxigt!ï»2kf«ýi: .çÈ4€$Ôô<‰ä ]9ûŽ0™LhÛ6×ûA;@P‰\.ðÙ•Œ¥ç6ÜL¤#Ó0qŽö\Gs|ÌfS¿ Xëˤ2;óÿV )(VÄ‚-]Ð Ÿ-¡’×0ÀAœ\ˆ!áCfD¥p MûgCƒØàV“+ »}fÊÉK2XÌ{(Šùi�UªUD’﹬™,˜LÓªõ+¼}¶°f!Xçvbã �¨¶$O XšÞ@ Nðê vèï%%•‚V“À˜<!&¡ Rt7ÊÒDóV6Tªƒî³+nœP5@Sסbì-^*†‘JúLh…/¨Ñì¶Ò}"ˆ­:M\‘çý‡y`d]¨Š×»‰¥€—¶ôñ$@Aw± žrzÉËÄGüs‘uÀÔ:9ÞRÒ².&ýØuÀ¨1sÑ4ˆoCú6'zd('`’\(†„—¢%S0S‰¯#‰ C?FºýÀ^`h­æ=EË@I@)¼¥ÄäbEƵÚÍú@å*‘±ûÄí§†HhiŠu¡¶ ‰7P—ZýÂMz™V )ÊfÝ�½âÐÖR) ¹XÜ9µ˜‹òÖ @A8â^´£? ¾–"ÛNg` 6êÑ-C,VfoËXÄFBjï™<Ð$âiÌ~ÑÙŽÆPÝ^fʇl+¼LÌÂÅí¥Ä–ü°ð·”ë8\裕[š©D6ÉÍ˜Ø€Ê c>_t[Ë®;•æaJl-æj`A“Ô{~G|uU¹¬ùÊ9œ«pUÑôL¢IÖ�.^x— Þ ÆÁ¥Vhîà5Ñ_|½HÖ÷eùœ·‚Úm–ˆÙ=5‹»®¯š„¥EgÏ9Ǚӿµ�F@n–îö÷O~ÄOL·ûü>p8�ìs½ ˜ëMÌ M|¸1ÅT•Ò¹­MŒëBµÝÿç«YC"ÞÜO=Æ6j¼ÚŸ�›¶’žoMz œy¡ë} Qsí¾;¸[øèÒo¨&™$J Ä ´X*£U7 tÿEƒIz€ì|í=ÛÿuF©MÖ–¢cÉÁ—W½—ºörÿ›‹Þ¢¶ÙÀô>k«öõαsÜúñ_÷MËÚÛG×C����IEND®B`‚����ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-curve-rectangle.rb���������������������������������0000644�0001750�0001750�00000004646�11701304107�023156� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-curve-rectangle.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Curve Rectangle This demo shows how to use GDK and cairo to draw curve rectangle. From http://cairographics.org/samples/curve_rectangle.html. =end require 'common' module Demo class CairoCurveRectangle < CairoWindow # a custom shape, that could be wrapped in a function X0 = 0.1 #< parameters like Cairo::Context#rectangle Y0 = 0.1 RECT_WIDTH = 0.8 RECT_HEIGHT = 0.8 RADIUS = 0.4 #< and an approximate curvature radius X1 = X0 + RECT_WIDTH Y1 = Y0 + RECT_HEIGHT def initialize super('cairo curve rectangle') end def draw(cr) return if (RECT_WIDTH <= 0 || RECT_HEIGHT <= 0) if (RECT_WIDTH / 2 < RADIUS) if (RECT_HEIGHT / 2 < RADIUS) cr.move_to(X0, (Y0 + Y1) / 2) cr.curve_to(X0 ,Y0, X0, Y0, (X0 + X1) / 2, Y0) cr.curve_to(X1, Y0, X1, Y0, X1, (Y0 + Y1) / 2) cr.curve_to(X1, Y1, X1, Y1, (X1 + X0) / 2, Y1) cr.curve_to(X0, Y1, X0, Y1, X0, (Y0 + Y1) / 2) else cr.move_to(X0, Y0 + RADIUS) cr.curve_to(X0 ,Y0, X0, Y0, (X0 + X1) / 2, Y0) cr.curve_to(X1, Y0, X1, Y0, X1, Y0 + RADIUS) cr.line_to(X1 , Y1 - RADIUS) cr.curve_to(X1, Y1, X1, Y1, (X1 + X0) / 2, Y1) cr.curve_to(X0, Y1, X0, Y1, X0, Y1- RADIUS) end else if (RECT_HEIGHT / 2 < RADIUS) cr.move_to(X0, (Y0 + Y1) / 2) cr.curve_to(X0, Y0, X0 , Y0, X0 + RADIUS, Y0) cr.line_to(X1 - RADIUS, Y0) cr.curve_to(X1, Y0, X1, Y0, X1, (Y0 + Y1) / 2) cr.curve_to(X1, Y1, X1, Y1, X1 - RADIUS, Y1) cr.line_to(X0 + RADIUS, Y1) cr.curve_to(X0, Y1, X0, Y1, X0, (Y0 + Y1) / 2) else cr.move_to(X0, Y0 + RADIUS) cr.curve_to(X0 , Y0, X0 , Y0, X0 + RADIUS, Y0) cr.line_to(X1 - RADIUS, Y0) cr.curve_to(X1, Y0, X1, Y0, X1, Y0 + RADIUS) cr.line_to(X1 , Y1 - RADIUS) cr.curve_to(X1, Y1, X1, Y1, X1 - RADIUS, Y1) cr.line_to(X0 + RADIUS, Y1) cr.curve_to(X0, Y1, X0, Y1, X0, Y1- RADIUS) end end cr.close_path cr.set_source_rgba(0.5,0.5,1) cr.fill_preserve cr.set_source_rgba(0.5, 0, 0, 0.5) cr.stroke end end end ������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/reset.css������������������������������������������������0000644�0001750�0001750�00000003707�12257552170�020315� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* @import this colorsheet to get the default values for every property. * This is useful when writing special CSS tests that should not be * inluenced by themes - not even the default ones. * Keep in mind that the output will be very ugly and not look like * anything GTK. * Also, when adding new style properties, please add them here. */ * { color: inherit; font-size: inherit; background-color: initial; font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; text-shadow: inherit; icon-shadow: inherit; box-shadow: initial; margin-top: initial; margin-left: initial; margin-bottom: initial; margin-right: initial; padding-top: initial; padding-left: initial; padding-bottom: initial; padding-right: initial; border-top-style: initial; border-top-width: initial; border-left-style: initial; border-left-width: initial; border-bottom-style: initial; border-bottom-width: initial; border-right-style: initial; border-right-width: initial; border-top-left-radius: initial; border-top-right-radius: initial; border-bottom-right-radius: initial; border-bottom-left-radius: initial; outline-style: initial; outline-width: initial; outline-offset: initial; background-clip: initial; background-origin: initial; background-size: initial; background-position: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: initial; outline-color: initial; background-repeat: initial; background-image: initial; border-image-source: initial; border-image-repeat: initial; border-image-slice: initial; border-image-width: initial; transition-property: initial; transition-duration: initial; transition-timing-function: initial; transition-delay: initial; engine: initial; gtk-key-bindings: initial; -GtkWidget-focus-line-width: 0; -GtkWidget-focus-padding: 0; -GtkNotebook-initial-gap: 0; } ���������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-line-join.rb���������������������������������������0000644�0001750�0001750�00000001760�11701304107�021746� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-line-join.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Line Join This demo shows how to use GDK and cairo to set line join. From http://cairographics.org/samples/set_line_join.html. =end require 'common' module Demo class CairoLineJoin < CairoWindow def initialize super('cairo line join') end def draw(cr) cr.set_line_width(0.16) cr.move_to(0.3, 0.33) cr.rel_line_to(0.2, -0.2) cr.rel_line_to(0.2, 0.2) cr.set_line_join(Cairo::LINE_JOIN_MITER) # default cr.stroke cr.move_to(0.3, 0.63) cr.rel_line_to(0.2, -0.2) cr.rel_line_to(0.2, 0.2) cr.set_line_join(Cairo::LINE_JOIN_BEVEL) cr.stroke cr.move_to(0.3, 0.93) cr.rel_line_to(0.2, -0.2) cr.rel_line_to(0.2, 0.2) cr.set_line_join(Cairo::LINE_JOIN_ROUND) cr.stroke end end end ����������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/gnome-gimp.png�������������������������������������������0000644�0001750�0001750�00000006522�11701304107�021210� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA�† 1è–_�� IDATxÚíYkŒ]ÕuþÖ>¯{ï9wÞ¶gllÏcÌ#¿ <l 6ˆ!•êªUÔ$}¨jû#Q鿤êCUߢÒü H©i$£´Â-¢¤@m9IJ±“ù9žaf<ß¹¯sÏ=g?Vœ}‡‹±ëqK$"±5[çÜ;÷îû}k}kíµ×>ŸÏǯô _Q¬Ü¹ŸuÔ7­êu„p,+çÒ ô÷ˆk,ðËô !Ä]›×?¶ûáíw ˆ ˆ@ôÑïÒu Ü´ryñ™¿ýÓý=>ÙÙ‘/$~IDhxùÀÐm›Æ~¿G‰È±Óþü=fR.êÛùwóÍ'{Ë¡C"_"ÿ#aŸ¢×Ûýð¶¯cv*­KDäv€ €Ü‚ÎõVK’6»žWztçÖïlÚ0úá[Þ;à Á.ô 9ñÿ<ckGn¿çÎß°l¾R;yêì介~¿ &€ð/ûÞxóÔ™ ±µÃÿøí§~w¯ç:¾Â$\"ò:ÖAnçÿ(©EðëFWŽ~ùñž#AcR)Ä­ä4�Ÿˆ\�‚¥OKs{&¥–Rÿ@*=tÓªåÏüÁWŸ|B$ÈBøDäàp-‹xgp 7züK÷~Ûô”RH©¦™ �àÑ¢rW\OBy¤ÑñŸŸžÛóÈöÇ“4+þîå+ÝŸŸ<w’ �—?²üd¨ŽÞ�îÍ£«6ýæ—wýƒãˆ½RiGJ ¥4Ž?ýýz3¾ Ð�k�æúì%IÒtŲ5Ã+·e™*ž{ϲÁ¾á_œš8ÂlIpž¤®Øx®•~E7øÑ5#;žØ}ïw!¾$•r”ÊÁK¥*òþ÷d� �Åö 0;K±3ó@_íŽ[×=©µ•f?,wÝuûúí4«]¼T©ä.&·+D×Ut½ïÚ鮹ó7žÜù-_ØôÖI¥ ¥†TRiÄÍäðÉÓ怡™Y‚¡˜¡,‰€°ùž&§/V¶Ü}ëa©°Yk­ ˜ydÕÈÐŽBD—æ«)@äPPtÅÅ"h"”VŽ Ýòèέß|`Çß*ƒÇ´ÖTZ›Žå!•n=~êß+ õÓ�i€%ƒeNf):6"òû{oyú/ÿä‡Y&×µZ âVŠLJÃ�Lš´³ã2S§þóíÔҳ†¹ÅÌŠˆ\ßw‡úµ»×ûžwWà»_d0Ø0´É¡5C)¥4”ÖX¨Ö'~üΑï)¥/�| *ƒ+Ìhœ0C¹7’熆†ÜÀwF⸭]Ï0 8®ƒ4“PR¥Bq‹[[¾²w7˜8“J¥i•)×°)1Øa6HÚ)Œa03Œac`Œ6Fhcô§'H¥’¼ÈLlw÷/�Ú7·mÛÞÿWñ­v>üè®ë‰÷~úßxëWQ,øÐZ`ïo·l¼ÅR„Zõ2Þø‰Çß-»Žv´ hÉÐJC ­µžƒg@ 0`Àæì¹éÎOÌ\�!°8 �3˜™Áv3ûX ëºëÃ0üzE_s]÷^fv™yÚó\ñoÿú£·„<øöÛïЦM›°zÍü „óçÎà¾ñç^¹Ú0´ÖðƒÖo¸–-[‰Ç~ c8—…ÔȤD–IdR!ËÒ,­”êáj­9ûÞÑic´�Ä�êœ_[6#)�fÑžçݼaÆïmÞ¼ù!!Dqbb‚§¦¦¾Çñ?=þȶKõF|çþýûñâ‹/b``�{öìÁ·Þ5kÇJýûöáðáÃÇ–-[ µÆªÕëP*¡V™µR1ÐZ[ðJçz3ˆWp’d•ŸþÙû™T©M€d† ˜óldS*wx===¿¾mÛ¶GÆÇǽf³Io¾ù&Åq<†¥?öƒÀ­Õªxå•Wh~~ív›™iš ·^{m?â8¦àرcüꫯBJ‰V«Ï©¶“¡•‚R R*(£Á h®Ö’ƱŸ='¥’�20�I.gN;–ïH¨C ìyÞýQy…Bív»ãr'šœ©Ñ'ó³Ïþ=·Z víÚ…F£3'`õØF´Ûm<óÌ3˜™™Áž={ešÍ&’$A;IÐI¹J(­ò{»Ëf0$©’GŸ¹¤”V (�mb� 0V:Ÿð@”rhrr‡B£ÑÀìì,„þ_ÄÑ£GP,Å¡ÿ…‰s¿@«>‡áÕq߃aëÖ­\«ÕðÔSO¡Ñh Ýn£R¹Œf}ÚæuÕ™ÚÀ0Àl�Î#óôÙ©T*­�µ-ðu�M0·8O*Ü…””²=== fF–ehµZ(•Jˆ¢ˆ¢(9çÏÂÌô9¸Žá€€‰3'0¶nž~úi(¥��RJT« 8{ê}°Î ”^ô‚Ö Ã &òØàV’fX &  fg“se×’Ð3Ÿ­×ë|߇ïûâ(B…p ÑhÆPÚ‡çûðáoìÿÊ}+àex~€´ÝÂÔ…SH“Jk´Zm´³ ÆÆÛÔI¶Úš¯ÔUšÉ@BÓfœ�U€̈¯_éLk½ßqœßaæ¢çyÃða!mU'mhÙ€=Ž`6`f,Ì¥? V¥lÆÉ$æj ApY)å›rðÔ‡s1€„rÍ×í¬è€oÛ}©c}ÓÉž‹i4˲wÇùaE{{zz¢0 Q.GÃ¥bóÏCÉZIÈT¡PÈày>èÚ=µ­erðJkLL]„TŒþ¾¤I¼¸‰q¾3ñôÌ|–´³€fnqTòÉuþxðÊ+ÁŒ€ÖºZ©Tž £(ð…Ja I\C³¾�Y”V AAƒ™lI§Hcëš¶Ìp¹Ò�‘‡ÁÁ2z˦š Íy5@Œ4“<5}©nÁב˦p•õ®Mëªà?q ‰ãx®^¯Š¢R{dyÿÝZ§…¹™IÌΜG&SH©rk@+©²üÄ„ÔnNõF ³s—qnb–î¹}3ÆV£¸íÕZZk”RæÄÉóÕv;[�P!`„i�Ó�f�Ì[µºÎü¿`fŠã¸9;;{xýèÐHàêÛÛIS¤iFJ*è¼â Ci©²T¡ÕJ0;WÁôÌ<.^Z@’dèé-“ç»(øBˆå½ú£�¡/ÐSt‰zÍÈ@ ´n/ë5̘jgò<€9ëŽþ•ÿ‰Ó]ë` ÀÛ¼qôÑLéß |ï¾,ËHÏ6Œ¸Õ†ì”B T,¢T* ·7BO¡¿¿Ê=ŠÅ"šÍSg±r0äÑ}ÜßS®K0H3‰…z‚jSÖÏUÝÚÁƒÿ¬^¯Ÿô<o¡¯¯O^ºtiÁfž« ¾""—€€ ð¶;Bléé)íJSµ^k±1丅¥"Jaårˆr¢¿¯Q¡P `ŒÆùó<yAW*õÖÜüB’¦²±jyï¹osé‘·®ê)ºB Ös×EvË+Ž?Ž3gΨ4MŸ;qâÄwúúú’8ŽÝ#GŽ$K!€.Ž==Šècð�3‰0V ‚»×ó<g™ø½®ã8®ã8®ë’ÄI’fµz£ÕŒ[‰Ö¦#ƒÔJ¢³IU¿°quñ«ãÛ×n¿÷M·=¸÷ÖF£ÉÉI=z“““ÙÙ³gÿ¹Z­¾922òã—^zéÃ%@Þ‹t (‚ÑË@?Àý`ô0ÈÀ�€@ yû£ÓVéž²™$±ù¾ÎŒšÕxࢠܹ^xáñññA)åÖ—_~ù–çŸþŽááa O¾öÚkk—Bàc}"x�ù�Š�‡�"0Ê�zôèãü¾ �ÀïJÏŒÅ2¢ÅʲaÓd³«|hØTÚ²^j¸³T*½e `xxøÞ}ûö½ÛݼޑÒäõ÷böZc¤³sFÖòä .ç*$3Ú]ß‹-èÌz¬Ôñ¨ýLÀ…V«5^©Tþ:‚­¾ï? à¾îtJKè–ÑíÏ‚í�.v÷»ºÝtñN¤Ö©ýÜ�€å–ˆ×å…€ÖÀÀÀúÕ«Wÿáðð°yýõ׫C‚–ØòûD#ª‹Œ×eu÷*½QîªßeW<È®×ÊaÀÎA»–±›v_¸l É¥Jˆ»6nkj»HÖEŠðñö"®ðB7Ýuß™®j“lc¡Ðé%uM\µº"Ôu¯–Øå®âkL²©ZÊÊÉíªøšÅÜ ÁUúŸ×“d÷wùÿ×V2uû:µ±Öi÷6n:¥|:ƒ—8—ºV·D;'1}EB0ŸÕǬtEÛ®(>uWuú™~NLWņ̃ñëóñ©Žÿ÷0iÿORÑ����IEND®B`‚������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/dialog.rb������������������������������������������������0000644�0001750�0001750�00000010072�12137115065�020231� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: dialog.rb,v 1.5 2005/02/12 23:02:43 kzys Exp $ =begin = Dialog and Message Boxes Dialog widgets are used to pop up a transient window for user feedback. =end require 'common' module Demo class Dialog < Demo::BasicWindow def initialize @count = 1 super('Dialogs') set_border_width(8) frame = Gtk::Frame.new('Dialogs') add(frame) vbox = Gtk::VBox.new(false, 8) vbox.set_border_width(8) frame.add(vbox) # Standard message dialog hbox = Gtk::Box.new(:horizontal, 0) vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) button = Gtk::Button.new('_Message Dialog', true) button.signal_connect('clicked') do message_dialog_clicked end hbox.pack_start(button, :expand => false, :fill => false, :padding => 0) vbox.pack_start(Gtk::HSeparator.new, :expand => false, :fill => false, :padding => 0) # Interactive dialog hbox = Gtk::Box.new(:horizontal, 8) vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) vbox2 = Gtk::VBox.new(false, 0) button = Gtk::Button.new('_Interactive Dialog') button.signal_connect('clicked') do interactive_dialog_clicked end hbox.pack_start(vbox2, :expand => false, :fill => false, :padding => 0) vbox2.pack_start(button, :expand => false, :fill => false, :padding => 0) table = Gtk::Table.new(2, 2, false) table.set_row_spacings(4) table.set_column_spacings(4) hbox.pack_start(table, :expand => false, :fill => false, :padding => 0) label = Gtk::Label.new('_Entry 1', true) table.attach_defaults(label, 0, 1, 0, 1) @entry1 = Gtk::Entry.new table.attach_defaults(@entry1, 1, 2, 0, 1) label.set_mnemonic_widget(@entry1) label = Gtk::Label.new('E_ntry 2', true) table.attach_defaults(label, 0, 1, 1, 2) @entry2 = Gtk::Entry.new table.attach_defaults(@entry2, 1, 2, 1, 2) label.set_mnemonic_widget(@entry2) end def message_dialog_clicked dialog = Gtk::MessageDialog.new(self, Gtk::Dialog::MODAL | Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::INFO, Gtk::MessageDialog::BUTTONS_OK, <<EOS) This message box has been popped up the following number of times: #{@count} EOS dialog.run dialog.destroy @count += 1 end def interactive_dialog_clicked dialog = Gtk::Dialog.new('Interactive Dialog', self, Gtk::Dialog::MODAL | Gtk::Dialog::DESTROY_WITH_PARENT, [Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK], ["_Non-stock Button", Gtk::Dialog::RESPONSE_CANCEL] ) hbox = Gtk::Box.new(:horizontal, 0) hbox.set_border_width(8) dialog.vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) stock = Gtk::Image.new(Gtk::Stock::DIALOG_QUESTION, Gtk::IconSize::DIALOG) hbox.pack_start(stock, :expand => false, :fill => false, :padding => 0) table = Gtk::Table.new(2, 2, false) table.set_row_spacings(4) table.set_column_spacings(4) hbox.pack_start(table, :expand => true, :fill => true, :padding => 0) label = Gtk::Label.new('_Entry 1', true) table.attach_defaults(label, 0, 1, 0, 1) local_entry1 = Gtk::Entry.new local_entry1.text = @entry1.text table.attach_defaults(local_entry1, 1, 2, 0, 1) label.set_mnemonic_widget(local_entry1) label = Gtk::Label.new('E_ntry 2', true) table.attach_defaults(label, 0, 1, 1, 2) local_entry2 = Gtk::Entry.new local_entry2.text = @entry2.text table.attach_defaults(local_entry2, 1, 2, 1, 2) label.set_mnemonic_widget(local_entry2) hbox.show_all response = dialog.run if response == Gtk::Dialog::RESPONSE_OK @entry1.text = local_entry1.text @entry2.text = local_entry2.text end dialog.destroy end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/appwindow.rb���������������������������������������������0000644�0001750�0001750�00000016424�12137115065�021011� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: appwindow.rb,v 1.7 2005/03/05 15:01:16 mutoh Exp $ =begin = Application main window Demonstrates a typical application window, with menubar, toolbar, statusbar. =end require 'common' module Demo class AppWindow < BasicWindow def initialize register_stock_icons ## Create toplevel window super('Application Window') table = Gtk::Table.new(1, 4, false) add(table) ## Create the menubar accel_group = Gtk::AccelGroup.new add_accel_group(accel_group) item_factory = Gtk::ItemFactory.new(Gtk::ItemFactory::TYPE_MENU_BAR, '<main>', accel_group) # create menu items menuitem_cb = proc do |data, widget| # TODO: Show item-factory's path to menu item dialog = Gtk::MessageDialog.new(self, Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::INFO, Gtk::MessageDialog::BUTTONS_CLOSE, "You selected or toggled the menu item \"#{Gtk::ItemFactory.path_from_widget(widget)}\"") # Close dialog on user response dialog.signal_connect('response') do |widget, data| widget.destroy end dialog.show end menu_items = [ ["/_File"], ["/_File/_New", "<StockItem>", "<control>N", Gtk::Stock::NEW, menuitem_cb], ["/_File/_Open", "<StockItem>", "<control>O", Gtk::Stock::OPEN, menuitem_cb], ["/File/_Save", "<StockItem>", "<control>S", Gtk::Stock::SAVE, menuitem_cb], ["/File/Save _As...", "<StockItem>", nil, Gtk::Stock::SAVE, menuitem_cb], ["/File/sep1", "<Separator>", nil, nil, menuitem_cb], ["/File/Quit", "<StockItem>", "<control>Q", Gtk::Stock::QUIT, menuitem_cb], ["/_Preferences"], ["/_Preferences/_Color"], ["/_Preferences/Color/_Red", "<RadioItem>", nil, nil, menuitem_cb], ["/_Preferences/Color/_Green", "/Preferences/Color/Red", nil, nil, menuitem_cb], ["/_Preferences/Color/_Blue", "/Preferences/Color/Red", nil, nil, menuitem_cb], ["/Preferences/_Shape"], ["/Preferences/Shape/_Square", "<RadioItem>", nil, nil, menuitem_cb], ["/Preferences/Shape/_Rectangle", "/Preferences/Shape/Square", nil, nil, menuitem_cb], ["/Preferences/Shape/_Oval", "/Preferences/Shape/Square", nil, nil, menuitem_cb], # If you wanted this to be right justified you would use # "<LastBranch>", not "<Branch>". Right justified help menu # items are generally considered a bad idea now days. ["/_Help"], ["/Help/_About", "<Item>", nil, nil, Proc.new{about_cb}], ] item_factory.create_items(menu_items) table.attach(item_factory.get_widget('<main>'), # X direction # Y direction 0, 1, 0, 1, Gtk::EXPAND | Gtk::FILL, 0, 0, 0) ## Create the toolbar toolbar = Gtk::Toolbar.new # toolbar.set_toolbar_style(Gtk::Toolbar::BOTH) toolbar.append(Gtk::Stock::OPEN, "This is a demo button with an 'open' icon" ) do toolbar_cb end toolbar.append(Gtk::Stock::QUIT, "This is a demo button with an 'quit' icon" ) do toolbar_cb end toolbar.append_space toolbar.append(:demo_gtk_logo, "This is a demo button with an 'gtk' icon" ) do toolbar_cb end table.attach(toolbar, # X direction # Y direction 0, 1, 1, 2, Gtk::EXPAND | Gtk::FILL, 0, 0, 0) ## Create document sw = Gtk::ScrolledWindow.new sw.set_policy(:automatic, :automatic) sw.shadow_type = :in table.attach(sw, # X direction # Y direction 0, 1, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0) set_default_size(200, 200) contents = Gtk::TextView.new sw.add(contents) ## Create statusbar statusbar = Gtk::Statusbar.new table.attach(statusbar, # X direction # Y direction 0, 1, 3, 4, Gtk::EXPAND | Gtk::FILL, 0, 0, 0) # Show text widget info in the statusbar buffer = contents.buffer buffer.signal_connect('changed') do |buffer| update_statusbar(buffer, statusbar) end # cursor moved buffer.signal_connect('mark_set') do |buffer, iter, mark| update_statusbar(buffer, statusbar) end end def toolbar_cb(*args) dialog = Gtk::MessageDialog.new(self, Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::INFO, Gtk::MessageDialog::BUTTONS_CLOSE, "You selected a toolbar button") # Close dialog on user response dialog.signal_connect('response') do |widget, data| widget.destroy end dialog.show end def about_cb(*args) unless Gtk.check_version?(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" return end authors = ["Peter Mattis", "Spencer Kimball", "Josh MacDonald", "and many more..."] documentors = ["Owen Taylor", "Tony Gale", "Mattias Clasen <mclasen@redhat.com>", "and many more..."] license = %Q[ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the Gnome Library; see the file COPYING.LIB.If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ] transparent = Gdk::Pixbuf.new(Demo.find_file("gtk-logo-rgb.gif")).add_alpha(true, 0xff, 0xff, 0xff) Gtk::AboutDialog.set_email_hook {|about, link| puts "send mail to #{link}" } Gtk::AboutDialog.set_url_hook {|about, link| puts "show url #{link}" } Gtk::AboutDialog.show(self, :name => "GTK+ Code Demos", :version => Gtk::VERSION.join("."), :copyright => "(C) 1997-2004 The GTK+ Team", :license => license, :website => "http://www.gtk.org", :comments => "Program to demonstrate GTK+ functions.", :authors => authors, :documenters => documentors, :logo => transparent) end def update_statusbar(buffer, statusbar) statusbar.pop(0) iter = buffer.get_iter_at_mark(buffer.get_mark('insert')) statusbar.push(0, "Cursor at row #{iter.line} column #{iter.line_offset} - #{buffer.char_count} chars in document") end def register_stock_icons # Register our stock items Gtk::Stock.add(:demo_gtk_logo, '_GTK!') # Add out custom icon factory to the list of defaults factory = Gtk::IconFactory.new factory.add_default filename = Demo.find_file('gtk-logo-rgb.gif') pixbuf = Gdk::Pixbuf.new(filename) transparent = pixbuf.add_alpha(true, 0xff, 0xff, 0xff) icon_set = Gtk::IconSet.new(transparent) factory.add('demo_gtk_logo', icon_set) end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/hypertext.rb���������������������������������������������0000644�0001750�0001750�00000015012�12137115065�021025� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: hypertext.rb,v 1.2 2005/12/01 09:27:01 ktou Exp $ =begin = Text Widget/Hypertext Usually, tags modify the appearance of text in the view, e.g. making it bold or colored or underlined. But tags are not restricted to appearance. They can also affect the behavior of mouse and key presses, as this demo shows. =end require 'common' module Demo class Hypertext < BasicWindow def initialize super('Hypertext') @hand_cursor = Gdk::Cursor.new(Gdk::Cursor::HAND2) @regular_cursor = Gdk::Cursor.new(Gdk::Cursor::XTERM) @hovering = false set_default_size(450, 450) self.border_width = 0 view = Gtk::TextView.new view.wrap_mode = :word view.signal_connect('key-press-event') do |*args| key_press_event(*args) end view.signal_connect('event-after') do |*args| event_after(*args) end view.signal_connect('motion-notify-event') do |*args| motion_notify_event(*args) end view.signal_connect('visibility-notify-event') do |*args| visibility_notify_event(*args) end buffer = view.buffer sw = Gtk::ScrolledWindow.new sw.set_policy(:automatic, :automatic) add(sw) sw.add(view) show_page(buffer, 1) end # Inserts a piece of text into the buffer, giving it the usual # appearance of a hyperlink in a web browser: blue and underlined. # Additionally, attaches some data on the tag, to make it recognizable # as a link. def insert_link(buffer, iter, text, page) tag = buffer.create_tag(nil, { 'foreground' => 'blue', 'underline' => Pango::AttrUnderline::SINGLE, }) tag.page = page buffer.insert(iter, text, tag) print("Insert #{tag}:#{page}\n") end # Fills the buffer with text and interspersed links. In any real # hypertext app, this method would parse a file to identify the links. def show_page(buffer, page) puts buffer.text = '' iter = buffer.get_iter_at(:offset => 0) case page when 1 buffer.insert(iter, 'Some text ot show that simple ') insert_link(buffer, iter, 'hypertext', 3) buffer.insert(iter, ' can easily be realized with ') insert_link(buffer, iter, 'tags', 2) buffer.insert(iter, '.') when 2 buffer.insert(iter, %Q[A tag is an attribute that can be applied to some range of text. For example, a tag might be called "bold" and make the text insid the tag bold. However, the tag concept is more general than that; tags don't have to affect appearance. They can instead affect the behavior of mouse and key presses, "lock" a range of text so the user can't edit it, or countless other things.]) buffer.insert(iter, "\n") insert_link(buffer, iter, 'Go back', 1) when 3 tag = buffer.create_tag(nil, { 'weight' => Pango::FontDescription::WEIGHT_BOLD }) buffer.insert(iter, "hypertext:\n", tag); buffer.insert(iter, %Q[machine-readable text that is not sequential but is organized so that related items of information are connected.\n]) insert_link(buffer, iter, 'Go back', 1) end end # Looks at all tags covering the position of iter in the text view, # and if one of them is a link, follow it by showing the page identified # by the data attached to it. def follow_if_link(text_view, iter) tags = iter.tags tags.each do |tag| print("Follow #{tag}:#{tag.page}\n") if tag.page show_page(text_view.buffer, tag.page) break end end end # Links can be activated by pressing Enter. def key_press_event(text_view, event) case event.keyval when Gdk::Keyval::GDK_Return, Gdk::Keyval::GDK_KP_Enter buffer = text_view.buffer iter = buffer.get_iter_at_mark(buffer.get_mark("insert")) follow_if_link(text_view, iter) end false end # Links can also be activated by clicking. def event_after(text_view, event) unless event.kind_of?(Gdk::EventButton) and event.button == 1 return false end buffer = text_view.buffer # we shouldn't follow a link if the user has selected something range = buffer.selection_bounds if range and range[0].offset != range[1].offset return false end x, y = text_view.window_to_buffer_coords(Gtk::TextView::WINDOW_WIDGET, event.x, event.y) iter = text_view.get_iter_at_location(x, y) follow_if_link(text_view, iter) end # Looks at all tags covering the position (x, y) in the text view, # and if one of them is a link, change the cursor to the "hands" cursor # typically used by web browsers. def set_cursor_if_appropriate(text_view, x, y) buffer = text_view.buffer iter = text_view.get_iter_at_location(x, y) hovering = false tags = iter.tags tags.each do |t| if t.page hovering = true break end end if hovering != @hovering @hovering = hovering window = text_view.get_window(Gtk::TextView::WINDOW_TEXT) window.cursor = if @hovering @hand_cursor else @regular_cursor end end end # Update the cursor image if the pointer moved. def motion_notify_event(text_view, event) x, y = text_view.window_to_buffer_coords(Gtk::TextView::WINDOW_WIDGET, event.x, event.y) set_cursor_if_appropriate(text_view, x, y) text_view.window.pointer false end # Also update the cursor image if the window becomes visible # (e.g. when a window covering it got iconified). def visibility_notify_event (text_view, event) window, wx, wy = text_view.window.pointer bx, by = text_view.window_to_buffer_coords(Gtk::TextView::WINDOW_WIDGET, wx, wy) set_cursor_if_appropriate(text_view, bx, by) false end end end module Gtk class TextTag attr_accessor :page end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/pixbufs.rb�����������������������������������������������0000644�0001750�0001750�00000011356�11701304107�020451� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: pixbufs.rb,v 1.5 2005/02/12 23:02:43 kzys Exp $ =begin = Pixbufs A Gdk::Pixbuf represents an image, normally in RGB or RGBA format. Pixbufs are normally used to load files from disk and perform image scaling. This demo is not all that educational, but looks cool. It was written by Extreme Pixbuf Hacker Federico Mena Quintero. It also shows off how to use Gtk::DrawingArea to do a simple animation. Look at the Image demo for additional pixbuf usage examples. =end require 'common' module Demo class Pixbufs < BasicWindow FRAME_DELAY = 50 BACKGROUND_NAME = 'background.jpg' IMAGE_NAMES = [ 'apple-red.png', 'gnome-applets.png', 'gnome-calendar.png', 'gnome-foot.png', 'gnome-gmush.png', 'gnome-gimp.png', 'gnome-gsame.png', 'gnu-keys.png', 'ruby-gnome2-logo.png' ] CYCLE_LEN = 60 def initialize super('Pixbufs') set_resizable(false) @background = nil @frame = nil @frame_num = 0 @images = [] begin load_pixbufs set_size_request(@background.width, @background.height) @frame = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, false, 8, @background.width, @background.height) @da = Gtk::DrawingArea.new @da.signal_connect('expose_event') do |w, e| expose_cb(w, e) end add(@da) timeout_id = Gtk.timeout_add(FRAME_DELAY) do timeout end signal_connect('destroy') do Gtk.timeout_remove(timeout_id) end rescue dialog = Gtk::MessageDialog.new(self, Gtk::Dialog::DESTROY_WITH_PARENT, Gtk::MessageDialog::ERROR, Gtk::MessageDialog::BUTTONS_CLOSE, "Failed to load an image: #{$!.message}") dialog.signal_connect('response') do dialog.destroy end dialog.show end end def load_pixbufs # Loads the images for the demo if @background return # already loaded earlier end # demo_find_file() looks in the the current directory first, # so you can run gtk-demo without installing GTK, then looks # in the location where the file is installed. # filename = Demo.find_file(BACKGROUND_NAME) @background = Gdk::Pixbuf.new(filename) IMAGE_NAMES.each_with_index do |basename, i| filename = Demo.find_file(basename) @images[i] = Gdk::Pixbuf.new(filename) end end def expose_cb(widget, event) rowstride = @frame.rowstride pixels = @frame.pixels pixels[0, rowstride * event.area.y + event.area.x * 3] = '' Gdk::RGB.draw_rgb_image(widget.window, widget.style.black_gc, event.area.x, event.area.y, event.area.width, event.area.height, Gdk::RGB::Dither::NORMAL, pixels, rowstride, event.area.x, event.area.y) true end # Timeout handler to regenerate the frame def timeout @background.copy_area(0, 0, @background.width, @background.height, @frame, 0, 0) f = Float(@frame_num % CYCLE_LEN) / CYCLE_LEN; xmid = @background.width / 2.0 ymid = @background.height / 2.0 radius = [xmid, ymid].min / 2.0 @images.each_with_index do |image, i| ang = 2.0 * Math::PI * Float(i) / IMAGE_NAMES.length - f * 2.0 * Math::PI r = radius + (radius / 3.0) * Math.sin(f * 2.0 * Math::PI) xpos = (xmid + r * Math.cos(ang) - image.width / 2.0 + 0.5).floor ypos = (ymid + r * Math.sin(ang) - image.height / 2.0 + 0.5).floor k = if (i & 1) == 1 Math.sin(f * 2.0 * Math::PI) else Math.cos(f * 2.0 * Math::PI) end k = [0.25, 2.0 * k * k].max r1 = Gdk::Rectangle.new(xpos, ypos, image.width * k, image.height * k) r2 = Gdk::Rectangle.new(0, 0, @background.width, @background.height) dest = r1.intersect(r2) if dest @frame.composite!(image, dest.x, dest.y, dest.width, dest.height, xpos, ypos, k, k, Gdk::Pixbuf::INTERP_NEAREST, if (i & 1) == 1 [ 127, (255 * Math.sin(f * 2.0 * Math::PI)).abs ].max else [ 127, (255 * Math.cos(f * 2.0 * Math::PI)).abs ].max end) end end @da.queue_draw @frame_num += 1 true end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/apple-red.png��������������������������������������������0000644�0001750�0001750�00000006731�11701304107�021024� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA��± üa�� IDATxœí™[Œ]WyÇk­½Ï9sóŒí8Á NìÜ)J„Ú„¶¢áÚ¨·Bª>p‰©E¤–¢ •¶‰WÉK« ÒR@è­«@›¤@Bq—‚S+¶ã8vÛ3ã™sÎÞk}—>œ3Á1¾Ä^ª|ÒÖž9ëöÿ¯ïûÖúïµàe{Ù^¶—ítvþy³—_æá¥Tz߇ß} „„¯ŸrçãÞ½ížc§ksëïÞð§M“?pï¿<üp+ÐÿE>ÑâÙ*ܾõÖ§ºúúÜêî W]³ví†Ëfgº½ôvwßûÖÛ>yºv!„›¿·ã'+³_ýŸdéL…·o½m]aûÄD•Ö­ŸÎóG»€¹‹7®îL¯ª«ù#ͯ¾êµ¿Òìü¯>tb»÷þÞW-,.ßñØã{�>üä—Eà,ð§&§+Ö¬›hæ â /—–¤Ú³{^Ž>ß„Õçõzàñþ;Þû‰“ÞñàÃ?êÿüû/ ;p·o}ïƒU¦.¹tµ÷—KGŇ«f»Ë6¯)oš]ºäÒÙáE¯Z¼ä²91|î}~÷ö•¶ó ËW--7CàÏÏ4øÎíŸ ;·ö%åáéì”oßzÛ!òí g|a¾•é™NgnMoñàþåé˜,çVºK‹U!†ˆ@0“G¾|ç×¶¼nËæÚ±k5pÍJŸo»éºg&;Wˆ5B8tpaßoùû;[6:à�×½ùOü\ œ2¹R wÍ®ér|¡•óΟ¨=Ó÷ÉéZ–—›ÜEBˆâ®|[ŒñaÕ²ÆÝþ,Æê­¿ÿ¡w~÷±û¿xà“½ù¶ VÕmäB)†F§h¡¬šá›ÿñcŽÝ·ó±ù¦üàÏüõÎíŸ}ê\IüŒþàn}G§Sef¶c"º´vÝÔªg÷ï/-þ3Æj"„ø`áówo»gprÛÛ>øŽAØúõ»¿qoÛäwÝò;7¬ª¹¥ŠO ̄ᰠ& ¬AÄXªA۰ضì8pìSî9pßÏMàßâªÙNwnmïØáƒƒja~¨n,‡v„?s÷¶{v}ôú7¼ñò¹ÙO„ÞÛêP ÷€v4!tñõ¯˜™ÜÒéTÔUMŒO¤Éh[(ê ‹0 š:²Ð4ôuÈ¢(­”íí;ú‘'Ÿyn÷9Øú©Û?SÕéc©bùèáጙõ!|'„øé/ýÍßÿø¦Í›7½çÒ+ÿ©Wu_Õ«œN¬H)‚£•‰DÄ^'ªj´FĪBÄ,h.è°%49³ Ãä ­0o…¥fH_ ô¹CóÍû¿ùøSÿv&/Ên¯zÏÂüàhÉ–ÜùtJÕ?ܽížç�^¿qãÆÛ6]ñÝ^·»~ºÓ£î&º5³¤‰)†‹G©¨ˆÄ1¢¢!@©Š2Ä ¦ÄºÆÛ–z¢f² ¨rª©\饊6šìœ?7¹ý=¯¿òÃ_ùÞ“wžÕï¿ãÖ·§Š/”¬ùå;¿úw'WüÛ7ßüìyÓÓë'¦ºÌ^°ž¹›˜½æjò±c …ã»wÓz–€CDqbO1£H¡ä!Þ´ÈÀÐa f´î´æ›–c•±P26,dÁh¨RäЀ«¶ïصëŒ0Óh™O~ùίÞ{r¥/¾õ¦»VOM¬ŸìVlØòæ^}½Ù5ä…#„�ey_\¤3Ѹ*1‚D7‰­*J­x§*4+DÐÆ¨ªÈ$‘¦Ä"½,õXä’Ùú^àêSxAJüpÇvýpÇž8¹ÂG®Ý×®Y½mº×eÝÆM¬Þ²…zr\ÉÇŽ1œ?LÞÿ ž êN£Éˆqû© X4L IŽzÁ‹!u$Dw¬¨á!P¢!¦X(3J€””⺫~ýÊÅÇw>ýðÉøÎ*æ®;oõç;Ý f®ØLթѦO{è ±ÛAž?ŒMt˜zåèU„:áÁñz47"ƒ’qsHÁÐNDSÀªˆ‡@Ý8Éœn5A7¢‚¡5eÐÏ<¾3øÐ®¿aª—¶têHš`â ÀÜ_ v:,î~‚ J¯;I±–’‡`†U"”* †af˜#æPpÄ wÇD0¬UÕÁSÀ«š˜"Vkaêð`ó9¸zõìÇT‘º5³—^W/…8–žÝOgn‰l‚?ŽÇ�ÆÈ¦P2â ¥àÑQsÌÇå8ž‰;‘–Aܦ TÑÀ"â‚J9%Æ3êô^]ývÝ« )àÓ”¥%°@Û_¢®júBŒxɘ9w'ˆŽfÔTð(ê„0 ªˆº¡-/lp˜aðèˆAìAi¡#äaE¬N­0NKàm7]·©êE’;¡ªétzØ`@~ï$Zɘ`x°¡D‘Ê^1CQŠÌƱoNÉÝ„@Ápu,‚†@¨z¼%º¡j÷S‹ÖÓ¸6ÍÝÔÑ:ઔ¶EÍkñ¾â®àŠÕ©)¨e¢  š"ÇÜа` ®h ¨ š"ä–íT ÍžñFP¡v,GbrJ>5ÎÓèZÀS TP'4Q�uÜï÷Gñl†«b*-¨+1€8˜ʨ>L UÇ£",*¹±V1�,EŠƒ,ä ˆ*Æà‚U;Ή@é&D„ ©"ËÇÑ™š&}a5\ )²"Jò‚F0U°Œ3 s°h Б‡BÄ+¬isaØ©ãè’§+ îœù Ãþ‹ªJ)-M™:&ÚàXɸ‚ "ÁÁŒày4âãd-£ÝÖTr‘•ðD@µ�¢#§È°(Þq†ƒ@ªàþ­Sá<ãçܶw½Å§«ŠéÙULÍÌЛYE*J.™D ‰BŒ#À%Cdb¦`# jŠ™0#ÁqZUT)†h¦¡¯…¥¥}7kCPK ÿüý§VŸ“�fÿZaoI¹Š@ÓPB iAŠ€ Ö©Á#Á”Ñ  ÁF‚Î Q£¨¢>JdŽPÌ1I‰áPÉ"XTlXæ‘E"iªûµÓa<ãF¶oyð…F §Ð¶}ƒã ó¾´˜g$ª‘ŒHF­àAQW\‚‘%SPpCU ¡ ªä±bQÚ2¤Í-ÍPXj %D OXÁpm÷®Óa<ë‰ÀÞý[‡¦{ êºK/E꺦rÃB¤[9FEŠ©¢2Á�g¤ñÕT(>"ÕZ@<£hsaÐŽÂgyÙhC¡ÑL_)Ž ±ŠLMt¿ùîºùtøÎzbö|Ö[{ùvÌÆ0FÔ•*A"E" 'U(ÁG3.¨ƒE–‘lPSZsD %;Ù¡µB¿1¬rch•Ð&3Ô„%$çàDõ9F‘b§ÂwÆ“9€ï<±gϯ¾ìµ¸^aÅPuç€áØX£dœ¢ &dW²Y5CÇIšK!k _œR2m$*¦F ‘,B«…¶iI) 1=zßýO~ è2ÒÇD^Ðg%�pÑk.þþª6¼3¤0-È”¡‘Q¡ ¢BGQr0úº‘-­*c…ZAÛ*mCiZ¡´ó€³‡vÙ;ä`˜dòÎH=é ³æÁÎÇö»øúK¾1³TÞ•ºiÚMG ±â¢d7Ä MiQ-´Ái‡™¶("…Á Ý€Ì’9Z”"­&•Ì À°1({ž[ûž]Ø�¼¸ è+‚¢�Ë+º+lÎHâѽ‹›/»ð‰nˆoR·©Ò m„6R bN«ÎòÀö[Z)ô‡™Ö•A¥%¯¬< " 13´€ 2¸ptPرëЉQ2\1þûyFGõÏ­NŽ]r¦±tw<ùÌÂÞ#‹ÏoZ»ê7S7¤vüQ"RȪ´­ÐäB.™Ö„ÖœR mŒL©æŠV¦F6§˜Ñ´‚hFUYÌÂýí?yü0ÆØgt`|8°B 7.<e–Ÿ@`xÅB¿¹á¿ùµ 3SLÖMÐd§ˆÒ¨¡V#KA4#Á1%zi ×ÑæF¡)£Z*÷íØ{ªñø°Øì“ ŸÓˆÕÍ@8ˆ%ë•=}xÇŠuS]D…lIiAQBFH‘l‘*8î ¦UÀÕ(ê¨({öy`ç¾S½ lgtϰx¬�«Æx)^ \lÞ\;=Ó›zýåë¹üüi' í÷yàñƒÌ÷�fç&¹æ¢µœ?Óeª[Ó«ªÈÐŒ‡<úÌQç_tåŒÂå{ÀŒâþ©ñ³2û²ì¥Zf€W0Z..^\ ¬½pÃÚn€p`ÿÑsèöE —½À.F³|˜Q¬ïc”´GNXtÎõr!c"kÇdÎYyo�Vû^éšÑjW1Ê¥È(VV“§ÇàŽ1Z"Ÿžð>6®ÿ3‹ÍÏ{;ydb v˜“XsØ<´2N8á·ö0ÃqY?óŒfza\ï´!þºÞ9¡züTŒr¥;þ¿ðÓÍÒO�9ÖÞèø7ƒŒc‚2~Ÿieü…8]¿‘Ÿ†Ñ‰blEËœ ç|µôÿÆþ\އÂÁ—����IEND®B`‚���������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/colorsel.rb����������������������������������������������0000644�0001750�0001750�00000004105�12257552170�020621� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: colorsel.rb,v 1.4 2005/02/12 23:02:43 kzys Exp $ =begin = Color Selector Gtk::ColorSelection lets the user choose a color. Gtk::ColorSelectionDialog is a prebuilt dialog containing a Gtk::ColorSelection. =end require 'common' module Demo class ColorSel < BasicWindow def initialize super('Color Selection') @color = Gdk::RGBA.new(0, 0, 1, 1) set_border_width(8) vbox = Gtk::Box.new(:vertical, 0) vbox.set_border_width(8) add(vbox) ## Create the color swatch area @frame = Gtk::Frame.new @frame.set_shadow_type(:in) vbox.pack_start(@frame, :expand => true, :fill => true, :padding => 0) @da = Gtk::DrawingArea.new @da.signal_connect('draw') do |widget, event| if widget.window context = widget.style_context background_color = context.get_background_color(:normal) event.set_source_rgba(background_color.to_a) event.paint end end # set a minimum size @da.set_size_request(200, 200) # set the color @da.override_background_color(:normal, @color) @frame.add(@da) alignment = Gtk::Alignment.new(1.0, 0.5, 0.0, 0.0) button = Gtk::Button.new(:mnemonic => '_Change the above color') alignment.add(button) vbox.pack_start(alignment, :expand => false, :fill => false, :padding => 0) button.signal_connect('clicked') do change_color_callback end end def change_color_callback dialog = Gtk::ColorSelectionDialog.new(:title => 'Changing color') dialog.set_transient_for(self) colorsel = dialog.color_selection colorsel.set_previous_rgba(@color) colorsel.set_current_rgba(@color) colorsel.set_has_palette(true) response = dialog.run if response == Gtk::ResponseType::OK @color = colorsel.current_rgba @da.override_background_color(:normal, @color) end dialog.destroy end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/common.rb������������������������������������������������0000644�0001750�0001750�00000003603�12257552170�020271� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin common.rb - Common class for gtk-demo. Copyright (c) 2003-2005 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: common.rb,v 1.9 2005/10/15 03:41:36 mutoh Exp $ =end require 'gtk3' module Demo def self.find_file(basename) %w(. /usr/share/gtk-3.0/demo /usr/local/share/gtk-3.0/demo/).each do |dirname| path = File.join(dirname, basename) if File.exist?(path) return path end end raise "#{basename}: No such file or directory" end class BasicWindow < Gtk::Window def initialize(title = nil) super(:toplevel) if title set_title("#{title} in Ruby/GTK") end signal_connect("key_press_event") do |widget, event| if event.state.control_mask? and event.keyval == Gdk::Keyval::GDK_q destroy true else false end end signal_connect("delete_event") do |widget, event| quit end end def quit destroy true end end class CairoWindow < BasicWindow def initialize(title=nil) super unless Gdk.cairo_available? add_cairo_require_label return end drawing_area = Gtk::DrawingArea.new add(drawing_area) drawing_area.signal_connect("draw") do |widget, event| cr = widget.window.create_cairo_context cr.scale(widget.window.width, widget.window.height) cr.set_line_width(0.04) cr.save do cr.set_source_color(Gdk::Color.new(65535, 65535, 65535)) cr.gdk_rectangle(Gdk::Rectangle.new(0, 0, 1, 1)) cr.fill end draw(cr) end end def add_cairo_require_label message = "This sample requires GTK+ 2.8.0 or later and cairo support" add(Gtk::Label.new(message)) end def draw(cr) raise "not implemented" end end end �����������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/css_accordion.css����������������������������������������0000644�0001750�0001750�00000002443�12257552170�022000� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@import url("reset.css"); * { transition-property: color, background-color, border-color, background-image, padding, border-width; transition-duration: 1s; font: Cantarell 20px; } GtkWindow { background: linear-gradient(153deg, #151515, #151515 5px, transparent 5px) 0 0, linear-gradient(333deg, #151515, #151515 5px, transparent 5px) 10px 5px, linear-gradient(153deg, #222, #222 5px, transparent 5px) 0 5px, linear-gradient(333deg, #222, #222 5px, transparent 5px) 10px 10px, linear-gradient(90deg, #1b1b1b, #1b1b1b 10px, transparent 10px), linear-gradient(#1d1d1d, #1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424); background-color: #131313; background-size: 20px 20px; } .button { color: black; background-color: #bbb; border-style: solid; border-width: 2px 0 2px 2px; border-color: #333; padding: 12px 4px; } .button:first-child { border-radius: 5px 0 0 5px; } .button:last-child { border-radius: 0 5px 5px 0; border-width: 2px; } .button:hover { padding: 12px 48px; background-color: #4870bc; } .button *:hover { color: white; } .button:hover:active, .button:active { background-color: #993401; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/background.jpg�������������������������������������������0000644�0001750�0001750�00000053313�11701304107�021264� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ÿØÿà�JFIF��H�H��ÿþ�Created with The GIMPÿÛ�C�    $.' ",#(7),01444'9=82<.342ÿÛ�C  2!!22222222222222222222222222222222222222222222222222ÿÀ�"�ÿÄ��������������ÿÄ�8��!1AQ"a2q#B‘R¡3±ÁrÑáðb¢ñ‚C²ÿÄ�������������ÿÄ��������������1ÿÚ� ��?�ùØT[C ŽGzFÈÜh ÊŽè¤^¶‚<M±iœïpŽIЯ;¹椑!w«{رPÌI�ûè³[µl„¶¡GÍ"!täI<ŽT$ßšY>¨hÐð|Ó lŒ‹F¤T€{¢æ(Äv×4 ùTQúž|Q •¡KH§Âylém¸Uw$‰¨¦"G¿4©îd€vEL¹ C1Ôÿ�H¦€‹€2;‘ÞY $É=«¶â3Yø4Àçp€£»V”M•´'UDýkYR#‰¢ŠB@X±ã˜§®X"A™8¦$ërBÁ¨©“ K„ö¥Ð¸dŒˆÖ©Þ1`Nˆ¢ÙpË›ŽMTDL‹î~)‚©oÏŠ%²%ýFQ"™-¢Ã³³ß<šŠÐP Ä\ˆŽ(žÃ@E/¦z––g[}ãST´¨€ùËÀª€ª-¡ˆÉŒ–¥ïpª¸Dìš* ¨„‡$÷¢EÁ‘V¶$~ê7U ›`Ð {ÐU-yZàTê»§ÔkŠ :ÔƒD!7@`5²{~(1`v¿ØÖ²0±™úݤ}«Næ[®åͰP‹b"7"¢Œ¾1—�Ð ˆ²rf�V ®ÀÁ$O€œîo~ÕP¨e½5'€HÝîq§��ñTf÷ËÚ †õþ±’ÈXE–g˜ ¨U27è?½‚)÷7ö¦fôWõ]Û‰?ù¬«mos9ùŸÅ� ‹hb$ÈïCÙYQÝ‹ÖÐG‰ –-3€]îÉ:ŠsRH;Õ½ìX¨f$€}ôY­Ú¶B[P£æ‘ºr$žGª NïÍ,ŸT4hx>iƒ…¶FE£R*@=Ñsb;kš|‹*(ýO>(„ÊáP¥€ˆ$S„ ‚a<¶t„6‚Ü*»’DÔS £ßšT÷²@;"¦\!˜ê¤S@EÀÈï@ˆG¬�’džÕÛq¬ü`s¸@@ÑÝ«J&ÊÚƪ¢~µ¬ƒ)ÄÑE! ,XñÌS‚×, ̉Su¹!`ÔTÉ…%‡B{Rè\2FDkTï°'DQ ‰l¸eÍÇ&ª ¢&EŽw?ŒÁT·çÅÙþ£(L–ÑaÙÙ‚ïžME!G*@u&cŠe·mT,HÉæ€~(EÅ9#Q@ fëlŸµ=ËÊ! …Ȭ¶ò-î#(š2¨!Ió@¶Ý ÂV0 Áý­n` 9ÆÀÉÐ ™ºÑ¢� [—{KHâ¨ýBÎôOŠKކâ[µp+³�Ì[`WEë-›ŽY- H’[ïÞªb¡‚ÌDI;&¤Q˜ÀEQäŠ(Äté’º“î9ôàqãɨ C*•WsÄÒª"�c7™,DÁ Ì¶Üì@ù¦Æ@rÅLh ¦@] LQ‘X‚÷îdP’É,<ÿ�ȱP ÐøB&æ Z õP& ˜<ÓûÜcÅ1#Sßâ¤?SÙ$ÀÞµTlf4cÍ'Ð…TnH rŦ8ì)D ÔsF%x"Gsº�ðèqàÀì�©Â— žcš¦Á5Í*¶�³0#tåÄr?Šbà3*¸ÍJÒÿ�˜k÷ ð©n€Ú'æŸÐ{BÒÝ%²Þ*œ}ê FGÀâœ6"ñ €Hó½Ö�¡,@-ò8¨¦FÈ<R›ym V0“3Û° C\’D[‰ È2PÊí5º{ÂÏQ饦¼ä{À×4¾­—ê­®#„"j¿á9‹w.-¶g¸Æ r<î´Ê¹t×z«—º«KmBª0ŸãïHöå‹úAŸl=v¯N.Y¸—,—%¢cÛ\­w¦==¤Vf¸ šËHr¤Q2f8¦[vÕBÄÌžhâ€$Y S‘"5�¦n¶À1ÉûSܼ¢QÜŠËo"Þâ2‰£*‚‘4 mÐÜ!c ЬÚÙæ�£œl�<˜Ý�™›­ ¹y´¹Ž êÔ!\ïDø¤¸èn%»W»0 Ŷt^±rÙ¸áÕ’ÐÔ‰%¾ýê &*,ÄD“²jEŒUH¢ŒGN™+©>ãïN<šŠ2©UpX÷<M*¢ 3y’ÄL À[mÎÄšld,TÆ€ êdÒÈÕiˆ/q¾æE !Œ’ÃÈñLQK�@„ R`þiÑÂ�E¢Q¥b`yƒÍ?½À&<Pã5=þ*Cõ=’L ëUFÆcF<Ò}UA†äŠÈ‚X¹Ðâ™U÷¬Ç�qSÄþ¡Æw—z.$ÌDŠ ;æ üTÐ  d|v YäXA'½asAX�y4Á LšÖ¹~òô¶!È|SÞP–YËûTdAø®Ïð«>—Kê”&õïv^*¡¬†ôÝ=„F´­se‹{ˆûÒ]éìtß­îeµ-胯üWeç·ÓÚqÎMû@šæ¿~Ût—{‚ ŠÑÔu-«ÑÒ³µÍqmÛàAä×jõXÚÀ&O„5È@W Úy ÂÕÁp*ʾ;šhrI =èC!ÉýÇ9•æg(Çš ÒÞÐ3X:4™Ÿš6P ³cŠÒË h46ÕPº1:Á¦H�d{ ED†nÇÁ¢H˜ù¨¬å‚Ù:óX¸E‘; P®n-Ç� “Oƒ‘îÖZxª…úB¨2Õ‘1�·#°ÿ�µ>H’¨ÒÝÏ1HÓýŽê(3b]î0…H¤é:TêɽԶ(L­¿#É¥¼¢ëZéÆÃ¹ÈÏaÍ{im-ZKP›m?¶«.uèºc­€ʯïRK¾‡T-[¶nÜpX3 éký-¶9\xñ ½C¿SnèDÁS�³Ú£Nr—Q¦ê(ù~(`K ¸š·UuQv¯Ü)©aseTžIæƒ2)e§ø+éþaº{$•W>à§;U ••Âߎi€+ðPÊý꣰t=´ :{p8öƒULÚÖ²Z*kÕ$MÅyð Nç_qÕÒÊâ&�^MF—¿y:Nšå¶½“±¦¼äŘ0P£ˆÇtUBuÎH=šY’wÏzˆÌˆ%‹)•PzÌp<Aêgyw¢âLÉÔ@øª(wñS@0‘ñÚd ‘aLžô…Í`äÐ-2jwZåûËÒØ@‡ qñOyBYg/íQ‘â»?¬ú]/ªP›×½Ùxª†±þÓtöҵ͖-î#ïIw§±Ó~·¹–Ô·¢¿ñ]—žßOh=Ç97íkšýûmÒ\\}î,j*wGQÔ¶¬[D?JÎÔW5Å·lJ“]«Õck�™>X×!\\'jt9æƒ WÀ\«*øîi¡É$€ ÷¡ ‡'÷ä W™œ Ohl/K{@Í`èÒd~h`Ù@2ÌyŽ)ÿ�K,- ÐÛUBèÄè˜} ‘ì)»‰ c梳–gdëÍbáDHì)B¹¸·�‚@M>G»Yh âª-剃<ÖÂæ^ëe{ŒZgñMmË-ÇHUŸ'¼Pfh ÔPÐÄÚõ#Œ´9õg¶ª; Ù'G½H€’ÀÆØŠ¨Ïe]Š»–V½.’_¥¶%Dk…¹ŸT°ó¨ o�€bÇúvh:úÛ`² º¯cûMs\`Ph99ù¤ ~á•°@=ØÇö A[%ÛǸ:ž*)½÷>cE© lFÜÉâ™ÉÍH2æ'À4æ§l—£<¹:+^%m9Æ·LätöU@÷üš”QI™ ŒJ)Ðù »Û ƒÁÚr?Š»=ÛÖú{.© ’Þ?[ ô–ÔÞpÀ˜9©-Æ7’ÏMmn:ÉbÜ]·.Û»ÕYÚ!‚wUã¶ ÉËƒÍ <˜åÿ�ÇÅ]ÑÜzçFÚ¤î*€2'B¢²«2cnÒö˜¬RÞ‹9b7£ýâ…²}Ïí÷HŸ™=ósxðsó@m*-ëW[;“æ½1 ú¬à~ªòðp¡Äò *ûΉòhã¼îX悳¸75,÷4‹$‰âx5FЊˆ¶¤“ÃËPg11ø4 ±ˆ1Þ‹LSöª€ˆ.ÀÉ:í ™> Pˤvu9"t4OdÛ|Ä‹iíÙí®õ†,èHçâŠ"˜Ù=Ϫ1K¶Ö2R{οŠXuö2OôäÄž>k)!8‚wÄTPd yb`Ï5°¹—ºÙ^ã™üS[rËqÒggÉïšÈ4�[CkÔŽ2ÐçÔvžÚ¨ì+dLõ FKb*£=•v*îYXD ôºI~–Ú@•A®æ}RÃ΢¼�V‹éÙ ëëm‚È‚èb½í5Íq€U@} äçæ5û†VÁ�÷cÚl—lKàêx¨¦÷Üú@U¦@-±r7'Šg$h?5 ˘Ÿ�ÐSš²\zŒòäèx­x•´äsÝ3‘ÓÙUÜòhQDe&vf‚1(H§Cæ‚ïl6SiÈ@8þ("ì÷o[é캤‚KxüUnƒÒ[SyÃ`椷ÞK=5µ¸ë%‹pvÜh»nïUd h„B ÝTsŒZØ+'.40Lòc—ÿ�wGqëœj“¸¨�È Š,énØ·°[©«—æ>ÂªŠŠ¹bÞuAžà¶¡@‰&;P"©ô˜1P@ˆð*‰"I<®¢—Ó,CL~ŸšGéÿ�ÌuInããk¡ÜÕF·ƒ Ž-±ÁªS)wü §êzfé¬ÚµÓZv ?Wæ¤Èöî0¸XÜb¢š}ØhäI¥KVñ¬ÁГ³6> dOšƒlË@#š�Ku Ëh€?{öHDH #šÀŸE@*K 11A…»s¶ ÄêˆÀËæY  v, �V�‡m–ÁPó ÉÇäö®fêl(—Û]»*“?o£\[}:é PÌ;ë-€ª¶­°KK¨A Ô?á‡;—®eFŒIÖ€¯ImäRAPǽrÝ«CñI~àéÖÊçý5p«Y³eíàK‚}Ìg½@ v Ó•BÊ$åªwöª!| ¬¤eÇÔ r1ã½ óŽÜS¤¢›…1v³3ª(* ‰ #±=èåÁb'KS�IrÎNɱ‚K¸yø T—n�ÞŒÖfU"u:¬�~(¢ ½[HÒ/šRI2I3â²17)’ÚŠÀb§Oo­Œ`L±ç½{€(µi3¸tk J‡+ä;!Ò´áÑqžýÍ*!yÙ€LÕBÉ+�…cÇÚŸ#&Êc*& РÀ±¸ÅGQ@ÚBÀ‚û'¸¬Qša¤0ˆ=«I6t&¶d‘ ÆäЍ,énØ·°[©«—æ>ÂªŠŠ¹bÞuAžà¶¡@‰&;TR*ŸIƒ¨’$“Êê)}2Ä1dÇáyù¤~ŸüÇT–î>6±:ÍTkx0¸âÐ`¨õ2—|; ~§¦nšÍ«]5§`Óõp>jLnã …À&*)§ÝˆöŽDšTµošÌ 0+0#cêDù H6Ì´9 ·P̶ˆ÷¿aT„@D€ ’9¬ ôT x°Ó[·;b�ÜN¨Œ ¾e˜÷ñJbÊ`vÐlU2 œ~Ojæn¦Áb‰qµÛ²©3ñ1Fú5Å·Ó®• ðñ^²Ø «jÛ´º„ÍAÃþs¹zàFThÄh ô–ÞE$ {Ñ -Ú´?—î`®q?ÓQ§ µ›6^Þ¸'ÜÆ{Ôb ÐÙÝ9T, òNZ§qoj¢ÀªÊX»éÖ¹–Ý`·mæå­É×< v!m®+�;ÔzŒmÙw$·üÔUX’˜È˜ÜR[{ª iµ¶.9“Z:‹ªnž‘aŒ‰p¦+§¡±q÷¹Ü#KûG‰ªŠdëxº^=EИTñ\îÖÞ×®¯qîð̇šõz{NÁ˜ÀÅxaÿ�Ú¼ÁuÖze6Ŷ’qÖ¦¢¥é ÇrO�›À*Ûq͹“le5Å�\ÙÇÕ(UQ�ƒuÜë|QƒÞµÄK\r} óAƒ(8éî°½¾ô3,˜Êg[ª;„¶GÞ‘W�äÓ‘Ž8º €=È=ªÖ:¯M$ “ÆÏGPÁî)vÜ(â›@sÜÍŸ¬ºW °SûGšæ$“=·C1ëÔ$÷Ûfi_—ñUŠM²àmާŠV¦Dÿ�Óºgp-¬dDkÒ5Ì' Aíê(=чý±TqéY�$Ö·mî÷ÕØ3ê å Ï ÄóU ‰ŠfvÀ"”qðS¯ÜÞ*`›ìBŽÝ?…‡»ÔOy­ZP=¨cŸ&‚ªg3ˆîh¹« æLE ¶ÅŽ­,•»s‘1âkYó æN¾(6*<˜¬ 7±X sOšÚÛ>É“É'“A-’œ ’EIv oæ+ DóLÌbkâ7S 3¦LA“QL°WÚitÏ„äØö¦! >aI˜ƒÚƒ*ÙéÊ›–=ÍT5¨[ ¡?÷ K’�“ð(Œ[ÙÃf{ŠP™)9·ÜÏ?jŠ»éÖ¹–Ý`·mæå­É×< v!m®+�;ÔzŒmÙw$·üÐU‰)Œ‰Å%°÷º –˜Û[`ã™5£¨º¦ééÈ— bºz_{‘Â4¿´xš¨¦N·‹¥ãÔ] €õOÎímízê÷ï Àhy¯W§´ìŒ W†ý«Ì]g¦Sl[i'jj*^ Üw$ð�ì)°|­°GÐk™0ÆPc\P�…Íœ}Q€…Uðh0']ηÅØ=ë\@TµÇ GÒ42ƒŽžá; ÛïAÃ2ÉŒ¦uº£±HKaTxéqM9àP‹ È܃ڭcªôÒJ <lñQTu â—mÂŽ)°D=ÌÐYúË¥pË?´y®bI3Ût3°]HOqA-¶f•ùPè¤Û.Øêx¥i dOý;¦wÚÆDF¹Ý#\ÂrÑÞ¢™¶ð�íÞ¡Ô¨{Jè81ç{®„'…Ùþk*CNF š¨ô‚‹¬Î¾Ûc‚Üš£„A$•FÔ÷5À½Uà°ªF‡Š•ë¯pÎXž7ÅHµÓÔõÃf׶ߟÝ\6Ðvã‚Kq>)íà¶A ÃÉmîƒ>¶™þõP f� ú{Ñ(¸É^ò>ôÃPHÊ>)L´â<ø¨¥À9Õ²XžAYíÛE_VåÂIúTóT̘ÅŽbiQQ=Øï·z¨æ|,î¨ò2P¤Š*¨P\dR[ÊöûÑy$Nñ⢂(Y$“q»v•ˆE-?Þ¶6Ën\8šÆÒ}^³¦wºoômÉc“ ŒÑ´ŠÜ{y1<·ŠM;’¤°_Š¡KŽL¬5½P¯qÐâ`ö¥°5_Ô?¸™¤[=KtÉt2æäâ„D ¬¡Eç²H/É�HïUIpI9æh,úsÚháí€ÐO$ Fd´Œå‚¨å›‘iBÁKez›½C„)l/´’'~)S©|¥Ó^aÌâ?ä×_Afå»n€¬î^'.õåæQqÚ%—\Tî„Ôÿ�2nÜ{�8ûWu¬¯�2B†|Wu�t"ÊÛS÷w¨©1ITªD F§æ³bÙ'˜S†Ú c1.fƒx&w1@'´–O`)‹Æ‚’#°¢$dý¢ªij�Oon襋EŒ‚�ùÙ¥´F;$’IŸÍ1_vY“<ÍE8d™ÀGoµ#31>Õ¸ãuŽ=þO4¶ð�íÞ¡Ô¨{Jè81ç{®„'…Ùþk*CNF š¨ô‚‹¬Î¾Ûc‚Üš£„A$•FÔ÷5À½Uà°ªF‡Š•ë¯pÎXž7ÅHµÓÔõÃf׶ߟÝ\6Ðvã‚Kq>)íà¶A ÃÉmîƒ>¶™þõP f� ú{Ñ(¸É^ò>ôÃPHÊ>)L´â<ø¨¥À9Õ²XžAYíÛE_VåÂIúTóT̘ÅŽbiQQ=Øï·z¨æ|,î¨ò2P¤Š*¨P\dR[ÊöûÑy$Nñ⢂(Y$“q»v•ˆE-?Þ¶6Ën\8šÆÒ}^³¦wºoômÉc“ ŒÑ´ŠÜ{y1<·ŠM;’¤°_Š¡KŽL¬5½P¯qÐâ`ö¥°5_Ô?¸™¤[=KtÉt2æäâ„D ¬¡Eç²H/É�HïUP…Ü÷¥w-¨“P!QCƒºÊ¢²µÌf3Tÿ�“@ÊŽë‘!Wÿ�wH#d+]c¡@|Õ\¡ !Gj[èâ‡SÀïA’Ù�©'#ãµDÙ~ÜP/€(¼ óÉ¥ôÜúŒH;ÐPÈAŽFÍ`Z vyjpél€ž|Ð’Nê)I¹væ6öcm:Z`B«±&Zy¬€¸t/µì?wæ‹Yic &cUq?¨µ<� )mÛ‹¢ã6À «ªå1Qd%N4gL)À–c‘h¥u gžP¸:~³©2xdñF×A{¨Qwª|Wœ$Àÿ�½5‹g¨ÿ�E3éôè ž í^ª#»F•&Y›ÅZGôVí'é]¸4:ì *õØnžÕ’×Ã7s&»’ý•Ì-ÀÄ+›§{Vo]{¿¨÷"cŠƒ z‡ÜtjFÚ¿UÒÛ>à\öÿ�EtõoníÑsÓE�§Z©‚ìÏé®*?UGªÈálb¿õRºª.w :Ë÷W%¾²ôD&‡1Q{—z‹Ì ã÷MHµÑw¨wµn8^Z¹æè lóâ)ñ–$ûˆÔÏ5‚¢œˆ“þÔ âZ|S¯?ÿ�4€!-+ÉíªV¤Ä( \Ãĉæ„1Y% wâi•-ú›A€‘³LU]¶ax� XÒ-¡ãã½+–r}6UOêj£º äö�R Viº¾a*¢JÂݲ×OrP%Å Yై‰5@팪b;H@2\" ö e�(PHÏzWp"Ú‰1ÅÕt8; ,ª++\Æc5Où4 ¨î¹÷t‚6BµÖ:4ÍUÊrv¥·þŽ(qU<ô- ’r>;Q„M‘'íÅø‹Àß<š_IÝϨÁ‰½õ ”älÖ §g–§–Ì(‰çÍ $›—ncof6Ó¥¦�„*»e§šÈ ‡BøÛ^Ã÷~h¹‘P:f5Qqú‰×ûSÀ�ÁØ–ݸº.3l º®QBTásFtœ f9ŠWP–yàE�kƒ§é :“'€&Omtº…z§ÅyÂLûÓX¶zñS>ŸN€™àžÕê¢;´iRe™¼U¤q/EnÒ~•Ûƒ@ƒ¡®ÀÒ¯Q†éíY-qL3q÷2k¹/Ù\ÂÜ A⹺wµfõ×»úqò&8¨9¤3,HÏâ²”ÁRäÑgÌ,4ÁUWP\÷ P@B2b`˜¬¨KF_oÿ�imŸP³/кüÕ†#góA°USX÷<ÐEs9'lR3’Ø) ?{xÈ€ªmƧE¨6#7XZ.ñÿ�V«Ç÷@ø€©`'#¿jn€£jiäÅ:&�µÈ,Ü/Š’@~àшPÄ-»däO4°öžü4Éh#z—}ÍûAàRÜcé ÜÔVP™$±¬@Ä’GŽiÒÜ ˆXüŸµMšÐ0VGe‰ §Gí¼íŽî€gä+Òu bãÜ00öÍy–ДËÒkpu'cñE܈n³ ˆ=¦‚v‘ͼdmÏ'íM‚Ì–2<Ó\!-„š_NB+¹ ïâª&–’àä/e¬ä'`+’&5°Êf"¢” *TòÝé€[i‚‚;±=éCûHTãs©7qbX[>æË€<�8fŲI“&g·j ¸¬GÚŽ0YV  ±üÐ U�€´P{¨ª2aæ±¶ 2y ÿ�5T[]?‚ÞL LÝì†3Åõ$Å�æîrú¨ ã; j95PñÐP�X2ìÁÖÿ�š¢ZœÜ3qÈÐ'ŠPÒ°ÛiÔR/¾{�{@Ы@HÐ�€9¡l*— ³@©¢Tæ€ÈfX ŸÅ!e)‚¤É¢2ϘXþi‚ª® ¹ï@ €„*dÄÁ1YP–Œ0,¾ßþÒÛ>¡f_¡uùª$# FÏæƒ`ª¦ ±îy ŠærN>ؤg%°R~öð)‘U 2ÛN‹PlG n°´2,]ãþ­V!îð)RÀ.NG~Ô ÝG:ÕÓÉŠtLkY¸_$€ýÁ£*¡ˆ[vÉÈ$žh aí=ùi’ÐFõ.û›öƒÀ¥¸ÇÓ @'¹¨¬ 02IcX‰$Ó¥¸@ ±ù?j›5 `¬ŽËANÛyÛÝ�ÏÈW¤êÅǸ`aíšó-¡)—¤ÖàêNÇ⋹!Ýf{Mí#›xÈÛžOÚ› ™,dy¦¸B[9?4¾œ„WrAÞ#ÅT#çýé™ñ´Ÿ[÷ð<ÑI,ØÉ ÌÖ²î&ãk]……@Úÿ�¥oÇî56b`lÏzir‚AT¾«" Wm šŠ)eTÞ{ ¢î]·’àP. DöŠÓ ±ßµŒY`ix§ Š�ˆkBh‚HHÝÚ¹ aìHù¤BC.91<)À" <Oz'lZ æbª3>M*ã™n@ì)Š§Ò¤ªù¥:IàŠ×ÜÁvsð)•àP'F¡bÅΦí˾¢€†Dîº.8±Ô½›„¤hD½T)õŽÉOïHKA”“ÿ�ƽ‰ýL|QÌ�·=¢€*i¸0 ÚvMf†¸�[‡‘ªÁ™î4ÈÑæƒÈ" óÅEb‘qT,À–,x™Àb!Œx§[aÜ<‘D2'Ý(#›%§3Ìê©eZÝ«aS'DÐÌ™÷4fú–}ǹ?ö %ýÝÉæuqö©ÙS\È‚ÿ�4ÞÕö)‰÷j˜ S”ƒö©JäB‘äÓ$ð~ kL=b#@’HàÐ9";…$½m®”7ƒ±w+Ø"µÇ¨ÿ�“Ú©aíÞéâÛ<¶ò{UC2~iY³.O�Õíô­Ô/­m–݆~þ+”•õ• y˜ p…QqNñž)’Ù¶ÅÜU¿ú0S Wžäö£%܄ɀÑ'QXHùÿ�zGf|m'Öýü4RK62Bó5¬†E{…I¸Ú×aU�[kþ•¿¸ÔÙˆe³=é¥Ê Pú¬ˆ%]´€@j(¥”ESxIì‚‹¹vÞJ@¸|Ú+L6Ç~Ô 1e¥âœ6( ­ ¢ " owh<懰I#æ‘ ¸äÄò@§�ˆ,@ñ=è°Yh'™Š¨Ìù4¨ Že¹°¦*ŸJ’«æ”é$€j+_sÙÏÀ¦Tt{@…‹:›·.úŠQºè¸âÇRönn‘¡>õP§Ö;%?½!-ROÿ�vö'õ1ñG0ÜöŠ�¨Y¦àÀ/iÙ5šànF«g¸Ó#Gš _ ˆ@'Ïå zk¡ñþôª2V·ù¬6ëò;Љ_“@×a”,kÄš/Ì·Qwö7¸&‹…Zá– FFPAÌÜÇÄÏÍbÁ-åŒjÍ4@�æ<SÁÀµEL°tlð¦±uAˆÛLÀ¬si&y¡g {, Î…Tf[h3¹»ŸµyAC}P8€<QãÜvÇVÔVžì@üE)arãd}‰ýÍ5ÆD·•Â1žõ%êºtLm«·»…S³üUEzêãžÅ¢“îg0&ºlÜ6Pý@ÔÜ`žÑ¡ÛŸø­Ð(·ÑÛS2HüÕ/ôëzÍÜ‹„a¶S¿ŠŠäk-iÀr¹8 TVËBÚÉš{¯ÓzcÒ{ŠàÁ,6µM–å„H ÌE¸—Êx…ÝP\.HìE:¥Å|Ø0@¢27KP'¨2v´ŠÖع‚{Õ³|Ôg�h#›ŽË‰h3$jª&ÖÂL9“Ú&ªŠ¨I ÃÉÿ�ŠLÍûzPÊ– nö¨¦¶NlÌ@@4w 6Ç“H¨¡±ÊLÖ ö’ í3U�s#=¼Ísu-ˆvlçÍX‹ Pß"…›#üý´f0ˆHÉ; ìézt鬄·„òìy5a À@g=éðL¾‚È6q¿[sŠOÚ§Zཆ½ÖÝ´×¢ª!Chy¨z^Í29HPÝ£µ2à#ÜïñEÞãtèÈš!qg_Õ2dèÍ3É�I�ЋŒÇ÷ºc7``Ä-鮇ÇûÒ¨ÉXvßæ°Û¯Èï@\DB%~M]†P±¯h¿2ÜEEߨÞàš.k†XUA3s?5‹·”1¨4ÐI�@˜ñL�Õ=2À=ѳšÅÕ#m3±Í¦™æ…œ-ì°/:Q™m Îæî~Õæ õ@â�ñGqÛuZwQZ{±ñ¥…Ë‘ö'÷4×ÞWÆ{Ô—ªéÑ1¶®ÞîNÏñUè_¨{Œz{ŠO¹œÀšé³pØ=Cõ�?Sq‚{F‡n|â·@¢ßGl]LÉ#óT¿Ó­ë7r.†ÙNþ*+‘¬µ§Èfäàt)Q[- j&iî¿MéIî+ƒ°ÙþÕ4[–"ƒ1â_)âtApH¹#±ê—ó`ÁˆÈLÝ-@€®†RE–ÐS6;Lï‚«¡À’ÖYmHb9"(³ªçy’ʶ v5º—¯Ùb—vÉ£Øk:«¿æoK¢˜¶œƒó^½¤(\˜SÅZ5RÓ+z1þeÚH$à(_[–m²ƒpÿ�×Ô«¢‹ÖQUË„%‡c@td]ÿ�2ר¦íö¥W+YºÍqU{Þ™Pl, kÞ6M` $“ϰq…P`Is•"¯¯r ‹k·oø¢ìò¶Óë}@ÿ�z£'§dZ¶|f~j¢ii.uÖí²M´L‚ù5é…L ŸÛ^xÈ>b;šê^¨fŒØ1Vœjjã©lŒ^^æ ~£ÅsõÝEGÓ´÷0òßÕRê:‡½qò:èWÆæ†äïñL¬…€¹2 íX7ëfAã·jı8Àv©ººbààn‚¦ŽÔ…”!ð5×3Œ»Ð¶ªí‘�"ð<šRT´— èUmo6cŒìÚµ§Å7ošV`·¸|мdÇf"‰Ç†MÑJ9 ûUb9“³=¨-rÖ¡¼)¬`)0&55—‚<5‹É“@]ÔD˜=kp—äl?© -rZ‚ñD†¸RPpuUMÕ#£ú`Ìlÿ�Ås¢ÂÄkÅ mô‡²Í7¦ʆk’½¼ÔV@5½HΪ 1€<Ö£Ûž$P"Ú–LGv (¬Iv©Í,”<˜¢ 2+9lˆÚŠ>Âp�ÇÇ÷ @WC)"ŽKh�©›À¦wÁUÐàIk,¶¤1‘ÙÕs¼Ée[P; šÝK×ì±Kމ;dÑì 5„Ußó7¥ÑL[NAù¯^Ò.L)ˆâ­Gš©i•½ÿ�2í$p/­Ë ¶ÙA¸ŠëêUÑEë(ªåÂñ :2.ÿ�™kÎìÓvûR«•¬Ýf‡¸ª½ÀïL¨6µï&°’IçŠX8ÂÀ¨0$¹Ê‘W×¹EµÛ·üQvy[iõ¾ ½Q“Ó²-[>3?5Q4´—:ëvÙ&Ú&A|šôÂǦ‚Oí¯<d1ƒÍu/T3Fl«N55qÔ¶F//s?Qâ¹úî¢Ç£éÚ{˜yoê©uCÞ¸ùt+ŒãsCrwø¦aVBŒ‚á@\™ö¬õ³ ñÛµbXˆ `;TÝ]1p p7AFÓ?ÇjBÊøŠkˆÆ]è[UvÈ€xM+IbAŽÕ.­™zk€I$ö“NÁUí*Éw1$ÏÞ‹ôÊêPÝxî*£Ð±h[²ª–ʨ™ÿ�Š=Mô²è–ÓP$±ú«t×SÓ¶n¹8ˆû×7YÔ‹×u¿¢‡QÔ5ô�·±xSæê.9¶„ʬÍI933�Åm ²{nƒUŽšÚ<‘X!k˜-âNöSJ"‚�ˆñZÛ³µÃ¨� U@EôٰĘå½ãd~ X2vkd¹Xk´ÿ�ÅEe8.þ£ªh<ïŸ4-¦Sq´ÎÏM¿|,ˆñª¸úÀmšœULš ¤S%˶¸ s$€W™ŸŠ¨$ÒÝI´ÛN¨²�ßQb<ö¢g)‘‚ ÙÜ'0inam@v�×z á,âI8’8¬¿©vZEµò;ÕAŒÊ-™"gæ•­»îT(ùª¡öÜx2Ú”¨, ØÌêŒÓì9¤iôÙ¾5ÿ�åme"Ú©‰&(º $Ü‘@Eµ,ð1 2…)%’vÜÖÀ”PͰ$ÈúPÛö¡ˆ}@’Wdˆ‘î|GX<)<šÙO¸ñ@eTƒlßT%¸•æf‰pÒ«ûH+£ôˆíU¯N ´Á#_z|Éæ“‰öK‘üÕHhC⢕Ifo�G¶æ„šÀmšbÞØ V’ăª][2ô×�’Hí&&‚«ÚU’îbIŸ½é•Ô¡ºñÜUG¡bзeU-•P#3ÿ�z›éeÑ-¦ IcõVé®§§lÝrq÷®n³©®ë~E£¨kèobð§ÍÔ\sm •Yš’rffŠ Úd öÝ>«5´y"°B×0[Ä즔Eâµ·gk‡P�ª€‹é³a‰1Ë+{ÆÈü °dìÖÉs °×iÿ�ŠŠÊp]ýGTÐyß>h[L¦ãižþ(›~øY'ãT qõ€Û588*ª˜4H>¦K—mq@æI�¯3?PI¥º“i¶8Qd¾¢ÄyíDÎS"*+³¸N"`ÒÜÂÚ€$ì®ôÂYÄ’q$qYRì´‹käwª†°ˆnƒx ëNLDOsA*\‘î'‰â)ÔBv™QJ¤™}(åh”B/;$Ñ@Ø–h¶ªl@Ñ$·a@@UB˜<‘²híT@ŸÌÓ�@ÜÐP(>Aø “–k-솟«’"¸cÀ(­arFºû¬×B¶ýÌ{&rV:ÜQHRˆnæ(ª2²N‚óÍ5±é£»!Mh@ì’qóA¤ÈÀ’DÍ1}ož` þõƒ¸ê£ˆ�€4$RìÞ]N¨­¶d¸n>*_ó‘=ò¥´'“³@J;´gm7Ç53iñkÎÇ“ª¶ÔÂÆûòiDYLŒfO}TSçnÂB! NäÔкÛ÷!bL’;U’wpóK‰iÌPášÀ“¨ÝhŸ·j`c‘àhT´A ìrÑïA>™&Ic j¯‚}GCš@¯#µ¶Ð7sN•æ s²ŽÑ^òbmÛì#gtÀ�1…âO4ÅËí‰ûT‹aÊ$UCúVä˜ànРð(9:Æ8ÙñQº.ÿ�•oLÃs‘íö °!ÜAr#u€%d¿öÝV×øwOg¥7©’¬µÉÙ®{6îÜ›LîY¦()€.ZN¸ÿ�ß4ºÊ&´À‰™>*a²¶² ‘À梪„ãäO4 +¶Õ@Y?šÎ]ä�#Hƒµb˜&!'ûÕF°ˆnƒx ëNLDOsA*\‘î'‰â)ÔBv™QJ¤™}(åh”B/;$Ñ@Ø–h¶ªl@Ñ$·a@@UB˜<‘²híT@ŸÌÓ�@ÜÐP(>Aø “–k-솟«’"¸cÀ(­arFºû¬×B¶ýÌ{&rV:ÜQHRˆnæ(ª2²N‚óÍ5±é£»!Mh@ì’qóA¤ÈÀ’DÍ1}ož` þõƒ¸ê£ˆ�€4$RìÞ]N¨­¶d¸n>*_ó‘=ò¥´'“³@J;´gm7Ç53iñkÎÇ“ª¶ÔÂÆûòiDYLŒfO}TSçnÂB! NäÔкÛ÷!bL’;U’wpóK‰iÌPúÀPKr@£Š¸ Àñ:¬Êp¶Åf}Ü“MŠªª)àwóA;Œmâ¡ò-À#tm#(w{xp o\ºÒÞŸ´Õ™—fw'@ð*¡S6‚Š[„…ÖÉÐÞ™½úøæ™Y\‘­ÅE(¶UàÃTJ£2ûDòiƒŒ¤Œˆ46Ò ¾{UF ŽˆÌV ®Å‰“æf˜*:I“HM¶1ˆgGu×5l"“‘ïFB¨äî¦0Ŷ8Ñ&ÃGbüPJj&fh† ’vbŒp5Å!*ºÐ1¶êù\ƒÚ“CÑR}G$’t<R¸ýÆ8àö§Rw­PvcbŠÃâ"•¹¿i¬¶•¶Tèj€ –%ÐcTù@1ÜH-bCxmÖ+qÿ�9žêf€œÝù2|žg‡bŠ£RhX p•Yâ°¸.g‰ÚT0¶0NûLÑs€$AŠC؈05¨¬-©ÄŸù¨¦x‘êQuÊE±îfÁ{óYn3Þ fÓ](�’РÕÓ§ê¯_·êÛK6‘Ã"MTYz+ÂǦýK±hÉLA¬ÎÏwü½åd’"·É®¶qŒŸh®{ïvÏQnáAm•‚|ÿ�ïÚ¢¹™O1Ìòhf-Û0�?ØV¸áÎmqƒÄTÖÚ¸V»t‹\ãÆT‰ÎNɉ¦“‘<wÝlØßp)+®@%T rE_¬·$ 8«€ÌªÌ¡W lVgÝÉ4تª¢ž4¸ÆÞ*"Ü7FÒ2‡w·‡@¡a&õË­-éû@àMP)™vgrtª3`H ˆ¥¸H]lé›ß¯Ži‘e•ÉÜTR‹aUQž�ì5Aª3/´O&˜8ÊHȃCm!@ËçµT`ÁèˆÅ`ªìX™>fi‚   d™Ù4„Ûc€ftwQMsVÂ)9ôd*ˆþNêc [c€M2l4v Å�4¦¢ffH`É'f)ØÇ\R«©Ýn¯•È0= y4='ÔrI'CÅ+ÜcŽjqµ'zÕ�'f6'ø¬>")[;öšËi[eN†¨ "-ëy1bF÷ÁŠÊT¡TŸ3DA&hýè°}¶×CB(µaR5õ–ëÁ™ãÅkŒVÑ`Ô§„~ $À$p?4PY˜ÌƒÇÛÿ�f˜ÈPƒTÌÇ!ˆäÆ©`" >hYsm4IÑOdžIïX’ ýõ?zP$   Í(ÆÕ²@˜˜?ì+*’Ç™žÔQ2Äi~4V�.C\=»D*# @1£X¶™;k"’2mРF̬ï@S}‘–§SNÅ·1æ²Ê Pù"a@€;Áaˆ˜‰¦¸ø.õ޳΢•ÈM‚ *¡‰…bÍÞ?µZÕ¯FÑ%}íÍdìíãɬßTO ÌöšÌÊöÐH*ˆš, !Çj¨À¬¢¶'S·¨LÊâ>ÔÁ‚#Ç“Am»ì±EøïQZiîK*¬O>ß!mL ïDœl(ˆüÐSü:×§Òª²êûÉ®ä·vâŸMr?ÿ�Íyëuìÿ�¤åOž&ŠuC†7±aÀíA×zòtÀ-xŸ©¸Âì÷ådž¸Ñšåî±2-§÷4 MÉøˆ %3yk„�VÆÑ}¦DZˆÔIf ƒ9KjGj�qÄp¤ž8¦xJ)ÜLÎéAuv¢"~‚Ìyn(õ¼˜±#{àÅe*P„*O™¢ “4~ôX¾Ûk¡¡ „Z°©úËõ`ÌñâµÆ+h°jS‹B?P`8š ¨,ÌfAãíÿ�³Ld(AªfcÄrcT°H‹4,¹¶š $Æè§²O$÷¬IþúŸ½(’Ðf”cjÙ ÌLö•IcÌÏj(™b4¿Hš�«�!®Ý€¢† Ѭ[L‰‡5‘I6„hP#fVw )¾ÈËS©§bÛˆ˜óYeP(|ˆ° @à°ÄLDÓ\|zïYçQJä&ÁPƒD±fïÚ­j×£h’¾öæ²HvvqäÖoª'ŠŠQm D‚9èa#q +*;¢‘zÚñ4Ŧp ½Â9'B椑!w«{رPÌI�ûè³[µl„¶¡GÍ"!täI<ŽT$ßšY>¨hÐð|Ó lŒ‹F¤T€{¢æ(Äv×4 ùTQúž|Q •¡KH§Âylém¸Uw$‰¨¦"G¿4©îd€vEL¹ C1Ôÿ�H¦€‹€2;‘ÞY $É=«¶â3Yø4Àçp€£»V”M•´'UDýkYR#‰¢ŠB@X±ã˜§®X"A™8¦$ërBÁ¨©“ K„ö¥Ð¸dŒˆÖ©Þ1`Nˆ¢ÙpË›ŽMTDL‹î~)‚©oÏŠ%²%ýFQ"™-¢Ã³³ß<šŠÐP Ä\ˆŽ(žÃ@E/¦z––g[}ãST´¨€ùËÀª€ª-¡ˆÉŒ–¥ïpª¸Dìš* ¨„‡$÷¢EÁ‘V¶$~ê7U ›`Ð {ÐU-yZàTê»§ÔkŠ :ÔƒD!7@`5²{~(1`v¿ØÖ²0±™úݤ}«Næ[®åͰP‹b"7"¢Œ¾1—�Ð ˆ²rf�V ®ÀÁ$O€œîo~ÕP¨e½5'€HÝîq§��ñTf÷ËÚ †õþ±’ÈXE–g˜ ¨U27è?½‚)÷7ö¦fôWõ]Û‰?ù¬«mos9ùŸÅ� ‹hb$ÈïCÙYQÝ‹ÖÐG‰ –-3€]îÉ:ŠsRH;Õ½ìX¨f$€}ôY­Ú¶B[P£æ‘ºr$žGª NïÍ,ŸT4hx>iƒ…¶FE£R*@=Ñsb;kš|‹*(ýO>(„ÊáP¥€ˆ$S„ ‚a<¶t„6‚Ü*»’DÔS £ßšT÷²@;"¦\!˜ê¤S@EÀÈï@ˆG¬�’džÕÛq¬ü`s¸@@ÑÝ«J&ÊÚƪ¢~µ¬ƒ)ÄÑE! ,XñÌS‚×, ̉Su¹!`ÔTÉ…%‡B{Rè\2FDkTï°'DQ ‰l¸eÍÇ&ª ¢&EŽw?ŒÁT·çÅÙþ£(L–ÑaÙÙ‚ïžME!G*@u&cŠe·mT,HÉæ€~(EÅ9#Q@ fëlŸµ=ËÊ! …Ȭ¶ò-î#(š2¨!Ió@¶Ý ÂV0 Áý­n` 9ÆÀÉÐ ™ºÑ¢� [—{KHâ¨ýBÎôOŠKކâ[µp+³�Ì[`WEë-›ŽY- H’[ïÞªb¡‚ÌDI;&¤Q˜ÀEQäŠ(Äté’º“î9ôàqãɨ C*•WsÄÒª"�c7™,DÁ Ì¶Üì@ù¦Æ@rÅLh ¦@] LQ‘X‚÷îdP’É,<ÿ�ȱP ÐøB&æ Z õP& ˜<ÓûÜcÅ1#Sßâ¤?SÙ$ÀÞµTlf4cÍ'Ð…TnH rŦ8ì)D ÔsF%x"Gsº�ðèqàÀì�©Â— žcš¦Á5Í*¶�³0#tåÄr?Šbà3*¸ÍJÒÿ�˜k÷ ð©n€Ú'æŸÐ{BÒÝ%²Þ*œ}ê FGÀâœ6"ñ €Hó½Ö�¡,@-ò8¨¦FÈ<R›ym V0“3Û° C\’D[‰ È2PÊí5º{ÂÏQ饦¼ä{À×4¾­—ê­®#„"j¿á9‹w.-¶g¸Æ r<î´Ê¹t×z«—º«KmBª0ŸãïHöå‹úAŸl=v¯N.Y¸—,—%¢cÛ\­w¦==¤Vf¸ šËHr¤Q2f8¦[vÕBÄÌžhâ€$Y S‘"5�¦n¶À1ÉûSܼ¢QÜŠËo"Þâ2‰£*‚‘4 mÐÜ!c ЬÚÙæ�£œl�<˜Ý�™›­ ¹y´¹Ž êÔ!\ïDø¤¸èn%»W»0 Ŷt^±rÙ¸áÕ’ÐÔ‰%¾ýê &*,ÄD“²jEŒUH¢ŒGN™+©>ãïN<šŠ2©UpX÷<M*¢ 3y’ÄL À[mÎÄšld,TÆ€ êdÒÈÕiˆ/q¾æE !Œ’ÃÈñLQK�@„ R`þiÑÂ�E¢Q¥b`yƒÍ?½À&<Pã5=þ*Cõ=’L ëUFÆcF<Ò}UA†äŠÈ‚X¹Ðâ™U÷¬Ç�qSÄþ¡Æw—z.$ÌDŠ ;æ üTÐ  d|v YäXA'½asAX�y4Á LšÖ¹~òô¶!È|SÞP–YËûTdAø®Ïð«>—Kê”&õïv^*¡¬†ôÝ=„F´­se‹{ˆûÒ]éìtß­îeµ-胯üWeç·ÓÚqÎMû@šæ¿~Ût—{‚ ŠÑÔu-«ÑÒ³µÍqmÛàAä×jõXÚÀ&O„5È@W Úy ÂÕÁp*ʾ;šhrI =èC!ÉýÇ9•æg(Çš ÒÞÐ3X:4™Ÿš6P ³cŠÒË h46ÕPº1:Á¦H�d{ ED†nÇÁ¢H˜ù¨¬å‚Ù:óX¸E‘; P®n-Ç� “Oƒ‘îÖZxª…úB¨2Õ‘1�·#°ÿ�µ>H’¨ÒÝÏ1HÓýŽê(3b]î0…H¤é:TêɽԶ(L­¿#É¥¼¢ëZéÆÃ¹ÈÏaÍ{im-ZKP›m?¶«.uèºc­€ʯïRK¾‡T-[¶nÜpX3 éký-¶9\xñ ½C¿SnèDÁS�³Ú£Nr—Q¦ê(ù~(`K ¸š·UuQv¯Ü)©aseTžIæƒ2)e§ø+éþaº{$•W>à§;U ••Âߎi€+ðPÊý꣰t=´ :{p8öƒULÚÖ²Z*kÕ$MÅyð Nç_qÕÒÊâ&�^MF—¿y:Nšå¶½“±¦¼äŘ0P£ˆÇtUBuÎH=šY’wÏzˆÌˆ%‹)•PzÌp<Aêgyw¢âLÉÔ@øª(wñS@0‘ñÚd ‘aLžô…Í`äÐ-2jwZåûËÒØ@‡ qñOyBYg/íQ‘â»?¬ú]/ªP›×½Ùxª†±þÓtöҵ͖-î#ïIw§±Ó~·¹–Ô·¢¿ñ]—žßOh=Ç97íkšýûmÒ\\}î,j*wGQÔ¶¬[D?JÎÔW5Å·lJ“]«Õck�™>X×!\\'jt9æƒ WÀ\«*øîi¡É$€ ÷¡ ‡'÷ä W™œ Ohl/K{@Í`èÒd~h`Ù@2ÌyŽ)ÿ�K,- ÐÛUBèÄè˜} ‘ì)»‰ c梳–gdëÍbáDHì)B¹¸·�‚@M>G»Yh âª-剃<ÖÂæ^ëe{ŒZgñMmË-ÇHUŸ'¼Pfh ÔPÐÄÚõ#Œ´9õg¶ª; Ù'G½H€’ÀÆØŠ¨Ïe]Š»–V½.’_¥¶%Dk…¹ŸT°ó¨ o�€bÇúvh:úÛ`² º¯cûMs\`Ph99ù¤ ~á•°@=ØÇö A[%ÛǸ:ž*)½÷>cE© lFÜÉâ™ÉÍH2æ'À4æ§l—£<¹:+^%m9Æ·LätöU@÷üš”QI™ ŒJ)Ðù »Û ƒÁÚr?Š»=ÛÖú{.© ’Þ?[ ô–ÔÞpÀ˜9©-Æ7’ÏMmn:ÉbÜ]·.Û»ÕYÚ!‚wUã¶ ÉËƒÍ <˜åÿ�ÇÅ]ÑÜzçFÚ¤î*€2'B¢²«2cnÒö˜¬RÞ‹9b7£ýâ…²}Ïí÷HŸ™=ósxðsó@m*-ëW[;“æ½1 ú¬à~ªòðp¡Äò *ûΉòhã¼îX悳¸75,÷4‹$‰âx5FЊˆ¶¤“ÃËPg11ø4 ±ˆ1Þ‹LSöª€ˆ.ÀÉ:í ™> Pˤvu9"t4OdÛ|Ä‹iíÙí®õ†,èHçâŠ"˜Ù=Ϫ1K¶Ö2R{οŠXuö2OôäÄž>k)!8‚wÄTPd yb`Ï5°¹—ºÙ^ã™üS[rËqÒggÉïšÈ4�[CkÔŽ2ÐçÔvžÚ¨ì+dLõ FKb*£=•v*îYXD ôºI~–Ú@•A®æ}RÃ΢¼�V‹éÙ ëëm‚È‚èb½í5Íq€U@} äçæ5û†VÁ�÷cÚl—lKàêx¨¦÷Üú@U¦@-±r7'Šg$h?5 ˘Ÿ�ÐSš²\zŒòäèx­x•´äsÝ3‘ÓÙUÜòhQDe&vf‚1(H§Cæ‚ïl6SiÈ@8þ("ì÷o[é캤‚KxüUnƒÒ[SyÃ`椷ÞK=5µ¸ë%‹pvÜh»nïUd h„B ÝTsŒZØ+'.40Lòc—ÿ�wGqëœj“¸¨�È Š,énØ·°[©«—æ>ÂªŠŠ¹bÞuAžà¶¡@‰&;P"©ô˜1P@ˆð*‰"I<®¢—Ó,CL~ŸšGéÿ�ÌuInããk¡ÜÕF·ƒ Ž-±ÁªS)wü §êzfé¬ÚµÓZv ?Wæ¤Èöî0¸XÜb¢š}ØhäI¥KVñ¬ÁГ³6> dOšƒlË@#š�Ku Ëh€?{öHDH #šÀŸE@*K 11A…»s¶ ÄêˆÀËæY  v, �V�‡m–ÁPó ÉÇäö®fêl(—Û]»*“?o£\[}:é PÌ;ë-€ª¶­°KK¨A Ô?á‡;—®eFŒIÖ€¯ImäRAPǽrÝ«CñI~àéÖÊçý5p«Y³eíàK‚}Ìg½@ v Ó•BÊ$åªwöª!| ¬¤eÇÔ r1ã½ óŽÜS¤¢›…1v³3ª(* ‰ #±=èåÁb'KS�IrÎNɱ‚K¸yø T—n�ÞŒÖfU"u:¬�~(¢ ½[HÒ/šRI2I3â²17)’ÚŠÀb§Oo­Œ`L±ç½{€(µi3¸tk J‡+ä;!Ò´áÑqžýÍ*!yÙ€LÕBÉ+�…cÇÚŸ#&Êc*& РÀ±¸ÅGQ@ÚBÀ‚û'¸¬Qša¤0ˆ=«I6t&¶d‘ ÆäЍ,énØ·°[©«—æ>ÂªŠŠ¹bÞuAžà¶¡@‰&;TR*ŸIƒ¨’$“Êê)}2Ä1dÇáyù¤~ŸüÇT–î>6±:ÍTkx0¸âÐ`¨õ2—|; ~§¦nšÍ«]5§`Óõp>jLnã …À&*)§ÝˆöŽDšTµošÌ 0+0#cêDù H6Ì´9 ·P̶ˆ÷¿aT„@D€ ’9¬ ôT x°Ó[·;b�ÜN¨Œ ¾e˜÷ñJbÊ`vÐlU2 œ~Ojæn¦Áb‰qµÛ²©3ñ1Fú5Å·Ó®• ðñ^²Ø «jÛ´º„ÍAÃþs¹zàFThÄh ô–ÞE$ {Ñ -Ú´?—î`®q?ÓQ§ µ›6^Þ¸'ÜÆ{Ôb ÐÙÝ9T, òNZ§qoj¢ÀªÊX»éÖ¹–Ý`·mæå­É×< v!m®+�;ÔzŒmÙw$·üÔUX’˜È˜ÜR[{ª iµ¶.9“Z:‹ªnž‘aŒ‰p¦+§¡±q÷¹Ü#KûG‰ªŠdëxº^=EИTñ\îÖÞ×®¯qîð̇šõz{NÁ˜ÀÅxaÿ�Ú¼ÁuÖze6Ŷ’qÖ¦¢¥é ÇrO�›À*Ûq͹“le5Å�\ÙÇÕ(UQ�ƒuÜë|QƒÞµÄK\r} óAƒ(8éî°½¾ô3,˜Êg[ª;„¶GÞ‘W�äÓ‘Ž8º €=È=ªÖ:¯M$ “ÆÏGPÁî)vÜ(â›@sÜÍŸ¬ºW °SûGšæ$“=·C1ëÔ$÷Ûfi_—ñUŠM²àmާŠV¦Dÿ�Óºgp-¬dDkÒ5Ì' Aíê(=чý±TqéY�$Ö·mî÷ÕØ3ê å Ï ÄóU ‰ŠfvÀ"”qðS¯ÜÞ*`›ìBŽÝ?…‡»ÔOy­ZP=¨cŸ&‚ªg3ˆîh¹« æLE ¶ÅŽ­,•»s‘1âkYó æN¾(6*<˜¬ 7±X sOšÚÛ>É“É'“A-’œ ’EIv oæ+ DóLÌbkâ7S 3¦LA“QL°WÚitÏ„äØö¦! >aI˜ƒÚƒ*ÙéÊ›–=ÍT5¨[ ¡?÷ K’�“ð(Œ[ÙÃf{ŠP™)9·ÜÏ?jŠ»éÖ¹–Ý`·mæå­É×< v!m®+�;ÔzŒmÙw$·üÐU‰)Œ‰Å%°÷º –˜Û[`ã™5£¨º¦ééÈ— bºz_{‘Â4¿´xš¨¦N·‹¥ãÔ] €õOÎímízê÷ï Àhy¯W§´ìŒ W†ý«Ì]g¦Sl[i'jj*^ Üw$ð�ì)°|­°GÐk™0ÆPc\P�…Íœ}Q€…Uðh0']ηÅØ=ë\@TµÇ GÒ42ƒŽžá; ÛïAÃ2ÉŒ¦uº£±HKaTxéqM9àP‹ È܃ڭcªôÒJ <lñQTu â—mÂŽ)°D=ÌÐYúË¥pË?´y®bI3Ût3°]HOqA-¶f•ùPè¤Û.Øêx¥i dOý;¦wÚÆDF¹Ý#\ÂrÑÞ¢™¶ð�íÞ¡Ô¨{Jè81ç{®„'…Ùþk*CNF š¨ô‚‹¬Î¾Ûc‚Üš£„A$•FÔ÷5À½Uà°ªF‡Š•ë¯pÎXž7ÅHµÓÔõÃf׶ߟÝ\6Ðvã‚Kq>)íà¶A ÃÉmîƒ>¶™þõP f� ú{Ñ(¸É^ò>ôÃPHÊ>)L´â<ø¨¥À9Õ²XžAYíÛE_VåÂIúTóT̘ÅŽbiQQ=Øï·z¨æ|,î¨ò2P¤Š*¨P\dR[ÊöûÑy$Nñ⢂(Y$“q»v•ˆE-?Þ¶6Ën\8šÆÒ}^³¦wºoômÉc“ ŒÑ´ŠÜ{y1<·ŠM;’¤°_Š¡KŽL¬5½P¯qÐâ`ö¥°5_Ô?¸™¤[=KtÉt2æäâ„D ¬¡Eç²H/É�HïUIpI9æh,úsÚháí€ÐO$ Fd´Œå‚¨å›‘iBÁKez›½C„)l/´’'~)S©|¥Ó^aÌâ?ä×_Afå»n€¬î^'.õåæQqÚ%—\Tî„Ôÿ�2nÜ{�8ûWu¬¯�2B†|Wu�t"ÊÛS÷w¨©1ITªD F§æ³bÙ'˜S†Ú c1.fƒx&w1@'´–O`)‹Æ‚’#°¢$dý¢ªij�Oon襋EŒ‚�ùÙ¥´F;$’IŸÍ1_vY“<ÍE8d™ÀGoµ#31>Õ¸ãuŽ=þO4¶ð�íÞ¡Ô¨{Jè81ç{®„'…Ùþk*CNF š¨ô‚‹¬Î¾Ûc‚Üš£„A$•FÔ÷5À½Uà°ªF‡Š•ë¯pÎXž7ÅHµÓÔõÃf׶ߟÝ\6Ðvã‚Kq>)íà¶A ÃÉmîƒ>¶™þõP f� ú{Ñ(¸É^ò>ôÃPHÊ>)L´â<ø¨¥À9Õ²XžAYíÛE_VåÂIúTóT̘ÅŽbiQQ=Øï·z¨æ|,î¨ò2P¤Š*¨P\dR[ÊöûÑy$Nñ⢂(Y$“q»v•ˆE-?Þ¶6Ën\8šÆÒ}^³¦wºoômÉc“ ŒÑ´ŠÜ{y1<·ŠM;’¤°_Š¡KŽL¬5½P¯qÐâ`ö¥°5_Ô?¸™¤[=KtÉt2æäâ„D ¬¡Eç²H/É�HïUP…Ü÷¥w-¨“P!QCƒºÊ¢²µÌf3Tÿ�“@ÊŽë‘!Wÿ�wH#d+]c¡@|Õ\¡ !Gj[èâ‡SÀïA’Ù�©'#ãµDÙ~ÜP/€(¼ óÉ¥ôÜúŒH;ÐPÈAŽFÍ`Z vyjpél€ž|Ð’Nê)I¹væ6öcm:Z`B«±&Zy¬€¸t/µì?wæ‹Yic &cUq?¨µ<� )mÛ‹¢ã6À «ªå1Qd%N4gL)À–c‘h¥u gžP¸:~³©2xdñF×A{¨Qwª|Wœ$Àÿ�½5‹g¨ÿ�E3éôè ž í^ª#»F•&Y›ÅZGôVí'é]¸4:ì *õØnžÕ’×Ã7s&»’ý•Ì-ÀÄ+›§{Vo]{¿¨÷"cŠƒ z‡ÜtjFÚ¿UÒÛ>à\öÿ�EtõoníÑsÓE�§Z©‚ìÏé®*?UGªÈálb¿õRºª.w :Ë÷W%¾²ôD&‡1Q{—z‹Ì ã÷MHµÑw¨wµn8^Z¹æè lóâ)ñ–$ûˆÔÏ5‚¢œˆ“þÔ âZ|S¯?ÿ�4€!-+ÉíªV¤Ä( \Ãĉæ„1Y% wâi•-ú›A€‘³LU]¶ax� XÒ-¡ãã½+–r}6UOêj£º äö�R Viº¾a*¢JÂݲ×OrP%Å Yై‰5@팪b;H@2\" ö e�(PHÏzWp"Ú‰1ÅÕt8; ,ª++\Æc5Où4 ¨î¹÷t‚6BµÖ:4ÍUÊrv¥·þŽ(qU<ô- ’r>;Q„M‘'íÅø‹Àß<š_IÝϨÁ‰½õ ”älÖ §g–§–Ì(‰çÍ $›—ncof6Ó¥¦�„*»e§šÈ ‡BøÛ^Ã÷~h¹‘P:f5Qqú‰×ûSÀ�ÁØ–ݸº.3l º®QBTásFtœ f9ŠWP–yàE�kƒ§é :“'€&Omtº…z§ÅyÂLûÓX¶zñS>ŸN€™àžÕê¢;´iRe™¼U¤q/EnÒ~•Ûƒ@ƒ¡®ÀÒ¯Q†éíY-qL3q÷2k¹/Ù\ÂÜ A⹺wµfõ×»úqò&8¨9¤3,HÏâ²”ÁRäÑgÌ,4ÁUWP\÷ P@B2b`˜¬¨KF_oÿ�imŸP³/кüÕ†#góA°USX÷<ÐEs9'lR3’Ø) ?{xÈ€ªmƧE¨6#7XZ.ñÿ�V«Ç÷@ø€©`'#¿jn€£jiäÅ:&�µÈ,Ü/Š’@~àшPÄ-»däO4°öžü4Éh#z—}ÍûAàRÜcé ÜÔVP™$±¬@Ä’GŽiÒÜ ˆXüŸµMšÐ0VGe‰ §Gí¼íŽî€gä+Òu bãÜ00öÍy–ДËÒkpu'cñE܈n³ ˆ=¦‚v‘ͼdmÏ'íM‚Ì–2<Ó\!-„š_NB+¹ ïâª&–’àä/e¬ä'`+’&5°Êf"¢” *TòÝé€[i‚‚;±=éCûHTãs©7qbX[>æË€<�8fŲI“&g·j ¸¬GÚŽ0YV  ±üÐ U�€´P{¨ª2aæ±¶ 2y ÿ�5T[]?‚ÞL LÝì†3Åõ$Å�æîrú¨ ã; j95PñÐP�X2ìÁÖÿ�š¢ZœÜ3qÈÐ'ŠPÒ°ÛiÔR/¾{�{@Ы@HÐ�€9¡l*— ³@©¢Tæ€ÈfX ŸÅ!e)‚¤É¢2ϘXþi‚ª® ¹ï@ €„*dÄÁ1YP–Œ0,¾ßþÒÛ>¡f_¡uùª$# FÏæƒ`ª¦ ±îy ŠærN>ؤg%°R~öð)‘U 2ÛN‹PlG n°´2,]ãþ­V!îð)RÀ.NG~Ô ÝG:ÕÓÉŠtLkY¸_$€ýÁ£*¡ˆ[vÉÈ$žh aí=ùi’ÐFõ.û›öƒÀ¥¸ÇÓ @'¹¨¬ 02IcX‰$Ó¥¸@ ±ù?j›5 `¬ŽËANÛyÛÝ�ÏÈW¤êÅǸ`aíšó-¡)—¤ÖàêNÇ⋹!Ýf{Mí#›xÈÛžOÚ› ™,dy¦¸B[9?4¾œ„WrAÞ#ÅTÿÙ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/infobar.rb�����������������������������������������������0000644�0001750�0001750�00000005721�12137115065�020417� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2013 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # =begin = Info bar Info bar widgets are used to report important messages to the user. =end require 'common' module Demo class InfoBar < BasicWindow def initialize super('Info Bars') self.border_width = 8 vbox = Gtk::Box.new :vertical self.add vbox bar = Gtk::InfoBar.new vbox.pack_start bar, :expand => false, :fill => false, :padding => 0 bar.message_type = :info label = Gtk::Label.new 'This is an info bar with message type GTK_MESSAGE_INFO' bar.content_area.pack_start label, :expand => false, :fill => false, :padding => 0 bar = Gtk::InfoBar.new vbox.pack_start bar, :expand => false, :fill => false, :padding => 0 bar.message_type = :warning label = Gtk::Label.new 'This is an info bar with message type GTK_MESSAGE_WARNING' bar.content_area.pack_start label, :expand => false, :fill => false, :padding => 0 bar = Gtk::InfoBar.new [:ok, :ok] bar.signal_connect(:response) {|widget, response_id| on_bar_response widget, response_id} vbox.pack_start bar, :expand => false, :fill => false, :padding => 0 bar.message_type = :question label = Gtk::Label.new 'This is an info bar with message type GTK_MESSAGE_QUESTION' bar.content_area.pack_start label, :expand => false, :fill => false, :padding => 0 bar = Gtk::InfoBar.new vbox.pack_start bar, :expand => false, :fill => false, :padding => 0 bar.message_type = :error label = Gtk::Label.new 'This is an info bar with message type GTK_MESSAGE_ERROR' bar.content_area.pack_start label, :expand => false, :fill => false, :padding => 0 bar = Gtk::InfoBar.new vbox.pack_start bar, :expand => false, :fill => false, :padding => 0 bar.message_type = :other label = Gtk::Label.new 'This is an info bar with message type GTK_MESSAGE_OTHER' bar.content_area.pack_start label, :expand => false, :fill => false, :padding => 0 frame = Gtk::Frame.new 'Info bars' vbox.pack_start frame, :expand => false, :fill => false, :padding => 8 vbox2 = Gtk::Box.new :vertical, 8 vbox2.border_width = 8 frame.add vbox2 # Standard message dialog label = Gtk::Label.new 'An example of different info bars' vbox2.pack_start label, :expand => false, :fill => false, :padding => 0 end def on_bar_response info_bar, response_id dialog = Gtk::MessageDialog.new :parent => self, :flags => [:modal, :destroy_with_parent], :type => :info, :buttons_type => :ok, :message => 'You clicked a button on an info bar' dialog.set_secondary_text "Your response has id %d" % response_id dialog.signal_connect(:response) {dialog.destroy} dialog.show_all end end end�����������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/editable_cells.rb����������������������������������������0000644�0001750�0001750�00000010504�12137115065�021725� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: editable_cells.rb,v 1.7 2005/02/06 18:25:13 kzys Exp $ =begin = Tree View/Editable Cells This demo demonstrates the use of editable cells in a Gtk::TreeView. If you're new to the Gtk::TreeView widgets and associates, look into the Gtk::ListStore example first. =end require 'common' module Demo class EditableCells < BasicWindow Item = Struct.new('Item', :number, :product, :editable) COLUMN_NUMBER, COLUMN_PRODUCT, COLUMN_EDITABLE, NUM_COLUMNS = *(0..4).to_a def initialize super('Shopping list') self.border_width = 5 vbox = Gtk::VBox.new(false, 5) add(vbox) vbox.pack_start(Gtk::Label.new('Shopping list (you can edit the cells!)'), :expand => false, :fill => false, :padding => 0) sw = Gtk::ScrolledWindow.new sw.shadow_type = Gtk::SHADOW_ETCHED_IN sw.set_policy(:automatic, :automatic) vbox.pack_start(sw, :expand => true, :fill => true, :padding => 0) # create model model = create_model # create tree view treeview = Gtk::TreeView.new(model) treeview.rules_hint = true treeview.selection.mode = Gtk::SELECTION_SINGLE add_columns(treeview) sw.add(treeview) # some buttons hbox = Gtk::Box.new(:horizontal, 4) hbox.homogeneous = true vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) button = Gtk::Button.new('Add item') button.signal_connect('clicked') do add_item(model) end hbox.pack_start(button, :expand => true, :fill => true, :padding => 0) button = Gtk::Button.new('Remove item') button.signal_connect('clicked') do remove_item(treeview) end hbox.pack_start(button, :expand => true, :fill => true, :padding => 0) set_default_size(320, 200) end def create_model # create array @articles = [] add_items # create list store model = Gtk::ListStore.new(Integer, String, TrueClass) # add items @articles.each do |article| iter = model.append article.each_with_index do |value, index| iter.set_value(index, value) end end return model end def add_items item = Item.new(3, 'bottles of coke', true) @articles.push(item) item = Item.new(5, 'packages of noodles', true) @articles.push(item) item = Item.new(2, 'packages of chocolate chip cookies', true) @articles.push(item) item = Item.new(1, 'can vanilla ice cream', true) @articles.push(item) item = Item.new(6, 'eggs', true) @articles.push(item) end def add_columns(treeview) model = treeview.model # number column renderer = Gtk::CellRendererText.new renderer.signal_connect('edited') do |*args| cell_edited(*args.push(model)) end treeview.insert_column(-1, 'Number', renderer, { :text => COLUMN_NUMBER, :editable => COLUMN_EDITABLE, }) def renderer.column COLUMN_NUMBER end # product column renderer = Gtk::CellRendererText.new renderer.signal_connect('edited') do |*args| cell_edited(*args.push(model)) end def renderer.column COLUMN_PRODUCT end treeview.insert_column(-1, 'Product', renderer, { :text => COLUMN_PRODUCT, :editable => COLUMN_EDITABLE, }) end def cell_edited(cell, path_string, new_text, model) path = Gtk::TreePath.new(path_string) column = cell.column iter = model.get_iter(path) case column when COLUMN_NUMBER i = iter.path.indices[0] @articles[i].number = new_text.to_i iter.set_value(column, @articles[i].number) when COLUMN_PRODUCT i = iter.path.indices[0] @articles[i].product = new_text iter.set_value(column, @articles[i].product) end end def add_item(model) foo = Item.new(0, 'Description here', true) @articles.concat([foo]) iter = model.append foo.each_with_index do |value, index| iter.set_value(index, value) end end def remove_item(treeview) model = treeview.model selection = treeview.selection if iter = selection.selected @articles.delete_at(iter.path.indices[0]) model.remove(iter) end end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/main.rb��������������������������������������������������0000755�0001750�0001750�00000023307�12257552170�017733� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/env ruby =begin main.rb - Main class of gtk-demo. Copyright (c) 2003-2013 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: main.rb,v 1.20 2007/07/09 13:21:54 ggc Exp $ =end require 'gtk3' $:.unshift(File.dirname(__FILE__)) module Demo class Main < Gtk::Window TITLE_COLUMN, FILENAME_COLUMN, CLASS_COLUMN, ITALIC_COLUMN = 0, 1, 2, 3 def initialize super() @current_file = nil @info_buffer = Gtk::TextBuffer.new @source_buffer = Gtk::TextBuffer.new set_title('Ruby/GTK+ Code Demos') signal_connect('destroy') do Gtk.main_quit end signal_connect("key_press_event") do |widget, event| if event.state.control_mask? and event.keyval == Gdk::Keyval::GDK_KEY_q destroy true else false end end hbox = Gtk::Box.new(:horizontal) add(hbox) tree = create_tree scrolled_window = Gtk::ScrolledWindow.new scrolled_window.set_policy :never, :automatic scrolled_window.add(tree) hbox.pack_start(scrolled_window, :expand => false, :fill => false, :padding => 0) notebook = Gtk::Notebook.new hbox.pack_start(notebook, :expand => true, :fill => true, :padding => 0) notebook.append_page(create_text(@info_buffer, false), Gtk::Label.new('_Info', true)) notebook.append_page(create_text(@source_buffer, true), Gtk::Label.new('_Source', true)) @info_buffer.create_tag('title', {'font' => 'Sans 18'}) @source_buffer.create_tag('comment', {'foreground' => 'red'}) @source_buffer.create_tag('const', {'foreground' => 'ForestGreen'}) @source_buffer.create_tag('string', { 'foreground' => 'RosyBrown', 'weight' => Pango::FontDescription::WEIGHT_BOLD }) @source_buffer.create_tag('reserved', {'foreground' => 'purple'}) end def script_info(path) title = nil klass = nil depend = nil file = File.open(path) file.each do |ln| if not title and ln =~ /^=\s+(.*)$/ title = $1 if title =~ /^(.*)\((.+?)\)$/ title = $1 depend = $2 end elsif not klass and ln =~ /\s*class\s+([A-Z][A-Za-z0-9_]*)/ klass = $1 end if title and klass break end end if not klass raise "File not found: #{path}." end return title, klass.intern, depend end def generate_index # Target scripts scripts = Dir.glob(File.join(File.dirname(__FILE__), '*.rb')) # Generate index tree children = {} index = [] scripts.each do |script| next if ["common.rb", "main.rb"].include?(File.basename(script)) title, klass, depend = script_info(script) if depend and not Gtk.const_defined?(depend) next end if title =~ %r{^(.+?)/(.+)$} parent = $1 child = $2 unless children[parent] children[parent] = [] index += [[parent, nil, nil, []]] end children[parent] += [[child, script, klass]] else index += [[title, script, klass]] end end # Sort children children.each_key do |parent| children[parent].sort! do |a, b| a[0] <=> b[0] end end # Expand children index.collect! do |row| if row[3] row[3] = children[row[0]] end row end index.sort! do |a, b| a[0] <=> b[0] end index end def create_tree model = Gtk::TreeStore.new(String, String, String, TrueClass) tree_view = Gtk::TreeView.new tree_view.set_model(model) selection = tree_view.selection selection.set_mode(:browse) tree_view.set_size_request(200, -1) append_children(model, generate_index) cell = Gtk::CellRendererText.new cell.style = Pango::FontDescription::STYLE_ITALIC column = Gtk::TreeViewColumn.new("Widget (double click for demo)", cell, { 'text' => TITLE_COLUMN, 'style_set' => ITALIC_COLUMN, }) tree_view.append_column(column) selection.signal_connect('changed') do |selection| iter = selection.selected load_file(iter.get_value(FILENAME_COLUMN)) if iter end tree_view.signal_connect('row_activated') do |tree_view, path, column| row_activated_cb(tree_view.model, path) end tree_view.expand_all return tree_view end def append_children(model, source, parent = nil) source.each do |title, filename, klass, children| iter = model.append(parent) [title, filename, klass].each_with_index do |value, i| if value iter.set_value(i, value) end end iter.set_value(ITALIC_COLUMN, false) if children append_children(model, children, iter) end end end def row_activated_cb(model, path) iter = model.get_iter(path) iter.set_value(ITALIC_COLUMN, true) lib = iter.get_value(FILENAME_COLUMN) if lib require(lib) klass = Demo.const_get(iter.get_value(CLASS_COLUMN)) window = klass.new window.signal_connect('destroy') do iter.set_value(ITALIC_COLUMN, false) end window.show_all @window = window end end def create_text(buffer, is_source) scrolled_window = Gtk::ScrolledWindow.new scrolled_window.set_policy(:automatic, :automatic) scrolled_window.set_shadow_type(:in) text_view = Gtk::TextView.new text_view.set_buffer(buffer) text_view.set_editable(false) text_view.set_cursor_visible(false) scrolled_window.add(text_view) if is_source font_desc = Pango::FontDescription.new('Monospace 12') text_view.override_font(font_desc) text_view.set_wrap_mode(:none) else text_view.set_wrap_mode(:word) text_view.set_pixels_above_lines(2) text_view.set_pixels_below_lines(2) end return scrolled_window end def fontify(start_iter = @source_buffer.start_iter, end_iter = @source_buffer.end_iter) str = @source_buffer.get_text(start_iter, end_iter, true) tokenizer = RubyTokonizer.new tokenizer.tokenize(str, start_iter.offset) do |tag, start, last| @source_buffer.apply_tag(tag.to_s, @source_buffer.get_iter_at(:offset => start), @source_buffer.get_iter_at(:offset => last)) end end def load_file(filename) if filename == @current_file return end @info_buffer.delete(*@info_buffer.bounds) @source_buffer.delete(*@source_buffer.bounds) file = begin File.open(filename) rescue $stderr.puts "Cannot open: #{$!}" if $DEBUG return end start = @info_buffer.get_iter_at(:offset => 0) state = :before_header file.each do |line| case state when :before_header if line =~ /^=begin$/ state = :in_header end when :in_header if line =~ /^=end$/ state = :body start = @source_buffer.get_iter_at(:offset => 0) elsif line =~ /^=\s+(.*)$/ title = $1 title.gsub!(/\s*\(.*\)$/, '') # Delete depend field last = start @info_buffer.insert(last, title) start = last.clone start.backward_chars(title.length) @info_buffer.apply_tag('title', start, last) start = last else @info_buffer.insert(start, line) end when :body # Reading program body @source_buffer.insert(start, line) end end fontify @current_file = filename end end class RubyTokonizer RESERVED_WORDS = %w(begin end module class def if then else while unless do case when require yield) RESERVED_WORDS_PATTERN = Regexp.compile(/(^|\s+)(#{RESERVED_WORDS.collect do |pat| Regexp.quote(pat) end.join('|')})(\s+|$)/) def tokenize(str, index = 0) until str.empty? tag = nil case str when /".+?"/, /'.+?'/ tag = :string when /#.*$/ tag = :comment when RESERVED_WORDS_PATTERN tag = :reserved when /[A-Z][A-Za-z0-9_]+/ tag = :const end if tag tokenize($~.pre_match, index) do |*args| yield(*args) end yield(tag, index + $~.begin(0), index + $~.end(0)) index += (str.length - $~.post_match.length) str = $~.post_match else index += str.length str = '' end end end end end target = ARGV.shift if target Demo::INDEX.each do |title, filename, klass_symbol, children| if target == filename or target == klass_symbol.id2name require filename window = Demo.const_get(klass_symbol).new window.show_all class << window def quit Gtk.main_quit end end break end end else main = Demo::Main.new main.set_default_size(600, 400) main.show_all end Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/iconview.rb����������������������������������������������0000644�0001750�0001750�00000006756�12137115065�020633� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: iconview.rb,v 1.7 2007/08/05 15:41:31 mutoh Exp $ =begin = Icon View (IconView) The Gtk::IconView widget is used to display and manipulate icons. It uses a Gtk::TreeModel for data storage, so the list store example might be helpful. =end require 'common' module Demo class IconView < Demo::BasicWindow COL_PATH, COL_DISPLAY_NAME, COL_IS_DIR, COL_PIXBUF = (0..3).to_a def fill_store @store.clear Dir.glob(File.join(@parent, "*")).each do |path| is_dir = FileTest.directory?(path) iter = @store.append # set COL_DISPLAY_NAME first because changing an iter will trigger the # sort function; if we set something else first, the value of # COL_DISPLAY_NAME for this row will be "nil" and the sort function will fail #puts path #puts GLib.convert(GLib.filename_to_utf8(path), "Shift_JIS", "UTF-8") #puts File.basename(GLib.convert(GLib.filename_to_utf8(path), "Shift_JIS", "UTF-8")) # iter[COL_DISPLAY_NAME] = File.basename(GLib.filename_to_utf8(path)) iter[COL_DISPLAY_NAME] = GLib.filename_to_utf8(path) iter[COL_PATH] = path iter[COL_IS_DIR] = is_dir iter[COL_PIXBUF] = is_dir ? @folder_pixbuf : @file_pixbuf end end def initialize super('Gtk::IconView demo') @file_pixbuf = Gdk::Pixbuf.new(Demo.find_file("gnome-fs-regular.png")) @folder_pixbuf = Gdk::Pixbuf.new(Demo.find_file("gnome-fs-directory.png")) @store = Gtk::ListStore.new(String, String, TrueClass, Gdk::Pixbuf) @parent = "/" @store.set_default_sort_func do |a, b| if !a[COL_IS_DIR] and b[COL_IS_DIR] 1 elsif a[COL_IS_DIR] and !b[COL_IS_DIR] -1 else a[COL_DISPLAY_NAME] <=> b[COL_DISPLAY_NAME] end end @store.set_sort_column_id(Gtk::TreeSortable::DEFAULT_SORT_COLUMN_ID, Gtk::SortType::ASCENDING) fill_store set_default_size(650, 400) set_border_width(8) vbox = Gtk::Box.new(:vertical) add(vbox) toolbar = Gtk::Toolbar.new vbox.pack_start(toolbar, :expand => false, :fill => false, :padding => 0) up_button = Gtk::ToolButton.new(:stock_id => :go_up) up_button.important = true up_button.sensitive = false toolbar.insert(up_button, -1) up_button.signal_connect("clicked") do @parent = File.dirname(@parent) fill_store up_button.sensitive = @parent != "/" end home_button = Gtk::ToolButton.new(:stock_id => :home) home_button.important = true toolbar.insert(home_button, -1) home_button.signal_connect("clicked") do @parent = GLib.home_dir fill_store up_button.sensitive = true end sw = Gtk::ScrolledWindow.new sw.shadow_type = :etched_in sw.set_policy(:automatic, :automatic) vbox.pack_start(sw, :expand => true, :fill => true, :padding => 0) iconview = Gtk::IconView.new(@store) iconview.selection_mode = :multiple iconview.text_column = COL_DISPLAY_NAME iconview.pixbuf_column = COL_PIXBUF iconview.signal_connect("item_activated") do |iview, path| iter = @store.get_iter(path) if iter[COL_DISPLAY_NAME] @parent = iter[COL_PATH] fill_store up_button.sensitive = true end end sw.add(iconview) iconview.grab_focus end end end ������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/links.rb�������������������������������������������������0000644�0001750�0001750�00000003767�12137115065�020127� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2013 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # =begin = Links GtkLabel can show hyperlinks. The default action is to call gtk_show_uri() on their URI, but it is possible to override this with a custom handler. =end require 'common' module Demo class Links < BasicWindow def initialize super('Links') title = 'Links' border_width = 12 signal_connect(:destroy) {self.destroy} label = Gtk::Label.new "Some <a href=\"http://en.wikipedia.org/wiki/Text\"" + "title=\"plain text\">text</a> may be marked up\n" + "as hyperlinks, which can be clicked\n" + "or activated via <a href=\"keynav\">keynav</a>\n" + "and they work fine with other markup, like when\n" + "searching on <a href=\"http://www.google.com/\">" + "<span color=\"#0266C8\">G</span><span color=\"#F90101\">o</span>" + "<span color=\"#F2B50F\">o</span><span color=\"#0266C8\">g</span>" + "<span color=\"#00933B\">l</span><span color=\"#F90101\">e</span>" + "</a>." label.use_markup = true label.signal_connect(:activate_link) {|widget, uri| activate_link uri} add label label.show end def activate_link uri if uri == 'keynav' dialog = Gtk::MessageDialog.new :parent => self, :flags => :destroy_with_parent, :type => :info, :buttons_type => :ok dialog.markup = "The term <i>keynav</i> is a shorthand for " + "keyboard navigation and refers to the process of using " + "a program (exclusively) via keyboard input." dialog.present dialog.signal_connect(:response) {dialog.destroy} return true end false end end end���������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/stock_browser.rb�����������������������������������������0000644�0001750�0001750�00000015302�12142464343�021663� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: stock_browser.rb,v 1.5 2005/02/12 23:02:43 kzys Exp $ =begin = Stock Item and Icon Browser This source code for this demo doesn't demonstrate anything particularly useful in applications. The purpose of the 'demo' is just to provide a handy place to browse the available stock icons and stock items. =end require 'common' module Demo class StockBrowser < BasicWindow Item = Struct.new('Item', :stock_id, :label, :modifier, :keyval, :translation_domain) ItemInfo = Struct.new('ItemInfo', :id, :item, :small_icon, :const, :accel_str) ItemDisplay = Struct.new('ItemDisplay', :type_label, :const_label, :id_label, :label_accel_label, :icon_image) def initialize super('Stock Icons and Items') set_default_size(-1, 500) self.border_width = 8 hbox = Gtk::Box.new(:horizontal, 8) add(hbox) sw = Gtk::ScrolledWindow.new sw.set_policy(:never, :automatic) hbox.pack_start(sw, :expand => false, :fill => false, :padding => 0) model = create_model treeview = Gtk::TreeView.new(model) sw.add(treeview) column = Gtk::TreeViewColumn.new column.title = 'Const' cell_renderer = Gtk::CellRendererPixbuf.new column.pack_start(cell_renderer, :expand => false) column.set_attributes(cell_renderer, "stock_id" => 1) cell_renderer = Gtk::CellRendererText.new column.pack_start(cell_renderer, :expand => true) column.set_cell_data_func(cell_renderer) do |column, cell, model, iter| cell.text = iter[0].const end treeview.append_column(column) cell_renderer = Gtk::CellRendererText.new treeview.insert_column(-1, 'Label', cell_renderer) do |col, cell, model, iter| info = iter[0] cell.text = info.item.label if info end cell_renderer = Gtk::CellRendererText.new treeview.insert_column(-1, 'Accel', cell_renderer) do |col, cell, model, iter| info = iter[0] cell.text = info.accel_str if info end cell_renderer = Gtk::CellRendererText.new treeview.insert_column(-1, 'ID', cell_renderer) do |col, cell, model, iter| info = iter[0] cell.text = info.id if info end align = Gtk::Alignment.new(0.5, 0.0, 0.0, 0.0) hbox.pack_end(align, :expand => false, :fill => false, :padding => 0) frame = Gtk::Frame.new('Selected Item') align.add(frame) vbox = Gtk::Box.new(:vertical, 8) vbox.border_width = 4 frame.add(vbox) display = ItemDisplay.new class << treeview @display = nil attr_accessor :display end treeview.display = display display.type_label = Gtk::Label.new display.const_label = Gtk::Label.new display.id_label = Gtk::Label.new display.label_accel_label = Gtk::Label.new display.icon_image = Gtk::Image.new # empty image vbox.pack_start(display.type_label, :expand => false, :fill => false, :padding => 0) vbox.pack_start(display.icon_image, :expand => false, :fill => false, :padding => 0) vbox.pack_start(display.label_accel_label, :expand => false, :fill => false, :padding => 0) vbox.pack_start(display.const_label, :expand => false, :fill => false, :padding => 0) vbox.pack_start(display.id_label, :expand => false, :fill => false, :padding => 0) selection = treeview.selection selection.mode = :single selection.signal_connect('changed') do |s| selection_changed(s) end end def create_model store = Gtk::ListStore.new(ItemInfo, String, String, String) list_ids = Gtk::Stock.ids list_ids.sort! do |a, b| a.to_s <=> b.to_s end list_ids.each do |stock_id| info = ItemInfo.new info.id = stock_id begin info.item = Item.new(*Gtk::Stock.lookup(stock_id)) rescue ArgumentError info.item = Item.new end # only show icons for stock IDs that have default icons icon_set = Gtk::IconFactory.lookup_default(info.id.to_s) if icon_set # See what sizes this stock icon really exists at sizes = icon_set.sizes # Use menu size if it exists, otherwise first size found size = sizes.find do |s| s == :menu end || sizes.first info.small_icon = render_icon_pixbuf(info.id, size) unless size == :menu # Make the result the proper size for our thumbnail w, h = Gtk::IconSize.lookup(size) scaled = info.small_icon.scale(w, h, Gdk::Pixbuf::INTERP_BILINEAR) info.small_icon = scaled end else info.small_icon = nil end if info.item.keyval info.accel_str = Gtk::Accelerator.to_name(info.item.keyval, info.item.modifier) else info.accel_str = '' end info.const = id_to_const(info.id) iter = store.append iter[0] = info iter[1] = info.id end return store end def selection_changed(selection) treeview = selection.tree_view display = treeview.display iter = selection.selected info = iter[0] display.type_label.label = if info.small_icon and info.item.label 'Icon and Item' elsif info.small_icon 'Icon Only' elsif info.item.label 'Item Only' else '???????' end display.const_label.label = info.const display.id_label.label = info.id if info.item.label str = "%s %s" % [info.item.label, info.accel_str] display.label_accel_label.set_text(str, true) else display.label_accel_label.set_text('') end if info.small_icon display.icon_image.set_from_stock(info.id, get_largest_size(info.id)) else display.icon_image.pixbuf = nil end end def get_largest_size(symbol) set = Gtk::IconFactory.lookup_default(symbol.id2name) best_size = :invalid best_pixels = 0 sizes = set.sizes sizes.collect! do |i| width, height = Gtk::IconSize.lookup(i) [i, width * height] end return (sizes.max do |a, b| a[1] <=> b[1] end)[0] end def id_to_const(id) const = '' s = id.id2name if s =~ /^gtk-/ const += 'Gtk::Stock::' s[0,4] = '' end const += s.upcase.gsub(/-/, '_') const end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/panes.rb�������������������������������������������������0000644�0001750�0001750�00000007605�12137115065�020110� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: panes.rb,v 1.5 2005/02/12 23:06:07 kzys Exp $ =begin = Paned Widgets The Gtk::HPaned and Gtk::VPaned Widgets divide their content area into two panes with a divider in between that the user can adjust. A separate child is placed into each pane. There are a number of options that can be set for each pane. This test contains both a horizontal (HPaned) and a vertical (VPaned) widget, and allows you to adjust the options for each side of each widget. =end require 'common' module Demo class Panes < BasicWindow def initialize super('Panes') self.border_width = 0 vbox = Gtk::VBox.new(false, 0) add(vbox) vpaned = Gtk::VPaned.new vbox.pack_start(vpaned, :expand => true, :fill => true, :padding => 0) vpaned.border_width = 5 hpaned = Gtk::HPaned.new vpaned.add1(hpaned) frame = Gtk::Frame.new frame.shadow_type = :in frame.set_size_request(60, 60) hpaned.add1(frame) button = Gtk::Button.new('_Hi there', true) frame.add(button) frame = Gtk::Frame.new frame.shadow_type = :in frame.set_size_request(80, 60) hpaned.add2(frame) frame = Gtk::Frame.new frame.shadow_type = :in frame.set_size_request(60, 80) vpaned.add2(frame) # Now create toggle buttons to control sizing vbox.pack_start(create_pane_options(hpaned, 'Horizontal', 'Left', 'Right'), :expand => false, :fill => false, :padding => 0) vbox.pack_start(create_pane_options(vpaned, 'Vertical', 'Top', 'Bottom'), :expand => false, :fill => false, :padding => 0) end def create_pane_options(paned, frame_label, label1, label2) frame = Gtk::Frame.new(frame_label) frame.border_width = 4 table = Gtk::Table.new(3, 2, true) frame.add(table) label = Gtk::Label.new(label1) table.attach_defaults(label, 0, 1, 0, 1) check_button = Gtk::CheckButton.new('_Resize', true) table.attach_defaults(check_button, 0, 1, 1, 2) check_button.signal_connect('toggled') do toggle_resize(paned.child1) end check_button = Gtk::CheckButton.new('_Shrink', true) table.attach_defaults(check_button, 0, 1, 2, 3) check_button.active = true check_button.signal_connect('toggled') do toggle_shrink(paned.child1) end label = Gtk::Label.new(label2) table.attach_defaults(label, 1, 2, 0, 1) check_button = Gtk::CheckButton.new('_Resize') table.attach_defaults(check_button, 1, 2, 1, 2) check_button.active = true check_button.signal_connect('toggled') do toggle_resize(paned.child2) end check_button = Gtk::CheckButton.new('_Shrink') table.attach_defaults(check_button, 1, 2, 2, 3) check_button.active = true check_button.signal_connect('toggled') do toggle_shrink(paned.child2) end return frame end def toggle_resize(child) paned = child.parent is_child1 = (child == paned.child1) resize = if is_child1 paned.child1_resize? else paned.child2_resize? end shrink = if is_child1 paned.child1_shrink? else paned.child2_shrink? end child.parent.remove(child) if is_child1 paned.pack1(child, !resize, shrink) else paned.pack2(child, !resize, shrink) end end def toggle_shrink(child) paned = child.parent is_child1 = (child == paned.child1) resize = if is_child1 paned.child1_resize? else paned.child2_resize? end shrink = if is_child1 paned.child1_shrink? else paned.child2_shrink? end child.parent.remove(child) if is_child1 paned.pack1(child, resize, !shrink) else paned.pack2(child, resize, !shrink) end end end end ���������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-long-lines.rb��������������������������������������0000644�0001750�0001750�00000001635�11701304107�022132� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-long-lines.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Long Lines This demo shows how to use GDK and cairo to show long lines. From http://cairographics.org/samples/xxx_long_liens.html. =end require 'common' module Demo class CairoLongLines < CairoWindow def initialize super('cairo long lines') end def draw(cr) cr.move_to(0.1, -50) cr.line_to(0.1, 50) cr.set_source_rgba(1, 0, 0) cr.stroke cr.move_to(0.2, -60) cr.line_to(0.2, 60) cr.set_source_rgba(1, 1, 0) cr.stroke cr.move_to(0.3, -70) cr.line_to(0.3, 70) cr.set_source_rgba(0, 1, 0) cr.stroke cr.move_to(0.4, -80) cr.line_to(0.4, 80) cr.set_source_rgba(0, 0, 1) cr.stroke end end end ���������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-pattern-fill.rb������������������������������������0000644�0001750�0001750�00000003705�11701304107�022464� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-pattern-fill.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Pattern Fill This demo shows how to use GDK and cairo to fill by pattern. From http://cairographics.org/samples/pattern_fill.html. =end require 'common' module Demo class CairoPatternFill < CairoWindow X_FUZZ = 0.08 Y_FUZZ = 0.08 X_INNER_RADIUS = 0.3 Y_INNER_RADIUS = 0.2 X_OUTER_RADIUS = 0.45 Y_OUTER_RADIUS = 0.35 SPIKES = 10 TEXT = "Ruby!" def initialize super('cairo pattern fill') end def draw(cr) srand(45) cr.set_line_width(0.01) x = y = nil 0.step(SPIKES * 2 - 1, 2) do |i| x = x_position(i, X_INNER_RADIUS) y = y_position(i, Y_INNER_RADIUS) if (i == 0) cr.move_to(x, y) else cr.line_to(x, y) end i += 1 x = x_position(i, X_OUTER_RADIUS) y = y_position(i, Y_OUTER_RADIUS) cr.line_to(x, y) end cr.close_path cr.stroke cr.select_font_face("Sans", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_BOLD) cr.move_to(x - 0.5, y) cr.set_font_size(0.1) cr.text_path(TEXT) cr.set_source_rgba(1, 0, 0.5) cr.fill cr.set_font_size(0.2) extents = cr.text_extents(TEXT) x = 0.5 - (extents.width / 2 + extents.x_bearing) y = 0.5 - (extents.height / 2 + extents.y_bearing) cr.move_to(x, y) cr.text_path(TEXT) cr.set_source_rgba(1, 0, 0) cr.stroke end def x_position(i, radius) 0.5 + Math.cos(Math::PI * i / SPIKES) * radius + rand * X_FUZZ end def y_position(i, radius) 0.5 + Math.sin(Math::PI * i / SPIKES) * radius + rand * Y_FUZZ end end end �����������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-clip-image.rb��������������������������������������0000644�0001750�0001750�00000002315�11701304107�022066� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-clip-image.rb,v 1.2 2005/10/16 12:07:32 mutoh Exp $ =begin = cairo/Clip Image This demo shows how to use GDK and cairo to use clip for image. From http://cairographics.org/samples/clip_image.html. =end require 'common' module Demo class CairoClipImage < CairoWindow def initialize super('cairo clip image') end def draw(cr) cr.save do cr.arc(0.5, 0.5, 0.4, 0, 2 * Math::PI) cr.clip cr.new_path loader = Gdk::PixbufLoader.new File.open("background.jpg", "rb") do |f| loader.last_write(f.read) end pixbuf = loader.pixbuf cr.scale(1.0 / pixbuf.width, 1.0 / pixbuf.height) cr.set_source_pixbuf(pixbuf, 0, 0) cr.paint end cr.save do cr.arc(0.5, 0.5, 0.3, 0, 2 * Math::PI) cr.clip cr.new_path image = Cairo::ImageSurface.from_png("ruby-gnome2-logo.png") cr.scale(1.0 / image.width, 1.0 / image.height) cr.set_source(image, 0, 0) cr.paint end end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/gnome-fs-regular.png�������������������������������������0000644�0001750�0001750�00000003403�11701304107�022316� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���4���Ì“»‘���bKGD������ùC»��¸IDATxÚÕšKoWDZCÚ4³Ð*HtEÊ¢,‚RBÃ+ÚO€Ô]Yõ#ðP%XtQ‰Hx4< ‚À’MT‰v”‡`ÄĵöÜÓ…3ž;wî±SPÒ+dß¹w|ÿó?çÌ5Àw€,„«»»ûéúõëúN`u ¹wïžè£P(È|Œb±(cccrôèQ_©õÀ{@*VܺuKDDfffÞŠ@J©†®r¹,ÅbQ¦¦¦dttÔWâ“8%R¼ƒ!"ˆHÃû*• ="“ɰyóf._¾ ð�X´Ùä Mlݺu^×G¹\ ££ƒ-[¶044Dkk«S‰Ð—Û·oÏ‹àþ~abb�¥™L†M›6qòä :::¬J¤æÃâºÀú~…çy58yžGww77~ÊñãÇM85ÍBsÜ&0ˆ¡ ”J%¦¦¦¸sçccc\½z•R©Ä† Ýœ:u à{`©O±Í&„â”hDh÷Úª ¶y_¡#GŽP,Q¾¡Y±¢‹={ö| ü�€Jó¦žu.Ã÷D¥„¾¾>–/_N.—£Xü‡\îããã�œ8qÂ߸dF…¦Ù<zl¡P ½½=Qp×ýF¬_]+³Ÿ!•JQ©T�˜žžæáäÓiòù<££·8vìÀ.à`ÒÊB.Œ»‚ÏÄrTè�ãzÀ*¥jó"Uæñ¼Êìž* õô|ÆôtžÞÞ/éééñ·7ùš“,÷6¬`”Š*¨”ªy�šŒ5Áý¶¶¶ÈS›u¶mÛ¦YEæ„å8Œ›Êxž2Œ¢´õ¾ðÕ¸(fhnnv—"Âèè(©TÊbéÏd’�2Ë&Á=ÏSšð¢Á‰Ð_‰+W.ÓÞþÕtÍ67×ïѬEÄšæ½@ý{ô·õ}I9'¡íÛ¿¨eÂ$,»•±1²qÀ>veOîÞýù|ž„jT¸yóétºXDï)U½|·ûÐð</4_UFÕ TÝ«4…dûb###tvv&yÀ&˜Ýʦ‹MÏ„ÝîòŒ2<ý]_9ýwcb@رcårÙ¢ VX$c\‡¢D(Øe°€F«óýý{xñb*B"pãÆ -Z “1tXøÌ\ÊÈ´>ÌD›W³óÕDX<xÖÅ‹Éd>Lö€Ý2,\kƒ‹ù“I‚5¶¬ޝº $;wîä͛׆2Ñø.Nf´`Â%¬¨X!+"ìÝ»çÏŸ%AH¸~ý:--­šûUH€*Ó(“H„I|hDÆ¥°bºg.\8ϲeËŠ^õ@ÃÆ$f€Û˜M÷€ÉLÅ&@H)¡··—R©T³Š¿Ñ,®¢Êˆ5ù…ƒÜF™6Á%ÂBû÷ —›LNd×®ýÆâÅ‹5H ±B8i™î×á\žÆLññ«N³Zsç†éêZ™ÄzpÚù\êêõBÌ^'‰³Ä¶C’zXH±k×. …£$p?Ôœ”k’³÷qµUUŽxò$!¥ô²ÕUÛç}fr1IØâRc³°ðbíÞDÃÃgYµjM2 éÖò» [ÿj«ƒ\Lb&-[IaÖWîJ !úúv“ÏOÐgwe+äìl$k KýYbbâqR"S\º4Bgç’cø–ðk•(Yæþðš(Da©¯:ÃêÕk“šhÛhòr´­´¹ßÖ¸»˜%êMkÕ!€þþ~^¾|Q³F”“ÅÑ™¹ß8؊ðÁÄ)´/Ç¡Cƒd³'×B##¿²tiFK(n&ÑÝï×6îîMBJ†ë&Sè(„Ξ=Ú5%çàýŒ$ZÛäñ¨«%¶s‹ë«yµŠpÙên)MеCg9n[÷úrpð0'CÈ/[£Ü«×*ÊÊ"ÑžXOnQ|“b"àÌ™_X»v]r°¥ñzP›ÔóvÛž’Ï!B™xß¾ýärO-Ör»}®‚ÛâŵopðkÆÇÿJnêÏŸ?GW× ë›ã(LpÙzh˸[X™Ó§fݺ“=”Ó$0†;‰¹--uŸ34rêȘœœpÔþâÌØs=Ù©WðÇ¿I†ÃÃC¬\¹Ú€L´·¹¿‘à‹Â.~}]rõ©IïeÞ…Å)€û÷ïÂÀÀ!ž<ÉZš”xú{Û¯#55… ”Íf혜œdff†±±ßgON<Òé4 eܽû'Ùl–W¯^YoÁü_¨ÎëG`Õû´Ú÷9ð>ТŸ�.À!Àkà)0áŸCõè¾Hÿð€P*MZ0/dÁmŠ(€¶Cžú@e����IEND®B`‚�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/floppybuddy.gif������������������������������������������0000644�0001750�0001750�00000012140�11701304107�021464� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89aP�F�÷€����  !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~�ãã‚‚‚ƒƒƒ„„„………†††‡‡‡ˆˆˆ‰‰‰ŠŠŠ‹‹‹ŒŒŒŽŽŽ‘‘‘’’’“““”””•••–––———˜˜˜™™™ššš›››œœœžžžŸŸŸ   ¡¡¡¢¢¢£££¤¤¤¥¥¥¦¦¦ÿ��¨¨¨ÿÿ=v{ÿ«««¬¬¬­­­®®®¯¯¯°°°±±±²²²³³³´´´µµµ¶¶¶···¸¸¸¹¹¹ººº»»»¼¼¼½½½¾¾¾¿¿¿¸ÂÙÁÁÁÂÂÂÃÃÃÄÄÄÅÅÅÆÆÆÇÇÇÈÈÈÉÉÉÊÊÊËËËÌÌÌÍÍÍÎÎÎÏÏÏÐÐÐÑÑÑÒÒÒÓÓÓÔÔÔÕÕÕÖÖÖ×××ØØØÙÙÙÚÚÚÛÛÛÜÜÜÝÝÝÞÞÞßßßàààáááâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿ!ÿ NETSCAPE2.0è�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó¦H� ‹þŠ2hJ§2rD)@*0£.µšª©O®[µvDÙ•@ª³Xsjjõé×¶lÅ6$æÙ«wÓÒ5¨”mW¯)»ÆÝ9- ½Í¢Í{ø,ÒEgúu8ìÎÇ Ó5|’®b¼‹Œ¼ô­S¯C£J%ˆx3è«|C¿f ™´ÐÛ¸Ic¨¹qhº»q}vmÛB—N­•êÀÏÐóþ-½8çª(U/g»ysêûÖ_þ9¼qáÙµã^?¸9yó³ßï‹>²döëí§¾|pÞó§_Mª6Ó~ÏÁ‡ÖÏ•‡vé(á„Þ„`‚.ä}õ W!*IøØ…¾õçІ£9gßNÀ´èâ‹À�ðÇúAÈškhq¨áƒ®8SŒ)ÁãŒ5ÚHg¡f>�$JBÊH£L:×àƒmÜh:‰QIeŠô!I‘–6 $˜0JY$dH¢X‘™'u¹¦“mŠ©Ah긑š*…9åž|j’šB¾è昉aéÑ€x&Úbˆ„âÄåe1aJ„Yzi… véiŠš–J¢§¦¦:*©”©¸êA*=äÒ«°žª­´ç®¹ê𔕽ò,B¼k$±ÃKªO9Ūl}<ëWL%‹*QÉMËÖi¯.WÚ~H¡†šS•;R¸Âáçìvç‘®»Õ¶;îm_2xn~)Á.÷ïµÉåkn¼2zk0Áõê À.9,oÄ[.ºÏf¬ñÆwìñÇ#�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó&΃EE4eS™Fž„ª@ªTL}ZÅ 4©TƒI»bÍš’ëPª �vèX¢(ÍúDËÀÕµj7)Ö©V«U©¨{×nªµ÷*ýÛ4ëYºóR{÷êáœ5Á*ʹ³âÁ ãµ,š�h‚q ¶|PJ¨|…’]üx'ÊФsW¾Z÷êË_Sí¬•øÞ™­'[Ö}˜uä«[[Eì%ìØÄ_Où|9s¬ûÏ¥.PøðìÚasÇí½¹sƒ†ÛSW¹½¦ýú¼Æo8yèý’•gÞuhà`ë ´ŸwÔ%¤V€"h röY·]„ìÉ—Öƒ¨ñvÜNÀ„(âˆÀ�ðÇÇ–àd”‘Ö`]&øáL%¦Db‰'¦\~ rуx™vÚŒ�ÔˆÒ&¢x!†ÿAjµFd("™ã’6èãDP¾8%JU’˜¤Ž¨q¤E[¢V`‘`)æ•êÁ×eH_Úø¦’qÊy&[kÞx'™¥éQŠGú)"}y~åš`1Uh!…;)ZÞ„”NèNŽfê’¤šv*i„Ú÷éI+¤Ҩšñhꥄ¨–Š«¨Vk‡³Žêjª±*t뎵¶Ê¬›æ*+Od!UÜ_½’D–lÆvÕ§²5†`u]Ñ6”kØŽ4­µ²¡è-·M¡œ²Ôf—Ò·Žyfb²«’¸¢˜nWâJ5ï¹Ó¢æвµù•cøÂ$¯Kì~͵n›­° 7ìðÃG,±T�!þ’This GIF file was assembled by CDavis with GIF Construction Set from: Alchemy Mindworks Inc. P.O. Box 500 Beeton, Ontario L0G 1A0 CANADA. �!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó¦H� ‹þŠ2hJ§2rD)@*0£.µšª©O®[µvDÙ•@ª³Xsjjõé×¶lÅ6$æÙ«wÓÒ5¨”mW¯)»ÆÝ9- ½Í¢Í{ø,ÒEgúu8ìÎÇ Ó5|’®b¼‹Œ¼ô­S¯C£J%ˆx3è«|C¿f ™´ÐÛ¸Ic¨¹qhº»q}vmÛB—N­•êÀÏÐóþ-½8çª(U/g»ysêûÖ_þ9¼qáÙµã^?¸9yó³ßï‹>²döëí§¾|pÞó§_Mª6Ó~ÏÁ‡ÖÏ•‡vé(á„Þ„`‚.ä}õ W!*IøØ…¾õçІ£9gßNÀ´èâ‹À�ðÇúAÈškhq¨áƒ®8SŒ)ÁãŒ5ÚHg¡f>�$JBÊH£L:×àƒmÜh:‰QIeŠô!I‘–6 $˜0JY$dH¢X‘™'u¹¦“mŠ©Ah긑š*…9åž|j’šB¾è昉aéÑ€x&Úbˆ„âÄåe1aJ„Yzi… véiŠš–J¢§¦¦:*©”©¸êA*=äÒ«°žª­´ç®¹ê𔕽ò,B¼k$±ÃKªO9Ūl}<ëWL%‹*QÉMËÖi¯.WÚ~H¡†šS•;R¸Âáçìvç‘®»Õ¶;îm_2xn~)Á.÷ïµÉåkn¼2zk0Áõê À.9,oÄ[.ºÏf¬ñÆwìñÇ#�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó&΃EE4eS™Fž„ª@ªTL}ZÅ 4©TƒI»bÍš’ëPª �vèX¢(ÍúDËÀÕµj7)Ö©V«U©¨{×nªµ÷*ýÛ4ëYºóR{÷êáœ5Á*ʹ³âÁ ãµ,š�h‚q ¶|PJ¨|…’]üx'ÊФsW¾Z÷êË_Sí¬•øÞ™­'[Ö}˜uä«[[Eì%ìØÄ_Où|9s¬ûÏ¥.PøðìÚasÇí½¹sƒ†ÛSW¹½¦ýú¼Æo8yèý’•gÞuhà`ë ´ŸwÔ%¤V€"h röY·]„ìÉ—Öƒ¨ñvÜNÀ„(âˆÀ�ðÇÇ–àd”‘Ö`]&øáL%¦Db‰'¦\~ rуx™vÚŒ�ÔˆÒ&¢x!†ÿAjµFd("™ã’6èãDP¾8%JU’˜¤Ž¨q¤E[¢V`‘`)æ•êÁ×eH_Úø¦’qÊy&[kÞx'™¥éQŠGú)"}y~åš`1Uh!…;)ZÞ„”NèNŽfê’¤šv*i„Ú÷éI+¤Ҩšñhꥄ¨–Š«¨Vk‡³Žêjª±*t뎵¶Ê¬›æ*+Od!UÜ_½’D–lÆvÕ§²5†`u]Ñ6”kØŽ4­µ²¡è-·M¡œ²Ôf—Ò·Žyfb²«’¸¢˜nWâJ5ï¹Ó¢æвµù•cøÂ$¯Kì~͵n›­° 7ìðÃG,±T�!þThis space for rent...�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó¦H� ‹þŠ2hJ§2rD)@*0£.µšª©O®[µvDÙ•@ª³Xsjjõé×¶lÅ6$æÙ«wÓÒ5¨”mW¯)»ÆÝ9- ½Í¢Í{ø,ÒEgúu8ìÎÇ Ó5|’®b¼‹Œ¼ô­S¯C£J%ˆx3è«|C¿f ™´ÐÛ¸Ic¨¹qhº»q}vmÛB—N­•êÀÏÐóþ-½8çª(U/g»ysêûÖ_þ9¼qáÙµã^?¸9yó³ßï‹>²döëí§¾|pÞó§_Mª6Ó~ÏÁ‡ÖÏ•‡vé(á„Þ„`‚.ä}õ W!*IøØ…¾õçІ£9gßNÀ´èâ‹À�ðÇúAÈškhq¨áƒ®8SŒ)ÁãŒ5ÚHg¡f>�$JBÊH£L:×àƒmÜh:‰QIeŠô!I‘–6 $˜0JY$dH¢X‘™'u¹¦“mŠ©Ah긑š*…9åž|j’šB¾è昉aéÑ€x&Úbˆ„âÄåe1aJ„Yzi… véiŠš–J¢§¦¦:*©”©¸êA*=äÒ«°žª­´ç®¹ê𔕽ò,B¼k$±ÃKªO9Ūl}<ëWL%‹*QÉMËÖi¯.WÚ~H¡†šS•;R¸Âáçìvç‘®»Õ¶;îm_2xn~)Á.÷ïµÉåkn¼2zk0Áõê À.9,oÄ[.ºÏf¬ñÆwìñÇ#�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó&΃EE4eS™Fž„ª@ªTL}ZÅ 4©TƒI»bÍš’ëPª �vèX¢(ÍúDËÀÕµj7)Ö©V«U©¨{×nªµ÷*ýÛ4ëYºóR{÷êáœ5Á*ʹ³âÁ ãµ,š�h‚q ¶|PJ¨|…’]üx'ÊФsW¾Z÷êË_Sí¬•øÞ™­'[Ö}˜uä«[[Eì%ìØÄ_Où|9s¬ûÏ¥.PøðìÚasÇí½¹sƒ†ÛSW¹½¦ýú¼Æo8yèý’•gÞuhà`ë ´ŸwÔ%¤V€"h röY·]„ìÉ—Öƒ¨ñvÜNÀ„(âˆÀ�ðÇÇ–àd”‘Ö`]&øáL%¦Db‰'¦\~ rуx™vÚŒ�ÔˆÒ&¢x!†ÿAjµFd("™ã’6èãDP¾8%JU’˜¤Ž¨q¤E[¢V`‘`)æ•êÁ×eH_Úø¦’qÊy&[kÞx'™¥éQŠGú)"}y~åš`1Uh!…;)ZÞ„”NèNŽfê’¤šv*i„Ú÷éI+¤Ҩšñhꥄ¨–Š«¨Vk‡³Žêjª±*t뎵¶Ê¬›æ*+Od!UÜ_½’D–lÆvÕ§²5†`u]Ñ6”kØŽ4­µ²¡è-·M¡œ²Ôf—Ò·Žyfb²«’¸¢˜nWâJ5ï¹Ó¢æвµù•cøÂ$¯Kì~͵n›­° 7ìðÃG,±T�!þïThis GIF file was assembled with GIF Construction Set from: Alchemy Mindworks Inc. P.O. Box 500 Beeton, Ontario L0G 1A0 CANADA. This comment block will not appear in files created with a registered version of GIF Construction Set�;��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/builder.rb�����������������������������������������������0000644�0001750�0001750�00000002213�11701304107�020407� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2008 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # =begin = Interface Builder Demonstrates an interface loaded from a XML description. =end require 'common' module Demo class Dialog < Demo::BasicWindow def initialize super('Interface Builder') available = Gtk.check_version?(2, 12, 0) if available label = Gtk::Label.new("Build an interface from XML description.") else label = Gtk::Label.new("You need GTK+ >= 2.12.0 to run this demo.") end add(label) return unless available @builder = Gtk::Builder.new filename = File.join(File.dirname(__FILE__), "demo.ui") @builder << filename @builder.connect_signals {|name| method(name)} @window = @builder["window1"] @window.show_all signal_connect("destroy") do @window.destroy unless @window.destroyed? end end private def quit_activate @window.destroy destroy unless destroyed? end def about_activate dialog = @builder["aboutdialog1"] dialog.run dialog.hide end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/clipboard.rb���������������������������������������������0000644�0001750�0001750�00000004135�12137115065�020734� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # $Id: clipboard.rb,v 1.3 2005/07/28 14:30:38 mutoh Exp $ =begin = Clipboard GtkClipboard is used for clipboard handling. This demo shows how to copy and paste text to and from the clipboard. =end require 'common' module Demo class Clipboard < Demo::BasicWindow def initialize super('Clipboard') vbox = Gtk::Box.new(:vertical) vbox.border_width = 8 add(vbox) label = Gtk::Label.new(%Q["Copy" will copy the text\nin the entry to the clipboard]) vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) hbox = Gtk::Box.new(:horizontal, 0) hbox.border_width = 8 vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) # Create the first entry entry = Gtk::Entry.new hbox.pack_start(entry, :expand => true, :fill => true, :padding => 0) # Create the button button = Gtk::Button.new(:stock_id => :copy) hbox.pack_start(button, :expand => false, :fill => false, :padding => 0) button.signal_connect('clicked', entry) do |w, e| clipboard = e.get_clipboard(Gdk::Selection::CLIPBOARD) clipboard.text = e.text end label = Gtk::Label.new(%Q["Paste" will paste the text from the clipboard to the entry]) vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) hbox = Gtk::Box.new(:horizontal, 4) hbox.border_width = 8 vbox.pack_start(hbox, :expand => false, :fill => false, :padding => 0) # Create the second entry entry = Gtk::Entry.new hbox.pack_start(entry, :expand => true, :fill => true, :padding => 0) # Create the button button = Gtk::Button.new(:stock_id => :paste) hbox.pack_start(button, :expand => false, :fill => false, :padding => 0) button.signal_connect('clicked', entry) do |w, e| clipboard = e.get_clipboard(Gdk::Selection::CLIPBOARD) clipboard.request_text do |board, text, data| e.text = text end end end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/spinner.rb�����������������������������������������������0000644�0001750�0001750�00000002754�12137115065�020460� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2013 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # =begin = Spinner GtkSpinner allows to show that background activity is on-going. =end require 'common' module Demo class Spinner < Gtk::Dialog def initialize super(:title => 'Spinner', :parent => nil, :flags => nil, :buttons => [[:close, :none]]) signal_connect(:response) {self.destroy} signal_connect(:destroy) {self.destroy} self.resizable = false vbox = Gtk::Box.new :vertical, 5 self.content_area.pack_start vbox, :expand => true, :fill => true, :padding => 0 vbox.border_width = 5 # Sensitive hbox = Gtk::Box.new :horizontal, 5 @spinner_sensitive = Gtk::Spinner.new hbox.add @spinner_sensitive hbox.add Gtk::Entry.new vbox.add hbox # Disabled hbox = Gtk::Box.new :horizontal, 5 @spinner_insensitive = Gtk::Spinner.new hbox.add @spinner_insensitive hbox.add Gtk::Entry.new vbox.add hbox hbox.sensitive = false button = Gtk::Button.new :stock_id => :media_play button.signal_connect(:clicked) do @spinner_sensitive.start @spinner_insensitive.start end vbox.add button button = Gtk::Button.new :stock_id => :media_stop button.signal_connect(:clicked) do @spinner_sensitive.stop @spinner_insensitive.stop end vbox.add button end end end��������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-image-pattern.rb�����������������������������������0000644�0001750�0001750�00000002000�11701304107�022603� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-image-pattern.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Image Pattern This demo shows how to use GDK and cairo to use image pattern. From http://cairographics.org/samples/imagepattern.html. =end require 'common' module Demo class CairoImagePattern < CairoWindow def initialize super('cairo image pattern') end def draw(cr) image = Cairo::ImageSurface.from_png("ruby-gnome2-logo.png") pattern = Cairo::SurfacePattern.new(image) pattern.set_extend(Cairo::EXTEND_REPEAT) cr.translate(0.5, 0.5) cr.rotate(Math::PI / 4) cr.scale(1 / Math.sqrt(2), 1 / Math.sqrt(2)) cr.translate(-0.5, -0.5) matrix = Cairo::Matrix.scale(image.width * 5, image.height * 5) pattern.set_matrix(matrix) cr.set_source(pattern) cr.rectangle(0, 0, 1.0, 1.0) cr.fill end end end ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/gnome-gmush.png������������������������������������������0000644�0001750�0001750�00000006254�11701304107�021401� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA�† 1è–_�� cIDATxÚí˜[Œ$×YǧNUß{î{õŽ×qŒlb³K¸¯"„1RŒ2QL B âÍ‘xˆKHŒŠà„<8h­„`@‰ÀÂö‚/+lÇ»k{–ÝÙÞ¹ôLwOwuuÕ9U禪U Þ Á ¹¥£ª­©­úÿ¿ïÿ}ßÿ|ðûà÷ÁïÿõO¼/}àáO Ä­Ñh(.]X}îò[W;ÿ§ <öç_^qƜȄX‰ÂÑò02#Lš¡cÅ•+kÿzñìkŸÚèô®\ï³ýïèGÿäw}Ïñ?’³Ç“åp2Á&´N1iFÍ÷¹uùvœµÄñä¾è®Iuvr§;\{ß |å鯭4ëÍÓ‰ŠQ©ÆXƒµ¦dÖK½Rg¶5‹ÖŠV½–£íC‹¿¾ÓþÊûFàϾñ—'Ïø‚C¬L’˜ÌXpŽz½ïWðœGŽÉ¬a0걺&ð=ŸîÎÖY*íÆççš_ô£Kÿ+ý‹ÇŽ¼ç¾“ó­™cì‰Ì˜åI‘(…µ‹c¶9Ë\{k-ã¹)vGCâ$áÍÞÛh­Ù ‡8Ö8Kó_ô£_þ®xåÍWWgæW„'t–-§©"Ñ <çyDKf-&K1YF"ÆŒµøRø{¯BÙŒXÅ€ÂÚƒÿãzãò…æ–¾à oE› c-išbL†6ƒCzRJÖY `¬a4M Œ'!›;Û8OJZÍ6Õ Æh<&Mõ¡¥#s÷ïlì~û¦ œ»üæ±cŽ>.„XÉL†³vïÎb¬Ù+Ng0Æ¢2E–eh‚³8kq´I‰z]T–2Gd6Åó%"È@ÒnµY>| ‰`§ßãóoÌF¿ÀÍXë^=vxþÀóÆšek-Σ·½Ej @f22k±ÖâU|Æaóƒ�™s¤Ö <‡Ò÷ñ«5d¢ñ$´Z-ª~@µRcŽFáÏÞ´„Ž,:½¹¹¾üû¿÷Û¼üâ|ßGzÂóðr¹T‚€f³IµZ!|: ç8pð ¹9Æã1·Üùa°¤ž@Jüß—x•�+6]æ[³ =Ó¦Ñj>püÀOn_Þþ§÷" ßíb¬’c¾”ö3?Ï›Îíukñ¤O!¨ÂDQ„ÔkuffZlnl±´¸Àîλ½> ÕRiΟy‰¥ Êb« ÒŒÔ¦h“2 GlûŒÂ½Ñ.Ãh„­x÷†Wûü^¼wM‹”Ç„Œ†‚ ¤ï£µ" C¢(Bk š&;;=¶º]œu4š ÖÖ®T*¤:Å“q“fKss´dWºw>?vÛÜ}t™Z­Æ$‰ÙnÓ°RàÕ*?xð£·ýá {!kíÚoþƯ-?ÿܳ{ò‘r¯ËàH…NSßGú’v³I¥Ra8 ŸÌ ~ø¾“ôû#&qL’$øR²¸0ÃÖÆeŽÝr”Üs7Æ¢hÂ$NXö¹°»Å¥Íu”V$J¡µ&Ý®ÿêúWrX._ïMÀ9·ÒÝÚ<ýÙÏ|ß—~€çK)ž‡5–8I˜Lb²,¥Z­Òn·¸ç#ʼn�¥iš’$ J©éò}É÷ÝyœÞ`€1†jµÂìÌ ó sÔ*úqÈ·Îýom¬¡RÖ)v{ôÃsÝö‘p°×/øoHœþöß?½ò[~qÊÖX‡µ!RJjÕ*‰RÄqÂOúiA)Åd2A)E’$ÄyŠcµZÁs çÀ9GµZáà%æçX\œgqaŽšðåoþëý.ÎºŽ½<øøøò “·Åñ=í´sît·»µòØ—åâÅ·ñ¥Dú>Rz{�ã„D)>tû|üÔŒÇc´ÖDQDE$IB†ŒÇã) ¥Öjl–rôÈ!.-Òh68rè ³³mæææh6ê„:æOŸùþáõ³¸Ì|=|öß?—ƒŸ®kÚ8çV€ÓßøÛ¯óôÓGŽkY–‘$ ¿øK¿Šs‚$I¦ ƒiš2 DQD†(¥Ÿ­ÎAµ0;3ÃÑ#‡8~|™ã·Þ²Gfn–±ŽùüýÝÑ€tµww|±ßLNÀ\“•B<éœ[þÄÏüÜã?~ê+Ïýó?òâ Ïqþ;¯Ñh6xàÁO²¼|| \)…”ß÷‰¢ˆ,ËÇT*¤”cPJ!„G«UG @ÀöNŸI†!Î:”Ò>rC ‹tÃ]¼ƒ­q±ÿÕBÍ€»f3'„è�ŸŽG'~à‡~äñï½÷ûOîôº¬wÖ¸cùêõúôÞJ¥B–eH)B0™Lð}ÏóBàœCks‚ápÄÒâFƒ…ùY¸uùfÚmêÏ_ø¯]^!°“t¨�ºÇu»ÑÙÖÌàG/®¯­4š­Gî¸ëî“K9”RT*¬µ8çBÐn·§×…!¦·Ö²´´H·»E0Dx<RzD™â¯Ÿ}ž¯½ô,BxX~+~uã<PË3�Þ ïn?zë“À“[ÛÝ'œuO'£çíMí’å(2¡Ôžá˲ c ÖZÚíæ^V¬£?¡º–Y›³«ö,ˆ«¯F/\þ UU€½é™ÞÃÚè=ËœƒJ’)%išN£.¥$Ë2œsÅ dg4b}´óÀyÀ@â¶<\]‚'°Ú¼¾½ó„¾2|-ï€È€�Ð7E ßï¯h½>Ë2¬µ¥cò}ƒ™ê˜õœÀ¯U°Â/°dÂôîäÕxkøRº1º˜ë½‘ƒV@µD¿)iš>’eÙd!0 i·Ûh­QJM H)ó°WI§FfëIo§ZGÉnÔÉ&js€µ\*•x-'áçFôÆk ÛížHÓôdš¦$Švéû>išRÎŽ1fZE'2ÆzkôÜ ×Ó9Ph-'PX“ϸ,þíÝàÇ0Okýéb–IL&“½è&É;ˆÙ|7Wœ‹½Ý 9ØÂÔrÉÔóUË£_Ïåm€w#àÏó©$I S Zkâ8ž- Öú$œsÓVëûþ‘ü™2[�/HÒ)d$J8®ë«Ä<àgY¶ìyÃáF£A–eÄqŒÖ)åt¹>Œ1SÅ— çÜ<Ð.Ùd›iZ’OZ’_rÑ™#àÏœ9³R´È 9çHÓ”4Mñ}cÌÔJGQôŽVÉ[l4K`MI&|^”êB�»¢ˆÀx<ö‹èJ)§¦M›|Puš¦Óm©sn:äòá¦öi¾ú. Ý»ì],`½ë�_è4Ã0(¢]¯×ÙÜÜDkM†Xk™L&ÄqÌp8¤ÓéLk¢N^J©/]º•4îçEêçïû:Q±Šì¸É€|衇¾Yg¥R¡×ëÑï÷§rŠã˜ÑhÄÅ‹i·ÛÓùPH¨°qoïÓvP~Oa™óÐùÑäç×ìFž€¿»»ûª”ò^¥Íf“ííí©ßBÐétò=4h­±ÖNmv~ßî[o½µYÚÚ}Eœ•fÃþ•]oþ‘W^yå‰bÒV*¶··I’„(Šèv»¬­­Q¯×ÑZ¿£zžÇ`0¸töìÙs9˜8_ •Î‹ë ˜ä×t©C “×�¼Ð¢_$•gžyfýþûï¿KJy[–e¬®®N-ÃÕ«WqÎÑh4ÞÑN{½^çõ×_£Óélç ’‰$çD&ÀØÍ­Å(?Nò¥-¯·…–ЬòÔSO™ŸŸïµZ­CµZmáüùó�„aH–e4 ºÝîúÕ«W¯¼üò˯¯®®n(¥Æ¥ £\”ƒåÇaiKà‹ÿ›ŠkÌ€WD¾4-›À 0 ,³§NúX†Uç\õÅ_\Ëﯔ²XL¶¤e]’GqŒJ„ÂÒå׈kÌ@ÑŠq^x“VNb.?oæ«^j²”Å2h“Ÿg¥ÂTù=q~-*Iª,«$¿÷š&qÑ!Dþoߥ†Ê^-/£ây*–˺¨-e@åçª$¹"òE¯yOìö “´Ê–¢8É£”\£·¯Mš}ÒÙŸ³Ï²JJà³!P�Hÿ B*zg@–<++|~’_/À‹Ò+öÝŸ–†—¹î[ïRв4=½}5â—À{eßRÒº.]7¥³ßâ›R´m)Źû $Ý’vÚ����IEND®B`‚����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/tree_store.rb��������������������������������������������0000644�0001750�0001750�00000016455�12137115065�021160� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: tree_store.rb,v 1.7 2005/02/06 18:25:13 kzys Exp $ =begin = Tree View/Tree Store The Gtk::TreeStore is used to store data in tree form, to be used later on by a Gtk::TreeView to display it. This demo builds a simple Gtk::TreeStore and displays it. If you're new to the GtkTreeView widgets and associates, look into the Gtk::ListStore example first. =end require 'common' module Demo class TreeStore < BasicWindow # TreeItem structure TreeItem = Struct.new('TreeItem', :label, :alex, :havoc, :tim, :owen, :dave, :world_holiday) # shared by the European hackers # columns ( HOLIDAY_NAME_COLUMN, ALEX_COLUMN, HAVOC_COLUMN, TIM_COLUMN, OWEN_COLUMN, DAVE_COLUMN, VISIBLE_COLUMN, WORLD_COLUMN, NUM_COLUMNS, ) = *(0..9).to_a # tree data TOPLEVEL = [ ['January', [ ["New Years Day", true, true, true, true, false, true], ["Presidential Inauguration", false, true, false, true, false, false], ["Martin Luther King Jr. day", false, true, false, true, false, false], ] ], ['February', [ ["Presidents' Day", false, true, false, true, false, false], ["Groundhog Day", false, false, false, false, false, false], ["Valentine's Day", false, false, false, false, true, true], ] ], ['March', [ ["National Tree Planting Day", false, false, false, false, false, false], [ "St Patrick's Day", false, false, false, false, false, true], ] ], ['April', [ [ "April Fools' Day", false, false, false, false, false, true ], [ "Army Day", false, false, false, false, false, false ], [ "Earth Day", false, false, false, false, false, true ], [ "Administrative Professionals' Day", false, false, false, false, false, false ], ]], ['May', [ [ "Nurses' Day", false, false, false, false, false, false ], [ "National Day of Prayer", false, false, false, false, false, false ], [ "Mothers' Day", false, false, false, false, false, true ], [ "Armed Forces Day", false, false, false, false, false, false ], [ "Memorial Day", true, true, true, true, false, true ], ] ], ['June', [ [ "June Fathers' Day", false, false, false, false, false, true ], [ "Juneteenth (Liberation of Slaves)", false, false, false, false, false, false ], [ "Flag Day", false, true, false, true, false, false ], ] ], ['July', [ [ "Parents' Day", false, false, false, false, false, true ], [ "Independence Day", false, true, false, true, false, false ], ] ], ['August', [ [ "Air Force Day", false, false, false, false, false, false ], [ "Coast Guard Day", false, false, false, false, false, false ], [ "Friendship Day", false, false, false, false, false, false ], ] ], ['September', [ [ "Grandparents' Day", false, false, false, false, false, true ], [ "Citizenship Day or Constitution Day", false, false, false, false, false, false ], [ "Labor Day", true, true, true, true, false, true ], ] ], ['October', [ [ "National Children's Day", false, false, false, false, false, false ], [ "Bosses' Day", false, false, false, false, false, false ], [ "Sweetest Day", false, false, false, false, false, false ], [ "Mother-in-Law's Day", false, false, false, false, false, false ], [ "Navy Day", false, false, false, false, false, false ], [ "Columbus Day", false, true, false, true, false, false ], [ "Halloween", false, false, false, false, false, true ], ] ], ['November', [ [ "Marine Corps Day", false, false, false, false, false, false ], [ "Veterans' Day", true, true, true, true, false, true ], [ "Thanksgiving", false, true, false, true, false, false ], ] ], ['December', [ [ 'Pearl Harbor Remembrance Day', false, false, false, false, false, false ], [ 'Christmas', true, true, true, true, false, true ], [ 'Kwanzaa', false, false, false, false, false, false ], ] ], ].collect do |month_name, holidays| [ month_name, holidays.collect do |args| TreeItem.new(args) end, ] end def initialize # create window, etc super('Card planning sheet') vbox = Gtk::VBox.new(false, 8) vbox.border_width = 8 add(vbox) vbox.pack_start(Gtk::Label.new("Jonathan's Holiday Card Planning Sheet"), :expand => false, :fill => false, :padding => 0) sw = Gtk::ScrolledWindow.new(nil, nil) sw.shadow_type = Gtk::SHADOW_ETCHED_IN sw.set_policy(:automatic, :automatic) vbox.pack_start(sw, :expand => true, :fill => true, :padding => 0) # create model model = create_model # create tree view treeview = Gtk::TreeView.new(model) treeview.rules_hint = true treeview.selection.mode = Gtk::SELECTION_MULTIPLE add_columns(treeview) sw.add(treeview) # expand all rows after the treeview widget has been realized treeview.signal_connect('realize') do treeview.expand_all end set_default_size(650, 400) end def create_model # create tree store model = Gtk::TreeStore.new(String, TrueClass, TrueClass, TrueClass, TrueClass, TrueClass, TrueClass, TrueClass) # add data to the tree store TOPLEVEL.each do |month_name, holidays| iter = model.append(nil) iter[HOLIDAY_NAME_COLUMN] = month_name (ALEX_COLUMN..DAVE_COLUMN).each do |index| iter[index] = false end # add children holidays.each do |holiday| child_iter = model.append(iter) child_iter[HOLIDAY_NAME_COLUMN] = holiday.label[0] %w(alex havoc tim owen dave).each_with_index do |person, i| child_iter[ALEX_COLUMN + i] = holiday[person] end child_iter[VISIBLE_COLUMN] = true child_iter[WORLD_COLUMN] = holiday.world_holiday end end return model end def add_columns(treeview) model = treeview.model # column for holiday names renderer = Gtk::CellRendererText.new renderer.xalign = 0.0 col_offset = treeview.insert_column(-1, 'Holiday', renderer, 'text' => HOLIDAY_NAME_COLUMN) column = treeview.get_column(col_offset - 1) column.clickable = true [ ['Alex', true ], ['Havoc', false], ['Tim', true ], ['Owen', false], ['Dave', false], ].each_with_index do |args, i| person, european = *args renderer = Gtk::CellRendererToggle.new renderer.xalign = 0.0 eval(%Q[def renderer.column; #{ALEX_COLUMN + i}; end]) renderer.signal_connect('toggled') do |cell, path| item_toggled(cell, path, model) end attributes = { 'active' => (ALEX_COLUMN + i), 'visible' => VISIBLE_COLUMN, } if european attributes['activatable'] = WORLD_COLUMN end col_offset = treeview.insert_column(-1, person, renderer, attributes) column = treeview.get_column(col_offset - 1) column.sizing = Gtk::TreeViewColumn::FIXED column.fixed_width = 50 column.clickable = true end end def item_toggled (cell, path_str, model) path = Gtk::TreePath.new(path_str) column = cell.column # get toggled iter iter = model.get_iter(path) toggle_item = iter[column] # do something with the value toggle_item ^= 1 # set new value iter[column] = toggle_item end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/textview.rb����������������������������������������������0000644�0001750�0001750�00000035721�12137115065�020661� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: textview.rb,v 1.8 2005/02/06 18:25:13 kzys Exp $ =begin = Text Widget/Multiple Views The Gtk::TextView widget displays a Gtk::TextBuffer. One Gtk::TextBuffer can be displayed by multiple Gtk::TextViews. This demo has two views displaying a single buffer, and shows off the widget's text formatting features. =end require 'common' module Demo class TextView < BasicWindow GRAY50_WIDTH = 2 GRAY50_HEIGHT = 2 GRAY50_BITS = [0x02, 0x01].pack("c") @@nest_window = nil def initialize super("TextView Window") set_default_size(450, 450) set_title("TextView") set_border_width(0) vpaned = Gtk::VPaned.new vpaned.set_border_width(5) add(vpaned) ## # For convenience, we just use the autocreated buffer from # the first text view; you could also create the buffer # by itself with Gtk::TextBuffer.new, then later create # a view widget. # view1 = Gtk::TextView.new buffer = view1.buffer view2 = Gtk::TextView.new(buffer) sw = Gtk::ScrolledWindow.new(nil, nil) sw.set_policy(:automatic, :automatic) vpaned.add1(sw) sw.add(view1) sw = Gtk::ScrolledWindow.new(nil, nil) sw.set_policy(:automatic, :automatic) vpaned.add2(sw) sw.add(view2) create_tags(buffer) insert_text(buffer) attach_widgets(view1) attach_widgets(view2) vpaned.show_all self.show end def create_tags(buffer) ## # Create a bunch of tags. Note that it's also possible to # create tags with Gtk::TextTag.new then add them to the # tag table for the buffer, Gtk::TextBuffer#create_tag is # just a convenience function. Also note that you don't have # to give tags a name; pass NULL for the name to create an # anonymous tag. # # In any real app, another useful optimization would be to create # a Gtk::TextTagTable in advance, and reuse the same tag table for # all the buffers with the same tag set, instead of creating # new copies of the same tags for every buffer. # # Tags are assigned default priorities in order of addition to the # tag table. That is, tags created later that affect the same text # property affected by an earlier tag will override the earlier # tag. You can modify tag priorities with # Gtk::TextTag#set_priority. # buffer.create_tag('heading', 'weight' => Pango::FontDescription::WEIGHT_BOLD, 'size' => 15 * Pango::SCALE) buffer.create_tag("italic", "style" => Pango::FontDescription::STYLE_ITALIC) buffer.create_tag("bold", "weight" => Pango::FontDescription::WEIGHT_BOLD) buffer.create_tag("big", # points times the PANGO_SCALE factor "size" => 20 * Pango::SCALE) buffer.create_tag("xx-small", "scale" => Pango::AttrScale::XX_SMALL) buffer.create_tag("x-large", "scale" => Pango::AttrScale::X_LARGE) buffer.create_tag("monospace", "family" => "monospace") buffer.create_tag("blue_foreground", "foreground" => "blue") buffer.create_tag("red_background", "background" => "red") stipple = Gdk::Pixmap.create_from_data(nil, GRAY50_BITS, GRAY50_WIDTH, GRAY50_HEIGHT) buffer.create_tag("background_stipple", "background_stipple" => stipple) buffer.create_tag("foreground_stipple", "foreground_stipple" => stipple) buffer.create_tag("big_gap_before_line", "pixels_above_lines" => 30) buffer.create_tag("big_gap_after_line", "pixels_below_lines" => 30) buffer.create_tag("double_spaced_line", "pixels_inside_wrap" => 10) buffer.create_tag("not_editable", "editable" => false) buffer.create_tag("word_wrap", "wrap_mode" => :word) buffer.create_tag("char_wrap", "wrap_mode" => Gtk::TextTag::WRAP_CHAR) buffer.create_tag("no_wrap", "wrap_mode" => :none) buffer.create_tag("center", "justification" => Gtk::JUSTIFY_CENTER) buffer.create_tag("right_justify", "justification" => Gtk::JUSTIFY_RIGHT) buffer.create_tag("wide_margins", "left_margin" => 50, "right_margin" => 50) buffer.create_tag("strikethrough", "strikethrough" => true) buffer.create_tag("underline", "underline" => Pango::AttrUnderline::SINGLE) buffer.create_tag("double_underline", "underline" => Pango::AttrUnderline::DOUBLE) buffer.create_tag("superscript", "rise" => 10 * Pango::SCALE, # 10 pixels "size" => 8 * Pango::SCALE) # 8 points buffer.create_tag("subscript", "rise" => -10 * Pango::SCALE, # 10 pixels "size" => 8 * Pango::SCALE) # 8 points buffer.create_tag("rtl_quote", "wrap_mode" => :word, "direction" => Gtk::Widget::TEXT_DIR_RTL, "indent" => 30, "left_margin" => 20, "right_margin" => 20) end def insert_text(buffer) ## # Demo.find_file looks in the the current directory first, # so you can run gtk-demo without installing GTK, then looks # in the location where the file is installed. # filename = Demo.find_file("gtk-logo-rgb.gif") pixbuf = Gdk::Pixbuf.new(filename) if filename unless pixbuf $stderr.print "Failed to load image file gtk-logo-rgb.gif\n" exit 1 end scaled = pixbuf.scale(32, 32, Gdk::Pixbuf::INTERP_BILINEAR) pixbuf = scaled ## # get start of buffer; each insertion will revalidate the # iterator to point to just after the inserted text. # iter = buffer.get_iter_at(:offset => 0) buffer.insert(iter, "The text widget can display text with all kinds of nifty attributes. It also supports multiple views of the same buffer; this demo is showing the same buffer in two places.\n\n") buffer.insert(iter, "Font styles. ", 'heading') buffer.insert(iter, "For example, you can have ") buffer.insert(iter, "italic", "italic") buffer.insert(iter, ", ") buffer.insert(iter, "bold", "bold") buffer.insert(iter, ", or ") buffer.insert(iter, "monospace(typewriter)", "monospace") buffer.insert(iter, ", or ") buffer.insert(iter, "big", "big") buffer.insert(iter, " text. ") buffer.insert(iter, "It's best not to hardcode specific text sizes; you can use relative sizes as with CSS, such as ") buffer.insert(iter, "xx-small", "xx-small") buffer.insert(iter, " or ") buffer.insert(iter, "x-large", "x-large") buffer.insert(iter, " to ensure that your program properly adapts if the user changes the default font size.\n\n") buffer.insert(iter, "Colors. ", "heading") buffer.insert(iter, "Colors such as ") buffer.insert(iter, "a blue foreground", "blue_foreground") buffer.insert(iter, " or ") buffer.insert(iter, "a red background", "red_background") buffer.insert(iter, " or even ") buffer.insert(iter, "a stippled red background", "red_background", "background_stipple") buffer.insert(iter, " or ") buffer.insert(iter, "a stippled blue foreground on solid red background", "blue_foreground", "red_background", "foreground_stipple") buffer.insert(iter, "(select that to read it) can be used.\n\n") buffer.insert(iter, "Underline, strikethrough, and rise. ", "heading") buffer.insert(iter, "Strikethrough", "strikethrough") buffer.insert(iter, ", ") buffer.insert(iter, "underline", "underline") buffer.insert(iter, ", ") buffer.insert(iter, "double underline", "double_underline") buffer.insert(iter, ", ") buffer.insert(iter, "superscript", "superscript") buffer.insert(iter, ", and ") buffer.insert(iter, "subscript", "subscript") buffer.insert(iter, " are all supported.\n\n") buffer.insert(iter, "Images. ", "heading") buffer.insert(iter, "The buffer can have images in it: ") buffer.insert(iter, pixbuf) buffer.insert(iter, pixbuf) buffer.insert(iter, pixbuf) buffer.insert(iter, " for example.\n\n") buffer.insert(iter, "Spacing. ", "heading") buffer.insert(iter, "You can adjust the amount of space before each line.\n") buffer.insert(iter, "This line has a whole lot of space before it.\n", "big_gap_before_line", "wide_margins") buffer.insert(iter, "You can also adjust the amount of space after each line; this line has a whole lot of space after it.\n", "big_gap_after_line", "wide_margins") buffer.insert(iter, "You can also adjust the amount of space between wrapped lines; this line has extra space between each wrapped line in the same paragraph. To show off wrapping, some filler text: the quick brown fox jumped over the lazy dog. Blah blah blah blah blah blah blah blah blah.\n", "double_spaced_line", "wide_margins") buffer.insert(iter, "Also note that those lines have extra-wide margins.\n\n") buffer.insert(iter, "Editability. ", "heading") buffer.insert(iter, "This line is 'locked down' and can't be edited by the user - just try it! You can't delete this line.\n\n", "not_editable") buffer.insert(iter, "Wrapping. ", "heading") buffer.insert(iter, "This line(and most of the others in this buffer) is word-wrapped, using the proper Unicode algorithm. Word wrap should work in all scripts and languages that GTK+ supports. Let's make this a long paragraph to demonstrate: blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah\n\n") buffer.insert(iter, "This line has character-based wrapping, and can wrap between any two character glyphs. Let's make this a long paragraph to demonstrate: blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah\n\n", "char_wrap") buffer.insert(iter, "This line has all wrapping turned off, so it makes the horizontal scrollbar appear.\n\n\n", "no_wrap") buffer.insert(iter, "Justification. ", "heading") buffer.insert(iter, "\nThis line has center justification.\n", "center") buffer.insert(iter, "This line has right justification.\n", "right_justify") buffer.insert(iter, "\nThis line has big wide margins. Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.\n", "wide_margins") buffer.insert(iter, "Internationalization. ", "heading") buffer.insert(iter, "You can put all sorts of Unicode text in the buffer.\n\nGerman(Deutsch Süd) Grüß Gott\nGreek(Ελληνικά) Γειά σας\nHebrew שלו×\nJapanese(日本語)\n\nThe widget properly handles bidirectional text, word wrapping, DOS/UNIX/Unicode paragraph separators, grapheme boundaries, and so on using the Pango internationalization framework.\n") buffer.insert(iter, "Here's a word-wrapped quote in a right-to-left language:\n") buffer.insert(iter, "??? ??? ???? ?? ???? ???????? ????? ?? ???? ?????? ??????? ??????? ?? ???? ?????? ?? ????? ?? ??????? ????? ??????? ??? ?????? ????? ?????? ????? ???? ?? ?????? ?????? ?? ???????? ?????? ????? ?? ???? ???? ????????? ???????. ???? ???? ??? ???????? ????? ?? »????????« ?? ???????.\n\n", "rtl_quote") buffer.insert(iter, "You can put widgets in the buffer: Here's a button: ") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, " and a menu: ") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, " and a scale: ") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, " and an animation: ") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, " finally a text entry: ") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, ".\n") buffer.insert(iter, "\n\nThis demo doesn't demonstrate all the Gtk::TextBuffer features; it leaves out, for example: invisible/hidden text(doesn't work in GTK 2, but planned), tab stops, application-drawn areas on the sides of the widget for displaying breakpoints and such...") # Apply word_wrap tag to whole buffer buf_start, buf_end = buffer.bounds buffer.apply_tag("word_wrap", buf_start, buf_end) end def find_anchor(iter) while iter.forward_char do return true if iter.child_anchor end return false end def attach_widgets(text_view) buffer = text_view.buffer; iter = buffer.start_iter i = 0; while find_anchor(iter) do anchor = iter.child_anchor if i == 0 widget = Gtk::Button.new("Click Me") widget.signal_connect('clicked') { |button| if @@nest_window and ! @@nest_window.destroyed? @@nest_window.present break end buffer = Gtk::TextBuffer.new iter = buffer.start_iter buffer.insert(iter, "This buffer is shared by a set of nested text views.\n Nested view:\n") anchor = buffer.create_child_anchor(iter) buffer.insert(iter, "\nDon't do this in real applications, please.\n") view = Gtk::TextView.new(buffer) recursive_attach_view(0, view, anchor) @@nest_window = Gtk::Window.new(Gtk::Window::TOPLEVEL) sw = Gtk::ScrolledWindow.new(nil, nil) sw.set_policy(:automatic, :automatic) @@nest_window.add(sw) sw.add(view) @@nest_window.set_default_size(300, 400) @@nest_window.show_all } elsif i == 1 menu = Gtk::Menu.new widget = Gtk::OptionMenu.new menu_item = Gtk::MenuItem.new("Option 1") menu.append(menu_item) menu_item = Gtk::MenuItem.new("Option 2") menu.append(menu_item) menu_item = Gtk::MenuItem.new("Option 3") menu.append(menu_item) widget.menu = menu elsif i == 2 widget = Gtk::HScale.new widget.set_range(0, 100) widget.set_size_request(70, -1) elsif i == 3 filename = Demo.find_file("floppybuddy.gif") widget = Gtk::Image.new(filename) elsif i == 4 widget = Gtk::Entry.new else #widget = nil; avoids a compiler warning #g_assert_not_reached ; end text_view.add_child_at_anchor(widget, anchor) widget.show_all i += 1 end end def recursive_attach_view(depth, view, anchor) return if depth > 4 child_view = Gtk::TextView.new(view.buffer) # Event box is to add a black border around each child view event_box = Gtk::EventBox.new color = Gdk::Color.parse("black") event_box.modify_bg(Gtk::STATE_NORMAL, color) align = Gtk::Alignment.new(0.5, 0.5, 1.0, 1.0) align.set_border_width(1) event_box.add(align) align.add(child_view) view.add_child_at_anchor(event_box, anchor) recursive_attach_view(depth + 1, child_view, anchor) end end end �����������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-arc.rb���������������������������������������������0000644�0001750�0001750�00000002061�11701304107�020622� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-arc.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Arc This demo shows how to use GDK and cairo to draw arc. From http://cairographics.org/samples/arc.html. =end require 'common' module Demo class CairoArc < CairoWindow CENTER_X = 0.5 CENTER_Y = 0.5 RADIUS = 0.4 ANGLE1 = 45.0 * (Math::PI / 180.0) # angles are specified ANGLE2 = 180.0 * (Math::PI / 180.0) # in radians def initialize super('cairo arc') end def draw(cr) cr.arc(CENTER_X, CENTER_Y, RADIUS, ANGLE1, ANGLE2) cr.stroke # draw helping lines cr.set_source_rgba(1, 0.2, 0.2, 0.6) cr.arc(CENTER_X, CENTER_Y, 0.05, 0, 2 * Math::PI) cr.fill cr.set_line_width(0.03) cr.arc(CENTER_X, CENTER_Y, RADIUS, ANGLE1, ANGLE1) cr.line_to(CENTER_X, CENTER_Y) cr.arc(CENTER_X, CENTER_Y, RADIUS, ANGLE2, ANGLE2) cr.line_to(CENTER_X, CENTER_Y) cr.stroke end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-path.rb��������������������������������������������0000644�0001750�0001750�00000001134�11701304107�021011� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-path.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Path This demo shows how to use GDK and cairo to draw path. From http://cairographics.org/samples/path.html. =end require 'common' module Demo class CairoPath < CairoWindow def initialize super('cairo path') end def draw(cr) cr.move_to(0.5, 0.1) cr.line_to(0.9, 0.9) cr.rel_line_to(-0.4, 0.0) cr.curve_to(0.2, 0.9, 0.2, 0.5, 0.5, 0.5) cr.stroke end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/rotated_text.rb������������������������������������������0000644�0001750�0001750�00000006173�11701304107�021500� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: rotated_text.rb,v 1.2 2005/03/05 15:01:16 mutoh Exp $ =begin = Rotated Text This demo shows how to use GDK and Pango to draw rotated and transformed text. The use of Gdk::PangoRenderer in this example is a somewhat advanced technique; most applications can simply use Gdk::Drawable#draw_layout. We use it here mostly because that allows us to work in user coordinates - that is, coordinates prior to the application of the transformation matrix, rather than device coordinates. As of GTK+-2.6, the ability to draw transformed and anti-aliased graphics as shown in this example is only present for text. With GTK+-2.8, a new graphics system called "Cairo" will be introduced that provides these capabilities and many more for all types of graphics. =end require 'common' module Demo class RotatedText < BasicWindow RADIUS = 150 N_WORDS = 10 FONT = "Sans Bold 27" def initialize super('Rotated Text') unless Gtk.check_version?(2, 6, 0) add(Gtk::Label.new("This sample requires GTK+ 2.6.0 or later")) return end drawing_area = Gtk::DrawingArea.new add(drawing_area) drawing_area.modify_bg(Gtk::STATE_NORMAL, Gdk::Color.new(65535, 65535, 65535)) drawing_area.signal_connect("expose_event") do matrix = Pango::Matrix.new # Get the default renderer for the screen, and set it up for drawing renderer = Gdk::PangoRenderer.get_default(drawing_area.screen) renderer.drawable = drawing_area.window renderer.gc = style.black_gc width = drawing_area.allocation.width height = drawing_area.allocation.height # Set up a transformation matrix so that the user space coordinates for # the centered square where we draw are [-RADIUS, RADIUS], [-RADIUS, RADIUS] # We first center, then change the scale device_radius = [width, height].min / 2.0 matrix.translate!(device_radius + (width - 2 * device_radius) / 2.0, device_radius + (height - 2 * device_radius) / 2.0) matrix.scale!(device_radius / RADIUS, device_radius / RADIUS) # Create a PangoLayout, set the font and text context = Gdk::Pango.context layout = Pango::Layout.new(context) layout.text = "Text" layout.font_description = Pango::FontDescription.new(FONT) # Draw the layout N_WORDS times in a circle (0...N_WORDS).each do |i| rotated_matrix = matrix.dup angle = 360 * i / N_WORDS.to_f # Gradient from red at angle == 60 to blue at angle == 300 red = 65535 * (1 + Math.cos((angle - 60) * Math::PI / 180.0)) / 2 color = Gdk::Color.new(red, 0, 65535 - red) renderer.set_override_color(Pango::Renderer::PART_FOREGROUND, color) rotated_matrix.rotate!(angle) context.matrix = rotated_matrix # Inform Pango to re-layout the text with the new transformation matrix layout.context_changed width, height = layout.size renderer.draw_layout(layout, - width / 2, - RADIUS * Pango::SCALE) end # Clean up default renderer, since it is shared renderer.set_override_color(Gdk::PangoRenderer::PART_FOREGROUND, nil) renderer.drawable = nil renderer.gc = nil end end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/gnome-calendar.png���������������������������������������0000644�0001750�0001750�00000005303�11701304107�022021� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA�† 1è–_�� zIDATxÚí™]lWÇwvvwÖñÆÞÆNvc7ޓ֤¡}ˆB‘òÐ"TDA¨ VT­è‡¢Ò¨¼ òQ Ayªh¥‚à)•BB ŠRˆª>Ñ Tb'µó¹‰¿¿âÙ]Û;wwfîåaïìŽ7N²*ªD®u5³ã™;çÎÿœû¿wàN»Óî´;íNûnân“þ¤�·0¨;ôÿ€èÀx½É}â†ë°?&ÃEÚÌx± …ôÍ@tàwßù¦RJ£µ"T!õ@QW …@ a „H Í_(®yJÀ6'C"™"aÛ$ì ËBûuüZ ß÷ ”BiM*ü ¤*=ܪD©;ÀÏw�eúBB­ E*öãˆÈes8ÝN£Û2H)A6žûÁË/éOïèãù×^Žã˜ÁZãJ)[?J%èíà•#/h´ÆÊl°34ç*Àê€ÒøaH†(­ÄÐω|>Ïêê*¡c76º $2äïÙ'\O6.8y}ìàB‘¹·ßÆ1€¾úÜaá…ŠÕÔ‘Êmãs‡u™'¬X¿ �aH B|r÷ן£P(J¥(^)R¯Ô‘R¶¼´€�ÔÕòúšD–J”NžDΗ^ä݈¢aîýòc_ÛûõkG-VVW6�l ·í¶�|êé#bhǶm†!nÅe~y¾e 9Fhfªòƒ¡ÛA^GÎÏ#‹ã”ÆÆ7Ð)rÀpðø¾$^<|˜þîñ]À ÙÞQøJ¡”"“Ìpyò2•• îªK­V£^­oð¸ $ŽíÄʈ†�œà C÷;QØ{üI¤ÓÈ¥nÏc‹ë2}ü8ŸÙÚ­ôÎ;¿�r€–k€ß �ᇠ�LÙd´Gíàui²ëëÈ ãà8ƃ@ ñ"�Z!§Š&7Ú—Ö½@^x¾Oÿì,kÕ*Ëóóœ)-l À]€o[¹€fMöƒ¥Cz8@oäܸ ¯K‰;7ÇÄ™ vïÛÝ(d6LJããxà�½h-€œ©`�µ¿¿Oèû¬•ËŒ—]í5êMØdU`ÎPHw@…„ª1’c; â9¦âD5#Mœ™@.}@îþ<GåïýYüõí·8uêOÏüŒ=Ø ‘Ó¢™ $žçaÏÏ£*eV¯]cqu•)P÷€C!€*Pê7Ëø¬hÕÃ¥ŒÑ±’y-^ÓwïÛÍ„”§%¯?öÙzU?ûò÷Åb¢Ïó(_+“N§[ÏF V#¼pÏuq]—J¡€\žëžÔÀNòeã}7zÒê@?PJ5“3ªñä®röíÛ‡”’;w¢´FYŠíwmçrñ2ÓÓÓœàùžïŽ",‹òÂËBnÛÆº¬ëõZ ÏLd®áEô¶;Ñ5Ö­[¼•mb$VF¥”är¹fDŠ3ÿ<ùâ9vîØ‰mÛ¸®»!™SË‹tË¥©)Jå2 … ss¬KI­î 3û–“·”"6OXJk­9 âÔql§e¼Ýºîù½} Y` ¡ …‚èëïcÿ}ûIžï‘ÉdðHË*ž”¸‹‹\‚ó++íû!4Pfňûh¡f„¡jÔs36u©ù2hÐɱ\ÏmþHX÷Þ{/é-i‰D#J¡$“̰RYÁ™˜ ÕÛËT±ˆ[©0Ž`ÕóH&“Ø ‹dÒ˜2Ü—1.:Í+TšPéÖå\/È¢ÿ•–KLü{‚Òr)Š�åõ2£££xž×�g7¢Ô=µ@.ŸgñìYÜ•N{’R½ŽmÛôôôÐÝ•!›É`<ïµ+�Í›B­ÐJ7<î8-ÑMý1wåÊäÒìèѼùæ›<ûÒ‹âı?òί¾ËéÓ§I§Ó ÞKIO:ÉÊ¥K,MN2[©pQXd·f P(°ÅɈt2…1>²7¾Övg«)â:Åç?€çyäóyF+CüëÜ ?ùí l÷ÖõSÏKôl ð=ŸÉË“¤R)¶/¢¶fY˜˜àZ©Ä)ßÇJgÈõäDeYZXbbGëFÐíç@oÐ84©ÓÛÛËÞ½¬­­á¤ÓX5ŸååeÖì!Jå:­ÉÌO“àêûïS)—¹¸¶N)‘ ¯¿‘‘òù<‰DËBˆÍ KsIjßb­£3­ukò±ÁénH‚Lƒ£-êÀ¶mÛ¨«:=çÏS­×¹zõ*ÊRìܽ“|`áž=Ët*Eya¹•ÎÙî,ÃCà  è�!Z£ ‰˜×o™í‹pݘ´hoT£ã8­óxïvØ}ÏnºººH%möÝ¿ƒŸ=ÈÈÐõ‹çyøÕW©{K®ËDbmé&¿#ÏÀÀ�éTù]‹8¬X[7Ë뢠…Fk´c;¢¡ã$N·Ó(jAã7@.›kF)“Ì`Û6IÛfïÐ^r¹ 'þJßð0Çßxƒ]<ÂGî 3W®ÒßÛËž={ÈårXV˧ Ñô§h¡o6ëödÖZ£ôƆHŒI)7H Ä”W­5™L†ÕÙz³YæGG™>wŽ3cc¯ûd³Y†v 180Hº+Mm½Ö¢‚@ÄìQ›íNt¥µR|ï™'õÈCÜî^’øé_áéC‘ïïgzt”%×eTk–ì Z«25;…5¿‘ÑIX£ƒÂØ®h¡&û”B¯ûŠrÝçÄ»ÇtÛ[ˆjE“ºZj…c'¸«Ëak*Í®áa1yêK®ËTu]Tõ🰺Æ%o©ñ³€nl(r ñ ò~ض½rC�Ç4 „¸Éd'„Æ„:o!:zûçGîc¥XdòÂ&«ëzÂI“ô} !Ò©¤¶–h+ß´Ö-úGº7 ÝI4À[ïÏ=À`зšÅµ $M©³ceΪ_Ü¿ûž'F¾ýÑ{ï1>7wù—ccïÛ€^óž²kž1.Z°\–ÌÒ10ãŨNVdÚÜ�ëfÀº9v)c|tŒ¶=‘Ž<úè 3ccLÎÌ”Ž‹¿1ãE94yÚµ0nzÅ�“æz=Duøœ•‡:°3<êQ$" ÖSÞWŸ›¾4;»òûññ×Öjfyš1*À¤Qš‘XócÝ3ï“4‹vËøÛ‰@Ôj1/E†Æ£`Ç€X_9\)—ùÛ•+¯—J3Æø.3æªÑø3ÀŠ3¢†£Mݼ7ê·M!Ñ$h§b/³ã}½R™›™ùÃ_&'OÛͺÖ2ž]®Æt¾jKÒvqúè–NëlË|Ã"ßôDL£Ø±ódlû/º¾Øe¶G2&Ÿ&MÖŒ1A[¹Œz‹NР“m½É¹Ž½È2ƒF�jm«+–´«¦�ÌÏWqí3m<²íçú¶·×Ûô‡Š½°ý£„µIÔt¬¢”Ly\0×T[ŽÅ›ÚdK]ý·_ht[^´ oð•ÆQaÅPHÝäÓÓÍŽû7²ö1­Xy L2ê[|ôÓ|šh[ÏÞêÃ^Çí? Äž®™ðÄö����IEND®B`‚�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/drawingarea.rb�������������������������������������������0000644�0001750�0001750�00000015371�12137115065�021265� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: drawingarea.rb,v 1.5 2005/02/12 23:02:43 kzys Exp $ =begin = Drawing Area Gtk::DrawingArea is a blank area where you can draw custom displays of various kinds. This demo has two drawing areas. The checkerboard area shows how you can just draw something; all you have to do is write a signal handler for expose_event, as shown here. The 'scribble' area is a bit more advanced, and shows how to handle events such as button presses and mouse motion. Click the mouse and drag in the scribble area to draw squiggles. Resize the window to clear the area. =end require 'common' module Demo class DrawingArea < BasicWindow def initialize # Pixmap for scribble area, to store current scribbles @pixmap = nil super('Drawing Area') self.border_width = 8 vbox = Gtk::VBox.new(false, 8) vbox.border_width = 8 add(vbox) ## Create the checkerboard area label = Gtk::Label.new label.set_markup('<u>Checkerboard pattern</u>') vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) frame = Gtk::Frame.new frame.shadow_type = :in vbox.pack_start(frame, :expand => true, :fill => true, :padding => 0) da = Gtk::DrawingArea.new # set a minimum size da.set_size_request(100, 100) frame.add(da) da.signal_connect('expose_event') do |widget, event| checkerboard_expose(widget) end ## Create the scribble area label = Gtk::Label.new label.set_markup('<u>Scribble area</u>') vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) frame = Gtk::Frame.new frame.shadow_type = :in vbox.pack_start(frame, :expand => true, :fill => true, :padding => 0) da = Gtk::DrawingArea.new # set a minimum size da.set_size_request(100, 100) frame.add(da) # Signals used to handle backing pixmap da.signal_connect('expose_event') do |*args| scribble_expose_event(*args) end da.signal_connect('configure_event') do |widget, event| scribble_configure_event(widget) end # Event signals da.signal_connect('motion_notify_event') do |*args| scribble_motion_notify_event(*args) end da.signal_connect('button_press_event') do |*args| scribble_button_press_event(*args) end # Ask to receive events the drawing area doesn't normally # subscribe to da.events |= (Gdk::Event::LEAVE_NOTIFY_MASK | Gdk::Event::BUTTON_PRESS_MASK | Gdk::Event::POINTER_MOTION_MASK | Gdk::Event::POINTER_MOTION_HINT_MASK) end # Create a new pixmap of the appropriate size to store our scribbles def scribble_configure_event(widget) @pixmap = Gdk::Pixmap.new(self.window, widget.allocation.width, widget.allocation.height, -1) # Initialize the pixmap to white @pixmap.draw_rectangle(widget.style.white_gc, true, 0, 0, widget.allocation.width, widget.allocation.height) # We've handled the configure event, no need for further processing. return true end CHECK_SIZE = 10 SPACING = 2 def checkerboard_expose(da) # At the start of an expose handler, a clip region of event.area # is set on the window, and event.area has been cleared to the # widget's background color. The docs for # gdk_window_begin_paint_region give more details on how this # works. # It would be a bit more efficient to keep these # GC's around instead of recreating on each expose, but # this is the lazy/slow way. gc1 = Gdk::GC.new(da.window) gc1.rgb_fg_color = Gdk::Color.new(30000, 0, 30000) gc2 = Gdk::GC.new(da.window) gc2.rgb_fg_color = Gdk::Color.new(65535, 65535, 65535) xcount = 0 SPACING.step(da.allocation.width, CHECK_SIZE + SPACING) do |i| ycount = xcount % 2; # start with even/odd depending on row SPACING.step(da.allocation.height, CHECK_SIZE + SPACING) do |j| gc = if ycount % 2 == 1 gc1 else gc2 end # If we're outside event.area, this will do nothing. # It might be mildly more efficient if we handled # the clipping ourselves, but again we're feeling lazy. da.window.draw_rectangle(gc, true, i, j, CHECK_SIZE, CHECK_SIZE) ycount += 1 end xcount += 1 end # return true because we've handled this event, so no # further processing is required. # return true end # Redraw the screen from the pixmap def scribble_expose_event(widget, event) # We use the 'foreground GC' for the widget since it already exists, # but honestly any GC would work. The only thing to worry about # is whether the GC has an inappropriate clip region set. widget.window.draw_drawable(widget.style.fg_gc(widget.state), @pixmap, # Only copy the area that was exposed. event.area.x, event.area.y, event.area.x, event.area.y, event.area.width, event.area.height) return false end def draw_brush(widget, x, y) update_rect = Gdk::Rectangle.new(x - 3, y - 3, 6, 6) # Paint to the pixmap, where we store our state @pixmap.draw_rectangle(widget.style.black_gc, true, update_rect.x, update_rect.y, update_rect.width, update_rect.height) # Now invalidate the affected region of the drawing area. widget.window.invalidate(update_rect, false) end def scribble_button_press_event(widget, event) unless @pixmap # paranoia check, in case we haven't gotten a configure event return false end if event.button == 1 draw_brush(widget, event.x, event.y) end # We've handled the event, stop processing return true end def scribble_motion_notify_event(widget, event) unless @pixmap # paranoia check, in case we haven't gotten a configure event return false end # This call is very important; it requests the next motion event. # If you don't call Gdk::Window#pointer you'll only get # a single motion event. The reason is that we specified # Gdk::POINTER_MOTION_HINT_MASK to Gtk::Widget#set_events. # If we hadn't specified that, we could just use event.x, event.y # as the pointer location. But we'd also get deluged in events. # By requesting the next event as we handle the current one, # we avoid getting a huge number of events faster than we # can cope. win, x, y, state = event.window.pointer if (state & Gdk::Window::BUTTON1_MASK) != 0 draw_brush(widget, x, y) end # We've handled it, stop processing return true end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/item_factory.rb������������������������������������������0000644�0001750�0001750�00000005541�12137115065�021464� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: item_factory.rb,v 1.4 2005/02/12 23:02:43 kzys Exp $ =begin = Item Factory The Gtk::ItemFactory object allows the easy creation of menus from an array of descriptions of menu items. =end require 'common' module Demo class ItemFactory < BasicWindow def initialize super('Item Factory') accel_group = Gtk::AccelGroup.new item_factory = Gtk::ItemFactory.new(Gtk::ItemFactory::TYPE_MENU_BAR, '<main>', accel_group) add_accel_group(accel_group) set_border_width(0) ifactory_cb = proc do |data, widget| puts "ItemFactory: activated \"#{Gtk::ItemFactory.path_from_widget(widget)}\"" end menu_items = [ ['/_File'], ['/File/tearoff1', '<Tearoff>', nil, nil, ifactory_cb], ['/File/_New', '<Item>', '<control>N', nil, ifactory_cb], ['/File/_Open', '<Item>', '<control>O', nil, ifactory_cb], ['/File/_Save', '<Item>', '<control>S', nil, ifactory_cb], ['/File/Save _As...', '<Item>', nil, nil, ifactory_cb], ['/File/sep1', '<Separator>'], ['/File/_Quit', '<Item>', '<control>Q', nil, ifactory_cb], ['/_Preferences'], ['/_Preferences/_Color'], [ '/_Preferences/Color/_Red', '<RadioItem>', nil, nil, ifactory_cb], ['/_Preferences/Color/_Green', '/Preferences/Color/Red', nil, nil, ifactory_cb], ['/_Preferences/Color/_Blue', '/Preferences/Color/Red', nil, nil, ifactory_cb], ['/_Preferences/_Shape'], ['/_Preferences/Shape/_Square', '<RadioItem>', nil, nil, ifactory_cb], [ '/_Preferences/Shape/_Rectangle', '/Preferences/Shape/Square', nil, nil, ifactory_cb], [ '/_Preferences/Shape/_Oval', '/Preferences/Shape/Rectangle', nil, nil, ifactory_cb], [ '/_Help', '<LastBranch>'], [ '/Help/_About', '<Item>', nil, nil, ifactory_cb], ] item_factory.create_items(menu_items) item_factory.get_item('/Preferences/Shape/Oval').set_active(true) box1 = Gtk::VBox.new(false, 0) add(box1) box1.pack_start(item_factory.get_widget('<main>'), :expand => false, :fill => false, :padding => 0) label = Gtk::Label.new("Type\n<alt>\nto start") label.set_size_request(200, 200) label.set_alignment(0.5, 0.5) box1.pack_start(label, :expand => true, :fill => true, :padding => 0) separator = Gtk::HSeparator.new box1.pack_start(separator) box2 = Gtk::VBox.new(false, 10) box2.set_border_width(10) box1.pack_start(box2, :expand => false, :fill => true, :padding => 0) button = Gtk::Button.new('close') # TODO: Need signal_connect_swapped? button.signal_connect('clicked') do quit end box2.pack_start(button, :expand => true, :fill => true, :padding => 0) button.set_flags(Gtk::Widget::CAN_DEFAULT) button.grab_default end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/gnome-foot.png�������������������������������������������0000644�0001750�0001750�00000005544�11701304107�021226� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���/���0���§#â���gAMA�† 1è–_�� IDATxÚíYkl×y=wfvvf¹»Ü—ø¶)Q¢‡®Ūl#H¬¨qd×mT i›4N A †´(Šnì� šþ‹]Ë l´µì<ä§â8vÜ*–#%RDY$MJæŠÏå>¸»Ü÷Ìì¼·?2T ·€,‹T\À0»³çžïÜs¿ ¼_ï×e»/ýׇ Ýóµ»oß>Ð:qj¼Àýþ…^Ú·o߉¡¡m÷Xíæ—pöd åWMËjoô1Wð[â?kll,°cûСT*5â:6ÑM‹•$eW2þo�bï ð¿xù¥ÑÉ3§ò“Ç}ò3ºÿÆõü›¯}õ–xgô¥­PUÕÑjI´3&–cïò�¸ß+øûÆwM&â rÕ¿%vì£{vÝ€ïéîú”$+Œ¥µQ)à˜:ÚšN•¶Æ˜–ýU�¿OðdçΑ/ËR³7ODzHKR"ÉxôûÉDb›ªëƒ–!ÍzKéÏAHˆiY�0  ïíR»’ºÜedLU©ó(fàyêQŠ–¤ôïûàݵr‘]] Cj6ѪU!É”¶J-Ë€€a�³å>—­Áå奂�‹JŠ‚zµ‚|q “ççˆEï0Ÿyúçæm{©¦µA=åJ™|¶ã¬7xx#™¿l«ÔuSÛ6Ð}Wz6˜™#gÞ˜%r[%-¹M²«¥ƒ–i|¢Zov,e ˜|óŸçQÀpÀ"�zÕÀ}åÃ_¼ëówÔª•âñ_Ÿ¬hšÚU®ÔvycŠª­­ àѦ¬¤Y†|´)ÉB&_‚ã¸Ä; àq�Õ«¶ßtÓMb¹\^”¥–÷ÄcÏŽŒØ& ÁG�Ô}F+�îå8nÿu;·ÿhdhp6ÒZbæe�w7Û%5¿ÿ“· 3 3Ôjµ`*Íá-ñ賎û¤n˜�xÊw€�-�8pàÀéh$Rwmcg.›#««…\½Ùšm´d몂g ¬•Kdjê,ÍJ(”*Û}–ïðk_z�úâÏ~º'žHýíµ×^sk¤£#¥È-¦­Èdzü7vq5_ÏVONžKçÄøÔÌF8Î%5¯*²¸­'ö¹QcŽþêÎ]X„iÙÃ�žõõëÞ÷Ío„<øýëGG¿ïŒÞÐV”Ë4PŠ¥…y°ŒäÃz[¾®Öl}¶Ñ”Nj†™¿Òƽ$ó¯O¾‘?õÛñ)ž#»³…"Ñ �::Bâͪ¦Ï?ôàƒ±OìûøK× îiTËðAªDZõ*ÄpÍz0 m[”6–V 1YQ¿ àO|¹mªÏKO½ø_·gìƒÿ^ªÔ†|Ÿ6<JÛ{÷îíØ÷ñ[ÖÓÛ󇦮AWUšžž Z[¡Õê±-„åž_¢ƒ½ R\«Ò|©B,ÇÐ¥à/%òõ¯ß+&S)í§?å5JiÖó¼–a~dÙökÏ?ÿÜýÃÃ#¦È-È­:YLŸC«^%Íz”RO$`êáàôÄ42Ù²«eâ÷ÈÓ� ›Å<33=ýÍ­[·þ}³¶úØ£ó?öø?Î-eu=OýÁ#¸¿¯ï+ŽmžâÂòò+‹°-,Ç‘Žpº¦]ÓŒÇH_w ÇÇ'×5®û»9ÁìᇾwCW*ñmÓÐ#µµר–¯ëÙ’<448°€5<<|<—³l›– +¨UÊ`–D¢QpG]Ç ÒD2‰JµŠÅ•<$Y¹˜2�Ô6­aŸxâpu'ÀóŽ€Î-­ X®†cÑð?ˆ¢pw,ù Òr±€Å¹4ÕÕ6 ð<µ,“0 ÏóÐn+¨V*ôìôyœ™z“x…o‘G|ð›ãógÎNåÂ<{¸+ÿÂj©J.,­ Úhaë@ï®T"±€&šõ14ª,An«Ð4XÉd’´šuÌÎ/’ó1y~†yqšð �m37)娩³÷'bQÏ0ÌÏi†É –D‰D’‚¦¡¡\ÈB… šÖ*5Äã1œ9;A³…UrjâmJ y‹< �þÀ¿i7 <k´äoøLÝ`@7¬çD!([¦N’½4(ˆ°-¢ˆC[1sþ<òÅ5;y–ê¿cÛÐ0àQ�GÿÖÉ»Ñÿ¥|ÞóÓâ�¿¶§ Gz뵪ËNETŠy˜†ÏóÀ³ ¦gçà·ö3P@€€=üÃÇ?”ÚÒuÝ)K-” ùåñññ=u$ ÀÚ¨M þËÖüŠª†u]3µ¶Ì b®ëRÏs‰¢(t9·JJ•ú:‹/û2™à�À‘gŸ¾iûжGú®ùièımPÏõRïýûo½ùÇÿyüô½�¤ ?I@znAn·U…Rt˜†NÃÑN(R“6 Ô›õONm�ÿ`~ø·¿u_߇wíz™òq×¶‰çºTn5`èÇA­Þ`‹åê„ ?e˜ÖAå6<�³Z«ç®èq¶e!à‰(ŠðÛÔ—Èì[¤ÓéÄbz&¤*R]½�Y[Íö-Z.®"[(a>“ƒiÙŸðÄ¥âûoå²¹‰ë¯Ù#vD�P0Ƕ‰`Y®ëooÌÃÏ<—WšÕ'oûØ-_n˱LƒºA±œYA¦P„iÙ�òì͘˜¹óK˯êºF M%‘αM,Ë¢§+…Á¾"ƒýä¸å—~yâŸ^=ùú3,ÇÑžAÒOV³×u±V­_\Ùwâ>ïzVY©TÕ?øÀŽ/ÏlË$ŽãÀ²,DÂ!ù�M%c¡î-‰”¤¨¯™–ýV0íù¥ÌÌŸÿåçìélV+T‘%drLÌ\€ãº�0ày?m¸lÐ’•Úøë'ÇFGîL%“4D2IEMÀ £ÔëM‰F>ûéOÝy3Šõ¨·°ã׳ݽý}±X|wo_oÿÊü,µl ¶ãbi¥�ãúå�uSÜÆ/#[(=948ðÇ `zz{a[aY᎞GPIg,¾íÚí#ð úúûHu¡^-CmËà¸�Š¥]XÉ_äÀÄ;ñú+™{¿˜>¾¶V™WU ¶mƒåX0, Ï£4ÚC<‘ЪW©®©`Yº¦"³Fni¥|¹•e̤Pk´Ößû� ï$>\é|Þr=×NÆ"·«í6  C�JY¦Ç’b!ǶÈZ±@MC#Å\†VË«¤V)cöÂ=vjªn¬çüïøÌ»› Þ[«5ò‚ ìòÜVI’a[xŽƒØÑA¢qD¢1†×¶‰ ŠXYZ�¥ Éd2ôÔÙÌgrç[�óçAWåfD/Wk3Çý‘G½„iZ„eâyxž'�ˆe™„BD1D8–%kkeL›%ÇOOÂõ<øáí²æ^-ðÔõ¼FµÞœ$ 1-;Ñ”dhªF$©EmS'–eQ]Ó‰m0Mƒ,g2xýó8vê,Õ~7ð|Æ/çjf£Š0Ö½%ñÏÑŽÐ^Â0l8$Òî-I° ƒ(J=j;.–²«XÈäˆaZëÞÊbMoÖåÛ;M©C| ð-Q®8΂<‚< ‰‚<e†ú^N}Æßôg8ÞE�DÜ à»~Ž×|F=ÿq}??àvnÿ®þh³ŠñAõû7"ÛtûŸW|/?ç ­÷ø·CÀ—ñ󽽞ó߯÷ë*Öø À樕ÇF����IEND®B`‚������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/button_box.rb��������������������������������������������0000644�0001750�0001750�00000005047�12137115065�021163� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: button_box.rb,v 1.3 2005/02/12 23:02:43 kzys Exp $ =begin = Button Boxes The Button Box widgets are used to arrange buttons with padding. =end require 'common' module Demo class ButtonBox < BasicWindow def initialize super('Button Boxes') set_border_width(10) main_vbox = Gtk::Box.new(:vertical) add(main_vbox) frame_horiz = Gtk::Frame.new('Horizontal Button Boxes') main_vbox.pack_start(frame_horiz, :expand => true, :fill => true, :padding => 10) vbox = Gtk::Box.new(:vertical) vbox.set_border_width(10) frame_horiz.add(vbox) vbox.pack_start(create_bbox(true, 'Spread', 40, :spread), :expand => true, :fill => true, :padding => 0) vbox.pack_start(create_bbox(true, 'Edge', 40, :edge), :expand => true, :fill => true, :padding => 5) vbox.pack_start(create_bbox(true, 'Start', 40, :start), :expand => true, :fill => true, :padding => 5) vbox.pack_start(create_bbox(true, 'End', 40, :end), :expand => true, :fill => true, :padding => 5) frame_vert = Gtk::Frame.new('Vertical Button Boxes') main_vbox.pack_start(frame_vert, :expand => true, :fill => true, :padding => 10) hbox = Gtk::Box.new(:horizontal, 0) hbox.set_border_width(10) frame_vert.add(hbox) hbox.pack_start(create_bbox(false, 'Spread', 30, :spread), :expand => true, :fill => true, :padding => 0) hbox.pack_start(create_bbox(false, 'Edge', 30, :edge), :expand => true, :fill => true, :padding => 5) hbox.pack_start(create_bbox(false, 'Start', 30, :start), :expand => true, :fill => true, :padding => 5) hbox.pack_start(create_bbox(false, 'End', 30, :end), :expand => true, :fill => true, :padding => 5) end def create_bbox(horizontal, title, spacing, layout) frame = Gtk::Frame.new(title) bbox = if horizontal Gtk::ButtonBox.new(:horizontal) else Gtk::ButtonBox.new(:vertical) end bbox.set_border_width(5) frame.add(bbox) bbox.layout_style = layout bbox.set_spacing(spacing) [Gtk::Stock::OK, Gtk::Stock::CANCEL, Gtk::Stock::HELP].each do |stock| button = Gtk::Button.new(:stock_id => stock) bbox.add(button) end return frame end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/entry_completion.rb��������������������������������������0000644�0001750�0001750�00000003135�12137115065�022366� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # $Id: entry_completion.rb,v 1.3 2005/02/25 17:09:24 kzys Exp $ =begin = Entry Completion (EntryCompletion) GtkEntryCompletion provides a mechanism for adding support for completion in GtkEntry. =end require 'common' module Demo class EntryCompletion < Gtk::Dialog def initialize super('GtkEntryCompletion', nil, # parent 0, [Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_NONE]) self.resizable = false signal_connect('response') do self.destroy end vbox = Gtk::VBox.new(false, 5) self.vbox.pack_start(vbox, :expand => true, :fill => true) vbox.border_width = 5 label = Gtk::Label.new label.markup = 'Completion demo, try writing <b>total</b> or <b>gnome</b> for example' vbox.pack_start(label, :expand => false, :fill => false) # Create our entry entry = Gtk::Entry.new vbox.pack_start(entry, :expand => false, :fill => false) # Create the completion object completion = Gtk::EntryCompletion.new # Assign the completion to the entry entry.completion = completion # Create a tree model and use it as the completion model completion.model = create_completion_model # Use model column 0 as the text column completion.text_column = 0 end def create_completion_model store = Gtk::ListStore.new(String) %w(GNOME total totally).each do |word| iter = store.append iter[0] = word end store end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-line-cap.rb����������������������������������������0000644�0001750�0001750�00000002261�11701304107�021547� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-line-cap.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Line Cap This demo shows how to use GDK and cairo to set line cap. From http://cairographics.org/samples/set_line_cap.html. =end require 'common' module Demo class CairoLineCap < CairoWindow def initialize super('cairo line cap') end def draw(cr) cr.set_line_width(0.12) cr.set_line_cap(Cairo::LINE_CAP_BUTT) # default cr.move_to(0.25, 0.2) cr.line_to(0.25, 0.8) cr.stroke cr.set_line_cap(Cairo::LINE_CAP_ROUND) cr.move_to(0.5, 0.2) cr.line_to(0.5, 0.8) cr.stroke cr.set_line_cap(Cairo::LINE_CAP_SQUARE) cr.move_to(0.75, 0.2) cr.line_to(0.75, 0.8) cr.stroke # draw helping lines cr.set_source_rgba(1, 0.2, 0.2) cr.set_line_width(0.01) cr.move_to(0.25, 0.2) cr.line_to(0.25, 0.8) cr.move_to(0.5, 0.2) cr.line_to(0.5, 0.8) cr.move_to(0.75, 0.2) cr.line_to(0.75, 0.8) cr.stroke end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/demo.ui��������������������������������������������������0000644�0001750�0001750�00000027402�11701304107�017726� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> <interface> <object class="GtkListStore" id="liststore1"> <columns> <column type="gchararray"/> <column type="gchararray"/> <column type="gint"/> <column type="gchararray"/> </columns> <data> <row> <col id="0">John</col> <col id="1">Doe</col> <col id="2">25</col> <col id="3">This is the John Doe row</col> </row> <row> <col id="0">Mary</col> <col id="1">Dole</col> <col id="2">50</col> <col id="3">This is the Mary Dole row</col> </row> </data> </object> <object class="GtkUIManager" id="uimanager"> <child> <object class="GtkActionGroup" id="DefaultActions"> <child> <object class="GtkAction" id="Copy"> <property name="name">Copy</property> <property name="tooltip" translatable="yes">Copy selected object into the clipboard</property> <property name="stock_id">gtk-copy</property> </object> </child> <child> <object class="GtkAction" id="Cut"> <property name="name">Cut</property> <property name="tooltip" translatable="yes">Cut selected object into the clipboard</property> <property name="stock_id">gtk-cut</property> </object> </child> <child> <object class="GtkAction" id="EditMenu"> <property name="name">EditMenu</property> <property name="label" translatable="yes">_Edit</property> </object> </child> <child> <object class="GtkAction" id="FileMenu"> <property name="name">FileMenu</property> <property name="label" translatable="yes">_File</property> </object> </child> <child> <object class="GtkAction" id="New"> <property name="name">New</property> <property name="tooltip" translatable="yes">Create a new file</property> <property name="stock_id">gtk-new</property> </object> </child> <child> <object class="GtkAction" id="Open"> <property name="name">Open</property> <property name="tooltip" translatable="yes">Open a file</property> <property name="stock_id">gtk-open</property> </object> </child> <child> <object class="GtkAction" id="Paste"> <property name="name">Paste</property> <property name="tooltip" translatable="yes">Paste object from the Clipboard</property> <property name="stock_id">gtk-paste</property> </object> </child> <child> <object class="GtkAction" id="Quit"> <property name="name">Quit</property> <property name="tooltip" translatable="yes">Quit the program</property> <property name="stock_id">gtk-quit</property> <signal handler="quit_activate" name="activate"/> </object> </child> <child> <object class="GtkAction" id="Save"> <property name="name">Save</property> <property name="is_important">True</property> <property name="tooltip" translatable="yes">Save a file</property> <property name="stock_id">gtk-save</property> </object> </child> <child> <object class="GtkAction" id="SaveAs"> <property name="name">SaveAs</property> <property name="tooltip" translatable="yes">Save with a different name</property> <property name="stock_id">gtk-save-as</property> </object> </child> <child> <object class="GtkAction" id="HelpMenu"> <property name="name">HelpMenu</property> <property name="label" translatable="yes">_Help</property> </object> </child> <child> <object class="GtkAction" id="About"> <property name="name">About</property> <property name="stock_id">gtk-about</property> <signal handler="about_activate" name="activate"/> </object> <accelerator key="F1"/> </child> </object> </child> <ui> <menubar name="menubar1"> <menu action="FileMenu" name="FileMenu"> <menuitem action="New" name="New"/> <menuitem action="Open" name="Open"/> <menuitem action="Save" name="Save"/> <menuitem action="SaveAs" name="SaveAs"/> <separator/> <menuitem action="Quit" name="Quit"/> </menu> <menu action="EditMenu"> <menuitem action="Copy" name="Copy"/> <menuitem action="Cut" name="Cut"/> <menuitem action="Paste" name="Paste"/> </menu> <menu action="HelpMenu" name="HelpMenu"> <menuitem action="About" name="About"/> </menu> </menubar> <toolbar name="toolbar1"> <toolitem action="New" name="New"/> <toolitem action="Open" name="Open"/> <toolitem action="Save" name="Save"/> <separator/> <toolitem action="Copy" name="Copy"/> <toolitem action="Cut" name="Cut"/> <toolitem action="Paste" name="Paste"/> </toolbar> </ui> </object> <object class="GtkAboutDialog" id="aboutdialog1"> <property name="program-name" translatable="yes">GtkBuilder demo</property> <accessibility> <relation target="window1" type="subwindow-of"/> </accessibility> </object> <object class="GtkWindow" id="window1"> <property name="default_height">250</property> <property name="default_width">440</property> <property name="title">GtkBuilder demo</property> <child> <object class="GtkVBox" id="vbox1"> <property name="visible">True</property> <child> <object constructor="uimanager" class="GtkMenuBar" id="menubar1"> <property name="visible">True</property> <child internal-child="accessible"> <object class="AtkObject" id="a11y-menubar"> <property name="AtkObject::accessible-name">The menubar</property> </object> </child> </object> <packing> <property name="expand">False</property> </packing> </child> <child> <object constructor="uimanager" class="GtkToolbar" id="toolbar1"> <property name="visible">True</property> <child internal-child="accessible"> <object class="AtkObject" id="a11y-toolbar"> <property name="AtkObject::accessible-name">The toolbar</property> </object> </child> </object> <packing> <property name="expand">False</property> <property name="position">1</property> </packing> </child> <child> <object class="GtkScrolledWindow" id="scrolledwindow1"> <property name="hscrollbar_policy">automatic</property> <property name="shadow_type">in</property> <property name="visible">True</property> <property name="vscrollbar_policy">automatic</property> <child> <object class="GtkTreeView" id="treeview1"> <property name="visible">True</property> <property name="model">liststore1</property> <property name="tooltip-column">3</property> <child internal-child="accessible"> <object class="AtkObject" id="a11y-treeview"> <property name="AtkObject::accessible-name">Name list</property> <property name="AtkObject::accessible-description"> A list of person with name, surname and age columns </property> </object> </child> <child> <object class="GtkTreeViewColumn" id="column1"> <property name="title">Name</property> <child> <object class="GtkCellRendererText" id="renderer1"/> <attributes> <attribute name="text">0</attribute> </attributes> </child> </object> </child> <child> <object class="GtkTreeViewColumn" id="column2"> <property name="title">Surname</property> <child> <object class="GtkCellRendererText" id="renderer2"/> <attributes> <attribute name="text">1</attribute> </attributes> </child> </object> </child> <child> <object class="GtkTreeViewColumn" id="column3"> <property name="title">Age</property> <child> <object class="GtkCellRendererText" id="renderer3"/> <attributes> <attribute name="text">2</attribute> </attributes> </child> </object> </child> </object> </child> <accessibility> <action action_name="move-cursor" description="Move the cursor to select another person."/> </accessibility> </object> <packing> <property name="position">2</property> </packing> </child> <child> <object class="GtkStatusbar" id="statusbar1"> <property name="visible">True</property> </object> <packing> <property name="expand">False</property> <property name="position">3</property> </packing> </child> </object> </child> </object> </interface> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/gtk-logo-rgb.gif�����������������������������������������0000644�0001750�0001750�00000014433�11701304107�021425� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89ak�Œ�ç��ÿÿÿïûõïô󪫹ÔÄèÔÜÔ˜¸­Æ¹ÅÄ/L”\lÀu’x 4# "7èÕï„x¤:Z¬5d Y$]'+4 ."dª¢Ü»Ò¼-E76Z7nNdlG7]9<E$.˜,d `jn'$2H*XDMM7,>$7L 5(4…=`Ûëà-LE*48  ; &M–=rá2fÆpˆz$L-M¸>vâ!C‚ÌåÚ %<’/e®o{,D´9MG 'Þõç=WW +T›,[Ÿ’ª¬43\Ç,  7gÓOkw1U» Ã¸DVr¦” ‚¤Œ=!2kFZûîú&Rl #4Td\ھس˜JmÍ ,š~¬ÕÌâ($;DL&p,X%I 5'iU!¤):ÉFA9GDjÓÔÖÕ<HõNL—91>e²)<9 H ØFE‚,)7 ëIKj)%6#&¨89;4P 4E&¶@<G[žL%7)\4T**b4ö^d"f)G#X$*TLZ'' Å9CªA5ß?Jo3&o' <,T2¶5<V\+}/ 9Ƴԑ|­–†Ì& Hêãòº¥×¢–¼É»áíìïïÛ÷…oŸ6|‚ެ¦‡¹B\VƒàrЬ7WOxÐgŽt\„Nr”OT^¢B¬ZY_-¬1ž:¬AÑ@$œ,Ú’ÜGÆF;à<XÕªá<è<äÈí5¹9 D1r4ÖµÜ5Ó8+Š.(¸,Fd&•+r+‡;§?š]¶z<œ9š<\JhN¦T»œÊJlH2‚4&¤*»”ƈ4,ƒ/3Æ7t"F$t*%|!“4´,<X "H88i’'79<žÒœRtXŠV~<‚„ˆ‡]Š˜Œb„[+aìx€^6LŽFœ¦t¬ˆS j9yz^„nFt–n¤nŠLÿÿÿÿÿÿÿÿÿÿÿÿ,����k�Œ��þ�H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“  \yR€@—/YÊ4s`€fê4 €�T D@Ájî\Y ƒ†F0B… .`È t)I 8tððD#*Œ ÁÀ‰pkŒñâu$'N H1BÅ ,ZXuñb¸ˆáDZw#Œ+d¨˜Ñ†ƒ,lÜ`P 9t¬p€¸D¨7Ø!ƒ•8`PÃÁfjôð‘ƒ÷͈/LŠšš¢J /‚ÐèÐÁ†l Hܸ!Þ9zg²âmi84‹þ3 @¤AlÓvÀbôeE²gÇŽ=¥K„%þ!#%ÄAÈÆÙhÓÕ€Coõiç`S´pC~£ô§P�A %HWÂtm‘vCñÉÇ |>4˜âÞ•pA àYhPJ,A‡~(Ût,0ñC&Η"ŠCÎwÅa¥…†Œ9ñŽˆÝ Û” @¡ƒƒ¼5¤ÚqGZp¤X@QHñ"\Ö6eS´d–¦Xä–:¼�b¥˜R\T¥Ž 2AdvP0CMà  àp%‘õ ‰ƒ„¥ÝpÊRBY±D‡ÞMwÙlBL‘å h6¥l5„¢zP §þÜ10abK%qE‹9JY‚@+ÀªõÂ,Ø6儳æGÁ‚[j7°•¢2YЀët»Vaâ-œ:®ù…›#š,4!*}Ù51‚¬¥a° ü™ë¡šÈ"¶ùmÆB¥Nh[¿•V0…vCú0A ¸†TIZ´p&š:º *ƒLˆ(®¸³"›,¸h: ­‰¼1ÑBùÅ’�[àŠ˜?8„[û;B: ¬ÃLÖ­;n|ÃpΗƒ¢$#F*`EÉÂuY ‚>¨C·ãF9âÀB«èCÝJÕ7Ô ôƒC#‰æ(ª¨–áÞ0BB¸ºÂ�GÉ@­fÍàþœCd6t·uCÞsù®yNDWAš†[ÖÍzv'»%Ô ­ŠÍÖ7\]¼ð凇‰€îœsSÑ�¹�QTýaÜ[É`hRš"€Œ.ÙYúðÅe-d¦,Ù Ë÷BÓ¡¬âJAÂçqA´v`0@i,ÂUAì½<¶ñ@¿™Ø\b‰â'×^ÊcDÆQÖP†«pò6"˜Áù †ù›zkÖ|¸U)<ŠKô)\ *ÅŠõaI ÀO¿6S³Ø¹ê~E�ÌJ�šEêM˜ÃNþU»e-RrÊÁïJÓŠ…(!'€AÐT6 ¬{ZÚŽun7®”è„þ*ªÙ£æÄ›{ÉæC.H`ÐR¸%­Ì¯èŠ@œ0ƒ<�1RÀ€ ä¶DMM-NCS| '·4áY?`ÂØ„ðUˆ&Ü[‘ìW4¸ÀB�èŠf ƒ#\àjà€âÖ½ïõîY`€Ø‡(@¸½¡h°MØ\0„ïOwK$]œb!‹Ö•`!Ã,† °¡ nxCà ¼qP€_íz'‰Ìn#ãXHG ‰7´€B,j±† Ø!Vàc Ô9ÌlÈbtðAAn Tdî FFüÆjì© ÷¸HF&îm :¸.fÄ |ÈBìðÁ”wþÀCÌt€@ ,\Ц€|u°š½¹Ÿø@׃’±xDœ#o¨°† HF»èD x ìá4àCü€<üpá¢Æ»¬1!Œp] ‹4©ªmljôC別ˆÆ‚ hÀÒP2ôÂ6¸À/:º…#Ðà€DIñ 3¹èÓ4Ÿ§p;Žý€GºØ"Õòƒ–q>è¤ÅL ¤áÀ†\…A‚ #(yÌ B ˆ©â!„‚‹.PƒB”¯§>0\ ƒ&™ön`CøÁ¦bv™`òƒ½ó->`Èà k0ˆA aÜ@ Å@H�‘†#ð!ª~Åþ"øY>¨ ôÓRWÛ‚&ÍQ>ÞT™ÝzGÂéJWXÁ†(c´¤%-%JP âÐäxjb[R? áE|@¬$@:·‹\c÷ô‡± @A—åÕÃVpOX�Ä€n~I{Œ°i€"NÐ Œ”»xðÃ"PúÇ#`€ X«oü6Á(ÁnKÀ ®¤I¹êVG¸ÁÝç7н@2ˆðA¤REp ñÇI! .X£‰˜ ·`+c,øAC‡Æ?qQàr¯”O~€‹ÖÀ% ÆØotõ«ŒDªAyiÄBÚ‡Ë ^æN ½úŒ@’®ëØþˆ$®$à°¿ÔÁ"ó¥,C¿¤….t™ŸR$$�Š Š`¿ dƒÔÀ‡4”á€(Š‚tš&ÖvÒæë Œ°„ Ôµk‰ñ]f¬vÄ^Ć©>¢Ðx ÃS£ùâ#À¡Uõ Í<Ô1±Þ`"7{“N#È SÎ5±‰ñ쌷<C!8Bmû ë©"R­tHJôÁH%EÂ…=pSæt ‡=4`BPƒ  1ZR+;ºÂ€K4lbHt@°Ôvu¡AmK µåÃ$119ú` ž›’"¥¤Þ-ý� hÀdù°ü*[Ï÷&FþK ´$�”˜Øàåjÿ 4`ƒ$±àHafÜë͆P‘A'Ç»$[ ¸\àR˜†~I-ê<›˜½ûVm%8´ò–—ôÕöCÁ-q‡?XâE ÿ˜@§—Ct a]6°Àrá"…=ôÂÞNû²Ù{ׄ8â-¯µºË¬@\‹PƒÑ·xɳòf6`@Ò°ëÚRîS9•Y‚Ô"D�‡ Ô‰«»|ªsÈv.¡OK e·…¤ƒg1@ Ù„ÒP<ä£-Ÿ]d ) $�•è@mYþyîÂL°5é™�P�Ž=]-hKZ3!)\£Þ£–²½)þaˆ¦ƒÓuÑ(ðˆFfåçî#ñ’Z{ª~�ÄÊÝ7P˜ÙtpÆX`… ³WÞ‡{£v 6À &Æ ŠU¶€¾'À!Àu…¦ R° °æ– l~x€ /Ö!¹C<½Á •sE@W4€ qe€  ¾ `ÐÎ eßGyQ§Z |j` ž ctP‹°mPhs�fBzß%X5¾”ŸÀ�ièU‡e÷†}ØG ¾@Yp †@O@jÙÀCÑ� `ÂÇ€ †Òv&È] MrØ]o` | 7ÀR¡‘n1Ði6àþAZ’yÑ•†»’6�\Xb¾ÐUÚ Ò–„ܵ ~ô0ËDVR@Üc‡f _w&(>�\pˆÞA•Ð ‡{ÝH$Ћ$ÐKGZáPPÖ I$Ó‡qàyÝå¬8hùáw±um– ÜàW‚Ї~è�ÐCà ÇP‹K° ·§ƒËVZo!A @ŽæHW¦l˜{À!q` [s –Àâr|ðÜE¸ŒÝµ ‹�F·”à øÑ‹K@o2¨}ѵrˆpqö #—<Ƹ÷´ t@~EAM)^ˆÁo`un "ems þ H†�œ`а Ýpޤ¥ y|–ŽpÊðqÊЀ~¦0°ø’Û[ßà’€$x_—Hˆ~4à¤7Uƒ` 6Ð�r¥ “¨ƒÁ  Ù`6P”r—_#W àtúÕ < ‘3@2›€É7UtPcA”}‚x° !¥„0Uß�6�Œ¸``†`à §gáW `Ž¥æÇdŒO@2Ü@}YR‘Pc€t&¢ˆj 16„°`|pxð ‹`Oƒž¹ ½È)• l9já 2$ mIZað°0°o± ß@|~… ¬Øš•öG~þ· „p àP×ø ƒ@A€‘æÈ $0oë°“£¶{ê Ëà™ÑUœpñlJ/À nÀ†  X•.²Lmà~ð€à߇¸QrÙ`Yðä™ Â�rÄ  ìUQ™qŽ.Òƒ‘ú)ÎøŸ±õ8˜ÙiJâ@Rt âÙ‹A€™¶G Ý`6P¡%Îð; ]Ê€‚áR ¹ˆbô l�ÏRÜ  j0ÕmÀ—o€ùväð~â飊@jÊ`‡H¦`à †€ %F‘ùAÈ _hbU†wÉФå› ¥{Xm„ kjt¦Ôr’Pþtʦ ÚAY`žÄ l†b)Z!7¦pqeŒq¬ã"›° µY|‚ ¥ýÈù4Un``pˆ`p¨j™Ž6à fðÌ` ÌÀ ÂU–•ÊC¡`r ¡'�ä/ùyH [èW5 O wÌ�‰·óh*¤Ê°<„$°ù¨oq‹À«�Qð"}PUTJ¬(•F÷”S% `¡ŽZŸdZ¦%œ0޵.Apg2 ÃÍ�®OðG›–`›.§ ¢Zl°m÷Ø®K€6¯¤e¿Ù!7° °Î`‘ú£»ð“GWÎÖ¤N:Щ–pþ®.7Á^üX‹v{ZRnpl¦&f²ˆAËp Yà Šͺ­(†ô€²dò",+Å÷ á¢åš®®Ù•Œù®fÙ_Ú!ÎÀ cˆ+äÉ›¹Ø“`ЭõÀI°œŠ° [m3$Š+~@séz]êW‘ðÞ—£¶™BëP™!KàžÉ ¿yÚ€²€&Xäð‹·°VJ ^PkmöW[ìZi ÚZbG‰+4`>š2ð\ô©lëà!GP (+`µEp[hXWR·¥7+[€ÀŠ"y›’f™o 2 !‹¡…g] ¡€²Q þDÛ`Ÿ–|€µ G^Éf7à}Ê ¢ˆ1™Ë›¾ÃÙ–£u¾>š” !�•0h}ðj`¹¹km»ËšÉZ|tp­% ¸ù•o¢žŸœ‚&¾Ð…ÑU¤„j a½æu›[m~ /˾Õö ,§ (V$P¦©{`�wºº% Á Q 7``ç€ k°»¥qšÌC6pgxv“•¦7Ù‹©[f0²Ê¶ f2%`)Á‚ŇŸ7òb`Å÷Wt A$0Ÿ£f¤â¢·c¦ YYà“&æ `H7p‰ !�`&PܲŸçä w…æ êÉŽÂùþØP­ ù›#\)Ç`Æ¤å ¨¢ °vƒÆç ÇêçWTL·3[ûk<tÞÀˆ¶.0¤;ˆlv-Ì�½djQ4Š ¦ÔRರ† .Š´ìrYŒ|œgÇ @‹gt‰­ÂU`à“Á ‹< ŽŒÇ�Hm` Œ`KxË%`˜›lhz¼+F\b^¬ž¬wÁ¶ÅŒœÐ Ý`ƒpJÁ›'29ÍŸHu¥QªÅ·Í$€«ÄP´Ò¾TÄmмä ÝÀ /š*ѤoA*Ê]yКߋ»Ü•Þá�¼¡ì‚þ¼lÉœÀ#¼ pJZÌ�/" €þ‡ÀüVà ¯å‡l`ϰ¶O„ùÐy¬ÅŠ;ZŽè¡w k¡OÐ %Æ€/râ"Lœ ÀŠûx‡Õ¶ ­ù¿xͱ¥³’Ѿ™Ap¶y¦ á ´<;eŠŒ&Þ ‹ƒè�‡Gh 8]Õ%5[ùA¶ÉøŒ‹%– *Ó¬IêÑŒ¨ÌVëê“é` qà ßÐe—u©ù0€@Óp]hžæ4íË­ù1º~}ŒHZÝ@ -ò�o@™j0£×˜o[yP %€ÃÕVGG lÙ.€{¹Ù¾P†µÅ  ¡ ¡i ‹` €0„�Ì`tír�%-Àˆ³¼þi€·_j‘j`�›R tá{*�® èá’Ãêr1 ÇÍŒ~ålö¡&öºù¡Ïš}õ¶©Êk)… Ô+Z°\ñ¶yo ÏøØo½¿~Ð"˜gß\KàÕâüÀæ� Pr i=‡@ ƒöb–°§V„�â{§Å\ ƒˆzÀ‘xÌÛz¨5)øð)9 û-Ú×GÀÒæážxÅSÜ"Ÿ\bÝ`¾H“[ààÊ&™A@T\<°bÁi…°Oå"§äã×-râ:² ü‘Djƒ ù"»! ) )) €.Â=îr!>U˜Pþ lbzˆ•Ðˋ؈÷êT7œ £M…Ð’o å!¾ ÁΜM¡Ç° DMÝrI 7¸¥îà× £ Âç¹Z^h‚%ì “‰× êÀ;º\Xæ;°î°�L3íãÙ¬ -ÒËë¡^m¾ k6)ÅÆ!�F@ ï GçéíãEè4ÞÇt<YÔº(`]"�º€ ¬qåÒ k›¼¿×nsÙþ¼ÛN KÝZ–`¦á"¡ í`åbµe¹W<C”ýîÎ+eGYGˆ‘øþª�‹3�º°B•R‘®å0Ù%ÐqjÛ%Æ*c àÎ0JRþçÁ»Øx%ààxv” œRúPª`@%UxŒ`˜€$Ú¾í%+0 ¿íPEtÞÚèîWûägȈKG¤¡\°0âQ�kp[ÐBÕ5M´j›½l•ˆ,LÒ† 2@ç¡ àS AQœRÆ ü¼Lu—ö� 2ÀnA|лP9÷¢kÛÉ<BuethÏ÷á« rð�k²&A\ì™Ïj-ã²EÏ÷°S¾!+üe¥‘ùK§¼Ê~ňWŽoZùuuñ°É~0C¸q玥 ¯Ï€ QÐoò`Éß%A]bÐ�ŸþÃûû �OÀrî�z§ÈCš_æ@ ¥‰.ý<1µðTÖÇH Ñ¡”A‹¯@þQ •áA0ßéþ�QÂ3sY\¸á D‰x^�<„QâDŠ-^Ęq"»4Jи`cáHaZ88RâB }h„SæL‹;– 1²Ä ÔF)òxÏáÄ—4EúðZrŽ´ÄÊ€‘ î¹LšU«Æ¢ÉœQâ aP8‰q! ½­mÝÊ´c¡Á 7nð˜QBM±·}ýZLbAFÎ <ˆÐõïâ¿¢ˆ,lÏaQÅŒ-kݷϨ¡—=·}@¤/•?ŸNÀjÖ­]¿†5 �;�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/expander.rb����������������������������������������������0000644�0001750�0001750�00000002501�12137115065�020576� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # $Id: expander.rb,v 1.2 2005/02/25 17:09:25 kzys Exp $ =begin = Expander (Expander) GtkExpander allows to provide additional content that is initially hidden. This is also known as "disclosure triangle". =end require 'common' module Demo class Expander < Gtk::Dialog def initialize # as opposed to the GTK2 dialog, the buttons have to be enclodes by brackeds # together with their ResponseType AND all groups have to bracketed together super(:title => 'GtkExpander', :parent => nil, :flags => 0, :buttons => [[Gtk::Stock::CLOSE, Gtk::ResponseType::NONE]]) self.resizable = false signal_connect('response') do self.destroy end vbox = Gtk::Box.new(:vertical, 5) self.child.pack_start(vbox, :expand => true, :fill => true) vbox.border_width = 5 label = Gtk::Label.new('Expander demo. CLick on the triangle for details.') vbox.pack_start(label, :expand => false, :fill => false) # Create the expander expander = Gtk::Expander.new('Details') vbox.pack_start(expander, :expand => false, :fill => false) expander.add(Gtk::Label.new('Details can be shown or hidden.')) end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/changedisplay.rb�����������������������������������������0000644�0001750�0001750�00000027174�12137115065�021620� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (c) 2003-2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: changedisplay.rb,v 1.6 2005/07/30 11:22:15 mutoh Exp $ =begin = Change Display Demonstrates migrating a window between different displays and screens. A display is a mouse and keyboard with some number of associated monitors. A screen is a set of monitors grouped into a single physical work area. The neat thing about having multiple displays is that they can be on a completely separate computers, as long as there is a network connection to the computer where the application is running. Only some of the windowing systems where GTK+ runs have the concept of multiple displays and screens. (The X Window System is the main example.) Other windowing systems can only handle one keyboard and mouse, and combine all monitors into a single screen. This is a moderately complex example, and demonstrates: - Tracking the currently open displays and screens - Changing the screen for a window - Letting the user choose a window by clicking on it - Using Gtk::ListStore and Gtk::TreeView - Using Gtk::Dialog =end require 'common' module Demo class ChangeDisplay < Gtk::Dialog # These enumerations provide symbolic names for the columns # in the two GtkListStore models. DISPLAY_COLUMN_NAME, DISPLAY_COLUMN_DISPLAY = 0, 1 SCREEN_COLUMN_NUMBER, SCREEN_COLUMN_SCREEN = 0, 1 # Main entry point. If the dialog for this demo doesn't yet exist, creates # it. Otherwise, destroys it. def initialize @size_group = nil @display_model = nil @screen_model = nil @screen_selection = nil @current_display = nil @current_screen = nil super( :title => 'Change Screen or display', :buttons => [ [:close, :close], ['Change', :ok] ] ) set_default_size(300, 400) signal_connect('response') do |dialog, response_id| if response_id == Gtk::ResponseType::OK query_change_display else destroy end end vbox = Gtk::Box.new(:vertical, 5) vbox.set_border_width(8) self.child.pack_start(vbox, :expand => true, :fill => true) @size_group = Gtk::SizeGroup.new(:horizontal) frame = create_display_frame vbox.pack_start(frame, :expand => true, :fill => true) frame = create_screen_frame vbox.pack_start(frame, :expand => true, :fill => true) initialize_displays end # Adds all currently open displays to our list of displays, # and set up a signal connection so that we'll be notified # when displays are opened in the future as well. def initialize_displays manager = Gdk::DisplayManager.get manager.displays.each do |display| add_display(display) end handler_id = manager.signal_connect('display_opened') do |display| add_display(display) end signal_connect('destroy') do manager.signal_handler_disconnect(handler_id) end end # Fills in the screen list based on the current display def fill_screens @screen_model.clear if @current_display n_screens = @current_display.n_screens n_screens.times do |i| iter = @screen_model.append iter.set_value(SCREEN_COLUMN_NUMBER, i) iter.set_value(SCREEN_COLUMN_SCREEN, @current_display.get_screen(i)) if i == 0 @screen_selection.select_iter(iter) end end end end # Creates the 'Display' frame in the main window. def create_display_frame frame, tree_view, button_vbox = create_frame('Display') button = left_align_button_new('_Open…') button.signal_connect('clicked') do open_display_cb end button_vbox.pack_start(button, :expand => false, :fill => false, :padding => 0) button = left_align_button_new('_Close') button.signal_connect('clicked') do if @current_display @current_display.close end end button_vbox.pack_start(button, :expand => false, :fill => false, :padding => 0) @display_model = Gtk::ListStore.new(String, Gdk::Display) tree_view.model = @display_model column = Gtk::TreeViewColumn.new('Name', Gtk::CellRendererText.new, {'text' => DISPLAY_COLUMN_NAME}) tree_view.append_column(column) selection = tree_view.selection selection.signal_connect('changed') do display_changed_cb(selection) end return frame end # Creates the 'Screen' frame in the main window. def create_screen_frame frame, tree_view, button_vbox = create_frame('Screen') @screen_model = Gtk::ListStore.new(Integer, Gdk::Screen) tree_view.model = @screen_model column = Gtk::TreeViewColumn.new('Number', Gtk::CellRendererText.new, {'text' => SCREEN_COLUMN_NUMBER}) tree_view.append_column(column) @screen_selection = tree_view.selection @screen_selection.signal_connect('changed') do |selection| @current_screen = if iter = selection.selected iter.get_value(SCREEN_COLUMN_SCREEN) else nil end end return frame end # This function is used both for creating the 'Display' and # 'Screen' frames, since they have a similar structure. The # caller hooks up the right context for the value returned # in tree_view, and packs any relevant buttons into button_vbox. def create_frame(title) frame = Gtk::Frame.new(title) hbox = Gtk::Box.new(:horizontal, 8) hbox.set_border_width(8) frame.add(hbox) scrollwin = Gtk::ScrolledWindow.new scrollwin.set_policy(:never, :automatic) scrollwin.shadow_type = :in hbox.pack_start(scrollwin, :expand => true, :fill => true) tree_view = Gtk::TreeView.new tree_view.headers_visible = false scrollwin.add(tree_view) selection = tree_view.selection selection.mode = :browse button_vbox = Gtk::Box.new(:vertical, 5) hbox.pack_start(button_vbox, :expand => false, :fill => false) @size_group.add_widget(button_vbox) return frame, tree_view, button_vbox end # If we have a stack of buttons, it often looks better if their contents # are left-aligned, rather than centered. This function creates a button # and left-aligns it contents. def left_align_button_new(label) button = Gtk::Button.new(:mnemonic => label) button.child.set_alignment(0.0, 0.5) return button end # Prompts the user for a toplevel window to move, and then moves # that window to the currently selected display def query_change_display screen = self.screen toplevel = query_for_toplevel(screen, "Please select the toplevel\n"+ "to move to the new screen") if toplevel toplevel.screen = @current_screen else screen.display.beep end end # Asks the user to click on a window, then waits for them click # the mouse. When the mouse is released, returns the toplevel # window under the pointer, or nil, if there is none. def query_for_toplevel(screen, prompt) toplevel = nil display = screen.display popup = Gtk::Window.new(:popup) popup.screen = screen popup.modal = true popup.window_position = :center frame = Gtk::Frame.new frame.set_shadow_type(:out) popup.add(frame) label = Gtk::Label.new(prompt) label.set_padding(10, 10) frame.add(label) popup.show_all # TODO: Gdk::Cursor.new(screen.display, Gdk::Cursor::CROSSHAIR) cursor = Gdk::Cursor.new(:crosshair) if Gdk::pointer_grab( popup.window, false, :button_release_mask, nil, cursor, Gdk::Event::CURRENT_TIME ) == Gdk::GRAB_SUCCESS clicked = false popup.signal_connect('button-release-event') do clicked = true end # Process events until clicked is set by button_release_event_cb. # We pass in may_block = true since we want to wait if there # are no events currently. until clicked Gtk.main_iteration # TODO: GLib::main_context_iteration(nil, true) toplevel = find_toplevel_at_pointer(screen.display) if toplevel == popup toplevel = nil end end popup.destroy Gdk.flush # Really release the grab return toplevel end end # Finds the toplevel window under the mouse pointer, if any. def find_toplevel_at_pointer(display) pointer_window, x, y = display.window_at_pointer # The user data field of a GdkWindow is used to store a pointer # to the widget that created it. if pointer_window widget = pointer_window.user_data end return (if widget widget.toplevel else nil end) end # Called when the user clicks on 'Open...' in the display # frame. Prompts for a new display, and then opens a connection # to that display. def open_display_cb dialog = Gtk::Dialog.new( :title => 'Open Display', :parent => self, :flags => :modal, :buttons => [ [:cancel, :cancel], [:ok, :ok] ] ) dialog.default_response = Gtk::ResponseType::OK display_entry = Gtk::Entry.new display_entry.activates_default = true dialog_label = Gtk::Label.new("Please enter the name of\nthe new display\n") dialog.child.add(dialog_label) dialog.child.add(display_entry) display_entry.grab_focus dialog.child.show_all result = nil until result response_id = dialog.run break if response_id != Gtk::ResponseType::OK new_screen_name = display_entry.text unless new_screen_name.empty? begin result = Gdk::Dispaly.open(new_screen_name) rescue dialog_label.text = "Can't open display :\n\t%s\nplease try another one\n" % [new_screen_name] end end end dialog.destroy end # Called when the selected row in the display list changes. # Updates info.current_display, then refills the list of # screens. def display_changed_cb(selection) @current_display = if iter = selection.selected iter.get_value(DISPLAY_COLUMN_DISPLAY) else nil end fill_screens end # Adds a new display to our list of displays, and connects # to the 'closed' signal so that we can remove it from the # list of displays again. def add_display(display) iter = @display_model.append iter.set_value(DISPLAY_COLUMN_NAME, display.name) iter.set_value(DISPLAY_COLUMN_DISPLAY, display) handler_id = display.signal_connect('closed') do display_closed_cb(display) end signal_connect('destroy') do display.signal_handler_disconnect(handler_id) end end # Called when one of the currently open displays is closed. # Remove it from our list of displays. def display_closed_cb(display) @display_model.each do |model, path, iter| tmp_display = iter.get_value( DISPLAY_COLUMN_DISPLAY) if tmp_display == display @display_model.remove(iter) break end end end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/gnome-applets.png����������������������������������������0000644�0001750�0001750�00000006022�11701304107�021717� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡���gAMA��± üa���bKGD�ÿ�ÿ�ÿ ½§“��� pHYs��`��`zxE���tIMEÐ (–ªŠ�� IDATxÚíšYŒ×u†¿Ú«»§»g㢤9Ò–dk¡MÑ–I¦@Ó’F² 'P q^b=Fâ ûI6ò”<YÀÉk Iˆ Ã@LÙ¢hQ#ÒÒˆÔˆξw³»ºö5}‹(·‡Ãe˜<)à  =·«þÿžÿœ{î¹#qs—$L.ÜK…¿gK ÷·ü’v�\&¬H aùý-'r#äpU˜V¸W csÀ1,'“þoÈg])€6„é˽‘Ï~ „@Ðc±°[â õ: (à&PÌOÝsp÷3_:z|dxèpÉ4È’4'±á:NàØöZ³eM¯®o¾}ú½÷ߘ]XYïóÅ3ãB|üy@.€Ï—Ÿ|ìsû¿ö•§¿yûÞ½_“$‰,ËH’˜(Š ‚�ß÷ñ<ϱ±]ÛvX[ßøÉÙ>úÑGç/nÁÉN(×9ó&P*/ÿ»üüÄñíÞ=r¿a–0Œº®£ëŠª **²,!!‘IR–B–¡ªò§†û_쯹³ +baGRR¶/dS*ÿ·?ø«{ïýÄ·+}5Õ,•)•ʦ‰n¨ª†ªj]ðR7² Ò4%Mb’$%NRUS¥/ì®Ì.¬¾ÙCâ–È¥£ç³ÿwóò÷ÆÆö}£Tî£T*S®”)•K覉a訪Š,É¿$’4!‰câ8!Šc’8¤‡ëåÅ•Í;%¡l3ûj>û?øþwÿäÀ»ÿ¼\©R*•)U*”ÊeÌRÃ4Q5EQd².ø$é‚•ð}Ÿ(މã˜8ŽˆÂˆLÊ•Kzk}³}¦^o˜„| ÚÓÇž¿{ß_꺎¦i¦iš˜å åJõŠ™å ¦ib˜š¦Ñ¯‚”¡êЬ )2²¬¢¨ ²,S)›ß®Ò°t+üNö9vôñoišnÊ²Š¢¨hš†¦F Ã,Q*WɃYӻ໱Ð/Ë Š,Q®T”î½$uM–es°¿ï;B¦ê6x®›@±Lкdp°ÿÅî edYñ)Ë2ªªc–úPUýÊwH2ùxI’d Y’»™ª\'Nº*‘$©û2Yz±RÖïr½a/ÈÛ¥Ï'}x"K3²,#ËR²,ƒ,íf–4%ŽC|Ï&ŽÃ+ß!Æåã³4#ÍR$Ecy­I(Wøpz«ã`Ù®RíÓ¿*2Ý {AÞ¦XS«ÕÊ#išt2‰ºEDa@x¾‡çv| ðˆÂ€(êŽKÓ˜$‰IÓ„4MI’Çqyá…xüèqÖ7/Ó±]TM£R.?ôÝŒämô¯jŠüÉ8ê®°QÔøÝ•Öw\§sÅ|×Á÷}¿K" C¢(&ŽºÙÈj5Ñ4z—^z‰;Flj☡¡a\Ï¿è/xAÚ‰®H“dO…A@„¾‹ï{xŽƒëØ¸¶…ݱpm ×±ñß÷|·;>£( ˜››g}}3gÞ£^ïgâ¹ç¨Vð\›,Í€ r£IÝ®úŒ¢Ðô=ïÊ +Ë]¾išE!ªª‘×B¹¼ßÅs=<ÏízÊó‚�ÇõHâÿxí ‡wqäÈþú‡/£ëŠ¢*À° X¢àK®g]Ø.`$ÏóƒÀï‚Y_ßä¿Nüš8ΰ;mÛ¢cµéXÝOǶÄ÷Žcã:.žçŠø高øžËüü¿9u’0 ˜xî9ÒTUM€A &d¤]o0÷z ¸äâÜRóàø¾Û$I¢i9œýà<©¤òÈáдnž¿V5êx>—–™_fßþýì“eNœøtާŽ=Í/~þSJ†‰¨ uDµ*]Ë ÊUÖ(ùìCǧ/ÌÜÖ±]‚žxž³gÏ"e]ï¦iJŠ rñ|×qXZ\âÌÔ4—æ?È“?J…LNž& <×feeOßÿ‹ óÆek h 9b3tM]Í)Üq×þÿð…?:ôãþfæù³ïaee…ŸýçëŒÞ¹—O#IRV×6(—L.·ÚX–EÛ² ‚ñxæÙϳ²4χS°´¼€m;ŒŽÞN¬,^âÈçá×_KóŠW”í†À]kû©l³SSSkjæýÙ‰çYZ^å GŸâ¶½{ù‡ü'—ÛL›Æó|6M66[ôUk<ðÀƒ<úØcÿÒãÝSorñâǬo¬awl‚0$cöìÆ45ÖÖ79vü™ìäÉ“«À²ðBGr|-[y ßGËíÍÏOÿ¼Ùl›úxÅÅÆÇ0>>Îî]CܵŒGŽf×®aÂÀ'Í2,Ëbò·y·cÑhlà!žïá{>A!I…ƒÃÃ8V‹™ù¥ö=÷=X6Mó“¾ï¿½Å{Û8Ø*f9 xÿüÅWJ%ýI×q´Öåˬ­®ò¹‡?ÿþäÒ4¦ÝXãö=à I,ÌÏ’¥)aF1AAÅ1iS2M¢8¥¿V#ô¼ìÜôìlËþ÷êÄÄľW_}õN`¦ÐénvC“×C†ï‡Š¥¾ŠyŸë‡È²ÂÚê çΟ'=š–ÕÂî´ñ=? ñÿʪì!q#Ë2%䯯J¥ÆÐà�ozw}yus©Ùl^[[[«†aø« äëÙR–›­N§Z1ïlµÛ{² &'ß%ŠBÈRü Ä45â$&ŠÅ¬ûq% ’$¡© }• õZZµŠ¦›\º4c>{þ`˲fFFF5‹ÀA (lvnzSo�}Í–mÉÄw¾szrÀ¶;¨ªBÿ�Aà¡k*ª"“$ i’"+2Šª ©*¦aP¯Õì¯Ó_¯£éKË«ö/ßšœÎÁ–ã8‹Õju¤Õj'F!³›%{¡T;¶çÊ%IÒUU¦Z­aª*ÓW)£ë:•rÓ0é«”©×ê R«V©Öjhºž½õö鿩ɩ1Ã9ÐnµZoO¿>.´^n(ˆ‹íÁHôpZÀ°FÉFûòm»‡²f£Q¾{l CM쯡j*º¦#ÉJwK©t72�ïœy?üÍäÔ\ÇvÛâ™¶ ‘›'´ÿ ðmàõë©…¶# öÐVå,ˆ¦gç C3TEÙsï½uM×ÕáÁ!YQU)#ËÚm+_Üˆææ—Üóæ?%! ¯@ ÓCÀ^>üðãkõ¤ëÈR†(u÷cÀ3À—óâ¥e‘·Õž¼]lðÊÀA¡í¬“ë_x¸)nˆ¢î/€o�+Ûuï”›hîZÀQ`Q¼,ï<¸ùlúiŒO®ôŸ›U c‹g“7y³A|52ð”�7]èB‡Ð9p¯ ™@xqª ›bç–ÇÆo?ÞÏÞÞÝÚ§Eý~ªp·Ò{ ¸ÂÖ‚tc Řð€5à.àaàÍ[A€‚¾ëÀ}À/ eÇÕäfç bà\„ŠæŠßGÀYàëÀÏÄDí˜@®Å6ð$ðÓ-<ÐE/´E,¼·Eäà=ñ¬<VDâ8q³Å//™¥¯.Ù‹!¾â¦<+d£M`·ÈPV˜³ø<}þðCÑv±wêbÉ}H¤¾ÙB&*za+9Bÿ{€zÀçõ4zó³µQàâ­$Pr8ÓC 7zeÔ^š)|çÀoÕ©ž à²{Ãê‹üü Èy Õ·XÔ~o£$š¹Qá·aáðïjmöÓ¢õÒØ "˜E‘êÜÂB¦b xvœõÄÂP‹ZÔsž|µEkSØŽ%”_‰XòóüÝ{.^å˜52* @ñNÁwB�hŸÈJiOýÓ{È]´Xd¡ìZåò­8'ÞîZ† ®O º—¶YG2AdÇÝ;õ@ÔîÑzo—o«þøÿëÿÄõßÄÖAýkå����IEND®B`‚��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-text.rb��������������������������������������������0000644�0001750�0001750�00000002060�11701304107�021040� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-text.rb,v 1.1 2005/10/12 05:38:30 ktou Exp $ =begin = cairo/Text This demo shows how to use GDK and cairo to show text. From http://cairographics.org/samples/text.html. =end require 'common' module Demo class CairoText < CairoWindow def initialize super('cairo text') end def draw(cr) cr.select_font_face("Sans", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_BOLD) cr.set_font_size(0.35) cr.move_to(0.04, 0.53) cr.show_text("Hello") cr.move_to(0.27, 0.65) cr.text_path("void") cr.set_source_rgba(0.5, 0.5, 1) cr.fill_preserve cr.set_source_rgba(0, 0, 0) cr.set_line_width(0.01) cr.stroke # draw helping lines cr.set_source_rgba(1,0.2,0.2, 0.6) cr.arc(0.04, 0.53, 0.02, 0, 2 * Math::PI) cr.arc(0.27, 0.65, 0.02, 0, 2 * Math::PI) cr.fill end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/gtk-demo/cairo-gradient.rb����������������������������������������0000644�0001750�0001750�00000001642�11701304107�021656� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 2005 Ruby-GNOME2 Project Team # This program is licenced under the same licence as Ruby-GNOME2. # # $Id: cairo-gradient.rb,v 1.2 2005/10/12 15:23:49 ktou Exp $ =begin = cairo/Gradient This demo shows how to use GDK and cairo to gradient. From http://cairographics.org/samples/gradient.html. =end require 'common' module Demo class CairoGradient < CairoWindow def initialize super('cairo gradient') end def draw(cr) pat = Cairo::LinearPattern.new(0.0, 0.0, 0.0, 1.0) pat.add_color_stop_rgb(1, 0, 0, 0) pat.add_color_stop_rgb(0, 1, 0, 0) cr.rectangle(0, 0, 1, 1) cr.set_source(pat) cr.fill pat = Cairo::RadialPattern.new(0.45, 0.4, 0.1, 0.4, 0.4, 0.5) pat.add_color_stop_rgba(0, 1, 1, 1, 0.8) pat.add_color_stop_rgba(1, 0, 0, 0) cr.set_source(pat) cr.arc(0.5, 0.5, 0.3, 0, 2 * Math::PI) cr.fill end end end ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/�������������������������������������������������������������0000755�0001750�0001750�00000000000�11740310343�015664� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/to_drawable.rb�����������������������������������������������0000644�0001750�0001750�00000001554�11701304107�020477� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin to_drawable.rb - Gdk::Pixbuf(GDK methods) sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: to_drawable.rb,v 1.6 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' filename = ARGV[0] unless filename puts "ruby #{$0} filename" exit(1) end pixbuf = Gdk::Pixbuf.new(filename) w = Gtk::Window.new("Drawable sample") w.realize w.signal_connect('delete-event') do Gtk.main_quit end d = Gtk::DrawingArea.new gc = Gdk::GC.new(w.window) d.signal_connect('expose-event') do |w, e| unless e.count > 0 width = w.allocation.width height = w.allocation.height pixbuf = pixbuf.scale(width, height) d.window.draw_pixbuf(gc, pixbuf, 0, 0, 0, 0, width, height, Gdk::RGB::DITHER_NORMAL, 0, 0) end true end w.add(d) w.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/drawing.rb���������������������������������������������������0000644�0001750�0001750�00000003662�11701304107�017651� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin drawing.rb - Gtk::Drawing sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: drawing.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' class Canvas < Gtk::DrawingArea def initialize super signal_connect("expose_event") { |w,e| expose_event(w,e) } signal_connect("configure_event") { |w, e| configure_event(w,e) } @buffer = nil @bgc = nil end def expose_event(w,e) unless @buffer.nil? rec = e.area w.window.draw_drawable(@bgc, @buffer, rec.x, rec.y, rec.x, rec.y, rec.width, rec.height) end false end def clear(b = @buffer) return if b.nil? g = b.size @bgc = self.style.bg_gc(self.state) if @bgc.nil? if (g[0] > 0 && g[1] > 0) b.draw_rectangle(@bgc, true, 0,0, g[0], g[1]) end end def configure_event(w,e) g = w.window.geometry if (g[2] > 0 && g[3] > 0) b = Gdk::Pixmap::new(w.window, g[2], g[3], -1) clear(b) if not @buffer.nil? g = @buffer.size b.draw_drawable(@bgc, @buffer, 0, 0, 0, 0, g[0], g[1]) end @buffer = b end true end end class A < Canvas def initialize super signal_connect("button_press_event") { |w,e| pressed(w,e) } set_events(Gdk::Event::BUTTON_PRESS_MASK) end def pressed(widget, ev) if not @last.nil? @buffer.draw_line(widget.style.fg_gc(widget.state), @last.x, @last.y, ev.x, ev.y) x1,x2 = if (@last.x < ev.x) then [@last.x, ev.x] else [ev.x, @last.x] end y1,y2 = if (@last.y < ev.y) then [@last.y, ev.y] else [ev.y, @last.y] end widget.queue_draw_area(x1, y1, x2 - x1 + 1, y2 - y1 + 1) end @last = nil @last = ev true end end window = Gtk::Window.new("drawing test") window.signal_connect("destroy") { Gtk.main_quit } canvas = A.new window.add(canvas) window.show_all Gtk::main ������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/settings.rb��������������������������������������������������0000644�0001750�0001750�00000002736�11701304107�020057� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin setting.rb - Gtk::Settings sample script. Copyright (C) 2004-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: settings.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' spec = GLib::Param::Int.new("integer", # name "Integer", # nick "Integer integer", # blurb 0, # min 10000, # max 0, # default GLib::Param::READABLE| GLib::Param::WRITABLE) enum = GLib::Param::Enum.new("enum", # name "Enum", # nick "Enum enum", # blurb GLib::Type["GdkCursorType"], #type Gdk::Cursor::ARROW, #default GLib::Param::READABLE| GLib::Param::WRITABLE) flags = GLib::Param::Flags.new("flags", # name "Flags", # nick "Flags flags", # blurb GLib::Type["GdkEventMask"], #type Gdk::Event::LEAVE_NOTIFY_MASK, #default GLib::Param::READABLE| GLib::Param::WRITABLE) p Gtk::Settings.rc_property_parse_color(spec, "{2222,44444,65535}").to_a p Gtk::Settings.rc_property_parse_enum(enum, "watch") p Gtk::Settings.rc_property_parse_flags(flags, "(scroll-mask|structure-mask)") p Gtk::Settings.rc_property_parse_requisition(spec, "{100, 200}") p Gtk::Settings.rc_property_parse_border(spec, "{100, 200, 300, 400}").to_a ����������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/button.rb����������������������������������������������������0000664�0001750�0001750�00000003233�11740310343�017527� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin button.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: button.rb,v 1.10 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("buttons") window.border_width = 0 box1 = Gtk::Box.new(:vertical, 0) window.add(box1) table = Gtk::Table.new(3, 3, false) table.set_row_spacings(5) table.set_column_spacings(5) table.set_border_width(10) box1.pack_start(table, true, true, 0) button = [] 0.upto(8) do |i| button.push Gtk::Button.new(:label => "button"+(i+1).to_s) end 0.upto(8) do |i| button[i].signal_connect("clicked") do |w| p [i] j = (i + 1) % 9 if button[j].visible? button[j].hide else button[j].show end end button[i].show end table.attach(button[0], 0, 1, 0, 1, nil, nil, 0, 0) table.attach(button[1], 1, 2, 1, 2, nil, nil, 0, 0) table.attach(button[2], 2, 3, 2, 3, nil, nil, 0, 0) table.attach(button[3], 0, 1, 2, 3, nil, nil, 0, 0) table.attach(button[4], 2, 3, 0, 1, nil, nil, 0, 0) table.attach(button[5], 1, 2, 2, 3, nil, nil, 0, 0) table.attach(button[6], 1, 2, 0, 1, nil, nil, 0, 0) table.attach(button[7], 2, 3, 1, 2, nil, nil, 0, 0) table.attach(button[8], 0, 1, 1, 2, nil, nil, 0, 0) separator = Gtk::Separator.new(:vertical) box1.pack_start(separator, false, true, 0) box2 = Gtk::Box.new(:vertical, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) close = Gtk::Button.new(:label => "close") close.signal_connect("clicked") do Gtk.main_quit end box2.pack_start(close, true, true, 0) close.can_default = true close.grab_default window.show_all Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/misc_button.rb�����������������������������������������������0000664�0001750�0001750�00000002361�11740310343�020543� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin misc_button.rb - Ruby/GTK sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: misc_button.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' box = Gtk::Box.new(:vertical) #Gtk::ColorButton colorbutton = Gtk::ColorButton.new colorbutton.signal_connect("color-set") do p colorbutton.color.to_a end box.add(colorbutton) #Gtk::FontButton fontbutton = Gtk::FontButton.new fontbutton.signal_connect("font-set") do p fontbutton.font_name end box.add(fontbutton) #Gtk::FileChooserButton filebutton = Gtk::FileChooserButton.new("Gtk::FileChooserButton", Gtk::FileChooser::Action::OPEN) filebutton.filename = GLib.home_dir filebutton.signal_connect("current-folder-changed") do |w, e| p filebutton.filename end box.add(filebutton) #Quit quitbutton = Gtk::Button.new(:label => "Quit") quitbutton.signal_connect("clicked") do Gtk.main_quit end box.add(quitbutton) Gtk::Window.new.add(box).set_default_size(200, 100).show_all Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/pointer_grab.rb����������������������������������������������0000644�0001750�0001750�00000001713�11701304107�020664� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin pointer_grab.rb - Gdk::Window#pointer_grab/ungrab sample script. Copyright (C) 2001-2006 Masao Mutoh<mutoh@highway.ne.jp> This program is licenced under the same licence as Ruby-GNOME. $Date: 2006/06/17 13:18:12 $ $Id: pointer_grab.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Pointer grab/ungrab sample") cursor = Gdk::Cursor.new(Gdk::Cursor::WATCH) button1 = Gtk::Button.new("Grab Window!") button2 = Gtk::Button.new("Ungrab Window!") button1.signal_connect('clicked') do Gdk.pointer_grab(window.window, true, Gdk::Event::BUTTON_PRESS_MASK, window.window, cursor, Gdk::Event::CURRENT_TIME) p Gdk.pointer_is_grabbed? end button2.signal_connect('clicked') do Gdk.pointer_ungrab(Gdk::Event::CURRENT_TIME) p Gdk.pointer_is_grabbed? end window.add(Gtk::VBox.new.add(button1).add(button2)) window.set_default_size(200,100).show_all window.signal_connect("destroy"){Gtk.main_quit} Gtk.main �����������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/aboutdialog.rb�����������������������������������������������0000644�0001750�0001750�00000002355�11701304107�020506� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin aboutdialog.rb - Ruby/GTK sample script. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: aboutdialog.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' if str = Gtk.check_version(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" puts str exit end Gtk::AboutDialog.set_email_hook {|about, link| p "email_hook" p link } Gtk::AboutDialog.set_url_hook {|about, link| p "url_hook" p link } a = Gtk::AboutDialog.new a.artists = ["Artist 1 <no1@foo.bar.com>", "Artist 2 <no2@foo.bar.com>"] a.authors = ["Author 1 <no1@foo.bar.com>", "Author 2 <no2@foo.bar.com>"] a.comments = "This is a sample script for Gtk::AboutDialog" a.copyright = "Copyright (C) 2005 Ruby-GNOME2 Project" a.documenters = ["Documenter 1 <no1@foo.bar.com>", "Documenter 2 <no2@foo.bar.com>"] a.license = "This program is licenced under the same licence as Ruby-GNOME2." a.logo = Gdk::Pixbuf.new("gnome-logo-icon.png") a.program_name = "Gtk::AboutDialog sample" a.translator_credits = "Translator 1\nTranslator 2\n" a.version = "1.0.0" a.website = "http://ruby-gnome2.sourceforge.jp" a.website_label = "Ruby-GNOME2 Project Website" p a.run �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/threads.rb���������������������������������������������������0000644�0001750�0001750�00000002525�11701304107�017645� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin threads.rb - Ruby/GTK2 sample script. Copyright (c) 2003-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: threads.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' require 'thread' label = Gtk::Label.new Thread.new { (0...1000).each { |cnt| p "A:" + cnt.to_s label.label = "A:" + cnt.to_s sleep(2) } } start_button = Gtk::Button.new("start") stop_button = Gtk::Button.new("stop") start_button.signal_connect("clicked") do start_button.sensitive=false @th = Thread.new { (0...10).each { |cnt| p "B:" + cnt.to_s label.label = "B:" + cnt.to_s sleep(2) } @th = nil start_button.sensitive = true start_button.grab_focus stop_button.sensitive = false } stop_button.sensitive = true stop_button.grab_focus end stop_button.signal_connect("clicked") do if @th @th.kill puts "killed" @th = nil start_button.sensitive = true start_button.grab_focus stop_button.sensitive = false end end stop_button.sensitive = false box = Gtk::VBox.new. set_size_request(100,100) box << label << start_button << stop_button win = Gtk::Window.new << box win.show_all.signal_connect("delete_event") do p "Exiting..." Gtk.main_quit Thread.list.each {|t| t.kill } end Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/combobox.rb��������������������������������������������������0000644�0001750�0001750�00000003522�11701304107�020021� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin combobox.rb - Ruby/GTK sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: combobox.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' if str = Gtk.check_version(2, 4, 0) puts "This sample requires GTK+ 2.4.0 or later" puts str exit end window = Gtk::Window.new("Gtk::ComboBox sample") window.signal_connect("destroy"){Gtk.main_quit} # # Text only # combo1 = Gtk::ComboBox.new ["foo", "bar", "fuga", "hoge"].each do |val| combo1.append_text(val) end combo1.active = 1 combo1.signal_connect("changed") do p "combo1: #{combo1.active}, #{combo1.active_iter[0]}" end # # Icon and text # model = Gtk::ListStore.new(Gdk::Pixbuf, String) [[Gtk::Stock::QUIT, "quit"], [Gtk::Stock::CANCEL, "cancel"], [Gtk::Stock::OK, "ok"]].each do |stock, name| iter = model.append iter[0] = window.render_icon(stock, Gtk::IconSize::MENU, "icon") iter[1] = name end combo2 = Gtk::ComboBox.new(model) # column 1 renderer = Gtk::CellRendererPixbuf.new combo2.pack_start(renderer, false) combo2.set_attributes(renderer, :pixbuf => 0) # column 2 renderer = Gtk::CellRendererText.new combo2.pack_start(renderer, true) combo2.set_attributes(renderer, :text => 1) combo2.active = 2 combo2.signal_connect("changed") do p "combo2: #{combo2.active}, #{combo2.active_iter[1]}" end # # Gtk::ComboBoxEntry # combo3 = Gtk::ComboBoxEntry.new ["foo", "bar", "fuga", "hoge"].each do |val| combo3.append_text(val) end combo3.active = 1 combo3.signal_connect("changed") do if combo3.active_iter p "combo3: #{combo3.active}, #{combo3.active_iter[0]}" end end # Show main window vbox = Gtk::VBox.new vbox.add(combo1).add(combo2).add(combo3) window.add(vbox).show_all Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/label.rb�����������������������������������������������������0000664�0001750�0001750�00000002054�11740310343�017273� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin label.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: label.rb,v 1.8 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' win = Gtk::Window.new("Gtk::Label sample") win.signal_connect("destroy"){Gtk.main_quit} label1 = Gtk::Label.new("_Not Use Mnemonic") label1.selectable = true label2 = Gtk::Label.new("_Use Mnemonic", true) label3 = Gtk::Label.new.set_markup(%Q[<markup><span size="xx-large" weight="bold" foreground="blue"><u>Ruby-GNOME2</u></span> is <span foreground="red" size="x-large"><i>cool</i></span>!</markup>], true) label4 = Gtk::Label.new.set_markup(%Q[<span foreground="#999900">_Not Use Mnemonic</span>]) label5 = Gtk::Label.new.set_markup(%Q[<span foreground="#009999">_Use Mnemonic</span>], true) box = Gtk::Box.new(:vertical) box.add(label1) box.add(label2) box.add(label3) box.add(label4) box.add(label5) win.add(box).show_all # This can be called after realized only. label1.select_region(3, 8) Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/cairo-pong.rb������������������������������������������������0000755�0001750�0001750�00000010572�11704226436�020270� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin cairo-pong.rb - Ruby/GTK with cairo sample script. Original: gtkcairo sample by Evan Martins. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: cairo-pong.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require "gtk3" unless Gdk.cairo_available? raise "GTK+ 2.8.0 or later and cairo support are required." end module Pong class CenteredItem attr_accessor :x, :y attr_reader :width, :height def initialize(x, y, width, height) @x = x @y = y @width = width @height = height end def min_x @x - @width / 2 end def max_x @x + @width / 2 end def min_y @y - @height / 2 end def max_y @y + @height / 2 end end class CenteredCircle < CenteredItem def draw(cr) cr.translate(min_x, min_y) cr.scale(@width, @height) cr.arc(0.5, 0.5, 0.5, 0, 2 * Math::PI) cr.fill end end class CenteredRect < CenteredItem def draw(cr) cr.translate(min_x, min_y) cr.scale(@width, @height) cr.rectangle(0, 0, 1, 1) cr.fill end end class Ball < CenteredCircle attr_accessor :dx, :dy def initialize(dx=0.02, dy=0.02) super(0.8, 0.5, 0.04, 0.04) @dx = dx @dy = dy end def update @x += @dx @y += @dy # ball bouncing if max_y > 1 @y = 1 - (max_y - 1) @dy *= -1 elsif min_y < 0 @y -= min_y @dy *= -1 end if max_x > 1 @x = 1 - (max_x - 1) @dx *= -1 elsif min_x < 0 @x -= min_x @dx *= -1 end end end class Paddle < CenteredRect def initialize(field, x, y) super(x, y, 0.05, 0.3) @field = field end def update(ball) # is the ball coming towards us? if (ball.x < @x and ball.dx > 0) or (ball.x > @x and ball.dx < 0) # move to intercept it @y = ball.y end end def ball_hit?(ball) ball.y > min_y and ball.y < max_y end def update_ball(ball) if ball_hit?(ball) if ball.min_x < @x and ball.max_x > min_x # hit our left side ball.x -= (ball.max_x - min_x) ball.dx = -ball.dx elsif ball.max_x > @x and ball.min_x < max_x # hit our right side ball.x += (max_x - ball.min_x) ball.dx = -ball.dx end end end end class Field attr_accessor :width, :height def initialize(margin=0.05) @margin = margin @left_paddle = Paddle.new(self, @margin, 0.5) @right_paddle = Paddle.new(self, 1 - @margin, 0.7) @paddles = [@left_paddle, @right_paddle] @ball = Ball.new end def update @paddles.each do |paddle| paddle.update(@ball) end @ball.update @paddles.each do |paddle| paddle.update_ball(@ball) end end def draw(cr) cr.set_source_rgba(1, 1, 1) cr.rectangle(0, 0, 1, 1) cr.fill cr.save do cr.set_source_rgba(0.8, 0.8, 0.8, 0.8) cr.set_line_join(Cairo::LINE_JOIN_ROUND) @paddles.each do |paddle| cr.save {paddle.draw(cr)} end end cr.set_source_rgba(0, 0, 0) cr.save {@ball.draw(cr)} end end class Window < Gtk::Window def initialize(speed=30) super() @speed = speed self.title = 'Pong Demonstration' signal_connect('destroy') { Gtk.main_quit } signal_connect("key_press_event") do |widget, event| if event.state.control_mask? and event.keyval == Gdk::Keyval::GDK_q destroy true else false end end set_default_size(260, 200) @field = Field.new @drawing_area = Gtk::DrawingArea.new set_draw vb = Gtk::VBox.new(false, 5) vb.border_width = 10 vb.pack_start(@drawing_area, true, true, 0) vb.show_all add(vb) Gtk.timeout_add(@speed) do @field.update @drawing_area.queue_draw unless @drawing_area.destroyed? end end def set_draw @drawing_area.signal_connect('draw') do |widget, cr| window = widget.window cr.scale(window.width, window.height) @field.draw(cr) end end end end Pong::Window.new.show_all Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/textbuffer_serialize.rb��������������������������������������0000644�0001750�0001750�00000010516�11701304107�022437� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin textbuffer_serialize.rb - Ruby/GTK sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: textbuffer_serialize.rb,v 1.1 2006/11/23 08:39:13 mutoh Exp $ =end require 'gtk3' if str = Gtk.check_version(2, 10, 0) puts "This sample requires GTK+ 2.10.0 or later" puts str exit end current_folder = ENV['HOME'] || "." file_name = "serialized.dat" textview = Gtk::TextView.new textview.set_size_request(600, 400) buffer = textview.buffer buffer.text = DATA.read format = buffer.serialize_formats[0] buffer.register_serialize_target(nil) buffer.register_deserialize_target(nil) window = Gtk::Window.new("Gtk::TextBuffer Serialize Demo") vbox = Gtk::VBox.new serialize_button = Gtk::FileChooserButton.new("Serialize to a file", Gtk::FileChooser::ACTION_OPEN) deserialize_button = Gtk::FileChooserButton.new("Serialize to a file", Gtk::FileChooser::ACTION_OPEN) serialize_button.current_folder = current_folder deserialize_button.current_folder = current_folder toolbar = Gtk::Toolbar.new toolbar.append(Gtk::Stock::OPEN, "Deserialize from a file") do dialog = Gtk::FileChooserDialog.new("Deserialize from a file", window, Gtk::FileChooser::ACTION_OPEN, nil, [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT]) dialog.filename = File.expand_path(file_name) if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT file_name = dialog.filename File.open(file_name, "rb") {|io| buffer.delete(buffer.start_iter, buffer.end_iter) buffer.deserialize(buffer, format, buffer.start_iter, io.read) } end dialog.destroy end toolbar.append(Gtk::Stock::SAVE, "Serialize to a file") do dialog = Gtk::FileChooserDialog.new("Serialize from a file", window, Gtk::FileChooser::ACTION_SAVE, nil, [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT]) dialog.current_name = file_name if dialog.run == Gtk::Dialog::RESPONSE_ACCEPT file_name = dialog.filename File.open(file_name, "wb") {|io| io.write(buffer.serialize(buffer, format, buffer.start_iter, buffer.end_iter)) } end dialog.destroy end toolbar.append(Gtk::Stock::CLEAR, "Clear all") do buffer.delete(buffer.start_iter, buffer.end_iter) end toolbar.append_space toolbar.append(Gtk::Stock::SELECT_COLOR, "Color the region") do dialog = Gtk::ColorSelectionDialog.new("Color the region") if dialog.run == Gtk::Dialog::RESPONSE_OK bounds = buffer.selection_bounds color = dialog.colorsel.current_color tag_name = color.to_a.inspect unless tag = buffer.tag_table.lookup(tag_name) tag = Gtk::TextTag.new(tag_name).set_foreground_gdk(color) end buffer.tag_table.add(tag) buffer.apply_tag(tag, bounds[0], bounds[1]) end dialog.destroy end toolbar.append(Gtk::Stock::SELECT_FONT, "Set a font to the region") do dialog = Gtk::FontSelectionDialog.new("Set font to the region") if dialog.run == Gtk::Dialog::RESPONSE_OK bounds = buffer.selection_bounds font = dialog.font_name unless tag = buffer.tag_table.lookup(font) tag = Gtk::TextTag.new(font).set_font(font) end buffer.tag_table.add(tag) buffer.apply_tag(tag, bounds[0], bounds[1]) end dialog.destroy end toolbar.append_space toolbar.append(Gtk::Stock::QUIT, "Quit this application") do Gtk.main_quit end vbox.pack_start(toolbar, false, false).add(Gtk::ScrolledWindow.new.add(textview)) window.add(vbox) window.show_all window.signal_connect("destroy") { Gtk.main_quit } Gtk.main __END__ This is a sample script for rich text serialization/deserialization. 1. Edit this text using font/color buttons. 2. Click save button and save this text (= serialize this as rich text to a file) 3. Click clear button and clear this text buffer. 4. Click load button and load the file which you save (= deserialize this). ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/uimanager2.xml�����������������������������������������������0000644�0001750�0001750�00000001576�11701304107�020447� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0"?> <ui> <menubar name='MenuBar'> <menu action='FileMenu'> <menuitem action='New'/> <menuitem action='Open'/> <menuitem action='Save'/> <menuitem action='SaveAs'/> <separator/> <menuitem action='Quit'/> </menu> <menu action='PreferencesMenu'> <menu action='ColorMenu'> <menuitem action='Red'/> <menuitem action='Green'/> <menuitem action='Blue'/> </menu> <menu action='ShapeMenu'> <menuitem action='Square'/> <menuitem action='Rectangle'/> <menuitem action='Oval'/> </menu> <menuitem action='Bold'/> </menu> <menu action='HelpMenu'> <menuitem action='About'/> </menu> </menubar> <toolbar name='ToolBar'> <toolitem action='Open'/> <toolitem action='Quit'/> <separator action='Sep1'/> <toolitem action='Logo'/> </toolbar> </ui> ����������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/t-gtksocket.rb�����������������������������������������������0000664�0001750�0001750�00000003305�11740310343�020453� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin Sample script using Gtk::Socket and Gtk::Plug. $ ruby t-gtksocket.rb Written by Alex Boussinet <mailto:dbug@wanadoo.fr> for testing purpose only. Copyright (c) 2003-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: t-gtksocket.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' class MyGtkSocket < Gtk::Window def initialize super("Gtk::Socket Test") set_window_position(Gtk::Window::Position::CENTER) signal_connect("delete_event"){Gtk::main_quit} @buttons = [] 6.times {|n| @buttons << Gtk::Button.new(:label => "Plug #{n}") @buttons.last.signal_connect("clicked"){ plug(n) } } @table = Gtk::Table.new(1, 2) @table.set_size_request(320, 200) add(@table) @vbox = Gtk::Box.new(:vertical, 5) @buttons.each{|b| @vbox.add(b) } @vbox.set_size_request(150, 190) @table.attach(@vbox, 0, 1, 0, 1, :fill, :fill, 5, 5) @socket = Gtk::Socket.new @table.attach(@socket, 1, 2, 0, 1, :fill, :fill, 5, 5) @socket.set_size_request(150, 150) show_all @xid = @socket.id @pid = 0 end def plug(arg) if @pid != 0 Process.kill("SIGKILL", @pid) Process.waitpid(@pid) begin @table.remove(@socket) unless @socket.destroyed? rescue ArgumentError # socket has been destroyed because child process finished unexpectedly end @socket = Gtk::Socket.new @table.attach(@socket, 1, 2, 0, 1, :fill, :fill, 5, 5) @socket.set_size_request(150, 190) @socket.show @xid = @socket.id end @pid = fork { exec "ruby t-gtkplug.rb -x #{@xid} Plug#{arg}" } end end MyGtkSocket.new Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/treemodelfilter.rb�������������������������������������������0000664�0001750�0001750�00000002330�11740310343�021377� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin treemodelfilter.rb - Gtk::TreeModelFilter sample Copyright (c) 2004,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: treemodelfilter.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' ls = Gtk::ListStore.new(String, Integer) column1 = Gtk::TreeViewColumn.new("data1", Gtk::CellRendererText.new, {:text => 0}) column2 = Gtk::TreeViewColumn.new("data2", Gtk::CellRendererText.new, {:text => 1}) mf = Gtk::TreeModelFilter.new(ls) mf.set_visible_func do |model, iter| /a/ =~ iter[0] end mf.set_modify_func(String, String) do |model, iter, column| child_iter = model.convert_iter_to_child_iter(iter) if column == 0 child_iter[0] else "#{child_iter[1]} * 2 = #{child_iter[1] * 2}" end end treeview = Gtk::TreeView.new(mf) treeview.append_column(column1) treeview.append_column(column2) [ ["aaa", 1], ["aab", 2], ["aac", 3], ["bba", 4], ["bbb", 5], ["bbc", 6] ].each do |str, num| iter = ls.append iter[0] = str iter[1] = num end win = Gtk::Window.new("Gtk::TreeModelFilter sample") win.signal_connect("destroy"){Gtk.main_quit} win.add(treeview).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/style_property.rc��������������������������������������������0000644�0001750�0001750�00000000730�11701304107�021314� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* style_property.rc - Ruby/GTK sample rc file for style_property.rb. Copyright (c) 2004 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: style_property.rc,v 1.1 2004/01/25 15:52:38 mutoh Exp $ */ style "test-default" { bg[NORMAL] = { 0.80, 0.80, 0.40 } MyButton::focus-line-width = 3 MyButton::focus-line-pattern = "\10\2" MyButton::foo = 30 MyButton::bar = boat } class "MyButton" style "test-default" ����������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/t-gtkplug.rb�������������������������������������������������0000664�0001750�0001750�00000002724�11740310343�020136� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin Sample script using Gtk::Socket and Gtk::Plug. $ ruby t-gtksocket.rb Written by Alex Boussinet <mailto:dbug@wanadoo.fr> for testing purpose only. Copyright (c) 2003-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: t-gtkplug.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' class MyGtkPlug def initialize(xid, plug) plug = "Button" if plug.nil? if xid.nil? @window = Gtk::Window.new("Gtk::Plug Test") @window.set_default_size(250, 50) else @window = Gtk::Plug.new(xid.to_i) end @window.window_position = Gtk::Window::Position::CENTER @window.signal_connect("delete_event"){Gtk.main_quit} @vbox = Gtk::Box.new(:vertical, 5) @window.add(@vbox) @button1 = Gtk::Button.new(:label => plug) @button1.signal_connect("clicked"){ $stderr.puts plug} @button2 = Gtk::Button.new(:label => "Exit") @button2.signal_connect("clicked"){Gtk.main_quit} # Exit button to test an unexpected end of child process by Gtk::Socket @vbox.pack_start(@button1, true, true) @vbox.pack_start(@button2, true, true) @window.show_all end end xid = nil ARGV.each_index { |i| arg = ARGV.at(i) if arg == "-x" if arg.length > 2 xid = arg[2..-1] else xid = ARGV.at(i + 1) ARGV.delete_at(i + 1) end xid = nil if xid.to_i <= 0 ARGV.delete_at(i) end } MyGtkPlug.new(xid, ARGV.shift) Gtk.main ��������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/entrycompletion.rb�������������������������������������������0000664�0001750�0001750�00000001314�11740310343�021445� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin entrycompletion.rb - Ruby/GTK sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. Enter "G", "t" on the entry box. $Id: entrycompletion.rb,v 1.4 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new window.set_default_size(200, 200) entry = Gtk::Entry.new completion = Gtk::EntryCompletion.new entry.completion = completion model = Gtk::ListStore.new(String) ["GNOME", "total", "totally"].each do |v| iter = model.append iter[0] = v end completion.model = model completion.text_column = 0 window.add(entry).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/dialog2.rb���������������������������������������������������0000644�0001750�0001750�00000002041�11701304107�017525� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin dialog2.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: dialog2.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::Dialog sample2") button = Gtk::Button.new("Create Dialog") button.signal_connect("clicked") do dialog = Gtk::Dialog.new("Gtk::Dialog Sample 2", window, Gtk::Dialog::MODAL|Gtk::Dialog::NO_SEPARATOR, [Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK], [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL]) dialog.vbox.add(Gtk::Label.new("Gtk::Dialog Sample 2")) dialog.set_default_size(300, 300) dialog.vbox.show_all result = dialog.run case result when Gtk::Dialog::RESPONSE_OK p "OK" when Gtk::Dialog::RESPONSE_CANCEL p "Cancel" end dialog.destroy end window.add(button).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/image.rb�����������������������������������������������������0000664�0001750�0001750�00000001506�11740310343�017277� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin image.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: image.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Image") window.signal_connect("destroy") do Gtk.main_quit end window.border_width = 0 box1 = Gtk::Box.new(:vertical, 10) box1.border_width = 10 button = Gtk::Button.new box1.add(button) label = Gtk::Label.new("Gtk::Image\ntest") image = Gtk::Image.new(:file => "test.xpm") box2 = Gtk::Box.new(:horizontal, 5).add(image).add(label) button.add(box2) box1.add(Gtk::Separator.new(:horizontal)) button = Gtk::Button.new(:label => "close") button.signal_connect("clicked") do Gtk.main_quit end box1.add(button) window.add(box1).show_all Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/calendar.rb��������������������������������������������������0000664�0001750�0001750�00000003164�11740310343�017770� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin calendar.rb - Gtk::Calendar sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: calendar.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' cal = Gtk::Calendar.new w = Gtk::Window.new("Calendar sample") w.add(cal).show_all.signal_connect('delete_event') do Gtk.main_quit end date = Time.new cal.select_month(date.month, date.year) cal.select_day(date.day) cal.mark_day(date.day) #cal.clear_marks # # Gtk::Calendar::DisplayOptions::WEEK_START_MONDAY does not exist anymore # cal.set_display_options(Gtk::Calendar::DisplayOptions::SHOW_HEADING | Gtk::Calendar::DisplayOptions::SHOW_DAY_NAMES | Gtk::Calendar::DisplayOptions::NO_MONTH_CHANGE | Gtk::Calendar::DisplayOptions::SHOW_WEEK_NUMBERS) year, month, day = cal.date puts "this is #{month} #{day}, #{year}" cal.signal_connect('day_selected') do year, month, day = cal.date puts "selected day: #{day}" end cal.signal_connect('month_changed') do year, month, day = cal.date puts "changed month: #{month}" end cal.signal_connect('day_selected_double_click') do year, month, day = cal.date puts "dclicked day: #{day}" end cal.signal_connect('prev_month') do year, month, day = cal.date puts "prev month: #{month}" end cal.signal_connect('next_month') do year, month, day = cal.date puts "next_month: #{month}" end cal.signal_connect('prev_year') do year, month, day = cal.date puts "prev_year: #{year}" end cal.signal_connect('next_year') do year, month, day = cal.date puts "next year: #{year}" end Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/test.xpm�����������������������������������������������������0000644�0001750�0001750�00000003767�11701304107�017404� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char *openfile[] = { /* width height num_colors chars_per_pixel */ " 20 19 66 2", /* colors */ ".. c None", ".# c #000000", ".a c #dfdfdf", ".b c #7f7f7f", ".c c #006f6f", ".d c #00efef", ".e c #009f9f", ".f c #004040", ".g c #00bfbf", ".h c #ff0000", ".i c #ffffff", ".j c #7f0000", ".k c #007070", ".l c #00ffff", ".m c #00a0a0", ".n c #004f4f", ".o c #00cfcf", ".p c #8f8f8f", ".q c #6f6f6f", ".r c #a0a0a0", ".s c #7f7f00", ".t c #007f7f", ".u c #5f5f5f", ".v c #707070", ".w c #00f0f0", ".x c #009090", ".y c #ffff00", ".z c #0000ff", ".A c #00afaf", ".B c #00d0d0", ".C c #00dfdf", ".D c #005f5f", ".E c #00b0b0", ".F c #001010", ".G c #00c0c0", ".H c #000f0f", ".I c #00007f", ".J c #005050", ".K c #002f2f", ".L c #dfcfcf", ".M c #dfd0d0", ".N c #006060", ".O c #00e0e0", ".P c #00ff00", ".Q c #002020", ".R c #dfc0c0", ".S c #008080", ".T c #001f1f", ".U c #003f3f", ".V c #007f00", ".W c #00000f", ".X c #000010", ".Y c #00001f", ".Z c #000020", ".0 c #00002f", ".1 c #000030", ".2 c #00003f", ".3 c #000040", ".4 c #00004f", ".5 c #000050", ".6 c #00005f", ".7 c #000060", ".8 c #00006f", ".9 c #000070", "#. c #7f7f80", "## c #9f9f9f", /* pixels */ "........................................", "........................................", "........................................", ".......................#.#.#............", ".....................#.......#...#......", "...............................#.#......", ".......#.#.#.................#.#.#......", ".....#.y.i.y.#.#.#.#.#.#.#..............", ".....#.i.y.i.y.i.y.i.y.i.#..............", ".....#.y.i.y.i.y.i.y.i.y.#..............", ".....#.i.y.i.y.#.#.#.#.#.#.#.#.#.#.#....", ".....#.y.i.y.#.s.s.s.s.s.s.s.s.s.#......", ".....#.i.y.#.s.s.s.s.s.s.s.s.s.#........", ".....#.y.#.s.s.s.s.s.s.s.s.s.#..........", ".....#.#.s.s.s.s.s.s.s.s.s.#............", ".....#.#.#.#.#.#.#.#.#.#.#..............", "........................................", "........................................", "........................................" }; ���������ruby-gnome2-all-2.1.0/gtk3/sample/misc/window.rb����������������������������������������������������0000664�0001750�0001750�00000001015�11740310343�017517� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin window.rb - Gtk::Window sample. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: window.rb,v 1.9 2006/10/21 16:58:00 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::Window sample") window.signal_connect("destroy"){Gtk.main_quit} button = Gtk::Button.new(:label => "Hello World") button.signal_connect("clicked") do puts "hello world" Gtk.main_quit end window.add(button) window.show_all Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/dialog.rb����������������������������������������������������0000644�0001750�0001750�00000002256�11701304107�017453� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin dialog.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: dialog.rb,v 1.6 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::Dialog sample") button = Gtk::Button.new("Create Dialog") button.signal_connect("clicked") do dialog = Gtk::Dialog.new dialog.title = "Gtk::Dialog Sample" dialog.transient_for = window dialog.set_default_size(300, 300) dialog.vbox.add(Gtk::Label.new("Gtk::Dialog Sample")) dialog.add_button("OK", Gtk::Dialog::RESPONSE_OK) dialog.add_button(Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL) dialog.add_button(Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_CLOSE) dialog.set_default_response(Gtk::Dialog::RESPONSE_CANCEL) dialog.signal_connect("response") do |widget, response| case response when Gtk::Dialog::RESPONSE_OK p "OK" when Gtk::Dialog::RESPONSE_CANCEL p "Cancel" when Gtk::Dialog::RESPONSE_CLOSE p "Close" dialog.destroy end end dialog.show_all end window.add(button).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/checkbutton.rb�����������������������������������������������0000664�0001750�0001750�00000001737�11740310343�020534� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin checkbutton.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: checkbutton.rb,v 1.10 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("check buttons") window.border_width = 0 box1 = Gtk::Box.new(:vertical) window.add(box1) box2 = Gtk::Box.new(:vertical, 10) box2.border_width = 10 box1.pack_start(box2) button1 = Gtk::CheckButton.new("_button1") button2 = Gtk::CheckButton.new("_button2", false) button3 = Gtk::CheckButton.new(Gtk::Stock::QUIT) box2.add(button1) box2.add(button2) box2.add(button3) box1.pack_start(Gtk::Separator.new(:horizontal)) box2 = Gtk::Box.new(:vertical, 10) box2.border_width = 10 box1.pack_start(box2) close = Gtk::Button.new(:label => "close") close.signal_connect("clicked") do Gtk.main_quit end box2.pack_start(close) close.can_default = true close.grab_default window.show_all Gtk.main ���������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/frame.rb�����������������������������������������������������0000664�0001750�0001750�00000002773�11740310343�017316� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin frame.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: frame.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("buttons") window.signal_connect("destroy") do Gtk.main_quit end window.border_width = 0 box1 = Gtk::Box.new(:vertical, 0) window.add(box1) box2 = Gtk::Box.new(:horizontal, 5) box2.border_width = 10 box1.pack_start(box2, true, true, 0) label = Gtk::Label.new("Hello World") frame = Gtk::Frame.new("Frame 1") box2.pack_start(frame, true, true, 0) box3 = Gtk::Box.new(:vertical, 5) box3.border_width = 5 frame.add(box3) button = Gtk::Button.new(:label => "switch") button.signal_connect("clicked") do label.reparent(box3) end box3.pack_start(button, false, true, 0) box3.pack_start(label, false, true, 0) frame = Gtk::Frame.new("Frame 2") box2.pack_start(frame, true, true, 0) box4 = Gtk::Box.new(:vertical, 5) box4.border_width = 5 frame.add(box4) button = Gtk::Button.new(:label => "switch") button.signal_connect("clicked") do label.reparent(box4) end box4.pack_start(button, false, true, 0) separator = Gtk::Separator.new(:horizontal) box1.pack_start(separator, false, true, 0) box2 = Gtk::Box.new(:horizontal, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) button = Gtk::Button.new(:label => "close") button.signal_connect("clicked") do Gtk.main_quit end box2.pack_start(button) window.show_all Gtk.main �����ruby-gnome2-all-2.1.0/gtk3/sample/misc/tree_combo.rb������������������������������������������������0000664�0001750�0001750�00000003536�11740310343�020340� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin tree_combo.rb - Gtk::TreeView and Gtk::CellRendererCombo sample script. Copyright (C) 2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: tree_combo.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' T_APPLICATION = 0 T_COMBO_TEXT_COLUMN = 1 T_COMBO_MODEL = 2 T_COMBO_HAS_ENTRY = 3 T_COMBO_EDITABLE = 4 T_COMBO_TEXT = 5 # The COMPUTER combo model combo_model = Gtk::ListStore.new(String) ["Ruby", "Perl", "Python", "Java"].each do |v| iter = combo_model.append iter[0] = v end # The table model. model = Gtk::ListStore.new(String, # T_APPLICATION Integer, # T_COMBO_TEXT_COLUMN Gtk::ListStore, # T_COMBO_MODEL TrueClass, # T_COMBO_HAS_ENTRY TrueClass, # T_COMBO_EDITABLE String) # T_COMBO_TEXT view = Gtk::TreeView.new(model) # 1st column(Text) trenderer = Gtk::CellRendererText.new tcol = Gtk::TreeViewColumn.new("Application", trenderer, :text => T_APPLICATION) view.append_column(tcol) # 2nd column(Combo) crenderer = Gtk::CellRendererCombo.new crenderer.signal_connect("edited") do |renderer, path, text| model.get_iter(path)[T_COMBO_TEXT] = text end ccol = Gtk::TreeViewColumn.new("Language", crenderer, :text_column => T_COMBO_TEXT_COLUMN, :model => T_COMBO_MODEL, :has_entry => T_COMBO_HAS_ENTRY, :editable => T_COMBO_EDITABLE, :text => T_COMBO_TEXT) view.append_column(ccol) # Create rows. (1..2).each do |v| iter = model.append iter[T_APPLICATION] = "application #{v}" iter[T_COMBO_MODEL] = combo_model iter[T_COMBO_HAS_ENTRY] = false iter[T_COMBO_EDITABLE] = true iter[T_COMBO_TEXT] = combo_model.get_iter("0")[0] end win = Gtk::Window.new win.signal_connect("delete_event"){ Gtk.main_quit } win.add(view).show_all Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/togglebutton.rb����������������������������������������������0000664�0001750�0001750�00000001416�11740310343�020732� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin togglebutton.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: togglebutton.rb,v 1.10 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::ToggleButton sample") window.border_width = 10 box = Gtk::Box.new(:vertical, 10) window.add(box) button1 = Gtk::ToggleButton.new("_button1") button2 = Gtk::ToggleButton.new("_button2",false) button3 = Gtk::ToggleButton.new(Gtk::Stock::QUIT) box.add(button1).add(button2).add(button3) box.pack_start(Gtk::Separator.new(:horizontal)) close = Gtk::Button.new(:label => "close") close.signal_connect("clicked") do Gtk.main_quit end box.add(close) window.show_all Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/drag-move.rb�������������������������������������������������0000644�0001750�0001750�00000005041�11701304107�020070� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin drag-move.rb - Move widget by drag sample script. Copyright (C) 2006 Kouhei Sutou This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 13:18:12 $ $Id: drag-move.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' class DraggableWidget < Gtk::EventBox def initialize super set_visible_window(false) @dragging = false @drag_button = 1 set_button_press_event set_button_release_event set_motion_notify_event end def layout parent end def move(x, y) if layout layout.move(self, x, y) true else false end end def dragging? @dragging end private def set_button_press_event signal_connect("button_press_event") do |widget, event| if event.button == @drag_button Gtk.grab_add(widget) x, y, w, h = widget.allocation.to_a drag_start(x, y, event.x_root, event.y_root) else false end end end def set_motion_notify_event signal_connect("motion_notify_event") do |widget, event| if dragging? drag_motion(event.x_root, event.y_root) else false end end end def set_button_release_event signal_connect("button_release_event") do |widget, event| if event.button == @drag_button Gtk.grab_remove(widget) drag_end else false end end end def set_drag_move_position_event signal_connect("drag_move_position") do |widget, x, y| if layout layout.move(widget, x, y) true else false end end end def drag_start(x, y, base_x, base_y) @dragging = true @drag_x = x @drag_y = y @drag_base_x = base_x @drag_base_y = base_y true end def drag_motion(base_x, base_y) delta_x = base_x - @drag_base_x delta_y = base_y - @drag_base_y if delta_x != 0 and delta_y != 0 move(@drag_x + delta_x, @drag_y + delta_y) else false end end def drag_end @dragging = false true end end window = Gtk::Window.new("Draggable Widget sample") window.signal_connect("destroy"){Gtk.main_quit} layout = Gtk::Layout.new draggable_widget = DraggableWidget.new draggable_widget.set_size_request(50, 50) layout.put(draggable_widget, 75, 75) draggable_widget.signal_connect("expose_event") do |widget, event| x, y, w, h = widget.allocation.to_a fg = Gdk::GC.new(widget.window) widget.window.draw_arc(fg, true, x, y, w, h, 0 * 64, 360 * 64) false end window.add(layout) window.show_all Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/pangorenderer.rb���������������������������������������������0000644�0001750�0001750�00000003342�11701304107�021044� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin pangorenderer.rb - Ruby/GTK sample script. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: pangorenderer.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' RADIUS = 80 N_WORDS = 16 if str = Gtk.check_version(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" puts str exit end win = Gtk::Window.new("Gdk::PangoRenderer sample") win.signal_connect("destroy"){Gtk.main_quit} win.set_default_size(400, 400) win.realize matrix = Pango::Matrix.new renderer = Gdk::PangoRenderer.default renderer.drawable = win.window renderer.gc = Gdk::GC.new(win.window) width, height = win.size device_radius = [width, height].min / 6.0 matrix.translate!(device_radius + (width - 2 * device_radius) / 2.0, device_radius + (height - 2 * device_radius) / 2.0) matrix.scale!(device_radius / RADIUS, device_radius / RADIUS) context = Gdk::Pango.context layout = Pango::Layout.new(context) layout.text = "Ruby-GNOME2" layout.font_description = Pango::FontDescription.new("Sans Bold 14") background = Gdk::Color.new(65535, 65535, 65535) Gdk::Colormap.system.alloc_color(background, false, true) win.window.background = background win.signal_connect("expose_event") do (0...N_WORDS).each do |i| rotated_matrix = matrix.dup angle = 360 * i / N_WORDS.to_f color = Gdk::Color.new(65535 * rand, 65535 * rand, 65535 * rand) renderer.set_override_color(Pango::Renderer::PART_FOREGROUND, color) rotated_matrix.rotate!(angle) context.set_matrix(rotated_matrix) layout.context_changed width, height = layout.size renderer.draw_layout(layout, width / 2, RADIUS * Pango::SCALE) end end win.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/print.rb�����������������������������������������������������0000664�0001750�0001750�00000015756�11740310343�017365� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin print.rb - Gtk::Print* sample Copyright (C) 2007 Mathieu Blondel This program is licenced under the same licence as Ruby-GNOME2. $Id: print.rb,v 1.1 2007/08/05 15:41:31 mutoh Exp $ =end require 'gtk3' # Values returned by a Pango::Layout or set in a Pango::Layout # are always multiple of Pango::SCALE. Those are convenience methods to # deal with that. class Pango::Layout def size_in_points self.size.collect { |v| v / Pango::SCALE } end def width_in_points self.size[0] / Pango::SCALE end def height_in_points self.size[1] / Pango::SCALE end def width_in_points=(width) self.width = width * Pango::SCALE end end class Print < Gtk::PrintOperation FONT = Pango::FontDescription.new("sans 12") FONT_SMALL = Pango::FontDescription.new("sans 8") FONT_SIZE = 12 FONT_SMALL_SIZE = 8 def initialize (parent_window, text) super() @parent_window = parent_window @text = text # with this option disabled, the origin is the the upper left corner # *taking into consideration margins* ! self.use_full_page = false self.unit = Gtk::PaperSize::Unit::POINTS # set default paper size page_setup = Gtk::PageSetup.new paper_size = Gtk::PaperSize.new(Gtk::PaperSize.default) page_setup.paper_size_and_default_margins = paper_size self.default_page_setup = page_setup # show a progress bar self.show_progress = true # You must choose between "paginate" and "begin-print". # "begin-print" is emitted only once and "paginate" is emitted # until the block returns true. # In both cases, you must set the number of pages at the end with # Gtk::PrintOperation#n_pages= signal_connect("begin-print") do |pop, context| puts "calls begin-print" cr = context.cairo_context paragraphs = @text.split("\n") layouts = [] paragraphs.each do |para| layouts << create_layout(cr, para) end # distribute paragraph layouts among pages @page_layouts = [] curr_height = 0 n_pages = 0 layouts.each do |layout| height = layout.height_in_points if curr_height + height > real_page_height n_pages += 1 curr_height = 0 end @page_layouts[n_pages] ||= [] @page_layouts[n_pages] << layout curr_height += height end pop.n_pages = n_pages + 1 end signal_connect("draw-page") do |pop, context, page_num| puts "calls draw-page %d" % page_num cr = context.cairo_context x, y = [0,0] # this means we start at the upper left margin if @page_layouts[page_num] @page_layouts[page_num].each do |layout| cr.move_to(x,y) cr.show_pango_layout(layout) y += layout.height_in_points end total_pages = @page_layouts.length else total_pages = 1 end # page_num starts at 0 draw_footer(cr, page_num + 1, total_pages) end end def run_print_dialog res = run(Action::PRINT_DIALOG, @parent_window) case res when RESULT_ERROR puts "error" when RESULT_CANCEL puts "cancelled" when RESULT_APPLY puts "applied" when RESULT_IN_PROGRESS puts "in progress" end end def run_preview res = run(Action::PREVIEW, @parent_window) end private def page_height setup = self.default_page_setup # this takes margins into consideration, contrary to get_paper_height setup.get_page_height(Gtk::PaperSize::Unit::POINTS) end def page_width setup = self.default_page_setup width = setup.get_page_width(Gtk::PaperSize::Unit::POINTS) end def real_page_height page_height - footer_height end def footer_height 5 * FONT_SMALL_SIZE end def create_layout(cr, text) layout = cr.create_pango_layout layout.width_in_points = page_width layout.font_description = FONT layout.wrap = Pango::Layout::WrapMode::CHAR layout.ellipsize = Pango::Layout::ELLIPSIZE_NONE layout.single_paragraph_mode = false layout.text = text layout end def draw_footer(cr, nth_page, total_page) layout = cr.create_pango_layout layout.alignment = Pango::Layout::ALIGN_RIGHT layout.font_description = FONT_SMALL layout.text = "Page %d/%d" % [nth_page, total_page] + "\n" + \ Time.now.strftime("Printed on %Y/%m/%d at %H:%M") + "\n" + \ "Powered by Ruby-GNOME2!" width, height = layout.size_in_points x, y = [page_width, page_height] x -= width y -= height cr.move_to(x, y) cr.show_pango_layout(layout) cr.rel_move_to(width, -2) cr.rel_line_to(-page_width, 0) cr.stroke end end class Window < Gtk::Window def initialize super signal_connect("delete-event") { Gtk.main_quit } set_default_size(600, 600) @textview = Gtk::TextView.new @textview.wrap_mode = Gtk::TextTag::WrapMode::WORD hbox = Gtk::Box.new(:horizontal) page_setup_button = Gtk::Button.new page_setup_button.label = "Page setup" page_setup_button.signal_connect("clicked") do @page_setup = Print::run_page_setup_dialog(self, # parent window @page_setup) end print_preview_button = Gtk::Button.new(:stock_id => Gtk::Stock::PRINT_PREVIEW) print_preview_button.signal_connect("clicked") do printop = Print.new(self, @textview.buffer.text) printop.default_page_setup = @page_setup if @page_setup printop.run_preview end print_button = Gtk::Button.new(:stock_id => Gtk::Stock::PRINT) print_button.signal_connect("clicked") do printop = Print.new(self, @textview.buffer.text) printop.default_page_setup = @page_setup if @page_setup printop.run_print_dialog end [page_setup_button, print_preview_button, print_button].each do |b| hbox.pack_start(b, true, true) # expand, fill end scrollbar = Gtk::Scrollbar.new(:vertical) vbox = Gtk::Box.new(:vertical) scroll = Gtk::ScrolledWindow.new.add(@textview) scroll.set_policy(:automatic, :automatic) vbox.pack_start(scroll) vbox.pack_end(hbox, false, false) add(vbox) show_all end end Window.new Gtk.main ������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/tree_progress.rb���������������������������������������������0000664�0001750�0001750�00000002250�11740310343�021075� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin tree_progress.rb - Gtk::TreeView and Gtk::CellRendererProgress sample script. Copyright (C) 2004-2006 Darren Willis, Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: tree_progress.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' win = Gtk::Window.new("Gtk::CellRendererProgress sample") win.set_default_size(300, 50) model = Gtk::ListStore.new(String, Float) view = Gtk::TreeView.new(model) prog = model.append prog[0] = "bar 1" prog[1] = 50 prog1 = model.append prog1[0] = "bar 2" prog1[1] = 5 prog2 = model.append prog2[0] = "bar 3" prog2[1] = 10 arenderer = Gtk::CellRendererText.new acol = Gtk::TreeViewColumn.new("words", arenderer, :text => 0) view.append_column(acol) prenderer = Gtk::CellRendererProgress.new pcol = Gtk::TreeViewColumn.new("Progress", prenderer, :value => 1) view.append_column(pcol) win.signal_connect("delete_event"){ Gtk.main_quit } win.add(view) win.show_all dir = 1 thr = Thread.new do loop { prog2[1] += dir if prog2[1] > 100 prog2[1] = 100 dir = - dir end if prog2[1] < 0 prog2[1] = 0 dir = - dir end sleep 0.01 } end Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/linkbutton.rb������������������������������������������������0000644�0001750�0001750�00000001642�11701304107�020403� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin linkbutton.rb - Gtk::LinkButton sample. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: linkbutton.rb,v 1.1 2006/10/21 16:58:00 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::LinkButton sample") window.signal_connect("destroy"){Gtk.main_quit} vbox = Gtk::VBox.new # URI only button1 = Gtk::LinkButton.new("http://ruby-gnome2.sourceforge.jp/") button1.signal_connect("clicked") do puts button1.uri end vbox.pack_start(button1) # URI with a label button2 = Gtk::LinkButton.new("http://ruby-gnome2.sourceforge.jp/", "Ruby-GNOME2 Website") button2.signal_connect("clicked") do puts button2.uri end # Global setting instead of using clicked signals. Gtk::LinkButton.set_uri_hook {|button, link| puts "set_uri_hook: " + link } vbox.pack_start(button2) window.add(vbox) window.show_all Gtk.main ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/dndtreeview.rb�����������������������������������������������0000664�0001750�0001750�00000002777�11740310343�020550� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin dndtreeview.rb - Drag and Drop sample script. Copyright (C) 2003-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 13:18:12 $ $Id: dndtreeview.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' class TestWindow < Gtk::Window attr_reader :list TARGET_TABLE = [["GTK_TREE_MODEL_ROW", 0, 0]] def initialize() super("Drag and Drop Gtk::TreeView") set_default_size(300,128) signal_connect("destroy") { Gtk.main_quit } data = [["Hello", "KON-NI-CHIWA"], ["Goodbye", "SAYO-NARA"], ["Good morning", "OHA-YO-GOZAI-MASU"], ["Good evening", "KON-BAN-WA"]] model = Gtk::ListStore.new(String, String) view = Gtk::TreeView.new(model) renderer = Gtk::CellRendererText.new col1 = Gtk::TreeViewColumn.new("Data", renderer, {:text => 0}) col2 = Gtk::TreeViewColumn.new("Data", renderer, {:text => 1}) view.append_column(col1) view.append_column(col2) data.each do |v1, v2| iter = model.append iter.set_value(0, v1) iter.set_value(1, v2) end view.enable_model_drag_source(Gdk::Window::ModifierType::BUTTON1_MASK, TARGET_TABLE, Gdk::DragContext::Action::COPY|Gdk::DragContext::Action::MOVE) view.enable_model_drag_dest(TARGET_TABLE, Gdk::DragContext::Action::COPY|Gdk::DragContext::Action::MOVE) add(view) end end win = TestWindow.new.show_all Gtk.main �ruby-gnome2-all-2.1.0/gtk3/sample/misc/scalebutton.rb�����������������������������������������������0000664�0001750�0001750�00000001061�11740310343�020534� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin scalebutton.rb - Very simple Gtk::ScaleButton example. Copyright (c) 2007 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: scalebutton.rb,v 1.1 2007/07/12 14:04:54 ggc Exp $ =end require 'gtk3' window = Gtk::Window.new window.add(scale = Gtk::ScaleButton.new(Gtk::IconSize::IconSize::BUTTON)) scale.set_icons(['gtk-goto-bottom', 'gtk-goto-top', 'gtk-execute']) scale.signal_connect('value-changed') { |widget, value| puts "value changed: #{value}" } window.show_all Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/combo_check.rb�����������������������������������������������0000644�0001750�0001750�00000003014�11701304107�020441� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin combo_check.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: combo_check.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("entry") window.border_width = 0 box1 = Gtk::VBox.new window.add(box1) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2) entry = Gtk::Entry.new entry.text = "hello world" entry.select_region(0, -1) box2.pack_start(entry) # # Gtk::Combo has been deprecated. Use Gtk::ComboBox instead. # cb = Gtk::Combo.new cb.set_popdown_strings(["item0", "item1 item1", "item2 item2 item2", "item3 item3 item3 item3", "item4 item4 item4 item4 item4", "item5 item5 item5 item5 item5 item5", "item6 item6 item6 item6 item6", "item7 item7 item7 item7", "item8 item8 item8", "item9 item9"]) cb.entry.set_text("hello world") cb.entry.select_region(0, -1) box2.pack_start(cb, true, true, 0) check = Gtk::CheckButton.new("Editable") box2.pack_start(check, false, true, 0) check.signal_connect("toggled") do cb.entry.set_editable(check.active?) entry.set_editable(check.active?) end check.state = 0 box1.pack_start(Gtk::HSeparator.new) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2) button = Gtk::Button.new("close") button.signal_connect("clicked") do Gtk.main_quit end box2.pack_start(button) button.can_default = true button.grab_default window.show_all Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/stock.rb�����������������������������������������������������0000644�0001750�0001750�00000001434�11701304107�017334� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin stock.rb - Gtk::Stock sample script. Copyright (C) 2001-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: stock.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::Stock sample") window.signal_connect("destroy"){Gtk.main_quit} stocks = Gtk::Stock.constants.sort image = Gtk::Image.new label = Gtk::Label.new button = Gtk::Button.new("Click!") cnt = 0 button.signal_connect("clicked") do stock_name = "Gtk::Stock::#{stocks[cnt]}" label.set_text(stock_name) image.set(eval(stock_name), Gtk::IconSize::DIALOG) if cnt < stocks.size - 1 cnt += 1 else cnt = 0 end end box = Gtk::VBox.new.add(image).add(label).add(button) window.add(box).set_default_size(200,200).show_all Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/xbm_cursor.rb������������������������������������������������0000644�0001750�0001750�00000003123�11701304107�020371� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin xbm_cursor.rb - Gdk::Cursor sample script. Copyright (C) 2001-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 13:18:12 $ $Id: xbm_cursor.rb,v 1.6 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' cursor_bits = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0xe0, 0x78, 0x00, 0xe0, 0x70, 0x00, 0xe0, 0x70, 0x00, 0xe0, 0x38, 0x00, 0xe0, 0x1f, 0x00, 0xe0, 0x1d, 0x00, 0xe0, 0x38, 0x00, 0xe0, 0x78, 0x00, 0xe0, 0xf0, 0x00, 0xf0, 0xf3, 0x01, 0xf0, 0xe3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].pack("c*") cursor_mask_bits = [ 0x63, 0x8e, 0x0f, 0x67, 0x8e, 0x0f, 0x06, 0xc6, 0x07, 0x04, 0x00, 0x00, 0xf0, 0x3f, 0x08, 0xe7, 0x78, 0x0e, 0xe7, 0x70, 0x0f, 0xe4, 0x70, 0x03, 0xe0, 0x38, 0x00, 0xe7, 0x1f, 0x0c, 0xe7, 0x1d, 0x0f, 0xe0, 0x38, 0x0e, 0xe0, 0x78, 0x08, 0xe7, 0xf0, 0x00, 0xf7, 0xf3, 0x01, 0xf0, 0xe3, 0x01, 0x04, 0x00, 0x00, 0x46, 0x24, 0x06, 0x67, 0x66, 0x0e, 0x67, 0x66, 0x0e].pack("c*") window = Gtk::Window.new("Gdk::Cursor sample") window.signal_connect("destroy"){Gtk.main_quit} window.realize source = Gdk::Pixmap.create_from_data(window.window, cursor_bits, 19, 19) mask = Gdk::Pixmap.create_from_data(window.window, cursor_mask_bits, 19, 19) fg = Gdk::Color.new(65535, 0, 0) bg = Gdk::Color.new(65535, 65535, 0) cursor = Gdk::Cursor.new(source, mask, fg, bg, 10, 10) window.window.set_cursor(cursor) window.add(Gtk::Label.new("Put your cursor on this window.")) window.set_default_size(200, 100).show_all Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/treeview.rb��������������������������������������������������0000664�0001750�0001750�00000003645�11740310343�020055� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin treeview.rb - Gtk::TreeView sample Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: treeview.rb,v 1.8 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::TreeView sample") # Create data model = Gtk::TreeStore.new(String, String, Gdk::Color, Float, Gdk::Pixbuf) # column 1 root_iter = model.append(nil) root_iter[0] = "Root" root_iter[1] = "red" root_iter[2] = Gdk::Color.new(0, 65535, 0) root_iter[3] = 5.0 # column 2 root_iter[4] = window.render_icon_pixbuf(Gtk::Stock::NEW, Gtk::IconSize::IconSize::DIALOG) child_iter1 = model.append(root_iter) child_iter1[0] = "Child_Iter1" child_iter1[1] = "green" child_iter1[2] = Gdk::Color.new(65535, 0, 0) child_iter1[3] = 3.0 # column 2 child_iter1[4] = window.render_icon_pixbuf(Gtk::Stock::OPEN, Gtk::IconSize::IconSize::MENU) child_iter2 = model.append(root_iter) child_iter2[0] = "Child_Iter2" child_iter2[1] = "yellow" child_iter2[2] = Gdk::Color.new(0, 0, 65535) child_iter2[3] = 0.9 # column 2 child_iter2[4] = window.render_icon_pixbuf(Gtk::Stock::QUIT, Gtk::IconSize::IconSize::BUTTON) # Create view tv = Gtk::TreeView.new(model) # column 1 renderer = Gtk::CellRendererText.new column = Gtk::TreeViewColumn.new("Gtk::CellRenderText", renderer, { :text => 0, :background => 1, :foreground_gdk => 2, :scale => 3, }) tv.append_column(column) # column 2 renderer = Gtk::CellRendererPixbuf.new column = Gtk::TreeViewColumn.new("Gtk::CellRenderPixbuf", renderer, { :pixbuf => 4 }) tv.append_column(column) window.add(tv).set_default_size(300, 300).show_all window.signal_connect("destroy"){Gtk.main_quit} Gtk.main �������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/colorselection.rb��������������������������������������������0000644�0001750�0001750�00000001205�11701304107�021231� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin colorselection.rb - Gtk::ColorSelection sample script. Copyright (C) 2005,2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: colorselection.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' settings = Gtk::Settings.default # You can save the palette to use right click on the palette. Gtk::ColorSelection.set_change_palette_hook{|screen, colors| puts strs = Gtk::ColorSelection.palette_to_string(colors) settings.gtk_color_palette = strs } a = Gtk::ColorSelection.new a.has_palette = true Gtk::Window.new.add(a).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/cursor.rb����������������������������������������������������0000664�0001750�0001750�00000001340�11740310343�017526� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin cursor.rb - Gdk::Cursor sample script. Copyright (C) 2001-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: cursor.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gdk::Cursor sample") window.realize button = Gtk::Button.new(:label => "Click!") button.use_underline = false cursors = Gdk::Cursor::Type.values - [Gdk::Cursor::Type::CURSOR_IS_PIXMAP] cnt = 0 button.signal_connect('clicked') do cursor = cursors[cnt] p cursor.inspect button.set_label(cursor.inspect) window.window.set_cursor(Gdk::Cursor.new(cursor)) cnt += 1 cnt = 0 if cnt == cursors.size end window.add(button) window.set_default_size(400,100).show_all Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/iconview.rb��������������������������������������������������0000644�0001750�0001750�00000001524�11701304107�020034� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin iconview.rb - Ruby/GTK2 sample script. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: iconview.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' TEXT_COLUMN = 0 PIXBUF_COLUMN = 1 model = Gtk::ListStore.new(String, Gdk::Pixbuf) iv = Gtk::IconView.new(model) iv.text_column = TEXT_COLUMN iv.pixbuf_column = PIXBUF_COLUMN Dir.glob("../gtk-demo/gnome*.png").each do |f| iter = model.append iter[TEXT_COLUMN] = File.basename(f) iter[PIXBUF_COLUMN] = Gdk::Pixbuf.new(f) end iv.signal_connect("item_activated") do |iv, path| iter = model.get_iter(path) p iter [0] end win = Gtk::Window.new("Gtk::IconView sample") win.signal_connect("destroy"){Gtk.main_quit} win.add(iv).set_default_size(300,300).show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/menu.rb������������������������������������������������������0000644�0001750�0001750�00000003306�11701304107�017155� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin menu.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: menu.rb,v 1.8 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' def create_menu(depth) return nil if depth < 1 menu = Gtk::Menu.new group = nil submenu = nil for i in 0..4 buf = sprintf("item %2d - %d", depth, i + 1) menuitem = Gtk::RadioMenuItem.new(group, buf) group = menuitem.group menu.append(menuitem) if depth > 1 menuitem.set_submenu create_menu(depth - 1) end end menu end window = Gtk::Window.new("menus") window.signal_connect("destroy") do Gtk.main_quit end window.border_width = 0 box1 = Gtk::VBox.new(false, 0) window.add(box1) menubar = Gtk::MenuBar.new box1.pack_start(menubar, false, true, 0) menu = create_menu(2) menuitem = Gtk::MenuItem.new("test\nline2") menuitem.set_submenu(menu) menubar.append(menuitem) menuitem = Gtk::MenuItem.new("foo") menuitem.set_submenu(create_menu(3)) menubar.append(menuitem) menuitem = Gtk::MenuItem.new("bar") menuitem.set_submenu(create_menu(4)) menubar.append(menuitem) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, true, true, 0) optionmenu = Gtk::OptionMenu.new optionmenu.set_menu(create_menu(1)) optionmenu.set_history(4) box2.pack_start(optionmenu, true, true, 0) separator = Gtk::HSeparator.new box1.pack_start(separator, false, true, 0) box2 = Gtk::HBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) button = Gtk::Button.new("close") button.signal_connect("clicked") do window.destroy end box2.pack_start(button, true, true, 0) window.show_all Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/filechooser.rb�����������������������������������������������0000664�0001750�0001750�00000002240�11740310343�020513� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin filechooser.rb - Ruby/GTK2 sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: filechooser.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require "gtk3" dialog = Gtk::FileChooserDialog.new(:title => "Gtk::FileChooser sample", :action => Gtk::FileChooser::Action::OPEN, :buttons => [[Gtk::Stock::OPEN, Gtk::Dialog::ResponseType::ACCEPT], [Gtk::Stock::CANCEL, Gtk::Dialog::ResponseType::CANCEL]]) extra_button = Gtk::Button.new(:label => "Extra button") extra_button.signal_connect("clicked") do puts "extra button is clicked" end dialog.extra_widget = extra_button filter_rb = Gtk::FileFilter.new filter_rb.name = "Ruby Scripts" filter_rb.add_pattern("*.rb") filter_rb.add_pattern("*.rbw") dialog.add_filter(filter_rb) filter_c = Gtk::FileFilter.new filter_c.name = "C sources" filter_c.add_pattern("*.[c|h]") dialog.add_filter(filter_c) dialog.add_shortcut_folder("/tmp") if dialog.run == Gtk::Dialog::ResponseType::ACCEPT puts "filename = #{dialog.filename}" puts "uri = #{dialog.uri}" end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/style_property.rb��������������������������������������������0000755�0001750�0001750�00000003200�11701304107�021311� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin style_property.rb - Ruby/GTK2 sample script. Copyright (c) 2004,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: style_property.rb,v 1.4 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' class MyButton < Gtk::Button type_register def initialize(label = nil) # When type_register() is used. # super is equivalent to GLib::Object#initialize. super("label" => label) end install_style_property(GLib::Param::Int.new("foo", # name "Foo", # nick "FOO", # blurb 0, #min 100, #max 5, #default GLib::Param::READABLE | GLib::Param::WRITABLE)) do |pspec, str| p pspec, str str.to_i + 10 #return the converted value. end install_style_property(GLib::Param::Enum.new("bar", # name "Bar", # nick "BAR", # blurb GLib::Type["GdkCursorType"], #Enum type Gdk::Cursor::ARROW, #default GLib::Param::READABLE | GLib::Param::WRITABLE)) do |pspec, str| p pspec, str if str.strip! == "boat" Gdk::Cursor::BOAT else pspec.default end end end Gtk::RC.parse("./style_property.rc") win = Gtk::Window.new("Gtk::RC sample") b = MyButton.new("Hello") b.signal_connect("clicked"){ Gtk.main_quit } p MyButton.style_properties win.set_default_size(100, 100) win.add(b).show_all win.signal_connect("destroy"){ Gtk.main_quit } # You need to call them after "Gtk::Widget#show" # (Or in expose event). p b.style_get_property("foo") p cursor = b.style_get_property("bar") Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/itemfactory2.rb����������������������������������������������0000644�0001750�0001750�00000004554�11701304107�020627� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin itemfactory2.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. *NOTE* Gtk::ItemFactory has been deprecated. Use Gtk::UIManager instead. $Id: itemfactory2.rb,v 1.8 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' puts "Deprecated. Use Gtk::UIManager instead." window = Gtk::Window.new("Gtk::ItemFactory2") window.signal_connect("destroy") do Gtk.main_quit end window.signal_connect("delete_event") do Gtk.main_quit end accelgroup = Gtk::AccelGroup.new window.add_accel_group(accelgroup) ifp = Gtk::ItemFactory.new(Gtk::ItemFactory::TYPE_MENU_BAR, "<main>", accelgroup) ifp.create_item("/_Stock") ifp.create_item("/_Stock/_New", "<StockItem>", "<control>N", Gtk::Stock::NEW, 1) do |v, _| p "StockItem #{v}" end item = ifp.create_item("/_Stock/_Open", "<StockItem>", "<control>O", Gtk::Stock::OPEN, 2) do |v, _| p "StockItem #{v}" end ifp.create_item("/_Stock/_Quit", "<StockItem>", "<control>Q", Gtk::Stock::QUIT, 3) do |v, _| p "Quit" Gtk.main_quit end ifp.create_item("/_Item") ifp.create_item("/_Item/Item_1", "<Item>"){p "Item1"} ifp.create_item("/_Item/Item_2", "<Item>"){p "Item2"} ifp.create_item("/_Check") ifp.create_item("/_Check/Check_1", "<CheckItem>"){p "Check1"} ifp.create_item("/_Check/Check_2", "<CheckItem>"){p "Check2"} ifp.create_item("/_Toggle") ifp.create_item("/_Toggle/Toggle_1", "<ToggleItem>", nil, nil, 1){|v, _| p "Toggle#{v}"} ifp.create_item("/_Toggle/Toggle_2", "<ToggleItem>", nil, nil, 2){|v, _| p "Toggle#{v}"} ifp.create_item("/_Radio") ifp.create_item("/_Radio/Radio_1", "<RadioItem>", nil, nil, 1){|v, _| p "Radio#{v}"} ifp.create_item("/_Radio/Radio_2", "/Radio/Radio1", nil, nil, 2){|v, _| p "Radio#{v}"} ifp.create_item("/_Radio/Radio_3", "/Radio/Radio1", nil, nil, 3){|v, _| p "Radio#{v}"} ifp.create_item("/_Misc", "<LastBranch>") ifp.create_item("/_Misc/Tearoff", "<Tearoff>") ifp.create_item("/_Misc/Title", "<Title>") ifp.create_item("/_Misc/Seperator", "<Separator>") ifp.create_item("/_Misc/Image", "<ImageItem>", "", Gdk::Pixbuf.new("gnome-logo-icon.png")) do p "ImageItem" end ifp.get_widget("/Stock/Open").sensitive = false vbox = Gtk::VBox.new vbox.add(ifp.get_widget("<main>")) vbox.add(Gtk::Label.new("Gtk::ItemFactory sample").set_size_request(400, 200)) window.add(vbox) window.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/mouse-gesture.rb���������������������������������������������0000644�0001750�0001750�00000023674�11701304107�021027� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin mouse-gesture.rb - mouse gesture sample script. Copyright (C) 2005,2006 Kouhei Sutou This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 13:18:12 $ $Id: mouse-gesture.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' unless Gdk.cairo_available? STDERR.puts("need cairo and rcairo support for this sample") exit 1 end class GestureProcessor DEFAULT_THRESHOLD = 16 DEFAULT_SKEW_THRESHOLD_ANGLE = 30 attr_accessor :threshold, :skew_threshold_angle attr_reader :motions def initialize(threshold=nil, skew_threshold_angle=nil) @threshold = threshold || DEFAULT_THRESHOLD @skew_threshold_angle = skew_threshold_angle @skew_threshold_angle ||= DEFAULT_SKEW_THRESHOLD_ANGLE reset end def started? @started end MOTIONS = %w(L R U D UL UR LL LR) def available_motion?(motion) MOTIONS.include?(motion) end def start(x, y) @prev_x = @x = x @prev_y = @y = y @started = true @motions = [] end def update_position(x, y) mx = x - @prev_x my = y - @prev_y motion = judge_motion(mx, my) if motion @prev_x = @x = x @prev_y = @y = y if @motions.last == motion false else @motions << motion true end else false end end def reset @started = false @x = @y = -1 @motions = [] end def to_a @motions end def position [@x, @y] end private def judge_motion(mx, my) mxa = mx.abs mya = my.abs distance = Math.sqrt(mxa ** 2 + mya ** 2) upper_theta = (45 + @skew_threshold_angle) * (Math::PI / 180.0) lower_theta = (45 - @skew_threshold_angle) * (Math::PI / 180.0) if distance > @threshold and mya < Math.tan(upper_theta) * mxa and mya > Math.tan(lower_theta) * mxa judge_corner_motion(mx, my) elsif mxa > @threshold or mya > @threshold judge_cross_motion(mx, my) else nil end end def judge_corner_motion(mx, my) if mx < 0 if my < 0 "UL" else "LL" end else if my < 0 "UR" else "LR" end end end def judge_cross_motion(mx, my) if mx.abs > my.abs if mx < 0 "L" else "R" end else if my < 0 "U" else "D" end end end end class Gesture < Gtk::EventBox DEFAULT_BACK_RGBA = [0.2, 0.2, 0.2, 0.5] DEFAULT_LINE_RGBA = [1, 0, 0, 1] DEFAULT_NEXT_RGBA = [0, 1, 0, 0.8] DEFAULT_CURRENT_RGBA = [1, 0, 1, 0.8] def initialize(conf={}) super() set_visible_window(false) conf ||= {} @back_rgba = conf[:back_rgba] || DEFAULT_BACK_RGBA @line_rgba = conf[:line_rgba] || DEFAULT_LINE_RGBA @next_rgba = conf[:next_rgba] || DEFAULT_NEXT_RGBA @current_rgba = conf[:current_rgba] || DEFAULT_CURRENT_RGBA @processor = GestureProcessor.new(conf[:threshold], conf[:skew_threshold_angle]) @actions = [] set_expose_event set_motion_notify_event set_button_release_event end def add_action(sequence, action=Proc.new) invalid_motion = sequence.find do |motion| not @processor.available_motion?(motion) end raise "invalid motion: #{invalid_motion}" if invalid_motion @actions << [sequence, action] end def start(widget, button, x, y, base_x, base_y) Gtk.grab_add(self) @widget = widget @button = button @processor.start(x, y) @base_x = base_x @base_y = base_y @cr = window.create_cairo_context @cr.set_source_rgba(@line_rgba) @cr.move_to(x, y) end private def perform_action act = action act.call(@widget) if act @processor.reset end def action motions = @processor.motions @actions.each do |sequence, act| return act if sequence == motions end nil end def available_motions motions = @processor.motions @actions.collect do |sequence, act| if sequence == motions sequence.last else nil end end.compact.uniq end def next_available_motions motions = @processor.motions @actions.collect do |sequence, act| if sequence[0..-2] == motions sequence.last else nil end end.compact.uniq end def match? not action.nil? end def set_expose_event signal_connect("expose_event") do |widget, event| if @processor.started? cr = widget.window.create_cairo_context cr.rectangle(*widget.allocation.to_a) cr.set_source_rgba(@back_rgba) cr.fill cr.set_source_rgba(@next_rgba) draw_available_marks(cr, next_available_motions) if action cr.set_source_rgba(@current_rgba) draw_mark(cr, *@processor.position) end @cr.stroke_preserve true else false end end end def draw_mark(cr, x=nil, y=nil, radius=nil) x ||= @processor.position[0] y ||= @processor.position[1] radius ||= @processor.threshold cr.save do cr.translate(x, y) cr.scale(radius, radius) cr.arc(0, 0, 0.5, 0, 2 * Math::PI) cr.fill end end def draw_available_marks(cr, motions) motions.each do |motion| adjust_x = calc_position_ratio(motion, %w(R), %w(L), %w(UR LR), %w(UL LL)) adjust_y = calc_position_ratio(motion, %w(D), %w(U), %w(LR LL), %w(UR UL)) threshold = @processor.threshold x, y = @processor.position x += threshold * adjust_x y += threshold * adjust_y draw_mark(cr, x, y, threshold) end end def calc_position_ratio(motion, inc, dec, inc_skew, dec_skew) case motion when *inc 1 when *inc_skew 1 / Math.sqrt(2) when *dec -1 when *dec_skew -1 / Math.sqrt(2) else 0 end end def set_motion_notify_event signal_connect("motion_notify_event") do |widget, event| if @processor.started? x = @base_x + event.x y = @base_y + event.y @cr.line_to(x, y) @cr.save do if @processor.update_position(x, y) queue_draw end end @cr.stroke_preserve true else false end end end def set_button_release_event signal_connect("button_release_event") do |widget, event| if event.button == @button and @processor.started? Gtk.grab_remove(self) perform_action hide true else false end end end end class GesturedWidget < Gtk::EventBox DEFAULT_GESTURE_BUTTON = 3 def initialize(gesture_button=nil) super() set_visible_window(false) @gesture_button = gesture_button || DEFAULT_GESTURE_BUTTON set_button_press_event end def layout parent end def gesture(x, y, base_x, base_y) if layout layout.gesture(self, @gesture_button, x, y, base_x, base_y) end end private def set_button_press_event signal_connect("button_press_event") do |widget, event| if event.button == @gesture_button x, y, w, h = widget.allocation.to_a gesture(x + event.x, y + event.y, x, y) else false end end end end class Layout < Gtk::Layout def initialize() super() @gesture = Gesture.new() put(@gesture, 0, 0) end def gesture(widget, button, x, y, base_x, base_y) remove(@gesture) put(@gesture, 0, 0) _, _, w, h = allocation.to_a @gesture.set_size_request(w, h) @gesture.show @gesture.start(widget, button, x, y, base_x, base_y) end def add_gesture_action(sequence, action=Proc.new) @gesture.add_action(sequence, action) end end window = Gtk::Window.new("Mouse Gesture sample") layout = Layout.new gestured_widget = GesturedWidget.new gestured_widget.set_size_request(50, 50) gestured_widget.signal_connect("expose_event") do |widget, event| x, y, w, h = widget.allocation.to_a cr = widget.window.create_cairo_context cr.set_source_rgba([0.8, 0.8, 0.3, 1]) cr.translate(x, y) cr.scale(w, h) cr.arc(0.5, 0.5, 0.5, -0.1, 360) cr.fill false end layout.put(gestured_widget, 75, 75) gestured_widget2 = GesturedWidget.new gestured_widget2.set_size_request(100, 50) gestured_widget2.signal_connect("expose_event") do |widget, event| x, y, w, h = widget.allocation.to_a cr = widget.window.create_cairo_context cr.set_source_rgba([0.3, 0.3, 0.8, 1]) cr.translate(x, y) cr.scale(w, h) cr.arc(0.5, 0.5, 0.5, -0.1, 360) cr.fill false end layout.put(gestured_widget2, 0, 25) # gesture handlers expand_size = 20 expand_left = Proc.new do |widget| x = layout.child_get_property(widget, :x) y = layout.child_get_property(widget, :y) w, h = widget.size_request layout.move(widget, x - expand_size, y) widget.set_size_request(w + expand_size, h) end expand_right = Proc.new do |widget| x = layout.child_get_property(widget, :x) y = layout.child_get_property(widget, :y) w, h = widget.size_request layout.move(widget, x, y) widget.set_size_request(w + expand_size, h) end expand_top = Proc.new do |widget| x = layout.child_get_property(widget, :x) y = layout.child_get_property(widget, :y) w, h = widget.size_request layout.move(widget, x, y - expand_size) widget.set_size_request(w, h + expand_size) end expand_bottom = Proc.new do |widget| x = layout.child_get_property(widget, :x) y = layout.child_get_property(widget, :y) w, h = widget.size_request layout.move(widget, x, y) widget.set_size_request(w, h + expand_size) end layout.add_gesture_action(["L"]) do |widget| expand_left.call(widget) end layout.add_gesture_action(["U"]) do |widget| expand_top.call(widget) end layout.add_gesture_action(["LL"]) do |widget| expand_left.call(widget) expand_bottom.call(widget) end layout.add_gesture_action(["R", "LR"]) do |widget| expand_right.call(widget) expand_bottom.call(widget) expand_right.call(widget) end window.add(layout) window.signal_connect("destroy"){Gtk.main_quit} window.show_all Gtk.main ��������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/uimanager.rb�������������������������������������������������0000644�0001750�0001750�00000010012�11701304107�020151� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin uimanager.rb - Copyright (C) 2004-2006 Masao Mutoh Original version is demos/gtk-demo/ui_manager.c. This program is licenced under the same licence as Ruby-GNOME2. $Id: uimanager.rb,v 1.6 2007/07/12 14:53:09 ggc Exp $ =end require 'gtk3' if str = Gtk.check_version(2, 4, 0) puts "This sample requires GTK+ 2.4.0 or later" puts str exit end if not Gtk.check_version(2, 12, 0) recentmenuitem = "<menuitem name='recent' action='recent'/>" else recentmenuitem = "" end ui_info = %Q[ <ui> <menubar name='MenuBar'> <menu action='FileMenu'> <menuitem action='New'/> <menuitem action='Open'/> #{recentmenuitem} <menuitem action='Save'/> <menuitem action='SaveAs'/> <separator/> <menuitem action='Quit'/> </menu> <menu action='PreferencesMenu'> <menu action='ColorMenu'> <menuitem action='Red'/> <menuitem action='Green'/> <menuitem action='Blue'/> </menu> <menu action='ShapeMenu'> <menuitem action='Square'/> <menuitem action='Rectangle'/> <menuitem action='Oval'/> </menu> <menuitem action='Bold'/> </menu> <menu action='HelpMenu'> <menuitem action='About'/> </menu> </menubar> <toolbar name='ToolBar'> <toolitem action='Open'/> <toolitem action='Quit'/> <separator action='Sep1'/> <toolitem action='Logo'/> </toolbar> </ui>] callback = Proc.new {|actiongroup, action| puts "`#{action.name}' is clicked. " if action.is_a? Gtk::ToggleAction puts "active? = #{action.active?}" end } callback_quit = Proc.new { p "Quit is called." Gtk.main_quit } callback_radio = Proc.new {|action, current| puts "action = `#{action.name}'" puts "current = `#{current.name}'" } actions = [ ["FileMenu", nil, "_File"], ["PreferencesMenu", nil, "_Preferences"], ["ColorMenu", nil, "_Color"], ["ShapeMenu", nil, "_Shape"], ["HelpMenu", nil, "_Help"], ["New", Gtk::Stock::NEW, "_New", "<control>N", "Create a new file", callback], ["Open", Gtk::Stock::OPEN, "_Open", "<control>O", "Open a file", callback], ["Save", Gtk::Stock::SAVE, "_Save", "<control>S", "Save current file", callback], ["SaveAs", Gtk::Stock::SAVE, "Save _As...", nil, "Save to a file", callback], ["Quit", Gtk::Stock::QUIT, "_Quit", "<control>Q", "Quit", callback_quit], ["About", nil, "_About", "<control>A", "About", callback], ["Logo", "demo-gtk-logo", nil, nil, "GTK+", callback] ] toggle_actions = [ ["Bold", Gtk::Stock::BOLD, "_Bold", "<control>B", "Bold", callback, true] ] color_radio_actions = [ ["Red", nil, "_Red", "<control>R", "Blood", 0], ["Green", nil, "_Green", "<control>G", "Grass", 1], ["Blue", nil, "_Blue", "<control>B", "Sky", 2] ] shape_radio_actions = [ ["Square", nil, "_Square", "<control>S", "Square", 0], ["Rectangle", nil, "_Rectangle", "<control>R", "Rectangle", 1], ["Oval", nil, "_Oval", "<control>O", "Egg", 2] ] window = Gtk::Window.new("Gtk::UIManager sample") actiongroup = Gtk::ActionGroup.new("Actions") actiongroup.add_actions(actions) actiongroup.add_toggle_actions(toggle_actions) actiongroup.add_radio_actions(color_radio_actions, 1) do |action, current| puts "action = `#{action.name}'" puts "current = `#{current.name}'" end actiongroup.add_radio_actions(shape_radio_actions, 2, callback_radio) if not Gtk.check_version(2, 12, 0) action = Gtk::RecentAction.new('recent', 'Open Recent', nil, 'gtk-open') [ 'item-activated', 'activate' ].each { |signal| action.signal_connect(signal) { |action| puts "`Recent' #{signal}, uri=#{action.current_uri || 'no item selected'}" } } actiongroup.add_action(action) end uimanager = Gtk::UIManager.new uimanager.insert_action_group(actiongroup, 0) window.add_accel_group(uimanager.accel_group) uimanager.add_ui(ui_info) vbox = Gtk::VBox.new vbox.pack_start(uimanager["/MenuBar"], false, false) vbox.pack_start(Gtk::Label.new("Gtk::UIManager Sample")) window.add(vbox) window.set_default_size(100, 100).show_all window.signal_connect("destroy"){Gtk.main_quit} Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/entry.rb�����������������������������������������������������0000664�0001750�0001750�00000001163�11740310343�017355� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin entry.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: entry.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("entry") window.border_width = 0 box1 = Gtk::Box.new(:vertical, 10) window.add(box1) entry = Gtk::Entry.new box1.add(entry) box1.add(Gtk::Separator.new(:horizontal)) button = Gtk::Button.new(:label => "close") button.signal_connect("clicked") do Gtk.main_quit end box1.add(button) window.show_all entry.text = "hello world" Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/listview.rb��������������������������������������������������0000664�0001750�0001750�00000003706�11740310343�020067� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin listview.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: listview.rb,v 1.11 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::ListStore sample") window.border_width = 0 box1 = Gtk::Box.new(:vertical, 0) window.add(box1) box2 = Gtk::Box.new(:vertical, 10) box2.border_width = 10 box1.pack_start(box2, true, true, 0) scrolled_win = Gtk::ScrolledWindow.new scrolled_win.set_policy(:automatic,:automatic) box2.pack_start(scrolled_win, true, true, 0) data = [ "hello", "world", "blah", "foo", "bar", "argh", "spencer", "is a", "wussy", "programmer" ] model = Gtk::ListStore.new(String) column = Gtk::TreeViewColumn.new("Data", Gtk::CellRendererText.new, {:text => 0}) treeview = Gtk::TreeView.new(model) treeview.append_column(column) treeview.selection.set_mode(:single) scrolled_win.add_with_viewport(treeview) data.each do |v| iter = model.append iter[0] = v end button = Gtk::Button.new(:label => "add") button.can_focus=true i = 0 button.signal_connect("clicked") do iter = model.append iter[0] = "add item #{i}" i += 1 end box2.pack_start(button, false, true, 0) button = Gtk::Button.new(:label => "remove") button.can_focus=true button.signal_connect("clicked") do iter = treeview.selection.selected model.remove(iter) if iter end box2.pack_start(button, false, true, 0) separator = Gtk::Separator.new(:horizontal) box1.pack_start(separator, false, true, 0) separator.show box2 = Gtk::Box.new(:vertical, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) button = Gtk::Button.new(:label => "close") button.signal_connect("clicked") do Gtk.main_quit end box2.pack_start(button, true, true, 0) button.can_default=true button.grab_default window.set_default_size(300, 300) window.show_all Gtk.main ����������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/composited-windows.rb����������������������������������������0000644�0001750�0001750�00000007171�11701304107�022053� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin composited-windows.rb - Sample script translated from http://library.gnome.org/devel/gdk/unstable/gdk-Windows.html#composited-window-example Copyright (c) 2008 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. =end require 'gtk3' if str = Gtk.check_version(2, 12, 0) puts "This sample requires GTK+ 2.12.0 or later." puts str exit end unless Gdk.cairo_available? puts "This sample requires Cairo support." exit end Gtk.init # Make the widgets button = Gtk::Button.new("A Button") event = Gtk::EventBox.new window = Gtk::Window.new(Gtk::Window::TOPLEVEL) # Put a red background on the window window.modify_bg(Gtk::STATE_NORMAL, Gdk::Color.parse("red")) # Set the colourmap for the event box. Must be done before the event box is realised. event.colormap = event.screen.rgba_colormap # Set our event box to have a fully-transparent background # drawn on it. Currently there is no way to simply tell GTK+ # that "transparency" is the background colour for a widget. event.app_paintable = true event.signal_connect('expose-event') do |widget, event| # This function simply draws a transparency onto a widget on the area # for which it receives expose events. This is intended to give the # event box a "transparent" background. # # In order for this to work properly, the widget must have an RGBA # colourmap. The widget should also be set as app-paintable since it # doesn't make sense for GTK+ to draw a background if we are drawing it # (and because GTK+ might actually replace our transparency with its # default background colour). # cr = widget.window.create_cairo_context cr.operator = Cairo::OPERATOR_CLEAR cr.gdk_region(event.region) cr.fill false end # Put them inside one another window.border_width = 10 window.add(event) event.add(button) # Realize and show everything window.show_all # Set the event box GdkWindow to be composited. # Obviously must be performed after event box is realised. event.window.composited = true # Set up the compositing handler. # Note that we do _after_ so that the normal (red) background is drawn # by gtk before our compositing occurs. # window.signal_connect_after('expose-event') do |widget, event| # This function performs the actual compositing of the event box onto # the already-existing background of the window at 50% normal opacity. # # In this case we do not want app-paintable to be set on the widget # since we want it to draw its own (red) background. Because of this, # however, we must ensure that we use #signal_connect_after so that # this handler is called after the red has been drawn. If it was # called before then GTK would just blindly paint over our work. # # Note: if the child window has children, then you need a cairo 1.16 # feature to make this work correctly. # # get our child (in this case, the event box) child = widget.child # create a cairo context to draw to the window cr = widget.window.create_cairo_context # the source data is the (composited) event box # NOTICE: next line generates a GTK warning, it is maybe a GTK problem, it is tracked # at http://bugzilla.gnome.org/show_bug.cgi?id=526965 cr.set_source_pixmap(child.window, child.allocation.x, child.allocation.y) # draw no more than our expose event intersects our child region = Gdk::Region.new(Gdk::Rectangle.new(child.allocation.x, child.allocation.y, child.allocation.width, child.allocation.height)) region.intersect(event.region) cr.gdk_region(region) cr.clip # composite, with a 50% opacity cr.operator = Cairo::OPERATOR_OVER cr.paint(0.5) false end Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/toolbar.rb���������������������������������������������������0000644�0001750�0001750�00000002735�11701304107�017660� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin toolbar.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: toolbar.rb,v 1.11 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::Toolbar sample") window.signal_connect("destroy") do Gtk.main_quit end toolbar = Gtk::Toolbar.new toolbar.append("Horizontal", "Horizontal toolbar layout", "Toolbar/Horizontal", Gtk::Image.new("test.xpm")) do toolbar.orientation = Gtk::ORIENTATION_HORIZONTAL end toolbar.append("Vertical", "Vertical toolbar layout", "Toolbar/Vertical", Gtk::Image.new("test.xpm")) do toolbar.orientation = Gtk::ORIENTATION_VERTICAL end toolbar.append_space toolbar.append("Icons", "Only show toolbar icons", "Toolbar/IconsOnly", Gtk::Image.new("test.xpm")) do toolbar.toolbar_style = Gtk::Toolbar::ICONS end toolbar.append("Text", "Only show toolbar text", "Toolbar/TextOnly", Gtk::Image.new("test.xpm")) do toolbar.toolbar_style = Gtk::Toolbar::TEXT end toolbar.append("Both", "Show toolbar icons and text", "Toolbar/Both", Gtk::Image.new("test.xpm")) do toolbar.toolbar_style = Gtk::Toolbar::BOTH end toolbar.append_space toolbar.append("Enable", "Enable tooltips",nil, Gtk::Image.new("test.xpm")) do toolbar.tooltips = true end toolbar.append("Disable", "Disable tooltips",nil, Gtk::Image.new("test.xpm")) do toolbar.tooltips = false end window.add(toolbar) window.show_all Gtk.main �����������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/recentchooserdialog.rb���������������������������������������0000664�0001750�0001750�00000002572�11740310343�022244� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin recentchooserdialog.rb - Ruby/GTK2 sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: recentchooserdialog.rb,v 1.2 2006/11/15 23:46:13 mutoh Exp $ =end require 'gtk3' dialog = Gtk::RecentChooserDialog.new(:title => "Recent Chooser Dialog Sample", :buttons => [[Gtk::Stock::CANCEL, Gtk::Dialog::ResponseType::CANCEL], [Gtk::Stock::OPEN, Gtk::Dialog::ResponseType::ACCEPT]]) dialog.signal_connect("response") do |widget, response| case response when Gtk::Dialog::ResponseType::ACCEPT info = dialog.current_item if info puts "----" puts info.uri puts info.display_name puts info.description puts info.mime_type puts info.added puts info.modified puts info.visited puts info.private_hint? p info.application_info("gedit") p info.applications puts info.last_application p info.groups puts info.has_group?("web") puts info.has_application?("gedit") puts info.get_icon(64) puts info.short_name puts info.uri_display puts info.age puts info.local? puts info.exist? end else p "Close" dialog.destroy Gtk.main_quit end end dialog.show_all Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/assistant.rb�������������������������������������������������0000755�0001750�0001750�00000023017�11701304107�020226� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin test-assistant.rb - Ruby/GTK version of testassistant.c from gtk+ 2.10 sources. Guillaume Cottenceau for the ruby-gnome2 project. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: assistant.rb,v 1.1 2006/11/23 08:39:12 mutoh Exp $ =end require 'gtk3' if str = Gtk.check_version(2, 10, 0) puts "This sample requires GTK+ 2.10.0 or later" puts str exit end class AssistantRunner def initialize @simple_assistant = nil @generous_assistant = nil @selected_branch = "A" @nonlinear_assistant = nil @full_featured_assistant = nil end def run_simple_assistant @simple_assistant = run_assistant(@simple_assistant, :create_simple_assistant) end def run_generous_assistant @generous_assistant = run_assistant(@generous_assistant, :create_generous_assistant) end def run_nonlinear_assistant @nonlinear_assistant = run_assistant(@nonlinear_assistant, :create_nonlinear_assistant) end def run_full_featured_assistant @full_featured_assistant = run_assistant(@full_featured_assistant, :create_full_featured_assistant) end private def run_assistant(assistant, assistant_create_method) assistant ||= send(assistant_create_method) if !assistant.visible? assistant.show else assistant.destroy assistant = nil end assistant end def add_completion_test_page(assistant, text, visible, complete) page = Gtk::VBox.new(0, 0) check = Gtk::CheckButton.new("Complete") page.add(Gtk::Label.new(text)) page.add(check) check.active = complete check.signal_connect('toggled') do complete = check.active? assistant.set_page_complete(page, complete) end page.show_all if visible assistant.append_page(page) assistant.set_page_title(page, text) assistant.set_page_complete(page, complete) page end def create_test_page(text) Gtk::Label.new(text) end def prepare_cb(assistant, page) if page.is_a?(Gtk::Label) puts "prepare: #{page.text}" elsif assistant.get_page_type(page) == Gtk::Assistant::PAGE_PROGRESS progress = page.child assistant.set_page_complete(page, false) progress.fraction = 0.0 Gtk.timeout_add(300) do page = assistant.get_nth_page(assistant.current_page) progress = page.child value = progress.fraction = progress.fraction + 0.1 continue = value < 1.0 assistant.set_page_complete(page, true) unless continue continue end else puts "prepare: #{assistant.current_page}" end end def create_simple_assistant assistant = Gtk::Assistant.new assistant.set_default_size(400, 300) assistant.signal_connect('cancel') do puts "cancel" assistant.hide end assistant.signal_connect('close') do puts "close" assistant.hide end assistant.signal_connect('apply') do puts "apply" end assistant.signal_connect('prepare') do |_assistant, page| prepare_cb(_assistant, page) end page = create_test_page("Page 1") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 1") assistant.set_page_complete(page, true) page = create_test_page("Page 2") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 2") assistant.set_page_type(page, :confirm) assistant.set_page_complete(page, true) end def create_generous_assistant assistant = Gtk::Assistant.new assistant.set_default_size(400, 300) assistant.signal_connect('cancel') do puts "cancel" assistant.hide end assistant.signal_connect('close') do puts "close" assistant.hide end assistant.signal_connect('apply') do puts "apply" end assistant.signal_connect('prepare') do|_assistant, page| prepare_cb(_assistant, page) end page = create_test_page("Introduction") page.show assistant.append_page(page) assistant.set_page_title(page, "Introduction") assistant.set_page_type(page, :intro) assistant.set_page_complete(page, true) page = add_completion_test_page(assistant, "Content", true, false) next_page = add_completion_test_page(assistant, "More Content", true, true) check = Gtk::CheckButton.new("Next page visible"); check.active = true check.signal_connect('toggled') do puts "beuh" next_page.visible = check.active? end check.show page.add(check) add_completion_test_page(assistant, "Even More Content", true, true) page = create_test_page("Confirmation") page.show assistant.append_page(page) assistant.set_page_title(page, "Confirmation") assistant.set_page_type(page, :confirm) assistant.set_page_complete(page, true) page = Gtk::Alignment.new(0.5, 0.5, 0.9, 0.0) page.add(Gtk::ProgressBar.new) page.show_all assistant.append_page(page) assistant.set_page_title(page, "Progress") assistant.set_page_type(page, :progress) assistant.set_page_complete(page, true) page = create_test_page("Summary") page.show assistant.append_page(page) assistant.set_page_title(page, "Summary") assistant.set_page_type(page, :summary) assistant.set_page_complete(page, true) end def create_nonlinear_assistant assistant = Gtk::Assistant.new assistant.set_default_size(400, 300) assistant.signal_connect('cancel') do puts "cancel" assistant.hide end assistant.signal_connect('close') do puts "close" assistant.hide end assistant.signal_connect('apply') do puts "apply" end assistant.signal_connect('prepare') do |_assistant, page| prepare_cb(_assistant, page) end assistant.set_forward_page_func do |current_page| retval = -1 if current_page == 0 if @selected_branch == 'A' retval = 1 else retval = 2 end elsif current_page == 1 || current_page == 2 retval = 3 end retval end page = Gtk::VBox.new(false, 6) button = Gtk::RadioButton.new('branch A') page.pack_start(button, false, false, 0) button.signal_connect('toggled') do @selected_branch = 'A' end button.active = true button = Gtk::RadioButton.new(button, 'branch B') page.pack_start(button, false, false, 0) button.signal_connect('toggled') do @selected_branch = 'B' end page.show_all assistant.append_page(page) assistant.set_page_title(page, "Page 1") assistant.set_page_complete(page, true) page = create_test_page("Page 2A") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 2A") assistant.set_page_complete(page, true) page = create_test_page("Page 2B") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 2B") assistant.set_page_complete(page, true) page = create_test_page("Confirmation") page.show assistant.append_page(page) assistant.set_page_title(page, "Confirmation") assistant.set_page_type(page, :confirm) assistant.set_page_complete(page, true) end def create_full_featured_assistant assistant = Gtk::Assistant.new assistant.set_default_size(400, 300) assistant.signal_connect('cancel') do puts "cancel" assistant.hide end assistant.signal_connect('close') do puts "close" assistant.hide end assistant.signal_connect('apply') do puts "apply" end assistant.signal_connect('prepare') do |_assistant, page| prepare_cb(_assistant, page) end button = Gtk::Button.new(Gtk::Stock::STOP) button.show assistant.add_action_widget(button) page = create_test_page("Page 1") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 1") assistant.set_page_complete(page, true) #- set a side image pixbuf = page.render_icon(Gtk::Stock::DIALOG_WARNING, :dialog) assistant.set_page_side_image(page, pixbuf) #- set a header image pixbuf = page.render_icon(Gtk::Stock::DIALOG_INFO, :dialog) assistant.set_page_header_image(page, pixbuf) page = create_test_page("Invisible page") assistant.append_page(page) page = create_test_page("Page 3") page.show assistant.append_page(page) assistant.set_page_title(page, "Page 3") assistant.set_page_type(page, :confirm) assistant.set_page_complete(page, true) #- set a header image pixbuf = page.render_icon(Gtk::Stock::DIALOG_INFO, :dialog) assistant.set_page_header_image(page, pixbuf) assistant end end runner = AssistantRunner.new buttons = [ [ 'simple assistant', proc { runner.run_simple_assistant } ], [ 'generous assistant', proc { runner.run_generous_assistant } ], [ 'nonlinear assistant', proc { runner.run_nonlinear_assistant } ], [ 'full featured assistant', proc { runner.run_full_featured_assistant } ], ] if ENV['RTL'] Gtk::Widget.default_direction = Gtk::Widget::TEXT_DIR_RTL end window = Gtk::Window.new(Gtk::Window::TOPLEVEL) window.signal_connect('destroy') { Gtk.main_quit } window.signal_connect('delete-event') { false } box = Gtk::VBox.new(false, 6) window.add(box) buttons.each do |label, callback| button = Gtk::Button.new(label) button.signal_connect('clicked') do callback.call end box.pack_start(button, true, true, 0) end window.show_all Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/button2.rb���������������������������������������������������0000664�0001750�0001750�00000001230�11740310343�017604� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/local/bin/ruby =begin button2.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: button2.rb,v 1.4 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::Button sample") button1 = Gtk::Button.new(:mnemonic => "_HELLO") button2 = Gtk::Button.new(:label => "_HELLO") button3 = Gtk::Button.new(:stock_id => Gtk::Stock::QUIT) button3.signal_connect("clicked"){ Gtk.main_quit } box = Gtk::Box.new(:vertical) box.add(button1) box.add(button2) box.add(button3) window.add(box).set_default_size(100,100).show_all Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/dnd.rb�������������������������������������������������������0000664�0001750�0001750�00000003541�11740310343�016763� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin dnd.rb - Drag and Drop sample script. Copyright (C) 2002-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Date: 2006/06/17 13:18:12 $ $Id: dnd.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' class SrcWindow < Gtk::Window def initialize super("Source Window") @label = Gtk::Label.new("Drag here!") add(@label) set_default_size(100, 100) drag_source_set(Gdk::Window::ModifierType::BUTTON1_MASK | Gdk::Window::ModifierType::BUTTON2_MASK, [["test", Gtk::Drag::TargetFlags::SAME_APP, 12345]], Gdk::DragContext::Action::COPY | Gdk::DragContext::Action::MOVE) signal_connect("drag_data_get") do |widget, context, selection_data, info, time| # selection_data.set("text/uri-list", 8, "hoge.txt") selection_data.set(Gdk::Selection::TYPE_STRING, "hoge.txt") end end end class DestWindow < Gtk::Window def initialize super("Dest Window") @label = Gtk::Label.new("Drop here!") add(@label) set_default_size(100, 100) drag_dest_set(Gtk::Drag::DestDefaults::MOTION | Gtk::Drag::DestDefaults::HIGHLIGHT, [["test", :same_app, 12345]], Gdk::DragContext::Action::COPY|Gdk::DragContext::Action::MOVE) signal_connect("drag-data-received") do |w, dc, x, y, selectiondata, info, time| dc.targets.each do |target| if target.name == "test" || selectiondata.type == Gdk::Selection::TYPE_STRING puts selectiondata.data end end end signal_connect("drag-drop") do |w, dc, x, y, time| w.drag_get_data(dc, dc.targets[0], time) end end end win1 = SrcWindow.new win2 = DestWindow.new win1.show_all.signal_connect("destroy"){Gtk.main_quit} win2.show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/gdkscreen.rb�������������������������������������������������0000644�0001750�0001750�00000001266�11701304107�020161� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin gdkscreen.rb - Gdk::Screen sample script. Copyright (C) 2004-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: gdkscreen.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' screen = Gdk::Screen.default settings_map = [ "gtk-double-click-time", "gtk-dnd-drag-threshold", "gtk-can-change-accels", "gtk-color-palette", "gtk-font-name", "gtk-icon-sizes", "gtk-key-theme-name", "gtk-toolbar-style", "gtk-toolbar-icon-size", "gtk-im-preedit-style", "gtk-im-status-style", "gtk-cursor-blink", "gtk-cursor-blink-time", "gtk-theme-name" ] settings_map.each do |v| puts "#{v}: #{screen.get_setting(v)}" end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/alpha-demo.rb������������������������������������������������0000755�0001750�0001750�00000003346�11701304107�020227� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin alpha-demo.rb - alpha blended window sample script. (need xcompmgr) Original: alphademo.py by Mike Hearn (*1) and David Trowbridge (*2) * (1) http://plan99.net/~mike/blog/2006/06/05/alpha-blended-windows-in-python/ * (2) http://david.navi.cx/blog/?p=91 Translated to Ruby by Juergen Mangler <juergen.mangler@univie.ac.at> Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: alpha-demo.rb,v 1.1 2007/01/06 03:55:44 ktou Exp $ =end require 'gtk3' require 'cairo' class AlphaDemo < Gtk::Window def initialize() super() set_app_paintable(true) set_title("AlphaDemo") set_decorated(false) set_default_size(200, 220) signal_connect("delete_event") do Gtk.main_quit end set_double_buffered(false) signal_connect('expose-event') do |widget, event| cr = widget.window.create_cairo_context rgba = [1.0, 1.0, 1.0] rgba << 0.0 if @supports_alpha cr.set_source_rgba(rgba) cr.set_operator(Cairo::OPERATOR_SOURCE) cr.paint twidth, theight = widget.size cr.set_source_rgba(1.0, 0.2, 0.2, 0.6) radius = [twidth, theight].min.to_f / 2 - 0.8 cr.arc(twidth.to_f / 2, theight.to_f / 2, radius, 0, 2.0 * Math::PI) cr.fill_preserve cr.stroke end signal_connect('screen-changed') do |widget, old_screen| screen_changed(widget, old_screen) end screen_changed(self) end def screen_changed(widget,old_screen=nil) tcolormap = widget.screen.rgba_colormap @supports_alpha = !tcolormap.nil? tcolormap ||= widget.screen.rgb_colormap widget.set_colormap(tcolormap) end end alpha = AlphaDemo.new alpha.show Gtk.main() ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/gnome-logo-icon.png������������������������������������������0000644�0001750�0001750�00000006022�11701304107�021361� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���0���Wù‡��� pHYs�� �� ÒÝ~ü���tIMEÒ !??G…�� ±IDATxœí™mp”ÕÇ÷nt@²ÙMIHÌî“Í’]Ü @"³@‚–šQ¦8MÀ@iE ”–J­Äi+`U”Ö)*kkªR-[B[ªX“ªmi±$Vc² /BDÝ /aŠåöþ°IžÍ‹f¦_<3ÿ$ϹçœçîëynàKùR¾ˆÿ7€Ñ£G;` ©ü€hÙ÷ôôDþbõ¡ø#+cÆŒq*¥Ü1‚û…ùJ©Ž¾ BÎ;€Ú«´âk‹>!Á ×ëwÄëõ*„7Bzôz=ñ!èõúb!e½Ôé\R§CÆÙ%%n­¶Ù%%‘÷ 1¡‹Ò#¤¬”R‚ë¶… ïB Â:Î)¤ôJ)QvýPXXX~¦»û> =J©‘OÀ˜”d–B–K©#S¦Lqü~sD'¤[J±¯]_˜Íf€~v!ýçO`lò¸yc“ǽ‘”<îàØäqó"Á¤Î¢5äBH€J©Ó¡Ó銘6$&&òÕ¹sƒqcèâ†K>9%ͬP^ˆì�¥”%95MsÇ�˜4É€ |(;ÇŠ+0 �Þ__ýçK@HQ)zo^ÆÝuu^)åÌX>‡À/ƒDò{‡Ãnç›Ë—Ô§ŒOo ùá°ÛùÞw×yˆ ‡aO!)D?´¶¶ºº><á”B4H!üÑm3¦OÇ”™ ШåÛFƒ‘­nw¸—«ûêûñnB§ó Žhœã®Ð³7ºmÍšï�øÇgšúúõ…!1‘ß¾ò;@õøLS“†>Òûƒ&žiq¦gšaqG@z¥DÃa·¥H)«¥RHÖ¬^Íôn�pK±÷õõ—Bb4ùíÎáXž “e‹†¾ùA%Ü՞aÎR!´+¥ !ýæ(½êì<ª”Rë3ÌYd˜³PJ«Ër0ì§”"ÔåŒöÍ0g©¥UË•ßÛïÇYZµ¿?€R*²ï÷›±Ègfe›Aù¢uË—Uy±ý™ù ÈÉÉyãðáî…·-àñŸ>àB4Ï.åÈ‘#ti+&x„»…‘J)Åæ-[+Ö:Ì)-Áž—n®Þ¼eë ýðz>,¦k¬*«¿»V)¥œ¦k¬(¥œJ©OC½öi¸‡Â½5P¯…ì6‡ü>UJíPJ™µüŠƒl£BH/P~>~âC€r!d“%gb“ïðù@%à°X',Ö<(ÂbζYú„õ!h´Xó¼B`Q—TdtÌ96,Ö<„�_ëpÔRŽ=€ÔÌ,3ÐH¨Ì-œ6•~å©/«ì˜¹ç¹|H©DŸÂdž  \)U®o�ñ !ª•RÏõ#&§Ž¶÷Òi†æ.ÔÓÓCOO¾Ö掯/º½23ój„”Ì) @îkY÷`5’öUL˜´±!<Q.¤d˜0"„GJ9¯ë˜ŽwDÚ‚4ÓΟ?A˜W44G ^¯àì™3áÌw4·´TæÙl�žlG~5Jy¡‡=ÏïÝù‚%Ûî |t¢úôtii)¯¼ü2�ÆÄ$.©KÍ—­oØ€R !Ä’<›­¨Ùú³§êAøÒ…ŒÞkn1î?<<úTŸ ,ˆLÿ§ŸÐí÷ÓÐhÀØ”TNŸ:ÉØq)½ôIé&'JÕsùÓoD$#=ú½uþäÔ´ÄhýéS'HNMÓôû¥gGì](95è*@éAŒ,y€ÒÙ3ŒIãMøO‹èSƧÁ-»]¯¼ŒÁ`ОBw"N§ë…¤tóz„ÈGF ú*/ð"Æ´LŒi™˜²óhk=„..®æÎ‹Á` ÃdÑžBÁ#ß\0@BJF;`ù"=­%ÛÝHÉÌb€ò “åw�«WUóUÕ½ìÂ|úŠæܵì›4ÿû]„”ètq$¤f:Ò2R‹!IHH`Ûc›Âä=@÷ïŽwú8ÞécÆM7õâcšÝk¾õ­œ8ÚÁ‰£ÚkÀd6c0$p¼£¥¶©Eƒ~„ GlÖl6<¸Ž‰¹9�ÛÔ¢%-ÿ|3Ò^pýu�Xr&RX0Î#m‘Z(¼=pÿ÷BÄžBá��£’RÖ5#A~eU%+—- ?º-9WEEð‡‘‡AEs !BÐÑÖBG[ áû¢‹uÚõ“Ùõ«gÂäý€ËVèZuSéÍüñ÷u,þú"L&R§ãÁÜOû¡÷ñµ6ãkmFtšk%esôz¾Ò8®˜àõܰEÏÊ»¾AÅ¢…a•¨É¶;c^ &{Þ/혬À5öËS¾í½ƒ�ئ— \×jÈ´ÉNžÜø úx…ÕÙŽÉ Ñ6áø9×^?x@!ú•š dOº®ŸN§»‹¨Òz0¹ÿÞTܱ üXc»qÎCaýO6lDÆ„NôKgý 1 *š ääOëooœG¨îLÖݳ‚ŠÛçC°×+­“ šB1œ7ƒ¾á\ꬿ)!^÷¥_ruz:¹E7[Ïw/ëu…ÚÖcŒƒfi©üy§'LÞroú Ì "ß}Åœ‘î{õ…gòs§Ü8¬µ¡}+uÐzçozçoBT^ć£”Û¦lS‹=gA`Ac,?×ô àBÆÄ\+ÞZ‡¼Í¡o#tqý ½êâ8sþ+×þ[A1¶‚bqá\Hw0om|Ðæã ϯëmÅHÉÊåK RÒ8ß´üI�Fë¹ÓXÏ®A]e`ê¯O2¿b_›Ø€î_9š‰k&`íÞÍ¡tñÒ]—°žy뙿Йu%w¾ýW””5JÊF%%±ðÄs/º.]e¸oÉžn^ÝÜŠuæ× !?Mûôô4JŠn�¨¿eG u-w’{º‰­[Ì¡ýD#ò)K÷æèkeX»—pÄÕÁ’¿_¡@kâmäÞÁBñ·ì(éyiO\5ŠÀ‚õ-ë×VfŽï.¡˜p?s»é`KÚ;@4‚Èe»îîªð«½m®¦,/›½eq¬ž·¨QHÚÇö_ìevág 깸iOoßc“8üd6rw!üaåitÛöÑuñ]÷Náçw·5=õðªm9× „n ä+d¥:K,›ù·”P:£ÀZ :º^r³ÿê“÷Ô·¬ Dpó[vŸ…ºæ@4rÅÚ ˜|2Ö"®'ù¬- oeîÏžä¿w—²‰R‹ý©âç[·ª²dÆ´A"6Ü<“Mkïð5,@ÁNŸmšÖ]|¶ýiö¿â7k{|”Ù깸Éw”ko£ev?uïñÿ³šÜwv3íÉOøÓÿiëŽ)¥æ½¸ç5Ï#ÛŸ7v‡þñ6©\ðUøöåºHˆ‰Mon$¿(øŽ+ž¸•‹÷ìéÇ)"‰Ï’R½:vÉwe¶7B¸ÌQOÝ{®H[Ê£èºx!: óÇþ€g÷ëo¹<»~ϱ“Å$^àÌãÞoÜN¡ÓE^4 5ñ0—”‡Œt­÷ÇN o E”R@Ms[»eÿ»ÍtŸ½<" ñc(>•«Ó" Ú:s^`ÛˆDîBE2µ%ù<ûçÓ,u$óìá NG ] Íœ?,âÐk>Ì#X.äÓû?2>‚åˆ;GÈŽÃE³Øöæë¬T %‡Û;yüÙZö½ý!¿wÀš`/$@ÑTî|óužX©-= À‹]åÔ5£¶4ŸÅ¯=|‰ñâž×xdûó|εÅ!,{©SÅâWQ;ç-¿:#Ö’À­¡ß^”R|ì°ûõ·æïG¢ìÚcÔ½{uo'¥‚'ëôZêÿº˜ÇœUÀÃìnJ |”ÚªxþÕ•ÆæÝ‹ù¯: @s[ï»ÓˆýðT¿+îY—¦0ëR<eÎ[ƒ=•›†ž29ɬ‹Ç˜¥PÄ…> ÜWwXtÃŒ½€ƒÚÒJ¢/Ƶ®Ô‡zÅþ?GŠq)I»����IEND®B`‚��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/properties.rb������������������������������������������������0000755�0001750�0001750�00000004321�11701304107�020406� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin properties.rb - GLib::Object#properties and Gtk::Container#child_properties sample script. Copyright (C) 2004-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: properties.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' class MyButton < Gtk::Button type_register def initialize(label = nil) # XXX: # When type_register() is used. # super is equivalent to GLib::Object#initialize. super("label" => label) @fuga = 0 @hoge = 0 end # define new property "fuga" install_property(GLib::Param::Int.new("fuga", # name "Fuga", # nick "fuga fuga", # blurb 0, # min 10000, # max 0, # default GLib::Param::READABLE | GLib::Param::WRITABLE)) # define new property "hoge" install_child_property(GLib::Param::Int.new("hoge", # name "Hoge", # nick "hoge hoge", # blurb 0, # min 10000, # max 0, # default GLib::Param::READABLE | GLib::Param::WRITABLE)) # implementation of the property "fuga" def fuga puts "MyButton#fuga is called" @fuga end def fuga=(arg) puts "MyButton#fuga= is called" @fuga = arg notify("fuga") end # implementation of the property "hoge" def get_hoge(child) puts "MyButton#get_hoge is called" @hoge end def set_hoge(child, arg) puts "MyButton#set_hoge is called" @hoge = arg end end b = MyButton.new("Hello") p b p b.label p b.gtype p MyButton.properties p b.get_property("fuga") b.set_property("fuga", 1) p b.get_property("fuga") p MyButton.child_properties p child = b.child p b.child_get_property(child, "hoge") b.child_set_property(child, "hoge", 2) p b.child_get_property(child, "hoge") p MyButton.ancestors ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/radiobutton.rb�����������������������������������������������0000664�0001750�0001750�00000002037�11740310343�020547� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin radiobutton.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: radiobutton.rb,v 1.10 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Gtk::RadioButton sample") window.signal_connect("destroy"){Gtk.main_quit} box1 = Gtk::Box.new(:vertical) window.add(box1) box2 = Gtk::Box.new(:vertical, 10) box2.border_width = 10 box1.add(box2) button1 = Gtk::RadioButton.new("_button1") button2 = Gtk::RadioButton.new(button1, "_button2", false) button3 = Gtk::RadioButton.new(button1, Gtk::Stock::QUIT) box2.add(button1).add(button2).add(button3) box1.add(Gtk::Separator.new(:horizontal)) box2 = Gtk::Box.new(:vertical, 10) box2.border_width = 10 box1.add(box2) close = Gtk::Button.new(:label => "close") close.signal_connect("clicked") do Gtk.main_quit end box2.add(close) close.can_default = true close.grab_default window.signal_connect("destroy"){Gtk.main_quit} window.show_all Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/rgtk+cairo.rb������������������������������������������������0000775�0001750�0001750�00000001726�11740310343�020264� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin rgtk+cairo.rb - Ruby/GTK2 using Ruby/Cairo sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. Heavily inspired from png.rb example of rcairo. $Id: rgtk+cairo.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' require 'cairo' w = Gtk::Window.new.add(vb = Gtk::Box.new(:vertical)) vb.add(da = Gtk::DrawingArea.new) da.set_size_request(200, 200) da.signal_connect('draw') { |widget, cr| # fill background with white cr.set_source_rgba(1.0, 1.0, 1.0) cr.paint # create shape cr.move_to(50, 50) cr.curve_to(100, 25, 100, 75, 150, 50) cr.line_to(150, 150) cr.line_to(50, 150) cr.close_path cr.set_source_rgb(0.0, 0.0, 0.0) cr.fill_preserve cr.set_source_rgb(1.0, 0.0, 0.0) cr.set_line_join(Cairo::LINE_JOIN_MITER) cr.set_line_width(4) cr.stroke } w.signal_connect("destroy"){Gtk.main_quit} w.show_all Gtk.main ������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/helloworld.rb������������������������������������������������0000664�0001750�0001750�00000001247�11740310343�020372� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin helloworld.rb - Ruby/GTK2 first sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: helloworld.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' button = Gtk::Button.new(:label => "Hello World") button.signal_connect("clicked") { puts "Hello World" } window = Gtk::Window.new("Hello World sample") window.signal_connect("delete_event") { puts "delete event occurred" #true false } window.signal_connect("destroy") { puts "destroy event occurred" Gtk.main_quit } window.border_width = 10 window.add(button) window.show_all Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/aboutdialog2.rb����������������������������������������������0000644�0001750�0001750�00000002566�11701304107�020574� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin aboutdialog2.rb - Ruby/GTK sample script. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: aboutdialog2.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' if str = Gtk.check_version(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" puts str exit end Gtk::AboutDialog.set_email_hook {|about, link| p "email_hook" p link } Gtk::AboutDialog.set_url_hook {|about, link| p "url_hook" p link } Gtk::AboutDialog.show(nil, "artists" => ["Artist 1 <no1@foo.bar.com>", "Artist 2 <no2@foo.bar.com>"], "authors" => ["Author 1 <no1@foo.bar.com>", "Author 2 <no2@foo.bar.com>"], "comments" => "This is a sample script for Gtk::AboutDialog", "copyright" => "Copyright (C) 2005 Ruby-GNOME2 Project", "documenters" => ["Documenter 1 <no1@foo.bar.com>", "Documenter 2 <no2@foo.bar.com>"], "license" => "This program is licenced under the same licence as Ruby-GNOME2.", "logo_icon_name" => "gtk-home", "program_name" => "Gtk::AboutDialog sample", "translator_credits" => "Translator 1 <no1@foo.bar.com>\nTranslator 2 <no2@foo.bar.com>\n", "version" => "1.0.0", "website" => "http://ruby-gnome2.sourceforge.jp", "website_label" => "Ruby-GNOME2 Project Website" ) Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/expander.rb��������������������������������������������������0000664�0001750�0001750�00000001144�11740310343�020021� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin expander.rb - Ruby/GTK2 sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: expander.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' expander = Gtk::Expander.new("Expander Sample") expander.expanded = true button = Gtk::Button.new(:label => "Hide this button.") button.signal_connect("clicked") do expander.expanded = false end button.set_size_request(200, 200) expander.add(button) Gtk::Window.new.add(expander).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/itemfactory.rb�����������������������������������������������0000644�0001750�0001750�00000005323�11701304107�020540� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin itemfactory.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. *NOTE* Gtk::ItemFactory has been deprecated. Use Gtk::UIManager instead. $Id: itemfactory.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' puts "Deprecated. Use Gtk::UIManager instead." window = Gtk::Window.new("Gtk::ItemFactory") window.signal_connect("destroy") do Gtk.main_quit end window.signal_connect("delete_event") do Gtk.main_quit end accelgroup = Gtk::AccelGroup.new window.add_accel_group(accelgroup) ifp = Gtk::ItemFactory.new(Gtk::ItemFactory::TYPE_MENU_BAR, "<main>", accelgroup) cal_stock = Proc.new {|d, item| p "StockItem, #{d}"} cal_quit = Proc.new{p "Quit"; Gtk.main_quit} cal_check = Proc.new {|d, item| p "CheckItem, #{d}"} cal_toggle = Proc.new {|d, item| p "ToggleItem, #{d}"} cal_radio = Proc.new {|d, item| p "RadioItem, #{d}"} cal_misc = Proc.new {|d, item| p "Misc #{d}"} ifp.create_items([ ["/_Stock"], ["/_Stock/_New", "<StockItem>", "<control>N", Gtk::Stock::NEW, cal_stock, 1], ["/_Stock/_Open", "<StockItem>", "<control>O", Gtk::Stock::OPEN, cal_stock, 2], ["/_Stock/_Quit", "<StockItem>", "<control>Q", Gtk::Stock::QUIT, cal_quit], ["/_Check"], ["/_Check/Check_1", "<CheckItem>", "", "", cal_check, 1], ["/_Check/Check_2", "<CheckItem>", "", "", cal_check, 2], ["/_Toggle"], ["/_Toggle/Toggle_1", "<ToggleItem>", "", "", cal_toggle, 1], ["/_Toggle/Toggle_2", "<ToggleItem>", "", "", cal_toggle, 2], ["/_Toggle/Toggle_3", "<ToggleItem>", "", "", cal_toggle, 3], ["/_Radio", "<Branch>"], ["/_Radio/Radio_1", "<RadioItem>", nil, nil, cal_radio, 1], ["/_Radio/Radio_2", "/Radio/Radio1", nil, nil, cal_radio, 2], ["/_Radio/Radio_3", "/Radio/Radio1", nil, nil, cal_radio, 3], ["/_Misc", "<LastBranch>"], ["/_Misc/Tearoff", "<Tearoff>"], ["/_Misc/Title", "<Title>"], ["/_Misc/Image", "<ImageItem>", "", Gdk::Pixbuf.new("gnome-logo-icon.png"), cal_misc, 1], ["/_Misc/Separator", "<Separator>"], ["/_Misc/Item", "<Item>", nil, nil, cal_misc, 2] ]) ifp.get_widget("/Stock/Open").sensitive = false ifp.delete_item("/Toggle/Toggle2") vbox = Gtk::VBox.new vbox.add(ifp.get_widget("<main>")) vbox.add(Gtk::Label.new("Gtk::ItemFactory sample").set_size_request(400, 200)) window.add(vbox) window.show_all Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/buttonbox.rb�������������������������������������������������0000664�0001750�0001750�00000004067�11740310343�020246� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin buttonbox.rb - Ruby/GTK2 sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: buttonbox.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' def create_bbox_window(horizontal, title, pos, spacing, layout) window = Gtk::Window.new(title) window.signal_connect("delete_event") do window.destroy end box1 = Gtk::Box.new(:vertical, 0) window.add(box1) if horizontal window.set_default_size(550, 60) window.move(150, pos) bbox = Gtk::ButtonBox.new(:horizontal) else window.set_default_size(150, 400) window.move(pos, 200) bbox = Gtk::ButtonBox.new(:vertical) end bbox.layout_style = layout bbox.spacing = spacing box1.border_width = 25 box1.pack_start(bbox, true, true, 0) button = Gtk::Button.new(:label => "OK") bbox.add(button) button.signal_connect("clicked") do window.destroy end button = Gtk::Button.new(:label => "Cancel") bbox.add(button) button.signal_connect("clicked") do window.destroy end button = Gtk::Button.new(:label => "Help") bbox.add(button) window.show_all end def test_hbbox create_bbox_window(true, "Spread", 50, 40, :spread) create_bbox_window(true, "Edge", 250, 40, :edge) create_bbox_window(true, "Start", 450, 40, :start) create_bbox_window(true, "End", 650, 15, :end) end def test_vbbox create_bbox_window(false, "Spread", 50, 40, :spread) create_bbox_window(false, "Edge", 250, 40, :edge) create_bbox_window(false, "Start", 450, 40, :start) create_bbox_window(false, "End", 650, 15, :end) end window = Gtk::Window.new("button box") window.signal_connect("delete_event") do Gtk.main_quit end window.border_width = 20 bbox = Gtk::ButtonBox.new(:horizontal) window.add(bbox) button = Gtk::Button.new(:label => "Horizontal") button.signal_connect("clicked") do test_hbbox end bbox.add(button) button = Gtk::Button.new(:label => "Vertical") button.signal_connect("clicked") do test_vbbox end bbox.add(button) window.show_all Gtk.main �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/keyboard_grab.rb���������������������������������������������0000644�0001750�0001750�00000001424�11701304107�021003� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin keyboard_grab.rb - Gdk::Window#keyboard_grab/ungrab sample script. Copyright (C) 2001-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME. $Date: 2006/06/17 13:18:12 $ $Id: keyboard_grab.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' window = Gtk::Window.new("Keyboard Grab/Ungrab sample") button1 = Gtk::Button.new("Grab Keyboard!") button2 = Gtk::Button.new("Ungrab Keyboard!") button1.signal_connect('clicked') do Gdk.keyboard_grab(window.window, true, Gdk::Event::CURRENT_TIME) end button2.signal_connect('clicked') do Gdk.keyboard_ungrab(Gdk::Event::CURRENT_TIME) end window.add(Gtk::VBox.new.add(button1).add(button2)) window.set_default_size(200,100).show_all.signal_connect("destroy"){Gtk.main_quit} Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/tooltips.rb��������������������������������������������������0000644�0001750�0001750�00000015356�11701304107�020076� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin tooltips.rb - Demonstrates the new tooltip API of Gtk+ 2.12; rg2 translation from gtk/tests/testtooltips.c. Copyright (c) 2007 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: tooltips.rb,v 1.1 2007/07/10 13:17:34 ggc Exp $ =end require 'gtk3' if str = Gtk.check_version(2, 12, 0) puts "This sample requires GTK+ 2.12.0 or later" puts str exit end def treeview_query_tooltip(treeview, keyboard_tip, x, y, tooltip) if keyboard_tip # Keyboard mode path, = treeview.cursor if not path return false end else bin_x, bin_y = treeview.convert_widget_to_bin_window_coords(x, y) # Mouse mode path, = treeview.get_path_at_pos(bin_x, bin_y) if not path return false end end data = treeview.model.get_value(treeview.model.get_iter(path), 0) tooltip.markup = "<b>Path #{path}:</b> #{data}" return true end def textview_query_tooltip(textview, keyboard_tip, x, y, tooltip, tag) if keyboard_tip iter = textview.buffer.get_iter_at_offset(textview.buffer.cursor_position) else bx, by = textview.window_to_buffer_coords(Gtk::TextView::WINDOW_TEXT, x, y) iter, = textview.get_iter_at_position(bx, by) end if iter.has_tag?(tag) tooltip.text = 'Tooltip on text tag' return true else return false end end def drawingarea_query_tooltip(keyboard_tip, x, y, tooltip, rectangles) if keyboard_tip return false end for r in rectangles if r.x < x && x < r.x + 50 && r.y < y && y < r.y + 50 tooltip.markup = r.tooltip return true end end return false end Gtk.init window = Gtk::Window.new(Gtk::Window::TOPLEVEL) window.title = 'Tooltips test' window.border_width = 10 window.signal_connect('delete-event') { Gtk.main_quit } box = Gtk::VBox.new(false, 3) window.add(box) # A check button using the tooltip-markup property button = Gtk::CheckButton.new('This one uses the tooltip-markup property') button.tooltip_text = 'Hello, I am a static tooltip.' box.pack_start(button, false, false, 0) raise if button.tooltip_text != 'Hello, I am a static tooltip.' raise if button.tooltip_markup != 'Hello, I am a static tooltip.' # A check button using the query-tooltip signal button = Gtk::CheckButton.new('I use the query-tooltip signal') button.has_tooltip = true button.signal_connect('query-tooltip') { |widget, x, y, keyboard_tip, tooltip| tooltip.markup = widget.label tooltip.set_icon_from_stock(Gtk::Stock::DELETE, Gtk::IconSize::MENU) true } box.pack_start(button, false, false, 0) # A label label = Gtk::Label.new('I am just a label') label.selectable = false label.tooltip_text = 'Label & and tooltip' box.pack_start(label, false, false, 0) raise if label.tooltip_text != "Label & and tooltip" raise if label.tooltip_markup != "Label & and tooltip" # A selectable label label = Gtk::Label.new('I am a selectable label') label.selectable = true label.tooltip_markup = '<b>Another</b> Label tooltip' box.pack_start(label, false, false, 0) raise if label.tooltip_text != 'Another Label tooltip' raise if label.tooltip_markup != '<b>Another</b> Label tooltip' # Another one, with a custom tooltip window button = Gtk::CheckButton.new('This one has a custom tooltip window!') box.pack_start(button, false, false, 0) tooltip_window = Gtk::Window.new(Gtk::Window::POPUP) tooltip_button = Gtk::Label.new('blaat!') tooltip_window.add(tooltip_button) tooltip_button.show button.tooltip_window = tooltip_window button.signal_connect('query-tooltip') { |widget, x, y, keyboard_tip, tooltip| widget.tooltip_window.modify_bg(Gtk::StateType::NORMAL, Gdk::Color.new(0, 65535, 0)) true } button.has_tooltip = true # An insensitive button button = Gtk::Button.new('This one is insensitive') button.sensitive = false button.tooltip_text = 'Insensitive!' box.pack_start(button, false, false, 0) # Tree view store = Gtk::TreeStore.new(String) iter = store.insert(nil, 0, ['File Manager']) iter = store.insert(nil, 0, ['Gossip']) iter = store.insert(nil, 0, ['System Settings']) iter = store.insert(nil, 0, ['The GIMP']) iter = store.insert(nil, 0, ['Terminal']) iter = store.insert(nil, 0, ['Word Processor']) treeview = Gtk::TreeView.new(store) treeview.set_size_request(200, 240) treeview.append_column(Gtk::TreeViewColumn.new('Test', Gtk::CellRendererText.new, { :text => 0 })) treeview.has_tooltip = true treeview.signal_connect('query-tooltip') { |widget, x, y, keyboard_tip, tooltip| treeview_query_tooltip(widget, keyboard_tip, x, y, tooltip) } treeview.selection.signal_connect('changed') { treeview.trigger_tooltip_query } # Set a tooltip on the column column = treeview.get_column(0) column.clickable = true #column.button.tooltip_text = 'Header' .button not available box.pack_start(treeview, false, false, 2) # Text view buffer = Gtk::TextBuffer.new buffer.insert(buffer.end_iter, 'Hello, the text ') tag = buffer.create_tag('bold', { 'weight' => Pango::WEIGHT_BOLD }) buffer.insert(buffer.end_iter, 'in bold', tag) buffer.insert(buffer.end_iter, ' has a tooltip!') textview = Gtk::TextView.new(buffer) textview.set_size_request(200, 50) textview.has_tooltip = true textview.signal_connect('query-tooltip') { |widget, x, y, keyboard_tip, tooltip| textview_query_tooltip(widget, keyboard_tip, x, y, tooltip, tag) } box.pack_start(textview, false, false, 2) # Drawing area if Gdk.cairo_available? Rectangle = Struct.new("Rectangle", :x, :y, :r, :g, :b, :tooltip) rectangles = [ Rectangle.new(10, 10, 0.0, 0.0, 0.9, "Blue box!"), Rectangle.new(200, 170, 1.0, 0.0, 0.0, "Red thing"), Rectangle.new(100, 50, 0.8, 0.8, 0.0, "Yellow thing") ] drawingarea = Gtk::DrawingArea.new drawingarea.set_size_request(320, 240) drawingarea.has_tooltip = true drawingarea.signal_connect('expose_event') { cr = drawingarea.window.create_cairo_context cr.rectangle(0, 0, drawingarea.allocation.width, drawingarea.allocation.height) cr.set_source_rgb(1.0, 1.0, 1.0) cr.fill rectangles.each { |r| cr.rectangle(r.x, r.y, 50, 50) cr.set_source_rgb(r.r, r.g, r.b) cr.stroke cr.rectangle(r.x, r.y, 50, 50) cr.set_source_rgba(r.r, r.g, r.b, 0.5) cr.fill } } drawingarea.signal_connect('query-tooltip') { |widget, x, y, keyboard_tip, tooltip| drawingarea_query_tooltip(keyboard_tip, x, y, tooltip, rectangles) } box.pack_start(drawingarea, false, false, 2) else warn "Part of this sample needs Cairo support. Make sure your ruby-gtk2 is compiled with Cairo support, and rcairo is installed." end window.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/statusicon.rb������������������������������������������������0000644�0001750�0001750�00000006044�11701304107�020407� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin status_icon.rb - Gtk::StatusIcon sample. This sample refers gtk/tests/teststatusicon.c of GTK+-2.10.x. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: statusicon.rb,v 1.1 2006/11/17 18:12:41 mutoh Exp $ =end require 'gtk3' if str = Gtk.check_version(2, 10, 0) puts "This sample requires GTK+ 2.10.0 or later" puts str exit end class StatusIconSample < Gtk::StatusIcon STATUS_INFO = 0 STATUS_QUESTION = 1 def initialize super @status = STATUS_INFO update_icon set_blinking(true) signal_connect("activate"){ icon_activated } signal_connect("popup-menu"){|w, button, activate_time| menu = Gtk::Menu.new checkmenuitem = Gtk::CheckMenuItem.new("Blink") checkmenuitem.active = blinking? checkmenuitem.signal_connect("activate"){|w| set_blinking(w.active?) } menu.append(checkmenuitem) menuitem = Gtk::MenuItem.new("Quit") menuitem.signal_connect("activate"){ set_visible(false) Gtk.main_quit } menu.append(menuitem) menu.show_all menu.popup(nil, nil, button, activate_time) } timeout_func end def update_icon if @status == STATUS_INFO set_icon_name(Gtk::Stock::DIALOG_INFO) set_tooltip("Some Information ...") else set_icon_name(Gtk::Stock::DIALOG_QUESTION) set_tooltip("Some Question ...") end end def timeout_func GLib::Timeout.add(2000) { if @status == STATUS_INFO @status = STATUS_QUESTION else @status = STATUS_INFO end update_icon true } end def icon_activated unless @dialog @dialog = Gtk::MessageDialog.new(nil, 0, Gtk::MessageDialog::QUESTION, Gtk::MessageDialog::BUTTONS_CLOSE, "You wanna test the status icon?") @dialog.window_position = Gtk::Window::POS_CENTER @dialog.signal_connect("response"){ @dialog.hide } @dialog.signal_connect("delete_event"){ @dialog.hide_on_delete } toggle = Gtk::ToggleButton.new("_Show the icon") @dialog.vbox.pack_end(toggle, true, true, 6) toggle.active = visible? toggle.signal_connect("toggled"){|w| set_visible(w.active?) } toggle = Gtk::ToggleButton.new("_Blink the icon") @dialog.vbox.pack_end(toggle, true, true, 6) toggle.active = blinking? toggle.signal_connect("toggled"){|w| set_blinking(w.active?) } toggle = Gtk::ToggleButton.new("_Change the icon") @dialog.vbox.pack_end(toggle, true, true, 6) toggle.active = (@timeout != 0) toggle.signal_connect("toggled"){ if @timeout and @timeout > 0 GLib::Source.remove(@timeout) @timeout = 0 else @timeout = timeout_func end } end @dialog.show_all @dialog.present end end StatusIconSample.new Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/bindings.rb��������������������������������������������������0000644�0001750�0001750�00000005412�11701304107�020006� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin bindings.rb - Ruby/GTK sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: bindings.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $ =end =begin Usage: bindings.rb <filename> Following key bindings are effective in the TextView area. <space> : scroll down by one page <backspace> : scroll up by one page j : move cursor donw by one line k : move cursor up by one line clicking buttons cause following effect "space" : same as pressing <space> in text view area. "back_space" : same as pressing <backspace> in text view area. "cancel j/k" : disable 'j' and 'k' binding =end require 'gtk3' class Pager < Gtk::TextView type_register # widget's key binding can be defined like this binding_set.add_signal(Gdk::Keyval::GDK_space, 0, "move_cursor", Gtk::MOVEMENT_PAGES, 1, false) binding_set.add_signal(Gdk::Keyval::GDK_BackSpace, 0, "move_cursor", Gtk::MOVEMENT_PAGES, -1, false) def initialize(path) @path = path super() @buffer = self.buffer load set_editable(false) set_size_request(400, 400) end def load open(@path).read.each_line do |line| @buffer.insert_at_cursor(line) end @buffer.place_cursor(@buffer.start_iter) end end path = ARGV[0] || __FILE__ window = Gtk::Window.new window.name = "pager_window" sw = Gtk::ScrolledWindow.new vbox = Gtk::VBox.new hbox = Gtk::HBox.new pager = Pager.new(path) hbox.add(button1 = Gtk::Button.new("space")) hbox.add(button2 = Gtk::Button.new("back_space")) hbox.add(button3 = Gtk::Button.new("cancel j/k")) button1.signal_connect("clicked") do Pager.binding_set.activate(Gdk::Keyval::GDK_space, 0, pager) end button2.signal_connect("clicked") do pager.bindings_activate(Gdk::Keyval::GDK_BackSpace, 0) end # Key bindings can be attached to any widget by # Gtk::BindingSet#add_path # see RC Files section of GTK+ documentation for more detail. bset = Gtk::BindingSet.new("j_and_k") bset.add_signal(Gdk::Keyval::GDK_j, 0, "move_cursor", Gtk::MOVEMENT_DISPLAY_LINES, 1, false) bset.add_signal(Gdk::Keyval::GDK_k, 0, "move_cursor", Gtk::MOVEMENT_DISPLAY_LINES, -1, false) bset.add_path(Gtk::PathType::WIDGET, "pager_window.*.Pager", Gtk::PathPriorityType::APPLICATION) button3.signal_connect("clicked") do bset.entry_clear(Gdk::Keyval::GDK_j, 0) bset.entry_clear(Gdk::Keyval::GDK_k, 0) end sw.add(pager) vbox.add(hbox).add(sw) window.add(vbox) window.show_all pager.grab_focus window.signal_connect("destroy") { Gtk.main_quit } Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/misc/uimanager2.rb������������������������������������������������0000644�0001750�0001750�00000005151�11701304107�020243� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin uimanager2.rb - Copyright (C) 2004-2006 Masao Mutoh This program is licenced under the same licence as Ruby-GNOME2. $Id: uimanager2.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $ =end require 'gtk3' if str = Gtk.check_version(2, 4, 0) puts "This sample requires GTK+ 2.4.0 or later" puts str exit end callback = Proc.new {|actiongroup, action| puts "`#{action.name}' is clicked. " if action.is_a? Gtk::ToggleAction puts "active? = #{action.active?}" end } callback_quit = Proc.new { p "Quit is called." Gtk.main_quit } callback_radio = Proc.new {|action, current| puts "action = `#{action.name}'" puts "current = `#{current.name}'" } actions = [ ["FileMenu", nil, "_File"], ["PreferencesMenu", nil, "_Preferences"], ["ColorMenu", nil, "_Color"], ["ShapeMenu", nil, "_Shape"], ["HelpMenu", nil, "_Help"], ["New", Gtk::Stock::NEW, "_New", "<control>N", "Create a new file", callback], ["Open", Gtk::Stock::OPEN, "_Open", "<control>O", "Open a file", callback], ["Save", Gtk::Stock::SAVE, "_Save", "<control>S", "Save current file", callback], ["SaveAs", Gtk::Stock::SAVE, "Save _As...", nil, "Save to a file", callback], ["Quit", Gtk::Stock::QUIT, "_Quit", "<control>Q", "Quit", callback_quit], ["About", nil, "_About", "<control>A", "About", callback], ["Logo", "demo-gtk-logo", nil, nil, "GTK+", callback] ] toggle_actions = [ ["Bold", Gtk::Stock::BOLD, "_Bold", "<control>B", "Bold", callback, true] ] color_radio_actions = [ ["Red", nil, "_Red", "<control>R", "Blood", 0], ["Green", nil, "_Green", "<control>G", "Grass", 1], ["Blue", nil, "_Blue", "<control>B", "Sky", 2] ] shape_radio_actions = [ ["Square", nil, "_Square", "<control>S", "Square", 0], ["Rectangle", nil, "_Rectangle", "<control>R", "Rectangle", 1], ["Oval", nil, "_Oval", "<control>O", "Egg", 2] ] window = Gtk::Window.new("Gtk::UIManager sample2") window.signal_connect("destroy"){Gtk.main_quit} actiongroup = Gtk::ActionGroup.new("Actions") actiongroup.add_actions(actions) actiongroup.add_toggle_actions(toggle_actions) actiongroup.add_radio_actions(color_radio_actions, 1) do |action, current| puts "action = `#{action.name}'" puts "current = `#{current.name}'" end actiongroup.add_radio_actions(shape_radio_actions, 2, callback_radio) uimanager = Gtk::UIManager.new uimanager.insert_action_group(actiongroup, 0) window.add_accel_group(uimanager.accel_group) uimanager.add_ui("./uimanager2.xml") vbox = Gtk::VBox.new vbox.pack_start(uimanager["/MenuBar"], false, false) vbox.pack_start(Gtk::Label.new("Gtk::UIManager Sample")) window.add(vbox) window.set_default_size(100, 100).show_all Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/����������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�016414� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/scrolledwindow.rb�����������������������������������������0000644�0001750�0001750�00000004072�11701304107�022003� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header scrolledwindow.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/21 17:47:19 $ $Id: scrolledwindow.rb,v 1.7 2005/07/21 17:47:19 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ScrolledWindowSample < SampleDialog def initialize super("dialog") scrolled_window = Gtk::ScrolledWindow.new scrolled_window.border_width = 10 scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) vbox.add(scrolled_window) table = Gtk::Table.new(20, 20, false) table.row_spacings = 10 table.column_spacings = 10 scrolled_window.add_with_viewport(table) table.focus_hadjustment = scrolled_window.hadjustment table.focus_vadjustment = scrolled_window.vadjustment for i in 0..19 for j in 0..19 buffer = "button (#{i},#{j})" button = Gtk::ToggleButton.new(buffer) table.attach(button, i, i + 1, j, j + 1) end end button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} action_area.pack_start(button, true, true, 0) set_default_size(300, 300) end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/shapedwindow.rb�������������������������������������������0000644�0001750�0001750�00000004306�11701304107�021440� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header shapedwindow.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: shapedwindow.rb,v 1.7 2005/07/21 17:47:19 mutoh Exp $ =end require 'sample' class ShapeSampleBasic < Gtk::Window include Sample extend SampleClass @@root_win = nil def initialize(xpm_file, x, y, px, py, type) super(type) @destroyed = false signal_connect("destroy"){destroy} realize @@root_win = Gdk::Window.default_root_window unless @@root_win window.set_events(window.events | Gdk::Event::BUTTON_MOTION_MASK | Gdk::Event::POINTER_MOTION_HINT_MASK | Gdk::Event::BUTTON_PRESS_MASK) signal_connect("button_press_event") do |w, event| if (event.event_type == Gdk::Event::BUTTON_PRESS) @x = event.x @y = event.y Gtk.grab_add(self) Gdk.pointer_grab(window, true, Gdk::Event::BUTTON_RELEASE_MASK | Gdk::Event::BUTTON_MOTION_MASK | Gdk::Event::POINTER_MOTION_HINT_MASK, nil, nil, 0) end end signal_connect("button_release_event") do Gtk.grab_remove(self) Gdk.pointer_ungrab(0) end signal_connect("motion_notify_event") do xp, yp, mask = @@root_win.pointer move(xp - @x, yp - @y) end move(x, y) style = Gtk::Widget.default_style fixed = Gtk::Fixed.new fixed.set_size_request(100, 100) add(fixed) gdk_pixmap, gdk_pixmap_mask = Gdk::Pixmap::create_from_xpm(window, style.bg(Gtk::STATE_NORMAL), xpm_file) pixmap = Gtk::Image.new(gdk_pixmap, gdk_pixmap_mask) fixed.put(pixmap, px, py) shape_combine_mask(gdk_pixmap_mask, px, py) end end class ShapeSampleModeller < ShapeSampleBasic def initialize super("Modeller.xpm", 440, 140, 0, 0, Gtk::Window::POPUP) end end class ShapeSampleSheets < ShapeSampleBasic def initialize super("FilesQueue.xpm", 580, 170, 0, 0, Gtk::Window::POPUP) end end class ShapeSampleRings < ShapeSampleBasic def initialize super("3DRings.xpm", 460, 270, 25, 25, Gtk::Window::TOPLEVEL) end end ShapesSample = Class.new class << ShapesSample def invoke ShapeSampleModeller.invoke ShapeSampleSheets.invoke ShapeSampleRings.invoke end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/button.rb�������������������������������������������������0000644�0001750�0001750�00000007173�11701304107�020264� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header button.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/17 16:55:26 $ $Id: button.rb,v 1.6 2005/07/17 16:55:26 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ButtonSample < SampleWindow def initialize super("buttons") box1 = Gtk::VBox.new(false, 0) add(box1) table = Gtk::Table.new(3, 3, false) table.row_spacings = 5 table.column_spacings = 5 table.border_width = 10 box1.pack_start(table, true, true, 0) button = [ Gtk::Button.new("button1"), Gtk::Button.new("button2"), Gtk::Button.new("button3"), Gtk::Button.new("button4"), Gtk::Button.new("button5"), Gtk::Button.new("button6"), Gtk::Button.new("button7"), Gtk::Button.new("button8"), Gtk::Button.new("button9"), ] button[0].signal_connect("clicked") do button_window(button[1]) end table.attach(button[0], 0, 1, 0, 1, [:expand, :fill], [:expand, :fill], 0, 0) # Gtk::EXPAND | Gtk::FILL button[1].signal_connect("clicked") do button_window(button[2]) end table.attach(button[1], 1, 2, 1, 2, [:expand, :fill], [:expand, :fill], 0, 0) button[2].signal_connect("clicked") do button_window(button[3]) end table.attach(button[2], 2, 3, 2, 3, [:expand, :fill], [:expand, :fill], 0, 0) button[3].signal_connect("clicked") do button_window(button[4]) end table.attach(button[3], 0, 1, 2, 3, [:expand, :fill], [:expand, :fill], 0, 0) button[4].signal_connect("clicked") do button_window(button[5]) end table.attach(button[4], 2, 3, 0, 1, [:expand, :fill], [:expand, :fill], 0, 0) button[5].signal_connect("clicked") do button_window(button[6]) end table.attach(button[5], 1, 2, 2, 3, [:expand, :fill], [:expand, :fill], 0, 0) button[6].signal_connect("clicked") do button_window(button[7]) end table.attach(button[6], 1, 2, 0, 1, [:expand, :fill], [:expand, :fill], 0, 0) button[7].signal_connect("clicked") do button_window(button[8]) end table.attach(button[7], 2, 3, 1, 2, [:expand, :fill], [:expand, :fill], 0, 0) button[8].signal_connect("clicked") do button_window(button[0]) end table.attach(button[8], 0, 1, 1, 2, [:expand, :fill], [:expand, :fill], 0, 0) box1.pack_start(Gtk::HSeparator.new, false, true, 0) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.pack_start(box2, false, true, 0) button[9] = Gtk::Button.new("close") button[9].signal_connect("clicked") do destroy end box2.add(button[9]) end private def button_window(button) unless button.visible? button.show else button.hide end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/pixmap.rb�������������������������������������������������0000644�0001750�0001750�00000003313�11701304107�020237� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header pixmap.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/18 17:13:32 $ $Id: pixmap.rb,v 1.5 2005/07/18 17:13:32 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class PixmapSample < SampleWindow def initialize super("pixmap") vbox = Gtk::VBox.new(false, 0) add(vbox) button = Gtk::Button.new vbox.pack_start(button, false, false, 10) label = Gtk::Label.new("Pixmap\ntest") boxbutton = Gtk::HBox.new(false, 0) boxbutton.border_width = 2 boxbutton.add(Gtk::Image.new("test.xpm")) boxbutton.add(label) button.add(boxbutton) vbox.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, false, false, 10) end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/README����������������������������������������������������0000644�0001750�0001750�00000000402�11701304107�017270� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-testgtk - testgtk.c rewritten in Ruby/GTK To run, do ruby testgtk.rb in this directory. ---- (Maintainer from Ruby/GTK2) Masao Mutoh <mutoh@highway.ne.jp> (Original Author of Ruby/GTK version) Hiroshi Igarashi <igarashi@ueda.info.waseda.ac.jp> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/progressbar.rb��������������������������������������������0000644�0001750�0001750�00000011503�11701304107�021272� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header progressbar.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: progressbar.rb,v 1.9 2005/07/18 17:13:32 mutoh Exp $ Rewritten by Minoru Inachi <inachi@earth.interq.or.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ProgressBarSample < SampleDialog def initialize super("Gtk::ProgressBar") set_border_width(10) vbox1 = Gtk::VBox.new(false, 5) vbox1.border_width = 10 child.add(vbox1) frame = Gtk::Frame.new("Progress") vbox1.add(frame) vbox2 = Gtk::VBox.new(false, 5) frame.add(vbox2) align = Gtk::Alignment.new(0.5, 0.5, 0, 0) vbox2.pack_start(align, FALSE, FALSE, 5) @pbar = Gtk::ProgressBar.new align.add(@pbar) @timer = GLib::Timeout.add(100){progress_timeout} align = Gtk::Alignment.new(0.5, 0.5, 0, 0) vbox2.pack_start(align, false, false, 5); hbox = Gtk::HBox.new(false, 5) align.add(hbox) label = Gtk::Label.new("Label updated by user :") hbox.add(label) @label = Gtk::Label.new("") hbox.add(@label) frame = Gtk::Frame.new("Options") vbox1.add(frame) vbox2 = Gtk::VBox.new(false, 5) frame.add(vbox2) tab = Gtk::Table.new(3, 2, false) vbox2.add(tab) label = Gtk::Label.new("Orientation :"); tab.attach(label, 0, 1, 0, 1, [:expand, :fill], [:expand, :fill], 5, 5) # Gtk::EXPAND | Gtk::FILL label.set_alignment(0, 0.5) =begin @omenu1 = build_option_menu( [ OptionMenuItem.new("Left-Right", proc { |w| toggle_orientation(w) }), OptionMenuItem.new("Right-Left", proc { |w| toggle_orientation(w) }), OptionMenuItem.new("Bottom-Top", proc { |w| toggle_orientation(w) }), OptionMenuItem.new("Top-Bottom", proc { |w| toggle_orientation(w) }) ], 0) hbox = Gtk::HBox.new(false, 0) tab.attach(hbox, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 5, 5); hbox.add(@omenu1) =end check = Gtk::CheckButton.new("Show text") check.signal_connect("clicked") do |w| toggle_show_text(w) end tab.attach(check, 0, 1, 1, 2, [:expand, :fill], [:expand, :fill], 5, 5) hbox = Gtk::HBox.new(false, 0) tab.attach(hbox, 1, 2, 1, 2, [:expand, :fill], [:expand, :fill], 5, 5) label = Gtk::Label.new("Text align :") tab.attach(label, 0, 1, 2, 3, [:expand, :fill], [:expand, :fill], 5, 5) label.set_alignment(0, 0.5) hbox = Gtk::HBox.new(false, 0) tab.attach(hbox, 1, 2, 2, 3, [:expand, :fill], [:expand, :fill], 5, 5) label = Gtk::Label.new("x :") hbox.pack_start(label, false, true, 5) adj = Gtk::Adjustment.new(0.5, 0, 1, 0.1, 0.1, 0) @x_align_spin = Gtk::SpinButton.new(adj, 0, 1) adj.signal_connect("value_changed"){adjust_align} hbox.pack_start(@x_align_spin, false, true, 0) @x_align_spin.sensitive = false label = Gtk::Label.new("y :") hbox.pack_start(label, false, true, 5) adj = Gtk::Adjustment.new(0.5, 0, 1, 0.1, 0.1, 0) @y_align_spin = Gtk::SpinButton.new(adj, 0, 1) adj.signal_connect("value_changed"){adjust_align} hbox.pack_start(@y_align_spin, false, true, 0) @y_align_spin.sensitive = false button = Gtk::Button.new("close") button.signal_connect("clicked"){ GLib::Source.remove(@timer) destroy } button.can_default = true self.action_area.add(button) button.grab_default end private def toggle_orientation(rmitem) return unless rmitem.mapped? i = 3 group = rmitem.group group.each do |g| break if g.active? i -= 1 end @pbar.orientation = i end private def progress_timeout new_val = @pbar.fraction + 0.05 new_val = 0.0 if new_val > 1.0 @pbar.fraction = new_val @label.text = "#{(new_val * 100).to_i}" true end private def toggle_show_text(cbutton) @pbar.show_text = cbutton.active? @x_align_spin.sensitive = cbutton.active? @y_align_spin.sensitive = cbutton.active? end private def adjust_align @pbar.text_xalign = @x_align_spin.value @pbar.text_yalign = @y_align_spin.value end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/labels.rb�������������������������������������������������0000644�0001750�0001750�00000005110�11701304107�020200� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- =begin header labels.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002,2003 Ruby-GNOME2 Project Team $Id: labels.rb,v 1.7 2005/07/17 16:55:27 mutoh Exp $ =end require 'sample' class LabelSample < SampleWindow def initialize super("Gtk::Label") set_border_width(5) vbox = Gtk::VBox::new(false, 5) hbox = Gtk::HBox::new(false, 5) hbox.pack_start(vbox, false, false, 0) create_frame("Normal Label", "This is a Normal label", vbox) create_frame("Multi-line Label", "This is a Multi-line label.\nSecond line\nThird line", vbox) create_frame("Left Justified Label", "This is a Left-Justified\nMulti-line label.\nThird line", vbox) do |label| label.justify = :left # Gtk::Justification::LEFT end create_frame("Right Justified Label", "This is a Right-Justified\nMulti-line label.\nFourth line, (j/k)", vbox) do |label| label.justify = :right # Gtk::Justification::RIGHT end vbox = Gtk::VBox::new(false, 5) hbox.pack_start(vbox, false, false, 0) create_frame("Line wrapped label", "This is an example of a line-wrapped label. It should not be taking up the entire width allocated to it, but automatically wraps the words to fit. The time has come, for all good men, to come to the aid of their party. The sixth sheik's six sheep's sick.\n It supports multiple paragraphs correctly, and correctly adds many extra spaces. ", vbox) do |label| label.wrap = true end create_frame("Filled, wrapped label", "This is an example of a line-wrapped, filled label. It should be taking up the entire width allocated to it. Here is a seneance to prove my point. Here is another sentence. Here comes the sun, do de do de do.\n This is a new paragraph.\n This is another newer, longer, better paragraph. It is coming to an end, unfortunately.", vbox) do |label| label.justify = :fill # Gtk::Justification::FILL label.wrap = true end create_frame("Underlined label", "This label is underlined!\nThis one is underlined in 日本語ã®å…¥ç”¨quite a funky fashion", vbox) do |label| label.justify = :left label.pattern = "_________________________ _ _________ _ _____ _ __ __ ___ ____ _____" end add(hbox) end def create_frame(title, label_str, vbox) frame = Gtk::Frame::new(title) frame.show label = Gtk::Label::new(label_str) yield(label) if iterator? frame.add(label) vbox.pack_start(frame, false, false, 0) end private :create_frame end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/fontselection.rb������������������������������������������0000644�0001750�0001750�00000003036�11701304107�021617� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header fontselection.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: fontselection.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ Rewritten by Neil Conway <neilconway@rogers.com> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class FontSelectionSample < Gtk::FontSelectionDialog include Sample extend SampleClass def initialize super(:title => 'Font Selection Dialog') set_window_position(:mouse) # Gtk::Window::Position::MOUSE signal_connect('destroy') { destroy } ok_button.signal_connect('clicked') { puts font_name destroy } cancel_button.signal_connect('clicked') { destroy } end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/wmhints.rb������������������������������������������������0000644�0001750�0001750�00000001774�11701304107�020443� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header wmhints.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: wmhints.rb,v 1.8 2005/07/21 17:47:19 mutoh Exp $ =end require 'sample' class WMHintsSample < SampleWindow def initialize super("WM Hints") realize circles = Gdk::Pixmap.create_from_xbm(window, "circles.xbm") window.set_icon(nil, circles, circles) window.icon_name = "WMHints Test Icon" window.decorations = Gdk::Window::DECOR_ALL | Gdk::Window::DECOR_MENU window.functions = Gdk::Window::FUNC_ALL | Gdk::Window::FUNC_RESIZE vbox = Gtk::VBox.new(false, 10) add(vbox) label = Gtk::Label.new("Try iconizing me!") label.set_size_request(150, 50) vbox.pack_start(label, true, true, 0) vbox.pack_start(Gtk::HSeparator.new, false, true, 0) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, true, true, 0) button.can_default = true button.grab_default end end ����ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/circles.xbm�����������������������������������������������0000644�0001750�0001750�00000006335�11701304107�020557� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#define circles_width 64 #define circles_height 64 static unsigned char circles_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xff, 0x01, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0xc0, 0xff, 0x01, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0x01, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0xf8, 0x1f, 0x00, 0x20, 0x00, 0x00, 0xff, 0x03, 0xf8, 0x0f, 0x00, 0xff, 0x07, 0x00, 0xfe, 0x03, 0xfc, 0x07, 0xc0, 0xff, 0x1f, 0x00, 0xfc, 0x07, 0xfc, 0x07, 0xf0, 0xff, 0x7f, 0x00, 0xfc, 0x07, 0xfc, 0x03, 0xf8, 0xff, 0xff, 0x00, 0xf8, 0x07, 0xfe, 0x03, 0xfc, 0xff, 0xff, 0x01, 0xf8, 0x0f, 0xfe, 0x01, 0xfe, 0x8f, 0xff, 0x03, 0xf0, 0x0f, 0xfe, 0x01, 0xfe, 0x01, 0xfc, 0x03, 0xf0, 0x0f, 0xff, 0x01, 0xff, 0x00, 0xf8, 0x07, 0xf0, 0x1f, 0xff, 0x00, 0x7f, 0x00, 0xf0, 0x07, 0xe0, 0x1f, 0xff, 0x80, 0x3f, 0x00, 0xe0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0xe0, 0x1f, 0xff, 0xc0, 0x0f, 0x00, 0x80, 0x1f, 0xe0, 0x1f, 0xff, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x80, 0x1f, 0x00, 0xc0, 0x0f, 0xe0, 0x1f, 0xff, 0x81, 0x3f, 0x00, 0xe0, 0x0f, 0xf0, 0x1f, 0xfe, 0x01, 0x7f, 0x00, 0xf0, 0x07, 0xf0, 0x0f, 0xfe, 0x01, 0xff, 0x00, 0xf8, 0x07, 0xf0, 0x0f, 0xfe, 0x03, 0xfe, 0x01, 0xfc, 0x03, 0xf8, 0x0f, 0xfc, 0x03, 0xfe, 0x8f, 0xff, 0x03, 0xf8, 0x07, 0xfc, 0x07, 0xfc, 0xff, 0xff, 0x01, 0xfc, 0x07, 0xfc, 0x07, 0xf8, 0xff, 0xff, 0x00, 0xfc, 0x07, 0xf8, 0x0f, 0xf0, 0xff, 0x7f, 0x00, 0xfe, 0x03, 0xf8, 0x1f, 0xc0, 0xff, 0x1f, 0x00, 0xff, 0x03, 0xf0, 0x1f, 0x00, 0xff, 0x07, 0x00, 0xff, 0x01, 0xf0, 0x3f, 0x00, 0x20, 0x00, 0x80, 0xff, 0x01, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x00, 0xc0, 0xff, 0x01, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x80, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0xfe, 0xff, 0x01, 0xf0, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/test.xpm��������������������������������������������������0000644�0001750�0001750�00000003767�11701304107�020136� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char *openfile[] = { /* width height num_colors chars_per_pixel */ " 20 19 66 2", /* colors */ ".. c None", ".# c #000000", ".a c #dfdfdf", ".b c #7f7f7f", ".c c #006f6f", ".d c #00efef", ".e c #009f9f", ".f c #004040", ".g c #00bfbf", ".h c #ff0000", ".i c #ffffff", ".j c #7f0000", ".k c #007070", ".l c #00ffff", ".m c #00a0a0", ".n c #004f4f", ".o c #00cfcf", ".p c #8f8f8f", ".q c #6f6f6f", ".r c #a0a0a0", ".s c #7f7f00", ".t c #007f7f", ".u c #5f5f5f", ".v c #707070", ".w c #00f0f0", ".x c #009090", ".y c #ffff00", ".z c #0000ff", ".A c #00afaf", ".B c #00d0d0", ".C c #00dfdf", ".D c #005f5f", ".E c #00b0b0", ".F c #001010", ".G c #00c0c0", ".H c #000f0f", ".I c #00007f", ".J c #005050", ".K c #002f2f", ".L c #dfcfcf", ".M c #dfd0d0", ".N c #006060", ".O c #00e0e0", ".P c #00ff00", ".Q c #002020", ".R c #dfc0c0", ".S c #008080", ".T c #001f1f", ".U c #003f3f", ".V c #007f00", ".W c #00000f", ".X c #000010", ".Y c #00001f", ".Z c #000020", ".0 c #00002f", ".1 c #000030", ".2 c #00003f", ".3 c #000040", ".4 c #00004f", ".5 c #000050", ".6 c #00005f", ".7 c #000060", ".8 c #00006f", ".9 c #000070", "#. c #7f7f80", "## c #9f9f9f", /* pixels */ "........................................", "........................................", "........................................", ".......................#.#.#............", ".....................#.......#...#......", "...............................#.#......", ".......#.#.#.................#.#.#......", ".....#.y.i.y.#.#.#.#.#.#.#..............", ".....#.i.y.i.y.i.y.i.y.i.#..............", ".....#.y.i.y.i.y.i.y.i.y.#..............", ".....#.i.y.i.y.#.#.#.#.#.#.#.#.#.#.#....", ".....#.y.i.y.#.s.s.s.s.s.s.s.s.s.#......", ".....#.i.y.#.s.s.s.s.s.s.s.s.s.#........", ".....#.y.#.s.s.s.s.s.s.s.s.s.#..........", ".....#.#.s.s.s.s.s.s.s.s.s.#............", ".....#.#.#.#.#.#.#.#.#.#.#..............", "........................................", "........................................", "........................................" }; ���������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/dialog.rb�������������������������������������������������0000644�0001750�0001750�00000001660�11701304107�020203� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin dialog.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: dialog.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ =end require 'sample' class DialogSample < SampleDialog def initialize super("Gtk::Dialog") set_default_size(200, 100) button = Gtk::Button.new("OK") button.signal_connect("clicked"){destroy} button.can_default = true action_area.pack_start(button) button.grab_default button = Gtk::Button.new("Toggle") button.signal_connect("clicked"){label_toggle} button.can_default = true action_area.pack_start(button) @label = nil end private def label_toggle if @label == nil then @label = Gtk::Label.new("Dialog Test") @label.signal_connect("destroy"){@label = nil} @label.set_padding(10, 10) child.pack_start(@label) @label.show else @label.destroy end end end ��������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/checkbutton.rb��������������������������������������������0000644�0001750�0001750�00000003521�11701304107�021253� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header checkbutton.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: checkbutton.rb,v 1.6 2005/07/17 16:55:26 mutoh Exp $ Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/17 16:55:26 $ $Id: checkbutton.rb,v 1.6 2005/07/17 16:55:26 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class CheckButtonSample < SampleWindow def initialize super("check buttons") box1 = Gtk::VBox.new add(box1) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.add(box2) button = Gtk::CheckButton.new("button1") box2.add(button) button = Gtk::CheckButton.new("button2") box2.add(button) button = Gtk::CheckButton.new("button3") box2.add(button) box1.pack_start(Gtk::HSeparator.new) box2 = Gtk::VBox.new(false, 10) box2.border_width = 10 box1.add(box2) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} box2.add(button) end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/range.rb��������������������������������������������������0000644�0001750�0001750�00000003515�11701304107�020041� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header range.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: range.rb,v 1.6 2005/07/18 17:13:32 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class RangeSample < SampleWindow def initialize super("range controls") vbox = Gtk::VBox.new(false, 10) add(vbox) adjustment = Gtk::Adjustment.new(0.0, 0.0, 101.0, 0.1, 1.0, 1.0) scale = Gtk::HScale.new(adjustment) scale.set_size_request(150, 50) scale.update_policy = Gtk::UPDATE_DELAYED scale.digits = 1 scale.draw_value = true vbox.add(scale) scrollbar = Gtk::HScrollbar.new(adjustment) scrollbar.update_policy = Gtk::UPDATE_CONTINUOUS vbox.add(scrollbar) vbox.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, true, true, 0) button.can_default = true button.grab_default end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/togglebutton.rb�������������������������������������������0000644�0001750�0001750�00000003057�11701304107�021463� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header togglebutton.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/21 17:47:19 $ $Id: togglebutton.rb,v 1.6 2005/07/21 17:47:19 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ToggleButtonSample < SampleWindow def initialize super("toggle buttons") set_border_width(5) vbox = Gtk::VBox.new(false, 5) add(vbox) (1..3).each do |i| vbox.add(Gtk::ToggleButton.new("button#{i}")) end vbox.pack_start(Gtk::HSeparator.new, false, true, 0) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.add(button) end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/marble.xpm������������������������������������������������0000644�0001750�0001750�00001115707�11701304107�020420� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char *granite07[] = { /* width height num_colors chars_per_pixel */ " 384 384 16 1", /* colors */ ". c #000000", "# c #111111", "a c #222222", "b c #333333", "c c #444444", "d c #555555", "e c #666666", "f c #777777", "g c #888888", "h c #999999", "i c #aaaaaa", "j c #bbbbbb", "k c #cccccc", "l c #dddddd", "m c #eeeeee", "n c #ffffff", /* pixels */ "aacfedbbcbbaaaaaaaaabaabaaaaabcbcbbbabbchfdcccbbabbbaaabaabcbaa#aa#######a#aaaabcddeefhec##dgbabbaaadabbcfbaa##########aaabbaaa#a#####a#aa###a#aaabbbbcbbbccdedaaaaa#aaaaa#a#abaaabbabbbeddbbaaaaaca##a#aaaba########aaaadcababbabdehd.##.a######.cgdcb###b##.##.##aaaaa####abcba######a##aac#a##a####aa#aa##babbbcfccbbbcdccccecbbbcbbbcdccddcbcdfeecbhhjihhgffc.aaa####.#######aaaaaaaabbaaaaa", "aaacedccbbcbaaaaaa#bbaabbbaaaabcaabbbbbbafhfccbbbbbbabacbacbaaaaa##########a###abbcdeghhhcagb#ababaaccbacdfca#a####aa###aaaaabaaa#####aca#aabaababbcccccccbcdfdaaaa###aaaaaaaaaaabbbbbbccccccbbcbcaaa##aaaaabaaaa###abdaccceebaaaabehja####a######..#aeec#bb##########aa#####abba#########aaca########aa#aa###aaaabddbbbbbbbbbbccbbabbbbabbabbabcbcbcefhfeddccefhhijheecb#...a####aaaaaaaabaaaaa", "aaabccccccdbabcbaaa#aaaaaaaaaaabbabbbbbccabefdccabcbbabacccbaaabaa######a######aaabceiiiihije#bbabbaaeaabcedcaabaa########aaaabaa##a###ab#aabcababbccccccdeeeecc#a##a##aaaaaaaaaabbbbbbbcccbbbdcbbcdaa#a#aabbaaaaa###acbaa#bccaa#abcfig.#######.#######acddgefdda#######a########a#######aaaaaa#a######aaaa#####aaacdcbabbaaabbbcaaaaaaaaabbbaaabbaabbbcbcbabbabcdeefghjkjgc#..####aaaaaaaaaaaa#", "#aaaaaacbccbcabbbaaaaaabcaaaaabbbbbbabbbcbaabffccbccbccbbcbaaaabaaaa#aa#aa##a#aaaaabbikkjhijicabbbcc#faaacdebcbda#########aaaaaaaaa####aa##cacccabcccdccccdddfdcbaa##a##abbbabccbbcbbbccccaaa#abbaaba#a##abbbbbaaaaaaaaaaccaaca##aabcfic.###aa#######a####bddeeddb####.##.###aaa#########aaaa###aa####aaaa#######aabdbbbbcabbbaaaa#aaaaaaaaabaaabbbaabbbbdbbaaabccccccdcefhhkhda##aaaa#a#aaaaa##", "#aaabaabcecbaa##bcaaaaaaaababbabaaabbabbaabb#chhfdccccbcbecaaabaaaaaaaaaa####aaaaaaabdgjkkijijdabbdcabfaabcecbbec###########a#aaaabaa#######abbaaaadddedddeeefeccaa###a#aabcccdcbcbbbbccbbbbaaaaa#aabbaaaabbbbbbaaaaaaabbbbbaaa####acegha##a#aabbb####a##adccdedbcc#######.###a###a#######aaa#a#aa##..#aa#########abdbaabbabbbaa###aaaaaaaaaaaaacbaaababbdbabbabcbbcbcbccbbdegjkgb#aa#aa#aaaaaaa", "##aa#aabccccaaaaaaaa#aaaaaabbaabbbaaaaabbbcbbcfhhgfcccbbbbccbaabbaaaaaaabaa#aaaabaaaabbcehkljjdabacccbgbaaccdb#adea#########aa#abaaaaa#####ac#ba##accdedddefffeaba##a#aaaaacccccccbbbcccaabaaaaaaaaa#aaaaabcbbaaa#bbbbaaefccdbaaa#aaacdei##aa##aabbbaaa#a#cdcccccbcea.#########bbaaa######a###a#aaaa.#aaba####.###abcbaaabaabbbaa###aaaaaaaaaaaabbaaaaaaaaaaababcbbcbbaabbbdddeghheba##ab#abaa##", "#####bbaaaaabaaaaa##aa#adccaabaaabbbbabbabbbabccbccfdbccbbbbbcaabcaabaaabbaaaaaaaaaaaabbbcglli#accbbbddgabcddbbaacea#a##########aaa#aaa##aaaa####aabcddeeefffgdbbaaaa###baabbbbbbcdabdcbcaaabaaaaaaa#aaaaaabcbbbbadfbbbaejhhebbccaaaaaccfi.aba##abaaaba####ecbbccba#fc.####.##.bba#a#######aaaaaaaaaaa##aaaa######abcdaa#aaaabaaa###aaaaabaaabbbaaba##aaababcbbcbbbbbcbaaabbccccddgggeb#aadca###", "#####bcaaaaaabcbaaa#aaaabcccaaaaaaabaaabbbbbbbaacbabeeddddccbcbbcccbabaaaabaabaaaaaaaaabbbbglmdbcbaabebdgdbcecbbaabdbaa#########aabbaaaa#aa#a##a#aabbdceeedccdcbbaaaaa##aaabbcbbbabaaabbababbaaaa#aaaaaaaabcdccbbbabcbbbcfijfbcdcabb#abcbif#abb##aaabaaaa##fcccbbcaa#db#..##.##.aaa#########ab#aaaaaa#aabaaaaa#####abdbbaaaabbaaaa###b#a#aaaabaaaaaaaaaaaaaabbabbbbaabbbaaaabbbbbbbceffecccbaa##", "#####abaaaaa#accbbbbaaabaaaaaaaaaaadcbaabbabbbabbdcaacgfddddcdddcadfcaaaabcbbabaaaaaabcabbbdjliacbababcbdfcdeeaaaaaabba########a##aa#aabaa##a######abddeggca#bcbaaaaaa####aaaaaabbbbbcbbbbbaaa##a#aaaaaaaabcbccbbaaaabaabfgfiecccccbbaaaccicbbbcbaaabaaabb#ceccccdca##aacdb######aaa###a###aabaaaaaa#aabca#abba#####abca##aaaaaaaaa##a##aaaaaaabaaaaaaabaaaacbcbacdbaaabaaaaaabaaaaabbcddccbaa##", "####aa#aaaaaaabccbabbaaaaaaaaaaaaabfaaabbcbbbbbabdebaabdffddedefedccecccdcbbbbbccbccbbbbbbccekldaabaaabccbfaaaaaaaaaaaba########aaaaaaaaba##aaa###aabbccfgfaababbbaaaaa#aabbaabaaccaabcccbcbaa##aaaaaabaabbbccbbbaabbbbbbdddghdbbbcccb#abcdebcccbaabbbabbcbaecddddbaa##.#acdeca#######a#aaaaaaaaaaaaaaabba##abba####aacba##aaaaaaaaaaaaa##aba#abaaaaaaabaaaabbbbbbcbabbaabbaaaaabaaaaaaaaccbaa##", ".####aa#aabaa##bccbaabbbba#aaaaabbaefdaabbbbccbbbaddaaabadeeffhhhffdedddeecbbbbcccbbabcbabbcfjjlkeaaaaacdadcaa#aaaaaaa#ab######ba#aaabbabcaa#aa###babcddcedba##acbaaaaaa#ababbbacbbbcccdfffbaa#aaaacbaabcbabccbbcbbbbbbcbbccedbbbccdccbaabcgb#bccbbbababbbcccdededcb#a####...addcba##aabbbbbbbbaaaaabba#aaa##abba####abbaa###a#aa#aa##aaa#a##abaaaaaaaaabababbcdbcb#baaaaaaaaaaaaaaaaaa#aaaaa###", "######a##aaaaaa#accbaaabbbaaa#aaababdcaaabbbbcccbbbdbabbbacdccgecadbbbcdccddeddcccccbaabcbbcgjhhjgeb#aacdcccaa#aa#aaa#a#aaa##aaaaa#aaabbaabb#aa###aabccddeccbbbaabcbbbcbbb#aacbbadbabcccddbaaa#aaaaabbbbabbbbcdbbbabbcddcbbbccaabbbccbbaaaadi##abbbbbbbaabbbacdeedbd######aa####bceda#aabbabaaaaaaaaba#aaaaa#aabaaa###acaaaa####aa##aaaaaaaa#aaaaaaaaaaababaaaaabcaaaaaaabbcbaaaaaaaaa###aaaa###", "##########aabaa#accbbabbbbbba##aaaabbcbbbbbbbbcbaaabdbbbbbbddccbbbbaaaabbabbbbcefefdcbaadbcddje#debgfbabecdc####aa##a###a#aa#aa##a##aaabbcabbaa###aabbcceedbcbaaaabdcccbabaaabbbbabbccbbaaaaaa#aaaaaaaabbbbbcbccabcccccdcccbbbbabbababbba#abfe#aaaaaaaabccbbaaaedddc######adcaaaa##dfcaaaaaaaaaa#aaaaa##aabcaaabbaa#aaab###aa###aaaaaaaaaaaa##aaaaaaaaaabaaabaaabcabaaaaaaabcbaabaaa##a###aa####", "#########aaaaaaabbcbbbbabcbaacbaa##aaabaaabccccccbaabecabbbcddbacdeba#aaaaabaaabbdfgedcbaccdcgica#aadghdbddd#aa#aaa#a###aaaabaa#####aaaaabbbbbba#aaabccceecbddbaa#bbccabcbbbbbacccdbbdabbaaaaaaa#aaaa#aabbbbcccdcbcbbccccccbcaababbdbabbba#bbgaabaaa#aaacccdcddbeedba#a##a#aba#aaaa##decbaaba#aaa###a#a###abba#bba###aaba####a####aaaaaaaaaaaa#aaabbbaaabbaabbaabbaaa#aa#a#abbaabbbaaa#aaaa#####", "############aaaaaaacbbbbbbbaa#aaa#a##aaaaaaaacbbbbbbabdcabbbcdbaccdba#aaaaaababbcbbdddedccddefihaa#aaahiiiffd#aaaa#abaa##aaaaacaa##a#bcaaaabbbcaaaabccdddecabaaaaacbbbabbccccccbbdbdfdaabbaaa###a#aaaaaaaabbbbbbbaaabdcddccbbbbabbbccaabbbaabfdaaabaa#aa##aabbbbbddba##aa#a#aa##aaaaaabcdbbaaa##aa#####a#aaabbaaaaa##abb######aa###aaaaaaaaaaaaaaaaabaaaaaaaabbbbaaabaaa#aaaaaaabbbaaaaaaaaa####", "###########aa#aa#aaaccabbaaaaaaabb#######a#aaabcbbbabbaeebbccbcbacdaaa##a#aabbbbccbbcbcdegifdfgifba##aaaagigha#aaaaabbaaaaaaaaabaaa##acaaaaabbbbbbabcdddefeba####abbaabccccbbbcbadcbcbaabba#aaaa#aaaaaababacccbaadbabbccedcccbbccbbabaaaaa##ade###abba#aa##abbba#cebb.#a####.#a#aaaaaaaaacfca#aaa###aa###abaabaaaaaaaabbaa#######aaaaa#aa#aaaaaaaaaaababdaaabbbbbababaaaaaa#aaaaaabbaaabaaaaa###", "##########a#aaabaaaaccaaaaaaabaaaaaaba###a##abaaabbababaccbcbbcccaaba#a###aaabbccdccccccdeegggfigaabb#aaa#fffcba#abbaaaaaaaaaaa#abba##aaa##aabbbcbbbbcdeegfeb####aabaabacbbbcbccaabbabaaaaaaa##aa#aaaaababbabbcbcdbbcccbddcdcccabcbbababba###afba#aabba#acaaabbbbaddb##aa####.####aabbaaaabffcaaaaaa##a##bcabbaaaaaaabbbc#a#a#######aaaaa#####a##ababbbbbaaaabbcbaaaaaaaaaaa#aaaaaabaaababaaaaa#", "#######a#####a#aaaaabcbaaaaaa#aabaaaaaa###abbabaaaaaccaaabdbccbccbaaca#####accddcccccccddeeefikjeabcca#a#abfifbaa#abbbbbaaaaaaaaa#bbba#bcaaaaaaaccbcccceffeccaa##aaabbbcabbacbddbbaabdbaaaaaaaaaaaaaaabbbaabbbbbbbbbcbbccccdcdcccabbbbbaaba###dcaaaabbaaabaabcbccaadba#aaa########aaaa##aaaacgdbaaaa####cfffda#a#aaaabbdbaa#aaa########aaaa#aa##aaabbabbbaaabbbaaaaaabaaaaaaaa#aaaaabaaaaaaaaa#a", "a###########aaaaaaaabbaabaaa###abaaa#a##a###a#aaaaabacaaabccbbbcbbbcbb####a#bdfbbccccccdefecdgiiddaabbaaaabacfeaaaaaabcccbaaaaaaabaaacaa##aaaaaaabccddcfgfgbabaaa#aaabbcccbccbcddbbacabbbbbbbbaaacbaaaabcbabbbbbcbbcbccbccdccdccdcbaabbbaabaaade#aa#baaabaa##abbcbacdb#.#abbccc#.##aaa####aa#aeeaaaaaaabbabddfgfba#aabcd#aaaa########aa##a##aaaaaababbaabbbbbabccbababaaaaaaa##a#aaaabbaaaaaaaa#", "#a###a######aaaaaaaacdaaaaaaaa#aaaaaaaaaa#####a###abbbbaaaaccbbbcbbbbaa#aaaaaeecabcccbccdedcdfgigeaaaacbaaabaacbaaaaaaabcbbbaaaaaaaaabccaaaaaaaaaacccceffffbabb#a####aaaabcccccddcdedbbbbaabcabbbccbccbcbcbbbbbbbbbcecbccccceccccdccbbaaaaaaabce#bbaaa###aaa##ababcacda#abb##a#######a#########bfdca#abcbaabaabcffddbabdc#aaaaa##########aa####aaaaaaabbabbbbbbbcbbbcbaaaaaaaa#aa#aaaaaabaa##b##", "##a#########aabaaaabcdbabaaaaa##aaaaabaaba######a##ababbbbbabbbbcbcdddbbaa#abceecabccccccdddfedgjgdbaaabaaabbbaaba#aabaabaccaaaaaaaabbccbbbaaabaaabcddefgfebbbb#aa####aaaabbcccccbbfeccbbbaaababbbbbbbccba#abbbabbcdccdcbddcddcccdcddcbaaaaaabcfbadaa#######a#abbacbbcc###a#a########a######a##aabdcabccbbababaaaacdfededbbaa#aa##aa######ba#aa#aaabbabaababcbbcbcbbbabbaaaaaaaa##aaabaaacba#a##", "##########a#abaaaaabbbcbbbcaa###a#aaaaa##aba#######aaaaaabbdccbaabccdddecaaaabccdbbacccddcdefdfgiifcba#bbaaabbaaaababbbbbbbabbaabaaaacbbbcbbaaaaaaaceeeefffbaaaa###a##aaaabbcbbbddcddddcbcbbaaabbbbababbabaaabababbbbcccdccddcddccccdecaaaa#abccfbbaaa#######aabbaacabe###a#aa#a#a##.aa#######a#aa#cfeecdcccccabbbabacggcabbaaabbaaaa####aabb#aaaabbababbbbbbcccbbbbbcccbbbaaaa#aaaaaababbaaaa##", "######a####abcbaaaaabbccbcbaa###a##aaa##a###aa######aaaaaabdgebaaabbbccacbaaaaabbbaaabccddcdeeffgigbaaaaaabaabcaaababbbbaabbacbaaabbaaaababccbabbabbdffefhdcaaa###aaabba#aababcbdeeccceccccbababbbbabbabbaaaaaabbaabbcbcccccdcddddccccdcaaaababcdeaba#####.###aaabaab#b####a####a##aa#b########aaaaabedddcccccaaaabbcabeaaaabbccbaaa#abbaaabbbaaaabbbaaacbcbcbbdccbaabbacbbbbbaaaaaaaaabbaa#####", "######aaa#abbcbaaaaabdccbbaaa#######aaa#####aaa##a#a##aaaababcbbaaaaabdebbbaaa##aaaaaaaabccddeefggieaaaaaaaacabaabbbabbbbaaaabbaaaaaaabbbabbccbaabbbdfgghebbbaa#####abba#aabbbcbccdcbbbcddcccbbbabbabbbabbabaaaaaaacbbabcbbccccddddccbcccaaaaaabbdcbc##########aaacbbaa####a####aa###a#aa###aaa###abbceddedcccbaaaacccdca##a#abbbabaaaabaaabbba#aabbbbbbccbbbbaaacccbbcbbaaabbbbbbabaaabaaaa####", "#######aa#aaccabbabaabdecbb#a########aaaa####aaa#aba##a#aaaaaaabbdcaabdcbcaacb####abb#abaabccdeffghfdabaaaa#acbbbbcbabcabcbaaaabbbabaaaabbbbbcccbbbccdfedccbbb#########aaaababbacccbcbbbddbdcccccbbbbaaaabbaabbaaaaabaabbbbccdcceedccccacbaaaabbbbddb####aa######aabbaa####a####aa#aa###a#####aa#aabbddeccddccbbbabbbbceb###aa#aaaaaa##aa####aaaa#abbbbbccacccbaa#accbbbbbaaababbabaaaaaaaaa####", "##a#####aaaaaabbbbabacdddccaa########aa#a#####aaa#aa#aaaaaaaaaaaabcabbcbbbbababa###baaaaaaabccdeeehifbabaaa###abbcbbcaccbcbbbaabbbbabaaabbbbbbbbcccccddbccbbbbba#######aaabbbaabbcccbdcbbdbbddcdcccbabaabaaaaaaaaaaaaaaaabbcccddecccbbacccbbbaabbbceca############aaaaa#############a#############aaaaabccddcbbbabbbbbbba#####a##a####aaa#######aaa#babaabbcbaaa##abbbaabbcbbbbaaaaaaaabbaaa####", "#########abaaabbabbbbbddeccca##aa######a#aa####bbaaaaaaaaaaaaaaaaaabccbcccebacfdb#####aaaaaaabcdddcfgfccbaa##a##abcbbcbbdcccccabbabaababbbbbbbbbbcdccddbabbbbbba########aaababbbacdccccaabcbbcabddddbbaaabbabbbaaaaaaaaabbbddcddecbccbbbdcbabbbaabbcda#############abaaaa############a####bb##a####aaaaabcffdcccbbbbbbbb#######aaa###aaaa#######aabaaaabbcbaaaaaaaa#aaaaaabbccbbaaaaaabbbaaa####", "#########aaabbabcbbbbbdddcbaaaaa###############aabaaaa#aaaaaaaaaaabbabbdefffccbba###aa##aaaaaabcdceecggdcbbaa##aa#aacbb#bcdddddabbbbbabbbabbbbbbbccfeedbbbbbbcbba#a#####a#acababbbdcbcbabbabaabaabeedcaaaaaaaabcbbaaaaaaabbcdfdddccbbbbcbccbabbbaaabcda########a#aaaaaaa#aa#####aaabaaaaaaacb##aaa#aaababbcdefddbbcbccbaa#####aaaaaaaab##a########aa#abbcccbaaaaaa###aaaaabaabccbbbaaaaaaaaa####", "########aaaaaaabbbbbbcdedbbbbabaa##########aa###bbb###a##aaaaaaabbaabbbdfeedb##a#a##aa###aaabbbbccdefbfecbbbaaa####a#adb#acdecdfcbaabcbbbbcbbbbbbcdeffbcccabbcdbbba#a###a#aabaaaaaccccbaaaaabbbbaabdfedaaaababbbbbaaaaaaababbcedcccbbbbaccccbaaaccbbabeb######aaaaa#aaa###a######aaaaaaabacbca#aaaaaabbbbccdegfeccccccbcbaaa#####aaaa#aaaaa###a###aaaabbbcccb##a#aaa#aaaaaaaabbdeddcbabaaaaa####", "#########a#aabbbbbbbbdddccbbba#aaaa##aa##a####a#bba#a#a#aaaabaabbbabbeedeeefdaaaa#####bb##aaabbabcddehgifffdcbaaaa#aa#aaaaaccdeddcabbbcbbbccbabbccdceeecdcaaaabbcccaaaaaaaaaaaaaabacdddbaabaabbbbcccccfdbaabbaabbcaaaaaaababbcccccbbbbbbbccbcca#acbbbbbda#####aaaa####ab##a######aaaaaaabaccbaaaaabbbbbbccceffcdeedcbbbbaaaa#aaaaaaaaa#aaabaaaaaa##aaaabbbcbbcbaa#####aaaaaabbbcccddcbbaaaaa####", "##########a#aabbcbcbbcecccbbbabaaaaaa#####a#aaaabbaa##ba#acaaababbbbbbbcdcfgdbbbaa####aba##aaaabbbccdfefhfgedecaaa##abaaaaacbabebbbbbbbbcccbcbbbbddbedbddcaaaaaabdccaaba#aaaaaa#bbbbbaddccaaabcbbdcbbcbddabbbbbbbccaaaaaaaaabcddcbbbbbbbbbbbbbbaaaabbaabe#########a####bb#aa#####aa#aaaabccdbbbbabbcbbbccccdccbaaeffdbca#aaaa#aaaaaaa#aaaaabaaaa#aaaabaabbccbbcceb#bcaaaaaaaabbbbcdcbbbaaaaa####", "#######aa#aaaaabbccbbcdccddcabaaaaaaaaa###aaa#aabcaaa#bba#aabaabbbbbbabcccdfedcaa##aaa######aaaabbbbcdddghhgfedcbaaaa#aaaaabcbbbccbbbbbbbcbccdcccccbeebccbbbaaaaaccccccba#aaaaaaabaaabbbddbbbbcccbcccbaceeacbbbcbccbaaabbabbbbceccbbbbbabbbbbbbab#aabbbbcc#.######a####.bcbcba####aaaa#bedccbbbbbbbaabccddedaaaaa##beeda#aaaaaaaaaaaaaaaaaaaaabba##babbabbbbcbbbccccbbaaaaabbabaabddcbbbaaaa####", "##########aaaabbbbccccbcddddbaaaa##a#a#a###aaaa#baabbaaaaaaaabbbabcbaabccbddfebaaba#ba######aaaabbbbbcddfiiigggedbaaaaaaaaaabcbabccbbbbbbbcccddddccceecccccbbaaaabccddbbba#aaaaaaaaabcbbbcccdccbcbabcbabceecbabbbbbbaaaabaabbbcddbbbbbbbbaabbbcbbbbaaabcbdc########..####ccccba#abbaaaabddbabbbcabbbbcccceeca###aaa##aaa##a#aaaaaaaaaaaaaaaaaaaaa##aabcbbbbbbbccbbbbcddaaaaacbaaaabddbbaaaaaa###", "############aaabbabcddccdbcdcbcbbbaaaaa##a##aaaa##abaaabaaaaaaabbaacaabddabcefc#aabaaa###a####aaabbbbbbddgihhfffgeaaaaaaaaaaaaabbbcbbbbbbbbbcddeeedceccdcccccaaaaabcbddbaa#a#ab#aaacbbbbbbddebbbbccbbbabbbedbaaaaaaaaaaaabbabbccecbbbbccbbbbaabbbbcc#aaabbcc######a#####.bccabbacbababaabdcabbbabbabbbcbdecabaa##aaaa####aaaaba##aaaaabaaababa##aa#aaabbbbbbbbcbbbbacbedbaaa#bbaaaabcbbbbaaaa#aa", "#######a####aaaaabaabbcccbabbbbbbbcbaaa######a#aa######aaaa#aaa#acbbbabeeebabddbaaabaa####aa#a#aababbbbbcehhgeeffdca##aaaaaaaaaabbbbabbbbbbcdcdddfgfhcbbcbbbcbaaaaabcccdbba###baaaabcbbaabcdeecaaabbbbbbaabddecaaaaaaaabbbbbbbccfcbcbbbbbbbaaaaabbbcca#aabacc#######a####acdcbbbbbbaaaabbccaabbbbbbbabbceecabb#aa#aaaa#######aaa##aaaaaaabbaaaaaaaaaaaabbbaabccbbcbaaacgdaaaa#aababbbabbbbaaaaa#", "###a#####a#aaaaaabcbacbbddcaaabbbbbbbaaaaaa##a#####a####aaaaa#aaabdbcbbedefcaaabaaaaabaaa#a##abaaaaababbbcfgggfeefea##aaaaaaaaaaabcbbbbbbbbcdcdddefgeabbbbaabccaabaaceddeeaaa##aaaaaabbbabbcdedbabbbaaaaaaaacfecaaaaabaabbbbbbcdfdbccbbbbbaaaaaabbbcdbaa#aabdb#########a#acdcccbaaab#aabccbbbbbbabbbceedccbcbbaaaa#baa#a###a#a##aa###aaaabaaaaaaaa##aaaabbaaabcbbbbbabbdfeaaaa#ababbcbbaabaaaaaa", "#####a#####aaaaaabbbbbbbcddcbabccaaabbaaaaa#a##a##a######aaaaaabaaaaacbbbffeaaaababbabbbbbaa##bbaaaabbbbcccghghgeffbaaabbaaaaaabbabccbbbbbbcdddefggecccbabaaabbbacbabbdddecbaa####aabaababbcccdcabaa#aaa###abceedcaaaaabbbbccddefdccdccbcbbaaaaabbccdccdb#abbd###a#####a#a#cddcccaaaaaaaaabccbbbbdeefbba##aabaaa#aaaaaa#aa###aaa##a####aaaaaaaaaaaa##aaaabacbabbbbbcbbbbcfgbaaa#aa#abbab#aaaabba", "##########abaaabbbbbcbcdcccdcbbbcbbbbbba#aaaaa#a############aa#aaaaaaababbdeaaaacbbbbbddcbaaa##abaaaabbbbcccghhhedecababcbaaaaaababcbbbbbccbddceggffecccbbbaaabca#aaaadddedcb#a##aaaabbbabbbbcccdd###aaaa#aa##bcefeddcddccefdddfdcccccccccbbaaaaaabccccdddaabbda########ab##bbbddcbbaa#aaaabcbbbcdddccaaaaa#abaaaaaaaaaa#aa#aaaabaa#####aaaaaaaa#######aabaacbabbbbbbcbbbbdfbbaaaa###baabaabaaba", "###########aaaabbcbbbcccbddbcdccbbbbcabbaaaaaaaaa###a##aa###aaaabaaababbccbbdb#abccabddbbbba#aaaabdbbaabbbbcdehihbaabbbbcdcbbbbaababbedcbbaccdddeeefedabbabaaa#aaa#aa#beeeeffca###aaabbbcbbbbbbcced#a###a##aaa#abffgfedcccfhcbdebcbccdccccbbaaaaaabbcccccddbaabdcb#.#aa#aaa##abdddcbbbaaababbbbbcbdbabbbbbb##ababbbaaaaa#aa#aa##aaa######ababaaa#####a#aabcbbbabbbbbbcccbbbeabcbba###aaaaaaaaaab", "b#########aaaaababbbbabbbbdebcccccbbbabaaaaaaaaaaaa########aa#abbaaabbabbdbcbbbaaadcbcbdbabba##aa##abcb#aaabcdcfhgdabbbccdcbcbbbbbbabcgdcbdbbdedeeehfgdbbbbbaaaa#aaa#abddddgeedcaaaaaabbbdccccccbceeaa###a###aaaacfghhgedccggefbccccccccccbbbbbbaabbcccccccdaabaaccb#aaa###a##adedccbcbaaabbbbcbbcddbaaabbbbaadbbaabbaaa##abaaa#aaaaaaaa#aaabaa########abbadccaaabbbcccccbbdcbcbbba###aaaaaaaabb", "aa##########aaabbbbbbbaabbaccbceeebbaabbaabaaabbbbaaa###aaaba#aabaaaaababbccggcbaabccbbbccbca##aaaabdbbabbabbcdddghbabbccddcbbbcbbbbbccgfcbccceddddeddedddcbababaaaaaa#accdeffedbaaaaaaaacccccbbbccffb#a#####aaaaabfhgghhhhgghecbccbccccccccbbbbaaabbbbcbbbcdcbbabbcb#####abca#abccccccabbbbbbbbbdddbaaaaabab#cdba#aabaaaaaaaa#aaa#a#aa#####aaaa#######aabbbbccbbbabbdeddcbbeaabbcb###aaaaaaaaab", "baaa######a#aaabaabdbbcbabbaccccedaaaaaaaaaaaaaaadbaa#aaaa##aaaaaaaaabbbcbcccdbaaaaabdcbacbcdcaaaaaaaabaaccbbccdddhgcabcccdecbcbbcbbabadedbbcdedcddeeccdddeeedcbbcbaabbbabbcddddec#aaaaaabbcccccbccdffc##a##a#aaaaaafheffhgeccefcbbcbcccccccbbbbaaabbbbccbbddedbabbcc.##a##abc###cdcccbcbbbabbbaddccababbbaaabaddba##aaaaaa#aaa#a#aaaaa##aa##aaaa#######abbbbccbcbbbbdefeeccecaaaaa####aabaaaaaa", "bb#a########aabbbaaababcccdaacdbbaba#aaaaaa#aaa##acaa###aa#aaaaaaaaaaabcdcccaaaaaaaaadbcbbbbacc###aaaaaaaacbbccdcdfggbbbcccdecccddcbbbacdfdbcdebbbcccdcccccdcbefccbaaaaabcbbccabdfcaaaaaaabbdddccccccefe##a##aaaaaaaadfghhhdbbcccccbcbbccdccbbbcaaaabbbbdccddeeba#bbda######.acabbddccabcbbbbbbbddccaaaaaaaaaaabdca#a#aaa#aaaaa##a#aaaaa##aa##aaa#a##a##abbbbccbbdbbccefffeccd#a########abaaaaaa", "aa##########aaaaabaabbaaccdcaacbbaab####aaaa#aaaaaa#a####abaaaaaaabcaaabddcacda#aaabacbbbbddddcbaaa##aaaaa#abbdcccdegfbbcdcdefccddccccbcbbfdccecabccbcbbbcdddcbffdcccb#aacbaabcbbeecaa#aaaabcedddccccddfeb#####aaaaaabbehhfcccbcccccbbccccccbcbcbbaaabbbcdcceddcbbabba########bcbbcdcbbbbbbbbaacccccaaaaaaaaaaaabcba####aba##aaaaaa#aaaaaa##a#aaaaaaa#aaabaabbcbbbbbbbdffffeeeaa########aabcaaaa", "aba#a#aa####aaaaabbabbabbaccaaabaaaa#######a####aaaaa####aaa#bbaaaabaaacbddcbccaaaaaaaaaaacdeabcbba#a###a#aaabccccdeegfcbcdddeedcdccddccccfedddcbbccbbbbbbccddedecccdca#aaaaaaabacedcddcbabaabccccccccceccd####aaaaaabaacdghhfecccccbbccccccccbcbbbaabbbcccccddcddceaca########cdccdccbbbbbbbbbccbcdcaaaaaaaaaaaaaaba#####aaaaaaa###aaaaa##a####aaaa###aabbbbbbccbdbbbcdefffgaa#a#######aabaaaaa", "aa#####aa###aaababbccccbbbbcbaaababa#######a#aabaaaaaa####aa#abbaaaabbaabbdcbbcdbbbbaaaaaabcddbcbba#####a#aaabcdccceefhgbbdcceeeeccccccddeefeeecccacccbcbabbccdefdbcebaaaabaababbbcdcdfffdabbbbbcccccccecade#aa#aabaaaabaackijkidbbbcbccccccccbcbbbbaabbccccccccddegfdaa#######ceedcbbcaacccccbcccccbaaaaaaaaaabaaaaaaaaa####aaa.baa######aaaa####baaa#aaaabbbbbccdcbbcddedfgfb##########abbaaa#", "#a########aaaaaaccbbcdcccbbbba#aaaaaa#####aa#aaab#aaaa#.###aa#aabababcbabaccbccdedaaaa#aaaaabccacbaa#a######aacbcccdffhigeccccdeedddccbcddffdefcbabbbcdecbabbbbcddecddbbaaabbabbbcccddeeffabbabbbbcccccdecdedb#a#aaabbaaaaahifgikfcbcccccccccccbbaaabbcbbbccbbbbcccdhea#a#####aedfebccccbbcbcccccccbaaaaaabaa#aaaaaaaaaba#b###aaa#b#######a####aa##abbbabaaabbbbbcdecbbcdedefghc#########abcedcb", "a############a#abcbbbcddccbbbcaaaaaa#a####a#a###ba#aa#######aaba#bbbbbccaabcccddeebaaaa##aaaabaaabaaaa#####a#aaaabcbdeggihfccccdddffdcbcccdfcbcbbbbbbccbbbbabaabcdfebcbbca##aabbbbcdcdfffeeaabbbccbbcccdeeddeed##aaabaaaaachgcccfijebbcccccccccbbaaaaabbbaabbaabbcbbcfecaaa#aaadcddbbdcccabbcccbbbabbaaaa#aaa###aaaaaaaaaaaaa##aaaaba######a######a#abbbbbbabbcbbbddcabcddddefgfa########aacedcc", "#######aaa#####aaaccccddcdcccbbaaaaa####a####a#aaaa#aa#######abaaabbccacdaadccdddccba#aa#bbaaabaaabaaaaaa#aaaaaababbbdeffiiebcccdddeedcccdcfbcbbbbaabcbbbbbbaaaabcdeefeeddedbaaabcbdccefffffabbbbbbbbbcdcdddddefbaabbbbabaeidccddcejgbbccccccccbbbbaaabaaaaabaaabccccdffebaabbaaddcc#cdccabcccccbbbbbaaaaa#aaaa##aa#aaaaaaaaabaaaba#b##a####a#a#a##a#aabbabbaabbbbddecbbdcccddeega.##.#a##aab###", "#########a#####ababccbbbdcccccabbb##aaaaaa#aaaaa##aaaaaa#..###aaaaaaccbbdcbbccdbccdaa##a#a#aaaaaa#ba###a#a#aaaaaaabbbcdeefhgeccedbbcdedeedgebbbbbbbbcdcbbbaabaaabacccddccccbdcaabbadddeefffgfbabbbbccccccccdddbggbaabbbbabhefcccddddihdccccccccbbbababaaa###aa#aabbbcdeeffa.##abcfedabccbcccabcbbbbbbabaaaaa###aaaaaaaabaaaaaaaaaaaaba#######aaab#####aaabaaaabbbaceffecbccddccdec#####.##aa#aa#", "#aa########a####abbccbbccdcccbbbbba#a##aaaaabaa#aa####aaba#.##baaaabccdabdbabbbbbcccbaa####aaaaaaa#aaaa######aaaabbabccdfeehihfggfdbceedddeddfdccbbcbbbbbbbbbbaaabaccccbbccdddecababedefffffhgdaaabccbcccccdddbfhfbbbcbbackdeeccdddccfhgbccccbbbaabaaabba#####a#aabbbdeddeda.###aeddcbaaccccccccbbbbbabaaaaaaaaaa##aba##abbaaaaaaaaaab######aa##aa###aaabbbaaaaabbbeffffdcdcdeffda######.###aaa#", "#aaa############aabcdcbcdcfedeecbbaba##aaaaabaa###b#a##aaaa####abaaacdcaacdaacbcaaaaaaaabc##aaaabaaaaaa######aaaaabbbdddeddfhhhhhhfcccffffdbaabcbdbabbbbbbbbbbaaaaabbcccbbbbcfdedbbadeddeefdefhffecbbcbcccccceddgibbbbbbdecccbbccccddddhidccccbbaacaaabba########aabccedddeda####cdcecbccccddddcbbbbbabbaaa#a#####a#######abaaaaaaa#aaaa#a##aaaa#a####aabaaaaaaaaabccddfgfddefge################", "##aaaaa#aa######aaabdccbccdeefebbaccb###aaabcbaa########aa######aaba#bdbbbcabbbbbbaaba##aba#####ababaaa##a#a##aaaabbcddedddeeefhghfddccdhecbbbaaaababbbabbabcbaaaaaabbccbbbbbbeefdbbbddbddffdggihiebbbcbbcccccedeicbcbbcdccccccccddddddcfifccbbbbabbabbbaaa####aa#aabcedddefeb##.bdcdeccbcccdddcbabbbbaaaaaa#aa############abaa#aaaaa#aaaaaaaaaa#######aabaaaaaaaabbabbcefgecbcc############a#a#", "##aaaa####aa##a##aaabcdcbbccdcdccbcaba##aaaabbbaa#aa#a####a######aabaaabaaaaaaaabbba#aa###a##a###abbbaa#aaaa#a##aabbcededddddeghggcdfedffddcbbbaaabbbbbccabbbbbcaaaaabccbbbbbbeccefdbcdbcbcefefhgghdbbcbcccccccdcefedbadccbbcccccddddddddeggcbbbaacaabbbaaa######aaaabdcdeedefbaa#deddcdcbbcdedccbbbcbaaaaaa##################aaaaa#aa##abaaaa#aaa#aa##aaaaaaaaaabaabbacdbacbaaba###############", "##a#aaa####aa##a##aaabbbbbcdeccbbaaaaabbaaabbaabaa###aaaa#########aaab#aaaaaaaaabbaaaa#a#a#aa#a#aabaaaa###abb##aaaaabcdeeddefghhhebbbfebbdddccbbbbbaaabdcbcbcbacbaaabbabcbbcccddbbcefecdcbbbcddehgggcbbcbcccccccdddffbbdbbbbbccccddddddddddegcbbaabaaabbbaaa######aaabbbcdefdeca#ddedcdddbacadedccbbbbbabaaaa###############.####aaa##a###a##aaa#aaa#abaabaaaaaaaaaaaaabcdbaaaa#a########a##a###", "a##a#aaaa#####aaaaaaabcccbbcdebbaaba#a#bbaaabbaaaa####aaa#####aa#abaaaaaaaabaaaaaabbbaaaaaa#aaaaaababaaa####aaaaaaaabcddddefedhhgbbbbcefbcdedcedabbbababbbcbbbbbbaaabbaabbbbbcbcddbbbcdcebbbbdcabehhebbbbcccccccceddhfddbbbbbccccddddddddddcdfdaaaaaababbaaaaaaaaaaabbbbccddcdfededffddddcbcabcddccbbcbbaaaaa#####################aa##a#a#######aa###aaaaaa###aaaaaaaaaabbccaabaaaa######a######", "aaaabaa##aa####aaaaaabbccccbcccaabbba#a##aaaabbb######aaaaba##aaaaababb##aaaaaa#aabaaaa#aaa#aabaaaaaacbaa####aaaaaaabcdeddefefhheabbbbbdfgfgedcfaaabbbbbbaaaaaacabaa#baaabbabaabbdeeeccabdccbbbcaachifbbbcccccbcccddejkeabbbbccccddddddddddccceebabbaabaaaaaaa#aaaabbbcbbcccddefgedfedddcccbaabcdcccbcbcaabaaaa########.##.########aa###a########aaaaa#a###a###aaaaaaaaababccaabaa#########aa#a#", "##aaaacb########aaaaabbbbcccbdcddbbcbc#aaaca##a#aba######abca#aaaa#aa###aa###aaaaaabbaaa#a###aaaaaaa##bcbba###a#aaaabbceedddehgfdaaabaccbfhiihffcaaaaccbaaaaaaacabaaabbaabcbbbbbbbcbdeffedfdb#acaabafjgbbcbcccbccccdefiicbbbbacccddddddddccccbbcfbbbbbabaaaaaaaaaabbbcbbbbccccdegfecfdbaabdabbbbcccdcccbbbbaaaa###################a#aa##a#a##a####a#aaaaa###########aaaaaabbbbbaabaa#######aa###", "###aaacba#######abaabbdcbbcdcbbefcbabcbbaaaaa####aa#a#a#a#a##aaab###a#aa####abb#a#aacbaa####aaaaaaa#aaabdcbaaaaaaaaabaceefeeffffbaaabbabccehigfeeddefdbabaaaaabbbabaabaaaaabbbbbbabccbabdedda##aaabbachhbbcbccccbbcccdeghebbbaccddddddddddccccbacecbabaaaaaa#aaaaabbbccbbbbcccdcdgfdfebbbbbcccbcbcddccccccbbaaaaa################aabbaaaa####aa###a##aba#############aaaaabbbddbbaba##########.#", "####aaaba#######aaaaabdfdbbcccbbdebbaaaab#aaa#a###aa###aaa###aba#####aaa#####aba#aaa#baaa#####aaaaa###aabcccaabbbbbcbbbdfffgeccebaaabbbbcbbeffedccfghhebaaaaaabbaaaaaaaabaabbabbbbbacbbbbcbdda####abbabghabbbccccbbccddddghdaabcddddeedddddcccbbabdfdaaaaa##aaaaaabccccccbbccddcbefdffdcbbbcdccbbccddcccccbbbaaaa################bbccbaabaa#aaaaaa#aabba##a#########a#aaaaabbccbcabaa###########", "#####aaaba#######aaacccefcccbcdccbcbbaaaaa#abcba#########aaaaaaa######aaaa####aa##aaa#aaaaaaa##aaaaa##aaaccddcccdddddcceeffdccdccbaaaaabbbbcfggdddfffggfebaaaaaaaaaabaaabccbbbbbbbabccbbbbbcbdb###aabbbbghbacccccccccccdddfigdbcddddddeddddcccbbbabbfeabaa#####aaaabcccccbcbdddecegfffcccabbccccbbccdcccccbbbbaaaa############a#aaaababaaaaaaa#aaa##aaaa#aaa##########aaaaaabbcccbbdba#########.", "#####aaaaa######aaabddefcccbabdccccbaaaaaa###aaa######aaabaabbba#######aaaa####a###aaaaaa#a##a#aaaaaaaaaabcddddcdeeedefgfefecdaabbaaaaabbbbbadfebcfdfgffeeecaaaaaaabaaacabdbaaabbbcdcbbbbbbbbccb#a###abbaegcabccccdcccccdddcfihfdccdddddddddcccbaaaaaddbaa######aaabccccbcbccdddhfcfgecccbbbbcbccbccbccbcccbbbbaaaa#a##########aaaaaabccbcba#aa#aa#aaaaa#aaaaa###########aaaabbaddedaa##a#.#####", "####aaaaaa#######cffdabcbcdcbbadfbcbbaa###a#aaa#aaaaaaabaaaababaa#######a##a#########aaa##aa##aa#aaaaaaaaabdeddccddddddffeeeec#a#aaabbbaaabbbcggdcfeeeeegfdccbabccbbaaabbbcaaaaabbbcdbbbbccbbbdbaaa###abbccebabbccccbcccccddcdfhjhedddddddddccbbaaaaaabdda#######aaabbddccbbdddedccdgeeedccbbccdccbccbcbccccbbbaaaaa#########.##aaabbaabbbcbaaa###aaaaaaa#a#a#a########aaaaabbaccddeb###########", "########aaa######acddbabcbbcccabcddcaabbaaa##aaaaaabbbcaaaabbaaaaaba########aaa#aa###aaa###aa##abaaaaaacbbbcdffeddeccdffffeddbaaaa#abbaaaabaabegebdfeddeffeddddcdddcabbacbcbccbaabbacccbcdbbbcdb#aa##aabbbbbffbbccccbccccccdddedfkkidddddddcccbbaaaaabbabdb#a#####abcccdbccccddfcccdfgeedccbbbcbccccbbabbcccbbbbbbaaa############a#a#aaaacacbaaa####aaa#aa###a##a######aaabaabbbbbbdfa##########", "#################abbcbaacccccbccaacbcaaaaaaaaaaaaaaabccabbbbaaab##bb######a#aba##aa##aaaaa##a#a#acabbbacdcbcddffffdgeefefeddcb#a##aaaaabaaaaaaddfdcfdccccccdcbcbcccecbbabccdddddcbbbbccccccbbbceb#aa###aaaabbfgbacccbcccdcdddeedgjkihccddcccccbbaaaabaabaadca####aabbcccbcddccefdcdeeeedddcacbccccccbabaaabbbbbbbaaaa###########.#####aaaabacbba##aaaaaaa####a####a######abbabbcbcbcdb###a##.##.", "###########aa#####bdbaaaaccddbbdcba#bbaa##aa#aaaabbbbbbaaabaaaaba##aa.####aaa##a#aaaaaabbbaa#####abaabbbbbccdddeefeffddefdccaa####aaaaaaaaaabaeefdedeccbabbbdddbbccccabbbbbbbbcdcccbcccccccccbaaaa#a####aaaabacgcabbcccdddefffedgijfehdcccccccbbbaa#aaaaaaabcbaaaaaabbccdcdddefgecddeefedccbbbabccbbbbaaaaaabbbbaaaaaa################aaabcbabbaa#aaaaa#aaa###a####a####aaabaabcbbbcbba###aa####", "############a#####abaaaaaabddccbcdddbaaaa###aaaabaaabbbaaaabbabba###b######aa######a##aacbcbba##a##babbccccdddddeeefgfeedccdb####a#aaaaaaaaaaadefedecbabbbbbcddddbcddcaabaaaaaabbbbbaabbccdcccbbbcb#a##aa#aaabbbfdbbccddddeffffefggeedjhedcdcccbbaaaaaaaaaaabbcaaaaabbcdcccdeefgdcccdefeccbbbbbbbccbbbbaaaaaaabbbaaaaa#######aa######aaabbbcab#a#aaaaaaaa#a##a#####abaaa#abaabbbbbbdccc####aa#.#", "###aaa###a#a#a####aabaaaaaabdbbbcecdcbaaaaaaaa#aaaaaaaaaaaaabccbb###a########a#a#aaaaa##aaaabca#a##aabbccccccdcccbbbbcbcabbbb#a#a#a#aaaabaaaabbeffddeabcbbbbcccccdccbbbaaaaa#abaaaaaaaaaababbbbbcbb#a##a##a#aaaabefcbdeeddeffffffeddfbchjieccccbbbaaaaaaaaaaaacfcabbbbcdddcdehggffeeddgfecbbccbbbccbcbbaaaaaaaaabaaa######a##aaa####aaaaaaabbaa##aaaaaaa#aaaa#####aabbaaaabbbbbbccccddbaaaa####.", "####aaaaa#aaaa#aaaaaaabbaaabccbbbcddbbdcbaaaaaabaaaaaabbbbaaaaabaaa###############aaaaa##a#aaaaaaaaaaabbccccdcbbbaaaaaaaabaaa#######aaaaabbbabaacffffbbbbbbbbbbbbccccbaaaaaaaaaaaa##aaaaaaabbccca#######aa###aaaabcgfcdeeefgggggggeffcbbehkjebbcbbaa##aaaa#aaaadheabbbcdddcegfbccdfffgggedccccbbbbbabbbaaaaaaaaabaaaaaa######aaaaa#aa##aaaabaaaaaaaaaaaaa##aaa##aaa#acbaaabababbcccdecbaaaa###a#", "#######a###abaaaaaaaaaaabbdccccbbbceefebcaaaaaa#aaaaaabbbcccaabaaa###aaa#######a###aaaba##aaaaaaa#aaaabccccccbbbaaaaaaaaabaa###a###a#aaaaacbababa#eeedbbbbcddbcbccbccccaaaaaaaa#a#aaaaaaaabbbbcba########aa####aabbbghdeeegggggghggfedbbbcdikgbbbbbaa#aaaaaaaaaabheaabccddegdccccdddccfffddbbabbbcbbbbbbbbbbbaaaaaaaa########a###aaaa#a#abaaaaaaaaaaabbabaaaaaaa#a##ccaaaaaaaaaabcccbacaaabaa###", "##a#aa#####aaaaaaaaaa#aabbbabbcbbabcdeedcbbbaaaaaaabbbccdddccccbbccbdcbcca########aa####aa##a#aaa###aabbccdccbbbaaaaaabaaaaa#########aaaaabcaaabaa#dfcccbcccbcccccdccccdbbaaaaaa###aaaaaaabbbcb######aa###aaaa###abbcfheeffghhghhijifcbbbbbehjhcbbba##aaaa##aaa##afgdbbcefecdcdccddddddeedcbabbcbbabbcbbbaaaaaaaabaa######a#a#a###aaaa#aaabaaaaa#aaaaaaaaaaaaaaaa#a#bcaaaaabaaaaabbcccbcabbbaaa#", "aaaaaaaaaa#aaaaaaaaaaaa#abaa#aaaaaaaaabcbbaabbbabbbbccddddddefdbcdccdecddcaa##aab######baaaa##ab###aaaabbbcccbbaaaaaaaaaaaaaa########aaaaaacdbaabaa#dcabccdddcccccdeeddddddbaaaaaa###aaaaabbbca#a#########a###a##aaabcegefgfhhggiiihddbbccbbfegihfb###aaaaa#aaaa##adgfefecbddccccddcedccefdcbabcdcaabbbbbbbaaaaaaaaaa#a####aaa#aa###aaaabaaaa#aaaaaaa#aaa##aaabaa##abcbaaa#aaaaaaabbbbdddbbbaaaa", "aaaabbabaaaaabaaaaa#a#aaa#abaaaaabaaaaaaaaababbbbccdddeeefdfffedccbbbbcccccaaaaacb#abaab#aaba#aaa###a#aaaabccbaaaa##aaa#abaa###a##a#aa#aaaaacca#abaaadbabddddfededcbbcaaabcddcaaaaaa###aabbbcdca######a####aa##aaaaabbcdkgghhhhhgiigecabbbccffedgiida#aaaaaaa#aaaaaabfecbccccbbbabbbddddddccbaaacdcbbcbbbbbbbaaaaaaaaa##################baaaaaaaa######aa#aaaaa#a##abbbbaaaaabbaaaababbddcbbbbaa", "aaaaabcccbbbaabaaaaa#aaaaa#aaaaaaaaaaaaabaaabaaabbbcdffefgffdcccdddcccccbaabaaacbab#aa##aaabb#a#a##aaaaaaabbbcaaa###aaaa#aaa#a###aaa#abaaaaaacccbaaaabcbaaccbbdccbbbababba#abccbaaaaaaaaaabdeabaa##########aa####aaaabbceghghhihiihhgcbbbbbbegdcdedhhdd#aaaaaaaaaaaaabdccccccaaabbbbcddddfeffdbbabcbbbbbbbbbaaaaaa###a#########aa#######acbaaa#####aaaa##aaaaaaaaa#a#aaaaaaaaaabbbbaabbccddbbbba", "aaaababbbccbbcbaaaaaa#aaabba#aaaaabaaaaababbbbbaaaaaa#aabbcaaabbbbbbbbbcbaaaaaabaaaa####a##aaaa######aaaaaabbbbb#######a#aaa#a###a##a#aaa#aaacbbcbabbabcabbbcddbaaabbaaaa##aaaabbaaaaaaaabbcdbaaa###########a####aaaaabbbcfihghhhihhhdabbbbbbeeccccbdehfaa##aaaa#aaaaaabedccbaaaabcdcddcbfeffddeedccbbbbbbabbaaaaa#############aa########ababaa###aaaaa###aaaaaaaaa##abaaaaabbbbbbbbbbbbcdffabaa", "aaaaabbacbbbabaaaa#aaa#aaaacba###aaabaaaaaababaaaaaaaaaa##aaaaaaaaababbccc###aabaaaa##a##aaaaa#aa##aa#abaaaacccb##a#a#a#aaaaa####aaaa###a#aa#ababdbbbabcbabbbbbbbbbcbbaaaaaaaaaaba#a###aaacbcdaaaa#########.#####aaaaaabbccfkjgfhhifdfdaaababbffcbbbbbacgda#aaaaaaaaaaaaaddcba#aabccccdbbdeefeddfdfecbbacaaaabbaa##############aaaaa#######a#aa###aaa####aaaaaabaaaaaaaba#aaababbbcccddddgihcabb", "baaaaababccccbbaaa##aaaaaaa#cddb#####aabbbbaaaaaaaaaaa#####aaa##aa#aabadedca#abbaaaaaa####aaaa#a#aaaaa##aababcbca#aaaa#####aa###a#aa##aaaaa#a#aaacbaabbbcbabcccbbbbcbabba#aaaaaaaa#bbaaaaabbadb###################aaaaaabacbgkkihhggfedaaaaaaaceecbaaaaabffgeca#aaaaaa###acdca#aaacbbccbcbeeefffdabdfecabaaababbaa#a##########aaaaaa#######abaa##aaaa#####aaaaaaaaaaaaaabaaabaabbbbbcdegghffdabb", "bbaaaaaabbcccccbbaaaaaaabaaaabccca###aabcceebaaaaaaaaaaa#a##a#####aa#aaaddbbaaabaaaaaaaaaaaaabb##abb#aaaaaaabcbba##aaa###aaa#########a#aaaaaaaaaaaaaabbbccbaabccbcbbbbbaaaaaaaaa##aaabaaaaccbed#################.##aaa#aaaaacekljihhhdbaaaaaaabdeedbaaaaaabceffdaaaaa#####abdd##abbbbccccbcedfeddbbbbdddbbaaababaaa#################aa#aa.###aa##ba##aa###aaaaaaabaaaaabaaaaababbabbbdfhjifeecba", "bbbaaababaabbcccbaaaaaa#aaaaa#aaba##aaabcbbccbaaaaaaaaaaaaa#aa####aaaaaabccbaaa#aaaabaabaaaa#abdca#acaaaaabaabbaba#aaaaaaabba##aaaaaaaaaaaa##a#aabbbbbbbccbbbacbcbabbbbbaaa#aaa##aaaaaacbccccdbbba#a########a#.####aaaaabaaaaafklljhfcaaaaaaaa#dcgfcbbaaabccccdggcbaaaaa#aaaacdaabbbbbbbbcbddeeddccccbbcecbaaaaaaaa#a##############aaa##a####aa##b###aa#aaaaaaaaaaaaaa#aabaaaaaabaabbdggghhfbdeb", "bbabbaaaaaabbcbccbabba#aaaa##a#aaa#a#aaabbabbbaaaaaabbabaaaa#a#####aaaaaadcba###aaaaaaaaaaaaaaabbaa#abaaaabbbcbaa#aaaaaaaaaaaa#aaaaaaaaaa#aaaaaaaabbbbbbbcbababbbcbbbbaaaa###a###aaaaaaaccddcddbaaba#aaaa####a#.#.#aaaaabbaaa##djlljc#aaaaaaaa#afdfebaaaabccccddegfdbaabbbbbbabddbbbbbbbbbadceedcdcccbbabdebaaaa#aaa#############aaaaaa#ab####a##ba#####aaaaaaaaaaaaaaaaaaaaaaaaaabcdfebbbabbbcc", "ecabbaaaaababcdcccbbbcdbaaaabbaa#aaaa##aabcbbbaabaaabbaabaaa#aa###aaaaaabecbaa#a#a#aaaaaaaaaa#aaaaaaaaaaaabbcbaa###aaaaabaaaaaaa#a####aaa#aabaaaaaabbbbbbdcbbabbbcbbaaaaa####aaa#aa###aaabcccccbaabbba##a####aa#####aaaabaaaaa##ahlkfa#aaaaaaa##fbbecaaaabccbcdddceghecbbccccbbbccddbbabaa#ccedddddccbbaaacfbaa#a##a############a##aaaaaaaaa##a###ca#aa###aaaaaaaaabaaaacabbaaabbbbddea###aaaabc", "abbcbbbbaaaabbccbbbbaaaa#a#aaaabcaaaaaa#aabbbbaabaaccbbabaaaaaaaaaaaabbabdcbaaaaa###aaaaaaaa#aaaaaabbbaabbbabaa#aaaaaa#aaacbbaaa##aa##aaaaabcbaaaaabacbccccabaabaacbcbaaa####aaaaa####aaaabdccdba#abbaaa#######a######aaaaaba#####dljfa#aaaaaaa#ddaadcbccbbbbccccdccehihfddccccccbbdfaaaabbbceefedddcbbbbaaaecaaaaa##a###a####a##a##aaaaaa####a###ba#aa###aaaaaaaaabbbbacbbbbbaaacccdd#####aaaab", "babbbcccbbbaacdbccbbbaaaaa######aaaaaaaa##abbbbabaaabbaaaaaaaaaaaa##abbbdcccbaa#aa#####aa#aaaaaaaaaaabcbabbabaa##aaaaaab#accbaaaaa#aaaaaaabcddbaaaaabbbccccbaabbbbaabbbbaa###aaaaa#####a#abceeeaaa#aaaaba#######a#######aaaaaaa###.cgjgb#aaaaaaaafcaacdcdcbcbbcbbccdeefeeghfeccccbcddc#aabaaaeffeccccbbbbbaaacdcaaba##aa##a#aa#aaaa#aa###a####a####b#a##aaaaaaaaaaaaabbbbcababbbbcdddeb#a#####aa", "bacbbcddcbbbbacddccbabbaaaaaa#a##aaaaaa####aabbaaaaaaabaaaaabaaaaaaaaabbcccbbabaaaaa#a#aaaaaaaaaaaaaaaabbccbbba##aaa#aaaaaabbbaaaa#aaa##abbaabbcbaabbcccccbbbbbabbbabbbbaa#############aaabbcedbaaaaaa#aaa######a########a#aaaa##a##adhjc#aaaaaaacdb##bddcbbbbaabbccefgecceffgfcbceccedabbaaacffdccbbbbbbbbbaabccbbaaa#aa####a###aaaaa#a##bb##a###ab##a###aaaaaaaaaaabaaabbbcbcbbbcefeb#####aa#a", "aaccbcddcbbabcbcddcbbbcbaaaaaaaa#aaaabaa##a#aaaa##aaaaaaaaaaaaaa#aaaaaaaaabbccaaaaaaa#aaabbaaaaaaaaaa##aabccccbaa#aaaa#abaaaaaaaaaaaaaabbbbaabbaccbddedcbbbbbabbbcbcbbcaaaa############a#aacbcba##aaaaaa#aaa#a###########a###aaaaa####adid#aaaaa##eca##addcbbaaaabbcddefddefddgiedccccffbaaaaaefeccbbbbbbbbbaabacdbbba####aa#a##a##aaaaaaccbba###.aa#aa#ba#a#aa#aaaaabbabcbccbcbcccegc######ba#a", "abcbbccdedcbbbabdddcbabbbbbaa##aa#aaabaa######aaaaaaaaaaaaaaa#aa#######aa#aabcbbaaaaaaaaabcaaa###abaaa#aaabcbcb#aa##aa#abbaaaaaaaabbcaaaaaabbgecbbbbccbbbbbabcabbcbbbbaaaaa##############aaabaaaa#aaba#######a###########ba#aaa#aaa###aabffcaaaaaabeb####cdcbaaaaaaabbccdeffeeegihfddddffcaaaabefeccaabbbbbbbaaaabdba#aa####aaaaa###aaaacccbbba#######aaaa#aa#a##aabbbbbbbccccccccddgf#aa##a#aaa", "aabcdddddddbbbccabcdccbaaaaaa#####bbaaaa#######aaaaaaa###a#####a#########aaaacbbbaaaa#accdddba#a#aaaaaaaaabbbcbaaaaa#aaaabaaaaabba#bdaaaaabeecbbcbcbccbbbbabbbbbbbabbbbaa#aa####a########aaaaacaabaabaa#######aa########abbbbaa##aaaa###aaegfb#aa##dcaaaabddbaaa##a##aaabcdfgffgiggfffedefea#aabffccbaaabbaaabaaaaacbaaaaaaa####a##aaaaaabbabaaa##aa##aaaaa######aabcbaabbccccbbddedeeaaaaa#baaa", "aabbdeedeedddaccbbbcbcccbaaaaaabbaccaaa#a#aa###aa#aaaa#########aa#a#####a##babbbbbcbbcfdccccbbaabaaaaabaabbbccbbaaaaaaaaaabaaaaaaaaacfcaaabcbbaaababbcaabbbabbbbbaaacbabaaa####a##.########a#abd##baaaaaa##.###aa#######abbadb#a#########aaeiib####bca#aabadcba########aabccdgghgfeddddeedegdaaabdedbbaaabbabbaaaaa#cbaaaaaaaa#a##a#aaa#abbbbaaa#aa##aaaaaaa#####aaabaabbbbccbbbcdecef######acaa", "baabcccddedddbacccbccdcbbbbaa####aa##aaa###a###aaaa#a#####aaaa#a#aaa###aaaaabbbbbabcgjfdccbbbaaaaaaaaaaaabbacccba###aaaaaaab##aaaabbbdfdbaabdecbbbabaabbbbbbbbbbbbababbaaaaaa######.########a#acdb#aaaaaaa######aa######abbccb####aa######afiifa###bca#aaaabcbba#a######aaabcdeefcbcedccccceffaaaaacdbaaabbbaabbabaaabcbbaaaaaaaaa##a#a##abbaaaa#ba##aaa###a####aaaaaaaaaaccbbbcccdeff.######aaa", "a#aabbbcdeddcccbcccccdcbbabaaaa##a###aa#a#a#####aa##a###a##aaa####aa#a#a#aaabbaabbbbbffdccbbbabbaaaabbbbbabcbbbaaa##aaaaaaaaa###aabcbbcdfdaacebbbbbaaabbbbbbbbbaaaaabbabaaaa###aa############abcdcaaaabbaaa######aa#####abbbdc#############adghf###cdaa##aaaabbaa##.##.##aaabcdecedbbcdecbbbccebaabacdaaaaabbbbbbbaaaaabdcbaaabaaaaa##aa#aaabaaa#bcaaaaaa###aa#a#a#aaaaaaaaababccdceec##########", "###bbbbcdeddddcccccbccbccbbbaaa#####.#a##aa######a##aaaa###aaaaa##a###aaaaaabbbbbbbccddcdcbbbbbcdbbbadecccccbcb###a###aaaabaaaa###accbbccfhcacbbbabbabbbbbbbbaaabbbaabbbaa####aa#########.####aabcbaaaabbaaaa#####a#####aabacfb###############dhhc.ddb###a###bbca#.#....##aaabcdccecbbccedbbcccedbabbdcbaaaaaaaabaaabaaaacccaabaaaaaaaaaaa#abaaabbcaaaaaa###########aaaaaaababbbceeda.#####a###a", "#baaabbcdeddddddddbbcccbcbbbbaaaa################aaababba####aaaaaa###aaaaaaabbaabbdecbccccccbbbccccbcbbbcbbddeeca###aaaabccaaaaaa##abbbbcdedbbabbaaaaabbbbbbbbaaaaaaabbaa#######aaa##########aabbbaaabbaabaaa########aaaaaabdfb####aa#########cghhceba###a##aabaa#.....###aaabcdceebbbbbddcbccbcdcabcedbbaaaaaaaabaaaaaa#cddbbbaaaaaaaaaaaaaaaaccbaaaaaba#a#a######a##a#aaaaaaccdeed####aa####a", "aaabaabccceeddeedcabbbcbbcbbbbbbaaaaa#########a##aaaaabbcbaa#aa#aaaaa#aaaaaaaaaaabbcddcbbbbbbbbbbbbbabbbbbbaabbdgfba#aaaaabbaaa##aaaaaabbbcceedaaaaabbabbbabbbbbbaaaaaabba#######aba#########a##abbcaabcbaabbba########aabbaabddca#aaaaa#########adjhaaa#aa#####aaa#...####aaabbcccfdabbbbbddcccbbccacffccbaaaaaaaaababaaa##bccccbabaaaaaa#aaaaabdcaabbaaaaa#########a#a#aaa###bcddhga####aa####", "##aabbbbcdffeddeebdcbbbbbcbbcbcbaaaaaa##.##aa######aabbbbaaaa#aaaaaaa##aaabb#aaaaacddfbcbabbccbccbbbaabbaaba#abadfdbbaaaabcaaaaaaaaabbbababbceedaaaabbabbbbbbbbbbaaaaaaaaa##.#####aa#########aaa#aacdabbbaaaaaaaa#######bbbbccdcddbaabbaaa####aa###bhgea#######.##aaa#####aaaababbbcebababbabdeccbbbceffeecbaaaaaaaaabaaaaaaa#bcccbbbbaaaaaaababbbbbaaaabaaa#######a##a#aa#aaaaabddhg###########", "#a#aaabcdddffdddeeedbbbbbcbbbbcbbbaabaaa#a##a##aacaaaaaaaaaa#a##aaaaacdaaaabaaaa#accdeaaaaabbbbccbbbbaaaaabbbababcdddcccbbaaaa#aaaabbbaaaaaabdeeeaaaaaababbbbbbaaaaaaaaaaaa###a####ba####a####aaaaaabecaa######aaa#####a#ababccccbcbabaaaaaaa###a####dijdb########a#a###aa##a#abbbbddbaaaaabbabdddcfeffffeccbbaaaaa#aaaaaaaaaa#abccbcabaaaaaaaabbaaababaaaaa#aaaa###aaa#aaaaaaaaabchga#####aaa##", "#a#a###abccdddefdeeecbbbbbbaabbbbbbbbba#########abaa#aaaaaaa##a#aaaaaccbaaabbabbcbbccfbcaaaababbbbbaaaaaaaaaaaabbbabbabaabaaa#aaaaaabbabaaa#abcdfea#aaaabbbbaaaaaaaaaaaaaaaa#######bba##########aaaabcedbb#######aa#####a##abdcbbccbaaaaaa#aaaaa#aa###bgjjga#######aba#aadba##aabbbccbaaaaabbaaabedffeffffdcbbaaaaaaaaaaaaaaaa#aaaccbbbaaaaaaaaaaaababbbaaaa#aaa#####aaaaaaaaaaabbbghc#####aaaaa", "a##a#aa#aabccbdfgeefeccababbbaabaabbbaa#a##.######aaaaaaabba##aa##abbbcbcbbccacbbdedgheccbbabbaaaaaaaaabbaaaaaaaaaaaaaaaaaacbbba#ababbbbaaaaaaabdeeca#aabcbaaaaaaaa#aaabaaaaa####.##ba###########aaabbceeba########a#########cbbbabbbaaa#aa#aaaaaaaaa###djkjb#b#..#abbcaaabcba##aaabbcaaa#aaaaabaacfffffedffccbaaaaaaaaaaaaaaaaaaaabcbbaaaaaa##aaaaabaaabaa#aaaaaaa#a#a#a#aaaabbbbccgc######aaa#", "##aaaaaa##aaccbaeihfgggcbabbbaaaaacbbceceeca########aaaaaabaaaaaaaabbbdcccdebbcbbabacedecbbbabaa#aaaaaabbbbaaaaaaaaaa#aaaaa#abbbbacbbbbbbaaaaaaaccddbbbbbbbaaaaaaaaa##aaa#a##a#####aa#############aaabbceeea########a########aaaaaaaabbaa###a###aaa######agjkhgfb.#aabddaaaaaaa###aabdb##b###aaaaa#cffffeeeeeccbaaaaa#aaaaaaaaaaaaaabcbaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaabbbbbdfeba####aaa#", "#a#aaaaa###aacca#cjjhhjebcbaa##a##acegebdcbdb#.#cbcaaaaaaaaaaaaaaaaaabbcdgiecbbaaabbbcbcdcbbbbbaaaa#aabaabcbaaaaa#aa#aa#aaa###aaaaaa####a###aaaabcddbcbbbaaaaaaa#aaaa#aaaaa##a#####baa#.#######a##aabbcdddffa##.####aa##.####aaaaaaaaaabaaa###########a####chhiihc..ceffbabaaabaaaaabccaacc###aaccbbegfffededdccbaa#a#aaaaaaaaaaaaaaaabcbbaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaabcccefeaaa###aa#a", "aaa#abaaaa##aaba##eiiikhccbddefeeffgecccdccdeffefddc#aaaba#aaabaabbaaaabcdhfbbbbaaacdecbbaabbbcbbbbaaaabbbbbbaaaaaa#######a###aaa#aaaaa######aaaaaccbcbaaaaaaa####aa##aaaaa#####a##############a##aaabcccccdfb##.#####a######aaa#aaaaaaaaaaa##########aaa##.#aejjifb#cffacbbbaaa#acbbcc##ddda##cddeefgfffeedddcabbaa#aaaaaaaaaaaaaaaaaaacbbaaaaaaabbabbbcaabaaaabbabbbbabbbbbbbbbbbdfc####a##aa#", "#aaa#a#a##a####b###dgkkjgccfiifdfdeeccddddcdcccccbca#aa##aa#aaaaabbbaababeggdbaaaaadfcbbbbbbcccbabcbaaaaabcabbbcbaaaaaa##########a#a########aa##a#accbbaaa#########aa###aaaa###aaa####.#########b##aabcbbcddfb###############aaaa###abbaaba#aaa#########aa#####djjjifbcebccdcba#bbacbcb##addccdcdeeefgfffeecbccbbbaaaaaaaa#aaaaaaaaaaaaaabbaaaaaaabaabbbbbaabababbbbbbbbbccccbbbbcced####a###aa#", "a##aaaaaaaaa#a#ba..#agkgfecfikgddcccdcccbcccbcbcbbdba##bccaaa#bbccccbaabbefffcaaaabdfbbbbbbbbccaaabaaaaaaabcbbbabbbbaaaa#######aaa############aa###abbaaa####a############a####a#######.#####a##aaa####aaaacfa#######..######aaaa###a#cdcbbbabcbaa#aab#########.chiiihfcddeghhgdccdabdaa#addcddceefeeffeeeedbbcccbbaaaaa#aaaaaaaaaaaaaaaaabbbbaaaaaaabaabbaaaababbbbbbbcccdccdcbbceea####aa###aa", "a####aaaabaaabbab#.#aaeecdhfijfcccddcccbbbbccbbbccaaa###.a#abccccbcbcbbbbbff#a###abcebabbbbccbcaabbaaaaabccbbbbbbbbbbbaaa#aa####aa##############aaaa#ababaa##############a#a######a####################aabbcacaaab#####.#.##abbaa###aaabcacbcaaaaaaa#aa#########.bgihiifcdgijjjiidaaabe#a#bdcbccccddddddecdecbbbccbbaaaaa##aabbaaaaaaaaaaabbbbbabbbaaaabbbbbaaabbbbbbbccdddedddefeffa####a#####a", "#######aaaaaaaaaa#.#abcdaahkkjgbbcccbbbbbcbbcbbbbaaaa#a######abddedccccbbacffcbb##acccacdcabbdccdbabaaaa#abbbbbaabbbbcba###a############.##.###########ababaa##################a##a###.################aaabcbcdbbbaa##.#.#.#aabaa###abcdcaabaa####aa#aabbb###a###.#bgjhacegijjjjjjhedfgea##cbbbccbbbcccccdcccbbbccaabaaaaaaaaaaaaaaaaaaaaaabcbabaaabaaabbbbbaababbbbbbccddddedffceedb######aa###", "aaa#a####a##aaa##a.##acda#cejjfdbbbbbabcbaabbcbbaa#aaa##a#a###baecbdfedddefhhgefea#cedbafecbbcbecbbccbbbbabbbbbbbccabbcdcaa####################.#######aaaaca##########################.########a######aaaaccccbbca#a########aaaa####bedcaabaa##aaaabaaabc########..#figefhikjihhhhiijiihd##bbcdbcccbcccddebcbbbbcdbaaaaaaaaaaaaaaaa#aaaaaabbcbbbbbbbabbbbbbbabbbbbccddedeedffa###a#####aaaaaaa#", "###aa############a#.##bccbbbbehhaabbbaaabbabbcbaba#aaa#######becdda#fgecddeehghegdabdecaabedbcaacbbddbbbbbbcbbbbbbdbaaccccba#########a################aaaaabcaba###############################a#####.###aaaabccbcb##a######aab##a###accbca#b#####aaaaaaaaa###.####...diihiiihfgeffeffhijid##ddcdccccccddddccbbaabddcaaaaaaabaaaaaaaaaaaaaaabbcbbabbababbbbbbbabbcbccdddedefc.##########aa#aaaa#", "#aaaaa#aaa##a######.#abbccaaaabgfb#ababa#aaaacbaaaaabbbab####edeefeccgedcddehhfacebadecaaaabcccbbbbcbabbbbbcbbcbccccccabccdb#######abb###a##############aaaacbccba##########a######.########a###a#########aabcceccb###a#####aaaa##aaaaacbb##ac######aaaaa##aaa#######..diihffffffdeddddefiigaaeddddbbcdddccdccbaaabcedbbbaababaaaaaaaaaaaaaaaabdcbaabbababbbbbbbbbbbbcceeegc.#############aaaaaa", "aabcbbaaaaaaaa########bbcdbaaaaaffa#aaaaa#aaabbaaaabcdeddabaefcdddefcgfddddeghcccffddbaaabbbbbccbccdbcbabbbbbbcbbbbbdcabbbddb########bca#a#######a##a###aaaaaaabdbaa#aaa####aca##...###aa####a##a########aaabbbdecc##aaa############aa#abba##a#########aa#aaaaa########.bgiedcccdccccccccdhigdeeeeedcdddccbcebaaaaaaceebbbbbbbababaaaaaaaaaaaabcccccfedcbbbbbbbbbbbbabcfffe############a###aaaaa", "a#aaedbbbbaaa#a#######abddca#aaaadcaa##aa####aabababbbccccfggcbcccccfgeccccdddffedfecddcbbbbccbbccdcddbbbbbbcbbbaabbcc#abaacba########aa##..#######aa####aaaaa###bbaaa#aaaaa#cc###a.####aa##aaa#########aaabbbbadcdaaabba##########a#aa#bbaa##a#######a#aa#aaaaaa#######.ageccbbbbbbbbbbbcbehigffeedddddccbcccbbaaa#accdcbbbbbbaaaaaaaaaaaaaabbcbccdbaadfdcbbbbbbbcbcefccba#################aaa#", "#aaacbaabbcbbbaa#######abcca##aaabbcba########abbaaabaabccdcbabbbccbcedccccccccccccedbbcdbbbccbcbbcbcbbbbbbbbbbabbbbcccbbaaaaaa##a####a#aa####.#####aa##a#aaaaa##abbcaaaabbbabcaaa#.#.###aa#a##a########aaabccabbddbaabaa####.##.aaaaaa##bba##############aaaa##a########.#bddbbbbbbbbbaaaaabfhhgfeedddccbccbdabaaabbbccddcbbbbbbaaaaaaaaaaabacbbcceb#a#babcbbbbbbcbce##.####################aa#", "aaaaaa#aaaababba#######abcccb#a#aaacddb######aaaaa#aaaaabbbbbbbcbbbbcdcbcbccbccccddbababcccccccccbbbbaaabbbbccbdcbbbbabcbbaa######aa#aaa############aa#####aaaaa#acbabaa#baabbcb#a##.#####baaa#########aaaabcdcccccbaaaa##########abaaa###aa##############a####aaa########.##dcbbbbbbbaaaaaaaabghgffedccccccbbcabbaaabbcbdedbbbbbbaaaaaaaaaabaaabccdecbcabbbcbbbbbcbeea###aa####################", "aaaaaaaaaaaaaa##########acceeba###bbbcda#######a####aaaaabbbabbabbbbbcccccccccbcbbcdcbaabbcbcccccbbbbbcabbbbddegebbbbbbbcaaaaa#########a######aba#####aa#####abaaaabcbb#aa##abaaba#####a##aaaaa######aaaaaaacccccbccaa##a#######aa#aabaa##aaa####aa########a#aaaaaa###########addcbbbaaaaaaaaaa#fieeeddcccbbbbbaaabaabbaaabdedcccbaaaabaaaaabbaabbbcdebaaccbbdddcbbcdc#aaaa###########.########b", "aaaaa#aaa#aa#############abcdfdaaaabcdf###aaaa##a#####aaaaabbccabbaaaabbbcccccbcbabbccbbbbbbbbbbbccbbcccbbbcdcdedecabbbbaaaaaaa########abb##aa#aaabaa#aba###a#aa#aabcccbabb###aa#aaa######aa##aa######aaaaaaaccccdaba###########aaa#aaba#aaaa#aa##a########aca##aaa######a######cffaaaaaaaaaaaaa#ehfeeedcbbbbbbcbaabbbbbbbaadeeefedcbaabbabbccbabbdcbcaabdcccccceedffb##aa####################a#", "aaaaa###aaaaaa#####.####aabccfgbaabbcfeda##aaabaaaaaa#aaaaaaaccbccbaaabcccbbccbbbbbbcbbbbbbbcbbbbbcabcccbababccdeccbabbbbaaaaa#aa########aaaaaaaabedaa##a#aaabaaaaabaccbaaaca###aaaaaa#####a###aa###a##aaa#aaaccbbabaa############aaaaaaaaaaaaa#########a##acdaabaaaa############acecaaaaaaaaaaaaafhffeddcbbabbcbbabbbbbbbbaabbdeddfeddbabbbdcabbabbababbbcbcbccddffcdaaaa##a###################", "aa#a#####aa#aaaa#########abcdcfeaaacbdccfcbbbdddbbbbbaaaaa#aaaabcbaabbbcccbbbcbbcccccccccbbcbcccbbbbbcccbbabbacddedcaabbabaaaaa##aa########cb##aa#cfdaa##aaababbbbaaaabbbbaabaaa#abaaa#####a#bbaaaa##a##aaaaaabbccdaaaaa#####bb#####aa##aaaaaaaa############aabbbbaaaa##aa##########deaaa###aaaaabcgiggddccccccccabbbbbabbaba#aabcaacccccbbcdbaacbbabbbbabcbcdddd####abaa#a##a#a#aa############a", "aaa#####aa#a#aaaaaaa######abccdfa#bbcddbcccdcdaaccdecbbbbbbbaabccbaaabbcccbbbccbccccddccccccddccbbbbbbcccbbbbbcccdddbabbbabaaaa########.####bba##a#aca###aaaaaaaaaaaaaabbbaabaabaaabba#######ababba.##aaaaaaaaabcdcb#aaaa#####a##########aaaaaa#a####aaaa##.##abbba#aab#aba#aa#a#####cgeaa####aa#aabfiigdccccbccccbbbbaabbbbaaaaaabccbbccccdabcbccaaaaabbbccdebdbaaaaaaaaa#a######aaaaa#########", "#aa#a###aaa####aa##a#####aabbbbeb#abbceeba#a####aaaba##cdbbbcccdccbbbbbbccbbabcbbbcbcddccccccddddddccdcabbbcbccbbbddcbbbbbbbaaaa#########.####aaa####a#a#aaaaaaaaaaaaaabbbbaaabaaaaaaba####a#.a##ab##.a##a##aaaabbddb##aa#####aa######.##aaaaaa#aa####a#aaa###abbb###acaacaaaa##a#####bff###a##aaa#aacghhfccbcbcbbcbbbbbbbcaaaabababbdccccddbbccccaaaaaabbccee##aaaabbacaaaa######aaa#aaaaaaa###", "#aaa##########aaaaa########bbbbbea#babcea#a######aaa####bccddcddedcccccccccbcbccbbbcbcddddcccbbbcccdefedcbaacbbcbbbbbbbbababaaaa############.###aa#a##aaa#aaaaaacbba##abbcbaaa#aaa#aa#########a#######a##aa#a#abbcbcc#a############aa####aaaaaaaaaa#######aa###aabaa##bbaaaa#a##aa######dea#####aaaaaa#behhdccbccacbbbbbbbcbbbaabbabbbcdcccdddbbbba#aaaaabbddb#######bcaaaaaa######aaaabbbaaaaaa", "aa#aa##########aaa########aabbbbbedbaabddcb#aaaa#aaaa####cccaacdeeggecccccccbbabbbbbbbbccddcccbbbbcbcddeedcbaaabbabbbbcbbbabaaaa###########.#####aba#######aaaaaabbba#aabbbbaa###aa##a#####.#a#.#.####aa##aa#aaabccbca#aa#..########a######aaa##aaa#########aaa#aaaaaabcaaaa##a##a###a#a#bdb#aaaaaaaaaaabcfhfccccabbcbbbbcbcbbbaabaabbabcddcdcccbba##a#a#abddb########aaaaa#aaa####aaaaaaaabbaaa", "aaa#aa##########aa#a#a#######abbabgebaabacca#ba#aaabaa#########a##bdeddeedddcbbbbbbbcbabacdddcccccbbbcdcdcdcabbbbbbababbbccbabaa###############aaabb####aa##aaaaabbbaaaa#abbbaa###aaaa###a###a##....###a##aa##aaabbbca##aa#.#######aaa##aa######aaa#########abaabaaaaaacbaaaaaa##a###a##a#afb##a##aabbbaaaaeggecebcbbbabbbcbbabaabbbbbbabbdddccccccabaaaaaaccc#####a#aaaa#a#####aaaaaaabbbaaabaa", "aaaaa############aa#a########.#abbcffcabbceccaaaaaaaaa###a###aa#######aaeebccccccbbbbcbbccbdddccccccbbbccbbbbbbbcbbabbbbbccbbbbaaa########.#aaa#a##aba#aa##aaabbbabbbaaa###abaaa#########aa##a############aa###aabcc#aa#aaa#######.##aaba#aaaaaa##aaaaa######baaaaaaa#aaaaaaaaaa###aaaaaa###ebaaaaaaaaaaaaabbfhgedbbbbbcbbbbbbabbbbbbbabbbbddecbcbbbbbbcbbbceaa#####aabca#a#a#a##a#aaaaaabbbbbaa", "aaaaaaa####aaaa#aa###########..#aabdddbbcccccaaaaaaaaaa##a##aaa###aa#####eddedddcddccbccbccccbbcbbcedbbcccccbbbbbbbbababbbcbbcbaaaaa############a#a#aa#aaaaabbaabaabaaa#aaa#abaaa#######aaaa#a###########.#aab##aacc#aa####a######..##aa#aaabbaaa##aaaaaaabbaabaccbaa###aaaaaaaaaa##aaaaa##a#ccbaaaaaa###aaaadgggfeababbcbcbcbbaabbbbaaabbbccddbcbbbbbcdccccca#a#a###aaaaaaaaaaaa#aaaaaaababccba", "aaabaaa#a#######a#aaa####aa###.###bcdcbcbabddbaacbbababaa#a##aaaa#aa#aacdccbddddddbbbbbaa#aaa######bfggfdcccbabbbbabaaabcbccabbaaaa#########a#aaaaa#######aabaaabbabbaa####aaaabaaa##aa##aaa#b####.#########abb#aaee##a###.##.##.###..####abccccbaaaaaaaaabcdaabbccba##a#aa#aaaaa#a#aa#aaaaaaaabebaaaaa#a##aabbfghhgedaaabbbccababcccbbbaabccbcccbbcbbcdcdcaaa########aaaaaaaaaaa#aaaaaaababbccb", "abaaaaaaaaaa######aaa########aa####bbccbbaabceaa#cbbbbbba#a##aaaa#aa###debacb#aacabaa##aa###########.#afhgeecbccbbbabaacbcccbbbbbbaa#a#########aa#aaaa####aaaaaabbbbbbbaa###aaabbba###a##aaa###.#######ba##aaadbaabeaa##aa#..###.##########abaaabdbaaababababbaabddbaa##aaaaaaaaaaa#aaaaaaaaaaa#aecaaaaa#aa#aaabdghhhfecccbcbbabbacccccbbbbbcbbbbbcbabbdcbcba########aaabaaaa##a###aaaaaaaaaabbb", "baaabbaaaaaaaaaaaa###########aaa####acccbaaaabcbcabbbbbbba#####aaaba#acbcaa#aaaa#abaa############.#####.dhihgeefccbbbbaabccbbbbbbaaaa##########a#aa#aa####aaa#aabaabcbbaa####a#aaaa###a#aaa################abbeebbbdd##a#######..####.######aaaaabcbbbbbbbbbbb#abcccbaaa#aaa#aaaaaa###aaabaaaaaaa#bcbaaaaaaaaaaaabehhhfedaaabaaabbccccbabbbbccbbabccbbbdcbbaaa#######a#aabaaaaa#aabaaaaaaaaaaabb", "bbaaaaaaaaaaaaaaaaaaa#########a#a####bbcbaaaaabeecbbaaabbaba###a#aaa##cedb#aaabaaaaa##a#########.##.###a#bfgedeffdccccbaaacdccccbbaa###########aaa######aaba###aabaabbbaaaa#####aa#a##abbaa####.##.####aaa#acbddddfega#a#######.######.##a#aaaa#aaaaaaaabccddebaba#bcba##aaaaaaaaab#aaaaabbbcaabaaaaccaaaaaaaabaabbehhfgebaaaaaaacdcccaabbcbbcbbbbbcdcbbcaaa#a######aa#abbaaaaaa#abbaaaaa#aaaaab", "bbbaaaaabbbaaabaa#aaaa###.#######a####abb#aa#a#cfecaabbaaaba#######aaa#bddcdaaabaaaa#a#aa######.########ba.a####bfddcccbbacdccccccaa############aaa######adb###aaaaaaabaaaaaa###aaaa##abaaa#####..#####aaaaabbcdeedfgd#aa########.#######a##aa#aaaa#a###a#abeedecc##aaba#aaaaaaaa#bbaaaaabbbbaaaaaaaaaccbaabaaababbadgggfdb#aaaaaabcbbbbbbccccdcaabbcdcccbaaa#######aaaaaaaa##aa###aaaaaaaaaaaba", "bbbbaa#aaaabaaaaaaaaaba#a######.#######abbbca##acdedcaabca#a#.###a######bddcfcaabaaa##a##a#####...##aa####a####a#abbccddcbbddedccccbaa####a######aaa#####acb###aaaaaaaaaaaaaa###########aaa####.####a##aaaaacdeceeeedc##aa########..#########aaaaa##a###aaaaaabcdedcb##aa#aaaaaaaaacbaaaaabbbbaaaaaaaaadfdaabaaaabbbbcdggfebaaaaaaacccbbbbbbccdcccbbbdcecba#####a####abbaaa#######a#aaabbaabaabb", "bbaacbabaabaaaabbaaabbaabb#.####.#######abbcba#aabecdbaccaa#a#.##aa##a###acacecbaaaaaa##########..######..abaa#aa####aceeddceggeddccbaa##########a#aaaa##aaa##a##aaaaaaaaaaaaa#########aaa####a#aaa####aaaabbdffffgebca#ab#######.#..#aa######aa###aa####aaaa#baabbdcc##b##aaaaaaaaabaaaaaabbbbaaaaaaaabcegcabaababbbbabgfgfdaaaaaabbabbbabbbcdddbcbccccdbaaa#a##a###aaaaaaa#########abbbbccbaab", "baaabbaaababaabbaaaaaaaaaaa##############abbaa##aadd##abbaaaa#.##aaa##a####aabcbaaa#aaa###a######..####.#..cdcbbbaa###abdcdedfghffddcbba###########aaaaaaaaaaaaaaaaaaaaaaa#aaaa########a#aaa#####aaa#a#aabbccddghhhfcca#aa##########...##########aa#aa###aaa##aaaa#a#bb####aaaaba#a#aaaaaaaabbcbbaaabaaabbefdabaabbbbbbbbfgggfdcaaaaabbbbbbbccdbdbcbcccbcbba##aaaaaa###aa#aaaa########bbabbbbaaa", "aa#a#aaaaaaaaaaaaaaaaaabbabaa#######.#.####aaaaaaabdeb#aababaa####aaa#abba#####aaaaa###a##bdba##a######....acdbabbaaaa#####cddaeggffedcba##########aaaa###aaa#abaaaababaaaaaaaaa##a###abaaaa###.#bbaaaaabdcddeefhhifdda#bb#aa##aa######..########ab##a###a##a#aaaa#abaabaaa#aaaaaaaaaaaa#aaaababbbbaaaaaaabcffbbbabaabbbaacefggdba#aabbbbcbacddccecbbbcccbba##aaaaaaaaaaa#a##a#a#######aaaabaa#a", "ba###aaaaa#cbaaaaa#abababa#a################aabbbbbbbea#aaabbaa#####a##adc##aaaaaaba##a####a########.#####...aca###########.####cffdcdecaaa#######aaabaa##aaaaaaa#aaabbbaaaaaabaaaba##babba######accbbbbbfccdeegdgfggeb#dc#####aaa#####...#######aaaa#aa##a#aaabaaa#bbaaaaa##aaaaaaaaaaaaaaabaabbbbbaaaaababbegdbbaaababbaabffffecb#aabbbbcbbcdddecbaabcbaaba#aaaaaaaaaaaaa###a########a#abbaabc", "a#######a###aa#abaaaabbccba###.##############abcbcbbcbea#aaaaaaa#######.##ba#a#aa#a#a#a##a####.###########..###ba##############a#aeedbadfcdddcbb##aaaaaaa#aa#aaaa#aaccbbbaabbbbbabcbbcdccb######abcdbddeeefddddb#afdcfebdca#####aaa######.#####aaca####abaa#aa#abcb#accaaaa##aa#aabbaaaaaaaaaaaabbbaaaaaaabbbbbgdbaaabbbbaaaccffgfdcaabbccccccddddfcbaaaaaaaaa#aaabbaaaaaa#a#aab####aa##aaa#bcc#", "aa###########aa#aaaaabbabbaaaa##..###########abdcccccbcdcaaaaaa#a##########aabb#abaa##########...#.########.######################.bfdaaccefddddbaaaaaaaaaaaaaa#aaababcccbbbbbccbbcddcabca####aaacdcabeggfdda.##.#cc#aefdbaaa###aaa###.##.####aaaaa#a###abd##a###ababbdc#aa#aaaaaaaabaaaaaaaaaaabbcbbaaaaaaabbbbgfbaaabbbbaabbbcefffddbabbcdccccedcabaaaaaaaaaaaaaaaaaaaaaaaaaaa#####aaa#aaaaaaa", "aaaa##########a######.#a#abbaa##########a####abdedcccccccba##########a######aaaa#abaaaaa#######..################aa#aa###############ddabedcgededbbbaabbabaaaaaaaaaaabbccccccbccdddba###abacbbcccba####aaaaaaaa##.###acfcaaa##aa#a############aa#####a#a##aea#aaa#aabbcda##aaa#aa#aaaaaaabaaaaaaababcbaaaaaaaabbbgfbabbbabaabcdcbdefffdbbcccccccdda#aaaaaaa##abaabbaaaaaaaabbbaaaa####a##aaaabaa", "aaaaabaa#######a###a##.###abbaa###############acdeccbbccdga##########a######.#aabaaaaaaaaa#a############.###aa###aaaaa###############.cdbbdefhhhfdccccbbbaaabaaaabbbbbccccdddcdccdb#####bbcbcddba####aa####a#a#####.##aedaaaa###aaa#######..#########a###a#bbbbbaaabbbbaba#aaaaaaa#aa#aaaabbaaababbabccbaaaabaabbbggdabbbbcbbbddcbcbdffdcaccccacccd#aaaaaaaaaa#abbbaaaaaaaabbabbabaa#aa####aabaa", "aaaa#aaa##########a###.##aaaaaaa####.##aa#####abccdcaabccffa##########a###aa####aabaaabaa#aaa####a######..###a#####aaa############aa###bdddeeddfgfeeeddcabaaabbbbbbbbbbcdddddeeeecaa####abbaaaa#######a#a########.###aaadaaaa#####aa########.#..##.##a######aaabbba#bbca##a###aaaaaaaaaaaabbaaaabbbaabddcaaaaaaaaabfgdaaabbbabdacdbcbdfffdbbdccbc#cbaa##aaaaaaa#aaaaaababaaaa#abbaaaaa#aaaaaaa#a", "###a#aaaaaaa######accbaaab#####aaaa####a#######accccabacccfe##.############aa####aa###aaa#aa####.#########.##########a############abca##bfcfabbbcaafffffdbbbbbbbbbabbcccdeeedefcaaaaaa##aaaaaaaa################a#.###abbcaa#aa#aaaaa#######....########aa####a#abba#bbbbaaaaaaaaaaaaaaaaaaabcabbbbbbabeedaaaaaaaaacfgecaabbabbacdbabcffffccccdda##aaaaaaaaababaaaaaaabaaaaaaaaaabaabaa##abb####", "a########aaa#######cddebba########aaaaaa#######abccccbabcdefea#.########aaaaabb##aaa#####aaa##.....#.##.##############a#####.#####aabcbaabfc######.afggggcbbbcbcccbbbccceeeeffhgccbaaa#aaabbaa#a######aaa########a#.##aacdba##ab#aabb##.#.####...########aa#####aaaaaaaabbaaaaaaaaaaaaaaaaaaccbabbbbbbabefdaaaaaaaaabeffabaaababdedabbcfffecccddaaaaaaaaababaaaa#aaaabbbaaaaaaaabbaaa#aa##ba###b", "#####aa#####aaaabbaaaacdb.#a#########aaa########abcbbbbbcdeeeefc.######aaaabaacbaaaaa##########..#..#....##############a###########abbbba#bd#a######aabbcfedccdddccccdddeeeeefgiedeebaaaaaabaaaa#aaaaa#aaaa###########aabcca##aabaaabba#....#....##.###.#aaa#######a#abaabbaaaaaaaaaaaaaaaaaaddbbbabaabbbddaaaaaaaa##adfecbbbbacddedbbccdffdccddaaa#aaa#bbaabca##a#aaabbaaaaaaaaaaaabb#aaaa###a#", "####aaba######aa#abbaaaba###aa#############.####aabcabcbbdegfebc.########abbbaaaaaaaaaa#########.....#.#.######.#######aa#####.#.##aaabbbbbc##a#######..##ehfeeeedddcedeffeeeeehf#abcecccbabbbbbaabaaaaaaaa########a###aacdba#aaaabaaaaa#..##..##.#..####aaa##a####aa#aaaabaaaaaaaaaaa#aaaaaabeeccbababbbbbaaaaaaaaaaaabcffbbbbcdccdcbbbcdfgfedcabaaaa##bbababa#####abbaaaaaaaaaaaaaaaa#aaaaaa##", "#a###aabaaaa###ba###ab##ba###a#############..###aaabcaabbdedefgb####aaa###aaaaaaaaabaaaa###########...#.############################aabbbadcaaa#####.######bfhhgggffffffffeeeefhhcaa##acfffeedddbaabaaaabaa########a####abebaaaa#a#a#aa############.###..#aa##a###aba##aaaaba#aaaaaaaaaaaaaaaaccdcdcbbbbabbbaaaaaaaaaaaaacfeaabbbbccdabccbdfffed#aaaaabaaaaaa#aa###aaaaabaaaaaaaaaaaaaaaaaaaaa##", "###aaa#aaaa#a##.a##a#aba#aa###########.#.#....####abcbbbbccdffegb...##aa###abaaaaaaaa#a#aa#######aaa###.####.#####################a##abbcfda#aaa###########.#acfhihhhijiiiihgfhhgcaaaa#..acccddccecccbaaabcb#######aa###abcdbaaaaa#aaa#aa##########.##########aa##aaa#aaaa########aaaaaabaaabbaaababaacbbabbbaaaaaabaaaaa#cefdabbbabbcbbbccdfggeb#aaaaaa###aaa#a###aabbaaaaaaaaa#aaaaaaaaaaaaaa#", "#aaaaaaaaaa##aaaaaaaa#aaaaaa##.###aa###.###...####aabdbbabbcfeced.#########aaaba#aaaaaa##ca#######aaaa######.########.########a#####aaabdhgfeaaaa#############.#aaba#addfghiiiiheb###aaaa###.####bdbcdcdcbbca##a##a##a##aabbdbaa####aaaaaaa#############a#.##aaaaaaaaa##aaa##a#a#acbaabbabbbaaaaaaaabbbbbaabbbaaaabaaaaa#a#bfgebaaababbbbbbbcggfeaaaaaaaaaaaaaaaa####aabaaaba###aaaabaaaaaaaaaaa", "a##ba#abaaaaaaaa####aa###bbaa##.#######b#####.#.###aacbbaabcdeccc##.########aabbba#a##aaa#bba######aaaaa#################.######aa##aabbfhhihdabaa##############aa######.##a#bgfb###aaaaaa########cbacccdfeecaa###aa##a#aaabcdbab##ababaaaaa##########aaa#####aaaaaaaa#a#aaba##aabfdaa#aaaaabbbabaaababdbbbbbbbbbbbbbaaaaaaa#dffcbaabbbbbbbbbcefgdba#abaaaaaaaaa#aa##abbbaaacba##a###aaaaaa##aaa", "aaaaaaaaaaaaaaaaaa#####a##aaaa########ab##.####..###aadccbbacdcaa###.######aabaaabb#aaaa###############aa#####a#####.##############aabbbehhhfcaaaa#####.########aaaa##aaa##a#.#caa####aa##########cdbbbbbcedefdcbbaa##aaaababbdbaaaaaaaaa#aba#########aa######aaaaaa#a#aa##aaa##addbbaaaaa#aaaaabaaaaaaccccdcbbabbbcbaabaaaaa#cfgdbabbbbabbbbbcfgedda#aaaaaaaaaab#a##aabbbaaaba#aa###a#aaaaaa#aa", "aaaaaabaaaaaaaa#accb#########babaa###aaa##.##a##.####abcbccabdeaaab#..######aaaaaaa#####################aaa####a#####.############aaaabdgihgcbaaa################aaaaaaaaa#aa###a######a##########dbaaaaaaaacbcefgfddcccddegdcbdbaabaaaaaaaaaaa######aaa####aaaaaaaaa#############aaaaaaaaaaaacaaaaaaaaabbbbdeccdccbbbbaabaaaaabefecbbbabbbbcbcegededcaabaaaabaaaaaa##aabbbaaaa#aa#aaa#bbaaaaa#a", "a##a#aaaaaa###aa#bbcbaa##aaa#aaaca##abb########a#####aacbbccbdeaaaba#########aaa##a#a####.################ba#########.##..######.bbabaaehhhgbaaaa#################aab#aabaa#aa###a##########a.###.ab#aa#abababbbcbcdcaacecccdefdc##abaaaaa##aa########aaba#aaa#a#aaaaba#a#aa#a##.##abaaaaaaaaabbabbaaaaaaaaaaccbbbcdbbbbaaabbbabbdgfdbbbabcbcccdddeeedcaaaaaaaabaaaaa##aabbaaaaa##aa####aaaaaaa#", "####aaaaaaa######abbcca##aaaaa##abbabba#a#####aaa######aabccedfaaaab#########aaa###.#######################b########.#ba#...##.#acbccccfgggebaaaa##a###############aababaaaa#a##a#a####a##a########c#aaaaaaaabbaaaaabccdebabbbdgeaaabbbaaaaa##a#######aaab##a##aaaaaabaaa###aaaa####ba#a##aaaaaabbaaaaabbaaaaacbbbcbbbcbbaaabbbbcbcfgecbcbbbccddccceddccaaaaaa#bbaaaaaaaaaaaa#aaa##a#aa#a#aa####", "##a###aaaaa#######aaaaaaaaaaaaa#aabbcaaaaa#a###aa########aabeeea###aaa#######aabb#####a######.#######aa##.######aaaabedccbbb##bbbbaabbbbccdeaa##a##a########aaa#####aabbbba#a#aaa#a####a###########caba###ababbbaabbabcdcddcbabehcaaaaaaaaaa############ab##aaaaaaaaaaaaaa#baaaaa###bb#a##aaaabbbbbaaaaabbbaabbbbcccbabbbaaaabbccccbfffcccbccccbccccddeedaab#aaaabaaabaaabaaa###aaa###bb##a#####", "aaaa##aaaaa#aa#######a#abbaaaab######aaaaa#aaaa#aa#######aabdefb#aaa#bc#######abcb#####a#################aa#a..###aabcdfffggfdcbbbbbaaaaaabdeaaa###########aaaa#####aabbbbbaaa#aaa#####aa#a##.#####aaaaaa##abaabcbbbaaabaabbbbcdefaaaabaaaaaa##a######aaa######aaaaa#aaaaaa##aaaa###aa#aaabbbabbaabbaaaaaaaabbbbbacccbaaaaaabbccdccdefegffdccecbccccdeeddcbaaaaaaabbbcbaaabaaaaaa#######aa######", "#aaaa##aaaa#############abaaaaaba##aaaaaaaabaaaaaba#####a##abdgca#aaadeb########bba#####aa#aaaaaa###aaa#ab#aa#.###.#acfhfddgccbaa#aaaaaa#abcfaaaa#######aaabbaaa#####aaaaaaaaa#aaaaa#aaaa##########aaaa#aa##aaa#acccabaaba#a###acdbaaaaaaaaaaa###a##.##aaaa###a###aaaaaaaaa###aaaa#abb#aaaabbbbbbbabaaaaaaaaaacbbbccbbbbaabaaacccccdfdbdfgeefcddabccbcedddccbbaaaaaabbbababbaa#aaaa#a##ab##a####", "##aaaa#############aa#####abaaabda##abaaaababbaaaaba####aa#abbdeaaaaaadf###############a#aaabbbbba#aa#aaaa#baba.#accbffffgddcbbaa#####aa##acfeabaaaaa###aabcdcbba######aaaaaaaaaaaaaaa#aaa##########dbaa########bbdcaab#abaaa##abceaaaa#a#aaaaaa#a###.######a#####aabaabb#aa#####a#bcbaaaaa#aaaabbbbbaaaaaaaaaaccccbccabacaaaabceeeeggdcdfffccccca#bbcbddeccccca#abbbbbbbaaabaaa#a#aaaaab#######", "##aaaa####.##########baaa##aaaaabda#aaaabbaaccbaaaa#####aaaaabbcbbaaabdgfe###aaa#######a##aaabbabbb#a#a#aabdceeedcabcaeddcfhecdb#########aacdhcbccbbbbbbbbdehhedba##aaaabbbbbaaaaaabbaaaaaaa########cba#######a#abbda#aabcbaa##aabceaaa######aaa##aa########aaa##aaaaaa#aaa###.###aabaaa#aaa#aa##abbbaa#baaaaaaabbbbbbdbbabaaaacaddacbbbbddccccbbda#cbbcdcddeccccbaabbbbca#aabaaaaaaaaaaaaa#####", "#aa###a####.##########aa#a##aaabaccaba#aabbaccbaaaaaaaaaaaaaabbccabaabeffeebbcb#.####.#aaabbaabbccccccccdddcec.#aaaaaaadccbbcccca.#######aabdhecdddeeeddeefecbbeedcaaaaabbbbbbabbbbcbbaaaaaaaaaba##aba####a####aacdccaa#ccbbaa##aabcdaa########a##aa########aaaa##aaaaa##aaa#########aaa##aa#aba#aabbbaaaaaa#aaaaaabaaaccbaaaaabccababbbb###bcbcbbecabbccdcddcdcccaaababbbbaaaaaaaa#aaaaaaaaa###", "#aa#aa##########a######a#####aaaaabc#abaaaabbcbbaa#a##aa#baaabbbbbabbcfffgghebdcbbacacbbbbbbbcbccdccfdaaabdedcaaabaaaaacccbbbbbbcb########abcfgedeffeeeegfcbbcbadgdddaabbbbbbbbbbcccccbbaabababbbaacbaa#########abcccbabccbbbaa##aabcb#a#######aa######a#a##abbbbabaa###a#aa########.bbaaa#aaaaaa#aaabbbccbaaaaabbbbbbbaaaaaaaaabbbccccaaa###bcdbabcbbbabcdddcbddccbbaaaabcccabaaaa#aabaaaaaaba#", "#aaaaa#######a####a###aa##.###aaaaabc#abaaabbcbba###aa####a#aaabbbaabcdcdeccdecccccba##aaabbaaaaaa##beaaabacfdeaabdecb#bdcbbbbbbaca#######abcdegeeeeffgfdabbccddeehhhfdbbbddeeccdcccdccbbbbbbcccbcca##a###a########aa#.aceccbbaa#aa#acb###.#####aa#####aba###abcdcbcbaaaaaaa#####a###bc#abaaaa#aaa#ababbbbccbaaaaabbcccbcbaaaaaabccdacccb#a###abddbbbbbbabbcebcbbdcccbbaabbabcabaaaaabcbaaaa#aaa", "aaaaaaaaaaa####aa#####aaaaa.###a#aaaccaaabaabccaa##aa#######aaaaaaaaadc##abaaaaa###a#######a#########cb#aaaacdddb#bbdda#becbbbbbbac#######abceffhffffda##babcccdeeddbddeecdcdebdeeccdddeddcccdeba#b###aa##a#########a###bedbbbbaa#a##aca###.#####aa####aaa####bbcdddbaaaaaaaaa#######adbbabaaa##aaaaaaacbabbccbaabaabbccccaaabbcbdcbcecccaa#a#a#adcabbbbbcbbcbccaabccdcbbbbcacbaabbaabcbaaaabaab", "bdbaaaabbaaaa#aa##a#aba#############abcaabababcba##aa#########aaaaaaabdb##aaaaaa###a##################b####aaccdeaabcbbaaeddbabbbabb#######bdfhghhgda###aabbcccecbbbdcccefdbbcbcb#eefgghggfeegdaa##a###aa#######aaa#####bedcabbaa#####acb##########a##aaaa####acbccccaaabaabbbba####a##dbba#aaaaa##aaaabdababbccbabaabbcddcbacbbccdacdbba#####aaaabcbbbbbbbccbbababbcddcbabbbabaaabcaaabaaacabaa", "aacdbaa##.##a##aa#aa#aba###.#########abca##aabbbca#..###########aaa##aab######aaaa#########aaa#a###aa#######aaccdfbabbaaaeeddbbcbbbdbaa#abcdfhjigca######abccbadb###cfbcbbecabbba#begfhggddcggdbbaaa##############a#aa#.cddccbaaaa#####ab##########aaaaaba####accbbbbaaabaabbbabb#######aba###aaa#aa#aaabcaaaaabccbabbcccdedcbdbbacdcdccaa##a#aaaaabcbbbbbacccbaaaabaccccbaaaaaaaabbbbaaaaababba", "aababbaa#####a##a##a###a####.##########aba###abbbbba####.#.#######a###aab######aa#a#########aaa#####aaaaa#####bbceebbbba#ceedccedcegdcbcddedbcbed#######aabccdbdda##adeeb##abbaaaaacbadeddfdghdcbbbaaa###########abbbcdbbdcbbca##aa#####bd###.#.###aaaaaaaba##abbbbbbbaaaaaaaabbaaa#######aa###aaa#aaaaaabcaabb##abcbbaabcedccdcbaaccccba####a#aaababcbaaaabbccbbaaababccbaa##aa##aaabaaaaaaabaa", "aabaaaaa#a#####a###aa##########..######aaba####aaaabb#.###############aaab##.###a#a#######aaaaaaaaa#a#aa###a##aacdceddfgfcfffgdccdeeefggdbaabbbbdcaa###aaabbcddeb##a#adfeaaaaaaaaa#bbaaccbeedhecbabbaaa#########.adccbcdbdbbcbba#######a#cda########abbaaaba##abbacbbaabaaaaabaaaaaa########aba##aaaaaaaaabcaaa#a##abca#aaabdefecbaadbbbaa##aa#aaaaaabdcbaaaaabcbaa#aaaabbbaaaaaaaaaaaaaaaaaaaaa", "aaabbaaa#########a##aaa###########.##.##aaaa#####aa#cba################abcb.####aaaaaa##aaaabbabaabbbaaa##aaaaaccgghggecdfihhg#a####a#a#abbccccacdcabbbbbacccdfeba#####aaaaaaa###a#ababbccadcgedccbaaa############ccbabccbcacabaa#####a#bacd###.####aaaaaaa###aaabbccaaaaaabbabbaaaa###.##..#bbb###aaaa#aaaaaaa########a#aabccceecbbdbbbbaa#aaaaaabbaadccbaabaabba#####aaaabaabaaa##aaba#aaa#aaa", "aaaa#aa##############bba##########..#.############aaaaaa#####.##########abca..####abaaaaabbbcccbbccddbbabbbbbcdefebdfd##a#.bedaa#########aabbbcbcddddcbbbcdeffd#########aaaaaaaa#aa#baaabcbacegedbbaaa##########bcdbaabbcccbbbaaaaa#####abbcca####.##aaa####aaabbcccdbaaaaaaabaaaaaaaa####.###abba##aaaa#aa##a############aaaa##cfebdcabcb###a##aaaabbabacbaaaaaba#a####aaa#aaaaaaa####aaaaaaaaa", "abbaaaa####a##########aa###################aaa####abaa#a################aabc#.#####aaaabbbcdddcdfffefgffeddfgdcdcb####aaaa###bb#######a##aabacdcddbdccacdefecc#a##a#####aaaaaaaaaa##aaaaabbbabfgdcbaa########aaacbbbbabbbbcdaba##a#####a#abccda####aaaaa#aaa#abaaaccbbbaaaababbaa##aaa#########bbba##abaa#####aa#a##aaa#a###aaa##defdcabbbaa##aa#aaaabbbaaccaaaaab######aaba#aaaaab####abaaaaaaa", "aaabaaa#################abba###############aaaaa##aaaaa#a###############aacaca.#####aabbbbccddfda#adeca#####b###aa#aa#aaaa##aaba#a####aa#aabccdccedebaacccb####aaaa###a###abaaabaaaaa#aaaaaababdgdbb##########cabbdbbbaaaaaccaaaaaaa##aaa##acdc#.#aaaaa##a##aabaa#ccaaabaabbaaacbb##abaa######..abca##aaaa#####aa#aaaaaa######abaabdggcaaa#aaaaaaaaaaacba##bbaaaabba#aa#aaaaa##aaaba###aa#aaaaa#", "#########.#################aaaa#.#.##aaa###aaa##aaa##a##aa###############abbbba#.##.#aabbbbcefc####...#####aa#####aa###aa####aa#######a#aaacbacbbdddbbccdfecbcc###aa####aa#aaaaaa###aaaaaaa##aaacfdaaa#####aaaabbabbbbaaabbabbaaa###aaaaaaa#abce..##ababc####aaaaabdaabbbbbbaaabbbaaa#a##.#######abaa#aaaba##aaaaa#a##aaa###aaa##ababehcaaaa##aaaaaaaadc####abaaaaaba###aaaaaaa###aaaaa#aaa#####", "####a######################aab#....##aacaaa#aabbaaaaa#####a##############aabbbcb##.###abbcceca###################aaaaaa#a#aa##a#aaaaaabaabbbbbacaaabbabaafddcbcb###aaa#aab##aaaa######a#######a##cfeaaa#####abcbbbbaaaaaabbabba###aaaaa#aaaabaaee#.##ddaaa####aaaaacaaabdcbbbbaabaaba#aa##.#######aaaa#aaabaaaaaaa##aaa#a##a#aaaaaaabbcgebbba#aaaaabaabbaba###aaaaabbaaaaaaaa#aaa##aa#a##baa#a##", "####a##aa##################aabda#.#####bcaa#abaabaaaaaa###################aaabcdb.####bbbdea##########.###########aaaaa##aaaaa##aaabbbbcbccbbaaaaaaaabbbaaaacdcbbbaaaaaaaabaa#aaa################abecaa####aadcabcaaaaaaabbaab#####aab#aaaaabaaade#..#ca.#a####abcbbb#abbccaaabbbabbbb#a############aa#aaaaaaaaaacaa##aaa##a#aaaaaacabccfebbbbaaaaabbbbaaba####ababacbaaabaaaa##a#aaaaaa##aaa###", "#####aaaa###.#a######a#######aab##..####abbbbbbbbaaa#aaa####aaaaa##########aabddea.###abda#################a#########a#####aaa###aaabbcdcbdbbaaaaaaaaabbbaaaaacddcbaaaa###abaa######..############abeda###ababbbccbaa#aaaaaabaa##a###ab#aa#aaaaaacec##ab.########babbaaaabbababababbcda###############a#aa###aaabcbbaaaaa###aaaa#ababbcdcdecaabaaababbaaa#######aaabbbbaaaaaabaaaa######a#aaaaa#", "a#######aa#a######aa#a#aaa###aaac#########abddccbbaaaaaaa####aa#aa########.abehghhc##abca##aaa##################################a#aabccb#aabaaaaaabbbaaaaaabaaabbbdba#aa###aaa##################aa#abefccaabbbcbabbaaaa#aaaaaaaa#aa###abaa##aaaabbcfdaba.#a######bacc##aaaabaababaabcbca##.#####a#####a#aaa#####aaaaab##aa##aaaa#aaaabccebbffbaaaaaabcaa###a#####bbbbbbbaaaaabaa#aa######aa#aa#a", "#baa#aaaaa###a#a#aaaaaaa####b#aaba#########aacbdcccaaa##a###aaa#aa##########bbfikjicacc###aa#aaaa#############a###################aaabccca##aaaaaabbaaaaabbbbaa#aabcbbaa####a#################a#aabaabdfbdcccbbbbbbbbaaaaaaaabbaaaaa#a#aaa#aaaaaabbcfdbb#######a#aaac##a#ababaaaabbcdaaaa##########a#aaaa#a#aa##a#aaaaaa#aaaaaaaaaaabbccdcaaegcbaaaaacaa#####a####bbbbbbbaaaabba##a###aaaaaa####", "####aa#aaaa##a#aaaaaaaaa##a#####aba##########aadcbbba####a####a#aa##########abcdfhiigc#a##aaaaaaaa#aa#####################a#######aadccccaba##aa#abaaaabbbcaabaaba#aaaaaa####a###a#a###.#####acbbcbaabcehfdccccbbbbbbbaaaaaaabaaaaaabaaaa###a#aaaabbcddca####.#####aa##aaacbabbbbaabcba#bc############aaa##aa##aaaaa#baaaaaa#aaaaaaaabccdeba#cgfbaaabca#a###aa#a###bcbbbbbbaabbba##b###aaaa#a###", "###a#aaaaa#aa######aaaaaaaa######aaaa#######a##aaaa####.###aaaaa#a###########abacdhiiga##abbaaaaaaaa##############a########a##a##abbcabc#abbaaaaaaaaaaaaaacaaabaa###a###aa###a###aaa########bbbbcbbbbddceihebbcbbbbbabbaaaaaaaa#aaaaaab#a#####aaaabbcccfb#.########aa##abaaaaaaabbaaaabbcbc#####a######ba##aaa###aa###aa##abbaa#aaaabbbdcccbbabdhebcbaaaaa####a#####accbbbbcbaacba#aa###a#aaa###", "#a####a#aaaaa#aaaaaaaaaaaaaa#######aba#######a####ab########aaaa##a#a##.#..#####aehhjihb#abacba#aaaaaa############a#a########aa#aabdcc####abaa##a##aaaaaa#ababa#a##aaaa#######a#aaaaaaaa##aacaabcccbcbabbcghgdbbabbbccba##aaaaaaaaaaaabaaa####aaaabcbcdccaa#########.##aaaaaaaaabababbabaa#######a#a##abbba#a######a###aa#aaaaaabbaabbcdbbbbabbadffbbaaaaaa#a##a####aabcbbbccabbabaaaba##baaaa##", "##aa###a#aaa#a##aaabbaaaaaaaaa##aa###a#############bba#.###aa#aaaaaa#######.####adfehjif###aaaaaaaabbaaa#a########aaa###a######abbbbcca.###a###########a###aa###a#############aaabbbbbaaceb#aaabbbccbaaabbbdggdcbbabbbbaa###aaaaaaaaaaba#aa#a###aabbbbcdc#####aa#######aaaabbbaaabbbbbbba#aa#######a##aabbaa#######aa###aa#aaaaaabbbbbccaaccbbbccdfgedaaaaaaaaaaaa##aaaccbcccbbccba##aa##abaaa##", "########a#aaaaa#aaaaaaaaaaaaa#aa#ba###########a####aaaaa#.##aaaaaaa##a#a########bbceeijfc####bbababaaaaaaa#########aa##a#aaaaabbadcccba####.############aaa#aa#############a##abbabbbaa##ceaaa#aaaabbbaaaaabbdgfbbbbbabba####aaaaaa#aaaaa#####a#aabbbccdccca#aaaa######aaaaababbaaabcabba##ba##a##a#aaaaaaaaa#######a#a##aaaaaaaabbbcccaabbddcaabbabdffdbbbaaa#aa####aabbccbbcbbddbaaa####acbaa#", "#######aa#a#aabbaaaaabaaaaaaaaaa##aa#a#############abaaaa####abb###aaa#a########babcfhiiea###acbbabbaaaaaaaaa####aaba#aaaaa#aaabaccbcbaa###############aaaa###a##############aabaaaaaa####bbbabaaaabbbbaaaabbbcffbbbbbbbbaa##aa##a###aaaa####aa##aabccefcadda##aaaabb#aaaaaaaaaabbbbbbbba##abb######aaaabbba###############aa#aabbcccbabbaabdccccaabacfggccbaaaaaa##a#aabccbbcaabdbacba####bbaaa", "aaa####aaaaaaaaaaaaababaaaaaaaaaaa#aa##############abbbbaaaaa##bbbaaaaaaa######ab#bccehiic###abcaabbbaaaa#aaaaaaaa#aaaaaaaaabcbccacba########.##########aa###############a#aaa#aa#a##a#####acbddcbaaabbbbbaaaabbefcbbbabaaaaaaaa######aaa###aa#####abcdghedcbbbbbcccdcbbaaaaaaaabbbbbbabaa#.acca#a###aaaaaaa########a##a###aaabbcdcaaaaaabbaccddaaaaacaadggfdbaaaaa#aaaaaabccbbaacbaababaaaabbaa", "aaa#a#####aaaaaabaaaabbbaaa#aaaaaaa###aa#######.#a###abbbaabbbbaaaaaaaaaaaa####a##ababchie###aabbbaaaaaa#aaaaa#aaaaaaaaaaaabccccbccb####a#############aa######.###########aa###aa#aaaa#a###abcccdbbbbaaaabbaaaabbceebbaabbaaaaa#########aaa##aa#####acdfdefebcddcbbdffdcbaabbaabbbbbcdbbaaa##abca#####aaaa#a##a#aa####a#a##aabbdedaaaaaa#aaccbeda#aabbaaaacefgfdbaaaa#aaaaabcccbccabaaabbaaaacc#", "##a##aa###aaabbbaaaaabcbaaa#aaaaaaa#a##########a#####aabbaaabaabaaaaaabcccca########aaacfhc##aaabccba#aaaaaabbaaa##abbababbcccbeecba#####a########a####a#a#####.##########b######a##a##aa###aababaaabbaaaaabaaaaaabdfcababbaaaa##############.#######bddcbdeffcbbba##dihdcbaaaaacaabbbdcaaabaa#aba#####aaa######aa##a###aa#abcdccdb#aa###aaaccdcbaaaaaaabbaaabehhebaaaaaaabaccbcbbbaaaaaaaaaaacb", "a##aa#####aaaabbbaaaaaababaaa#abaaa#############.###aaaabcaabaaaabbbbacdedaaaa######a##bccdccaaaaaacdcaaababbbaababbbccbcbbcdcceedc####a##a###########a#aaa######..####.####.###aa######abbaaaabaaaaaaaaaaaaaaaaaaaacfeedbbaa############.######aaaa#abbaaaaccbabaaa###igdccbbbaaaaaaabcbabcbcb##a######a####a#aaaaa####aaaacb#abdcaaa#a###a#acddcbaabaaaaaaaaadfhhedaaabbabbcccbbaaaaaaaaaaaaaa", "ba##a##a#aaaaa#aaabaaaaaaacaabcbaaaa#aa#########.#########aaaaaa##ababdefcab#aa########aabdfgbaaaaaacdcaaabaaaaabbbbabbcbbbcccddaaaa####aa#aa########a#aa#########..##.##..###.###aaba###aaaaa#abaaaaaaa#aa#aaaaaa#aaaegdcbbbaa###########.######aaa##aaaaab#abaaaaaa#.febaaabcccbcbbcbbaaadbcecbaa#####a#aaaaa###aaa#aaaaabaaaabccaaaaaa#aa###adbbbcbbaaaabaaaabbchifbabcccabbccaacbaaa##a#aaba", "#ba########a###aaaaaaa#a#aaa#abaaaaabaa##a#aa###############aab####aaaaabccaaa##a#.#####abcdfb#aaaaaaaaabaabbbcbbbbbababbcdddfedcb#a##aaa#aaaaa###aaaa##aaa##.######.###.###########a#########aaaabbaaaaaaa###aaa##a###bfedcbbaaa############a####a######a#aaabcbbbaaa#gdaaa###bcddcecccca#addefgfddca###a##aaaaaaa##aabaacb####bbdcaaaaaa#aa###ccbbbccbaaaaaaaaabaadhieabaabbccdcbabbaa#####aaa", "#aab####aa###aaaaaaaaaaaaaaaa#aaaaaaa#####aaa#a##.############aa#abaaaaaaabaaaaa########abccdfcaaaaaaabbbaa#abbcbbaacabbbbcddecdcc####aaa#aaaaa#aaaaaaa##aaaa###..######.#####a########aaa#a####aaaaa#aaaaa########aa####dedbbbaaa##############a###a#####ababccbaaaaa#gcaaaa####bdebbbbbca#bddcbaabccaa##a##aa#aaaaaaabbaca####abdbaaaaaaaaaa#a#ccbbbbbbbaaabbaabba#adhgcbaccccccdccba######aaa", "a##aa#a###aaaaaaaaaaaaaaaaaaaaaaaaa#aa###aaaaa###.#############a##abababbaaaaaba######aaabbcddhcaaab##baaababaabaaabbabbbbcdddffeeb###aaabcaaaaaaaa###aaa#aa####.######a#######b#####aaacb#######ababaa#aaa##aa########a#aaeecbbbaa##################a##a##bbaabb#aaaa#cd#aaaaaaaace.aaa#bdccdcaaabcacbaba###aaaaaaaabaabccaa#aaabbd#aaaaaaaaaaa#bcccbbbcbbaaaaaaabbaabbhidbbcccbdeddaaa#aa#aa#a", "aaaa#aaaa##aaaaaaaaaa#aaaaaaaaaaa######aa#aaa####..#########.###aaabbbcbbbaaaaaaba#####aabbcccegcbaaaaaaaacbaabbaaabaaaabcccdeeffddaaaaabcbbbcfffecdcba#abb#############aa#a##acbbcba#bbaa########aabba###a##########aa#aaa#eedccbaaa#####a#a###########aaa#aaa#bcaaaaaafaaaaaaaaacfa##a#aaaba#abaaccbcbbccbaaaaaaabbbbbbaaaa#a#abccc#aaaaabaaaaaadcbbbcbcabbbbaaaaabaaccfjgbccbcccccaa##aabaa#a", "#a#aa#aabbaa#aaaaaa##abaaaaaaaaa##aaabaa##aa#a###.#.##############aabbbcacbaca#aaca#####aabbccdeedbaabbaaaabbabababaaaabbccdddffedffb###bbccefebccbdeda#aaabbaaa#######aaaaa###aabcca#adaaa#####aba#aaaa##aa################.cedcbbbbaaaaaaaaa##a######aa####aa#bbaaaaaadc#aaaaaabbee####abaaa#aa##abaaabbabdcccdcbbaccbcb##aaaaabbcdbaaaaababaaaacbccbbccbaaabbbbaabababadjiedccccbbbaaaa#aa#a#", "aaaaa###aaaa##aaaaa####abaa#aaa#a###aaaa######aa#################a##abbbcccbbbaaabba##.#aabbbbddedd#aacb#aaaaaaaaaaaaabbbccdddggffghecbbaabbbddabaa#aaaabaaa#bbbaaaaa##a##aba###aaabb##bbaa####aaaa###########a########.#####aaeecbaabbaaaaaaaaaaaaaa###aaa##a##aa###aaabeabaaaaaabchca###a#aa#a###a##aa####bca#abdecbcdbaaba#aaabbdcaaaaaaaabbaaaaccbbbccdbabaaabbbabbbabacjkjgfdccbaaaabbaaa##", "#a#aaaa###caa#####aaadb#aaa#aaaa#aaa##aaa###aaaa#a####a##a######a#a##aabbbbabba##aabaa##aaaabacdececaaaba#aaaabaaaa#aaaaccdeeefgeeefbcbbbcbbbcbaaaaaaabaaaaaa##abba##a#####aaa###aaaa##.#ba##.###aa############.##.#############dedcbaabbaaaaaaabaa###a###aa##aa#aaaaaaa#dbbbbbbbaacgg#b####a####a##aaabaaabbcaa#abacdcaaaabaaaaabbccaaaaaaaabbbbcbabcacccccbabbaabbbabcbbaaejklhfcbcbbaaaa#aaaa", "####aaaaa##aaaaabaaaaabbaaa##aaaa###aabbaa###aa#aaaa###aa#######aa#a##bcccaaabbaa#acaa###aaaabbcdcdcbaabaaaaaabaa##aaaabbccdfffghffdaabbaabccddbabaaaaaaaaaaaaaaaaa##a#######a####aaa###.aba######a#################a############bfedbaabbbbbaaaaabaa##a#########abbbba##dcbabbbaaabcgdc#####aabaa###a#bbbbbbbbbbaaabbcbbabbbaaaabbbdebaabbbaabcbbbbacbabbabbbbabbbaababbbbbghillgcbbbbbaabbaaa#", "###aaaaaaccdcaaaaaaba##aaaaa##aabaabaaab########aaaba####a###a##aaaaaabccbba##bbba#bca###aaaaabdcddcda#abaaabaaaaccaaabbbccefgfghffaaaabbaaabefbcbaaaaaaaaaaaabaaaa##aa#########a########aaa###a##############.##.#.############a#abdebabcdcbbcbaabba############acdea#abecbaabbbaabbdfc##aaaa#a#aaa##abbbcaba#adebaecabbaccdcbbabbcbdddbabbbabccccbbacbbbbbabccbbbbbaaaabcbcfijjkjfddcbabdebaaa", "db#bdccbbcb##aabbbbaa###aaabbbbaccaaaabca####.#####baba##a#aaaaa#aba#accbbbbaaaaaaaacbaaaaaaaaacccdccc##abaabbaaabdbabbcccdffffhggbaaaaabdbaaaababbaaaaa#a#a#aaaaba#a#a################aabaaaaa###########.#####...#####.##.####aaaa#bedcccaaaaabbaaaaa##a#####aaaaddaabdebabbbbbabbbbgcaa#a#aaaa###aaabdaddabaadcfdfgdacbaabcbbbcccbdcdffdacdcedccbbbacbbbbcccccbbbbabacabbdgigbbgjjedcbbbccaaa", "#bbbaaaaaabaaabbbea#aaa#abbbbabaaaaaaaaba#############b####aaaaaabaa###abbbbbaaaaaaaacbaaaaaaabbcccccdd##cbcbcaaaaaaabcdeffgggiigabbbbbaabcaaaaaaaaaaaaaa#aaa##aaaaaaa################aaba###baaaa#######.#####....#########.#a##aa##a#adfca###abbaaaaaaa#####a####bdbacfdaaaaaabbaacedfa#aa#########abefeddcccdebccfggfedaaccbacddecdccdeddccefddcccccccabaabbabaabbaabacbbhijgdbacfkjeedcba#a#", "###aaaaa#abbaaaaaaa#a####bcaaaba###a#aaaa######a####aa######aaababaaaa##aabbaaaaaaaaabcaabbaaaaabcbccccbcbaaaaababbcccdefgfgghkgbaabbcbccbaaaaaabaaaaaaaa#aaaa#aaaaaaaaa####a########aaabba#aaaa#####a#.###.######.#####.####.##a#abaaa#aaddaaabbaaaaaaaa#########aabgggfbaaaaaabbbabbcfea#a#####aa##afghhfggghhgccddffhfffcccbccdfgeeeceec#aabcddcdddccebaaabaaabaaacbbbb#ejhjgbbceceikibbceba#", "aaa##a#aabbabbaaaaaaab####bc#aaaa#aaaaaa#ab##aaaa##a#aa######aa#baaaaaaaaaaaaaaaa#aaaaacbaabaaaabbcccccdbaaaabbbbccddeeefeegjheb#a#aabaccdcaaaaaaabbabaa#aa##aaaaaaaaaaaa#######a###aaaabba#abaa####..###.###.####..#####.#######aa##ba#####bcbaaabbaaaaaa########abdfggebabaaaaaabbbbbchfaaa######abbfegggefgghgffeecefggfhheecdddeeefdcefcabaabccbaabcbcbaaaaaaabbabbbbbbfghggdbcbcbbgkjfbbecb", "#aa#a###aababbbaaaaaaac###.acaaaba#aba####ac#aba###aaaaaaa#aa##a#a########aaaaa#aaaaabbbbbaabbaaabbbccccebaaaabbccddddedegggfhbaaa##aaabcccaaa#aaabbbbcbaaa#####aaaaaa#aaaaa#####a###aaaaaabbdaaa########...##.###..########.#####aa#aba###a#accbaaaaaaa#######aaaaabccdeeccbbaabaabbbbegfgeca#####adefffefgggfghggfeeccegihijigedbccfeceddfeaaabcacbbaaabbaaabaaaabbbbbcbchgghfgdabbaa#bgkjgcdd", "d#a#a####aaaabbbabaaaaaa####abaabaaaaaaa###acdbaa#a###aaaaaaaa###########aa#a####aaa#abbbbbaabaaaaaabcbccdaaaaabccddeefefhgefgbaaaaaaabaabbaa##ababbaaabcca#aa#aaaaaa##aabaaa####a####aacba#bcb#aa#.####.#...##.##..################a########a#adbaaaabaa#aa##aaaaabbbcdeddddcbabebbcbbffeefdec##adeeefeffefghgghghhgfedfheabfghhfdcegecbbbbccaaaabcaaaaaabaaabaabbbbabbcdfffgffffabbbbbcabgkjec", "cdaa##aa#aaababbbaabbaaaa####bbabcaaaaaaa##.acaaaaaaaa#aaaaa#ba###########aaa#a###aaaababbaabaaaaaaaabcccdgbbbccccddeffefgfeffbaa###a#aaaaaa#aaaaaaabbbccaaabaaaaa##a###aaabfd#####aaaabbaba#aa########.###.##.###############################bacedcbbbbabaaaaaaaaabcccccddedddbbdeecdefeededdeeffdegffeddefgfgggggcb##abbca###bbefeefeddcdcbeeaaaaab#a###babbbbbababcbccfgfeeefegcbaaabbca#afkh", "gdcbaaaaaabbbaaabaaabbbbaaa###bbcbaa#aaaa#####a###aaaaaa#aaa#aaaaa##a#####a#aa#aa#a#aaaabbaaacaaabaaaabccdfgddddddccdfhhffddfbaaa####aaaaaaa##a#aaaaaabbdb#aaaaba#a#######aacegdbaa#aaabaabbb########.#.##.##..#...####.#######################babedededcbaaaaaaaaabccddeedefecfffeeffddddddeddeeeddeggfddeeffbaaaaaaaabdb#baa#a##cbdfeaaabbcdfbaaaaa####a##abbbbaabbbbdcgfgeeedeefabba#aaaaaabg", "gjgccbaaaaabbbbbbbbaacbaaaaa###aaaaaaaaaaa####aaa#####aaa##aaa#a#a#######aaaaaa##aaaaaaaabba#acaacbaaa#acccfgdefefcdecfhhddbcaaa#a#####aaa#aa###aaaaaaabbeebaaaaaaa####.###aaacdcbaaaa#aaabba#############.#.#.#...###########..###############aacddeeededceeedccefggfgggfedggghfdfecdddccccddeeeeefddfffddddbabbbaaaaabefcdb#aa##aaabcaaaaa#bdgb#abaa#######ba#bbaabaaeegfgfeeeecfcaaa#aa#aaaa#", "#bgifcbaaabbbcbbbbaabbbaba#a#aa##aaaaaaaa######aaaa##a#aabaaaaaaaaabaaaba##aaba###aaaaaaaaabbabbabaa#a#abcceffeecb#cddeeggcdb##a##aa##aa#########aaaaaaa#bedaaaaaa##########abaa#aaaaaa#aaabaa#####a####################..######.#a##.#########aabcccbcda##afgggffdbbbabdhheghifedddeecbccdcdefffeeffdfggfdbaaaaa#aababbacdddb#bb#aaa#a####ababbdebbbaaa####a#babbaaacddfgffeefeeddcbabbaaaa#aaa", "a##ehiecbbbccdccbbbbaabbaaa#aaa##aabaaaaaaa####aaaa#####aaba#aabcbbbaabbba##abaaa######aa#abbacbaaaaaaaaabcccdfcaa##bbbbceabaa######aa##a##aa####aaaaaaaa#abaaaaaa###a######abbbaba##aaa#a####aaa###a############.########################a####aa#dcddcdb#a#dedeedcaa#baacgegiifedddddddcdddefeffggfgeedbba#aaaabbaabaaaaabceebbdaaaaa######aaaaabdddb#aaaaaabacbbbaabdfffgfgfeeeeddgcbaaaaa####", "#b##adiifdbcefedccccbaabaaaa#aaaaaaaaaaaaaaaa##abaa######aabbaabbcbbaaaaaaa#abaaa#######aaaaabcca#aaa##aaaabbccc#########a###aa##a###aa########aaa##aaa#aaa#aa#aba##a#######aabbabcaa#ababbca##aa####a#####a.#########################a###a##acba.ddeecccba#cfeeedcaaaaabccbaigfeeeddddcbcdcddfeffggeedaabaaaabaaabbabaaaaa##cffedeaa#a#aaa#aaaaaa#abfebabaaaaaacadcaaffecffffgfffeeggaaabaa####", "#caaa#.ahjgffefgggffecbbbabaaaaaaaa#aaaaaaaaababaa#aa#a#aaaabaaaacccaaaaaa#a#aaabaa######aaababaaaaaaaaa#aaaabccb####aaa##ab###aa#####a#a####.#aabaaaa########a##aba########acbbaaaaaaaaaabbbaaa################a###a####aa############aaccb#adcbbdddccbcdebdedccba#a#aabdcbaggeeddedcbbbccdeeffffhggfcbaaaabbbcaabaaaba####a#debceea#aaabaaaaaba#aaa#cfgcaa##aabcbcbdffedfeeeefefeedhcaaaa#a###", "####aa##.behhgfeeeddefedbbbbaaabaaaaabaaaaaaaabaaaa#aaaa#a#abbaaabbcbbaaaaaaaaaaaba####aa#aaabaaaa##a#aa#a#aaabbcc.##ab##aabca##aaaa############aabaaaaa#a#a#####aaa#bb#.####bccbaa##aaaa###aaaaa######a#######bbabba####bb###a#a###a###bcccccdcdccddcbbabcdcddccba####bdddb#bdcecdedcbbbbbcceeeeehhcdaaaababcbcaaaaabaaa#####ab#aabb###bb##abcaa###a##adfeba###aabaaefefffedddeedefefhbaaa###.#", "#####aaaa###chikjiigedcegcccbabbaaaaaabbaaaaabaa#aaa#a#a##aaaaaaaaabaa#aaaaaaabbbaa######aaaaabaaaaaa##aaba##aaabab.###aaaaaabaa#aa#a#############a###aaba########aa#cbb####abcbaaa##aaa#a######a#.####aa###bbccbbdccbaaabb###a#aaaaa###cbbbaccccbbcccaaaabbccccbbaaa#accdcb##bacgeeedccccbccdeeefggebdaaaaabbbbbbaaabaa#####a#a#aa#####aaaa##ca#####a####beeca#b#abadgefffedeedfdcffeff#a#a###.", "..######a#aaadd#acdhihecdgecbcaa#aa####ba#aaa##aa##aaa###aaaaaaa##ababaaa#aaaaabbbaa######aaaaaaaabaaaa##baa##a#a#b######aaaaaaaaa#################a#aa#bcb#####aba##a######bbbcbaabcaa#################a#abcdbdefededcbcbaa##aaa#a###bcbababbccbbbbbcaaaaabcccbaabaaaabcdbba###bhhfhgeddccbccddfhhhfbbaaaaaabbbccaaaabaa####aa#a#####b####aa#aa#ab###a##aaabefd#a#abbfgfeeeeeedeeddefggbaaa####", "##.######aaba#abaaaabeiiebceddcbaaaaa###aaba#########a##aaaaaaaa###aaaaaaaaabaabbbbaaa###aaaaabbbaaabbaaaaa###a###bb#####aa###########a######a#####aa#baaaba##abcedcbaa##a##bcccbaaaddccaa##############a##bbceffgfededdedcbaa#a#aaa#bcabaaabbbccbbbbbbaaaabbcbbbbaaaaabbcda#a##ehgfeeeeecddbcddfhhgcbbbbbbaaaabcbbbaaaaa###.#a#a#a####aaa###aa##a########aabbbedbacfegggfeeefeddccddgihdaaa####", "##.###a####aaaa#bacbaa#chidccdfdbbabaaa#ababaaa###a###aa#aaaaaaaaaba#aaaabccccbcccccabb###aabaabbbcbaabaa########aaab.####aaa##################a####b##aaaabb#aacdddcbb#######bccaaaabdbba#####aa#a#########abccccccddcffhigcbaaa#aa#acaabaabbbbaaabbbbbaaaabbbbaaaaaabcccdda#a#higheddefedeecdffffeeaaabbbbaaabcbaabaaaa#########a####aaaa######a#######aaabdcbadgfdeddegfgfeedcccccehigaaa####", "###########aa#####aacdb##ejgcbbfedcaaaaaacbabaa#####aaaa#aaaaaaaaaaa##abbbbbbaaabbcddddbccdcccbababaaaaaab#########aba..####aa###################aa########aa##aaaabbbba##a####ccaababdaa#aa#####aa##########aaaaabbccdfgjjihdcaa#aaaacbaabbababbaabbbabaabbbbbbbbbbbbbcccddebadhggfffeeffffeeeffdccddaaaabaaabbabbbbaaaa######..######aaaaaa#a###a#aaa###aaaccc#ceggedddcffffedcbabccdfgebaa###", "#########aabaaa####a#aabbachjgbacdedcccbabaaaaaaa#####aa#######aaaaaa#aaaaaaabaaaabbccdccddcbbbabaaaaaabbaa########aabb.#######a##################aaa##########aa##abaaaaa######bbaaaaba#a#a#.##.#a#aa###aa###aaaaaabcddgijijjigeba#abdcbbcdcabbbbaabbabaaabbbbaaabbbbbcacddee#dfeeeffeccdghhfffebccccaaaaababbbbaaabba#a########.###a##aaaa##aa##aaaaa####aababbddceggfedcdffedcbaabcdeeffaaaa#", "#######a#aaaaaa#a#####aaaabcdiibaaacecddcbaaaaaaaaaa##aaa########a#aa###aaaaaaaaaaaaabcccbbaaaaaaaaabaabbaaa######aaaaca.###.##a#a####a########aaaaaaa##...###a###a##a#aaaa#####bdaaaaaa########a########a##a##aaaaabbbbegfeedeghgeccddeeefgcbbaaaabbbbaaaabbbaababbbbcccbceeebegdddeffedbdeiihecbcbdbaabaaababcbbaaabaaa#a#.############aaaa##b#a##aaaaa##aabbbbccdceghgeddefedcaaaaccdedfaaaa#", "########bcaaaaa##########aaaa#gidaaabedcccbbbaabdbaa####aba#a#############aaaa###aaaaaaacbbaaaaabbabbbbbcbbabaa######aabb..##.####aa#aaa######aaaaaaa####a#.####aa##ba#aaaba#####dbaaaaa######aaa#aa######aa###aaa#aaabccebabaabbdfhhhgfghggdbaaabbcaaabbaaabaaaaaaabccccccedchigdcdddcedccabghdbaaabcaaabaaaaabbbbcbbaa##a########a##.#aaaaaaaaa#aaaaaaaca#acbbbbbcccdefeddeecdcbaababcfdfeaa##", "########baaaaba#aaaa#####a####aciib#aacdddbabbaabbb#aa#####aa#############aaaa##aaaabaaaabaa##aabababbbbccbbbcb#######aaaa#...##.#####aa########aaaaa######a############a#aaaab##abbaaaa#######cb############aa#aa#aaaaabaaa#######bfhigihhfbaabaaaaaabaaaabbaaaabaaaccbccdcchiihhdbcddcddccbbeeaaaabbbaaaababaabbbeeeaa#####.###.aaaa#aaaaaa#aaa#aaaaaa#bbadccbbbbccccbcddddcbcccbaaaaddddge###", "########a##abbaaa#########a#aaabcfjhaaabcdecaabaaaaaaa#######a########a#aa#abaa#####aaabaabaa##ba#abbccbaccaaca########abcb..######################aa###ceb#######aaa#####a#aaa###acaa#aa#######b############a#a##aaaaaabaa########abacfhhfcbbaaaabaaabaaaaccaaaaaaaacbcbbcffgfgcegeddeddcdccbcd#aaababbbaaababcaabaaccba########a#abaa##aaaa##aaaaaaaaaababcbbbaccbbcbccdddcbbbcbbcbbadcdeehd##", "########bb####aaba#########a####aabfjfbbcbcfdbabaaaaaaba######aa######aaaaaaaaa##a#####aaa######aaaabacbbaaabaa#########aadc...#######.##########aaaaaa#ddeb#a####aaaabeb######a###bbaaaa##b####aa#.##########a#a#a#aaaabaaa##b###.adbaabeecbaaaaaababaaaaabcabaaaabbbbbcdcfgeddgbbggeedddcccccc####aabaaaaabbaabaaa#acda############aaaaaa#aaabaaaaaaaaaabcbabbbabcbbbbcddccbcbbbabbbbccdfggf#a", "aaaa####bc##a#aaaaaaa###.#####.####aciiecccbceebaabbabbb######a#a####a##aaaaaaa########aaa#######aaabcbbabbaaaaa#########acfc..####.#.###.###aa###a#a#aaabcaaaa###aaaa##########a##bdcaaaa#ba###baa##########aaa####aaa#bbababdcbaacbbbaaaabbaaa##aaaaaaa#aabbbaaabbbbbbcdcccddcdec#adfedddcccbe#####aaaaaaaaaabbbaaa#bdb##.#######.####aaaaa###aaaaa##aaabccbbbaababbbbbcdccccbcbbbcbbbdcefghc#", "########a#####aa#bbaaaba######...####adhifegfddfdcabccbaa###aaaaaaa######aaaa##aa##a###b##########aa#aaaaaabaaa######a###abdfb..#######.##.#####aaa#a###baaa####aaa#########a####a#bddcbaaaa####aaaa####ad##aaaaaa#######abadddccccdcba##a#ababa###aaaaaaaaabaaabbbbbcbbcbbccdccbaba##afedddccbfa######a#aaaaaabbabaaaaab#####.##..#..a###aaaaa#aabbaaaaaabcccbbbabbbbbbbbddccbbcbbbcbbcfdeeffha", "##############aababaaaa##########.##.#..chjjhjifffdeccdbaa#aaa###aa#####.##aa#######.#######a#########aaaaaaaaaac########acchc.....#..###########aa##aa#abaaa##aba##a######aaaa##a##bdcbaaaa#####a#aa###bd###aaaa#aa##a####adgdcbbcddbb###aaa#a#####aaa##aaa##abbaabbbbcbbbcccddeccc#a#bhggfedaec##########aa#aaababaaaaaa#####.##.##.####aaaaaaaaaaaaaaaabdcbbbababbabbbabddcbbbbbbccbbdifdefge", "a###a##########abb#aaab#a#######...#####.##a#acgkigfeefdcaaa##aa#aaba####..######.#a###a#aa#aa##.#######aaaaaa##ba#####aaabbeha...###.###.#######a##aaa#aaa#a#aaaa###aa#a###aa###a###cdcaaa######a#####abb####aaaaa####a####deebbbccdbba##aaa#aa####aabaa#a#aabbbaaaaabcbcbbccbcedbba###cdffffeefba###########aaaaaabcaba#####.####.#######a#aaaaaaaaaaaaacdccabbababbabbaabcccbbbbbbbccdeeedefh", "f#######aa##a##aaa#aa#bba#########..############afkjgfgfeeeba#aaa##a#######.####.#.#####abbbaa##########aaaa##a#a#######abbcdhe#...######.##a####aa#a###aa#a#aaaaa######aaa###########bdbbaaa####a######aa##.##aaab####aabdecdcbaabbbaba##aaa#########abaaa##abbbaaaaabbbcdbaccbcebaa####adghfedeeba#############aaaaabbcb##########.######aa#aaaaaaa###bcdccbbabbbacbaabbbbbbdcccbbbbbcccccddeh", "hc#####aa######aa####aaaa#####a###.......##aa##a###gijhhhggeb##baaaa####...#####.#..a###acccaaa##########aa#####aaa####aacdddhf#..###.#..####aaaaaaaaaa###a#aa#aaaaa#####aabb##########cecaaa####a##############aabb##aabacddbcbbabbbaaaaaaaa##a#######baaaaa#abbaaa#abbbabcbbbcdgd####a##adcgfecdeb######a########aaaa#baaba########.######aaaaabbbbbbcbccbbbbbbbbbaaaaabbbbbbccbcbbbbcccccdeed", "egb##baaaaa####a##aa#aaa#a#######.#..###.###########adfilkhfca#abaaa#####..##....#....###bbccaa##a##aa####aaaaa##a##a##abbcfhjfb#..#####.######aaaaaaa######aa##a#abbbba###aba#aa#######cecaaaa###a#.#######aa##aa#aa###aaabcbcbbcbbaaabb##aaaaa#######abaaaaaabbaaa#abbbbbabbabdfeaaaa##a#ca#eecccfcaaaaaaaaa#a#a######aaaaabca########a####aaaabababbbbbbbbbbbbbbbaaaaaaabababccccbcccdccbdffd", "cfhd#acaaaa##a#######a#a##a###a##.....######.##########bddjkidca#########..###....######acaacbbb#a###ab##aaaaaaaaaaaaa#aabcfgejfa#.###a######a##aaaa#aaa#a###aa##a#abbcba#####aa####a###aeedbaaa##aa####...#aaaa#bcaccbaaaabcdccabcbbbaaca#aaaaa#########aaaaaaabaaaaabbbbbbbaaabbecbbcaaaaaa#adecccedcaaaaaaaaa##a###########abaa######a####aaaabdbbbbbbbaabbbbbabbaaaaaaaabbaabccbccbccdccdefg", "fedfea#a####a##a#a#######a####a#.##..#.####...########aaaaaeikhea#####################aaacbabbdfdbbaa#aaabbcbbaabaaaaaaabcdfbbeica..#a########aabaaaaaba#a###aa#######aaa#####aaa#.aa###adffdbaaa##ca####.#########abbcdeeeefcdcbabbbbbaacbbaaaaaa##a##a##baa##aa###aaaabbabbaabaadfb#bbbbbaa###feccbeecbbabaabaaaaaaa#aa###a####a########a##aaaaabbbbbbcbabbaaaaaabbbaaaaaaabbbabccccccddddeeee", "fggehdaaa######a##########aaaaa#.##.####..#..##.#######aabbaadjljgda.#################aaaccbccddcccccccccccccdcbbccbcbaabbcfdcbgf#...#aa######abcbaaaaabaaaaa############.##aa##a########dffedcbaa#cc##########a####bbbbcdffeedaaabbbbbcbabbaaaaaaa#######abaaaaaaaaaaaabbabbaa#a#bdcbbbaaaaa###cfeeehhecabbbbbbaaaaaa##aaa##a###a########aa#aaaa#bbcbbbabbbbaaaaabbbbbabaaaaaaaabbbbbcccddddeee", "edehhg#aaa######a#a#####a##abbaa###.###################aaabbcaacjllkhbaa#######a######bbaefddddcbbbaaaababefeedddccffdccdfgeeeefec#...#ab#.####abccbbba#aaaaaa###########..###a##########bfdfdccaaacfb.######aababaaaccccbdffebbbbcbbaacccbabbabaaaa######aaaaaaaaab#aaabaaaabaaaabbeffcaaaa####aeeeefiihfcabbbbbbabaaaaaaaa##a######aaaa####abbabbabcbaaaaccbbbbbbbbcbcaaaaaaaaaaaacbbcdddddede", "eefgghcaa#######a##aa######abbbcc#.############.###a#aaaaaaaaccbafjllkjecbaaaaaaaa##aabcccgefeecccbba#aaaa.acffffffcacdccbbbfffefda#.##########aabcedba##aa#a#####a#####..#####aa###.####bceecccbaabdfa##aabbbaabbbbdcbbccdcceebabbbaaabcdcbbbbbaaaa######a##aaaaaaacaaaaabbaba###acdeegcbbb#####aeffgfgijkgcbbbbbbbbabbaaaaa##a#aaa#abaaaa##aacdbabbccbaaa#bbbbaabaabccbaaaabbaaaaabbbccdeedddd", "deeffdfd#####a######a#######aaaca#a############bdca###aca##aaaceddfijjnligdcbbcbaaaaabcddchgedddbccaaa#aaaaa##accfbbbaa####bdhfedhd#.###########bbcccdba###aaa#####a##a#.#####a####.####.#abedebdcbbcfe#####adcbcddbbdbaaacbcbccbbbaaa#bbcbbbbbbaba#a############aaaaaaaaaabaaaaaaabdfcccbbba#####aceffgiijihedccbbbbbabbaaaaaaaaaaaaaaaaa#####aabaaabbbaaaaaabbaabbbbbcabaaaaaaaaabbbbcccdddddd", "ddddecbdca###a###a##baa#aa##abaaba#a###.#####.#aabaaa#aaa##aa#acdhilmklmlmkheegecbbbbccbcefgedcdcbbbbaaaaa#aba#a#cdabcbaaa#achihggfa############abdb#bcaa##aaa#########a###.######..########beddecbcdffc###.#acdfffdabcca#aabacbbbbbaa#abbbbbbbbbaa#############a#aaa#baaaaaba###aaadfd#babacababbbcegfhhiihgfdddcccbbbaabbaaaaaaaaaaba#aaa###a#aaaaaaaaaaaabbabbaabaaabcbbbaaaaaaababbccdddddcd", "deddddcacaba###a####aaaaaa#aaaa#aaa###aa#########a##aa#aaa##aba#.cfehhjkjllmllihfedcccbbdefgdcccecbbbccbaaaaaaaaabdbbbcbaaaabhjjhggea#.####a##a#accaa#cdaa#aaa#.#############a##a##.###a####.cedccccefbbaa#####deffeaacdaaaa#aabbbbbaaaaaabbaaabbaba#####a.###a###a#a#aaaaaaa#a##aaacdecaaaabaa#aa#bdgfeeefhhfdccccddcbbaaababaaa##aaaaaaaaa###aaaaaaaaaaaaaaaabbaaababbbbabbbaaaaaabbbbcdcdccdd", "dddcccdbbbcba#bb#aa###aa##a##a####a##.####aaa##a#aa##a#a#ba######.fffkjlhkkljmmmlieeddccefaeeeccdedbcdccbcbaaaaaabaccbccaaaabeijjigieba.#######aacbaa#accaaaaa##########a#a###aaa#############decabdeeeaba###..adeddcaabcbba##aabbbaaaaaaaaaaaaaaaaa#####a###########aa#abaaaa##a#abbcdeba#b#aa#####cefedcbbdeedcccdddcbbbaabbaaaaaaaaaaabaaa###aaaa#aaaaa###aaaaaaaaaabbbaabbcbaaaaaabcccccccdd", "ddccbcccbcedaddaaaaaaaaaa#aa#a######...###########aaaaaaaaaa####..cfhjjkmlmklkklmnjfeedeefebdeddegheeedddccbbbaaabbccbcbbaabbbgjkjjhifda.#######aaaaa###abaaaa####aaa###########aa##########..adccaddcecbabbaa##dedddcbabcbca#aaaabbaaaaaaaaaaaaaaaaaa###############aabaa##a####aacbcddebaaa########cffecdcbceeefdddddcbbbaabbbaaaabaaaaaaaaaa###aaa#a#aaaaaaaaaaaaaaaabbbaaaacbbaaabbbbcdcdccb", "cdcccccbbcdbaacbbbbbbaaa#aa#aaaa#####..#..##.#####a#aaa####aa######eigfcfgijjjlmmmmnlhfhiggdddeefgegfgffdeddcdcbaaccccbcbaaabbcfjkkkijgfb#######a#aa######a#############a###aaaaaba############abcc#ddcccbdecdcaddddddecbbbccaa###aabaaabaaaaaa#aaa#########.####a##a##a#aa#a######abccdgbb#ba#a######cffgfdefffehgdddeccccbaabbbaaabbabaaaaaaaaa###aa##aaaaaaaaaaaaaaaaaaaaaaaabbba#aabbacddccc", "cddcccbbcccaabbabaacbaaaaa#aa#aa#.#...#...#..###a###a#########aa##adeaaa#abedefijlkmnnlkkjdddfdcebb#degfaefgfeddcbdcddbacbbbbbbdjjklkkihgc#aa#####aa################aaa##a#aaabaaaaa###########aabdbedcabdddeeddddedcccddccbbbca###aaaaabba#a#####a#a###aaa###.###a#######aaaaa###aabbbbcdaaabaa##a####aeghhhggghhhfedddcccccbbbbbbbbbbbbbbaaaaaa####aaba#aca#aaaaaaaaaaaaaaaaaaaaabaaaaabbbcddd", "dddcccbbdedaabdaaaabbabbbbaaaaaa#.##.##.#.#####################aaaddbbaa#aa##a##aceejnllkkhfhfccfbbaaaabafabdeffgfcdddcabbbbabacgjkkllkhjhbaa#####aa############a##aaaa###aaa#aa#a#####.####a##aa#deedcabdeeeedeeddeedbccdcccdcb####aaabbbaaa#####a##a##a####################aa####aabbbcdea##a########aaabehiiiiiihfedfdccccccbacbbabbbcbbbbaaaaaaaa##ab##bbaaaaaaaaaabaaaaaaaabbbaaaaaabbbbbdd", "ddccdbcbedcaabbbbaaaaaabbababbaa#################a##########a###a#ecbaababaaaa#####abkllllljgbaaccbababbabaaaa#cedfheedcabbbbbbbchkkkklkhggeba###aba####.####a####a##aa##aaaaaaa##aa####.####a####dfdcba#bdeeeeeefedddcbbcdbbadcba###abaaacaaa###a##a###aa#####.####a######.##a####abbbbccbbc#ab##a#aa#ca###cfggihhihffffedcccccbbabccccdccbbbaaaaaaa#aa#aa#aaababaaabbaaaaaaaaaaaaaa#aa#abbcccc", "dedcccbcecaaacbababbbaabbbbbcbaaa#..###.#########a##############.cdabbbbbbbba###aabcddilmmljeaaabcbbbbbbbbbbbabaabcefgfecbbbbbbcdfjjkkkmkhfgecbaaabb########a######aaaaa####aaa###################befcbaabbadfeeeeffededcbbccabccccaa#aaa#abaa#######a########...###########.##..###abbbbcbbf#aa###abaa#a#####acfgffgfggefddcccccbbabcecbbbcbbaaaaaaaa##aa#aaaaababbbabbbbbcbbabaaaaa##aaaaabbcc", "cddecccccdcaaaaaabbbbaaaabbbbaaaa########.####################..aaababaaacbba#abddbcdfeejmllf#aabbbaabbbbbbaaaaaaa#afffdedcbbbddffjfijjkkkhgfed####aba#######a####aaaa#aa#####a######a############adffddcaa#befefedeeddccccbcbaacbaabbaa###aba####a###############.###########.######aabcddcefbb###bbaaaaaabba#cffffghhgfffedccccccbcbbebbbbbbbaaaaaaaa####aaba#aaaabbbbbbcbaaaaabbcbaaaaaaaabcc", "dddddfebdfeba##aaaaaaabbbbabaaaa####.#########################.abbaaaaaaaaabbaaabba##aceeilmme#aaaaaaaabbbbaaaaabbbbbefgeddcddddegiighiiggjggfdba##aaaa##############ba#b###aaaa#######a##a#aaa####dfgffgcaabefeeededccccdddcbbbbbaaacbab###aaaaaa########a#a########.#########..####aaabdcdecbdc#aa###aabbcccaacegggfgghggfeeeddddcccbccbbbbaaaaaaaaaaba#aaaabaaaaaaaaaaaaaaaaaaabbaaaaabbabbbc", "bcdeeeeedeeda##aaaaaaaccbbaaaaaaa####..##.#########a##########aaaaaaaaaaaaababba#aa####abbdhkmgbbbaaaaabbabaaaaababbbaehfcdeeeegghkkjjigdeehfeccaaaabcba########a####aaa#####aa####a####aa###baba##adfgfffdeeffdcddddddbcccdccbbbbbbb##bdb###aadb#a##############.##.######.##########abcdcedecegdb#a#aaabbcddaa#adfghfghgffefeefeeddcccccbbcbaaaaaaaaaaa#aa###aaaaaa#aaaab##aaaabbbabaaaabaaabb", "cbceeeefffffd#aaaaaaaaaddbaaaaaaaa#############.#############cbbaabaaaaaaabaaaaaaaaa###aaa#achlkigdaabbabbbbaabcaacaababccdbbdedcdfehkkjgeceheccda#aabbba###.######a#aaa#####aa######.#a#aa##aa#aa##adgggfeeggffdcccddcccbbcbccbbbaaa####ca##abcba#aa##########.#####a######.#.#######abbcbddbdfhgeaaa##abbcdcaaa##aaceghdfgffffffeeddddcccbbbaaaaaaaaaaaa##aa#aaaaaaaaaaab##a#baabbabbbaaaababb", "ccddefgfefffd#a##aaaaaabccbabaabaaa##########...############acbaabaabaaaaaaa#aaa#aabaaaa#aaaabgkjiifbabbabbaaaabaaabbabaaaaaaabcc#####cgkmjgfhfcbcaaaabcbaa########a#aa###a###########.####a######aa##bghfefgeddeccbbbccccccbcdcaaa#a##a#aa#a#aaaacbaa##.############aa########.#######bbbccddddggfbaa###abbcbaaaa#aaabeeeeggghgggffeedcccbbbbbcbaaaaaaaaaa###aaaba#aaaabbaa#a#abbbbbbabdbbaaaab", "bcceddefhgfcbaa#a#aaa###aaabbbaaaaa#######################aababaaaaa#aaaaaaaaaaa#aaaaaaaa#aa###cefllgabaaaaabbbaaaaabaaabbabaaa#ba######bfjljhghcac##aaacaa########a###############aa#.##a#############afgfgfedcccccbbccccccddcccaa##a####aa#aaaaaabaa#################a#a##.#########aaabccccddeegfbaa###abbaaa#aaaaaabdfceghhhhhhgfedddcbbbbbbbbaaaaaaaaaa###a##aaaaaaabbbaaacbbabbbbbcccdaaaa", "bbcccdefhiea###a##aaa######aaaa#aacb##############a####aaabcbbabbaaaaabaaaaaaaaa##a#aaabaaaaaaaaabekljbaaabbaabaabaaaaaaaabbaaaa#a#aa#####aekkhhiba###aabbbb#####a.#########a#a#####a#######aa####.#aba##gggfeedccbbbbbbcbaabccbcbaa##a###aa##abaaa#aa###..###########.###a##.#######aaaabbbcdddcefgaaaaa##abaabaaaabbaabdeffghighhgfffeeccbababbbbbaaaaa#aaaa#a####aaaaaabbaabbbbbbbcccbcccdbaa", "bcccccdefgeaaaaaaaaa#a#a#a##aaa#a#aba#######a#.###aa######bcaaaaaaaaaaabaaaaaaaa###aaaaaabbaa#aaabbchkkc#aaaaaaaaaaaaaaaaaaaaa#a#aaa#a#######dkklibca#aaabcdca#a#aa#################a######aaaa######aab#cghhgfddcbbbbaabaaaaabbca##a##abaaa##abaaba#a#aa############...##.###.#..####aaacbbcdccdcdedbaaa#a#acbaaa#aaaaaaabcffffghhhfggfeddbcbbbaaaabbaaaaaaaaaaa#aa#aa#aaabbbcccbbbbbbbbbbcdccb", "bbbccccdfcec##aaaaaa####a####aa#aa#aca##a####baa#######a##bbbaaaaaaaabbbbbaaaa#aaaa##aaaaabbba#aaaaaadijgaabaabbaaaaaa###aaaaaaaaaaaaaa#######behlidcdbaaabbcecaa######a###aaa###########a####a#######aaacghihgfedcbaaaaaaaaaababbbaa###aaa####a#aba##a#a#####..######......#...#.#.####aaccbcccdcdehhdaa####bcba###aaaaaaabaaadfeeegihgecdedcbcbaaaabbaaabaaaaaaa##aaaa#aaabcbbbccbbbbbbbbbcbbb", "babbcdddddde######aaa###########aaaabda##a####abaaa#####abbaaaaaaaaaaaaaaabbbaaa#aa##aaaaaaaaabaaaaaabcdkib#aaaabbaaaaaa####aaaaa#aaaaaa##a##a##acgjhfgefcbbacccbaa####a######aaaa########a#############bfffhjigedddbaaaaaabaabbbbccaa####aa###a##aa#################a##.....#..#########aabbbbcccddfheaaa####bba####abba#aaaa##bca.#bghfedecbccbbbaaaaaabaaaaaaaaa#a#aaaaabbbbbbbbbbbbbbbbbbaba", "bbabbdcdddcec#####aaaa#a####a###abaaaaaa##bda##aaa######aaaaa#######aabbbaaaaaa##a##aa#a#aaaaaaaabaabacbdjjbaaaaaabaaaaaa##########a#aa##aaa##a#a##cfhhededabbdcbcca##########aaaaa############a######a##dffgjiiheedcbaa###bbaabbbddba#########aaa####################a###..###..##..###aaaabbbbcbcfffebaaaa#aabaa##a#aaaaaaa#####aa#.bdegfeccbbaabbaaaaaaaaaaaaaa#aaaaaaaababccbcbaabbbbbbcbbab", "dbbbbcdcdcdcea###a####a#aab#aaaa##aaaaaaa##a####aaa###.##aa###########aaaabaa#aaaaaaaaaaaaa#aaaaaaabbaabbbhkfcaaaaabbaaaaa##########aaa###aaba######.ekjgddbabbaabccbba########aaa####.#######aa##aaa#####dgfgghgggedcbbaaa#aabbbcbedba#######aaa#a####################aa#.......##..####aabbbbcbcdefeebb#aaa#aaa##ab###aaa#######a###.##cgefdccbbabbbaaaaaaa#aaaa#a#aaaabbccbbcbbbaabbbbcbccbbb", "bcabbcceffabbc########aaa#aaaaaaba#aaaaaaaa########.#####aa######aa####aabbbaaaaaaa##aaaaaa###aa#aa#aaaaabbfkjhdaaaabaaa#aa##aa#####aa#a#a#aaaa######aikjjhbaaabbaacbaaa###############.###################bfhggggggfedcabaaaaabbcdeccaa########aa##########aa######a#a##a##..#.#...#####aabbbbbcccecdgccb##a####a##a############aaa######agfedccccbbaaaababaaaaaaa####aabbaaaaabbababbbccccbbcb", "ababbccdffdbbbba###aa#aaaaaaa#baaaaaaaaaaaa#########.####ab###########aaaaaaabcbbbaa###aaaa#ba###aaa###abbbbflljeaaaaaaaaa###########aa##aaaaa#######.afikkiba#abbaaba##########a############################ehffgggfeedcccbaabababcccbaa######aa##aa###.###aa####...#########...########abbbbcbbbcdecfgdaa#######################aa##a####bfeeddccbbbbbaaaaaabaaa#abaaaaaaaaabaaaabbbbbbccccccc", "adbbbbcdddecbaba#a#######a#a##aaaaaaaaa#aa##########.###aac##########a##aa#aaaabcbbaaaa##aaa####aa#aaba#abbbbdillhcaaaaa####aa####aa#aaaa##aa#########.#chkli#aaaaabbaaa########a#aa###a###############.###aa#fggffgffedeecbbbaaabbbbcbaaa#####aa###a############################.######aababbcbbbccedcfccaaaaaaaa###############.####a#####bffeddccbbaaaaaaaabaaa###aabaaaaaaaaaaababbbbbbbcccc", "ccbbccddeeeccaaca##a####aaaaaa##aaaaa#a#aaaa#########.###ab####.#a###aaa##aaa#aaaabbaaaaaaaaaaba#abaaaaaaaaaaachkklfbaaaa##########a##abaaa############..#bimiaaaaaabaaba##########aa#babaa##############.##a##aegfcbdeedfedbbbabbabbcbbbaa#####a#####aa######################.#########aabbbbbcbbacddddccaaa#aaaaaa###a#####################afgeecdccbaaaaaaa#abccbaaaaaaa#aaaaaaaaaaaabbbccbcc", "ccedcdddeeeccbbbcba#a###aaa#a#a#aaa#####aa#a#############ab#####.#####aa#a#aabaaaabbbbabbba##aa###acb#aaaaaaaaacfihkida##a#a###.####aaaaaaaa##a###aa######.ahljc#abaaaaaaa###.####a######abaaa############.#####.bababeedegdcbccbcbabaaabba#a##aa####aba#aba#a###################.####a##ababbbcbbbcdddedea#aaa#a####aa#######.###.######a##a##fgfedddbbaaaa#bcdccbbba####aaaaaaaabbabbbbbbbcbbc", "cddeddddeefddcbbcc#a#aa#aaaaaaa#aaaa####aaa######aa######ab#a########aa#a#aaaaaaaaaaabbaabba#aab###abb######aaabbcfheihc######a#####aa#aaaaaaa####aaaaaa###.aikjcaaaaaaaa#################aaccbaa#a################aaaaaaabdddcbccbaaaaaaaaaaa##b####abbcccb##.###a#############..###aaaaaabbbbbccbbccccddecaaa#aaaa###a########################effedccaabbaccbbaaaacc####a#aaaa#aabbbbbbbbbbbcc", "dcdcdcdeddfecdcbcdaa#aaa##a###a###aa##############aaaa###aba#############aaaabaaabaaaabbabbaaa#aba####a##a###aaabccefadhhb##aaa#####aaaaa#aa#a##aaa#aaa#####.aflkcaaaabaa####################ddcbaaa#################a#aaa#bdddbbcbaaaabaaaaaaa#a####a#baa####a###a###aa#############aaaabccccbcccbbcdcdedefb##a###aa##aa###############a##aa####efddcbcecbccabbaa#aacc###a##aa#aaaabbababbbbccc", "ccdddcbcfhfddcdcbbc#####a#aaa##a########a#a#aaa#####aaa##abaaa##.#######aabbaabbaaaaaaaababbaaa#aaaaa###a#a#a#aaabccdha#diga##aba#####ca##aa####aaaaa#a#######acildaababbaa###########a#######abccbaa#########.#########a###cdedbbdcbbabba#aaa###a####aaaa#aab###a##a#aa######aaa######aabbccccccccccddddeddfca#aa##aaa#aaa#####a####.###aa#a##a#cfeddedacaaabcaa###aacc###########aaaaaabbbbbcc", "ccccddccdeffdcccdccb########aa##########a#aaabaa#####aa##ab#aa###########aaaaaaababaaaaaaaabaabcabba############aaabcffb.afjfa#aba####a#a########a#a########aa#abhjb#aaaba#a##########a#######aabcccbb####.#..###aba#########abddbcecbbcbba#aaa########aaaa#a#a###aaa########aaaaa#####aabccdcddccccccccddedcec###ba#a####a#a##########.######aa#adedcbbaabaaabbaa###aabca##aaa#a##aaaaaaabbbbbc", "cccccdcedcddfebbdcbdb#######################abcbba#######bbaa######.######aaaaaabbabaaaa##aaabababaaaaa########aaaabbcfiea#bgjeaaa######aa#a#############a####a#acgigaaabb##########.##a#######aaa#adcba##########ba#a#a#####a#adfcddbcccbaa#aaa######aaaaaa##aa#aabbab#aa####aaaa#####aaabbccdddcdcbbbbcccddegd##baaaaa#########a################abbcccbbbbabbbba#####abca##aaa####aa#aaabbbbbb", "bbbccddcdcddefdbcdadcaaa#####################aabbbba#a#aabba#aa##########aaaaaabbaaaaaaaaa#a#aaabbbbbaaaa###a#aaaaaaaabfifa##ejgbaaa########a##################acbcfigba#aa###########a#########a#aaabbbba#######.#a#a#######aaaaffddccbccba##aaa##########a######aabaaa#.####aa######aaabbbccdeeefggecdedcdfedcbaacbaaaa##a#a####a############a##aa#accdcbcbbbbbba#####aaca#aaaaaaa###a#aaabaab", "bbbbcccccddddfecbccbdc#a############a###aaaa#aaa#aa##aabcccc###########aa#aaaaaabaaaaaaaaaa#aaa#aaabbbbbbaa###a#aabaaabbbhie#.bfhfbaaaa###aaaaaaaaa#######a####aaabdhifbaa########aabaa###a######aa#####bccaa#####.#####a########afgeddccdcba###aa########a#a#######aa######.##########aabcbcccdffghihgdcddcbacbbeabaaaaaa#a###################a##aaaa#bcddcdcbbbab##a##aaaba#aabcaa####a#aaaaba", "bbbbbbcccccdefedbbcacdc####aa##a#.##a#.##abb######a##aabbccc###########aa#aaaabbbbaaabaaaaaaaaaaaaaaabbbccbaa##aaabaabba##diic##adhebaaaa#aaa#aa##aa##########aabaaagjjf#a######a#aaaaaaa#a#######aa#a###bdddaa#a###.#a###########adcdddddcba#aaaaa#a###a##a##ba#b###aa####.###aa#####a#abcdcbbcdghihhgdcaaaaaabcfdccaaaaa#aa###################a##a#a##acbcdcbbcba#a#####aaba##abaaaa###aaaaaaa", "aaaaabbbbbcddeedccebaccb###a####a####a#..aba##########aaaaccb.############aaaabbaabbaabbaaaaaaaaaa#baaaccbbaaaa#aaaaaaaa####fjfb###egebaabcb##aaa##############aaa#achkjbaa######aaaaaba#a#aa###a###########abba###################abaceddcbaaaaaaaa#####a#####a####a##a######.###a##abaaccddedeeffdghfaaaaaaaabbdfcabbaaaaa###############.#########a###bccbedcbdaa######a#abaaaba########a#aaa", "#a#aaaabbbbbbcdedcccbabbb##aa######.######ba#############abcc##############aaaaababaaaaabbaaaaaaaaaaaaabbcbbccba#aaaaaaaaaaa#beihb##afgdbbcba#aaaaa######a######aa#abcilheba#####aaaaabaaaaaa#########a####a##a#aaa###############a#aaadedbbaaaaaaaaa##aa##a#######a##aab######.##aaaababceefcddcb#.#gfaaa#aaaaabcfgcaaaaaba########.#####################aabddcbcabaa##a##aaabaaaa######a######", "##a#aaaabbaabbccdcbcbbbacb###a###########.aba#######aa###aacf#######.#######aaaaaabcaaa#acaabbaaaaaaaaabababbbcdcbaabba#abaaaaabfje#a#aehdaaaaaaaaba#####ab#a####aabaabijiebaa##aaaaaabaaaba##aa#####a#a###########a###a###########aaaaaabbbaaaaaabaaa#aaaaa#####a##abaaaaaa########abbabcdgeba##.##.bdaaa#a#aaaacfgcaaaaaa########.a########.#######a#aa###abccbbbaaaa#aa#abbab#abaa####aa#####", "#####aaabbaaaabcbccccbbbcca###a############a#########aa##aaacb###.#.########aaaaaaaaabcbaaabaaaaaaaabaaaaaaaaaabcaaaaabaaaaabaabaejhbaa#aggcaaaaaaaaa####abb#a###aa##aabhigddbababba#acbabaaa###aa####a#c#a#############a#a########aaaaaaaabbaaaaaaaaaa#aa##a#####aaaaaa###aaa######aabbabege##b#######aa#a##aaaaaceecbaaa############################aaaa##aaacbbbaaa##aaa#aaaaa##aa#####a#####", "####aaaaaaaabbabbdcbcdccbbba#aa####a##a####a######..##aaaaabab###.###########aaaaaaabbbbbbaaaaa#aaaabcbaabaaabbaaaaaaabbaaabbabab#bghcaba#dhfaabaaaaaa#aa###aa##aaaaaaaabeegbccbaaabcbbbaababa######aa#aaaaa##aa#.######aaa#########b#aaaaaabaaaaaaaaaaa#a##aa#aaa#aaabbab##a####ab#aabbbbcfhaaca##############abbabddbbaa####################.###a##a#aaaaa#aabbbbbaaaaaa###aaaaaaaa#######a###", "#####aaaaaabbbbbccdbccdcbcca##########a#####aa##a######a#aaaabc###############aaacaabbabbbbbaaaaaaabccbbaaaaaaababcaa#bbaaaaaaaa#ba#eiebabaafhb#aaa###a#a####aaabbaa#baabbbigcebaaabcbbcdbbbcca#a##a###acbbaa#ab##########aaaa########aababbbaaaaabaaaaa##a###a#aa###aaaca##a#aa.bc#abbdccbdga#####.###########abbbbcdebaa##a##a##########a####.###a#aa###aaa##aabbabbba#a#####aaaaaa########aa#", "#####bbbabbbabbcddddcccbbbcca#a##aa###a#################aaaaabb#a####.########aaaacaaaaaacaaaaabcaaabbcdcbbbcbabbbabbaaaaaaaaa####aa#cijdbababhfa#aa###aa##a##a#aaaaa#aabbbflggfaabacbaabbbaacbba##aa#abccbbaa###aaa#####a#aaaba###a#aaaaabbacbaaaaaaaaaaaa###aaaaaaaaaacaaaa#bbab#abbcccccbdc#################aabdceedebaa#########################b#####aa#####bbbabbaa#a####a#aa##ba########a", "aa##aaabbbbccbbcccddcdccabbdfa####a###########aa######a#a#aacc#######.#########aaabababbaaaabbaaaaaaaabbbbaaaaaaabaabbbaaabaaaaacba#a#beijbaaaaehfa###########aa#abaaaabbbbdhjghffedccaaabaabaabbaaaacbcbcccbaa#aaaaaaaa#aaaaaaaa####aaaabbaadebbaaaaaaaaaaa###aaabaa#a#aaaaabbbbbbbabcdcccefe####.##.#######.##a#aacccccaa#aa#####.###############aaa###.#a###a##bbbbbaa#a########aaaaa##a#####", "###ab#ababbccbcbccdddccccbbbeda##aaa######aa###abaa####a###abdb#a###.######aaa#aaabbbaaaaaa#abbbaa#aaaaabdaabbcbabb#aaaaaaaabaaacbcba####ejdbbbacgjd##aa#aa#####aaabbaabaabbejiiiihhggfbaabbbaabcba#bcdcdddddcaabbbbcbaaaaabaaaaaaa##aaabbbbcdedbcbaaaaabbaa#aa#aabbaaaaaaabccbbbbbcdccddffebb####################aabccccca###########.#########a####aaa####a##aa#abbaaaaaa########aaa####a#####", "#aaaaabbbabbcccccdedccccedccdebabaa#aa###########baa##.##aaa#aca#######.#####aaa#aaabaaaaaabaaaacbaaaaaaabaaaabcbaabaa##aaabaaaaabaaaa###.cjgcbbbadiib##aaaaa####aaabbaaaaabdhlijjiiihfefcbaabbbbbbababdedfddedccbccdccbccdccccbaa#aaaaababcccdddcccbaaabbaaba#aaaabbaabbaccdddcdefffedeeed..################.######abcbdfbab#a###########################a#a#####aaaaaaaa##aaaa######a##.#a####", "###aaaaabcbabccccdcddcccccbbccebaaaa##############a#a####aaa##abb##############aabaaababaaabaaaabbaaaaaaaaaaaaaabbcbabbaabaaaaaaaaaaaa####.afhdbbaabfihb.#aa###aa###aaba#aaacclljjiijigddecbaabccbabbbdbadcbeffffeffgghhhighgfhgffcaaababdbbbbcfddddcbbbbbccabaaaaaaababddehggfegjiedaaaa#a####a##############.######bcdcddbaaa##a###################a#a#####aa####aaaa#aaa#a########a#######aaa", "aa##aaaabaaabbbdddccdbcddcccccdd##a#aa##aa########a######aaba###ab##############abaaaaacbaaaabaaaaaaaaaaaaaabbaabbaccbaaaaaaaaaaaaaa#########bfgbaabbdije.######aa#abbaaaaaaabellkkkkllkiiigfdcdcbabbcbcdcbcgijkjhhhhijjic#dcbcbddghffeeeihiggfgddedcccbcdcdcbcbcbabadeeffghhhebegdddb#########a#a####################babbbcbbb##a##################aa##a####aa#a###aa#a#aaa##a#######aaaaa##aa#", "a#aaaaabaaaaaabcdcceccefcadgeceebba###a#aaa########a#####aabaa#aabda########a####aaaaaaabbaaaabaaaaaabbaaaabbbbaaaaaabbcbaaaabaaaaaaa#aa######.eiebbbbcfihc#.###abaaa#aa##aaaabellkjlkjklmnnmlkgfccbbdddeefghjijkkllkhd#cfeabcbbcbbdgjjhgecccehieeededccceeedddddefcdffcedbacdec#bbaba#########aaaba#########.#######aaaacccdbbaa####################aa##a####aaaaa#aaaaa#a####aa######aa#aa##aa", "a#aaaabaaaaaaaabcccdddggedbdfccecaaa###aaba#a#######aa#.##aabba#aabc###########aaaaabcbaaaabaabaabbbabaaaaaabbcccaaaabbbbbbaaabaaaaaa#aa#aba###.bigbbbccdilid.##aaaaaa####aabbbcekmljgdfiijikmlmnkgdeefeeegieeddgdcghgdbabcfdebcccceffggfcbbbbbcefgedddcceeefdedcbccefgb####babedcaa##aa#######aabcda##.#############aaaaabcdcdbaa#########a########a###a###aabbbbaa#aa#aaaaa##aa######aaa##aaa#", "##aaaaabbaaaaaaabcdceeffedccfgedcaaa##aaaa###a#a#####aa..##abaaaabbd#########aaaaa#a#bbbbbbaaaaaaabbbbbaaaaaabccbbaaabaabbbbab#aaaaaaaaa#aaaaa###ahibbcdccgjkg####a#aa####aabbcddegkhddgihhghiibdilmljjjjiiihfaaa##aeeedcbbdghfdbbdfedfedccbbbbdbffhfededeefhhfc#####cea#####aaabdfda.a######.##abdfb##########.###a##aaaabadefecb#a##########aaa####a##aa####acbbbaa##aaaaaaaaaaa#####a######a#", "a##aaaaaabaaaaaabacddeddfdccefffd#aaaaabbaa#a#####a#.aaa###aaaa#abbdb########aaaaba#aaaaababbaabbbbbbbbbaaaaaaa#abcbaaababbbbcb#aa#abaaa###########fhdcccdcehihb###aa######a#bccdefggiglkjjhiihba#cglkjhiihgebcaaaaaa#aacdbbdefhfdbbeedbccbbbabdcbgjifefedeggfgfa#aa#a.aa######aaaacffba####.###abdeca######a###########aabbegffgedaaa##########aa####a##aaa#####aaaab#aaa##aaa#aa######a#######", "##aaaaa#aaaaaaaaabbcdddceddeeecdfbaaaaabbbaa#####ab#########aaaaaabbc########aababbaaaaaaaabbbaaaabcbbabbaaabaaaaaaabbbbaaabaabbbcaaaaaaa##########.bhfcccdddefigc#abaa#aaaaaacccdegeiihkihhjhbbaa#.#a##a#..##aaaaaaaaaaaacaabaacefedefbbedcbaccdbcfgiihhfdec.addb#ba###aa######aaaaadgeca#######aceaaa#################aaabdgeeghffb########a######aa####abaa#####a#aaaaaaa#aa###a#.######aaaa#", "a##a####aa#aaaaaaabccbccdedefebbef#baaaaaabaa#####a#aaa####aaa##aaaada########aaabbbaaaaabbaaaaccbbcabbbbaaaabaaaaaaaabbbbabbbbaabcb#a##a#########a##bifdccdddefgjeaaabaaaa##accbbcddfhehijhdb#aaaaa#a####a#abaa#aa##aa#aaaaaabbbaabefigffefdbcccdcbaacbbdhhfeaacbabb##a##########aaaaadhgb#####aabecaa########a###########baegfefgfeca##a#######a##aaaaa#aaaaa####aa#aabbaa#aaa###a#.#####a#aaa", "#aa#####a#a#aaaaaaacccbbccdcdedbcfcaaabbbaaaaa####a###a###abdb####aaeda######a#aa#aabbbabbaaaaacddbaaaaabaaaaaaabcbaabbbaabbbbbbababa####aa###aaa#####dihecccdedeejgaabcbaaaaabcbbbcdeheggeabaaa####aa########aa###aaaaaaaaaaaaaaccbaabdegedddddddccbbbba#abaabcbbaaaa##a##.#.#####a#a#abefb#####abdfaaa#####aaaa#a########aaadfeeffffc#######a######aa#aaaaaaa#aa##aa#aaabaaaaaa#######.###a#aa", "aaaaaa#aaaaaabaaaaabbcbbabbbcceedffdbaabcaaaa##abaa##aa###acefa####abdaa###.####a##aabbbcbcbaaaaabba##aaabaaaabaabbbaabbbaabbbbabbcbba#a##aa###aaa#####bhjgccdddefdhheabbaaababcbbabcdehfcaaaaaaaaa#aaaa#######aa###a##aaaaaabcdaabbbbabbbefedeccddcbbbaababbbcccca#a####aa#############aaceda###aabfebaa####aaaaa##########aaadefedegca########aaa##aaa#aaaaaaa##aaa##aaaaaaa#bcba#########aa##", "#aaa#aaa#aaaababcbbbbccbaaabbbbdgffgbaabbbaaaa#aaa####a##abbgea##aa##bca#########a#a#bcbabbbbaaaaaaaa##aabaababbbaabaabbbbbbbbbaaaabbaa##a#####aaa######adhidddddfhdfigbcba#aaaaaaaacbcfdabaaaaaa#aaaaaaa#######bb#####aaa##aabccaaabdcaaaeeefeddefcbbbbaaaabcbbbcdba#####a####..#######a##abdb#aabcefdaa####a#aaaaa#######aaaaaabacefc#########a###aaaaaa##aaaaaaaaaaaaabaaaa##aaaa###.#####aa#", "#############aabaaaabcbbaaaabbcceeeeeaaabbaa##a###ab#####abddb#####a##cb#######aa#a##aabbbbbbbaaaaabaaa##bbabbbaaabaabbbacbcbbbcbbbbaaa###a######aa##a#baaagkecdeegfeehfcbba##aaaaaaaaccdcbaccbaaaa#aaa##aaa#########a##a###aaabcaaaadeddbbdcdeigfdbcccbaa##cbabcbcdaaa####aaa######.######aa#debaacfdcaa#####aaaabaa########a##aabccdd#############aaaaaaa###aaaaaaaaaaaaaa###aaaaaa#########aa", "#############aabbbcbbccbaaaabbccddeedca#abaaa#aa###a##.##aaaa#######aaaca############aaaaaabaabaaaaaa##a#aaaaabbaaaaabbbabbbcbbccbccbaba##########a##aaabaabejfddddehddhgdbbba##aaaaabbbcccaabaaaaa#a#a##a#aaa###############aabcaaaaaegeddcecacdghfdccbaaa#cbabcbac#######bba#################bcdcbeebaaa###aaaa#aa#a###a####abaabdcdcba#a##a####aa###aaaaa##aaaa#aaaaaaaaaaa#aaa##aa#########a", "aca##########a#aaabdbcccbaaaabbccddeedbaaaaaa#aa#########abca#######a#aca############aaaaaaaaaaaaaaaaaaaaaaaaabbabaabbbbbabbbcbbbbcabbbba##########aa###aabbbeidbbccehefhhcbbaaa#aaabbaaabbcaaa#abcaaaaaaaaaaaaa#####.########aaabaacbedfdbbbdccccfhebaabaaa##a#acaba######daa###.######a####aa##acfdfdaa####aaaaaaaa###aca#aaaabaabccdeaaa###aa#aaaa##a#aaaaaa#abaaaaaaaabaaa##############.aab", "aa#bb#####.######aaabcccbbaaaabbbcddeebaaaa########.#####abca##########abaa####a#####aaaaaaaaaaaaaa#aaaaaaaaabcbbaaaaaaaabbbbbbbbbccabbaa#a#########a#####aaaachdbccdefehgiebbbaaaaabaaabccacbaaaacbaaaaaaa#aaaaaa#############a#baaaaceddbaabcbebbefdcaaaaa###ba#baa#####.aba##############a#a##aacfghdcaaaa#abaaaaaa######acbababbbdbaa###aaa#aaaa#a#aa#aa#aa##abaaaaaaabaaaaa##############ba", "a#aa#a#####.###a#aaabbcccbbbaabbbccccge#aa#######.#######abbba#######aaabbaa####bba###aaaaaaaaaaaaa#######aaaaabbbbabaabbaabbbbcbbbcbabbbaaa#a##a##########aaaabeccccddfgefhgaccaa#abbabbbbabbbba#aa#aaaaaaaaaaaaa#######a#####aaaaaabacdccabbbcecaacdfecbbaaaa#aaabaaa#####aa########aaab####a###aabeggbaaaaaaaaaaaaa#a##a###aaaabcccccaa###aaaaaaa#aa#aaaaaaaa#abaaaabaaaaaaa#a###########a#aa", "###aaaa###a######aaaacccbbbbbbbabccccehb#a########..#####abbca#######aaaacaa####cca###aaaaaaaaaaaaa#######aaaabaaaacdbaaabbbbbbbaabbbbcbccaa############a#aaaaabaccbdccegeccffbbaa######.#abaabbbaaaaaaaa#aaa#aaaaaaa#a##########aaaabbcc#abbabaabaddcbceebbba#aaaaaba######a############aba###a##aaaccggbaaaaaaabaaaaabaaaaa#a#bbabbccdb#aa###aa#aa#aaa#a#aaabaaaaab###abbabaaa###a#a########aa", "###aa#a######.######aacccbbbbbabbbccccfheaaaa#############bbcaa#######aaabcaa#####aa####aaaaaabaaaaa#aaa##aaabaaaaaacdcbaabcbbcbbbabbaabbbbca#a######aaa##a##a#aaacabccdeggacge.#aa####a#baaaabbabaaaaababbaaaaaaaaaaaa#########aaaaaaabda#aaabbbacbcdbbcdeca#a#aaaaa#a#aa#aa#############aa#####a#aaabcfgcabaaaaabaaaa#aaa#####babbbcccc##aa#a#aa#aaaa###aa#aaaaaaaaaaa#aabbaaaa###a#a#####abba", "###aa##aa##########a#acbcccbbbbbbbbbcceffebaa#############accbaaa######a#bdcaaa####aa##aaaaaaaaabaaaaaaaa#abbbaaaababcddccbcccccbaabaaabbbbbca####a######aaaaa##a##bbabcbdgefeed########a#a###ab#aabbbaaaaaaaaaaabaaabba#####a#.#a##aaaabca##abbbaccbbdcbcdedb#aaaaabaaa###aaa#########aa#aaaaaaaaaaaaabceecc##aaaaaa#a#aa########abbacccc##aaa#aa##aaaa###aabaaaaabaaaaaaabaaaa####aa#####a#a#a", "b###aaaaa#######.##a##abbdcbaabbbbaabccdegea########a#####abcbba###aa####acccaa######a#####aaaacbbbabbccbbaaccaaaaabbbcccbcbccbbaaaababaaaaabc###a#aa#####a#aa#a#aabdaaacbbafhgbfa.#####aaaaaaaaa#aabaaaaaaaaaaaabbbaaba###a###########baba##aaaabacaabccbccdeeaaaa#aaab####.########.##aabbbaaaaaaaaaaabccaccba##abbaa###a##a###a#aabbccca#aaa#a#abaaaaaaaaacaaaa#aaaabbaaaaa#aaaa#a#######a##a", "baabaa#######aaa#####aabbccbbaaabbaaabccdfeba#######aaa###abcabbaa##aaa####ddbaa######a###aaaaaaaaaabbcbbbbbccaaaaaabbbbbcccccbbbaaaaaaaaaa#abca##a#aaaaaa##aaaaaaabcaaaabaabgicce##.#a##aa#a#aaaaabaccbaabaaaaaaaaabbbaaa#aabb##########aa#aaaaaaaaaaabccccddfebaaaaabbaa################bbbbbbaaaaaaaabbbc##acbbaaaaaa####a#####aabbbcccb###aaaaaabbaaaa#a##aa####aba#bbaaaaaaabaaa#######a##a", "baaaaa#######aa#######aabccbabaabbbaabbbcdgdb#a########a##abdbbaaaa##aaa##abdcbaa#############aaaabbbbbbbbbabccaaaaaaaacbbbcccbccccbbaaaaaaaabbca#aaa#a#aaaaaacbabaa#aaaaaccbbjgabc###bb######abaaabbcccbabbbaaaaaaaaaaaaa##aaaaaa#######aa###aabcbaaaabbbccdeeefebaccbbbbb#.####a####.###abaabbbbbcbaa#aaabca.##acccbaaaa########aaababbcba##abaaaaaaaaaaaaaaaa#aaa#baaababa#bbaaaaaaa#######aa", "aa##aaa###############a#abcbabbaaaabaabbbcffcaa##aa##aaaa#abbbbaaaaaaa##a##abdbaa##############aaaaabbaacbabbbcaaaaaaaabbbaaabacbccbbbaaa#aaa#aabb#aaaaaaaaaaabbbbaaaa##aabbbadiabbc.##c#######aaaaaabbccbbabbaaababaaaaaaaaaa##aa#######a#####aabbaaaabcbbbcddcefhgceeaabba##############abbbbbbcbaa###.###aca####aacdba#a#a######aaaabbcbbaa##aaaaaaaaaaaa#aaaaaaaaaaaaaa#bababaaaabaaaaaaa#ab", "cb####aa################abcbbbaaaaabbaabbbdgdb##a#aa#aaaaa#abaabaaa#bba####aaddba#######a#########a#abbaaccccccbaaaaabaabccbbabaabcbbbbaaa#aa###acda####aaaabaaabbcbbaaaaa#bcbcebbccd#.aba######aaa#a#acbaaabbbbbaaabbdbbca##ba###abc.#.####.##a#bbaaaaaaccccdecdefghgfccccb#.####.#...###aaaabbabddba###...##bb#####a#bcba##########aaabbccaa###aaaaaaaaaaaaa##a#aa#aaaaaaaa##ababbaabaaaaaaaab", "ec##########a##aa#.#####abbcbbaaa#aa#ababccfffcaaa#aabaaaaaabbaaaaa#aba###aabbfdaa###.#############a#aaabbccbbccaabbaabbbbbbbbabaaabbbbbaaa#a###aacdba##aa#abbacbbcbbbaabaaabbceabccde.#c#aa######aaa#aaa#aaababbabaabbdefecd#aaaaaaec#.#########aaaaaa#aacdcbdbabdfegddffdba##.#.###.###aabbbbabbccbba###.#.##bc#######abbba########aaabbbddcaa##aaa##aaaaaaaaaa#aaa#aaaa#aaaaaababaabbaaaa##ab", "bca######.#####aa#######abbbbac#a##aa##abcdcehfaaaabbbaa#abcbbbaaa#aaba#####acegdaa####.############aaaaabbbbccccbabababcbbbbbaabbcbbabaa##aaa###aacebba###bffcdbcbbcbbcaaaabbbhbabbcee.##aa##aaa#acaabbaaaaaaabccaaaaaabdefge##aaaacea###########a######abdfdabaaaaababaceeb###.#...#.##aaabbbabbbaabaaa###..##bea###a##a#aca#a#a#####aaababb####aaaa##aaaaaaaaaaaabaaaaa#aaaaaababaaaaaaa###ab", ".#a###########.b########aacaaaacaaaaaaa##acdffgbaaabaaa##aaehdbaaaa#aaaa#####acfgbaa#########.########aaaabbabcdecbaabbabbbbbbbaaababaaaa######a##aaddbaaaaab##a##abccccccbbaabfhaababgd.######aa#aaaaaaaaaaaaabacdddbaaaaaaddeda#aa#ba######..##a########abdcaaaaababcabbbcddb#a###..#.##aaabccbbaaaaa#########abed#########cb#a#a####a#aaaaacb###a#aaa##aaaaaaaaaaaabaa#aaaaabaaaababaaa######", "#########aaa###a########abbaaaaaaa#a#aaaaaacdegeaabaaccbaa#acefcaa###aabba###aadfdbbaa####.#############ababaaabcccaaaaabbbbbbbabaaabbbbaaa#####aaaabdeaabbba########aabdedcbabbffaababhd########a#aaaaaaaaaaaaaaacedbabaaba#bfggcaaa#########..#.########aabcb#aaaaaabaababccddba#..##.####aaabbaaaaaa##...#####acecb########abba#aa#a#aaaaabbca##aa#aa#aabbaaaaaaaaaaaaaaaaaaabaaaaaabaaa#aa##", "##########aa###a#####aaaaaaa##aaaacc#a###aabbcefbabbcfcddddbabgfa#a#aaaadbaa##abdedcaaaaaa#############a#aaaabbbbaacbbabbaabbaaababbaabababa##a##aaaaaccbbbb########.###abbacdcccgbabbbcida####aa#a#baaaaaaaa##aaabccaaaaaacbbabggb#a#####aa##..##aa######aabbcbaaaaaaaba#aabbcccca#.########aaaaaaaaa###...#######abdec########abb#aaaaaaaaaaabcbaaa#####aabbbb#aaaaaa#abba#aaaaaabaaaaaaaaabb#", "###########aaaaba###aaaaaa####aaabdebca###aabbcfgfbacdccdeheaadgea###a##dcabaaaabdedcbaa##################aaaaabbbccbaabcbaabbbbabbabbbaaabaa#####aa#abddbcb##a########a##.##accdeedbcccejcbaa####aaaaaa#a#aaaa###aabbbbaa#bdbb#chfa####a########.###########babbaaaaaabaa#aaaaabbcdc#..######aa#aaaaaa###.#..#####a#abdeba#######bbbbaaa#aaaaaabcca#aaaa#aaaabbbaabaaaaaaaba#aa#bbaabbaaaa#####", "######a##a###a#aaaaa#aabaaa##aaacddbbcaa##aaaabdifdadeeddfffaabdddbaaaaabd#aaaaaacfedcaa#################aa###aaaacccbbabbbbaaabbbbbbbbbaaaaa######a#aaacdddaaa#########a######aabbicceedghcbb##aa#aaaaaa#aaa#a####aaabbaa#adffbafgd####aa###################aaaaaaaaaaaaa#ababaaabbbcb#.####aaaa#a#a#a##..########a#aabbcdd#.###a##bbaaaaaaaaabbbbba######aaaacbb#abaaabaa#a#aaaabaabbbabaa####", "######aaaaa####aaaaba#abaaa###a#bddccaaa######abcfgghhhfdfffcacbabdecca#bca#aba##aeffeba##############.########aaaaccbbbabcbbbaaaababbbbbbbaaaa######aaaabeeaa#aaa######a###a#aaaabfgdbbddhhccb###aaaaaabaaa###aa##aaaaaaaa#bffgd#cda##a#a######a#a###########aaaa#aaaaabb#abaaaa#aaaabbca####aa#aaaa####.#############aaabcdc#####a#abba###aaabababc#aaa##aaabcaaaaabaaaaaaacaaaabaabbbbbaaa###", "a######aaaa##a#aabbaaaaacba##a##acccddbaa#a##aaaaacccdefefefdacaaaacgebcdb#a##aacbbegfdba#aba##############aa###aaabcdbccbbabcbbbbbbbaabbabaaa###a###aaaabcdb#baa#a###########aaabddgcdcbbcfidbcb#aaaaabaaa#a#a#abaa###a#aa##dfffeaa#####a#####aa##b.######.###aaaaaaaaaacbacaabaaaa#aaaacccaa####################a########abceca###aa#abaa#aaabaaaacda#aa###aacaaaaaabaaa#aaabaaaacbbbbacaaaaaa", "aa##a###aaaa#a##aaaaabbbbbbba####bbbacbaaaa##aaaaaabccbdedcefaccaaa#accccaa##aaabcddfgefeeffea################aaaaaabbcbcbbcbabbbaabbaacaaaa#a#######a#aaaacfcaaa##a############aacdee#a####eifccc#aaa#ccaa###aaa#ba###a###a#befffd######aaab###aa############aaaaaaaaaabbcbcdbbaa###abbaaabccdca...#######aa#a####a######aaaabcdc######aaaaaaaaaaabbcdbaaa##aababaa##aabaaaaaabaa#abbbbaaba#aaa", "#aaaaa##a#.###a#aaaaaceccbbbab##aaaaaaaaaba#aaaa#aaabccbcdddgfdaaaa######aa##a#aaaeggihgeefeddeca###############aaaaababcbbbbaabaaaaabacbaaa##a#####ba#aaabadgeaa#a##a####a##a##aabbeeaa#####bhibaca##aadbaaaaaca###########aadfddfda###abaabb#aaba#####a######baa#aaaa#abdc#bccbaaaa###ba#aaabdfeec#########aa#aaaa####aa#aaaaabde###a###aaaaba#aaaabbccbaaaaaaaaaa#a#aaabaaabbaaaababbbbaabaaa", "##aa####a#####aaaaabcccbbbcbbaa##aaaaaaaaabb#baa##aaabbcccdefgiecbaaa##aabba###a#affghihfccdddddeca################aaabaaaabaaaaaaaaa#aaaabaa########aaaabaabcgcaaaadda#aa#######aacdde#######aegbbdbaa#adbbaabcaa#aa#########acfeeecaaaaaaaabbaaaba###########aaaaaaaaabddfbaaababaaaaaaa##aba#acefgca###aa#####abb######aaaaaaabcfa##a###aaaabdaaaabbbbdb###aa#aaaaaaaaaabcbbbbbbabaabbbbbbaa#", "####aaaa#a#####aaabccccbaabcbcca##aaababbabbabaaaaaabcccbacddefffdccabccdedaaaabdeeffgggeccddccdcdca#a##############aaacaaaabaabaaaaaaaaaaaaaaaa###aa###aaaaacdgcaaabaaa#######a##abdchaa######.cfcbcb#a.bffcbbbab###aaaa###a###ceedddabcbaaaabbabbaaaa##..#####aa##aaaa#acecbbcbaaaaabaaaa##aba#aecbccdcabaaa##abbaa#a##aaaa##aaaabdd##aa##aaa#aaababbbbbdb#a##aabaaaaaaaaaaaaabbbbbbcbbbbcbbaa", "aaabaaaa####aaaacccbbcbbbaaaabdaaaaabcaabcbbbbbaa##abcddcbcdefedffedbdccdeec#aafffdddeffcccbcdcccccccaa#############aaaab##aacaaaaaaaaaaaaaaaaaaa###aba#aaababdefaaaaaaa##a###aaaaabccgcaa#######bgcdeca##bhgbabaac##a#aaa##a###befddfdddbddbaacabbbbaa####.#######a#aaaaaacbaabbbaa##ababa##aa##acaaaabbcb#aa#a#aaa##aa#####a#a#aaaabeca#aaaaaaaaabaabbbbbdb#aaa#abaaaaaaaaaaaaaaaaaabcbaababaa", "aaaaaa#aa#####abbbcbbabcccbbaaabbccccdbabccbbbbbaaabbcddcbceeeddeggddfbcdeec###dffedddeddcccedccccbbcdb#################aa#aaabaaaa#baabaaa#aaa######aaaaaaaabbcdfaaaaaaa#a####a#aaaabge##########bhcbccaabdeeaaaa###a###aaaaaabceedefeeedeeccabbabcbbaaaaa##.#.#######aaaabbb#aaaaaaaaaabaa##a##aaa#acbcabca###aa####aa#########a##aaaedb#abaaaaaaabbabababccb#aaaaba#aaaaaaaaaaaaaaaaabbbbbaaa", "aaabaaaaaa###aaabbbbbaaaacbbbbbcccddefdaabbbbccbbbbabbccbcdddddeeeffefcedffedbabeeecddcbcccbdbbbabbbabba#aaaaa##a######aa#a##aaaaa#a##aaaaaaaaa###aa##aa###aaabbdedaaaaab#a####aaaaabbgha#a########becaccdfgddda#aa#aaaabaaa#a#addeecdcdfeeeddcacbbbcbbaaaaaa###########aabacbaaaaabaaba#baba#aa##bbbdbacaabcb##aaaaaaaaaa#########a#aaabddbaaaaababbbbbaaabcccbabaaaabaaaaaaaaaabaaabaaaabbbbaa", "abbabbaaaaaaaaaaaabbabaaaaabbcbbcdedfggccbaaabbbbccccbccddeddccdddcddecddeffddecddccacbaacbbbbaabaabaaaaaaaaaaaaaba####a###ba#ba#aa#####aa#aaaaa############aabbcdebbbaaaa########ababdhf#a#########afecfffebceaa###aaa#aaaaa##abeeddddeegffdcfdbbabcccbaaaaba###########aaaabaaaabbaaabbbaabbaaaaacdcaacaaaabca##aaa#aa#aa#aa#######aaaaacee#bbaababbbbbbbbbccdcaaaabbaaaabbbaaaaaaaaaabaaaaaab", "babbaaabaaa#aaa#aaaaaaaaaaaabbbbcdbadccdbbbaabbbbbcbbccdeeedeabcccccccccdeedfddcccdbcbaaaaaaabbbaaaaaaaaaccaaa#aa##aaaabbaab#a####aa####aa##aaa###############abcdedbcba#####aaaa#aabbdhie.#####a#####fgffececeda###aaa#aaaaaa#cddecddcddefeegefeccbccccbaa##aaa#.#####.##aaaabaa#aaaaa#aab#bcccbbccbbaab#aaaabcbbaa#aaaa#a#a######aaa##aaabdfdbbbbabbbbbbbbbbccccaaaaaaaaaaabbbbbaaaaaaaaaaba#b", "bbaaabbaaaaaaaaaaabaabbbaaaabbabcedcbbabccaaaaabbbaabbceffcccbbcbbbbbbbbddcdddbbbabbbbaa####aaabaaaaa##aacfeaa######a##aaabbbaaa##aa#a#####bcca#a##aab##aaa#aaaacccgdbbb#######aaaaabbbdhhb###########aeifddbbceda#aaa##aaabaabefffcdddccdeeeedeffefeddccbaa##aaa###.###..aa##aba##aaa#aaabaaabccddcccaabaababaabcca###aa#aaaaa####aa#####aaacffbbbbbbbbbbbbbbbbcdcaaaabbaaaaaabbaacbaaaaaabbbab", "babbbabbaaaaaaaaaaaaabbbaaaaabbbceddcbaaabbbbbaaaaaaabcdffdcabbccbbaaaabbbbbbbbaaaaaabaaa#a##aaaaaaa####aadd######a########abbaaaa##a#####a#aa########aaaaaa#aabbbbdgcaaa###aa##aaaaabadfgb######aa###aadidcdbaceca#aaaaaa#abcdeeeccdeddccddeadeefffffffecbaba#######.###.##aa#abaaaaaaaaabcaaabaabcbd#abaabbbbaaabdba#a#a##a###aaaa#########aacefdbbbbbbbbbbbbcbcccaaaabaaabbaabaaccaaabbaabbaa", "baababbbbabaaaa#a##aaabbbaaaaabccehdbaaaaaaabbaaaa##aabdgieccccbcbaaaaabaaaaaaaaaabaaaaaaaaabaaaaa###a###aaa################aaaaaacba######a#a##########aaaa#abbbbbcdhb##a####aaaaaaaacbfe.##aaaaa#####aadhcbbaaefbdb##aaccddfgedbddccccbbcdedceceggfeefefdcbaaaa#####.###.###aaaaaaaaa##aba#aaaaababdb#aa#aaabaa###bcbaa#######aa#############abdffcabbbabbcbbcbcbcdcbbaaabbbbbbbaacabaaaaaaaaa", "bbbbabbbbbbbaaaaabdcabdcaaaaaabbcdffcbaabaaabbbaaaaa##bcgjfbbbcdddcbbbbbbbbbaaabaabbbaaaaaaaaaaaba#########a#a###############aaaaaabaa#######a######aa#a##aaaabcbabbcceda#aaaaaaaaaaabbbec.a#aaaaaaa####aadhcabbbeecbaaadefggfeddcddcccccbccdccdddeghggeeeddcbaaaaa############abbaabaa#aaaaaaaaba#ba#aaaa#abaaaaa##aabbb###aa#a#a##a##########abbcffdcabbcbbbcccbbccccbaaaaaabbbbaabbabaaaaabba", "bbbbbbbbbbbbbbaaabfdcccbcbaaaaacdceebaa####aaabbbbaa##bdghfcbaaacdddccccccccccbbababbbaaaaaaabbbaa#a##aa#a#b##a#aa###a#######abaa###aaaa##a################aaaaabbbcbbcffaaa#cbaaaaaaaacec.#####aadea##a#aabgdababdfda#adfggeddccccbbbaccbbcbcddddgghigffffbabbaaaa##########ab#aaaaaaaaaaaaa####aaaabaaaaaaaaaa####a##aaca##a######a#########acbbbbcdefdabbaabccbbbbccccbcbaaabbbaaaababaaaabcc", "bcbbbbbbbbbcbbbbbcecccbaccedaaabddcaaa#######aabcbbbaabdfhfdcaa###acdcabdfeeedcccccbbcbbaaaaaaacbaa###aaaa#aaa#####a#aa##aa###ba###aaaaaaaba############aa#aaaaaaaaaabbbfgaa#adbaaa#aaaaehaa###aa#adea#a#aaabgbabacefdb#dfffedccbbaaaaaaccbbcdecdggihihhfdffcbbaaaa###aa###..#aa####baaabaaaaaa#####aaaaaaaa#aba#a###abaa#cbaa##.##aa####aa##aa#baaaacccefdbbabbcccbbbdccdbaabbbbbbbaaabbaaaaabc", "cabaabbbbbbcbcccccddb##abaccbabbdbcaa#a##a####aabdcdbbcdddghcbaaa####bcacigggecbbbcbcbbabcaaaaaabaaa#a##abb#########a##aaaaaaaaaa###aaaaaaa########aa##aaaa#####aaaaa#acegfaaa#aac##aaaachfc###aa###aabb###a#bbabccddefdceffedbcaaaaa#aaabbbbcdegihhhhgggdcffecabaaaa##a##.###abca#aaa##aaaaaaaa######a###b###baa####aaaaaaaaabca###############aaaabbbbbbdfebbabcccbcdcbbdcbbaababbabaabaaaabbb", "febaaaabbbbcdcccccb#####abbabbcccbbaaa####aa#a#abdeccbddeeehgcaa#a#aa#addhifdddbbccbcccbbbbaaaaaababaaa#aaba####a##a#a##aaaa#aaaaa#a##baaaaaaa#####b###aaaaaa##a##aaaabcefihefc##aaaaaabbdha####aaaa#ab######aaaabbccdefegffdcccaa#a##aaaaaabbehhhhffffcddbdcdbbba#ac######..###bb###a#abaaaaaabba#####aaa######a#aa#####a#####bbca###########a##aaabbbaaaabdfdbaccbccbcbbccdcbbbbaaaabaaaaaaabb", "dedbbbbbbccbcdccddb#####bbbaacccacbaaaa###aaaaaaacfdcbcdegghigbaa#aaaaaadfhgedcccccbbbbbbbbbbbbbbbbaaaaaabbba########aa#aaaa#abaaa####aaaaaa############aaaaaaa###aaaabcfghgihfbcb#abaaabbge####aaaaab######a#aaaaaaccdeeddfdbcbaaa##a##aabaafhgggfedccccdccbaaabaaaaaa#########a#####a##aabaabcaa#aaa#a#####.####a###########a#aaaba##a####a#aba#aaaabbaaaaabdeecccbbcbbccccdcbabaaabbbaaaabbba", "bccdcbbbcccccbcdfda#####acbabcbaabaaa#a###aa#aabbbefedcdffiihhcaaaaaaaabacfffefedcbbbbbaaaabbbbbbbbcaaaaaabaaa####a###a##aaaaaaaaba#####aabaa###########a#a####a###baabccghfhiieaa##aaaaabdga##a#a#aaaa######aabbaaabbbcddegdcbbaa##aaaaaaabbfedfddecbbbbbbaabbabbaaaaaaaaaa####aa####a#a#aaaabcbaaaaaaaa##############.######a#a#aabbba#a####a#aaaabaaabaaabbabcfedcbbbcbccccccbabbabaaaaabbccb", "bbccccbbcccccdddeca####aabbccca##aaaa##a#####abbbbeeffeeccfjjifbaabaaabbbcdecdeffdbcbbbaabbbccccbbdcbaaaaa###########a#a#aaaaaba#a######aaabcaaabaa###aa#aaa######acedbcdfihfhifba####aaaadhc###aaa###########a#bbaaabbccccfecaaacca##aaaaaccffdfccedbbab#a#aaaabbaaabababaa###########aaa###bbaa#aaa#abaa##########.########aa####a#aabba#a###a###aaaaabaabaaabbbcdfedbcccbcccccabbbbbbabbbbbbc", "bcdcbbcccccddddddba####abbbbdca#a###a###aa####aaabcededcbbgiijjhcabbaaaaaccddddcceedddddddeeefedbbcbcccbbbbaaa#a###aaaaa###aaaacaaa##a###a##acca############acaaaaa#abbccdghccggfcaba#aaaacggdaaa###############abbbaabbdeefedbaaaadda##aabbchedeefedbaaab#####aabbaabacbabaaaa########aa#a###aa####aaabba##a##.#############a#a####aaa##abdba#########aabbaabbabbaabdeddcbbbcccccbbbbaabbbccbba", "bbddccbccdccdcebcbb#####abccbcd######aa##a######abcddcdddeggiihhhdaaaabcccceedccbbcbbccbccdeeeggfeddccdeccbbaaaaaaa#a##aaa###aaaba#a##aa######a#####a######aaaaaaabaaababcehb#adcbdbba#aaabdceaa#################abbbbbacgeeecca###bedcaa#adfhccdffbbbba###a####aaaaabbbbaaaba###aaaa##########aa#.##aaaaa#aa#b######a#######aaaa##aaaa###abcdb######a#aabcbaabaabbaaabcdedbbbcddcbbbbcabbbccbbb", "bcdfdddcccdddcecbb####a#aabccabaa#####aaaaa#####abbccdedeedcijfggfabaabbbbccddccbbbabaaaaaaaaabbbgihihffedccbbbbbbbba#a#aa####aaaaaaa##aa#######a###aaaa########abaabbbbaccega#cdaaabaaaaabbfea#a#################abbbbbaeedddcbaaabacceccefihdccedcbaa##########aaaaaaabbbaaaa#####aaa##a############aa####aaaa######a#####aa##a##aaa###aaa#a#abc#aa###aabcaaaabbbbbbbbbbcddcbccddcbbbbabcccdcc", "ccbcffhfdddddccadbaa#####aabbaaba##########a##aaabbaacdddfeehjifgha#aabcbacddccbbbbbabbaaa#aabcccefgdddeffeecdedbbbbcba###aa####a##aaaaa##a###aa###aba#aa######a#aaabbba#abbfcbcccccbaaa#abbfjg#aa###########aaabbaaabbcbdedcdbbaaabbbcceghhiiedcedbbaa######a###aaaa#abaaaaaaaa##aaa##a##############aa####aaaaa#####ab#####aa##a###aa#aa#a#####aaaa##aaaaabbbbabbbbbbbbbbbbdddccddccbcbbbcccdd", "eecbdggfdddedcacda####a###abbaaca######aa##aaa#aabcababcdeeedgigdfgbbcbbbbbcccbbbbbaaaaaaaaaccddddefdecccbbcbbddcbccddedcaaa#a#aa##########a########adbaa#########aabbbcbcabbdcdcbbbcbaa##abbfiaaa##############baaabbbbccedcccbaa#abbbbbefgihfdcccbaaaa###a######aaba#abaaaaaabaa#aaaaaa######...#a#.#####aa#aaaa########a##aaa###a###aa#aa#aaaa#aabbabaaaaabcbbbbbbbbbbbbbbbccdeddcccbdccccdde", "eedfhhfcba#abb##a#####a#aabcaaccbc#####a#aa#aa###ccbbbabcdfffhgifehfebbbabbcccbbbbbbbbaaaa#ccdcddfghfeccccbbbbabcddegcbccdcaaaaaa###a###a######a#a##accba#########aaaabbccbbcbcehb###cbba##bdehe###############aa##aabbbccdcbccba##aacccbcceffedcbbaaa#####a######aaba##aaaa#ababcbbbbcbaa########.#.##a####a####aa######aaa###aa####a###a##a#aaa####aaadbbaaacccbbbbbbccbcbcccbcceeeeededcdbccd", "dgghigdb##a#a########baaa#abbcbdbbb#####aa#aaaaaaabaababcdegiihdggffdcbaabbbbabbbbbabaaaaa#ccdccdegedccbbbbbbcbbbbaadbabaacdb###aa###############aaaab#aa##a#######aaaaababbbabbfieaaaa#aaa#chke.#########..#aaaaaaaaababbccbbcbaa#aabbcbabcdeedcba###a#####a#a##.###baabbaaaaaaaabbaaba#########....#.#######ab#a#######a######a#########a##aabba###aaabbbbbbacdcbbbbcbcccccbdddeededegeddddcdc", "dhghhfa##a######a######aabaacccedaaa#######aaaaaaaababbbccdghgfedgfgcabaaaaaaabababaabaaaaabdcceeeecdbbbababbbbccbbbbbabdbabcba#a############aa##aaaaab#aa###########aababcbbaabeggh######aaagj##############aa#####abbaabbbbbabbbabcabbaaaabcddccba#######.###########ccaaa###aa##aaaa###a###..##....#.aa##a############aaa#####a#####a###aaa#aaaa#aaacaabbbbbbeccccbbccddccdegghhgfeegd#bddccc", "ffhhhe###########a#####b#bcadddcbaaaa#####abcca#aaaaaaaaabdhihgddfgfgcaaaaaaabbbabbbaabaaaabedcefecbbbbbbabbbaaabbacdca#aaa#bbdb#aaa#########aa####aa#a###a#####.###aaaaadbbaabaddcggbaaaa#bbdia#a##########aaa###aaabaaaabbbbbbaacefebaa#aaaabcccbaaaa###########.#.##ad#####.##aaa#aa#aa#####...#...###ab#ba######a###a##ab#####a###aaa##aa#aaaaaaaabbbbbbbbbbceddeeccbccccddfhijjhggghb#bba##", "#afhgcaa###########a#a##aabcddca###aa######abbbabaaaaabaaaeiiihgbbgeddaaaaaaaaabbaabbbaaaaabdcccddddccabbbbacaaaaabbbaaabaa##acdd###a######..a#a#####a#aa##a########a##aaecb#abbbcccfgaaaaaaaeia#a#a##############aabbaaaababbababdgeca####aaaaabcbbba#####a####.#######da##############aaaa#######.##.#.#ba########.#a#aa##abba##aa#aa#aa###aaaaaaaaaabbbbbcbccccefgeeccbccbbbbdfiihgggeb#aaaa#", "##bhgd###############ab#ababcdd###aaaa####aaaaaaaaababaaaadhhigebabfddcaaaaaaaaaaaabaaaaaaabcbbbcbbcecbbbabbbaaaabbaaaaaba###abadea#########.#a##########aa#a###a###a####aabbabbaadccghbbbaaabfi#a##a###aa####a##a#aaabaaaaaaaabbacfdba##a#aaa#aaaabbb######a######.##a#######aa#a##a#a####aa#####a#.#a####aa#########aaaaa##aaa###aa#aaaaa#aaaaabaaaabcbbbbccccceeceeeefedddcbbceeffhgfebaa####", "##.dhdb#########ab###bdababaddc######a###.#a######aabacaaaadghfdbbabecdba###aaa#aaaaccabaaacababbbbbbbcbcbbcbaaaaababaaaba####abbcfbaa#aaa###.###ab#####aaaa##a######aa#ba#aabbbabdcabefbcaababhe#a##aa##aa###a#####aabba#aaaaabbbefcba###aaaa#aaaaaaaa#########a#.##############aa#bb#aaa##a####.###########aaaaa#######aaaa###a####a##aabaabaaaaaaaaaabbbcccddebbbbdedefdcccccbceeghgfdaaba#aa", "aa#aeea##########c####ba###aca#####aba#############abcabaa#acdefccbacdbdc##aaaaa###aabdbaaabbcccbbbbbbbccbabcabaabbabbaaaaa###addbcdba#a################a####aaaa#aaaaaaaa#aaacbabdcbbbehca#abbeh#aa######aa######aa#aacfbaaaaaabbdgdbaa###aaaa#aaaa########.###aa#a.###########aaa#bbaaaaaa####a#.##.#######aba#####a#############a#aaaaabbba#bbbbaaaaabbcddddddbaabcedccbaadfdcceeggdbaaaaaaa#", "aa##ada#a########aaaa###a###a######abaa#########aa#abbbaaaabbcddeeebcdbabb#aaaaaa####aaaabcccbccbaabbbabccbaaaaaaaabbaaaaaaa##aabcccfeb##############a####ab#aaa##aaabbaacababaaaabcdbccffc##abeh.##aa###a#########aaaaacbabaaaccddfgdbaaa##aaaaaaa#######.##.#######.#########aaabaab########a#a##.#########aaa#####aa##a#aa###bdaaba#aa#aabaaaabbbabbbbcddefecbcbaabbdcbaabcecccefgcaaaaaaaaa#", "aaa#aaaa#aaaaa#####aaaaaa###########a#####a##ab#a##aacabaaabcccbdhedfdbbabc#aaaaaaaba##aaaeheaaaaaaabbbacddbbaaabbbaaaaaaabc#aa#a###cfgb#a#########aa###aaaccaaaaaaaacbabcdaacbaaabcddcccgfcaabeg.#a#aa#a###aaaa####aaaaabaaaaaaceefhfdbaa###aaaaaa########.####.###.####.####aa#abcbaaa####aaa#############aaaaaaaa#aaaa#ba#babffb#acb#aaaabaaabbccabbcccfgdaa##bcbbaaacbcbacebbbcddbbaaa#a####", "accccedaa#aa#aaa##a#aabda#################a#a#a##aaaabbbabbcccdcccfcfecbaaceca#aacdbcccba#ahgabaaaaababbbccccbaabbbbbbbaaabcb###aca#aabcc##a##########a###a#abaaa#aaabbddddbbbcbaaaaabcdddhecccg######ba#a##.#a###aaceca#cbaaaaacdefhgfcaaa#aaaabba#########..#####...#.#######aaabccbaaa####aa########.####abb##aa#aaa#a#ba#abbefba##bbbaaaaaabbccc#ccddeffcaaaa#baaaaabebbbbcbbbbcbbbbbaa##a##", "#abeeebaaa###aa###aa###aaa###################aa###a#aabbbbcddddccefegfcca#adhbaacccaaabcbcdecaaa##aaacabdabdcbaabbabbaaababbcb#aabb#aa##dea##aa#######aaa##a##aabaaaacacdfebbbbbbabccccfeddfgfed...#a##aa###########acdbabbb#aa#acddegfecbaaaaaaabaa#########...#####.#########a#abbbabba##aa#####.##....#####a##aaaaaaaa#baaaceeebaaaaeedbbbabbbccb#cedddcccbaaaaaaabaa#bebbbbbbbbbbbbbaaaa####", "##aadba#aa##a#######abbda################a#######aaaa#ababccdeeddffhhgccbaabefdbbaaa#aabcbbabca#aaaababbbbcccbaaacaabaaabaaaabbaaaab#aaaaefaaaaaaa#.###a#a#a######bbbaabccabbdcbabbcbcdbbaaaefeiiffa####a#######a##aaaaabbcba#baabdddefffdcaaaaaaaaaa##########...##############aabbbbbdabaaa###.....########aaaaaaaaaaaaabcccbdfebaaaaaacfdccbcddc##baabcbabaaaaaaaaabaaaedbcbcccccbbccbaaaaaaa", "a##aba#a####.######a##bgb#######a########aa#######aaa##aabbcceedddeghiebaaabccebaaaaaaaabaabaaabbaaabbaaabbbbbaaabbaaaaaaaaabbccbbcba#####cfebbabbbacaaaaaa#aaaa###acbbbbbbbbcbaabbbccbaaab#.aceffdfghfa#a####aa#aa##acbacbbbaaaaabcedcddedbaaabaaaaaa#######..#.################aabccccdbbb####.#..#..#.#..########aa#aaa#aaabdddbcababbbdeddedeeb####aaaaaa#ba#aababcbbbaeccbcbcbcbbbbaaaa###a", "ba#a#####a#############cb#########aa##a###a####ab#aabaaaabbbbedcdccehihcbbbbbbccaaa#a#aaaaabbaaaabbbcbbaaabbbccaaabbaaaaaaaaaabbbbacda####aaedbaaabddba#aaab###aa####aaddcceebabbbcbcdca#aaba#aaabaabfmka##aabaaaaaa#abbabbbbaaa#acccdddccedbbbbaaaaaaaa##a####.#.###############aabddcbbcaaa####.#......aa###aa####aaaa#aa##aacccccbbbabbcdedddea####a##aa#a#bccbccbcbbaaaadddccbbbbbbaa#aa####", "ab##aaaa######a##########aa###b##aaaaa##a#a#####ababbbaababbbccccdcdgjifbbabbcccca#aaaaaaaaacaaaaabcccbaaa#bbbcaaaaaaaaaaaaaaaaccbaabbaa#a#a#bcbbaa##a###aaba######aaaaaaddfhgccddddacacaaaaa#aaaaaaabhnk.aabbb##aa####aa#acaabb#aabccddeecccbbbabaa##aa###aa#######.######a###aaaabdddcdedda#########...#####aaaaaaaaa##a###aabcbbccbbbbcddeeefc##a####aaaaaacdccbbaababaaabccdccccbbbbaa#a####", "#####a#aaaaa###aaa######ba###aa#bba#aa#abca##bb#abaabbbbbbaabbbbdccceihgecbcdccbcd#ababa##aaabaaaaaabccbaabbddbbaa#aaaaaaaaaaaaaccbaaa#a######aabdcb##aaa##a#a#####aaaa##aabffebccddcb#aa#######aaaaaadlnd#aabbabaaaaa##aaaa####aaaabccdeedbb#aa##a###############.##..#.#####aaaaabccdeecdaa#####.########.###aaa#aa###aaaa#aaabcbccccbbccddeef##aaaaa####aaaccbaabaaaaaaaaba#bcddcbbbbbb#aaa#a", "abaa###aaaaa##a#a##a#############a#a#ababda#aaaaaaaabbaabbbbcbbbddbddgifhedbcccbbcc##aabbaa#aaaaaaabaabbbccccdebaa##aa#aaaaaaaaaabedaaaa##########becaaaaa#a#########aaa##abceffdccb##aa########a#abbabilk#a#a######ab#aa#aa#####aaabbcddedbaa#a######a#####################a#aaaaaabdddfgfc##########...a#a###aaa#a#aa##a###aaaabbbbbcbbbcceghfaaaaaaaabbabccbbbaaaaaaaa#abba#aacedcccbaaaaa#aa", "bbaa##aa#aaaa#aaaaaaaaa#aaa##########abaaaa#baaaaabbbbbabbbbccccddbddggghhfdbbcaabbbbbaabbaaaa#aaabbaaabbb#bbbaaa#####a#aaaaaaaaaabb##aa##########aabdcbabaaaa####aa###aa#abbcdhhcaba#baaa#######aaaaabhlmc#a#####aaaaa#a##abba#aabaaabcdgfbb################################aabbaabbccdhigca#########.########aaa########aa#a##aaabbbbccbccdgfha#caaa.##fedbbcbaaaaaaaaa#aaa###aaadecccbbaaaaaa", "#aa###aaa#a#aaabbbbbcbaa##a#######aaabaababaa#aaaaabbbbbaaababccdecdfhhiihgfdbccbbcbabaaaaaadca##abbaaaaaaa#bb##aaa####aa#aaa#aaaabbda.##########aaaabddcbbaa#a##aa#aaa##aaabbdecca#a#aa#a########aaaaaeili##a######abaa###aaaaaacfeaabddcdbaa##############################aaabbbbbbcdfgjieba####.#####aa#aa############aaaaa###aaabcbbcbbcefggcbbfeedbedbcbabbaaaaaaaaaaaaaaa#aaa#cdcddcbbaaaa", "aa#a###aa#a##a#aaaabbccaa#aaa########bacbaaaaaaaaaaaabcbbbbbbcedcdccfhfhkhggfdbbccbbabaabaabdda###aaa#aaaaaaacb#########aaaaaa#aaaabec##########aaaaaaabddcbaaaaaaaaaaaa##aabacbaaaba#####a##a######aaabgklbaaa#####aaaaaaaaaaabbbfdaacddeddcbaaa#########aaab##########a##aaaabbcbbbbeffhjifdcb#####.##acbb#aaaa###########aaaa#aaacbcbbcbcegfaccgghgffdcbbaabbbaaa#aaaaaaaaaba#aaaabeecccbaaaa", "aaaa########aaaabbabbbbcbbbaaaa#####.##aaaaaaaaaaaaabbbbaaaaadedcdccegijkifddebccbbccaabaaa##aa######aaaaaaba#aa#########aaaaaaaaa#bccda#######aaaaabbaaabddcba#aaaaaaaaaaaaabcdaaaaa##abaaa#a#a#a##aaaafhlg.aa#a#a###ba##b#acaabcdfaaaccdccedba##########adcbca#########a#aaabbcddccbdefggiigecb########aaaa#abba###########aaaaaa#bdbccbccef#abdeddeeddccba#bbbbbaaaaaaaaaaabcaaaaaa#eedccbbba", "aa#aaaaa###aaaaaaaaabbbbbbbbaaaa#######aabaaaaaaaaaabbaaaaabbbfeccccdfiljigcdeccccbccbccbbaaaa#######a#aa##aaa#####..#..#aaabaaaaaaabacb######aaaaaaabbaaaacddcbaaa##cbabaaaaabcbaaaaa###a##a####a##aababchl#.###a#####aaaaaa#aabbdeaaacbbbbdfdccbabb####a#ddbbbba##########abbbccdcccddefghhfcaaa######aab#abaaddaa########ab###aaaacccccdefd#dbgebcccdcaabbbaaaaaaababbbaaabacaaaaaba#eeddcbba", "aa#aaaaba#a#a##aaababbccbabbbbba########aa#a#aaaaaaaababbaaaaadcccaddfhkjigdcdecccbbcdcecbaaaa######aca####aa#####a#####.#aaaaa#aabababb######aaaaaabbabaaaaabcdcbaaaaaaaaaabbbcaaaa#a####aa####a#aaaaaababjh.####a#####aaa##aaaabdabaaaabbabdeeeddddcb#.##debaaabaaaba####aaabbccdcccddeffgfgcaa##aa###aaaaaccaddca########a#a###aaaccbbceffbaacgeaabbbbabaaaaaaaaaaabaaaabbcaaabaaaabbbccdedcb", "ba#a#aaaaa####aaaaaaaaaaccbcbbaa#######aaaa###aa##aaaaaaaabbbabbcbbefffhjihfcbfcbcbbbcfhgcaaa#####a#deaa##aaaa###############a##a###aaaaa###aaaabbaaaababbbbbbbbedcbaa#abbbbbcccaa##a######aa##aaa##abaa#aabja##.#######a#a###aaabecaaaaaaacccbcaaaabbdddefedcbaa###aaaa#aaaabbbcccccccddfggghdba####aababababcbbddba###a###a#aaa##aabbcccegfbaabcaaaaaaabbaaaaabbaabaacaabbbabbadbaaaaabba#aefc", "ba#a#aa#######aaaaaaabaabbebdbbb######aa####a###a####aaaabbaabcabcccddffjhfdbaefcdbbbbdjkjebaa#####bccb##baba#####aa######a###a#a####aaaaa##a##aabaaaaaaabbbbbbabefdbbcbbbcbbbcbaa####aa#######aaaaadaaaaabbdg###a#a####a#aa#aabccccaaaaaabcdbccaaaaabbdeeedcdcba###aa#aabaaabbbcbcccddddeffffdbaa####abccbb#bbccdbccaa###a#aaaa#a#aabbdcdfgdaaaccaaaaaa#aaaaababbaaabbbbbabbbbbcbcbaaaabaa###be", "fcb#############aa#aaaaaaadegdacbaa###aa####aaa#a####aaaabbaaabaabddccehieabaabecccbbbbbikkgca####acbb###baba#####aa####aaaaaaaa######aa###aaaaaaabaaaaaaaacbbbbbbeffedccbcddddbaaa##aaaa###a##aaa#adba#aaabbie.#.#aa##aaaaaaacecaaaba###a##aabdb#a#aaccccccccbbba###aaa###aaabbbbcccdddedegcddcbbaaaabbabbabbaabbaaddbaa#####aa##aaabbddefgcabagbaaaaaaaaaaaabbaaacabaaaaabbbbabbaaaaaaaaaaaa#a", "bdeba#########aaaaa###aaaaacfebbbbaa###aa#####aa########aaababaacbdeccehhbaaaaaddcbbbbbcgijhea####acb########a##aa#a##a#aaaaabaaaa####aaab###aaaaaaaaaababbccbbbbacbedffedcdeeaaaab#aaa#aa##a##aa#a###aa#aabackc.#.##aaaaaabdefb#a#aaaaa#a####abc####abcbbeecbbaaabb#aaaaaaaabbbbcbcdededdefdcaccbca##aaaa###aaaaabaaeccaaa###aaa#aaabcccdffbbacfc#a#a#aaaaaaabbaaaaeabcbbabbbbcbbabb#aaaaaaa#aa", "##aba######aaaaaaaa##a#aaa#fdaabbccb###################a#aaaabbabccccdehibabbbbcfdcbbbabgihc#a####abbaa##a###aa##a#aaaa##aaa##aaaaba###daaa###abcaaabaaabbbbbccbcbcdcdddggfedbcbaaaaa##a#####aaaa#aa#####abbbbdjb.a##aaaaabeecabba##aabda######aa####aaabbdcdcbaa#bcbbaaaaaaaabbbcccddedefffdcbccbab####a#####a#aaabaabeeba######aaacbcddegebbacccba##a#aaaaaaaaaaaaccbbbbbabaaa#aaabbaaaaaaaaaa", "aa##baa####aaabaaaaa#####aacaababbccbaa##################aaaaaaaabbccbegifaaaabbcecbbbbaadgb#####aeeabc#.######aa##aaaaa#aaaaa###abaa##edaaaa##aabbaaaabbbbbbbccbbdccccdddehhdabbaaaaaa##a###aaaabb######cebcbcgj#aa##abdfggcbbbaaaabdfea####aaaaa##aa###aaa#aaaa#aaabbaaaaaaaabbccddeeddeffeeeefcabaa#aa#####aa#aabbbacccbaaaaaaaabcccdegfbbbceaacb#####aaaaaaaaaaaacccabaaaaa#a#abbccaabbaaaa#", "#aaa#daaaaaaaabbbaaaa####abbaabaabcbbbbb##aa################aaaaabbbddehecacbaaaabecbbbbabaa#####adcca#########a#a##daaaaacaaaaaa###aa#aca#aa##aaaabbbaabccbbbbcddaccdeddecfhgcabaaa#ab#a####a####aaa#aaaabbbcbcijdchihgighedbcbbcdfdabbbbccaaaaaa###caa#aaaa#a#a##aaaaaaaaaaaaabcccdddddeeedeeeffbaaaaaa##aa###aaabbbabcdeabaaaabbbbcdegibabbfaabca####a#acca#aaaaaaababbbaaaa##aaababbaaabaaaa", "#####adcbbbaabbbaaaa#a#a#####aaaabbaaabcbaa#################aa#aaaaabddgeadbcaaaaabccbbbbba#####a#a##aaaaa###aa#aa#bccaabaac#aaa#####a#..#####aaaaaabcbaaabbbbcdccdcddedceefgfccbaaaaaa#aa###aa##accaaaaaaaabbbbdjkfdfgjjhgfeeeeeedcaabaabaaaaa#####ab#a#aaaa###a####aaaaaaaaaaabbccddccccdccdeeegfbcbcaaa#aaba#aaabdcbbbababbbaabbcccdghg#aadbaabbaa###a##acdaaa#a#aa#baaaaaaaaa#a#aaaccbaabaaa", "a##a#aaedbbcbabaaaa##a##aa####aaaababbaabacaaa###a#######a####aaaaaaaccehbbbbcbaaaaacdbbbcb#a#a#a#.####aaa##a#aaaaaaabaaaaab##aaaaaaaa#####aaa##aa##abbaaabbbccbccbcdcdcddeffcaabaaaabba#aa####a##bcbaaaabababbbbejib#abccdcbbccba##a##aaaa##a######a##aaaaa#a###a#####aaaaaaaaabbccccccccccccdeegfcdabbaaaaaaa#aaaabccbbbaccbabbbcddefedea#cd##a#aaab#aaa##bcb###aaa##abaaaa#####aaaaabbcbaabbb", "aa##aa#bhgccbbccbbaaaaa########aaaaabcbaaaabbaaaa###aa#####a#a#aaaabbbbcega##acbabababecccdabaa##########aaaaaaaaaaaaaabaaa####aaaaaaaa##.##abaaa#aaaaabbbbbbbbcdbbccddcdcegeaaaab#aaaaaaaaa####aabbabbcbbbcaaabbcegiaaaaaa##abbcbca##.###aaaaa####aaa##abbaa#aaaaa####aaaabbaaabbbbccccbcccdddedfddcaaaaaaaaaaaaabbccdbbbcecbbccdefged#a###fa######aaaaaaaabaa#######aab#aaaa#aa#aaaaaabcccabaa", "aa##aadafhhfeccbbbaa#aaa##a####a#aaaaaaaaaaaaaaaaabaaaabaa#aa###aaaaaabbcfd#a#acbaaaaabeecdcc#############abbaaaaaaaababbba###aaaaaaa#a#####aa#aaaaaa#aaaabbbabcccehgeecdegebaaaaaaaaa#aaa#aa###aaaaababccbbaa#aabceggaaaaaa#aaaabcb####a###aaba######a#a#####aaaaba#####aabbaaaabcbbbbcbbacceeddeebabdbabbaaaaaababcdccdccdcbbccefecb#####cc#########aaaaaaaaaa##ba#aaaaabbbbaaa#aaaaaabcccdgdb", "##aaacdggggghgdbbbbbaaaaa#aa###a###aa##aaaaaaaaaaaaabcbbaaaaaa#aaaaaaabbbdfd#aaacdaaaaaadgefc#######a#a###abb##a#aaabaaaaaa#######aaa#a########aaaaa##aabbbbbbbbccefhfeeegfbbba#aaaaaaaaaaaa####aa##abbcdacbaa##aabcehfaaaa###aaababa##.##a#aaaca#a#aaaaaa#aaaa#aabcc#####aaaabbbbbadcabbbbbbceedefcaabcecaaabaaababccdcdddccbbcceda#####baeaa#aaa#####ab##aaaaa##aaa##abbbbbbbbaaaaaaaaabbbagig", "f#aaaehhfffeffhfbccbbaaaaaaa####a#aaaaa###aaa#a#abaabccabcbabbbbabbaabbbbcehdaaaaaaaaaab#dgeaa##a###########aa####aaaaaaa######a####aaaa###a###aaaaa###aabbbbbacccdedddfgebcbaaaaabbbaabaaba#########abcbdabaaa#aabcdeibaaa######aaaca######aabbb####aaaaaaaaaaa##bbdb####aabbbbaaaacdcaabbbbcceddeccccaba#aaabaaaabccddddddceddeec#aca#aabebaaa#######aaaba#######aaaaabbbabbbbbaaaaaaaaaba#dii", "hd#aaejiedefeeddedccbaaaaaa########aaa#######a#a#aaaabbaacbbababccbbabbbbbceidbaaaaaaaacbcgeca#############aaaaaaaaaaaba######.a############a##aaaaaaaaaaaacbbbccccedbcfcbbbbaaabbbbaaaaaaababaaa#baaaabababbabaaaaabdfhaaaaa#aa##b#bbaa#####abb##a##aaaabbba#aaaaaacda#####abbbbaa####a#abaabccbdecdbbaaaaaaaaaaaabccceeedcdfgffeba#aa#aa#bcaaa##########aa##a####aaaaa#aaabbbbaaaaabbbcbbbeefh", "ggecdhjkiefeeddcdefdababaaa########aa##a########abaabaabcdabbcdccbcbabbbbccchiecaa#abbbaaaadeca#####a#######aabaaaaaabba###a##.#############a##aaaaaaaaaaabbbccdddbbeccdbbcbbbabbbbbbcbbaaaabccaaaabaabcabbabaaaabaabcefeabaaaaa####aaccb####aaa###a###aabbab#a#aaa##aaa#####acbba#a######aaaabbbbfefdaaaacaaaaaaaabbbcefffeefbed########a##dbaaa#######a#############a########aaaaaaaaaccfgfhdf", "efddegijmkfeeeddccdgdbcccbaaa####a#aaa#####a####a###aabbcbabacccdccbbbbbcbbdfijhbaaaaabb###cedbaa###aaa#####aabbccbaaaaa###accb###a##########aaaaaaaaaaaabcbbccddddcddaaaabbbabbbbbbcbaabbbbbaaaabbaaaaabbbbaaa#ccaabbddheabaaaaa####abca#####ba##a####abcaaaaaaaaaa#aaaa#####bbaaa##aaaa##aaabbaaadfdbaabcbaaaaaaabbacehhhhcaaaa#####a#ab##ccaa########aa#############ba#a#aaaa#aaabdaaeffghgff", "eddcbcdefijgeedcccbbdeccccbaaaaaaaaaa#a#########aaa##a#abcaacccccccbcbbccccdefikibaaaaaaaabbdddca#a#a#aa####aaabbbaaaa##a##aaaba##aa##a######aaaaaaaaaaabbbbbccccddddaabbaabcdbbbccbacbabcbbccbaa#aaaa###baaaaa#a#aaabcdfjb#aaaaaa####abaa.####a##aa####bcbbaaaaaaaa#####aa##abaaa#a##aaaaaaaaaaaaabecbaababaaaaabbbcbcehhcaaa##aaa#######b#.cbabaa#####aa##a#####a#########aa#a#aaabdefffggfefe", "ddcaaabdefhihecdbbbbacdecccbbaaaaaaaa############aa##aa#ababbcbcbbbababccdceeegijgaaaaaba###bfcdc##aaaaa######aaaaaaaaa#aaaaaacba#aaa#a#ba#aa#aaaaaaaababcbbbbbcedabbaabbaaabbbabbdccbbbaabbbbbaaa#aaaaa##aaaaaa#####abcehka##aaa#####aaaa###..a#aba#####abcaaaaaaa#a##a##a###ba########aaaa####aa#deaaa#aaaaaaabbbbbccefcbaba##abaaaa.#a#ba##dc#a#a####abaabb#a##aa##a###a###aaaaabaceecddhhedd", "cccbabbcdfffhheccbbbbbcdfccbbbbaaaaaa###############a##aaaabacbbbbaaaacccddcdefhjjhbaaaabaa##dfbbc###aa#aa######aabaabaabbbbbabdb#aa#a###bba#a##aaaabbabbbbbcbbcedbaaaaaaaaabbbbbcbccbcebbbbaaaaaaaaaa#####aaa####aa#aabdegj.############a##a##a#aba####a##baaaaaa#a###aa#aa########a##a#aaaa####a#eeaa###aaaaaaaaabbcdgfdbaa####aabbcb#aabc###cda#aa##aababcbb#a#aa###a##aab#aaaaababdecbcdheed", "cbbaccbcddeffeedcbbbbbbccffdbbcbabbaaa#aa########a###ca#abaabbbabaaaaabcccddcdgiikjgbaaaaba##afcacba###aa########abbbbaabbbbbbbcbbbb#aa#a###aa##aaaaababbbbcbccdca#a##aaaaabaaabcccbbcbcbaabba##aaaaaba#####aa####aabbbddcdjd.#########.#..#######aba######aaaaaba########aa#######aaa#aba#aaa###aacaaaa##aabaaaaaaabbcefcbbaaaaa##aaacabaaaa###bca#####aaaaacaa#a###a##a#aaa#a#aabbbbcddcccegdd", "cbbabbbbccddeedddcbbbbbbbbdfheccccbaaaa###########aa#bd##baaaabaaaaaababcddcccggijjjbaaabbaa##bcbabba##aa#######aaaaaaabbbbbbbbbcccaaaa##a##aaa##aaaabbbdbcbbcdfbaaa#aaabbbbbbbbbcccbccdedaaa#aaaabbaaaa#a#aa####a#abcccdccfi###########....#######aa##aaaaaaaaaaa##########a###a##aa#aa#aaa#####aaa#aaaa##abbbaaaaabcdefbbaaaaabaa####aa####a#a#dba#####bb##b###########aaaaa#aaabbaabbbccddede", "baabbbbbccccdeedcccbbccbcbbcdiheccbbbaaaaa#aab##aa###aa###aaaacbaaaaaababccccdfhjjjl#abbbaaba#abeaabb######a#####bbaa#aaaabbbcbbabbaa###aa####a###aaaabacdcccdceaaaaaaaaaababbbbbbbcbbbcbdba###aabbbaaa#aa##########aabbabccgb.###.#########.########a#aaaa#abaa#########a##aa#####bcaabaaba###aaaaaaaa#####aaaaaabbbdhidabaaaaaaaa###########a###ebbb###aaa####a###aa#aabcaabbaaababaaabbbbbdcb", "abcbbbbbbbccbbcddbcbbbbbbbbbcfeghfccbbabaaaaabaaaa####a#b##aaaabbaa#aaaaabccbceefhegdedaaaaaaa#abdaaba#aa##a#####aaaabaaaaaaabbbaacc###aa#aa####a#aaaaaaabcccddfbba#aaaaaabbbbabbccccccbcbdaa#####ac#####a##########aa#aabcbdh..#########.#####.####aaa#aaa###abb###########accaa###a##aaabbbba#a##a#abba####aaaaaccegcbbaaaaaaa#aa###.##a########aeaaaa###a#a######aaa##aaaaaaaabbaabbaacaacced", "cadbbbbbbcbccbbacbbbbbbbbabccdeehgffccbcbaaabaaaaaa###a####aaa#aaaaaaaaaaabccbdeeffeehgcaabaaa##adb#aca##aaa#####aaabaaaaaaaaaabaacdb##aaaaaaa#abbaaabbbabbdecffbaaaaaaaaaaaaaabbaccbcbcccdcaa#############aabb######aaaaabbbehd..###d#.#.######.####adbaaaa##abba########aaaaaaaaaaaaa#aaaaaaa#a#aa#abaaa####aaacdeheaaaaaaaaa##aa#aa#####a####a#.cdaa######a##a###########aa##aabb#aabaaabbadf", "cabdabbbabcccdccbccbbbbbbaabdcdefdcfgccbbbbaabcbaaa###aa##aca####aaa##aabbbccccddffhihhfbaba#c###bdaaagaaa#a######aabaabaaaaaaaa#a#aa####aaaa#aabbaaaabbbbbcddfeca###aaaaabbaabbabbcbccbbbccdada###aa######aaba####a###abaabcafjlf..defe##...#########bbaaa###aab#a#######aaabcb#aaaaaca##aaaa####a##aab###a##aabdfiida###aaaaa##ca#aa#####a####a###ecaaa########a##a#####a####a###aaaaaaaaaabab", "ccbbbbabbaaabccdcbbbbbbaaaabcdbbbeeadgeccbbbbabbbaaa##aa#abedbaa####a####bbbcbccddehhhfdaa###da#a#ddaabhaa###########a#abaabbaa######a####aaaaaaaaaabbbbbbcbdeefcb###aaaaaaaaaabbbbccccbbaabbcaaa############aacbaabaaaaaaabccbdejkbd..bgccdcba########aa######aaa#a#######aaaccaba#bcaaba#a##aaa#####abba#aa#aabdgkjkihgdb#.cedcbb#.###dc########b##ebaaaa#########################aaa#aaaaaaba", "abeecbbaababbbabbdbabbbbbaaabcccbdcb#ehedccbbaabbbaaa#abaaaedba###########acbbbcceeeggdaaa#bacaa#aadabbdf#######.#######aaaaaa######bca###aaaaaaaaaabbbbbbbccfffbaaaa#aaaaa#aaaabbccabbcccbbbbaaaaa#######a#aa#acaaaaaaaaaaaabccceglh.#....#baacca..####ab########aaa####a##ababbbba#ceaaaaaa###a######aa##acbbbbchgcddfgjihddigefegfffba#affeecbbaaabda#aa######a#a################aaaa#aaaaaab", "babfdcbcbabaabababbbaaaaaaaabcccdbaaaacifddcbbbbbbbabaabaacecabaaaaa######aaabbcdeeedifba#adcbaaba#bcabbfe#aa####aaa###a#abaaaa######aaaac#aaaaaaaabbbdbbbbcceebbba##aaaaaaa#aaabbbbbbcccdcabaaaaab##a#aaaaaaa######abaaaaa#abbbbddei#####a####.#ee######aa######aaaba######abaaaa#a##bc##aa#a####a###a#aaaabcbbbceecbbcbdeffgfdccccdefeefgffedcefeb##cdbcba########a###########a###aaaabaaaaaaa" }; SIMPLE = T BITPIX = 8 NAXIS = 2 NAXIS1 = 384 NAXIS2 = 384 HISTORY Written by XV 3.10a END 3"3wUD3D3"3""3"3"333""""""""3DDDU3""""DªwUUD3333333"3""3""DfD"3""""""""33DUfffUªw3""UD3""3"3D"33wf"""""""3""""""""D""""""""333U3333DDff333"""""""""""333333DDDUD"3"""""3"""""""""3""""""3333UUfª"�ff"""""3""3"""""3D"""""""""3D333DffD33D3UfwwˆwUDDDDUfwffwˆwwfUDfwf3DU3D3"""""""3""""""""3ffD33""3"333"33U3"33333"""3DDD3UD3f™fUDD33""333""""3"""fU3""D333DDfffˆˆU"""3"D""""U"33Uw�""""""3D"""""""""""3333333DDwww3"""""""""""""33DD"33DDD3333"""""""""D""""""""""""3DDDfˆÝ™�����3""DD"��"3"""""3"3333"Df""""""""""D3333D™ˆDUUwˆ»ª™UUªˆfwfˆwww3""wwffD33"""3U"""""""""""""""3DD3333"33"""3DDUD333333""""3DU333ff"UˆfDD3333"333""""""3fU3"""333D3DDUUf™™™wU""U""UU""3™""""3""33"""""""""""""333333D3UffwD3""""""""""3333DDDD33""33D"""""D3""3"""""""3DD3Uf»Ì3U��3ˆDDUD3""""""""""DD"3"3D""3""""""33"""""3UˆÌ»Ìª™ˆU3�DfUD33�UD3f3"""""""""""""3"D"3U"333"3DDDUDD3DD333333""3UDUfwUDwˆDD3333""3D3""""""D""""""333DDDDUUww™ª™™w3"3"D3U"""ˆ""""""3""3"""""""""""""""""33""""33333DUUwfD""""""33""33"33D3DD333DDU"U"""""3"""3""3D"w»Ýw��Ufwf���33"""""3""""3D3"""""D""""""""3"""3UwªªU""""""D"""""fD"""""""""""""""""3"3D"U333333D3DD33"D33333333"3DDUff™ˆwwDD3D3"""3"""""""""""""""""""""3DD3Uffwwff™ˆD""3""""U3"D"""""""3""""""""""3""DU3""""""""33"""333"33UfDww3""""""""""""""33"DD3D3DDDUD""""33"""""333f™U��U���"U3"""""33"""""""""""""""""""""""""3""""""DUf™f"""""""""""""""�DU""""""""33""3"""33"Uw"3D3333333DD33DUU3D333333333Dwfˆ™wDD33"3"""""3"""""3""""33"""""""3DD3Dffw™fˆUfU""""""""3U""3""""""""3"""""""333""DD""""""""""""3DDDUUw33"""""""3333"33DDDDDD3D3U"""D"""""3D3U™����"""""""33"DD""""""3333""""33""""""DDfˆD33"""""""""�""f"""""""""""""""""33""33""D""DDfU3""33333DDDDUffUDDD33DD3D33DUª™fDD333"""""""3""""""""D3""""""3"3DDDDUw™»»»Ý"333""3""3f""33"33""""""333D33"33"""""""""3"DUDDDUDf""""""""""3"3333333D333D3U3"""333"""""""33"3DDˆ3���""""""3"""""3D""3""3"""""""""""""""333U™ªU"3"""""""""f333""""""""3D""33"""3"3"""33333UD3D33"3333DDUUffUUUD33333333Uw™fDDDD3""""""3U3""""3""""""3"3DUUDDDˆˆª»»»3"""33""3D3"33""""""""""333333333DDD""""""""""""333U3D33DUw3""""""333333333DDD3DDUfU"""""""33"""""""""3DDDUDDwª����""""""""""""""""""""""""""""""333"""""3DUfw33"""""3""""""U3"333""""""""33""333DDUUfUfD33"DD3DUUfwwffUD333333DDwwU33D3"33""""""D""3""333"3"""""3DDDUUDUˆªªÌ»ˆ3""""3""wD"D3""""3333""3333333D3333""""""""""3"3333D3DDUD"""""""3"""3DDD33D3D3""33""""""3"""""333UUDU»U����"3""""""3"""""""3""""""D""""""3"""""""33DfwD33""""""""D"3""""3D""""""D"""""""""""3333DUUDDDfˆUUDDD3"33DUwww™™fDD33333DUwDD3333"""""""""""3"D3333""""DDDUUDUfw™»»™3""""3""Uw33D""""""3""3""33333"3U3"""33""""""33"33333D33DfU3"""""""""33333D3DD3Df3333"""""""""""""""""3Ufˆ»�""""3""3""""""""""""""""""ff"""""""""""33DUˆwU3""""33D3""3DDU"""""3"3D33""""""3"""""3"3UfD3DU™ffUUUD"""3Ufw™ª™fDU3333"DUfDDD33"""""""""""""3"33D3D333"3"3DDUDfffˆª»ˆ"""""3"3wDUD""""""""""""""""""""D3"""""3"""""""""""3"3D33333DfU"33""33"""333"33UDD333""33333"""""""""""""""3Df™Ì""""""""��""3""3D""""""""""3"""""""Uf""""""""""33333DDfwD3"3""3""""�"3"UD"""3""33""""""""""3"DffDUU™™fUUfUUD3DUfwª»ˆffUDDD33UfDDDD3""""""""""""""""3D""DDDDDDD3D33DDDDUfwªÌª3""""""""33UUUD""""""""333""""""""3"""""""""""""""33333DDDDUUUU""33""3DU333DD3"D3"3D33DD3""""""3"""""""""3DUw»3"""""""3""�"""3D33"""""""""""3"""""""""""""""""3fD3""3"3"""""333D3Df™™D""""""3�D3"3""""""""""""3UfwwwˆˆwfwffwUUfˆª»îÌwfffUUDDUˆU3DDD3"""""""""""33D3"3"DDDUDD33333D33Uwª»™3"""""33DfU3"""""""33DD3""""""DD3"""""""""""""3D33DDUUUUDUU""""333"333333D3""33333""""33"""""3333"""DD""33UU™f"3""""""3D"3"""3D""""""""""""""33""""""""""33"""UwU3""3D3"""""""33"Df™™™™D""""""3DD""""3"""""""""3U""fwwˆ™ˆwwˆˆfDU™»ÌªfwffUUDUfwU"3"3"""""""3""3""3DU"33DUDD3D3"3333DDD™ªfD"""333""""UfD""""3""""""33""�""""""""""""333DDUUU33fDDU33D333"333333D33""""3DD""""3""3D"33"3""""3""3Dfwf"3"""""""DD3""""""33"3""""""""D33""""""3333wfwU""""D""""""""333Dfwwwffw3fU"U3""""""""""""""DDwˆw™Uw™U""f»ªfUfwffUUfUDD3"""""""""""""""33""D33"3"3DD33"33333DfªU3""""""""D3DˆfD""""""""""""3"�""""""""""""""D333DDDDfU3DwD3333"""3333"""""""3"3"""3""""3"3"33"3"""""3Uw™"""""""333"""33"""""333"""""""DU""3333""""3""3DD3UfDU33""""""""""""3DDDfffUDUwˆwwf3"""""3D""""""""""""""3333"""""333D333ffw™w"""f™™wwwfww™w3DD33""""""""""""""""""3""3DD"3D3"3333"33""3333Df™U""""""""""3Uˆf"""""""""""""""""""""""""33333"DDDUfUUUwˆf3D3"""""333""3""3""3D3U"3"""""3DUfª3""""""D"""333"""""""""""33U3""3333""""DUD""3333DDfUUfDDDD"3""""3""""3DDUUUUUUDfUUffD"D"""3f3""""""3""""""333"33333"""""""""3"Uªª"""DUˆˆˆˆˆ™ˆU33333"""""""""""""""""""""""3D33"""""""""""""333UwU"""DU""""""UˆfwD"""33""""3"""""""""""""""""33333333DDfw™wfffˆw333""""""""""""""""33DU"D3""""3Df™w"""""""3"3"�""""D""""""""""""""3DD""""33333"UD"333333DffUfwD""3DfD"""3"""3"3DDUDUUUDD33DDfU"3"f""""""3"""""""""33333333"""""""""333"ˆªˆ""""U"w™™wfDD333""""""""""""""""""""""""3""""3""""""""""33DwU""D3"""""3ffDUDD"33""""""""3"333"""""""""""""""""""""333"3DDDf™ˆffDUfˆf3"""""""""""""""""""3"3DD33""""3Dfˆˆ""""""""""3D3"""3"""""""3"""33""""3D3333D33"DDffUUff3"3U3"33""""""3"3DUDDUDDUD33DDfwfD3DD""""""""""3""""""3333"""""""""3DDDUˆU3""""3™ˆDD33DD33""""""""""3D3""""33""""""""""""3333Dfˆ""D3"3"3"3fDDDU"3""""""""""""""""3"""""""""""�"3""""""""33333333DU33DDUUDUDfˆf""""3"""""""""""33"33D333D"""33Dfˆª"""""""33D3D"�"""""""""33"""""""""""33"""3333DDDD3DDDUUUfUwUUD"""""""""""""33DDU333DfD33DDUfwˆfU"w"""""""""3""""3""""""""""""3DDD"3""""""fU33D3"3"""""""""""3"33""3"D""""""""""""DDf™3333D3"""""DU333D3"""�"""""""""""3"""""3""""""""""""""33"""333DD3DD3DUDUDUUfwwD""3""""33""""3D3""""3"3"3333f»ª3"3DDUD33DD3""""""""""""""""""""""""33DDDDDDDDDDDDUffˆwDU"33"""""""""""3DD333"DD3"333DUUfwfUf"DU""""3"""3D3""""3"""""""""33D3""333"UD333""333""""""""""33"""3D3"""""""""3UUˆf"U3D"""""3DD33333""""""""""""3DD""3""D""""��""""""3D3"""3333DUDDUDUUfUDffwˆwDD3"""""""""""DD""""""""3333U»ÌwUwˆ»»™ˆwffffffUD""3""3""""""3"""""""""""""""""33DDUUDDDDUDDUfffˆw3D3D"""""3""""3UD333"3"333""33DDDUˆ™ˆ""U3""33""""DU""""""3"""""""""""""DD3""3""""""U""""""""333"""""33""3""3D33333"""""""333UUf™fD"D3""""3fD3333"3"""UDD"""U"""""D"""""""""D"""""""333""3DD3333DUU"DDUfUUfDw™ˆD"3""""3"""""""""333D3Dª»UD™ª™ˆªˆ™fU3D33DUwU"3333DD""""""D"""""""""""""""""""""3DDDUUUUUfffUfffww3"""""""""""333"3DUf"3""""3333DUfˆª3"33w""3D"""DD""""""""3"333"""""""3"33"""3""""""3"""""3"""""""D""3"33DD3""""""""""33DD3fˆªw""""33DfD3333""Uˆ3"ff"3D�"""""""""""""3""fU""""""33""""3333333DD33UDDDDUUUf™™U"33"""""""""""33Df3D3Dˆ»"""3UwˆˆD333""""3Uwf""""""""""""""""""33""""""""33DDUUffUUfwwffffwD"3""""""""333"DDD3""""""""3DDDUfˆw333Df""D3""""""""""""DDD"3"""""""33DD""33"""""3"""""""""""""wU""33DD3"""""33"3DDDDUf™ª3"3333DwUD333"3ˆª™D""33"""""""""""""""""3"U""""3D"""3"""33333DD3D3DUDUUUˆˆwfU3D3"""""""""""""3333U»3�""""""3ffD"33"""3U""""""33UDUD3""3D33""""""""333DDDUUfUfwwwUD3DD3"3"""""3""3ff3""""D3DUUfˆf33"DDD3""""""""""""""DD33333"3""""""33""""""""""3Uf3"""""""""""Dwf3333"""""""""3"3""D3UfDDf™™3"""""UUD33333Dˆª»™f""D3""""""""""3"""""""3""""""""""3"33DD3333"D3fUwwfUDUff""""3"""""""""""""3"DÌD��""""""3Ufw3""""""""3D"3D33ffD33"""33""""""""3333D3DUfUfUUfwUD"DD3D""""""""""3""fDD"""""""""3DDDUww33"DwD"""""""""33""""f"3D33"3333D33"33"""""""""wD3"""""""""UfˆU"D3""""""""""""33"""3""3UUDDf™ªf"3""3fDDD33333ªÌ̈D""D333"3""""""""""""""""""""3""""""""D333333fwwfUDD3DUUUU3""""""""""""U3""""33ªf��"""""""""DfD"""3""""3U3"""DDDDDDDD333"""""""3333DDDUUUfUfˆDUUD33""""33"33"33""33""UU3"""""""33UUfwˆD"3"ˆ3""""""""""""33"""D"3"""""3333"33"""""""""""""3"""""""""""3""33f3U333""""""""33""3D"3DDDUUww»™wU3"fwDU3333U»Ì»f3""3DD33"3""""""""""""""3"""""""333333"3fwU33D333D333D3"""""""""U"""""33Uˆ"""""""3DDDD""""""3DU3DD"""""33UfffUDUD3"""""3"""333D3DDDUUUUfwwwwU3"""3DD3333DDU3DD""""""""""33UDUwˆU"""DD"""""""""""3"33"""33333"33333D3D3""""3""3f3"""""""""""""""""DD3D33""""""""""""""""333"33D33fwww™»ª™wD3wD3D333Dw™ˆD""""Uf"""""""""""""""""33""""3"33333333fUD3"""33333DDD"""""""""3""""3»"�"""""3fD"""""""DDD3D""""33UUUfwfUD3""""""""""333DDDDDDDUUwˆˆˆ™U3"""3"3"3"3D33UU3""""""""33DDDfˆw3""3D"""""""33"""""33""3""D""333"33"U3"""""33""fwD""""""3""""""3"33DD3"33333""""""""""""3"33"""""UDDD"UUw™Ì»ªˆUDUfDDD33DUDfD3"""""D""""�"""""""3"3"33""""""33"3"""""3DUD3""""""""""333D""""""""""""""3"3»™�""""""""3U"3""""33"3UfffUUUUD3�Uf3"""3"""3""""33DDUDDDUUfwwˆwˆD"""""""""DD"UUD""""""DD33Dfww3""Dˆf""3333"3"""""""""""3""""33D"""3""""333DDUfUD3""""""""""""""""33333333""""""3""""""""""33"""""333wfDDDDUwªÝ»ªˆDUfDDDD3DD3DD33""""""""""����"""3"""""""3"D3"""""""33""""DUUD3"""D3"3"""""3D3""""""""""3"3D™Ý�"""""""""33Uf"""D3333UwUDD3"33"UU3333""333DDUDDDUUfwˆ™™wD"""""3"3""UU"""3""""DDDDDUfwUU3ˆf3DDDUD""333"""""""3"333"""3"D"""""3"ffUUD33"""""""""33"3333D333""""�"""""""""""""3333"""""UfUDUDDfˆª»ÌªwUUf3DD33DD""3"""""""""""3""""""""""""3DDU""""""33"""3UUD3""""""""""""""3DU""""""3""""""""""w™Ýˆ�""""3"3"D""3DUw"""DDUDDfU3""UD3D"""""33DUUDD3UfwˆˆªªˆfD3"""""33"""""""3U3DD3DDfw"3UfUUffUUDD3"33333"""""""""""3D""""""ffUDD333""""""""""""33DD"""""3"D3""""""""""""3D333333DfUDUDDw™w™Ì™ˆˆwU33DD33"3""3""3UU"""""""""""D3""""""""""3fD"""""""3UUD3""""""""""""""3"D3"""3""""""3ˆÌÝ3""""""""""""""333wU""DUUfUUD3""""""3"""""33D3333fww™»ªwUD3�"D33"""""""""""D3D33D3Dfˆw"DDˆˆ™ˆwwUD33""333""""""""""""3"""""3ffDDD3"""""""""""""33333D3""""""3""3"3"""""""33333"""3"3DDUfDUw™™ªª™ˆwU3DD33D3"3""""""UD""33"""""""33""""""""""""33U"�""""3UUD33"""""""""""33UfDD""""""""""fªÝª""3""""""""Dwf""3UUDU3"""""333333DUwˆ»ªf3"�""""""""""""3D33D33DfwˆˆD33wffU3fU3D3"33""""""""""""""""""DUDUUD33""""33"""""""""""""""""""""3""""3"""""33333"3333DDDDUU3UUˆˆˆ™™wU33D""33333""33"""""""33"""333333""""""""""""""33""""3UD3"3"""""""""33DU™™D"3"3""""""""3™ÝîD""""""""33"""3"""3DUˆw33""33""33DDU™ªˆD"�"""""""""3333DD3DDUˆw™"D"""�wfU33D3"""""""""""""""UfDDD33"""""""3"""""""""""""3"3U"""""""""33""3333D333UU3UUˆªw™fU3DDD33DD""33"""""""""3""333DDDDUf3""""""""""""""3fU""""3fD""""""""""3DfwwUDD3""""33"3ªÝÌ"""3"""""""33DUUfU3"""""""""""3UUUwˆwD���"""""""""""""33333D333DDfˆ™w""""""""33"3DD333"""""""""33"""DfUDDD3""""""""""""""""3"""33""""3D"33"3""333333""3333UDDDfª™ˆfD3DUDD3DU"3"3""""3""""""3DD3""33UU33"""""""""""""""DD3""""""3UD3"""""""""""3wwf3DDUUD3""""""""UÝÿU""33"3"""""""""""""3DDUffU33"""����"""""3DDUffDU""��""""""""""""3D3DDDD33DDUUffw""""""""DD3""3""""""""3"3DUUD333333"""""3"""""""3""""""""3"333""3"333DDDDUDUˆ»ªw33"33DDDD""""""""""D"""""3DDD3"""333D""""""""""""""""DD3""33""""3D33"""""3"""""""UUw™ˆDDUUUU"D"D""""""""""""3™ÿÌ�""333"""""D""33""3DDUUffDDD333"3""""""�"""""3UUUDUfUU"���""""""""""""3D33DD3333DUUfffwD"""""""DUDD33""3"3"""3DDUDDDD3333"""3"""D3"""""3""3""""3333fUDUDDf™ª™D333333DD"""""""""33""""333D33"""333DD"""33""""""""""3333"DU"""fU3"""3UU3""""3""""UUDDff3"333D3DUD"""3""""3""3wîÌ"""3"""""""33"3333""""DDDUUUDDfU3333"""""""""��""3UUD33D"""�������""""""""""""DDDDD333"33DUfUUUf"""""3DD3DD3D33""""UUUDD333333""""""3""�"3ˆ3""""""""33DDffUUUfˆ™ªf3"""3DDf3""""""""3""3"""33"""33"""33333"""33"""""""""33DD33D3"Dwf33"333"D"""""""""""D33333333D3""333DD3"""3�"DfwwUwˆ™w"""""""D3"D333"""""3DfUDUUfU3"""3""""""���""3DDDDU333��������""""""""3UUU3D"3"333UfUUfUff3""""""3"""3"3D333"fDD3D3D3D3333"""""""U3"""""33U"""""""3"3DDUffUUww™™ˆDD3""3fwU33"""""3D33"3D"""""3"3333DDD3"""D""3"""3""""33""""3""""fw"""""""�"""333""3DD"33UD3"33D3DU33"""fwfªªww""""""""33D3"3""3UUUfwwwUD""""""""""���""33333U"3"""�����"""""""""""""3DDD3Uwf3""""""DwUDD3DUUD3""3D3"3"""""""""3"""fU3D3DDDDD33DD3""""""""3fff3"""""""""""""""3333DUUUUDDfwfˆwDD""U™3""DDD"""3D3DUfD""""""D"3U"3UD3""33"33"""3"33D3""33""Uf"""""""""3""""D"DUwf333333"3DDDDwfUUwˆwfU���""""DU3"333"""DUUfˆwfD3"""""""3""����""333"33"""�����"""""""""3"""Dfff3""""ffU333"333DD3DfUUUDDD3"""""""3""3f3333333333333"""""DDDDfU""""""""""3U""""""""333"33DDDUDDDwDwfD3""DfD"""DU3DDD3""™ˆ"3"""""3"333DDDD3""3333333"""3D3"D"""3DD""""3""""""33UUUU333D3"""""3DUUU™fDDDˆ3""�"""DfD"D3"""""DUfw™ˆwD"""""""33"������"""3DD3"""""�"33""""""3""33fw3"333""""""33DDDDDUUfwwD""""3"""""3f3333D3333D33333""""""""""""""""""""""""3"""D"3"""3DDD3U™fUwU33"3D"""""""3""""f™f"""""""333"DUU33"""333"""""""3D"""Dwˆ3""""""DD""""""""D3"3DU""D3"""3DUUDDDˆwD""3fˆ�"""""""""""""3""""""Dffw™wU3""""""""����"""3D3""""""""""""""""""3"3"3ww3"D3""""3"""33DD"33DDDwˆU""3D33"""D3D3"Df333DUU33"""""""U"""""""""3"""""333""""33DUUfff3DU3"33""""""""""3DDD3DD3""333"3DD3""""""""33"""""""""3DDDwf3""3""""""33""D"3"3""""3DU3DDwwD"3f™�""""""""D3"3"""DDUUwˆU3""""""""""���"""3""3""�""""""""3U""3"""""3""""333"3333DUUfwfD3D3""33UD3""3DfDDDfwˆD""""""""""""ff"D3""D""3""3D"3"""DUfwDD3"DU3UD"""""""3U3"""33DDD3333333DD3"3D"3""33"33""""""UU3DU3""""""""""""""""""D3"3UD333f™D""33f™""""""""Dw3""""""33UˆU3""""""""""�"""�"""33"""""""��"3""""""""333"3333"""""33DUUUUUU3""3DfUDD3""UwUDDffˆˆU3"""""""�U™U3"33U"3"3"UUD"�"""3"D""""Uˆ™wU33"3fDU3""""""""DD"3"""D"3"3333333D3D33D3"""""3"3"""3""33Dw3"""""�"3"""""""3"""333"3UD"3fw3D""3"3™f""""""""33""""""333fwD3""""""""""""""�""33""""�"""""""""""""3""3""""""""""333DDDUUf3333UfUfwUDDDDD3Dffˆ™ˆwU""3"""3™ˆU"3"3"3DUU"""""""""""""3"3""""U™™ªˆf3"3wUUD""""""""""""3"""""""3D333D33DfD333"333""""33"""""3""3"Uf"�""""""""33"33""UDDˆ™333"""3wª"""""""""3""""""""33"DwU3"""""""""333"�"""""""""�"""""""""""""""""""""""3""""3D3333DDDDDffDffffwfUUUD33Dffww™ˆwf3"""w™ˆD""""""3DUUD""""333"3"""""3"""fªªª™ˆ33ˆfUU"""""""""33""333"""""3UDDDUUUUDD"3333"D"""""333"""3"""DUU"��"""""""""fD3"333DDDwˆ"""""""fª"""""33""""3"33"3"3UˆfD""""""3D333""�U"""""���3"�""""33"""""""""""""""""33333D3DDDDfwˆffDD3DD3333Uwªª™ˆˆˆf3""""ww™™™f"33D"UUUD3"""""3DD""""""""""3U™ª™ˆUUwˆwˆD"""""""333"333""3""""3fUDfwfD333333"333"""33"DUD""""33U3"""""""""�"""""U33""3"UUDˆˆ3""""33Uª""""""""3""""333333""Dfwf3""""""3DDD3""""��"U�"""""""������"33""""3""""""""""""""3333333333DfUUffDD3DDDDUUw™ª»»™ˆˆˆ™333"U™ˆ™™w"""""3""DDDfU"""""""""""3"333DDUˆ™ˆwfUˆwˆD"3"""""""3"3"3""3"""""3UDDffffDU333"3"3333DD33333"3U3"3D3"""""""""3""""3"3D33""3fˆˆ™"""ˆ»"""33""33333"333"3D"33""""3DUUDD3"�DD""""""""""�������""""""""""""""""""D""333333fDDDD33DDUUDDUfˆˆ™™ˆwffˆU3UUDDDUˆˆ™ªˆU3""3""""33D3U333"""""""""3""3"3DUfˆªª™UˆˆwwUD3""3333"33333"3"""""DDUDDUfˆfUDD333333D3333""U3"3""DU3""""""3""""""""3"333"33wªf"""""""D™Ìf���"""""""""3"33DD33D3""""33D3"3DUffUD3""""�3""33""""""""33""3"�����"3""""""33""""333333"DUD3333D3DDDDD3UUUffUfUfˆfUUUUDUDffUw™™wD3""33""""3D""DD3D"""""DD333"3DUwww™ˆªwf™wf333"33DDD33333333""""DDUDUUwˆ™wfDDDD3333"3DUUfˆD3DDUD"""""""""""DD3"""""33DD33D3Df™3D33"3Uf™f""""333DDUD3DD3"""DDD3DDfwwfUD33""""""3""""""3"3D3333D3""��""""""""""""""""""U33"""DDD333333DD3D3DDD3DDfffffUfUDU3DDUffD3UˆˆwUUUfUD"DU"""33""D""""""""3D"3"3DUfffUˆªˆUwˆ33D33333DDD33333"""""""""DDUUUUfwUfDDD33D33UUD3DDUUfUD""""""""U3""""333D3D"33UDUD333D3"""33wª"""3"""3333DDfUDDD3"""33333fwˆª™wUDDD3"""""""3""3""""""3""""""""���"�"""""""""""""""""""""33"3"""""3D333333333333333DDUfUUDDD3UDDDDUUfDD3Dww™wUUUUUDD"U3""""33""3"""""33""DUUUwff™»ªwˆ™"""3D3"DUUDD33333"33"""""3DDDfwˆUUUfwwffDUfU3333D3"""""""""""""3"""""""333""33wD3DDDDD3""""33w»ˆ"""""33"""33D3UfUDU33"""333DDfˆ™™ªªfUDfU33""""""""3""""""""""""""""""""3"""""""""""""""""3333"333333333333UUUDDUUDD3D333DDDUU3DUwUUUDDDUUUDfD33"""3DD"3""""""""33DDUfUffUDª»wˆˆw"3""3333DDUUDD333"3"""""""""333ˆª™ª™wwfUDD33333333"""""""""""""""""""3""3333"DDfˆ"DU"""3"""""33wf"""33333"ffUUUD3"""3"DDfDDfwª™UDDfUD3"""""""""333""""""""""""""""""""""""""3D""""3D""""3333333333DUUD3DDUUD3333"3DDDUDD33UUDD3DDUDDUDf3D33"3DD3DU""""3DUUDUUUfˆˆªª™™™U""""3DDDDffUDD33D33DD3DDUfffˆˆwfUUDDUfDD33""""""""""""""3"""""""""""""3"""3"3Df™3"UD3U33""""3UDf"""33333"DˆfffDD"3fUD"""Uw™DDUww3333"""""""3333"""3"""""""�"""""""3""""""""""3DU3"""3D3""3""33"""3DUfU333DUUD3333D"333DD3333DUD33DDDDDUUUUUU3""3333UD""""""""3DfUfUD33ˆªª»»™D"33"""""DDUUUUDDffUUUUUUUfffwfU33D3DDD3333"""""""""""""D""""""DD""D""""""33DDUˆ™DDˆˆwD"3"""""DˆˆU""""333""33UffwfU3""""UU"""33D™fUffwfU3"""3""33""3"D3"3""""""""""""33""�""""""3U3"""33""33"33""3UfUUD333DDDDD3333""333DD33"33DDDD33DDDDDUUUfD"""33DDD"""""""3333ffwwffDDw»»ªw3""3"""333DUfDUfwwU3D333""333DDDD33UD3""""""""""""3"""""3D"""3""""""""DfU3DUwª™w™ªw3"""""U™D""""33"""33DDDDwfD"""DD""""""DDwwUwDDfU33"3"""""33"""3"3"3"""""33""""""3""�"""""33""""""""3""3"""333DUwfU3DDD3DDDDD"333333"333333D3DDUD333DDDDD3DUwU""D3"3D3""3""""""""333fwfUDUwwªª™™D""""""""3"DwwwfwfUD33333""""33333333D""""""3"""""""""""""3"""3"""""3""3DDˆ™w™ªªf"""""""3Uˆ"""""""""33"""333DUUfˆUD33"""""""""33wfUwUUfD333333""33"33""""""""""""""""""3D3""""""""�""""333"""""""3"""3"""33"3DwfUD333D3DDDDDD3"33"3"""""33DD3UfU333333DD3DUDDUU3333""DDD"D3"""""""""""DwUD3DUfˆˆ™ªˆ3""""""""Uw™ˆfUDDDDD3333333333333333""""""333""""""""3""""""""""""""""""""3Dwˆ™ˆª™w3D3"3"""33ˆf"""""3"""""""DDUffUUwU3D3""""""3""w™ˆˆˆwfUDDDDUDD3"""3""""""""""3""3D""""""�"""""3""""3"""""33"""""3UffDDD33D33DDDDUD3"3"""333""""333"wf3""""3333DUDDDDD3"33"33DDD33"""""""3UfDD3UUfff™ˆD""""""UU™ªwUUU33DD3DDD3333""""""3"3"""""3""""""""""""""3"""""""3"""""""""""3Dfwª™fwD""""""33U™""""""3""""33DDUfwfˆwwUDDD"""""""""33f™™™™wwwwDUU3UDU333""D��33""3""""""33""""""""33D"""""333""""3UwU3"DD3DD3D33DDUD3333""""3"""""""33D"3""333333D3DDDDDUU3"3"DD3"33U3D""""""3UDU33DUUUˆ™D3"""3D"DªˆˆˆfD333D3D33"3D""""""3"""""33""""""""""""""""""""""""""""""Dfˆw"""""D""""D™wD""""33"33"3DDUUfwUDfwwfU3D""""""""3333DUfˆª™™™™ˆˆˆUDwwfD"3"""""�"3D"""""""""""""33"""""""""""3D"""""333333Uwf33"3DDD3DUD33UD33""3"33"3""3""""3333D333333333D33333DfDDD3"DDfU"""3UUD"""""3D333""3Uw™wUD"""DUD"3UwfffUDDDDD33D33"""""""D3""""""""""""""3""""""""3"""""""""""""333wˆ"""U3"""""""f™"""""Uf"""""3ˆ3"3"DfwU3UwwwfUDD33""""""DD33DUfDUˆˆª™ª™™wUwwD33""""""��""3"""3"""""""""""""""3"""3""D3""�""""""3""""DDDfwU33"33DDD333UDDU3""3333333"""33"""""3D33333333333333"""3wUDDD3D3"""""DUDff3"""""3333""3Uˆ™wD3"""DUUUDDDDDDDDDD33"3"333"""""""333""""""3"""""3""""""""""""333D33Dww"""D3""""""""DfD�""Uf""""3ˆU"3"3UwU""UwˆˆfUUDDDD333"DD33D3DUUUUˆˆ™ªˆwwww3"33"""""3"""""""""""""""""3"""""""""""""D""""D3333DUfwU"33""3DD3333DDDD3D3"""333""""3"3""""3DD3333"3333333"""""3UD"3UD""""""33DUwwD3""3"""333"""""3Dˆ»w333DUUUD333333333"""3""333"""""""""""3"""""""""3""""""""""3D3"33DDfU""""""""""""333fD�""""""""""U™D"333ffD3"""UfwˆˆwfUUDUUDDDDD3DDUDDUUUfˆ™ˆˆfffUUD3""""""33""3""""""""""3"3""""""3"""""""333""""""33DwwUD"33D333DDD33DDDD3""""""3333""33"3"""""33"3""3"3333"3""""""""333"""""3DDf™U3"""""""33""""""3UˆªfDDDD3D3"""""3""""""""""3"""""""""3"""""""""""""""D3""""""""33333DU™3"""""""""D3wf�"""""""U™D33""fw3U3""DDUUwˆfU3UUDDDD33DUfUDfDfˆˆwffwfwUD3""""��""""""""""3""""""3"3U3"""""3""3D3"""""3UwwD"333"33D33D3D3DUD33"""3333333""D"3"""""""""3"333"33"""""""""""""333"""""333DfUUD3"""33333"""""""3DUwwUD"33DD33""""33333333""""""3"""""""""""""UU""33""""""""""""""""3333UˆD""""""""""3"Uwˆ3""""UªUDU3"DfD""""""""3DUfffDDUfUUDDUUf"UffwwwwwwwfD3"3"��"""3"""""""""3D"""3""3D3U"3""3333"""3U3""""""""""DfwU333333333333D3DDD""""3"""33""3""DD"""33""33""33"""33"""""""""""3""333""""33"3DfUD33"3DD"""""333""33DfwwDDD33D33333333UUDUUU333"3333"""""3"""""""Dwf""""""333""""""3DD""""3"""""""DDDˆU333"""""333U™™3"fªwUU33DfU"""""""3""3fwwwDUUUDDUffffUfwwfwfUUDD3"""""���"""3"""""""3"""3DDUUDDD""3""3"3""3DD"""""""""""""Dww3333333333333333DUD""""33""""""33""D3""""""333"33"33"""3""""""""""""""""""3333DU3"UDDU333""33333D33DDUfffUf"3DDDDDDDDDUffUwUUDDDU3D3"""""""333"""""""""DD"""""""""33""3"""""""""3DUfU3D3"""""""33U™ªf�"wˆwwfDfDfU""""""""""DUUfDUUDUUfwffˆfwfDD3DDDD3"""""��""""3"""""""""33DDD33DD33""3""""3D33""""""""""""""3UwU3333"3333333333DDDD"""""""""""33333""""""""""3"3"33"33""""""""""""33"3"""""33D33DUfUwˆˆDD3"""3333DDDD3DDUUfUUDDUUUDUUfDUUfwwUUfDUUDD"D3""D3333""3""3"""""""""""""3""3"3""""""""""""33DUf333"""""3"3U™w""wfDwwwf3Df"""""""""""3ffUUUUffˆwwUDwU33"3DDD3""""3"""""3""""33"""333""33"""""DUD""D""""3D"""""""""""""""Dff33""3"333333333DDUD""""33""""333""""""""""3""""""3"""3"""""""""33333""""D33333DDDUUfwU""3333DD3333"33DD3DUUUUUfffwwfwDfUwwfU3"3fffDUUD3DDD3U333"333"33""""""""""""""""""""""""""""""""33UfU"""""3""""""33ˆ™""3fD"DDUwˆUUU"""""""3"""""UUffDUDUwfffUUD"D333D33""""""""3"D3"""""3""3"3"3"""333U3"D""3D3""""""""""""""3UU3"""""3"33333"""3DDD3"3""""3""""""""""3"""3""""3333"""""""""""333D33"3DDD33"""33DDDDU3"3DD33333"""33DUUD3DfffUUfˆˆUUw3DUffDUwwfUUUfUUDDDfUDDDD33DU3"""""3""""3""3""""""""""""""33DUw"""""""""""""3ˆf3™D3DD""3Uff"""""""""""3DffUfwfffUffDD"33"3D33"""""��""""333""""""""""3"""""""D3D"3D"""""""""fU3"3"""""""33"3"3"3DD3""""3""""""""""""""""""33333""""""3""""""""DDD33D333""""3U"""""3D""3D33333"""3DUUD3DUfwfUwwfU3UDDUffD""wwwUUUfwwDDD3DUDDDDDDD""""""3""D""""""""""""""""""""3""""3"3Ufw"""""""""""""3DDˆD""3ˆDUfD"3™ˆ3"3""D"""""3fwUUwUUU3UU3""D"3333""�"""""""D3""333"""3"3""""D""""33D3""""""""""""""3fD""""""""""3""33333U3""""3""""""""""""""""""3D3""3"3""""""""""3DDDD3""3D3DD""""3"33"33"3""""""3DDD3"DUUfwwwUDD"3DDUfU""""3UffwwˆˆˆfDDUUDDUDUD"""""D""""3""3"""""""""""""""""""""""DUˆD"""3"""""3UD™""�DwD3D3"�3wwD333"3"""""DffUUU"3D3""""33"33""""��"""""""DfD33D3"""""3"""""3""fD3DDUD"3""""33"""""""""""3UU""""""""3"33333U3"""3"""""""""""""333333D3333D33""""""""""3DDD333D33"""""""""""333"""""33DDDUfwˆªfD3"""""33"""wwˆ™ª™wDDUUUUUfD""""3""""3"""""""""""""3""""""3""3DˆD""""UU"""""DUUf"fˆ33U3"""U33""3D"""""DwfffD""""""""33"""3""""""""""3UUw3"""3"3""""""""3""DfwˆD""""33"""""""3Dw""""""3U""""3333U3""""""""""""3D333333"3""333333""""""""�""""""DfDD333"3"""""""""3""""""""3DD3DUUUˆwU""""""""""fˆˆª™ˆffwfUUfD""""""3"3D3333""3"""""3"D3""""3""""3"Uˆf""""""""33ff""3™ª3"D"""U3"""""D"""UwUUwU""3""33""3""3"""""""3UD3DD3""""3""""3UwffD"""""""""""""3Uf"""""3"""""33DD3""""""""""""""3"""33""""3"3333""3""""""""""""""""3333333"333"D3""""""""""3DD3UfUDfw"DD""""DDDD"""""3DUUwˆfwffwwf"""""""33D3D33D3"333""33""D""""""""""DwD""""""DUff"fªwDDD"""DD"""""3"""3fwwwU"""3""""""""""""33D3DU33"""33"""3DDUD"���""""""""3DUD"""""""""""33DU3"""""3"3""""3""""""3"""3333""3""""""""""""33"""""D3"""DDDUU3""""""""DDDUfwfwfwU"D""""Dˆf3DU3"""D33fˆwU3""3""""""3DU3DD33"3D3333333""33"3""""""""3DU33""""""3UUˆDUD33DwªU3D3"""""3""""""3"""""Uwwwf"""""3��""""""""""D3"D""3""""""""DDD""""3DfD""""3"""""3""""DU"""""D""""""3""""""3""""D3333"D"""""""""""""""3""3""""3UUDD""""3Dwˆˆ™™™wUwwwD"D3"3UfDD"3D""3""fwwf3"�""""DD333"3D333""""3"3333333""""""""3ff"""""""""""3wˆU33UU™™DD3""""""3"""""""""""""3wwˆUDU""""""""""""""33"3""""""""33D"""""""�"""3DUD""33""""3"3"3D""""""3D"""""3"""""""D""""3""33333"""""""""""""3""""""DUU33D""""""3UªwU"UffUUwww""3UUU3"""""3U""""""DwfUD""""""""DDD33"3333"""333333333"""""""""DUUU""""""33ªDDffUˆ™D33"""""""""""""""33"""Uww3"wˆU""""""""""""""""3"3"""333D3�"""""""��"""33DUU�"33"""""""""33333"""""D33"3"""3"""""""3""333"3""""""3""""""""""3Uf3D"""33Dwˆw3"DUDDUf™f""Uˆf""UD"3""""3UfUD3"""""""333DD3""3D3""3333"33"333"""3"""""3UU3D3""�"DDUffU3DDDf»D3"""""""""""""""3333""3U33D™w""�3"33""""""3"""""""33DUD��""""""""���""3Uf3"3333"""""""""3DD"""""""""333""3"""""""3"""33""33""""""""""""""""""DD"""33Dfw3"33DwDUUUU3"3ˆw""""""U3"""3UfUD"""""""""""3333""D33"33""33"""3"33""3"3"3"""""""DD3333�"33"DUDDDˆ3"333DªU""""3"""""""""""3DD""""""D33"3ˆˆ3"""��""""33D3"""""""3"""33DDDD"�"""""""""���"3UfD"33"""""""""""3D3"""""3333"""""""33"""""""3"""""""""33"""""33""""""""""""""DUfˆf""3""DD3"""DfwD""""33"""UwU33""�"3"3"""3DDD"""""3333333"3"""3333"""""""3Uf""333"""3UfUD3"33ww""3"3™U""""""""""""""""DfU3"3""3"3wˆˆD"""���""3D3""""""3""3"3DDUU3"���"""33""""""���"DfD3"33"""""""""33D"""""""33"""""""""""""""""""3""""""3"""""�"�3""D""""D""""""""DUwwˆ3"""3"""""f™U3"""""""""Dwˆ3""�""""33"3DUfD3""33"3333333"""3"3"""""""UU3"""""3""3DDDDDD33""3w™""3"3ˆU�"""""""""""""""3"DUUU3""""""UUfU"""3"��""3UD"""""3"3D"333DUU3"���"""3DD33""""""3fUD3""""""""D3""""""""""""""""3"""""""3""""3"3"""3D"�"""3333"D""""3DUDf™w""""333"""3D333"""""3""DfˆU""�"""""3333DDDD3"3"3"3D33333""33D33"3"""""""Df33"3wwDU3D33D33D""""333™3"33Dff�""""""D""33"""""""3DD""""""3Ufwˆf""""Df"""3UwU"3"""""3"3"Dff3�����"""333"333""3"""��3f""""D""""""3"33""""""""""""""""3"""""""""""3"3""""""""3fD"""�"33D33""""""3"3DDwwwD"""""3""""""33""""""3"""33wU""�""""33DD33DD""33""33333333"3"""33333""""""DU3""""33"D33D333""3"""33Df"3DDUf�D"""""""""""3"33"3""33UfwfDU""""""fD�""""""""DUD3U3"3UwfˆUUwwU3"���""3333"33DD33"��3D"333""""333UUD""""""""""""""""""""""""""""3"3""33"""""3D3"""3D333"""""33""333UˆU3"""""""""3""3"""33"""UU3""""33""DDDDDD3"""""3""3DD33"3""3D3333""""""DU"""""3"""33D33"""""3D3Df33DDU�"3""""""D3"""33333"""33U33D"3""3D���"33""""""DDDDUfDUfwˆ™ˆwDDDD3�����""""33"3UU3"���33"3D3""""33DD"""""""""""""""""""""""""""3"33""3""""""""3"""""""3D3"33""""3""333DwwD"""""""""3333"""""""""3U3"""""""33""D3"333D""""""""333"""3"D3DD333""""""""33"""""""""""3333""""""333"Uª"33D�D""""""33DD33"33"""3"3"""""""""""""""33""""3D333DUUDfw™ˆDff""33""333333D3""�"D"""DU3"""""""33D33""""""""""""""""""""""""""""3"3"3""""3""""""""33"""""""""3DD3"3""333""333DUˆU3"""3U33""""""""3UD3""""""333333333"3DD""""""""D333DDD3DDDD33""""""""33D"""""""""""D3"3"""""""DD33»ˆ"3D33"3"""33DDD3"333"""""""""""""""""""""""3D3""""333DDUfffwf3"DD33333�"�"3""33333D3"""""3D"�"DDD3"""""""3"33D3""3"""""""""""""""""""3"""3"3"33"""""""""3""3"""""""33DD33"""33"""3DDUwf3"""""3D"33"""""UU3"""""""""""""33D33333DD""""""33333DDDDD333"""""""""""3D"""""""""""""""3D""""3""3ˆªDDf�"""""""""3"DD3""3"""""""""333"""""33"""""""""""""3DDDDUUwf3"""""33""333333""""""""333D"D33"""""""""333DDD3""""""33""""""""3"33"""""""3"""""3"""""�""33UD3""3333""3DDUfˆf"""3D33""""DDD"""""""D333"33DD33""DD"""""333DDD3D3DD33""""3"3"""""3D"""""""""3U"""D33"w™ˆ3w"�"""""""""""3""""""""""""333""3""3"3"""""3"D""3DD3DDUff"""""""3��""333"""""""""""3DD"DD3""33"""""""33DDD""""""3"""""""""D""""""""33""""""""""""""""""D3DDD333333333DDfwwf3"""DD3""""3UD""""""""""""""3"""""""""333""""3"3DUUDD3DDDDD3""3"""33333D""""""""33"3D3UˆfwffU"""3""333"""""""""""3"""33""�"""""3D""333"DD33UD3DUfU3"""""3"""""""""""""""""""""3DffDD""""""""""33"DDDD"""""""""""3"""""3"""""""3""""""""""""�""DDD33333"333DDDDw™f""""33D"""""3D""""""""""3"""""""""""3""""""DUD3""3D33D333"33""3333D""""""""""D"3DDUfˆˆ"Dˆf�"""3""""33"3"""""3"33"""""""""""""""""""3U""""333"D3DU33DUfD""""""""""""""""""3DwˆD"3"""""3"""""""3"333DDDD""""""""""""""""""""""""33"""""""33""""""""""DDD3333333"3DDDDf™3"��"33D"""""D""DD""""""""""""""""""3""""DU3"""3333333""3333D3DD""""""""3"DD3UDDfˆfDDww33""�"3""333"""""""""""""""""""""""33DD"33"3""3"UUD3Dff333""""""3"""3"""""DDˆˆ3"""""""3"""""3""""""33"33DDU3"""""""""""""3"""""3"33"3"""""""""""�""""33DDD333""333DDDDˆf""�"333""""33""33"""""""""""""""""""3333"3""33""3333D333D3"333"""""""""3fDDDDUUwˆfw™ˆ"DD"""33"3333"3333"""""""""""""""""""""""3"DUDD"333DfD""DUwfD33"""""""3""""""""3"""3fˆˆ3"""""""""""""""""""3DDDDD""""""""""""""""""""3""""3"""""""""""""33�"""3DDD33""""333DUUff3""""�"3D""3""""""""""""""""""""""""""3D33""""""""333333333DD"33""""""""D™U3DDUfwf™ˆªf333"""""3"""3DD"D3""""D3""""""""""""""3""""DfUU3""3D3f33fwUD"""""3"3""�"3"""""Dwˆ™UD"""""3"""""""D3"3"333U3"""""""""""""""""3"""""""3"""""3""D"""""3U3DDD3""""33DDUUffU3"""""""""3D"""D""""""""""""""""""""""""""33"3""33333"333D3333D"3333"""""333fªU33DDf™fw™™D33""""""33"""33D""""3D"""""""""""""�"""3""D3fUwU333UDDDDw™f3""3"""""D"3"U""�""""DwUwU"""""""""""D"""""3""3DDUf"""""""""""""""""3""""""""3"""�""3""333D33DD3""""33DDUUffUD""3""""""�"""""""D"""""""3""3""""""""""""33"""""333"333D33DD3DD3"3"""""3""3f»wUUUUf™UU™ˆU333""""""333DDD""3"""""""""""""3D"""""fˆfUUDfD"DUˆ™wUDD3"""D3"3D3"D33"3DUD3ff3""""""""""""3""3UDUD3"""""""""""""""""""""""""""""""""3""""3D33""""33DDfffff"""33""""3"3UU3"D3"""""3333333"""""3"""33"333"""3""333"D3D333D3333"""""""3"""ˆÌfDUffˆwff™wD33"""""""""DDUD3"DD3"""""""""""""""3D""""UfUU33UDUfªˆwU3DDD3""D3"3D3DU""""""�""Uf3""DwUD""""""3"""""3DDUU"""""""""""""""""""""""""""""""""""""""3"3D3333DD3"""3333Uˆwwˆ3""333"""""""""33ˆf"""3D"""3D3"3333""""""""""3""3"333""3""333333333""""33"""""""U™ªUUUUUw™Uwªˆ3D3"""""""""D3DwU"3"""""""""""""33"""""3DD"""3UD"""fffwfUUfwD3333""""3D333DU3""��""3U3""3DfwU""""""""""""""3"DfwD""""""""""""""""""""3""""""""�""""""""""""""3"""""33D33"333DDffUwwU3""3D"""""3"""""Dfw""3U""�"""333D3D3"""""33""""3""""3""333""333""3333"33D33"""""""3™»ˆDDUUUfwU™™f"33"""3"3D33"3DUf™wD""""""""""""""""""""""3DU""3333"333fwfUfDDUUD333""3"333DDDD""""""DfU"""3wf3""""""""""UfwfUfˆD""""""""""""""""""""""""3D3""""""""""""""DDD33DDUDUfU3DwD"""333""""""""3U3""fU""""""333"33"""""DUU3"""""3"""""""3D3""333""333333"3"3""""""Uª™fDDDUfUff»ˆ""3D3"""""3D333DUf™fˆˆf"3"""""""""""""""""""""DD3""3UfˆfUUUUUUUDD3333""3""3D33"""""��"""3fw3"3Uw"""""""""""UwffwwwwD"""""""""""""""""3""""""�""""""""""""""3DD3DDUfUfwf33fw3""""""3"""""""""""""U""""333"""""33""""DD33D"3333""""3""""""""3333"3333""3D3"""3ªwUDDUUUfwˆ»f"""3"""""DD33DUUw™f™ª»™U3""""""""3""""""""""""333""3fwªˆwwfwU3DDDUD3""D33U™™wf""D3"33""""""U™ˆ3""3fD"""3"fˆwfwˆwfD"""""""""""""""""33""""""�""""""""""""""""""33DUUUDfUUfffDUw3"""""333"""3""""""33D""3"33""""""""333""""3D33"33"""3"""""""3333"""3""333D"""""""�3™wDDDUUUfwªˆD"3""""""""DDDUfˆfªª™Ìª™™»™33""�""��""""""""""""D""3""DfwfUfw33fUD3"DDU3Dwˆªª™™wUfD�"UU33""""""""UˆfD""Df""""""3Uˆffˆ™ww3""""3"""""""""""""�"""""""""""3""""""3"DUUfUUwUDDfwwwU"""""33""""�""""""""33U3""""3""""""3"33""333333333""""""""3D3"""3"3333D3"""3"""w™UDDDUDf™ª™3"""3DDUfwˆˆªˆÝÌ»»™ªª™3"DˆÝÌ»™ªª™ˆf3D""""""""DU33Ufw™wU33ffU3DD333"3UD3ˆ»ªwfwfUfˆˆwˆw""""�""""""Dww3"�"3UfD""""33fˆwwˆfU"""""""""""""3""""""""""""""33"""""""3DUDffwwfUDDwˆfUD"""""""""""��"3""""33U""""""333333"""""""33333""""""3DD33"""3""3333"3"""""""""""""""™ª33DUDDˆ»Ìˆ"""""33DUUfˆÌ™UUˆª™™ˆ™ªª3UªÝîÝ»»»»ªªª™w""""fffUD33Uˆ™wU33UwfUwfUDD3333U3ww™wfUfUffw™™wDDf""""3UwU"�"�"3Uw3�"""""3"UfwfD3""""""""D333""""""""""""""""""""3""""""""3DDDUUUˆˆfU3UwDDfD"""""3""""�""33"""3D"""""3D3""""3""3""333"3""""""33DDD""""333333"""3"""""""""3"�3ªˆ333DDUªÝªU�""""""""333DfÌîÝ»ˆUwªª»ªÌîÝîÿ̈UffwfffˆªffUUˆUDˆ™ˆU3"3DwUf3DDDDfwwˆˆwD33333DfwˆfUUUDDfffwUfUD3DDfwˆ33"3fUD""""""3DU"�"""""3DUDU3"""""""3333"""""""""""""""""""""""3""""""3DUDDfDDfwD"UˆfDff33""""""""3""""3U"""""""""33""""3""""""33""""3333""""""33D3""""3"""""""""�fªf3333Dwª™D�"3"""""""""3fÝÝÌ»ÝÌ»ÌÝîÿÿîÝ̈wDD33UUUffwˆ™»ª»ÌÌÝÝÌ™UDwf"3D33D33Uˆ»»™ˆfDDDf™ªfffUfUDDDfffUUUUUfwDUwwDfU3"DUfD33"3""""3"�""""DDDU33""""""""""""""""""""""""""""""3"""333UUUDDU3DUUDDDDDUU""""""""3""3"3"""""D3""""3""""""""""""""33""33"DD3""""""""""""""3wˆ3""33Uª»f�"""33"""""""3fÝÝÌÌÌÌÝÝ̪ªªˆwUDUD3"33D3DUD3Dˆª»Ì»™™™™ª»»ªDUD3D3UUˆ™wwfffª™ªˆˆwˆUUfUDDD3DUDUD3D3D3"3"Uffwwˆ™™™f3fˆUUU3""3"333D333""""""""""""""""""""""""""3D3"3DDDDUDUUDDDDD33DDf3""""""""""33""3"""3"3"""3""""33""""""""""""""33D3"33""3""""""""""""�"w™U33""3wª™3�""""""3""""DDÝÝ»»ªª»ªˆUUfD3""3DD3"333U3"UD3fwwwwfwwˆˆ™™™ªˆ™ˆw™ˆwwD"""3"3U3333DwUUUUD33333DD"3"""""""3"3UUf™ˆˆwfˆ»ªfU""""""�3DUDUU3"""""""""""""""""""""""""333"33DDDDDUfUDDDDfUDDUf3"3""""3""�""""D"�""""""3""""""3""""D3"""""""3""""3D3""3"""""3"""""3""""�D»ˆD333"Uªª3""""""""33"""""3U™Ýª»»ªªª™wfwD3""333333"3"3UfUwUUfUDD3DDUDD3DDUDDDD3"""""""3"3DDDUUUDDD3"""33""3"""""33""33"DDUUUDUfwwwfUfffU���"3D3Uw3"3""""""""""""""""�""3"3"33DD3D3DDUUUDDDD333fU"""""""3""""3U3"�""""""333"""""""333"""""""3U""33D3"33""""""""3"""D3D3"f»U333"Dˆ»U"""""""33""3""33f»ªªªª™™ˆˆw3""333""3D3"3DUDUUUUUD""3333D3"""""3""""""""""3333DUfU3D3"""""33""""""33"""""""3DD33333DUDDUUwwf33""3DDDDD"�""""""""33"""""""""""""""3333DD33DDDUUDUDD"33Uw""""""""DD�"""3"3"33""""33""""""""3333"""""""3""333"""3"""""D3""3fª»3""""f™w""""3""""3333U™»ˆ™wwfUDD"""3""3""33""""D3D3DDD3""""""""""""""""""""""33""Uf33""""""""""""""3""""""""3333333"3DUDDDfwf���"""DDDDD""""�"""�""33333"""""""""333"333"33DUUUUDDD333DD""""""""""33"�""""D""""""D"""""3D"""33DUD333D3"333"33"""""""""""Dª»U3"3"3™w""""""""""""""333w݈ˆw""3"D3""333""D33""""3DD33"""""""""3"""""""33"D3""""""""""""""""""""""D""""33"3"33DDDDD3UD""3UDffUf3""3""333"33""""""3""""""""33333DDU3DDUD3DD""""""""""3D"""D""33"33333"""""""3DD33"""""""3"3D""33""""""""3"fªf3"3""w™3""""""""33""3""333ªˆDf3"""3D33DU333DD""""D33"""3""""""3"333"""""3""""""""""""D""""�3D"33UDD3Uˆ"�"3333DUf3"""""�""""""""33"333""""""""""""""""""33"33UD3DUDD333""""""��"""""3"3�"""""""333333"""""""""3D3""3"""33"""""""33"""33"3"33ˆ™D"3"U™w""3""""""""""""""""""3ffˆ3DD3"""3D333""3"3""""""""""�"""3""""""3""""""""""""""""""""33"3""3""3333Dw™""D""33"3UU33""�"""""""""33333""""""""""""""""""33""""3D3DDDD333DD""""""""D3��"""""""""3D3"""3""""""""3""""""""""3D"""""3"""""3""3"f»™3"""ˆˆD""""""""""33"""""3™ªˆUU3"3"33""D3"3""""""D"""""""""""33""""""""""""""""""""""""33"3fˆf3""""""""DffD3""""""""""D333"""""""""""""""""""33""33DDUD3D333"D3"�"3"""""Dw�""""""3D""""D""33"""""""""3"3"333DUD3""33""3"""""3w»f""f™U""""""""3""3"""3""3ª»ªf3""""""""3"""3"""""""""""""333""""""3""""""""""3"""""""33"3DUˆf3"��3U""""""""DwˆD""""""�"�""""3DD333"""""""33"3"3"""""""""333333DUfUDDD3"333""�3""3DD"""""3"3"""""33"""""""""""""33D33DD3""""""""""""3fª™3"wˆU33D3""""""""""3DªÝ™f3""""""3""""""""""""""""UfU33"""""""""""""""3�""""3"3DffwDUUD3�ˆw""""""""3DwˆD"""""3"�""3UUD3D"3""""""3""""""""""33333DUUffUDDf3"DD3"""��"3"""""DD3�""""33""33""33""""""""""3"""DD33""""""""""""w»w3fˆf3""3D3"""""""D™Ì»3"""""""3""""""33""3"DfUUD3""""""""""""�""3""DDUUfUffwwUˆ™w""""""""33UwD"33"""""�"3DD3fUD3U""""3"""3"""""333333DDDDDUfwfU33D"DUD"""�"�"33"""33DDD""""""3333"""3"""""""""""""""333DD3"""""3""33"UªªD"U™f3"""""""""""""3"""ˆ»»w"""""""""""""3UUU"""�""UDUUUUUD3"""""""""3"3""�""""3DUD33DUˆ™ª™™ˆUD""""""3DwUDD"""""""""""D3DUD33D3""""3""3"""""""""""3333DDDDDUUUUwfD3DD3UD"""""""""""""3DDDD""""""""3""""""""""""""""333333"""""3"""333™ªf�3w™w3"""""""""""""""""3U™ªw3""""3"""""3DD""�""wˆfUUDDUD3"""""""�""3D3DDDUwwˆ™ª™ˆUDUUD3"D33f"3""""""""""""3DUUDUD333"3""""3"""3D"""""""3"333DDUUDUDUUfwU3DU"UD"""""3333""""33"""""""""33"""""""""""""33333"""""""""""""3wªw"f»ˆ3"""""D3Dwªˆ3""""""""3333"�""""""wwUUDD3DD3"""""""3"""�"""""333DDUfffwˆˆfDUfUDUwfUD3""D3"""""""""""DDUD3D333333"""D""""""""""""3""3DDDDDUDfUDUUwf33UD3U3"3D33"33""�""""""33"3"""""""3"3"3"""""""""33Dwªf"3ˆ»f"""""""""Dˆªˆ"""33�"""""UD3"3"""""UwDUU3DDD3"""""""""""""""33"3"""""""""33DDUUUDUD3333DDDUUfˆU3"""""""33DDD3333"3333""3D"""""""""333333DDDDUUDDUfwwUDDDUDD3""""""3"""""3"""""""""3"3""""""""3""3D"33""""3Dww3�"w»w""3""""""""3™»3"""3"""""3DDD33���"3""3UU3DfD33D33""""""""""""""""""""3DDUDUUDDDDDDDDUUfUDfD3""""�"""UfUD33""3"""33""""3D""""""""""""33333DDDUUUD3Dw™wUUDUD33D""""""""""""""3"""�""33""33""""""""3"33""""""""""""""3DDU™"Uªˆ""3"D""""""""""DªÝU""3"33""""3DD3""�"DUfU33UD33"33"""""""""""3"""""""""33DDDDDDDDDDUUUUfUUwD""""""""""�""""DwfUUfU"D"""3D""""DD""""""33333DDUDUDUDUfUUwfDUD3DU""""""""""""""3"""""3"""3""""33"33""""3""""""3DDfw"U™™3"""""""""""""""""�"wÝÌD""""3""UUD3"""""""3UUU33D3""""3"""""""""3""""""""""3DDDD3DDD33DUDUfUfw3""""""""fwUUD3DfD3DD"33""""DD"""""""33"3"3333DDDDUUfUUUUffwUUD33DD""""""""""""""""""""3"""""""""""""""33""33"""3"33"""33Dw™fª™D""""""""""""""""�"ªÌ»D""""""""""DD3""""""""""3UUUD3DD3"""""""""""3"33DDD3�"��""""""33333DD33DDDDUUfD""""""""fwwfUDD""33"DD33""""DD"""""""33333333333DDDDfUDUUUfffDD333D3""""""""""""""3�"""""3""""3333"333""""D3"""""""""Dwª™ÌªU"""�"""""""""""�"™Ý»D"3"""""""�""3"""��3"3"3ffUfˆUD3DD3D3"3"""33"""""3""3""�""3"333D333DUUUfUf"""""""��""wˆwfUUU33""""3DUDD333"""""""""33"3333333D33DDD33DDUUfffDD""D""""""""""""""""""�"3�"""""""""""33""""""""""3""3"""""""""""D™ÌÌÝw3""""""3"""��3ªîª""""""3""3"""3"3""�""fˆwD3UffUwfU333"33"33D333"""""�""33333D33"DUUUUDD"""""""""""wˆffDUDD3""""""""3DD3"""""""""""""""""""333DD3DD"U3333DUUUfD3"3"""""""""""""""�""D"""""""3D33"""""""""""3""3333UªÝÝ™D"""""""""""""""�D™Ìݪ"""""33"""""""�""wˆˆwwˆwwfUffD333"""3333D3""""""�""3"33D333DDfUDwDD""""""""�"3wwfUUDD33""""""""3"""""3"""""""""""3"3333333DDDD"3"33DDUwwU3333""""""""""3""""""""""""�"3"""""""3D333""""""3"""""3333wÝÝ»f""""""""""""""""�"wªÌ̪3""33""3""f™wwˆˆˆwffUDDD3""3"3"3DDD3""""""�""������"3333D333DUfDwˆU"""""3wffUUDD33333""""""3""""3"""""""""3""""333333DDDDDDD3D"33DDfww"33D"""""""""3"""""""""�""""""333""""""""""""""""""""""33wÌ»™U""""3""""""""""""""""ªÌ»»™3"""33""D3"""�3w™ˆˆˆˆˆˆwfUD"3"""""33DUfDD"""""""""������""33333DDDfDUˆDD3"""""""ˆwfUDDDD33""""3"3"""""""""33"""""33"3"333DDDD33D3U3333DUDUDUDf"""""3"""""""""""""""�""""""3""""""""""""""""""""""33""333™ÌwD"""""33""""""""""3"�fÌ»ˆUU3"33""3DD33""""�"""""Uˆwˆˆ™ˆˆˆfUD33"""""333D3fU3"""""""���������""3333D3DUfwff33"""""""3""""�DˆfwUDD33"333""""""""""""""""33DD33D333""3333D3DD33333"33UDUUUDfD"""""""3""""""3U"""""""""""333""""""""""""""""""3""3"D3U»»3""""""3""""""""""""""Dw™™fUfU"33UD3DD""""""""Uwwˆ»ªª™ffUD3""33""333UU3"""""������""""3333D3Dwwwf3""""""3""""""""""""�3UfˆwfDD33""33""""""""""""""""""""""3"3DD3D3""333333D33"33"33DUUUUUUf"""""""3U"""3""""33"""""""""""""""333""""""""""""""3""""""3DU̪3""""33""""""""""""""""""""Dˆ»™wˆfwD33"DDD3""""""""3www™»ªˆfUUU3""""""3""3333DD""""""""�������""3333DDDUUw™f"""33""33"""""3D"�3ˆ™wfUfD3DD333""""""3"""""""""""""""333333333333333333"3"333DDDDUwDfD""""""""""""D""3"""333""""""""33333"""""""""""""333"""""""Uª»ˆ""3""33""""""""""""""""""""3f™ÝªUDU3"""33DfD"""""""""""Dˆ™ª™ˆwfUD3""""""""""3"333"""""""3"""�������������""DD3DDDUDUf™™U""3D3""""""""3"""Uwfffˆª™ˆfDUfUD3D3""""33"""3""""""""""""""3D333DD333333333D3333DDDDDUfwˆf"""""""""""""""""3""�""3D"""""""""""3""""""""""""""33"""""33D™ÌÌD""""""""""""""""""""""""""UÌÌݪ3D""""3DUD"""""""""""3Dˆ™™ˆwUUD3333""3"""""33D"""3""""3""3""""�������"""D33DUDDUDUfU3"""""D3""""""""""3Dwwwwˆ™™™wˆˆwfUU3D333""""33""""""""""""""""""333DDD3333333333DUDD333DDDUfw™ªf"""""""""""D3""""3D33"33"""""3"""""""""""""3"""""""""3fÌÝ»3"""33""3""3""""""""33""""""""fÌÌ™™ª3"""3333"�"""""�"3"ˆˆˆwffUDD333333D3""3DD3D3""""""3"""""���"�""""333DUUUDfwˆ""""""3""3""""33""3Ufwwˆ™ªˆ™™ˆwwwffDD3"3"33333""""""""""""""""33""3333333DDD3DDDU3""3DDfUUfw™ˆwD3"""""""""333"""""""3"3""""""""""""""""""""""""""DfwÝ݈"3"""""333"""""3"""33"3"""3"3w»Ý»™ˆ™D"D"""D"""""�""wˆwˆwfUDDDDD33DDDDDDUUDDD"""""""""""3""""�"""3DDDDUUffˆw3"""33"""""""""3UwDfˆ™™™™™™ˆwfUUUD33333333""""""""""""""""""333"""D33"33333DDDU""""DDUUfwˆwfwwwU"""""""3DD3"3""3"""���"D3""3""3""""""""""""3""""""""3ˆÌ»ªªw3"33"33""""3"""33"3"""""""3DDDˆÌw™wD3D""""3D3""""""�"""3ˆ™wfwˆfUUfDD333DDDDDD3DUD""""""""""""D3""�""�333DDUUUUˆˆw3"""33D3"""""""3ffffˆˆˆ™ˆˆˆwwffUDDD33333D3"""""""""""""3"""""33""""333333"3U33""""3D3DffffwwwwwU"""""""""UU3""""""""�D33""3"""""""3"""""""""""""D™Ý̪ˆU""33"3333""3D""D""3"3DDU33UfUDUwf™ÌÌ»ˆfDf™fDDU"""333"�""""""�""""""""UˆˆˆwffˆˆwwUDDDUUDDD33D3DD333"""D""3D3"""�"��"33D3UU3Uw™ˆf""""33DUD"""""Dfˆ™UwˆwwwwwwffUUUUDDD333"""""""""""""""""""""""""3"3""33"333""""3"333DUfffffUffU""""""""DD33"""""""���""""""""""""""3"33""""33U™Ìîˆ333"""""33"3"""""3"333"f™wDUffffˆˆ™ÌÌ»»ªˆUff™wfDD""""3D3""""""""""3"3""UwˆwwwUffwwUDUUUUUU3DDDUDD33333333U3""U3"���"3DUDfUfDfˆU3""""33DUU"""Uwˆ™wˆ™ˆwwfwffwffUUDDDDD33D3"""""""""""""""""""""""3""""333"3""""3"""33UUUUUwf3Uwf3""""""""3333"3""""��"33"""""""""33"""33""DffªÝîîf""""""""3333"""""33333fwˆfUUDUUUUfˆªªˆ™ªªˆˆ»ˆˆwU3"""""3"3"""""""""UwˆwwˆD""3fwfffUfUDDDDUUUD33333"""D3"3""""""""���"""3UDUfD3UD""""33DDD""Dfˆˆˆwˆˆ™ˆˆwfffUUUUDDD3DD3333""""""""""3"""""3"""""""""""""""""""33"""""33"333DDUUfDDDDDUD""""""3333""""3333""""���"""3"3"""D33""3UU3DUwff»îÝÝw""333""333333""""""""wwwUfUD333UUww»wª»»ÌÌÌ™ˆwfU"3"""""""""""UwwUUD""3fwfwfUffUUDDDD3D3""D3""33"""3""��""3DUUDfw3333""""""33"Dwwwwˆ™™ˆwwwfUDDDDDD3D33f3333333""""""""""3"""""333333D3"""""33D3""""""""3DDUfUDDD3DfD"""D3"3"333""33333D3"""���"�DU"33333333"""3DUUªÝîîÝ»f"""3D33333333333"3""3DfwˆwfD333333DUw»»ÌÌÌîÌ™wˆfD3"""33"""""""""3fwD3""33"UwffffwwfUfUD33DD"3DDDD""""""3"""������"3333D33w"""3""""DwˆwwˆwˆˆfwUUDDDDD33"3DfD333D33"""""""""""""""3"333"33333D33"3""""""""""33DDUUDDU3D3fUD""3333""""""33"3"33"""""fD3""3"3"""""3ÌÝÝÝÝÝ»ˆ3""DD3"3"33"3""""DfUw™ffUD"3333333D™ÌÌÌÌÝÌ™ˆˆf3""3"�"""""""""""""�"UwUD3"3UffffffwfUUUD33DU33"UD3""3"""D"""""""�"�""3333DD33D"3"""D"Dwˆˆª™™ª™wwwwfUDDDDD33"3DDDDUDD333""""""""""""""3"3"""33"""""""""""""""""33DDDDUUUDDD33UfU""3U""""33"3333""""""����"""UU33""""""Dff»ÿÝÝÌÌ™w™wDDw33""""3"w"3UfwwˆwDUUUD"3333"3"Dˆ»ÌÌÝÝÌ™»™3"""""""""""""""�"""UffUD"3UffffUffUUffU3DDUDDDUD3"""333""""""""""333DUf"""""3f™ªªªªªª™wfUwUDDDDDD3"D33"333D3333"""""""""333""""""""""3""""""""333""""""33333UUDUUDDD33DDD""33"3""D3"""""""""���������"""""Uf""""3fUfwª»ÝÌîÿÿÝÌÌ»UUUwUDf33Ufˆw"fwˆwfUUD3UDUU3"D333333U»»ÌÝÌ̪™ˆD"""""""""""3"""""""3U3fUD"3UUUffUUUUfUDDDUUDD333D""""""33"""""""�""""""""3333DU"""3""""fˆ™™™ˆˆˆ™™™wfUUUDDDDD33333333333333""""""""3""D""""""""""""""""""""""3"""""333DUUUDUDDDDD33DU3""D333333"""""""""�����""""""fªˆwDwˆª»»»ÝîîîîÿÝ™w™ªˆˆUUUffwˆfˆwˆwwUfUUDUD3""DDDD3D3"""33Dw»ÌÌ̪»ˆw3""""""""""3""3DDUUDDD3UfDUD"UUUUUUfD333DD""""3"""3"""""""""�"""""""3DDUˆ333""DwwˆwUfwwwf™ˆUUUfDDDD3""333"""33"3"""""""""""""""""""""""""""""""""""333"""33"DUUDDDUUDD3DDD3DfU"UU"""""""""""""���""""""""""��Dw™»»ÌîÝîÌÝÌÌÝîÿ»wffUffwf3UfUUfˆ™fffUUUDD333"""33DD3D33""333ˆ»Ì»»™ªwU"�""""""3"""""""""��"UDD"UUDfD3"33""UfUUUD3"3D3D"""""33""""""""""""""""""""3"""""D3DUUf3"""DwwfDUD3DfffwUUUUUD333""333""""3""""""""""""""""""""""""""""""333""""D33"""3333DUDUDD3UUUDDDU333D3"33"""""""�""""""""3"�www̻ݙÌÌÝ»îîîݪffUUDDfw"fffDDUfU3DUDD3D3""""""3"DD3DD""""3fª»»ªˆªf3"�""D3"""DD""""""""""UfD"3Ufff"3"��"UfUUD""3D33"""333"""""""""""""""""""""3""""""33DUf3"3""DfwfUD33UffUDDDUUUD333""33"""""""""""3""""""""""""""""""""""333""33D3""""""3DDDDDDDUUUfUUUUD"D"3""""""""""""""""""""""""3"�Dwf™™»Ì»ÝÝîÝݪ™wfUDDD33UfwˆUDDDfD333DD3"""""""""3U333D3""""3™»»™ˆˆf"�"""DD""DU"""""�""�"�DfUDDDDfw33""Ufwwf""DU""""""33333""""""33"""33"3""�""""""""""""""DUfD""""3""""3Uˆwfffw™™wUDDDDUUD33"""3"3""""""""""""""""""""""""""""33"""3"3333"333""""""3333DUDUDDUUUUUUfD3UD"""3"""""3""3""��""3"""""""""DU™ªÝîÌÝîÝîÌ™ffˆfD3333DD3DfwˆfUDUD3333""""""3""DU"3D3""""D™ª™ˆˆw""3U33D""""""���3fUUfD3DUwwD�"DUwwwU"3DD"""3"D33333"""333333333""""""3"""""3""""UwU3"3"D"3"333Dfˆw™™ªª™ˆwUUUDDD333""33""""""""""3"""""""""""""""""33"33""3"""3D333"""""""3"33DDUUUUUDUUffwwUwU"""""D""3UD""D""""DfUUwª»»ÿݪˆUD33D3"""""3DUUD™ˆfUUU3DD"""""""""DDw333""3U™wfU™U�33DDDU3""""""�"��"3fUf3UD33Dwf"UD3DUU33U3"""D3D3DD333"""33D333333"3""""""""""""3"""""""3UwDDD333""Dfwwˆªª»ª™fUDD33333"33"""""""""""""""""""3"""333""""""33""33333D"3"""""""""3333DDDUUUUUUffwˆˆ™D""""""333DD��"""""""""DD3"w»ÝÝÌ»fD3""""""""""3DDDˆfwffDDD33"""""�"DwwwwwwD"DUDD333wwwfwU"�""3DfU3"""""��""�3DffDDD3""3Uw"""333""3333UD33DDUDDff3"333"""3DUD33333""""""""""""D"""""33"3""DUffˆD333"fwwˆwˆª»ÌˆD33333333"33""""""""""3""""""DU3"33DD3"""3333""3""3DD3""""33"""""333DDUffUUUUfUf™™ˆ"""""""33""�"""33D""D»ÝÝÌ™3"""33"fwUUUUD333""""3"3fwffUUUDDwwUDDUwˆffffwfD���"3�"3DD333"""""""��"3wUwUDD"""Dw3�""3"3"""DDDD3Uwwf3333D33""DDD3"33"3"""""""""""""3"""3""""3""""33fwwD"""""ffffwªª™wD"333333"3""""""""""""""33"33"3D3""""DD33333333D3D""""""""""""D33DUUUUUfUfwˆˆf™U"""""""""�������""33""U»Ý»ˆU"�"""DD3DDUUDDDDDDDDDDDDDUD33DD3D3""33DwUD3ˆw���"""3D3"""""3"""""�"""UwwfUD3""DD"3333DUwwffU"""33333D3"33""""""""3""""""""""""33"33"""3UD333"""""Dwfff™™fD"333333"""""""""""""""""33D333"3333"""""33333"3""""""""33333DDDUUUUfffwfUwf"""""""�������"""""fªÌ™f""""D3"33UwU33"""""33D33""3"""""""3DUw33fªD"��"""3"""""3""""""""""�"""UwwU3"""D"�"33DUffffwDUD3"33333""D33""""""""3""""""""33"33""3""Uw333333""wfDD3ffD33"3""3"""""""""""""""""333333D3"33""""""333"""""""333"3DDDDDDUUUUffffDw™U"D"""""""""������3UU»ÌªUD"������"D""D333""3"""""""""""""""3Dwˆf»w"�""""""""""""""33D3"""""ffU3"""""���""""3D"DD3""""3DUDD"3D333""D"""""""""""""3"""""3333333"""33fD33D"""""""UfDDDfUD"""""""""""3"""""""3U3333333""33333"33""""""""33""3DD3DD3DDUDDUfwˆfˆ33""""""""""""����"UwªÝÌ™wD""3"""����������33DD"""""""""""""33Dw™»w3���"""""""""""3333""3"""DfD"""""�"""""""""3D3D33D33"""33""""""3""""""33""""33333"33"3Uwf"""""D"ffDDDwD""""""""""""""""3D""""""3"3"333333333333333"""""""3"3"3DDDD3DDDUDD3UwwU™D"""""""""�������"""ˆª»™™™ˆˆf33""""������""DDD""""""""""DUUU™w�����""""""""""""""""""""33DfD""""""33""3"DUU3D33"333"""""""""3""""""33""""333"3D333DUˆU""UDˆwfDUf3"""""3""3"�"""""333333D3DD333333333"""""333333DD3D3333DDDDDUffUw""""""""33"��"wÌ»ˆwˆwfff3"""""���"333"""""""""33DU™f����"""""""""""""""3U33""""""�"""3""3UfDUD3""333"3"""""3""""333"""""333DU3"DD3Df3"""Uˆ™wfUff3""""""33D3�"""""""""3DUDD33"333"D3""333333UDDD33333DDDDDUUf™"""33"""3"����""DˆÌªˆwffwUD"""""""3"���""""""�""""""3""""33f™"�����""""""""""""""""""DUD"""""33""""""Uff333DDU33""""""""3"""""333"""""3D3D33DD3DfU33"DUwwwwffw3"""""""3D"3"��""""""""""""""DUDD"33"3"33"33""3DDD3333333DDUfffUfw™""3"3""""����D™»»™»ªwwwUfDDU3"""""""�""�"""""""""""D"DD™D�������"""""3""""3"""""""3UD3"""""""3U""""""""UˆUD33DUU33"""""""""""33""3333D333DDDUUfDDD"3™ˆˆwfU"fD"""""3"3""""""���""""""""""""""""3UD333"3"33"333"3UUD333333DD33UªwUfwˆf"""33"""3"���"U™ªwfˆwUUwUD"3DD3""""""""""""""""3""""""""3"""""3Uw3����""""3""""""""3UUD3"""""""""U"""""""3"UUUDDDDUD3"""3"3""""""""""3"""33333D33D33DDUDD3"3""wfUUUDD3w""""""""33"3"""""3�����""""""""33""""""3DDD333"33333333UUDD33D333D33DwUffww™"""""3D""""""""��"DªªfDDD3Dff3""33"333""""""""""""""""3D33"33""""""DwD�����"""""""3D"""""""""3UD""""3"3""""""""33"3"3UD3""D333""""33""""""""""""333"""333333DUDDDUUDUfD"UwfUUUDDD3f""""""""""333"""3U3��"""""""""""""3DD333""3"33333DUDDDD3D333D333UDfwˆ™D33""3""""3w»w33D3DwU3"3""""""3""""""""""""""""""""3"D33"""3""""UD����""""""UUf3"""""3f3"33""""3""�"""""""3"""3�"U3""3ffD3""""""3"3"""""3D"3""""33333DUDwˆfUUˆ33ˆˆffUUUDDDDDD""3"""""33""3""""DU""""""""""3""""""""""3D3"333"3D3333DUUDD3D333"3333DDUwˆˆw"""33"""""""3Dw»™"""3DUfD""3""""""""""""3"""""3""3""3""33DD3"DD""D""3D3��""Df3""""""""D""""3""""""""3"""3"Dw™™wD33""""3"""3""""DD""""""""D3D33DwwˆwˆDfˆfUUfUUDUDD3DU"""3"333"""3"3D""3""DD3"""3""""""""""""""""3"3D333"DD33D3DDUUUD333D33D33"UDUff™U3""""3"""""""Dªª3""DUUU3"33""333""""""""""""3""""3""""3"3"3333DD333D3""""����"""""""""""""3"33""""D3"""""""""3"""3w™ªˆª™™w3""3""""""3""""33""""3"""DD3DDUDD™ªª™™U3DUUDUUDD33ff""""333""""3"3""333fff""��"""""""""""""""""""33"UDD3333DDDD3DUUUUD3DDD3""""UUUUˆf3D"""""""""ˆªU"""3fUDDD333""3U3"""3"""""""""""""D33"""""33"33333D33"3""""33���"""""""""""""�""3""""3"U3""""""""""""""""""3DDf3"3""33Uw™™™ˆwˆ™ˆˆU3"""33D"""33"""3"""""""3DDDDDDfUD™ªˆUDUUUDfUDD"3ˆ™U3"""3D"""3"""""3333D33""""�""""""""""""""""D""D33333DDDUfwfUUffDUD3""3"3DwUwf""""""""""""""3DUªª3"""DfDUUD3"""""""""""""""""""""""""""""3DDD33"""""""""3""33"""""""D"��""""""""""���"""""""3U""""""""""""""3333fˆwffUfˆ™ˆfDDUUfffwˆD33""""3333""""333""3"3333DDD3Dfff3fˆUUUfwwfU3Ufªª™fD3D3U3""3"""3"3D33"""3""""�""""3""""""""3333DDUDfˆ™ˆfUUfwfUD""""DDUfUw""""""3""""""33"D™»ˆ3"DUfUDDD3"3""""""""""""""""""""""3""""33DDUDDUUD333"3""""""33""""33�"""""""3"""""33""""3"""��"""""""""""3DUUˆª»ª»»ªˆf3""3UD33DUD"3333""33"3"""3333"""33333D"DUUffUwfffwwfDDUˆ™™wwwf3DDDD"""""3"3333"""33""�""""""""""""""3"33UUDfˆˆwfUDUwwfUD3""3DUffww""""""""DU3f»ˆD33wfUD""""""D3"3""""""""""""""""""333333"""33DUUUU3DDUDDD3"3"3""""""3"3"��""""""""""3333""DD""3"3U"""""""""""33DDUwˆ»»ª™UD""""""D3""33"3"33""333"3""3333333333333DDDUUf3"U™ˆˆwwwffwwwwfffwwUDDUU""""3"""33"3333""""��""""""""""""""DDDDfˆˆfUUUDwwwwfUD3"3DDUwˆf3""�"""""3"D3""D™ªUDDUwU33"3""""3"3"""""""""""""""3"""""3DDDD3DDDDD"33""3""333D3""3"""""3�""""3""""33""DUUUD333DD""""3U33"""""3DDDDDDUUDww™ªˆD3""""""D""3""3333"""33333""""3333""""""3DDDUU""™ªˆ™fUUfwfUffDUwwwwff"""3333"""3D3""3"""""""""""""3UD3"UˆwUfUUfˆwˆwffUDDDDDf™ªˆ"""�""3""3""""3fªªf3DfUUD3"""""""3"""""""""""""""""""3""3333""""""""333"""33""""""33""""""3"""3""3DfUD3"""3DDD3"""UUDD"""33DfwwˆwfUfUUfUD3""""""3D"3"""333DD333333""""33D3333"""""33DU""f™ˆwfffffDUU3DUUw™™ˆD333333""""3D333"""""�"""""""""""333fU3"DwfˆˆˆwfffwfUUDDUUˆª™U"""��""""UU"DU™ª™fDUˆfD3D""""3"""""""""""""""""3"3""""""""333""""""""""3""""3""""3""""""""""""3D3"3""333D3""3D""""3DU3UfwfUfUD3D3""""""3D3"3"33DD33333D"""""3DDD3""3""""3DU33"3™™w™ˆfUUDD3DDUUw™™™w33""""""333DD""""3"""""3"""""3""""3fwU""33wˆwffffffUffUUfwˆˆ3"""""""D™ªÌ»ªªˆfUDfˆDDD3"33""""""33"""""3""""""""""""""""3"""""""""333"""""""3""""""""3""""3"3�""""""3""""""""3"""D33"3D3""""""""�""33DD33UDD3"""33""""""D333"DDDD33DDD""""33DDDD33""""DDUD33"DˆfffUDDDD3DDUfffwˆˆf3U"""""333333"""3""""""""""D""3ffD"3"3"UˆfwwwfUffUwUDwwfww""�""�3f™™ˆwfffUUfwfU3333"""3"""""3""""""""3""""""""""33"""33D33"""""""""""3""""""3"""""""""""33DD�"3""3D"""""""3""""""""""33�3DD3""""""""""""33"33"33"""3DDDDDUDUDDUUD33"3DUDUUDD3"3UUU33UDfDUfUD33333DDfffff™™DU""""3"3D3D"""""3""""3""3333"3D""""Uwf3"""3""fwfwwwfUUUffUfwfw™3"""�D"""�"™»ˆwwfwˆˆˆwwfD333"3"""""""""""""""""3"3"""""""""3""""DDD""""""""""3"""""3"3"""""""""""""3DD3""""3""""�""3""""""3""D33""""""""""333"""""""""DD3"UD33UUUDD3DUf3UfUDD3""""3UD3"ˆˆffUUfUD333DDUffwwww™ˆˆwD3""""333D""3"""3""Uf3Dff""""3"""""3""""DwˆD""""3D3D3UwwfUwffffwfwffU™D"""""3"UªªwU3DfwfUDDDD3""3"""""""""""""""""""""3""""33""33D33""""""""3""""""""3DD""""""""33DDD""""""""""""""""""3""""33"3D"""3"33D"""""�"""D3"�UUffDDD3"DwfffUD"""""3DD3"ªˆwfffUUUUD3DUDUUwfwwˆˆffU""3""""3"""33"3"""""DwwfUf"""""""""""""3wf3"3""""""D"UD""wwfDwwwwˆwwwffˆˆ"""3"""f™ªfD333DDUDD3333""33""""""""3"""""""""""""3"""3D333""333""3""""""33"D3"""""""""3DDDUwD""3333Df"3""""""""""""""""3""""""""333"3"""""""""�"""UDUUDU3"UfUffUD""3""DˆfˆªªwfUUUUUUUDUUUfwfwwˆˆwˆffU33"""""33""3"""""3Dff33U""""""""""3UUU3""""""3"D333""3UwwwˆwˆwffffUUˆD3"""""3ˆªwD3"""333D3333""333"3"""""""""""""""""""3"""""""""3"""3"""3""""""""""33"33"3""""3DDfwwffD3DUUffˆˆDU3""""""""""""3fU"""""""3"""""""""""3"""���"�""3DDD3DU""wˆˆˆwwU333"3U™™fˆ™ªwfUUUffD3DDUDUfwwwffwwUwˆˆwU3"""""""3"33"DUUU333"""""3"33Uf333""""3"33"""DUUwˆwwffwffUUD3"33"""""""ˆ»ˆDD3"""""33333333""D3"""""""""""""""""""""""""""""""""""""""""33""D""D3""""DDDwˆUfwfwDUfDw™™UU3D""""""""""""""""33ff3"""""""�"""DUD3"""""""33"��������""DUUfffUfUDfffUDDfwˆˆwˆˆˆwfUˆˆˆ™wUwfDUUUDDDDUUfffffwUUwwwUUUU3"333"""""3fwDU3"""""3D"""""3Uˆ3"3""3"33""3""ffˆwˆwffffDwD"""""""""ˆUD3""""""333"""3"""3333"""33D3""""""""""""""""""""""""""""""""33"""D"""3""""3DDUwˆUUUUUUDDUw™™wwUUw3"""""""""""""""""33U3""""3""""DfˆU3"""""3""333���������3"3fUfUfUD3"""""""""3DDUUffUfwfDwwwffwwUUUUUUfUUfffUUfˆˆwUUffww3""""""""3U33"""D3Uwf"""33DUw3"""""""3333""3333UDˆwˆfffUffw"33"""""""3ˆDU"""""""3"333""33""""33"3D"""""""�"D"""""""""""""3"""""""""3"33""3""""""""3DDDUˆ333DDDDUUfwwfwˆwfww3""""""""""""""""333DD"""3"""""""""3wU""""33"3"""���3"DfUD3333"3"""""""""3DDDDDUUfUUU33UffDUfwffUfUUffwwUfˆwwfUUfwˆwˆˆˆˆˆD3"33D"33fwffwfUUDUD3ff"""""3"3"33333"3"3D3DDwˆwfffwfˆD3"""33D""wÌ™U""""""333"3"""""""3""3""""""""DU3""""""""""""""""""33333""3""""""3D3DDU"""""3DDUUffwfw™ˆfwˆ3"""""""3""33"""3"33"""3DD"""""""""""3""""""D3"3D3""��������"""U3""""3"""""""""333DUfUUUUD3"3f33D33wwffwUfD"Ufffwfwwfwˆ™ˆˆ™ˆ™™ˆwfUw™f"3wˆ™™wUDfˆfD3333DD""""3D""""""3"""3""3333"33DUwwwˆwwww"33333D"3ˆÌ»fD"""""3"333"""""""D�"D"""3""3""D"3""""""""""""""""""""""33333""33"""333DDDDf3""""33DDUUUUfUfˆˆˆw™3""""""3DDD""""""3333D3"""""""""""""""""""""33U"""�������"""3"""DD3""""""""""""3DDUffDD33""3""3333fˆwˆfD""Ufwwwfwˆˆˆwˆ™ˆˆwffDDfˆª™ª»ªˆfU3DDwfDfUUwf"""3D"D33"""33"""3""""33333D3D™ˆˆ™wˆU"33""3ˆÌ»ˆDUU""""""33"33"""""""33D"""""""""""3"""""""""3"""""""""""""""""""""D3""3""""33DDDDDU3""""3333DDUUfffwffˆ»™f3"""3"DDUD"""""""33"3"""""""""""""""""""""33""3""�������""3"3D3"""33"""""""3Uwˆˆf3"3""""""33333D™w""""33wfˆˆˆfwˆˆ™ˆwwffDfwˆˆw™™ffDUUUfffwUDfwD"3""3DD3""3D3D3"""""""33"333333wˆ™ˆˆU3D3D33ˆÌ»w33fD3""""""33""""""""3D"""3""""""""""""3"3""""""33"""""""""3D""33"""""3D3DDDD3D3"""""3"33DDDUfwˆwˆˆ™Ìˆ3""33D3DD3""""""3"""""""""""""""""""""""""33""""""�����""3"""""UU"""33""""""""""3ˆˆˆw3""""""333"33Dwf"""""wˆ™™wˆˆˆ™™ˆDDUUww™wwwDDD3DDUwˆfffDffD""3DUUDUUUDDf3"""3"""3"""D3333f»™»ˆ33DfDfªÌª33Df3"333""""""3"""333f"""""3333"3""""""""3"3""""""3"""33333""""""""D3"""""""33DDDDDUUD3D3D"""""""3DUfwwˆˆˆªªˆ"33333""3D""""""""""""""""""""""""""3"3""""������"""""UwD""33""""""""3U3"DwU""""""33""DfUw""""3fwfUUDDDUf3DDwˆˆwfU""DD3"DUUfDUDDUfUUDDfwUUDDDDDDD"3""33"3""33""3"D33™ª»ˆU3"DwÌ»ffUD3""U33UDD33D3""3333"""""3333"DD""""3D"�3"3""""""""3""DD3333""""""""D3"""""""""DDDUDDD"3""33"""3U3"33DDDUwwww™ˆˆ3"""""3U3""""3"33"""""""""""3"""""3"""""������""""3fUDDD"""""33""""""""""UU""3Uf3"33333"3333ˆD""""""""""3U"UU"3""UDwUwˆU"D3""3D333DDD3UDUwwU"DUDfUDD333"D3333DDDDD3333"3"D"33Uˆªˆ33ˆ»»fUD333DD"""""""""DDUD""""""3""""""""3""3"""3"""3"""""""""3DD33"333"3D""""""3UDUUDU""3"""3""""DD"""333DDfwˆwˆ™ww""""33"""3fw3D3""""""""""""3"""""""""""���""3Uf3"3DUD33D3""33""DUf""3fD3""333""33UwD"""""""""333D"3""Uf3"fD"33"DDUD33"33D3UUU3"333"3DDDD33"D33333"3DD33333""""3D3Dwª»»Ì»wUUD3"3Uf3"""""""""""""3"""""33"""""""""33"""""""""""""3DDD"""33"""D""""""33DUDUD3""3""""""3""""""33DDUwwwˆ™wwU""33""3DDUU3"3""""""""""""""""""""""�"3"""3wfU3""33333"""""3""""3333"UD3"333"""3DˆUD""3"""3333333333"""33D33"333""""333Uf3""333""3D3333"D3"33"3333"333""3"33333ˆ™ªÝ݈D33333""33""""""""D"""""U3""""""""""""""""""""""""3333"33"""3""""""3"DUfDfD"""3"""""3""""""""DDUfffwˆfffw3D333D333D3"""""""3"""""""33"""""""""�3"�""��UfUD3""33"""""""3""""""""""""""U3333333""Dˆˆ3"""""3"""33D"""3"DUD""""3"""""33DD""""""""3333D3"3D"DDDDD3"33""333"3D33""f»ÌÝ™wD3D33"""""""""""""""""""""""3""""""""""""""333DDD333"""33"�""3333UUfUU""D3"""""""""""""333DDUUUˆˆwwˆ™fD33""333UU"3""""""3"""333"""""""3""""3333"""""""�""ffD3""33"""""""""""""""""""""""3f"3""""""3D™D""""""""3D""3UfD3DU3""3""""33UD""""""""33""""DD333DDU3"3"""333"333"3"D»Ì»ˆwUDD3""""33""""""""33"""""""""3""""""""""""3"""""��""333D"D3"D"""D"""33DDUffU3""33""""33"3"3"3""""33DDUUUwwfUww333DDfwf3DD3UfU""""33""""""""""3DD""U""""3"""""""�DfUD3333""""""""""""""33""""""UD""""""33ff"3""""""3"""33"3UDDDUD33"DD3D3"""""33DU3"""""3"3""""D3DD33DD3"""3333""3"3"3"U»ªfUDDDD333"""""""""""""""""""""""""""""""""""""""""���"""333D333""""""3"""33DDDfˆD3""""""""D3""33"""3""""3DDDUffwwUU"""""3D333DwwwfDUD3""33""""D33D3"33""""33"""""""ffUDD3"""""""""""3D""""""w"""""""""Dw"""""3""3""DD3D33DD3"""""""333333""""""3DDD"""""3""""""UD333D3D"3333"""""3""DDw»ˆ3DD3DDDDD""""3"""""""""""""""""""""""""""""""""""""""�""3"3"33"""""3""""33DUU™D"""33"""3"3""3"""33"3333DUUUwwff3"""3D"""""""""""""�"3"""D3"3"3""""""""""ffD333""""33""33""""DU""""""""Df�"""3UDDUD"""3D"D3"3"""""""""3""3DD"""""33U"""""""""""3DDD333D33"""""""33""33™ªU33DDD3UfUU""""""""""3"""""""""""""""""""""""""""""�"""3"""""""3""""""3DDUwD"""""""333"""33D33""D"3333DUUfDUDD"""""""""""""""""""���"""""""""""""""""UfU333""""""3"3DD3"""""ˆD""""3Uf33333D"3UUD3""3DD""""""""""""33"D""3U3"""""""""""DD3333333"""33""33""U™ˆD3"DDDDDDUDD3""""3""""""""""""""3"""""3"""""""3"""""3DD""""�"3DUw3"""""""""3""333D33333"3"33DUUUwfUD3""""""""""""""""���"""""33"""""""""""3wfUD33"""""""""3D333"""ˆU"""3DUUDfDDDD""UUfwˆwUUD"""""""""""3""D333UD""""""""DD333DD3"""""""""3""U™ªf"3""33DDUD3"33"""""3"""""""""""3"""""""D""3D3""""""�"""""""3"3UfwD"3""""3Uwˆ3""""""DUD"""3"""""3333"33D333DDDUU"""""""""""������""3"""""""3""""""""""""""""""fˆUD333""�""""""""3"3""""""�wf3"""3DDD3D33D33"""U3DfD3""""""""""""""""3""""3DD"""""""""U333D33""""3""""33D™ªw3"3DDD"33DD""D3""""""3""""""""333""""""3"3""""3"""�""""3D""3""""3333"DUfU"""""3DDUDD""""""DUD"""3"333""3"333DD3D33DUDDffUD""""""����"""33""""3""""""""""""""""""""DwffU33""�"""""33""""DD3"3"""ªˆUDD333"""""""3D3"3D3D3""""""""""""D3"3UD""""""DUUD3""3"""""""""Uw™™fU"""33"33DDD33""""""""""""""""""""333"""""3D3""""""""""""""33"""3""3""""""3DDDD""""Dw™D"""3DD3"""""""33""""33"3"33DDD3ffD3"""""�3""""""3"3"""33"""""3""""""3UwD"3"33""""�3UUD3UfwwD333"Uª™UD3"""""D""333UD"""3"""3""""""""""3DUDDU3"""""DDUD3"""""""33"""3f™™f3"""""""3"DD3D333"""""""""""D3""""""""""3""""333""""""""""""�""333""3333""""""""""""""3"3D™ªf""333"""""""""""""""""""""""3DDDD3DD3"""�""""""""""3DDDU3333""""33""""33Dff33""33"""""""""""DUwUfwf3DUUD33UwwUD3""33""33333DU33""""3D"""""""""""""33UfU""""""""DD3fU"""33""""DfwˆwU3"""""""""3DDD3DD"3"""33""""DD""""""""""""""""3"3""""""""""""""3333"""""333""""""""33DDf™ªªD"3D""333"""""""""""""""""""""3D3DD"D3"�"""""""""""D3UUD3"""33333""""33fwD333"3""""""""""""""3DUˆ™fUD33333DDDUD33""""""""333333"3""�"DD""""""""""""""33DUD""""""33"DDUU"""""D""UˆˆwU3"""""""""""3DD33""D3""3"3""""33"""""""33"""""3""""""""""""""3"""""33""""3"3Dw™ªªf""D33"33"""""""""""3"""""""""3"DD3D3"""""""""3""""""333"3""""3333""""333Dww33333333"""""""""""""3DDfwD"UU"""""33""""""""""33333333""33""""333"""""33DDD3"33""3UDDDD""3"DwˆˆDD3"""""""""3DD33D""3U3"D3"33""""""""""""""""""""""""3"""""""�"""""""""33Dffª»wD33"3"3"""""""""""""""33"UDDD3"�"""""""33"333""Df"""""""333"""""33Uˆw33333"33"""""""""""""""333DDUDDD""""""""""3"33"""3D"33"3""""""""""""""""""""""333DDD""33UUD""33"3UwwU333"""""""33DD33D33UU3""""D3""""""""""""33""""""""""""33"�""""""""�"Uwf™»ªw""""""""33"""""""""3333DD"�""""""""33333""Df3"""333DD3"""333UˆˆUD33"3333""""""""""""3""""""3333DUD""""""333"""3333333""""""33""""""""""""33333DD""DD333DDUwˆfU"""""""""""""""DD3DDD33DD3""""3"""""""""""""""""""""""""3"""3""""""���"f™™»ª™3"3"D3"""""""""""""3UDD"3""""""""""3"3"""""""""""""""""D""3DDD3D3"33Dˆ™ˆU33"333DD3"""""""""""""3"""""""3D3DUDD""�"""""""""3"3"33"3"""""333"""""""""""33""33DU3333"33"Uww33""""""""""3D333DD"33"3"""3"3"""""""""""""""""""""""""""""�"""""""3"DU™ªªˆ""33""""""""""""33D"3D"33""""""""""""""D"""3"""""""""3333D3333UUDfª™f33D33333"33""""""""""""""3"""""33DDDw3�"""3"""""""33""""33D3D"3"""""""""33""""""333UDDD33"3U™f3D3"""""""DD3333D3""D3"""""""""""""""""""""""""3"""UD333""""""3DUw™ªªˆD""""""""""""""UDDDD"3""""3""""333D""3""3""""""""""�"D33D3""3Df™wUDDDD3333333"""""""3""""""3"""""""""33DUUD"�"""""D3"3333""3D3"3D""""""""""3""""""""""""""3DDUf3"Dˆw3"""3D"""""3D333333""333"3"""""3""""""""""""""""3""3"""D3UDDD"""""""""33wªÌ»ªD"DD""""""""""3DDD"""""""33"""""3333""""3D33""""""3""3Uw3UDDD33333333""""""""33"""""""""""""""33DwU33""""D""3"3""""33DU""""""""""""""""""""""""""""""33DDUD""fˆD3"""""D"""3333333""""33"""""""""""""""""""""D"3UUDD33"""""""""""�"3f™ˆ™™D"3D"""""""3DD3""3""""""333""""""3"""333U3"""""""""3fwDD""333D3"33"""""""""""""""3""""""33DwU"3"�"3"DD""""3""3"3""3D3D"�""""""""""3""""""""""3DDf33ww3""""""3D"""3333333"""""3"""""""""""""�""""3��"33333333"""""""""""""3UUf"�"3U"""""""""33DUD3U33"""""""""333"""""DUUD3"""""3""��"3fU""3"333DD3""""""""3""""3""""""""DfD"3�3"33""""33"3"3"3"33DU"""""""3D33""""""""""3"33DUDUfD""3"""3"33""""""3333""""""3"""""""""""""""3U"�3D"""3""3"""""""""3DU3�333Uf"�"""""""""""""3333D3DD33""""""""333""""DUD333""""""""3""""""3fD""""UD"3D"""""""33""3""3"""""3"""Uf��D"�""3D333"33DD"""333"3333"""""""""""""D""""""""""""D"3DDwf3333"""""3333""3""3"3"D3"""3"""""""""""""""""3����""D"""""33""""""""333D3�"33DDfD"""""""""""""""""3""33333"D"""33"3""wUUD3D3"""""3""""""Dwf""""3D3333""""""33"33""""""""""3""ff�UU""""""""D"""3UD3333""3""3"""�"""""""3"""""""""""""""""""33Dˆf333""""""3""33"3""""""33""""""""""""""3"""�""""��"""""""""""""3333"��""3333DfwD���""""""""""""D3"D33UUU33DDUwfD3DD""""""""""""""""""""DwU"""""""33"3333"""33"33"""""""""""3Df��"3"3D"""""3U""333333"""333""""�"3"""""3""""""""""""""3"3f™D""""""""""""UD"3"""""3"""""""""""""""""""3""""33""""""""""""""D"D"�""3333DDUUwU""UfD"3""""""""""3""""""3DDUDDfUf3""DDD3""""""3"""3"""""""""""3"3UˆU33D"33U333"""""DD"""""""""""DUD�""""""""3""DD"""3""33"""D33"3""��"3D""""""""""""""3""3UˆˆD""""""""""""""D3"33""""33"""""""""""3"""""""""33"""""""""""3"""""3D�""""333DUUUDUwwwfwˆwwfUUwˆUDUD3""""33"""3"DUDUU3UDD"DUfwfDD"""""""""""""""""333"3wˆUD3"""""D3333"3333DU"3""""3DDU""""""""""3"""DD333""""3"33"""""333""3""""""""""""UfwUD"333""""""""333""DD"""""3""3""""""3"3"""""""""""""33"���""""""�"3D"��"3"""""333DDD33DDUU33"33333DUfwf3UwU"�3fU""""333D3DUUUUD333DUfwwU""""""""""3"""3D3"DfˆfU33"""3DU3""33DDD333""""""33DD"�""""""33DDDU3"""""""3""""""""�"33""""""""""""Dwf3UD"3D3"""""33"3"D3"""""3""""""""""""""""""""""""33"""""""��""""""D3""3D3�""""""""""33"3""333""""""""DDˆˆ™ˆˆfDUwª™™ˆ""""33DDDD"DUD"33333"DDDUwf3""""""""""3"33DD"UDˆfUDD3"""DD3"3DD3D"D"3"""3"DU�""""""""""33DD""""""33"33""""���333""""""""""""""3DDDffD33U3333""""""""33""UDD3""3""33"""""3""3"""""3"""""""""3"""""""""��""3"""""33�"""3�"""""""""""""""""DUDfUUwˆwDwwwˆUDDUfffwˆˆU3""3333UD"""""33DUUf3""Uwf"""""""""33""DD3ffU™fD3"33"""�"UDD3DU3U33D33""DU""33"""3""33"D33""3"""""3"""""""3""""""""""3D"""""3D""""3UfwfD3""U333""""""""""3UD3"""""3D3""""""333"""""""""""""""""""""""3"33""""""�"3""33333"��"""3"""""""""""33Dff3333"DffUDDfUDfˆUD3DUUfU3D3fU""3DDU3UU""Uff3"33"""""D3"UfUUwUˆ™UD333""""333DU33UD33D"""3U��"""""""3""3333333""""""""33""""""""""""""3D""33"3D33""3DfUDDUD3""DDDD3"""""3"3D3""""33DD33"""3"3DD3"""""""3"""""""3""""DU3""�""""""3"�"3D"""333D"��"""""3""""""""""""DDUw3"33"""ffUU33D333U3"""3DUw™»ªˆD""3DD3"U3Dw3D33fD"333"3fˆw™ˆˆUUDˆˆU33""""""�DUUDD3"""""3"""""3""DD3333"""3""333"33"3"""""""""3D"""""3DD3"33DDDUfUD3U33"DUDUDD""""""""3D33333"DDD3""""3"DDDD3""""""""3333"""""3"33"3U3""""33""""""""3""3D""3"3"3D3""""""""""3U3"""""""3""DDUf""3D33""fUU3"333"333Uw™ˆ™™ˆU"""33DDDfD333UDDDfwU33D3D3ffwˆˆ™ˆˆwffˆU""""""""3fUD"33"""D3""""""D3DDDD"""3""3333""U33""""""""""3U"3"33DD3"3""33DUUD3"D33DDU"DU33"""""3D3333333DD33"3"33DUUD3"333"3"""3D"""3"""D"3""""""""""""""""""""�""""DD"""3""3DD"""""""""""""UD"3"""""""D3""""DUUU333UU"3fD333333"D"3Dfww™wwwwU"3"3DDDUffUU3UUffDUDUf3UffDDUUUfUUDDDUf3"3""""3fU3333""""D"�"""""33DUUU3""""""""""U33"3""""""""""D3"33DD3""3""33DDDD"""33D3UD3DfDDD"""""UD"33333D33D3DD""3DDUD3333D"D3""33""3D3""""3""3"""""""""�"""""3D"3"""33D33"""""""333""3DUDUfDDUfDDDDD3""""33""""""3f"""3"DwUf""3UfD33UD333333"D""3DUfˆffffwwˆwU"33DDUUff™™™wU333UUffDDUDDDUDD333333DDD3DD"""""�"DfDD33"""""D3�"""3""3DUD3D3""""""""3D"3""""""""3"3333DD3"""""33DDD3D3""""""3DDU"DDD3""3UU333333"33Df3D33UDDD33""33"3D"3"""""3D3""""""""""""""""""3D"3""""33D33"""""3"""33333"33Dwwwˆˆ™f3UD33"D"D3333333D3DDUDDwU"""3UfUD"""3"""""DDD333333D3"3DwˆfUfwwffffˆwD33D3"UˆUUU""3333333333DDDDD33""3"3"333""D3"""3DDD3"3DD333""""3D3""""""3333"3"""""�33""""""""""""333DD3"""""3333333"""""""""333DDDD"""3DU3"3D333"3DUUUD3UUDD33""""3DDD"3""""""3""""""3""""�""""""3"DD"3"""33"DD3""""""""""""""33DD"3""3fwwff33D3��"""33""33DDDDDDDDUUUDfD�"""""""UDD33DDDD"�""3U™fDUUUfffUUffwfD33ffUD"""""333333"3333D33"""""""""3""3""""DUDD""DD33""""3DU"""""""""""""""""""""""3"""333""""""""""""3"""DD3"""""3DD"3"33333D3D33fD"33DDUDUUDUDDD"""3"3333"""""""""""""""""""""�3""""""""3U"""""33""DD3"""""""""33D33"""3Uˆwf"""""""33"333""""3UDfffUD"3D"fUUDw™fDU3""DU™D3DD33333333Uf™™fU3"""""33333""""""33"""""""D3"""33U"""3D3""""3Df""""""""""""""""""""�""3"""""""""333""3"""""""333333U33"3""""D"UU"D3333UUDDDD33U"D33DUDUUfDDDD3""3333D"""3""""""""""""""""""""3"""3U""3""""3"33""""3""""33Uf""""""Uw""""33333"""""""3"3"�"DD3wwwwˆUUD33"""""Dwf"3"""""""3DUD33"""""""""""""""""""U3""33UD""3"3""""3Df""""""""""""�"""3""33"""3D3"""""""""33333""""""""""DDDD3DD"3"D""""3DffffˆˆUDUwwwDDDDD"33D3UUfDDDDD""3333333"""3"""""""""3"""""""""3"""""3"""""""""3"""""3"""3UˆD""""Uf333"""""""""""""3""��"Dw™wUUˆDD3"""""""""3Dw"""""""33"""""""""""""""""""""""""""""""DDD"3""3"""DU3""""""""""""�"""""""""""""""""""33""""3333333"3""""""""""D333DD3333""3"""DDDDDUwU3UwˆffwDUU"3DD3DfUUUDD33""""""333"3"33""""""""3""""""""""""""33""""3"""""""""""""3Ufw3"""3D"3D3""""��""3DUwwwˆˆwUD33333""""""3Uf"""""""""33333"""""""""�"""""""3""3D333"""3""3333DUfw""""3""""""""""""""""""""""""""""""333"33""33""""""""33333"DDD3""""""33DDUDDUfwfˆwwUDDfD3DDDDUffUUD3"""""""333D3"""3"""""""""""""""""""""""""""""33D""""""""""3fff""""""33"�""�""""3fUDD3333333""3333DDUf"""""""""3333"""""""D"3""3"333""33"3DUDUUD3"3f™D"""""""""""3""""""""""""""3"""""33"""""33333"""""333""3333DDD3"333""""33DDDD3wwwDDD3DDDD3DDDDUUffU""3""""3"""3"""3""""""33"""""""""33DD"""""""33"33"""""""3DDfUw""""3"""�3�3"����"D3DDDDwˆˆˆf3"""""""3"3"""""""""D""""""""33"""""3DDUf3"333Uˆf"""333"""""""""3"""""""3"""""""3""""""""33"""""33"""""D333D333D33"""3333D3DwˆfD3D333DDUUDDDfUUDD""""""33"""""""""""""""""""""""""""""""33D3""""""""D""33"""D33DD3Uf"""3""""""�3"����33"3""f™™™ˆ3""""""3""3""""""��"3"""3"3"333D3DUD""DfDDDUfwUD"3"""""""""3"""""""""3"""""�"3"""""""""33"33""""""""""DD333DU3333"""333"33UˆwU333"3D3DDDUUUfffUD""""""""3"""""""33""""""""""""""""""""3"""""""""DD33"3"""""�"�"3D3DD"3Uf"""3��"""""""""""�""""3Uˆª™ˆD3""""""""""""""""U3""""""""D3DfwˆwUUDDDUUfˆUD3U3""3"""""""""""""""""""""""""""""""""""D"""""""""3333UfDDUDD3333""3"""""3fwfD333"3333D3DfˆfUfUD""3""""3""""""""333"""""""""33""""""""""""""""""""""""""""""3���""UDD33"DUD""�""3"""33"""""""�""333f™™™wD""""�""""""""�D""""DU33333DfUfwUD33""""""3"33U3""""""""""3""""""""""""""""UU33""""""""""3""""""DDDDUD33"333D3""3"""""DwˆU3"3333"33333DwˆfUU"""""""""""3"""333"""3"""""""""""""3""3""""""""""33""�3��""D33""3DUfDDD�""333"""""33""""""�""""33w™™ª™U"3""""�"3ˆw3""""""D3"DDDUwffD""""""""3DU3"3"3"3"""""""""""""""""""3"""3wU"""""""333"3"""3"3U3333333333333"""""""UwwD3""333333333DfwˆU3""3""""""""""""333"""D3"""""""""""""""""""""""""""""""""""�""����""3U33"33DwfDfU�"""3"""""""D"""""��""""3U™ˆwf""""�""3""UUwˆ™ªªªª™f3""""�3U3DUDUD33D""""""33U3""""""""""�"""""""""""""""D3""33"333""""""""33333""333""""3""""""3wˆf3"""3"3333333Dˆˆwf""""""""""""""""""3"""3"""""3"""""""""""""""""""�"""3"""������"3D3333DDUwwfˆ3���"""3""""""""""""""��""33DwU""""�"Dw™ª™™™ª»ªªªª™ˆw™™ˆD""""��"DDDUUDDfDDD3"""3D3"""3DU3""""""""""�"""""""""""""""3"""33"""3"3""D33"333""""""3"""""DfwU"333"33D333DDUwˆˆf3""""""""""""33""""""""""""""""""""""""""3""""3""33""��"""3D""33UfUfwˆ3""""""""""""3""""����""333"UD"""�3w™™ˆˆˆwwwwwwwwffffw™™D"""DwwwffUUU3""3""""3""""3f3""""""""���""""3"""""3"""""""""""""""""DDUDUD3333"333"""""""""""""Dwf""3333DDU"3DD3UwwwfU"""""3"""""""""""""3"""""""""""""""""""""""3""""33"""3"""�""3D"3D33Ufˆwf3D�"333""""""""""��������""��"""33333D"��f™wffffUUUDfUfwwfffff™w"3DfDDD3"33333""3"""""""""""DU3"""""3"""""�������""""""""""3"""""""""""""""""3ffDD3"3"33333""""""""""""3Dww3333DUDDUD333DUwˆwfUD"3""""33"3"3""33""""""""""""""""""""""""""""33""""DU3�"""""3D33333DUffffwD�""""3""D3"""""��������""3333"3U"""33DwfUDDUUUDDDDUUUfffffwˆªfUff3""""""3"""""""""""""""3DD"""3"""33"����������"""""3""33""""""""""""""""""UU333"3""333UU"""""""""UwfD3333"DUUfU33DDUwwUDDUU""""""33""3D"""""33""""""""""""33"""""""""DUUf33""""""""3DDDD3"3DUfwf"�"""""33""""""�������"�""3D3""3wD�"wˆˆˆˆD333D3DDD333DDDffffww™ˆDD3""""""33"""""""�""DU3""3""33�����""""""""""33""""""""""""""""""DD3"333333"3fwU"""""""""3fww"3"""3"3UfU"33DwwwfDDDUU"""""""""3"3""""""""333""""""""33"""""3"3"""""""""DD3"""3""""""DDDD"3"DDDwf�"""""""""��""3D"3wDw"333D""wwwwwU333333333"33DDDUfffUfwD"""""""""""""""�"33D"""""""""����""""33"3333"""""""""""""""""""3D"333333"3ffU"""""""""DwˆfD""33"33"DU3"3DwwwwDDDDUU""""""""""3"3"""""""3""""""""""3""3"""33""""""""�"""""""�"""3DDUD""3DDww""""""3"""3""""""��""""""3UUUffUUwˆwfffUUD"3"""3333333333DUUUUUffffD"""33""""""�"""U""""""����""""333"33D""""""""""""""33""""333""3UUD"""""""""3wˆU"""333"3U"DU3D3UwwwU33UDD3DD3"""""""""""""""3"3"""""33""""""""""""""""""3""""�"33"""DUfDD33DDUˆ""�""3""""""""""�"""""""�DU33Ufw™™™wUDDDD333"""3""""33333DDDDUUUDUDDU333D3DUU3"""""�"fU"""""""��""33333"""3333"3""""""""""""""33"""3"33"3DD3""""3""333ˆˆU"3333D333UUD3D3UwwUD"DDDD"DDDU"""""""""""333""""""""33"33"3""""""3"""""""�""33""""3UfUDDDDDDD3"""""""3"""""��""""UU"3fUDˆfUfU333""33"3"""""""""""33DDDDDD3DDUUU3""3"D33DDD3"""""""""�"DwD"""""""""""f""""""33DU"""""""""""""3"""""""3"3D3""""""""333ˆw3"333"3""3DUD3UfwwwU33DDDDDDDUU"""""""""3""33""""""""333"""""""""3"""""""""""33"33""""��"3UDDDDD3DUD"""""""""33"3""������3wU""DDfwUUUU3"""""""""""""""""3"3DDD33333DD33DUUD"3D""""DUD"3fˆˆwUU"��DD"fwU3""""""��"""""""3U""3"33UD""""""""""3"""""""""""33D33"""""""3333ˆw3"""3333""333DfwwwUU3"33DUDDDDfUD"3""""""""""""""""""""""""""""""""""""""""""3""""33DD3"�"3D3D33D3f""""""""�3""""""""���3"""ffU3"UwDUUUD33"""""""""""""""DD333""33333"3D33DUDD3"3DU3UUfffwUUUU3"wUDwf3UD""""�""D""3"""""3D3"DD""""""""33""""""""""""333"""""""33333ˆU3"""3333"""DDwwˆwUD""33DDDDDDUUUUwD3""""""""""""33"""""""""3"""""3DD3""""""D3""""""3"3"3""""3333333f""""33""""UD""""""3"""����"D"�DwwUDUfD""""""3""""""""""""333""""""3"""3"3"33""DD33333wDDUffˆUˆwˆˆf3UD"""���""""""""""3"""33""""""""""""""""""""3""33333"""""3"33fˆU33"""3"33""3wwwwfD3""3333D33DUUUfD3""3D3""3"""""""""""""""""33""3D"""""""""""""""""""""33"3""��"""""""3Uf3""3"3""""""33"""""""3U3""����"DU3"33""""DUU"fˆˆwwfUD3"""""""""3""""3"3"""""""""""3""""�33"""""3UDUUffw™™ªwUU"33""""��"3""""""""3""3"""""""""""""""""""3"3333"""""""3Dww333"3""333""DfwˆˆU3"""3333D3"DUUDDfD333DDD33"""""""""""""""""""3"""3"""33"""3"3""33""""""""""""33""""UU"33""""�""""""3D3"""""""�����DUD333"""3UDUfUwˆ™wwUUD33""""""""""""""""""""""""""""""""""""""33DDUUˆ™™™wDD"""���""""""""""""33""""3""""""""""33D33"""3"""33fwU"3""33333333wˆˆˆwUD"""""3333333DDU3U3D3DDD3D33"""""""""""""33"3333"""33""D3"3""3""""33"""33""33��"33D3"""3fDU3"DD"""�""""D"DfD3""""""����"3"""""DffUUDfˆˆfUUDD3"""""""""""""""""""""""""""""""""""33Uwwwwˆf3D""3���""""""""""3""33UDD3"""""""""3""""""3333""""""""3DfˆD"3""3"3333"3ˆwˆwU""""""33"333"333DUUU3D3DDDDU3"""""""""""""3333DD3""33333""""""3"""""""""3""�"333D""DUfUD""3D""�"3UUDwD""3"""""���"""""33DDUUD33UUfUDDDD3"""""""D3"""""""""""""""""�""""""DUfDffffUD""��""""""""""""3DUfUD3"""""""""""D3"""""3333"""""""""UwU""3""""3333DUˆˆwf3"""""""DDD333333DDUDDD333UDfD3"""33"""""""33""3""33333"""""333"""3""""""�""33"""DwfD""33"""3""""3UUDU"""3"""""""�3"�"3wUUDDD33"DUDDDDDD""""""U3"""""""3"""""""""""3"""��"""""33DUffUwˆU""�""""""""""3ffUfDD""3"""""""""33"""""3333"""""""""DD3""3"""3"33"UˆˆˆwU3""""""3D333333DDDDUD""33DUDDD3""""""""""""""""""""""""3"33"""""""""""""""""""""33D3"""""3ffD33"""33"3"""""DfU3"""3""""""��"3wˆfUfwwUDDDD3"""DUDDDD33"""""""3"""3""333""""""""33""��""""D3UUUUwfˆ""��"""""""""""""3DDUUf3"3"3D3""""""""""3"""""333D""3""""DD""""""""3""33f™™wˆf3"""""""DUDDD""33D33D33333DUD33D"""""""33"""""""33""""""""""33"""33""""""""""""""""DDD3""""3D3D"3333333""""3""D3D"""""""3""��U™ª™ˆffwDD3333""3DD333333""""""""""""""3""3D33""""""""""""33ff333UU"���"""""3D33333333333"3DDD3"""""""""""""""3"""""""3D3""""""""""""3f™™™wfU"""3"""33DDDD3"3333DD33"3DD333UD33""""""3"""""""3"""""""""""33"3"""""""""""""""33DD33""3Df""D333333""""""""Uf3"D3""D"3""""�"w™ˆffD3DD333"3""D3DDD333333"""""""""""""""3333333"""""333"""""�3""""U3""3f""""���"3"""3U3"""3"3"3"33""3UU3"""""""""""""""""""""""""fD""""""""""3Uˆ™™™wfDDD3D33"33"DDDDD33333D33333D3"33UD3D3""""3"""""""""""""""333"""3""""""""""�3DUD3D3"3UU3""D33"3"3"""""""""""DUDD3UUUUUU33333"""""3wˆˆwUDDD3"3333"3"""3D3DD"33""""""""""""3"""33"33""""""3""""""""3�"33""ff"�����"3DDDD3"""""""""3DU""33DD3""""""""""""""""""""3f3""""""""33wˆ™™ˆfU"""333DD"3"3DDD333""3DD3DDD33D33DUDUD"""""""""""""""""""""3"33DD3"""""""""""""��""3UUU33DDDDD""""""""""""""""fUUfUUUDUUDD3DD3DDDD33D33DfU33DDDDD33333333"3"333D33D3""""""""""""""33""3""3"""""""3""""""""�""3""DD"""��"""""33""""""""""33""3"DD3""""""""""""""""""DD3""""""""""Uˆˆˆwf"3"33D3D3D33""3333"""333DDUU3D33333DUDDDDD""""""""""""""""""""""3"3DD3"""""""""�"33DwwD"33DfDD""""""""""""""ff3DDDDDD3333D33DD3UUUDDDDDD333DD3333333D33"33333DD3333"""�"""""3""""""333"333""""3""""""""""3DD"""""�""3""""""""""""3"""""""""""""""""""""""f3"""""""""""""33w™ˆfU33333D333333"3333333"3333UUfD3D333333D333Df""""3D"""""""""""33333""""""""""""33"3ˆf3""3"DD"3""""3"""3UfUUffUUUD3333333D3"3"DUUUDDDDD333DUDUDUD"333333"3"333DD3"3"""""33"""""""333"""""333""""""""����""""""333D"""�"""""""""3""3""""""D3""""""""""w3"""333""""fˆˆfDf3D333"333D33"3""333333"33UUUDDDDDD"3""""""DDD"""""""""""""333"""3"""""""""""33333fU3""3UUD3""""""""DDD""DUffˆˆfDDDDDDD33"33333333DDUUDDD3333D3DUUffUD3"""33"3333D333"3""""�"3"""""""333"""3333"""""�"��"""""""3DD3D"""��""""""""""""""""3D""""""""3U3"""""""""""3Dw™wDDDD"33D3333D3D333""3""33"3DUUDUDDD33""""3UU3""""""""""""""""33"""""""""""33333f"3"3Df"""""3DDUUDUUfUDDDDDDDDD3D3DD333D3DUUUUDDD333DDDUfwfUD3""D33D33333333"3"3""""�""""""""""""D33""33D3""""""""""""""33D3DD"""""""""""""""""3""33"""""""Uf"""""""3f™™UDD3DD"D3333333D333""33"333DUDDDUUU3333""""""33UU33D""""""""""333"""""""""""""""""3333f3"33Dff3"""""3"DU333DDDUDD333333DD33"3D333D3DUUDDDDDDUUUUUUDDUD"333D3DD333UUD3333333""""�"""""""""""""""""""3333"""3""""""3""�""3�""""""33UU3""""�"""""""""""""333"D""D"""""3ww""""""Dˆ™™wDD3D3D33D3333333D""""3"3"33UDDDDUU33DDDD""""""33DDff""""33"D""""""""""""""""""""""""""""3DDUw"33DUU3DDDUDU""DDUfD3333333""3DD3"""33DDD333DD3DDDDUUDDDDDDUUDD333333DDD33333DDDUUU3"333"3""""�33"""D"""""""""""""""333""3""3"""33""3"33"�"""""""""3DUD3""""""""""""""""�"333"""3"3""""Dˆf""""""3wªªˆUDDDD3DDDD3333""3333""""""3DD33DDDDU"3D3DD"""""333DDUf3U3"""""""""""""""""""""""""3DUDwf"""D3UDDwD333UUU33333"""""""""3D3""333DDD333D33DDDDDDDDD33D3DDD33333DDD33"33"DUUfUD""33"3"""""""D3""DwU"""""3"3333""""3333""3""""3""""33"""""""""""33DDU"""""33""""""""""""3333""""""Uf""""""""3DˆªˆˆUUDDDDDDDD"33333"33"3"""3D""DDDDD33DU3""D33"3333"3D3DUUUU"3"""""""""""""""""""�""3DDwˆ3""33DwfU""""3"""""""""""""DD3DD3"""3DDD33DD333333D3333333D33333D"3DDD3"3"3DDUfDD3"3333"""""""""""""""3fU""""""3"""""3"DD3"""D"""""""""""""""""DD33"3"""""""""""""""""DU""3"""""DfD"""""""""""""w™wwfUUD33"33D33"33333333""33UfUUwfUU3"333UD"33"33"3"333D3D3DDUUwwDU""""""""""""""""3DUwU""""3DUw""""""""""33DD"33""""333DDDDD3D3"33DD33333333333DD33DDD333DUDUfUfD"3333""""""""33"""""3"""3""""""3DDD3"33""""""""""""""""DDDDU"3""""""3"""""""""D"""""Dww"""""""""""""f™wfffUD333333D3""3333333""UfffwfUD3""33"33DD3"33UD3D""3UDDDDDDffUww3""""""""""""""""""DDff3"333DU"""""""333"33"33333DDDDDDDDD3D33DUD3""33D3DDDDD33333D"3333UUfˆf3333333D"""""""3""""3""""3D33"""3""3""""""""""""""DDDDD3DD"""""""3"""""""""""""""UUD333""""""""""wªfffUUDDD33333"""3""33"""3UfUDDD3""""3"""""33""333DUf3""DD33UUUD33DUD""""�3""""""""""3"33""3DDD3""""DUU3""""""""""3333333D3333DUD3D3DD3DDDDUU3"3"3DDDDDDDDD3333"""3333DD3UD3333"3D33"""""""""""""""D3"3""3""33D3"�3"""""""3DUDDDDD3"""""3"""""""""�UD3333333""""""""3ˆ™ˆwwfUDDDDDD33D"33"""33D3UfU333333""""""""""3"""3DDUfD3D"333D33333D3ff""""""D3""33D333"""3DD""""33D3""33"""3""3DDUD3"333DD3DfUDDDDDDDDDDDDfU33DU333DD3D33D3D3333333333"3333DDD33""""""""""�"""""""""33D""""333"3D"""��"""""""3DD"33UU3""3""��""""""33""""""�3UU333333333"""""3w™™ˆwffUUUDD3DD3U"3"""333DDUUD333333"""""""""""3"D33DDf3"3"3D333333D3Df�"""""fU3333"""""3UUD"""""UD""""""3"3"333DDDDwˆˆD3DDDDDwˆfDDDDUUUwwfUwfDUUD3333DD33DDUDUU333333D333""33DD"3""D3"""��"""""""33""""""""DD"�""""""""3333"UDU"""33""""33""""""""""""�"ˆfDD33333333333D3f™ªˆwwffUUUUUDD3DDD33""""DDUD333333""""""""""""""33D3DDU3""UwUD3333333D3DfwDD3""""""3D33""""""""33DU3"""""ww"""""""""33""""3DUfUU"3"fwDUUUfwDˆwUUUUfˆ™DDDwwUU3"""33333DD3DDU3D3"333333D33333UD"333UU33D"""""""""""3U3""""""D"���"""""""333UfDD""""""33"""""""""�3ˆªfUDDDUDDDDDDDDU™ªˆUfffffUDUUUDD3Df3""""""Dff3333333"3"3""""""""""""3DDDDDwfUD333333333333"3Dwwwf"""""""""""""""�"33DD""""3ˆw3"3"3"""""D3"""""333"3fUffwfDDˆfUDUUf™™w"Df3"UfD""""3DDD3333D3"33333D33D3DDDDDD"3DDU3"33"""""D3DD3""�""""3DDfDD3""""""""""D33"D""""""""��Uªª™wwwwwwUfUUUUfwªªˆ""fUUUU33DUUUDDUDD3"""3DfU333""3"3""""""""""""""""3UD3""33"3"333333333333DDfffˆD�"""""""""�3DD3333f™™""333"""33"33D3"3""""3fDUU"wˆfDUUff™ˆ™fˆU"3UfD""3fU3D""D33UU333333D333333U3""DDDD3"""""""3D"3""�""""3DD3D3"""3""DD3D"3"""""""""����Uªª™ªªª™wˆfwwfww™ª»ªUUUDUDDDDDDUUUUDD33""3UUD"""""""3"""""""""""""""33D33"33"3"3333333"33D3DDUUUfUfwD�"""""""""""""""�"DU"Df»»wU33333"3D3""33D33"""""""3"fD3UwfUUUfw™™ˆfwf"DfU3"wfD33D3fD33DD3333"3333333DD"33DUD""�""""D"�"""""DDDD33D""""""3fUD""3""""""3"""3D��wªˆfw™ªÌ»ª™™™™ªª»ªª™U33DU3DDD3DDDUUf3D3333DU3""""""""""""""""""""""33D3333333"3333333"33333DDUUfUffUww"""""""""""""""""""�"3DU""™ÌÌ»ˆ33DDD33333D33D3333""""""3UUfUDDDD33"DwwD33"DDD"DUD"33UDDU3"3"""""33333""3333D3""��"3"3""""�"""3D3DU333""���""3"""3DUD""3""""""333"�3ˆ»™"Dfˆª»»»»»»™fUwˆf"D333DD333DDDDDUDDD333DD""3""""""""""""""""""""""3D3"3"""3"""33333""3"333333DDUUUUfUwwDffU3"""""""3"""33"3�""ffDU™wª»wDDDUUDDD3333DD333DD"""�""3DDDD3D3D33333ww""3Df3"3333DD3D""33"""""3DD33333333333""""""""""""3"3"""""""33D"D"""3��"33"""""3D"D3D"""""""""�3ˆª™ªªwDUˆª»»»ªªU"""3f"3UD3DDDDUUUUUUfDUfD333DD33"""""""33"""""""""""33333"333""""33333"""3333333DDUUUfUUUfwfww""""""""""""""3"��"ˆÌˆwfDwªÌˆUUDDDUDDD3DDD3D3D33U3"3DD"""33DDDD3""33fwwwD""""3Uw33333333DD"""3"""""""3D333"3333""""""""""33""""""�""""""""Dw"��"""""DUD333"3D3""""3�D™ªªª™wDUUfˆ™™ˆUDDU"3U"""UUDUUDffwffwwffffU33DDD33""""""""""""""""""""""3333"""""""3""33""""3"3333333DDDUDDUD33Dff"""""""""""3UˆÌÌ»ˆDDwªªwUwUffDDUUUUDUDDDDD3D""""""""""333""3"3fˆˆU3"""""UwD333333DDD3"3D3"""""3D"333D3""""""""""""DD33""""""""""""�3""3D33DUUw3"""""33""3""""""U»»»ªw3Df3DDUD3"33"D3D3"UUDDUDUfffwˆwwwffD3DD333""""""""""""""""""""""33"""""""3""33333""3"3"333333333DDDD3333DDfU"""""""3""""""3"fªªªÌ™DD3UUfwffwwˆfDDDUDDUfwwfwUUD"""3""""3""33""""3DU™w3333"""DUfD33""333D3333""""333333""""""""""""""""""""DD3D3"""""""""""""""""""3DDDDDUw3�""""""""""""""""""�"f»»ªw3Dww"D333""""D33DDUUU"DUUffwˆwwwffUUUD"33"""""""""""""""""""""D33"""""""33"333D""3""""33"3333"33333333333UwD"""""""""""DD"D»»™™»f3D3""""Dfˆf3UD3U3�D3D""""""""""""""""""33DUˆªfD33"""333D3DUD33333""""""3""3D3"""""""""""""""""""""""3DUU3D333"""""""""""""""""3""�"""33DUUUww"�""�""""""""""3""""D™™ªª™D��Dfww3"3"""3"""""3DD""DD""DD33fˆwwwfUfUUDD3"""""""""""""""""""3D33"""""""""""""3"""""""""""""""""""""""3DDDfwf""""""""""""""DD3"fª™wˆˆˆD3"333"""""D33DfDffD"""""""3""""""""333UDDDUf33D33"3"DfUfD333"3""""""""3333""""""""""""""""3333"D333333"""""""DDUU3333333"""""""""""""""""""33Dfff""""""""""33"""""""ˆ»Ì™ˆw3�""3UU"""""""""3U33"""""DwwwwfffffDD3"""""""""""""""""""3D3"""""""""""""""3"""""""""""""""""""""""33333Uwf3""""""""""3DD3UwˆffwfDD"3"333""3""333"""�"""""""33""""333D3D33DD"D33UfUˆ™fDD33"33"""""""""33""""""""""""""""""D333""3"3333"""""""3UffD"""3D3"""""""""""3"""""�3""""33Dff3""D333"333""""""""""""""U»Ì»33��"33D"""3D3""""33D""""""""3""DwwwwwfUwwDD3""""""""""""""""""""3D33"""""""""""3"""3""""""""""""""""3333DDˆD""""""3DDUUUfwUfffD333333""333333333""3"""""""""""""""DD3"""33"33D33DDw3D""""3"33333""""""""""""333"33"3""3"""""""""33"3""""3DUwf"""""3333""""""""""""""""33"""""3DfU33""""3UD33DD3"""""""""""""3ˆ»»ˆ""3"""U3"""333DD3"""""33"""3fUwwfwwwwUD33"""""""""""""""""""DD333""""""""""""3"333""""""""""""""""""333ˆ™D"""""""""3DUUUwwUUUfffU33333D3333D333""3"""""""D""""""""""""""""DU""""3"""""DDUf"""""3333DD3333"""""333"3"3DUUUDDD33""""""""333""""""3Ufff""""""3"333333"""""""""""""3""""""""3fD"""""""3"3DDDD3D3"3""""""""Uª»U3""""""3333UU3"""""33"3UUUDwfwwwwfDD33""""""""""""""""3DD3D"3""""""""33"""3"3"""""""""""""""""""""3D™ˆ""""""3333DUwwfUUff3UD33333D33D3D3""""""�""""3333""""""""""""""33"""""DUUw3D3"33DD3DD333""33""3""3"UwU33""""3D"""""""""333"3"33DffU""""33"3333333333"""""""""�"""""""DU"333""""""""3333DDUDUU3""33"""""3™ˆf"�"""""""3"333Df3"3"33"3UfDD333DfwwffD3"""""""""3"""""""3DDD3333"""""""3"33333""""3""""""""""""3UU™ˆ"""3""3DDDffUUffUD"333D33D333333"""""""""""33D3""""""""""""""""""""33DUUD3333333333333"333333""33Uˆw3""""""33"""""""""333DDffU"""""33"333"333333""""""33""3"""33D""3D3""333"""33""3UUD"""""""U»™""""""""���"""33DDDwU"33333UUDDD33DD"DwwDD3"""""""""3"3"""3DDDD3"3"""""""""""3UD""33""""""""""3DUU™ˆ"""3"""33DUfUUUUUUUU33DDD3D3333"""""""3"33""""""""""""""33""33UfD3DDDDDD333DDDD3D333D33UUffD"""""3DD"""""""3333DUfU33"33"""""33333333"""""""33"""""""333"""33""3"""""""""3Uw3""Dˆ™™Df3""""3""�����"""3DUDff33333UUD3DD3DUD"3DfU33""""""""3""""""DUU333""""""""""""""""DD3"""""3"""""""""""DDUffU"""3333DUfUUUUDDDDD3DD3DD333"""�""""""""""""""""""""3333333DDUUDUD33333DU333"UfDDDDD3D3"""""3"""""DD33DDw™D"D333"33"33333333"""333""333""""�""3D3""""33"""""""3"Dw3U™™D�UU3"33D"�����"""3DUDDfD33DDfU33DDDfU3"33UD3""""""""3"""3""""DDD""3""""""""""""3"""33D"""""""""""""3"333DffU"�"""""333DUfUUDDD3DDDDDUD33"3"""""""""""""""""""""""33""33333wwUDD333"33""""33333"3D333""""""""""""""3D33DUwU""Df33333"""333333333"""""33"3"""""""3DUD""""33""""""333UD"Uˆ™wDU""""""33""��"""3DUfDfU33DUfD333DDf3""3"DU"""""3333333"""""3UD3"""3""""""""""3"""3D"""""""""""""""""""3"3DDUDffD3""3DDDUUfUUU3"DDD3DDUD3333""""""""""""""""""""""""""33333"3Dˆ»wUDD333""""""""""""33"DDD3""""""""3""""333UwU3""3UfD333"3""333333333333"3"33""""""�""DU3""""""""""33DD3"""wªªw"3D"""""3D33"""""3DUffwD3DfUDDDDDfww"""""DU3"""333""33"3"""3D33""""""""""""33""""3"""""""""""""""DD333DDDUfww�"""""33UffUffUUU"DD333D3DDD3""""""33"DD""""""""""""""""3"33333D33DwUDDDD33""3"""""3""333DD33""""""""""3"""""""""DwD"""3D33"""3"33D""333"33333"""D3"3""""�""3U3""""""�"""33"U3"""fªª33D"""3"UD3"""3DDUˆˆ™ˆwfUUUUffUfˆU"""3UfU33"""33"33"""""D3""""""""""""""3333"""""""""""""""3""3333DD333DUfDfw"D""""3DUUUUUUU333DD"3DUDD3""""""33"""""""""""""""""D333"""""DDUUU3"""""""""""333D3"""""""""3"""""33"3U"""""3ffD33D3D3DD3333"3333333"3333""""""""""D""3""3"""""3333""""""""fˆw3""UD""""3UU3"""""""3DUwˆwwˆªˆˆwwwfUfwf"""3wwDD3"""33"""3"""""D3""""""""""""""33"3""""""""""""3D3""33DDDD33UUfUff"""""3""""3D33DDUfUD333"3UUUD3"33333"""""""3"""""""""""""""""""""""3D33"""""""""3D""""3""""""3D3D3"""""33""""""""33D""""""33ˆfD3333DD33333"3D"33D3333""""""""3""""""3""3"""""""""3wwD""""""3f3DUD3"""""""33DDUfwwfffˆª™wUUUUwwD""""3fwfDD""3333333""""3U3""""""""""""DDD333""""""""""3333333DDDDDDDDUUˆw""""""""DD3DUUD33"3D3DUUD333D3""""""""""""3""""""""""""""""""""""""""""""33DD""""""""""33""""""""""""3DDDD3"""""""3""""""""""""""3333""33"DD3UUfUD33333"333D3D33D"""""""D3D3""""""""""""""""""UªU"""""fD""UUD33""""33DUUfwUUfwUUˆªfUDDDDww3"""""fwfDD333333333""3"DU333"""""""""""DD33"�""""3"""""""""33"3D3DD3D3DDDfˆD3""3"D33DUUD3333"DUUDD3"33"""""""""""""""33"""""""3"""""3"""""""""33DDD33"3""""""""""""""""""""""33DD333""""""""""333""""""""33""33D3""33DDDDD33333"333"3333"""""33DfU3"""""""""""""""""U™»D"""""""DU33UUD3333""33DDfwˆfDDfwwˆwD3DfDDfU"33"""DwwUDD333333333""3DD33""""""""""""33""3""""""""""""3"""333D3D333Dfwf3"""3"333DDD333""DU3DD333""""""""""""""3333"3"""33"""""""""""""333UDDD3"""""""""""""""""3D3"33"3""""""""3"DD3""""""""""""3DUU3"""""333DDDD3""3333""3333"""""""""3Dfff"""""""3"""""""""�Dˆ»ˆ3""""""""wD""DUDUD3D33D33DDUffwffˆ™wfDDDD3DUUD""3"""fwwfDDDD33333"""DUD""3""""""""""""""3""""""""""""""3333D"3"3333DUUUf3""""33D3333""""33DD3333"""""""""3D""""""""3333""3""DD33"3""""""""""""33"3UD3"""""""""""""""""""333""333"3"""""""""""D33""""""""""3D3"""""3"D3DDDD"3""3""D3D3""""""""""""3UDDU3""33"""""""""3"UÝ»w""""""""UU""UD3DD3333DDDDUDDf™ª™wUUDDDDDD33Uw""""333DffwfUUUD3333"""fD""""""""""""""""3""""""""""""3333"D33333"""DDDUU""""3fD"33"""""3"3DUDDD333DU3""""33""""""""3D333""3"""33""3"""""""""""3fD3""""""""""""""""""""""""""33D3"""""""3"""""""""""""3""""""333333UD33"333D33"""""""""""""3DDDDD3""333""""""""3""""""™ÝÌw""""""""w33fD""""3DD3DUUUDfˆ™fD33DDDD333DDUU33"3""DDfUUUUUDD33"""Dw3"""""""""""""""D""""""""""""3""""D"33"""3333UUf"""""3D33"33""""""33D3DD3"33"""""""""""""33"333""""""33"3"""""""""""UD3""""""""""""""""33"""3""""333D3""""""""""""""""""""""""""""""""3333333D3"3"333D3333""""""""""""DDUUDUU3""3""""""��"""""33"""U»ÝÝ»D"""""""""wUwf3""""3DDDDUUfˆwU3""333333"3UU333333333"UDffUDUDDD33"3Uf3""""""""""""""3"3"""""""""""""""""""""""""""3DUwf333"333DD333"""3"3""33DDD3"""""""""""""3""""3D33DD3"""""""""""""""""""""3DD3"""""""3""3"""""3UD""D"""""3""33"3""""""""33""""""""""""""""3333333DD333"D3D3"33333""""""""""""D3DDDDU333"""�"""""3"""""wÌÝÝ»™wD""""""""UDˆwD33"""3DDDDUˆˆD3"""""""""DU""33333333D3UUffUUDDDD33DfD3"""""""""""""""3""""""""""""""""""3""""""3""33Uˆˆˆ™™w3Uf333""""""33DDDDD33"""""""3""""3DDD"""3DDff3""""""""""""""""""UU33"""3"""""""""""""33"33"""""""3D33""""""""""""""""""""""333DD3""3DD3D33333""""""""""""3""""DD3fU�""""""""DfÌÝ»ª™™™U3"""""""3UffU3""""""3DfwwU""""""3UU"3333DDDD3DfUwfUU3333UUU33"""3"3"""""""�""3""""""""""3"""""3"""""3"33"333Uw™»ªwffD3"3"""""3"3DDDD33""""""""""DUU3""3333""""""""""""""""""3"UfUD""33""""""""""""""""""3"3D3D"""""""""""""""""""D3""333D3"3DDD3333D3"33"""""""""33"""""33"U3""""""3"D3ˆÌ̪™™ˆˆwfU"""""""DffD3"""""3wwˆfD""""""""DUD""""D33DD3D3fffwwwU"3UwfD"3"""3"33""""""""""3""""""""""""""""""""3"""3""33333DUfˆˆ™wwU"33"""""33"D333"3"""""""""""D3""""3""""""3"3"""""""""""""""""""3"33DDD""3"""""""""""""""3""""DDD3""""""""""""""""3"3U333"3D3"333333333D33""""""""""3"""""D3DU""""�""""""33DDwÌ»ˆw™™ªwUwU"""3"33wwD33333"DˆU""""""""""""""UUD3"""3DDDDU33UffwfUUwUwfD33"D""""33"""""""""""""""""""3"""""""3""""3"333DDDUUUUˆª™D"33""""3"333DD33D3"""""""""33""""""3"""""3"33333""""""""33D"""333333333D3""""""3"""""""""""""""33333"""""""""""""D33D3"33"3D"333DUU3"""33""""""""33""""""""33DU3"""""""""333Dwª™ˆ™™™ª™™™U"333333ffDDDD3Uf™w""""""""""""3fUDD3""""3DUDUUD3wfwwUUffUDD333333"33""""""""3"3"""""""""""""""""3"""""333333333333DUww"3"""""""3DDD333""3"""""""""""""""""""""""3"""3"""333DUwwfwˆwwUDDDUUUDDDDD3""3"""D3"3"""""33"""""""""333D"""""""""""""""3""""""DDD3""""3D3""DD33UDD333"3"33""3DD3""""""""""3Uf"3""""""""33Dfˆ™ˆ™™ª™ªª™™ˆD333333fˆUDUfU™™UU"""""""""""""3UDDDDDD"""3333DUUUUwfwwU33"3D333333333""""""""""D3"""""""""""""""""""""""""""3333""33DDUU3333"""""33"3"""""3""""""""""3"""""3"""""""""3"3333DDUUUfffwUwwwfUDD3333DDDDD"""""D3"3""3""3"""""""""3DD3""""""""3"""""""""""DD""3"""U3"3UUUUwfUfUD33D"""3DUUD""""""""333DUD"""""""""33D܈™™™™™ˆªªˆfD"333DDwwfUˆªªU""""""""""""""3wfD3DDDD333"333UUUUUUDD3"""DUD33D3333333"""""""""3"""""""""""""""""3333"""""33""""3"33UUD3333"""""""""""""""""""""""""3"""""""""""3D33""333"3333DDUUUUUUfwU3DUDDUfDUUD""""33"""""3""""333DDD33""""""""""""""""""""DU3""3""UD"3DDUUUDDDDDUffUUUUUU3"""""""""""333D"""""""3Dfˆfwˆw™™ˆˆªªª™UU33DD33wfˆª™w3""""""""""UˆwfwfD3UUDDDDUUDfUDDfwUD3"3DUD""3333333""""""""""""""""""""3"""""""""""""""""3"""3D3""""""""""3333UUU333"""""""""""""""""""333"33D33"3DUffUD333"""""""333DDUUUDDDD33DD3UD3DD"""""""""""33DDUDD333""""""3""""""""""3D"""3""UwDDD3DDD3DDDDDUDDDDU33"""""""""""""333D3"""""""33Dw™ffwwˆ™™ˆ™™ª»ªwD33333f™»™D333"""""""""wˆU33DfwfDUDUDDUUUUUUffUD3"33D33"33D333""""""""3""""""""""""3""""""""""""""""""""""3D"""""3"""""33DDD3D"333"""""3"""""""""""33UDDDD333Dffwf3D""""""""""""333DDD""3""""""""""3""""""""""""3DDDDDD333"""""""""3"""""""""D3"3"3"fffU3333DUU3D3DD3DDDD"""""""""""""""""3333D3"""""333ˆ™Ufffˆˆˆˆˆˆ™ˆˆwfU333DUªÌˆ33333""""""""""""3™f""3DDUUfˆUDDDDUUUDDwwwUU33"333D33333333333"""""""""""""""3"""""""""""33"3""""""""DD""""""""""3DDD3"D"""3""""""""""""""""""33"""3DD333DUU33UD3""""""3""""""3333"""""3""""""""""""""""""""33DDDDUD333""""""""3""""""""333"3""Dwwww333333333333DDDD3"""""""""""""""""""33DDD"""""""3DˆwDUfffwˆˆˆˆˆˆˆfwwD33f™Ì»f33D33""""""""""U™f"333DUUUDfˆw3DDUwwwˆˆˆfUDDDD33333"333"""""""""3"""""""""""""""""3""""""""""""""""""""D3"""3"3"33DDDUfD3"""""""""""""3""""""3U333DfDUD3"""""""""""""""""""""3DD33""""""""""""3D""""33DDDDDDUDDD3333D3D"3333"""""""3""""33fwwUUf"3D3333DDDDDUDD333""""""3""""""""""3"33333D33"""""""3fwD3UffUUfwwwwwwfUUw3D™»ªfDDDD333""""""""""""DwD"3333DUUUDUf™ˆˆwwffUUˆwfD33DD333DD3D33"""""""""3""""""""""""""33"""""""""""""""33""""333333DDDDUU3""""�""3""""""3UUDD3DUUU3""""""""3"""333""""33"33"3"""""D3D33""3"33DDDDUUUUUfffwˆwffUDDU3""""""""""""UfwfUfD3"33333DUUUU3DUUD""3""""""33333""33DDUDDD333D3""""""333wU33DDUUUUfwwwwfwˆˆffU»™fUDUDDD33"""""""""""33D"""""33DUDDDUffwˆUDDDUfwfDD3333333DD3333"""""""333""""""""""333D"3""""""""""""3""""3""333333UDDD""�""3U3""""DDUU33UD3"33""""""""333333"""3""""3"""�""""""""""333"""3""33333DDUUUffwfwwUUfwUDD""""""""""""3"ffwUfUfDD3"333UUU33DDDD"33333333DUDDD3DDDDDDDDD3"""""""""3"DˆD"33DDDUUUfwwwfUˆª»wf™UDDDDDDD333"""""""""3D3""""""33DDUDUUUfwˆfDUUffwfUDD333"3DD3333""""""3333"""""""""3D3"33"""""""""""""""3""3D333D33""""33D3""DDDDD3DD""D3D"""""""""""""""3DD"3333"""333""3"""""""""""D"333"DUD3DUUwwwwUˆffwfwfUUD3""""""3""""""UUwUDwUDDDDDDUD3D3DDDfD33"3DDUUUUUD3333DDDDDD333Df3""""""33wˆ3"DDD3DDDUDUUUffUˆ»Ìª™DDUUDDDDD33""""3""3""UD"""33DDD3DUUDDfwUDUffffUUUD"D3DDDDDD3"3"""3333333""""�""""3"D33"""""""""""33"33D3D3DU3"��""""DUU3"3D33DDD"3DUUD""33"""""""""333D""""33"""""3""""""""""""3""""""D333DUwwfUUfDDUwwwwfUU3"""""33""""3""3fˆf3UwfUUfwwfUUUUDUUUD"33"D3D3DD3""33"DDD3DU333DU3""""33333ww33DDDD3DDDDDDUUUfUwÌ̪UUUUUUUDDD33"""""33"3U3""3DDDU3DDDDUUwDDDUwˆffUDD333D3DDDD33"33DDD333333"""""""""D"D3"""""""""""""3""333333Uw"""""""DwwU"3D3DUD33"Uw3D33"""""""""""""3""""3"3""""""""""""""""""""3UfUUDDUUUUUUwwffffD""""333"""333DˆˆUDwfffffˆwUDD3"3DD33"""333D"""""333DU3333DD333U3""""33DDf3"33DDDD3DDDDDUUDUw™»™fUUUUUUUUUDD33""""""3UU""""33UUDD33UUUfUDDUˆfffUDD33DDUDD3DD3D3DDDD333"""""�"""33""333D3""""""""""""""""""33"DDUUf3""""""""3UUfwDDD3"3UDDDD3""""""""""""3""333""""""""""""""""""""""""3DUUUUDUfffUfwˆwfwfDU""33"""""33333"Uwf3DwUwˆwwfffD"""""""3"""D"3U3"""333DUD33333333DD3""33"fˆD"3DDDDUDDDDDUUUDwª™wUDDUUUUUUUUUDDD3"""""UU3"""""3DDDD3D3DDUUU™wDwˆfDDD3333D3DD3DD3DD3DDD3333"""""""""""3DD3D3"""""""""""""""""""33"UUfU"""�"""3""""DDDfwDDD3DUDD3D33""""""3D3""""""""""""""""""""""""""""""""DDUUDDDUUUUUDDffwwUDDUDD3"""""3333DwˆˆUUUwwwˆˆwf3""""""""""3"""3DD3333333"3DD33333D3U3""3333ˆ™3"DDDDDDDDDDDUUUwªˆU3DUUUUUUfUUUUDDD333"33wf"3""""""3DDDDD3D3UUUfDfˆwwwDDD"33DDDD33DDUDDDDD3333"""""""""3"3"""""""""""""""""""""""33DDD33U3"�"""3""""""3UwU33DDD33Uf33""""3""""""""""3"""""3""""3""""""""""3DDD""33333D333UwwwˆfDDf3"""3333D33fwwfUDDwˆ™™f3""""""33""""""""3""33"33333"D3333D3UU""33"3ˆ™"333DDDD33DDUUUUˆ™U""3DUUUUffUUUUUDDD33"3UwU"""""""""""3DDDDDD33DDUUD3fwUwwUD333DUDD33DDUUDDDDD333""""33DD3""3""""""""""33""""""""33DD3D"3"""""D3""3""33UD33DUD33fwD3"3D33""""""""""""""3""""33"""D3""""""""""""3UD3"""""""""3"Dffwffwwww3"""33"3DDf™ªˆwffUUfwU3"3"""""333"3""3"""""333333"3DD3"3UfUU""""33"D™™33D3DDDD33DDDUfˆ™f333"DDUUUUUUUUUUDDDD3"DfD3"3"""""""""""333DD3333DDDUDUˆwUwf33333DDD3D3DUUDDDDDD33"""""""33""""""""3""""""333UU33"3"�""""D3"""""3333DDD3UDUU33D3D"""D"""3""3D"""""""""""""""33"""""""""""3D33""""""33DffUUUf™ˆwU"""3"DD3w™ªª™wwD""""DD3"""""""D"3"""33""3D3333333D3UfwwfUwU3"D""3"w»ˆ33D3DDD3DDDDUfwªªD3333"DDDUUUUUUUUDDDD33Dw33333"3""""""""""333D3333DDDDUfˆwfDwU3""3U"3333DDDUDDD3333""""""""""""""""""""""33333""3""""""""3""""""""""33DDDD3DDD""333""""""333""""3""""""3"33""""""""3"""""""""3""""""D3"""""""""3DUfUUfwfw™™f"33333UwˆwˆfUDw"""333333""""""D"3""3"""33"3""33UfffDD"3UDD333D""D™ªw333DDDDD3DDDUUf»Ìf"3333DDDDUUUUUUUUUUDDDff3"33""3"""""""""""333D33DDDUUfwˆfUwfUUUDDD3""3DUDDD3D3D""3""""��"""""""""""""""""""3"3DD""3""""""""""""""""""3DDD33DUf33""3""33"""33""""""""""3""""""""3""""""333""""""""""""3"3"""""""""""3DUUUUfwfU™™ˆ3333Dfw3DUfUDfU"333"3"333D333333"""33""33333D3DUU333DUDf3333UD"3f™™f3333DDDDDDDDfUU™wUU33333DDDDUUUUUUUUUUDUwU""""""3"33"""""""""""3333DDUUDUwfUfUwwUUUUD3D"3DUUDD33D33"""""""""""""""""""""""""""33DD""3"""""""""""""""33333DUfDD33"""""33"""33""3"""""""""3"""""""""33"""""""""""3"""""33"""""3DUffUUfwˆ™™™f333wf33UUUDD33333"""3UD3D3D3"D3"""33"3D33DDDUU33DfwfDUD333DUUf™ˆˆˆD33D3DDDDDDDUUUww33U33333DDDDUUUUUUUUUUfˆD33""3"""333""""""333DUfwUfD"UUfUDUUU3"D"UfUDD33333"3""""�""""""""""""3""3"""""""""""""3DU3"""""""""""""""""3DUD33DDUDUDD3D"3"""""333""""""""3"""3""""""""333""""""333"""""""""33DfUfUUUUUfˆ™ˆˆDUwfUwwUUD333"""33333DD"33333D"""""3DD333333fDDfwU3DU3D3Dfwfw™ˆˆ™U33D3DDDDDDDUDfwfU3"UDD33DDDDDUUUUUUUUfˆˆD333""D""333"""""""3UDUffUfw3""UfUUDUD33DUfUDD333D3""""""""""""""3"""""""""""""""""""3""33"DU3"D3""3"""""""""""3UDD3DDUffwf33"DD3"""3D3""""""3"3U333D"333333""3""3""3"3"""""""""33DUUfUUUfffw™ˆ™wUUDDU™fD333""""3"333"33"3D3""""""33DD333333ffwU333UU3UUwwUˆˆª™ªf333D33DDDDDfUfªD3D33DUDDDDDDDDUUUUUUDwªwDD3333"33"333"""""""3DfUUUfwf3�3UDUfDD3DDDUUUD3"3333"""""""""3"""""""""""""""""""3""""""""33"33DfwˆfD3DD"""""""3DUD3DUDwfUffD33"3""""""3""3""""""3"""DUD""DU""D3D""""""""3D""""3"""""""""""333UUUfUUw™™™™™™wDDDwwwwU3""3D3U3"3333333333"""""33DDD3333DwUfU33"UfUUffwUfw™wwfD33D3DDDDDDfUUˆª333333UfDDD33DDDDUUUU™ªUDDDD33""D"""33"""3DDfUUUfU"DUDfD3DDDDUUUUD33333"33""""""3"""""""""""""""""""3"""""""""3DDUUwˆwUUfwˆf""""33DD33DDUDDD33333"""""""3""""""3"�3""""3DDU"3U3"33333DDD3"""""""""""""""""33"3DDUwff™ª™wˆˆwU3DffUUUfUUwUDD33D3333333333"""3"DDDD33DDUUUfD"3"3fUfwwwww™ˆU"""3DD3DDDDDUUU3w™w333D33"DÌUffDDUUUDDw™ˆ3DDDD333""3"""33""""333UfUUfU"�"fUUD3""DDDDDDDD33333"3"""""""""""3""33""""""""""3"""""""333"""""333fwwwwUDUDUfwwU"�"""""3"3DD333UDDDDD"333"""""""""""""""""��""""""DD33UD33DDU3DDU""""""""""3""""""""""333DUffw™ˆfDDfU33DUfUffUˆf33333333DUD333""3"""3"DDDUUDDDD3UD""33"UUUffwwwˆw3"3333DDDDDDDDUUU3ˆˆ3""3333"3™fwDDDUUUUª™UDDDDDDDD333"3"3"""""""333DUffww"�"3DwfU"3DD3DDD"3D333333"3"""""""""""""3""""""""""""3""""3"""3""""333"DfwwfD3DDUUDDUfD�""""""""""DDDDUUDUDDD33""""""""""""""3"""33DD"DU""UDDUUUDD3"""33"""3"""3""""""""""""3"333Ufwwªªf3DDDUUUffUDDDUDw3D3333""3D333333""""3DUffwffUUfU3"""3D3UDDfwwwww"333333333DUDUUUUUfw3""3333"3"fªUDDUUDf»ˆ33DDDDDDDD3333"""3"""""3"""3DDDDUwwf3""33""UUDDDUDD"3DDDDD33333""""""""""""""""""""3"""3"3"""""""33"33""3333UUfD33UDDDUUffˆ"��"""3"""3D333DUUDD333D"""""""""3"""""3"33333DD""3DDDUUff3""""""""3"""3"""""""""3D3Ufˆˆª™wDDDDUUUwwUD3DDDUwD3D333333DD3333"3""3DUwf3D33D"""3333DUDUwwwff""333DD33DDDUffUUffU"""3"""""D™ˆDDDwª»f33DDDDDDDDD33"""""333""33""33D33DwfD""""""UDUU33UDDD"33DDD333"33""""""""""""""""""""""""3""""333333"33D333UUD"3DUUUUfwˆw"""DfUDD"""""""DD33DUDDD3333""""""""""""3""""�""""3"3"3D3"3"DD3DDUfU"""""""""3DD"D3"""""D3DDDUww™ªˆfDDDDUffUUUDD3DUUwwUfwD3"333DUfD3"3333DUUfDUU33"""33"333DDDUUffww"33"3333DDDDDUfDUfU3""""33"""""™ªwˆªÌwD3DDDDDDDDDDD33"""33D333DD3333DDDU™f"""fUwf3DDDD33D3DDDDDDD3""""""3"""""""""""3"3"""3""""333"3"""33333DUfD33DUfUfwˆ™D"3DfUD3"""""""3"33DDDD3333D3"""3"3""""3"""""""""33""""33""33UD33DU3333""""""3DUU3D33"""""3DUDDDffw™ˆ33UDDffffDDDDDDUUffwfffDDD"DDD3D3"33DDUfwU3Df3""""3""3"333DUDUwwwU"33333DDDDDDDfD"Uf""""3""""3""D̪»ÌªU333D3DDDDDDDD3D3333""33DDDDDDDDUUfˆwU""DffUD33D""DDDDD3DDDDD3""""""""""3""""""""""""�3""""""3"""""""33333DDUD33DUUfUwˆw3"33""""3"""""""""33"33"33"DD"""3"""""""""""""33""""3"""D3UUD3DD"""""""""""DUf"3D33""""""3DDDDUffˆwD3DUUUffUDUDDUUDDDDwfUUUD33DD333333DDUUfUfDDDUD""""""""3"DfUDUUD3"3""3DDDDDDDDDfDDU""""""3""DUˆ™™wfDDDDD33DDDDDDDD3D333""333DDDDDUUDUUDf"D"DUDDUDD333333333DD3DUD""""""""""""""3""""""""""""""""""""333333DD3U333DUfwwwˆ"""""3""""""""""""3""33""DDUD""D33""3""""""""""""3"""""""3D"""3UUD"DU""""3"D3333UUUUD3"""""""""33UDDDUfˆw33DUDUfwDDUUDDDD3D33wUDDfD"3DD3D333DUUUD3wwUDDD3""D3""3D33ffD""""""3DfUUUDDDDUUwf3""""""33f™™wDDD3DDDDD33DDDDDD3D3D33"""333DUDDfUUD33"33"3D33DUD33333333""DDDDD""""""""""""3D3""3""""""""""""""""""""""""3""33D3333333Uwwwwfff""""3D""""33"""333"""3"3DDDU""DU33"3"""""""""""D"""""""""""""""3DUDDD"""""""""U3D3333"DD""""""""D33DDUDUwˆˆ333DDDUfDDDUUD333"DUwU3DUf333DDDUDDDDDUD3fwDD3"""""3D33DD"3UwD"""""""33UUUDDDDDDfwf"""""""""Uwˆ™™™U33DDDDD3D33DDUDD333D""""3333UDDUUff3"33U"�"D"33UUDD"3D3333333UUDD"""""""""""3UD""""""""""""""""""""""""3333DD33U33DDfwwwfDDU""3""""""3"""""""3""3U33D3"33"DDDDfU"""""""""""""""U3"""""""""""""""333D3DDDU3"""""3UD3"D3DUD""""""""3""DD33DDUUU™ˆD"3DDDUfD3D33D33"3"UfU33DUfUDUUffDDUUUfffUD33D3""333"33DUUUUfD""""""33DDDDD3DDUwwD""""""""w™fww™ˆfDDfwD33D3DDDDDDD3333"""3333DD33UUfU3"33DD�""3DDUDDD3D333"333"UUDD"3"333"""3"UU3"""""""""""""""""""""""3333DD3D3333UfwffDDfD"""""""3"""""""""""3333333""33"DD3Dfff33""33""3"""3333""""""3"""3"""""3"33DDˆˆD3""3DD333DD3D"""""3U33"33"33DUUUˆ™3"33DDUUD333D33333DDˆwD3DDDfUUUUfUUfUUUD3"3"3"""""""DDUfwwfU3""""""""DDDDD333DDww3""""""3w™ˆˆ™™™™ˆˆ™fD3DD3DDDDDDDD3333"""3333D333DUD33"33D3"3D""3DDDDDD"333333333UUU3"""""3"3DU3"""3""""""""""""""""""""3333DD333"33UfUUD33f""33D3"""""""""33"""""3"3333"3333Uf3DDDDD333"3"""""""""""""""33"""33"33U3D333"""UD3D3U3"33""""3D3"""3DUDw™ˆU"333DDUD3D333333"3DˆUD3U33UfUfff™wˆU33333""""""""3UUUUˆffUD""""""333UDDDDDD3Dff"""""""Dwˆ™™ˆfUDDˆˆfw3DDDDDDDDDD333333""33DDDDDDDU""3""DD3"""""UfUDD3D3"""3333D33DUU3"""3333""U33""33""""3""""""""""""""3"""33"UDD"""333DDDDD33UD3D333"""""""""33""""33D333DDD3UU3DUDD3333D"33""""""""""""""""3"""3"33DD33U3"3DD"3UU3333"""""3U33""3333DUf™ª™3""3333DUD3333""3"33fUD33"DDUUUfffwfU"33"3""""""""3ffffwwD""""333D333333DDfU""""""3wwˆwfUDDDw™D3Uf3D3DDUDDDD33""""""33DDDDDUU3""3UD3�""""""3UUUD333"""3"33333D3U3"333333"3"333"""""""""""""3"3""""""3D333"333333DDD333f"3D33"""""""""""3"3"""33333D3DUDDDUD333D333333""""""""""""""""3"33Uf""""D33333UUD3""""3""""3333DDDˆ™™™fUfD"3"3D3""""""3"3D33333DD3UUDfˆˆwwfDDD333"""3D"""""UUUfUD3"""""333"3333DDDUU""""""3DfwfUUDUUDDfwUUUwUDDDDDDDDD33""""""3DDDDUUU""33U""3333UUD33""""""3D333DUUUDD""""""3""""""""""""""""3""""""""""""3""D3"333333D3333Uw33""""3""3""3""3""""""""3333333DUUD3"3DD"""33""""""""""""""3"""""D333wwf""""3"33"33333""33""""3333DDDˆ™ˆ™ˆfww3"""33""""""33"3DD333333DUUUfwˆˆfDDD3"3"""333"D3"33UUUfD3""""3""3"33DDDUD"3""""""3DffUD"""""3333DDUUfwUDDUDD3D33"""""33DDUDDU3"33U"""DUUDDD"""""""""3DD3333Uffw33"""3"""""""""""""""""""""""""""""""3"D3"33333D3333Dwˆ3""""""33"3""""33"""""""""3D3"D33UUD"""3333333""""""""""""""""3U3D33fUfwD"""3"""""3"""""3"""""3"333Dwˆˆˆwffwf""""""""""""3D33333333DUDUUUfwˆf"3333""3DD""3""DfUUff"""""""""333"33DUfU3"333""""""""DwfD"""""3""333333DUwU3DD33333""""""333DU3""""3U3""DUDDD3"""3""3DD333333"333DffUDD3D33""""3"""""""""""3""""""""""""33"""3D33333"33Uwf"""""3"33D33""3""""""""""""3""33DDD3"3333333D3""""""""""""""D333"3fff3"3UU3"""3"""""""3"33333Df™™ˆffwwUD"""""""""""3333"333333DUDUUUwˆw™D33D333D3"""""3DDDU33"3""""3D33""3DUffD"""333333""3UUfD""""""""3333333DDwD3D3333333"""""333DD"""3"DD""DUD333333""""33DD""3333333"33DffD"33""""""""""""""""33""""""""""""333""3DD33D3"""DˆU""""""3"333"3333""""""""33"3DUUDDU3DUD3D333"""""""""""3"""3"""""""33""D""3UU"3DfwD""3"""""""333333UUˆª™™wwwˆf"""""""""""""333D333333333DUUfffUDfDDUDDDDD"""""3D3UU3""""3"""D333333UUf3333DD333"333fU3""""""""""""33"33DDfD3333DD3333""3333DD"""33DD"�3DD"33"D3"3"3""3UD"333"33"333D3UfD"3""""""""""3""""""3"""3"3""""""33333333D3333"D3fU3"""33""""3D3333""""""""""3333DDDD3DUUUU3"""""""""""3""33""""""""333"3D3""3DD3UUwf3""3"3"""""33333DUUwªªªˆˆˆfU3""""""""""3D3"3DD3333333DDDUUUUDDDffDDDDD33""""3DDUU333""""""""""3D333DDDUDD3D3"3D3"3DffD3"333333""""3""333DUU33333333""333D3333"""3D3UD��DDDD3""33""""3UU3"333D"3333DDDDffD"""""""""""""""""""""""""""""""3D3333333DD3333DUU"""""D3""""3UU33"""""""""""""33DD33DUDDUUD"3""""""""""""""3D"""33"""3""333333"3DDDUwfUD"""""""""3333DUUUˆ™™ˆwfUD3"""""""""3D333DD3333333D3DDUDDDDD3ff3DD333"""""DDDDDD3""""""""3"""333UU3333DDD3DDD3"Dff"D333D3DD3"""33"3333DfDD33333"3333333"3""3333DD�"�3D3D3"""""3fUDD3333333""3DDUUfU"""""3ffU""""""""""""""""""""""33"3"33"3333D333DDDD33"""""33"3""3UUD333"""""""33D3D33DfDDD333"3"""""""""""33""3""D"""3"3333333DUDwˆU333"""3"""""333DDUwfw™wˆfUfD""""3"""""D3"3f33333333DDD3D3333UU3fU3UUD""""""3UDD""3"""""""33333"UUDD"""3D33UD33D3UU"3333333DD"""""""""3DUUD33333333333333""""33""3f"33""""""""3DDU3333"33D333DDDDUDD3""fwwU3D"""""""""""""""""3""""""""3""33DD33DDf33D""""""""3333DUD333""""""""33333333UUUDD333"""""""""33"""""""3""333"33ffUfffwU""""33"""33"3DUUf™ˆªwwwUD3"""""""""""DDUfUUD"333D333DD3"33DDUDfffDUD""""33DDD""""""""""""""3"DUUU3""3""3333DDDDDwU3""33""33D"""""""3"33DDDDD3333333DD3DD""D33333U""""""3""""""""3"DD3"""""333333DDDfwwDUffUD3333""""""""""""""""3""""""""""333D33D3""""""""333DDDUUD33""""""""""""333333DUfU3333"3""""333""""""""33""333UwffU3"""""""3333DDUfw3wfD333"""""U3"DUfDUwD3""3D3333D333333DUfww3DDD"33DU333"""""3"""""DDDD3"""""3333""3UwfU""""3"33333"""""""3"33DfUDDD3333"DDDD3"""DD33"3f3""""""""""""""""3"D3D"""""""3333DDUfˆwfDDDDDD3D3"""""""""""""""""333DDD3""""""""""""33UfUUD3"3""""""""33"3D33333UUUD3"""""""3"""""""""""""""33"33UfwwwDD33"""""""""3DUDffDˆˆUD33""""""D333DUUUUU"33333"333"3333333DDwffU333333D33""""D"3"333UD3D3"33"3""3""3ffUD""""""""3D33"""""""33DUwUUUDD3333D3DD3"333"""3DU""""""""""""""3"""""""D3""""""3"33DUfwUU33D3DD3""""""""""3""""33DDD3"""""""""""3""3DD333""""""""""3"""33"33333UUfDDD""""""33""""""""""""""""""3DD3DDDf3"DwU3"""""""3DUUUDwˆwDD3""""3D33D33UDDDDD"33"3""3"3333333333DUDDUU3"333333""""3"333"DUDDDD""3D33D"3UUUU33"""33"333"""""""""333UUDUUfD3DD333UD3"333""33DU""3"""""33""""""3DwwUDDD33333333"""""""""3""""33D3""""""""""""""33DD33""""""333""""""""""3333"3"DUUUDD""""""""""""""""""""""3D"33D3333"3"3"3"""""""3DDUfff™ªw3"3""""33D33D"DD3D333""3333"3"""33333333DDDDDUU3DD33333""""333""33DDD3UD33U33UUDUDDD3"3""3""""""""""""""""33DDDUUfDDD33"DDD333""333DfD""""""""""""3DDUUD333"3333333"""""""""3"3""33D3""""333""33D3333""""""""33"""""""DD"33"3""3UfD33"""""""""3"""""""""33UD""3UD3D""D3"33"3""3DDUfwwˆ™wU"3"""""D3333D3"3D"3D3""""333"3""""33333DDD333DDUwfUDD333""""3"33"DDD3D333UU3UDDDDD3333""""33""33"""""3""3333DDUDDffUDDDD"D3""""3333UU3""""33""""""""""""33UUfDDUUDD333"3333Df3"""""""""""""""33333DD"DDD3"""DD33333"""3"33"3"""""""""""""33D3"""""3UDD33"""""""""""""""3"3D33"""""3Uf333"""""""""""3DDUUffwˆˆªf""""""""D"3""333"3333""""33"""""""333"33DD3""333Uwˆˆ™f333"""33"""333D3DDUD333DUUDDD333"33"333"33"3"""""""D33"3D33DDDDUUUUDD3DDD""""""33UD3D"""D33""""""""""""33DfUUfUDDD3""""DDDUD"""333"3""""3"""333"""333333DD3333"""DDD33D33"""333333"3"""3""""""3D3"""""33DD3D3"""""""""""""""3Uˆf3"""333DD"D3"""""333"""3DDUUDUffwwˆªˆ3""""""3""3D"""3"3333""33"D3"""33""""3"3DD3"33"33Uwwfw™UD""""""33"""3"3D3UffDDDfDDDD3"3"3333"33"33""""""33""33D3DDDDDUDUUUUDDDDUD""""3"3DUf"3"�"""3""33""""3"""""3fUUUDDDDD""""33D"3f""""33DD3""""33"""333""""333"""D3D3D33UDD3""33"D33333"""""""""33""""3"""""333D333D"""""""""3"""""""33UDD3""3DDUUUfD""""3DDU33"DDDUUDUfwUwˆªªwD3"33"""33""""3"3333333"33""3""""D333D33"""""""Dffffwww3"""""""""33D333UUDUUUUD3D33"""3333"3"33"3"""3"3"3333DDDUDDUUDUUDDDDUfD"""""3DDw33"""""33""D"3f"""""�"""""DwffDUDDDDD"333"3"DˆˆD"33"""33""""""33""""33"3"333333DDD33333DDD333""""""""""3"33"""""""3""""3DU3"3""""""""""3""3"""3"33333"3333D3DUUU33"""3DffD"3DDDDDDUUUwfUˆ»ˆU3"""3"""333""3"""3""3"DD""""""""33DD333"""3"""3DUUfwˆwf3333""""""33DDDDD33wfDD333"""3"3333333DD3""333"33DUDDUD3UUDUUDDDUDUUD3""""""3Dw3"U""""33"D33DD""""""3UD"3DD33"3"3""""DUwfUfU33""""""3""""""33"3""3"3D33D3D333"33"""""""""""3"""D3""""""""""""DU""""""""""""""""""""3333""""DD333D3333"""""""ffD"3DDD3DDUfUDUwˆªˆf""""D3"""3""D3"""""""3D333"""""""""3DD""""""""""DDDDfwwww3"33"""""3DDDDDUUDUfU3333""3D"333DD3DD3D3D333333333DfD3DDDDDfDDDDUDD33"""""""3Df33"""""""3"3D"DU""33""3wUD""3D3""3""3DwwUU3"3UD""""""""""""""33"3333333D333D3""""""""""""""""3""3"""""""""33""3""""3"""""""""""3"D"""3DD333D333D33"3Uw33DDDDDDUfwfDUˆªªUU""33""""3"Dwf""""""3DDD3"""""""3"""D"""""""""3DDUUDwˆwˆ3"3""""""33DDD3DD3DUU33"D"33333333"""D3""""3D3"33333D33D3DD3DDUDDUDDUD3""333""3"""Uf""3"""3"""33D3"DU3�"33DDD�""""""ff"""""""33"3UUwˆw3"""3DU"""""""""""""3"33""33333"3DD3"3"3""""""""""""33"""""""""""""""3D3""""""""3"""""""33"3"""""DD"""3U3DD3DD3""D""DDUUDDDDDDDUUfffwªÌ»f"3DD"""3wªw3"""33333"""""""""333"3D"""""""DD3DDDDfwwfDD"""""333D"33"D3UU33""3U3"""""""""""""""333""333333333D33DDDDUDUDDD"33333""3"UD""""33"""3""3D3DD""U3""""""""""""DˆU3""""DwwwU""""""33U3""""""""""""""33"333"""333""""""3"""""""""""""3""""""""""""""3""""DD"""""""3""""""3"""3"""33"3"3"DD3D33DDD""3"""""33DDUDDDDDDUffˆˆˆwªˆ""33"""wwwD3""33""""""""""""33""""""333D3333DUffˆwf3""3""3"D333D3DD""33"3""""""""""""""3"33"33D3DU33DDD3UUDUDDD"3D33"3"33""w3"""33""D"""3333"UU3""�""33""""3wwD"""""""3D"33"""""""333D"""""""""3"33333""""33D3"""""""""""""""""3"""3"3""""""""""""DD"33"""""""33""""3D333"33"ff33DD3D3"DU""""""3333DD33D3DUfˆªwUwˆªw3"""""ˆªˆ™""""""33"""""""""3""""D"""""333333"3DUUUfwf3""33""3DDDD333D3"UD3D3""33"""""""""""3"3"DDD3""U3"33DDfUDDD33DD33"3""""""Uf"33""""333"Df33�"�""""""""""DwD"""""""3""3""""""""33""""""""""""""""""""3"3U"""33333"3"3""""""""""""33"""3""""""""""""D3333333""""""""""""""D333333"3UD"333DU3"DDU3"""""""3"33D33UUUfUDDUUfwª™"""""™ªªªwwU"""""3"""""""D"""3D""""333D""""3DDUUUfD"3"""""D333"33DDDDDD33U3UwU""33""""""""""""3333333"""3UDUUDD3333"333DD""333""3wU"""3""""""33333UU3""""""""""""3DU33"""""""""33""""""33"""""""""""""""""""3""""""""3333"""3""""""""""333""""""""""""""""33D3333"3D3""D3"""""3"""3DDDDDD3""3fD"333DUU3"DUf3""""""3"""33UwˆfUD3"DDUDˆªD"""Uˆ™U3UUU""""""""""3"""""""333333""""3DDDffD3UU3""33DD"3D33333"DDDU33U"33"""""""""""""3333DDDUD3D33DDDDDD3D""3"33U3"333"33ˆ""3""""""DDDUDUU3ffU3""""3"""""UfD3""3"""""""33"33"""3"""""""""""""""""333"""33""33""33"""""""33""333"""""""""3"""DD33"333333"""""33D33333333D3"""3U333333UUDD3333""""33"3333DfwfwUD3""U3DUU»fUf3ˆw3"3fDUD""""""""""""33D"33""""33DDffU3D3""""3UDDD3"3"""3333"33DD33""""""""""""""33333D3DD"3DDDDDUDDD3333"33"3"333""3wf""""""""3DD33"""fUUUD"UD""""UwD"""""""""""""""""3D"""33"""""3""""""""""""""""""""""""3"""3"""3D"3"""""""3D3""3""""""""""""""DD3"""333""""""3"3UD"""3333DDD333U3"333"DUDDˆfD"U333DUDDUUfUUDDDDD3""3D33Dˆ»™™»ˆf3""DUDDD"""""""""""""""""""33""33""""3DDUUfDD333""3D333D333""D33"U3"3DDDUU3""""""""3333"3333DU333"33DUUD333DD""333DD33""""Uª"3333333""333"DUffU3U""3DfU"""33"3""""""""3""""""""3""""D"""""""""""""""""""""""""3"3"""""3D"""""""33D3"""""""""""""�""""3""3DD3""3333""""""33"fwU""3333DD333"UU"""3"Uffww™™™wwUfUUUffD3333DDD33"3D3"33Dw»»ÝÌf"""""DU"UD""""""""""33""""33"3D""""3"3DUUDfU3""D3"""""""3"333"D333DDDUwww3""""""D3""3D3"3DD33D333333D33DDfU333DDUDD3""3Dˆ33DD333"3"333DDDUfUfUD3"���"UUD3"""33333333"""""33"""""33""33""""""""""""3"""""""""3"3"33DU3D33""""""""""""""""""""""""""""""""3DD3"33"""""""""""""3w"""33D33333"3Uf3""3UwwUUfUfwfUDDfDDDUD33333DD3DD333333DDfÌÝU""3"""3DD3w"""""""""""3"""""""""3""""""33DDwˆw""3"333"""""""33""3""DD""3DDD3D3""""""""3""333DD333""333333UUUˆ™U333DDD3"3DUf3DDD3""333"33D3"fDUUUU3""�"DUfD"""""""""""""""""33""33"""D3"""""""""""""""3""3"""""""3""""333333D3"33""33"""""3""""""""DD3"""3""""""DD3333"""3"""""""""""UD3""33"333"33UD""DˆwUUUUDUUUD"UwD""""3D33"3""""""3D"333U»Ýª"D3"3"3D3UwDUff""""""33""""""3""""3UUfˆˆD"3D3""""""""""""33333D33333""""""""""""3D3DD33""""3""3wˆwªfDDDDD33"""DDªD333D3"""3"""33DfDDDDUD"""DU3""""""3""""""""3D""33""3D""""""""""""""""""3"""""""3""""D3D3"DU3"""3""""""3"""""33DUUDD3""3D""""""3D3"""""""3DDD"""""""3"""3333333""D3"3ffUUUUDD3D33DDD3"3""""3""3"""""""""3333ˆÝîU3D3""3f3UˆU3DfD33""3U3""""33""""""""""33UDfffUDDUD33""""""""33D333"3"""33"3"33""""""""""""3DUDD333"3D333Dwª»w3DUD"33"3D3ªw"33"""3""""wDDD33D""U3����""""3""""""""3""""""3U33""""33""""3"""""3""""""""""""""33"3333""333""""3333333DfwwfDDD3""33"""""3""""""""UDD""3"""3333"33"333"3DD3DDwU3DD33333D""3D""3"""33""""""""""""333DˆÝݪ"DD333UUˆ"3DUU33""Df""""""""""""""3DUUfffwwwˆU33""""3""333333DU"3UD3D"""3"""""""""""""3D3333"Uw333"f»™™f33DD"""""DDwª�"3""3"""3"fD33DD3"wD���33""""""""""""""""""3DU""""""3""""""""3"""333""3""""3"3D33D33333D3"""33DDDDUUˆˆˆf3""UD"""""3DDDD""""""""""""""33""333"""""333D33Dw™™ˆwDDD3333DD3""33"""""""3""""""3""""33Df™ÌÝ»»U"3"DDD3ˆ3""DDU3"Uf""""3""""""D3""DDUfUUUfwwwf"3"""""""DDDDDDD333DDD""3""""""""""""""3D33"""3333""fwDDU3""""""DUfª""""333""""DUDDDDD3Df"�33"""""""""�""3"�"3D3"""3""333""""""""""""""33"""""""""""3"3D33D33""333UUUfˆ™™f3""3"3"""""3""3DfD3""3D""""""""3"33"3"""33"33""33D™™wUDDDD3D3fD"""3"""""""""""""""""3Uˆ»Ì̪»ª»U"33UD"3w""3DfD33fD"""""3"""33""""UUUfUUUfffwfDD"""""3DDDUD3D3333DD3333"""""""33""""333333"""""""33333""""Dfˆ™""""333""UDDUfU3DD�""""""""��"""3U3""33"333"""""""""""""""D3"""3"33U3"33"3D33D3D3DD33Ufˆ»Ìˆ3"""""""""""""""""D3DD3D"333""""""3D"""""333333"333D3""3wwDD3DD3DD33D3""""3""""""""""""""33ªÌÌ»™ª»ªD"333DDw"""DUf3D3U""""""""""""D"DDD"3DDDUDDDDUUUwUD3""""333"3DD33D333DDDD""""33""3"""33333""""""""""DD""D"""3DwªD�"""3UUffUU3��"""""""""""""""3U3333D"333"""""""""""""3"""333""3333U33"""3DDDDDDUDfw™™Ì™U""""""""""""""3DDDDDDU3"3D3""""""""""""""33"33333DD"3fwUDD"3D33"3"DDD3"""3""""""3Dfªªªª™ª»f33"33""f""3DfUD""3""""""3""""3""3D"3"33DDDDDDUffffDD""""""""""""3333333DDD333UD33DU"""""33""""""D3""3DD"""3Dwªˆ��"DUUˆfwUU"""""""""""""""""DUD3"33"""333D"""""""""333"""33""333D3D3"33"3DUffwˆ™»Ì»ˆD��"""""""""""""""DfUDD33D3""""""33""333""""3D""333333"w™wDD333333"3"D3"D3"""""""33DUfˆ™™™D"ˆ3"3"3""DD3"DUwD"""""""""3""""D"""3""3"33DDDDDDD3DUwU"""""""""""""""333333DDDDDD33D3D""""""""3"""""3U"DDDff3""""3f™»""��"ffD33"""33"""D"""""""""3UU3333333333DD33"3333"33"33"3D3D3Dfw™wfUUDDfw™™ª»™ffD3���"""""""""3"""""""DwfU33D33"""""""""3""3"""""3D3D333"33D™wUDDD33"333"""3""3D3"""""""""3DUUffw™fDUˆ3"33"""U"33Dw3"""""33"""""""""""3333D333DDUfU""""""""""""3"""33"333fUU33"""""D"""""3"""""UD"3"33"3Uf™U��"�DˆUD33��""""""3D3""""D""""""3"333DwDD333DUDDDDfD333D333DUDDUUD3DUwffD3™™»ª™™ˆwwD�"""�""""""""33"""""���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/reparent.rb�����������������������������������������������0000644�0001750�0001750�00000005171�11701304107�020565� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header reparent.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: reparent.rb,v 1.6 2005/07/18 17:13:33 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ReparentSample < SampleWindow def initialize super("reparent") vbox = Gtk::VBox.new(false, 0) add(vbox) box2 = Gtk::HBox.new(false, 5) box2.set_border_width(10) vbox.pack_start(box2, true, true, 0) label = Gtk::Label.new("Hello World") frame = Gtk::Frame.new("Frame 1") box2.pack_start(frame, true, true, 0) framebox1 = Gtk::VBox.new(false, 5) framebox1.border_width = 5 frame.add(framebox1) button = Gtk::Button.new("switch") button.signal_connect("clicked"){ label.reparent(framebox1) } framebox1.pack_start(button, false, true, 0) framebox1.add(label) label.signal_connect("parent_set"){ |child, old_parent| puts "set_parent for \"#{child.class}\":" puts " new parent: \"#{if child.parent then child.parent.class else 'NULL' end}\"," puts " old parent: \"#{if old_parent then old_parent.class else 'NULL' end}\"," puts " data: 42\n" } frame = Gtk::Frame.new("Frame 2") box2.pack_start(frame, true, true, 0) framebox2 = Gtk::VBox.new(false, 5) framebox2.border_width = 5 frame.add(framebox2) button = Gtk::Button.new("switch") button.signal_connect("clicked"){ label.reparent(framebox2) } framebox2.pack_start(button, false, true, 0) vbox.pack_start(Gtk::HSeparator.new, false, true) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, false, true, 10) button.can_default = true button.grab_default end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/3DRings.xpm�����������������������������������������������0000644�0001750�0001750�00000007504�11701304107�020421� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char * DRings_xpm[] = { "48 48 65 1", " c None", ". c #104010404103", "X c #1040208130C2", "o c #104014515144", "O c #000010402081", "+ c #1040104030C2", "@ c #208120815144", "# c #28A241035965", "$ c #30C230C26185", "% c #208130C24103", "& c #104010402081", "* c #104000002081", "= c #000010401040", "- c #492441036185", "; c #596559659E79", ": c #30C220815144", "> c #0820186128A2", ", c #000000001040", "< c #2081104030C2", "1 c #514459659658", "2 c #514455556185", "3 c #104000001040", "4 c #000008200000", "5 c #618569A6AEBA", "6 c #618569A69658", "7 c #410345148E38", "8 c #104020814103", "9 c #79E782079658", "0 c #208120814103", "q c #596571C69E79", "w c #4103514471C6", "e c #2081208130C2", "r c #6185618571C6", "t c #28A228A25965", "y c #596561858617", "u c #96589E79BEFB", "i c #28A230C271C6", "p c #38E345145144", "a c #79E78207A699", "s c #30C2492469A6", "d c #410330C25965", "f c #410351446185", "g c #AEBAAAAAD75C", "h c #38E338E34103", "j c #EFBEEBADEFBE", "k c #208130C25144", "l c #9658A289DF7D", "z c #208110404103", "x c #28A228A26185", "c c #8E388A28BEFB", "v c #208118612081", "b c #38E3451479E7", "n c #4924618579E7", "m c #86178617B6DA", "M c #30C220814103", "N c #104030C25144", "B c #4103410371C6", "V c #86178A28D75C", "C c #DF7DDB6CE79D", "Z c #BEFBC30BD75C", "A c #410330C271C6", "S c #30C228A230C2", "D c #082008201861", "F c #186130C238E3", "G c #0000208130C2", " .Xo ", " O+O@#$% ", " &*=+X-;: ", " >&=,=<11#2 ", " +O34,X567& ", " 8X+=,90q9w. ", " +e<>3r tyu-& ", " Xi%.= paus+ ", " Od-@= fga$h ", " @y7X, Xrjak ", " 2:eaw+ $ag;@ ", " .X@8@k@o@X+ +pl9tO ", " +zX@x$$isikt8o02crv ", " 8@%ip7757ywbs$Ohn6#. ", " &0%$p7r215ybw1pzp2-0= ", " 8tk$#yw21665n;1+%-p$O ", " O<e7pbryq5am9ay6XMpM>3& ", " 9.NtpBw16amclVcm1t%kX*88 ", " +&etd7r6y9ulgglm6>e>3s@83 ", " +0k$y-y69cgCCCZVam%+#ik8X ", " O&oi$d725amgCjCZu962ybtx8+p ", " &X0x$sBym9VZCCCZca;yBbi%08& ", " =++@sApMy5muZZgum6y2wds:>+& ", " #tp;1;yB#i25cVucma5;w-pti@8& ", " .#2alumnBp:@1r59y9y6ywBS$%0X+= ", " %$wmZVu;#tX8X07r1656y2wbp$k@%@OD ", " 0Byc9a;h%0>&D&hBrr2r1bwB-AF:0<&*= ", " kBf;yr#@X+&<%MkhsBwBwpsB#Bktkt8+Oh ", " xt7B-t8*,3O.X00:$i#dBd#bptFek0X.+* ", " Xt#b#@=, =&O+X0Ft%ibsp$p$ki%l5sX&= ", " &<kvX&4 +O*&<X0e:%$pAti%:edugn0= ", " +X@&+, V,O&>+Xt>tktktv0%@k;Cls+ ", " =+O*4*X:p;9cy3&&8ve0FMtt$ee0>z7cZ6k ", " D=D4,=.k$sBs$ee=+X0Fk%-#t%0X&O0nu9bG ", " ,,434*&ze@F<eeeeee><tdhdSMe<&&XAaawx ", " 4,4,=+><peeeeee&=<%M%$hSF0X&O&kw5r%Z ", " D&vSFMF<>&D =0S-2i& ", " +>puB> >0h7s. ", " SM5VqM &0t#$8 ", " XpVV70 &0kMk. ", " XdyB%z *X<%@+ ", " &k$b0X+=8X08o ", " &e:e+=*X.X+& ", " +X.O+X0O.=, ", " +>&+0>3&* ", " &X0k+O, ", " >v,3 ", " "}; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/check-y.xpm�����������������������������������������������0000644�0001750�0001750�00000000533�11701304107�020466� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char *openfile[] = { /* width height num_colors chars_per_pixel */ " 10 9 5 1", /* colors */ ". c None", "# c #000000", "i c #ff0fff", "y c #ff1f00", "# c #9f9f9f", /* pixels */ "..........", "........yy", ".......yy.", "......yy..", ".yyy.yy...", "..yyyy....", "...yy.....", "..........", "..........", }; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/colorselect.rb��������������������������������������������0000644�0001750�0001750�00000001434�11701304107�021261� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin colorselect.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project $Id: colorselect.rb,v 1.5 2005/07/17 16:55:27 mutoh Exp $ =end require 'sample' class ColorSelectionSample < Gtk::ColorSelectionDialog include Sample extend SampleClass def initialize super(:title => "color selection dialog") @destroyed = false signal_connect("destroy"){destroy} color_selection.set_has_opacity_control(true) set_window_position(:mouse) # Gtk::Window::Position::MOUSE color_selection.signal_connect("color_changed"){ color_selection.current_color } ok_button.signal_connect("clicked"){ puts color_selection.current_color destroy } cancel_button.signal_connect("clicked"){destroy} end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/menu.rb���������������������������������������������������0000644�0001750�0001750�00000003376�11701304107�017716� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header menu.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: menu.rb,v 1.6 2005/07/18 17:13:32 mutoh Exp $ =end require 'sample' class MenuSample < SampleWindow def initialize super("menus") signal_connect("delete_event") do true end box = Gtk::VBox.new(false, 10) add(box) menubar = Gtk::MenuBar.new box.pack_start(menubar, false, true, 0) menu = create_menu(2, true) menuitem = Gtk::MenuItem.new("test\nline2") menuitem.set_submenu(menu) menubar.append(menuitem) menuitem = Gtk::MenuItem.new("foo") menuitem.set_submenu(create_menu(3, true)) menubar.append(menuitem) menuitem = Gtk::MenuItem.new("bar") menuitem.set_submenu(create_menu(4, true)) menuitem.right_justified = true menubar.append(menuitem) optionmenu = Gtk::OptionMenu.new optionmenu.set_menu(create_menu(1, false)) optionmenu.history = 4 box.add(optionmenu) box.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} box.add(button) button.set_flags(Gtk::Widget::CAN_DEFAULT) button.grab_default end private def create_menu(depth, tearoff) return nil if depth < 1 menu = Gtk::Menu.new group = nil if tearoff then menuitem = Gtk::TearoffMenuItem.new menu.append(menuitem) end for i in 0..4 j = i + 1 buf = sprintf("item %2d - %d", depth, j) menuitem = Gtk::RadioMenuItem.new(group, buf) group = menuitem.group menu.append(menuitem) menuitem.set_sensitive(false) if i == 3 submenu = create_menu(depth - 1, true) menuitem.set_submenu(submenu) unless submenu.nil? end menu end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/layout.rb�������������������������������������������������0000644�0001750�0001750�00000005202�11701304107�020255� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header layout.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: layout.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ Rewritten by Minoru Inachi <inachi@earth.interq.or.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class LayoutSample < SampleWindow def initialize super("Gtk::Layout") set_default_size(200, 200) scrolledwindow = Gtk::ScrolledWindow.new add(scrolledwindow) @layout = Gtk::Layout.new(nil, nil) scrolledwindow.add(@layout) # We set step sizes here since GtkLayout does not set # them itself. @layout.hadjustment.step_increment = 10.0 @layout.vadjustment.step_increment = 10.0 @layout.set_events(Gdk::Event::EXPOSURE_MASK) @layout.signal_connect("expose_event") do | w, event | layout_expose_handler(event) end @layout.set_size(1600, 128000) for i in 0..15 do for j in 0..15 do buf = "Button #{i}, #{j}" if ((i + j) % 2) != 0 then button = Gtk::Button.new(buf) else button = Gtk::Label.new(buf) end @layout.put(button, j*100, i*100) button.show end end for i in 16..1279 do buf = "Button #{i}, 0" if (i % 2) != 0 then button = Gtk::Button.new(buf) else button = Gtk::Label.new(buf) end @layout.put(button, 0, i * 100) end end private def layout_expose_handler(event) imin = (event.area.x) / 10 imax = (event.area.x + event.area.width + 9) / 10 jmin = (event.area.y) / 10 jmax = (event.area.y + event.area.height + 9) / 10 for i in imin..imax-1 do for j in jmin..jmax-1 do if ((i+j) % 2) != 0 then @layout.bin_window.draw_rectangle( @layout.style.black_gc, true, 10 * i, 10 * j, 1 + i % 10, 1 + j % 10) end end end false end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/entry.rb��������������������������������������������������0000644�0001750�0001750�00000003270�11701304107�020104� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header entry.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002,2003 Ruby-GNOME2 Project Team $Id: entry.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ =end require 'sample' class EntrySample < SampleWindow def initialize cbitems = [ "item0", "item1 item1", "item2 item2 item2", "item3 item3 item3 item3", "item4 item4 item4 item4 item4", "item5 item5 item5 item5 item5 item5", "item6 item6 item6 item6 item6", "item7 item7 item7 item7", "item8 item8 item8", "item9 item9" ] super("entry") box = Gtk::VBox.new(false, 5) add(box) entry = Gtk::Entry.new entry.text = "hello world" entry.select_region(0, 5) box.add(entry) cb = Gtk::Combo.new cb.set_popdown_strings(cbitems) cb.entry.text = "hello world" cb.entry.select_region(0, -1) box.add(cb) editable_check = Gtk::CheckButton.new("Editable") box.add(editable_check) editable_check.signal_connect("toggled"){ entry.editable = editable_check.active? } editable_check.active = true visible_check = Gtk::CheckButton.new("Visible") box.add(visible_check) visible_check.signal_connect("toggled"){ entry.visibility = visible_check.active? } visible_check.active = true sensitive_check = Gtk::CheckButton.new("Sensitive") box.add(sensitive_check) sensitive_check.signal_connect("toggled"){ entry.sensitive = sensitive_check.active? } sensitive_check.active = true box.pack_start(Gtk::HSeparator.new, false, true, 5) button = Gtk::Button.new("close") button.signal_connect("clicked"){ destroy } box.add(button) end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/savedposition.rb������������������������������������������0000644�0001750�0001750�00000004265�11701304107�021637� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin savedposition.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: savedposition.rb,v 1.7 2005/07/21 17:47:19 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class SavedPositionSample < SampleWindow Pos = [ 0, 0 ] def initialize super("Saved Position") move(Pos[0], Pos[1]) set_default_size(200, 100) set_border_width = 5 vbox = Gtk::VBox.new add(vbox) hbox1 = Gtk::HBox.new hbox1.border_width = 5 vbox.add(hbox1) label = Gtk::Label.new("X Origin : ") label.set_alignment(0, 0.5) hbox1.add(label) x_label = Gtk::Label.new("") hbox1.add(x_label) hbox2 = Gtk::HBox.new hbox2.set_border_width(5) vbox.add(hbox2) label = Gtk::Label.new("Y Origin : ") label.set_alignment(0, 0.5) hbox2.add(label) y_label = Gtk::Label.new("") hbox2.add(y_label) signal_connect("configure_event") do x, y = window.root_origin Pos[0] = x Pos[1] = y x_label.text = x.to_s y_label.text = y.to_s false end vbox.pack_start(Gtk::HSeparator.new, false, true, 10) button = Gtk::Button.new("Close") button.signal_connect("clicked"){destroy} vbox.add(button) button.can_default = true button.grab_default end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/Modeller.xpm����������������������������������������������0000644�0001750�0001750�00000007557�11701304107�020723� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char * InterfaceModeller_app_2_Tile_xpm[] = { "48 48 66 1", " c None", ". c #86174D344103", "X c #69A651445144", "o c #8617410330C2", "O c #69A6410338E3", "+ c #30C218611861", "@ c #AEBA6DB66185", "# c #71C638E328A2", "$ c #69A634D328A2", "% c #30C228A228A2", "& c #79E73CF330C2", "* c #BEFB9E799E79", "= c #8E3869A66185", "- c #514424921861", "; c #A699A289B6DA", ": c #A6999E79A699", "> c #71C65D756185", ", c #9E799A69A699", "< c #8E3882078E38", "1 c #861779E78617", "2 c #A6999A69AEBA", "3 c #8E388A289658", "4 c #71C675D679E7", "5 c #96588A289E79", "6 c #30C230C238E3", "7 c #C71BC71BC71B", "8 c #9E79A289AEBA", "9 c #AEBAAAAABEFB", "0 c #96589248A699", "q c #A699AAAAB6DA", "w c #AEBAAAAAB6DA", "e c #D75CD34CD75C", "r c #EFBEE79DEFBE", "t c #BEFBB6DABEFB", "y c #B6DABAEAC71B", "u c #AEBAAEBAB6DA", "i c #E79DDB6CDF7D", "p c #96588E389658", "a c #596559656185", "s c #AEBA8E388E38", "d c #CF3CCB2BCF3C", "f c #9E799A699E79", "g c #86177DF78E38", "h c #69A6659571C6", "j c #AEBAAEBABEFB", "k c #96589E799E79", "l c #B6DAA699A699", "z c #E79DC71BC71B", "x c #B6DAB6DAB6DA", "c c #861786179658", "v c #B6DAB2CABEFB", "b c #BEFBAAAAAEBA", "n c #C71BBEFBC71B", "m c #514441034103", "M c #41033CF34103", "N c #492428A228A2", "B c #AEBAA289B6DA", "V c #618530C22081", "C c #69A630C228A2", "Z c #69A630C22081", "A c #596528A22081", "S c #492428A22081", "D c #618528A22081", "F c #596520811861", "G c #69A628A22081", "H c #FFFF14514103", " .X ", " .oO+ ", " @.o#++ ", " @.o$%+ ", " @.&#++ ", " @.o#++ ", " @.o$++ ", " @.&#++ ", " .O#++ ", " *=-$++ ", " ;:>+++ ", " ;,<1% ", " 2,34 ", " 2;,51 ", " 2,,,,6 ", " 7777 28888,6 ", " 77777777 2829,,,06 ", " 9qwwe7rrrrr77rr 828,9tyt,6 ", " uuwriirrieiiieii77pa< 82,8,,,8,06 ", " s=1ttiieeeeded77eufgh>j,8,8,k,0,6 ", " =@lzieeeeee77eeex:fpcg4>9,,,,qjv6 ", " =O=blt7eeee7deenw:ffp<gha:t979;06 ", " =OO@=@zieeee7ex:::fffff0,v72444h6 ", " =OOo&Osst7iee7wkf:f:ff;t721444ham ", " =#&&&&OO@di7eu:ff:fferiv114444hmMX ", " =O&&&..o.sdp33fff:errrii7cc1hhh6mmNX= ", " =O&&&@.o.@sberrrrrriiuxuxnB;44aMmVCO#OX ", " =O&&o@..o.zrrrie777nnxtuxx:x;n:>mV##&&O$mX ", " =O&&o....zrrieieuxunx7txx:nnfwpMmVZ#$ZZZVVN ", " =O&oooo.*rrde77ewxnxxtnw:f4M%M%+NA#$Z$ZZVmN> ", " =Oo&ooo@iree7inxn7nnuuff4h%M>m%S-AZ$CCZDZmSX ", " =O&o.o.@rrn7eulun7xxuwp4mm6ahM%--AZCCZDDDANX ", " =Ooooo.*rixenuwwn7nxupph%M>>h6mAADVVZVVDDANX ", " =O&o.o.zrexwwnwuxxnughX%mahhmMN-AZCCVVDDAAN> ", " *XOoo.*iin7n777xxxtphaM+ama>MSNFVCZZVVDAAAS> ", " 1O..izewxux7nuuux4%++%hha>%N-DDCZZVDAAAASX ", " 1.=ituu:uButnxxuX%>hh>M%++NADZZZVDADAA--X ", " :e7f::lnn7*ppnx6ahm6++mNN-ADCZVDDAAAA-SX ", " 7nupp:wxxg%MMau6%++NmmmADADVVVVVDAA---NX ", " 7uBgh1wwxg6h>m%:MmmVNAVDZVZCVZZDAAAAF-S+X ", " nfgaM%pnwhX6%mXb6$DVVZC$C#C$ZZDVAAA---+NX ", " 27a%MaM47:mN.OoolmODGZ####$$ZZVDDA-----SSX ", " 2gmg<m6p7wmmOo...O$GZ####$$CZVVDAAA----++X ", " qBcaM <gxgmXmo.@.o&$$##$$$CZZZDADA-A-++-NX ", " M6> paMa HX.@@@oZ$###$$CZVDDAAAA---SS+X ", " 43 p=&@@&&$##$CCCVVVAAA--+S+S+%X ", " k =o@.##$VVmmmNNNSSSSSS%XXXX ", " s>OSSNmN>>aaa177777 "}; �������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/toolbar.rb������������������������������������������������0000644�0001750�0001750�00000004771�11701304107�020414� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header toolbar.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Id: toolbar.rb,v 1.7 2005/07/21 17:47:19 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ToolbarSample < SampleWindow def initialize super("Toolbar test") toolbar = Gtk::Toolbar.new toolbar.append("Horizontal", "Horizontal toolbar layout", "Toolbar/Horizontal", Gtk::Image.new("test.xpm")){ toolbar.orientation = Gtk::ORIENTATION_HORIZONTAL } toolbar.append("Vertical", "Vertical toolbar layout", "Toolbar/Vertical", Gtk::Image.new("test.xpm")){ toolbar.orientation = Gtk::ORIENTATION_VERTICAL } toolbar.append_space toolbar.append("Icons", "Only show toolbar icons", "Toolbar/IconsOnly", Gtk::Image.new("test.xpm")){ toolbar.toolbar_style = Gtk::Toolbar::ICONS } toolbar.append("Text", "Only show toolbar text", "Toolbar/TextOnly", Gtk::Image.new("test.xpm")){ toolbar.toolbar_style = Gtk::Toolbar::TEXT } toolbar.append("Both", "Show toolbar icons and text", "Toolbar/Both", Gtk::Image.new("test.xpm")){ toolbar.toolbar_style = Gtk::Toolbar::BOTH } toolbar.append_space toolbar.append(Gtk::Entry.new, "This is an unusable Gtk::Entry ;)", "Hey don't click me!!!") toolbar.append_space toolbar.append("Enable", "Enable tooltips", nil, Gtk::Image.new("test.xpm")){ toolbar.tooltips = true } toolbar.append("Disable", "Disable tooltips", nil, Gtk::Image.new("test.xpm")){ toolbar.tooltips = false } add(toolbar) end end �������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/FilesQueue.xpm��������������������������������������������0000644�0001750�0001750�00000005503�11701304107�021214� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char * FilesQueue_xpm[] = { "44 31 64 1", " c None", ". c #E79DE38DDF7D", "X c #CF3CC71BCF3C", "o c #71C675D671C6", "O c #B6DAB2CAB6DA", "+ c #CF3CD34CCF3C", "@ c #DF7DE38DE79D", "# c #FFFFFBEEFFFF", "$ c #EFBEEFBEEFBE", "% c #DF7DDB6CDF7D", "& c #BEFBBAEAC71B", "* c #BEFBBAEABEFB", "= c #BEFBC30BC71B", "- c #71C66DB671C6", "; c #D75CD34CD75C", ": c #9E799A699E79", "> c #E79DE38DE79D", ", c #CF3CCB2BC71B", "< c #B6DAB2CABEFB", "1 c #BEFBBAEAB6DA", "2 c #B6DAB6DAB6DA", "3 c #618561856185", "4 c #C71BBAEABEFB", "5 c #AEBAAAAAAEBA", "6 c #965892488E38", "7 c #A699A699A699", "8 c #38E338E338E3", "9 c #F7DEF7DEF7DE", "0 c #E79DEFBEEFBE", "q c #DF7DE38DDF7D", "w c #C71BC71BC71B", "e c #C71BC30BBEFB", "r c #BEFBC30BBEFB", "t c #B6DAAAAAAEBA", "y c #410345144103", "u c #D75CDB6CD75C", "i c #C71BCB2BC71B", "p c #BEFBCB2BBEFB", "a c #9E79A289A699", "s c #86178E388E38", "d c #CF3CCF3CD75C", "f c #CF3CD75CCF3C", "g c #C71BC30BCF3C", "h c #28A22CB228A2", "j c #000000000000", "k c #D75CD34CDF7D", "l c #10400C300820", "z c #E79DEBADEFBE", "x c #DF7DDB6CD75C", "c c #514459655965", "v c #8617861779E7", "b c #DF7DD34CD75C", "n c #CF3CCB2BCF3C", "m c #618555555965", "M c #861786178617", "N c #30C234D330C2", "B c #EFBEEBADE79D", "V c #DF7DDB6CE79D", "C c #D75CE38DD75C", "Z c #514449245144", "A c #186120812081", "S c #79E77DF779E7", "D c #6185659569A6", "F c #9E7992489E79", " .XoOX+ ", " @#$%&*=-o;: ", " @>,=O<12*&:-<3X ", " >%&1*4*2*OO**56758790 ", " 9qX+we=r*&e<<<251t5555yu9 ", " $qu++;ipi=p*=p**2tOOO27a5s<- ", " #9udfXi;,gi&**4**4r*Ot5t55tehj ", " 0qku+u;+d,gg=*=r*&**&<255t<*yl1 ", " $$zq@%xk%uf;,w,i=i=e**r=12tO1=8cvj ", " $@%>.%.%%%xbkx,w+ni,wwrwe*4*1=;8mMNj ", " zz@Bz>>>V%%%C+u;;dfnnfwggi&=&X+yZsNll ", " af#9@B0>q>qqq>xk.;;;kfX+XnXw=g,fycMhhN5 ", " al5#9$$>qzBV.%x%%b;x+fnf+,X,iiqym6NAo-j ", " #roS%#$zz>>V%%xkk%f;;+df,XnwnVZD:8AS-j* ", " D-9Oy*9$Bz>q%qx%%u;x;;dknX+d>Zm:hhSDjr ", " a3o+>S3z#90@@z.%>qCC%uu;ff%@Zm:NhMoj= ", " wlvvo#:3599$>B>q>%%%%+f;fk$ymaalMvjr ", " 0.a--S49mct9$z@.qkkqC;xu%@Zm5AlvSj* ", " ohu%3:Z:9@y609q@@>..>Cx>$Zm5NhMvjr ", " -j797Zv5705y=#$0>>V.%>#Z378AMMj* ", " Zj9Xo-McBXDv%90.%%#9cc78AsMj* ", " 8hM#M-DSF96cvz0>z#c35Nhs6j1 ", " jl9#o63vx#-D###mmt8N66j* ", " 5jc@fZF3o%+ZFDm<8A6FjO ", " :j50sSay<$ss2Nh:FjO ", " 6880&SDMF.rNNFFj1 ", " 8jr#:SFScA6ajO ", " Alr$DSysajO ", " >jy#51:jO ", " %Dy*gjO ", " alla "}; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/testgtkrc�������������������������������������������������0000644�0001750�0001750�00000006216�11701304107�020356� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# pixmap_path "<dir 1>:<dir 2>:<dir 3>:..." # # include "rc-file" # # style <name> [= <name>] # { # <option> # } # # widget <widget_set> style <style_name> # widget_class <widget_class_set> style <style_name> # testgtkrc2 sets all the buttons in the main window to blue by default include "testgtkrc2" #include "/usr/local/share/themes/Pixmap/gtk/gtkrc" #include "/usr/local/share/themes/Redmond95/gtk/gtkrc" #include "/usr/local/share/themes/Metal/gtk/gtkrc" #include "/usr/local/share/themes/Notif/gtk/gtkrc" #include "/usr/local/share/themes/Default/gtk/gtkrc" #pixmap_path "." style "defaultfont" { # fontset = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*,*" font = "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*,*" } # common default class "GtkWidget" style "defaultfont" style "window" { # bg_pixmap[NORMAL] = "marble.xpm" } style "scale" { fg[NORMAL] = { 1.0, 0, 0 } bg_pixmap[NORMAL] = "<parent>" } style "button" = "default" { # fg[PRELIGHT] = { 1.0, 1.0, 1.0 } # bg[PRELIGHT] = { 0, 0, 0.75 } # bg[PRELIGHT] = { 0.75, 0, 0x00 } } style "toggle_button" = "button" { fg[NORMAL] = { 1.0, 0, 0 } fg[ACTIVE] = { 1.0, 0, 0 } # bg_pixmap[ACTIVE] = "check-y.xpm" # bg_pixmap[NORMAL] = "check-n.xpm" } style "text" { bg_pixmap[NORMAL] = "marble.xpm" text[NORMAL] = { 1.0, 1.0, 1.0 } fg[NORMAL] = { 1.0, 1.0, 1.0 } base[NORMAL] = { 0.0, 0.0, 0.0 } } style "slider" { fg[NORMAL] = { 1.0, 1.0, 1.0 } bg[NORMAL] = { 0.0, 0.0, 1.0 } bg[ACTIVE] = { 0.0 ,0.0, 0.5 } bg[PRELIGHT] = { 0.75 ,0.75, 1.0 } } style "ruler" { font = '-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*' } style "curve" { fg[NORMAL] = { 58000, 0, 0 } # red } style "red-bar" { bg[PRELIGHT] = { 0.95, .55, 0.55 } } # override testgtk2, introduce the green color in the button list style 'button_list' = 'button' { font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*" bg[PRELIGHT] = { 0, 0.75, 0x00 } } widget "main window.*GtkScrolledWindow.*GtkButton*" style "button_list" class "GtkScrollbar" style "red-bar" widget_class "GtkWindow" style "window" widget_class "GtkDialog" style "window" widget_class "GtkFileSelection" style "window" widget_class "*Gtk*Scale" style "scale" widget_class "*GtkCheckButton*" style "toggle_button" widget_class "*GtkRadioButton*" style "toggle_button" widget_class "*GtkButton*" style "button" widget_class "*Ruler" style "ruler" widget_class "*GtkText" style "text" widget "*GtkCurve" style "curve" binding "test1" { bind "<ctrl>1" { "debug-msg" ("jup!") } } binding "test2" { bind "<ctrl>1" { "debug-msg" ("hallo and") "debug-msg" ("huhu") } } # possible priorities are (in ascending order): # lowest # gtk (used by gtk for internal class bindings) # application (for hard coded bindings on application basis) # rc (used implicitel by rc files) # highest class "GtkCList" binding "test1" # implicit : rc #class "GtkWindow" binding : highest "test2" # override "rc" priority binding "clist-test" { bind "j" { "scroll-vertical" (step-backward, 0.0) } bind "k" { "scroll-vertical" (step-forward, 0.0) } } class "GtkCList" binding "clist-test" ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/testgtk.rb������������������������������������������������0000644�0001750�0001750�00000010615�11701304107�020431� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin header testgtk.rb - testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2006 Ruby-GNOME2 Project Team $Id: testgtk.rb,v 1.16 2006/06/17 13:18:12 mutoh Exp $ Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end $:.unshift(File.dirname(__FILE__)) require 'gtk3' require 'sample' require 'button' require 'checkbutton' require 'togglebutton' require 'radiobutton' require 'buttonbox' require 'toolbar' require 'statusbar' require 'reparent' require 'pixmap' require 'tooltips' require 'labels' require 'layout' require 'menu' require 'scrolledwindow' require 'entry' require 'spinbutton' require 'colorselect' require 'dialog' require 'range' require 'notebook' require 'shapedwindow' require 'wmhints' require 'progressbar' require 'savedposition' require 'filesel' require 'fontselection' # # Main Window # def create_main_window buttons = [ ["button box", ButtonBoxSample], ["buttons", ButtonSample], ["check buttons", CheckButtonSample], ["color selection", ColorSelectionSample], ["dialog", DialogSample], ["entry", EntrySample], ["file chooser", FileChooserSample], ["font selection", FontSelectionSample], ["labels", LabelSample], ["layout", LayoutSample], ["menus", MenuSample], ["notebook", NotebookSample], ["pixmap", PixmapSample], ["progress bar", ProgressBarSample], ["radio buttons", RadioButtonSample], ["range controls", RangeSample], ["reparent", ReparentSample], ["saved position", SavedPositionSample], ["scrolled windows", ScrolledWindowSample], ["shapes", ShapesSample], ["spinbutton", SpinButtonSample], ["statusbar", StatusbarSample], ["toggle buttons", ToggleButtonSample], ["toolbar", ToolbarSample], ["tooltips", TooltipsSample], ["WM hints", WMHintsSample], ] nbuttons = buttons.size window = Gtk::Window.new window.name = "main window" window.set_default_size(200, 400) window.move(20, 20) window.signal_connect("destroy"){Gtk.main_quit} box1 = Gtk::VBox.new(false, 0) window.add(box1) label = Gtk::Label.new("Gtk+ v#{Gtk::MAJOR_VERSION}.#{Gtk::MINOR_VERSION}.#{Gtk::MICRO_VERSION}") box1.pack_start(label, false, false, 0) label = Gtk::Label.new("Ruby/GTK3 v#{Gtk::BINDING_VERSION.join(".")}") box1.pack_start(label, false, false, 0) scrolled_window = Gtk::ScrolledWindow.new(nil, nil) scrolled_window.border_width = 10 scrolled_window.set_policy(:automatic, :automatic) # Gtk::PolicyType::AUTOMATIC box1.pack_start(scrolled_window, true, true, 0) box2 = Gtk::VBox.new(false, 0) box2.border_width = 10 scrolled_window.add_with_viewport(box2); box2.focus_vadjustment = scrolled_window.vadjustment buttons.each do |title, sample_class| button = Gtk::Button.new(title) unless sample_class.nil? button.signal_connect("clicked"){|obj| sample_class.invoke } else button.sensitive = false end box2.pack_start(button, true, true, 0) end box1.pack_start(Gtk::HSeparator.new, false, true, 0) button = Gtk::Button.new("close") button.signal_connect("clicked") do window.destroy Gtk.main_quit end box1.pack_start(button, false, true, 5) window.show_all end def main srand Gtk::RC.parse("testgtkrc") create_main_window Gtk.main end if $DEBUG $stderr.sync = true Thread.start do loop do STDERR.print("+") GC.start sleep(1) end end $stderr.puts("#{$0}: started GC-thread for debugging.") # timeout Gtk.timeout_add(1000) do $stderr.print("*") true end end main puts("#{$0}: done.") �������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/spinbutton.rb���������������������������������������������0000644�0001750�0001750�00000012576�11701304107�021161� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header spinbutton.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: spinbutton.rb,v 1.7 2005/07/30 10:24:57 mutoh Exp $ Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class SpinButtonSample < SampleWindow def get_value(spin, label, data) if (data == 1) buf = sprintf("%d", spin.value_as_int) else buf = sprintf("%0.*f", spin.digits, spin.value) end label.text = buf end def initialize super("Gtk::SpinButton") main_vbox = Gtk::VBox.new(false, 5) main_vbox.set_border_width(10) add(main_vbox) frame = Gtk::Frame.new("Not accelerated") main_vbox.pack_start(frame, true, true, 0) vbox = Gtk::VBox.new(false, 0) vbox.set_border_width(5) frame.add(vbox) # Day, month, year spinners hbox = Gtk::HBox.new(false, 0) vbox.pack_start(hbox, true, true, 5) vbox2 = Gtk::VBox.new(false, 0) hbox.pack_start(vbox2, true, true, 5) label = Gtk::Label.new("Day :") label.set_alignment(0, 0.5) vbox2.pack_start(label, false, true, 0) adj = Gtk::Adjustment.new(1.0, 1.0, 31.0, 1.0, 5.0, 0.0) spinner = Gtk::SpinButton.new(adj, 0, 0) spinner.wrap = true vbox2.pack_start(spinner, false, true, 0) vbox2 = Gtk::VBox.new(false, 0) hbox.pack_start(vbox2, true, true, 5) label = Gtk::Label.new("Month :") label.set_alignment(0, 0.5) vbox2.pack_start(label, false, true, 0) adj = Gtk::Adjustment.new(1.0, 1.0, 12.0, 1.0, 5.0, 0.0) spinner = Gtk::SpinButton.new(adj, 0, 0) spinner.wrap = true vbox2.pack_start(spinner, false, true, 0) vbox2 = Gtk::VBox.new(false, 0) hbox.pack_start(vbox2, true, true, 5) label = Gtk::Label.new("Year :") label.set_alignment(0, 0.5) vbox2.pack_start(label, false, true, 0) adj = Gtk::Adjustment.new(1998.0, 0.0, 2100.0, 1.0, 100.0, 0.0) spinner = Gtk::SpinButton.new(adj, 0, 0) spinner.wrap = true spinner.set_size_request(55, -1) vbox2.pack_start(spinner, false, true, 0) frame = Gtk::Frame.new("Accelerated") main_vbox.pack_start(frame, true, true, 0) vbox = Gtk::VBox.new(false, 0) vbox.set_border_width(5) frame.add(vbox) hbox = Gtk::HBox.new(false, 0) vbox.pack_start(hbox, false, true, 5) vbox2 = Gtk::VBox.new(false, 0) hbox.pack_start(vbox2, true, true, 5) label = Gtk::Label.new("Value :") label.set_alignment(0, 0.5) vbox2.pack_start(label, false, true, 0) adj = Gtk::Adjustment.new(0.0, -10000.0, 10000.0, 0.5, 100.0, 0.0) spinner1 = Gtk::SpinButton.new(adj, 1.0, 2) spinner1.set_wrap(true) spinner1.set_size_request(100, -1) spinner1.set_update_policy(Gtk::SpinButton::UPDATE_ALWAYS) vbox2.pack_start(spinner1, false, true, 0) vbox2 = Gtk::VBox.new(false, 0) hbox.pack_start(vbox2, true, true, 5) label = Gtk::Label.new("Digits :") label.set_alignment(0, 0.5) vbox2.pack_start(label, false, true, 0) adj = Gtk::Adjustment.new(2, 1, 5, 1, 1, 0) spinner2 = Gtk::SpinButton.new(adj, 0.0, 0) spinner2.wrap = true adj.signal_connect("value_changed"){ spinner1.digits = spinner2.value_as_int } vbox2.pack_start(spinner2, false, true, 0) hbox = Gtk::HBox.new(false, 0) vbox.pack_start(hbox, false, true, 5) button = Gtk::CheckButton.new("Snap to 0.5-ticks") button.signal_connect("clicked"){ spinner1.snap_to_ticks = button.active? } vbox.pack_start(button, true, true, 0) button.set_active(true) button2 = Gtk::CheckButton.new("Numeric only input mode") button2.signal_connect("clicked"){ spinner1.numeric = button2.active? } vbox.pack_start(button2, true, true, 0) button2.active = true val_label = Gtk::Label.new("") hbox = Gtk::HBox.new(false, 0) vbox.pack_start(hbox, false, true, 5) button3 = Gtk::Button.new("Value as Int") button3.signal_connect("clicked"){get_value(spinner1, val_label, 1)} hbox.pack_start(button3, true, true, 5) button4 = Gtk::Button.new("Value as Float") button4.signal_connect("clicked"){get_value(spinner1, val_label, 2)} hbox.pack_start(button4, true, true, 5) vbox.pack_start(val_label, true, true, 0) val_label.text = "0" hbox = Gtk::HBox.new(false, 0) main_vbox.pack_start(hbox, false, true, 0) button5 = Gtk::Button.new("Close") button5.signal_connect("clicked"){destroy} hbox.pack_start(button5, true, true, 5) end end ����������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/testgtkrc2������������������������������������������������0000644�0001750�0001750�00000000670�11701304107�020436� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# pixmap_path "<dir 1>:<dir 2>:<dir 3>:..." # # include "rc-file" # # style <name> [= <name>] # { # <option> # } # # widget <widget_set> style <style_name> # widget_class <widget_class_set> style <style_name> # this file gets included from testgtkrc style 'main_buttons' = 'button' { font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*" bg[PRELIGHT] = { 0, 0, 0.75 } } widget "main window.*GtkButton*" style "main_buttons" ������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/sample.rb�������������������������������������������������0000644�0001750�0001750�00000002731�11701304107�020225� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header sample.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: sample.rb,v 1.9 2005/07/21 17:47:19 mutoh Exp $ =end require 'gtk3' module Sample def destroy super @destroyed = true end def destroyed? @destroyed end end module SampleClass def invoke @singleton = nil unless defined? @singleton @singleton = new if @singleton.nil? or @singleton.destroyed? unless @singleton.visible? @singleton.show_all else @singleton.destroy end end end class SampleWindow < Gtk::Window include Sample extend SampleClass def initialize(title) super(title) @destroyed = false signal_connect("destroy") do destroy end end end class SampleDialog < Gtk::Dialog include Sample extend SampleClass def initialize(title) super(:title => title) @destroyed = false signal_connect("destroy") do destroy end end end OptionMenuItem = Struct.new("OptionMenuItem", :name, :block) def build_option_menu(items, history) omenu = Gtk::OptionMenu.new menu = Gtk::Menu.new group = nil items.size.times do |i| menu_item = Gtk::RadioMenuItem.new(group, items[i].name) menu_item.signal_connect("activate") do |widget| items[i].block.call(widget) end group = menu_item.group menu.append(menu_item) menu_item.active = true if i == history menu_item.show end omenu.menu = menu omenu.history = history omenu end ���������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/radiobutton.rb��������������������������������������������0000644�0001750�0001750�00000003356�11701304107�021302� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header radiobutton.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/18 17:13:32 $ $Id: radiobutton.rb,v 1.7 2005/07/18 17:13:32 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class RadioButtonSample < SampleWindow def initialize super("radio buttons") set_border_width(10) vbox = Gtk::VBox.new(false, 10) add(vbox) button1 = Gtk::RadioButton.new("button1") vbox.add(button1) button2 = Gtk::RadioButton.new(button1, "button2") vbox.add(button2) button3 = Gtk::RadioButton.new(button1, "button3") vbox.add(button3) vbox.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, false, true) button.can_default = true button.grab_default end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/filesel.rb������������������������������������������������0000644�0001750�0001750�00000003753�11701304107�020374� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header filesel.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: filesel.rb,v 1.6 2005/07/17 16:55:27 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class FileChooserSample < Gtk::FileChooserDialog include Sample extend SampleClass def initialize super( :title => "file chooser dialog", :buttons => [ # TODO # [:cancel, :cancel], # Gtk::Stock::CANCEL, Gtk::Dialog::ResponseType::CANCEL # [:open, :accept], # Gtk::Stock::OPEN, Gtk::Dialog::ResponseType::ACCEPT [Gtk::Stock::CANCEL, Gtk::Dialog::ResponseType::CANCEL], [Gtk::Stock::OPEN, Gtk::Dialog::ResponseType::ACCEPT], ] ) @destroyed = false signal_connect("destroy") do destroy end signal_connect("response") do |widget, response_id| case response_id when Gtk::Dialog::ResponseType::ACCEPT # TODO puts filename destroy when Gtk::Dialog::ResponseType::CANCEL # TODO destroy end end set_window_position(:mouse) # Gtk::Window::Position::MOUSE end end ���������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/notebook.rb�����������������������������������������������0000644�0001750�0001750�00000016156�11701304107�020572� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header notebook.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: notebook.rb,v 1.11 2005/07/18 17:13:32 mutoh Exp $ Rewritten by TAKAHASHI Hitoshi <thitoshi@ne.scphys.kyoto-u.ac.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' $book_open_xpm = [ "16 16 4 1", " c None s None", ". c black", "X c #808080", "o c white", " ", " .. ", " .Xo. ... ", " .Xoo. ..oo. ", " .Xooo.Xooo... ", " .Xooo.oooo.X. ", " .Xooo.Xooo.X. ", " .Xooo.oooo.X. ", " .Xooo.Xooo.X. ", " .Xooo.oooo.X. ", " .Xoo.Xoo..X. ", " .Xo.o..ooX. ", " .X..XXXXX. ", " ..X....... ", " .. ", " " ] $book_closed_xpm = [ "16 16 6 1", " c None s None", ". c black", "X c red", "o c yellow", "O c #808080", "# c white", " ", " .. ", " ..XX. ", " ..XXXXX. ", " ..XXXXXXXX. ", ".ooXXXXXXXXX. ", "..ooXXXXXXXXX. ", ".X.ooXXXXXXXXX. ", ".XX.ooXXXXXX.. ", " .XX.ooXXX..#O ", " .XX.oo..##OO. ", " .XX..##OO.. ", " .X.#OO.. ", " ..O.. ", " .. ", " " ] class NotebookSample < SampleWindow def initialize super("notebook") vbox = Gtk::VBox.new(false, 0) add(vbox) @notebook = Gtk::Notebook.new @notebook.signal_connect("switch_page") do |widget, page, num_page| unless destroyed? page_switch(widget, page, num_page) end end @notebook.tab_pos = :top # Gtk::PositionType::TOP vbox.add(@notebook) @notebook.border_width = 10 @notebook.realize @book_open = Gdk::Pixbuf.new($book_open_xpm) @book_closed = Gdk::Pixbuf.new($book_closed_xpm) create_pages(1, 5) vbox.add(Gtk::HSeparator.new) cbutton1 = Gtk::CheckButton.new("popup menu") vbox.add(cbutton1) cbutton1.signal_connect("clicked"){ @notebook.enable_popup = cbutton1.active? } hbox = Gtk::HBox.new(false, 5) hbox.border_width = 10 vbox.pack_start(hbox, false, false, 0) label = Gtk::Label.new("Notebook Style :") hbox.add(label) =begin omenu = build_option_menu([ OptionMenuItem.new("Standard", proc { standard_notebook }), OptionMenuItem.new("No tabs", proc { notabs_notebook }), OptionMenuItem.new("Scrollable", proc { scrollable_notebook }) ], 0) hbox.add(omenu) =end button = Gtk::Button.new("Show all Pages") hbox.add(button) button.signal_connect('clicked'){ @notebook.each do |w| w.show end } hbox = Gtk::HBox.new(true, 10) hbox.set_border_width(10) vbox.pack_start(hbox, false, true, 0) button = Gtk::Button.new("prev") button.signal_connect("clicked"){ @notebook.prev_page } hbox.pack_start(button, true, true, 0) button = Gtk::Button.new("next") button.signal_connect("clicked"){ @notebook.next_page } hbox.pack_start(button, true, true, 0) button = Gtk::Button.new("rotate") button.signal_connect("clicked"){ @notebook.tab_pos = (@notebook.tab_pos.to_i + 1) % 4 } hbox.pack_start(button, true, true, 0) vbox.add(Gtk::HSeparator.new) button = Gtk::Button.new("close") button.signal_connect("clicked"){destroy} vbox.pack_start(button, false, false, 5) button.can_default = true button.grab_default end def standard_notebook @notebook.set_show_tabs(true) @notebook.set_scrollable(false) if @notebook.children.size == 15 10.times do @notebook.remove_page(5) end end end def notabs_notebook @notebook.set_show_tabs(false) if @notebook.children.size == 15 10.times do @notebook.remove_page(5) end end end def scrollable_notebook @notebook.set_show_tabs(true) @notebook.set_scrollable(true) if @notebook.children.size == 5 create_pages(6, 15) end end def create_pages(start_page, end_page) start_page.upto(end_page) do |i| buffer = "Page #{i}" child = Gtk::Frame.new(buffer) child.border_width = 10 vbox = Gtk::VBox.new(true, 0) vbox.border_width = 10 child.add(vbox) hbox = Gtk::HBox.new(true, 0) vbox.pack_start(hbox, false, true, 5) button1 = Gtk::CheckButton.new("Fill Tab") hbox.pack_start(button1, true, true, 5) button1.active = true button1.signal_connect('toggled'){ @notebook.child_set_property(child, :tab_fill, button1.active?) } button2 = Gtk::CheckButton.new("Expand Tab") hbox.pack_start(button2, true, true, 5) button2.signal_connect('toggled'){ @notebook.child_set_property(child, :tab_expand, button2.active?) } =begin button3 = Gtk::CheckButton.new("Pack end") hbox.pack_start(button3, true, true, 5) button3.signal_connect('toggled'){ expand, fill, pack = @notebook.query_tab_label_packing(child) @notebook.set_tab_label_packing(child, expand, fill, button3.active? ? :end : :start) } =end button = Gtk::Button.new("Hide Page") vbox.pack_end(button, false, false, 5) button.signal_connect('clicked'){ child.hide } child.show_all label_box = Gtk::HBox.new(false, 0) pixwid = Gtk::Image.new(@book_closed, @book_closed_mask) label_box.pack_start(pixwid, false, true, 0) pixwid.set_padding(3, 1) label = Gtk::Label.new(buffer) label_box.pack_start(label, false, true, 0) label_box.show_all menu_box = Gtk::HBox.new(false, 0) pixwid = Gtk::Image.new(@book_closed, @book_closed_mask) menu_box.pack_start(pixwid, false, true, 0) pixwid.set_padding(3, 1) label = Gtk::Label.new(buffer) menu_box.pack_start(label, false, true, 0) menu_box.show_all @notebook.append_page_menu(child, label_box, menu_box) end end def set_page_pixmaps(notebook, page_num, pix, mask) child = notebook.get_nth_page(page_num) label = notebook.get_tab_label(child).children[0].set(pix, mask) end def page_switch(notebook, page, page_num) old_page_num = notebook.page return if (page_num == old_page_num) set_page_pixmaps(notebook, page_num, @book_open, @book_open_mask) if (old_page_num != -1) set_page_pixmaps(notebook, old_page_num, @book_closed, @book_closed_mask) end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/buttonbox.rb����������������������������������������������0000644�0001750�0001750�00000005540�11701304107�020771� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header buttonbox.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: buttonbox.rb,v 1.6 2005/07/17 16:55:26 mutoh Exp $ Rewritten by Minoru Inachi <inachi@earth.interq.or.jp> Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class ButtonBoxSample < SampleWindow def initialize super("Button Boxes") signal_connect("destroy"){destroy} set_border_width(10) main_vbox = Gtk::VBox.new add(main_vbox) frame_horz = Gtk::Frame.new("Horizontal Button Boxes") main_vbox.pack_start(frame_horz, true, true, 10) vbox = Gtk::VBox.new vbox.border_width = 10 frame_horz.add(vbox) vbox.pack_start(create_bbox(true, "Spread", 40, :spread)) # Gtk::ButtonBox::Style::SPREAD vbox.pack_start(create_bbox(true, "Edge", 40, :edge), true, true, 5) # Gtk::ButtonBox::Style::EDGE vbox.pack_start(create_bbox(true, "Start", 40, :start), true, true, 5) # Gtk::ButtonBox::Style::START vbox.pack_start(create_bbox(true, "End", 40, :end), true, true, 5) # Gtk::ButtonBox::Style::END frame_vert = Gtk::Frame.new("Vertical Button Boxes") main_vbox.pack_start(frame_vert, true, true, 10) hbox = Gtk::HBox.new hbox.border_width = 10 frame_vert.add(hbox) hbox.pack_start(create_bbox(false, "Spread", 30, :spread)) hbox.pack_start(create_bbox(false, "Edge", 30, :edge), true, true, 5) hbox.pack_start(create_bbox(false, "Start", 30, :start), true, true, 5) hbox.pack_start(create_bbox(false, "End", 30, :end), true, true, 5) end def create_bbox(horizontal, title, spacing, layout) frame = Gtk::Frame.new(title) if horizontal then bbox = Gtk::HButtonBox.new else bbox = Gtk::VButtonBox.new end bbox.border_width = 5 frame.add(bbox) bbox.set_layout_style(layout) bbox.set_spacing(spacing) button = Gtk::Button.new("OK") bbox.add(button) button = Gtk::Button.new("Cancel") bbox.add(button) button = Gtk::Button.new("Help") bbox.add(button) frame end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/tooltips.rb�����������������������������������������������0000644�0001750�0001750�00000002162�11701304107�020617� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin tooltips.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team $Id: tooltips.rb,v 1.6 2005/07/21 17:47:19 mutoh Exp $ =end require 'sample' class TooltipsSample < SampleWindow def initialize super("Tooltips") set_default_size(200, -1) set_border_width(5) tooltips = Gtk::Tooltips.new button = Gtk::ToggleButton.new("button1") tooltips.set_tip(button,"This is button 1", "ContextHelp/buttons/1") button2 = Gtk::ToggleButton.new("button2") tooltips.set_tip(button2, "This is button 2. This is also a really long tooltip which probably won't fit on a single line and will therefore need to be wrapped. Hopefully the wrapping will work correctly.", "ContextHelp/buttons/2_long") vbox = Gtk::VBox.new(false, 10) vbox.add(button) vbox.add(button2) vbox.add(Gtk::HSeparator.new) button4 = Gtk::Button.new("close") button4.signal_connect("clicked"){destroy} vbox.pack_start(button4) tooltips.set_tip(button4, "Push this button to close window", "ContextHelp/buttons/Close") add(vbox) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/statusbar.rb����������������������������������������������0000644�0001750�0001750�00000005126�11701304107�020755� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin header statusbar.rb - a part of testgtk.c rewritten in Ruby/GTK2 Copyright (C) 2002-2005 Ruby-GNOME2 Project Team Rewritten by Hiroshi IGARASHI <igarashi@ueda.info.waseda.ac.jp> $Date: 2005/07/21 17:47:19 $ $Id: statusbar.rb,v 1.6 2005/07/21 17:47:19 mutoh Exp $ Original Copyright: GTK - The GIMP Toolkit Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =end require 'sample' class StatusbarSample < SampleWindow def initialize super("statusbar") set_border_width(5) @counter = 1 vbox = Gtk::VBox.new(false, 5) add(vbox) statusbar = Gtk::Statusbar.new vbox.pack_end(statusbar, true, true, 0) statusbar.signal_connect("text_popped"){|o, mid, text| @counter = 1 if text puts "poped" } statusbar.signal_connect("text_pushed"){|o, mid, text| # do nothing... as of gtk 1.2.6 puts "pushed" } button_push = Gtk::Button.new("push something") vbox.add(button_push) button_push.signal_connect("clicked"){ @counter += 1 statusbar.push(1, "something #{@counter}") } button_pop = Gtk::Button.new("pop") vbox.add(button_pop) button_pop.signal_connect("clicked"){ statusbar.pop(1) } button_steal = Gtk::Button.new("steal #4") vbox.add(button_steal) button_steal.signal_connect("clicked"){ statusbar.remove(1, 4) } button_context = Gtk::Button.new("test contexts") vbox.add(button_context) button_context.signal_connect("clicked"){ ["any context", "idle messages", "some text", "hit the mouse", "hit the mouse2"].each do |str| puts "Gtk::StatusBar: context=\"#{str}\", context_id=#{statusbar.get_context_id(str)}" end } vbox.add(Gtk::HSeparator.new) button_close = Gtk::Button.new("close") button_close.signal_connect("clicked"){destroy} vbox.add(button_close) end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/sample/testgtk/check-n.xpm�����������������������������������������������0000644�0001750�0001750�00000000533�11701304107�020453� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* XPM */ static char *openfile[] = { /* width height num_colors chars_per_pixel */ " 10 9 5 1", /* colors */ ". c None", "# c #000000", "y c #666666", "i c #ff1f00", "# c #9f9f9f", /* pixels */ "..........", "........yy", ".......yy.", "......yy..", ".yyy.yy...", "..yyyy....", "...yy.....", "..........", "..........", }; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/README.md����������������������������������������������������������������0000644�0001750�0001750�00000001075�12257552167�014752� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Ruby/GTK3 Ruby/GTK3 is a Ruby binding of GTK 3. ## Requirements * Ruby/GLib2, Ruby/ATK, Ruby/Pango, Ruby/GdkPixbuf2 and Ruby/GTK3 in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [rcairo](https://github.com/rcairo/rcairo) * [GTK+](http://www.gtk.org/) 3.4.2 or later ## Install gem install gtk3 ## License Copyright (c) 2002-2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ## Project Website http://ruby-gnome2.sourceforge.jp/ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/extconf.rb���������������������������������������������������������������0000644�0001750�0001750�00000002223�11701304107�015440� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "gtk3" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/Rakefile�����������������������������������������������������������������0000644�0001750�0001750�00000000752�12257553751�015141� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require 'gnome2/rake/package-task' package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/GTK3 is a Ruby binding of GTK+-3.x." package.description = "Ruby/GTK3 is a Ruby binding of GTK+-3.x." package.dependency.gem.runtime = [ "glib2", "gio2", "atk", "pango", "gdk_pixbuf2", "gdk3", ] package.windows.packages = [] package.windows.dependencies = [] end package_task.define ����������������������ruby-gnome2-all-2.1.0/gtk3/test/��������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552170�014441� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_accel_key.rb�����������������������������������������������0000644�0001750�0001750�00000001647�12124610262�020607� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkAccelKey < Test::Unit::TestCase def test_flags key = Gtk::AccelKey.new assert_equal(0, key.flags) end end �����������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_list_store.rb����������������������������������������������0000644�0001750�0001750�00000005251�12257552170�021064� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301 USA class TestGtkListStore < Test::Unit::TestCase include GtkTestUtils ID = 0 NAME = 1 COLUMNS = { ID => Integer, NAME => String, } def setup columns = COLUMNS.keys.sort.collect do |key| COLUMNS[key] end @store = Gtk::ListStore.new(*columns) end def test_set_values iter = @store.append assert_nothing_raised do @store.set_values(iter, [0, '1']) end assert_equal([0, '1'], [iter[0], iter[1]]) iter = @store.append assert_nothing_raised do @store.set_values(iter, [2, '3']) end assert_equal([2, '3'], [iter[0], iter[1]]) assert_nothing_raised do @store.set_values(iter, []) end assert_equal([2, '3'], [iter[0], iter[1]]) end def test_set_values_with_hash iter = @store.append assert_nothing_raised do @store.set_values(iter, {ID => 0, NAME => 'me'}) end assert_equal([0, 'me'], [iter[ID], iter[NAME]]) iter = @store.append assert_nothing_raised do @store.set_values(iter, {NAME => 'you', ID => 2}) end assert_equal([2, 'you'], [iter[ID], iter[NAME]]) assert_nothing_raised do @store.set_values(iter, {NAME => "she"}) end assert_equal([2, 'she'], [iter[ID], iter[NAME]]) assert_nothing_raised do @store.set_values(iter, {}) end assert_equal([2, 'she'], [iter[ID], iter[NAME]]) end def test_iter_gc n_iterators = count_objects(Gtk::TreeIter) 50.times do |i| iter = @store.append iter[ID] = i iter[NAME] = i.to_s end 100.times do @store.iter_first end iter = @store.iter_first while @store.remove(iter); end iter = nil assert_equal(0, @store.to_enum(:each).to_a.size) GC.start assert_equal(n_iterators, count_objects(Gtk::TreeIter)) end private def count_objects(klass) n_objects = ObjectSpace.each_object(Gtk::TreeIter) do # do nothing end n_objects end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_accel_group_entry.rb���������������������������������������0000644�0001750�0001750�00000001676�12124610262�022376� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkAccelGroupEntry < Test::Unit::TestCase def test_accel_path entry = Gtk::AccelGroupEntry.new assert_nil(entry.accel_path) end end ������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_unix_print.rb����������������������������������������������0000644�0001750�0001750�00000000623�11701304107�021056� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkUnixPrint < Test::Unit::TestCase def test_classes if GLib.os_unix? assertion = :assert_const_defined else assertion = :assert_not_const_defined end send(assertion, Gtk, :PageSetupUnixDialog) send(assertion, Gtk, :Printer) send(assertion, Gtk, :PrintCapabilities) send(assertion, Gtk, :PrintJob) send(assertion, Gtk, :PrintUnixDialog) end end �������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_widget.rb��������������������������������������������������0000644�0001750�0001750�00000001052�12257552170�020153� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkWidget < Test::Unit::TestCase include GtkTestUtils def setup @widget = Gtk::Invisible.new end def test_set_window attrs = Gdk::WindowAttr.new(100, 100, :input_only, :temp) window = Gdk::Window.new(nil, attrs, 0) @widget.window = window assert_equal(window, @widget.window) end def test_modify_color_component_with_nil_color assert_nothing_raised do @widget.override_color(:normal, nil) end assert_nothing_raised do @widget.override_background_color(:normal, nil) end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/gtk-test-utils.rb���������������������������������������������������0000644�0001750�0001750�00000000501�11701304107�017646� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������require 'tempfile' module GtkTestUtils private def only_gtk_version(major, minor, micro=nil) micro ||= 0 unless Gtk.check_version?(major, minor, micro) omit("Require GTK+ >= #{major}.#{minor}.#{micro}") end end def only_x11 omit("Only for X11 backend") unless Gdk.windowing_x11? end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_icon_theme.rb����������������������������������������������0000644�0001750�0001750�00000001323�12257552170�021003� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkIconTheme < Test::Unit::TestCase include GtkTestUtils def setup @theme = Gtk::IconTheme.default end def test_choose_icon assert_nil(@theme.choose_icon("non-existent", 100)) icon = @theme.choose_icon("face-cool", 10) assert_not_nil(icon) assert_match(/face-cool/, icon.filename) assert_not_nil(@theme.choose_icon("face-cool", 29, [:use_builtin, :no_svg])) end def test_contexts assert_operator(@theme.contexts, :include?, "MimeTypes") end class TestIcons < self def test_no_argument assert_operator(@theme.icons, :include?, "face-cool") end def test_context assert_operator(@theme.icons("Actions"), :include?, "find") end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_entry.rb���������������������������������������������������0000644�0001750�0001750�00000000667�12257552170�020044� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkEntry < Test::Unit::TestCase include GtkTestUtils def setup @entry = Gtk::Entry.new end def test_cursor_hadjustment assert_nil(@entry.cursor_hadjustment) adjustment = Gtk::Adjustment.new(0.0, 0.0, 100.0, 100.0, 1.0, 1.0) @entry.cursor_hadjustment = adjustment assert_equal(adjustment, @entry.cursor_hadjustment) end end �������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_recent_filter_info.rb��������������������������������������0000644�0001750�0001750�00000001762�12124610262�022526� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkRecentFilterInfo < Test::Unit::TestCase include GtkTestUtils def test_contains info = Gtk::RecentFilterInfo.new assert_equal(Gtk::RecentFilter::Flags.new, info.contains) end end ��������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_builder.rb�������������������������������������������������0000644�0001750�0001750�00000010000�12257552170�020307� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkBuilder < Test::Unit::TestCase include GtkTestUtils def test_constants assert_kind_of(Gtk::BuilderError, Gtk::BuilderError::INVALID_TAG) end def test_new assert_nothing_raised do Gtk::Builder.new end end def test_add_from_file builder = Gtk::Builder.new assert_nothing_raised do builder.add_from_file(ui_definition_file.path) end assert_kind_of(Gtk::Dialog, builder["dialog1"]) end def test_add_from_string builder = Gtk::Builder.new assert_nothing_raised do builder.add_from_string(ui_definition) end assert_kind_of(Gtk::Box, builder["vbox1"]) end def test_add_with_file builder = Gtk::Builder.new assert_nothing_raised do builder.add(ui_definition_file.path) end assert_kind_of(Gtk::ButtonBox, builder["hbuttonbox1"]) end def test_add_with_string builder = Gtk::Builder.new assert_nothing_raised do builder.add(ui_definition) end assert_kind_of(Gtk::Button, builder["ok_button"]) end def test_add_chain builder = Gtk::Builder.new assert_nothing_raised do builder << ui_definition_file.path << ui_definition_simple end assert_kind_of(Gtk::Dialog, builder["dialog1"]) assert_kind_of(Gtk::Window, builder["main-window"]) end def test_objects builder = Gtk::Builder.new assert_nothing_raised do builder << ui_definition_file.path << ui_definition_simple end assert_equal(["dialog1", "vbox1", "hbuttonbox1", "ok_button", "main-window"].sort, builder.objects.collect {|object| object.builder_name}.sort) end def test_translation_domain builder = Gtk::Builder.new assert_nil(builder.translation_domain) builder.translation_domain = "ruby-gnome2" assert_equal("ruby-gnome2", builder.translation_domain) end def test_connect_signals handler_names = [] builder = Gtk::Builder.new builder.connect_signals do |name| handler_names << name Proc.new {} end assert_equal([].sort, handler_names.sort) builder << ui_definition ok_button = builder["ok_button"] builder.connect_signals do |name| handler_names << name Proc.new {} end assert_equal(["ok_button_clicked"].sort, handler_names.sort) end def test_connect_signals_with_no_signal_ui_definition handler_names = [] builder = Gtk::Builder.new builder.connect_signals do |name| handler_names << name Proc.new {} end assert_equal([].sort, handler_names.sort) builder << ui_definition_simple builder.connect_signals do |name| handler_names << name Proc.new {} end assert_equal([].sort, handler_names.sort) end def test_get_type_from_name builder = Gtk::Builder.new assert_nil(builder.get_type("XXX")) assert_equal(Gtk::Box, builder.get_type("GtkBox")) end private def ui_definition <<-EOX <interface> <object class="GtkDialog" id="dialog1"> <child internal-child="vbox"> <object class="GtkVBox" id="vbox1"> <property name="border-width">10</property> <child internal-child="action_area"> <object class="GtkHButtonBox" id="hbuttonbox1"> <property name="border-width">20</property> <child> <object class="GtkButton" id="ok_button"> <property name="label">gtk-ok</property> <property name="use-stock">TRUE</property> <signal name="clicked" handler="ok_button_clicked"/> </object> </child> </object> </child> </object> </child> </object> </interface> EOX end def ui_definition_simple <<-EOX <interface> <object class="GtkWindow" id="main-window"> </object> </interface> EOX end def ui_definition_with_signal <<-EOX <interface> <object class="GtkWindow" id="main-window"> </object> </interface> EOX end def ui_definition_file xml = Tempfile.new("Gtk::Builder") xml.print(ui_definition) xml.close xml end end ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_recent_data.rb���������������������������������������������0000644�0001750�0001750�00000001660�12124610262�021134� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkRecentData < Test::Unit::TestCase def test_mime_type data = Gtk::RecentData.new assert_nil(data.mime_type) end end ��������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_container.rb�����������������������������������������������0000644�0001750�0001750�00000002141�12257552170�020652� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkContainer < Test::Unit::TestCase class TestFocusChain < self def setup @container = Gtk::Layout.new end def test_set_explicitly @container.focus_chain = [] assert_equal([], @container.focus_chain) end def test_not_set_explicitly assert_nil(@container.focus_chain) end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_buildable.rb�����������������������������������������������0000644�0001750�0001750�00000002445�12257552170�020622� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkBuildable < Test::Unit::TestCase include GtkTestUtils def setup @buildable = Gtk::Box.new(:horizontal) end def test_name assert_equal("", @buildable.name) @buildable.name = "YYY" assert_equal("YYY", @buildable.name) @buildable.name = nil assert_equal("", @buildable.name) end def test_add_child assert_equal([], @buildable.children) builder = Gtk::Builder.new entry = Gtk::Entry.new @buildable.add_child(builder, entry) assert_equal([entry], @buildable.children) end def test_set_buildable_property assert_nil(@buildable.parent) builder = Gtk::Builder.new parent = Gtk::Box.new(:horizontal) @buildable.set_buildable_property(builder, "parent", parent) assert_equal(parent, @buildable.parent) end def test_construct_child assert_nil(@buildable.parent) @buildable = Gtk::UIManager.new @buildable.add_ui(<<-EOU) <ui> <toolbar name='Toolbar'> </toolbar> </ui> EOU builder = Gtk::Builder.new assert_kind_of(Gtk::Toolbar, @buildable.construct_child(builder, "Toolbar")) end def test_get_internal_child assert_nil(@buildable.parent) @buildable = Gtk::Dialog.new builder = Gtk::Builder.new assert_kind_of(Gtk::Box, @buildable.get_internal_child(builder, "vbox")) end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_about_dialog.rb��������������������������������������������0000644�0001750�0001750�00000000467�12257552170�021332� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkAboutDialog < Test::Unit::TestCase include GtkTestUtils def setup @dialog = Gtk::AboutDialog.new end def test_program_name assert_equal(File.basename($0), @dialog.program_name) @dialog.program_name = "my-program" assert_equal("my-program", @dialog.program_name) end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk.rb���������������������������������������������������������0000644�0001750�0001750�00000001621�12257552170�016612� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtk < Test::Unit::TestCase include GtkTestUtils def test_show_uri assert_true(Gtk.respond_to?(:show_uri)) end end ���������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gc.rb����������������������������������������������������������0000644�0001750�0001750�00000000734�12257552170�016422� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGC < Test::Unit::TestCase priority :must def test_closure 10.times do invisible = Gtk::Invisible.new invisible.signal_connect("destroy") {} GC.start end end def test_inheritance_and_gc button = Class.new(Gtk::Button) box = Gtk::Box.new(:horizontal) n = 10 n.times do box.add(button.new) end GC.start assert_equal([button] * 10, box.children.collect {|item| item.class}) end end ������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_style_properties.rb����������������������������������������0000644�0001750�0001750�00000002475�12257552170�022316� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkStyleProperties < Test::Unit::TestCase def setup @properties = Gtk::StyleProperties.new end class TestGet < self def test_eixstent key = "border-radius" state = :normal value = 29 g_value = GLib::Value.new(GLib::Type::INT, value) # TODO: support direct Ruby object use @properties.set_property(key, state, g_value) assert_equal(value, @properties.get_property(key, state)) end def test_noneixstent assert_nil(@properties.get_property("nonexistent", :normal)) end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/run-test.rb���������������������������������������������������������0000755�0001750�0001750�00000003427�12124610262�016546� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") atk_base = File.join(ruby_gnome2_base, "atk") pango_base = File.join(ruby_gnome2_base, "pango") gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2") gdk3_base = File.join(ruby_gnome2_base, "gdk3") gtk3_base = File.join(ruby_gnome2_base, "gtk3") [[glib_base, "glib2"], [atk_base, "atk"], [pango_base, "pango"], [gdk_pixbuf_base, "gdk_pixbuf2"], [gdk3_base, "gdk3"], [gtk3_base, "gtk3"]].each do |target, module_name| if system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require 'glib-test-init' $LOAD_PATH.unshift(File.join(gtk3_base, "test")) require 'gtk-test-utils' require 'gtk3' exit Test::Unit::AutoRunner.run(true) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_image.rb���������������������������������������������������0000644�0001750�0001750�00000000324�12257552170�017753� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkImage < Test::Unit::TestCase include GtkTestUtils def test_stock image = Gtk::Image.new(Gtk::Stock::GO_FORWARD, :dialog) assert_equal(Gtk::Stock::GO_FORWARD.to_s, image.stock) end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_style_context.rb�������������������������������������������0000644�0001750�0001750�00000002067�12257552170�021603� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkStyleContext < Test::Unit::TestCase include GtkTestUtils def setup @style_context = Gtk::StyleContext.new end def test_add_provider provider = Gtk::CssProvider.new assert_nothing_raised do @style_context.add_provider(provider, GLib::MAXUINT) end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_allocation.rb����������������������������������������������0000644�0001750�0001750�00000001711�12124610262�021005� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkAllocation < Test::Unit::TestCase def test_width allocation = Gtk::Allocation.new(0, 10, 20, 30) assert_equal(20, allocation.width) end end �������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_menu_item.rb�����������������������������������������������0000644�0001750�0001750�00000000435�11701304107�020642� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkMenuItem < Test::Unit::TestCase include GtkTestUtils def test_new_with_label item = Gtk::MenuItem.new("Label") assert_equal("Label", item.label) end def test_new_with_nil_label item = Gtk::MenuItem.new(nil) assert_equal("", item.label) end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_tree_path.rb�����������������������������������������������0000644�0001750�0001750�00000000763�11701304107�020637� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestGtkTreePath < Test::Unit::TestCase include GtkTestUtils def test_compare assert_equal(-1, tree_path("0") <=> tree_path("1")) assert_equal(0, tree_path("0") <=> tree_path("0")) assert_equal(1, tree_path("1") <=> tree_path("0")) end def test_equal assert_equal(tree_path("0"), tree_path("0")) assert_not_equal(tree_path("0"), tree_path("1")) assert_not_equal(tree_path("0"), "0") end private def tree_path(path) Gtk::TreePath.new(path) end end �������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_border.rb��������������������������������������������������0000644�0001750�0001750�00000001670�12124610262�020141� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkBorder < Test::Unit::TestCase def test_left border = Gtk::Border.new(10, 15, 20, 25) assert_equal(10, border.left) end end ������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtk3/test/test_gtk_css_provider.rb��������������������������������������������0000644�0001750�0001750�00000001775�12257552170�021406� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGtkCssProvider < Test::Unit::TestCase include GtkTestUtils def setup @provider = Gtk::CssProvider.new end def test_load_from_data assert_true(@provider.load(:data => "GtkWindow {background-color: red;}")) end end ���ruby-gnome2-all-2.1.0/AUTHORS�����������������������������������������������������������������������0000644�0001750�0001750�00000007034�11701304107�013652� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������The Ruby-GNOME2 Project Team (in alphabetical order, M:Maintainer) ------------------------------------------------------------------------ Chikara Takamatsu <c_takamatu at ybb.ne.jp> Japanese Website, Website Guillaume Cottenceau <ggc at users.sourceforge.net> Ruby/GLib, Ruby/GTK, Website. Dario Linsky <dlinsky at web.de> German Website(M). Franz Burgmann <franz.burgmann at gmx.net> German Website, Website, Provides some binary packages. Hiroshi IGARASHI <iga at ruby-lang.org> rbbr, Technical advisor. Geoff Youngs <g at intersect-uk.co.uk> Ruby/GTK, Ruby/GdkPixbuf, Ruby/GtkSourceView, Ruby/Pango, Ruby/GLib. Ruby-GNOME2 Icon, Website. Joachim Glauche <jg at connection-net.de> Releases(M), since 0.17.0 Joao Pedrosa <joaopedrosa at yahoo.com> Portuguese-BR Website(M), Website, Ruby/GTK. Joshua Keith <joshuakeith at linuxmail.org> Tutorial, Website, Ruby-GNOME2 Icon. Junichiro Kita <kita at kitaj.no-ip.com> Ruby/GTK Tutorial(Japanese) (M) KATO Kazuyoshi <kzys at 8-p.info> Ruby/GTK(mainly gtk-demo), Ruby/GdkPixbuf, Ruby/GLib, Ruby/Libart. Kouhei Sutou <kou at cozmixng.org> Ruby/GnomePrint(M), Ruby/GnomePrintUI(M), Ruby/RSVG(M), Ruby/GdkPixbuf, Ruby/GnomeCanvas, Ruby/GTK, Ruby/Libart, Ruby/Pango, Ruby/GtkGLExt, Ruby/GLib. KUBO Takehiro <kubo at jiubao.org> Ruby/GNOME, Ruby/GnomeCanvas, Ruby/Libart, Ruby/GTK, Ruby/GLib. Laurent Sansonetti <lrz at gnome.org> Ruby/GStreamer(M), Ruby/Libgda(M), Ruby/GtkSourceView(M), Ruby/GLib, Ruby/GTK, French Website, Website, Tutorials. Malte Milatz <malte at gmx-topmail.de> German Website. Martin Povolný <xpovolny at fi.muni.cz> Ruby/GtkHtml2(M). Ruby/GTK, Masahiro Sakai <sakai at tom.sfc.keio.ac.jp> Ruby/GLib and almost of the important design of Ruby-GNOME2. Porting to Win32 platform. Masao Mutoh <mutoh at highway.ne.jp> Chief maintainer. Ruby/ATK(M), Ruby/GTK(M), Ruby/GdkPixbuf(M), Ruby/Libglade(M), Ruby/Pango(M), Ruby/PanelApplet(M), Ruby/rbbr(M), Website(M), Others. Project management. Matthew Berg <galt at gothpoodle.com> Ruby/GTK TreeView Tutorial(M), Website, Ruby/GTK. Mirko Maischberger <mirko at lilik.it> Ruby/GtkMozEmbed(M), Ruby/GTK, Ruby/Pango, Ruby/GdkPixbuf, Ruby/GNOME, Website. Nikolai :: lone-star :: Weibull <lone-star at home.se> Ruby/GConf, Ruby/GnomeVFS(M), Ruby/GTK. Nobuyoshi Nakada <nobu.nokada at softhome.net> Technical advisor. OGASAWARA, Takeshi <t-ogs at earth.email.ne.jp> Ruby/GTK. Pascal Terjan <pterjan at linuxfr.org> Ruby/GLib, Ruby/GTK, Ruby/GtkSourceView, Ruby/Pango, Ruby/GnomeVFS, Ruby/GConf. Sam Stephenson <sstephenson at gmail.com> Website. Sjoerd Simons <sjoerd at luon.net> Ruby/GLib, Ruby/GTK. TAMURA.Kenichi <sgs02516 at nifty.com> Ruby/GLib. Vincent Isambart <vincent.isambart at laposte.net> Ruby/GtkGLExt(M), Ruby/GnomeCanvas, Ruby/ATK, Ruby/Pango, Ruby/GLib, Ruby/GTK, Ruby/GtkHtml2, Ruby/Libart, Ruby/Libglade, French Website, Website. All members of Ruby-GNOME2 Mailing lists. And many others who have contributed patches, reported bugs. Thanks! ---------------------------------------- Ruby-GNOME Maintainers. (current) Kouhei Sutou <kou at cozmixng.org> (up to Ruby-GNOME2 ver. 0.16) Masao Mutoh <mutoh at highway.ne.jp> (up to Ruby-GNOME ver. 0.27) Neil Conway <neilconway at rogers.com> (up to Ruby-GNOME ver. 0.25) Hiroshi IGARASHI <iga at ruby-lang.org> (up to Ruby-GNOME ver. 0.18) by Dai.K. <MAP2303 at mapletown.net> charset = UTF-8. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665515�015067� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/patches/����������������������������������������������������������0000755�0001750�0001750�00000000000�12142464343�016503� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/patches/0001-actor-fix-clutter-win32.h-include-path.patch���������0000644�0001750�0001750�00000001521�12137115064�027213� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������From b692fd86471c8b3c5e0e92007b7b2d5cfd058af7 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou <kou@clear-code.com> Date: Sat, 13 Apr 2013 19:19:36 +0900 Subject: [PATCH] actor: fix clutter-win32.h include path It is installed under "clutter/win32/" directory. Other include paths were fixed in 9da7dd191dae7d1cc626ea22998145ebc2bb0722 but it was not fixed. --- clutter-gtk/gtk-clutter-actor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clutter-gtk/gtk-clutter-actor.c b/clutter-gtk/gtk-clutter-actor.c index f95caed..67d9cdd 100644 --- a/clutter-gtk/gtk-clutter-actor.c +++ b/clutter-gtk/gtk-clutter-actor.c @@ -59,7 +59,7 @@ #endif #ifdef CLUTTER_WINDOWING_WIN32 -#include <clutter/clutter-win32.h> +#include <clutter/win32/clutter-win32.h> #endif #ifdef GDK_WINDOWING_WIN32 #include <gdk/gdkwin32.h> -- 1.7.10.4 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/patches/0001-Use-no-undefined-ld-flag.patch�����������������������0000644�0001750�0001750�00000002627�12142464343�024522� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������From c42a07c632ef64d34e57723b5effd643ea0a7c86 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou <kou@clear-code.com> Date: Mon, 29 Apr 2013 18:08:59 +0900 Subject: [PATCH] Use -no-undefined ld flag It fixes DLL generation by cross compile. --- clutter-gtk/Makefile.am | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter-gtk/Makefile.am b/clutter-gtk/Makefile.am index 9a35919..3963ac0 100644 --- a/clutter-gtk/Makefile.am +++ b/clutter-gtk/Makefile.am @@ -47,7 +47,7 @@ source_h_private = \ libclutter_gtk_@CLUTTER_GTK_API_VERSION@_la_SOURCES = $(source_c) $(source_h) $(source_h_private) libclutter_gtk_@CLUTTER_GTK_API_VERSION@_la_LIBADD = $(CLUTTER_GTK_DEPS_LIBS) $(LIBM) libclutter_gtk_@CLUTTER_GTK_API_VERSION@_la_LDFLAGS = \ - $(CLUTTER_LT_LDFLAGS) \ + $(CLUTTER_GTK_LT_LDFLAGS) \ -export-symbols-regex "^gtk_clutter.*" cluttergtkheadersdir = $(includedir)/clutter-gtk-@CLUTTER_GTK_API_VERSION@/clutter-gtk diff --git a/configure.ac b/configure.ac index 7d381e2..8db163b 100644 --- a/configure.ac +++ b/configure.ac @@ -56,7 +56,7 @@ AC_MSG_CHECKING([if building for some Win32 platform]) AS_CASE([$host], [*-*-mingw*|*-*-cygwin*], [ - CLUTTER_LT_LDFLAGS="$CLUTTER_GTK_LT_LDFLAGS -no-undefined" + CLUTTER_GTK_LT_LDFLAGS="$CLUTTER_GTK_LT_LDFLAGS -no-undefined" platform_win32=yes ], -- 1.7.10.4 ���������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/COPYING.LIB�������������������������������������������������������0000644�0001750�0001750�00000063642�12077252561�016533� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/lib/��������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�015633� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/lib/clutter-gtk.rb������������������������������������������������0000644�0001750�0001750�00000004343�12257552167�020431� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" require "gtk3" base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) module ClutterGtk LOG_DOMAIN = "Clutter-Gtk" GLib::Log.set_log_domain(LOG_DOMAIN) class << self def const_missing(name) init() if const_defined?(name) const_get(name) else super end end def init(argv=[]) loader = Loader.new(self, argv) loader.load("GtkClutter") Clutter.init(argv) class << self remove_method(:init) remove_method(:const_missing) end end end class Loader < GObjectIntrospection::Loader class InitError < StandardError end def initialize(base_module, init_arguments) super(base_module) @init_arguments = init_arguments end private def pre_load(repository, namespace) init = repository.find(namespace, "init") arguments = [ 1 + @init_arguments.size, [$0] + @init_arguments, ] error, argc, argv = init.invoke(:arguments => arguments) @init_arguments.replace(argv) if error.to_i <= 0 raise InitError, "failed to initialize Clutter: #{error.name}" end end def post_load(repository, namespace) end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/sample/�����������������������������������������������������������0000755�0001750�0001750�00000000000�12147676243�016346� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/sample/events.rb��������������������������������������������������0000755�0001750�0001750�00000013742�12147676243�020211� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # clutter-gtk/examples/gtk-clutter-events.c. The image file used in # this sample code is copied from # clutter-gtk/examples/redhand.png. They are licensed under the terms # of the GNU Lesser General Public License, version 2.1 or (at your # option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter-gtk" require "gdk_pixbuf2" window = Gtk::Window.new window.title = "Gtk-Clutter Interaction demo" window.set_default_size(800, 600) window.resizable = false window.border_width = 12 window.signal_connect("destroy") do Gtk.main_quit end vbox = Gtk::Box.new(:vertical, 12) window.add(vbox) clutter_entry = nil gtk_entry = Gtk::Entry.new gtk_entry.text = "Enter some text" vbox.pack_start(gtk_entry, :expand => false, :fill => false, :padding => 0) gtk_entry.signal_connect("changed") do |editable| clutter_entry.text = editable.text end hbox = Gtk::Box.new(:horizontal, 12) vbox.pack_start(hbox, :expand => true, :fill => true, :padding => 0) # Set up clutter & create our stage clutter_embed = ClutterGtk::Embed.new hbox.pack_start(clutter_embed, :expand => true, :fill => true, :padding => 0) clutter_embed.grab_focus stage = clutter_embed.stage clutter_embed.set_size_request(640, 480) stage.signal_connect("captured-event") do |_stage, event| case event when Clutter::ButtonEvent puts("#{event.type.nick} captured at (#{event.x}, #{event.y})"); when Clutter::CrossingEvent if event.source == _stage and not event.related.nil? if event.type == Clutter::EventType::ENTER stage_action = "Entering" actor_action = "leaving" else stage_action = "Leaving" actor_action = "entering" end puts("#{stage_action} the stage and #{actor_action} '#{event.related.name}'") end when Clutter::KeyEvent if event.type == Clutter::EventType::KEY_PRESS format = "the stage got a key press: '%s' (symbol: %d, unicode: 0x%x)" unicode = [event.key_unicode].pack("U") puts(format % [unicode, event.key_symbol, event.key_unicode]) end end not Clutter::Event::STOP end clutter_embed.signal_connect("enter-notify-event") do |widget| puts("Entering widget '#{widget.class.name}'") false end clutter_embed.signal_connect("leave-notify-event") do |widget| puts("Leaving widget '#{widget.class.name}'") end # Create the main texture that the spin buttons manipulate pixbuf = Gdk::Pixbuf.new(File.expand_path("redhand.png", File.dirname(__FILE__))); hand = ClutterGtk::Texture.new hand.from_pixbuf = pixbuf stage.add_child(hand) hand.anchor_point_from_gravity = :center hand.set_position(stage.width / 2, stage.height / 2) hand.reactive = true hand.name = "Red Hand" hand.signal_connect("button-press-event") do |actor, event| puts("Button press on hand ('#{actor.class.name}')") not Clutter::Event::STOP end # Setup the clutter entry clutter_entry = Clutter::Text.new clutter_entry.color = Clutter::Color.new(:black) stage.add_child(clutter_entry) clutter_entry.set_position(0, 0) clutter_entry.set_size(500, 20) # Create our adjustment widgets vbox = Gtk::Box.new(:vertical, 6) hbox.pack_start(vbox, :expand => false, :fill => false, :padding => 0) box = Gtk::Box.new(:horizontal, 6) vbox.pack_start(box, :expand => false, :fill => true, :padding => 0) label = Gtk::Label.new("Rotate x-axis") box.pack_start(label, :expand => true, :fill => true, :padding => 0) button = Gtk::SpinButton.new(0, 360, 1) box.pack_start(button, :expand => true, :fill => true, :padding => 0) button.signal_connect("value-changed") do |_button| hand.set_rotation(:x_axis, _button.value, 0, hand.height / 2, 0) end box = Gtk::Box.new(:horizontal, 6) vbox.pack_start(box, :expand => false, :fill => true, :padding => 0) label = Gtk::Label.new("Rotate y-axis") box.pack_start(label, :expand => true, :fill => true, :padding => 0) button = Gtk::SpinButton.new(0, 360, 1) box.pack_start(button, :expand => true, :fill => true, :padding => 0) button.signal_connect("value-changed") do |_button| hand.set_rotation(:y_axis, _button.value, hand.width / 2, 0, 0) end box = Gtk::Box.new(:horizontal, 6) vbox.pack_start(box, :expand => false, :fill => true, :padding => 0) label = Gtk::Label.new("Rotate z-axis") box.pack_start(label, :expand => true, :fill => true, :padding => 0) button = Gtk::SpinButton.new(0, 360, 1) box.pack_start(button, :expand => true, :fill => true, :padding => 0) button.signal_connect("value-changed") do |_button| hand.set_rotation(:z_axis, _button.value, hand.width / 2, hand.height / 2, 0) end box = Gtk::Box.new(:horizontal, 6) vbox.pack_start(box, :expand => false, :fill => true, :padding => 0) label = Gtk::Label.new("Adjust opacity") box.pack_start(label, :expand => true, :fill => true, :padding => 0) button = Gtk::SpinButton.new(0, 255, 1) button.value = 255 box.pack_start(button, :expand => true, :fill => true, :padding => 0) button.signal_connect("value-changed") do |_button| hand.opacity = _button.value end window.show_all # Only show/show_all the stage after parent show. widget_show will call # show on the stage. stage.show Gtk.main ������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/sample/test.rb����������������������������������������������������0000755�0001750�0001750�00000010711�12147676243�017655� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of # clutter-gtk/examples/gtk-clutter-test.c. The image file used in # this sample code is copied from # clutter-gtk/examples/redhand.png. They are licensed under the terms # of the GNU Lesser General Public License, version 2.1 or (at your # option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter-gtk" require "gdk_pixbuf2" N_HANDS = 4 WINDOW_WIDTH = 400 WINDOW_HEIGHT = 400 RADIUS = 150 fade_p = false fullscreen_p = false pixbuf = Gdk::Pixbuf.new(File.expand_path("redhand.png", File.dirname(__FILE__))) window = Gtk::Window.new window.set_default_size(WINDOW_WIDTH, WINDOW_HEIGHT) window.title = "Clutter Embedding" window.signal_connect("destroy") do Gtk.main_quit end vbox = Gtk::Grid.new vbox.orientation = :vertical vbox.hexpand = true vbox.vexpand = true window.add(vbox) clutter = ClutterGtk::Embed.new vbox.add(clutter) stage = clutter.stage stage.background_color = Clutter::Color.new(:sky_blue_light) label = Gtk::Label.new("This is a label") vbox.add(label) label.hexpand = true button = Gtk::Button.new(:label => "This is a button...clicky") button.signal_connect("clicked") do |_button| fade_p = !fade_p end vbox.add(button) button.hexpand = true button = Gtk::Button.new(:label => "Fullscreen") button.image = Gtk::Image.new(:stock => Gtk::Stock::FULLSCREEN, :size => :button) button.signal_connect("clicked") do |_button| if fullscreen_p window.unfullscreen fullscreen_p = false else window.fullscreen fullscreen_p = true end end vbox.add(button) button.hexpand = true button = Gtk::Button.new(:stock_id => Gtk::Stock::QUIT) button.signal_connect("clicked") do |_button| _button.destroy end vbox.add(button) button.hexpand = true group = Clutter::Actor.new hands = [] N_HANDS.times do |i| if i.zero? hands[i] = ClutterGtk::Texture.new hands[i].set_from_pixbuf(pixbuf) else hands[i] = Clutter::Clone.new(hands[0]) end # Place around a circle w = hands[0].width h = hands[0].height x = WINDOW_WIDTH / 2 + RADIUS * Math.cos(i * Math::PI / (N_HANDS / 2)) - w / 2 y = WINDOW_HEIGHT / 2 + RADIUS * Math.sin(i * Math::PI / (N_HANDS / 2)) - h / 2 hands[i].set_position(x, y) # Add to our group group group.add_child(hands[i]) end # Add the group to the stage stage.add_child(group) constraint = Clutter::AlignConstraint.new(stage, :x_axis, 0.5) group.add_constraint(constraint) constraint = Clutter::AlignConstraint.new(stage, :y_axis, 0.5) group.add_constraint(constraint) stage.signal_connect("button-press-event") do |_stage, event| x, y = event.coords actor = _stage.get_actor_at_pos(:all, x, y) if actor.is_a?(ClutterGtk::Texture) or actor.is_a?(Clutter::Clone) actor.hide end Clutter::Event::STOP end stage.signal_connect("key-release-event") do |_stage, event| puts("*** key press event (key:#{[event.key_unicode].pack('U*')}) ***") case event.key_symbol when Clutter::Keys::KEY_q Gtk.main_quit when Clutter::Keys::KEY_r N_HANDS.times do |i| hands[i].show end end Clutter::Event::STOP end window.show_all # Create a timeline to manage animation timeline = Clutter::Timeline.new(6000) timeline.repeat_count = -1 # fire a callback for frame change timeline.signal_connect("new-frame") do |_timeline, msecs| rotation = _timeline.progress * 360.0 group.set_rotation(:z_axis, rotation, WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2, 0) N_HANDS.times do |i| hands[i].set_rotation(:z_axis, -(6.0 * rotation), hands[i].width / 2, hands[i].height / 2, 0) if fade_p hands[i].opacity = (255 - (rotation % 255)) end end end # and start it timeline.start Gtk.main �������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/sample/multistage.rb����������������������������������������������0000755�0001750�0001750�00000005123�12147676243�021055� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter-gtk/examples/gtk-clutter-multistage.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter-gtk" require "gdk_pixbuf2" window = Gtk::Window.new window.set_default_size(600, 400) window.title = "Multiple GtkClutterEmbed" window.signal_connect("destroy") do Gtk.main_quit end notebook = Gtk::Notebook.new window.add(notebook) clutter0 = ClutterGtk::Embed.new notebook.append_page(clutter0, Gtk::Label.new("One stage")) stage0 = clutter0.stage stage0.background_color = Clutter::Color.new(0xdd, 0xff, 0xdd, 0xff) vbox = Gtk::Box.new(:vertical, 6) notebook.append_page(vbox, Gtk::Label.new("Two stages")) clutter1 = ClutterGtk::Embed.new clutter1.set_size_request(320, 240) stage1 = clutter1.stage stage1.background_color = Clutter::Color.new(0xff, 0xff, 0xff, 0xff) texture1 = ClutterGtk::Texture.new texture1.set_from_stock(clutter1, Gtk::Stock::DIALOG_INFO.to_s, :dialog) texture1.set_anchor_point(texture1.width / 2, texture1.height / 2) texture1.set_position(160, 120) stage1.add_child(texture1) texture1.show vbox.add(clutter1) clutter2 = ClutterGtk::Embed.new clutter2.set_size_request(320, 120) stage2 = clutter2.stage stage2.background_color = Clutter::Color.new(0x00, 0x00, 0x00, 0xff) texture2 = ClutterGtk::Texture.new texture2.set_from_icon_name(clutter1, "user-info", :button) texture2.set_anchor_point(texture2.width / 2, texture2.height / 2) texture2.set_position(160, 60) stage2.add_child(texture2) vbox.add(clutter2) stage2.signal_connect("allocation-changed") do |actor, allocation, flags| texture2.set_position((allocation.x2 - allocation.x1) / 2, (allocation.y2 - allocation.y1) / 2) end window.show_all Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/sample/redhand.png������������������������������������������������0000644�0001750�0001750�00000020072�12077252561�020455� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���È���Õ���¿Û���bKGD�ÿ�ÿ�ÿ ½§“��� pHYs�� �� �šœ���tIMEÖ 3x<û,��ÇIDATxÚí]y|M×Ú~Ö>ÉÉ(£‘ ‰"HQŠV«>ý ·ÕQ)U´U:hÕÐÉPz鍿R®Jµu]½\×PBiÌBE’DDæ99ÓZß9½Ÿ«ÅÙûì³÷Öóûå—ÎÞk­w­g=ï»öZï888888888888888888888888œDé)¥þ„ø»ü,rU‰ú0ÆâøßÑH„¶#Ûœ#„TÙ‰mª!ç8A¬€Édò'„Œ „Ü` €(�ÂÝú@9€�cÉ‚ äÉ4ãŒ$„ p¿¹.w³ƒ ÀY�)Œ±ƒ‚ ü$“m"!EÚ†Èý½.�RT´ 3×ç €49mãô0™Lý)¥ëc&f=(cl+¥´¿T’RJ§RJ/›ße-JcŸPJ#¬°ÍV™êbo¶¹L)}—RêÏYpûÎß'“±ÿl0ì³t0˜;ÿ]ÆX³ Lf¢øsÛüeœ(4øVuþíCÄ]ãe¦ J)¥SïàºDØ¢mC)N)-µÛ¸6ø­³ÔØ?!êÇ Æ[±÷Ö“R:Ö†³´ÛüÝ^lã*äxE%ƒß<c~|Ó�8ÉÔÅes° Jé;jÛ†RúÎM*¦¶mNþn—XÅ¢”®%„L´“¶¬cŒu'„ô´ƒº”3Æ~&„<n†aŒm%„ d'¶¹_„óNMJéW„I<úâpf’Éñ.'‡"„ ”¶u:¡”'„$C…¯ðN‡“Œ±‡A¨r ‚˜L&?BH!$˜÷-‡LØJyÂ)\,BÈל2ãqÆØp‡WJé0BˆÕûl˜É„Ê3gP‘šŠÚK— //ƒ60>íÛ#°wo&&‚¸»+b�}i)JFuZ `¬«ƒÆË žaaðëÜÁýûÃ+<\‘º0£•§N¡<5uÙÙÐWT�@“m:t@PŸ>èÑÄÍM‘ú芋Qvèª~û ùù0Õ×Cãå¯ðpøué‚àþýáÙª•EeB:8:A.BÚK-ˆêõÈÛ¸¹«W£¡ �`ìv2Ï–-ÑvÂDNž ··M^›•…KK–àÆîÝ zýí 俆à¾}=s&ï¹Ç&u156âêúõ¸²v- ïl›°0D¾ðÚ¾ð4^^6©Oõ… ¸´x1J~þùζqwGóóöÛðOH°¶Ø±„$‡$¥t !d“ÔBJSRpaæLÔåäˆzγuktZ°�¡Ã†É:3æÍCþ¦Mwìü?J:l:/^ m°|^fñž=HŸ3õyâ6äz…‡£ÓÂ…h9t¨lu1ÖÖââ{ï¡à‡ÀŒFËm£Ñ ì±ÇÐiÑ"¸ûKþXn—*b)ANJý�weÝ:\üà0ƒAZÞ|Ño½ëÎt7nàÔøñ¨<uJò;¼£¢øÍ7ðµÒŸbÈY±™ ‚™L’m=c:LŸnµm pê¹çPýÛo’ßá‹ÄM›àé4*B, G<!$MÒ”°l2?üðö.ƒD½ü2âæÍ“kTTàסCE«ØŸÁ=0}wî„Oé^Ö_ÿŠËŸ.m^z qóçK~¾±¨G‡EãµkV×Å£E ôݽ[jܶ2ØÑV±ÆJröîEÖ¢E² ��È]½ß/m²6pvÒ$YÈ�†Š œ?†*iË÷×üQ6r�@îš5ÈO’6ñRg&L…¿ö§Æƒ©¾^ÊãI=c£AÌ{xÄ  ª*œ›6M²ëp;—äÂÛoKêÈܵkQzèìA~†„Y[WR‚óÓ§ËFŽÿØfÖ,Ô_Jùò_ âäIyƒüó瑵x±4—¦ét¥c„Rꠇؗæ,_Þ´|kƒÕž¬?GÖÊJd/]jã|÷j³²Ä ÈO?…±¶VöºP½Y}$z¶Ï]½Ú&¶¹º~}Ój¥x t‚BD“ÃPY‰+k×Ú¬Â×¶lAC~¾¨Eƒù{‚Ü`F#²¿øB”¯/Õ²Ôu«ÍÌ´|"[¹¦º:›Ô…êtÈþòK)&8 A�ˆ>ç|c×.©þ§Åƒ²pûv‹_øØÔ€E;wZÜÞëÉÉ¢––EÛ†R\ÛºÕâßÚÚ6ד“E-›ÑÑ¢ûÂÒ”›WÚÒ2òóQ—mÓº˜Pqâ„ÃÙ¦63º7lZCEªÎ‰Ï Äëê0Aºè�í›WºÆÂµz%ê"¦œ%l“žnÑâˆb¶9/éÈG°£DôRKca¡Í+­¯¨€©±Ñ.êbi9ŒR4Ù¼.T¯‡¾´ôîu–iY×^ú@-‚ˆþ<k´QÐ÷ׯ‚rl Iª‹œK»Vöb¶ihpj‚ˆïQ…%å0Jª ³»Xj;ê'—R—„#…êÌœœ Œ~ @¯óm‹!NM® \A¸‚pá „+W® \A¸‚pá „+W>sá „+W® \A¸‚páuvAáàpipËU],ÅLÃ],Æç¤sð +W¤sá „+W® \A¸‚pá Â„ÏÆ\A¸‚pá „+W® .¯ T¯‡©®NJ^Z® v†»]—ÊÄïÞÃÂX[ S}=¨Á�P ¢Ñ@ðô„›Í.Üä ¢.A¸‚X�}yùíïC©ª‚Ž+A8x Âc§›¸‚páà „ƒ+W® vBÇíJþò©hPèrW€SºXUgÎàø¨Q¸ºaƒKvêÉÑ£‘þÎ;w¾Š›»X®§ ׯãÜë¯ãè°a(;rÄeÂR½WÖ®Åáþý‘·q£MoÖuuqú3ƒ¹«Váð€(ؼÌ`à= @WR‚ßfÌÀ¯<‚ª3gx ⊠R›™‰ÔGÅÅ>€¡ªŠ³âÏ\ÎsçðëˆÈ^º”O®ƒ0JquÃ2Çóž¼›Û¥Ó!sáB{â Ô_¹Âc áæ¨O›2¥‡ÛEœA4h||àæë ÁÝÄÍ D£3ÁŒF˜›6264¨^ßò£Gqäá‡áÓ®Ÿ5d ˆÝÒ¿ôÐ!ÅËt „O»vhÖ©šuìïˆxµm Z-A�„¦[v)5™@u:˜ÐXXˆ†¼<Ô忢æâEÔ\¼ˆú+W@uÊmi4TV¢òôiƒ8³‚(Bˆ€�$&¢ùÀêÕ ¾11ÐøøˆRh4и»Cãé wx††" Gÿr ¨JKCù¯¿¢4%5éé|åÉAârë¤Ú  „<ôZ‰ >}àÖ¬™mÝ3A€68!ƒ!dÐ ÄÌž ]QŠ÷îÅõädT?îÐdá1ˆ€h4êÓáÏ>‹–C†Øœw#ŒgX"ÆCÄsÏ¡>?×¶lÁµ-[š‚kƒ(6ÝÝÑrÈ´õUøwëfÉwD¢ßz í_}E?ý„ìeËP“žî06æ1ˆBÐj:bÚOŠfqq‘•DÐj6jB‡Gñž=È^¶ìÿ8ä·»KÅ „ äÁqßþýHX¹Í:ur¸”=‚V‹ÐaÃÐwçNôøúkxµiÃc â4.–Wx8º¯]‹Ä¤$øÆÆ:>×ÝÜ:|8ú8€¨)S xxpK‚8Eœõò˸ïÀ´1¢iéÕ™‚H??ÄÍ‹¾ÿú‚úôá>w±,‡gXz}ÿ=âæÍƒ»¿¿Sw¤_—.èµu+:¼ù&ˆ»;w±¸‚Ü!ƒ¡ß¿ÿàþý]jñ!fæL$&%Á£eK>ýóäÏ]ª˜Ù³‘¸i“Ë’°›ÉÇ v§'V®D‡7Þ°+7C-÷òžÍ›Ñúñǹ ðp÷÷GϤ$´9’÷êïëáø/¿DääÉ<qeñhÙ½þþw40€³âÖêæ†¸ùó3kVÓNcQpø­&-Z ÷¶mðŽæ½y»Nt˜>OO\œ7OÑ3)<Q“Ý~~HÜ´‰“ÃBD½ü2ÚOÊ á 1ˆàáëÖÁ¿{wÞ‹–ˆ™3áÏ<ÃcgVâæ†ø¥KÑüþûù k;]>þ-† áÆ vIÿö¯¾Š°Çã½'µÓµZ$¬XŸx âl ܯ¢ß|“râ·„Õ«¡ñôäÆp–Ä#$ÝV¬pù€rÁ?>çÍã1ˆ3¸XD£Aü—_Â3,Œl1nZÁ],Gw±Ú<û,B|h¹'A@çÅ‹¡ æÆpTKÛ¼9bÞy‡÷–­ìŒØ9s¸‹å¨ Òñ½÷  t,Ë:˜k>z4ùlq ì~«I`ïÞhýÔSvi<S]ªÓÓQuö,ê._F]v6 ••0ÔÔ€ MéH}|àÙª|:t€ol,{ö„WD„Ýl$ :}ôŽ f4òÄB‚¨îwúðC»Údg¬©Añ¾}(ܶ •'NÜù’š?k“›¼#"Ðbð`„¿®]í†,þݺ!üé§‘Ÿ”Ä¥ÃB‚¨JÿlÊWeh,*ÂÕµk‘¿y3ôeeÒgT£u99È]³WÖ®…_×®h÷Ê+hùÈ#´ZÕÛÙ~Ú4üðƒl×$ðÄfòAÐþõ×ÕWŒÚZd.Z„Cýú!{Ù2«Èñ²PŠª´4œ™<Gz%ûö©»xGE!ŒŸ©±˜ ªÑ?¸_?ÞsªÆ)Þ»¿ „ì/¾€±¦Æ¦eÕddàä˜183itÅÅêªÈk¯Éæöñï ¶ê$ÕƒêõȘ?§ÆS4.£×wìÀ‘!CPvø°jí÷EËÿù.°Óï ¾±±h®RÂcu5NŽƒœåËe]Íï\»†Ï<ƒ¼Um'Nä1ˆ½*HÄØ±ª¤Õ•”àØO ôàAÕm@õz\˜9—?ûL•¸$èÞ{ÙíËc±Òj¦B&Žß•ÞB3J‘µx1rW­R~D.Ã÷'ƒÈœ÷ïmPâ³õé^°ÏléŒ!cÁnݪxÑ­FŒp¸äÞNƒØrgéípiñb”¦¤Øm'1“ çgÌ@MF†¢åzGEÁ¿kWƒØ ˆ 䡇-³dÿ~ä¬\i÷eª«ÃÙÉ“›nÊU-~˜+ˆ½Ä ~ññð QnÐÕ×ãÂÌ™`&“CtVMF²¿üRÑ2›Äc{q±”Nü–½t)êóòªÃrW¬@]v¶bå$$Xug#w±dD`ïÞŠ•¥+)Aîš5×a¦ÆF\þôSåÜ^77ôìÉ],Õ],B=p嫯`ª¯wÈN+LNVô `¯^ÜÅR^áápWèPÕé÷Í7ÛiÌ`ÀÕõë+ÏÚ•,ƒÈ wî¬X£‹÷졢¡;®pÛ6Ù¶¤ß Í:uâ1ˆÚPòbÍk*|t“=†*.Fé/¿(¦î® jÆ Þʸ'F#ÊŽqŠÎSlÏ!ð–xÝ4A䚥ڶU¤œª´4««‚ Jn‰·÷ûØ>ñTè>ÁJ{Üo%5/‚êtŠ”%õ¾GƒÈ¥V°ê._v‚0“ u99Š”¥ôRƒÜÚJD¡¥”jÔ ŒÇ rÄ€b ©}yW­ö¸jx»ˆA³µkkª•jÔ”D<¹Õ R’¼)˜8êõNE¥Úco™ 6‘â*)õE�4ÞÞNÕJµ‡Jì#ƒÈ ÅTA‚¸ùú:A”j³)¯j1ˆ$_•1˜êêi°Rß[”‚gh¨2±ŽÄÄy<¹îþþ’žÓ+´ãl©l”j³­þ©F©”ô¥¥Š4XÉM‘6?||»’NΜÄ.¤»K$HCa¡" VòÔ¢­Ô«—bWCHígÒEgQ–ºg§áêUEì¡ØÎa[#XÁô¬ vv_)‚¤K€RP—›«X£[ âø=GZ ¬HQT§CcQ'ˆò(u[tÍÅ‹Š5ºõO8|Çùwë¦X<U“™©Z"o{Wã¢$2RREj32KÒìß­›UÇHíáO?­XY5éé’Ÿuêe^AD§ýh+)p4TU¡V©­è„ ÝÔ©Ûi!!Š¤Ê‰ÎÐÈ­ �pBÌ 5>>’OV?®XÃÃFŽ„wT”CvZä‹/*ºeFÉ~qD‚œûR©J*RS•‹qÝÝ7w®Ãe/÷nÛ‘“&)Vž¡²Rñ¤ÙEÆØ±/ ˜�®äàA0Jk|Ë¡C[ ’Ë5ìôá‡Ðxy)VdiJŠU¹‹]a³âQ±/•š‰OwãªûMQtY²ÚæÍ#0æÅ—¨K~þ® Ùc�ð—|íÆ®]ŠÀ3, Ý–-³ûóÍââÐyÑ"EËdŠ÷ìá¹ã¡À%Q/Õj%o鸾c‡âwò…<ø :¾÷žÝÆ#-[¢çßþ¦øY–²£G]v–€ƒRÔ]¾Œªsç7DÔ”)h÷Ê+vG÷€�$~û­*+n…ÿø‡ a“ lwgŒ‰^É ±ââ•ü¤$UŒûî»èðÆŠm�´D9zmÙÿøxÅË6VWãúO?ÁÕaéH}ŸoLŒä³ …Û·«’\bfÍB§>‚àá¡jÇøÆÆ¢Ï?Â?!A•ò ·oWì›ÃD„ bã@ú…œÆêjU¯'hûüóè½}»äm3Ö’´õ“O¢ï®]ðiß^•ö3£¹«WËó.:“.:i5r¤äŠå®ZSc£j† LLD¿={9q¢ä”7bᎄ¯¾B·eˬºöÌZ\ß±CÑkÞœ‚ Œ±d±/o¿.]$ULwã 6oV=@î´hîݹ-~ÄÍÍ&åhÑaútô?xPõ»É¥Š_êL ":ýH›1c$W.gùr»È¦áß­“’Ðw×.„?õÜdq¥|cbûÞ{šŠ˜Y³àæç§z[‹÷ì±j÷®³Áâ)Q„:³Š<.¦€°Q£1¾¤û� ÿí·hûüóva,ÿ„Ä/[CUJöíCiJ ÊEcQÑ݉L4ÞÞð‹‹Cpÿþ<Ý»ÛÕJf4âÒÇËS9ø2¯(Ÿ1ö#!DAÜýý6jò7m’TÁ¬¿þ¡Ã†)zº¥m 5 ŒRè®_G}~>êsr ¯¨€±¶T§ƒ›Üš5ƒg«Vðn×®éF‰Y_”@ÞÆ¨>žËÆÍócJ©!ä �Q›—j³²pxÀ�Éß~ñÜ/¶)tÅÅ8tß}0TVÊúÞ¨_DÜ‚bÁ»õ°jA?Ö(ꋘyÛÉßÅâƒ+vÍ^Û²å n…wEdÌŸ/;9¬ÀBHÙ-™Œ±dÆØ<Jé Ji3»#ˆÙÍZ!¥ ö¯½&yu†QŠ ³f)v›’«¡ì—_Ph£‹MeüÒÀ�ïBöB cÉ”ÒG)¥^vCóGCÑÓy`b¢äýY@Ó¹èŒùóùh–ú²2¤M›¦è9™à `!d!$—Rú<¥ÔMu‚˜g…åRž‹yûm«ö9]Y·E;wòQ-×ìN)νö¯]sô¦´$„¬'„¤RJU �’ˆÎꟀVZQÆpþ7P¯P’9gGîªUÎvÞ£'!dcìo”ÒPÕ"B-cì)Ïv|÷]«Î5*+qöÅajhà#Ü ”§¦"ë£l^ŽJßAÆBPJ»¨B3VHQÏÖ­­N¹Syú4Ò¦LQôâgBmf&Nïìw~t$„üJ)½O‚˜UäS)϶Ÿ6 ¾11Vµ¾hçN\˜=ÛƒKUÑxíNŒ }y¹+4×—ò/kHbíÉ åRTDðð@—O>±z›EÞ7ßàÒ’%ŠÑuT**pbôh4äç+· ~ßüN’~ŠÄ êÓãÇ[ÝúËŸŽœ•+9I,ˆÝNŽ«hd;S’ݔҖŠÄ€Žï¿o}fÆ1o2,°*“S»UׯãØc¹t†D3IŠýVb5AÌ*2Gʳ//$¬\)ËñÖœåËq~út—½lòv¨ËÎFêÈ‘Šç³ãÀ]Tî$ÙÖàc�$ÉÁÕõëqaölYܤC† aÕ*§»ÍV *OŸÆ©çžƒ®¸Xµ:40�­þòi“¯§'´ÁÁðކgh¨œÖ:B2%¥ô^BÈa� ìBÚ´i¸¶e‹<Z‹îkÖ8ü’'+J‘¿i.¾ÿ¾s|/">íÛ#ô‘G1~<¼Âí}ãw„ÑŠĬ"k�L–ò¬©¡©#G¢êìYYê¢ññAç… Ñúé§í&0VWã··ßFá¶mNÙ>"'L@»W_µêl c¬£ ™Š„RÚŒr €¤‹ ¯_ǯÿû¿h((­NáO=…N ÚÅqV[£êìYœ2uJݳ¢făë×[ó=Í"‘}�¥t(!Dr‚Ýšôt¤Ž CU•luòlÝqsç"tøp§Tcu5.}ú)®~ýµK-R¸ qófJ¼M€1Ö\„2E b.x3€g¤>_~ô(NŒ-éûòÀˆûðCøFG;M¬QôÏââ8ÃŽ\IðhÑ}wï–—Ì$„,Qœ fWë$�ÉúWrà�N=÷œì‡¤4žžh;q"¢^z -Z8(3*ÏœÁ¥%K\þz�ðïÞ}wí’²3ã0!d€â1“¤/!䤬j™Qüïã̤I6I çæë‹6Ï>‹¨—^‚gë֣ǎ!{éR”8ÀwÜ„nË—£õ“OJñvÜA0)N3I^$„X•ò4%§Æ·YžX—Z?ù$"'N„Ot´]Æ(T¯GiJ rW®DÙ‘#œ ¯ðpÜ숻»ØG „T… f†~Àª+YËSSqzÜ8è+*lVO"ìÝû?·8iUW‹úœnߎk?ü€ú¼<΂» qÓ&)7p½IùL5‚˜ã‘=�úXóžÚ¬,œ3õW®ØÜÐ//48-~!<�V­Qª×£æâE”ìß»w£*-»Q"1nºˆO|7—2O5‚˜IÒ†r €UÙßt%%8=a*ŽSÌè¿§ ìÕ ½zÁ¯kWxGFBðð°Š4Ìh„±¶µ™™¨<}Ç£òÔ)4ñ‘.5XG¿}ûÄ>62WU‚˜IÒÉìëYEª×ãâûïãê† ªÍ®ooxGF«Mx·iÐPhá§'­ÄÍ Ô`�Õé`ª«ƒ¾¼ú²24¢>/ ùùh((�3ùÈ– å˜1“¤3!$@°µïº¶e .Ìž cM MƒÙÍ C e%ˆ¢K6‚ \`ŒM`õ9ÙÖO>‰~{÷" gO>28𯗠îqQ|MS„ïcÏÊAŸvíÐ'9Ñ3f¨~e‡úð •”é‡ÙAn"É9H"hµˆž1ýöîE`¯^|”¸0šÅÅ9¾‚ÜD’ïä" �4ëØ}’“Ñõ³Ïw ‡Uh>p ¤ÐøŽqÚbŒ ð D^©p'ªªýù縺aO0ç*ñ‡‡¥¥A$öÑ;~IW}_!ä_Œ± 1ñßÁÝßçÎÅ€#G1nœb—pr¨‡¶&H!�œ¶kùÎQÚ…²€ìþQ}^®|õ ¾ûŽ/ ;!Üqj*ÜÅo:Méé1“IJ€M¢m}Eò“’Ÿ”Ô´e…oãpxÝ¿þ¡<"åñO!3† 7‘d €I¶r™É„²_~Aþ·ß¢xï^›íæ°¹ŽØ9sš.g’†n„sE›ˆ2š²"/ cM Š÷íCÑŽ(=|¸ÉãÊbÿA¹V‹Žsç"râD©¯8E¹ëY]»¾£×—¬p"åét¨8~%û÷£ìèQÔ¤§óDtvßèht^¼Á÷Y•¸},!$É¡ r“Ëõ€· ðª›±¦UgÏ¢*- Õé騹põ¹¹ Osª‚;å…¨—_F›Ñ£¥ŒºÙ„ë(ö¡”ö#„l� jƪף±¨h((€¾´´i§ny9Luu z}Ó¿»Äjh<=¡ ot4‚î½~]»Êu.Ç"õp(‚ܤ&¯�X�+κs¸4öB,¾“œ8b )¥] !Ÿ�ì¨màP�!Ÿ_vÈ,j‚ œ'„ AÓ½Ù—x¿sX�`šr8,Aþ?n#ÿ$„Ä�x–…ã.xŸò­è1æTSDÓ9“Ôä9ìk !’’ª;¥ÿn&Ê\�íyŒâòXG™$ÙKqfËPJï#„Œð<øª—«Æ+¬rã]ÁR”RBÈ�¯sUq dxÞ|¡8AĹ_]Œ0@;8øBÇTã3� !²ÜŸáÒ3)¥4‚2Àý�þÂÝ0‡&ÆÏhJásXÎsWã¿Õ¥?€nfÂ$�ˆâ cßs€ �6ÊM NËc—x3a"´5ÿ4ÿ„+Žò„Èà €r¹Rœ ¶SåpÎÖ„ààààààààààààààààààààààààpü·RÃDsV÷ê����IEND®B`‚����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/sample/test-actor.rb����������������������������������������������0000755�0001750�0001750�00000010653�12147676243�020770� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter-gtk/examples/gtk-clutter-test-actor.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter-gtk" MAX_N_WIDGETS = 4 WINDOW_WIDTH = 400 WINDOW_HEIGHT = 400 RADIUS = 80 do_rotate_p = true window = Gtk::Window.new window.signal_connect("destroy") do Gtk.main_quit end vbox = Gtk::Box.new(:vertical, 6) window.add(vbox) clutter = ClutterGtk::Embed.new clutter.set_size_request(WINDOW_WIDTH, WINDOW_HEIGHT) vbox.pack_start(clutter, :expand => true, :fill => true, :padding => 0) stage = clutter.stage button = Gtk::Button.new(:stock_id => Gtk::Stock::QUIT) button.signal_connect("clicked") do |_button| window.destroy end vbox.pack_end(button, :expand => false, :fill => false, :padding => 0) stage.background_color = Clutter::Color.new(0x61, 0x64, 0x8c, 0xff) widgets = [] # create a new group to hold multiple actors in a group group = Clutter::Actor.new create_gtk_actor = lambda do gtk_actor = ClutterGtk::Actor.new bin = gtk_actor.widget vbox = Gtk::Box.new(:vertical, 6) bin.add(vbox) button = Gtk::Button.new(:label => "A Button") vbox.pack_start(button, :expand => false, :fill => false, :padding => 0) button.signal_connect("clicked") do |_button| puts("button clicked") label = Gtk::Label.new("A new label") label.show vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) end button = Gtk::CheckButton.new("Another button") vbox.pack_start(button, :expand => false, :fill => false, :padding => 0) entry = Gtk::Entry.new vbox.pack_start(entry, :expand => false, :fill => false, :padding => 0) bin.show_all gtk_actor end add_clutter_actor = lambda do |actor, container, i| container.add_child(actor) # Place around a circle w = widgets.first.width h = widgets.first.height x = WINDOW_WIDTH / 2 + RADIUS * Math.cos(i * 2 * Math::PI / (MAX_N_WIDGETS)) - w / 2 y = WINDOW_HEIGHT / 2 + RADIUS * Math.sin(i * 2 * Math::PI / (MAX_N_WIDGETS)) - h / 2 actor.set_position(x, y) end MAX_N_WIDGETS.times do |i| widget = create_gtk_actor.call widgets[i] = widget add_clutter_actor.call(widget, group, i) end # Add the group to the stage and center it stage.add_child(group) group.add_constraint(Clutter::AlignConstraint.new(stage, :x_axis, 0.5)) group.add_constraint(Clutter::AlignConstraint.new(stage, :y_axis, 0.5)) window.show_all # Create a timeline to manage animation timeline = Clutter::Timeline.new(6000) timeline.repeat_count = -1 # fire a callback for frame change timeline.signal_connect("new-frame") do |_timeline, m_secs| rotation = _timeline.progress * 360.0 if do_rotate_p # Rotate everything clockwise about stage center group.set_rotation(:z_axis, rotation, WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2, 0) widgets.each do |widget| # rotate each widget around its center w = widget.width h = widget.height widget.set_rotation(:z_axis, -(2 * rotation), w / 2, h / 2, 0) widget.opacity = 50 * Math.sin(2 * Math::PI * rotation / 360) + (255 - 50) end end end # and start it timeline.start GLib::Timeout.add_seconds(3) do if MAX_N_WIDGETS == widgets.size # Removing an item group.remove_child(widgets.pop) else # Adding an item widget = create_gtk_actor.call widgets << widget add_clutter_actor.call(widget, group, MAX_N_WIDGETS - 1) end keep_callback = true keep_callback end Gtk.main �������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/sample/window-test.rb���������������������������������������������0000755�0001750�0001750�00000005430�12147676243�021164� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter-gtk/examples/gtk-clutter-window-test.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # The original header: # (c) 2009, Collabora Ltd. # # Written by Davyd Madeley <davyd.madeley@collabora.co.uk> # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter-gtk" require "gdk_pixbuf2" window = ClutterGtk::Window.new window.signal_connect("destroy") do Gtk.main_quit end window.set_default_size(400, 300) NAME_COLUMN = 0 PIXBUF_COLUMN = 1 store = Gtk::ListStore.new(String, Gdk::Pixbuf) theme = Gtk::IconTheme.default [ "devhelp", "empathy", "evince", "gnome-panel", "seahorse", "sound-juicer", "totem", ].each do |icon_name| pixbuf = theme.load_icon(icon_name, 48, 0) iter = store.append iter[0] = icon_name iter[1] = pixbuf end icon_view = Gtk::IconView.new(store) icon_view.text_column = NAME_COLUMN icon_view.pixbuf_column = PIXBUF_COLUMN scrolled_window = Gtk::ScrolledWindow.new window.add(scrolled_window) scrolled_window.add(icon_view) scrolled_window.show_all # Widget 2 is a toolbar stage = window.stage toolbar = Gtk::Toolbar.new [ Gtk::Stock::ADD, Gtk::Stock::BOLD, Gtk::Stock::ITALIC, Gtk::Stock::CANCEL, Gtk::Stock::CDROM, Gtk::Stock::CONVERT, ].each do |stock_id| item = Gtk::ToolButton.new(:stock_id => stock_id) toolbar.insert(item, -1) end toolbar.show_all actor = ClutterGtk::Actor.new(toolbar) actor.add_constraint(Clutter::BindConstraint.new(stage, :width, 0.0)) actor.signal_connect("enter-event") do |_actor, event| _actor.save_easing_state do _actor.easing_mode = :linear _actor.opacity = 255 _actor.y = 0 end Clutter::Event::STOP end actor.signal_connect("leave-event") do |_actor, event| _actor.save_easing_state do _actor.easing_mode = :linear _actor.opacity = 128 _actor.y = _actor.height * -0.5 end Clutter::Event::STOP end actor.y = actor.height * -0.5 actor.opacity = 128 actor.reactive = true stage.add_child(actor) window.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/sample/window-test2.rb��������������������������������������������0000755�0001750�0001750�00000010473�12147676243�021251� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter-gtk/examples/gtk-clutter-window-test2.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # The original header: # (c) 2009, Collabora Ltd. # # Written by Davyd Madeley <davyd.madeley@collabora.co.uk> # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter-gtk" require "gdk_pixbuf2" window = ClutterGtk::Window.new table = Gtk::Grid.new table.hexpand = true table.vexpand = true add_button = lambda do |stock_id, row| button = Gtk::Button.new(:stock_id => stock_id) table.insert_row(row) table.insert_column(row) table.attach(button, row, row, 1, 1) button.signal_connect("clicked") do |_button| puts("button clicked: #{stock_id}") toplevel = _button.toplevel if toplevel.is_a?(ClutterGtk::Window) # create a texture from the button image texture = ClutterGtk::Texture.new image = _button.image size = image.icon_size texture.set_from_stock(_button, stock_id.to_s, size) # position the texture on top of the existing icon stage = toplevel.stage stage.add_actor(texture) allocation = image.allocation # replace the icon itself blank = Gdk::Pixbuf.new(:colorspace => :rgb, :has_alpha => true, :bits_per_sample => 8, :width => allocation.width, :height => allocation.height) blank.fill!(0x00000000) image.pixbuf = blank # animate a fall due to gravity toplevel_allocation = toplevel.allocation texture.save_easing_state do texture.easing_mode = :ease_in_quad texture.easing_duration = 200 texture.set_final_state("x", allocation.x.to_f) texture.set_final_state("y", allocation.y.to_f) texture.y = toplevel_allocation.height.to_f end first_completed_id = texture.signal_connect_after("transitions-completed") do image_allocation = image.allocation # do the second animation, have the icon grow out from the middle of the # button texture.save_easing_state do texture.easing_mode = :ease_out_sine texture.easing_duration = 100 texture.set_final_state("x", image_allocation.x.to_f) texture.set_final_state("y", image_allocation.y.to_f) texture.set_final_state("scale-x", 0.0) texture.set_final_state("scale-y", 0.0) texture.scale_x = 1.0 texture.scale_y = 1.0 texture.set_final_state("scale-gravity", Clutter::Gravity::CENTER) end texture.signal_handler_disconnect(first_completed_id) second_completed_id = texture.signal_connect_after("transitions-completed") do # undo our changes puts("set stock = #{stock_id}, size = #{size}") image.icon_size = size image.stock = stock_id texture.signal_handler_disconnect(second_completed_id) texture.destroy end end end end end add_button.call(Gtk::Stock::OK, 0) add_button.call(Gtk::Stock::CANCEL, 1) add_button.call(Gtk::Stock::CLOSE, 2) add_button.call(Gtk::Stock::ABOUT, 3) add_button.call(Gtk::Stock::BOLD, 4) add_button.call(Gtk::Stock::ITALIC, 5) window.add(table) window.show_all # override the gtk-button-images setting, since we kind # of rely on this to be true to actually show the stock # icon falling off the button settings = window.settings settings.gtk_button_images = true window.signal_connect("destroy") do Gtk.main_quit end Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/sample/test-scroll.rb���������������������������������������������0000755�0001750�0001750�00000011226�12147676243�021153� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter-gtk/examples/gtk-clutter-test-scroll.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter-gtk" N_WIDGETS = 5 WINDOW_WIDTH = 400 WINDOW_HEIGHT = 400 RADIUS = 80 do_rotate_p = true window = Gtk::Window.new window.signal_connect("destroy") do Gtk.main_quit end vbox = Gtk::Box.new(:vertical, 6) window.add(vbox) clutter = ClutterGtk::Embed.new clutter.set_size_request(WINDOW_WIDTH, WINDOW_HEIGHT) vbox.add(clutter) stage = clutter.stage button = Gtk::Button.new(:stock_id => Gtk::Stock::QUIT) button.signal_connect("clicked") do |_button| window.destroy end vbox.pack_start(button, :expand => false, :fill => false, :padding => 0) # and its background color stage.background_color = Clutter::Color.new(0x61, 0x64, 0x8c, 0xff) widgets = [] # create a new group to hold multiple actors in a group group = Clutter::Group.new create_gtk_actor = lambda do gtk_actor = ClutterGtk::Actor.new bin = gtk_actor.widget scroll = Gtk::ScrolledWindow.new scroll.set_policy(:never, :automatic) bin.add(scroll) vbox = Gtk::Box.new(:vertical, 6) scroll.add_with_viewport(vbox) button = Gtk::Button.new(:label => "A Button") vbox.pack_start(button, :expand => false, :fill => false, :padding => 0) button.signal_connect("clicked") do |_button| puts("button clicked") label = Gtk::Label.new("A new label") label.show vbox.pack_start(label, :expand => false, :fill => false, :padding => 0) end 6.times do |i| button = Gtk::CheckButton.new("Another button") vbox.pack_start(button, :expand => false, :fill => false, :padding => 0) end entry = Gtk::Entry.new vbox.pack_start(entry, :expand => false, :fill => false, :padding => 0) bin.show_all gtk_actor end N_WIDGETS.times do |i| widget = create_gtk_actor.call widgets[i] = widget # Place around a circle w = widgets.first.width h = widgets.first.height x = WINDOW_WIDTH / 2 + RADIUS * Math.cos(i * 2 * Math::PI / (N_WIDGETS)) - w / 2 y = WINDOW_HEIGHT / 2 + RADIUS * Math.sin(i * 2 * Math::PI / (N_WIDGETS)) - h / 2 widget.set_position(x, y) # Add to our group group group.add_actor(widget) end # Add the group to the stage stage.add_actor(group) stage.signal_connect("button-press-event") do |_stage, event| x, y = event.coords actor = _stage.get_actor_at_pos(:all, x, y) puts("click at #{x}, #{y} -> #{actor.gtype.name}:#{actor}") if !actor.is_a?(Clutter::Stage) and !actor.is_a?(Clutter::Group) actor.hide end end stage.signal_connect("key-release-event") do |_sage, event| unichar = [event.key_unicode].pack("U*") puts("*** key press event (key:#{unichar}) ***") if event.key_symbol == Clutter::Keys::KEY_q Gtk.main_quit end end window.show_all # Only show the actors after parent show otherwise it will just be # unrealized when the clutter foreign window is set. widget_show # will call show on the stage. group.show_all # Create a timeline to manage animation timeline = Clutter::Timeline.new(6000) timeline.loop = true # fire a callback for frame change timeline.signal_connect("new-frame") do |_timeline, m_secs| rotation = _timeline.progress * 360.0 if do_rotate_p # Rotate everything clockwise about stage center group.set_rotation(:z_axis, rotation, WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2, 0) widgets.each do |widget| # rotate each widget around its center w = widget.width h = widget.height widget.set_rotation(:z_axis, -(2 * rotation), w / 2, h / 2, 0) widget.opacity = 50 * Math.sin(2 * Math::PI * rotation / 360) + (255 - 50) end end end # and start it timeline.start Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/README.md���������������������������������������������������������0000644�0001750�0001750�00000001413�12077252561�016336� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Ruby/ClutterGTK Ruby/ClutterGTK is a Ruby binding of Clutter-GTK. ## Requirements * Ruby/Clutter and Ruby/GTK3 in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [Clutter-GTK](http://blogs.gnome.org/clutter/) ## Install gem install clutter-gtk ## License Copyright (c) 2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ### Exceptions Ruby scripts and image files in sample/ are ported and copied from Clutter. Headers in samples/*.rb describes that the location of the original file of the Ruby script and image files. The original files are licensed under the LGPL v2.1 or later. ## Project Website http://ruby-gnome2.sourceforge.jp/ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/Rakefile����������������������������������������������������������0000644�0001750�0001750�00000004460�12257552167�016536� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $LOAD_PATH.unshift("./../glib2/lib") require "gnome2/rake/package-task" package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/ClutterGTK is a Ruby binding of Clutter-GTK." package.description = "Ruby/ClutterGTK is a Ruby binding of Clutter-GTK." package.dependency.gem.runtime = ["clutter", "gtk3"] package.dependency.gem.development = ["test-unit-notify"] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = [ "glib2", "atk", "pango", "gdk_pixbuf2", "gobject-introspection", "clutter", "gdk3", ] package.windows.gobject_introspection_dependencies = [ "atk", "pango", "gdk_pixbuf2", "clutter", "gdk3", ] package.external_packages = [ { :name => "clutter-gtk", :download_site => :gnome, :label => "Clutter-GTK", :version => "1.4.4", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :patches => [ "0001-actor-fix-clutter-win32.h-include-path.patch", "0001-Use-no-undefined-ld-flag.patch", ], :need_autoreconf => true, :built_file => "bin/libclutter-gtk-1.0-0.dll", }, } ] end package_task.define Rake::Task["native:clutter-gtk:i386-mingw32"].prerequisites.clear namespace :dependency do desc "Install depenencies" task :install do # TODO: Install gir1.2-gtkclutter-1.0 on Debian. end end task :build => "dependency:install" ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/test/�������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�016044� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/test/test-clutter-gtk-embed.rb������������������������������������0000644�0001750�0001750�00000001576�12257552167�022676� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class ClutterGtkEmbedTest < Test::Unit::TestCase def test_new assert_not_nil(ClutterGtk::Embed.new) end end ����������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/test/run-test.rb��������������������������������������������������0000755�0001750�0001750�00000005217�12257552167�020162� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2012-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA have_make = system("which make > /dev/null") ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") atk_base = File.join(ruby_gnome2_base, "atk") pango_base = File.join(ruby_gnome2_base, "pango") gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2") cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject") gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection") clutter_base = File.join(ruby_gnome2_base, "clutter") gdk3_base = File.join(ruby_gnome2_base, "gdk3") gtk3_base = File.join(ruby_gnome2_base, "gtk3") clutter_gtk_base = File.join(ruby_gnome2_base, "clutter-gtk") modules = [ [glib_base, "glib2"], [atk_base, "atk"], [pango_base, "pango"], [gdk_pixbuf_base, "gdk_pixbuf2"], [cairo_gobject_base, "cairo-gobject"], [gobject_introspection_base, "gobject-introspection"], [clutter_base, "clutter"], [gdk3_base, "gdk3"], [gtk3_base, "gtk3"], [clutter_gtk_base, "clutter-gtk"], ] modules.each do |target, module_name| if File.exist?(File.join(target, "Makefile")) and have_make `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require "glib-test-init" $VERBOSE = false # TODO: remove me $LOAD_PATH.unshift(File.join(gobject_introspection_base, "test")) require "gobject-introspection-test-utils" $LOAD_PATH.unshift(File.join(clutter_base, "test")) require "clutter-test-utils" $LOAD_PATH.unshift(File.join(clutter_gtk_base, "test")) require "clutter-gtk-test-utils" require "clutter-gtk" # exclude sample/test-* clutter_gtk_test_base = File.join(clutter_gtk_base, "test") exit Test::Unit::AutoRunner.run(true, clutter_gtk_test_base) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gtk/test/clutter-gtk-test-utils.rb������������������������������������0000644�0001750�0001750�00000001531�12077252561�022744� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "test-unit" require "test/unit/notify" module ClutterGtkTestUtils end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/run-test.rb�������������������������������������������������������������������0000755�0001750�0001750�00000002272�12257552170�014726� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # quick & dirty script for running all available tests for each module # Author: Joachim Glauche require "rbconfig" require "pathname" ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['RUBY_INSTALL_NAME'] + RbConfig::CONFIG['EXEEXT']) # for creating a separating line def separator "-" * 80 end targets = [] includes = [] base_dir = Pathname(File.dirname(__FILE__)) Pathname.glob((base_dir + "*").to_s) do |dir| next unless dir.directory? dir = dir.expand_path ext_dir = dir + "ext" + dir.basename includes.concat(["-I", (dir + "lib").to_s, "-I", ext_dir.to_s]) next unless (dir + "test").directory? targets << dir end ignored_modules = [ "gstreamer", "gstreamer-no-gi", "webkit-gtk", "webkit-gtk2", ] succeeded = true targets.each do |target| next if ignored_modules.include?(target.basename.to_s) Dir.chdir(target.to_s) do puts "#{Time.now} running test for #{target}" puts separator args = includes + ["test/run-test.rb"] command = [ruby, *args] unless system(command.collect {|arg| "'#{arg.gsub(/'/, '\\\'')}'"}.join(' ')) succeeded = false end puts separator end end exit(succeeded) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/�������������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665515�013452� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/patches/�����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�015077� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/patches/gdk+-3.10.6-remove-def-use.diff����������������������������������0000644�0001750�0001750�00000007611�12257552167�022122� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������diff -ru gtk+-3.10.6.orig/gdk/Makefile.am gtk+-3.10.6/gdk/Makefile.am --- gtk+-3.10.6.orig/gdk/Makefile.am 2013-12-05 12:17:39.000000000 +0900 +++ gtk+-3.10.6/gdk/Makefile.am 2013-12-25 23:10:14.691695701 +0900 @@ -179,8 +179,8 @@ if USE_WIN32 libgdk_3_la_SOURCES += gdkkeynames.c libgdk_3_la_LIBADD += win32/libgdk-win32.la -libgdk_3_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def -libgdk_3_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def +libgdk_3_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o +libgdk_3_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o -no-undefined endif # USE_WIN32 if USE_BROADWAY @@ -270,17 +270,6 @@ endif # HAVE_INTROSPECTION -if OS_WIN32 -install-def-file: gdk.def - mkdir -p $(DESTDIR)$(libdir) - $(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def -uninstall-def-file: - -rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def -else -install-def-file: -uninstall-def-file: -endif - if MS_LIB_AVAILABLE noinst_DATA = gdk-win32-$(GTK_API_VERSION).lib @@ -382,9 +371,9 @@ DISTCLEANFILES = gdkconfig.h stamp-gc-h -install-data-local: install-ms-lib install-def-file +install-data-local: install-ms-lib -uninstall-local: uninstall-ms-lib uninstall-def-file +uninstall-local: uninstall-ms-lib rm -f $(DESTDIR)$(configexecincludedir)/gdkconfig.h # if srcdir!=builddir, clean out maintainer-clean files from builddir diff -ru gtk+-3.10.6.orig/gtk/Makefile.am gtk+-3.10.6/gtk/Makefile.am --- gtk+-3.10.6.orig/gtk/Makefile.am 2013-12-05 12:51:06.000000000 +0900 +++ gtk+-3.10.6/gtk/Makefile.am 2013-12-25 23:10:26.047429593 +0900 @@ -61,29 +61,18 @@ endif if OS_WIN32 -gtk_def = gtk.def -gtk_win32_symbols = -export-symbols $(srcdir)/gtk.def - gtk_win32_res = gtk-win32-res.o gtk_win32_res_ldflag = -Wl,gtk-win32-res.o gtk-win32-res.o : gtk-win32.rc $(WINDRES) gtk-win32.rc $@ - -install-def-file: gtk.def - $(INSTALL) $(srcdir)/gtk.def $(DESTDIR)$(libdir)/gtk-win32-3.0.def -uninstall-def-file: - -rm $(DESTDIR)$(libdir)/gtk-win32-3.0.def -else -install-def-file: -uninstall-def-file: endif if MS_LIB_AVAILABLE noinst_DATA = gtk-win32-$(GTK_API_VERSION).lib -gtk-win32-$(GTK_API_VERSION).lib: libgtk-win32-$(GTK_API_VERSION).la gtk.def - lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgtk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gtk.def -out:$@ +gtk-win32-$(GTK_API_VERSION).lib: libgtk-win32-$(GTK_API_VERSION).la + lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgtk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -out:$@ install-ms-lib: $(INSTALL) gtk-win32-$(GTK_API_VERSION).lib $(DESTDIR)$(libdir) @@ -1233,8 +1222,8 @@ if USE_WIN32 libgtk_3_la_LIBADD += -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32 libgtk_3_la_LDFLAGS += -Wl,-luuid -libgtk_3_la_DEPENDENCIES += $(gtk_def) $(gtk_win32_res) $(deps) -libgtk_target_ldflags = $(gtk_win32_res_ldflag) $(gtk_win32_symbols) +libgtk_3_la_DEPENDENCIES += $(gtk_win32_res) $(deps) +libgtk_target_ldflags = $(gtk_win32_res_ldflag) endif install-exec-hook: @@ -1286,13 +1275,13 @@ rm libgtk.vs10.sourcefiles.filters # Install a RC file for the default GTK+ theme, and key themes -install-data-local: install-ms-lib install-def-file install-mac-key-theme +install-data-local: install-ms-lib install-mac-key-theme $(MKDIR_P) $(DESTDIR)$(datadir)/themes/Default/gtk-3.0 $(INSTALL_DATA) $(srcdir)/gtk-keys.css.default $(DESTDIR)$(datadir)/themes/Default/gtk-3.0/gtk-keys.css $(MKDIR_P) $(DESTDIR)$(datadir)/themes/Emacs/gtk-3.0 $(INSTALL_DATA) $(srcdir)/gtk-keys.css.emacs $(DESTDIR)$(datadir)/themes/Emacs/gtk-3.0/gtk-keys.css -uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-mac-key-theme +uninstall-local: uninstall-ms-lib uninstall-mac-key-theme rm -f $(DESTDIR)$(datadir)/themes/Raleigh/gtk-3.0/gtk.css rm -f $(DESTDIR)$(datadir)/themes/Default/gtk-3.0/gtk-keys.css rm -f $(DESTDIR)$(datadir)/themes/Emacs/gtk-3.0/gtk-keys.css �����������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�014226� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�015100� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkconst.c����������������������������������������������������0000644�0001750�0001750�00000002233�11701304107�017362� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" void Init_gdk_const(VALUE mGdk) { G_DEF_CLASS(GDK_TYPE_STATUS, "Status", mGdk); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkx11x11window.c���������������������������������������������0000664�0001750�0001750�00000003414�11740310343�020435� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #ifdef GDK_WINDOWING_X11 #define RG_TARGET_NAMESPACE cX11Window #define _SELF(self) (RVAL2GDKX11WINDOW(self)) static VALUE rg_xid(VALUE self) { return ULONG2NUM(gdk_x11_window_get_xid(_SELF(self))); } static VALUE rg_move_to_current_desktop(VALUE self) { gdk_x11_window_move_to_current_desktop(_SELF(self)); return self; } static VALUE rg_server_time(VALUE self) { return UINT2NUM(gdk_x11_get_server_time(_SELF(self))); } static VALUE rg_set_user_time(VALUE self, VALUE time) { gdk_x11_window_set_user_time(_SELF(self), NUM2UINT(time)); return Qnil; } #endif void Init_gdkx11_x11window(VALUE mGdkX11) { #ifdef GDK_WINDOWING_X11 VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_X11_WINDOW, "X11Window", mGdkX11); RG_DEF_METHOD(xid, 0); RG_DEF_METHOD(move_to_current_desktop, 0); RG_DEF_METHOD(server_time, 0); RG_DEF_METHOD(set_user_time, 1); #endif } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkrectangle.c������������������������������������������������0000644�0001750�0001750�00000006457�12124610262�020216� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cRectangle #define _SELF(r) (RVAL2GDKRECTANGLE(r)) static VALUE rg_initialize(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) { GdkRectangle rectangle; rectangle.x = NUM2INT(x); rectangle.y = NUM2INT(y); rectangle.width = NUM2INT(width); rectangle.height = NUM2INT(height); G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_RECTANGLE, &rectangle)); return Qnil; } static VALUE rg_intersect(VALUE self, VALUE other) { GdkRectangle dest; gboolean ret = gdk_rectangle_intersect(_SELF(self), _SELF(other), &dest); return ret ? GDKRECTANGLE2RVAL(&dest) : Qnil; } static VALUE rg_union(VALUE self, VALUE other) { GdkRectangle dest; gdk_rectangle_union(_SELF(self), _SELF(other), &dest); return GDKRECTANGLE2RVAL(&dest); } /* Struct accessors */ static VALUE rg_x(VALUE self) { return INT2NUM(_SELF(self)->x); } static VALUE rg_y(VALUE self) { return INT2NUM(_SELF(self)->y); } static VALUE rg_width(VALUE self) { return INT2NUM(_SELF(self)->width); } static VALUE rg_height(VALUE self) { return INT2NUM(_SELF(self)->height); } static VALUE rg_set_x(VALUE self, VALUE x) { _SELF(self)->x = NUM2INT(x); return self; } static VALUE rg_set_y(VALUE self, VALUE y) { _SELF(self)->y = NUM2INT(y); return self; } static VALUE rg_set_width(VALUE self, VALUE width) { _SELF(self)->width = NUM2INT(width); return self; } static VALUE rg_set_height(VALUE self, VALUE height) { _SELF(self)->height = NUM2INT(height); return self; } static VALUE rg_to_a(VALUE self) { GdkRectangle* a = _SELF(self); return rb_ary_new3(4, INT2FIX(a->x), INT2FIX(a->y), INT2FIX(a->width), INT2FIX(a->height)); } void Init_gdk_rectangle(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_RECTANGLE, "Rectangle", mGdk); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(intersect, 1); RG_DEF_ALIAS("&", "intersect"); RG_DEF_METHOD(union, 1); RG_DEF_ALIAS("|", "union"); RG_DEF_METHOD(x, 0); RG_DEF_METHOD(y, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(set_x, 1); RG_DEF_METHOD(set_y, 1); RG_DEF_METHOD(set_width, 1); RG_DEF_METHOD(set_height, 1); RG_DEF_METHOD(to_a, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkselection.c������������������������������������������������0000644�0001750�0001750�00000013750�11701304107�020227� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE mSelection static VALUE rg_s_owner_set(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE owner, selection, time, send_event; int ret; if (argc == 4){ rb_scan_args(argc, argv, "40", &owner, &selection, &time, &send_event); ret = gdk_selection_owner_set(RVAL2GDKWINDOW(owner), RVAL2ATOM(selection), NUM2UINT(time), RVAL2CBOOL(send_event)); } else { VALUE display = Qnil; rb_scan_args(argc, argv, "50", &display, &owner, &selection, &time, &send_event); ret = gdk_selection_owner_set_for_display(RVAL2GDKDISPLAYOBJECT(display), RVAL2GDKWINDOW(owner), RVAL2ATOM(selection), NUM2UINT(time), RVAL2CBOOL(send_event)); } return CBOOL2RVAL(ret); } static VALUE rg_s_owner_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE selection; if (argc == 1) { rb_scan_args(argc, argv, "10", &selection); return GOBJ2RVAL(gdk_selection_owner_get(RVAL2ATOM(selection))); } else { VALUE display = Qnil; rb_scan_args(argc, argv, "20", &display, &selection); return GOBJ2RVAL(gdk_selection_owner_get_for_display(RVAL2GDKDISPLAYOBJECT(display), RVAL2ATOM(selection))); } } static VALUE rg_s_convert(VALUE self, VALUE requestor, VALUE selection, VALUE target, VALUE time) { gdk_selection_convert(RVAL2GDKWINDOW(requestor), RVAL2ATOM(selection), RVAL2ATOM(target), NUM2INT(time)); return self; } static VALUE rg_s_property_get(G_GNUC_UNUSED VALUE self, VALUE requestor) { guchar *data; GdkAtom prop_type; gint prop_format; VALUE ary; gdk_selection_property_get(RVAL2GDKWINDOW(requestor), &data, &prop_type, &prop_format); ary = rb_ary_new3(3, CSTR2RVAL((const char*)data), GDKATOM2RVAL(prop_type), INT2NUM(prop_format)); g_free(data); return ary; } static VALUE rg_s_send_notify(int argc, VALUE *argv, VALUE self) { VALUE requestor, selection, target, property, time; if (argc == 5) { rb_scan_args(argc, argv, "50", &requestor, &selection, &target, &property, &time); gdk_selection_send_notify(RVAL2GDKWINDOW(requestor), RVAL2ATOM(selection), RVAL2ATOM(target), NIL_P(property) ? GDK_NONE : RVAL2ATOM(property), NUM2INT(time)); } else { VALUE display = Qnil; rb_scan_args(argc, argv, "60", &display, &requestor, &selection, &target, &property, &time); gdk_selection_send_notify_for_display(RVAL2GDKDISPLAYOBJECT(display), RVAL2GDKWINDOW(requestor), RVAL2ATOM(selection), RVAL2ATOM(target), NIL_P(property) ? GDK_NONE : RVAL2ATOM(property), NUM2INT(time)); } return self; } void Init_gdk_selection(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Selection"); RG_DEF_SMETHOD(owner_set, -1); RG_DEF_SMETHOD(owner_get, -1); RG_DEF_SMETHOD(convert, 4); RG_DEF_SMETHOD(property_get, 1); RG_DEF_SMETHOD(send_notify, -1); /* Constants */ rb_define_const(RG_TARGET_NAMESPACE, "PRIMARY", GDKATOM2RVAL(GDK_SELECTION_PRIMARY)); rb_define_const(RG_TARGET_NAMESPACE, "SECONDARY", GDKATOM2RVAL(GDK_SELECTION_SECONDARY)); rb_define_const(RG_TARGET_NAMESPACE, "CLIPBOARD", GDKATOM2RVAL(GDK_SELECTION_CLIPBOARD)); /* GdkSelectionType */ rb_define_const(RG_TARGET_NAMESPACE, "TYPE_ATOM", GDKATOM2RVAL(GDK_SELECTION_TYPE_ATOM)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_BITMAP", GDKATOM2RVAL(GDK_SELECTION_TYPE_BITMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_COLORMAP", GDKATOM2RVAL(GDK_SELECTION_TYPE_COLORMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_DRAWABLE", GDKATOM2RVAL(GDK_SELECTION_TYPE_DRAWABLE)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_INTEGER", GDKATOM2RVAL(GDK_SELECTION_TYPE_INTEGER)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_PIXMAP", GDKATOM2RVAL(GDK_SELECTION_TYPE_PIXMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_WINDOW", GDKATOM2RVAL(GDK_SELECTION_TYPE_WINDOW)); rb_define_const(RG_TARGET_NAMESPACE, "TYPE_STRING", GDKATOM2RVAL(GDK_SELECTION_TYPE_STRING)); /* GdkTarget */ rb_define_const(RG_TARGET_NAMESPACE, "TARGET_BITMAP", GDKATOM2RVAL(GDK_TARGET_BITMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TARGET_COLORMAP", GDKATOM2RVAL(GDK_TARGET_COLORMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TARGET_DRAWABLE", GDKATOM2RVAL(GDK_TARGET_DRAWABLE)); rb_define_const(RG_TARGET_NAMESPACE, "TARGET_PIXMAP", GDKATOM2RVAL(GDK_TARGET_PIXMAP)); rb_define_const(RG_TARGET_NAMESPACE, "TARGET_STRING", GDKATOM2RVAL(GDK_TARGET_STRING)); } ������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/init.c����������������������������������������������������������0000644�0001750�0001750�00000002262�11704226436�016202� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * Copyright (C) 1998-2001 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #include "gmodule.h" extern void Init_gdk3(void); void Init_gdk3(void) { Init_gdk(); Init_gdkx11(); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkwindow.c���������������������������������������������������0000644�0001750�0001750�00000062074�12257552167�017576� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2002-2013 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #ifdef HAVE_RB_CAIRO_H #include <rb_cairo.h> #endif #define RG_TARGET_NAMESPACE cWindow #define _SELF(s) RVAL2GDKWINDOW(s) static VALUE rg_initialize(VALUE self, VALUE parent, VALUE attributes, VALUE attributes_mask) { GdkWindow *win; win = gdk_window_new(NIL_P(parent) ? NULL : _SELF(parent), RVAL2GDKWINDOWATTR(attributes), RVAL2GDKWINDOWATTRIBUTESTYPE(attributes_mask)); G_INITIALIZE(self, win); return Qnil; } static VALUE rg_destroy(VALUE self) { gdk_window_destroy(_SELF(self)); return Qnil; } static VALUE rg_window_type(VALUE self) { return GDKWINDOWTYPE2RVAL(gdk_window_get_window_type(_SELF(self))); } static VALUE rg_show(VALUE self) { gdk_window_show(_SELF(self)); return self; } static VALUE rg_show_unraised(VALUE self) { gdk_window_show_unraised(_SELF(self)); return self; } static VALUE rg_hide(VALUE self) { gdk_window_hide(_SELF(self)); return Qnil; } static VALUE rg_visible_p(VALUE self) { return CBOOL2RVAL(gdk_window_is_visible(_SELF(self))); } static VALUE rg_viewable_p(VALUE self) { return CBOOL2RVAL(gdk_window_is_viewable(_SELF(self))); } static VALUE rg_state(VALUE self) { return GDKWINDOWSTATE2RVAL(gdk_window_get_state(_SELF(self))); } static VALUE rg_withdraw(VALUE self) { gdk_window_withdraw(_SELF(self)); return Qnil; } static VALUE rg_iconify(VALUE self) { gdk_window_iconify(_SELF(self)); return self; } static VALUE rg_deiconify(VALUE self) { gdk_window_deiconify(_SELF(self)); return self; } static VALUE rg_stick(VALUE self) { gdk_window_stick(_SELF(self)); return self; } static VALUE rg_unstick(VALUE self) { gdk_window_unstick(_SELF(self)); return self; } static VALUE rg_maximize(VALUE self) { gdk_window_maximize(_SELF(self)); return self; } static VALUE rg_unmaximize(VALUE self) { gdk_window_unmaximize(_SELF(self)); return self; } static VALUE rg_fullscreen(VALUE self) { gdk_window_fullscreen(_SELF(self)); return self; } static VALUE rg_unfullscreen(VALUE self) { gdk_window_unfullscreen(_SELF(self)); return self; } static VALUE rg_set_keep_above(VALUE self, VALUE setting) { gdk_window_set_keep_above(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_set_keep_below(VALUE self, VALUE setting) { gdk_window_set_keep_below(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_move(VALUE self, VALUE x, VALUE y) { gdk_window_move(_SELF(self), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_resize(VALUE self, VALUE w, VALUE h) { gdk_window_resize(_SELF(self), NUM2INT(w), NUM2INT(h)); return self; } static VALUE rg_move_resize(VALUE self, VALUE x, VALUE y, VALUE w, VALUE h) { gdk_window_move_resize(_SELF(self), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h)); return self; } static VALUE rg_scroll(VALUE self, VALUE dx, VALUE dy) { gdk_window_scroll(_SELF(self), NUM2INT(dx), NUM2INT(dy)); return self; } static VALUE rg_move_region(VALUE self, VALUE region, VALUE dx, VALUE dy) { gdk_window_move_region(_SELF(self), RVAL2CRREGION(region), NUM2INT(dx), NUM2INT(dy)); return self; } static VALUE rg_reparent(VALUE self, VALUE new_parent, VALUE x, VALUE y) { gdk_window_reparent(_SELF(self), _SELF(new_parent), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_raise(VALUE self) { gdk_window_raise(_SELF(self)); return self; } static VALUE rg_lower(VALUE self) { gdk_window_lower(_SELF(self)); return self; } static VALUE rg_focus(VALUE self, VALUE timestamp) { gdk_window_focus(_SELF(self), NUM2UINT(timestamp)); return self; } static VALUE rg_register_dnd(VALUE self) { gdk_window_register_dnd(_SELF(self)); return self; } static VALUE rg_begin_resize_drag(VALUE self, VALUE edge, VALUE button, VALUE root_x, VALUE root_y, VALUE timestamp) { gdk_window_begin_resize_drag(_SELF(self), RVAL2GDKWINDOWEDGE(edge), NUM2INT(button), NUM2INT(root_x), NUM2INT(root_y), NUM2UINT(timestamp)); return self; } static VALUE rg_begin_move_drag(VALUE self, VALUE button, VALUE root_x, VALUE root_y, VALUE timestamp) { gdk_window_begin_move_drag(_SELF(self), NUM2INT(button), NUM2INT(root_x), NUM2INT(root_y), NUM2UINT(timestamp)); return self; } static VALUE rg_s_constrain_size(G_GNUC_UNUSED VALUE self, VALUE geometry, VALUE flags, VALUE w, VALUE h) { gint new_width, new_height; gdk_window_constrain_size(RVAL2GDKGEOMETRY(geometry), RVAL2GDKWINDOWHINTS(flags), NUM2INT(w), NUM2INT(h), &new_width, &new_height); return rb_assoc_new(INT2NUM(new_width), INT2NUM(new_height)); } static VALUE rg_beep(VALUE self) { gdk_window_beep(_SELF(self)); return self; } static VALUE rg_begin_paint(VALUE self, VALUE area) { if (rb_obj_is_kind_of(area, GTYPE2CLASS(GDK_TYPE_RECTANGLE))){ gdk_window_begin_paint_rect(_SELF(self), RVAL2GDKRECTANGLE(area)); } else { gdk_window_begin_paint_region(_SELF(self), RVAL2CRREGION(area)); } return self; } static VALUE rg_end_paint(VALUE self) { gdk_window_end_paint(_SELF(self)); return self; } static VALUE rg_invalidate(VALUE self, VALUE area, VALUE invalidate_children) { if (rb_obj_is_kind_of(area, GTYPE2CLASS(GDK_TYPE_RECTANGLE))){ gdk_window_invalidate_rect(_SELF(self), RVAL2GDKRECTANGLE(area), RVAL2CBOOL(invalidate_children)); } else { gdk_window_invalidate_region(_SELF(self), RVAL2CRREGION(area), RVAL2CBOOL(invalidate_children)); } return self; } static gboolean invalidate_child_func_wrap(GdkWindow *window, VALUE func) { VALUE result = rb_funcall(func, id_call, 1, GOBJ2RVAL(window)); return RVAL2CBOOL(result); } static VALUE rg_invalidate_maybe_recurse(VALUE self, VALUE region) { VALUE func = (VALUE)NULL; if (rb_block_given_p()){ func = rb_block_proc(); G_RELATIVE(self, func); } gdk_window_invalidate_maybe_recurse(_SELF(self), RVAL2CRREGION(region), (GdkWindowChildFunc)invalidate_child_func_wrap, (gpointer)func); return self; } static VALUE rg_update_area(VALUE self) { return CRREGION2RVAL(gdk_window_get_update_area(_SELF(self))); } static VALUE rg_freeze_updates(VALUE self) { gdk_window_freeze_updates(_SELF(self)); return self; } static VALUE rg_thaw_updates(VALUE self) { gdk_window_thaw_updates(_SELF(self)); return self; } static VALUE rg_s_process_all_updates(VALUE self) { gdk_window_process_all_updates(); return self; } static VALUE rg_process_updates(VALUE self, VALUE update_children) { gdk_window_process_updates(_SELF(self), RVAL2CBOOL(update_children)); return self; } static VALUE rg_s_set_debug_updates(VALUE self, VALUE setting) { gdk_window_set_debug_updates(RVAL2CBOOL(setting)); return self; } static VALUE rg_configure_finished(VALUE self) { gdk_window_configure_finished(_SELF(self)); return self; } static VALUE rg_enable_synchronized_configure(VALUE self) { gdk_window_enable_synchronized_configure(_SELF(self)); if (rb_block_given_p()) { rb_ensure(rb_yield, self, rg_configure_finished, self); } return self; } static VALUE rg_set_user_data(VALUE self, VALUE user_data) { gdk_window_set_user_data(_SELF(self), (gpointer)RVAL2GOBJ(user_data)); return self; } static VALUE rg_set_override_redirect(VALUE self, VALUE override_redirect) { gdk_window_set_override_redirect(_SELF(self), RVAL2CBOOL(override_redirect)); return self; } static VALUE rg_set_accept_focus(VALUE self, VALUE accept_focus) { gdk_window_set_accept_focus(_SELF(self), RVAL2CBOOL(accept_focus)); return self; } static VALUE rg_set_focus_on_map(VALUE self, VALUE focus_on_map) { gdk_window_set_focus_on_map(_SELF(self), RVAL2CBOOL(focus_on_map)); return self; } static VALUE rg_shape_combine_region(VALUE self, VALUE shape_region, VALUE offset_x, VALUE offset_y) { gdk_window_shape_combine_region(_SELF(self), NIL_P(shape_region) ? NULL : RVAL2CRREGION(shape_region), INT2NUM(offset_x), INT2NUM(offset_y)); return self; } static VALUE rg_set_child_shapes(VALUE self) { gdk_window_set_child_shapes(_SELF(self)); return self; } static VALUE rg_merge_child_shapes(VALUE self) { gdk_window_merge_child_shapes(_SELF(self)); return self; } static VALUE rg_input_shape_combine_region(VALUE self, VALUE shape_region, VALUE offset_x, VALUE offset_y) { gdk_window_input_shape_combine_region(_SELF(self), RVAL2CRREGION(shape_region), NUM2INT(offset_x), NUM2INT(offset_y)); return self; } static VALUE rg_set_child_input_shapes(VALUE self) { gdk_window_set_child_input_shapes(_SELF(self)); return self; } static VALUE rg_merge_child_input_shapes(VALUE self) { gdk_window_merge_child_input_shapes(_SELF(self)); return self; } static VALUE rg_set_static_gravities(VALUE self, VALUE use_static) { gboolean ret = gdk_window_set_static_gravities(_SELF(self), RVAL2CBOOL(use_static)); if (! ret) rb_raise(rb_eRuntimeError, "couldn't turn on static gravity"); return self; } static VALUE rg_set_title(VALUE self, VALUE title) { gdk_window_set_title(_SELF(self),RVAL2CSTR(title)); return self; } static VALUE rg_set_background(VALUE self, VALUE color) { gdk_window_set_background(_SELF(self), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_user_data(VALUE self) { GObject *data = NULL; gdk_window_get_user_data(_SELF(self), (gpointer)&data); return GOBJ2RVAL(data); } static VALUE rg_geometry(VALUE self) { gint x, y, w, h; gdk_window_get_geometry(_SELF(self), &x, &y, &w, &h); return rb_ary_new3(4, INT2NUM(x), INT2NUM(y), INT2NUM(w), INT2NUM(h)); } static VALUE rg_set_geometry_hints(VALUE self, VALUE geometry, VALUE geom_mask) { gdk_window_set_geometry_hints(_SELF(self), NIL_P(geometry) ? (GdkGeometry*)NULL : RVAL2GDKGEOMETRY(geometry), RVAL2GDKWINDOWHINTS(geom_mask)); return self; } static VALUE rg_width(VALUE self) { return INT2NUM(gdk_window_get_width(_SELF(self))); } static VALUE rg_height(VALUE self) { return INT2NUM(gdk_window_get_height(_SELF(self))); } static VALUE rg_set_icon_list(VALUE self, VALUE rbpixbufs) { GdkWindow *window = _SELF(self); GList *pixbufs = RVAL2GDKPIXBUFGLIST(rbpixbufs); gdk_window_set_icon_list(window, pixbufs); g_list_free(pixbufs); return self; } static VALUE rg_set_modal_hint(VALUE self, VALUE modal) { gdk_window_set_modal_hint(_SELF(self), RVAL2CBOOL(modal)); return self; } static VALUE rg_set_type_hint(VALUE self, VALUE hint) { gdk_window_set_type_hint(_SELF(self), RVAL2GDKWINDOWHINT(hint)); return self; } static VALUE rg_type_hint(VALUE self) { return GDKWINDOWHINT2RVAL(gdk_window_get_type_hint(_SELF(self))); } static VALUE rg_set_skip_taskbar_hint(VALUE self, VALUE hint) { gdk_window_set_skip_taskbar_hint(_SELF(self), RVAL2CBOOL(hint)); return self; } static VALUE rg_set_skip_pager_hint(VALUE self, VALUE hint) { gdk_window_set_skip_pager_hint(_SELF(self), RVAL2CBOOL(hint)); return self; } static VALUE rg_set_urgency_hint(VALUE self, VALUE hint) { gdk_window_set_urgency_hint(_SELF(self), RVAL2CBOOL(hint)); return self; } static VALUE rg_position(VALUE self) { gint x, y; gdk_window_get_position(_SELF(self), &x, &y); return rb_assoc_new(INT2NUM(x), INT2NUM(y)); } static VALUE rg_root_origin(VALUE self) { int x, y; gdk_window_get_root_origin(_SELF(self), &x, &y); return rb_assoc_new(INT2FIX(x), INT2FIX(y)); } static VALUE rg_frame_extents(VALUE self) { GdkRectangle rect; gdk_window_get_frame_extents(_SELF(self), &rect); return GDKRECTANGLE2RVAL(&rect); } static VALUE rg_origin(VALUE self) { gint x, y; gdk_window_get_origin(_SELF(self), &x, &y); return rb_assoc_new(INT2NUM(x), INT2NUM(y)); } static VALUE rg_parent(VALUE self) { return GOBJ2RVAL(gdk_window_get_parent(_SELF(self))); } static VALUE rg_toplevel(VALUE self) { return GOBJ2RVAL(gdk_window_get_toplevel(_SELF(self))); } static VALUE rg_children(VALUE self) { /* Don't use gdk_window_get_children() here */ GList *list = gdk_window_peek_children(_SELF(self)); VALUE ary = rb_ary_new(); while (list) { rb_ary_push(ary, GOBJ2RVAL(list->data)); list = list->next; } return ary; } static VALUE rg_events(VALUE self) { return GDKEVENTMASK2RVAL(gdk_window_get_events(_SELF(self))); } static VALUE rg_set_events(VALUE self, VALUE mask) { gdk_window_set_events(_SELF(self), RVAL2GDKEVENTMASK(mask)); return self; } /* deprecated static VALUE rg_set_icon(VALUE self, VALUE icon, VALUE pixmap, VALUE mask) { gdk_window_set_icon(_SELF(self), NIL_P(icon) ? NULL :_SELF(icon), NIL_P(pixmap) ? NULL : RVAL2GDKPIXMAP(pixmap), NIL_P(mask) ? NULL : RVAL2GDKBITMAP(mask)); return self; } */ static VALUE rg_set_icon_name(VALUE self, VALUE name) { gdk_window_set_icon_name(_SELF(self), RVAL2CSTR(name)); return self; } static VALUE rg_set_transient_for(VALUE self, VALUE parent) { gdk_window_set_transient_for(_SELF(self), _SELF(parent)); return self; } static VALUE rg_set_role(VALUE self, VALUE role) { gdk_window_set_role(_SELF(self), RVAL2CSTR(role)); return self; } static VALUE rg_set_group(VALUE self, VALUE leader) { gdk_window_set_group(_SELF(self), _SELF(leader)); return self; } static VALUE rg_group(VALUE self) { return GOBJ2RVAL(gdk_window_get_group(_SELF(self))); } static VALUE rg_set_decorations(VALUE self, VALUE decor) { gdk_window_set_decorations(_SELF(self), RVAL2GDKWMDECORATION(decor)); return self; } static VALUE rg_decorations(VALUE self) { GdkWMDecoration decorations; gboolean ret = gdk_window_get_decorations(_SELF(self), &decorations); return ret ? GDKWMDECORATION2RVAL(decorations) : Qnil; } static VALUE rg_set_functions(VALUE self, VALUE func) { gdk_window_set_functions(_SELF(self), RVAL2GDKWMFUNCTION(func)); return self; } static VALUE rg_set_composited(VALUE self, VALUE composited) { gdk_window_set_composited(_SELF(self), RVAL2CBOOL(composited)); return self; } static VALUE rg_set_opacity(VALUE self, VALUE opacity) { gdk_window_set_opacity(_SELF(self), NUM2DBL(opacity)); return self; } static VALUE rg_set_startup_id(VALUE self, VALUE startup_id) { gdk_window_set_startup_id(_SELF(self), RVAL2CSTR_ACCEPT_NIL(startup_id)); return self; } /* deprecated static VALUE rg_s_toplevels(G_GNUC_UNUSED VALUE self) { return GOBJGLIST2RVAL_FREE(gdk_window_get_toplevels(), g_list_free, NULL); } */ static VALUE rg_s_default_root_window(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_get_default_root_window()); } /* Would you need this? GdkPointerHooks* gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); */ /* From X Window System Interaction */ /* deprecated static VALUE rg_s_foreign_new(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE arg[2]; GdkWindow * win = NULL; rb_scan_args(argc, argv, "11", &arg[0], &arg[1]); switch(argc) { case 1: win = gdk_window_foreign_new(RVAL2GDKNATIVEWINDOW(arg[0])); break; case 2: win = gdk_window_foreign_new_for_display(RVAL2GOBJ(arg[0]), RVAL2GDKNATIVEWINDOW(arg[1])); break; default: break; } if (win == NULL) return Qnil; else { return GOBJ2RVAL(win); } } static VALUE rg_s_lookup(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE arg[2]; GdkWindow * win = NULL; rb_scan_args(argc, argv, "11", &arg[0], &arg[1]); switch(argc) { case 1: win = gdk_window_lookup(RVAL2GDKNATIVEWINDOW(arg[0])); break; case 2: win = gdk_window_lookup_for_display(RVAL2GOBJ(arg[0]), RVAL2GDKNATIVEWINDOW(arg[1])); break; default: break; } if (win == NULL) return Qnil; else { return GOBJ2RVAL(win); } } */ struct rbgdk_rval2gdkatomglist_args { VALUE ary; long n; GList *result; }; static VALUE rbgdk_rval2gdkatomglist_body(VALUE value) { long i; struct rbgdk_rval2gdkatomglist_args *args = (struct rbgdk_rval2gdkatomglist_args *)value; for (i = 0; i < args->n; i++) args->result = g_list_append(args->result, GINT_TO_POINTER(RVAL2ATOM(RARRAY_PTR(args->ary)[i]))); return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkatomglist_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdkatomglist_args *)value)->result); rb_exc_raise(rb_errinfo()); } static GList * rbgdk_rval2gdkatomglist(VALUE value) { struct rbgdk_rval2gdkatomglist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgdk_rval2gdkatomglist_body, (VALUE)&args, rbgdk_rval2gdkatomglist_rescue, (VALUE)&args); return args.result; } #define RVAL2GDKATOMGLIST(value) rbgdk_rval2gdkatomglist(value) static VALUE rg_drag_begin(VALUE self, VALUE targets) { GList *list = RVAL2GDKATOMGLIST(targets); GdkDragContext *result = gdk_drag_begin(_SELF(self), list); g_list_free(list); return GOBJ2RVAL(result); } static VALUE rg_drag_protocol(VALUE self) { GdkWindow *target; GdkWindow **p; GdkDragProtocol prot; VALUE ary = rb_ary_new(); prot = gdk_window_get_drag_protocol(_SELF(self), &target); for (p = ⌖ *p; p++) rb_ary_push(ary, GOBJ2RVAL(*p)); return rb_ary_new3(2, GDKDRAGPROTOCOL2RVAL(prot), ary); } static VALUE rg_get_device_position(VALUE self, VALUE device) { gint x, y; GdkModifierType state; GdkWindow *underneath_window; underneath_window = gdk_window_get_device_position(_SELF(self), RVAL2GDKDEVICE(device), &x, &y, &state); return rb_ary_new3(4, GOBJ2RVAL(underneath_window), INT2NUM(x), INT2NUM(y), GDKMODIFIERTYPE2RVAL(state)); } #ifdef HAVE_RB_CAIRO_H static VALUE rg_create_cairo_context(VALUE self) { VALUE rb_cr; cairo_t *cr; cr = gdk_cairo_create(_SELF(self)); rb_cairo_check_status(cairo_status(cr)); rb_cr = CRCONTEXT2RVAL(cr); cairo_destroy (cr); return rb_cr; } #endif void Init_gdk_window(VALUE mGdk) { GObjectClass *g_class; VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_WINDOW, "Window", mGdk); g_class = g_type_class_peek(GDK_TYPE_WINDOW); RG_DEF_METHOD(initialize, 3); RG_DEF_METHOD(destroy, 0); RG_DEF_METHOD(window_type, 0); RG_DEF_SMETHOD(constrain_size, 4); RG_DEF_SMETHOD(process_all_updates, 0); RG_DEF_SMETHOD(set_debug_updates, 1); RG_DEF_METHOD(show, 0); RG_DEF_METHOD(show_unraised, 0); RG_DEF_METHOD(hide, 0); RG_DEF_METHOD_P(visible, 0); RG_DEF_METHOD_P(viewable, 0); RG_DEF_METHOD(withdraw, 0); RG_DEF_METHOD(state, 0); RG_DEF_METHOD(iconify, 0); RG_DEF_METHOD(deiconify, 0); RG_DEF_METHOD(stick, 0); RG_DEF_METHOD(unstick, 0); RG_DEF_METHOD(maximize, 0); RG_DEF_METHOD(unmaximize, 0); RG_DEF_METHOD(fullscreen, 0); RG_DEF_METHOD(unfullscreen, 0); RG_DEF_METHOD(set_keep_above, 1); RG_DEF_METHOD(set_keep_below, 1); RG_DEF_METHOD(move, 2); RG_DEF_METHOD(resize, 2); RG_DEF_METHOD(move_resize, 4); RG_DEF_METHOD(scroll, 2); RG_DEF_METHOD(move_region, 3); RG_DEF_METHOD(reparent, 3); RG_DEF_METHOD(raise, 0); RG_DEF_METHOD(lower, 0); RG_DEF_METHOD(focus, 1); RG_DEF_METHOD(register_dnd, 0); RG_DEF_METHOD(beep, 0); RG_DEF_METHOD(begin_resize_drag, 5); RG_DEF_METHOD(begin_move_drag, 4); RG_DEF_METHOD(begin_paint, 1); RG_DEF_METHOD(end_paint, 0); RG_DEF_METHOD(invalidate, 2); RG_DEF_METHOD(invalidate_maybe_recurse, 1); RG_DEF_METHOD(update_area, 0); RG_DEF_METHOD(freeze_updates, 0); RG_DEF_METHOD(thaw_updates, 0); RG_DEF_METHOD(process_updates, 1); RG_DEF_METHOD(configure_finished, 0); RG_DEF_METHOD(enable_synchronized_configure, 0); RG_DEF_METHOD(set_user_data, 1); RG_DEF_METHOD(set_override_redirect, 1); RG_DEF_METHOD(set_accept_focus, 1); RG_DEF_METHOD(set_focus_on_map, 1); RG_DEF_METHOD(shape_combine_region, 3); RG_DEF_METHOD(set_child_shapes, 0); RG_DEF_METHOD(merge_child_shapes, 0); RG_DEF_METHOD(input_shape_combine_region, 3); RG_DEF_METHOD(set_child_input_shapes, 0); RG_DEF_METHOD(merge_child_input_shapes, 0); RG_DEF_METHOD(set_static_gravities, 1); RG_DEF_METHOD(set_title, 1); RG_DEF_METHOD(set_background, 1); RG_DEF_METHOD(user_data, 0); RG_DEF_METHOD(geometry, 0); RG_DEF_METHOD(set_geometry_hints, 2); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(set_icon_list, 1); RG_DEF_METHOD(set_modal_hint, 1); RG_DEF_METHOD(set_type_hint, 1); RG_DEF_METHOD(type_hint, 0); RG_DEF_METHOD(set_skip_taskbar_hint, 1); RG_DEF_METHOD(set_skip_pager_hint, 1); RG_DEF_METHOD(set_urgency_hint, 1); RG_DEF_METHOD(position, 0); RG_DEF_METHOD(root_origin, 0); RG_DEF_METHOD(frame_extents, 0); RG_DEF_METHOD(origin, 0); RG_DEF_METHOD(parent, 0); RG_DEF_METHOD(toplevel, 0); RG_DEF_SMETHOD(default_root_window, 0); RG_DEF_METHOD(children, 0); RG_DEF_METHOD(events, 0); RG_DEF_METHOD(set_events, 1); /* deprecated RG_DEF_METHOD(set_icon, 3); */ RG_DEF_METHOD(set_icon_name, 1); RG_DEF_METHOD(set_transient_for, 1); RG_DEF_METHOD(set_role, 1); RG_DEF_METHOD(set_group, 1); RG_DEF_METHOD(group, 0); RG_DEF_METHOD(set_decorations, 1); RG_DEF_METHOD(decorations, 0); RG_DEF_METHOD(set_functions, 1); RG_DEF_METHOD(set_composited, 1); RG_DEF_METHOD(set_opacity, 1); RG_DEF_METHOD(set_startup_id, 1); /* deprecated RG_DEF_SMETHOD(toplevels, 0); RG_DEF_SMETHOD(foreign_new, -1); RG_DEF_SMETHOD(lookup, -1); */ RG_DEF_METHOD(drag_begin, 1); RG_DEF_METHOD(drag_protocol, 0); RG_DEF_METHOD(get_device_position, 1); #ifdef HAVE_RB_CAIRO_H RG_DEF_METHOD(create_cairo_context, 0); #endif G_DEF_CLASS(GDK_TYPE_WINDOW_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_WINDOW_WINDOW_CLASS, "WindowClass", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_WINDOW_HINTS, "Hints", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_GRAVITY, "Gravity", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_WINDOW_EDGE, "Edge", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_WINDOW_TYPE_HINT, "TypeHint", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_WINDOW_ATTRIBUTES_TYPE, "AttributesType", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_FILTER_RETURN, "FilterReturn", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_MODIFIER_TYPE, "ModifierType", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_WM_DECORATION, "WMDecoration", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_WM_FUNCTION, "WMFunction", RG_TARGET_NAMESPACE); rb_define_const(RG_TARGET_NAMESPACE, "PARENT_RELATIVE", INT2FIX(GDK_PARENT_RELATIVE)); #ifdef GDK_WINDOWING_X11 G_DEF_CLASS3("GdkWindowImplX11", "WindowImplX11", mGdk); #elif defined(GDK_WINDOWING_WIN32) G_DEF_CLASS3("GdkWindowImplWin32", "WindowImplWin32", mGdk); #elif defined(GDK_WINDOWING_FB) G_DEF_CLASS3("GdkWindowFB", "WindowFB", mGdk); #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkrgba.c�����������������������������������������������������0000644�0001750�0001750�00000006357�12124610262�017164� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cRGBA #define _SELF(self) (RVAL2GDKRGBA(self)) static VALUE rg_s_parse(G_GNUC_UNUSED VALUE self, VALUE spec) { GdkRGBA color; if (!gdk_rgba_parse(&color, RVAL2CSTR(spec))) rb_raise(rb_eArgError, "can't parse color representation `%s'", RVAL2CSTR(spec)); return GDKRGBA2RVAL(&color); } static VALUE rg_initialize(VALUE self, VALUE red, VALUE green, VALUE blue, VALUE alpha) { GdkRGBA rgba; rgba.red = NUM2DBL(red); rgba.green = NUM2DBL(green); rgba.blue = NUM2DBL(blue); rgba.alpha = NUM2DBL(alpha); G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_RGBA, &rgba)); return Qnil; } static VALUE rg_red(VALUE self) { return DBL2NUM(_SELF(self)->red); } static VALUE rg_set_red(VALUE self, VALUE red) { _SELF(self)->red = NUM2DBL(red); return self; } static VALUE rg_green(VALUE self) { return DBL2NUM(_SELF(self)->green); } static VALUE rg_set_green(VALUE self, VALUE green) { _SELF(self)->green = NUM2DBL(green); return self; } static VALUE rg_blue(VALUE self) { return DBL2NUM(_SELF(self)->blue); } static VALUE rg_set_blue(VALUE self, VALUE blue) { _SELF(self)->blue = NUM2DBL(blue); return self; } static VALUE rg_alpha(VALUE self) { return DBL2NUM(_SELF(self)->alpha); } static VALUE rg_set_alpha(VALUE self, VALUE alpha) { _SELF(self)->alpha = NUM2DBL(alpha); return self; } static VALUE rg_to_a(VALUE self) { GdkRGBA *rgba = _SELF(self); return rb_ary_new3(4, DBL2NUM(rgba->red), DBL2NUM(rgba->green), DBL2NUM(rgba->blue), DBL2NUM(rgba->alpha)); } static VALUE rg_to_s(VALUE self) { return CSTR2RVAL_FREE(gdk_rgba_to_string(_SELF(self))); } static VALUE rg_operator_equal(VALUE self, VALUE other) { return CBOOL2RVAL(gdk_rgba_equal(_SELF(self), _SELF(other))); } void Init_gdk_rgba(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_RGBA, "RGBA", mGdk); RG_DEF_SMETHOD(parse, 1); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(red, 0); RG_DEF_METHOD(set_red, 1); RG_DEF_METHOD(green, 0); RG_DEF_METHOD(set_green, 1); RG_DEF_METHOD(blue, 0); RG_DEF_METHOD(set_blue, 1); RG_DEF_METHOD(alpha, 0); RG_DEF_METHOD(set_alpha, 1); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD(to_s, 0); RG_DEF_METHOD_OPERATOR("==", equal, 1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkwindowattr.c�����������������������������������������������0000644�0001750�0001750�00000012617�12124610262�020447� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" /*****************************************/ static GdkWindowAttr* attr_copy(const GdkWindowAttr* win) { GdkWindowAttr* new_win; g_return_val_if_fail (win != NULL, NULL); new_win = g_new(GdkWindowAttr, 1); *new_win = *win; return new_win; } GType gdk_windowattr_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkWindowAttr", (GBoxedCopyFunc)attr_copy, (GBoxedFreeFunc)g_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cWindowAttr #define _SELF(w) (RVAL2GDKWINDOWATTR(w)) static VALUE rg_initialize(VALUE self, VALUE width, VALUE height, VALUE wclass, VALUE window_type) { GdkWindowAttr attribute; attribute.width = NUM2INT(width); attribute.height = NUM2INT(height); attribute.wclass = RVAL2GDKWINDOWWINDOWCLASS(wclass); attribute.window_type = RVAL2GDKWINDOWTYPE(window_type); G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_WINDOW_ATTR, &attribute)); return Qnil; } #define ATTR_STR(name)\ static VALUE \ attr_get_ ## name (VALUE self)\ {\ return CSTR2RVAL(_SELF(self)->name);\ }\ static VALUE \ attr_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = (gchar *)RVAL2CSTR(val);\ return self;\ } #define ATTR_INT(name)\ static VALUE \ attr_get_ ## name (VALUE self)\ {\ return INT2NUM(_SELF(self)->name);\ }\ static VALUE \ attr_set_ ## name (VALUE self, VALUE val)\ {\ _SELF(self)->name = NUM2INT(val);\ return self;\ } ATTR_STR(title); ATTR_INT(event_mask); ATTR_INT(x); ATTR_INT(y); ATTR_INT(width); ATTR_INT(height); static VALUE rg_wclass(VALUE self) { return GDKWINDOWWINDOWCLASS2RVAL(_SELF(self)->wclass); } static VALUE rg_set_wclass(VALUE self, VALUE val) { _SELF(self)->wclass = RVAL2GDKWINDOWWINDOWCLASS(val); return self; } static VALUE rg_visual(VALUE self) { return GOBJ2RVAL(_SELF(self)->visual); } static VALUE rg_set_visual(VALUE self, VALUE val) { _SELF(self)->visual = RVAL2GDKVISUAL(val); return self; } static VALUE rg_window_type(VALUE self) { return GDKWINDOWTYPE2RVAL(_SELF(self)->window_type); } static VALUE rg_set_window_type(VALUE self, VALUE val) { _SELF(self)->window_type = RVAL2GDKWINDOWTYPE(val); return self; } static VALUE rg_cursor(VALUE self) { return GDKCURSOR2RVAL(_SELF(self)->cursor); } static VALUE rg_set_cursor(VALUE self, VALUE val) { _SELF(self)->cursor = RVAL2GDKCURSOR(val); return self; } ATTR_STR(wmclass_name); ATTR_STR(wmclass_class); static VALUE rg_override_redirect(VALUE self) { return CBOOL2RVAL(_SELF(self)->override_redirect); } static VALUE rg_set_override_redirect(VALUE self, VALUE val) { _SELF(self)->override_redirect = RVAL2CBOOL(val); return self; } void Init_gdk_windowattr(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_WINDOW_ATTR, "WindowAttr", mGdk); RG_DEF_METHOD(initialize, 4); rbg_define_method(RG_TARGET_NAMESPACE, "title", attr_get_title, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_title", attr_set_title, 1); rbg_define_method(RG_TARGET_NAMESPACE, "event_mask", attr_get_event_mask, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_event_mask", attr_set_event_mask, 1); rbg_define_method(RG_TARGET_NAMESPACE, "x", attr_get_x, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_x", attr_set_x, 1); rbg_define_method(RG_TARGET_NAMESPACE, "y", attr_get_y, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_y", attr_set_y, 1); rbg_define_method(RG_TARGET_NAMESPACE, "width", attr_get_width, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_width", attr_set_width, 1); rbg_define_method(RG_TARGET_NAMESPACE, "height", attr_get_height, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_height", attr_set_height, 1); RG_DEF_METHOD(wclass, 0); RG_DEF_METHOD(set_wclass, 1); RG_DEF_METHOD(visual, 0); RG_DEF_METHOD(set_visual, 1); RG_DEF_METHOD(window_type, 0); RG_DEF_METHOD(set_window_type, 1); RG_DEF_METHOD(cursor, 0); RG_DEF_METHOD(set_cursor, 1); rbg_define_method(RG_TARGET_NAMESPACE, "wmclass_name", attr_get_wmclass_name, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_wmclass_name", attr_set_wmclass_name, 1); rbg_define_method(RG_TARGET_NAMESPACE, "wmclass_class", attr_get_wmclass_class, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_wmclass_class", attr_set_wmclass_class, 1); RG_DEF_METHOD(override_redirect, 0); RG_DEF_METHOD(set_override_redirect, 1); } �����������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkatom.c�����������������������������������������������������0000644�0001750�0001750�00000006225�11701304107�017201� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cAtom #define _SELF(a) ((RVAL2GDKATOM(a))->atom) /*****************************************/ static GdkAtomData * gdk_atom_copy(const GdkAtom atom) { GdkAtomData* data; data = g_new(GdkAtomData, 1); data->atom = atom; return data; } GType gdk_atom_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkAtomData", (GBoxedCopyFunc)gdk_atom_copy, (GBoxedFreeFunc)g_free); return our_type; } GdkAtom get_gdkatom(VALUE atom) { if (TYPE(atom) == T_STRING) return gdk_atom_intern(RVAL2CSTR(atom), FALSE); return (RVAL2GDKATOM(atom))->atom; } /*****************************************/ static VALUE rg_s_intern(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE name; VALUE exist; rb_scan_args(argc, argv, "11", &name, &exist); return GDKATOM2RVAL(gdk_atom_intern(RVAL2CSTR(name), RVAL2CBOOL(exist))); } /* We don't need them. GdkAtom gdk_atom_intern_static_string(const gchar *atom_name); */ static VALUE rg_initialize(VALUE self, VALUE num) { guint atom = FIX2INT(num); if (atom == 0){ /* This is a trick for passing 0(NULL) */ G_INITIALIZE(self, GUINT_TO_POINTER(1)); _SELF(self) = GUINT_TO_POINTER(GDK_NONE); } else { G_INITIALIZE(self, GUINT_TO_POINTER(atom)); } return Qnil; } static VALUE rg_name(VALUE self) { return CSTR2RVAL_FREE(gdk_atom_name(_SELF(self))); } static VALUE rg_to_i(VALUE self) { return UINT2NUM(GPOINTER_TO_UINT(_SELF(self))); } static VALUE rg_operator_equal(VALUE self, VALUE other) { return CBOOL2RVAL(_SELF(self) == _SELF(other)); } void Init_gdk_atom(VALUE mGdk) { VALUE none; VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_ATOM, "Atom", mGdk); RG_DEF_SMETHOD(intern, -1); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(to_i, 0); RG_DEF_METHOD_OPERATOR("==", equal, 1); /* This is a trick to define GDK_NONE as a BOXED object */ none = GDKATOM2RVAL((gpointer)1); rb_define_const(RG_TARGET_NAMESPACE, "NONE", none); _SELF(none) = GDK_NONE; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkcolor.c����������������������������������������������������0000644�0001750�0001750�00000006275�12124610262�017366� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cColor #define _SELF(c) (RVAL2GDKCOLOR(c)) static VALUE rg_initialize(VALUE self, VALUE red, VALUE green, VALUE blue) { GdkColor color; color.pixel = 0; color.red = NUM2INT(red); color.green = NUM2INT(green); color.blue = NUM2INT(blue); G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_COLOR, &color)); return Qnil; } static VALUE rg_s_parse(G_GNUC_UNUSED VALUE self, VALUE name) { GdkColor c; if (! gdk_color_parse(RVAL2CSTR(name), &c)) { rb_raise(rb_eArgError, "can't parse color name `%s'", RVAL2CSTR(name)); } return GDKCOLOR2RVAL(&c); } static VALUE rg_pixel(VALUE self) { return INT2NUM(_SELF(self)->pixel); } static VALUE rg_red(VALUE self) { return INT2FIX(_SELF(self)->red); } static VALUE rg_set_red(VALUE self, VALUE red) { _SELF(self)->red = NUM2INT(red); return self; } static VALUE rg_green(VALUE self) { return INT2FIX(_SELF(self)->green); } static VALUE rg_set_green(VALUE self, VALUE green) { _SELF(self)->green = NUM2INT(green); return self; } static VALUE rg_blue(VALUE self) { return INT2FIX(_SELF(self)->blue); } static VALUE rg_set_blue(VALUE self, VALUE blue) { _SELF(self)->blue = NUM2INT(blue); return self; } static VALUE rg_to_a(VALUE self) { GdkColor *c = _SELF(self); return rb_ary_new3(3, INT2FIX(c->red), INT2FIX(c->green), INT2FIX(c->blue)); } static VALUE rg_operator_gdkcolor_equal(VALUE self, VALUE other) { return CBOOL2RVAL(gdk_color_equal(_SELF(self), _SELF(other))); } static VALUE rg_to_s(VALUE self) { return CSTR2RVAL_FREE(gdk_color_to_string(_SELF(self))); } void Init_gdk_color(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_COLOR, "Color", mGdk); RG_DEF_SMETHOD(parse, 1); RG_DEF_METHOD(initialize, 3); RG_DEF_METHOD(pixel, 0); RG_DEF_METHOD(red, 0); RG_DEF_METHOD(set_red, 1); RG_DEF_METHOD(green, 0); RG_DEF_METHOD(set_green, 1); RG_DEF_METHOD(blue, 0); RG_DEF_METHOD(set_blue, 1); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD_OPERATOR("==", gdkcolor_equal, 1); RG_DEF_METHOD(to_s, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkscreen.c���������������������������������������������������0000644�0001750�0001750�00000025631�12121311640�017517� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2006 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #ifdef HAVE_RB_CAIRO_H #include <rb_cairo.h> #endif #define RG_TARGET_NAMESPACE cScreen #define _SELF(i) RVAL2GDKSCREEN(i) static ID id_new; static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_screen_get_default()); } /* deprecated static VALUE rg_default_colormap(VALUE self) { return GOBJ2RVAL(gdk_screen_get_default_colormap(_SELF(self))); } static VALUE rg_set_default_colormap(VALUE self, VALUE colormap) { gdk_screen_set_default_colormap(_SELF(self), RVAL2GDKCOLORMAP(colormap)); return self; } static VALUE rg_system_colormap(VALUE self) { return GOBJ2RVAL(gdk_screen_get_system_colormap(_SELF(self))); } */ static VALUE rg_system_visual(VALUE self) { return GOBJ2RVAL(gdk_screen_get_system_visual(_SELF(self))); } /* deprecated static VALUE rg_rgb_colormap(VALUE self) { return GOBJ2RVAL(gdk_screen_get_rgb_colormap(_SELF(self))); } static VALUE rg_rgb_visual(VALUE self) { return GOBJ2RVAL(gdk_screen_get_rgb_visual(_SELF(self))); } */ /* deprecated static VALUE rg_rgba_colormap(VALUE self) { return GOBJ2RVAL(gdk_screen_get_rgba_colormap(_SELF(self))); } */ static VALUE rg_rgba_visual(VALUE self) { return GOBJ2RVAL(gdk_screen_get_rgba_visual(_SELF(self))); } static VALUE rg_composited_p(VALUE self) { return CBOOL2RVAL(gdk_screen_is_composited(_SELF(self))); } static VALUE rg_root_window(VALUE self) { return GOBJ2RVAL(gdk_screen_get_root_window(_SELF(self))); } static VALUE rg_display(VALUE self) { return GOBJ2RVAL(gdk_screen_get_display(_SELF(self))); } static VALUE rg_number(VALUE self) { return INT2NUM(gdk_screen_get_number(_SELF(self))); } static VALUE rg_width(VALUE self) { return INT2NUM(gdk_screen_get_width(_SELF(self))); } static VALUE rg_height(VALUE self) { return INT2NUM(gdk_screen_get_height(_SELF(self))); } static VALUE rg_width_mm(VALUE self) { return INT2NUM(gdk_screen_get_width_mm(_SELF(self))); } static VALUE rg_height_mm(VALUE self) { return INT2NUM(gdk_screen_get_height_mm(_SELF(self))); } static VALUE rg_visuals(VALUE self) { return GOBJGLIST2RVAL_FREE(gdk_screen_list_visuals(_SELF(self)), g_list_free, NULL); } static VALUE rg_toplevel_windows(VALUE self) { return GOBJGLIST2RVAL_FREE(gdk_screen_get_toplevel_windows(_SELF(self)), g_list_free, NULL); } static VALUE rg_display_name(VALUE self) { gchar* name = gdk_screen_make_display_name(_SELF(self)); VALUE ret = CSTR2RVAL(name); g_free(name); return ret; } static VALUE rg_n_monitors(VALUE self) { return INT2NUM(gdk_screen_get_n_monitors(_SELF(self))); } static VALUE rg_monitor_geometry(VALUE self, VALUE num) { GdkRectangle rect; gdk_screen_get_monitor_geometry(_SELF(self), NUM2INT(num), &rect); return GDKRECTANGLE2RVAL(&rect); } static VALUE rg_get_monitor(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2; VALUE ret; rb_scan_args(argc, argv, "11", &arg1, &arg2); if (argc == 2){ ret = INT2NUM(gdk_screen_get_monitor_at_point(_SELF(self), NUM2INT(arg1), NUM2INT(arg2))); } else if (argc == 1){ ret = INT2NUM(gdk_screen_get_monitor_at_window(_SELF(self), RVAL2GDKWINDOW(arg1))); } else { rb_raise(rb_eArgError, "Wrong number of arguments: %d", argc); } return ret; } /* deprecated static VALUE rg_broadcast_client_message(VALUE self, VALUE event) { gdk_screen_broadcast_client_message(_SELF(self), RVAL2GEV(event)); return self; } */ /* type: String, Integer, Gdk::Color. */ static VALUE rg_get_setting(int argc, VALUE *argv, VALUE self) { VALUE name, type; GType gtype; GValue val = G_VALUE_INIT; gboolean ret; VALUE value; rb_scan_args(argc, argv, "11", &name, &type); if (NIL_P(type)) gtype = G_TYPE_STRING; else gtype = CLASS2GTYPE(type); g_value_init(&val, gtype); ret = gdk_screen_get_setting(_SELF(self), RVAL2CSTR(name), &val); value = ret ? GVAL2RVAL(&val) : Qnil; g_value_unset(&val); return value; } #ifdef HAVE_RB_CAIRO_H static VALUE gdkscreen_get_font_options(VALUE self) { return CRFONTOPTIONS2RVAL((cairo_font_options_t *)gdk_screen_get_font_options(_SELF(self))); } static VALUE gdkscreen_set_font_options(VALUE self, VALUE options) { gdk_screen_set_font_options(_SELF(self), (const cairo_font_options_t *)RVAL2CRFONTOPTIONS(options)); return self; } #endif static VALUE rg_active_window(VALUE self) { return GOBJ2RVAL(gdk_screen_get_active_window(_SELF(self))); } static VALUE rg_window_stack(VALUE self) { GList* list = gdk_screen_get_window_stack(_SELF(self)); VALUE ary = rb_ary_new(); while (list) { rb_ary_push(ary, GOBJ2RVAL(list->data)); g_object_unref(list->data); list = list->next; } g_list_free(list); return ary; } static void child_setup(gpointer func) { if (! NIL_P(func)){ rb_funcall((VALUE)func, id_call, 0); } } /* deprecated static VALUE rg_spawn_on_screen(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags) { GError *err = NULL; gboolean ret; gint child_pid; VALUE func = Qnil; gchar **gargv; gchar **genvp; if (rb_block_given_p()) { func = rb_block_proc(); G_RELATIVE(self, func); } gargv = (gchar **)RVAL2STRV(argv); genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp); ret = gdk_spawn_on_screen(_SELF(self), RVAL2CSTR_ACCEPT_NIL(working_directory), gargv, genvp, NUM2INT(flags), (GSpawnChildSetupFunc)child_setup, (gpointer)func, &child_pid, &err); g_free(gargv); g_free(genvp); if (!ret) RAISE_GERROR(err); return INT2NUM(child_pid); } static VALUE rg_spawn_on_screen_with_pipes(VALUE self, VALUE working_directory, VALUE argv, VALUE envp, VALUE flags) { GError *err = NULL; gboolean ret; gint child_pid; VALUE func = Qnil; gchar **gargv; gchar **genvp; gint standard_input, standard_output, standard_error; if (rb_block_given_p()) { func = rb_block_proc(); G_RELATIVE(self, func); } gargv = (gchar **)RVAL2STRV(argv); genvp = (gchar **)RVAL2STRV_ACCEPT_NIL(envp); ret = gdk_spawn_on_screen_with_pipes(_SELF(self), RVAL2CSTR_ACCEPT_NIL(working_directory), gargv, genvp, NUM2INT(flags), (GSpawnChildSetupFunc)child_setup, (gpointer)func, &child_pid, &standard_input, &standard_output, &standard_error, &err); g_free(gargv); g_free(genvp); if (!ret) RAISE_GERROR(err); return rb_ary_new3(4, INT2NUM(child_pid), rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_input)), rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_output)), rb_funcall(rb_cIO, id_new, 1, INT2NUM(standard_error))); } */ static VALUE rg_spawn_command_line_on_screen(G_GNUC_UNUSED VALUE self, VALUE command_line) { GError *err = NULL; VALUE ret; ret = CBOOL2RVAL(g_spawn_command_line_async(RVAL2CSTR(command_line), &err)); if (!ret) RAISE_GERROR(err); return ret; } /* From X Window System Interaction */ #ifdef GDK_WINDOWING_X11 #include <gdk/gdkx.h> static VALUE rg_xnumber(VALUE self) { return INT2NUM(GDK_SCREEN_XNUMBER(_SELF(self))); } static VALUE rg_supports_net_wm_hint_p(VALUE self, VALUE property) { return CBOOL2RVAL(gdk_x11_screen_supports_net_wm_hint(_SELF(self), RVAL2ATOM(property))); } static VALUE rg_window_manager_name(VALUE self) { return CSTR2RVAL(gdk_x11_screen_get_window_manager_name(_SELF(self))); } static VALUE rg_screen_number(VALUE self) { return INT2NUM(gdk_x11_screen_get_screen_number(_SELF(self))); } #endif void Init_gdk_screen(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_SCREEN, "Screen", mGdk); id_new = rb_intern("new"); RG_DEF_SMETHOD(default, 0); /* deprecated RG_DEF_METHOD(default_colormap, 0); RG_DEF_METHOD(set_default_colormap, 1); RG_DEF_METHOD(system_colormap, 0); */ RG_DEF_METHOD(system_visual, 0); /* deprecated RG_DEF_METHOD(rgb_colormap, 0); RG_DEF_METHOD(rgb_visual, 0); */ /* deprecated RG_DEF_METHOD(rgba_colormap, 0); */ RG_DEF_METHOD(rgba_visual, 0); RG_DEF_METHOD_P(composited, 0); RG_DEF_METHOD(root_window, 0); RG_DEF_METHOD(display, 0); RG_DEF_METHOD(number, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(width_mm, 0); RG_DEF_METHOD(height_mm, 0); RG_DEF_METHOD(visuals, 0); RG_DEF_METHOD(toplevel_windows, 0); RG_DEF_METHOD(display_name, 0); RG_DEF_METHOD(n_monitors, 0); RG_DEF_METHOD(monitor_geometry, 1); RG_DEF_METHOD(get_monitor, -1); /* deprecated RG_DEF_METHOD(broadcast_client_message, 1); */ RG_DEF_METHOD(get_setting, -1); #ifdef HAVE_RB_CAIRO_H G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "font_options", gdkscreen_get_font_options, 0); G_REPLACE_SET_PROPERTY(RG_TARGET_NAMESPACE, "font_options", gdkscreen_set_font_options, 1); #endif RG_DEF_METHOD(active_window, 0); RG_DEF_METHOD(window_stack, 0); /* deprecated RG_DEF_METHOD(spawn_on_screen, 4); RG_DEF_METHOD(spawn_on_screen_with_pipes, 4); */ RG_DEF_METHOD(spawn_command_line_on_screen, 1); #ifdef GDK_WINDOWING_X11 RG_DEF_METHOD(xnumber, 0); RG_DEF_METHOD_P(supports_net_wm_hint, 0); RG_DEF_METHOD(window_manager_name, 0); RG_DEF_METHOD(screen_number, 0); #endif #ifdef GDK_WINDOWING_X11 G_DEF_CLASS3("GdkScreenX11", "ScreenX11", mGdk); #endif } �������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/gdk3.def��������������������������������������������������������0000644�0001750�0001750�00000000362�12257552167�016411� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXPORTS Init_gdk3 rbgdk_rval2gdkpoints rbgdk_rval2gdkatoms rbgdk_rval2gdkpixbufglist gdk_atom_get_type gdk_geometry_get_type gdk_windowattr_get_type get_gdkatom rbgdk_gdkevent2rval rbgdk_rval2gdkevent ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdk.c���������������������������������������������������������0000644�0001750�0001750�00000025754�12257552167�016352� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE mGdk ID id_call; /* We don't need them. void gdk_init (gint *argc, gchar ***argv); gboolean gdk_init_check (gint *argc, gchar ***argv); void gdk_parse_args (gint *argc, gchar ***argv); */ struct rbgdk_rval2gdkpoints_args { VALUE ary; long n; GdkPoint *result; }; static VALUE rbgdk_rval2gdkpoints_body(VALUE value) { long i; struct rbgdk_rval2gdkpoints_args *args = (struct rbgdk_rval2gdkpoints_args *)value; for (i = 0; i < args->n; i++) { VALUE points = rb_ary_to_ary(RARRAY_PTR(args->ary)[i]); if (RARRAY_LEN(points) != 2) rb_raise(rb_eArgError, "point %ld should be array of size 2", i); args->result[i].x = NUM2INT(RARRAY_PTR(points)[0]); args->result[i].y = NUM2INT(RARRAY_PTR(points)[1]); } return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkpoints_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdkpoints_args *)value)->result); rb_exc_raise(rb_errinfo()); } GdkPoint * rbgdk_rval2gdkpoints(VALUE value, long *n) { struct rbgdk_rval2gdkpoints_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GdkPoint, args.n + 1); rb_rescue(rbgdk_rval2gdkpoints_body, (VALUE)&args, rbgdk_rval2gdkpoints_rescue, (VALUE)&args); *n = args.n; return args.result; } struct rbgdk_rval2gdkatoms_args { VALUE ary; long n; GdkAtom *result; }; static VALUE rbgdk_rval2gdkatoms_body(VALUE value) { long i; struct rbgdk_rval2gdkatoms_args *args = (struct rbgdk_rval2gdkatoms_args *)value; for (i = 0; i < args->n; i++) args->result[i] = RVAL2ATOM(RARRAY_PTR(args->ary)[i]); return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkatoms_rescue(VALUE value) { g_free(((struct rbgdk_rval2gdkatoms_args *)value)->result); rb_exc_raise(rb_errinfo()); } GdkAtom * rbgdk_rval2gdkatoms(VALUE value, long *n) { struct rbgdk_rval2gdkatoms_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = g_new(GdkAtom, args.n + 1); rb_rescue(rbgdk_rval2gdkatoms_body, (VALUE)&args, rbgdk_rval2gdkatoms_rescue, (VALUE)&args); *n = args.n; return args.result; } struct rval2gdkpixbufglist_args { VALUE ary; long n; GList *result; }; static VALUE rbgdk_rval2gdkpixbufglist_body(VALUE value) { long i; struct rval2gdkpixbufglist_args *args = (struct rval2gdkpixbufglist_args *)value; for (i = 0; i < args->n; i++) args->result = g_list_append(args->result, RVAL2GDKPIXBUF(RARRAY_PTR(args->ary)[i])); return Qnil; } static G_GNUC_NORETURN VALUE rbgdk_rval2gdkpixbufglist_rescue(VALUE value) { g_list_free(((struct rval2gdkpixbufglist_args *)value)->result); rb_exc_raise(rb_errinfo()); } GList * rbgdk_rval2gdkpixbufglist(VALUE value) { struct rval2gdkpixbufglist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgdk_rval2gdkpixbufglist_body, (VALUE)&args, rbgdk_rval2gdkpixbufglist_rescue, (VALUE)&args); return args.result; } static VALUE rg_s_display_arg_name(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gdk_get_display_arg_name()); } /* deprecated static VALUE rg_s_set_locale(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gdk_set_locale()); } */ /* deprecated static VALUE rg_s_set_sm_client_id(VALUE self, VALUE id) { gdk_set_sm_client_id(RVAL2CSTR_ACCEPT_NIL(id)); return self; } */ static VALUE rg_s_notify_startup_complete(int argc, VALUE *argv, VALUE self) { VALUE startup_id; rb_scan_args(argc, argv, "01", &startup_id); if (NIL_P(startup_id)) { gdk_notify_startup_complete(); } else { gdk_notify_startup_complete_with_id(RVAL2CSTR(startup_id)); } return self; } static VALUE rg_s_program_class(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gdk_get_program_class()); } static VALUE rg_s_set_program_class(VALUE self, VALUE program_class) { gdk_set_program_class(RVAL2CSTR(program_class)); return self; } static VALUE rg_s_display(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(gdk_get_display()); } #ifdef HAVE_X11_XLIB_H #ifdef HAVE_XGETERRORTEXT #include <X11/Xlib.h> #include <errno.h> static VALUE rb_x_error; static VALUE rb_x_io_error; static int rbgdk_x_error(Display *display, XErrorEvent *error) { gchar buf[64]; XGetErrorText(display, error->error_code, buf, 63); rb_funcall((VALUE)rb_x_error, id_call, 4, INT2NUM(error->serial), INT2NUM(error->error_code), INT2NUM(error->request_code), INT2NUM(error->minor_code)); return 0; } static int rbgdk_x_io_error(Display *display) { int errno_saved = errno; const gchar* disp; const gchar* error; disp = display ? DisplayString(display) : gdk_get_display_arg_name(); if (! disp) disp = "(none)"; error = g_strerror(errno_saved); rb_funcall((VALUE)rb_x_io_error, id_call, 3, CSTR2RVAL(disp), INT2NUM(errno), CSTR2RVAL(error)); return 0; } #endif #endif static VALUE rg_s_set_x_error_handler(VALUE self) { #ifdef HAVE_XGETERRORTEXT rb_x_error = rb_block_proc(); G_RELATIVE(self, rb_x_error); XSetErrorHandler(rbgdk_x_error); #else rb_warn("Not supported on this environment."); #endif return self; } static VALUE rg_s_set_x_io_error_handler(VALUE self) { #ifdef HAVE_XGETERRORTEXT rb_x_io_error = rb_block_proc(); G_RELATIVE(self, rb_x_io_error); XSetIOErrorHandler(rbgdk_x_io_error); #else rb_warn("Not supported on this environment."); #endif return self; } static VALUE rg_s_flush(VALUE self) { gdk_flush(); return self; } static VALUE rg_s_screen_width(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_screen_width()); } static VALUE rg_s_screen_width_mm(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_screen_width_mm()); } static VALUE rg_s_screen_height(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_screen_height()); } static VALUE rg_s_screen_height_mm(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_screen_height_mm()); } static VALUE rg_s_set_double_click_time(VALUE self, VALUE msec) { gdk_set_double_click_time(NUM2UINT(msec)); return self; } static VALUE rg_s_beep(VALUE self) { gdk_beep(); return self; } static VALUE rg_s_error_trap_push(VALUE self) { gdk_error_trap_push(); return self; } static VALUE rg_s_error_trap_pop(VALUE self) { gdk_error_trap_pop(); return self; } static VALUE rg_s_windowing_x11_p(G_GNUC_UNUSED VALUE self) { #ifdef GDK_WINDOWING_X11 return Qtrue; #else return Qfalse; #endif } static VALUE rg_s_windowing_win32_p(G_GNUC_UNUSED VALUE self) { #ifdef GDK_WINDOWING_WIN32 return Qtrue; #else return Qfalse; #endif } static VALUE rg_s_windowing_fb_p(G_GNUC_UNUSED VALUE self) { #ifdef GDK_WINDOWING_FB return Qtrue; #else return Qfalse; #endif } static VALUE rg_s_windowing_quartz_p(G_GNUC_UNUSED VALUE self) { #ifdef GDK_WINDOWING_QUARTZ return Qtrue; #else return Qfalse; #endif } static VALUE rg_s_windowing_directfb_p(G_GNUC_UNUSED VALUE self) { #ifdef GDK_WINDOWING_DIRECTFB return Qtrue; #else return Qfalse; #endif } static VALUE rg_s_target(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(RUBY_GDK3_TARGET); } static VALUE rg_s_cairo_available_p(G_GNUC_UNUSED VALUE self) { return Qtrue; } void Init_gdk(void) { id_call = rb_intern("call"); VALUE RG_TARGET_NAMESPACE = rb_define_module("Gdk"); RG_DEF_SMETHOD(display_arg_name, 0); /* deprecated RG_DEF_SMETHOD(set_locale, 0); RG_DEF_SMETHOD(set_sm_client_id, 1); */ RG_DEF_SMETHOD(notify_startup_complete, -1); RG_DEF_SMETHOD(program_class, 0); RG_DEF_SMETHOD(set_program_class, 1); RG_DEF_SMETHOD(display, 0); RG_DEF_SMETHOD(set_x_error_handler, 0); RG_DEF_SMETHOD(set_x_io_error_handler, 0); RG_DEF_SMETHOD(screen_width, 0); RG_DEF_SMETHOD(screen_width_mm, 0); RG_DEF_SMETHOD(screen_height, 0); RG_DEF_SMETHOD(screen_height_mm, 0); RG_DEF_SMETHOD(beep, 0); RG_DEF_SMETHOD(flush, 0); RG_DEF_SMETHOD(set_double_click_time, 1); RG_DEF_SMETHOD(error_trap_push, 0); RG_DEF_SMETHOD(error_trap_pop, 0); RG_DEF_SMETHOD_P(windowing_x11, 0); RG_DEF_SMETHOD_P(windowing_win32, 0); RG_DEF_SMETHOD_P(windowing_fb, 0); RG_DEF_SMETHOD_P(windowing_quartz, 0); RG_DEF_SMETHOD_P(windowing_directfb, 0); RG_DEF_SMETHOD(target, 0); RG_DEF_SMETHOD_P(cairo_available, 0); G_DEF_CLASS(GDK_TYPE_GRAB_STATUS, "GrabStatus", RG_TARGET_NAMESPACE); Init_gdk_atom(RG_TARGET_NAMESPACE); Init_gdk_cairo(); Init_gdk_color(RG_TARGET_NAMESPACE); Init_gdk_const(RG_TARGET_NAMESPACE); Init_gdk_cursor(RG_TARGET_NAMESPACE); Init_gdk_device(RG_TARGET_NAMESPACE); Init_gdk_device_manager(RG_TARGET_NAMESPACE); Init_gdk_display(RG_TARGET_NAMESPACE); Init_gdk_display_manager(RG_TARGET_NAMESPACE); Init_gdk_dragcontext(RG_TARGET_NAMESPACE); Init_gdk_event(RG_TARGET_NAMESPACE); Init_gdk_geometry(RG_TARGET_NAMESPACE); Init_gdk_keymap(RG_TARGET_NAMESPACE); Init_gdk_keyval(RG_TARGET_NAMESPACE); Init_gdk_pango(RG_TARGET_NAMESPACE); /* deprecated Init_gdk_pangorenderer(RG_TARGET_NAMESPACE); */ Init_gdk_pixbuf(RG_TARGET_NAMESPACE); Init_gdk_property(RG_TARGET_NAMESPACE); Init_gdk_rectangle(RG_TARGET_NAMESPACE); /* deprecated Init_gdk_rgb(RG_TARGET_NAMESPACE); */ Init_gdk_rgba(RG_TARGET_NAMESPACE); Init_gdk_screen(RG_TARGET_NAMESPACE); Init_gdk_selection(RG_TARGET_NAMESPACE); Init_gdk_threads(RG_TARGET_NAMESPACE); Init_gdk_timecoord(RG_TARGET_NAMESPACE); Init_gdk_visual(RG_TARGET_NAMESPACE); Init_gdk_window(RG_TARGET_NAMESPACE); Init_gdk_windowattr(RG_TARGET_NAMESPACE); } ��������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdk3.h��������������������������������������������������������0000644�0001750�0001750�00000004551�12257552167�016432� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGDK3_H__ #define __RBGDK3_H__ #include <gdk/gdk.h> #ifdef GDK_WINDOWING_X11 # include <gdk/gdkx.h> #endif #ifdef GDK_WINDOWING_WIN32 # include <gdk/gdkwin32.h> #endif #include "rbgdk3conversions.h" #define RBGDK_MAJOR_VERSION RBGLIB_MAJOR_VERSION #define RBGDK_MINOR_VERSION RBGLIB_MINOR_VERSION #define RBGDK_MICRO_VERSION RBGLIB_MICRO_VERSION #define RVAL2GDKPOINTS(value, n) rbgdk_rval2gdkpoints(value, n) #define RVAL2GDKATOMS(value, n) rbgdk_rval2gdkatoms(value, n) #define RVAL2GDKPIXBUFGLIST(value) rbgdk_rval2gdkpixbufglist(value) /* for backword compatibility. TODO: remove me. */ #define GEV2RVAL(ev) GDKEVENT2RVAL(ev) #define RVAL2GEV(ev) RVAL2GDKEVENT(ev) #define RVAL2ATOM(atom) (get_gdkatom(atom)) #define GDK_TYPE_GEOMETRY (gdk_geometry_get_type()) #define GDK_TYPE_ATOM (gdk_atom_get_type()) #define GDK_TYPE_WINDOW_ATTR (gdk_windowattr_get_type()) #define GDK_TYPE_TIME_COORD (gdk_timecoord_get_type()) typedef struct { GdkAtom atom; } GdkAtomData; GdkPoint *rbgdk_rval2gdkpoints(VALUE value, long *n); GdkAtom *rbgdk_rval2gdkatoms(VALUE value, long *n); GList *rbgdk_rval2gdkpixbufglist(VALUE value); extern GType gdk_windowattr_get_type(void); extern GType gdk_atom_get_type(void); extern GType gdk_geometry_get_type(void); extern GType gdk_timecoord_get_type(void); extern GdkAtom get_gdkatom(VALUE atom); extern VALUE rbgdk_gdkevent2rval(GdkEvent *event); extern GdkEvent *rbgdk_rval2gdkevent(VALUE event); #endif /* __RBGDK3_H__ */ �������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdk3conversions.h���������������������������������������������0000644�0001750�0001750�00000020275�12257552167�020724� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGDK3CONVERSIONS_H__ #define __RBGDK3CONVERSIONS_H__ #define RVAL2GDKDEVICE(o) (GDK_DEVICE(RVAL2GOBJ(o))) #define RVAL2GDKDISPLAY(o) (GDK_DISPLAY(RVAL2GOBJ(o))) #define RVAL2GDKDISPLAYMANAGER(o) (GDK_DISPLAY_MANAGER(RVAL2GOBJ(o))) #define RVAL2GDKDEVICEMANAGER(o) (GDK_DEVICE_MANAGER(RVAL2GOBJ(o))) #define RVAL2GDKDISPLAYOBJECT(o) (GDK_DISPLAY_OBJECT(RVAL2GOBJ(o))) #define RVAL2GDKDRAGCONTEXT(o) (GDK_DRAG_CONTEXT(RVAL2GOBJ(o))) #define RVAL2GDKDRAWABLE(o) (GDK_DRAWABLE(RVAL2GOBJ(o))) #define RVAL2GDKKEYMAP(o) (GDK_KEYMAP(RVAL2GOBJ(o))) #define RVAL2GDKPANGORENDERER(o) (GDK_PANGO_RENDERER(RVAL2GOBJ(o))) #define RVAL2GDKPIXBUF(o) (GDK_PIXBUF(RVAL2GOBJ(o))) #define RVAL2GDKSCREEN(o) (GDK_SCREEN(RVAL2GOBJ(o))) #define RVAL2GDKVISUAL(o) (GDK_VISUAL(RVAL2GOBJ(o))) #define RVAL2GDKWINDOW(o) (GDK_WINDOW(RVAL2GOBJ(o))) #define RVAL2GDKX11WINDOW(o) (GDK_X11_WINDOW(RVAL2GOBJ(o))) #define RVAL2GDKATOM(o) ((GdkAtomData*)RVAL2BOXED(o, GDK_TYPE_ATOM)) #define GDKATOM2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_ATOM)) #define RVAL2GDKCOLOR(o) ((GdkColor*)RVAL2BOXED(o, GDK_TYPE_COLOR)) #define GDKCOLOR2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_COLOR)) #define RVAL2GDKCURSOR(o) ((GdkCursor*)RVAL2BOXED(o, GDK_TYPE_CURSOR)) #define GDKCURSOR2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_CURSOR)) #define RVAL2GDKEVENT(o) (rbgdk_rval2gdkevent(o)) #define GDKEVENT2RVAL(o) (rbgdk_gdkevent2rval(o)) #define RVAL2GDKGEOMETRY(o) ((GdkGeometry*)RVAL2BOXED(o, GDK_TYPE_GEOMETRY)) #define GDKGEOMETRY2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_GEOMETRY)) #define RVAL2GDKRECTANGLE(o) ((GdkRectangle*)RVAL2BOXED(o, GDK_TYPE_RECTANGLE)) #define GDKRECTANGLE2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_RECTANGLE)) #define RVAL2GDKRGBA(o) ((GdkRGBA*)RVAL2BOXED(o, GDK_TYPE_RGBA)) #define GDKRGBA2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_RGBA)) #define RVAL2GDKTIMECOORD(o) ((GdkTimeCoord*)RVAL2BOXED(o, GDK_TYPE_TIME_COORD)) #define GDKTIMECOORD2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_TIME_COORD)) #define RVAL2GDKWINDOWATTR(o) ((GdkWindowAttr*)RVAL2BOXED(o, GDK_TYPE_WINDOW_ATTR)) #define GDKWINDOWATTR2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_WINDOW_ATTR)) #define RVAL2GDKEVENTKEY(o) ((GdkEventKey*)RVAL2GDKEVENT(o)) #define RVAL2GDKAXISUSE(o) (RVAL2GENUM(o, GDK_TYPE_AXIS_USE)) #define GDKAXISUSE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_AXIS_USE)) #define RVAL2GDKBYTEORDER(o) (RVAL2GENUM(o, GDK_TYPE_BYTE_ORDER)) #define GDKBYTEORDER2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_BYTE_ORDER)) #define RVAL2GDKCURSORTYPE(o) (RVAL2GENUM(o, GDK_TYPE_CURSOR_TYPE)) #define GDKCURSORTYPE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_CURSOR_TYPE)) #define RVAL2GDKDRAGPROTOCOL(o) (RVAL2GENUM(o, GDK_TYPE_DRAG_PROTOCOL)) #define GDKDRAGPROTOCOL2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_DRAG_PROTOCOL)) #define RVAL2GDKEVENTTYPE(o) (RVAL2GENUM(o, GDK_TYPE_EVENT_TYPE)) #define GDKEVENTTYPE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_EVENT_TYPE)) #define RVAL2GDKFILTERRETURN(o) (RVAL2GENUM(o, GDK_TYPE_FILTER_RETURN)) #define GDKFILTERRETURN2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_FILTER_RETURN)) #define RVAL2GDKGRABSTATUS(o) (RVAL2GENUM(o, GDK_TYPE_GRAB_STATUS)) #define GDKGRABSTATUS2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_GRAB_STATUS)) #define RVAL2GDKGRAVITY(o) (RVAL2GENUM(o, GDK_TYPE_GRAVITY)) #define GDKGRAVITY2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_GRAVITY)) #define RVAL2GDKINPUTMODE(o) (RVAL2GENUM(o, GDK_TYPE_INPUT_MODE)) #define GDKINPUTMODE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_INPUT_MODE)) #define RVAL2GDKINPUTSOURCE(o) (RVAL2GENUM(o, GDK_TYPE_INPUT_SOURCE)) #define GDKINPUTSOURCE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_INPUT_SOURCE)) #define RVAL2GDKGRABOWNERSHIP(o) (RVAL2GENUM(o, GDK_TYPE_GRAB_OWNERSHIP)) #define GDKGRABOWNERSHIP2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_GRAB_OWNERSHIP)) #define RVAL2GDKPROPMODE(o) (RVAL2GENUM(o, GDK_TYPE_PROP_MODE)) #define GDKPROPMODE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_PROP_MODE)) #define RVAL2GDKRGBDITHER(o) (RVAL2GENUM(o, GDK_TYPE_RGB_DITHER)) #define GDKRGBDITHER2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_RGB_DITHER)) #define RVAL2GDKVISUALTYPE(o) (RVAL2GENUM(o, GDK_TYPE_VISUAL_TYPE)) #define GDKVISUALTYPE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_VISUAL_TYPE)) #define RVAL2GDKWINDOWEDGE(o) (RVAL2GENUM(o, GDK_TYPE_WINDOW_EDGE)) #define GDKWINDOWEDGE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_WINDOW_EDGE)) #define RVAL2GDKWINDOWSTATE(o) (RVAL2GENUM(o, GDK_TYPE_WINDOW_STATE)) #define GDKWINDOWSTATE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_WINDOW_STATE)) #define RVAL2GDKWINDOWTYPE(o) (RVAL2GENUM(o, GDK_TYPE_WINDOW_TYPE)) #define GDKWINDOWTYPE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_WINDOW_TYPE)) #define RVAL2GDKWINDOWHINT(o) (RVAL2GENUM(o, GDK_TYPE_WINDOW_TYPE_HINT)) #define GDKWINDOWHINT2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_WINDOW_TYPE_HINT)) #define RVAL2GDKWINDOWWINDOWCLASS(o) (RVAL2GENUM(o, GDK_TYPE_WINDOW_WINDOW_CLASS)) #define GDKWINDOWWINDOWCLASS2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_WINDOW_WINDOW_CLASS)) #define RVAL2GDKDRAGACTION(o) (RVAL2GFLAGS(o, GDK_TYPE_DRAG_ACTION)) #define GDKDRAGACTION2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_DRAG_ACTION)) #define RVAL2GDKEVENTMASK(o) (RVAL2GFLAGS(o, GDK_TYPE_EVENT_MASK)) #define GDKEVENTMASK2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_EVENT_MASK)) #define RVAL2GDKMODIFIERTYPE(o) (RVAL2GFLAGS(o, GDK_TYPE_MODIFIER_TYPE)) #define GDKMODIFIERTYPE2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_MODIFIER_TYPE)) #define RVAL2GDKWINDOWHINTS(o) (RVAL2GFLAGS(o, GDK_TYPE_WINDOW_HINTS)) #define GDKWINDOWHINTS2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_WINDOW_HINTS)) #define RVAL2GDKWMDECORATION(o) (RVAL2GFLAGS(o, GDK_TYPE_WM_DECORATION)) #define GDKWMDECORATION2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_WM_DECORATION)) #define RVAL2GDKWMFUNCTION(o) (RVAL2GFLAGS(o, GDK_TYPE_WM_FUNCTION)) #define GDKWMFUNCTION2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_WM_FUNCTION)) #define RVAL2GDKDRAGACTION(o) (RVAL2GFLAGS(o, GDK_TYPE_DRAG_ACTION)) #define GDKDRAGACTION2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_DRAG_ACTION)) #define RVAL2GDKMODIFIERTYPE(o) (RVAL2GFLAGS(o, GDK_TYPE_MODIFIER_TYPE)) #define GDKMODIFIERTYPE2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_MODIFIER_TYPE)) #define RVAL2GDKWINDOWATTRIBUTESTYPE(o) (RVAL2GFLAGS(o, GDK_TYPE_WINDOW_ATTRIBUTES_TYPE)) #define GDKWINDOWATTRIBUTESTYPE2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_WINDOW_ATTRIBUTES_TYPE)) #define RVAL2GDKWINDOWHINTS(o) (RVAL2GFLAGS(o, GDK_TYPE_WINDOW_HINTS)) #define GDKWINDOWHINTS2RVAL(o) (GFLAGS2RVAL(o, GDK_TYPE_WINDOW_HINTS)) #endif /* __RBGDK3CONVERSIONS_H__ */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkx11.c������������������������������������������������������0000664�0001750�0001750�00000004536�11740310343�016661� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #ifdef GDK_WINDOWING_X11 #define RG_TARGET_NAMESPACE mGdkX11 /* deprecated static VALUE rg_s_xid_table_lookup(int argc, VALUE *argv, VALUE self) { VALUE arg[2]; GdkPixmap* win = NULL; rb_scan_args(argc, argv, "11", &arg[0], &arg[1]); switch(argc) { case 1: win = gdk_xid_table_lookup(NUM2UINT(arg[0])); break; case 2: win = gdk_xid_table_lookup_for_display(RVAL2GOBJ(arg[0]), NUM2UINT(arg[1])); break; } if (win == NULL) return Qnil; else { return GOBJ2RVAL(win); } } */ /* deprecated static VALUE rg_s_net_wm_supports_p(VALUE self, VALUE property) { return CBOOL2RVAL(gdk_net_wm_supports(RVAL2ATOM(property))); } */ static VALUE rg_s_default_screen(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_x11_get_default_screen()); } static VALUE rg_s_grab_server(G_GNUC_UNUSED VALUE self) { gdk_x11_grab_server(); return Qnil; } static VALUE rg_s_ungrab_server(G_GNUC_UNUSED VALUE self) { gdk_x11_ungrab_server(); return Qnil; } #endif void Init_gdkx11(void) { #ifdef GDK_WINDOWING_X11 VALUE RG_TARGET_NAMESPACE = rb_define_module("GdkX11"); /* deprecated RG_DEF_SMETHOD(xid_table_lookup, -1); */ /* deprecated RG_DEF_SMETHOD_P(net_wm_supports, 1); */ RG_DEF_SMETHOD(default_screen, 0); RG_DEF_SMETHOD(grab_server, 0); RG_DEF_SMETHOD(ungrab_server, 0); Init_gdkx11_x11window(RG_TARGET_NAMESPACE); #endif } ������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkvisual.c���������������������������������������������������0000644�0001750�0001750�00000013225�11701304107�017542� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cVisual #define _SELF(self) (RVAL2GDKVISUAL(self)) static VALUE rg_s_query_depths(G_GNUC_UNUSED VALUE self) { gint *depth; gint count; VALUE ary; int i; gdk_query_depths(&depth, &count); ary = rb_ary_new2(count); for (i = 0; i < count; i++) { rb_ary_push(ary, INT2NUM((depth)[i])); } return ary; } static VALUE rg_s_query_visual_types(G_GNUC_UNUSED VALUE self) { GdkVisualType *visual_types; gint count; VALUE ary; int i; gdk_query_visual_types(&visual_types, &count); ary = rb_ary_new2(count); for (i = 0; i < count; i++) { rb_ary_push(ary, GDKVISUALTYPE2RVAL((visual_types)[i])); } return ary; } static VALUE rg_s_visuals(G_GNUC_UNUSED VALUE self) { GList *list = gdk_list_visuals(), *cur; VALUE ary = rb_ary_new(); for (cur = list; cur != NULL; cur = cur->next) { rb_ary_push(ary, GOBJ2RVAL((GdkVisual *)cur->data)); } g_list_free(list); return ary; } static VALUE rg_s_best_depth(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_visual_get_best_depth()); } static VALUE rg_s_best_type(G_GNUC_UNUSED VALUE self) { return INT2NUM(gdk_visual_get_best_type()); } static VALUE rg_s_system(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_visual_get_system()); } static VALUE rg_s_best(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_visual_get_best()); } static VALUE rg_s_best_with_depth(G_GNUC_UNUSED VALUE self, VALUE depth) { return GOBJ2RVAL(gdk_visual_get_best_with_depth(NUM2INT(depth))); } static VALUE rg_s_best_with_type(G_GNUC_UNUSED VALUE self, VALUE type) { return GOBJ2RVAL(gdk_visual_get_best_with_depth( (GdkVisualType)GDKVISUALTYPE2RVAL(type))); } static VALUE rg_s_best_with_both(G_GNUC_UNUSED VALUE self, VALUE depth, VALUE type) { return GOBJ2RVAL(gdk_visual_get_best_with_both( NUM2INT(depth), (GdkVisualType)RVAL2GDKVISUALTYPE(type))); } static VALUE rg_screen(VALUE self) { return GOBJ2RVAL(gdk_visual_get_screen(_SELF(self))); } /* Structure accessors */ static VALUE rg_visual_type(VALUE self) { return GDKVISUALTYPE2RVAL(gdk_visual_get_visual_type(_SELF(self))); } static VALUE rg_depth(VALUE self) { return INT2FIX(gdk_visual_get_depth(_SELF(self))); } static VALUE rg_byte_order(VALUE self) { return GDKBYTEORDER2RVAL(gdk_visual_get_byte_order(_SELF(self))); } static VALUE rg_colormap_size(VALUE self) { return INT2FIX(gdk_visual_get_colormap_size(_SELF(self))); } static VALUE rg_bits_per_rgb(VALUE self) { return INT2FIX(gdk_visual_get_bits_per_rgb(_SELF(self))); } /* TODO static VALUE rg_red_mask(VALUE self) { return INT2FIX(_SELF(self)->red_mask); } static VALUE rg_red_shift(VALUE self) { return INT2FIX(_SELF(self)->red_shift); } static VALUE rg_red_prec(VALUE self) { return INT2FIX(_SELF(self)->red_prec); } static VALUE rg_green_mask(VALUE self) { return INT2FIX(_SELF(self)->green_mask); } static VALUE rg_green_shift(VALUE self) { return INT2FIX(_SELF(self)->green_shift); } static VALUE rg_green_prec(VALUE self) { return INT2FIX(_SELF(self)->green_prec); } static VALUE rg_blue_mask(VALUE self) { return INT2FIX(_SELF(self)->blue_mask); } static VALUE rg_blue_shift(VALUE self) { return INT2FIX(_SELF(self)->blue_shift); } static VALUE rg_blue_prec(VALUE self) { return INT2FIX(_SELF(self)->blue_prec); } */ void Init_gdk_visual(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_VISUAL, "Visual", mGdk); /* class methods */ RG_DEF_SMETHOD(query_depths, 0); RG_DEF_SMETHOD(query_visual_types, 0); RG_DEF_SMETHOD(visuals, 0); RG_DEF_SMETHOD(best_depth, 0); RG_DEF_SMETHOD(best_type, 0); RG_DEF_SMETHOD(system, 0); RG_DEF_SMETHOD(best, 0); RG_DEF_SMETHOD(best_with_depth, 1); RG_DEF_SMETHOD(best_with_type, 1); RG_DEF_SMETHOD(best_with_both, 2); /* instance methods */ RG_DEF_METHOD(screen, 0); RG_DEF_METHOD(visual_type, 0); RG_DEF_METHOD(depth, 0); RG_DEF_METHOD(byte_order, 0); RG_DEF_METHOD(colormap_size, 0); RG_DEF_METHOD(bits_per_rgb, 0); /* TODO RG_DEF_METHOD(red_mask, 0); RG_DEF_METHOD(red_shift, 0); RG_DEF_METHOD(red_prec, 0); RG_DEF_METHOD(green_mask, 0); RG_DEF_METHOD(green_shift, 0); RG_DEF_METHOD(green_prec, 0); RG_DEF_METHOD(blue_mask, 0); RG_DEF_METHOD(blue_shift, 0); RG_DEF_METHOD(blue_prec, 0); */ G_DEF_CLASS(GDK_TYPE_VISUAL_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_BYTE_ORDER, "ByteOrder", RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkevent.c����������������������������������������������������0000644�0001750�0001750�00000113465�12257552167�017411� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2002-2013 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" static VALUE rb_cGdkEvent; static VALUE rb_cGdkEventAny; static VALUE rb_cGdkEventExpose; static VALUE rb_cGdkEventVisibility; static VALUE rb_cGdkEventMotion; static VALUE rb_cGdkEventButton; static VALUE rb_cGdkEventTouch; static VALUE rb_cGdkEventScroll; static VALUE rb_cGdkEventKey; static VALUE rb_cGdkEventCrossing; static VALUE rb_cGdkEventFocus; static VALUE rb_cGdkEventConfigure; static VALUE rb_cGdkEventProperty; static VALUE rb_cGdkEventSelection; static VALUE rb_cGdkEventOwnerChange; static VALUE rb_cGdkEventProximity; static VALUE rb_cGdkEventDND; static VALUE rb_cGdkEventWindowState; static VALUE rb_cGdkEventSetting; static VALUE rb_cGdkEventGrabBroken; #define DEFINE_EVENT_TYPE(type_lower_case, type_upper_case) \ static GType \ rb_gdk_event_ ## type_lower_case ## _get_type(void) \ { \ static GType type = 0; \ if (type == 0) { \ type = g_boxed_type_register_static("GdkEvent" # type_upper_case, \ (GBoxedCopyFunc)gdk_event_copy, \ (GBoxedFreeFunc)gdk_event_free); \ } \ return type; \ } DEFINE_EVENT_TYPE(any, Any) DEFINE_EVENT_TYPE(expose, Expose) DEFINE_EVENT_TYPE(visibility, Visibility) DEFINE_EVENT_TYPE(motion, Motion) DEFINE_EVENT_TYPE(button, Button) DEFINE_EVENT_TYPE(touch, Touch) DEFINE_EVENT_TYPE(scroll, Scroll) DEFINE_EVENT_TYPE(key, Key) DEFINE_EVENT_TYPE(crossing, Crossing) DEFINE_EVENT_TYPE(focus, Focus) DEFINE_EVENT_TYPE(configure, Configure) DEFINE_EVENT_TYPE(property, Property) DEFINE_EVENT_TYPE(selection, Selection) DEFINE_EVENT_TYPE(owner_change, OwnerChange) DEFINE_EVENT_TYPE(proximity, Proximity) DEFINE_EVENT_TYPE(dnd, DND) DEFINE_EVENT_TYPE(window_state, WindowState) DEFINE_EVENT_TYPE(setting, Setting) DEFINE_EVENT_TYPE(grab_broken, GrabBroken) #define GDK_TYPE_EVENT_ANY (rb_gdk_event_any_get_type()) #define GDK_TYPE_EVENT_EXPOSE (rb_gdk_event_expose_get_type()) #define GDK_TYPE_EVENT_VISIBILITY (rb_gdk_event_visibility_get_type()) #define GDK_TYPE_EVENT_MOTION (rb_gdk_event_motion_get_type()) #define GDK_TYPE_EVENT_BUTTON (rb_gdk_event_button_get_type()) #define GDK_TYPE_EVENT_TOUCH (rb_gdk_event_touch_get_type()) #define GDK_TYPE_EVENT_SCROLL (rb_gdk_event_scroll_get_type()) #define GDK_TYPE_EVENT_KEY (rb_gdk_event_key_get_type()) #define GDK_TYPE_EVENT_CROSSING (rb_gdk_event_crossing_get_type()) #define GDK_TYPE_EVENT_FOCUS (rb_gdk_event_focus_get_type()) #define GDK_TYPE_EVENT_CONFIGURE (rb_gdk_event_configure_get_type()) #define GDK_TYPE_EVENT_PROPERTY (rb_gdk_event_property_get_type()) #define GDK_TYPE_EVENT_SELECTION (rb_gdk_event_selection_get_type()) #define GDK_TYPE_EVENT_OWNER_CHANGE (rb_gdk_event_owner_change_get_type()) #define GDK_TYPE_EVENT_PROXIMITY (rb_gdk_event_proximity_get_type()) #define GDK_TYPE_EVENT_DND (rb_gdk_event_dnd_get_type()) #define GDK_TYPE_EVENT_WINDOW_STATE (rb_gdk_event_window_state_get_type()) #define GDK_TYPE_EVENT_SETTING (rb_gdk_event_setting_get_type()) #define GDK_TYPE_EVENT_GRAB_BROKEN (rb_gdk_event_grab_broken_get_type()) /***********************************************/ static GType rb_gdk_event_type_to_gtype(GdkEventType event_type) { GType gtype = GDK_TYPE_EVENT_ANY; switch (event_type) { case GDK_NOTHING: case GDK_DELETE: case GDK_DESTROY: break; case GDK_EXPOSE: gtype = GDK_TYPE_EVENT_EXPOSE; break; case GDK_MOTION_NOTIFY: gtype = GDK_TYPE_EVENT_MOTION; break; case GDK_BUTTON_PRESS: case GDK_2BUTTON_PRESS: case GDK_3BUTTON_PRESS: case GDK_BUTTON_RELEASE: gtype = GDK_TYPE_EVENT_BUTTON; break; case GDK_KEY_PRESS: case GDK_KEY_RELEASE: gtype = GDK_TYPE_EVENT_KEY; break; case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: gtype = GDK_TYPE_EVENT_CROSSING; break; case GDK_FOCUS_CHANGE: gtype = GDK_TYPE_EVENT_FOCUS; break; case GDK_CONFIGURE: gtype = GDK_TYPE_EVENT_CONFIGURE; break; case GDK_MAP: case GDK_UNMAP: break; case GDK_PROPERTY_NOTIFY: gtype = GDK_TYPE_EVENT_PROPERTY; break; case GDK_SELECTION_CLEAR: case GDK_SELECTION_REQUEST: case GDK_SELECTION_NOTIFY: gtype = GDK_TYPE_EVENT_SELECTION; break; case GDK_PROXIMITY_IN: case GDK_PROXIMITY_OUT: gtype = GDK_TYPE_EVENT_PROXIMITY; break; case GDK_DRAG_ENTER: case GDK_DRAG_LEAVE: case GDK_DRAG_MOTION: case GDK_DRAG_STATUS: case GDK_DROP_START: case GDK_DROP_FINISHED: gtype = GDK_TYPE_EVENT_DND; break; case GDK_CLIENT_EVENT: break; case GDK_VISIBILITY_NOTIFY: gtype = GDK_TYPE_EVENT_VISIBILITY; break; case GDK_SCROLL: gtype = GDK_TYPE_EVENT_SCROLL; break; case GDK_WINDOW_STATE: gtype = GDK_TYPE_EVENT_WINDOW_STATE; break; case GDK_SETTING: gtype = GDK_TYPE_EVENT_SETTING; break; case GDK_OWNER_CHANGE: gtype = GDK_TYPE_EVENT_OWNER_CHANGE; break; case GDK_GRAB_BROKEN: gtype = GDK_TYPE_EVENT_GRAB_BROKEN; break; case GDK_DAMAGE: gtype = GDK_TYPE_EVENT_EXPOSE; break; case GDK_TOUCH_BEGIN: case GDK_TOUCH_UPDATE: case GDK_TOUCH_END: case GDK_TOUCH_CANCEL: gtype = GDK_TYPE_EVENT_TOUCH; break; case GDK_EVENT_LAST: break; default: break; } return gtype; } static VALUE rb_gdk_event_type_to_class(GdkEventType event_type) { VALUE klass = Qnil; switch (event_type) { case GDK_NOTHING: case GDK_DELETE: case GDK_DESTROY: break; case GDK_EXPOSE: klass = rb_cGdkEventExpose; break; case GDK_MOTION_NOTIFY: klass = rb_cGdkEventMotion; break; case GDK_BUTTON_PRESS: case GDK_2BUTTON_PRESS: case GDK_3BUTTON_PRESS: case GDK_BUTTON_RELEASE: klass = rb_cGdkEventButton; break; case GDK_KEY_PRESS: case GDK_KEY_RELEASE: klass = rb_cGdkEventKey; break; case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: klass = rb_cGdkEventCrossing; break; case GDK_FOCUS_CHANGE: klass = rb_cGdkEventFocus; break; case GDK_CONFIGURE: klass = rb_cGdkEventConfigure; break; case GDK_MAP: case GDK_UNMAP: break; case GDK_PROPERTY_NOTIFY: klass = rb_cGdkEventProperty; break; case GDK_SELECTION_CLEAR: case GDK_SELECTION_REQUEST: case GDK_SELECTION_NOTIFY: klass = rb_cGdkEventSelection; break; case GDK_PROXIMITY_IN: case GDK_PROXIMITY_OUT: klass = rb_cGdkEventProximity; break; case GDK_DRAG_ENTER: case GDK_DRAG_LEAVE: case GDK_DRAG_MOTION: case GDK_DRAG_STATUS: case GDK_DROP_START: case GDK_DROP_FINISHED: klass = rb_cGdkEventDND; break; case GDK_CLIENT_EVENT: break; case GDK_VISIBILITY_NOTIFY: klass = rb_cGdkEventVisibility; break; case GDK_SCROLL: klass = rb_cGdkEventScroll; break; case GDK_WINDOW_STATE: klass = rb_cGdkEventWindowState; break; case GDK_SETTING: klass = rb_cGdkEventSetting; break; case GDK_OWNER_CHANGE: klass = rb_cGdkEventOwnerChange; break; case GDK_GRAB_BROKEN: klass = rb_cGdkEventGrabBroken; break; case GDK_DAMAGE: klass = rb_cGdkEventExpose; break; case GDK_TOUCH_BEGIN: case GDK_TOUCH_UPDATE: case GDK_TOUCH_END: case GDK_TOUCH_CANCEL: klass = rb_cGdkEventTouch; break; case GDK_EVENT_LAST: break; default: break; } if (NIL_P(klass)) { klass = rb_cGdkEventAny; } return klass; } static GType rb_gdk_event_to_gtype(VALUE event) { VALUE klass; GType type = GDK_TYPE_EVENT; klass = rb_obj_class(event); if (klass == rb_cGdkEvent) { type = GDK_TYPE_EVENT; } else if (klass == rb_cGdkEventAny) { type = GDK_TYPE_EVENT_ANY; } else if (klass == rb_cGdkEventExpose) { type = GDK_TYPE_EVENT_EXPOSE; } else if (klass == rb_cGdkEventVisibility) { type = GDK_TYPE_EVENT_VISIBILITY; } else if (klass == rb_cGdkEventMotion) { type = GDK_TYPE_EVENT_MOTION; } else if (klass == rb_cGdkEventButton) { type = GDK_TYPE_EVENT_BUTTON; } else if (klass == rb_cGdkEventScroll) { type = GDK_TYPE_EVENT_SCROLL; } else if (klass == rb_cGdkEventKey) { type = GDK_TYPE_EVENT_KEY; } else if (klass == rb_cGdkEventCrossing) { type = GDK_TYPE_EVENT_CROSSING; } else if (klass == rb_cGdkEventFocus) { type = GDK_TYPE_EVENT_FOCUS; } else if (klass == rb_cGdkEventConfigure) { type = GDK_TYPE_EVENT_CONFIGURE; } else if (klass == rb_cGdkEventProperty) { type = GDK_TYPE_EVENT_PROPERTY; } else if (klass == rb_cGdkEventSelection) { type = GDK_TYPE_EVENT_SELECTION; } else if (klass == rb_cGdkEventOwnerChange) { type = GDK_TYPE_EVENT_OWNER_CHANGE; } else if (klass == rb_cGdkEventProximity) { type = GDK_TYPE_EVENT_PROXIMITY; } else if (klass == rb_cGdkEventDND) { type = GDK_TYPE_EVENT_DND; } else if (klass == rb_cGdkEventWindowState) { type = GDK_TYPE_EVENT_WINDOW_STATE; } else if (klass == rb_cGdkEventSetting) { type = GDK_TYPE_EVENT_SETTING; } else if (klass == rb_cGdkEventGrabBroken) { type = GDK_TYPE_EVENT_GRAB_BROKEN; } else if (klass == rb_cGdkEventTouch) { type = GDK_TYPE_EVENT_TOUCH; } else { rb_raise(rb_eArgError, "Not event object: %s", RBG_INSPECT(event)); } return type; } VALUE rbgdk_gdkevent2rval(GdkEvent *event) { return BOXED2RVAL(event, rb_gdk_event_type_to_gtype(event->any.type)); } GdkEvent * rbgdk_rval2gdkevent(VALUE event) { return RVAL2BOXED(event, rb_gdk_event_to_gtype(event)); } /***********************************************/ #define ATTR_STR(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return CSTR2RVAL(RVAL2GDKEVENT(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ RVAL2GDKEVENT(self)->type.name = (gchar *)RVAL2CSTR(val);\ return self;\ } #define ATTR_INT(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return INT2NUM(RVAL2GDKEVENT(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ RVAL2GDKEVENT(self)->type.name = NUM2INT(val);\ return self;\ } #define ATTR_UINT(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return UINT2NUM(RVAL2GDKEVENT(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ RVAL2GDKEVENT(self)->type.name = NUM2UINT(val);\ return self;\ } #define ATTR_GDKWINDOW(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return GOBJ2RVAL(RVAL2GDKEVENT(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ RVAL2GDKEVENT(self)->type.name = RVAL2GDKWINDOW(val);\ return self;\ } #define ATTR_FLOAT(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return rb_float_new(RVAL2GDKEVENT(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ RVAL2GDKEVENT(self)->type.name = NUM2DBL(val);\ return self;\ } #define ATTR_GOBJ(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return GOBJ2RVAL(RVAL2GDKEVENT(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ GdkEvent *event;\ event = RVAL2GDKEVENT(self);\ if (event->type.name)\ g_object_unref(event->type.name);\ event->type.name = RVAL2GOBJ(val);\ if (event->type.name)\ g_object_ref(event->type.name);\ return self;\ } #define ATTR_BOOL(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return CBOOL2RVAL(RVAL2GDKEVENT(self)->type.name);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ RVAL2GDKEVENT(self)->type.name = RVAL2CBOOL(val);\ return self;\ } #define ATTR_ATOM(type, name)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ GdkAtom atom = RVAL2GDKEVENT(self)->type.name;\ return GDKATOM2RVAL(atom);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ RVAL2GDKEVENT(self)->type.name = RVAL2ATOM(val);\ return self;\ } #define ATTR_FLAGS(type, name, gtype)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return GFLAGS2RVAL(RVAL2GDKEVENT(self)->type.name, gtype);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ RVAL2GDKEVENT(self)->type.name = RVAL2GFLAGS(val, gtype);\ return self;\ } #define ATTR_ENUM(type, name, gtype)\ static VALUE \ gdkevent ## type ## _ ## name (VALUE self)\ {\ return GENUM2RVAL(RVAL2GDKEVENT(self)->type.name, gtype);\ }\ static VALUE \ gdkevent ## type ## _set_ ## name (VALUE self, VALUE val)\ {\ RVAL2GDKEVENT(self)->type.name = RVAL2GENUM(val, gtype);\ return self;\ } #define ATTR_AXES(type, gdkklass) \ static VALUE \ gdkevent ##type ## _axes(VALUE self)\ {\ gdkklass type = RVAL2GDKEVENT(self)->type;\ return type.axes ? rb_ary_new3(2, \ rb_float_new(type.axes[0]),\ rb_float_new(type.axes[1])) : Qnil;\ } \ static VALUE \ gdkevent ## type ## _set_axes(VALUE self, VALUE x, VALUE y)\ {\ gdkklass val = RVAL2GDKEVENT(self)->type;\ val.axes[0] = NUM2DBL(x);\ val.axes[1] = NUM2DBL(y);\ return self;\ } #define DEFINE_ACCESSOR(event, type, name) \ rbg_define_method(event, G_STRINGIFY(name), gdkevent ## type ## _## name, 0);\ rbg_define_method(event, G_STRINGIFY(set_ ## name), gdkevent ## type ## _set_## name, 1); /* initialize */ #define GDKEVENT_INIT(type, default_gtype) \ static VALUE \ gdkevent ## type ## _initialize(int argc, VALUE *argv, VALUE self)\ {\ VALUE type;\ GdkEventType gtype;\ \ rb_scan_args(argc, argv, "01", &type);\ if (NIL_P(type)){\ gtype = default_gtype;\ } else {\ gtype = RVAL2GDKEVENTTYPE(type);\ }\ \ G_INITIALIZE(self, gdk_event_new(gtype));\ return Qnil;\ } #define DEFINE_INIT(event, type) \ rbg_define_method(event, "initialize", gdkevent ## type ## _initialize, -1); /***********************************************/ /* GdkEvent Singleton Methods */ static VALUE gdkevent_s_events_pending(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gdk_events_pending()); } static VALUE gdkevent_s_peek(G_GNUC_UNUSED VALUE self) { return GDKEVENT2RVAL(gdk_event_peek()); } static VALUE gdkevent_s_get(G_GNUC_UNUSED VALUE self) { return GDKEVENT2RVAL(gdk_event_get()); } /* GdkEvent */ static VALUE gdkevent_initialize(VALUE self, VALUE type) { GdkEventType event_type; VALUE klass; event_type = RVAL2GDKEVENTTYPE(type); klass = rb_gdk_event_type_to_class(event_type); if (!RVAL2CBOOL(rb_obj_is_kind_of(self, klass))) { rb_raise(rb_eArgError, "Wrong event type for this class."); } G_INITIALIZE(self, gdk_event_new(event_type)); return Qnil; } static VALUE gdkevent_type(VALUE self) { return GDKEVENTTYPE2RVAL(RVAL2GDKEVENT(self)->type); } static VALUE gdkevent_put(VALUE self) { gdk_event_put(RVAL2GDKEVENT(self)); return self; } /* We don't need this. gdk_event_get_time(); gboolean gdk_event_get_state (GdkEvent *event, GdkModifierType *state); */ static VALUE gdkevent_get_axis(VALUE self, VALUE axis_use) { gdouble value; gboolean ret = gdk_event_get_axis(RVAL2GDKEVENT(self), RVAL2GDKAXISUSE(axis_use), &value); return ret ? rb_float_new(value) : Qnil; } static VALUE gdkevent_get_coords(VALUE self) { gdouble x_win, y_win; gboolean ret = gdk_event_get_coords(RVAL2GDKEVENT(self), &x_win, &y_win); return ret ? rb_ary_new3(2, rb_float_new(x_win), rb_float_new(y_win)) : Qnil; } static VALUE gdkevent_get_root_coords(VALUE self) { gdouble x_root, y_root; gboolean ret = gdk_event_get_root_coords(RVAL2GDKEVENT(self), &x_root, &y_root); return ret ? rb_ary_new3(2, rb_float_new(x_root), rb_float_new(y_root)) : Qnil; } static void handler_func(GdkEvent *event, gpointer func) { rb_funcall((VALUE)func, id_call, 1, GDKEVENT2RVAL(event)); } static VALUE gdkevent_s_handler_set(VALUE self) { volatile VALUE func = rb_block_proc(); G_RELATIVE(self, func); gdk_event_handler_set((GdkEventFunc)handler_func, (gpointer)func, NULL); return self; } static VALUE gdkevent_s_get_show_events(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gdk_get_show_events()); } static VALUE gdkevent_s_set_show_events(VALUE self, VALUE show_events) { gdk_set_show_events(RVAL2CBOOL(show_events)); return self; } static VALUE gdkevent_set_screen(VALUE self, VALUE screen) { gdk_event_set_screen(RVAL2GDKEVENT(self), RVAL2GDKSCREEN(screen)); return self; } static VALUE gdkevent_screen(VALUE self) { return GOBJ2RVAL(gdk_event_get_screen(RVAL2GDKEVENT(self))); } /* type: String, Integer, Gdk::Color. */ static VALUE gdkevent_s_setting_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE name, type; GType gtype; GValue val = G_VALUE_INIT; gboolean ret; VALUE value; rb_scan_args(argc, argv, "11", &name, &type); if (NIL_P(type)) gtype = G_TYPE_STRING; else gtype = CLASS2GTYPE(type); g_value_init(&val, gtype); ret = gdk_setting_get(RVAL2CSTR(name), &val); value = ret ? GVAL2RVAL(&val) : Qnil; g_value_unset(&val); return value; } /* GdkEventAny */ ATTR_GOBJ(any, window); ATTR_BOOL(any, send_event); /* GdkEventKey */ ATTR_UINT(key, time); ATTR_FLAGS(key, state, GDK_TYPE_MODIFIER_TYPE); ATTR_INT(key, keyval); ATTR_UINT(key, hardware_keycode); ATTR_UINT(key, group); /* GdkEventButton */ ATTR_UINT(button, time); ATTR_FLOAT(button, x); ATTR_FLOAT(button, y); ATTR_AXES(button, GdkEventButton); ATTR_INT(button, button); ATTR_FLAGS(button, state, GDK_TYPE_MODIFIER_TYPE); ATTR_GOBJ(button, device); ATTR_FLOAT(button, x_root); ATTR_FLOAT(button, y_root); /* GdkEventTouch */ ATTR_GOBJ(touch, window); ATTR_BOOL(touch, send_event); ATTR_UINT(touch, time); ATTR_FLOAT(touch, x); ATTR_FLOAT(touch, y); ATTR_AXES(touch, GdkEventTouch); ATTR_FLAGS(touch, state, GDK_TYPE_MODIFIER_TYPE); ATTR_BOOL(touch, emulating_pointer); ATTR_GOBJ(touch, device); ATTR_FLOAT(touch, x_root); ATTR_FLOAT(touch, y_root); /* GdkEventScroll */ ATTR_UINT(scroll, time); ATTR_FLOAT(scroll, x); ATTR_FLOAT(scroll, y); ATTR_FLAGS(scroll, state, GDK_TYPE_MODIFIER_TYPE); ATTR_ENUM(scroll, direction, GDK_TYPE_SCROLL_DIRECTION); ATTR_GOBJ(scroll, device); ATTR_FLOAT(scroll, x_root); ATTR_FLOAT(scroll, y_root); GDKEVENT_INIT(scroll, GDK_SCROLL); /* GdkEventMotion */ ATTR_UINT(motion, time); ATTR_FLOAT(motion, x); ATTR_FLOAT(motion, y); ATTR_AXES(motion, GdkEventMotion); ATTR_FLOAT(motion, x_root); ATTR_FLOAT(motion, y_root); ATTR_FLAGS(motion, state, GDK_TYPE_MODIFIER_TYPE); ATTR_BOOL(motion, is_hint); ATTR_GOBJ(motion, device); GDKEVENT_INIT(motion, GDK_MOTION_NOTIFY); static VALUE gdkeventmotion_request_motions(VALUE self) { gdk_event_request_motions(&(RVAL2GDKEVENT(self)->motion)); return self; } /* GdkEventExpose */ static VALUE gdkeventexpose_area(VALUE self) { return GDKRECTANGLE2RVAL(&RVAL2GDKEVENT(self)->expose.area); } static VALUE gdkeventexpose_set_area(VALUE self, VALUE rect) { GdkRectangle* grect = RVAL2GDKRECTANGLE(rect); GdkEventExpose *event = &(RVAL2GDKEVENT(self)->expose); event->area.x = grect->x; event->area.y = grect->y; event->area.width = grect->width; event->area.height = grect->height; return self; } static VALUE gdkeventexpose_region(VALUE self) { return CRREGION2RVAL(RVAL2GDKEVENT(self)->expose.region); } static VALUE gdkeventexpose_set_region(VALUE self, VALUE region) { RVAL2GDKEVENT(self)->expose.region = RVAL2CRREGION(region); return self; } ATTR_INT(expose, count); GDKEVENT_INIT(expose, GDK_EXPOSE); /* GdkEventVisibility */ ATTR_ENUM(visibility, state, GDK_TYPE_VISIBILITY_STATE); GDKEVENT_INIT(visibility, GDK_VISIBILITY_NOTIFY); /* GdkEventCrossing */ ATTR_GOBJ(crossing, subwindow); ATTR_UINT(crossing, time); ATTR_INT(crossing, x); ATTR_INT(crossing, y); ATTR_FLOAT(crossing, x_root); ATTR_FLOAT(crossing, y_root); ATTR_ENUM(crossing, mode, GDK_TYPE_CROSSING_MODE); ATTR_ENUM(crossing, detail, GDK_TYPE_NOTIFY_TYPE); ATTR_BOOL(crossing, focus); ATTR_FLAGS(crossing, state, GDK_TYPE_MODIFIER_TYPE); /* GdkEventFocus */ ATTR_BOOL(focus_change, in); GDKEVENT_INIT(focus_change, GDK_FOCUS_CHANGE); /* GdkEventConfigure */ ATTR_INT(configure, x); ATTR_INT(configure, y); ATTR_INT(configure, width); ATTR_INT(configure, height); GDKEVENT_INIT(configure, GDK_CONFIGURE); /* GdkEventProperty */ ATTR_ATOM(property, atom); ATTR_UINT(property, time); ATTR_ENUM(property, state, GDK_TYPE_PROPERTY_STATE); GDKEVENT_INIT(property, GDK_PROPERTY_NOTIFY); /* GdkEventSelection */ ATTR_ATOM(selection, selection); ATTR_ATOM(selection, target); ATTR_ATOM(selection, property); ATTR_GDKWINDOW(selection, requestor); ATTR_INT(selection, time); /* GdkEventDND */ ATTR_GOBJ(dnd, context); ATTR_UINT(dnd, time); ATTR_INT(dnd, x_root); ATTR_INT(dnd, y_root); /* GdkEventProximity */ ATTR_UINT(proximity, time); ATTR_GOBJ(proximity, device); /* GdkEventWindowState */ ATTR_FLAGS(window_state, changed_mask, GDK_TYPE_WINDOW_STATE); ATTR_FLAGS(window_state, new_window_state, GDK_TYPE_WINDOW_STATE); GDKEVENT_INIT(window_state, GDK_WINDOW_STATE); /* GdkEventSetting */ ATTR_ENUM(setting, action, GDK_TYPE_SETTING_ACTION); ATTR_STR(setting, name); GDKEVENT_INIT(setting, GDK_SETTING); /* GdkEventOwnerChange */ ATTR_GDKWINDOW(owner_change, owner); ATTR_ENUM(owner_change, reason, GDK_TYPE_OWNER_CHANGE); ATTR_ATOM(owner_change, selection); ATTR_UINT(owner_change, time); ATTR_UINT(owner_change, selection_time); GDKEVENT_INIT(owner_change, GDK_OWNER_CHANGE); /* GdkEventGrabBroken */ ATTR_BOOL(grab_broken, keyboard); ATTR_BOOL(grab_broken, implicit); ATTR_GOBJ(grab_broken, grab_window); GDKEVENT_INIT(grab_broken, GDK_GRAB_BROKEN); /* MISC */ static VALUE gdkevent_g2r(const GValue *values) { return GDKEVENT2RVAL(g_value_get_boxed(&values[0])); } void Init_gdk_event(VALUE mGdk) { /* GdkEvent */ rb_cGdkEvent = G_DEF_CLASS(GDK_TYPE_EVENT, "Event", mGdk); rbg_define_method(rb_cGdkEvent, "initialize", gdkevent_initialize, 1); rbg_define_method(rb_cGdkEvent, "event_type", gdkevent_type, 0); rbg_define_singleton_method(rb_cGdkEvent, "events_pending?", gdkevent_s_events_pending, 0); rbg_define_singleton_method(rb_cGdkEvent, "peek", gdkevent_s_peek, 0); rbg_define_singleton_method(rb_cGdkEvent, "get", gdkevent_s_get, 0); rbg_define_method(rb_cGdkEvent, "put", gdkevent_put, 0); rbg_define_method(rb_cGdkEvent, "get_axis", gdkevent_get_axis, 1); rbg_define_method(rb_cGdkEvent, "coords", gdkevent_get_coords, 0); rbg_define_method(rb_cGdkEvent, "root_coords", gdkevent_get_root_coords, 0); rbg_define_singleton_method(rb_cGdkEvent, "handler_set", gdkevent_s_handler_set, 0); rbg_define_singleton_method(rb_cGdkEvent, "show_events?", gdkevent_s_get_show_events, 0); rbg_define_singleton_method(rb_cGdkEvent, "set_show_events", gdkevent_s_set_show_events, 1); rbg_define_singleton_method(rb_cGdkEvent, "setting_get", gdkevent_s_setting_get, -1); rbg_define_method(rb_cGdkEvent, "screen", gdkevent_screen, 0); rbg_define_method(rb_cGdkEvent, "set_screen", gdkevent_set_screen, 1); /* * GdkEvent's Constants */ rb_define_const(rb_cGdkEvent, "CURRENT_TIME", INT2FIX(GDK_CURRENT_TIME)); rb_define_const(rb_cGdkEvent, "PRIORITY_EVENTS", INT2FIX(GDK_PRIORITY_EVENTS)); rb_define_const(rb_cGdkEvent, "PRIORITY_REDRAW", INT2FIX(GDK_PRIORITY_REDRAW)); /* GdkEventType */ /* XXX */ G_RENAME_CONSTANT("2BUTTON_PRESS","BUTTON2_PRESS"); G_RENAME_CONSTANT("3BUTTON_PRESS","BUTTON3_PRESS"); G_DEF_CLASS(GDK_TYPE_EVENT_TYPE, "Type", rb_cGdkEvent); G_RENAME_CONSTANT("2BUTTON_PRESS","BUTTON2_PRESS"); G_RENAME_CONSTANT("3BUTTON_PRESS","BUTTON3_PRESS"); G_DEF_CONSTANTS(rb_cGdkEvent, GDK_TYPE_EVENT_TYPE, "GDK_"); /* GdkEventMask */ G_DEF_CLASS(GDK_TYPE_EVENT_MASK, "Mask", rb_cGdkEvent); G_DEF_CONSTANTS(rb_cGdkEvent, GDK_TYPE_EVENT_MASK, "GDK_"); /* GdkEventAny */ rb_cGdkEventAny = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_ANY, "EventAny", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventAny, any, window); rbg_define_method(rb_cGdkEventAny, "send_event?", gdkeventany_send_event, 0); rbg_define_method(rb_cGdkEventAny, "set_send_event", gdkeventany_set_send_event, 1); /* GdkEventExpose */ rb_cGdkEventExpose = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_EXPOSE, "EventExpose", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventExpose, expose, area); DEFINE_ACCESSOR(rb_cGdkEventExpose, expose, region); DEFINE_ACCESSOR(rb_cGdkEventExpose, expose, count); DEFINE_INIT(rb_cGdkEventExpose, expose); /* GdkEventVisibility */ rb_cGdkEventVisibility = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_VISIBILITY, "EventVisibility", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventVisibility, visibility, state); DEFINE_INIT(rb_cGdkEventVisibility, visibility); /* GdkVisibilityState */ G_DEF_CLASS(GDK_TYPE_VISIBILITY_STATE, "State", rb_cGdkEventVisibility); G_DEF_CONSTANTS(rb_cGdkEventVisibility, GDK_TYPE_VISIBILITY_STATE, "GDK_VISIBILITY_"); /* GdkEventMotion */ rb_cGdkEventMotion = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_MOTION, "EventMotion", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, time); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, x); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, y); rbg_define_method(rb_cGdkEventMotion, "axes", gdkeventmotion_axes, 0); rbg_define_method(rb_cGdkEventMotion, "set_axes", gdkeventmotion_set_axes, 1); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, state); rbg_define_method(rb_cGdkEventMotion, "hint?", gdkeventmotion_is_hint, 0); rbg_define_method(rb_cGdkEventMotion, "set_hint", gdkeventmotion_set_is_hint, 1); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, device); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, x_root); DEFINE_ACCESSOR(rb_cGdkEventMotion, motion, y_root); DEFINE_INIT(rb_cGdkEventMotion, motion); rbg_define_method(rb_cGdkEventMotion, "request", gdkeventmotion_request_motions, 0); /* GdkEventButton */ rb_cGdkEventButton = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_BUTTON, "EventButton", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventButton, button, time); DEFINE_ACCESSOR(rb_cGdkEventButton, button, x); DEFINE_ACCESSOR(rb_cGdkEventButton, button, y); rbg_define_method(rb_cGdkEventButton, "axes", gdkeventbutton_axes, 0); rbg_define_method(rb_cGdkEventButton, "set_axes", gdkeventbutton_set_axes, 2); DEFINE_ACCESSOR(rb_cGdkEventButton, button, state); DEFINE_ACCESSOR(rb_cGdkEventButton, button, button); DEFINE_ACCESSOR(rb_cGdkEventButton, button, device); DEFINE_ACCESSOR(rb_cGdkEventButton, button, x_root); DEFINE_ACCESSOR(rb_cGdkEventButton, button, y_root); /* GdkEventTouch */ rb_cGdkEventTouch = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_TOUCH, "EventTouch", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventTouch, touch, window); rbg_define_method(rb_cGdkEventTouch, "send_event?", gdkeventtouch_send_event, 0); rbg_define_method(rb_cGdkEventTouch, "set_send_event", gdkeventtouch_set_send_event, 1); DEFINE_ACCESSOR(rb_cGdkEventTouch, touch, time); DEFINE_ACCESSOR(rb_cGdkEventTouch, touch, x); DEFINE_ACCESSOR(rb_cGdkEventTouch, touch, y); rbg_define_method(rb_cGdkEventTouch, "axes", gdkeventtouch_axes, 0); rbg_define_method(rb_cGdkEventTouch, "set_axes", gdkeventtouch_set_axes, 2); DEFINE_ACCESSOR(rb_cGdkEventTouch, touch, state); DEFINE_ACCESSOR(rb_cGdkEventTouch, touch, emulating_pointer); DEFINE_ACCESSOR(rb_cGdkEventTouch, touch, device); DEFINE_ACCESSOR(rb_cGdkEventTouch, touch, x_root); DEFINE_ACCESSOR(rb_cGdkEventTouch, touch, y_root); /* GdkEventScroll */ rb_cGdkEventScroll = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_SCROLL, "EventScroll", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, time); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, x); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, y); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, state); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, direction); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, device); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, x_root); DEFINE_ACCESSOR(rb_cGdkEventScroll, scroll, y_root); DEFINE_INIT(rb_cGdkEventScroll, scroll); /* GdkScrollDirection */ G_DEF_CLASS(GDK_TYPE_SCROLL_DIRECTION, "Direction", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventScroll, GDK_TYPE_SCROLL_DIRECTION, "GDK_SCROLL_"); /* GdkEventKey */ rb_cGdkEventKey = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_KEY, "EventKey", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventKey, key, time); DEFINE_ACCESSOR(rb_cGdkEventKey, key, state); DEFINE_ACCESSOR(rb_cGdkEventKey, key, keyval); DEFINE_ACCESSOR(rb_cGdkEventKey, key, hardware_keycode); DEFINE_ACCESSOR(rb_cGdkEventKey, key, group); /* GdkEventCrossing */ rb_cGdkEventCrossing = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_CROSSING, "EventCrossing", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, subwindow); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, time); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, x); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, y); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, x_root); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, y_root); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, mode); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, detail); rbg_define_method(rb_cGdkEventCrossing, "focus?", gdkeventcrossing_focus, 0); rbg_define_method(rb_cGdkEventCrossing, "set_focus", gdkeventcrossing_set_focus, 1); DEFINE_ACCESSOR(rb_cGdkEventCrossing, crossing, state); /* GdkCrossingMode */ G_DEF_CLASS(GDK_TYPE_CROSSING_MODE, "Mode", rb_cGdkEventCrossing); G_DEF_CONSTANTS(rb_cGdkEventCrossing, GDK_TYPE_CROSSING_MODE, "GDK_CROSSING_"); /* GdkNotifyType */ G_DEF_CLASS(GDK_TYPE_NOTIFY_TYPE, "NotifyType", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventScroll, GDK_TYPE_NOTIFY_TYPE, "GDK_"); /* GdkEventFocus */ rb_cGdkEventFocus = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_FOCUS, "EventFocus", mGdk, rb_cGdkEvent); rbg_define_method(rb_cGdkEventFocus, "in?", gdkeventfocus_change_in, 0); rbg_define_method(rb_cGdkEventFocus, "set_in", gdkeventfocus_change_set_in, 1); DEFINE_INIT(rb_cGdkEventFocus, focus_change); /* GdkEventConfigure */ rb_cGdkEventConfigure = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_CONFIGURE, "EventConfigure", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventConfigure, configure, x); DEFINE_ACCESSOR(rb_cGdkEventConfigure, configure, y); DEFINE_ACCESSOR(rb_cGdkEventConfigure, configure, width); DEFINE_ACCESSOR(rb_cGdkEventConfigure, configure, height); DEFINE_INIT(rb_cGdkEventConfigure, configure); /* GdkEventProperty */ rb_cGdkEventProperty = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_PROPERTY, "EventProperty", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventProperty, property, atom); DEFINE_ACCESSOR(rb_cGdkEventProperty, property, time); DEFINE_ACCESSOR(rb_cGdkEventProperty, property, state); DEFINE_INIT(rb_cGdkEventProperty, property); /* GdkPropertyState */ G_DEF_CLASS(GDK_TYPE_PROPERTY_STATE, "State", rb_cGdkEventProperty); G_DEF_CONSTANTS(rb_cGdkEventProperty, GDK_TYPE_PROPERTY_STATE, "GDK_"); /* GdkEventSelection */ rb_cGdkEventSelection = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_SELECTION, "EventSelection", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventSelection, selection, selection); DEFINE_ACCESSOR(rb_cGdkEventSelection, selection, target); DEFINE_ACCESSOR(rb_cGdkEventSelection, selection, property); DEFINE_ACCESSOR(rb_cGdkEventSelection, selection, requestor); DEFINE_ACCESSOR(rb_cGdkEventSelection, selection, time); /* GdkEventOwnerChange */ rb_cGdkEventOwnerChange = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_OWNER_CHANGE, "EventOwnerChange", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventOwnerChange, owner_change, owner); DEFINE_ACCESSOR(rb_cGdkEventOwnerChange, owner_change, reason); DEFINE_ACCESSOR(rb_cGdkEventOwnerChange, owner_change, selection); DEFINE_ACCESSOR(rb_cGdkEventOwnerChange, owner_change, time); DEFINE_ACCESSOR(rb_cGdkEventOwnerChange, owner_change, selection_time); DEFINE_INIT(rb_cGdkEventOwnerChange, owner_change); /* GdkOwnerChange */ G_DEF_CLASS(GDK_TYPE_OWNER_CHANGE, "OwnerChange", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventScroll, GDK_TYPE_OWNER_CHANGE, "GDK_OWNER_CHANGE_"); /* GdkEventProximity */ rb_cGdkEventProximity = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_PROXIMITY, "EventProximity", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventProximity, proximity, time); DEFINE_ACCESSOR(rb_cGdkEventProximity, proximity, device); /* GdkEventDND */ rb_cGdkEventDND = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_DND, "EventDND", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventDND, dnd, context); DEFINE_ACCESSOR(rb_cGdkEventDND, dnd, time); DEFINE_ACCESSOR(rb_cGdkEventDND, dnd, x_root); DEFINE_ACCESSOR(rb_cGdkEventDND, dnd, y_root); /* GdkEventWindowState */ rb_cGdkEventWindowState = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_WINDOW_STATE, "EventWindowState", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventWindowState, window_state, changed_mask); DEFINE_ACCESSOR(rb_cGdkEventWindowState, window_state, new_window_state); DEFINE_INIT(rb_cGdkEventWindowState, window_state); /* GdkWindowState */ G_DEF_CLASS(GDK_TYPE_WINDOW_STATE, "WindowState", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventWindowState, GDK_TYPE_WINDOW_STATE, "GDK_WINDOW_STATE_"); /* GdkEventSetting */ rb_cGdkEventSetting = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_SETTING, "EventSetting", mGdk, rb_cGdkEvent); DEFINE_ACCESSOR(rb_cGdkEventSetting, setting, action); DEFINE_ACCESSOR(rb_cGdkEventSetting, setting, name); DEFINE_INIT(rb_cGdkEventSetting, setting); /* GdkSettingAction */ G_DEF_CLASS(GDK_TYPE_SETTING_ACTION, "Action", rb_cGdkEventScroll); G_DEF_CONSTANTS(rb_cGdkEventSetting, GDK_TYPE_SETTING_ACTION, "GDK_SETTING_"); /* GdkEventGrabBroken */ rb_cGdkEventGrabBroken = G_DEF_CLASS_WITH_PARENT(GDK_TYPE_EVENT_GRAB_BROKEN, "EventGrabBroken", mGdk, rb_cGdkEvent); rbg_define_method(rb_cGdkEventGrabBroken, "keyboard?", gdkeventgrab_broken_keyboard, 0); rbg_define_method(rb_cGdkEventGrabBroken, "set_keyboard", gdkeventgrab_broken_set_keyboard, 1); rbg_define_method(rb_cGdkEventGrabBroken, "implicit?", gdkeventgrab_broken_implicit, 0); rbg_define_method(rb_cGdkEventGrabBroken, "set_implicit", gdkeventgrab_broken_set_implicit, 1); DEFINE_ACCESSOR(rb_cGdkEventGrabBroken, grab_broken, grab_window); DEFINE_INIT(rb_cGdkEventGrabBroken, grab_broken); rbgobj_register_g2r_func(GDK_TYPE_EVENT, &gdkevent_g2r); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkpixbuf.c���������������������������������������������������0000644�0001750�0001750�00000014731�11701304107�017537� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cPixbuf #define _SELF(s) RVAL2GDKPIXBUF(s) /* deprecated static VALUE rg_render_threshold_alpha(VALUE self, VALUE bitmap, VALUE src_x, VALUE src_y, VALUE dest_x, VALUE dest_y, VALUE width, VALUE height, VALUE alpha_threshold) { gdk_pixbuf_render_threshold_alpha(_SELF(self), RVAL2GDKBITMAP(bitmap), NUM2INT(src_x), NUM2INT(src_y), NUM2INT(dest_x), NUM2INT(dest_y), NUM2INT(width), NUM2INT(height), NUM2INT(alpha_threshold)); return self; } static VALUE rg_render_to_drawable(int argc, VALUE *argv, VALUE self) { VALUE gc, src_x, src_y, dest_x, dest_y, width, height, dither, x_dither, y_dither; rb_warn("Gdk::Pixbuf#render_to_drawable is obsolete. Use Gdk::Drawable#draw_pixbuf instead."); rb_scan_args(argc, argv, "73", &gc, &src_x, &src_y, &dest_x, &dest_y, &width, &height, &dither, &x_dither, &y_dither); if (NIL_P(gc)) rb_raise(rb_eArgError, "arguments 1 must be non nil"); if (NIL_P(src_x)) rb_raise(rb_eArgError, "arguments 2 must be non nil"); if (NIL_P(src_y)) rb_raise(rb_eArgError, "arguments 3 must be non nil"); if (NIL_P(dest_x)) rb_raise(rb_eArgError, "arguments 4 must be non nil"); if (NIL_P(dest_y)) rb_raise(rb_eArgError, "arguments 5 must be non nil"); if (NIL_P(width)) rb_raise(rb_eArgError, "arguments 6 must be non nil"); if (NIL_P(height)) rb_raise(rb_eArgError, "arguments 7 must be non nil"); gdk_pixbuf_render_to_drawable(_SELF(self), RVAL2GDKDRAWABLE(self), RVAL2GDKGC(gc), NUM2INT(src_x), NUM2INT(src_y), NUM2INT(dest_x), NUM2INT(dest_y), NUM2INT(width), NUM2INT(height), NIL_P(dither) ? GDK_RGB_DITHER_NONE : RVAL2GDKRGBDITHER(dither), NIL_P(x_dither) ? 0 : NUM2INT(x_dither), NIL_P(y_dither) ? 0 : NUM2INT(y_dither)); return self; } static VALUE rg_render_pixmap_and_mask(int argc, VALUE *argv, VALUE self) { VALUE colormap_or_alpha, alpha; GdkPixmap *pixmap; GdkBitmap *mask; rb_scan_args(argc, argv, "11", &colormap_or_alpha, &alpha); if (rb_obj_is_kind_of(colormap_or_alpha, GTYPE2CLASS(GDK_TYPE_COLORMAP))){ gdk_pixbuf_render_pixmap_and_mask_for_colormap(_SELF(self), RVAL2GOBJ(colormap_or_alpha), &pixmap, &mask, NIL_P(alpha)?0:NUM2INT(alpha)); } else { gdk_pixbuf_render_pixmap_and_mask(_SELF(self), &pixmap, &mask, NIL_P(colormap_or_alpha)? 0:NUM2INT(colormap_or_alpha)); } return rb_ary_new3(2, pixmap ? GOBJ2RVAL(pixmap) : Qnil, mask ? GOBJ2RVAL(mask) : Qnil); } static VALUE rg_s_from_drawable(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE cmap, src, src_x, src_y, width, height, dest, dest_x, dest_y; GdkPixbuf* buf; rb_scan_args(argc, argv, "63", &cmap, &src, &src_x, &src_y, &width, &height, &dest, &dest_x, &dest_y); buf = gdk_pixbuf_get_from_drawable(RVAL2GDKPIXBUF(dest), RVAL2GDKDRAWABLE(src), RVAL2GDKCOLORMAP(cmap), NUM2INT(src_x), NUM2INT(src_y), NIL_P(dest_x) ? 0 : NUM2INT(dest_x), NIL_P(dest_y) ? 0 : NUM2INT(dest_y), NUM2INT(width), NUM2INT(height)); if (NIL_P(dest)) { if (buf) { return GOBJ2RVALU(buf); } else { return Qnil; } } else { return dest; } } static VALUE rg_s_from_image(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE cmap, src, src_x, src_y, width, height, dest, dest_x, dest_y; GdkPixbuf* buf; rb_scan_args(argc, argv, "63", &cmap, &src, &src_x, &src_y, &width, &height, &dest, &dest_x, &dest_y); buf = gdk_pixbuf_get_from_image(RVAL2GDKPIXBUF(dest), RVAL2GDKIMAGE(src), RVAL2GDKCOLORMAP(cmap), NUM2INT(src_x), NUM2INT(src_y), NIL_P(dest_x) ? 0 : NUM2INT(dest_x), NIL_P(dest_y) ? 0 : NUM2INT(dest_y), NUM2INT(width), NUM2INT(height)); if (NIL_P(dest)) { if (buf) { return GOBJ2RVAL(buf); } else { return Qnil; } } else { return dest; } } */ void Init_gdk_pixbuf(VALUE mGdk) { /* * This defines Gdk::Pixbuf methods of GDK side. */ VALUE RG_TARGET_NAMESPACE = GTYPE2CLASS(GDK_TYPE_PIXBUF); /* deprecated RG_DEF_METHOD(render_threshold_alpha, 8); RG_DEF_METHOD(render_to_drawable, -1); RG_DEF_METHOD(render_pixmap_and_mask, -1); RG_DEF_SMETHOD(from_drawable, -1); RG_DEF_SMETHOD(from_image, -1); */ } ���������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkpangorenderer.c��������������������������������������������0000644�0001750�0001750�00000007515�11701304107�021077� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ /* deprecated #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cPangoRenderer #define _SELF(s) (RVAL2GDKPANGORENDERER(s)) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE screen; GdkScreen* gscreen; rb_scan_args(argc, argv, "01", &screen); if (NIL_P(screen)){ gscreen = gdk_screen_get_default(); } else { gscreen = RVAL2GDKSCREEN(screen); } G_INITIALIZE(self, gdk_pango_renderer_new(gscreen)); return Qnil; } static VALUE rg_s_get_default(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE screen; GdkScreen* gscreen; rb_scan_args(argc, argv, "01", &screen); if (NIL_P(screen)){ gscreen = gdk_screen_get_default(); } else { gscreen = RVAL2GDKSCREEN(screen); } return GOBJ2RVAL(gdk_pango_renderer_get_default(gscreen)); } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { GdkScreen* gscreen = gdk_screen_get_default(); return GOBJ2RVAL(gdk_pango_renderer_get_default(gscreen)); } static VALUE rg_set_drawable(VALUE self, VALUE drawable) { gdk_pango_renderer_set_drawable(_SELF(self), RVAL2GDKDRAWABLE(drawable)); return self; } static VALUE rg_set_gc(VALUE self, VALUE gc) { gdk_pango_renderer_set_gc(_SELF(self), NIL_P(gc) ? NULL : RVAL2GDKGC(gc)); return self; } #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE static VALUE rg_set_stipple(VALUE self, VALUE part, VALUE stipple) { gdk_pango_renderer_set_stipple(_SELF(self), RVAL2PANGORENDERPART(part), NIL_P(stipple) ? NULL : RVAL2GDKBITMAP(stipple)); return self; } #else static VALUE prenderer_set_stipple(G_GNUC_UNUSED VALUE self, G_GNUC_UNUSED VALUE part, G_GNUC_UNUSED VALUE stipple) { rb_warning("Gdk::PangoRender#set_tipple is not supported (Require pango-1.8.1 or later"); return self; } #endif #ifdef HAVE_PANGO_RENDER_PART_GET_TYPE static VALUE rg_set_override_color(VALUE self, VALUE part, VALUE color) { gdk_pango_renderer_set_override_color(_SELF(self), RVAL2PANGORENDERPART(part), RVAL2GDKCOLOR(color)); return self; } #else static VALUE prenderer_set_override_color(G_GNUC_UNUSED VALUE self, G_GNUC_UNUSED VALUE part, G_GNUC_UNUSED VALUE color) { rb_warning("Gdk::PangoRender#set_override_color is not supported (Require pango-1.8.1 or later"); return self; } #endif void Init_gdk_pangorenderer(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PANGO_RENDERER, "PangoRenderer", mGdk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_drawable, 1); RG_DEF_METHOD(set_gc, 1); RG_DEF_METHOD(set_stipple, 2); RG_DEF_METHOD(set_override_color, 2); RG_DEF_SMETHOD(get_default, -1); RG_DEF_SMETHOD(default, 0); } */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkdevicemanager.c��������������������������������������������0000644�0001750�0001750�00000002505�12257552167�021052� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cDeviceManager #define _SELF(obj) RVAL2GDKDEVICEMANAGER(obj) static VALUE rg_devices(VALUE self) { return GOBJGLIST2RVAL_FREE(gdk_device_manager_list_devices(_SELF(self), GDK_TYPE_DEVICE), g_list_free, NULL); } void Init_gdk_device_manager(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DISPLAY_MANAGER, "DeviceManager", mGdk); RG_DEF_METHOD(devices, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkkeymap.c���������������������������������������������������0000644�0001750�0001750�00000010526�11701304107�017526� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cKeymap #define _SELF(s) RVAL2GDKKEYMAP(s) static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_keymap_get_default()); } static VALUE rg_s_for_display(G_GNUC_UNUSED VALUE self, VALUE display) { return GOBJ2RVAL(gdk_keymap_get_for_display(RVAL2GDKDISPLAYOBJECT(display))); } static VALUE rg_lookup_key(VALUE self, VALUE keycode, VALUE group, VALUE level) { GdkKeymapKey key; key.keycode = NUM2UINT(keycode); key.group = NUM2INT(group); key.level = NUM2INT(level); return INT2NUM(gdk_keymap_lookup_key(_SELF(self), &key)); } static VALUE rg_translate_keyboard_state(VALUE self, VALUE hardware_keycode, VALUE state, VALUE group) { guint keyval; gint effective_group, level; GdkModifierType consumed_modifiers; gboolean ret; ret = gdk_keymap_translate_keyboard_state(_SELF(self), NUM2UINT(hardware_keycode), RVAL2GDKMODIFIERTYPE(state), NUM2INT(group), &keyval, &effective_group, &level, &consumed_modifiers); return ret ? rb_ary_new3(4, UINT2NUM(keyval), INT2NUM(effective_group), INT2NUM(level), GDKMODIFIERTYPE2RVAL(consumed_modifiers)) : Qnil; } static VALUE rg_get_entries_for_keyval(VALUE self, VALUE keyval) { GdkKeymapKey* keys; gint n_keys; gboolean ret; ret = gdk_keymap_get_entries_for_keyval(_SELF(self), NUM2UINT(keyval), &keys, &n_keys); if (ret){ VALUE key; VALUE ary = rb_ary_new(); gint i; for (i = 0; i < n_keys; i++){ key = rb_ary_new3(3, UINT2NUM(keys[i].keycode), INT2NUM(keys[i].group), INT2NUM(keys[i].level)); rb_ary_push(ary, key); } g_free(keys); return ary; } else { return Qnil; } } static VALUE rg_get_entries_for_keycode(VALUE self, VALUE hardware_keycode) { GdkKeymapKey* keys; guint* keyvals; gint n_entries; gboolean ret = gdk_keymap_get_entries_for_keycode(_SELF(self), NUM2UINT(hardware_keycode), &keys, &keyvals, &n_entries); if (ret){ VALUE key; VALUE ary = rb_ary_new(); gint i; for (i = 0; i < n_entries; i++){ key = rb_ary_new3(4, UINT2NUM(keys[i].keycode), INT2NUM(keys[i].group), INT2NUM(keys[i].level), UINT2NUM(keyvals[i])); rb_ary_push(ary, key); } g_free(keys); g_free(keyvals); return ary; } else { return Qnil; } } static VALUE rg_direction(VALUE self) { return PANGODIRECTION2RVAL(gdk_keymap_get_direction(_SELF(self))); } static VALUE rg_have_bidi_layouts_p(VALUE self) { return CBOOL2RVAL(gdk_keymap_have_bidi_layouts(_SELF(self))); } void Init_gdk_keymap(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_KEYMAP, "Keymap", mGdk); RG_DEF_SMETHOD(default, 0); RG_DEF_SMETHOD(for_display, 0); RG_DEF_METHOD(lookup_key, 3); RG_DEF_METHOD(translate_keyboard_state, 3); RG_DEF_METHOD(get_entries_for_keyval, 1); RG_DEF_METHOD(get_entries_for_keycode, 1); RG_DEF_METHOD(direction, 0); RG_DEF_METHOD_P(have_bidi_layouts, 0); #ifdef GDK_WINDOWING_X11 G_DEF_CLASS3("GdkKeymapX11", "KeymapX11", mGdk); #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkproperty.c�������������������������������������������������0000644�0001750�0001750�00000022467�11701304107�020133� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE mProperty /* deprecated static VALUE rg_s_text_property_to_text_list(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { gint num, i; gchar** list; VALUE ret = Qnil; if (argc == 3) { VALUE encoding, format, text; rb_scan_args(argc, argv, "30", &encoding, &format, &text); StringValue(text); num = gdk_text_property_to_text_list(RVAL2ATOM(encoding), NUM2INT(format), (const guchar*)RVAL2CSTR(text), RSTRING_LEN(text), &list); } else { VALUE display, encoding, format, text; rb_scan_args(argc, argv, "40", &display, &encoding, &format, &text); StringValue(text); num = gdk_text_property_to_text_list_for_display(RVAL2GDKDISPLAYOBJECT(display), RVAL2ATOM(encoding), NUM2INT(format), (const guchar*)RVAL2CSTR(text), RSTRING_LEN(text), &list); } ret = rb_ary_new2(num); for (i =0; i < num; i++){ rb_ary_push(ret, CSTR2RVAL(list[i])); } gdk_free_text_list(list); return ret; } */ /* TODO static VALUE rg_s_text_property_to_utf8_list(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { gint num, i; gchar** list; VALUE ret = Qnil; if (argc == 3) { VALUE encoding, format, text; rb_scan_args(argc, argv, "30", &encoding, &format, &text); StringValue(text); num = gdk_text_property_to_utf8_list(RVAL2ATOM(encoding), NUM2INT(format), (const guchar*)RVAL2CSTR(text), RSTRING_LEN(text), &list); } else { VALUE display, encoding, format, text; rb_scan_args(argc, argv, "40", &display, &encoding, &format, &text); StringValue(text); num = gdk_text_property_to_utf8_list_for_display(RVAL2GDKDISPLAYOBJECT(display), RVAL2ATOM(encoding), NUM2INT(format), (const guchar*)RVAL2CSTR(text), RSTRING_LEN(text), &list); } ret = rb_ary_new2(num); for (i =0; i < num; i++){ rb_ary_push(ret, CSTR2RVAL(list[i])); } g_strfreev(list); return ret; } */ /* deprecated static VALUE rg_s_string_to_compound_text(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { gint num; GdkAtom encoding; gint format; guchar *ctext; gint length; if (argc == 1) { VALUE str; rb_scan_args(argc, argv, "10", &str); num = gdk_string_to_compound_text(RVAL2CSTR(str), &encoding, &format, &ctext, &length); } else { VALUE display, str; rb_scan_args(argc, argv, "20", &display, &str); num = gdk_string_to_compound_text_for_display(RVAL2GDKDISPLAYOBJECT(display), RVAL2CSTR(str), &encoding, &format, &ctext, &length); } if (num == 0){ VALUE ret = CSTR2RVAL((const char*)ctext); gdk_free_compound_text(ctext); return rb_ary_new3(3, GDKATOM2RVAL(encoding), INT2NUM(format), ret); } else { rb_raise(rb_eRuntimeError, "failed to converts a string %d\n", num); } return Qnil; } */ static VALUE rg_s_utf8_to_string_target(G_GNUC_UNUSED VALUE self, VALUE str) { return CSTR2RVAL((const char*)gdk_utf8_to_string_target(RVAL2CSTR(str))); } /* deprecated static VALUE rg_s_utf8_to_compound_text(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { GdkAtom encoding; gint format; guchar *ctext; gint length; gint ret; if (argc == 1) { VALUE str; rb_scan_args(argc, argv, "10", &str); ret = gdk_utf8_to_compound_text(RVAL2CSTR(str), &encoding, &format, &ctext, &length); } else { VALUE display, str; rb_scan_args(argc, argv, "20", &display, &str); ret = gdk_utf8_to_compound_text_for_display(RVAL2GDKDISPLAYOBJECT(display), RVAL2CSTR(str), &encoding, &format, &ctext, &length); } if (ret){ VALUE val = CSTR2RVAL((const char*)ctext); gdk_free_compound_text(ctext); return rb_ary_new3(3, GDKATOM2RVAL(encoding), INT2NUM(format), val); } else { rb_raise(rb_eRuntimeError, "failed to converts a string %d\n", ret); } return Qnil; } */ /* TODO static VALUE rg_s_change(int argc, VALUE *argv, VALUE self) { int fmt, len; void* dat; GdkAtom ntype; VALUE win, property, type, size= Qnil, mode, src; if(6 == argc) rb_scan_args(argc, argv, "60", &win, &property, &type, &size, &mode, &src); else rb_scan_args(argc, argv, "50", &win, &property, &type, &mode, &src); rbgtk_atom2selectiondata(type, size, src, &ntype, &dat, &fmt, &len); gdk_property_change(RVAL2GDKWINDOW(win), RVAL2ATOM(property), ntype, fmt, RVAL2GDKPROPMODE(mode), dat, len); rbgtk_atom2selectiondata_free(ntype, dat); return self; } */ static VALUE rg_s_get(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { /* for argument processing */ GdkAtom rtype; gint rfmt, rlen; guchar* rdat; VALUE win, property, type, offset=INT2FIX(0), length=INT2FIX(9999), delete; /* for inner processing */ gint i; size_t j; VALUE ret = 0; if(6 == argc) rb_scan_args(argc, argv, "60", &win, &property, &type, &offset, &length, &delete); else rb_scan_args(argc, argv, "40", &win, &property, &type, &delete); if(gdk_property_get(RVAL2GDKWINDOW(win), RVAL2ATOM(property), RVAL2ATOM(type), NUM2INT(offset), NUM2INT(length), RVAL2CBOOL(delete), &rtype, &rfmt, &rlen, &rdat) == FALSE){ return Qnil; } switch(rfmt){ case 8: default: ret = RBG_STRING_SET_UTF8_ENCODING(rb_str_new((const char*)rdat, rlen)); break; case 16: ret = rb_ary_new(); for( i = 0; i < rlen; i++){ rb_ary_push(ret, rb_Integer(((unsigned short*)rdat)[i])); } break; case 32: ret = rb_ary_new(); if(rtype != GDK_SELECTION_TYPE_ATOM){ for(j = 0; j < (rlen/sizeof(unsigned long)); j++){ rb_ary_push(ret, INT2FIX(((unsigned long*)rdat)[j])); } } else { for(j = 0; j < (rlen/sizeof(unsigned long)); j++){ rb_ary_push(ret, GDKATOM2RVAL((GdkAtom)((unsigned long*)rdat)[j])); } } break; } return rb_ary_new3(3, GDKATOM2RVAL(rtype), ret, INT2NUM(rlen)); } static VALUE rg_s_delete(VALUE self, VALUE win, VALUE property) { gdk_property_delete(RVAL2GDKWINDOW(win), RVAL2ATOM(property)); return self; } void Init_gdk_property(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Property"); /* deprecated RG_DEF_SMETHOD(text_property_to_text_list, -1); */ /* TODO RG_DEF_SMETHOD(text_property_to_utf8_list, -1); */ /* deprecated RG_DEF_SMETHOD(string_to_compound_text, -1); */ RG_DEF_SMETHOD(utf8_to_string_target, 1); /* deprecated RG_DEF_SMETHOD(utf8_to_compound_text, -1); */ /* TODO RG_DEF_SMETHOD(change, -1); */ RG_DEF_SMETHOD(get, -1); RG_DEF_SMETHOD(delete, 2); G_DEF_CLASS(GDK_TYPE_PROP_MODE, "PropMode", RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkthreads.c��������������������������������������������������0000644�0001750�0001750�00000003503�11701304107�017667� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003-2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #ifdef G_THREADS_ENABLED #define RG_TARGET_NAMESPACE mThreads static VALUE rg_s_init(VALUE self) { #ifndef GDK_WINDOWING_WIN32 if (!g_thread_supported()){ g_thread_init(NULL); } gdk_threads_init(); #endif return self; } static VALUE rg_s_enter(VALUE self) { gdk_threads_enter(); return self; } static VALUE rg_s_leave(VALUE self) { gdk_threads_leave(); return self; } static VALUE rg_s_synchronize(G_GNUC_UNUSED VALUE self) { VALUE func = rb_block_proc(); gdk_threads_enter(); func = rb_block_proc(); rb_funcall(func, id_call, 0); gdk_threads_leave(); return Qnil; } #endif void Init_gdk_threads(VALUE mGdk) { #ifdef G_THREADS_ENABLED VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Threads"); RG_DEF_SMETHOD(init, 0); RG_DEF_SMETHOD(enter, 0); RG_DEF_SMETHOD(leave, 0); RG_DEF_SMETHOD(synchronize, 0); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/extconf.rb������������������������������������������������������0000644�0001750�0001750�00000006770�12257552167�017105� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin extconf.rb for Ruby/GDK extention library =end require 'pathname' source_dir = Pathname(__FILE__).dirname base_dir = source_dir.parent.parent.expand_path top_dir = base_dir.parent.expand_path top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "gdk3" package_id = "gdk-3.0" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end have_func("rb_errinfo") ["glib2", "pango", "gdk_pixbuf2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end rcairo_options = {} rcairo_source_dir_names = ["rcairo"] if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM rcairo_source_dir_names.unshift("rcairo.win32") end rcairo_source_dir_names.each do |rcairo_source_dir_name| rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name if rcairo_source_dir.exist? rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s break end end unless check_cairo(rcairo_options) exit(false) end setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id, :debian => "libgtk-3-dev", :fedora => "gtk3-devel", :homebrew => "gtk+3", :macports => "gtk3") exit(false) end have_header("st.h") have_header("ruby/st.h") STDOUT.print("checking for target... ") STDOUT.flush target = PKGConfig.variable(package_id, "target") $defs << "-DRUBY_GDK3_TARGET=\\\"#{target}\\\"" STDOUT.print(target, "\n") gdk_include_path = nil include_paths = $CFLAGS.gsub(/-D\w+/, '').split(/-I/) + ['/usr/include'] include_paths.each do |path| path.strip! if FileTest.exist?("#{path}/gdk/gdkkeysyms.h") gdk_include_path = Pathname("#{path}/gdk") break end end raise "can't find gdkkeysyms.h" if gdk_include_path.nil? xlib_header = "X11/Xlib.h" if target == "x11" and have_header('X11/Xlib.h') and have_library("X11") have_func("XReadBitmapFileData", xlib_header) have_func("XGetErrorText", xlib_header) end create_pkg_config_file("Ruby/GDK3", package_id, ruby_gnome2_version) rbgdkkeysyms_h_path = Pathname("rbgdkkeysyms.h") gdkkeysyms_h_paths = [] gdkkeysyms_h_paths << gdk_include_path + "gdkkeysyms.h" gdkkeysyms_h_paths << gdk_include_path + "gdkkeysyms-compat.h" rbgdkkeysyms_h_path.open("w") do |rbgdkkeysyms_h| gdkkeysyms_h_paths.each do |path| next unless path.exist? path.each_line do |line| if /^#define\s+(GDK_KEY_\w+)\s+\d+/ =~ line define_line = "rb_define_const(mGdkKeyval, \"#{$1}\", INT2FIX(#{$1}));" rbgdkkeysyms_h.puts(define_line) end end end end add_distcleanfile("rbgdkkeysyms.h") ensure_objs $defs << "-DRUBY_GDK3_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ��������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdk3private.h�������������������������������������������������0000644�0001750�0001750�00000006005�12257552167�020021� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGDK3PRIVATE_H__ #define __RBGDK3PRIVATE_H__ #ifdef HAVE_RUBY_ST_H # include <ruby/st.h> #else # include <st.h> #endif #include <rb_cairo.h> #include <rbgobject.h> #include <rbpango.h> #include "rbgdk3.h" #ifndef HAVE_RB_ERRINFO # define rb_errinfo() (ruby_errinfo) #endif #ifndef G_VALUE_INIT # define G_VALUE_INIT { 0, { { 0 } } } #endif extern ID id_call; G_GNUC_INTERNAL void Init_gdk(void); G_GNUC_INTERNAL void Init_gdk_atom(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_cairo(void); G_GNUC_INTERNAL void Init_gdk_color(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_const(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_cursor(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_device(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_device_manager(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_display(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_display_manager(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_dragcontext(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_event(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_geometry(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_keymap(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_keyval(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_pango(VALUE mGdk); /* deprecated G_GNUC_INTERNAL void Init_gdk_pangorenderer(VALUE mGdk); */ G_GNUC_INTERNAL void Init_gdk_pixbuf(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_property(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_rectangle(VALUE mGdk); /* deprecated G_GNUC_INTERNAL void Init_gdk_rgb(VALUE mGdk); */ G_GNUC_INTERNAL void Init_gdk_rgba(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_screen(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_selection(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_threads(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_timecoord(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_visual(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_window(VALUE mGdk); G_GNUC_INTERNAL void Init_gdk_windowattr(VALUE mGdk); G_GNUC_INTERNAL void Init_gdkx11(void); G_GNUC_INTERNAL void Init_gdkx11_x11window(VALUE mGdkX11); #endif /* __RBGDK3PRIVATE_H__ */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkkeyval.c���������������������������������������������������0000644�0001750�0001750�00000006036�11701304107�017534� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #include <gdk/gdkkeysyms.h> #define RG_TARGET_NAMESPACE mGdkKeyval static VALUE rg_s_to_name(G_GNUC_UNUSED VALUE self, VALUE keyval) { gchar* name = gdk_keyval_name(NUM2UINT(keyval)); return name ? CSTR2RVAL(name) : Qnil; } static VALUE rg_s_from_name(G_GNUC_UNUSED VALUE self, VALUE keyval_name) { return UINT2NUM(gdk_keyval_from_name(RVAL2CSTR(keyval_name))); } static VALUE rg_s_upper_p(G_GNUC_UNUSED VALUE self, VALUE keyval) { return CBOOL2RVAL(gdk_keyval_is_upper(NUM2UINT(keyval))); } static VALUE rg_s_lower_p(G_GNUC_UNUSED VALUE self, VALUE keyval) { return CBOOL2RVAL(gdk_keyval_is_lower(NUM2UINT(keyval))); } static VALUE rg_s_convert_case(G_GNUC_UNUSED VALUE self, VALUE symbol) { guint upper, lower; gdk_keyval_convert_case(NUM2UINT(symbol), &lower, &upper); return rb_ary_new3(2, UINT2NUM(lower), UINT2NUM(upper)); } static VALUE rg_s_to_upper(G_GNUC_UNUSED VALUE self, VALUE keyval) { return INT2NUM(gdk_keyval_to_upper(NUM2UINT(keyval))); } static VALUE rg_s_to_lower(G_GNUC_UNUSED VALUE self, VALUE keyval) { return INT2NUM(gdk_keyval_to_lower(NUM2UINT(keyval))); } static VALUE rg_s_to_unicode(G_GNUC_UNUSED VALUE self, VALUE keyval) { return UINT2NUM(gdk_keyval_to_unicode(NUM2UINT(keyval))); } static VALUE rg_s_from_unicode(G_GNUC_UNUSED VALUE self, VALUE wc) { VALUE unicode; if (TYPE(wc) == T_STRING) { unicode = NUM2UINT(rb_funcall(wc, rb_intern("[]"), 1, INT2FIX(0))); } else { unicode = NUM2UINT(wc); } return UINT2NUM(gdk_unicode_to_keyval(unicode)); } void Init_gdk_keyval(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Keyval"); RG_DEF_SMETHOD(to_name, 1); RG_DEF_SMETHOD(from_name, 1); RG_DEF_SMETHOD_P(upper, 1); RG_DEF_SMETHOD_P(lower, 1); RG_DEF_SMETHOD(convert_case, 1); RG_DEF_SMETHOD(to_upper, 1); RG_DEF_SMETHOD(to_lower, 1); RG_DEF_SMETHOD(to_unicode, 1); RG_DEF_SMETHOD(from_unicode, 1); #include "rbgdkkeysyms.h" } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkdisplaymanager.c�������������������������������������������0000644�0001750�0001750�00000003225�11701304107�021236� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cDisplayManager #define _SELF(obj) RVAL2GDKDISPLAYMANAGER(obj) static VALUE rg_s_get(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_display_manager_get()); } static VALUE rg_displays(VALUE self) { return GOBJGSLIST2RVAL_FREE(gdk_display_manager_list_displays(_SELF(self)), g_slist_free, NULL); } /* Move to Gdk::Display. static VALUE gdkdisplaymanager_get_core_pointer(VALUE self) { return GOBJ2RVAL(gdk_display_get_core_pointer(_SELF(self))); } */ void Init_gdk_display_manager(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DISPLAY_MANAGER, "DisplayManager", mGdk); RG_DEF_SMETHOD(get, 0); RG_DEF_METHOD(displays, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkpango.c����������������������������������������������������0000644�0001750�0001750�00000013503�11701304107�017342� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003,2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #include "rbpango.h" #define RG_TARGET_NAMESPACE mPango static VALUE rg_s_context(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE screen, ret; rb_scan_args(argc, argv, "01", &screen); if (NIL_P(screen)){ ret = GOBJ2RVAL(gdk_pango_context_get()); } else { ret = GOBJ2RVAL(gdk_pango_context_get_for_screen(RVAL2GDKSCREEN(screen))); } return ret; } /* deprecated static VALUE gdkpango_context_set_colormap(VALUE self, VALUE colormap) { gdk_pango_context_set_colormap(RVAL2PANGOCONTEXT(self), RVAL2GDKCOLORMAP(colormap)); return self; } static VALUE gdkpango_attr_embossed_initialize(VALUE self, VALUE embossed) { DATA_PTR(self) = gdk_pango_attr_embossed_new(RVAL2CBOOL(embossed)); return Qnil; } static VALUE gdkpango_attr_embossed_value(VALUE self) { return CBOOL2RVAL(((GdkPangoAttrEmbossed*)RVAL2ATTR(self))->embossed); } */ /* deprecated static VALUE gdkpango_attr_stipple_initialize(VALUE self, VALUE stipple) { DATA_PTR(self) = gdk_pango_attr_stipple_new(RVAL2GDKBITMAP(stipple)); return Qnil; } static VALUE gdkpango_attr_stipple_value(VALUE self) { return GOBJ2RVAL(((GdkPangoAttrStipple*)RVAL2ATTR(self))->stipple); } */ static VALUE gdkpango_layout_get_clip_region(VALUE self, VALUE rbx_origin, VALUE rby_origin, VALUE rbindex_ranges) { PangoLayout *layout = RVAL2PANGOLAYOUT(self); gint x_origin = NUM2INT(rbx_origin); gint y_origin = NUM2INT(rby_origin); long n; gint *index_ranges = RVAL2GINTS(rbindex_ranges, n); cairo_region_t *result; if (n % 2 != 0) { g_free(index_ranges); rb_raise(rb_eArgError, "an even number of byte indexes must be given"); } result = gdk_pango_layout_get_clip_region(layout, x_origin, y_origin, index_ranges, n / 2); g_free(index_ranges); return CRREGION2RVAL(result); } static VALUE gdkpango_layout_line_get_clip_region(VALUE self, VALUE rbx_origin, VALUE rby_origin, VALUE rbindex_ranges) { PangoLayoutLine *line = RVAL2PANGOLAYOUTLINE(self); gint x_origin = NUM2INT(rbx_origin); gint y_origin = NUM2INT(rby_origin); long n; gint *index_ranges = RVAL2GINTS(rbindex_ranges, n); cairo_region_t *result; if (n % 2 != 0) { g_free(index_ranges); rb_raise(rb_eArgError, "an even number of byte indexes must be given"); } result = gdk_pango_layout_line_get_clip_region(line, x_origin, y_origin, index_ranges, n / 2); g_free(index_ranges); return CRREGION2RVAL(result); } /* deprecated static VALUE gdkpango_attr_emboss_color_initialize(VALUE self, VALUE color) { DATA_PTR(self) = gdk_pango_attr_emboss_color_new(RVAL2GDKCOLOR(color)); return Qnil; } static VALUE gdkpango_attr_emboss_color_value(VALUE self) { return PANGOCOLOR2RVAL(&(((GdkPangoAttrEmbossColor *)RVAL2ATTR(self))->color)); } */ void Init_gdk_pango(VALUE mGdk) { /* deprecated VALUE klass; PangoAttribute* tmpattr; GdkColor color; */ VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "Pango"); /* deprecated VALUE context = GTYPE2CLASS(PANGO_TYPE_CONTEXT); */ VALUE layout = GTYPE2CLASS(PANGO_TYPE_LAYOUT); VALUE layoutline = GTYPE2CLASS(PANGO_TYPE_LAYOUT_LINE); /* deprecated VALUE pattr = ATTRTYPE2CLASS(CSTR2RVAL("Attribute")); VALUE pattrbool = ATTRTYPE2CLASS(CSTR2RVAL("AttrBool")); VALUE pattr_color = ATTRTYPE2CLASS(CSTR2RVAL("AttrColor")); */ RG_DEF_SMETHOD(context, -1); /* deprecated rbg_define_method(context, "set_colormap", gdkpango_context_set_colormap, 1); */ rbg_define_method(layout, "get_clip_region", gdkpango_layout_get_clip_region, 3); rbg_define_method(layoutline, "get_clip_region", gdkpango_layout_line_get_clip_region, 3); /* deprecated klass = rb_define_class_under(mGdk, "PangoAttrEmbossed", pattrbool); rbg_define_method(klass, "initialize", gdkpango_attr_embossed_initialize, 1); tmpattr = gdk_pango_attr_embossed_new(TRUE); rbg_define_method(klass, "value", gdkpango_attr_embossed_value, 0); RBPANGO_ADD_ATTRIBUTE(tmpattr->klass->type, klass); pango_attribute_destroy(tmpattr); */ /* deprecated klass = rb_define_class_under(mGdk, "PangoAttrStipple", pattr); rbg_define_method(klass, "initialize", gdkpango_attr_stipple_initialize, 1); rbg_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); */ /* deprecated klass = rb_define_class_under(mGdk, "PangoAttrEmbossColor", pattr_color); rbg_define_method(klass, "initialize", gdkpango_attr_emboss_color_initialize, 1); rbg_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); */ } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkdevice.c���������������������������������������������������0000644�0001750�0001750�00000015637�12257552167�017531� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2003-2006 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cDevice #define _SELF(self) (RVAL2GDKDEVICE(self)) /* deprecated static VALUE rg_s_list(G_GNUC_UNUSED VALUE self) { return GOBJGLIST2RVAL(gdk_devices_list()); } static VALUE rg_s_set_extension_events(G_GNUC_UNUSED VALUE self, VALUE window, VALUE mask, VALUE mode) { gdk_input_set_extension_events(RVAL2GDKWINDOW(window), NUM2INT(mask), FIX2INT(mode)); return Qnil; } static VALUE rg_s_core_pointer(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_device_get_core_pointer()); } static VALUE rg_set_source(VALUE self, VALUE source) { gdk_device_set_source(_SELF(self), RVAL2GDKINPUTSOURCE(source)); return self; } */ static VALUE rg_set_mode(VALUE self, VALUE mode) { return CBOOL2RVAL(gdk_device_set_mode(_SELF(self), RVAL2GDKINPUTMODE(mode))); } static VALUE rg_set_key(VALUE self, VALUE index, VALUE keyval, VALUE modifiers) { gdk_device_set_key(_SELF(self), NUM2UINT(index), NUM2UINT(keyval), RVAL2GDKMODIFIERTYPE(modifiers)); return self; } static VALUE rg_set_axis_use(VALUE self, VALUE index, VALUE use) { gdk_device_set_axis_use(_SELF(self), NUM2UINT(index), RVAL2GDKAXISUSE(use)); return self; } static VALUE rg_get_state(VALUE self, VALUE window) { gdouble axes[2]; GdkModifierType mask; gdk_device_get_state(_SELF(self), RVAL2GDKWINDOW(window), axes, &mask); return rb_ary_new3(3, rb_float_new(axes[0]), rb_float_new(axes[1]), GDKMODIFIERTYPE2RVAL(mask)); } static VALUE rg_get_history(VALUE self, VALUE window, VALUE start, VALUE stop) { gboolean ret; GdkTimeCoord** events; gint i, n_events; VALUE ary = Qnil; ret = gdk_device_get_history(_SELF(self), RVAL2GDKWINDOW(window), NUM2UINT(start), NUM2UINT(stop), &events, &n_events); if (ret){ ary = rb_ary_new(); for (i = 0; i < n_events; i++){ rb_ary_push(ary, GDKTIMECOORD2RVAL(events)); } gdk_device_free_history(events, n_events); } return ary; } static VALUE rg_get_axis(VALUE self, VALUE rbaxes, VALUE rbuse) { GdkDevice *device = _SELF(self); GdkAxisUse use = RVAL2GDKAXISUSE(rbuse); long n; gdouble *axes = RVAL2GDOUBLES(rbaxes, n); gint device_n_axes = gdk_device_get_n_axes(device); gdouble value; gboolean found; if (n != device_n_axes) rb_raise(rb_eArgError, "unexpected number of axes: %ld != %d", n, device_n_axes); found = gdk_device_get_axis(device, axes, use, &value); g_free(axes); return found ? DBL2NUM(value) : Qnil; } static VALUE rg_mode(VALUE self) { return GDKINPUTMODE2RVAL(gdk_device_get_mode(_SELF(self))); } static VALUE rg_get_window_at_position(G_GNUC_UNUSED VALUE self) { gint x, y; GdkWindow *win = gdk_device_get_window_at_position(_SELF(self), &x ,&y); return rb_ary_new3(3, GOBJ2RVAL(win), INT2FIX(x), INT2FIX(y)); } static VALUE rg_ungrab(int argc, VALUE *argv, VALUE self) { VALUE rb_time; guint32 time = GDK_CURRENT_TIME; rb_scan_args(argc, argv, "01", &rb_time); if (!NIL_P(rb_time)) { time = NUM2UINT(GDK_CURRENT_TIME); } gdk_device_ungrab(_SELF(self), time); return self; } static VALUE rg_get_position(VALUE self) { GdkScreen *screen; gint x, y; gdk_device_get_position(_SELF(self), &screen, &x, &y); return rb_ary_new3(3, GOBJ2RVAL(screen), INT2NUM(x), INT2NUM(y)); } static VALUE rg_warp(VALUE self, VALUE screen, VALUE x, VALUE y) { gdk_device_warp(_SELF(self), RVAL2GDKSCREEN(screen), NUM2INT(x), NUM2INT(y)); return self; } static VALUE rg_grab(VALUE self, VALUE win, VALUE grab_ownership, VALUE owner_events, VALUE event_mask, VALUE cursor, VALUE time) { return GDKGRABSTATUS2RVAL(gdk_device_grab(_SELF(self), RVAL2GDKWINDOW(win), RVAL2GDKGRABOWNERSHIP(grab_ownership), RVAL2CBOOL(owner_events), RVAL2GDKEVENTMASK(event_mask), RVAL2GDKCURSOR(cursor), NUM2INT(time))); } /* deprecated static VALUE rg_axes(VALUE self) { gint i; VALUE ary = rb_ary_new(); GdkDeviceAxis* axes = _SELF(self)->axes; for (i = 0; i < _SELF(self)->num_axes; i++){ rb_ary_push(ary, rb_ary_new3(3, GDKAXISUSE2RVAL(axes[i].use), rb_float_new(axes[i].min), rb_float_new(axes[i].max))); } return ary; } static VALUE rg_keys(VALUE self) { gint i; VALUE ary = rb_ary_new(); GdkDeviceKey* keys = _SELF(self)->keys; for (i = 0; i < _SELF(self)->num_keys; i++){ rb_ary_push(ary, rb_ary_new3(2, UINT2NUM(keys[i].keyval), GDKMODIFIERTYPE2RVAL(keys[i].modifiers))); } return ary; } */ void Init_gdk_device(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DEVICE, "Device", mGdk); /* deprecated RG_DEF_SMETHOD(list, 0); RG_DEF_SMETHOD(set_extension_events, 3); RG_DEF_SMETHOD(core_pointer, 0); RG_DEF_METHOD(set_source, 1); */ RG_DEF_METHOD(set_mode, 1); RG_DEF_METHOD(set_key, 3); RG_DEF_METHOD(set_axis_use, 2); RG_DEF_METHOD(get_state, 1); RG_DEF_METHOD(get_history, 3); RG_DEF_METHOD(get_axis, 2); RG_DEF_METHOD(mode, 0); RG_DEF_METHOD(get_window_at_position, 0); RG_DEF_METHOD(ungrab, -1); RG_DEF_METHOD(get_position, 0); RG_DEF_METHOD(warp, 3); RG_DEF_METHOD(grab, 6); /* deprecated RG_DEF_METHOD(axes, 0); RG_DEF_METHOD(keys, 0); */ G_DEF_CLASS(GDK_TYPE_INPUT_SOURCE, "InputSource", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_INPUT_MODE, "InputMode", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_AXIS_USE, "AxisUse", RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkdragcontext.c����������������������������������������������0000644�0001750�0001750�00000012633�11701304107�020563� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cDragContext #define _SELF(self) (RVAL2GDKDRAGCONTEXT(self)) static VALUE rg_protocol(VALUE self) { return GDKDRAGPROTOCOL2RVAL(gdk_drag_context_get_protocol(_SELF(self))); } static VALUE rg_source_window(VALUE self) { return GOBJ2RVAL(gdk_drag_context_get_source_window(_SELF(self))); } static VALUE rg_dest_window(VALUE self) { return GOBJ2RVAL(gdk_drag_context_get_dest_window(_SELF(self))); } static VALUE rg_targets(VALUE self) { GList *list, *cur; VALUE ary = rb_ary_new(); list = gdk_drag_context_list_targets(_SELF(self)); for (cur = list; cur != NULL; cur = cur->next) { rb_ary_push(ary, GDKATOM2RVAL((GdkAtom)cur->data)); } return ary; } static VALUE rg_actions(VALUE self) { return GDKDRAGACTION2RVAL(gdk_drag_context_get_actions(_SELF(self))); } static VALUE rg_suggested_action(VALUE self) { return GDKDRAGACTION2RVAL(gdk_drag_context_get_suggested_action(_SELF(self))); } static VALUE rg_selected_action(VALUE self) { return GDKDRAGACTION2RVAL(gdk_drag_context_get_selected_action(_SELF(self))); } static VALUE rg_selection(VALUE self) { return GDKATOM2RVAL(gdk_drag_get_selection(_SELF(self))); } static VALUE rg_drag_abort(VALUE self, VALUE time) { gdk_drag_abort(_SELF(self), NUM2UINT(time)); return self; } static VALUE rg_drop_reply(VALUE self, VALUE ok, VALUE time) { gdk_drop_reply(_SELF(self), RVAL2CBOOL(ok), NUM2UINT(time)); return self; } static VALUE rg_drag_drop(VALUE self, VALUE time) { gdk_drag_drop(_SELF(self), NUM2UINT(time)); return self; } static VALUE rg_find_window(int argc, VALUE *argv, VALUE self) { VALUE drag_window, x_root, y_root; GdkWindow *dest_window; GdkDragProtocol prot; if (argc == 3) { /* deprecated rb_scan_args(argc, argv, "30", &drag_window, &x_root, &y_root); gdk_drag_find_window(_SELF(self), RVAL2GDKWINDOW(drag_window), NUM2INT(x_root), NUM2INT(y_root), &dest_window, &prot); */ } else { VALUE screen; rb_scan_args(argc, argv, "40", &drag_window, &screen, &x_root, &y_root); gdk_drag_find_window_for_screen(_SELF(self), RVAL2GDKWINDOW(drag_window), RVAL2GDKSCREEN(screen), NUM2INT(x_root), NUM2INT(y_root), &dest_window, &prot); } return rb_ary_new3(2, GOBJ2RVAL(dest_window), GDKDRAGPROTOCOL2RVAL(prot)); } static VALUE rg_drag_motion(VALUE self, VALUE dest_window, VALUE protocol, VALUE x_root, VALUE y_root, VALUE suggested_action, VALUE possible_actions, VALUE time) { gboolean ret = gdk_drag_motion(_SELF(self), RVAL2GDKWINDOW(dest_window), RVAL2GDKDRAGPROTOCOL(protocol), NUM2INT(x_root), NUM2INT(y_root), RVAL2GDKDRAGACTION(suggested_action), RVAL2GDKDRAGACTION(possible_actions), NUM2UINT(time)); return CBOOL2RVAL(ret); } static VALUE rg_drop_finish(VALUE self, VALUE success, VALUE time) { gdk_drop_finish(_SELF(self), RVAL2CBOOL(success), NUM2UINT(time)); return self; } static VALUE rg_drag_status(VALUE self, VALUE action, VALUE time) { gdk_drag_status(_SELF(self), RVAL2GDKDRAGACTION(action), NUM2UINT(time)); return self; } static VALUE rg_drag_drop_succeeded_p(VALUE self) { return CBOOL2RVAL(gdk_drag_drop_succeeded(_SELF(self))); } void Init_gdk_dragcontext(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DRAG_CONTEXT, "DragContext", mGdk); RG_DEF_METHOD(protocol, 0); RG_DEF_METHOD(source_window, 0); RG_DEF_METHOD(dest_window, 0); RG_DEF_METHOD(targets, 0); RG_DEF_METHOD(actions, 0); RG_DEF_METHOD(suggested_action, 0); RG_DEF_METHOD(selected_action, 0); RG_DEF_METHOD(selection, 0); RG_DEF_METHOD(drag_abort, 1); RG_DEF_METHOD(drop_reply, 2); RG_DEF_METHOD(drag_drop, 1); RG_DEF_METHOD(find_window, 4); RG_DEF_METHOD(drag_motion, 7); RG_DEF_METHOD(drop_finish, 2); RG_DEF_METHOD(drag_status, 2); RG_DEF_METHOD_P(drag_drop_succeeded, 0); G_DEF_CLASS(GDK_TYPE_DRAG_PROTOCOL, "Protocol", RG_TARGET_NAMESPACE); G_DEF_CLASS(GDK_TYPE_DRAG_ACTION, "Action", RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkrgb.c������������������������������������������������������0000644�0001750�0001750�00000014237�11701304107�017015� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Ruby-GNOME2 Project Team * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ /* deprecated #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE mRGB #define RVAL2DRAW(s) RVAL2GDKDRAWABLE(s) static VALUE rg_s_draw_rgb_image(int argc, VALUE *argv, VALUE self) { VALUE win, gc, x, y, w, h, dither, buf, rowstride, xdith, ydith; rb_scan_args(argc, argv, "92", &win, &gc, &x, &y, &w, &h, &dither, &buf, &rowstride, &xdith, &ydith); if (argc == 9){ gdk_draw_rgb_image(RVAL2DRAW(win), RVAL2GDKGC(gc), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), RVAL2GDKRGBDITHER(dither), (guchar*)RVAL2CSTR(buf), NUM2INT(rowstride)); } else { gdk_draw_rgb_image_dithalign(RVAL2DRAW(win), RVAL2GDKGC(gc), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), RVAL2GDKRGBDITHER(dither), (guchar*)RVAL2CSTR(buf), NUM2INT(rowstride), NUM2INT(xdith), NUM2INT(ydith)); } return self; } static VALUE rg_s_draw_indexed_image(VALUE self, VALUE win, VALUE rbgc, VALUE rbx, VALUE rby, VALUE rbwidth, VALUE rbheight, VALUE rbdither, VALUE rbbuf, VALUE rbrowstride, VALUE rbcolors) { GdkDrawable *drawable = RVAL2DRAW(win); GdkGC *gc = RVAL2GDKGC(rbgc); gint x = NUM2INT(rbx); gint y = NUM2INT(rby); gint width = NUM2INT(rbwidth); gint height = NUM2INT(rbheight); GdkRgbDither dither = RVAL2GDKRGBDITHER(rbdither); const guchar *buf = (const guchar *)RVAL2CSTR(rbbuf); gint rowstride = NUM2INT(rbrowstride); long n; guint32 *colors = RVAL2GUINT32S(rbcolors, n); GdkRgbCmap *cmap; if (n < 0 || n > 255) { g_free(colors); rb_raise(rb_eArgError, "colors: out of range (0 - 255)"); } cmap = gdk_rgb_cmap_new(colors, n); g_free(colors); gdk_draw_indexed_image(drawable, gc, x, y, width, height, dither, buf, rowstride, cmap); gdk_rgb_cmap_free(cmap); return self; } static VALUE rg_s_draw_gray_image(VALUE self, VALUE win, VALUE gc, VALUE x, VALUE y, VALUE w, VALUE h, VALUE dither, VALUE buf, VALUE rowstride) { gdk_draw_gray_image(RVAL2DRAW(win), RVAL2GDKGC(gc), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), RVAL2GDKRGBDITHER(dither), (guchar*)RVAL2CSTR(buf), NUM2INT(rowstride)); return self; } static VALUE rg_s_draw_rgb_32_image(int argc, VALUE *argv, VALUE self) { VALUE win, gc, x, y, w, h, dither, buf, rowstride, xdith, ydith; rb_scan_args(argc, argv, "92", &win, &gc, &x, &y, &w, &h, &dither, &buf, &rowstride, &xdith, &ydith); if (argc == 9){ gdk_draw_rgb_32_image(RVAL2DRAW(win), RVAL2GDKGC(gc), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), RVAL2GDKRGBDITHER(dither), (guchar*)RVAL2CSTR(buf), NUM2INT(rowstride)); } else { gdk_draw_rgb_32_image_dithalign(RVAL2DRAW(win), RVAL2GDKGC(gc), NUM2INT(x), NUM2INT(y), NUM2INT(w), NUM2INT(h), RVAL2GDKRGBDITHER(dither), (guchar*)RVAL2CSTR(buf), NUM2INT(rowstride), NUM2INT(xdith), NUM2INT(ydith)); } return self; } static VALUE rg_s_find_color(VALUE self, VALUE colormap, VALUE color) { gdk_rgb_find_color(RVAL2GDKCOLORMAP(colormap), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_s_set_install(VALUE self, VALUE install) { gdk_rgb_set_install(RVAL2CBOOL(install)); return self; } static VALUE rg_s_set_min_colors(VALUE self, VALUE min_colors) { gdk_rgb_set_min_colors(NUM2INT(min_colors)); return self; } static VALUE rg_s_visual(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_rgb_get_visual()); } static VALUE rg_s_colormap(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(gdk_rgb_get_colormap()); } static VALUE rg_s_ditherable_p(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(gdk_rgb_ditherable()); } static VALUE rg_s_set_verbose(VALUE self, VALUE verbose) { gdk_rgb_set_verbose(RVAL2CBOOL(verbose)); return self; } void Init_gdk_rgb(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGdk, "RGB"); RG_DEF_SMETHOD(draw_rgb_image, -1); RG_DEF_SMETHOD(draw_indexed_image, 10); RG_DEF_SMETHOD(draw_gray_image, 9); RG_DEF_SMETHOD(draw_rgb_32_image, -1); RG_DEF_SMETHOD(find_color, 2); RG_DEF_SMETHOD(set_install, 1); RG_DEF_SMETHOD(set_min_colors, 0); RG_DEF_SMETHOD(visual, 0); RG_DEF_SMETHOD(colormap, 0); RG_DEF_SMETHOD_P(ditherable, 0); RG_DEF_SMETHOD(set_verbose, 1); G_DEF_CLASS(GDK_TYPE_RGB_DITHER, "Dither", RG_TARGET_NAMESPACE); } */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkcursor.c���������������������������������������������������0000644�0001750�0001750�00000006335�11701304107�017560� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2001-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cCursor static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GdkCursor* cursor = NULL; if (argc == 1){ VALUE type; rb_scan_args(argc, argv, "10", &type); cursor = gdk_cursor_new(RVAL2GDKCURSORTYPE(type)); } else if (argc == 2) { VALUE display, type_or_name; rb_scan_args(argc, argv, "20", &display, &type_or_name); if (TYPE(type_or_name) == T_STRING) cursor = gdk_cursor_new_from_name(RVAL2GDKDISPLAYOBJECT(display), RVAL2CSTR(type_or_name)); else cursor = gdk_cursor_new_for_display(RVAL2GDKDISPLAYOBJECT(display), RVAL2GDKCURSORTYPE(type_or_name)); } else if (argc == 4) { VALUE display, pixbuf, x, y; rb_scan_args(argc, argv, "40", &display, &pixbuf, &x, &y); cursor = gdk_cursor_new_from_pixbuf(RVAL2GDKDISPLAYOBJECT(display), RVAL2GDKPIXBUF(pixbuf), NUM2INT(x), NUM2INT(y)); /* deprecated } else if (argc == 6) { VALUE pixmap, mask, fg, bg, x, y; rb_scan_args(argc, argv, "60", &pixmap, &mask, &fg, &bg, &x, &y); cursor = gdk_cursor_new_from_pixmap(RVAL2GDKPIXMAP(pixmap), NIL_P(mask)?NULL:RVAL2GDKPIXMAP(mask), RVAL2GDKCOLOR(fg), RVAL2GDKCOLOR(bg), NUM2INT(x), NUM2INT(y)); */ } G_INITIALIZE(self, cursor); return Qnil; } static VALUE rg_display(VALUE self) { return GOBJ2RVAL(gdk_cursor_get_display(RVAL2GDKCURSOR(self))); } /* TODO static VALUE rg_cursor_type(VALUE self) { return GDKCURSORTYPE2RVAL((RVAL2GDKCURSOR(self))->type); } */ static VALUE rg_image(VALUE self) { return GOBJ2RVAL(gdk_cursor_get_image(RVAL2GDKCURSOR(self))); } void Init_gdk_cursor(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_CURSOR, "Cursor", mGdk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(display, 0); /* TODO RG_DEF_METHOD(cursor_type, 0); */ RG_DEF_METHOD(image, 0); G_DEF_CLASS(GDK_TYPE_CURSOR_TYPE, "Type", RG_TARGET_NAMESPACE); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/depend����������������������������������������������������������0000644�0001750�0001750�00000000504�12064346475�016260� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install-so: install-headers install-headers: $(INSTALL_DATA) $(srcdir)/rbgdk3.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgdk3conversions.h $(RUBYARCHDIR) install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-gdk3.pc $(pkgconfigdir); \ fi ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkcairo.c����������������������������������������������������0000644�0001750�0001750�00000005310�12257552167�017352� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Kouhei Sutou * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #include <gdk/gdk.h> #include <rb_cairo.h> #define RG_TARGET_NAMESPACE rb_cCairo_Context #define _SELF(self) RVAL2CRCONTEXT(self) static VALUE rg_set_source_gdk_color(VALUE self, VALUE color) { gdk_cairo_set_source_color(_SELF(self), RVAL2GDKCOLOR(color)); rb_cairo_check_status(cairo_status(_SELF(self))); return self; } static VALUE rg_set_source_pixbuf(int argc, VALUE *argv, VALUE self) { VALUE pixbuf, pixbuf_x, pixbuf_y; rb_scan_args(argc, argv, "12", &pixbuf, &pixbuf_x, &pixbuf_y); gdk_cairo_set_source_pixbuf(_SELF(self), RVAL2GDKPIXBUF(pixbuf), NIL_P(pixbuf_x) ? 0 : NUM2DBL(pixbuf_x), NIL_P(pixbuf_y) ? 0 : NUM2DBL(pixbuf_y)); rb_cairo_check_status(cairo_status(_SELF(self))); return self; } /* deprecated static VALUE rg_set_source_pixmap(VALUE self, VALUE pixmap, VALUE pixmap_x, VALUE pixmap_y) { gdk_cairo_set_source_pixmap(_SELF(self), RVAL2GDKPIXMAP(pixmap), NUM2DBL(pixmap_x), NUM2DBL(pixmap_y)); rb_cairo_check_status(cairo_status(_SELF(self))); return self; } */ static VALUE rg_gdk_rectangle(VALUE self, VALUE rectangle) { gdk_cairo_rectangle(_SELF(self), RVAL2GDKRECTANGLE(rectangle)); rb_cairo_check_status(cairo_status(_SELF(self))); return self; } static VALUE rg_gdk_region(VALUE self, VALUE region) { gdk_cairo_region(_SELF(self), RVAL2CRREGION(region)); rb_cairo_check_status(cairo_status(_SELF(self))); return self; } void Init_gdk_cairo(void) { RG_DEF_METHOD(set_source_gdk_color, 1); RG_DEF_METHOD(set_source_pixbuf, -1); /* deprecated RG_DEF_METHOD(set_source_pixmap, 3); */ RG_DEF_METHOD(gdk_rectangle, 1); RG_DEF_METHOD(gdk_region, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkgeometry.c�������������������������������������������������0000644�0001750�0001750�00000013726�12124610262�020102� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * Copyright (C) 1998-2000 Yukihiro Matsumoto, * Daisuke Kanda, * Hiroshi Igarashi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" /*****************************************/ static GdkGeometry* geo_copy(const GdkGeometry* geo) { GdkGeometry* new_geo; g_return_val_if_fail (geo != NULL, NULL); new_geo = g_new(GdkGeometry, 1); *new_geo = *geo; return new_geo; } GType gdk_geometry_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkGeometry", (GBoxedCopyFunc)geo_copy, (GBoxedFreeFunc)g_free); return our_type; } /*****************************************/ #define RG_TARGET_NAMESPACE cGeometry #define _SELF(g) (RVAL2GDKGEOMETRY(g)) static VALUE rg_initialize(VALUE self) { GdkGeometry geometry; memset(&geometry, 0, sizeof(GdkGeometry)); G_INITIALIZE(self, g_boxed_copy(GDK_TYPE_GEOMETRY, &geometry)); return Qnil; } static VALUE rg_set(VALUE self, VALUE min_width, VALUE min_height, VALUE max_width, VALUE max_height, VALUE base_width, VALUE base_height, VALUE width_inc, VALUE height_inc, VALUE min_aspect, VALUE max_aspect, VALUE gravity) { GdkGeometry *geo = _SELF(self); geo->min_width = NUM2INT(min_width); geo->min_height = NUM2INT(min_height); geo->max_width = NUM2INT(max_width); geo->max_height = NUM2INT(max_height); geo->base_width = NUM2INT(base_width); geo->base_height = NUM2INT(base_height); geo->width_inc = NUM2INT(width_inc); geo->height_inc = NUM2INT(height_inc); geo->min_aspect = NUM2DBL(min_aspect); geo->max_aspect = NUM2DBL(max_aspect); geo->win_gravity = RVAL2GDKGRAVITY(gravity); return self; } static VALUE rg_min_width(VALUE self) { return INT2NUM(_SELF(self)->min_width); } static VALUE rg_min_height(VALUE self) { return INT2NUM(_SELF(self)->min_height); } static VALUE rg_max_width(VALUE self) { return INT2NUM(_SELF(self)->max_width); } static VALUE rg_max_height(VALUE self) { return INT2NUM(_SELF(self)->max_height); } static VALUE rg_base_width(VALUE self) { return INT2NUM(_SELF(self)->base_width); } static VALUE rg_base_height(VALUE self) { return INT2NUM(_SELF(self)->base_height); } static VALUE rg_width_inc(VALUE self) { return INT2NUM(_SELF(self)->width_inc); } static VALUE rg_height_inc(VALUE self) { return INT2NUM(_SELF(self)->height_inc); } static VALUE rg_min_aspect(VALUE self) { return rb_float_new(_SELF(self)->min_aspect); } static VALUE rg_max_aspect(VALUE self) { return rb_float_new(_SELF(self)->max_aspect); } static VALUE rg_win_gravity(VALUE self) { return GDKGRAVITY2RVAL(_SELF(self)->win_gravity); } static VALUE rg_set_min_width(VALUE self, VALUE min_width) { _SELF(self)->min_width = NUM2INT(min_width); return self; } static VALUE rg_set_min_height(VALUE self, VALUE min_height) { _SELF(self)->min_height = NUM2INT(min_height); return self; } static VALUE rg_set_max_width(VALUE self, VALUE max_width) { _SELF(self)->max_width = NUM2INT(max_width); return self; } static VALUE rg_set_max_height(VALUE self, VALUE max_height) { _SELF(self)->max_height = NUM2INT(max_height); return self; } static VALUE rg_set_base_width(VALUE self, VALUE base_width) { _SELF(self)->base_width = NUM2INT(base_width); return self; } static VALUE rg_set_base_height(VALUE self, VALUE base_height) { _SELF(self)->base_height = NUM2INT(base_height); return self; } static VALUE rg_set_width_inc(VALUE self, VALUE width_inc) { _SELF(self)->width_inc = NUM2INT(width_inc); return self; } static VALUE rg_set_height_inc(VALUE self, VALUE height_inc) { _SELF(self)->height_inc = NUM2INT(height_inc); return self; } static VALUE rg_set_min_aspect(VALUE self, VALUE min_aspect) { _SELF(self)->min_aspect = NUM2DBL(min_aspect); return self; } static VALUE rg_set_max_aspect(VALUE self, VALUE max_aspect) { _SELF(self)->max_aspect = NUM2DBL(max_aspect); return self; } static VALUE rg_set_win_gravity(VALUE self, VALUE gravity) { _SELF(self)->win_gravity = RVAL2GDKGRAVITY(gravity); return self; } void Init_gdk_geometry(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_GEOMETRY, "Geometry", mGdk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(min_width, 0); RG_DEF_METHOD(min_height, 0); RG_DEF_METHOD(max_width, 0); RG_DEF_METHOD(max_height, 0); RG_DEF_METHOD(base_width, 0); RG_DEF_METHOD(base_height, 0); RG_DEF_METHOD(width_inc, 0); RG_DEF_METHOD(height_inc, 0); RG_DEF_METHOD(min_aspect, 0); RG_DEF_METHOD(max_aspect, 0); RG_DEF_METHOD(win_gravity, 0); RG_DEF_METHOD(set, 11); RG_DEF_METHOD(set_min_width, 1); RG_DEF_METHOD(set_min_height, 1); RG_DEF_METHOD(set_max_width, 1); RG_DEF_METHOD(set_max_height, 1); RG_DEF_METHOD(set_base_width, 1); RG_DEF_METHOD(set_base_height, 1); RG_DEF_METHOD(set_width_inc, 1); RG_DEF_METHOD(set_height_inc, 1); RG_DEF_METHOD(set_min_aspect, 1); RG_DEF_METHOD(set_max_aspect, 1); RG_DEF_METHOD(set_win_gravity, 1); } ������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdktimecoord.c������������������������������������������������0000644�0001750�0001750�00000006453�11701304107�020231� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cTimeCoord #define _SELF(s) (RVAL2GDKTIMECOORD(s)) /**********************************/ static GdkTimeCoord* timecoord_copy(const GdkTimeCoord* val) { GdkTimeCoord* new_val; g_return_val_if_fail (val != NULL, NULL); new_val = g_new(GdkTimeCoord, 1); *new_val = *val; return new_val; } GType gdk_timecoord_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkTimeCoord", (GBoxedCopyFunc)timecoord_copy, (GBoxedFreeFunc)g_free); return our_type; } /**********************************/ static VALUE rg_initialize(VALUE self, VALUE rbtime, VALUE rbaxes) { guint32 time = NUM2UINT(rbtime); long n; gdouble *axes = RVAL2GDOUBLES(rbaxes, n); GdkTimeCoord *coord; if (n > GDK_MAX_TIMECOORD_AXES) { g_free(axes); rb_raise(rb_eArgError, "axes out of range: %ld (0..%d)", n, GDK_MAX_TIMECOORD_AXES); } coord = g_new(GdkTimeCoord, 1); coord->time = time; MEMCPY(coord->axes, axes, gdouble, n); g_free(axes); G_INITIALIZE(self, coord); return Qnil; } static VALUE rg_time(VALUE self) { return UINT2NUM(_SELF(self)->time); } static VALUE rg_set_time(VALUE self, VALUE time) { _SELF(self)->time = NUM2UINT(time); return self; } static VALUE rg_axes(VALUE self) { VALUE ary = rb_ary_new(); int i; for (i = 0; i < GDK_MAX_TIMECOORD_AXES; i++){ rb_ary_push(ary, rb_float_new(_SELF(self)->axes[i])); } return ary; } static VALUE rg_set_axes(VALUE self, VALUE rbaxes) { GdkTimeCoord *coord = _SELF(self); VALUE axes = rb_ary_to_ary(rbaxes); long i; long n = RARRAY_LEN(axes); if (n < 0 || n > GDK_MAX_TIMECOORD_AXES) rb_raise(rb_eArgError, "axes out of range: %ld (0..%d)", n, GDK_MAX_TIMECOORD_AXES); for (i = 0; i < n; i++) coord->axes[i] = NUM2DBL(RARRAY_PTR(axes)[i]); return self; } void Init_gdk_timecoord(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_TIME_COORD, "TimeCoord", mGdk); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(time, 0); RG_DEF_METHOD(set_time, 1); RG_DEF_METHOD(axes, 0); RG_DEF_METHOD(set_axes, 1); rb_define_const(RG_TARGET_NAMESPACE, "MAX_AXES", INT2NUM(GDK_MAX_TIMECOORD_AXES)); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/ext/gdk3/rbgdkdisplay.c��������������������������������������������������0000644�0001750�0001750�00000024674�12257552167�017740� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2005 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk3private.h" #define RG_TARGET_NAMESPACE cDisplay #define _SELF(i) RVAL2GDKDISPLAYOBJECT(i) static VALUE rg_close(VALUE self) { gdk_display_close(_SELF(self)); return self; } static VALUE rg_s_open(G_GNUC_UNUSED VALUE self, VALUE display_name) { GdkDisplay* gdisplay = gdk_display_open(RVAL2CSTR(display_name)); if (! gdisplay) { rb_raise(rb_eRuntimeError, "The display `%s' could not be opened.", RVAL2CSTR(display_name)); } else { VALUE display; g_object_ref(gdisplay); display = GOBJ2RVAL(gdisplay); if (rb_block_given_p()) { rb_ensure(rb_yield, display, rg_close, display); return Qnil; } else { return display; } } } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { GdkDisplay* gdisplay = gdk_display_get_default(); if (! gdisplay) rb_raise(rb_eRuntimeError, "No default display is found."); return GOBJ2RVAL(gdisplay); } static VALUE rg_name(VALUE self) { return CSTR2RVAL(gdk_display_get_name(_SELF(self))); } static VALUE rg_n_screens(VALUE self) { return INT2NUM(gdk_display_get_n_screens(_SELF(self))); } static VALUE rg_get_screen(VALUE self, VALUE num) { return GOBJ2RVAL(gdk_display_get_screen(_SELF(self), NUM2INT(num))); } static VALUE rg_default_screen(VALUE self) { return GOBJ2RVAL(gdk_display_get_default_screen(_SELF(self))); } static VALUE rg_device_is_grabbed_p(VALUE self, VALUE device) { return CBOOL2RVAL(gdk_display_device_is_grabbed(_SELF(self), RVAL2GDKDEVICE(device))); } static VALUE rg_beep(VALUE self) { gdk_display_beep(_SELF(self)); return self; } static VALUE rg_sync(VALUE self) { gdk_display_sync(_SELF(self)); return self; } static VALUE rg_flush(VALUE self) { gdk_display_flush(_SELF(self)); return self; } static VALUE rg_event(VALUE self) { return GEV2RVAL(gdk_display_get_event(_SELF(self))); } static VALUE rg_peek_event(VALUE self) { return GEV2RVAL(gdk_display_peek_event(_SELF(self))); } static VALUE rg_put_event(VALUE self, VALUE event) { gdk_display_put_event(_SELF(self), RVAL2GEV(event)); return self; } /* Don't implement this. static GdkFilterReturn filter_func(GdkXEvent xevent, GdkEvent event, gpointer func) { return GENUM2RVAL(rb_funcall((VALUE)func, id_call, 2, ????, GEV2RVAL(event)), GDK_TYPE_FILTER_RETURN); } static VALUE gdkdisplay_add_client_message_filter(VALUE self, VALUE message_type) { VALUE func = RB_BLOCK_PROC(); G_RELATIVE(self, func); gdk_display_add_client_message_filter(_SELF(self), RVAL2ATOM(message_type), filter_func, func); return self; } */ static VALUE rg_set_double_click_time(VALUE self, VALUE msec) { gdk_display_set_double_click_time(_SELF(self), NUM2UINT(msec)); return self; } static VALUE rg_closed_p(VALUE self) { return CBOOL2RVAL(gdk_display_is_closed(_SELF(self))); } static VALUE rg_set_double_click_distance(VALUE self, VALUE distance) { gdk_display_set_double_click_distance(_SELF(self), NUM2UINT(distance)); return self; } /* Don't implement this. GdkDisplayPointerHooks* gdk_display_set_pointer_hooks (GdkDisplay *display, const GdkDisplayPointerHooks *new_hooks); */ static VALUE rg_supports_cursor_color_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_cursor_color(_SELF(self))); } static VALUE rg_supports_cursor_alpha_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_cursor_alpha(_SELF(self))); } static VALUE rg_default_cursor_size(VALUE self) { return UINT2NUM(gdk_display_get_default_cursor_size(_SELF(self))); } static VALUE rg_maximal_cursor_size(VALUE self) { guint width, height; gdk_display_get_maximal_cursor_size(_SELF(self), &width, &height); return rb_assoc_new(UINT2NUM(width), UINT2NUM(height)); } static VALUE rg_default_group(VALUE self) { return GOBJ2RVAL(gdk_display_get_default_group(_SELF(self))); } static VALUE rg_supports_selection_notification_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_selection_notification(_SELF(self))); } static VALUE rg_request_selection_notification_p(VALUE self, VALUE selection) { return CBOOL2RVAL(gdk_display_request_selection_notification(_SELF(self), RVAL2ATOM(selection))); } static VALUE rg_supports_clipboard_persistence_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_clipboard_persistence(_SELF(self))); } static VALUE rg_store_clipboard(VALUE self, VALUE rbclipboard_window, VALUE rbtime_, VALUE rbtargets) { GdkDisplay *display = _SELF(self); GdkWindow *clipboard_window = RVAL2GDKWINDOW(rbclipboard_window); guint32 time_ = NUM2UINT(rbtime_); long n; GdkAtom *targets = RVAL2GDKATOMS(rbtargets, &n); gdk_display_store_clipboard(display, clipboard_window, time_, targets, n); g_free(targets); return self; } /* deprecated static VALUE rg_core_pointer(VALUE self) { return GOBJ2RVAL(gdk_display_get_core_pointer(_SELF(self))); } */ #ifdef GDK_WINDOWING_X11 static VALUE rg_grab(VALUE self) { gdk_x11_display_grab(_SELF(self)); return self; } static VALUE rg_ungrab(VALUE self) { gdk_x11_display_ungrab(_SELF(self)); return self; } static VALUE rg_register_standard_event_type(VALUE self, VALUE event_base, VALUE n_events) { gdk_x11_register_standard_event_type(_SELF(self), NUM2INT(event_base), NUM2INT(n_events)); return self; } static VALUE rg_user_time(VALUE self) { return UINT2NUM(gdk_x11_display_get_user_time(_SELF(self))); } static VALUE rg_set_cursor_theme(VALUE self, VALUE theme, VALUE size) { gdk_x11_display_set_cursor_theme(_SELF(self), RVAL2CSTR(theme), NUM2INT(size)); return self; } /* *** need gdk_x11_display_broadcast_startup_messagev() *** typedef struct _StartupMessageParameterData { gchar **parameters; guint i; } StartupMessageParameterData; static int collect_parameter(VALUE key, VALUE value, VALUE data) { StartupMessageParameterData *parameter_data; parameter_data = (StartupMessageParameterData *)data; parameter_data->parameters[parameter_data->i] = RVAL2CSTR(key); parameter_data->i++; parameter_data->parameters[parameter_data->i] = RVAL2CSTR(value); parameter_data->i++; return ST_CONTINUE; } static VALUE rg_broadcast_startup_message(int argc, VALUE *argv, VALUE self) { VALUE rb_message_type, rb_parameters; char *message_type; guint n_parameters; gchar **parameters; rb_scan_args(argc, argv, "11", &rb_message_type, &rb_parameters); message_type = RVAL2CSTR(rb_message_type); if (NIL_P(rb_parameters)) { n_parameters = 0; parameters = NULL; } else { StartupMessageParameterData data; Check_Type(rb_parameters, T_HASH); n_parameters = NUM2UINT(rb_funcall(rb_parameters, rb_intern("size"), 0)); parameters = ALLOCA_N(gchar *, n_parameters * 2); data.i = 0; data.parameters = parameters; rb_hash_foreach(rb_parameters, collect_parameter, (VALUE)&data); } gdk_x11_display_broadcast_startup_messagev(_SELF(self), message_type, n_parameters, parameters); return self; } */ static VALUE rg_startup_notification_id(VALUE self) { return CSTR2RVAL(gdk_x11_display_get_startup_notification_id(_SELF(self))); } #endif static VALUE rg_supports_shapes_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_shapes(_SELF(self))); } static VALUE rg_supports_input_shapes_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_input_shapes(_SELF(self))); } static VALUE rg_supports_composite_p(VALUE self) { return CBOOL2RVAL(gdk_display_supports_composite(_SELF(self))); } void Init_gdk_display(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_DISPLAY, "Display", mGdk); RG_DEF_SMETHOD(open, 1); RG_DEF_SMETHOD(default, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(n_screens, 0); RG_DEF_METHOD(get_screen, 1); RG_DEF_ALIAS("[]", "get_screen"); RG_DEF_METHOD(default_screen, 0); RG_DEF_METHOD_P(device_is_grabbed, 1); RG_DEF_METHOD(beep, 0); RG_DEF_METHOD(sync, 0); RG_DEF_METHOD(flush, 0); RG_DEF_METHOD(close, 0); RG_DEF_METHOD(event, 0); RG_DEF_METHOD(peek_event, 0); RG_DEF_METHOD(put_event, 1); RG_DEF_METHOD(set_double_click_time, 1); RG_DEF_METHOD_P(closed, 0); RG_DEF_METHOD(set_double_click_distance, 1); RG_DEF_METHOD_P(supports_cursor_color, 0); RG_DEF_METHOD_P(supports_cursor_alpha, 0); RG_DEF_METHOD(default_cursor_size, 0); RG_DEF_METHOD(maximal_cursor_size, 0); RG_DEF_METHOD(default_group, 0); RG_DEF_METHOD_P(supports_selection_notification, 0); RG_DEF_METHOD_P(request_selection_notification, 1); RG_DEF_METHOD_P(supports_clipboard_persistence, 0); RG_DEF_METHOD(store_clipboard, 3); /* deprecated RG_DEF_METHOD(core_pointer, 0); */ #ifdef GDK_WINDOWING_X11 RG_DEF_METHOD(grab, 0); RG_DEF_METHOD(ungrab, 0); RG_DEF_METHOD(register_standard_event_type, 2); RG_DEF_METHOD(user_time, 0); RG_DEF_METHOD(set_cursor_theme, 2); /* RG_DEF_METHOD(broadcast_startup_message, -1); */ RG_DEF_METHOD(startup_notification_id, 0); G_DEF_CLASS3("GdkDisplayX11", "DisplayX11", mGdk); #endif RG_DEF_METHOD_P(supports_shapes, 0); RG_DEF_METHOD_P(supports_input_shapes, 0); RG_DEF_METHOD_P(supports_composite, 0); } ��������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/COPYING.LIB��������������������������������������������������������������0000644�0001750�0001750�00000063642�12257552167�015123� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/lib/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�014174� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/lib/gdk3.rb��������������������������������������������������������������0000644�0001750�0001750�00000000057�11701304107�015353� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������require 'gdk3/base' require 'gdk3/deprecated' ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/lib/gdk3/����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�015046� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/lib/gdk3/deprecated.rb���������������������������������������������������0000644�0001750�0001750�00000015365�12257552167�017505� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������module Gdk extend GLib::Deprecatable define_deprecated_enums :GrabStatus, 'GRAB' define_deprecated_enums :Status define_deprecated_const :Image, :raise => "Use 'Gdk::Pixbuf' or 'Cairo::Surface' instead." define_deprecated_const :Colormap, :raise => "Use 'Gdk::Visual' instead." define_deprecated_const :Input, :raise => "Use 'GLib::IOChannel' instead." define_deprecated_const :X11, 'GdkX11' define_deprecated_singleton_method :pointer_grab, :raise => "Use 'Gdk::Device#grab'." define_deprecated_singleton_method :pointer_ungrab, :raise => "Use 'Gdk::Device#ungrab'." define_deprecated_singleton_method :keyboard_grab, :raise => "Use 'Gdk::Device#grab'." define_deprecated_singleton_method :keyboard_ungrab, :raise => "Use 'Gdk::Device#ungrab'." define_deprecated_singleton_method :pointer_is_grabbed?, :raise => "Use 'Gdk::Display#device_is_grabbed?'." class Cursor extend GLib::Deprecatable define_deprecated_enums :Type define_deprecated_method :pixmap?, :warn => "Don't use this method." do |_self| false end end class Device extend GLib::Deprecatable define_deprecated_enums :AxisUse, 'AXIS' define_deprecated_enums :ExtensionMode, 'EXTENSION_EVENTS' define_deprecated_enums :InputMode, 'MODE' define_deprecated_enums :InputSource, 'SOURCE' define_deprecated_method :source, :input_source end class Display extend GLib::Deprecatable define_deprecated_method :double_click_time, :raise => "Don't use this method." define_deprecated_method :double_click_distance, :raise => "Don't use this method." define_deprecated_method :button_click_time, :raise => "Don't use this method." define_deprecated_method :button_window, :raise => "Don't use this method." define_deprecated_method :button_number, :raise => "Don't use this method." define_deprecated_method :button_x, :raise => "Don't use this method." define_deprecated_method :button_y, :raise => "Don't use this method." define_deprecated_method :pointer, :raise => "Use 'Gdk::Device#get_position'." define_deprecated_method :pointer_ungrab, :raise => "Use 'Gdk::Device#ungrab'." define_deprecated_method :pointer_grabbed_p, :raise => "Use 'Gdk::Display#device_is_grabbed?'." define_deprecated_method :window_at_pointer, :raise => "Use 'Gdk::Device#get_window_at_position'." define_deprecated_method :warp_pointer, :raise => "Use 'Gdk::Device#warp'." define_deprecated_method :devices, :raise => "Use 'Gdk::DeviceManager#devices'." end class DragContext extend GLib::Deprecatable define_deprecated_flags :Action, 'ACTION' define_deprecated_enums :Protocol, 'PROTO' define_deprecated_singleton_method :drag_begin, :warn => "Use 'Gdk::Window#drag_begin'." do |_self, window, targets| window.drag_begin(targets) end define_deprecated_singleton_method :get_protocol, :raise => "Use 'Gdk::Window#drag_protocol'." define_deprecated_method :initialize, :raise => "Use 'Gdk::Window#drag_begin'." define_deprecated_method :action, :selected_action define_deprecated_method :source?, :warn => "Don't use this method." define_deprecated_method :start_time, :raise => "Don't use this method." end class Event extend GLib::Deprecatable define_deprecated_flags :Mask define_deprecated_enums :Type end class EventCrossing extend GLib::Deprecatable define_deprecated_enums :Mode define_deprecated_enums :NotifyType, 'NOTIFY' end class EventOwnerChange extend GLib::Deprecatable define_deprecated_enums :OwnerChange end class EventProperty extend GLib::Deprecatable define_deprecated_enums :State, 'PROPERTY' end class EventScroll extend GLib::Deprecatable define_deprecated_enums :Direction end class EventSetting extend GLib::Deprecatable define_deprecated_enums :Action, 'ACTION' end class EventVisibility extend GLib::Deprecatable define_deprecated_enums :State end class EventWindowState extend GLib::Deprecatable define_deprecated_flags :WindowState end module Keyval extend GLib::Deprecatable constants.each do |key| define_deprecated_const key.to_s.sub(/^GDK_KEY_/, 'GDK_'), [self, key].join('::') end end class Pixmap extend GLib::Deprecatable define_deprecated_method :initialize, :raise => "Use 'Gdk::Window#create_similar_surface'." define_deprecated_singleton_method :create_from_data, :raise => "Use 'Cairo::ImageSurface.new'." define_deprecated_singleton_method :create_from_xbm, :raise => "Use 'Cairo::ImageSurface.new'." define_deprecated_singleton_method :create_from_xpm, :raise => "Use 'Gdk::Pixbuf.new'." define_deprecated_singleton_method :create_from_xpm_d, :raise => "Use 'Gdk::Pixbuf.new'." define_deprecated_singleton_method :colormap_create_from_xpm, :raise => "Use 'Gdk::Pixbuf.new'." define_deprecated_singleton_method :colormap_create_from_xpm_d, :raise => "Use 'Gdk::Pixbuf.new'." define_deprecated_singleton_method :foreign_new, :raise => "Don't use this method." define_deprecated_singleton_method :lookup, :raise => "Don't use this method." end module Property extend GLib::Deprecatable define_deprecated_enums :PropMode, 'MODE' end class Visual extend GLib::Deprecatable define_deprecated_enums :ByteOrder define_deprecated_enums :Type end class Window extend GLib::Deprecatable define_deprecated_flags :AttributesType, 'WA' define_deprecated_enums :Edge, 'EDGE' define_deprecated_enums :FilterReturn, 'FILTER' define_deprecated_enums :Gravity, 'GRAVITY' define_deprecated_flags :Hints, 'HINT' define_deprecated_flags :ModifierType define_deprecated_enums :Type define_deprecated_enums :TypeHint, 'TYPE_HINT' define_deprecated_enums :WindowClass define_deprecated_flags :WMDecoration, 'DECOR' define_deprecated_flags :WMFunction, 'FUNC' define_deprecated_method :clear, :warn => "Don't use this method." define_deprecated_method :clear_area, :warn => "Don't use this method." define_deprecated_method :internal_paint_info, :raise => "Don't use this method." define_deprecated_method :shape_combine_mask, :warn => "Don't use this method." define_deprecated_method :input_shape_combine_mask, :warn => "Don't use this method." define_deprecated_method :set_back_pixmap, :warn => "Don't use this method." define_deprecated_singleton_method :at_pointer, :raise => "Use 'Gdk::Device#get_window_at_position'." define_deprecated_method :pointer, :raise => "Use 'Gdk::Device#get_device_position'." end class WindowAttr extend GLib::Deprecatable define_deprecated_method :colormap, :raise => "Don't use this method." define_deprecated_method :set_colormap, :warn => "Don't use this method." alias :colormap= :set_colormap end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/lib/gdk3/base.rb���������������������������������������������������������0000644�0001750�0001750�00000002536�12137115064�016277� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin Copyright (c) 2006-2011 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. =end require 'glib2' require 'pango' require 'gdk_pixbuf2' base_dir = Pathname.new(__FILE__).dirname.dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/gdk3.so" rescue LoadError require "gdk3.so" end if vendor_dir.exist? begin require "gobject-introspection" vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) rescue LoadError end end module Gdk LOG_DOMAIN = "Gdk" end if Gdk.cairo_available? module Cairo class Context if method_defined?(:set_source_color) alias_method :set_source_not_gdk_color, :set_source_color def set_source_color(color) if color.is_a?(Gdk::Color) set_source_gdk_color(color) else set_source_not_gdk_color(color) end end else alias_method :set_source_color, :set_source_gdk_color end def source_color=(color) set_source_color(color) color end end end end GLib::Log.set_log_domain(Gdk::LOG_DOMAIN) ������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/README.md����������������������������������������������������������������0000644�0001750�0001750�00000001070�12077252561�014720� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Ruby/GDK3 Ruby/GDK3 is a Ruby binding of GDK 3. ## Requirements * Ruby/GLib2, Ruby/ATK, Ruby/Pango and Ruby/GdkPixbuf2 in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [rcairo](https://github.com/rcairo/rcairo) * [GTK+](http://cairographics.org/) 3.4.2 or later ## Install gem install gdk3 ## License Copyright (c) 2002-2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ## Project Website http://ruby-gnome2.sourceforge.jp/ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/extconf.rb���������������������������������������������������������������0000644�0001750�0001750�00000002223�11701304107�015420� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "gdk3" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/Rakefile�����������������������������������������������������������������0000644�0001750�0001750�00000002666�12257664725�015133� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require "gnome2/rake/package-task" package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/GDK3 is a Ruby binding of GDK-3.x." package.description = "Ruby/GDK3 is a Ruby binding of GDK-3.x." package.dependency.gem.runtime = ["pango", "gdk_pixbuf2"] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = [ "glib2", "atk", "pango", "gdk_pixbuf2", "gobject-introspection", ] package.windows.gobject_introspection_dependencies = [ "atk", "pango", "gdk_pixbuf2", ] package.external_packages = [ { :name => "gtk+", :download_site => :gnome, :label => "GTK+", :version => "3.10.6", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :patches => [ "gdk+-3.10.6-remove-def-use.diff", ], :need_autoreconf => true, :built_file => "bin/libgdk-3-0.dll", }, }, { :name => "hicolor-icon-theme", :download_base_url => "http://icon-theme.freedesktop.org/releases", :label => "gtk-hi-color-icon-theme", :version => "0.13", :windows => { :configure_args => [], :build_concurrently => false, :built_file => "share/icons/hicolor/index.theme", } }, ] end package_task.define ��������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/test/��������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�014427� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/test/test-gdk-event.rb���������������������������������������������������0000644�0001750�0001750�00000030074�12257552167�017621� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGdkEvent < Test::Unit::TestCase class TestAny < self def setup @event = Gdk::EventAny.new(:delete) end def test_delete assert_equal("GDK_DELETE", Gdk::EventAny.new(:delete).event_type.name) end def test_destroy assert_equal("GDK_DESTROY", Gdk::EventAny.new(:destroy).event_type.name) end def test_window assert_nothing_raised do @event.window end end def test_send_event assert_false(@event.send_event?) end end class TestKey < self def setup @key = Gdk::EventKey.new(:key_press) end def test_key_press assert_equal("GDK_KEY_PRESS", Gdk::EventKey.new(:key_press).event_type.name) end def test_key_release assert_equal("GDK_KEY_RELEASE", Gdk::EventKey.new(:key_release).event_type.name) end def test_time assert_kind_of(Integer, @key.time) end def test_state assert_not_nil(@key.state) end def test_keyval assert_kind_of(Integer, @key.keyval) end end class TestButton < self def setup @button = Gdk::EventButton.new(:button_press) end def test_button_press assert_equal("GDK_BUTTON_PRESS", Gdk::EventButton.new(:button_press).event_type.name) end def test_button2_press assert_equal("GDK_2BUTTON_PRESS", Gdk::EventButton.new(:button2_press).event_type.name) end def test_button3_press assert_equal("GDK_3BUTTON_PRESS", Gdk::EventButton.new(:button3_press).event_type.name) end def test_button_release assert_equal("GDK_BUTTON_RELEASE", Gdk::EventButton.new(:button_release).event_type.name) end def test_time assert_kind_of(Integer, @button.time) end def test_x assert_kind_of(Float, @button.x) end def test_y assert_kind_of(Float, @button.y) end def test_state assert_not_nil(@button.state) end def test_button assert_kind_of(Integer, @button.button) end def test_x_root assert_kind_of(Float, @button.x_root) end def test_y_root assert_kind_of(Float, @button.y_root) end end class TestTouch < self def setup @touch = Gdk::EventTouch.new(:touch_begin) end def test_window assert_nothing_raised do @touch.window end end def test_send_event assert_false(@touch.send_event?) end def test_time assert_kind_of(Integer, @touch.time) end def test_x assert_kind_of(Float, @touch.x) end def test_y assert_kind_of(Float, @touch.y) end def test_axes assert_nothing_raised do @touch.axes end end def test_state assert_not_nil(@touch.state) end def test_touch_begin assert_equal("GDK_TOUCH_BEGIN", Gdk::EventTouch.new(:touch_begin).event_type.name) end def test_touch_update assert_equal("GDK_TOUCH_UPDATE", Gdk::EventTouch.new(:touch_update).event_type.name) end def test_touch_cancel assert_equal("GDK_TOUCH_CANCEL", Gdk::EventTouch.new(:touch_cancel).event_type.name) end def test_touch_end assert_equal("GDK_TOUCH_END", Gdk::EventTouch.new(:touch_end).event_type.name) end def test_emulating_pointer assert_nothing_raised do @touch.emulating_pointer end end def test_device assert_nothing_raised do @touch.device end end def test_x_root assert_kind_of(Float, @touch.x_root) end def test_y_root assert_kind_of(Float, @touch.y_root) end end class TestScroll < self def setup @scroll = Gdk::EventScroll.new end def test_time assert_kind_of(Integer, @scroll.time) end def test_x assert_kind_of(Float, @scroll.x) end def test_y assert_kind_of(Float, @scroll.y) end def test_state assert_not_nil(@scroll.state) end def test_direction assert_kind_of(Gdk::EventScroll::Direction, @scroll.direction) end def test_x_root assert_kind_of(Float, @scroll.x_root) end def test_y_root assert_kind_of(Float, @scroll.y_root) end end class TestMotion < self def setup @motion = Gdk::EventMotion.new end def test_time assert_kind_of(Integer, @motion.time) end def test_x assert_kind_of(Float, @motion.x) end def test_y assert_kind_of(Float, @motion.y) end def test_state assert_not_nil(@motion.state) end def test_x_root assert_kind_of(Float, @motion.x_root) end def test_y_root assert_kind_of(Float, @motion.y_root) end def test_request assert_nothing_raised do @motion.request end end end class TestVisibility < self def setup @visibility = Gdk::EventVisibility.new(:visibility_notify) end def test_state assert_kind_of(Gdk::EventVisibility::State, @visibility.state) end end class TestCrossing < self def setup @crossing = Gdk::EventCrossing.new(:enter_notify) end def test_enter_notify assert_equal("GDK_ENTER_NOTIFY", Gdk::EventCrossing.new(:enter_notify).event_type.name) end def test_leave_notify assert_equal("GDK_LEAVE_NOTIFY", Gdk::EventCrossing.new(:leave_notify).event_type.name) end def test_time assert_kind_of(Integer, @crossing.time) end def test_x # TODO: Is Float better? assert_kind_of(Integer, @crossing.x) end def test_y # TODO: Is Float better? assert_kind_of(Integer, @crossing.y) end def test_x_root assert_kind_of(Float, @crossing.x_root) end def test_y_root assert_kind_of(Float, @crossing.y_root) end def test_mode assert_kind_of(Gdk::EventCrossing::Mode, @crossing.mode) end def test_detail assert_not_nil(@crossing.detail) end def test_state assert_not_nil(@crossing.state) end end class TestFocus < self def setup @focus = Gdk::EventFocus.new end def test_in assert_false(@focus.in?) end end class TestConfigure < self def setup @configure = Gdk::EventConfigure.new end def test_x assert_kind_of(Integer, @configure.x) end def test_y assert_kind_of(Integer, @configure.y) end def test_width assert_kind_of(Integer, @configure.width) end def test_height assert_kind_of(Integer, @configure.height) end end class TestProperty < self def setup @property = Gdk::EventProperty.new end def test_atom assert_nothing_raised do @property.atom end end def test_time assert_kind_of(Integer, @property.time) end def test_state assert_not_nil(Integer, @property.state) end end class TestSelection < self def setup @selection = Gdk::EventSelection.new(:selection_clear) end def test_selection_clear assert_equal("GDK_SELECTION_CLEAR", Gdk::EventSelection.new(:selection_clear).event_type.name) end def test_selection_notify assert_equal("GDK_SELECTION_NOTIFY", Gdk::EventSelection.new(:selection_notify).event_type.name) end def test_selection_request assert_equal("GDK_SELECTION_REQUEST", Gdk::EventSelection.new(:selection_request).event_type.name) end def test_selection assert_nothing_raised do @selection.selection end end def test_target assert_nothing_raised do @selection.target end end def test_property assert_nothing_raised do @selection.property end end def test_time assert_kind_of(Integer, @selection.time) end end class TestDND < self def setup @dnd = Gdk::EventDND.new(:drag_enter) end def test_drag_enter assert_equal("GDK_DRAG_ENTER", Gdk::EventDND.new(:drag_enter).event_type.name) end def test_drag_leave assert_equal("GDK_DRAG_LEAVE", Gdk::EventDND.new(:drag_leave).event_type.name) end def test_drag_motion assert_equal("GDK_DRAG_MOTION", Gdk::EventDND.new(:drag_motion).event_type.name) end def test_drag_status assert_equal("GDK_DRAG_STATUS", Gdk::EventDND.new(:drag_status).event_type.name) end def test_drop_start assert_equal("GDK_DROP_START", Gdk::EventDND.new(:drop_start).event_type.name) end def test_drop_finished assert_equal("GDK_DROP_FINISHED", Gdk::EventDND.new(:drop_finished).event_type.name) end def test_context assert_nothing_raised do @dnd.context end end def test_time assert_kind_of(Integer, @dnd.time) end def test_x_root assert_kind_of(Integer, @dnd.x_root) end def test_y_root assert_kind_of(Integer, @dnd.y_root) end end class TestProximity < self def setup @proximity = Gdk::EventProximity.new(:proximity_in) end def test_proximity_in assert_equal("GDK_PROXIMITY_IN", Gdk::EventProximity.new(:proximity_in).event_type.name) end def test_proximity_out assert_equal("GDK_PROXIMITY_OUT", Gdk::EventProximity.new(:proximity_out).event_type.name) end def test_time assert_kind_of(Integer, @proximity.time) end def test_device assert_nothing_raised do @proximity.device end end end class TestWindowState < self def setup @window_state = Gdk::EventWindowState.new end def test_changed_mask assert_nothing_raised do @window_state.changed_mask end end def test_new_window_state assert_nothing_raised do @window_state.new_window_state end end end class TestSetting < self def setup @setting = Gdk::EventSetting.new end def test_action assert_nothing_raised do @setting.action end end def test_name assert_nothing_raised do @setting.name end end end class TestOwnerChange < self def setup @owner_change = Gdk::EventOwnerChange.new end def test_owner assert_nothing_raised do @owner_change.owner end end def test_reason assert_nothing_raised do @owner_change.reason end end def test_selection assert_nothing_raised do @owner_change.selection end end def test_time assert_kind_of(Integer, @owner_change.time) end def test_selection_time assert_kind_of(Integer, @owner_change.selection_time) end end class TestGrabBroken < self def setup @grab_broken = Gdk::EventGrabBroken.new end def test_keyboard assert_boolean(@grab_broken.keyboard?) end def test_implicit assert_boolean(@grab_broken.implicit?) end def test_grab_window assert_nothing_raised do @grab_broken.grab_window end end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/test/test-gdk-color.rb���������������������������������������������������0000644�0001750�0001750�00000001711�12124610262�017572� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGdkColor < Test::Unit::TestCase def test_to_s color = Gdk::Color.new(0xffff, 0x1234, 0xabcd) assert_equal("#ffff1234abcd", color.to_s) end end �������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/test/test-gdk-rectangle.rb�����������������������������������������������0000644�0001750�0001750�00000001705�12124610262�020423� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGdkRectangle < Test::Unit::TestCase def test_width rectangle = Gdk::Rectangle.new(0, 10, 20, 30) assert_equal(20, rectangle.width) end end �����������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/test/test-gdk-geometry.rb������������������������������������������������0000644�0001750�0001750�00000001671�12124610262�020314� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGdkGeometry < Test::Unit::TestCase def test_min_width geometry = Gdk::Geometry.new assert_equal(0, geometry.min_width) end end �����������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/test/run-test.rb���������������������������������������������������������0000755�0001750�0001750�00000003321�12124610262�016517� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") atk_base = File.join(ruby_gnome2_base, "atk") pango_base = File.join(ruby_gnome2_base, "pango") gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2") gdk3_base = File.join(ruby_gnome2_base, "gdk3") [[glib_base, "glib2"], [atk_base, "atk"], [pango_base, "pango"], [gdk_pixbuf_base, "gdk_pixbuf2"], [gdk3_base, "gdk3"]].each do |target, module_name| if system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require "glib-test-init" $LOAD_PATH.unshift(File.join(gdk3_base, "test")) require "gdk-test-utils" require "gdk3" exit Test::Unit::AutoRunner.run(true) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/test/test-gdk-rgba.rb����������������������������������������������������0000644�0001750�0001750�00000001710�12257552167�017406� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGdkRGBA < Test::Unit::TestCase def test_to_s rgba = Gdk::RGBA.new(0.2, 0.4, 0.6, 0.5) assert_equal("rgba(51,102,153,0.5)", rgba.to_s) end end ��������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/test/gdk-test-utils.rb���������������������������������������������������0000644�0001750�0001750�00000001522�12124610262�017614� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "test-unit" require "test/unit/notify" module GdkTestUtils end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk3/test/test-gdk-window-attr.rb���������������������������������������������0000644�0001750�0001750�00000002324�12124610262�020734� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestGdkWindowAttr < Test::Unit::TestCase include GdkTestUtils def test_initialize attrs = Gdk::WindowAttr.new(100, 100, :input_only, :temp) assert_equal([ 100, 100, Gdk::Window::WindowClass::INPUT_ONLY, Gdk::Window::Type::TEMP, ], [attrs.width, attrs.height, attrs.wclass, attrs.window_type]) end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/�������������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665516�013463� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�014236� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/����������������������������������������������������������������0000755�0001750�0001750�00000000000�12137115064�015104� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosocketcontrolmessage.c�������������������������������������0000644�0001750�0001750�00000005052�11701304107�022525� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cSocketControlMessage #define _SELF(value) RVAL2GSOCKETCONTROLMESSAGE(value) static VALUE rg_s_deserialize(G_GNUC_UNUSED VALUE self, VALUE level, VALUE type, VALUE data) { StringValue(data); return GOBJ2RVAL(g_socket_control_message_deserialize(FIX2INT(level), FIX2INT(type), RSTRING_LEN(data), RSTRING_PTR(data))); } static VALUE rg_level(VALUE self) { return INT2FIX(g_socket_control_message_get_level(_SELF(self))); } static VALUE rg_msg_type(VALUE self) { return INT2FIX(g_socket_control_message_get_msg_type(_SELF(self))); } static VALUE rg_size(VALUE self) { return GSIZE2RVAL(g_socket_control_message_get_size(_SELF(self))); } static VALUE rg_serialize(VALUE self) { gsize size; VALUE result; /* TODO: Is tainting really necessary? Where does the message come * from? */ size = g_socket_control_message_get_size(_SELF(self)); result = rb_str_new(NULL, size); g_socket_control_message_serialize(_SELF(self), RSTRING_PTR(result)); OBJ_TAINT(result); return result; } void Init_gsocketcontrolmessage(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_CONTROL_MESSAGE, "SocketControlMessage", mGio); RG_DEF_SMETHOD(deserialize, 3); RG_DEF_METHOD(level, 0); RG_DEF_METHOD(msg_type, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(serialize, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioasyncresult.c����������������������������������������������0000644�0001750�0001750�00000002610�11701304107�020640� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mAsyncResult #define _SELF(value) RVAL2GASYNCRESULT(value) /* NOTE: g_async_result_get_user_data isn't of any use from Ruby. */ static VALUE rg_source_object(VALUE self) { return GOBJ2RVAL_UNREF(g_async_result_get_source_object(_SELF(self))); } void Init_gasyncresult(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_ASYNC_RESULT, "AsyncResult", mGio); RG_DEF_METHOD(source_object, 0); } ������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioiomodules.c������������������������������������������������0000664�0001750�0001750�00000003010�11740310343�020263� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mIOModules static VALUE rg_s_load_all_in_directory(G_GNUC_UNUSED VALUE self, VALUE dirname) { return GLIST2ARY_FREE(g_io_modules_load_all_in_directory(RVAL2CSTR(dirname))); } static VALUE rg_s_scan_all_in_directory(VALUE self, VALUE dirname) { g_io_modules_scan_all_in_directory(RVAL2CSTR(dirname)); return self; } void Init_giomodules(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "IOModules"); RG_DEF_SMETHOD(load_all_in_directory, 1); RG_DEF_SMETHOD(scan_all_in_directory, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiozlibdecompressor.c�����������������������������������������0000644�0001750�0001750�00000002755�11701304107�021664� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cZlibDecompressor #define _SELF(value) RVAL2GZLIBDECOMPRESSOR(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE format; rb_scan_args(argc, argv, "01", &format); G_INITIALIZE(self, g_zlib_decompressor_new(RVAL2GZLIBCOMPRESSORFORMATDEFAULT(format))); return Qnil; } void Init_gzlibdecompressor(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_ZLIB_DECOMPRESSOR, "ZlibDecompressor", mGio); RG_DEF_METHOD(initialize, -1); } �������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioconverteroutputstream.c������������������������������������0000644�0001750�0001750�00000003026�11701304107�022772� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cConverterOutputStream #define _SELF(value) RVAL2GCONVERTEROUTPUTSTREAM(value) static VALUE rg_initialize(VALUE self, VALUE base_stream, VALUE converter) { G_INITIALIZE(self, g_converter_output_stream_new(RVAL2GOUTPUTSTREAM(base_stream), RVAL2GCONVERTER(converter))); return Qnil; } void Init_gconverteroutputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CONVERTER_OUTPUT_STREAM, "ConverterOutputStream", mGio); RG_DEF_METHOD(initialize, 2); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosrvtarget.c������������������������������������������������0000644�0001750�0001750�00000004376�11701304107�020320� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cSrvTarget #define _SELF(value) RVAL2GSRVTARGET(value) static VALUE rg_initialize(VALUE self, VALUE hostname, VALUE port, VALUE priority, VALUE weight) { /* TODO: Does this work with boxed? */ /* TODO: hostname should be infected when returned. */ G_INITIALIZE(self, g_srv_target_new(RVAL2CSTR(hostname), RVAL2GUINT16(port), RVAL2GUINT16(priority), RVAL2GUINT16(weight))); return Qnil; } static VALUE rg_hostname(VALUE self) { return CSTR2RVAL(g_srv_target_get_hostname(_SELF(self))); } static VALUE rg_port(VALUE self) { return GUINT162RVAL(g_srv_target_get_port(_SELF(self))); } static VALUE rg_priority(VALUE self) { return GUINT162RVAL(g_srv_target_get_priority(_SELF(self))); } static VALUE rg_weight(VALUE self) { return GUINT162RVAL(g_srv_target_get_weight(_SELF(self))); } /* TODO: srvtarget_list_sort */ void Init_gsrvtarget(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SRV_TARGET, "SrvTarget", mGio); RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(hostname, 0); RG_DEF_METHOD(port, 0); RG_DEF_METHOD(priority, 0); RG_DEF_METHOD(weight, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioloadableicon.c���������������������������������������������0000644�0001750�0001750�00000006026�11701304107�020705� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mLoadableIcon #define _SELF(value) RVAL2GLOADABLEICON(value) static VALUE rg_load(int argc, VALUE *argv, VALUE self) { VALUE size, cancellable; char *type; GError *error = NULL; GInputStream *stream; rb_scan_args(argc, argv, "11", &size, &cancellable); stream = g_loadable_icon_load(_SELF(self), NUM2INT(size), &type, RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return rb_assoc_new(GOBJ2RVAL_UNREF(stream), CSTR2RVAL_FREE(type)); } static VALUE rg_load_async(int argc, VALUE *argv, VALUE self) { VALUE rbsize, rbcancellable, block; int size; GCancellable *cancellable; rb_scan_args(argc, argv, "11&", &rbsize, &rbcancellable, &block); size = NUM2INT(rbsize); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_loadable_icon_load_async(_SELF(self), size, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_load_finish(VALUE self, VALUE result) { char *type; GError *error = NULL; GInputStream *stream; stream = g_loadable_icon_load_finish(_SELF(self), RVAL2GASYNCRESULT(result), &type, &error); if (error != NULL) rbgio_raise_error(error); return rb_assoc_new(GOBJ2RVAL_UNREF(stream), CSTR2RVAL_FREE(type)); } void Init_gloadableicon(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_LOADABLE_ICON, "LoadableIcon", mGio); RG_DEF_METHOD(load, -1); RG_DEF_METHOD(load_async, -1); RG_DEF_METHOD(load_finish, 1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofilemonitor.c����������������������������������������������0000644�0001750�0001750�00000003242�11701304107�020615� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFileMonitor #define _SELF(value) RVAL2GFILEMONITOR(value) static VALUE rg_cancel(VALUE self) { return CBOOL2RVAL(g_file_monitor_cancel(_SELF(self))); } void Init_gfilemonitor(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_MONITOR, "FileMonitor", mGio); G_DEF_CLASS(G_TYPE_FILE_MONITOR_EVENT, "Event", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_MONITOR_EVENT, "G_FILE_MONITOR_"); G_DEF_CLASS(G_TYPE_FILE_MONITOR_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_MONITOR_FLAGS, "G_FILE_MONITOR_"); RG_DEF_METHOD(cancel, 0); /* TODO: Do we need #emit_event? */ } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofilteroutputstream.c���������������������������������������0000644�0001750�0001750�00000002076�11701304107�022254� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" void Init_gfilteroutputstream(VALUE mGio) { (void)G_DEF_CLASS(G_TYPE_FILTER_OUTPUT_STREAM, "FilterOutputStream", mGio); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgio2conversions.h���������������������������������������������0000644�0001750�0001750�00000025766�11701304107�020744� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGIO2CONVERSIONS_H__ #define __RBGIO2CONVERSIONS_H__ #define RVAL2GAPPINFO(o) (G_APP_INFO(RVAL2GOBJ(o))) #define RVAL2GAPPLAUNCHCONTEXT(o) (G_APP_LAUNCH_CONTEXT(RVAL2GOBJ(o))) #define RVAL2GASYNCINITABLE(o) (G_ASYNC_INITABLE(RVAL2GOBJ(o))) #define RVAL2GASYNCRESULT(o) (G_ASYNC_RESULT(RVAL2GOBJ(o))) #define RVAL2GBUFFEREDINPUTSTREAM(o) (G_BUFFERED_INPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GBUFFEREDOUTPUTSTREAM(o) (G_BUFFERED_OUTPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GCANCELLABLE(o) (G_CANCELLABLE(RVAL2GOBJ(o))) #define RVAL2GCHARSETCONVERTER(o) (G_CHARSET_CONVERTER(RVAL2GOBJ(o))) #define RVAL2GCONVERTER(o) (G_CONVERTER(RVAL2GOBJ(o))) #define RVAL2GCONVERTERINPUTSTREAM(o) (G_CONVERTER_INPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GCONVERTEROUTPUTSTREAM(o) (G_CONVERTER_OUTPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GDATAINPUTSTREAM(o) (G_DATA_INPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GDATAOUTPUTSTREAM(o) (G_DATA_OUTPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GDESKTOPAPPINFO(o) (G_DESKTOP_APP_INFO(RVAL2GOBJ(o))) #define RVAL2GDRIVE(o) (G_DRIVE(RVAL2GOBJ(o))) #define RVAL2GEMBLEM(o) (G_EMBLEM(RVAL2GOBJ(o))) #define RVAL2GEMBLEMEDICON(o) (G_EMBLEMED_ICON(RVAL2GOBJ(o))) #define RVAL2GFILE(o) (G_FILE(RVAL2GOBJ(o))) #define RVAL2GFILEDESCRIPTORBASED(o) (G_FILE_DESCRIPTOR_BASED(RVAL2GOBJ(o))) #define RVAL2GFILEENUMERATOR(o) (G_FILE_ENUMERATOR(RVAL2GOBJ(o))) #define RVAL2GFILEICON(o) (G_FILE_ICON(RVAL2GOBJ(o))) #define RVAL2GFILEINFO(o) (G_FILE_INFO(RVAL2GOBJ(o))) #define RVAL2GFILEINPUTSTREAM(o) (G_FILE_INPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GFILEIOSTREAM(o) (G_FILE_IO_STREAM(RVAL2GOBJ(o))) #define RVAL2GFILEMONITOR(o) (G_FILE_MONITOR(RVAL2GOBJ(o))) #define RVAL2GFILENAMECOMPLETER(o) (G_FILENAME_COMPLETER(RVAL2GOBJ(o))) #define RVAL2GFILEOUTPUTSTREAM(o) (G_FILE_OUTPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GICON(o) (G_ICON(RVAL2GOBJ(o))) #define RVAL2GINETADDRESS(o) (G_INET_ADDRESS(RVAL2GOBJ(o))) #define RVAL2GINITABLE(o) (G_INITABLE(RVAL2GOBJ(o))) #define RVAL2GINPUTSTREAM(o) (G_INPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GIOMODULE(o) (G_IO_MODULE(RVAL2GOBJ(o))) #define RVAL2GIOSTREAM(o) (G_IO_STREAM(RVAL2GOBJ(o))) #define RVAL2GLOADABLEICON(o) (G_LOADABLE_ICON(RVAL2GOBJ(o))) #define RVAL2GMEMORYINPUTSTREAM(o) (G_MEMORY_INPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GMOUNT(o) (G_MOUNT(RVAL2GOBJ(o))) #define RVAL2GMOUNTOPERATION(o) (G_MOUNT_OPERATION(RVAL2GOBJ(o))) #define RVAL2GNETWORKADDRESS(o) (G_NETWORK_ADDRESS(RVAL2GOBJ(o))) #define RVAL2GNETWORKSERVICE(o) (G_NETWORK_SERVICE(RVAL2GOBJ(o))) #define RVAL2GOUTPUTSTREAM(o) (G_OUTPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GPERMISSION(o) (G_PERMISSION(RVAL2GOBJ(o))) #define RVAL2GRESOLVER(o) (G_RESOLVER(RVAL2GOBJ(o))) #define RVAL2GSEEKABLE(o) (G_SEEKABLE(RVAL2GOBJ(o))) #define RVAL2GSIMPLEASYNCRESULT(o) (G_SIMPLE_ASYNC_RESULT(RVAL2GOBJ(o))) #define RVAL2GSOCKET(o) (G_SOCKET(RVAL2GOBJ(o))) #define RVAL2GSOCKETADDRESS(o) (G_SOCKET_ADDRESS(RVAL2GOBJ(o))) #define RVAL2GSOCKETADDRESSENUMERATOR(o) (G_SOCKET_ADDRESS_ENUMERATOR(RVAL2GOBJ(o))) #define RVAL2GSOCKETCLIENT(o) (G_SOCKET_CLIENT(RVAL2GOBJ(o))) #define RVAL2GSOCKETCONNECTABLE(o) (G_SOCKET_CONNECTABLE(RVAL2GOBJ(o))) #define RVAL2GSOCKETCONNECTION(o) (G_SOCKET_CONNECTION(RVAL2GOBJ(o))) #define RVAL2GSOCKETCONTROLMESSAGE(o) (G_SOCKET_CONTROL_MESSAGE(RVAL2GOBJ(o))) #define RVAL2GSOCKETLISTENER(o) (G_SOCKET_LISTENER(RVAL2GOBJ(o))) #define RVAL2GSOCKETSERVICE(o) (G_SOCKET_SERVICE(RVAL2GOBJ(o))) #define RVAL2GTHEMEDICON(o) (G_THEMED_ICON(RVAL2GOBJ(o))) #define RVAL2GUNIXCONNECTION(o) (G_UNIX_CONNECTION(RVAL2GOBJ(o))) #define RVAL2GUNIXFDLIST(o) (G_UNIX_FD_LIST(RVAL2GOBJ(o))) #define RVAL2GUNIXFDMESSAGE(o) (G_UNIX_FD_MESSAGE(RVAL2GOBJ(o))) #define RVAL2GUNIXINPUTSTREAM(o) (G_UNIX_INPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GUNIXMOUNTMONITOR(o) (G_UNIX_MOUNT_MONITOR(RVAL2GOBJ(o))) #define RVAL2GUNIXOUTPUTSTREAM(o) (G_UNIX_OUTPUT_STREAM(RVAL2GOBJ(o))) #define RVAL2GUNIXSOCKETADDRESS(o) (G_UNIX_SOCKET_ADDRESS(RVAL2GOBJ(o))) #define RVAL2GVFS(o) (G_VFS(RVAL2GOBJ(o))) #define RVAL2GVOLUME(o) (G_VOLUME(RVAL2GOBJ(o))) #define RVAL2GVOLUMEMONITOR(o) (G_VOLUME_MONITOR(RVAL2GOBJ(o))) #define RVAL2GZLIBCOMPRESSOR(o) (G_ZLIB_COMPRESSOR(RVAL2GOBJ(o))) #define RVAL2GZLIBDECOMPRESSOR(o) (G_ZLIB_DECOMPRESSOR(RVAL2GOBJ(o))) #define RVAL2GFILEATTRIBUTEINFO(o) ((GFileAttributeInfo*)RVAL2BOXED(o, G_TYPE_FILE_ATTRIBUTE_INFO)) #define GFILEATTRIBUTEINFO2RVAL(o) (BOXED2RVAL(o, G_TYPE_FILE_ATTRIBUTE_INFO)) #define RVAL2GFILEATTRIBUTEINFOLIST(o) ((GFileAttributeInfoList*)RVAL2BOXED(o, G_TYPE_FILE_ATTRIBUTE_INFO_LIST)) #define GFILEATTRIBUTEINFOLIST2RVAL(o) (BOXED2RVAL(o, G_TYPE_FILE_ATTRIBUTE_INFO_LIST)) #define RVAL2GFILEATTRIBUTEMATCHER(o) ((GFileAttributeMatcher*)RVAL2BOXED(o, G_TYPE_FILE_ATTRIBUTE_MATCHER)) #define GFILEATTRIBUTEMATCHER2RVAL(o) (BOXED2RVAL(o, G_TYPE_FILE_ATTRIBUTE_MATCHER)) #define RVAL2GSRVTARGET(o) ((GSrvTarget*)RVAL2BOXED(o, G_TYPE_SRV_TARGET)) #define GSRVTARGET2RVAL(o) (BOXED2RVAL(o, G_TYPE_SRV_TARGET)) #define RVAL2GDATASTREAMBYTEORDER(o) (RVAL2GENUM(o, G_TYPE_DATA_STREAM_BYTE_ORDER)) #define GDATASTREAMBYTEORDER2RVAL(o) (GENUM2RVAL(o, G_TYPE_DATA_STREAM_BYTE_ORDER)) #define RVAL2GDATASTREAMNEWLINETYPE(o) (RVAL2GENUM(o, G_TYPE_DATA_STREAM_NEWLINE_TYPE)) #define GDATASTREAMNEWLINETYPE2RVAL(o) (GENUM2RVAL(o, G_TYPE_DATA_STREAM_NEWLINE_TYPE)) #define RVAL2GDRIVESTARTFLAGS(o) (RVAL2GENUM(o, G_TYPE_DRIVE_START_FLAGS)) #define GDRIVESTARTFLAGS2RVAL(o) (GENUM2RVAL(o, G_TYPE_DRIVE_START_FLAGS)) #define RVAL2GDRIVESTARTSTOPTYPE(o) (RVAL2GENUM(o, G_TYPE_DRIVE_START_STOP_TYPE)) #define GDRIVESTARTSTOPTYPE2RVAL(o) (GENUM2RVAL(o, G_TYPE_DRIVE_START_STOP_TYPE)) #define RVAL2GEMBLEMORIGIN(o) (RVAL2GENUM(o, G_TYPE_EMBLEM_ORIGIN)) #define GEMBLEMORIGIN2RVAL(o) (GENUM2RVAL(o, G_TYPE_EMBLEM_ORIGIN)) #define RVAL2GFILEATTRIBUTESTATUS(o) (RVAL2GENUM(o, G_TYPE_FILE_ATTRIBUTE_STATUS)) #define GFILEATTRIBUTESTATUS2RVAL(o) (GENUM2RVAL(o, G_TYPE_FILE_ATTRIBUTE_STATUS)) #define RVAL2GFILEATTRIBUTETYPE(o) (RVAL2GENUM(o, G_TYPE_FILE_ATTRIBUTE_TYPE)) #define GFILEATTRIBUTETYPE2RVAL(o) (GENUM2RVAL(o, G_TYPE_FILE_ATTRIBUTE_TYPE)) #define RVAL2GFILETYPE(o) (RVAL2GENUM(o, G_TYPE_FILE_TYPE)) #define GFILETYPE2RVAL(o) (GENUM2RVAL(o, G_TYPE_FILE_TYPE)) #define RVAL2GMOUNTMOUNTFLAGS(o) (RVAL2GENUM(o, G_TYPE_MOUNT_MOUNT_FLAGS)) #define GMOUNTMOUNTFLAGS2RVAL(o) (GENUM2RVAL(o, G_TYPE_MOUNT_MOUNT_FLAGS)) #define RVAL2GMOUNTOPERATIONRESULT(o) (RVAL2GENUM(o, G_TYPE_MOUNT_OPERATION_RESULT)) #define GMOUNTOPERATIONRESULT2RVAL(o) (GENUM2RVAL(o, G_TYPE_MOUNT_OPERATION_RESULT)) #define RVAL2GPASSWORDSAVE(o) (RVAL2GENUM(o, G_TYPE_PASSWORD_SAVE)) #define GPASSWORDSAVE2RVAL(o) (GENUM2RVAL(o, G_TYPE_PASSWORD_SAVE)) #define RVAL2GSOCKETFAMILY(o) (RVAL2GENUM(o, G_TYPE_SOCKET_FAMILY)) #define GSOCKETFAMILY2RVAL(o) (GENUM2RVAL(o, G_TYPE_SOCKET_FAMILY)) #define RVAL2GSOCKETPROTOCOL(o) (RVAL2GENUM(o, G_TYPE_SOCKET_PROTOCOL)) #define GSOCKETPROTOCOL2RVAL(o) (GENUM2RVAL(o, G_TYPE_SOCKET_PROTOCOL)) #define RVAL2GSOCKETTYPE(o) (RVAL2GENUM(o, G_TYPE_SOCKET_TYPE)) #define GSOCKETTYPE2RVAL(o) (GENUM2RVAL(o, G_TYPE_SOCKET_TYPE)) #define RVAL2GAPPINFOCREATEFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_APP_INFO_CREATE_FLAGS)) #define GAPPINFOCREATEFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_APP_INFO_CREATE_FLAGS)) #define RVAL2GAPPLICATIONFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_APPLICATION_FLAGS)) #define GAPPLICATIONFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_APPLICATION_FLAGS)) #define RVAL2GCONVERTERFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_CONVERTER_FLAGS)) #define GCONVERTERFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_CONVERTER_FLAGS)) #define RVAL2GCONVERTERRESULT(o) (RVAL2GFLAGS(o, G_TYPE_CONVERTER_RESULT)) #define GCONVERTERRESULT2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_CONVERTER_RESULT)) #define RVAL2GFILEATTRIBUTEINFOFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS)) #define GFILEATTRIBUTEINFOFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS)) #define RVAL2GFILECOPYFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FILE_COPY_FLAGS)) #define GFILECOPYFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FILE_COPY_FLAGS)) #define RVAL2GFILECREATEFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FILE_CREATE_FLAGS)) #define GFILECREATEFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FILE_CREATE_FLAGS)) #define RVAL2GFILEMONITORFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FILE_MONITOR_FLAGS)) #define GFILEMONITORFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FILE_MONITOR_FLAGS)) #define RVAL2GFILEQUERYINFOFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_FILE_QUERY_INFO_FLAGS)) #define GFILEQUERYINFOFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_FILE_QUERY_INFO_FLAGS)) #define RVAL2GMOUNTUNMOUNTFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_MOUNT_UNMOUNT_FLAGS)) #define GMOUNTUNMOUNTFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_MOUNT_UNMOUNT_FLAGS)) #define RVAL2GOUTPUTSTREAMSPLICEFLAGS(o) (RVAL2GFLAGS(o, G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS)) #define GOUTPUTSTREAMSPLICEFLAGS2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS)) #define RVAL2GZLIBCOMPRESSORFORMAT(o) (RVAL2GFLAGS(o, G_TYPE_ZLIB_COMPRESSOR_FORMAT)) #define GZLIBCOMPRESSORFORMAT2RVAL(o) (GFLAGS2RVAL(o, G_TYPE_ZLIB_COMPRESSOR_FORMAT)) #endif /* __RBGIO2CONVERSIONS_H__ */ ����������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgio2private.h�������������������������������������������������0000644�0001750�0001750�00000016144�12017142000�020025� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGIO2PRIVATE_H__ #define __RBGIO2PRIVATE_H__ #include <ruby.h> #include <rbglib.h> #include <rbgobject.h> #include "rbgio2.h" #define CSTR2RVAL_TAINTED(string, length) \ rbgio_cstr_to_rval_tainted((string), (length)) #define CSTR2RVAL_TAINTED_FREE(string, length) \ rbgio_cstr_to_rval_tainted_free((string), (length)) #define GLIST2ARY_UNREF_FREE(list) rbgio_glist_to_ary_unref_free(list) #define GFDS2ARY(fds) rbgio_fds_to_ary(fds) #define GFDS2ARY_FREE(fds) rbgio_fds_to_ary_free(fds) #define GFILEARY2GLIST(ary) rbgio_gfile_ary_to_glist(ary) #define GFILEARY2GLIST_ACCEPT_NIL(ary) rbgio_gfile_ary_to_glist_accept_nil(ary) G_GNUC_INTERNAL VALUE rbgio_cstr_to_rval_tainted(const char *string, gsize length); G_GNUC_INTERNAL VALUE rbgio_cstr_to_rval_tainted_free(char *string, gsize length); G_GNUC_INTERNAL VALUE rbgio_glist_to_ary_unref_free(GList *list); G_GNUC_INTERNAL VALUE rbgio_fds_to_ary(const gint *fds); G_GNUC_INTERNAL VALUE rbgio_fds_to_ary_free(gint *fds); G_GNUC_INTERNAL GList *rbgio_gfile_ary_to_glist(VALUE ary); G_GNUC_INTERNAL GList *rbgio_gfile_ary_to_glist_accept_nil(VALUE ary); G_GNUC_INTERNAL void rbgio_rval_to_gtimeval(VALUE value, GTimeVal *time); G_GNUC_INTERNAL void rbgio_async_ready_callback(GObject *source, GAsyncResult *result, gpointer data); G_GNUC_INTERNAL VALUE rbgio_child_remove_and_return(VALUE parent, VALUE child); G_GNUC_INTERNAL void Init_gio(void); G_GNUC_INTERNAL void Init_gappinfo(VALUE mGio); G_GNUC_INTERNAL void Init_gapplaunchcontext(VALUE mGio); G_GNUC_INTERNAL void Init_gasyncinitable(VALUE mGio); G_GNUC_INTERNAL void Init_gasyncresult(VALUE mGio); G_GNUC_INTERNAL void Init_gbufferedinputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gbufferedoutputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gcancellable(VALUE mGio); G_GNUC_INTERNAL void Init_gcharsetconverter(VALUE mGio); G_GNUC_INTERNAL void Init_gcontenttype(VALUE mGio); G_GNUC_INTERNAL void Init_gconverter(VALUE mGio); G_GNUC_INTERNAL void Init_gconverterinputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gconverteroutputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gdatainputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gdataoutputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gdesktopappinfo(VALUE mGio); G_GNUC_INTERNAL void Init_gdrive(VALUE mGio); G_GNUC_INTERNAL void Init_gemblem(VALUE mGio); G_GNUC_INTERNAL void Init_gemblemedicon(VALUE mGio); G_GNUC_INTERNAL void Init_gfile(VALUE mGio); G_GNUC_INTERNAL void Init_gfileattribute(VALUE mGio); G_GNUC_INTERNAL void Init_gfileattributeinfo(VALUE mGio); G_GNUC_INTERNAL void Init_fileattributeinfolist(VALUE mGio); G_GNUC_INTERNAL void Init_gfileattributematcher(VALUE mGio); G_GNUC_INTERNAL void Init_gfiledescriptorbased(VALUE mGio); G_GNUC_INTERNAL void Init_gfileenumerator(VALUE mGio); G_GNUC_INTERNAL void Init_gfileicon(VALUE mGio); G_GNUC_INTERNAL void Init_gfileinfo(VALUE mGio); G_GNUC_INTERNAL void Init_gfileinputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gfileiostream(VALUE mGio); G_GNUC_INTERNAL void Init_gfilemonitor(VALUE mGio); G_GNUC_INTERNAL void Init_gfilenamecompleter(VALUE mGio); G_GNUC_INTERNAL void Init_gfileoutputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gfilterinputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gfilteroutputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gicon(VALUE mGio); G_GNUC_INTERNAL void Init_ginetaddress(VALUE mGio); G_GNUC_INTERNAL void Init_ginetsocketaddress(VALUE mGio); G_GNUC_INTERNAL void Init_ginitable(VALUE mGio); G_GNUC_INTERNAL void Init_ginputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gioerror(VALUE mGio); G_GNUC_INTERNAL void Init_giomodule(VALUE mGio); G_GNUC_INTERNAL void Init_giomodules(VALUE mGio); G_GNUC_INTERNAL void Init_gioscheduler(VALUE mGio); G_GNUC_INTERNAL void Init_gioschedulerjob(VALUE mGio); G_GNUC_INTERNAL void Init_giostream(VALUE mGio); G_GNUC_INTERNAL void Init_gloadableicon(VALUE mGio); G_GNUC_INTERNAL void Init_gmemoryinputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gmemoryoutputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gmount(VALUE mGio); G_GNUC_INTERNAL void Init_gmountoperation(VALUE mGio); G_GNUC_INTERNAL void Init_gnetworkaddress(VALUE mGio); G_GNUC_INTERNAL void Init_gnetworkservice(VALUE mGio); G_GNUC_INTERNAL void Init_goutputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gresolver(VALUE mGio); G_GNUC_INTERNAL void Init_gseekable(VALUE mGio); G_GNUC_INTERNAL void Init_gsimpleasyncresult(VALUE mGio); G_GNUC_INTERNAL void Init_gsocket(VALUE mGio); G_GNUC_INTERNAL void Init_gsocketaddress(VALUE mGio); G_GNUC_INTERNAL void Init_gsocketclient(VALUE mGio); G_GNUC_INTERNAL void Init_gsocketconnectable(VALUE mGio); G_GNUC_INTERNAL void Init_gsocketaddressenumerator(VALUE mGio); G_GNUC_INTERNAL void Init_gsocketconnection(VALUE mGio); G_GNUC_INTERNAL void Init_gsocketconnectionfactory(VALUE mGio); G_GNUC_INTERNAL void Init_gsocketcontrolmessage(VALUE mGio); G_GNUC_INTERNAL void Init_gsocketlistener(VALUE mGio); G_GNUC_INTERNAL void Init_gsocketservice(VALUE mGio); G_GNUC_INTERNAL void Init_gsrvtarget(VALUE mGio); G_GNUC_INTERNAL void Init_gtcpconnection(VALUE mGio); G_GNUC_INTERNAL void Init_gthreadedsocketservice(VALUE mGio); G_GNUC_INTERNAL void Init_gthemedicon(VALUE mGio); G_GNUC_INTERNAL void Init_gtlscertificate(VALUE mGio); G_GNUC_INTERNAL void Init_gunixconnection(VALUE mGio); G_GNUC_INTERNAL void Init_gunixfdlist(VALUE mGio); G_GNUC_INTERNAL void Init_gunixfdmessage(VALUE mGio); G_GNUC_INTERNAL void Init_gunixinputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gunixmount(VALUE mGio); G_GNUC_INTERNAL void Init_gunixmounts(VALUE mGio); G_GNUC_INTERNAL void Init_gunixmountpoint(VALUE mGio); G_GNUC_INTERNAL void Init_gunixmountpoints(VALUE mGio); G_GNUC_INTERNAL void Init_gunixmountmonitor(VALUE mGio); G_GNUC_INTERNAL void Init_gunixoutputstream(VALUE mGio); G_GNUC_INTERNAL void Init_gunixsocketaddress(VALUE mGio); G_GNUC_INTERNAL void Init_gvfs(VALUE mGio); G_GNUC_INTERNAL void Init_gvolume(VALUE mGio); G_GNUC_INTERNAL void Init_gvolumemonitor(VALUE mGio); G_GNUC_INTERNAL void Init_gzlibcompressor(VALUE mGio); G_GNUC_INTERNAL void Init_gzlibdecompressor(VALUE mGio); G_GNUC_INTERNAL void Init_util(void); #endif /* __RBGIO2PRIVATE_H__ */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioconverter.c������������������������������������������������0000644�0001750�0001750�00000010407�11701304107�020276� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mConverter #define _SELF(value) RVAL2GCONVERTER(value) #define RVAL2GCONVERTERFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GCONVERTERFLAGS, \ G_CONVERTER_NO_FLAGS) /* TODO: Look at gconverteroutputstream for implementing this. */ /* TODO: Actually, is there any point in implementing this? */ static VALUE rg_convert(int argc, VALUE *argv, VALUE self) { VALUE input, rbflags; GConverter *converter; gsize input_remaining, output_size, output_remaining, bytes_read, bytes_written; GConverterFlags flags; /* TODO: Use a Ruby string instead. */ char *output_base, *output; GError *error = NULL; GConverterResult result; rb_scan_args(argc, argv, "11", &input, &rbflags); converter = _SELF(self); StringValue(input); input_remaining = RSTRING_LEN(input); flags = RVAL2GCONVERTERFLAGSDEFAULT(rbflags); output_remaining = output_size = BUFSIZ; output_base = output = ALLOCA_N(char, output_size); do { result = g_converter_convert(converter, RSTRING_PTR(input), input_remaining, output, output_remaining, flags, &bytes_read, &bytes_written, &error); switch (result) { case G_CONVERTER_ERROR: switch (error->code) { case G_IO_ERROR_NO_SPACE: /* TODO: Expand the buffer? */ break; case G_IO_ERROR_PARTIAL_INPUT: /* TODO: How do we request/tell the user that * they need to provide more data? */ break; default: break; } rbgio_raise_error(error); break; case G_CONVERTER_CONVERTED: case G_CONVERTER_FLUSHED: input_remaining -= bytes_read; input += bytes_read; output_remaining -= bytes_written; output += bytes_written; /* TODO: Do we need to do anything else? */ break; case G_CONVERTER_FINISHED: /* TODO: Do we simply break, or do we need to consider * something else? */ break; default: break; } } while (input_remaining > 0); return CSTR2RVAL(output_base); } static VALUE rg_reset(VALUE self) { g_converter_reset(_SELF(self)); return self; } void Init_gconverter(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_CONVERTER, "Converter", mGio); RG_DEF_METHOD(convert, -1); RG_DEF_METHOD(reset, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofileattribute.c��������������������������������������������0000644�0001750�0001750�00000023345�11701304107�021137� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mFileAttribute void Init_gfileattribute(VALUE mGio) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "FileAttribute"); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_TYPE)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_HIDDEN", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_BACKUP", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_SYMLINK", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_IS_VIRTUAL", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_NAME)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_DISPLAY_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_EDIT_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_COPY_NAME", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_COPY_NAME)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_DESCRIPTION", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_ICON", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_ICON)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_CONTENT_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_FAST_CONTENT_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SIZE)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_ALLOCATED_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_SYMLINK_TARGET", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_TARGET_URI", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_TARGET_URI)); rb_define_const(RG_TARGET_NAMESPACE, "STANDARD_SORT_ORDER", CSTR2RVAL(G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER)); rb_define_const(RG_TARGET_NAMESPACE, "ETAG_VALUE", CSTR2RVAL(G_FILE_ATTRIBUTE_ETAG_VALUE)); rb_define_const(RG_TARGET_NAMESPACE, "ID_FILE", CSTR2RVAL(G_FILE_ATTRIBUTE_ID_FILE)); rb_define_const(RG_TARGET_NAMESPACE, "ID_FILESYSTEM", CSTR2RVAL(G_FILE_ATTRIBUTE_ID_FILESYSTEM)); rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_READ", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_READ)); rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_WRITE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE)); rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_EXECUTE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE)); rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_DELETE", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE)); rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_TRASH", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH)); rb_define_const(RG_TARGET_NAMESPACE, "ACCESS_CAN_RENAME", CSTR2RVAL(G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_MOUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_UNMOUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_EJECT", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_UNIX_DEVICE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_UNIX_DEVICE_FILE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_HAL_UDI", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_POLL", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_START", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_START_DEGRADED", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_CAN_STOP", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP)); rb_define_const(RG_TARGET_NAMESPACE, "MOUNTABLE_START_STOP_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE)); rb_define_const(RG_TARGET_NAMESPACE, "TIME_MODIFIED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_MODIFIED)); rb_define_const(RG_TARGET_NAMESPACE, "TIME_MODIFIED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC)); rb_define_const(RG_TARGET_NAMESPACE, "TIME_ACCESS", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_ACCESS)); rb_define_const(RG_TARGET_NAMESPACE, "TIME_ACCESS_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_ACCESS_USEC)); rb_define_const(RG_TARGET_NAMESPACE, "TIME_CHANGED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CHANGED)); rb_define_const(RG_TARGET_NAMESPACE, "TIME_CHANGED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CHANGED_USEC)); rb_define_const(RG_TARGET_NAMESPACE, "TIME_CREATED", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CREATED)); rb_define_const(RG_TARGET_NAMESPACE, "TIME_CREATED_USEC", CSTR2RVAL(G_FILE_ATTRIBUTE_TIME_CREATED_USEC)); rb_define_const(RG_TARGET_NAMESPACE, "UNIX_DEVICE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_DEVICE)); rb_define_const(RG_TARGET_NAMESPACE, "UNIX_INODE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_INODE)); rb_define_const(RG_TARGET_NAMESPACE, "UNIX_MODE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_MODE)); rb_define_const(RG_TARGET_NAMESPACE, "UNIX_NLINK", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_NLINK)); rb_define_const(RG_TARGET_NAMESPACE, "UNIX_UID", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_UID)); rb_define_const(RG_TARGET_NAMESPACE, "UNIX_GID", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_GID)); rb_define_const(RG_TARGET_NAMESPACE, "UNIX_RDEV", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_RDEV)); rb_define_const(RG_TARGET_NAMESPACE, "UNIX_BLOCK_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE)); rb_define_const(RG_TARGET_NAMESPACE, "UNIX_BLOCKS", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_BLOCKS)); rb_define_const(RG_TARGET_NAMESPACE, "UNIX_IS_MOUNTPOINT", CSTR2RVAL(G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT)); rb_define_const(RG_TARGET_NAMESPACE, "DOS_IS_ARCHIVE", CSTR2RVAL(G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE)); rb_define_const(RG_TARGET_NAMESPACE, "DOS_IS_SYSTEM", CSTR2RVAL(G_FILE_ATTRIBUTE_DOS_IS_SYSTEM)); rb_define_const(RG_TARGET_NAMESPACE, "OWNER_USER", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_USER)); rb_define_const(RG_TARGET_NAMESPACE, "OWNER_USER_REAL", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_USER_REAL)); rb_define_const(RG_TARGET_NAMESPACE, "OWNER_GROUP", CSTR2RVAL(G_FILE_ATTRIBUTE_OWNER_GROUP)); rb_define_const(RG_TARGET_NAMESPACE, "THUMBNAIL_PATH", CSTR2RVAL(G_FILE_ATTRIBUTE_THUMBNAIL_PATH)); rb_define_const(RG_TARGET_NAMESPACE, "THUMBNAILING_FAILED", CSTR2RVAL(G_FILE_ATTRIBUTE_THUMBNAILING_FAILED)); rb_define_const(RG_TARGET_NAMESPACE, "PREVIEW_ICON", CSTR2RVAL(G_FILE_ATTRIBUTE_PREVIEW_ICON)); rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_SIZE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_SIZE)); rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_FREE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_FREE)); rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_TYPE", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_TYPE)); rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_READONLY", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_READONLY)); rb_define_const(RG_TARGET_NAMESPACE, "FILESYSTEM_USE_PREVIEW", CSTR2RVAL(G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW)); rb_define_const(RG_TARGET_NAMESPACE, "GVFS_BACKEND", CSTR2RVAL(G_FILE_ATTRIBUTE_GVFS_BACKEND)); rb_define_const(RG_TARGET_NAMESPACE, "SELINUX_CONTEXT", CSTR2RVAL(G_FILE_ATTRIBUTE_SELINUX_CONTEXT)); rb_define_const(RG_TARGET_NAMESPACE, "TRASH_ITEM_COUNT", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT)); rb_define_const(RG_TARGET_NAMESPACE, "TRASH_DELETION_DATE", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_DELETION_DATE)); rb_define_const(RG_TARGET_NAMESPACE, "TRASH_ORIG_PATH", CSTR2RVAL(G_FILE_ATTRIBUTE_TRASH_ORIG_PATH)); G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_ATTRIBUTE_TYPE, "G_FILE_ATTRIBUTE_"); G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_STATUS, "Status", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_ATTRIBUTE_STATUS, "G_FILE_ATTRIBUTE_"); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioinitable.c�������������������������������������������������0000664�0001750�0001750�00000014507�11740310343�020067� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mInitable #define _SELF(value) RVAL2GINITABLE(value) static VALUE rg_init(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; rb_scan_args(argc, argv, "01", &cancellable); if (!g_initable_init(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } struct rbgio_ginitable_new_data { GObjectClass *gclass; GCancellable *cancellable; VALUE rbparameters; guint index; guint n_parameters; GParameter *parameters; GError *error; }; static VALUE rbgio_ginitiable_new_parameters_initialize(VALUE key_value, struct rbgio_ginitable_new_data *data) { VALUE key, value; GParamSpec *spec; if (data->index >= data->n_parameters) rb_raise(rb_eArgError, "too many parameters (%d >= %d)", data->index, data->n_parameters); key = rb_ary_entry(key_value, 0); value = rb_ary_entry(key_value, 1); data->parameters[data->index].name = SYMBOL_P(key) ? rb_id2name(SYM2ID(key)) : StringValuePtr(key); spec = g_object_class_find_property(data->gclass, data->parameters[data->index].name); if (spec == NULL) rb_raise(rb_eArgError, "%s: no such property", data->parameters[data->index].name); g_value_init(&(data->parameters[data->index].value), G_PARAM_SPEC_VALUE_TYPE(spec)); rbgobj_rvalue_to_gvalue(value, &(data->parameters[data->index].value)); data->index++; return Qnil; } static VALUE rbgio_ginitable_new_body(struct rbgio_ginitable_new_data *data) { rb_iterate(rb_each, data->rbparameters, rbgio_ginitiable_new_parameters_initialize, (VALUE)data); return (VALUE)g_initable_newv(G_TYPE_FROM_CLASS(data->gclass), data->n_parameters, data->parameters, data->cancellable, &data->error); } static VALUE rbgio_ginitable_new_ensure(struct rbgio_ginitable_new_data *data) { guint i; g_type_class_unref(data->gclass); for (i = 0; i < data->n_parameters; i++) if (G_IS_VALUE(&data->parameters[i].value)) g_value_unset(&data->parameters[i].value); g_free(data->parameters); return Qnil; } GObject * rbgio_ginitable_new(GType type, VALUE parameters, VALUE cancellable) { static ID s_id_length; GError *error = NULL; GObject *object; struct rbgio_ginitable_new_data data; if (s_id_length == 0) s_id_length = rb_intern("length"); if (!g_type_is_a(type, G_TYPE_OBJECT)) rb_raise(rb_eArgError, "%s is not a descendant of GObject", g_type_name(type)); if (NIL_P(parameters)) { object = g_initable_newv(type, 0, NULL, RVAL2GCANCELLABLE(cancellable), &error); if (object == NULL) rbgio_raise_error(error); return object; } else { parameters = rb_convert_type(parameters, T_HASH, "Hash", "to_hash"); } data.gclass = G_OBJECT_CLASS(g_type_class_ref(type)); data.cancellable = RVAL2GCANCELLABLE(cancellable); data.rbparameters = parameters; data.index = 0; data.n_parameters = RVAL2GUINT(rb_funcall(parameters, s_id_length, 0)); data.parameters = g_new(GParameter, data.n_parameters); data.error = NULL; object = (GObject *)rb_ensure(rbgio_ginitable_new_body, (VALUE)&data, rbgio_ginitable_new_ensure, (VALUE)&data); if (object == NULL) rbgio_raise_error(data.error); return object; } /* NOTE: We don't implement g_initable_new. */ /* NOTE: We don't implement g_initable_new_valist. */ static VALUE rg_s_new(int argc, VALUE *argv, VALUE self) { const RGObjClassInfo* info; VALUE cancellable, parameters; GObject *object; VALUE result; rb_scan_args(argc, argv, "02", &cancellable, ¶meters); info = CLASS2CINFO(self); if (info->klass != self) rb_raise(rb_eTypeError, "%s: class not registered with GLib", rb_class2name(self)); object = rbgio_ginitable_new(info->gtype, parameters, cancellable); result = GOBJ2RVAL(object); g_object_unref(object); return result; } void Init_ginitable(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_INITABLE, "Initable", mGio); RG_DEF_SMETHOD(new, -1); RG_DEF_METHOD(init, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiomountoperation.c�������������������������������������������0000644�0001750�0001750�00000003266�11701304107�021357� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cMountOperation #define _SELF(value) RVAL2GMOUNTOPERATION(value) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_mount_operation_new()); return Qnil; } static VALUE rg_reply(VALUE self, VALUE value) { g_mount_operation_reply(_SELF(self), RVAL2GMOUNTOPERATIONRESULT(value)); return self; } void Init_gmountoperation(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MOUNT_OPERATION, "MountOperation", mGio); G_DEF_CLASS(G_TYPE_MOUNT_OPERATION_RESULT, "Result", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_MOUNT_OPERATION_RESULT, "G_MOUNT_OPERATION_"); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(reply, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofilenamecompleter.c����������������������������������������0000664�0001750�0001750�00000004563�11740310343�021774� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFilenameCompleter #define _SELF(value) RVAL2GFILENAMECOMPLETER(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE dirs_only; GFilenameCompleter *completer; rb_scan_args(argc, argv, "01", &dirs_only); completer = g_filename_completer_new(); g_filename_completer_set_dirs_only(completer, RVAL2CBOOL(dirs_only)); G_INITIALIZE(self, completer); return Qnil; } static VALUE rg_get_completion_suffix(VALUE self, VALUE initial_text) { return CSTR2RVAL_FREE(g_filename_completer_get_completion_suffix(_SELF(self), RVAL2CSTR(initial_text))); } static VALUE rg_get_completions(VALUE self, VALUE initial_text) { return STRV2RVAL_FREE(g_filename_completer_get_completions(_SELF(self), RVAL2CSTR(initial_text))); } static VALUE rg_set_dirs_only(VALUE self, VALUE dirs_only) { g_filename_completer_set_dirs_only(_SELF(self), RVAL2CBOOL(dirs_only)); return self; } void Init_gfilenamecompleter(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILENAME_COMPLETER, "FilenameCompleter", mGio); 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); } ���������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixfdlist.c�����������������������������������������������0000644�0001750�0001750�00000005645�11701304107�020470� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixfdlist.h> #define RG_TARGET_NAMESPACE cUnixFDList #define _SELF(value) RVAL2GUNIXFDLIST(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE rbfds; long n; gint *fds; GUnixFDList *list; rb_scan_args(argc, argv, "0*", &rbfds); fds = RVAL2FDS(rbfds, n); if (n == 0) { G_INITIALIZE(self, g_unix_fd_list_new()); return Qnil; } list = g_unix_fd_list_new_from_array(fds, n); g_free(fds); G_INITIALIZE(self, list); return Qnil; } static VALUE rg_length(VALUE self) { return GINT2RVAL(g_unix_fd_list_get_length(_SELF(self))); } static VALUE rg_get(VALUE self, VALUE index) { GError *error = NULL; gint fd; fd = g_unix_fd_list_get(_SELF(self), RVAL2GINT(index), &error); if (fd == -1) rbgio_raise_error(error); /* TODO: This fd must be closed properly. How do we deal with that? */ return FD2RVAL(fd); } static VALUE rg_peek_fds(VALUE self) { return GFDS2ARY(g_unix_fd_list_peek_fds(_SELF(self), NULL)); } static VALUE rg_steal_fds(VALUE self) { return GFDS2ARY_FREE(g_unix_fd_list_steal_fds(_SELF(self), NULL)); } static VALUE rg_append(VALUE self, VALUE fd) { GError *error = NULL; int index; index = g_unix_fd_list_append(_SELF(self), RVAL2FD(fd), &error); if (index == -1) rbgio_raise_error(error); return self; } #endif void Init_gunixfdlist(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_FD_LIST, "UnixFDList", mGio); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(length, 0); RG_DEF_METHOD(get, 1); RG_DEF_ALIAS("[]", "get"); RG_DEF_METHOD(peek_fds, 0); RG_DEF_METHOD(steal_fds, 0); RG_DEF_METHOD(append, 1); RG_DEF_ALIAS("<<", "append"); #endif } �������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiothemedicon.c�����������������������������������������������0000644�0001750�0001750�00000004730�11701304107�020410� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mThemedIcon #define _SELF(value) RVAL2GTHEMEDICON(value) /* TODO: Is this unnecessarily complicated? */ static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE iconnames, with_default_fallbacks; GIcon *icon; rb_scan_args(argc, argv, "11", &iconnames, &with_default_fallbacks); if (TYPE(iconnames) != T_ARRAY) { const char *iconname = RVAL2CSTR(iconnames); icon = RVAL2CBOOL(with_default_fallbacks) ? g_themed_icon_new_with_default_fallbacks(iconname) : g_themed_icon_new(iconname); G_INITIALIZE(self, icon); return Qnil; } if (argc > 1) rb_raise(rb_eArgError, "only one argument allowed when first argument is an Array"); icon = g_themed_icon_new_from_names(RVAL2STRV_DUP(iconnames), -1); G_INITIALIZE(self, icon); return Qnil; } static VALUE rg_prepend_name(VALUE self, VALUE iconname) { g_themed_icon_prepend_name(_SELF(self), RVAL2CSTR(iconname)); return self; } static VALUE rg_append_name(VALUE self, VALUE iconname) { g_themed_icon_append_name(_SELF(self), RVAL2CSTR(iconname)); return self; } void Init_gthemedicon(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_THEMED_ICON, "ThemedIcon", mGio); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(prepend_name, 1); RG_DEF_METHOD(append_name, 1); } ����������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioasyncinitable.c��������������������������������������������0000644�0001750�0001750�00000020251�11701304107�021112� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mAsyncInitable #define _SELF(value) RVAL2GASYNCINITABLE(value) static VALUE rg_init_async(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_async_initable_init_async(_SELF(self), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_init_finish(VALUE self, VALUE result) { GError *error = NULL; if (!g_async_initable_init_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error)) rbgio_raise_error(error); return self; } /* NOTE: We don't implement g_async_initable_new_async. */ /* NOTE: We don't implement g_async_initable_new_valist_async. */ struct rbgio_gasyncinitable_new_async_data { GObjectClass *gclass; int io_priority; GCancellable *cancellable; VALUE block; VALUE rbparameters; guint index; guint n_parameters; GParameter *parameters; }; static VALUE rbgio_gasyncinitiable_new_async_parameters_initialize(VALUE key_value, struct rbgio_gasyncinitable_new_async_data *data) { VALUE key, value; GParamSpec *spec; if (data->index >= data->n_parameters) rb_raise(rb_eArgError, "too many parameters (%d >= %d)", data->index, data->n_parameters); key = rb_ary_entry(key_value, 0); value = rb_ary_entry(key_value, 1); data->parameters[data->index].name = SYMBOL_P(key) ? rb_id2name(SYM2ID(key)) : StringValuePtr(key); spec = g_object_class_find_property(data->gclass, data->parameters[data->index].name); if (spec == NULL) rb_raise(rb_eArgError, "%s: no such property", data->parameters[data->index].name); g_value_init(&(data->parameters[data->index].value), G_PARAM_SPEC_VALUE_TYPE(spec)); rbgobj_rvalue_to_gvalue(value, &(data->parameters[data->index].value)); data->index++; return Qnil; } static VALUE rbgio_gasyncinitable_new_async_body(struct rbgio_gasyncinitable_new_async_data *data) { rb_iterate(rb_each, data->rbparameters, rbgio_gasyncinitiable_new_async_parameters_initialize, (VALUE)data); SAVE_BLOCK(data->block); g_async_initable_newv_async(G_TYPE_FROM_CLASS(data->gclass), data->n_parameters, data->parameters, data->io_priority, data->cancellable, rbgio_async_ready_callback, (gpointer)data->block); return Qnil; } static VALUE rbgio_gasyncinitable_new_async_ensure(struct rbgio_gasyncinitable_new_async_data *data) { guint i; g_type_class_unref(data->gclass); for (i = 0; i < data->n_parameters; i++) if (G_IS_VALUE(&data->parameters[i].value)) g_value_unset(&data->parameters[i].value); g_free(data->parameters); return Qnil; } void rbgio_gasyncinitable_new_async(GType type, VALUE parameters, VALUE io_priority, VALUE cancellable, VALUE block) { static ID s_id_length; struct rbgio_gasyncinitable_new_async_data data; if (s_id_length == 0) s_id_length = rb_intern("length"); if (!g_type_is_a(type, G_TYPE_OBJECT)) rb_raise(rb_eArgError, "%s is not a descendant of GObject", g_type_name(type)); if (NIL_P(parameters)) { SAVE_BLOCK(block); g_async_initable_newv_async(type, 0, NULL, RVAL2IOPRIORITYDEFAULT(io_priority), RVAL2GCANCELLABLE(cancellable), rbgio_async_ready_callback, (gpointer)block); return; } else { parameters = rb_convert_type(parameters, T_HASH, "Hash", "to_hash"); } data.gclass = G_OBJECT_CLASS(g_type_class_ref(type)); data.io_priority = RVAL2IOPRIORITYDEFAULT(io_priority); data.cancellable = RVAL2GCANCELLABLE(cancellable); data.block = block; data.rbparameters = parameters; data.index = 0; data.n_parameters = RVAL2GUINT(rb_funcall(parameters, s_id_length, 0)); data.parameters = g_new(GParameter, data.n_parameters); rb_ensure(rbgio_gasyncinitable_new_async_body, (VALUE)&data, rbgio_gasyncinitable_new_async_ensure, (VALUE)&data); return; } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { const RGObjClassInfo* info; VALUE io_priority, cancellable, parameters, block; rb_scan_args(argc, argv, "03&", &io_priority, &cancellable, ¶meters, &block); info = CLASS2CINFO(self); if (info->klass != self) rb_raise(rb_eTypeError, "%s: class not registered with GLib", rb_class2name(self)); rbgio_gasyncinitable_new_async(info->gtype, parameters, io_priority, cancellable, block); return self; } static VALUE rg_initialize_finish(VALUE self, VALUE result) { GError *error = NULL; GObject *object; VALUE rbobject; object = g_async_initable_new_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (object == NULL) rbgio_raise_error(error); rbobject = GOBJ2RVAL(object); g_object_unref(object); return rbobject; } void Init_gasyncinitable(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_ASYNC_INITABLE, "AsyncInitable", mGio); RG_DEF_METHOD(init_async, -1); RG_DEF_METHOD(init_finish, 1); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(initialize_finish, 1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofileenumerator.c�������������������������������������������0000664�0001750�0001750�00000012203�11740310343�021310� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFileEnumerator #define _SELF(value) RVAL2GFILEENUMERATOR(value) static VALUE rg_next_file(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; GFileInfo *info; rb_scan_args(argc, argv, "01", &cancellable); info = g_file_enumerator_next_file(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_close(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; rb_scan_args(argc, argv, "01", &cancellable); if (!g_file_enumerator_close(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_next_files_async(int argc, VALUE *argv, VALUE self) { VALUE rbnum_files, rbio_priority, rbcancellable, block; int num_files; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "12&", &rbnum_files, &rbio_priority, &rbcancellable, &block); num_files = NUM2INT(rbnum_files); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_enumerator_next_files_async(_SELF(self), num_files, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_next_files_finish(VALUE self, VALUE result) { GError *error = NULL; GList *files = g_file_enumerator_next_files_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (error != NULL) rbgio_raise_error(error); return GLIST2ARY_FREE(files); } static VALUE rg_close_async(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_enumerator_close_async(_SELF(self), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_close_finish(VALUE self, VALUE result) { GError *error = NULL; if (!g_file_enumerator_close_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error)) rbgio_raise_error(error); return Qnil; } static VALUE rg_closed_p(VALUE self) { return CBOOL2RVAL(g_file_enumerator_is_closed(_SELF(self))); } static VALUE rg_has_pending_p(VALUE self) { return CBOOL2RVAL(g_file_enumerator_has_pending(_SELF(self))); } static VALUE rg_set_pending(VALUE self, VALUE pending) { g_file_enumerator_set_pending(_SELF(self), RVAL2CBOOL(pending)); return self; } static VALUE rg_container(VALUE self) { return GOBJ2RVAL(g_file_enumerator_get_container(_SELF(self))); } void Init_gfileenumerator(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ENUMERATOR, "FileEnumerator", mGio); RG_DEF_METHOD(next_file, -1); RG_DEF_METHOD(close, -1); RG_DEF_METHOD(next_files_async, -1); RG_DEF_METHOD(next_files_finish, 1); RG_DEF_METHOD(close_async, -1); RG_DEF_METHOD(close_finish, 1); RG_DEF_METHOD_P(closed, 0); RG_DEF_METHOD_P(has_pending, 0); RG_DEF_METHOD(set_pending, 1); RG_DEF_METHOD(container, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioicon.c�����������������������������������������������������0000644�0001750�0001750�00000003700�11701304107�017215� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mIcon #define _SELF(value) RVAL2GICON(value) static VALUE rg_s_new_for_string(G_GNUC_UNUSED VALUE self, VALUE string) { GError *error = NULL; GIcon *icon; icon = g_icon_new_for_string(RVAL2CSTR(string), &error); if (icon == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(icon); } static VALUE rg_hash(VALUE self) { return GUINT2RVAL(g_icon_hash(_SELF(self))); } static VALUE rg_operator_icon_equal(VALUE self, VALUE other) { return CBOOL2RVAL(g_icon_equal(_SELF(self), _SELF(other))); } static VALUE rg_to_string(VALUE self) { return CSTR2RVAL_FREE(g_icon_to_string(_SELF(self))); } void Init_gicon(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_ICON, "Icon", mGio); RG_DEF_SMETHOD(new_for_string, 1); RG_DEF_METHOD(hash, 0); RG_DEF_METHOD_OPERATOR("==", icon_equal, 1); RG_DEF_METHOD(to_string, 0); RG_DEF_ALIAS("to_s", "to_string"); } ����������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosocketaddressenumerator.c����������������������������������0000644�0001750�0001750�00000005415�11701304107�023232� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cSocketAddressEnumerator #define _SELF(value) RVAL2GSOCKETADDRESSENUMERATOR(value) static VALUE rg_next(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; GSocketAddress *address; rb_scan_args(argc, argv, "01", &cancellable); address = g_socket_address_enumerator_next(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return GOBJ2RVAL(address); } static VALUE rg_next_async(int argc, VALUE *argv, VALUE self) { VALUE rbcancellable, block; GCancellable *cancellable; rb_scan_args(argc, argv, "01&", &rbcancellable, &block); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_socket_address_enumerator_next_async(_SELF(self), cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_next_finish(VALUE self, VALUE result) { GError *error = NULL; GSocketAddress *address; address = g_socket_address_enumerator_next_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (address == NULL) rbgio_raise_error(error); return GOBJ2RVAL(address); } void Init_gsocketaddressenumerator(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_ADDRESS_ENUMERATOR, "SocketAddressEnumerator", mGio); RG_DEF_METHOD(next, -1); RG_DEF_METHOD(next_async, -1); RG_DEF_METHOD(next_finish, 1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixmounts.c�����������������������������������������������0000664�0001750�0001750�00000003267�11740310343�020532� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixmounts.h> #define RG_TARGET_NAMESPACE mUnixMounts static VALUE rg_s_get(G_GNUC_UNUSED VALUE self) { guint64 time_read; GList *mounts; mounts = g_unix_mounts_get(&time_read); return rb_assoc_new(GLIST2ARY_STR_FREE(mounts), GUINT642RVAL(time_read)); } static VALUE rg_s_changed_since_p(G_GNUC_UNUSED VALUE self, VALUE time_read) { return CBOOL2RVAL(g_unix_mounts_changed_since(RVAL2GUINT64(time_read))); } #endif void Init_gunixmounts(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "UnixMounts"); RG_DEF_SMETHOD(get, 0); RG_DEF_SMETHOD_P(changed_since, 1); #endif } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiocancellable.c����������������������������������������������0000644�0001750�0001750�00000010200�11701304107�020503� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cCancellable #define _SELF(value) RVAL2GCANCELLABLE(value) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_cancellable_new()); return Qnil; } static VALUE rg_cancelled_p(VALUE self) { return CBOOL2RVAL(g_cancellable_is_cancelled(_SELF(self))); } static VALUE rg_raise_error_if_cancelled(VALUE self) { GError *error = NULL; if (g_cancellable_set_error_if_cancelled(_SELF(self), &error)) rbgio_raise_error(error); return self; } static VALUE rg_fd(VALUE self) { return FD2RVAL(g_cancellable_get_fd(_SELF(self))); } static VALUE rg_make_pollfd(VALUE self) { GCancellable *cancellable = _SELF(self); GPollFD *gfd = g_new(GPollFD, 1); g_cancellable_make_pollfd(cancellable, gfd); return GPOLLFD2RVAL(gfd); } G_GNUC_NORETURN static VALUE rg_release_fd(VALUE self) { /* TODO: How do we implement this? Maybe not at all? */ self = self; rb_raise(rb_eNotImpError, "release_fd has not been implemented yet"); #if 0 g_cancellable_release_fd(_SELF(self)); return self; #endif } static VALUE rg_s_current(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(g_cancellable_get_current()); } static VALUE rg_pop_current(VALUE self) { g_cancellable_pop_current(_SELF(self)); return self; } static VALUE rg_push_current(VALUE self) { g_cancellable_push_current(_SELF(self)); return self; } static VALUE rg_reset(VALUE self) { g_cancellable_reset(_SELF(self)); return self; } static VALUE cancellable_connect_callback_call(VALUE block) { static ID s_id_call; if (s_id_call == 0) s_id_call = rb_intern("call"); rb_funcall(block, s_id_call, 0); return Qnil; } static void cancellable_connect_callback(gpointer block) { G_PROTECT_CALLBACK(cancellable_connect_callback_call, block); } static VALUE rg_connect(VALUE self) { VALUE block; block = rb_block_proc(); G_RELATIVE(self, block); return GULONG2RVAL(g_cancellable_connect(_SELF(self), G_CALLBACK(cancellable_connect_callback), (gpointer)block, NULL)); } static VALUE rg_disconnect(VALUE self, VALUE handler_id) { g_cancellable_disconnect(_SELF(self), RVAL2GULONG(handler_id)); return self; } static VALUE rg_cancel(VALUE self) { g_cancellable_cancel(_SELF(self)); return self; } void Init_gcancellable(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CANCELLABLE, "Cancellable", mGio); RG_DEF_SMETHOD(current, 0); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD_P(cancelled, 0); RG_DEF_METHOD(raise_error_if_cancelled, 0); RG_DEF_METHOD(fd, 0); RG_DEF_METHOD(make_pollfd, 0); RG_DEF_METHOD(release_fd, 0); RG_DEF_METHOD(pop_current, 0); RG_DEF_METHOD(push_current, 0); RG_DEF_METHOD(reset, 0); RG_DEF_METHOD(connect, 0); RG_DEF_METHOD(disconnect, 1); RG_DEF_METHOD(cancel, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiovolumemonitor.c��������������������������������������������0000644�0001750�0001750�00000004453�11701304107�021212� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cVolumeMonitor #define _SELF(value) RVAL2GVOLUMEMONITOR(value) static VALUE rg_s_get(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL_UNREF(g_volume_monitor_get()); } static VALUE rg_connected_drives(VALUE self) { return GLIST2ARY_FREE(g_volume_monitor_get_connected_drives(_SELF(self))); } static VALUE rg_volumes(VALUE self) { return GLIST2ARY_FREE(g_volume_monitor_get_volumes(_SELF(self))); } static VALUE rg_mounts(VALUE self) { return GLIST2ARY_FREE(g_volume_monitor_get_mounts(_SELF(self))); } static VALUE rg_get_mount_for_uuid(VALUE self, VALUE value) { return GOBJ2RVAL_UNREF(g_volume_monitor_get_mount_for_uuid(_SELF(self), RVAL2CSTR(value))); } static VALUE rg_get_volume_for_uuid(VALUE self, VALUE value) { return GOBJ2RVAL_UNREF(g_volume_monitor_get_volume_for_uuid(_SELF(self), RVAL2CSTR(value))); } void Init_gvolumemonitor(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_VOLUME_MONITOR, "VolumeMonitor", mGio); rb_define_const(RG_TARGET_NAMESPACE, "EXTENSION_POINT_NAME", CSTR2RVAL(G_VOLUME_MONITOR_EXTENSION_POINT_NAME)); RG_DEF_SMETHOD(get, 0); RG_DEF_METHOD(connected_drives, 0); RG_DEF_METHOD(volumes, 0); RG_DEF_METHOD(mounts, 0); RG_DEF_METHOD(get_mount_for_uuid, 0); RG_DEF_METHOD(get_volume_for_uuid, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixfdmessage.c��������������������������������������������0000644�0001750�0001750�00000004210�11701304107�021124� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixfdmessage.h> #define RG_TARGET_NAMESPACE cUnixFDMessage #define _SELF(value) RVAL2GUNIXFDMESSAGE(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE fd_list; GSocketControlMessage *message; rb_scan_args(argc, argv, "01", &fd_list); message = NIL_P(fd_list) ? g_unix_fd_message_new() : g_unix_fd_message_new_with_fd_list(RVAL2GUNIXFDLIST(fd_list)); G_INITIALIZE(self, message); return Qnil; } static VALUE rg_append_fd(VALUE self, VALUE fd) { GError *error = NULL; if (!g_unix_fd_message_append_fd(_SELF(self), RVAL2FD(fd), &error)) rbgio_raise_error(error); return self; } static VALUE rg_steal_fds(VALUE self) { return GFDS2ARY_FREE(g_unix_fd_message_steal_fds(_SELF(self), NULL)); } #endif void Init_gunixfdmessage(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_FD_MESSAGE, "UnixFDMessage", mGio); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(append_fd, 1); RG_DEF_ALIAS("<<", "append_fd"); RG_DEF_METHOD(steal_fds, 0); #endif } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioinputstream.c����������������������������������������������0000644�0001750�0001750�00000024117�11701304107�020645� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cInputStream #define _SELF(value) RVAL2GINPUTSTREAM(value) static VALUE s_cReadAsyncResult; static VALUE rg_read(int argc, VALUE *argv, VALUE self) { VALUE rbcount, cancellable, result; gsize count; GError *error = NULL; gssize bytes_read; rb_scan_args(argc, argv, "11", &rbcount, &cancellable); count = RVAL2GSIZE(rbcount); result = rb_str_new(NULL, count); bytes_read = g_input_stream_read(_SELF(self), RSTRING_PTR(result), count, RVAL2GCANCELLABLE(cancellable), &error); if (bytes_read == -1) rbgio_raise_error(error); rb_str_set_len(result, bytes_read); rb_str_resize(result, bytes_read); OBJ_TAINT(result); return result; } static VALUE rg_read_all(int argc, VALUE *argv, VALUE self) { VALUE rbcount, cancellable, result; gsize count; GError *error = NULL; gsize bytes_read; rb_scan_args(argc, argv, "11", &rbcount, &cancellable); count = RVAL2GSIZE(rbcount); result = rb_str_new(NULL, count); if (!g_input_stream_read_all(_SELF(self), RSTRING_PTR(result), count, &bytes_read, RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); rb_str_set_len(result, bytes_read); rb_str_resize(result, bytes_read); OBJ_TAINT(result); return result; } static VALUE rg_skip(int argc, VALUE *argv, VALUE self) { VALUE count, cancellable; GError *error = NULL; gssize bytes_skipped; rb_scan_args(argc, argv, "11", &count, &cancellable); bytes_skipped = g_input_stream_skip(_SELF(self), RVAL2GSIZE(count), RVAL2GCANCELLABLE(cancellable), &error); if (bytes_skipped == -1) rbgio_raise_error(error); return GSSIZE2RVAL(bytes_skipped); } static VALUE rg_close(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; rb_scan_args(argc, argv, "01", &cancellable); if (!g_input_stream_close(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } struct read_async_result { VALUE string; GAsyncResult *result; }; static void read_async_result_mark(struct read_async_result *result) { rb_gc_mark(result->string); } struct read_async_callback_data { GAsyncResult *result; gpointer user_data; }; static VALUE read_async_callback_call(VALUE data) { static ID s_id_call; struct read_async_callback_data *real; VALUE ary; struct read_async_result *result; if (s_id_call == 0) s_id_call = rb_intern("call"); real = (struct read_async_callback_data *)data; ary = (VALUE)real->user_data; G_CHILD_REMOVE(mGLib, ary); if (NIL_P(RARRAY_PTR(ary)[1])) return Qnil; result = g_new(struct read_async_result, 1); result->string = RARRAY_PTR(ary)[0]; result->result = real->result; rb_funcall(RARRAY_PTR(ary)[1], s_id_call, 1, Data_Wrap_Struct(s_cReadAsyncResult, read_async_result_mark, g_free, result)); return Qnil; } static void read_async_callback(G_GNUC_UNUSED GObject *source, GAsyncResult *result, gpointer user_data) { struct read_async_callback_data real = { result, user_data }; G_PROTECT_CALLBACK(read_async_callback_call, &real); } static VALUE rg_read_async(int argc, VALUE *argv, VALUE self) { VALUE rbcount, rbio_priority, rbcancellable, block, data; gsize count; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "12&", &rbcount, &rbio_priority, &rbcancellable, &block); count = RVAL2GSIZE(rbcount); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); data = rb_assoc_new(rb_str_new(NULL, count), block); G_CHILD_ADD(mGLib, data); g_input_stream_read_async(_SELF(self), RSTRING_PTR(RARRAY_PTR(data)[0]), count, io_priority, cancellable, read_async_callback, (gpointer)data); return self; } static VALUE rg_read_finish(VALUE self, VALUE rbresult) { struct read_async_result *result; GError *error = NULL; gssize bytes_read; Data_Get_Struct(rbresult, struct read_async_result, result); bytes_read = g_input_stream_read_finish(_SELF(self), result->result, &error); if (bytes_read == -1) rbgio_raise_error(error); rb_str_set_len(result->string, bytes_read); rb_str_resize(result->string, bytes_read); OBJ_TAINT(result->string); return result->string; } static VALUE rg_skip_async(int argc, VALUE *argv, VALUE self) { VALUE rbcount, rbio_priority, rbcancellable, block; gsize count; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "12&", &rbcount, &rbio_priority, &rbcancellable, &block); count = RVAL2GSIZE(rbcount); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_input_stream_skip_async(_SELF(self), count, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_skip_finish(VALUE self, VALUE result) { GError *error = NULL; gssize skipped_bytes; skipped_bytes = g_input_stream_skip_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (skipped_bytes == -1) rbgio_raise_error(error); return GSSIZE2RVAL(skipped_bytes); } static VALUE rg_close_async(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_input_stream_close_async(_SELF(self), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_close_finish(VALUE self, VALUE result) { GError *error = NULL; if (!g_input_stream_skip_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error)) rbgio_raise_error(error); return self; } static VALUE rg_closed_p(VALUE self) { return CBOOL2RVAL(g_input_stream_is_closed(_SELF(self))); } static VALUE rg_has_pending_p(VALUE self) { return CBOOL2RVAL(g_input_stream_has_pending(_SELF(self))); } static VALUE rg_set_pending(VALUE self) { GError *error = NULL; if (!g_input_stream_set_pending(_SELF(self), &error)) rbgio_raise_error(error); return self; } static VALUE rg_clear_pending(VALUE self) { g_input_stream_clear_pending(_SELF(self)); return self; } void Init_ginputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_INPUT_STREAM, "InputStream", mGio); s_cReadAsyncResult = rb_define_class_under(RG_TARGET_NAMESPACE, "ReadAsyncResult", rb_cObject); RG_DEF_METHOD(read, -1); RG_DEF_METHOD(read_all, -1); RG_DEF_METHOD(skip, -1); RG_DEF_METHOD(close, -1); RG_DEF_METHOD(read_async, -1); RG_DEF_METHOD(read_finish, 1); RG_DEF_METHOD(skip_async, -1); RG_DEF_METHOD(skip_finish, 1); RG_DEF_METHOD(close_async, -1); RG_DEF_METHOD(close_finish, 1); RG_DEF_METHOD_P(closed, 0); RG_DEF_METHOD_P(has_pending, 0); RG_DEF_METHOD(set_pending, 0); RG_DEF_METHOD(clear_pending, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosocketclient.c���������������������������������������������0000644�0001750�0001750�00000016526�12002536277�021000� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cSocketClient #define _SELF(value) RVAL2GSOCKETCLIENT(value) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_socket_client_new()); return Qnil; } static VALUE rg_connect(int argc, VALUE *argv, VALUE self) { VALUE connectable, cancellable; GError *error = NULL; GSocketConnection *connection; rb_scan_args(argc, argv, "11", &connectable, &cancellable); connection = g_socket_client_connect(_SELF(self), RVAL2GSOCKETCONNECTABLE(connectable), RVAL2GCANCELLABLE(cancellable), &error); if (connection == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(connection); } static VALUE rg_connect_async(int argc, VALUE *argv, VALUE self) { VALUE rbconnectable, rbcancellable, block; GCancellable *cancellable; GSocketConnectable *connectable; rb_scan_args(argc, argv, "11&", &rbconnectable, &rbcancellable, &block); connectable = RVAL2GSOCKETCONNECTABLE(rbconnectable); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_socket_client_connect_async(_SELF(self), connectable, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } typedef GSocketConnection *(*ConnectionFinishMethod)(GSocketClient *, GAsyncResult *, GError **); static VALUE connection_finish_method(ConnectionFinishMethod method, VALUE self, VALUE result) { GError *error = NULL; GSocketConnection *connection; connection = method(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (connection == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(connection); } static VALUE rg_connect_finish(VALUE self, VALUE result) { return connection_finish_method(g_socket_client_connect_finish, self, result); } static VALUE rg_connect_to_host(int argc, VALUE *argv, VALUE self) { VALUE host_and_port, default_port, cancellable; GError *error = NULL; GSocketConnection *connection; rb_scan_args(argc, argv, "21", &host_and_port, &default_port, &cancellable); connection = g_socket_client_connect_to_host(_SELF(self), RVAL2CSTR(host_and_port), RVAL2GUINT16(default_port), RVAL2GCANCELLABLE(cancellable), &error); if (connection == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(connection); } static VALUE rg_connect_to_host_async(int argc, VALUE *argv, VALUE self) { VALUE rbhost_and_port, rbdefault_port, rbcancellable, block; GCancellable *cancellable; const gchar *host_and_port; guint16 default_port; rb_scan_args(argc, argv, "21&", &rbhost_and_port, &rbdefault_port, &rbcancellable, &block); host_and_port = RVAL2CSTR(rbhost_and_port); default_port = RVAL2GUINT16(rbdefault_port); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_socket_client_connect_to_host_async(_SELF(self), host_and_port, default_port, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_connect_to_host_finish(VALUE self, VALUE result) { return connection_finish_method(g_socket_client_connect_to_host_finish, self, result); } static VALUE rg_connect_to_service(int argc, VALUE *argv, VALUE self) { VALUE domain, service, cancellable; GError *error = NULL; GSocketConnection *connection; rb_scan_args(argc, argv, "21", &domain, &service, &cancellable); connection = g_socket_client_connect_to_service(_SELF(self), RVAL2CSTR(domain), RVAL2CSTR(service), RVAL2GCANCELLABLE(cancellable), &error); if (connection == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(connection); } static VALUE rg_connect_to_service_async(int argc, VALUE *argv, VALUE self) { VALUE rbdomain, rbservice, rbcancellable, block; GCancellable *cancellable; const gchar *domain; const gchar *service; rb_scan_args(argc, argv, "21&", &domain, &service, &rbcancellable, &block); domain = RVAL2CSTR(rbdomain); service = RVAL2CSTR(rbservice); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_socket_client_connect_to_service_async(_SELF(self), domain, service, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_connect_to_service_finish(VALUE self, VALUE result) { return connection_finish_method(g_socket_client_connect_to_service_finish, self, result); } void Init_gsocketclient(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_CLIENT, "SocketClient", mGio); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(connect, -1); RG_DEF_METHOD(connect_async, -1); RG_DEF_METHOD(connect_finish, 1); RG_DEF_METHOD(connect_to_host, -1); RG_DEF_METHOD(connect_to_host_async, -1); RG_DEF_METHOD(connect_to_host_finish, 1); RG_DEF_METHOD(connect_to_service, -1); RG_DEF_METHOD(connect_to_service_async, -1); RG_DEF_METHOD(connect_to_service_finish, 1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioapplaunchcontext.c�����������������������������������������0000644�0001750�0001750�00000004604�11701304107�021651� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cAppLaunchContext #define _SELF(value) RVAL2GAPPLAUNCHCONTEXT(value) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_app_launch_context_new()); return Qnil; } typedef char *(*GetMethod)(GAppLaunchContext *, GAppInfo *, GList *); static VALUE get_value_by(GetMethod method, int argc, VALUE *argv, VALUE self) { VALUE info, rbfiles; GList *files; char *value; rb_scan_args(argc, argv, "11", &info, &rbfiles); files = GFILEARY2GLIST_ACCEPT_NIL(rbfiles); value = method(_SELF(self), RVAL2GAPPINFO(info), files); g_list_free(files); return CSTR2RVAL_FREE(value); } static VALUE rg_get_display(int argc, VALUE *argv, VALUE self) { return get_value_by(g_app_launch_context_get_display, argc, argv, self); } static VALUE rg_get_startup_notify_id(int argc, VALUE *argv, VALUE self) { return get_value_by(g_app_launch_context_get_startup_notify_id, argc, argv, self); } static VALUE rg_launch_failed(VALUE self, VALUE sn_id) { g_app_launch_context_launch_failed(_SELF(self), RVAL2CSTR(sn_id)); return self; } void Init_gapplaunchcontext(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_APP_LAUNCH_CONTEXT, "AppLaunchContext", mGio); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(get_display, -1); RG_DEF_METHOD(get_startup_notify_id, -1); RG_DEF_METHOD(launch_failed, 1); } ����������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiothreadedsocketservice.c������������������������������������0000644�0001750�0001750�00000003046�11701304107�022642� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cThreadedSocketService static VALUE rg_initialize(VALUE self, VALUE max_threads) { G_INITIALIZE(self, g_threaded_socket_service_new(RVAL2TYPE_WITH_DEFAULT(max_threads, RVAL2GINT, 10))); return Qnil; } void Init_gthreadedsocketservice(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_THREADED_SOCKET_SERVICE, "ThreadedSocketService", mGio); RG_DEF_METHOD(initialize, -1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiodesktopappinfo.c�������������������������������������������0000644�0001750�0001750�00000004732�11701304107�021321� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gdesktopappinfo.h> #define RG_TARGET_NAMESPACE cDesktopAppInfo #define _SELF(value) RVAL2GDESKTOPAPPINFO(value) static VALUE rg_s_new_from_filename(G_GNUC_UNUSED VALUE self, VALUE filename) { return GOBJ2RVAL_UNREF(g_desktop_app_info_new_from_filename(RVAL2CSTR(filename))); } static VALUE rg_s_new_from_keyfile(G_GNUC_UNUSED VALUE self, VALUE keyfile) { return GOBJ2RVAL_UNREF(g_desktop_app_info_new_from_keyfile(RVAL2GKEYFILE(keyfile))); } static VALUE rg_initialize(VALUE self, VALUE desktop_id) { G_INITIALIZE(self, g_desktop_app_info_new(RVAL2CSTR(desktop_id))); return Qnil; } static VALUE rg_filename(VALUE self) { return CSTR2RVAL(g_desktop_app_info_get_filename(_SELF(self))); } static VALUE rg_hidden_p(VALUE self) { return CBOOL2RVAL(g_desktop_app_info_get_is_hidden(_SELF(self))); } static VALUE rg_s_set_desktop_env(G_GNUC_UNUSED VALUE self, VALUE desktop_env) { g_desktop_app_info_set_desktop_env(RVAL2CSTR(desktop_env)); return self; } /* TODO: g_desktop_app_info_lookup_get_default_for_uri_scheme ()? */ #endif void Init_gdesktopappinfo(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_DESKTOP_APP_INFO, "DesktopAppInfo", mGio); RG_DEF_SMETHOD(new_from_filename, 1); RG_DEF_SMETHOD(new_from_keyfile, 1); RG_DEF_SMETHOD(set_desktop_env, 1); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(filename, 0); RG_DEF_METHOD_P(hidden, 0); #endif } ��������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiovfs.c������������������������������������������������������0000644�0001750�0001750�00000004541�11701304107�017067� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cVfs #define _SELF(value) RVAL2GVFS(value) static VALUE rg_file_for_path(VALUE self, VALUE path) { return GOBJ2RVAL_UNREF(g_vfs_get_file_for_path(_SELF(self), RVAL2CSTR(path))); } static VALUE rg_file_for_uri(VALUE self, VALUE uri) { return GOBJ2RVAL_UNREF(g_vfs_get_file_for_uri(_SELF(self), RVAL2CSTR(uri))); } static VALUE rg_parse_name(VALUE self, VALUE parse_name) { return GOBJ2RVAL_UNREF(g_vfs_parse_name(_SELF(self), RVAL2CSTR(parse_name))); } static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(g_vfs_get_default()); } static VALUE rg_s_local(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(g_vfs_get_local()); } static VALUE rg_active_p(VALUE self) { return CBOOL2RVAL(g_vfs_is_active(_SELF(self))); } static VALUE rg_supported_uri_schemes(VALUE self) { return STRV2RVAL((const gchar **)g_vfs_get_supported_uri_schemes(_SELF(self))); } void Init_gvfs(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_VFS, "Vfs", mGio); rb_define_const(RG_TARGET_NAMESPACE, "EXTENSION_POINT_NAME", CSTR2RVAL(G_VFS_EXTENSION_POINT_NAME)); RG_DEF_SMETHOD(default, 0); RG_DEF_SMETHOD(local, 0); RG_DEF_METHOD(file_for_path, 1); RG_DEF_METHOD(file_for_uri, 1); RG_DEF_METHOD(parse_name, 1); RG_DEF_METHOD_P(active, 0); RG_DEF_METHOD(supported_uri_schemes, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofile.c�����������������������������������������������������0000664�0001750�0001750�00000204412�11740310343�017213� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mFile #define _SELF(value) RVAL2GFILE(value) #define RVAL2GFILECOPYFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), RVAL2GFILECOPYFLAGS, G_FILE_COPY_NONE) #define RVAL2GFILECREATEFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GFILECREATEFLAGS, \ G_FILE_CREATE_NONE) #define RVAL2GFILEMONITORFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GFILEMONITORFLAGS, \ G_FILE_MONITOR_NONE) #define RVAL2GFILEQUERYINFOFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GFILEQUERYINFOFLAGS, \ G_FILE_QUERY_INFO_NONE) #define RVAL2FSATTRIBUTESDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), RVAL2CSTR, "fs::*") static VALUE rg_s_new_for_path(G_GNUC_UNUSED VALUE self, VALUE value) { return GOBJ2RVAL_UNREF(g_file_new_for_path(RVAL2CSTR(value))); } static VALUE rg_s_new_for_uri(G_GNUC_UNUSED VALUE self, VALUE value) { return GOBJ2RVAL_UNREF(g_file_new_for_uri(RVAL2CSTR(value))); } static VALUE rg_s_new_for_commandline_arg(G_GNUC_UNUSED VALUE self, VALUE value) { return GOBJ2RVAL_UNREF(g_file_new_for_commandline_arg(RVAL2CSTR(value))); } static VALUE rg_s_parse_name(G_GNUC_UNUSED VALUE self, VALUE value) { return GOBJ2RVAL_UNREF(g_file_parse_name(RVAL2CSTR(value))); } static VALUE rg_dup(VALUE self) { return GOBJ2RVAL_UNREF(g_file_dup(_SELF(self))); } static VALUE rg_hash(VALUE self) { return GUINT2RVAL(g_file_hash(_SELF(self))); } static VALUE rg_operator_file_equal(VALUE self, VALUE other) { return CBOOL2RVAL(g_file_equal(_SELF(self), _SELF(other))); } static VALUE rg_basename(VALUE self) { return CSTR2RVAL_FREE(g_file_get_basename(_SELF(self))); } static VALUE rg_path(VALUE self) { return CSTR2RVAL_FREE(g_file_get_path(_SELF(self))); } static VALUE rg_uri(VALUE self) { return CSTR2RVAL_FREE(g_file_get_uri(_SELF(self))); } static VALUE rg_parse_name(VALUE self) { return CSTR2RVAL_FREE(g_file_get_parse_name(_SELF(self))); } static VALUE rg_parent(VALUE self) { return GOBJ2RVAL_UNREF(g_file_get_parent(_SELF(self))); } static VALUE rg_has_parent_p(int argc, VALUE *argv, VALUE self) { VALUE parent; rb_scan_args(argc, argv, "01", &parent); return CBOOL2RVAL(g_file_has_parent(_SELF(self), RVAL2GFILE(parent))); } static VALUE rg_get_child(VALUE self, VALUE name) { return GOBJ2RVAL_UNREF(g_file_get_child(_SELF(self), RVAL2CSTR(name))); } static VALUE rg_get_child_for_display_name(VALUE self, VALUE name) { GError *error = NULL; GFile *file = g_file_get_child_for_display_name(_SELF(self), RVAL2CSTR(name), &error); if (file == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(file); } static VALUE rg_has_prefix_p(VALUE self, VALUE prefix) { return CBOOL2RVAL(g_file_has_prefix(_SELF(self), _SELF(prefix))); } static VALUE rg_get_relative_path(VALUE self, VALUE other) { return CSTR2RVAL_FREE(g_file_get_relative_path(_SELF(self), _SELF(other))); } static VALUE rg_resolve_relative_path(VALUE self, VALUE path) { return GOBJ2RVAL_UNREF(g_file_resolve_relative_path(_SELF(self), RVAL2CSTR(path))); } static VALUE rg_native_p(VALUE self) { return CBOOL2RVAL(g_file_is_native(_SELF(self))); } static VALUE rg_has_uri_scheme_p(VALUE self, VALUE scheme) { return CBOOL2RVAL(g_file_has_uri_scheme(_SELF(self), RVAL2CSTR(scheme))); } static VALUE rg_uri_scheme(VALUE self) { return CSTR2RVAL_FREE(g_file_get_uri_scheme(_SELF(self))); } struct file_input_stream_close_data { GCancellable *cancellable; GFileInputStream *stream; }; static VALUE file_input_stream_close(VALUE data) { struct file_input_stream_close_data *real; GError *error = NULL; real = (struct file_input_stream_close_data *)data; if (!g_input_stream_close(G_INPUT_STREAM(real->stream), real->cancellable, &error)) rbgio_raise_error(error); return Qnil; } static VALUE rg_read(int argc, VALUE *argv, VALUE self) { VALUE cancellable; struct file_input_stream_close_data data; GError *error = NULL; rb_scan_args(argc, argv, "01", &cancellable); data.cancellable = RVAL2GCANCELLABLE(cancellable); data.stream = g_file_read(_SELF(self), data.cancellable, &error); if (data.stream == NULL) rbgio_raise_error(error); if (!rb_block_given_p()) return GOBJ2RVAL_UNREF(data.stream); return rb_ensure(rb_yield, GOBJ2RVAL_UNREF(data.stream), file_input_stream_close, (VALUE)&data); } static VALUE rg_read_async(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_read_async(_SELF(self), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_read_finish(VALUE self, VALUE result) { GError *error = NULL; GFileInputStream *stream; stream = g_file_read_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (stream == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(stream); } typedef GFileOutputStream *(*CreateMethod)(GFile *, GFileCreateFlags, GCancellable *, GError **); struct file_output_stream_close_data { GCancellable *cancellable; GFileOutputStream *stream; }; static VALUE file_output_stream_close(VALUE data) { struct file_output_stream_close_data *real; GError *error = NULL; real = (struct file_output_stream_close_data *)data; if (!g_output_stream_close(G_OUTPUT_STREAM(real->stream), real->cancellable, &error)) rbgio_raise_error(error); return Qnil; } static VALUE create_method(CreateMethod method, int argc, VALUE *argv, VALUE self) { VALUE flags, cancellable; struct file_output_stream_close_data data; GError *error = NULL; rb_scan_args(argc, argv, "02", &flags, &cancellable); data.cancellable = RVAL2GCANCELLABLE(cancellable); data.stream = method(_SELF(self), RVAL2GFILECREATEFLAGSDEFAULT(flags), data.cancellable, &error); if (data.stream == NULL) rbgio_raise_error(error); if (!rb_block_given_p()) return GOBJ2RVAL_UNREF(data.stream); return rb_ensure(rb_yield, GOBJ2RVAL_UNREF(data.stream), file_output_stream_close, (VALUE)&data); } static VALUE rg_append_to(int argc, VALUE *argv, VALUE self) { return create_method(g_file_append_to, argc, argv, self); } static VALUE rg_create(int argc, VALUE *argv, VALUE self) { return create_method(g_file_create, argc, argv, self); } static VALUE rg_replace(int argc, VALUE *argv, VALUE self) { VALUE etag, make_backup, flags, cancellable; struct file_output_stream_close_data data; GError *error = NULL; rb_scan_args(argc, argv, "04", &etag, &make_backup, &flags, &cancellable); data.cancellable = RVAL2GCANCELLABLE(cancellable); data.stream = g_file_replace(_SELF(self), RVAL2CSTR_ACCEPT_NIL(etag), RVAL2CBOOL(make_backup), RVAL2GFILECREATEFLAGSDEFAULT(flags), data.cancellable, &error); if (data.stream == NULL) rbgio_raise_error(error); if (!rb_block_given_p()) return GOBJ2RVAL_UNREF(data.stream); return rb_ensure(rb_yield, GOBJ2RVAL_UNREF(data.stream), file_output_stream_close, (VALUE)&data); } typedef void (*CreateAsyncMethod)(GFile *, GFileCreateFlags, int, GCancellable *, GAsyncReadyCallback, gpointer); static VALUE create_async_method(CreateAsyncMethod method, int argc, VALUE *argv, VALUE self) { VALUE rbflags, rbio_priority, rbcancellable, block; GFileCreateFlags flags; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbflags, &rbio_priority, &rbcancellable, &block); flags = RVAL2GFILECREATEFLAGSDEFAULT(rbflags); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); method(_SELF(self), flags, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_append_to_async(int argc, VALUE *argv, VALUE self) { return create_async_method(g_file_append_to_async, argc, argv, self); } typedef GFileOutputStream *(*WriteFinishMethod)(GFile *, GAsyncResult *, GError **); static VALUE write_finish_method(WriteFinishMethod method, VALUE self, VALUE result) { GError *error = NULL; GFileOutputStream *stream; stream = method(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (stream == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(stream); } static VALUE rg_append_to_finish(VALUE self, VALUE result) { return write_finish_method(g_file_append_to_finish, self, result); } static VALUE rg_create_async(int argc, VALUE *argv, VALUE self) { return create_async_method(g_file_create_async, argc, argv, self); } static VALUE rg_create_finish(VALUE self, VALUE result) { return write_finish_method(g_file_create_finish, self, result); } typedef void (*ReplaceAsyncMethod)(GFile *, const char *, gboolean, GFileCreateFlags, int, GCancellable *, GAsyncReadyCallback, gpointer); static VALUE replace_async_method(ReplaceAsyncMethod method, int argc, VALUE *argv, VALUE self) { VALUE rbetag, rbmake_backup, rbflags, rbio_priority, rbcancellable, block; const char *etag; gboolean make_backup; GFileCreateFlags flags; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "05&", &rbetag, &rbmake_backup, &rbflags, &rbio_priority, &rbcancellable, &block); etag = RVAL2CSTR_ACCEPT_NIL(rbetag); make_backup = RVAL2CBOOL(rbmake_backup); flags = RVAL2GFILECREATEFLAGSDEFAULT(rbflags); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); method(_SELF(self), etag, make_backup, flags, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_replace_async(int argc, VALUE *argv, VALUE self) { return replace_async_method(g_file_replace_async, argc, argv, self); } static VALUE rg_replace_finish(VALUE self, VALUE result) { return write_finish_method(g_file_replace_finish, self, result); } static VALUE rg_query_info(int argc, VALUE *argv, VALUE self) { VALUE attributes, flags, cancellable; GError *error = NULL; GFileInfo *info; rb_scan_args(argc, argv, "03", &attributes, &flags, &cancellable); info = g_file_query_info(_SELF(self), RVAL2ATTRIBUTESDEFAULT(attributes), RVAL2GFILEQUERYINFOFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_query_info_async(int argc, VALUE *argv, VALUE self) { VALUE rbattributes, rbflags, rbio_priority, rbcancellable, block; const char *attributes; GFileQueryInfoFlags flags; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "04&", &rbattributes, &rbflags, &rbio_priority, &rbcancellable, &block); attributes = RVAL2ATTRIBUTESDEFAULT(rbattributes); flags = RVAL2GFILEQUERYINFOFLAGSDEFAULT(rbflags); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_query_info_async(_SELF(self), attributes, flags, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_query_info_finish(VALUE self, VALUE result) { GError *error = NULL; GFileInfo *info = g_file_query_info_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_query_exists_p(int argc, VALUE *argv, VALUE self) { VALUE cancellable; rb_scan_args(argc, argv, "01", &cancellable); return CBOOL2RVAL(g_file_query_exists(_SELF(self), RVAL2GCANCELLABLE(cancellable))); } static VALUE rg_query_file_type(int argc, VALUE *argv, VALUE self) { VALUE flags, cancellable; rb_scan_args(argc, argv, "02", &flags, &cancellable); return GFILETYPE2RVAL(g_file_query_file_type(_SELF(self), RVAL2GFILEQUERYINFOFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable))); } static VALUE rg_query_filesystem_info(int argc, VALUE *argv, VALUE self) { VALUE attributes, cancellable; GError *error = NULL; GFileInfo *info; rb_scan_args(argc, argv, "02", &attributes, &cancellable); info = g_file_query_filesystem_info(_SELF(self), RVAL2FSATTRIBUTESDEFAULT(attributes), RVAL2GCANCELLABLE(cancellable), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_query_filesystem_info_async(int argc, VALUE *argv, VALUE self) { VALUE rbattributes, rbio_priority, rbcancellable, block; const char *attributes; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbattributes, &rbio_priority, &rbcancellable, &block); attributes = RVAL2FSATTRIBUTESDEFAULT(rbattributes); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_query_filesystem_info_async(_SELF(self), attributes, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_query_filesystem_info_finish(VALUE self, VALUE result) { GError *error = NULL; GFileInfo *info; info = g_file_query_filesystem_info_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_query_default_handler(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; GAppInfo *info; rb_scan_args(argc, argv, "01", &cancellable); info = g_file_query_default_handler(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_find_enclosing_mount(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; GMount *mount; rb_scan_args(argc, argv, "01", &cancellable); mount = g_file_find_enclosing_mount(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (mount == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(mount); } static VALUE rg_find_enclosing_mount_async(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_find_enclosing_mount_async(_SELF(self), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_find_enclosing_mount_finish(VALUE self, VALUE result) { GError *error = NULL; GMount *mount = g_file_find_enclosing_mount_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (mount == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(mount); } struct file_enumerator_each_data { GCancellable *cancellable; GFileEnumerator *enumerator; }; static VALUE file_enumerator_each(VALUE data) { struct file_enumerator_each_data *real; GError *error = NULL; real = (struct file_enumerator_each_data *)data; while (TRUE) { GFileInfo *info = g_file_enumerator_next_file(real->enumerator, real->cancellable, &error); if (error != NULL) rbgio_raise_error(error); if (info == NULL) break; rb_yield(GOBJ2RVAL_UNREF(info)); } return Qnil; } static VALUE file_enumerator_each_ensure(VALUE data) { struct file_enumerator_each_data *real; GError *error = NULL; real = (struct file_enumerator_each_data *)data; if (!g_file_enumerator_close(real->enumerator, real->cancellable, &error)) { g_object_unref(real->enumerator); rbgio_raise_error(error); } g_object_unref(real->enumerator); return Qnil; } static VALUE rg_enumerate_children(int argc, VALUE *argv, VALUE self) { VALUE attributes, flags, cancellable; struct file_enumerator_each_data data; GError *error = NULL; rb_scan_args(argc, argv, "03", &attributes, &flags, &cancellable); data.cancellable = RVAL2GCANCELLABLE(cancellable); data.enumerator = g_file_enumerate_children(_SELF(self), RVAL2ATTRIBUTESDEFAULT(attributes), RVAL2GFILEQUERYINFOFLAGSDEFAULT(flags), data.cancellable, &error); if (data.enumerator == NULL) rbgio_raise_error(error); if (!rb_block_given_p()) return GOBJ2RVAL_UNREF(data.enumerator); rb_ensure(file_enumerator_each, (VALUE)&data, file_enumerator_each_ensure, (VALUE)&data); return self; } static VALUE rg_enumerate_children_async(int argc, VALUE *argv, VALUE self) { VALUE rbattributes, rbflags, rbio_priority, rbcancellable, block; const char *attributes; GFileQueryInfoFlags flags; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "04&", &rbattributes, &rbflags, &rbio_priority, &rbcancellable, &block); attributes = RVAL2ATTRIBUTESDEFAULT(rbattributes); flags = RVAL2GFILEQUERYINFOFLAGSDEFAULT(rbflags); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_enumerate_children_async(_SELF(self), attributes, flags, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_enumerate_children_finish(VALUE self, VALUE result) { GError *error = NULL; GFileEnumerator *enumerator; enumerator = g_file_enumerate_children_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (enumerator == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(enumerator); } static VALUE rg_set_display_name(int argc, VALUE *argv, VALUE self) { VALUE display_name, cancellable; GError *error = NULL; GFile *file; rb_scan_args(argc, argv, "11", &display_name, &cancellable); file = g_file_set_display_name(_SELF(self), RVAL2CSTR(display_name), RVAL2GCANCELLABLE(cancellable), &error); if (file == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(file); } static VALUE rg_set_display_name_async(int argc, VALUE *argv, VALUE self) { VALUE rbdisplay_name, rbio_priority, rbcancellable, block; const char *display_name; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbdisplay_name, &rbio_priority, &rbcancellable, &block); display_name = RVAL2CSTR(rbdisplay_name); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_set_display_name_async(_SELF(self), display_name, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_set_display_name_finish(VALUE self, VALUE result) { GError *error = NULL; GFileInfo *info; info = g_file_query_filesystem_info_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } typedef gboolean (*CancellableMethod)(GFile *, GCancellable *, GError **); static VALUE cancellable_method(CancellableMethod method, int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; rb_scan_args(argc, argv, "01", &cancellable); if (!method(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_delete(int argc, VALUE *argv, VALUE self) { return cancellable_method(g_file_delete, argc, argv, self); } static VALUE rg_trash(int argc, VALUE *argv, VALUE self) { return cancellable_method(g_file_trash, argc, argv, self); } struct progress_callback_data { goffset current_num_bytes; goffset total_num_bytes; gpointer data; }; static VALUE progress_callback_call(VALUE data) { static ID s_id_call; struct progress_callback_data *real; VALUE block; if (s_id_call == 0) s_id_call = rb_intern("call"); real = (struct progress_callback_data *)data; block = USE_BLOCK_AND_SAVE(real->data); if (!NIL_P(block)) rb_funcall(block, s_id_call, 2, GOFFSET2RVAL(real->current_num_bytes), GOFFSET2RVAL(real->total_num_bytes)); return Qnil; } static void progress_callback(goffset current_num_bytes, goffset total_num_bytes, gpointer data) { struct progress_callback_data real; real.current_num_bytes = current_num_bytes; real.total_num_bytes = total_num_bytes; real.data = data; G_PROTECT_CALLBACK(progress_callback_call, &real); } typedef gboolean (*CopyMoveMethod)(GFile *, GFile *, GFileCopyFlags, GCancellable *, GFileProgressCallback, gpointer, GError **); static VALUE copy_move_method(CopyMoveMethod method, int argc, VALUE *argv, VALUE self) { VALUE rbdestination, rbflags, rbcancellable, block; GFile *destination; GFileCopyFlags flags; GCancellable *cancellable; GError *error = NULL; rb_scan_args(argc, argv, "12&", &rbdestination, &rbflags, &rbcancellable, &block); destination = _SELF(rbdestination); flags = RVAL2GFILECOPYFLAGSDEFAULT(rbflags); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); if (!method(_SELF(self), destination, flags, cancellable, NIL_P(block) ? NULL : progress_callback, (gpointer)block, &error)) rbgio_raise_error(error); return self; } static VALUE rg_copy(int argc, VALUE *argv, VALUE self) { return copy_move_method(g_file_copy, argc, argv, self); } static VALUE rg_copy_async(int argc, VALUE *argv, VALUE self) { VALUE rbdestination, rbflags, rbio_priority, rbcancellable, block; GFile *destination; GFileCopyFlags flags; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "13&", &rbdestination, &rbflags, &rbio_priority, &rbcancellable, &block); destination = _SELF(rbdestination); flags = RVAL2GFILECOPYFLAGSDEFAULT(rbflags); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); /* NOTE: This requires the block to take a variable number of * arguments. It will be two integer values for the progress part and * a GLib::AsyncResult when done. */ g_file_copy_async(_SELF(self), destination, flags, io_priority, cancellable, NIL_P(block) ? NULL : progress_callback, (gpointer)block, rbgio_async_ready_callback, (gpointer)block); return self; } typedef gboolean (*BooleanFinishMethod)(GFile *, GAsyncResult *, GError **); static VALUE boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result) { GError *error = NULL; if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error)) rbgio_raise_error(error); return self; } static VALUE rg_copy_finish(VALUE self, VALUE result) { return boolean_finish_method(g_file_copy_finish, self, result); } static VALUE rg_move(int argc, VALUE *argv, VALUE self) { return copy_move_method(g_file_move, argc, argv, self); } static VALUE rg_make_directory(int argc, VALUE *argv, VALUE self) { return cancellable_method(g_file_make_directory, argc, argv, self); } static VALUE rg_make_directory_with_parents(int argc, VALUE *argv, VALUE self) { return cancellable_method(g_file_make_directory_with_parents, argc, argv, self); } static VALUE rg_make_symbolic_link(int argc, VALUE *argv, VALUE self) { VALUE symlink_value, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &symlink_value, &cancellable); if (!g_file_make_symbolic_link(_SELF(self), RVAL2CSTR(symlink_value), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } typedef GFileAttributeInfoList *(*QueryAttributesMethod)(GFile *, GCancellable *, GError **); static VALUE query_attributes_method(QueryAttributesMethod method, int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; GFileAttributeInfoList *list; rb_scan_args(argc, argv, "01", &cancellable); list = method(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (list == NULL) rbgio_raise_error(error); return GFILEATTRIBUTEINFOLIST2RVAL(list); } static VALUE rg_query_settable_attributes(int argc, VALUE *argv, VALUE self) { return query_attributes_method(g_file_query_settable_attributes, argc, argv, self); } static VALUE rg_query_writable_namespaces(int argc, VALUE *argv, VALUE self) { return query_attributes_method(g_file_query_writable_namespaces, argc, argv, self); } static VALUE rg_set_attribute(int argc, VALUE *argv, VALUE self) { VALUE rbattribute, rbtype, rbvalue, rbflags, rbcancellable; const char *attribute; GFileAttributeType type; gpointer value; gboolean gboolean_value; guint32 guint32_value; gint32 gint32_value; guint64 guint64_value; gint64 gint64_value; const char **stringv_value = NULL; GFileQueryInfoFlags flags; GCancellable *cancellable; GError *error = NULL; rb_scan_args(argc, argv, "32", &rbattribute, &rbtype, &rbvalue, &rbflags, &rbcancellable); attribute = RVAL2CSTR(rbattribute); type = RVAL2GFILEATTRIBUTETYPE(rbtype); flags = RVAL2GFILEQUERYINFOFLAGSDEFAULT(rbflags); cancellable = RVAL2GCANCELLABLE(rbcancellable); switch (type) { case G_FILE_ATTRIBUTE_TYPE_STRING: case G_FILE_ATTRIBUTE_TYPE_BYTE_STRING: value = (gpointer)RVAL2CSTR(rbvalue); break; case G_FILE_ATTRIBUTE_TYPE_BOOLEAN: gboolean_value = RVAL2CBOOL(rbvalue); value = &gboolean_value; break; case G_FILE_ATTRIBUTE_TYPE_UINT32: guint32_value = RVAL2GUINT32(rbvalue); value = &guint32_value; break; case G_FILE_ATTRIBUTE_TYPE_INT32: gint32_value = RVAL2GINT32(rbvalue); value = &gint32_value; break; case G_FILE_ATTRIBUTE_TYPE_UINT64: guint64_value = RVAL2GUINT64(rbvalue); value = &guint64_value; break; case G_FILE_ATTRIBUTE_TYPE_INT64: gint64_value = RVAL2GINT64(rbvalue); value = &gint64_value; break; case G_FILE_ATTRIBUTE_TYPE_OBJECT: value = RVAL2GOBJ(rbvalue); break; case G_FILE_ATTRIBUTE_TYPE_STRINGV: stringv_value = RVAL2STRV(rbvalue); value = (gpointer)stringv_value; break; case G_FILE_ATTRIBUTE_TYPE_INVALID: default: rb_raise(rb_eArgError, "Unknown file attribute type: %d", type); } g_file_set_attribute(_SELF(self), attribute, type, value, flags, cancellable, &error); g_free(stringv_value); if (error != NULL) rbgio_raise_error(error); return self; } static VALUE rg_set_attributes_from_info(int argc, VALUE *argv, VALUE self) { VALUE info, flags, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "12", &info, &flags, &cancellable); if (!g_file_set_attributes_from_info(_SELF(self), RVAL2GFILEINFO(info), RVAL2GFILEQUERYINFOFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_set_attributes_async(int argc, VALUE *argv, VALUE self) { VALUE rbinfo, rbflags, rbio_priority, rbcancellable, block; GFileInfo *info; GFileQueryInfoFlags flags; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "13&", &rbinfo, &rbflags, &rbio_priority, &rbcancellable, &block); info = RVAL2GFILEINFO(rbinfo); flags = RVAL2GFILEQUERYINFOFLAGSDEFAULT(rbflags); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_set_attributes_async(_SELF(self), info, flags, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_set_attributes_finish(VALUE self, VALUE result) { GFileInfo *info; GError *error = NULL; if (!g_file_set_attributes_finish(_SELF(self), RVAL2GASYNCRESULT(result), &info, &error)) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_set_attribute_string(int argc, VALUE *argv, VALUE self) { VALUE attribute, value, flags, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "22", &attribute, &value, &flags, &cancellable); if (!g_file_set_attribute_string(_SELF(self), RVAL2CSTR(attribute), RVAL2CSTR(value), RVAL2GFILEQUERYINFOFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_set_attribute_byte_string(int argc, VALUE *argv, VALUE self) { VALUE attribute, value, flags, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "22", &attribute, &value, &flags, &cancellable); if (!g_file_set_attribute_byte_string(_SELF(self), RVAL2CSTR(attribute), RVAL2CSTR(value), RVAL2GFILEQUERYINFOFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_set_attribute_uint32(int argc, VALUE *argv, VALUE self) { VALUE attribute, value, flags, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "22", &attribute, &value, &flags, &cancellable); if (!g_file_set_attribute_uint32(_SELF(self), RVAL2CSTR(attribute), RVAL2GUINT32(value), RVAL2GFILEQUERYINFOFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_set_attribute_int32(int argc, VALUE *argv, VALUE self) { VALUE attribute, value, flags, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "22", &attribute, &value, &flags, &cancellable); if (!g_file_set_attribute_int32(_SELF(self), RVAL2CSTR(attribute), RVAL2GINT32(value), RVAL2GFILEQUERYINFOFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_set_attribute_uint64(int argc, VALUE *argv, VALUE self) { VALUE attribute, value, flags, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "22", &attribute, &value, &flags, &cancellable); if (!g_file_set_attribute_uint64(_SELF(self), RVAL2CSTR(attribute), RVAL2GUINT64(value), RVAL2GFILEQUERYINFOFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_set_attribute_int64(int argc, VALUE *argv, VALUE self) { VALUE attribute, value, flags, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "22", &attribute, &value, &flags, &cancellable); if (!g_file_set_attribute_int64(_SELF(self), RVAL2CSTR(attribute), RVAL2GINT64(value), RVAL2GFILEQUERYINFOFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } typedef void (*MountMethod)(GFile *, GMountMountFlags, GMountOperation *, GCancellable *, GAsyncReadyCallback, gpointer); static VALUE mount_method(MountMethod method, int argc, VALUE *argv, VALUE self) { VALUE rbflags, rbmount_operation, rbcancellable, block; GMountMountFlags flags; GMountOperation *mount_operation; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block); flags = RVAL2GMOUNTMOUNTFLAGSDEFAULT(rbflags); mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); method(_SELF(self), flags, mount_operation, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_mount_mountable(int argc, VALUE *argv, VALUE self) { return mount_method(g_file_mount_mountable, argc, argv, self); } static VALUE rg_mount_mountable_finish(VALUE self, VALUE result) { GError *error = NULL; GFile *file; file = g_file_mount_mountable_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (file == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(file); } typedef void (*UnmountEjectStopMountableMethod)(GFile *, GMountUnmountFlags, GMountOperation *, GCancellable *, GAsyncReadyCallback, gpointer); static VALUE unmount_eject_stop_mountable_method(UnmountEjectStopMountableMethod method, int argc, VALUE *argv, VALUE self) { VALUE rbflags, rbmount_operation, rbcancellable, block; GMountUnmountFlags flags; GMountOperation *mount_operation; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block); flags = RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(rbflags); mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); method(_SELF(self), flags, mount_operation, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_unmount_mountable_with_operation(int argc, VALUE *argv, VALUE self) { return unmount_eject_stop_mountable_method(g_file_unmount_mountable_with_operation, argc, argv, self); } static VALUE rg_unmount_mountable_with_operation_finish(VALUE self, VALUE result) { return boolean_finish_method(g_file_unmount_mountable_with_operation_finish, self, result); } static VALUE rg_eject_mountable_with_operation(int argc, VALUE *argv, VALUE self) { return unmount_eject_stop_mountable_method(g_file_eject_mountable_with_operation, argc, argv, self); } static VALUE rg_eject_mountable_with_operation_finish(VALUE self, VALUE result) { return boolean_finish_method(g_file_eject_mountable_with_operation_finish, self, result); } static VALUE rg_start_mountable(int argc, VALUE *argv, VALUE self) { VALUE rbflags, rbstart_operation, rbcancellable, block; GDriveStartFlags flags; GMountOperation *start_operation; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbflags, &rbstart_operation, &rbcancellable, &block); flags = RVAL2GDRIVESTARTFLAGSDEFAULT(rbflags); start_operation = RVAL2GMOUNTOPERATION(rbstart_operation); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_start_mountable(_SELF(self), flags, start_operation, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_start_mountable_finish(VALUE self, VALUE result) { return boolean_finish_method(g_file_start_mountable_finish, self, result); } static VALUE rg_stop_mountable(int argc, VALUE *argv, VALUE self) { return unmount_eject_stop_mountable_method(g_file_stop_mountable, argc, argv, self); } static VALUE rg_stop_mountable_finish(VALUE self, VALUE result) { return boolean_finish_method(g_file_stop_mountable_finish, self, result); } typedef void (*CancellableAsyncMethod)(GFile *, GCancellable *, GAsyncReadyCallback, gpointer); static VALUE cancellable_async_method(CancellableAsyncMethod method, int argc, VALUE *argv, VALUE self) { VALUE rbcancellable, block; GCancellable *cancellable; rb_scan_args(argc, argv, "01&", &rbcancellable, &block); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); method(_SELF(self), cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_poll_mountable(int argc, VALUE *argv, VALUE self) { return cancellable_async_method(g_file_poll_mountable, argc, argv, self); } static VALUE rg_poll_mountable_finish(VALUE self, VALUE result) { return boolean_finish_method(g_file_poll_mountable_finish, self, result); } static VALUE rg_mount_enclosing_volume(int argc, VALUE *argv, VALUE self) { return mount_method(g_file_mount_enclosing_volume, argc, argv, self); } static VALUE rg_mount_enclosing_volume_finish(VALUE self, VALUE result) { return boolean_finish_method(g_file_mount_enclosing_volume_finish, self, result); } typedef GFileMonitor *(*MonitorMethod)(GFile *, GFileMonitorFlags, GCancellable *, GError **); static VALUE monitor_method(MonitorMethod method, int argc, VALUE *argv, VALUE self) { VALUE flags, cancellable; GError *error = NULL; GFileMonitor *monitor; rb_scan_args(argc, argv, "02", &flags, &cancellable); monitor = method(_SELF(self), RVAL2GFILEMONITORFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error); if (monitor == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(monitor); } static VALUE rg_monitor_directory(int argc, VALUE *argv, VALUE self) { return monitor_method(g_file_monitor_directory, argc, argv, self); } static VALUE rg_monitor_file(int argc, VALUE *argv, VALUE self) { return monitor_method(g_file_monitor_file, argc, argv, self); } static VALUE rg_monitor(int argc, VALUE *argv, VALUE self) { return monitor_method(g_file_monitor, argc, argv, self); } static VALUE rg_load_contents(int argc, VALUE *argv, VALUE self) { VALUE cancellable; char *contents; gsize length; char *etag_out; GError *error = NULL; rb_scan_args(argc, argv, "01", &cancellable); if (!g_file_load_contents(_SELF(self), RVAL2GCANCELLABLE(cancellable), &contents, &length, &etag_out, &error)) rbgio_raise_error(error); return rb_assoc_new(CSTR2RVAL_TAINTED_FREE(contents, length), CSTR2RVAL_FREE(etag_out)); } static VALUE rg_load_contents_async(int argc, VALUE *argv, VALUE self) { return cancellable_async_method(g_file_load_contents_async, argc, argv, self); } static VALUE rg_load_contents_finish(VALUE self, VALUE result) { char *contents; gsize length; char *etag_out; GError *error = NULL; if (!g_file_load_contents_finish(_SELF(self), RVAL2GASYNCRESULT(result), &contents, &length, &etag_out, &error)) rbgio_raise_error(error); return rb_assoc_new(CSTR2RVAL_TAINTED_FREE(contents, length), CSTR2RVAL_FREE(etag_out)); } struct load_partial_contents_async_read_more_callback_data { const char *file_contents; goffset file_size; gpointer data; }; static VALUE load_partial_contents_async_read_more_callback_call(VALUE data) { static ID s_id_call; struct load_partial_contents_async_read_more_callback_data *real; VALUE block; if (s_id_call == 0) s_id_call = rb_intern("call"); real = (struct load_partial_contents_async_read_more_callback_data *)data; block = USE_BLOCK_AND_SAVE(real->data); if (NIL_P(block)) return Qtrue; return rb_funcall(block, s_id_call, 1, CSTR2RVAL_TAINTED(real->file_contents, real->file_size)); } static gboolean load_partial_contents_async_read_more_callback(const char *file_contents, goffset file_size, gpointer data) { struct load_partial_contents_async_read_more_callback_data real; real.file_contents = file_contents; real.file_size = file_size; real.data = data; return RVAL2CBOOL(G_PROTECT_CALLBACK(load_partial_contents_async_read_more_callback_call, &real)); } static VALUE rg_load_partial_contents_async(int argc, VALUE *argv, VALUE self) { VALUE rbcancellable, rbuse_read_more_callback, block; GCancellable *cancellable; gboolean use_read_more_callback; rb_scan_args(argc, argv, "02&", &rbcancellable, &rbuse_read_more_callback, &block); cancellable = RVAL2GCANCELLABLE(rbcancellable); use_read_more_callback = RVAL2CBOOL(rbuse_read_more_callback); SAVE_BLOCK(block); /* TODO: Should we force a block if use_read_more_callback is true? */ g_file_load_partial_contents_async(_SELF(self), cancellable, use_read_more_callback ? load_partial_contents_async_read_more_callback : NULL, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_load_partial_contents_finish(VALUE self, VALUE result) { char *contents; gsize length; char *etag_out; GError *error = NULL; if (!g_file_load_partial_contents_finish(_SELF(self), RVAL2GASYNCRESULT(result), &contents, &length, &etag_out, &error)) rbgio_raise_error(error); return rb_assoc_new(CSTR2RVAL_TAINTED_FREE(contents, length), CSTR2RVAL_FREE(etag_out)); } static VALUE rg_replace_contents(int argc, VALUE *argv, VALUE self) { VALUE rbcontents, etag, make_backup, flags, cancellable; const char *contents; char *new_etag; GError *error = NULL; rb_scan_args(argc, argv, "14", &rbcontents, &etag, &make_backup, &flags, &cancellable); contents = RVAL2CSTR(rbcontents); if (!g_file_replace_contents(_SELF(self), contents, (gsize)RSTRING_LEN(rbcontents), RVAL2CSTR_ACCEPT_NIL(etag), RVAL2CBOOL(make_backup), RVAL2GFILECREATEFLAGSDEFAULT(flags), &new_etag, RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return CSTR2RVAL_FREE(new_etag); } static VALUE rg_replace_contents_async(int argc, VALUE *argv, VALUE self) { VALUE rbcontents, rbetag, rbmake_backup, rbflags, rbcancellable, block; const char *contents; gsize length; const char *etag; gboolean make_backup; GFileCreateFlags flags; GCancellable *cancellable; rb_scan_args(argc, argv, "14&", &rbcontents, &rbetag, &rbmake_backup, &rbflags, &rbcancellable, &block); contents = RVAL2CSTR(rbcontents); length = RSTRING_LEN(rbcontents); etag = RVAL2CSTR_ACCEPT_NIL(rbetag); make_backup = RVAL2CBOOL(rbmake_backup); flags = RVAL2GFILECREATEFLAGSDEFAULT(rbflags); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_replace_contents_async(_SELF(self), contents, length, etag, make_backup, flags, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_replace_contents_finish(VALUE self, VALUE result) { char *new_etag; GError *error = NULL; if (!g_file_replace_contents_finish(_SELF(self), RVAL2GASYNCRESULT(result), &new_etag, &error)) rbgio_raise_error(error); return CSTR2RVAL_FREE(new_etag); } static VALUE rg_copy_attributes(int argc, VALUE *argv, VALUE self) { VALUE destination, flags, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "12", &destination, &flags, &cancellable); if (!g_file_copy_attributes(_SELF(self), _SELF(destination), RVAL2GFILECOPYFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } struct file_io_stream_close_data { GCancellable *cancellable; GFileIOStream *stream; }; static VALUE file_io_stream_close(VALUE data) { struct file_io_stream_close_data *real; GError *error = NULL; real = (struct file_io_stream_close_data *)data; if (!g_io_stream_close(G_IO_STREAM(real->stream), real->cancellable, &error)) rbgio_raise_error(error); return Qnil; } static VALUE rg_create_readwrite(int argc, VALUE *argv, VALUE self) { VALUE flags, cancellable; struct file_io_stream_close_data data; GError *error = NULL; rb_scan_args(argc, argv, "02", &flags, &cancellable); data.cancellable = RVAL2GCANCELLABLE(cancellable); data.stream = g_file_create_readwrite(_SELF(self), RVAL2GFILECREATEFLAGSDEFAULT(flags), data.cancellable, &error); if (data.stream == NULL) rbgio_raise_error(error); if (!rb_block_given_p()) return GOBJ2RVAL_UNREF(data.stream); return rb_ensure(rb_yield, GOBJ2RVAL_UNREF(data.stream), file_io_stream_close, (VALUE)&data); } static VALUE rg_create_readwrite_async(int argc, VALUE *argv, VALUE self) { return create_async_method(g_file_create_readwrite_async, argc, argv, self); } typedef GFileIOStream *(*ReadwriteFinishMethod)(GFile *, GAsyncResult *, GError **); static VALUE readwrite_finish_method(ReadwriteFinishMethod method, VALUE self, VALUE result) { GError *error = NULL; GFileIOStream *stream = method(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (stream == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(stream); } static VALUE rg_create_readwrite_finish(VALUE self, VALUE result) { return readwrite_finish_method(g_file_create_readwrite_finish, self, result); } static VALUE rg_open_readwrite(int argc, VALUE *argv, VALUE self) { VALUE cancellable; struct file_io_stream_close_data data; GError *error = NULL; rb_scan_args(argc, argv, "01", &cancellable); data.cancellable = RVAL2GCANCELLABLE(cancellable); data.stream = g_file_open_readwrite(_SELF(self), data.cancellable, &error); if (data.stream == NULL) rbgio_raise_error(error); if (!rb_block_given_p()) return GOBJ2RVAL_UNREF(data.stream); return rb_ensure(rb_yield, GOBJ2RVAL_UNREF(data.stream), file_io_stream_close, (VALUE)&data); } static VALUE rg_open_readwrite_async(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_open_readwrite_async(_SELF(self), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_open_readwrite_finish(VALUE self, VALUE result) { return readwrite_finish_method(g_file_open_readwrite_finish, self, result); } static VALUE rg_replace_readwrite(int argc, VALUE *argv, VALUE self) { VALUE etag, make_backup, flags, cancellable; struct file_io_stream_close_data data; GError *error = NULL; rb_scan_args(argc, argv, "04", &etag, &make_backup, &flags, &cancellable); data.cancellable = RVAL2GCANCELLABLE(cancellable); data.stream = g_file_replace_readwrite(_SELF(self), RVAL2CSTR_ACCEPT_NIL(etag), RVAL2CBOOL(make_backup), RVAL2GFILECREATEFLAGSDEFAULT(flags), data.cancellable, &error); if (data.stream == NULL) rbgio_raise_error(error); if (!rb_block_given_p()) return GOBJ2RVAL_UNREF(data.stream); return rb_ensure(rb_yield, GOBJ2RVAL_UNREF(data.stream), file_io_stream_close, (VALUE)&data); } static VALUE rg_replace_readwrite_async(int argc, VALUE *argv, VALUE self) { return replace_async_method(g_file_replace_readwrite_async, argc, argv, self); } static VALUE rg_replace_readwrite_finish(VALUE self, VALUE result) { return readwrite_finish_method(g_file_replace_readwrite_finish, self, result); } static VALUE rg_supports_thread_contexts_p(VALUE self) { return CBOOL2RVAL(g_file_supports_thread_contexts(_SELF(self))); } void Init_gfile(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_FILE, "File", mGio); G_DEF_CLASS(G_TYPE_FILE_QUERY_INFO_FLAGS, "QueryInfoFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_QUERY_INFO_FLAGS, "G_FILE_"); G_DEF_CLASS(G_TYPE_FILE_CREATE_FLAGS, "CreateFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_CREATE_FLAGS, "G_FILE_"); G_DEF_CLASS(G_TYPE_FILE_COPY_FLAGS, "CopyFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_COPY_FLAGS, "G_FILE_"); G_DEF_CLASS(G_TYPE_FILE_MONITOR_FLAGS, "MonitorFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_MONITOR_FLAGS, "G_FILE_"); G_DEF_CLASS(G_TYPE_FILE_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_TYPE, "G_FILE_"); RG_DEF_SMETHOD(new_for_path, 1); RG_DEF_SMETHOD(new_for_uri, 1); RG_DEF_SMETHOD(new_for_commandline_arg, 1); RG_DEF_SMETHOD(parse_name, 1); RG_DEF_METHOD(dup, 0); RG_DEF_METHOD(hash, 0); RG_DEF_METHOD_OPERATOR("==", file_equal, 1); RG_DEF_METHOD(basename, 0); RG_DEF_METHOD(path, 0); RG_DEF_METHOD(uri, 0); RG_DEF_METHOD(parse_name, 0); RG_DEF_METHOD(parent, 0); RG_DEF_METHOD_P(has_parent, -1); RG_DEF_METHOD(get_child, 1); RG_DEF_METHOD(get_child_for_display_name, 1); RG_DEF_METHOD_P(has_prefix, 1); RG_DEF_METHOD(get_relative_path, 1); RG_DEF_METHOD(resolve_relative_path, 1); RG_DEF_METHOD_P(native, 0); RG_DEF_METHOD_P(has_uri_scheme, 1); RG_DEF_METHOD(uri_scheme, 0); RG_DEF_METHOD(read, -1); RG_DEF_METHOD(read_async, -1); RG_DEF_METHOD(read_finish, 1); RG_DEF_METHOD(append_to, -1); RG_DEF_METHOD(create, -1); RG_DEF_METHOD(replace, -1); RG_DEF_METHOD(append_to_async, -1); RG_DEF_METHOD(append_to_finish, 1); RG_DEF_METHOD(create_async, -1); RG_DEF_METHOD(create_finish, 1); RG_DEF_METHOD(replace_async, -1); RG_DEF_METHOD(replace_finish, 1); RG_DEF_METHOD(query_info, -1); RG_DEF_METHOD(query_info_async, -1); RG_DEF_METHOD(query_info_finish, 1); RG_DEF_METHOD_P(query_exists, -1); RG_DEF_ALIAS("exists?", "query_exists?"); RG_DEF_METHOD(query_file_type, -1); RG_DEF_METHOD(query_filesystem_info, -1); RG_DEF_METHOD(query_filesystem_info_async, -1); RG_DEF_METHOD(query_filesystem_info_finish, 1); RG_DEF_METHOD(query_default_handler, -1); RG_DEF_METHOD(find_enclosing_mount, -1); RG_DEF_METHOD(find_enclosing_mount_async, -1); RG_DEF_METHOD(find_enclosing_mount_finish, 1); RG_DEF_METHOD(enumerate_children, -1); RG_DEF_METHOD(enumerate_children_async, -1); RG_DEF_METHOD(enumerate_children_finish, 1); RG_DEF_METHOD(set_display_name, -1); RG_DEF_METHOD(set_display_name_async, -1); RG_DEF_METHOD(set_display_name_finish, 1); RG_DEF_METHOD(delete, -1); RG_DEF_METHOD(trash, -1); RG_DEF_METHOD(copy, -1); RG_DEF_METHOD(copy_async, -1); RG_DEF_METHOD(copy_finish, 1); RG_DEF_METHOD(move, -1); RG_DEF_METHOD(make_directory, -1); RG_DEF_METHOD(make_directory_with_parents, -1); RG_DEF_METHOD(make_symbolic_link, -1); RG_DEF_METHOD(query_settable_attributes, -1); RG_DEF_METHOD(query_writable_namespaces, -1); RG_DEF_METHOD(set_attribute, -1); RG_DEF_METHOD(set_attributes_from_info, -1); RG_DEF_METHOD(set_attributes_async, -1); RG_DEF_METHOD(set_attributes_finish, 1); RG_DEF_METHOD(set_attribute_string, -1); RG_DEF_METHOD(set_attribute_byte_string, -1); RG_DEF_METHOD(set_attribute_uint32, -1); RG_DEF_METHOD(set_attribute_int32, -1); RG_DEF_METHOD(set_attribute_uint64, -1); RG_DEF_METHOD(set_attribute_int64, -1); RG_DEF_METHOD(mount_mountable, -1); RG_DEF_METHOD(mount_mountable_finish, 1); RG_DEF_METHOD(unmount_mountable_with_operation, -1); RG_DEF_METHOD(unmount_mountable_with_operation_finish, 1); RG_DEF_METHOD(eject_mountable_with_operation, -1); RG_DEF_METHOD(eject_mountable_with_operation_finish, 1); RG_DEF_METHOD(start_mountable, -1); RG_DEF_METHOD(start_mountable_finish, 1); RG_DEF_METHOD(stop_mountable, -1); RG_DEF_METHOD(stop_mountable_finish, 1); RG_DEF_METHOD(poll_mountable, -1); RG_DEF_METHOD(poll_mountable_finish, 1); RG_DEF_METHOD(mount_enclosing_volume, -1); RG_DEF_METHOD(mount_enclosing_volume_finish, 1); RG_DEF_METHOD(monitor_directory, -1); RG_DEF_METHOD(monitor_file, -1); RG_DEF_METHOD(monitor, -1); RG_DEF_METHOD(load_contents, -1); RG_DEF_METHOD(load_contents_async, -1); RG_DEF_METHOD(load_contents_finish, 1); RG_DEF_METHOD(load_partial_contents_async, -1); RG_DEF_METHOD(load_partial_contents_finish, 1); RG_DEF_METHOD(replace_contents, -1); RG_DEF_METHOD(replace_contents_async, -1); RG_DEF_METHOD(replace_contents_finish, 1); RG_DEF_METHOD(copy_attributes, -1); RG_DEF_METHOD(create_readwrite, -1); RG_DEF_METHOD(create_readwrite_async, -1); RG_DEF_METHOD(create_readwrite_finish, 1); RG_DEF_METHOD(open_readwrite, -1); RG_DEF_METHOD(open_readwrite_async, -1); RG_DEF_METHOD(open_readwrite_finish, 1); RG_DEF_METHOD(replace_readwrite, -1); RG_DEF_METHOD(replace_readwrite_async, -1); RG_DEF_METHOD(replace_readwrite_finish, 1); RG_DEF_METHOD_P(supports_thread_contexts, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioioscheduler.c����������������������������������������������0000644�0001750�0001750�00000006134�11701304107�020577� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mIOScheduler struct ioscheduler_job_callback_data { GIOSchedulerJob *job; GCancellable *cancellable; gpointer data; }; static VALUE ioscheduler_job_callback_call(VALUE data) { static VALUE s_id_call; struct ioscheduler_job_callback_data *real; if (s_id_call == 0) s_id_call = rb_intern("call"); real = (struct ioscheduler_job_callback_data *)data; /* TODO: Totally unsure if _UNREF is correct here or not. */ return rb_funcall(USE_BLOCK_AND_SAVE(real->data), s_id_call, 2, GOBJ2RVAL_UNREF(real->job), GOBJ2RVAL_UNREF(real->cancellable)); } static gboolean ioscheduler_job_callback(GIOSchedulerJob *job, GCancellable *cancellable, gpointer data) { struct ioscheduler_job_callback_data real = { job, cancellable, data }; return RVAL2CBOOL(G_PROTECT_CALLBACK(ioscheduler_job_callback_call, &real)); } static void ioscheduler_job_callback_free(gpointer data) { USE_BLOCK((VALUE)data); } static VALUE rg_s_push_job(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; gint io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "02", &rbio_priority, &rbcancellable); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); block = rb_block_proc(); SAVE_BLOCK(block); g_io_scheduler_push_job(ioscheduler_job_callback, (gpointer)block, ioscheduler_job_callback_free, io_priority, cancellable); return self; } static VALUE rg_s_cancel_all_jobs(VALUE self) { g_io_scheduler_cancel_all_jobs(); return self; } void Init_gioscheduler(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "IOScheduler"); RG_DEF_SMETHOD(push_job, -1); RG_DEF_SMETHOD(cancel_all_jobs, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofileinputstream.c������������������������������������������0000644�0001750�0001750�00000006332�11701304107�021504� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFileInputStream #define _SELF(value) RVAL2GFILEINPUTSTREAM(value) static VALUE rg_query_info(int argc, VALUE *argv, VALUE self) { VALUE attributes, cancellable; GError *error = NULL; GFileInfo *info; rb_scan_args(argc, argv, "02", &attributes, &cancellable); info = g_file_input_stream_query_info(_SELF(self), RVAL2ATTRIBUTESDEFAULT(attributes), RVAL2GCANCELLABLE(cancellable), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_query_info_async(int argc, VALUE *argv, VALUE self) { VALUE rbattributes, rbio_priority, rbcancellable, block; const char *attributes; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbattributes, &rbio_priority, &rbcancellable, &block); attributes = RVAL2ATTRIBUTESDEFAULT(rbattributes); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_input_stream_query_info_async(_SELF(self), attributes, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_query_info_finish(VALUE self, VALUE result) { GError *error = NULL; GFileInfo *info; info = g_file_input_stream_query_info_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } void Init_gfileinputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_INPUT_STREAM, "FileInputStream", mGio); RG_DEF_METHOD(query_info, -1); RG_DEF_METHOD(query_info_async, -1); RG_DEF_METHOD(query_info_finish, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixmountpoints.c������������������������������������������0000664�0001750�0001750�00000003344�11740310343�021600� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixmounts.h> #define RG_TARGET_NAMESPACE mUnixMountPoints static VALUE rg_s_get(G_GNUC_UNUSED VALUE self) { guint64 time_read; GList *mount_points; mount_points = g_unix_mount_points_get(&time_read); return rb_assoc_new(GLIST2ARY_STR_FREE(mount_points), GUINT642RVAL(time_read)); } static VALUE rg_s_changed_since_p(G_GNUC_UNUSED VALUE self, VALUE time_read) { return CBOOL2RVAL(g_unix_mount_points_changed_since(RVAL2GUINT64(time_read))); } #endif void Init_gunixmountpoints(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "UnixMountPoints"); RG_DEF_SMETHOD(get, 0); RG_DEF_SMETHOD_P(changed_since, 1); #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosocketconnection.c�����������������������������������������0000644�0001750�0001750�00000003663�11701304107�021645� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cSocketConnection #define _SELF(value) RVAL2GSOCKETCONNECTION(value) static VALUE rg_local_address(VALUE self) { GError *error = NULL; GSocketAddress *address; address = g_socket_connection_get_local_address(_SELF(self), &error); if (address == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(address); } static VALUE rg_remote_address(VALUE self) { GError *error = NULL; GSocketAddress *address; address = g_socket_connection_get_remote_address(_SELF(self), &error); if (address == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(address); } /* TODO: lookup_type */ /* TODO: register_type */ void Init_gsocketconnection(VALUE mGio) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_CONNECTION, "SocketConnection", mGio); RG_DEF_METHOD(local_address, 0); RG_DEF_METHOD(remote_address, 0); } �����������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofileicon.c�������������������������������������������������0000644�0001750�0001750�00000002473�11701304107�020063� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFileIcon #define _SELF(value) RVAL2GFILEICON(value) static VALUE rg_initialize(VALUE self, VALUE file) { G_INITIALIZE(self, g_file_icon_new(RVAL2GFILE(file))); return Qnil; } void Init_gfileicon(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ICON, "FileIcon", mGio); RG_DEF_METHOD(initialize, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiobufferedinputstream.c��������������������������������������0000644�0001750�0001750�00000012614�11701304107�022347� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cBufferedInputStream #define _SELF(value) RVAL2GBUFFEREDINPUTSTREAM(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE rbbase_stream, size; GInputStream *base_stream, *stream; rb_scan_args(argc, argv, "11", &rbbase_stream, &size); base_stream = RVAL2GINPUTSTREAM(rbbase_stream); stream = NIL_P(size) ? g_buffered_input_stream_new(base_stream) : g_buffered_input_stream_new_sized(base_stream, RVAL2GSIZE(size)); G_INITIALIZE(self, stream); return Qnil; } static VALUE rg_available(VALUE self) { return GSIZE2RVAL(g_buffered_input_stream_get_available(_SELF(self))); } static VALUE rg_peek_buffer(VALUE self) { gsize size; const void *buffer; buffer = g_buffered_input_stream_peek_buffer(_SELF(self), &size); return CSTR2RVAL_TAINTED(buffer, size); } static VALUE rg_peek(VALUE self, VALUE rboffset, VALUE rbcount) { gsize offset = RVAL2GSIZE(rboffset); gsize count = RVAL2GSIZE(rbcount); VALUE result = rb_str_new(NULL, count); gsize bytes_peeked = g_buffered_input_stream_peek(_SELF(self), RSTRING_PTR(result), offset, count); rb_str_set_len(result, bytes_peeked); rb_str_resize(result, bytes_peeked); OBJ_TAINT(result); return result; } static VALUE rg_fill(int argc, VALUE *argv, VALUE self) { VALUE count, cancellable; GError *error = NULL; gsize bytes_read; rb_scan_args(argc, argv, "02", &count, &cancellable); bytes_read = g_buffered_input_stream_fill(_SELF(self), NIL_P(count) ? -1 : RVAL2GSSIZE(count), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return GSSIZE2RVAL(bytes_read); } static VALUE rg_fill_async(int argc, VALUE *argv, VALUE self) { VALUE rbcount, rbio_priority, rbcancellable, block; gssize count; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbcount, &rbio_priority, &rbcancellable, &block); count = NIL_P(rbcount) ? -1 : RVAL2GSSIZE(rbcount); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_buffered_input_stream_fill_async(_SELF(self), count, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_fill_finish(VALUE self, VALUE result) { GError *error = NULL; gsize bytes_read; bytes_read = g_buffered_input_stream_fill_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (error != NULL) rbgio_raise_error(error); return GSSIZE2RVAL(bytes_read); } static VALUE rg_read_byte(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; int byte; rb_scan_args(argc, argv, "01", &cancellable); byte = g_buffered_input_stream_read_byte(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return INT2FIX(byte); } void Init_gbufferedinputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_BUFFERED_INPUT_STREAM, "BufferedInputStream", mGio); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(available, 0); RG_DEF_METHOD(peek_buffer, 0); RG_DEF_METHOD(peek, 2); RG_DEF_METHOD(fill, -1); RG_DEF_METHOD(fill_async, -1); RG_DEF_METHOD(fill_finish, 1); RG_DEF_METHOD(read_byte, -1); } ��������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgio2.h��������������������������������������������������������0000644�0001750�0001750�00000012657�12137115064�016454� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGIO2_H__ #define __RBGIO2_H__ #include <gio/gio.h> #include "rbgio2conversions.h" G_BEGIN_DECLS /* Block Handling */ #define SAVE_BLOCK(block) G_STMT_START { \ if (!NIL_P(block)) \ G_CHILD_ADD(mGLib, (block)); \ } G_STMT_END #define USE_BLOCK(data) \ rbgio_child_remove_and_return(mGLib, (VALUE)(data)) #define USE_BLOCK_AND_SAVE(data) ((VALUE)data) #if !GLIB_CHECK_VERSION(2, 34, 0) #define G_TYPE_FILE_ATTRIBUTE_MATCHER (g_file_attribute_matcher_get_type()) GType g_file_attribute_matcher_get_type(void); #define G_TYPE_FILE_ATTRIBUTE_INFO_LIST (g_file_attribute_info_list_get_type()) GType g_file_attribute_info_list_get_type(void); #endif #define G_TYPE_FILE_ATTRIBUTE_INFO (g_file_attribute_info_get_type()) GType g_file_attribute_info_get_type(void); /* Conversion Macros */ #define RVAL2TYPE_WITH_DEFAULT(value, type, default_value) \ (NIL_P(value) ? (default_value) : type(value)) #define RVAL2ATTRIBUTESDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), RVAL2CSTR, "standard::*") #define RVAL2GDRIVESTARTFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GDRIVESTARTFLAGS, \ G_DRIVE_START_NONE) #define RVAL2GMOUNTMOUNTFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GMOUNTMOUNTFLAGS, \ G_MOUNT_MOUNT_NONE) #define RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GMOUNTUNMOUNTFLAGS, \ G_MOUNT_UNMOUNT_NONE) #define RVAL2GSOCKETPROTOCOLDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GSOCKETPROTOCOL, \ G_SOCKET_PROTOCOL_DEFAULT) #define GTIMEVAL2RVAL(value) rb_time_new((value)->tv_sec, (value)->tv_usec) #define RVAL2GZLIBCOMPRESSORFORMATDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GZLIBCOMPRESSORFORMAT, \ G_ZLIB_COMPRESSOR_FORMAT_ZLIB) #define RVAL2IOPRIORITYDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), NUM2INT, G_PRIORITY_DEFAULT) /* Integer Type Conversion Macros */ #define FD2RVAL(value) INT2FIX(value) #define RVAL2FD(value) FIX2INT(value) #define RVAL2FDS(value, n) RVAL2GINTS(value, n) #define GINT2RVAL(value) INT2NUM(value) #define RVAL2GINT(value) NUM2INT(value) #define GINT162RVAL(value) INT2FIX(value) #define RVAL2GINT16(value) FIX2INT(value) #define GINT322RVAL(value) INT2NUM(value) #define RVAL2GINT32(value) NUM2INT(value) #define GINT642RVAL(value) rbglib_int64_to_num(value) #define RVAL2GINT64(value) rbglib_num_to_int64(value) #define GSIZE2RVAL(value) ULONG2NUM(value) #define RVAL2GSIZE(value) NUM2ULONG(value) #define GLONG2RVAL(value) LONG2NUM(value) #define RVAL2GLONG(value) NUM2LONG(value) #define GOFFSET2RVAL(value) rbglib_int64_to_num(value) #define RVAL2GOFFSET(value) rbglib_num_to_int64(value) #define GSSIZE2RVAL(value) LONG2NUM(value) #define RVAL2GSSIZE(value) NUM2LONG(value) /* TODO: Should we be zeroing out bits? */ #define GUCHAR2RVAL(value) INT2FIX(value) #define RVAL2GUCHAR(value) FIX2INT(value) #define GUINT2RVAL(value) UINT2NUM(value) #define RVAL2GUINT(value) NUM2UINT(value) /* TODO: Should we be zeroing out bits? */ #define GUINT162RVAL(value) INT2FIX(value) #define RVAL2GUINT16(value) FIX2INT(value) #define GUINT322RVAL(value) UINT2NUM(value) #define RVAL2GUINT32(value) NUM2UINT(value) #define GUINT642RVAL(value) rbglib_uint64_to_num(value) #define RVAL2GUINT64(value) rbglib_num_to_uint64(value) #define GULONG2RVAL(value) ULONG2NUM(value) #define RVAL2GULONG(value) NUM2ULONG(value) VALUE rbgio_define_domain_error(VALUE module, const char *name, GQuark domain, const char *enum_name, VALUE parent); VALUE rbgio_define_error(VALUE module, const char *name, gint code, VALUE domain_error); NORETURN(void rbgio_raise_error(GError *error)); GObject *rbgio_ginitable_new(GType type, VALUE parameters, VALUE cancellable); void rbgio_gasyncinitable_new_async(GType type, VALUE parameters, VALUE io_priority, VALUE cancellable, VALUE block); G_END_DECLS #endif /* __RBGIO2_H__ */ ���������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiovolume.c���������������������������������������������������0000644�0001750�0001750�00000013664�11701304107�017606� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mVolume #define _SELF(value) RVAL2GVOLUME(value) static VALUE rg_name(VALUE self) { return CSTR2RVAL_FREE(g_volume_get_name(_SELF(self))); } static VALUE rg_uuid(VALUE self) { return CSTR2RVAL_FREE(g_volume_get_uuid(_SELF(self))); } static VALUE rg_icon(VALUE self) { return GOBJ2RVAL_UNREF(g_volume_get_icon(_SELF(self))); } static VALUE rg_drive(VALUE self) { return GOBJ2RVAL_UNREF(g_volume_get_drive(_SELF(self))); } static VALUE rg_get_mount(VALUE self) { return GOBJ2RVAL_UNREF(g_volume_get_mount(_SELF(self))); } static VALUE rg_can_mount_p(VALUE self) { return CBOOL2RVAL(g_volume_can_mount(_SELF(self))); } static VALUE rg_should_automount_p(VALUE self) { return CBOOL2RVAL(g_volume_should_automount(_SELF(self))); } static VALUE rg_activation_root(VALUE self) { return GOBJ2RVAL_UNREF(g_volume_get_activation_root(_SELF(self))); } static VALUE rg_mount(int argc, VALUE *argv, VALUE self) { VALUE rbflags, rbmount_operation, rbcancellable, block; GMountMountFlags flags; GMountOperation *mount_operation; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block); flags = RVAL2GMOUNTMOUNTFLAGSDEFAULT(rbflags); mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_volume_mount(_SELF(self), flags, mount_operation, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } typedef gboolean (*BooleanFinishMethod)(GVolume *, GAsyncResult *, GError **); static VALUE boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result) { GError *error = NULL; if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error)) rbgio_raise_error(error); return self; } static VALUE rg_mount_finish(VALUE self, VALUE result) { return boolean_finish_method(g_volume_mount_finish, self, result); } static VALUE rg_can_eject_p(VALUE self) { return CBOOL2RVAL(g_volume_can_eject(_SELF(self))); } static VALUE rg_eject_with_operation(int argc, VALUE *argv, VALUE self) { VALUE rbflags, rbmount_operation, rbcancellable, block; GMountUnmountFlags flags; GMountOperation *mount_operation; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block); flags = RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(rbflags); mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_volume_eject_with_operation(_SELF(self), flags, mount_operation, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_eject_with_operation_finish(VALUE self, VALUE result) { return boolean_finish_method(g_volume_eject_with_operation_finish, self, result); } static VALUE rg_enumerate_identifiers(VALUE self) { return STRV2RVAL_FREE(g_volume_enumerate_identifiers(_SELF(self))); } static VALUE rg_get_identifier(VALUE self, VALUE kind) { return CSTR2RVAL_FREE(g_volume_get_identifier(_SELF(self), RVAL2CSTR(kind))); } void Init_gvolume(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_VOLUME, "Volume", mGio); rb_define_const(RG_TARGET_NAMESPACE, "IDENTIFIER_KIND_HAL_UDI", CSTR2RVAL(G_VOLUME_IDENTIFIER_KIND_HAL_UDI)); rb_define_const(RG_TARGET_NAMESPACE, "IDENTIFIER_KIND_LABEL", CSTR2RVAL(G_VOLUME_IDENTIFIER_KIND_LABEL)); rb_define_const(RG_TARGET_NAMESPACE, "IDENTIFIER_KIND_NFS_MOUNT", CSTR2RVAL(G_VOLUME_IDENTIFIER_KIND_NFS_MOUNT)); rb_define_const(RG_TARGET_NAMESPACE, "IDENTIFIER_KIND_UNIX_DEVICE", CSTR2RVAL(G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE)); rb_define_const(RG_TARGET_NAMESPACE, "IDENTIFIER_KIND_UUID", CSTR2RVAL(G_VOLUME_IDENTIFIER_KIND_UUID)); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(uuid, 0); RG_DEF_METHOD(icon, 0); RG_DEF_METHOD(drive, 0); RG_DEF_METHOD(get_mount, 0); RG_DEF_METHOD_P(can_mount, 0); RG_DEF_METHOD_P(should_automount, 0); RG_DEF_METHOD(activation_root, 0); RG_DEF_METHOD(mount, -1); RG_DEF_METHOD(mount_finish, 1); RG_DEF_METHOD_P(can_eject, 0); RG_DEF_METHOD(eject_with_operation, -1); RG_DEF_METHOD(eject_with_operation_finish, 1); RG_DEF_METHOD(enumerate_identifiers, -1); RG_DEF_ALIAS("identifiers", "enumerate_identifiers"); RG_DEF_METHOD(get_identifier, 1); } ����������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioresolver.c�������������������������������������������������0000644�0001750�0001750�00000017513�11701304107�020135� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cResolver #define _SELF(value) RVAL2GRESOLVER(value) static VALUE rg_s_default(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL_UNREF(g_resolver_get_default()); } static VALUE rg_s_set_default(G_GNUC_UNUSED VALUE self, VALUE resolver) { g_resolver_set_default(_SELF(resolver)); return self; } static VALUE rg_lookup_by_name(VALUE self, VALUE hostname, VALUE cancellable) { GError *error = NULL; GList *addresses; addresses = g_resolver_lookup_by_name(_SELF(self), RVAL2CSTR(hostname), RVAL2GCANCELLABLE(cancellable), &error); if (addresses == NULL) rbgio_raise_error(error); return GLIST2ARY_UNREF_FREE(addresses); } static VALUE rg_lookup_by_name_async(int argc, VALUE *argv, VALUE self) { VALUE rbhostname, rbcancellable, block; const gchar *hostname; GCancellable *cancellable; rb_scan_args(argc, argv, "11&", &hostname, &rbcancellable, &block); hostname = RVAL2CSTR(rbhostname); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_resolver_lookup_by_name_async(_SELF(self), hostname, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_lookup_by_name_finish(VALUE self, VALUE result) { GError *error = NULL; GList *addresses; addresses = g_resolver_lookup_by_name_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (addresses == NULL) rbgio_raise_error(error); return GLIST2ARY_UNREF_FREE(addresses); } static VALUE rg_lookup_by_address(int argc, VALUE *argv, VALUE self) { VALUE address, cancellable; GError *error = NULL; gchar *hostname; rb_scan_args(argc, argv, "11", &address, &cancellable); hostname = g_resolver_lookup_by_address(_SELF(self), RVAL2GINETADDRESS(address), RVAL2GCANCELLABLE(cancellable), &error); if (hostname == NULL) rbgio_raise_error(error); return CSTR2RVAL_FREE(hostname); } static VALUE rg_lookup_by_address_async(int argc, VALUE *argv, VALUE self) { VALUE rbaddress, rbcancellable, block; GInetAddress *address; GCancellable *cancellable; rb_scan_args(argc, argv, "11&", &rbaddress, &rbcancellable, &block); address = RVAL2GINETADDRESS(rbaddress); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_resolver_lookup_by_address_async(_SELF(self), address, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_lookup_by_address_finish(VALUE self, VALUE result) { GError *error = NULL; gchar *hostname; hostname = g_resolver_lookup_by_address_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (hostname == NULL) rbgio_raise_error(error); return CSTR2RVAL_FREE(hostname); } static VALUE rg_lookup_service(int argc, VALUE *argv, VALUE self) { VALUE service, protocol, domain, cancellable; GError *error = NULL; GList *targets; rb_scan_args(argc, argv, "31", &service, &protocol, &domain, &cancellable); targets = g_resolver_lookup_service(_SELF(self), RVAL2CSTR(service), RVAL2CSTR(protocol), RVAL2CSTR(domain), RVAL2GCANCELLABLE(cancellable), &error); if (targets == NULL) rbgio_raise_error(error); return GLIST2ARY_UNREF_FREE(targets); } static VALUE rg_lookup_service_async(int argc, VALUE *argv, VALUE self) { VALUE rbservice, rbprotocol, rbdomain, rbcancellable, block; const gchar *service; const gchar *protocol; const gchar *domain; GCancellable *cancellable; rb_scan_args(argc, argv, "31&", &rbservice, &rbprotocol, &rbdomain, &rbcancellable, &block); service = RVAL2CSTR(rbservice); protocol = RVAL2CSTR(rbprotocol); domain = RVAL2CSTR(rbdomain); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_resolver_lookup_service_async(_SELF(self), service, protocol, domain, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_lookup_service_finish(VALUE self, VALUE result) { GError *error = NULL; GList *targets; targets = g_resolver_lookup_service_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (targets == NULL) rbgio_raise_error(error); return GLIST2ARY_UNREF_FREE(targets); } void Init_gresolver(VALUE mGio) { VALUE RG_TARGET_NAMESPACE, error; RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_RESOLVER, "Resolver", mGio); RG_DEF_SMETHOD(default, 0); RG_DEF_SMETHOD(set_default, 1); /* TODO: Taint result of these methods? */ RG_DEF_METHOD(lookup_by_name, 2); RG_DEF_METHOD(lookup_by_name_async, -1); RG_DEF_METHOD(lookup_by_name_finish, 1); RG_DEF_METHOD(lookup_by_address, -1); RG_DEF_METHOD(lookup_by_address_async, -1); RG_DEF_METHOD(lookup_by_address_finish, 1); RG_DEF_METHOD(lookup_service, -1); RG_DEF_METHOD(lookup_service_async, -1); RG_DEF_METHOD(lookup_service_finish, 1); error = rbgio_define_domain_error(RG_TARGET_NAMESPACE, "Error", G_RESOLVER_ERROR, "GResolverErrorEnum", rb_eIOError); rbgio_define_error(RG_TARGET_NAMESPACE, "NotFoundError", G_RESOLVER_ERROR_NOT_FOUND, error); rbgio_define_error(RG_TARGET_NAMESPACE, "TemporaryFailureError", G_RESOLVER_ERROR_TEMPORARY_FAILURE, error); rbgio_define_error(RG_TARGET_NAMESPACE, "InternalError", G_RESOLVER_ERROR_INTERNAL, error); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiobufferedoutputstream.c�������������������������������������0000644�0001750�0001750�00000003341�11701304107�022545� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cBufferedOutputStream #define _SELF(value) RVAL2GBUFFEREDOUTPUTSTREAM(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE rbbase_stream, size; GOutputStream *base_stream, *stream; rb_scan_args(argc, argv, "11", &rbbase_stream, &size); base_stream = RVAL2GOUTPUTSTREAM(rbbase_stream); stream = NIL_P(size) ? g_buffered_output_stream_new(base_stream) : g_buffered_output_stream_new_sized(base_stream, RVAL2GSIZE(size)); G_INITIALIZE(self, stream); return Qnil; } void Init_gbufferedoutputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_BUFFERED_OUTPUT_STREAM, "BufferedOutputStream", mGio); RG_DEF_METHOD(initialize, -1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosimpleasyncresult.c����������������������������������������0000664�0001750�0001750�00000011030�11740310343�022052� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cSimpleAsyncResult #define _SELF(value) RVAL2GSIMPLEASYNCRESULT(value) static VALUE rg_initialize(VALUE self, VALUE object) { VALUE block; /* TODO: I have absolutely no idea if this makes sense. Should we even * be providing this method? */ block = rb_block_proc(); SAVE_BLOCK(block); G_INITIALIZE(self, g_simple_async_result_new(RVAL2GOBJ(object), rbgio_async_ready_callback, (gpointer)block, (gpointer)block)); return Qnil; } /* NOTE: Can't implement g_simple_async_result_new_error. */ /* NOTE: Can't implement g_simple_async_result_new_from_error. */ /* NOTE: Can't implement g_simple_async_result_set_op_res_gpointer. */ /* NOTE: Can't implement g_simple_async_result_get_op_res_gpointer. */ static VALUE rg_set_op_res_gssize(VALUE self, VALUE op_res) { g_simple_async_result_set_op_res_gssize(_SELF(self), RVAL2GSSIZE(op_res)); return self; } static VALUE rg_op_res_gssize(VALUE self) { return GSSIZE2RVAL(g_simple_async_result_get_op_res_gssize(_SELF(self))); } static VALUE rg_set_op_res_gboolean(VALUE self, VALUE op_res) { g_simple_async_result_set_op_res_gboolean(_SELF(self), RVAL2CBOOL(op_res)); return self; } static VALUE rg_op_res_gboolean(VALUE self) { return CBOOL2RVAL(g_simple_async_result_get_op_res_gboolean(_SELF(self))); } static VALUE rg_source_tag(VALUE self) { return (VALUE)g_simple_async_result_get_source_tag(_SELF(self)); } static VALUE rg_valid_p(VALUE self, VALUE source, VALUE source_tag) { return CBOOL2RVAL(g_simple_async_result_is_valid(RVAL2GASYNCRESULT(self), RVAL2GOBJ(source), (gpointer)source_tag)); } static VALUE rg_set_handle_cancellation(VALUE self, VALUE handle_cancellation) { g_simple_async_result_set_handle_cancellation(_SELF(self), RVAL2CBOOL(handle_cancellation)); return self; } static VALUE rg_complete(VALUE self) { g_simple_async_result_complete(_SELF(self)); return self; } static VALUE rg_complete_in_idle(VALUE self) { g_simple_async_result_complete_in_idle(_SELF(self)); return self; } /* TODO: Should we implement g_simple_async_result_run_in_thread? I'd say no, * but I'm not sure. */ /* NOTE: Can't implement g_simple_async_result_set_from_error. */ /* NOTE: Can't implement g_simple_async_result_propagate_error. */ /* NOTE: Can't implement g_simple_async_result_set_error. */ /* NOTE: Can't implement g_simple_async_result_set_error_va. */ /* NOTE: Can't implement g_simple_async_result_report_error_in_idle. */ /* NOTE: Can't implement g_simple_async_result_report_gerror_in_idle. */ void Init_gsimpleasyncresult(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SIMPLE_ASYNC_RESULT, "SimpleAsyncResult", mGio); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(set_op_res_gssize, 1); RG_DEF_METHOD(op_res_gssize, 0); RG_DEF_METHOD(set_op_res_gboolean, 1); 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); RG_DEF_METHOD(complete, 0); RG_DEF_METHOD(complete_in_idle, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixconnection.c�������������������������������������������0000644�0001750�0001750�00000004270�11701304107�021333� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixconnection.h> #define RG_TARGET_NAMESPACE cUnixConnection #define _SELF(value) RVAL2GUNIXCONNECTION(value) static VALUE rg_receive_fd(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; gint fd; rb_scan_args(argc, argv, "01", &cancellable); fd = g_unix_connection_receive_fd(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (fd == -1) rbgio_raise_error(error); return FD2RVAL(fd); } static VALUE rg_send_fd(int argc, VALUE *argv, VALUE self) { VALUE fd, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &fd, &cancellable); if (!g_unix_connection_send_fd(_SELF(self), RVAL2FD(fd), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } #endif void Init_gunixconnection(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_CONNECTION, "UnixConnection", mGio); RG_DEF_METHOD(receive_fd, -1); RG_DEF_METHOD(send_fd, -1); #endif } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/gio2.h����������������������������������������������������������0000644�0001750�0001750�00000002027�11701304107�016110� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __GIO2_H__ #define __GIO2_H__ #ifdef __GNUC__ #warning "<gio2.h> has been deprecated. Use <rbgio2.h> instead." #endif #include "rbgio2.h" #endif /* __GIO2_H__ */ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixmountpoint.c�������������������������������������������0000644�0001750�0001750�00000007176�11701304107�021420� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixmounts.h> #define G_TYPE_UNIX_MOUNT_POINT (g_unix_mount_point_get_type()) #define RG_TARGET_NAMESPACE cUnixMountPoint #define _SELF(value) \ ((GUnixMountPoint *)(RVAL2BOXED((value), G_TYPE_UNIX_MOUNT_POINT))) static GUnixMountPoint * unixmountpoint_copy(const GUnixMountPoint *mount_point) { return (GUnixMountPoint *)mount_point; } static GType g_unix_mount_point_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static("GUnixMountPoint", (GBoxedCopyFunc)unixmountpoint_copy, (GBoxedFreeFunc)g_unix_mount_point_free); return our_type; } static VALUE rg_compare(VALUE self, VALUE other) { return INT2FIX(g_unix_mount_point_compare(_SELF(self), _SELF(other))); } static VALUE rg_mount_path(VALUE self) { return CSTR2RVAL(g_unix_mount_point_get_mount_path(_SELF(self))); } static VALUE rg_device_path(VALUE self) { return CSTR2RVAL(g_unix_mount_point_get_device_path(_SELF(self))); } static VALUE rg_fs_type(VALUE self) { return CSTR2RVAL(g_unix_mount_point_get_fs_type(_SELF(self))); } static VALUE rg_readonly_p(VALUE self) { return CBOOL2RVAL(g_unix_mount_point_is_readonly(_SELF(self))); } static VALUE rg_user_mountable_p(VALUE self) { return CBOOL2RVAL(g_unix_mount_point_is_user_mountable(_SELF(self))); } static VALUE rg_loopback_p(VALUE self) { return CBOOL2RVAL(g_unix_mount_point_is_loopback(_SELF(self))); } static VALUE rg_guess_icon(VALUE self) { return GOBJ2RVAL_UNREF(g_unix_mount_point_guess_icon(_SELF(self))); } static VALUE rg_guess_name(VALUE self) { return CSTR2RVAL_FREE(g_unix_mount_point_guess_name(_SELF(self))); } static VALUE rg_guess_can_eject_p(VALUE self) { return CBOOL2RVAL(g_unix_mount_point_guess_can_eject(_SELF(self))); } #endif void Init_gunixmountpoint(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_MOUNT_POINT, "UnixMountPoint", mGio); rb_include_module(RG_TARGET_NAMESPACE, rb_mComparable); rbgobj_boxed_not_copy_obj(G_TYPE_UNIX_MOUNT_POINT); RG_DEF_METHOD(compare, 1); RG_DEF_ALIAS("<=>", "compare"); RG_DEF_METHOD(mount_path, 0); RG_DEF_METHOD(device_path, 0); RG_DEF_METHOD(fs_type, 0); RG_DEF_METHOD_P(readonly, 0); RG_DEF_METHOD_P(user_mountable, 0); RG_DEF_METHOD_P(loopback, 0); RG_DEF_METHOD(guess_icon, 0); RG_DEF_METHOD(guess_name, 0); RG_DEF_METHOD_P(guess_can_eject, 0); #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiomount.c����������������������������������������������������0000644�0001750�0001750�00000020600�11701304107�017425� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mMount #define _SELF(value) RVAL2GMOUNT(value) static VALUE rg_name(VALUE self) { return CSTR2RVAL_FREE(g_mount_get_name(_SELF(self))); } static VALUE rg_uuid(VALUE self) { return CSTR2RVAL_FREE(g_mount_get_uuid(_SELF(self))); } static VALUE rg_icon(VALUE self) { return GOBJ2RVAL_UNREF(g_mount_get_icon(_SELF(self))); } static VALUE rg_drive(VALUE self) { return GOBJ2RVAL_UNREF(g_mount_get_drive(_SELF(self))); } static VALUE rg_root(VALUE self) { return GOBJ2RVAL_UNREF(g_mount_get_root(_SELF(self))); } static VALUE rg_volume(VALUE self) { return GOBJ2RVAL_UNREF(g_mount_get_volume(_SELF(self))); } static VALUE rg_default_location(VALUE self) { return GOBJ2RVAL_UNREF(g_mount_get_default_location(_SELF(self))); } static VALUE rg_can_unmount_p(VALUE self) { return CBOOL2RVAL(g_mount_can_unmount(_SELF(self))); } typedef void (*UnmountEjectMethod)(GMount *, GMountUnmountFlags, GMountOperation *, GCancellable *, GAsyncReadyCallback, gpointer); static VALUE unmount_eject_method(UnmountEjectMethod method, int argc, VALUE *argv, VALUE self) { VALUE rbflags, rbmount_operation, rbcancellable, block; GMountUnmountFlags flags; GMountOperation *mount_operation; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block); flags = RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(rbflags); mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); method(_SELF(self), flags, mount_operation, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_unmount_with_operation(int argc, VALUE *argv, VALUE self) { return unmount_eject_method(g_mount_unmount_with_operation, argc, argv, self); } typedef gboolean (*BooleanFinishMethod)(GMount *, GAsyncResult *, GError **); static VALUE boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result) { GError *error = NULL; if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error)) rbgio_raise_error(error); return self; } static VALUE rg_unmount_with_operation_finish(VALUE self, VALUE result) { return boolean_finish_method(g_mount_unmount_with_operation_finish, self, result); } static VALUE rg_remount(int argc, VALUE *argv, VALUE self) { VALUE rbflags, rbmount_operation, rbcancellable, block; GMountMountFlags flags; GMountOperation *mount_operation; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block); flags = RVAL2GMOUNTMOUNTFLAGSDEFAULT(rbflags); mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_mount_remount(_SELF(self), flags, mount_operation, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_remount_finish(VALUE self, VALUE result) { return boolean_finish_method(g_mount_remount_finish, self, result); } static VALUE rg_can_eject_p(VALUE self) { return CBOOL2RVAL(g_mount_can_eject(_SELF(self))); } static VALUE rg_eject_with_operation(int argc, VALUE *argv, VALUE self) { return unmount_eject_method(g_mount_eject_with_operation, argc, argv, self); } static VALUE rg_eject_with_operation_finish(VALUE self, VALUE result) { return boolean_finish_method(g_mount_eject_with_operation_finish, self, result); } static VALUE rg_guess_content_type(int argc, VALUE *argv, VALUE self) { VALUE rbforce_rescan, rbcancellable, block; gboolean force_rescan; GCancellable *cancellable; rb_scan_args(argc, argv, "02&", &rbforce_rescan, &rbcancellable, &block); force_rescan = RVAL2CBOOL(rbforce_rescan); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_mount_guess_content_type(_SELF(self), force_rescan, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_guess_content_type_finish(VALUE self, VALUE result) { GError *error = NULL; gchar **content_types; content_types = g_mount_guess_content_type_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (content_types == NULL) rbgio_raise_error(error); return STRV2RVAL_FREE(content_types); } static VALUE rg_guess_content_type_sync(int argc, VALUE *argv, VALUE self) { VALUE force_rescan, cancellable; GError *error = NULL; gchar **content_types; rb_scan_args(argc, argv, "02", &force_rescan, &cancellable); content_types = g_mount_guess_content_type_sync(_SELF(self), RVAL2CBOOL(force_rescan), RVAL2GCANCELLABLE(cancellable), &error); if (content_types == NULL) rbgio_raise_error(error); return STRV2RVAL_FREE(content_types); } static VALUE rg_shadowed_p(VALUE self) { return CBOOL2RVAL(g_mount_is_shadowed(_SELF(self))); } static VALUE rg_shadow(VALUE self) { g_mount_shadow(_SELF(self)); return self; } static VALUE rg_unshadow(VALUE self) { g_mount_unshadow(_SELF(self)); return self; } void Init_gmount(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_MOUNT, "Mount", mGio); G_DEF_CLASS(G_TYPE_MOUNT_MOUNT_FLAGS, "MountFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_MOUNT_MOUNT_FLAGS, "G_MOUNT_"); G_DEF_CLASS(G_TYPE_MOUNT_UNMOUNT_FLAGS, "UnmountFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_MOUNT_UNMOUNT_FLAGS, "G_MOUNT_"); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(uuid, 0); RG_DEF_METHOD(icon, 0); RG_DEF_METHOD(drive, 0); RG_DEF_METHOD(root, 0); RG_DEF_METHOD(volume, 0); RG_DEF_METHOD(default_location, 0); RG_DEF_METHOD_P(can_unmount, 0); RG_DEF_METHOD(unmount_with_operation, -1); RG_DEF_METHOD(unmount_with_operation_finish, 1); RG_DEF_METHOD(remount, -1); RG_DEF_METHOD(remount_finish, 1); RG_DEF_METHOD_P(can_eject, 0); RG_DEF_METHOD(eject_with_operation, -1); RG_DEF_METHOD(eject_with_operation_finish, 1); RG_DEF_METHOD(guess_content_type, -1); RG_DEF_METHOD(guess_content_type_finish, 1); RG_DEF_METHOD(guess_content_type_sync, -1); RG_DEF_METHOD_P(shadowed, 0); RG_DEF_METHOD(shadow, 0); RG_DEF_METHOD(unshadow, 0); } ��������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofileoutputstream.c�����������������������������������������0000644�0001750�0001750�00000006570�11701304107�021711� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFileOutputStream #define _SELF(value) RVAL2GFILEOUTPUTSTREAM(value) static VALUE rg_query_info(int argc, VALUE *argv, VALUE self) { VALUE attributes, cancellable; GError *error = NULL; GFileInfo *info; rb_scan_args(argc, argv, "02", &attributes, &cancellable); info = g_file_output_stream_query_info(_SELF(self), RVAL2ATTRIBUTESDEFAULT(attributes), RVAL2GCANCELLABLE(cancellable), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_query_info_async(int argc, VALUE *argv, VALUE self) { VALUE rbattributes, rbio_priority, rbcancellable, block; const char *attributes; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbattributes, &rbio_priority, &rbcancellable, &block); attributes = RVAL2ATTRIBUTESDEFAULT(rbattributes); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_output_stream_query_info_async(_SELF(self), attributes, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_query_info_finish(VALUE self, VALUE result) { GError *error = NULL; GFileInfo *info; info = g_file_output_stream_query_info_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_etag(VALUE self) { return CSTR2RVAL(g_file_output_stream_get_etag(_SELF(self))); } void Init_gfileoutputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_OUTPUT_STREAM, "FileOutputStream", mGio); RG_DEF_METHOD(query_info, -1); RG_DEF_METHOD(query_info_async, -1); RG_DEF_METHOD(query_info_finish, 1); RG_DEF_METHOD(etag, 0); } ����������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixsocketaddress.c����������������������������������������0000644�0001750�0001750�00000004321�11701304107�022027� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixsocketaddress.h> #define RG_TARGET_NAMESPACE cUnixSocketAddress #define _SELF(value) RVAL2GUNIXSOCKETADDRESS(value) static VALUE rg_initialize(VALUE self, VALUE path) { G_INITIALIZE(self, g_unix_socket_address_new(RVAL2CSTR(path))); return Qnil; } static VALUE rg_s_new_abstract(G_GNUC_UNUSED VALUE self, VALUE path) { StringValue(path); return GOBJ2RVAL_UNREF(g_unix_socket_address_new_abstract(RSTRING_PTR(path), RSTRING_LEN(path))); } static VALUE rg_s_abstract_names_supported_p(G_GNUC_UNUSED VALUE self) { return CBOOL2RVAL(g_unix_socket_address_abstract_names_supported()); } #endif void Init_gunixsocketaddress(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_SOCKET_ADDRESS, "UnixSocketAddress", mGio); # if GLIB_CHECK_VERSION(2, 26, 0) G_DEF_CLASS(G_TYPE_UNIX_SOCKET_ADDRESS_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_UNIX_SOCKET_ADDRESS_TYPE, "G_UNIX_SOCKET_ADDRESS_"); # endif RG_DEF_SMETHOD(new_abstract, 1); RG_DEF_SMETHOD_P(abstract_names_supported, 0); RG_DEF_METHOD(initialize, 1); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofiledescriptorbased.c��������������������������������������0000644�0001750�0001750�00000002670�11701304107�022307� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gfiledescriptorbased.h> #define RG_TARGET_NAMESPACE mFileDescriptorBased #define _SELF(value) RVAL2GFILEDESCRIPTORBASED(value) static VALUE rg_fd(VALUE self) { return FD2RVAL(g_file_descriptor_based_get_fd(_SELF(self))); } #endif void Init_gfiledescriptorbased(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_FILE_DESCRIPTOR_BASED, "FileDescriptorBased", mGio); RG_DEF_METHOD(fd, 0); #endif } ������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosocketconnectable.c����������������������������������������0000644�0001750�0001750�00000002556�11701304107�021763� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mSocketConnectable #define _SELF(value) RVAL2GSOCKETCONNECTABLE(value) static VALUE rg_enumerate(VALUE self) { return GOBJ2RVAL(g_socket_connectable_enumerate(_SELF(self))); } void Init_gsocketconnectable(VALUE mGio) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_SOCKET_CONNECTABLE, "SocketConnectable", mGio); RG_DEF_METHOD(enumerate, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofileinfo.c�������������������������������������������������0000664�0001750�0001750�00000041414�11740310343�020070� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFileInfo #define _SELF(value) RVAL2GFILEINFO(value) #define RVAL2FILEINFONAMESPACEDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), RVAL2CSTR, "*") static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_file_info_new()); return Qnil; } static VALUE rg_dup(VALUE self) { return GOBJ2RVAL_UNREF(g_file_info_dup(_SELF(self))); } static VALUE rg_copy_into(VALUE self, VALUE other) { g_file_info_copy_into(_SELF(self), _SELF(other)); return self; } static VALUE rg_has_attribute_p(VALUE self, VALUE attribute) { return CBOOL2RVAL(g_file_info_has_attribute(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_has_namespace_p(VALUE self, VALUE namespace) { return CBOOL2RVAL(g_file_info_has_namespace(_SELF(self), RVAL2CSTR(namespace))); } static VALUE rg_set_attribute_status(VALUE self, VALUE attribute, VALUE status) { return CBOOL2RVAL(g_file_info_set_attribute_status(_SELF(self), RVAL2CSTR(attribute), RVAL2GFILEATTRIBUTESTATUS(status))); } static VALUE rg_list_attributes(int argc, VALUE *argv, VALUE self) { VALUE name_space; rb_scan_args(argc, argv, "01", &name_space); return STRV2RVAL_FREE(g_file_info_list_attributes(_SELF(self), RVAL2FILEINFONAMESPACEDEFAULT(name_space))); } static VALUE rg_get_attribute_type(VALUE self, VALUE attribute) { return GFILEATTRIBUTETYPE2RVAL(g_file_info_get_attribute_type(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_remove_attribute(VALUE self, VALUE attribute) { g_file_info_remove_attribute(_SELF(self), RVAL2CSTR(attribute)); return self; } static VALUE rg_get_attribute_as_string(VALUE self, VALUE attribute) { return CSTR2RVAL_FREE(g_file_info_get_attribute_as_string(_SELF(self), RVAL2CSTR(attribute))); } static VALUE file_attribute_to_value(GFileAttributeType type, gpointer value) { switch (type) { case G_FILE_ATTRIBUTE_TYPE_STRING: case G_FILE_ATTRIBUTE_TYPE_BYTE_STRING: return CSTR2RVAL(value); case G_FILE_ATTRIBUTE_TYPE_BOOLEAN: return CBOOL2RVAL(*(gboolean *)value); case G_FILE_ATTRIBUTE_TYPE_UINT32: return GUINT322RVAL(*(guint32 *)value); case G_FILE_ATTRIBUTE_TYPE_INT32: return GINT322RVAL(*(gint32 *)value); case G_FILE_ATTRIBUTE_TYPE_UINT64: return GUINT642RVAL(*(guint64 *)value); case G_FILE_ATTRIBUTE_TYPE_INT64: return GINT642RVAL(*(gint64 *)value); case G_FILE_ATTRIBUTE_TYPE_OBJECT: return GOBJ2RVAL((GObject *)value); case G_FILE_ATTRIBUTE_TYPE_STRINGV: return STRV2RVAL_FREE((gchar **)value); case G_FILE_ATTRIBUTE_TYPE_INVALID: rb_raise(rb_eArgError, "invalid file attribute type"); break; default: rb_raise(rb_eArgError, "unknown file attribute type"); break; } } static VALUE rg_get_attribute_data(VALUE self, VALUE attribute) { GFileAttributeType type; gpointer value; GFileAttributeStatus status; if (!g_file_info_get_attribute_data(_SELF(self), RVAL2CSTR(attribute), &type, &value, &status)) return Qnil; return rb_ary_new3(3, GFILEATTRIBUTETYPE2RVAL(type), file_attribute_to_value(type, value), GFILEATTRIBUTESTATUS2RVAL(status)); } static VALUE rg_get_attribute_status(VALUE self, VALUE attribute) { return GFILEATTRIBUTESTATUS2RVAL(g_file_info_get_attribute_status(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_get_attribute_string(VALUE self, VALUE attribute) { return CSTR2RVAL(g_file_info_get_attribute_string(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_get_attribute_stringv(VALUE self, VALUE attribute) { return STRV2RVAL((const gchar **)g_file_info_get_attribute_stringv(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_get_attribute_byte_string(VALUE self, VALUE attribute) { return CSTR2RVAL(g_file_info_get_attribute_byte_string(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_get_attribute_boolean(VALUE self, VALUE attribute) { return CBOOL2RVAL(g_file_info_get_attribute_boolean(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_get_attribute_uint32(VALUE self, VALUE attribute) { return GUINT322RVAL(g_file_info_get_attribute_uint32(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_get_attribute_int32(VALUE self, VALUE attribute) { return GINT322RVAL(g_file_info_get_attribute_int32(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_get_attribute_uint64(VALUE self, VALUE attribute) { return GUINT642RVAL(g_file_info_get_attribute_uint64(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_get_attribute_int64(VALUE self, VALUE attribute) { return GINT642RVAL(g_file_info_get_attribute_int64(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_get_attribute_object(VALUE self, VALUE attribute) { return GOBJ2RVAL(g_file_info_get_attribute_object(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_get_attribute_value(VALUE self, VALUE attribute) { GFileAttributeType type; gpointer value; GFileAttributeStatus status; if (!g_file_info_get_attribute_data(_SELF(self), RVAL2CSTR(attribute), &type, &value, &status)) return Qnil; return file_attribute_to_value(type, value); } static VALUE rg_set_attribute_string(VALUE self, VALUE attribute, VALUE value) { g_file_info_set_attribute_string(_SELF(self), RVAL2CSTR(attribute), RVAL2CSTR(value)); return self; } static VALUE rg_set_attribute_byte_string(VALUE self, VALUE attribute, VALUE value) { g_file_info_set_attribute_byte_string(_SELF(self), RVAL2CSTR(attribute), RVAL2CSTR(value)); return self; } static VALUE rg_set_attribute_boolean(VALUE self, VALUE attribute, VALUE value) { g_file_info_set_attribute_boolean(_SELF(self), RVAL2CSTR(attribute), RVAL2CBOOL(value)); return self; } static VALUE rg_set_attribute_uint32(VALUE self, VALUE attribute, VALUE value) { g_file_info_set_attribute_uint32(_SELF(self), RVAL2CSTR(attribute), RVAL2GUINT32(value)); return self; } static VALUE rg_set_attribute_int32(VALUE self, VALUE attribute, VALUE value) { g_file_info_set_attribute_int32(_SELF(self), RVAL2CSTR(attribute), RVAL2GINT32(value)); return self; } static VALUE rg_set_attribute_uint64(VALUE self, VALUE attribute, VALUE value) { g_file_info_set_attribute_uint64(_SELF(self), RVAL2CSTR(attribute), RVAL2GUINT64(value)); return self; } static VALUE rg_set_attribute_int64(VALUE self, VALUE attribute, VALUE value) { g_file_info_set_attribute_int64(_SELF(self), RVAL2CSTR(attribute), RVAL2GINT64(value)); return self; } static VALUE rg_set_attribute_object(VALUE self, VALUE attribute, VALUE value) { g_file_info_set_attribute_object(_SELF(self), RVAL2CSTR(attribute), RVAL2GOBJ(value)); return self; } static VALUE rg_clear_status(VALUE self) { g_file_info_clear_status(_SELF(self)); return self; } static VALUE rg_file_type(VALUE self) { return GFILETYPE2RVAL(g_file_info_get_file_type(_SELF(self))); } static VALUE rg_hidden_p(VALUE self) { return CBOOL2RVAL(g_file_info_get_is_hidden(_SELF(self))); } static VALUE rg_backup_p(VALUE self) { return CBOOL2RVAL(g_file_info_get_is_backup(_SELF(self))); } static VALUE rg_symlink_p(VALUE self) { return CBOOL2RVAL(g_file_info_get_is_symlink(_SELF(self))); } static VALUE rg_name(VALUE self) { return CSTR2RVAL(g_file_info_get_name(_SELF(self))); } static VALUE rg_display_name(VALUE self) { return CSTR2RVAL(g_file_info_get_display_name(_SELF(self))); } static VALUE rg_edit_name(VALUE self) { return CSTR2RVAL(g_file_info_get_edit_name(_SELF(self))); } static VALUE rg_icon(VALUE self) { return GOBJ2RVAL(g_file_info_get_icon(_SELF(self))); } static VALUE rg_content_type(VALUE self) { return CSTR2RVAL(g_file_info_get_content_type(_SELF(self))); } static VALUE rg_size(VALUE self) { return GOFFSET2RVAL(g_file_info_get_size(_SELF(self))); } static VALUE rg_modification_time(VALUE self) { GTimeVal time; g_file_info_get_modification_time(_SELF(self), &time); return GTIMEVAL2RVAL(&time); } static VALUE rg_symlink_target(VALUE self) { return CSTR2RVAL(g_file_info_get_symlink_target(_SELF(self))); } static VALUE rg_etag(VALUE self) { return CSTR2RVAL(g_file_info_get_etag(_SELF(self))); } static VALUE rg_sort_order(VALUE self) { return GINT322RVAL(g_file_info_get_sort_order(_SELF(self))); } static VALUE rg_set_attribute_mask(VALUE self, VALUE rbmask) { gboolean should_unref; GFileAttributeMatcher *mask; if (NIL_P(rbmask)) { g_file_info_unset_attribute_mask(_SELF(self)); return self; } if (TYPE(rbmask) == T_STRING) { mask = g_file_attribute_matcher_new(RVAL2CSTR(rbmask)); should_unref = TRUE; } else { mask = RVAL2GFILEATTRIBUTEMATCHER(rbmask); should_unref = FALSE; } g_file_info_set_attribute_mask(_SELF(self), mask); if (should_unref) g_file_attribute_matcher_unref(mask); return self; } static VALUE rg_unset_attribute_mask(VALUE self) { g_file_info_unset_attribute_mask(_SELF(self)); return self; } static VALUE rg_set_file_type(VALUE self, VALUE value) { g_file_info_set_file_type(_SELF(self), RVAL2GFILETYPE(value)); return self; } static VALUE rg_set_hidden(VALUE self, VALUE value) { g_file_info_set_is_hidden(_SELF(self), RVAL2CBOOL(value)); return self; } static VALUE rg_set_symlink(VALUE self, VALUE value) { g_file_info_set_is_symlink(_SELF(self), RVAL2CBOOL(value)); return self; } static VALUE rg_set_name(VALUE self, VALUE value) { g_file_info_set_name(_SELF(self), RVAL2CSTR(value)); return self; } static VALUE rg_set_display_name(VALUE self, VALUE value) { g_file_info_set_display_name(_SELF(self), RVAL2CSTR(value)); return self; } static VALUE rg_set_edit_name(VALUE self, VALUE value) { g_file_info_set_edit_name(_SELF(self), RVAL2CSTR(value)); return self; } static VALUE rg_set_icon(VALUE self, VALUE value) { g_file_info_set_icon(_SELF(self), RVAL2GICON(value)); return self; } static VALUE rg_set_content_type(VALUE self, VALUE value) { g_file_info_set_content_type(_SELF(self), RVAL2CSTR(value)); return self; } static VALUE rg_set_size(VALUE self, VALUE value) { g_file_info_set_size(_SELF(self), RVAL2GOFFSET(value)); return self; } static VALUE rg_set_modification_time(VALUE self, VALUE rbtime) { GTimeVal time; rbgio_rval_to_gtimeval(rbtime, &time); g_file_info_set_modification_time(_SELF(self), &time); return self; } static VALUE rg_set_symlink_target(VALUE self, VALUE value) { g_file_info_set_symlink_target(_SELF(self), RVAL2CSTR(value)); return self; } static VALUE rg_set_sort_order(VALUE self, VALUE value) { g_file_info_set_sort_order(_SELF(self), RVAL2GINT32(value)); return self; } void Init_gfileinfo(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_INFO, "FileInfo", mGio); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(dup, 0); RG_DEF_METHOD(copy_into, 1); RG_DEF_METHOD_P(has_attribute, 1); RG_DEF_METHOD_P(has_namespace, 1); RG_DEF_METHOD(list_attributes, -1); RG_DEF_ALIAS("attributes", "list_attributes"); RG_DEF_METHOD(get_attribute_type, 1); RG_DEF_METHOD(remove_attribute, 1); RG_DEF_METHOD(get_attribute_as_string, 1); RG_DEF_METHOD(get_attribute_data, 1); RG_DEF_METHOD(get_attribute_status, 1); RG_DEF_METHOD(get_attribute_string, 1); RG_DEF_METHOD(get_attribute_stringv, 1); RG_DEF_METHOD(get_attribute_byte_string, 1); RG_DEF_METHOD(get_attribute_boolean, 1); RG_DEF_METHOD(get_attribute_uint32, 1); RG_DEF_METHOD(get_attribute_int32, 1); RG_DEF_METHOD(get_attribute_uint64, 1); RG_DEF_METHOD(get_attribute_int64, 1); RG_DEF_METHOD(get_attribute_object, 1); RG_DEF_METHOD(get_attribute_value, 1); RG_DEF_ALIAS("[]", "get_attribute_value"); RG_DEF_METHOD(set_attribute_status, 2); RG_DEF_METHOD(set_attribute_string, 2); RG_DEF_METHOD(set_attribute_byte_string, 2); RG_DEF_METHOD(set_attribute_boolean, 2); RG_DEF_METHOD(set_attribute_uint32, 2); RG_DEF_METHOD(set_attribute_int32, 2); RG_DEF_METHOD(set_attribute_uint64, 2); RG_DEF_METHOD(set_attribute_int64, 2); RG_DEF_METHOD(set_attribute_object, 2); RG_DEF_METHOD(clear_status, 0); RG_DEF_METHOD(file_type, 0); RG_DEF_METHOD_P(hidden, 0); RG_DEF_METHOD_P(backup, 0); RG_DEF_METHOD_P(symlink, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(display_name, 0); RG_DEF_METHOD(edit_name, 0); RG_DEF_METHOD(icon, 0); RG_DEF_METHOD(content_type, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(modification_time, 0); RG_DEF_METHOD(symlink_target, 0); RG_DEF_METHOD(etag, 0); RG_DEF_METHOD(sort_order, 0); RG_DEF_METHOD(set_attribute_mask, 1); RG_DEF_METHOD(unset_attribute_mask, 0); RG_DEF_METHOD(set_file_type, 1); RG_DEF_METHOD(set_hidden, 1); RG_DEF_METHOD(set_symlink, 1); RG_DEF_METHOD(set_name, 1); RG_DEF_METHOD(set_display_name, 1); RG_DEF_METHOD(set_edit_name, 1); RG_DEF_METHOD(set_icon, 1); RG_DEF_METHOD(set_content_type, 1); RG_DEF_METHOD(set_size, 1); RG_DEF_METHOD(set_modification_time, 1); RG_DEF_METHOD(set_symlink_target, 1); RG_DEF_METHOD(set_sort_order, 1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiocharsetconverter.c�����������������������������������������0000644�0001750�0001750�00000003470�11701304107�021652� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cCharsetConverter #define _SELF(value) RVAL2GCHARSETCONVERTER(value) static VALUE rg_initialize(VALUE self, VALUE to, VALUE from) { GError *error = NULL; GCharsetConverter *converter; converter = g_charset_converter_new(RVAL2CSTR(to), RVAL2CSTR(from), &error); if (converter == NULL) rbgio_raise_error(error); G_INITIALIZE(self, converter); return Qnil; } static VALUE rg_num_fallbacks(VALUE self) { return GUINT2RVAL(g_charset_converter_get_num_fallbacks(_SELF(self))); } void Init_gcharsetconverter(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CHARSET_CONVERTER, "CharsetConverter", mGio); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(num_fallbacks, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioemblemedicon.c���������������������������������������������0000644�0001750�0001750�00000003572�11701304107�020717� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cEmblemedIcon #define _SELF(value) RVAL2GEMBLEMEDICON(value) static VALUE rg_initialize(VALUE self, VALUE icon, VALUE emblem) { G_INITIALIZE(self, g_emblemed_icon_new(RVAL2GICON(icon), RVAL2GEMBLEM(emblem))); return Qnil; } static VALUE rg_icon(VALUE self) { return GOBJ2RVAL(g_emblemed_icon_get_icon(_SELF(self))); } static VALUE rg_emblems(VALUE self) { return GLIST2ARY_FREE(g_emblemed_icon_get_emblems(_SELF(self))); } static VALUE rg_add_emblem(VALUE self, VALUE emblem) { g_emblemed_icon_add_emblem(_SELF(self), RVAL2GEMBLEM(emblem)); return self; } void Init_gemblemedicon(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_EMBLEMED_ICON, "EmblemedIcon", mGio); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(icon, 0); RG_DEF_METHOD(emblems, 0); RG_DEF_METHOD(add_emblem, 1); RG_DEF_ALIAS("<<", "add_emblem"); } ��������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosocketaddress.c��������������������������������������������0000644�0001750�0001750�00000002202�11701304107�021117� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" /* TODO: new_from_native? */ /* TODO: to_native? */ /* TODO: get_native_size? */ void Init_gsocketaddress(VALUE mGio) { (void)G_DEF_CLASS(G_TYPE_SOCKET_ADDRESS, "SocketAddress", mGio); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofileattributeinfo.c����������������������������������������0000644�0001750�0001750�00000004715�11701304107�022013� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFileAttributeInfo static GFileAttributeInfo * fileattributeinfo_copy(const GFileAttributeInfo *info) { return (GFileAttributeInfo *)info; } static void fileattributeinfo_free(G_GNUC_UNUSED GFileAttributeInfo *info) { return; } GType g_file_attribute_info_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static("GFileAttributeInfo", (GBoxedCopyFunc)fileattributeinfo_copy, (GBoxedFreeFunc)fileattributeinfo_free); return our_type; } #define _SELF(value) RVAL2GFILEATTRIBUTEINFO(value) static VALUE rg_name(VALUE self) { return CSTR2RVAL(_SELF(self)->name); } static VALUE rg_type(VALUE self) { return GFILEATTRIBUTETYPE2RVAL(_SELF(self)->type); } static VALUE rg_flags(VALUE self) { return GFILEATTRIBUTEINFOFLAGS2RVAL(_SELF(self)->flags); } void Init_gfileattributeinfo(VALUE mGio) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO, "FileAttributeInfo", mGio); G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS, "Flags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_FILE_ATTRIBUTE_INFO_FLAGS, "G_FILE_ATTRIBUTE_INFO_"); rbgobj_boxed_not_copy_obj(G_TYPE_FILE_ATTRIBUTE_INFO); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(type, 0); RG_DEF_METHOD(flags, 0); } ���������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/gio2.c����������������������������������������������������������0000644�0001750�0001750�00000002015�11701304107�016100� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" void Init_gio2(void); void Init_gio2(void) { Init_util(); Init_gio(); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgionetworkaddress.c�������������������������������������������0000644�0001750�0001750�00000003704�11701304107�021330� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cNetworkAddress #define _SELF(value) RVAL2GNETWORKADDRESS(value) static VALUE rg_initialize(VALUE self, VALUE hostname, VALUE port) { G_INITIALIZE(self, g_network_address_new(RVAL2CSTR(hostname), RVAL2GUINT16(port))); return Qnil; } static VALUE rg_s_parse(G_GNUC_UNUSED VALUE self, VALUE host_and_port, VALUE default_port) { GError *error = NULL; GSocketConnectable *connectable; connectable = g_network_address_parse(RVAL2CSTR(host_and_port), RVAL2GUINT16(default_port), &error); if (connectable == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(connectable); } void Init_gnetworkaddress(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_NETWORK_ADDRESS, "NetworkAddress", mGio); RG_DEF_SMETHOD(parse, 2); RG_DEF_METHOD(initialize, 2); } ������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioiostream.c�������������������������������������������������0000664�0001750�0001750�00000005752�11740310343�020125� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cIOStream #define _SELF(value) RVAL2GIOSTREAM(value) static VALUE rg_close(VALUE self, VALUE cancellable) { GError *error = NULL; if (!g_io_stream_close(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_close_async(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "01&", &rbio_priority, &rbcancellable, &block); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_io_stream_close_async(_SELF(self), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_close_finish(VALUE self, VALUE result) { GError *error = NULL; if (!g_io_stream_close_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error)) rbgio_raise_error(error); return self; } static VALUE rg_has_pending_p(VALUE self) { return CBOOL2RVAL(g_io_stream_has_pending(_SELF(self))); } static VALUE rg_set_pending(VALUE self) { GError *error = NULL; if (!g_io_stream_set_pending(_SELF(self), &error)) rbgio_raise_error(error); return self; } static VALUE rg_clear_pending(VALUE self) { g_io_stream_clear_pending(_SELF(self)); return self; } void Init_giostream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IO_STREAM, "IOStream", mGio); 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); RG_DEF_METHOD(clear_pending, 0); } ����������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/extconf.rb������������������������������������������������������0000644�0001750�0001750�00000003276�11701304107�017101� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin extconf.rb for Ruby/GIO extention library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent.expand_path top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "gio2" package_id = "gio-2.0" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end ruby_header = 'ruby.h' have_func 'rb_exec_recursive', ruby_header have_func 'rb_errinfo', ruby_header ["glib2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end win32 = setup_win32(module_name, base_dir) defines = '-DRUBY_GIO2_COMPILATION' PKGConfig.have_package(package_id) or exit 1 unless win32 PKGConfig.have_package('gio-unix-2.0') and defines += ' -DHAVE_GIO_UNIX' end PKGConfig.have_package('gobject-2.0') or exit 1 create_pkg_config_file("Ruby/GIO2", package_id) $defs << defines create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiomemoryoutputstream.c���������������������������������������0000644�0001750�0001750�00000003006�11701304107�022271� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cMemoryOutputStream /* TODO: Take string argument? */ static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_memory_output_stream_new(NULL, 0, g_realloc, g_free)); return Qnil; } void Init_gmemoryoutputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MEMORY_OUTPUT_STREAM, "MemoryOutputStream", mGio); RG_DEF_METHOD(initialize, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofileattributeinfolist.c������������������������������������0000644�0001750�0001750�00000006616�12137115064�022717� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFileAttributeInfoList #define RVAL2GFILEATTRIBUTEINFOFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GFILEATTRIBUTEINFOFLAGS, \ G_FILE_ATTRIBUTE_INFO_NONE) #if !GLIB_CHECK_VERSION(2, 34, 0) GType g_file_attribute_info_list_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static("GFileAttributeInfoList", (GBoxedCopyFunc)g_file_attribute_info_list_ref, (GBoxedFreeFunc)g_file_attribute_info_list_unref); return our_type; } #endif #define _SELF(value) RVAL2GFILEATTRIBUTEINFOLIST(value) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_file_attribute_info_list_new()); return Qnil; } static VALUE rg_dup(VALUE self) { return GFILEATTRIBUTEINFOLIST2RVAL(g_file_attribute_info_list_dup(_SELF(self))); } static VALUE rg_lookup(VALUE self, VALUE name) { /* TODO: How do we deal with the const? */ return GFILEATTRIBUTEINFO2RVAL((GFileAttributeInfo *)g_file_attribute_info_list_lookup(_SELF(self), RVAL2CSTR(name))); } static VALUE rg_add(int argc, VALUE *argv, VALUE self) { VALUE name, type, flags; rb_scan_args(argc, argv, "21", &name, &type, &flags); g_file_attribute_info_list_add(_SELF(self), RVAL2CSTR(name), RVAL2GFILEATTRIBUTETYPE(type), RVAL2GFILEATTRIBUTEINFOFLAGSDEFAULT(flags)); return self; } static VALUE rg_each(VALUE self) { GFileAttributeInfoList *list = RVAL2GFILEATTRIBUTEINFOLIST(self); int i; for (i = 0; i < list->n_infos; i++) rb_yield(GFILEATTRIBUTEINFO2RVAL(&list->infos[i])); return self; } void Init_fileattributeinfolist(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_INFO_LIST, "FileAttributeInfoList", mGio); rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(dup, 0); RG_DEF_METHOD(lookup, 1); RG_DEF_ALIAS("[]", "lookup"); RG_DEF_METHOD(add, 3); RG_DEF_METHOD(each, 0); } ������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgionetworkservice.c�������������������������������������������0000644�0001750�0001750�00000003176�11701304107�021346� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cNetworkService #define _SELF(value) RVAL2GNETWORKSERVICE(value) static VALUE rg_initialize(VALUE self, VALUE service, VALUE protocol, VALUE domain) { /* TODO: If these are infected, so should they be when returned. How * do we deal with that? */ G_INITIALIZE(self, g_network_service_new(RVAL2CSTR(service), RVAL2CSTR(protocol), RVAL2CSTR(domain))); return Qnil; } void Init_gnetworkservice(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_NETWORK_SERVICE, "NetworkService", mGio); RG_DEF_METHOD(initialize, 3); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosocketlistener.c�������������������������������������������0000664�0001750�0001750�00000017632�11740310343�021340� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cSocketListener #define _SELF(value) RVAL2GSOCKETLISTENER(value) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_socket_listener_new()); return Qnil; } static VALUE rg_add_socket(int argc, VALUE *argv, VALUE self) { VALUE socket, source_object; GError *error = NULL; rb_scan_args(argc, argv, "11", &socket, &source_object); if (!g_socket_listener_add_socket(_SELF(self), RVAL2GSOCKET(socket), RVAL2GOBJ(source_object), &error)) rbgio_raise_error(error); return self; } static VALUE rg_add_address(int argc, VALUE *argv, VALUE self) { VALUE rbaddress, type, protocol, source_object; GError *error = NULL; GSocketAddress *address; rb_scan_args(argc, argv, "22", &rbaddress, &type, &protocol, &source_object); if (!g_socket_listener_add_address(_SELF(self), RVAL2GSOCKETADDRESS(rbaddress), RVAL2GSOCKETTYPE(type), RVAL2GSOCKETPROTOCOLDEFAULT(protocol), RVAL2GOBJ(source_object), &address, &error)) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(address); } static VALUE rg_add_inet_port(int argc, VALUE *argv, VALUE self) { VALUE port, source_object; GError *error = NULL; rb_scan_args(argc, argv, "11", &port, &source_object); if (!g_socket_listener_add_inet_port(_SELF(self), RVAL2GUINT16(port), RVAL2GOBJ(source_object), &error)) rbgio_raise_error(error); return self; } static VALUE rg_add_any_inet_port(int argc, VALUE *argv, VALUE self) { VALUE source_object; GError *error = NULL; guint16 port; rb_scan_args(argc, argv, "01", &source_object); port = g_socket_listener_add_any_inet_port(_SELF(self), RVAL2GOBJ(source_object), &error); if (port == 0) rbgio_raise_error(error); return self; } static VALUE rg_accept(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GObject *source_object; GError *error = NULL; GSocketConnection *connection; rb_scan_args(argc, argv, "01", &cancellable); connection = g_socket_listener_accept(_SELF(self), &source_object, RVAL2GCANCELLABLE(cancellable), &error); if (connection == NULL) rbgio_raise_error(error); return rb_assoc_new(GOBJ2RVAL_UNREF(connection), GOBJ2RVAL(source_object)); } static VALUE rg_accept_async(int argc, VALUE *argv, VALUE self) { VALUE rbcancellable, block; GCancellable *cancellable; rb_scan_args(argc, argv, "01&", &rbcancellable, &block); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_socket_listener_accept_async(_SELF(self), cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_accept_finish(VALUE self, VALUE result) { GObject *source_object; GError *error = NULL; GSocketConnection *connection; connection = g_socket_listener_accept_finish(_SELF(self), RVAL2GASYNCRESULT(result), &source_object, &error); if (connection == NULL) rbgio_raise_error(error); return rb_assoc_new(GOBJ2RVAL_UNREF(connection), GOBJ2RVAL(source_object)); } static VALUE rg_accept_socket(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GObject *source_object; GError *error = NULL; GSocket *socket; rb_scan_args(argc, argv, "01", &cancellable); socket = g_socket_listener_accept_socket(_SELF(self), &source_object, RVAL2GCANCELLABLE(cancellable), &error); if (socket == NULL) rbgio_raise_error(error); return rb_assoc_new(GOBJ2RVAL_UNREF(socket), GOBJ2RVAL(source_object)); } static VALUE rg_accept_socket_async(int argc, VALUE *argv, VALUE self) { VALUE rbcancellable, block; GCancellable *cancellable; rb_scan_args(argc, argv, "01&", &rbcancellable, &block); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_socket_listener_accept_socket_async(_SELF(self), cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_accept_socket_finish(VALUE self, VALUE result) { GObject *source_object; GError *error = NULL; GSocket *socket; socket = g_socket_listener_accept_socket_finish(_SELF(self), RVAL2GASYNCRESULT(result), &source_object, &error); if (socket == NULL) rbgio_raise_error(error); return rb_assoc_new(GOBJ2RVAL_UNREF(socket), GOBJ2RVAL(source_object)); } static VALUE rg_close(VALUE self) { g_socket_listener_close(_SELF(self)); return self; } static VALUE rg_set_backlog(VALUE self, VALUE listen_backlog) { g_socket_listener_set_backlog(_SELF(self), FIX2INT(listen_backlog)); return self; } void Init_gsocketlistener(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_LISTENER, "SocketListener", mGio); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(add_socket, -1); RG_DEF_METHOD(add_address, -1); RG_DEF_METHOD(add_inet_port, -1); RG_DEF_METHOD(add_any_inet_port, -1); RG_DEF_METHOD(accept, -1); RG_DEF_METHOD(accept_async, -1); RG_DEF_METHOD(accept_finish, 1); RG_DEF_METHOD(accept_socket, -1); RG_DEF_METHOD(accept_socket_async, -1); RG_DEF_METHOD(accept_socket_finish, 1); RG_DEF_METHOD(close, 0); RG_DEF_METHOD(set_backlog, 1); } ������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiocontenttype.c����������������������������������������������0000664�0001750�0001750�00000007624�11740310343�020656� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mContentType static VALUE rg_s_equals_p(G_GNUC_UNUSED VALUE self, VALUE arg1, VALUE arg2) { return CBOOL2RVAL(g_content_type_equals(RVAL2CSTR(arg1), RVAL2CSTR(arg2))); } static VALUE rg_s_is_a_p(G_GNUC_UNUSED VALUE self, VALUE arg1, VALUE arg2) { return CBOOL2RVAL(g_content_type_is_a(RVAL2CSTR(arg1), RVAL2CSTR(arg2))); } static VALUE rg_s_unknown_p(G_GNUC_UNUSED VALUE type) { return CBOOL2RVAL(g_content_type_is_unknown(RVAL2CSTR(type))); } static VALUE rg_s_get_description(G_GNUC_UNUSED VALUE type) { return CSTR2RVAL_FREE(g_content_type_get_description(RVAL2CSTR(type))); } static VALUE rg_s_get_mime_type(G_GNUC_UNUSED VALUE type) { return CSTR2RVAL_FREE(g_content_type_get_mime_type(RVAL2CSTR(type))); } static VALUE rg_s_get_icon(G_GNUC_UNUSED VALUE type) { return GOBJ2RVAL_UNREF(g_content_type_get_icon(RVAL2CSTR(type))); } static VALUE rg_s_can_be_executable_p(G_GNUC_UNUSED VALUE type) { return CBOOL2RVAL(g_content_type_can_be_executable(RVAL2CSTR(type))); } static VALUE rg_s_from_mime_type(G_GNUC_UNUSED VALUE type) { return CSTR2RVAL(g_content_type_from_mime_type(RVAL2CSTR(type))); } static VALUE rg_s_guess(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE rbfilename, rbdata; const char *filename; const guchar *data; gboolean result_uncertain; char *type; rb_scan_args(argc, argv, "02", &rbfilename, &rbdata); if (NIL_P(rbfilename) && NIL_P(rbdata)) rb_raise(rb_eArgError, "Either filename or data can be nil but not both"); filename = RVAL2CSTR_ACCEPT_NIL(rbfilename); data = (guchar *)RVAL2CSTR_ACCEPT_NIL(rbdata); type = g_content_type_guess(filename, data, (gsize)((data != NULL) ? RSTRING_LEN(rbdata) : 0), &result_uncertain); return rb_assoc_new(CSTR2RVAL_FREE(type), CBOOL2RVAL(result_uncertain)); } static VALUE rg_s_guess_for_tree(G_GNUC_UNUSED VALUE self, VALUE root) { return STRV2RVAL_FREE(g_content_type_guess_for_tree(RVAL2GFILE(root))); } static VALUE rg_s_registered(G_GNUC_UNUSED VALUE self) { return GLIST2ARY_STR_FREE(g_content_types_get_registered()); } void Init_gcontenttype(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "ContentType"); /* TODO: Should wrap this in a class. */ RG_DEF_SMETHOD_P(equals, 2); /* TODO: This name isn't great. */ RG_DEF_SMETHOD_P(is_a, 2); RG_DEF_SMETHOD_P(unknown, 1); RG_DEF_SMETHOD(get_description, 1); RG_DEF_SMETHOD(get_mime_type, 1); RG_DEF_SMETHOD(get_icon, 1); RG_DEF_SMETHOD_P(can_be_executable, 1); RG_DEF_SMETHOD(from_mime_type, 1); RG_DEF_SMETHOD(guess, -1); RG_DEF_SMETHOD(guess_for_tree, 1); RG_DEF_SMETHOD(registered, 0); } ������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioinetsocketaddress.c����������������������������������������0000644�0001750�0001750�00000002641�11701304107�022006� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cInetSocketAddress static VALUE rg_initialize(VALUE self, VALUE address, VALUE port) { G_INITIALIZE(self, g_inet_socket_address_new(RVAL2GINETADDRESS(address), RVAL2GUINT16(port))); return Qnil; } void Init_ginetsocketaddress(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_INET_SOCKET_ADDRESS, "InetSocketAddress", mGio); RG_DEF_METHOD(initialize, 2); } �����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiodrive.c����������������������������������������������������0000644�0001750�0001750�00000017030�11701304107�017377� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mDrive #define _SELF(value) RVAL2GDRIVE(value) static VALUE rg_name(VALUE self) { return CSTR2RVAL_FREE(g_drive_get_name(_SELF(self))); } static VALUE rg_icon(VALUE self) { return GOBJ2RVAL_UNREF(g_drive_get_icon(_SELF(self))); } static VALUE rg_has_volumes_p(VALUE self) { return CBOOL2RVAL(g_drive_has_volumes(_SELF(self))); } static VALUE rg_volumes(VALUE self) { return GLIST2ARY_FREE(g_drive_get_volumes(_SELF(self))); } static VALUE rg_can_eject_p(VALUE self) { return CBOOL2RVAL(g_drive_can_eject(_SELF(self))); } static VALUE rg_start_stop_type(VALUE self) { return GDRIVESTARTSTOPTYPE2RVAL(g_drive_get_start_stop_type(_SELF(self))); } static VALUE rg_can_start_p(VALUE self) { return CBOOL2RVAL(g_drive_can_start(_SELF(self))); } static VALUE rg_can_start_degraded_p(VALUE self) { return CBOOL2RVAL(g_drive_can_start_degraded(_SELF(self))); } static VALUE rg_can_stop_p(VALUE self) { return CBOOL2RVAL(g_drive_can_stop(_SELF(self))); } static VALUE rg_can_poll_for_media_p(VALUE self) { return CBOOL2RVAL(g_drive_can_poll_for_media(_SELF(self))); } static VALUE rg_poll_for_media(int argc, VALUE *argv, VALUE self) { VALUE rbcancellable, block; GCancellable *cancellable; rb_scan_args(argc, argv, "01&", &rbcancellable, &block); cancellable = RVAL2GCANCELLABLE(rbcancellable); g_drive_poll_for_media(_SELF(self), cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } typedef gboolean (*BooleanFinishMethod)(GDrive *, GAsyncResult *, GError **); static VALUE boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result) { GError *error = NULL; if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error)) rbgio_raise_error(error); return self; } static VALUE rg_poll_for_media_finish(VALUE self, VALUE result) { return boolean_finish_method(g_drive_poll_for_media_finish, self, result); } static VALUE rg_has_media_p(VALUE self) { return CBOOL2RVAL(g_drive_has_media(_SELF(self))); } static VALUE rg_media_check_automatic_p(VALUE self) { return CBOOL2RVAL(g_drive_is_media_check_automatic(_SELF(self))); } static VALUE rg_media_removable_p(VALUE self) { return CBOOL2RVAL(g_drive_is_media_removable(_SELF(self))); } typedef void (*EjectStopMethod)(GDrive *, GMountUnmountFlags, GMountOperation *, GCancellable *, GAsyncReadyCallback, gpointer); static VALUE eject_stop_method(EjectStopMethod method, int argc, VALUE *argv, VALUE self) { VALUE rbflags, rbmount_operation, rbcancellable, block; GMountUnmountFlags flags; GMountOperation *mount_operation; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbflags, &rbmount_operation, &rbcancellable, &block); flags = RVAL2GMOUNTUNMOUNTFLAGSDEFAULT(rbflags); mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); method(_SELF(self), flags, mount_operation, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_eject_with_operation(int argc, VALUE *argv, VALUE self) { return eject_stop_method(g_drive_eject_with_operation, argc, argv, self); } static VALUE rg_eject_with_operation_finish(VALUE self, VALUE result) { return boolean_finish_method(g_drive_eject_with_operation_finish, self, result); } static VALUE rg_start(int argc, VALUE *argv, VALUE self) { VALUE rbflags, rbmount_operation, rbcancellable, block; GDriveStartFlags flags; GMountOperation *mount_operation; GCancellable *cancellable; rb_scan_args(argc, argv, "03", &rbflags, &rbmount_operation, &rbcancellable, &block); flags = RVAL2GDRIVESTARTFLAGSDEFAULT(rbflags); mount_operation = RVAL2GMOUNTOPERATION(rbmount_operation); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_drive_start(_SELF(self), flags, mount_operation, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_start_finish(VALUE self, VALUE result) { return boolean_finish_method(g_drive_start_finish, self, result); } static VALUE rg_stop(int argc, VALUE *argv, VALUE self) { return eject_stop_method(g_drive_stop, argc, argv, self); } static VALUE rg_stop_finish(VALUE self, VALUE result) { return boolean_finish_method(g_drive_stop_finish, self, result); } static VALUE rg_enumerate_identifiers(VALUE self) { return STRV2RVAL_FREE(g_drive_enumerate_identifiers(_SELF(self))); } static VALUE rg_get_identifier(VALUE self, VALUE kind) { return CSTR2RVAL_FREE(g_drive_get_identifier(_SELF(self), RVAL2CSTR(kind))); } void Init_gdrive(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_DRIVE, "Drive", mGio); G_DEF_CLASS(G_TYPE_DRIVE_START_FLAGS, "StartFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_DRIVE_START_FLAGS, "G_DRIVE_"); G_DEF_CLASS(G_TYPE_DRIVE_START_STOP_TYPE, "StartStopType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_DRIVE_START_STOP_TYPE, "G_DRIVE_"); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(icon, 0); RG_DEF_METHOD_P(has_volumes, 0); RG_DEF_METHOD(volumes, 0); RG_DEF_METHOD_P(can_eject, 0); RG_DEF_METHOD(start_stop_type, 0); RG_DEF_METHOD_P(can_start, 0); RG_DEF_METHOD_P(can_start_degraded, 0); RG_DEF_METHOD_P(can_stop, 0); RG_DEF_METHOD_P(can_poll_for_media, 0); RG_DEF_METHOD(poll_for_media, -1); RG_DEF_METHOD(poll_for_media_finish, 1); RG_DEF_METHOD_P(has_media, 0); RG_DEF_METHOD_P(media_check_automatic, 0); RG_DEF_METHOD_P(media_removable, 0); RG_DEF_METHOD(eject_with_operation, -1); RG_DEF_METHOD(eject_with_operation_finish, 1); RG_DEF_METHOD(start, -1); RG_DEF_METHOD(start_finish, 1); RG_DEF_METHOD(stop, -1); RG_DEF_METHOD(stop_finish, 1); RG_DEF_METHOD(enumerate_identifiers, -1); RG_DEF_ALIAS("identifiers", "enumerate_identifiers"); RG_DEF_METHOD(get_identifier, 1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioinetaddress.c����������������������������������������������0000644�0001750�0001750�00000007424�11701304107�020601� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mInetAddress #define _SELF(value) RVAL2GINETADDRESS(value) static VALUE rg_s_new_from_string(G_GNUC_UNUSED VALUE self, VALUE string) { return GOBJ2RVAL_UNREF(g_inet_address_new_from_string(RVAL2CSTR(string))); } /* TODO: Should this take an array instead? */ static VALUE rg_s_new_from_bytes(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE rbbytes, rbfamily; guint8 *bytes; GSocketFamily family; rb_scan_args(argc, argv, "11", &rbbytes, &rbfamily); bytes = (guint8 *)RVAL2CSTR(rbbytes); family = RVAL2GSOCKETFAMILY(rbfamily); /* TODO: Should check encoding. */ /* TODO: We can't pass bytes as such, as it will be NULL-terminated. */ /* TODO: Do we need to deal with G_SOCKET_FAMILY_UNIX? */ switch (family) { case G_SOCKET_FAMILY_IPV4: if (RSTRING_LEN(rbbytes) != 4) rb_raise(rb_eArgError, "string containing 4 bytes expected"); break; case G_SOCKET_FAMILY_IPV6: if (RSTRING_LEN(rbbytes) != 16) rb_raise(rb_eArgError, "string containing 16 bytes expected"); break; case G_SOCKET_FAMILY_INVALID: case G_SOCKET_FAMILY_UNIX: rb_raise(rb_eArgError, "invalid family: %d", family); default: rb_raise(rb_eArgError, "unknown family: %d", family); break; } return GOBJ2RVAL_UNREF(g_inet_address_new_from_bytes(bytes, family)); } static VALUE rg_s_new_any(G_GNUC_UNUSED VALUE self, VALUE family) { return GOBJ2RVAL_UNREF(g_inet_address_new_any(RVAL2GSOCKETFAMILY(family))); } static VALUE rg_s_new_loopback(G_GNUC_UNUSED VALUE self, VALUE family) { return GOBJ2RVAL_UNREF(g_inet_address_new_loopback(RVAL2GSOCKETFAMILY(family))); } /* TODO: Return array of bytes instead? */ static VALUE rg_to_bytes(VALUE self) { gsize size; size = g_inet_address_get_native_size(_SELF(self)); return rb_str_new((const gchar *)g_inet_address_to_bytes(_SELF(self)), size); } static VALUE rg_get_native_size(VALUE self) { return GSIZE2RVAL(g_inet_address_get_native_size(_SELF(self))); } static VALUE rg_to_string(VALUE self) { return CSTR2RVAL_FREE(g_inet_address_to_string(_SELF(self))); } void Init_ginetaddress(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_INET_ADDRESS, "InetAddress", mGio); RG_DEF_SMETHOD(new_from_string, 1); RG_DEF_SMETHOD(new_from_bytes, -1); RG_DEF_SMETHOD(new_any, 1); RG_DEF_SMETHOD(new_loopback, 1); RG_DEF_METHOD(to_bytes, 0); RG_DEF_METHOD(get_native_size, 0); RG_DEF_METHOD(to_string, 0); RG_DEF_ALIAS("to_str", "to_string"); RG_DEF_ALIAS("to_s", "to_string"); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofileiostream.c���������������������������������������������0000644�0001750�0001750�00000006454�11701304107�020761� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFileIOStream #define _SELF(value) RVAL2GFILEIOSTREAM(value) static VALUE rg_etag(VALUE self) { return CSTR2RVAL(g_file_io_stream_get_etag(_SELF(self))); } static VALUE rg_query_info(int argc, VALUE *argv, VALUE self) { VALUE attributes, cancellable; GError *error = NULL; GFileInfo *info; rb_scan_args(argc, argv, "02", &attributes, &cancellable); info = g_file_io_stream_query_info(_SELF(self), RVAL2ATTRIBUTESDEFAULT(attributes), RVAL2GCANCELLABLE(cancellable), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_query_info_async(int argc, VALUE *argv, VALUE self) { VALUE rbattributes, rbio_priority, rbcancellable, block; const char *attributes; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "03&", &rbattributes, &rbio_priority, &rbcancellable, &block); attributes = RVAL2ATTRIBUTESDEFAULT(rbattributes); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_file_io_stream_query_info_async(_SELF(self), attributes, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_query_info_finish(VALUE self, VALUE result) { GError *error = NULL; GFileInfo *info; info = g_file_io_stream_query_info_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } void Init_gfileiostream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_IO_STREAM, "FileIOStream", mGio); RG_DEF_METHOD(etag, 0); RG_DEF_METHOD(query_info, -1); RG_DEF_METHOD(query_info_async, -1); RG_DEF_METHOD(query_info_finish, 1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiodataoutputstream.c�����������������������������������������0000644�0001750�0001750�00000013732�11701304107�021701� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cDataOutputStream #define _SELF(value) RVAL2GDATAOUTPUTSTREAM(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE base_stream, byte_order; rb_scan_args(argc, argv, "11", &base_stream, &byte_order); G_INITIALIZE(self, g_data_output_stream_new(RVAL2GOUTPUTSTREAM(base_stream))); if (!NIL_P(byte_order)) g_data_output_stream_set_byte_order(_SELF(self), RVAL2GDATASTREAMBYTEORDER(byte_order)); return Qnil; } static VALUE rg_put_byte(int argc, VALUE *argv, VALUE self) { VALUE value, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &value, &cancellable); if (!g_data_output_stream_put_byte(_SELF(self), RVAL2GUCHAR(value), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_put_int16(int argc, VALUE *argv, VALUE self) { VALUE value, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &value, &cancellable); if (!g_data_output_stream_put_int16(_SELF(self), RVAL2GINT16(value), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_put_uint16(int argc, VALUE *argv, VALUE self) { VALUE value, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &value, &cancellable); if (!g_data_output_stream_put_uint16(_SELF(self), RVAL2GUINT16(value), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_put_int32(int argc, VALUE *argv, VALUE self) { VALUE value, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &value, &cancellable); if (!g_data_output_stream_put_int32(_SELF(self), RVAL2GINT32(value), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_put_uint32(int argc, VALUE *argv, VALUE self) { VALUE value, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &value, &cancellable); if (!g_data_output_stream_put_uint32(_SELF(self), RVAL2GINT32(value), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_put_int64(int argc, VALUE *argv, VALUE self) { VALUE value, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &value, &cancellable); if (!g_data_output_stream_put_int64(_SELF(self), RVAL2GINT64(value), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_put_uint64(int argc, VALUE *argv, VALUE self) { VALUE value, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &value, &cancellable); if (!g_data_output_stream_put_uint64(_SELF(self), RVAL2GUINT64(value), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_put_string(int argc, VALUE *argv, VALUE self) { VALUE value, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &value, &cancellable); if (!g_data_output_stream_put_string(_SELF(self), RVAL2CSTR(value), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } void Init_gdataoutputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_DATA_OUTPUT_STREAM, "DataOutputStream", mGio); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(put_byte, -1); RG_DEF_METHOD(put_int16, -1); RG_DEF_METHOD(put_uint16, -1); RG_DEF_METHOD(put_int32, -1); RG_DEF_METHOD(put_uint32, -1); RG_DEF_METHOD(put_int64, -1); RG_DEF_METHOD(put_uint64, -1); RG_DEF_METHOD(put_string, -1); } ��������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioemblem.c���������������������������������������������������0000644�0001750�0001750�00000003320�11701304107�017524� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cEmblem static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE rbicon, origin; GIcon *icon; GEmblem *emblem; rb_scan_args(argc, argv, "11", &rbicon, &origin); icon = RVAL2GICON(rbicon); emblem = NIL_P(origin) ? g_emblem_new(icon) : g_emblem_new_with_origin(icon, RVAL2GEMBLEMORIGIN(origin)); G_INITIALIZE(self, emblem); return Qnil; } void Init_gemblem(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_EMBLEM, "Emblem", mGio); G_DEF_CLASS(G_TYPE_EMBLEM_ORIGIN, "Origin", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_EMBLEM_ORIGIN, "G_EMBLEM_"); RG_DEF_METHOD(initialize, -1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioio.c�������������������������������������������������������0000644�0001750�0001750�00000011544�11701304107�016701� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mIO /* NOTE: g_io_error_from_errno doesn't make sense from Ruby. */ void Init_gioerror(VALUE mGio) { VALUE RG_TARGET_NAMESPACE, error; RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "IO"); error = rbgio_define_domain_error(RG_TARGET_NAMESPACE, "Error", G_IO_ERROR, "GIOErrorEnum", rb_eIOError); rbgio_define_error(RG_TARGET_NAMESPACE, "FailedError", G_IO_ERROR_FAILED, error); rbgio_define_error(RG_TARGET_NAMESPACE, "NotFoundError", G_IO_ERROR_NOT_FOUND, error); rbgio_define_error(RG_TARGET_NAMESPACE, "ExistsError", G_IO_ERROR_EXISTS, error); rbgio_define_error(RG_TARGET_NAMESPACE, "IsDirectoryError", G_IO_ERROR_IS_DIRECTORY, error); rbgio_define_error(RG_TARGET_NAMESPACE, "NotDirectoryError", G_IO_ERROR_NOT_DIRECTORY, error); rbgio_define_error(RG_TARGET_NAMESPACE, "NotEmptyError", G_IO_ERROR_NOT_EMPTY, error); rbgio_define_error(RG_TARGET_NAMESPACE, "NotRegularFileError", G_IO_ERROR_NOT_REGULAR_FILE, error); rbgio_define_error(RG_TARGET_NAMESPACE, "NotSymbolicLinkError", G_IO_ERROR_NOT_SYMBOLIC_LINK, error); rbgio_define_error(RG_TARGET_NAMESPACE, "NotMountableFileError", G_IO_ERROR_NOT_MOUNTABLE_FILE, error); rbgio_define_error(RG_TARGET_NAMESPACE, "FilenameTooLongError", G_IO_ERROR_FILENAME_TOO_LONG, error); rbgio_define_error(RG_TARGET_NAMESPACE, "InvalidFilenameError", G_IO_ERROR_INVALID_FILENAME, error); rbgio_define_error(RG_TARGET_NAMESPACE, "TooManyLinksError", G_IO_ERROR_TOO_MANY_LINKS, error); rbgio_define_error(RG_TARGET_NAMESPACE, "NoSpaceError", G_IO_ERROR_NO_SPACE, error); rbgio_define_error(RG_TARGET_NAMESPACE, "InvalidArgumentError", G_IO_ERROR_INVALID_ARGUMENT, error); rbgio_define_error(RG_TARGET_NAMESPACE, "PermissionDeniedError", G_IO_ERROR_PERMISSION_DENIED, error); rbgio_define_error(RG_TARGET_NAMESPACE, "NotSupportedError", G_IO_ERROR_NOT_SUPPORTED, error); rbgio_define_error(RG_TARGET_NAMESPACE, "NotMountedError", G_IO_ERROR_NOT_MOUNTED, error); rbgio_define_error(RG_TARGET_NAMESPACE, "AlreadyMountedError", G_IO_ERROR_ALREADY_MOUNTED, error); rbgio_define_error(RG_TARGET_NAMESPACE, "ClosedError", G_IO_ERROR_CLOSED, error); rbgio_define_error(RG_TARGET_NAMESPACE, "CancelledError", G_IO_ERROR_CANCELLED, error); rbgio_define_error(RG_TARGET_NAMESPACE, "PendingError", G_IO_ERROR_PENDING, error); rbgio_define_error(RG_TARGET_NAMESPACE, "ReadOnlyError", G_IO_ERROR_READ_ONLY, error); rbgio_define_error(RG_TARGET_NAMESPACE, "CantCreateBackupError", G_IO_ERROR_CANT_CREATE_BACKUP, error); rbgio_define_error(RG_TARGET_NAMESPACE, "WrongEtagError", G_IO_ERROR_WRONG_ETAG, error); rbgio_define_error(RG_TARGET_NAMESPACE, "TimedOutError", G_IO_ERROR_TIMED_OUT, error); rbgio_define_error(RG_TARGET_NAMESPACE, "WouldRecurseError", G_IO_ERROR_WOULD_RECURSE, error); rbgio_define_error(RG_TARGET_NAMESPACE, "BusyError", G_IO_ERROR_BUSY, error); rbgio_define_error(RG_TARGET_NAMESPACE, "WouldBlockError", G_IO_ERROR_WOULD_BLOCK, error); rbgio_define_error(RG_TARGET_NAMESPACE, "HostNotFoundError", G_IO_ERROR_HOST_NOT_FOUND, error); rbgio_define_error(RG_TARGET_NAMESPACE, "WouldMergeError", G_IO_ERROR_WOULD_MERGE, error); rbgio_define_error(RG_TARGET_NAMESPACE, "FailedHandledError", G_IO_ERROR_FAILED_HANDLED, error); rbgio_define_error(RG_TARGET_NAMESPACE, "TooManyOpenFilesError", G_IO_ERROR_TOO_MANY_OPEN_FILES, error); rbgio_define_error(RG_TARGET_NAMESPACE, "NotInitializedError", G_IO_ERROR_NOT_INITIALIZED, error); rbgio_define_error(RG_TARGET_NAMESPACE, "AddressInUseError", G_IO_ERROR_ADDRESS_IN_USE, error); rbgio_define_error(RG_TARGET_NAMESPACE, "PartialInputError", G_IO_ERROR_PARTIAL_INPUT, error); rbgio_define_error(RG_TARGET_NAMESPACE, "InvalidDataError", G_IO_ERROR_INVALID_DATA, error); } ������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosocketconnectionfactory.c����������������������������������0000664�0001750�0001750�00000002647�11740310343�023242� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mSocketConnectionFactory static VALUE rg_s_create_connection(G_GNUC_UNUSED VALUE self, VALUE socket) { return GOBJ2RVAL_UNREF(g_socket_connection_factory_create_connection(RVAL2GSOCKET(socket))); } void Init_gsocketconnectionfactory(VALUE mGio) { /* TODO: Perhaps just move this to SocketConnection? */ VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mGio, "SocketConnectionFactory"); RG_DEF_SMETHOD(create_connection, 1); } �����������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiotcpconnection.c��������������������������������������������0000644�0001750�0001750�00000002056�11701304107�021136� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" void Init_gtcpconnection(VALUE mGio) { (void)G_DEF_CLASS(G_TYPE_TCP_CONNECTION, "TcpConnection", mGio); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioconverterinputstream.c�������������������������������������0000644�0001750�0001750�00000003016�11701304107�022570� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cConverterInputStream #define _SELF(value) RVAL2GCONVERTERINPUTSTREAM(value) static VALUE rg_initialize(VALUE self, VALUE base_stream, VALUE converter) { G_INITIALIZE(self, g_converter_input_stream_new(RVAL2GINPUTSTREAM(base_stream), RVAL2GCONVERTER(converter))); return Qnil; } void Init_gconverterinputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_CONVERTER_INPUT_STREAM, "ConverterInputStream", mGio); RG_DEF_METHOD(initialize, 2); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/util.c����������������������������������������������������������0000644�0001750�0001750�00000017220�11701304107�016221� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifndef HAVE_RB_ERRINFO # define rb_errinfo() (ruby_errinfo) #endif static ID s_id_enum_name; static ID s_id_errors; static VALUE s_errors; VALUE rbgio_cstr_to_rval_tainted(const char *string, gsize length) { VALUE result; if (string == NULL) return Qnil; result = rb_str_new(string, length); OBJ_TAINT(result); return result; } struct rbgio_cstr_to_rval_tainted_free_data { char *string; gsize length; }; static VALUE rbgio_cstr_to_rval_tainted_free_body(VALUE data) { struct rbgio_cstr_to_rval_tainted_free_data *real; real = (struct rbgio_cstr_to_rval_tainted_free_data *)data; return rbgio_cstr_to_rval_tainted(real->string, real->length); } static VALUE rbgio_cstr_to_rval_tainted_free_ensure(VALUE data) { g_free(((struct rbgio_cstr_to_rval_tainted_free_data *)data)->string); return Qnil; } VALUE rbgio_cstr_to_rval_tainted_free(char *string, gsize length) { struct rbgio_cstr_to_rval_tainted_free_data data = { string, length }; return rb_ensure(rbgio_cstr_to_rval_tainted_free_body, (VALUE)&data, rbgio_cstr_to_rval_tainted_free_ensure, (VALUE)&data); } VALUE rbgio_glist_to_ary_unref_free(GList *list) { VALUE ary; GList *i; ary = rb_ary_new(); for (i = list; i != NULL; i = i->next) rb_ary_push(ary, GOBJ2RVAL_UNREF(i->data)); g_list_free(list); return ary; } VALUE rbgio_fds_to_ary(const gint *fds) { int i, n; VALUE ary; for (i = n = 0; fds[i] != -1; i++) n++; ary = rb_ary_new2(n); for (i = 0; i < n; i++) RARRAY_PTR(ary)[i] = FD2RVAL(fds[i]); return ary; } static VALUE rbgio_fds_to_ary_free_ensure(gint *fds) { g_free(fds); return Qnil; } VALUE rbgio_fds_to_ary_free(gint *fds) { return rb_ensure(rbgio_fds_to_ary, (VALUE)fds, rbgio_fds_to_ary_free_ensure, (VALUE)fds); } struct rbgio_gfile_ary_to_glist_args { VALUE ary; long n; GList *result; }; static VALUE rbgio_gfile_ary_to_glist_body(VALUE value) { long i; struct rbgio_gfile_ary_to_glist_args *args = (struct rbgio_gfile_ary_to_glist_args *)value; for (i = 0; i < args->n; i++) args->result = g_list_append(args->result, RVAL2GFILE(RARRAY_PTR(args->ary)[i])); return Qnil; } static G_GNUC_NORETURN VALUE rbgio_gfile_ary_to_glist_rescue(VALUE value) { g_list_free(((struct rbgio_gfile_ary_to_glist_args *)value)->result); rb_exc_raise(rb_errinfo()); } GList * rbgio_gfile_ary_to_glist(VALUE value) { struct rbgio_gfile_ary_to_glist_args args; args.ary = rb_ary_to_ary(value); args.n = RARRAY_LEN(args.ary); args.result = NULL; rb_rescue(rbgio_gfile_ary_to_glist_body, (VALUE)&args, rbgio_gfile_ary_to_glist_rescue, (VALUE)&args); return args.result; } GList * rbgio_gfile_ary_to_glist_accept_nil(VALUE ary) { if (NIL_P(ary)) return NULL; return rbgio_gfile_ary_to_glist(ary); } void rbgio_rval_to_gtimeval(VALUE value, GTimeVal *time) { if (rb_respond_to(value, rb_intern("tv_sec"))) { time->tv_sec = RVAL2GLONG(rb_funcall(value, rb_intern("tv_sec"), 0)); time->tv_usec = rb_respond_to(value, rb_intern("tv_usec")) ? RVAL2GLONG(rb_funcall(value, rb_intern("tv_usec"), 0)) : 0; } else if (rb_respond_to(value, rb_intern("to_ary"))) { VALUE ary = rb_ary_to_ary(value); if (RARRAY_LEN(ary) < 1 || RARRAY_LEN(ary) > 2) rb_raise(rb_eArgError, "Array of length 1 or 2 expected"); time->tv_sec = RVAL2GLONG(RARRAY_PTR(ary)[0]); time->tv_usec = RARRAY_LEN(ary) > 1 ? RVAL2GLONG(RARRAY_PTR(ary)[1]) : 0; } else { time->tv_sec = RVAL2GLONG(value); time->tv_usec = 0; } } struct async_ready_callback_data { GAsyncResult *result; gpointer data; }; static VALUE rbgio_async_ready_callback_call(VALUE data) { static VALUE s_id_call; struct async_ready_callback_data *real; VALUE block; if (s_id_call == 0) s_id_call = rb_intern("call"); real = (struct async_ready_callback_data *)data; block = USE_BLOCK(real->data); if (!NIL_P(block)) rb_funcall(block, s_id_call, 1, GOBJ2RVAL_UNREF(real->result)); return Qnil; } void rbgio_async_ready_callback(G_GNUC_UNUSED GObject *source, GAsyncResult *result, gpointer data) { struct async_ready_callback_data real = { result, data }; G_PROTECT_CALLBACK(rbgio_async_ready_callback_call, &real); } VALUE rbgio_child_remove_and_return(VALUE parent, VALUE child) { G_CHILD_REMOVE(parent, child); return child; } VALUE rbgio_define_domain_error(VALUE module, const char *name, GQuark domain, const char *enum_name, VALUE parent) { VALUE error; error = rb_define_class_under(module, name, parent); rb_ivar_set(error, s_id_enum_name, CSTR2RVAL(enum_name)); rb_ivar_set(error, s_id_errors, rb_hash_new()); rb_hash_aset(s_errors, UINT2NUM(domain), error); return error; } VALUE rbgio_define_error(VALUE module, const char *name, gint code, VALUE domain_error) { VALUE error; error = rb_define_class_under(module, name, domain_error); rb_hash_aset(rb_ivar_get(domain_error, s_id_errors), INT2NUM(code), error); return error; } void rbgio_raise_error(GError *error) { VALUE domain_error, rberror; domain_error = rb_hash_aref(s_errors, UINT2NUM(error->domain)); if (NIL_P(domain_error)) RAISE_GERROR(error); rberror = rb_hash_aref(rb_ivar_get(domain_error, s_id_errors), INT2NUM(error->code)); if (NIL_P(rberror)) { VALUE enum_name = rb_ivar_get(domain_error, s_id_enum_name); rb_raise(rb_eNotImpError, "%s contains error codes that have not been implemented: %d", RVAL2CSTR(enum_name), error->code); } rb_raise(rberror, "%s", error->message); } void Init_util(void) { s_id_enum_name = rb_intern("@enum_name"); s_id_errors = rb_intern("@errors"); s_errors = rb_hash_new(); rb_global_variable(&s_errors); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixmountmonitor.c�����������������������������������������0000664�0001750�0001750�00000003725�11740310343�021756� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixmounts.h> #define RG_TARGET_NAMESPACE cUnixMountMonitor #define _SELF(value) RVAL2GUNIXMOUNTMONITOR(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE limit_msec; GUnixMountMonitor *monitor; rb_scan_args(argc, argv, "01", &limit_msec); monitor = g_unix_mount_monitor_new(); if (!NIL_P(limit_msec)) g_unix_mount_monitor_set_rate_limit(monitor, FIX2INT(limit_msec)); G_INITIALIZE(self, monitor); return Qnil; } static VALUE rg_set_rate_limit(VALUE self, VALUE limit_msec) { g_unix_mount_monitor_set_rate_limit(_SELF(self), FIX2INT(limit_msec)); return self; } #endif void Init_gunixmountmonitor(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_MOUNT_MONITOR, "UnixMountMonitor", mGio); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(set_rate_limit, 1); #endif } �������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixoutputstream.c�����������������������������������������0000644�0001750�0001750�00000003175�11701304107�021753� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixoutputstream.h> #define RG_TARGET_NAMESPACE cUnixOutputStream #define _SELF(value) RVAL2GUNIXOUTPUTSTREAM(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE fd, close_fd; rb_scan_args(argc, argv, "11", &fd, &close_fd); G_INITIALIZE(self, g_unix_output_stream_new(RVAL2FD(fd), RVAL2CBOOL(close_fd))); return Qnil; } #endif void Init_gunixoutputstream(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_OUTPUT_STREAM, "UnixOutputStream", mGio); RG_DEF_METHOD(initialize, -1); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosocket.c���������������������������������������������������0000644�0001750�0001750�00000026524�12056655563�017611� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2012 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cSocket #define _SELF(value) RVAL2GSOCKET(value) static ID id_call; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE family, type, protocol; GError *error = NULL; GSocket *socket; rb_scan_args(argc, argv, "21", &family, &type, &protocol); socket = g_socket_new(RVAL2GSOCKETFAMILY(family), RVAL2GSOCKETTYPE(type), RVAL2GSOCKETPROTOCOLDEFAULT(protocol), &error); if (socket == NULL) rbgio_raise_error(error); G_INITIALIZE(self, socket); return Qnil; } static VALUE rg_s_new_from_fd(G_GNUC_UNUSED VALUE self, VALUE id) { GError *error = NULL; GSocket *socket; socket = g_socket_new_from_fd(RVAL2FD(id), &error); if (socket == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(socket); } static VALUE rg_bind(VALUE self, VALUE address, VALUE allow_reuse) { GError *error = NULL; if (!g_socket_bind(_SELF(self), RVAL2GSOCKETADDRESS(address), RVAL2CBOOL(allow_reuse), &error)) rbgio_raise_error(error); return self; } static VALUE rg_listen(VALUE self) { GError *error = NULL; if (!g_socket_listen(_SELF(self), &error)) rbgio_raise_error(error); return self; } static VALUE rg_accept(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; GSocket *socket; rb_scan_args(argc, argv, "01", &cancellable); socket = g_socket_accept(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (socket == NULL) rbgio_raise_error(error); return self; } static VALUE rg_connect(int argc, VALUE *argv, VALUE self) { VALUE address, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &address, &cancellable); if (!g_socket_connect(_SELF(self), RVAL2GSOCKETADDRESS(address), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } /* TODO: This makes very little sense in Ruby. How do we deal with it? */ static VALUE rg_check_connect_result(VALUE self) { GError *error = NULL; if (!g_socket_check_connect_result(_SELF(self), &error)) rbgio_raise_error(error); return self; } static VALUE rg_receive(int argc, VALUE *argv, VALUE self) { VALUE rbbytes, cancellable, result; GError *error = NULL; gsize bytes; gssize read; rb_scan_args(argc, argv, "11", &rbbytes, &cancellable); bytes = RVAL2GSIZE(rbbytes); result = rb_str_new(NULL, bytes); read = g_socket_receive(_SELF(self), RSTRING_PTR(result), bytes, RVAL2GCANCELLABLE(cancellable), &error); if (read == -1) rbgio_raise_error(error); /* TODO: This is what Ruby does, but I can't figure out why one needs * both. */ rb_str_set_len(result, read); rb_str_resize(result, read); OBJ_TAINT(result); return result; } static VALUE rg_receive_from(int argc, VALUE *argv, VALUE self) { VALUE rbbytes, cancellable, result; GSocketAddress *address; GError *error = NULL; gsize bytes; gssize read; rb_scan_args(argc, argv, "11", &rbbytes, &cancellable); bytes = RVAL2GSIZE(rbbytes); result = rb_str_new(NULL, bytes); read = g_socket_receive_from(_SELF(self), &address, RSTRING_PTR(result), bytes, RVAL2GCANCELLABLE(cancellable), &error); if (read == -1) rbgio_raise_error(error); rb_str_set_len(result, read); rb_str_resize(result, read); OBJ_TAINT(result); return rb_assoc_new(GOBJ2RVAL_UNREF(address), result); } static VALUE rg_send(int argc, VALUE *argv, VALUE self) { VALUE buffer, cancellable; GError *error = NULL; gssize sent; rb_scan_args(argc, argv, "11", &buffer, &cancellable); StringValue(buffer); sent = g_socket_send(_SELF(self), RSTRING_PTR(buffer), RSTRING_LEN(buffer), RVAL2GCANCELLABLE(cancellable), &error); if (sent == -1) rbgio_raise_error(error); return GSSIZE2RVAL(sent); } static VALUE rg_send_to(int argc, VALUE *argv, VALUE self) { VALUE address, buffer, cancellable; GError *error = NULL; gssize sent; rb_scan_args(argc, argv, "11", &address, &buffer, &cancellable); StringValue(buffer); sent = g_socket_send_to(_SELF(self), RVAL2GSOCKETADDRESS(address), RSTRING_PTR(buffer), RSTRING_LEN(buffer), RVAL2GCANCELLABLE(cancellable), &error); if (sent == -1) rbgio_raise_error(error); return GSSIZE2RVAL(sent); } static VALUE rg_close(VALUE self) { GError *error = NULL; if (!g_socket_close(_SELF(self), &error)) rbgio_raise_error(error); return self; } static VALUE rg_closed_p(VALUE self) { return CBOOL2RVAL(g_socket_is_closed(_SELF(self))); } static VALUE rg_shutdown(VALUE self, VALUE shutdown_read, VALUE shutdown_write) { GError *error = NULL; if (!g_socket_shutdown(_SELF(self), RVAL2CBOOL(shutdown_read), RVAL2CBOOL(shutdown_write), &error)) rbgio_raise_error(error); return self; } static VALUE rg_connected_p(VALUE self) { return (g_socket_is_connected(_SELF(self))); } static gboolean source_func(GSocket *socket, GIOCondition condition, gpointer user_data) { VALUE callback = (VALUE)user_data; return RVAL2CBOOL(rb_funcall(callback, id_call, 2, GOBJ2RVAL(socket), GIOCONDITION2RVAL(condition))); } static VALUE rg_create_source(int argc, VALUE *argv, VALUE self) { VALUE condition, cancellable, callback; GSource *source; rb_scan_args(argc, argv, "11&", &condition, &cancellable, &callback); source = g_socket_create_source(_SELF(self), RVAL2GIOCONDITION(condition), RVAL2GCANCELLABLE(cancellable)); G_RELATIVE(self, callback); g_source_set_callback(source, (GSourceFunc)source_func, (gpointer)callback, NULL); return GSOURCE2RVAL(source); } static VALUE rg_condition_check(VALUE self, VALUE condition) { return GIOCONDITION2RVAL(g_socket_condition_check(_SELF(self), RVAL2GIOCONDITION(condition))); } static VALUE rg_condition_wait(int argc, VALUE *argv, VALUE self) { VALUE condition, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &condition, &cancellable); if (!g_socket_condition_wait(_SELF(self), RVAL2GIOCONDITION(condition), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE socket_get_local_address(VALUE self) { GError *error = NULL; GSocketAddress *address; address = g_socket_get_local_address(_SELF(self), &error); if (address == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(address); } static VALUE socket_get_remote_address(VALUE self) { GError *error = NULL; GSocketAddress *address; address = g_socket_get_remote_address(_SELF(self), &error); if (address == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(address); } static VALUE rg_speaks_ipv4_p(VALUE self) { return CBOOL2RVAL(g_socket_speaks_ipv4(_SELF(self))); } void Init_gsocket(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET, "Socket", mGio); id_call = rb_intern("call"); G_DEF_CLASS(G_TYPE_SOCKET_FAMILY, "Family", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_SOCKET_FAMILY, "G_SOCKET_"); G_DEF_CLASS(G_TYPE_SOCKET_TYPE, "Type", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_SOCKET_TYPE, "G_SOCKET_"); G_DEF_CLASS(G_TYPE_SOCKET_PROTOCOL, "Protocol", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_SOCKET_PROTOCOL, "G_SOCKET_"); G_DEF_CLASS(G_TYPE_SOCKET_MSG_FLAGS, "MsgFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_SOCKET_MSG_FLAGS, "G_SOCKET_"); RG_DEF_SMETHOD(new_from_fd, 1); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(bind, 2); RG_DEF_METHOD(listen, 0); RG_DEF_METHOD(accept, -1); RG_DEF_METHOD(connect, -1); RG_DEF_METHOD(check_connect_result, 0); RG_DEF_METHOD(receive, -1); RG_DEF_METHOD(receive_from, -1); RG_DEF_METHOD(send, -1); RG_DEF_METHOD(send_to, -1); RG_DEF_METHOD(close, 0); RG_DEF_METHOD_P(closed, 0); RG_DEF_METHOD(shutdown, 2); RG_DEF_METHOD_P(connected, 0); RG_DEF_METHOD(create_source, -1); RG_DEF_METHOD(condition_check, 1); RG_DEF_METHOD(condition_wait, -1); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "local_address", socket_get_local_address, 0); G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "remote_address", socket_get_remote_address, 0); RG_DEF_METHOD_P(speaks_ipv4, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiozlibcompressor.c�������������������������������������������0000644�0001750�0001750�00000003530�11701304107�021343� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cZlibCompressor #define _SELF(value) RVAL2GZLIBCOMPRESSOR(value) #define RVAL2ZLIBCOMPRESSORLEVELDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), FIX2INT, -1) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE format, level; rb_scan_args(argc, argv, "02", &format, &level); G_INITIALIZE(self, g_zlib_compressor_new(RVAL2GZLIBCOMPRESSORFORMATDEFAULT(format), RVAL2GZLIBCOMPRESSORFORMATDEFAULT(level))); return Qnil; } void Init_gzlibcompressor(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_ZLIB_COMPRESSOR, "ZlibCompressor", mGio); G_DEF_CLASS(G_TYPE_ZLIB_COMPRESSOR_FORMAT, "Format", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_ZLIB_COMPRESSOR_FORMAT, "G_ZLIB_"); RG_DEF_METHOD(initialize, -1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixmount.c������������������������������������������������0000644�0001750�0001750�00000010615�11701304107�020336� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixmounts.h> #define RG_TARGET_NAMESPACE cUnixMount static GUnixMountEntry * unixmount_copy(const GUnixMountEntry *mount) { return (GUnixMountEntry *)mount; } static GType g_unix_mount_entry_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static("GUnixMountEntry", (GBoxedCopyFunc)unixmount_copy, (GBoxedFreeFunc)g_unix_mount_free); return our_type; } #define G_TYPE_UNIX_MOUNT_ENTRY (g_unix_mount_entry_get_type()) #define _SELF(value) \ ((GUnixMountEntry *)(RVAL2BOXED((value), G_TYPE_UNIX_MOUNT_ENTRY))) #define GUNIXMOUNTENTRY2RVAL(value) BOXED2RVAL((value), G_TYPE_UNIX_MOUNT_ENTRY) static VALUE rg_compare(VALUE self, VALUE other) { return INT2FIX(g_unix_mount_compare(_SELF(self), _SELF(other))); } static VALUE rg_mount_path(VALUE self) { return CSTR2RVAL(g_unix_mount_get_mount_path(_SELF(self))); } static VALUE rg_device_path(VALUE self) { return CSTR2RVAL(g_unix_mount_get_device_path(_SELF(self))); } static VALUE rg_fs_type(VALUE self) { return CSTR2RVAL(g_unix_mount_get_fs_type(_SELF(self))); } static VALUE rg_readonly_p(VALUE self) { return CBOOL2RVAL(g_unix_mount_is_readonly(_SELF(self))); } static VALUE rg_system_internal_p(VALUE self) { return CBOOL2RVAL(g_unix_mount_is_system_internal(_SELF(self))); } static VALUE rg_guess_icon(VALUE self) { return GOBJ2RVAL_UNREF(g_unix_mount_guess_icon(_SELF(self))); } static VALUE rg_guess_name(VALUE self) { return CSTR2RVAL_FREE(g_unix_mount_guess_name(_SELF(self))); } static VALUE rg_guess_can_eject_p(VALUE self) { return CBOOL2RVAL(g_unix_mount_guess_can_eject(_SELF(self))); } static VALUE rg_guess_should_display_p(VALUE self) { return CBOOL2RVAL(g_unix_mount_guess_should_display(_SELF(self))); } static VALUE rg_s_at(G_GNUC_UNUSED VALUE self, VALUE mount_path) { guint64 time_read; GUnixMountEntry *mount; mount = g_unix_mount_at(RVAL2CSTR(mount_path), &time_read); return rb_assoc_new(GUNIXMOUNTENTRY2RVAL(mount), GUINT642RVAL(time_read)); } static VALUE rg_s_mount_path_system_internal_p(G_GNUC_UNUSED VALUE self, VALUE mount_path) { return CBOOL2RVAL(g_unix_is_mount_path_system_internal(RVAL2CSTR(mount_path))); } #endif void Init_gunixmount(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_MOUNT_ENTRY, "UnixMount", mGio); rb_include_module(RG_TARGET_NAMESPACE, rb_mComparable); /* TODO: This doesn't follow the naming conventions, but it seems * overkill to have GLib::Unix just for mount_path_system_internal?. */ RG_DEF_SMETHOD_P(mount_path_system_internal, 1); RG_DEF_SMETHOD(at, 1); rbgobj_boxed_not_copy_obj(G_TYPE_UNIX_MOUNT_ENTRY); RG_DEF_METHOD(compare, 1); RG_DEF_ALIAS("<=>", "compare"); RG_DEF_METHOD(mount_path, 0); RG_DEF_METHOD(device_path, 0); RG_DEF_METHOD(fs_type, 0); RG_DEF_METHOD_P(readonly, 0); RG_DEF_METHOD_P(system_internal, 0); RG_DEF_METHOD(guess_icon, 0); RG_DEF_METHOD(guess_name, 0); RG_DEF_METHOD_P(guess_can_eject, 0); RG_DEF_METHOD_P(guess_should_display, 0); #endif } �������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgio.c���������������������������������������������������������0000644�0001750�0001750�00000012726�12017142000�016345� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mGio static VALUE rg_s_has_unix_p(G_GNUC_UNUSED VALUE self) { #ifdef HAVE_GIO_UNIX return Qtrue; #else return Qfalse; #endif } void Init_gio(void) { VALUE RG_TARGET_NAMESPACE = rb_define_module("Gio"); G_DEF_CLASS(G_TYPE_FILESYSTEM_PREVIEW_TYPE, "FilesystemPreviewType", RG_TARGET_NAMESPACE); G_DEF_CLASS(G_TYPE_DATA_STREAM_BYTE_ORDER, "DataStreamByteOrder", RG_TARGET_NAMESPACE); G_DEF_CLASS(G_TYPE_DATA_STREAM_NEWLINE_TYPE, "DataStreamNewlineType", RG_TARGET_NAMESPACE); G_DEF_CLASS(G_TYPE_ASK_PASSWORD_FLAGS, "AskPasswordFlags", RG_TARGET_NAMESPACE); G_DEF_CLASS(G_TYPE_PASSWORD_SAVE, "PasswordSave", RG_TARGET_NAMESPACE); RG_DEF_SMETHOD_P(has_unix, 0); Init_gappinfo(RG_TARGET_NAMESPACE); Init_gapplaunchcontext(RG_TARGET_NAMESPACE); Init_gasyncinitable(RG_TARGET_NAMESPACE); Init_gasyncresult(RG_TARGET_NAMESPACE); Init_gbufferedinputstream(RG_TARGET_NAMESPACE); Init_gbufferedoutputstream(RG_TARGET_NAMESPACE); Init_gcancellable(RG_TARGET_NAMESPACE); Init_gcharsetconverter(RG_TARGET_NAMESPACE); Init_gcontenttype(RG_TARGET_NAMESPACE); Init_gconverter(RG_TARGET_NAMESPACE); Init_gconverterinputstream(RG_TARGET_NAMESPACE); Init_gconverteroutputstream(RG_TARGET_NAMESPACE); Init_gdatainputstream(RG_TARGET_NAMESPACE); Init_gdesktopappinfo(RG_TARGET_NAMESPACE); Init_gdataoutputstream(RG_TARGET_NAMESPACE); Init_gdrive(RG_TARGET_NAMESPACE); Init_gemblem(RG_TARGET_NAMESPACE); Init_gemblemedicon(RG_TARGET_NAMESPACE); Init_gfile(RG_TARGET_NAMESPACE); Init_gfileattribute(RG_TARGET_NAMESPACE); Init_gfileattributeinfo(RG_TARGET_NAMESPACE); Init_gfileattributematcher(RG_TARGET_NAMESPACE); Init_gfiledescriptorbased(RG_TARGET_NAMESPACE); Init_gfileenumerator(RG_TARGET_NAMESPACE); Init_gfileicon(RG_TARGET_NAMESPACE); Init_gfileinfo(RG_TARGET_NAMESPACE); Init_gfileinputstream(RG_TARGET_NAMESPACE); Init_gfileiostream(RG_TARGET_NAMESPACE); Init_gfilemonitor(RG_TARGET_NAMESPACE); Init_gfilenamecompleter(RG_TARGET_NAMESPACE); Init_gfileoutputstream(RG_TARGET_NAMESPACE); Init_gfilterinputstream(RG_TARGET_NAMESPACE); Init_gfilteroutputstream(RG_TARGET_NAMESPACE); Init_gicon(RG_TARGET_NAMESPACE); Init_ginetaddress(RG_TARGET_NAMESPACE); Init_ginetsocketaddress(RG_TARGET_NAMESPACE); Init_ginitable(RG_TARGET_NAMESPACE); Init_ginputstream(RG_TARGET_NAMESPACE); Init_gioerror(RG_TARGET_NAMESPACE); Init_giomodule(RG_TARGET_NAMESPACE); Init_giomodules(RG_TARGET_NAMESPACE); Init_gioscheduler(RG_TARGET_NAMESPACE); Init_gioschedulerjob(RG_TARGET_NAMESPACE); Init_giostream(RG_TARGET_NAMESPACE); Init_gloadableicon(RG_TARGET_NAMESPACE); Init_gmemoryinputstream(RG_TARGET_NAMESPACE); Init_gmemoryoutputstream(RG_TARGET_NAMESPACE); Init_gmount(RG_TARGET_NAMESPACE); Init_gmountoperation(RG_TARGET_NAMESPACE); Init_gnetworkaddress(RG_TARGET_NAMESPACE); Init_gnetworkservice(RG_TARGET_NAMESPACE); Init_goutputstream(RG_TARGET_NAMESPACE); Init_gresolver(RG_TARGET_NAMESPACE); Init_gseekable(RG_TARGET_NAMESPACE); Init_gsimpleasyncresult(RG_TARGET_NAMESPACE); Init_gsocket(RG_TARGET_NAMESPACE); Init_gsocketaddress(RG_TARGET_NAMESPACE); Init_gsocketclient(RG_TARGET_NAMESPACE); Init_gsocketconnectable(RG_TARGET_NAMESPACE); Init_gsocketaddressenumerator(RG_TARGET_NAMESPACE); Init_gsocketconnection(RG_TARGET_NAMESPACE); Init_gsocketconnectionfactory(RG_TARGET_NAMESPACE); Init_gsocketcontrolmessage(RG_TARGET_NAMESPACE); Init_gsocketlistener(RG_TARGET_NAMESPACE); Init_gsocketservice(RG_TARGET_NAMESPACE); Init_gsrvtarget(RG_TARGET_NAMESPACE); Init_gtcpconnection(RG_TARGET_NAMESPACE); Init_gthemedicon(RG_TARGET_NAMESPACE); Init_gthreadedsocketservice(RG_TARGET_NAMESPACE); Init_gtlscertificate(RG_TARGET_NAMESPACE); Init_gunixconnection(RG_TARGET_NAMESPACE); Init_gunixfdlist(RG_TARGET_NAMESPACE); Init_gunixfdmessage(RG_TARGET_NAMESPACE); Init_gunixinputstream(RG_TARGET_NAMESPACE); Init_gunixmount(RG_TARGET_NAMESPACE); Init_gunixmounts(RG_TARGET_NAMESPACE); Init_gunixmountpoint(RG_TARGET_NAMESPACE); Init_gunixmountpoints(RG_TARGET_NAMESPACE); Init_gunixmountmonitor(RG_TARGET_NAMESPACE); Init_gunixoutputstream(RG_TARGET_NAMESPACE); Init_gunixsocketaddress(RG_TARGET_NAMESPACE); Init_gvfs(RG_TARGET_NAMESPACE); Init_gvolume(RG_TARGET_NAMESPACE); Init_gvolumemonitor(RG_TARGET_NAMESPACE); Init_gzlibcompressor(RG_TARGET_NAMESPACE); Init_gzlibdecompressor(RG_TARGET_NAMESPACE); } ������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioseekable.c�������������������������������������������������0000644�0001750�0001750�00000005270�11701304107�020044� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mSeekable #define _SELF(value) RVAL2GSEEKABLE(value) #define RVAL2GSEEKTYPEDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), NUM2INT, G_SEEK_CUR) static VALUE rg_tell(VALUE self) { return GOFFSET2RVAL(g_seekable_tell(_SELF(self))); } static VALUE rg_can_seek_p(VALUE self) { return CBOOL2RVAL(g_seekable_can_seek(_SELF(self))); } static VALUE rg_seek(int argc, VALUE *argv, VALUE self) { VALUE offset, type, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "12", &offset, &type, &cancellable); if (!g_seekable_seek(_SELF(self), RVAL2GOFFSET(offset), RVAL2GSEEKTYPEDEFAULT(type), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_can_truncate_p(VALUE self) { return CBOOL2RVAL(g_seekable_can_truncate(_SELF(self))); } static VALUE rg_truncate(int argc, VALUE *argv, VALUE self) { VALUE offset, cancellable; GError *error = NULL; rb_scan_args(argc, argv, "11", &offset, &cancellable); if (!g_seekable_truncate(_SELF(self), RVAL2GOFFSET(offset), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } void Init_gseekable(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_SEEKABLE, "Seekable", mGio); RG_DEF_METHOD(tell, 0); RG_DEF_METHOD_P(can_seek, 0); RG_DEF_METHOD(seek, -1); RG_DEF_METHOD_P(can_truncate, 0); RG_DEF_METHOD(truncate, -1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofilterinputstream.c����������������������������������������0000644�0001750�0001750�00000002073�11701304107�022050� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" void Init_gfilterinputstream(VALUE mGio) { (void)G_DEF_CLASS(G_TYPE_FILTER_INPUT_STREAM, "FilterInputStream", mGio); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiotlscertificate.c�������������������������������������������0000644�0001750�0001750�00000004705�12017142000�021271� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cTlsCertificate #define _SELF(value) RVAL2GOBJ(value) static VALUE rg_initialize(VALUE self, VALUE data) { GTlsCertificate *certificate; GError *error = NULL; certificate = g_tls_certificate_new_from_pem(StringValuePtr(data), RSTRING_LEN(data), &error); if (error) rbgio_raise_error(error); G_INITIALIZE(self, certificate); return Qnil; } static VALUE rg_s_load(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE cert_file, key_file; GError *error = NULL; GTlsCertificate *certificate; rb_scan_args(argc, argv, "11", &cert_file, &key_file); if (NIL_P(key_file)) { certificate = g_tls_certificate_new_from_file(StringValuePtr(cert_file), &error); } else { certificate = g_tls_certificate_new_from_files(StringValuePtr(cert_file), StringValuePtr(key_file), &error); } if (error) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(certificate); } static VALUE rg_verify(VALUE self, VALUE identity, VALUE trusted_ca) { GTlsCertificateFlags flags; flags = g_tls_certificate_verify(_SELF(self), RVAL2GOBJ(identity), RVAL2GOBJ(trusted_ca)); return GFLAGS2RVAL(flags, G_TYPE_TLS_CERTIFICATE_FLAGS); } void Init_gtlscertificate(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_TLS_CERTIFICATE, "TlsCertificate", mGio); G_DEF_CLASS(G_TYPE_TLS_CERTIFICATE_FLAGS, "TlsCertificateFlags", mGio); RG_DEF_SMETHOD(load, -1); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(verify, 2); } �����������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiofileattributematcher.c�������������������������������������0000644�0001750�0001750�00000006144�12137115064�022507� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cFileAttributeMatcher #if !GLIB_CHECK_VERSION(2, 34, 0) GType g_file_attribute_matcher_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static("GFileAttributeMatcher", (GBoxedCopyFunc)g_file_attribute_matcher_ref, (GBoxedFreeFunc)g_file_attribute_matcher_unref); return our_type; } #endif #define _SELF(value) RVAL2GFILEATTRIBUTEMATCHER(value) static VALUE rg_initialize(VALUE self, VALUE attributes) { G_INITIALIZE(self, g_file_attribute_matcher_new(RVAL2CSTR(attributes))); return Qnil; } static VALUE rg_matches_p(VALUE self, VALUE attribute) { return CBOOL2RVAL(g_file_attribute_matcher_matches(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_matches_only_p(VALUE self, VALUE attribute) { return CBOOL2RVAL(g_file_attribute_matcher_matches_only(_SELF(self), RVAL2CSTR(attribute))); } static VALUE rg_enumerate_namespace(VALUE self, VALUE ns) { const char *match; gboolean matches_all = g_file_attribute_matcher_enumerate_namespace(_SELF(self), RVAL2CSTR(ns)); if (!rb_block_given_p()) return CBOOL2RVAL(matches_all); while ((match = g_file_attribute_matcher_enumerate_next(_SELF(self))) != NULL) rb_yield(CSTR2RVAL(match)); return self; } static VALUE rg_enumerate_next(VALUE self) { return CSTR2RVAL(g_file_attribute_matcher_enumerate_next(_SELF(self))); } void Init_gfileattributematcher(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_FILE_ATTRIBUTE_MATCHER, "FileAttributeMatcher", mGio); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD_P(matches, 1); /* TODO: Is this confusing when we have both #matches and * #matches_only? What does #=~ call? */ RG_DEF_ALIAS("=~", "matches?"); RG_DEF_METHOD_P(matches_only, 1); RG_DEF_METHOD(enumerate_namespace, 1); RG_DEF_METHOD(enumerate_next, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/depend����������������������������������������������������������0000644�0001750�0001750�00000000504�12077752267�016304� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install-so: install-headers install-headers: $(INSTALL_DATA) $(srcdir)/rbgio2.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgio2conversions.h $(RUBYARCHDIR) install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-gio2.pc $(pkgconfigdir); \ fi ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/gio2.def��������������������������������������������������������0000644�0001750�0001750�00000000023�11701304107�016411� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXPORTS Init_gio2 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioiomodule.c�������������������������������������������������0000644�0001750�0001750�00000002631�11701304107�020104� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cIOModule #define _SELF(value) RVAL2GIOMODULE(value) static VALUE rg_initialize(VALUE self, VALUE filename) { G_INITIALIZE(self, g_io_module_new(RVAL2CSTR(filename))); return Qnil; } /* NOTE: No point in implementing g_io_module_query. */ void Init_giomodule(VALUE mGio) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(G_IO_TYPE_MODULE, "IOModule", mGio); RG_DEF_METHOD(initialize, 1); } �������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiodatainputstream.c������������������������������������������0000644�0001750�0001750�00000024000�11701304107�021466� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cDataInputStream #define _SELF(value) RVAL2GDATAINPUTSTREAM(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE base_stream, byte_order, newline_type; rb_scan_args(argc, argv, "12", &base_stream, &byte_order, &newline_type); G_INITIALIZE(self, g_data_input_stream_new(RVAL2GINPUTSTREAM(base_stream))); if (!NIL_P(byte_order)) g_data_input_stream_set_byte_order(_SELF(self), RVAL2GDATASTREAMBYTEORDER(byte_order)); if (!NIL_P(newline_type)) g_data_input_stream_set_newline_type(_SELF(self), RVAL2GDATASTREAMNEWLINETYPE(newline_type)); return Qnil; } static VALUE rg_read_byte(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; guchar value; rb_scan_args(argc, argv, "01", &cancellable); value = g_data_input_stream_read_byte(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return GUCHAR2RVAL(value); } static VALUE rg_read_int16(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; gint16 value; rb_scan_args(argc, argv, "01", &cancellable); value = g_data_input_stream_read_int16(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return GINT162RVAL(value); } static VALUE rg_read_uint16(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; guint16 value; rb_scan_args(argc, argv, "01", &cancellable); value = g_data_input_stream_read_uint16(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return GUINT162RVAL(value); } static VALUE rg_read_int32(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; gint32 value; rb_scan_args(argc, argv, "01", &cancellable); value = g_data_input_stream_read_int32(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return GINT322RVAL(value); } static VALUE rg_read_uint32(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; guint32 value; rb_scan_args(argc, argv, "01", &cancellable); value = g_data_input_stream_read_uint32(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return GUINT322RVAL(value); } static VALUE rg_read_int64(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; gint64 value; rb_scan_args(argc, argv, "01", &cancellable); value = g_data_input_stream_read_int64(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return GINT642RVAL(value); } static VALUE rg_read_uint64(int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; guint64 value; rb_scan_args(argc, argv, "01", &cancellable); value = g_data_input_stream_read_uint64(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return GUINT642RVAL(value); } static VALUE rg_read_line(int argc, VALUE *argv, VALUE self) { VALUE cancellable; gsize length; GError *error; char *line; rb_scan_args(argc, argv, "01", &cancellable); line = g_data_input_stream_read_line(_SELF(self), &length, RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return CSTR2RVAL_TAINTED_FREE(line, length); } static VALUE rg_read_line_async(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_data_input_stream_read_line_async(_SELF(self), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_read_line_finish(VALUE self, VALUE result) { GError *error = NULL; gsize length; char *line; line = g_data_input_stream_read_line_finish(_SELF(self), RVAL2GASYNCRESULT(result), &length, &error); if (error != NULL) rbgio_raise_error(error); return CSTR2RVAL_TAINTED_FREE(line, length); } #if GLIB_CHECK_VERSION(2, 26, 0) static VALUE rg_read_upto(int argc, VALUE *argv, VALUE self) { VALUE rbstop_chars, cancellable; const char *stop_chars; gsize length; GError *error; char *string; rb_scan_args(argc, argv, "11", &rbstop_chars, &cancellable); stop_chars = RVAL2CSTR(rbstop_chars); string = g_data_input_stream_read_upto(_SELF(self), stop_chars, RSTRING_LEN(rbstop_chars), &length, RVAL2GCANCELLABLE(cancellable), &error); if (error != NULL) rbgio_raise_error(error); return CSTR2RVAL_TAINTED_FREE(string, length); } static VALUE rg_read_upto_async(int argc, VALUE *argv, VALUE self) { VALUE rbstop_chars, rbcancellable, rbio_priority, block; const char *stop_chars; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "12&", &rbstop_chars, &rbio_priority, &rbcancellable, &block); stop_chars = RVAL2CSTR(rbstop_chars); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_data_input_stream_read_upto_async(_SELF(self), stop_chars, RSTRING_LEN(rbstop_chars), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_read_upto_finish(VALUE self, VALUE result) { GError *error = NULL; gsize length; char *string; string = g_data_input_stream_read_upto_finish(_SELF(self), RVAL2GASYNCRESULT(result), &length, &error); if (error != NULL) rbgio_raise_error(error); return CSTR2RVAL_TAINTED_FREE(string, length); } #endif void Init_gdatainputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_DATA_INPUT_STREAM, "DataInputStream", mGio); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(read_byte, -1); RG_DEF_METHOD(read_int16, -1); RG_DEF_METHOD(read_uint16, -1); RG_DEF_METHOD(read_int32, -1); RG_DEF_METHOD(read_uint32, -1); RG_DEF_METHOD(read_int64, -1); RG_DEF_METHOD(read_uint64, -1); RG_DEF_METHOD(read_line, -1); RG_DEF_METHOD(read_line_async, -1); RG_DEF_METHOD(read_line_finish, 1); #if GLIB_CHECK_VERSION(2, 26, 0) RG_DEF_METHOD(read_upto, -1); RG_DEF_METHOD(read_upto_async, -1); RG_DEF_METHOD(read_upto_finish, 1); #endif } ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiooutputstream.c���������������������������������������������0000664�0001750�0001750�00000024744�11740310343�021060� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cOutputStream #define _SELF(value) RVAL2GOUTPUTSTREAM(value) #define RVAL2GOUTPUTSTREAMSPLICEFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GOUTPUTSTREAMSPLICEFLAGS, \ G_OUTPUT_STREAM_SPLICE_NONE) static VALUE rg_write(int argc, VALUE *argv, VALUE self) { VALUE rbbuffer, cancellable; const char *buffer; GError *error = NULL; gssize bytes_written; rb_scan_args(argc, argv, "11", &rbbuffer, &cancellable); buffer = RVAL2CSTR(rbbuffer); bytes_written = g_output_stream_write(_SELF(self), buffer, (gsize)RSTRING_LEN(rbbuffer), RVAL2GCANCELLABLE(cancellable), &error); if (bytes_written == -1) rbgio_raise_error(error); return GSSIZE2RVAL(bytes_written); } static VALUE rg_write_all(int argc, VALUE *argv, VALUE self) { VALUE rbbuffer, cancellable; const char *buffer; gsize bytes_written; GError *error = NULL; rb_scan_args(argc, argv, "11", &rbbuffer, &cancellable); buffer = RVAL2CSTR(rbbuffer); if (!g_output_stream_write_all(_SELF(self), buffer, (gsize)RSTRING_LEN(rbbuffer), &bytes_written, RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return GSIZE2RVAL(bytes_written); } static VALUE rg_splice(int argc, VALUE *argv, VALUE self) { VALUE source, flags, cancellable; GError *error = NULL; gssize bytes_spliced; rb_scan_args(argc, argv, "12", &source, &flags, &cancellable); bytes_spliced = g_output_stream_splice(_SELF(self), RVAL2GINPUTSTREAM(source), RVAL2GOUTPUTSTREAMSPLICEFLAGSDEFAULT(flags), RVAL2GCANCELLABLE(cancellable), &error); if (bytes_spliced == -1) rbgio_raise_error(error); return GSSIZE2RVAL(bytes_spliced); } typedef gboolean (*CancellableMethod)(GOutputStream *, GCancellable *, GError **); static VALUE cancellable_method(CancellableMethod method, int argc, VALUE *argv, VALUE self) { VALUE cancellable; GError *error = NULL; rb_scan_args(argc, argv, "01", &cancellable); if (!method(_SELF(self), RVAL2GCANCELLABLE(cancellable), &error)) rbgio_raise_error(error); return self; } static VALUE rg_flush(int argc, VALUE *argv, VALUE self) { return cancellable_method(g_output_stream_flush, argc, argv, self); } static VALUE rg_close(int argc, VALUE *argv, VALUE self) { return cancellable_method(g_output_stream_close, argc, argv, self); } /* TODO: Does it make sense to use buffer and count? We should probably * provide a better wrapper that simply pumps out buffer while count hasn't * been reached, calling the callback with the bytes written, then with the * result. */ static VALUE rg_write_async(int argc, VALUE *argv, VALUE self) { VALUE rbbuffer, rbcount, rbio_priority, rbcancellable, block; const gchar *buffer; gsize count; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "22&", &rbbuffer, &rbcount, &rbio_priority, &rbcancellable, &block); buffer = RVAL2CSTR(rbbuffer); count = RVAL2GSIZE(rbcount); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_output_stream_write_async(_SELF(self), buffer, count, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } typedef gssize (*SSizeFinishMethod)(GOutputStream *, GAsyncResult *, GError **); static VALUE ssize_finish_method(SSizeFinishMethod method, VALUE self, VALUE result) { GError *error = NULL; gssize bytes_read; bytes_read = method(_SELF(self), RVAL2GASYNCRESULT(result), &error); if (error != NULL) rbgio_raise_error(error); return GSSIZE2RVAL(bytes_read); } static VALUE rg_write_finish(VALUE self, VALUE result) { return ssize_finish_method(g_output_stream_write_finish, self, result); } static VALUE rg_splice_async(int argc, VALUE *argv, VALUE self) { VALUE rbsource, rbflags, rbio_priority, rbcancellable, block; GInputStream *source; GOutputStreamSpliceFlags flags; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "12&", &rbsource, &rbflags, &rbio_priority, &rbcancellable, &block); source = RVAL2GINPUTSTREAM(rbsource); flags = RVAL2GOUTPUTSTREAMSPLICEFLAGSDEFAULT(rbflags); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_output_stream_splice_async(_SELF(self), source, flags, io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_splice_finish(VALUE self, VALUE result) { return ssize_finish_method(g_output_stream_splice_finish, self, result); } static VALUE rg_flush_async(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_output_stream_flush_async(_SELF(self), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } typedef gboolean (*BooleanFinishMethod)(GOutputStream *, GAsyncResult *, GError **); static VALUE boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result) { GError *error = NULL; if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error)) rbgio_raise_error(error); return self; } static VALUE rg_flush_finish(VALUE self, VALUE result) { return boolean_finish_method(g_output_stream_flush_finish, self, result); } static VALUE rg_close_async(int argc, VALUE *argv, VALUE self) { VALUE rbio_priority, rbcancellable, block; int io_priority; GCancellable *cancellable; rb_scan_args(argc, argv, "02&", &rbio_priority, &rbcancellable, &block); io_priority = RVAL2IOPRIORITYDEFAULT(rbio_priority); cancellable = RVAL2GCANCELLABLE(rbcancellable); SAVE_BLOCK(block); g_output_stream_close_async(_SELF(self), io_priority, cancellable, rbgio_async_ready_callback, (gpointer)block); return self; } static VALUE rg_close_finish(VALUE self, VALUE result) { return boolean_finish_method(g_output_stream_close_finish, self, result); } static VALUE rg_closing_p(VALUE self) { return CBOOL2RVAL(g_output_stream_is_closing(_SELF(self))); } static VALUE rg_closed_p(VALUE self) { return CBOOL2RVAL(g_output_stream_is_closed(_SELF(self))); } static VALUE rg_has_pending_p(VALUE self) { return CBOOL2RVAL(g_output_stream_has_pending(_SELF(self))); } static VALUE rg_set_pending(VALUE self) { GError *error = NULL; if (!g_output_stream_set_pending(_SELF(self), &error)) rbgio_raise_error(error); return self; } static VALUE rg_clear_pending(VALUE self) { g_output_stream_clear_pending(_SELF(self)); return self; } void Init_goutputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_OUTPUT_STREAM, "OutputStream", mGio); G_DEF_CLASS(G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS, "SpliceFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_OUTPUT_STREAM_SPLICE_FLAGS, "G_OUTPUT_STREAM_"); RG_DEF_METHOD(write, -1); RG_DEF_METHOD(write_all, -1); RG_DEF_METHOD(splice, -1); RG_DEF_METHOD(flush, -1); RG_DEF_METHOD(close, -1); RG_DEF_METHOD(write_async, -1); RG_DEF_METHOD(write_finish, 1); RG_DEF_METHOD(splice_async, -1); RG_DEF_METHOD(splice_finish, 1); RG_DEF_METHOD(flush_async, -1); RG_DEF_METHOD(flush_finish, 1); RG_DEF_METHOD(close_async, -1); RG_DEF_METHOD(close_finish, 0); RG_DEF_METHOD_P(closing, 0); RG_DEF_METHOD_P(closed, 0); RG_DEF_METHOD_P(has_pending, 0); RG_DEF_METHOD(set_pending, 0); RG_DEF_METHOD(clear_pending, 0); } ����������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiosocketservice.c��������������������������������������������0000644�0001750�0001750�00000003342�11701304107�021140� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cSocketService #define _SELF(value) RVAL2GSOCKETSERVICE(value) static VALUE rg_initialize(VALUE self) { G_INITIALIZE(self, g_socket_service_new()); return Qnil; } static VALUE rg_start(VALUE self) { g_socket_service_start(_SELF(self)); return self; } static VALUE rg_stop(VALUE self) { g_socket_service_stop(_SELF(self)); return self; } static VALUE rg_active_p(VALUE self) { return CBOOL2RVAL(g_socket_service_is_active(_SELF(self))); } void Init_gsocketservice(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_SOCKET_SERVICE, "SocketService", mGio); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(start, 0); RG_DEF_METHOD(stop, 0); RG_DEF_METHOD_P(active, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiomemoryinputstream.c����������������������������������������0000644�0001750�0001750�00000004245�11701304107�022076� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE cMemoryInputStream #define _SELF(value) RVAL2GMEMORYINPUTSTREAM(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE data; rb_scan_args(argc, argv, "01", &data); if (NIL_P(data)) { G_INITIALIZE(self, g_memory_input_stream_new()); return Qnil; } StringValue(data); G_RELATIVE(self, data); G_INITIALIZE(self, g_memory_input_stream_new_from_data(RSTRING_PTR(data), RSTRING_LEN(data), NULL)); return Qnil; } static VALUE rg_add_data(VALUE self, VALUE data) { StringValue(data); G_RELATIVE(self, data); g_memory_input_stream_add_data(_SELF(self), RSTRING_PTR(data), RSTRING_LEN(data), NULL); return self; } void Init_gmemoryinputstream(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_MEMORY_INPUT_STREAM, "MemoryInputStream", mGio); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(add_data, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgiounixinputstream.c������������������������������������������0000644�0001750�0001750�00000003165�11701304107�021551� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #ifdef HAVE_GIO_UNIX #include <gio/gunixinputstream.h> #define RG_TARGET_NAMESPACE cUnixInputStream #define _SELF(value) RVAL2GUNIXINPUTSTREAM(value) static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE fd, close_fd; rb_scan_args(argc, argv, "11", &fd, &close_fd); G_INITIALIZE(self, g_unix_input_stream_new(RVAL2FD(fd), RVAL2CBOOL(close_fd))); return Qnil; } #endif void Init_gunixinputstream(G_GNUC_UNUSED VALUE mGio) { #ifdef HAVE_GIO_UNIX VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_UNIX_INPUT_STREAM, "UnixInputStream", mGio); RG_DEF_METHOD(initialize, -1); #endif } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioioschedulerjob.c�������������������������������������������0000644�0001750�0001750�00000007046�11701304107�021275� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define G_TYPE_IO_SCHEDULER_JOB (g_io_scheduler_job_get_type()) #define RVAL2GIOSCHEDULERJOB(object) \ ((GIOSchedulerJob *)(RVAL2BOXED(object, G_TYPE_IO_SCHEDULER_JOB))) #define GIOSCHEDULERJOB2RVAL(object) \ BOXED2RVAL(object, G_TYPE_IO_SCHEDULER_JOB) #define RG_TARGET_NAMESPACE cIOSchedulerJob #define _SELF(value) RVAL2GIOSCHEDULERJOB(value) static GIOSchedulerJob * ioschedulerjob_copy(const GIOSchedulerJob *job) { return (GIOSchedulerJob *)job; } static void ioschedulerjob_free(G_GNUC_UNUSED GIOSchedulerJob *job) { return; } static GType g_io_scheduler_job_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static("GIOSchedulerJob", (GBoxedCopyFunc)ioschedulerjob_copy, (GBoxedFreeFunc)ioschedulerjob_free); return our_type; } static VALUE ioscheduler_source_callback_call(VALUE data) { static VALUE s_id_call; if (s_id_call == 0) s_id_call = rb_intern("call"); return rb_funcall(USE_BLOCK_AND_SAVE(data), s_id_call, 0); } static gboolean ioscheduler_source_callback(gpointer data) { return RVAL2CBOOL(G_PROTECT_CALLBACK(ioscheduler_source_callback_call, data)); } static void ioscheduler_source_callback_free(gpointer data) { USE_BLOCK(data); } static VALUE rg_send_to_mainloop(VALUE self) { VALUE block; block = rb_block_proc(); SAVE_BLOCK(block); return CBOOL2RVAL(g_io_scheduler_job_send_to_mainloop(_SELF(self), ioscheduler_source_callback, (gpointer)block, ioscheduler_source_callback_free)); } static VALUE rg_send_to_mainloop_async(VALUE self) { VALUE block; block = rb_block_proc(); SAVE_BLOCK(block); g_io_scheduler_job_send_to_mainloop_async(_SELF(self), ioscheduler_source_callback, (gpointer)block, ioscheduler_source_callback_free); return self; } void Init_gioschedulerjob(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IO_SCHEDULER_JOB, "IOSchedulerJob", mGio); RG_DEF_METHOD(send_to_mainloop, 0); RG_DEF_METHOD(send_to_mainloop_async, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/ext/gio2/rbgioappinfo.c��������������������������������������������������0000644�0001750�0001750�00000021254�11701304107�017725� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008-2009 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgio2private.h" #define RG_TARGET_NAMESPACE mAppInfo #define _SELF(value) RVAL2GAPPINFO(value) #define RVAL2GAPPINFOCREATEFLAGSDEFAULT(value) \ RVAL2TYPE_WITH_DEFAULT((value), \ RVAL2GAPPINFOCREATEFLAGS, \ G_APP_INFO_CREATE_NONE) static VALUE rg_s_create_from_commandline(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE commandline, application_name, flags; GError *error = NULL; GAppInfo *info; rb_scan_args(argc, argv, "12", &commandline, &application_name, &flags); info = g_app_info_create_from_commandline(RVAL2CSTR(commandline), RVAL2CSTR_ACCEPT_NIL(application_name), RVAL2GAPPINFOCREATEFLAGSDEFAULT(flags), &error); if (info == NULL) rbgio_raise_error(error); return GOBJ2RVAL_UNREF(info); } static VALUE rg_s_reset_type_associations(VALUE self, VALUE content_type) { g_app_info_reset_type_associations(RVAL2CSTR(content_type)); return self; } static VALUE rg_s_get_all_for_type(G_GNUC_UNUSED VALUE self, VALUE content_type) { return GLIST2ARY_FREE(g_app_info_get_all_for_type(RVAL2CSTR(content_type))); } static VALUE rg_s_all(int argc, VALUE *argv, VALUE self) { VALUE content_type; rb_scan_args(argc, argv, "01", &content_type); if (!NIL_P(content_type)) return rg_s_get_all_for_type(self, content_type); return GLIST2ARY_FREE(g_app_info_get_all()); } static VALUE rg_s_get_default_for_type(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE content_type, must_support_uris; rb_scan_args(argc, argv, "11", &content_type, &must_support_uris); return GOBJ2RVAL_UNREF(g_app_info_get_default_for_type(RVAL2CSTR(content_type), RVAL2CBOOL(must_support_uris))); } static VALUE rg_s_get_default_for_uri_scheme(G_GNUC_UNUSED VALUE self, VALUE uri_scheme) { return GOBJ2RVAL_UNREF(g_app_info_get_default_for_uri_scheme(RVAL2CSTR(uri_scheme))); } static VALUE rg_s_launch_default_for_uri(int argc, VALUE *argv, VALUE self) { VALUE uri, launch_context; GError *error; rb_scan_args(argc, argv, "11", &uri, &launch_context); if (!g_app_info_launch_default_for_uri(RVAL2CSTR(uri), RVAL2GAPPLAUNCHCONTEXT(launch_context), &error)) rbgio_raise_error(error); return self; } static VALUE rg_dup(VALUE self) { return GOBJ2RVAL_UNREF(g_app_info_dup(_SELF(self))); } static VALUE rg_equal_p(VALUE self, VALUE other) { return CBOOL2RVAL(g_app_info_equal(_SELF(self), _SELF(other))); } static VALUE rg_id(VALUE self) { return CSTR2RVAL(g_app_info_get_id(_SELF(self))); } static VALUE rg_name(VALUE self) { return CSTR2RVAL(g_app_info_get_name(_SELF(self))); } static VALUE rg_display_name(VALUE self) { return CSTR2RVAL(g_app_info_get_display_name(_SELF(self))); } static VALUE rg_description(VALUE self) { return CSTR2RVAL(g_app_info_get_description(_SELF(self))); } static VALUE rg_executable(VALUE self) { return CSTR2RVAL(g_app_info_get_executable(_SELF(self))); } static VALUE rg_commandline(VALUE self) { return CSTR2RVAL(g_app_info_get_commandline(_SELF(self))); } static VALUE rg_icon(VALUE self) { return GOBJ2RVAL(g_app_info_get_icon(_SELF(self))); } typedef gboolean (*LaunchMethod)(GAppInfo *, GList *, GAppLaunchContext *, GError **); static VALUE launch_method(LaunchMethod method, int argc, VALUE *argv, VALUE self) { VALUE rbfiles, rblaunch_context; GList *files; GAppLaunchContext *launch_context; GError *error = NULL; gboolean launched; rb_scan_args(argc, argv, "02", &rbfiles, &rblaunch_context); launch_context = RVAL2GAPPLAUNCHCONTEXT(rblaunch_context); files = GFILEARY2GLIST_ACCEPT_NIL(rbfiles); launched = method(_SELF(self), files, launch_context, &error); g_list_free(files); if (!launched) rbgio_raise_error(error); return self; } static VALUE rg_launch(int argc, VALUE *argv, VALUE self) { return launch_method(g_app_info_launch, argc, argv, self); } static VALUE rg_supports_files_p(VALUE self) { return CBOOL2RVAL(g_app_info_supports_files(_SELF(self))); } static VALUE rg_supports_uris_p(VALUE self) { return CBOOL2RVAL(g_app_info_supports_uris(_SELF(self))); } static VALUE rg_launch_uris(int argc, VALUE *argv, VALUE self) { return launch_method(g_app_info_launch_uris, argc, argv, self); } static VALUE rg_should_show_p(VALUE self) { return CBOOL2RVAL(g_app_info_should_show(_SELF(self))); } static VALUE rg_can_delete_p(VALUE self) { return CBOOL2RVAL(g_app_info_can_delete(_SELF(self))); } static VALUE rg_delete(VALUE self) { return CBOOL2RVAL(g_app_info_delete(_SELF(self))); } static VALUE rg_set_as_default_for_type(VALUE self, VALUE value) { GError *error = NULL; if (!g_app_info_set_as_default_for_type(_SELF(self), RVAL2CSTR(value), &error)) rbgio_raise_error(error); return self; } static VALUE rg_set_as_default_for_extension(VALUE self, VALUE value) { GError *error = NULL; if (!g_app_info_set_as_default_for_extension(_SELF(self), RVAL2CSTR(value), &error)) rbgio_raise_error(error); return self; } static VALUE rg_add_supports_type(VALUE self, VALUE value) { GError *error = NULL; if (!g_app_info_add_supports_type(_SELF(self), RVAL2CSTR(value), &error)) rbgio_raise_error(error); return self; } static VALUE rg_remove_supports_type(VALUE self, VALUE value) { GError *error = NULL; if (!g_app_info_remove_supports_type(_SELF(self), RVAL2CSTR(value), &error)) rbgio_raise_error(error); return self; } static VALUE rg_can_remove_supports_type_p(VALUE self) { return CBOOL2RVAL(g_app_info_can_remove_supports_type(_SELF(self))); } void Init_gappinfo(VALUE mGio) { VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(G_TYPE_APP_INFO, "AppInfo", mGio); G_DEF_CLASS(G_TYPE_APP_INFO_CREATE_FLAGS, "CreateFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, G_TYPE_APP_INFO_CREATE_FLAGS, "G_APP_INFO_"); RG_DEF_SMETHOD(create_from_commandline, -1); RG_DEF_SMETHOD(reset_type_associations, -1); RG_DEF_SMETHOD(all, 0); RG_DEF_SMETHOD(get_all_for_type, 1); RG_DEF_SMETHOD(get_default_for_type, -1); RG_DEF_SMETHOD(get_default_for_uri_scheme, 1); RG_DEF_SMETHOD(launch_default_for_uri, 0); RG_DEF_METHOD(dup, 0); RG_DEF_METHOD_P(equal, 1); RG_DEF_METHOD(id, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(display_name, 0); RG_DEF_METHOD(description, 0); RG_DEF_METHOD(executable, 0); RG_DEF_METHOD(commandline, 0); RG_DEF_METHOD(icon, 0); RG_DEF_METHOD(launch, -1); RG_DEF_METHOD_P(supports_files, 0); RG_DEF_METHOD_P(supports_uris, 0); RG_DEF_METHOD(launch_uris, -1); RG_DEF_METHOD_P(should_show, 0); RG_DEF_METHOD_P(can_delete, 0); RG_DEF_METHOD(delete, 0); RG_DEF_METHOD(set_as_default_for_type, 1); RG_DEF_METHOD(set_as_default_for_extension, 1); RG_DEF_METHOD(add_supports_type, 1); RG_DEF_METHOD_P(can_remove_supports_type, 1); RG_DEF_METHOD(remove_supports_type, 1); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/TODO���������������������������������������������������������������������0000644�0001750�0001750�00000001125�11701304107�014125� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Unimplementable? ---------------- GIOExtension Other ----- When we use GOBJ2RVAL on properties of objects, should we call G_CHILD_ADD? g_unix_socket_address_new_abstract is deprecated Need to document GLib::Socket Glib::FileAttribute should be an object so that we can use | on them GLib::InputStream#read_all can read bytes /and/ return error at the same time GLib::OutputStream#write_all can write bytes /and/ return error at the same time GConverterFlags Remove implementation of methods that only fetch or set properties (and thus are automatically generated anyway) Update to 2.26 �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/README�������������������������������������������������������������������0000644�0001750�0001750�00000001065�11701304107�014320� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ruby/GIO2 ========= Ruby/GIO2 is a Ruby binding of gio-2.0.x. Requirements ------------ Ruby: http://www.ruby-lang.org/ GIO: http://library.gnome.org/devel/gio/stable Install ------- 0. install Ruby and GLib. 1. ruby extconf.rb 2. make 3. su 4. make install Copying ------- Copyright (c) 2008-2010 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/lib/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�12137115064�014212� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/lib/gio2.rb��������������������������������������������������������������0000644�0001750�0001750�00000006447�12137115064�015412� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������require 'glib2' base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/gio2.so" rescue LoadError require "gio2.so" end require "gio2/deprecated" class Gio::DataInputStream include Enumerable def each while line = read_line yield line end end alias each_line each def each_async(io_priority = GLib::PRIORITY_DEFAULT, cancellable = nil, &block) each_async_loop io_priority, cancellable, block self end alias each_line_async each_async private def each_async_loop(io_priority, cancellable, block) # TODO: Should we really pass in the object? I mean, how often is that # useful? We can always get it with result.source_object as well. read_line_async io_priority, cancellable do |result| if line = read_line_finish(result) block.call line each_async_loop io_priority, cancellable, block end end end # TODO: Add #each_byte? end if Gio.const_defined? :DesktopAppInfo class Gio::DesktopAppInfo class << self def desktop_env=(desktop_env) set_desktop_env desktop_env desktop_env end end end end module Gio::File include Enumerable def eql?(other) self === other and self == other end alias each enumerate_children def each_async(num_files, attributes = nil, flags = nil, io_priority = GLib::PRIORITY_DEFAULT, cancellable = nil, &block) enumerate_children_async attributes, flags, io_priority, cancellable do |result| enumerate_children_finish(result).each_async num_files, io_priority, cancellable, &block end self end end class Gio::FileEnumerator include Enumerable def each(cancellable = nil) return self.enum_for unless block_given? while file = next_file(cancellable) yield file end close self end # TODO: Return Enumerator unless block_given? def each_async(num_files, io_priority = GLib::PRIORITY_DEFAULT, cancellable = nil, &block) each_async_loop num_files, io_priority, cancellable, block end private def each_async_loop(num_files, io_priority, cancellable, block) next_files_async num_files, io_priority, cancellable do |result| files = next_files_finish(result) files.each do |file| block.call file end if files.length > 0 each_async_loop num_files, io_priority, cancellable, block else close end end end end class Gio::FileInfo def directory? file_type == Gio::File::Type::DIRECTORY end end module Gio::Icon def eql?(other) self === other and self == other end end class Gio::InputStream def pending=(pending) pending ? set_pending : clear_pending end end class Gio::Resolver class << self def default=(default) set_default default default end end end module Gio::SocketConnectable include Enumerable def each(cancellable = nil) enumerator = enumerate while address = enumerator.next(cancellable) yield address end end end class Gio::UnixFDList include Enumerable def each i = 0 while i < length yield self[i] end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/lib/gio2/����������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�015044� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/lib/gio2/deprecated.rb���������������������������������������������������0000644�0001750�0001750�00000014156�11701304107�017500� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������module GLib extend GLib::Deprecatable define_deprecated_const :AppInfo, 'Gio::AppInfo' define_deprecated_const :AppLaunchContext, 'Gio::AppLaunchContext' define_deprecated_const :AskPasswordFlags, 'Gio::AskPasswordFlags' define_deprecated_const :AsyncInitable, 'Gio::AsyncInitable' define_deprecated_const :AsyncResult, 'Gio::AsyncResult' define_deprecated_const :BufferedInputStream, 'Gio::BufferedInputStream' define_deprecated_const :BufferedOutputStream, 'Gio::BufferedOutputStream' define_deprecated_const :Cancellable, 'Gio::Cancellable' define_deprecated_const :CharsetConverter, 'Gio::CharsetConverter' define_deprecated_const :ContentType, 'Gio::ContentType' define_deprecated_const :Converter, 'Gio::Converter' define_deprecated_const :ConverterInputStream, 'Gio::ConverterInputStream' define_deprecated_const :ConverterOutputStream, 'Gio::ConverterOutputStream' define_deprecated_const :DataInputStream, 'Gio::DataInputStream' define_deprecated_const :DataOutputStream, 'Gio::DataOutputStream' define_deprecated_const :DataStreamByteOrder, 'Gio::DataStreamByteOrder' define_deprecated_const :DataStreamNewlineType, 'Gio::DataStreamNewlineType' define_deprecated_const :DesktopAppInfo, 'Gio::DesktopAppInfo' define_deprecated_const :Drive, 'Gio::Drive' define_deprecated_const :Emblem, 'Gio::Emblem' define_deprecated_const :EmblemedIcon, 'Gio::EmblemedIcon' define_deprecated_const :File, 'Gio::File' define_deprecated_const :FileAttribute, 'Gio::FileAttribute' define_deprecated_const :FileAttributeInfo, 'Gio::FileAttributeInfo' define_deprecated_const :FileAttributeMatcher, 'Gio::FileAttributeMatcher' define_deprecated_const :FileDescriptorBased, 'Gio::FileDescriptorBased' define_deprecated_const :FileEnumerator, 'Gio::FileEnumerator' define_deprecated_const :FileIOStream, 'Gio::FileIOStream' define_deprecated_const :FileIcon, 'Gio::FileIcon' define_deprecated_const :FileInfo, 'Gio::FileInfo' define_deprecated_const :FileInputStream, 'Gio::FileInputStream' define_deprecated_const :FileMonitor, 'Gio::FileMonitor' define_deprecated_const :FileOutputStream, 'Gio::FileOutputStream' define_deprecated_const :FilenameCompleter, 'Gio::FilenameCompleter' define_deprecated_const :FilesystemPreviewType, 'Gio::FilesystemPreviewType' define_deprecated_const :FilterInputStream, 'Gio::FilterInputStream' define_deprecated_const :FilterOutputStream, 'Gio::FilterOutputStream' define_deprecated_const :IO, 'Gio::IO' define_deprecated_const :IOModule, 'Gio::IOModule' define_deprecated_const :IOModules, 'Gio::IOModules' define_deprecated_const :IOScheduler, 'Gio::IOScheduler' define_deprecated_const :IOSchedulerJob, 'Gio::IOSchedulerJob' define_deprecated_const :IOStream, 'Gio::IOStream' define_deprecated_const :Icon, 'Gio::Icon' define_deprecated_const :InetAddress, 'Gio::InetAddress' define_deprecated_const :InetSocketAddress, 'Gio::InetSocketAddress' define_deprecated_const :Initable, 'Gio::Initable' define_deprecated_const :InputStream, 'Gio::InputStream' define_deprecated_const :LoadableIcon, 'Gio::LoadableIcon' define_deprecated_const :MemoryInputStream, 'Gio::MemoryInputStream' define_deprecated_const :MemoryOutputStream, 'Gio::MemoryOutputStream' define_deprecated_const :Mount, 'Gio::Mount' define_deprecated_const :MountOperation, 'Gio::MountOperation' define_deprecated_const :NetworkAddress, 'Gio::NetworkAddress' define_deprecated_const :NetworkService, 'Gio::NetworkService' define_deprecated_const :OutputStream, 'Gio::OutputStream' define_deprecated_const :PasswordSave, 'Gio::PasswordSave' define_deprecated_const :Resolver, 'Gio::Resolver' define_deprecated_const :Seekable, 'Gio::Seekable' define_deprecated_const :SimpleAsyncResult, 'Gio::SimpleAsyncResult' define_deprecated_const :Socket, 'Gio::Socket' define_deprecated_const :SocketAddress, 'Gio::SocketAddress' define_deprecated_const :SocketAddressEnumerator, 'Gio::SocketAddressEnumerator' define_deprecated_const :SocketClient, 'Gio::SocketClient' define_deprecated_const :SocketConnectable, 'Gio::SocketConnectable' define_deprecated_const :SocketConnection, 'Gio::SocketConnection' define_deprecated_const :SocketConnectionFactory, 'Gio::SocketConnectionFactory' define_deprecated_const :SocketControlMessage, 'Gio::SocketControlMessage' define_deprecated_const :SocketListener, 'Gio::SocketListener' define_deprecated_const :SocketService, 'Gio::SocketService' define_deprecated_const :SrvTarget, 'Gio::SrvTarget' define_deprecated_const :TcpConnection, 'Gio::TcpConnection' define_deprecated_const :ThemedIcon, 'Gio::ThemedIcon' define_deprecated_const :ThreadedSocketService, 'Gio::ThreadedSocketService' define_deprecated_const :UnixConnection, 'Gio::UnixConnection' define_deprecated_const :UnixFDList, 'Gio::UnixFDList' define_deprecated_const :UnixFDMessage, 'Gio::UnixFDMessage' define_deprecated_const :UnixInputStream, 'Gio::UnixInputStream' define_deprecated_const :UnixMount, 'Gio::UnixMount' define_deprecated_const :UnixMountMonitor, 'Gio::UnixMountMonitor' define_deprecated_const :UnixMountPoint, 'Gio::UnixMountPoint' define_deprecated_const :UnixMountPoints, 'Gio::UnixMountPoints' define_deprecated_const :UnixMounts, 'Gio::UnixMounts' define_deprecated_const :UnixOutputStream, 'Gio::UnixOutputStream' define_deprecated_const :UnixSocketAddress, 'Gio::UnixSocketAddress' define_deprecated_const :Vfs, 'Gio::Vfs' define_deprecated_const :Volume, 'Gio::Volume' define_deprecated_const :VolumeMonitor, 'Gio::VolumeMonitor' define_deprecated_const :ZlibCompressor, 'Gio::ZlibCompressor' define_deprecated_const :ZlibDecompressor, 'Gio::ZlibDecompressor' define_deprecated_enums 'Gio::FilesystemPreviewType', 'FILESYSTEM_PREVIEW_TYPE' define_deprecated_enums 'Gio::DataStreamByteOrder', 'DATA_STREAM_BYTE_ORDER' define_deprecated_enums 'Gio::DataStreamNewlineType', 'DATA_STREAM_NEWLINE_TYPE' define_deprecated_flags 'Gio::AskPasswordFlags', 'ASK_PASSWORD' define_deprecated_enums 'Gio::PasswordSave', 'PASSWORD_SAVE' define_deprecated_singleton_method :gio_has_unix?, :warn => "Use 'Gio.has_unix?'." do |_self| Gio.has_unix? end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/lib/1.8/�����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665514�014535� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/lib/1.9/�����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665514�014536� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/extconf.rb���������������������������������������������������������������0000644�0001750�0001750�00000002223�11701304107�015430� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "gio2" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/Rakefile�����������������������������������������������������������������0000644�0001750�0001750�00000000606�12147676243�015127� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require 'gnome2-raketask' package = GNOME2Package.new do |_package| _package.summary = "Ruby/GIO2 is a Ruby binding of gio-2.x." _package.description = "Ruby/GIO2 is a Ruby binding of gio-2.x." _package.dependency.gem.runtime = ["glib2"] _package.win32.packages = [] _package.win32.dependencies = [] end package.define_tasks ��������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/test/��������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�014437� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/test/test_bufferedinputstream.rb�����������������������������������������0000644�0001750�0001750�00000000333�12257552167�022100� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- class TestBufferedInputStream < Test::Unit::TestCase def test_buffered_input_stream assert_nothing_raised do Gio::BufferedInputStream.new(Gio::FileInputStream.new) end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/test/test_filemonitor.rb�������������������������������������������������0000644�0001750�0001750�00000000627�12257552167�020357� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- class TestFileMonitor < Test::Unit::TestCase class Flags < self def test_file_monitor_flags assert_nothing_raised do Gio::FileMonitor::Flags.new(Gio::FileMonitor::Flags::SEND_MOVED) end end def test_file_monitor_event assert_nothing_raised do Gio::FileMonitor::Event.new(Gio::FileMonitor::Event::CREATED) end end end end ���������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/test/test_inetaddress.rb�������������������������������������������������0000644�0001750�0001750�00000000315�12257552167�020327� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- class TestInetAddress < Test::Unit::TestCase def test_responds_to_properties a = Gio::InetAddress.new_any(Gio::Socket::FAMILY_IPV4) assert a.respond_to?(:any?) end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/test/test_fileenumerator.rb����������������������������������������������0000644�0001750�0001750�00000000321�12257552167�021040� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- class TestFileEnumerator < Test::Unit::TestCase def test_responds_to_properties a = Gio::File.new_for_path('/').enumerate_children assert a.respond_to?(:container) end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/test/test_charsetconverter.rb��������������������������������������������0000644�0001750�0001750�00000000301�12257552167�021376� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- class TestCharsetConverter < Test::Unit::TestCase def test_converter assert_nothing_raised do Gio::CharsetConverter.new("UTF-8", "ASCII") end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/test/test_datainputstream.rb���������������������������������������������0000644�0001750�0001750�00000000352�12257552167�021230� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- class TestDataInputStream < Test::Unit::TestCase def test_byte_order_property assert_equal Gio::DataStreamByteOrder::BIG_ENDIAN, Gio::DataInputStream.new(Gio::MemoryInputStream.new).byte_order end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gio2/test/run-test.rb���������������������������������������������������������0000755�0001750�0001750�00000000572�12257552167�016554� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # -*- coding: utf-8 -*- base = File.dirname(File.expand_path(__FILE__)) root = File.dirname(File.dirname(base)) ['glib2', 'gio2'].each do |lib| ['ext/%s' % lib, 'lib'].each do |sub| $LOAD_PATH.unshift File.join(root, lib, sub) end end require 'gio2' require File.join(root, 'glib2/test/glib-test-init') exit Test::Unit::AutoRunner.run(true, base) ��������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/�������������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665516�013504� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/patches/�����������������������������������������������������������������0000755�0001750�0001750�00000000000�12077252562�015124� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/patches/ncurses-5.9-add-missing-exe.diff���������������������������������0000644�0001750�0001750�00000000606�12077252562�022727� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- ncurses-5.9/ncurses/tinfo/MKcaptab.sh.orig 2010-12-26 08:43:58.000000000 +0900 +++ ncurses-5.9/ncurses/tinfo/MKcaptab.sh 2013-01-20 10:20:20.799215399 +0900 @@ -52,8 +52,8 @@ EOF -./make_hash 1 info $OPT1 <$DATA -./make_hash 3 cap $OPT1 <$DATA +./make_hash.exe 1 info $OPT1 <$DATA +./make_hash.exe 3 cap $OPT1 <$DATA $AWK -f $OPT2 bigstrings=$OPT1 tablename=capalias <$DATA ��������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/patches/ncurses-5.9-support-mingw32.diff���������������������������������0000644�0001750�0001750�00000001320�12077252562�022743� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- ncurses-5.9/configure.orig 2011-04-01 08:35:51.000000000 +0900 +++ ncurses-5.9/configure 2013-01-20 16:03:44.730515836 +0900 @@ -5662,7 +5662,7 @@ fi cf_cv_rm_so_locs=yes ;; - linux*|gnu*|k*bsd*-gnu) #(vi + linux*|gnu*|k*bsd*-gnu|mingw32) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" @@ -5678,7 +5678,7 @@ cf_cv_shared_soname='`basename $@`' fi - MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats -o $@' ;; openbsd[2-9].*) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�014257� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/����������������������������������������������������������������0000755�0001750�0001750�00000000000�12064346475�015161� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/rbvteterminal.c�������������������������������������������������0000644�0001750�0001750�00000057607�11701304107�020201� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte3private.h" #include <stdarg.h> #include <pwd.h> #define RG_TARGET_NAMESPACE cTerminal #define _SELF(s) (RVAL2VTETERMINAL(s)) static ID id_new, id_call; static char ** rval2cstrary(VALUE ary) { long i, len; char **result; if (NIL_P(ary)) return NULL; len = RARRAY_LEN(ary); result = ALLOC_N(char *, len + 1); for (i = 0; i < len; i++) { result[i] = g_strdup(RVAL2CSTR(RARRAY_PTR(ary)[i])); } result[i] = NULL; return result; } static void free_cstrary(char **ary) { long i; if (!ary) return; for (i = 0; ary[i] != NULL; i++) { g_free(ary[i]); } g_free(ary); } static VALUE attrary2rval(GArray *attrs) { long i, len; VALUE rb_attrs, rb_class; len = attrs->len; rb_attrs = rb_ary_new2(len); rb_class = rb_const_get(rb_const_get(rb_cObject, rb_intern("Vte")), rb_intern("CharAttributes")); for (i = 0; i < len; i++) { VteCharAttributes *attr; attr = &g_array_index(attrs, VteCharAttributes, i); rb_ary_push(rb_attrs, rb_funcall(rb_class, id_new, 6, LONG2NUM(attr->row), LONG2NUM(attr->column), GDKCOLOR2RVAL(&(attr->fore)), GDKCOLOR2RVAL(&(attr->back)), CBOOL2RVAL(attr->underline), CBOOL2RVAL(attr->strikethrough))); } return rb_attrs; } static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, vte_terminal_new()); return Qnil; } static VALUE fork_command_default_argv(void) { struct passwd *pwd; const char *shell = NULL; pwd = getpwuid(getuid()); if (pwd != NULL) shell = pwd->pw_shell; if (shell == NULL) shell = g_getenv("SHELL") ? g_getenv("SHELL") : "/bin/sh"; return rb_ary_new3(1, CSTR2RVAL(shell)); } static VALUE rg_fork_command(int argc, VALUE *argv, VALUE self) { VALUE options, rb_pty_flags, rb_working_directory, rb_command_argv, rb_envv, rb_spawn_flags; int pty_flags, spawn_flags; char *working_directory; char **command_argv; char **envv; GPid child_pid; gboolean result; GError *error = NULL; rb_scan_args(argc, argv, "01", &options); rbg_scan_options(options, "pty_flags", &rb_pty_flags, "working_directory", &rb_working_directory, "argv", &rb_command_argv, "envv", &rb_envv, "spawn_flags", &rb_spawn_flags, NULL); pty_flags = NIL_P(rb_pty_flags) ? VTE_PTY_DEFAULT : RVAL2VTEPTYFLAGS(rb_pty_flags); working_directory = RVAL2CSTR_ACCEPT_NIL(rb_working_directory); command_argv = rval2cstrary(NIL_P(rb_command_argv) ? fork_command_default_argv() : rb_command_argv); envv = rval2cstrary(rb_envv); spawn_flags = NIL_P(rb_spawn_flags) ? G_SPAWN_CHILD_INHERITS_STDIN | G_SPAWN_SEARCH_PATH : NUM2INT(rb_spawn_flags); result = vte_terminal_fork_command_full(_SELF(self), pty_flags, working_directory, command_argv, envv, spawn_flags, NULL, NULL, &child_pid, &error); free_cstrary(command_argv); free_cstrary(envv); if (error) RAISE_GERROR(error); return INT2NUM(child_pid); } static VALUE rg_feed(VALUE self, VALUE data) { glong length; length = RSTRING_LEN(data); if (length > 0) { vte_terminal_feed(_SELF(self), RSTRING_PTR(data), length); } return self; } static VALUE rg_feed_child(VALUE self, VALUE data) { glong length; length = RSTRING_LEN(data); if (length > 0) { vte_terminal_feed_child(_SELF(self), RSTRING_PTR(data), length); } return self; } static VALUE rg_feed_child_binary(VALUE self, VALUE data) { glong length; length = RSTRING_LEN(data); if (length > 0) { vte_terminal_feed_child_binary(_SELF(self), RSTRING_PTR(data), length); } return self; } static VALUE rg_copy_clipboard(VALUE self) { vte_terminal_copy_clipboard(_SELF(self)); return self; } static VALUE rg_paste_clipboard(VALUE self) { vte_terminal_paste_clipboard(_SELF(self)); return self; } static VALUE rg_copy_primary(VALUE self) { vte_terminal_copy_primary(_SELF(self)); return self; } static VALUE rg_paste_primary(VALUE self) { vte_terminal_paste_primary(_SELF(self)); return self; } static VALUE rg_set_size(VALUE self, VALUE columns, VALUE rows) { vte_terminal_set_size(_SELF(self), NUM2LONG(columns), NUM2LONG(rows)); return self; } static VALUE rg_set_audible_bell(VALUE self, VALUE is_audible) { vte_terminal_set_audible_bell(_SELF(self), RVAL2CBOOL(is_audible)); return self; } static VALUE rg_audible_bell_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_audible_bell(_SELF(self))); } static VALUE rg_set_visible_bell(VALUE self, VALUE is_visible) { vte_terminal_set_visible_bell(_SELF(self), RVAL2CBOOL(is_visible)); return self; } static VALUE rg_visible_bell_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_visible_bell(_SELF(self))); } static VALUE rg_set_scroll_background(VALUE self, VALUE scroll) { vte_terminal_set_scroll_background(_SELF(self), RVAL2CBOOL(scroll)); return self; } static VALUE rg_set_scroll_on_output(VALUE self, VALUE scroll) { vte_terminal_set_scroll_on_output(_SELF(self), RVAL2CBOOL(scroll)); return self; } static VALUE rg_set_scroll_on_keystroke(VALUE self, VALUE scroll) { vte_terminal_set_scroll_on_keystroke(_SELF(self), RVAL2CBOOL(scroll)); return self; } static VALUE rg_set_color_dim(VALUE self, VALUE dim) { vte_terminal_set_color_dim(_SELF(self), RVAL2GDKCOLOR(dim)); return self; } static VALUE rg_set_color_bold(VALUE self, VALUE bold) { vte_terminal_set_color_bold(_SELF(self), RVAL2GDKCOLOR(bold)); return self; } static VALUE rg_set_color_foreground(VALUE self, VALUE foreground) { vte_terminal_set_color_foreground(_SELF(self), RVAL2GDKCOLOR(foreground)); return self; } static VALUE rg_set_color_background(VALUE self, VALUE background) { vte_terminal_set_color_background(_SELF(self), RVAL2GDKCOLOR(background)); return self; } static VALUE rg_set_color_cursor(VALUE self, VALUE cursor) { vte_terminal_set_color_cursor(_SELF(self), NIL_P(cursor) ? NULL : RVAL2GDKCOLOR(cursor)); return self; } static VALUE rg_set_color_highlight(VALUE self, VALUE highlight) { vte_terminal_set_color_highlight(_SELF(self), NIL_P(highlight) ? NULL : RVAL2GDKCOLOR(highlight)); return self; } static VALUE rg_set_colors(VALUE self, VALUE foreground, VALUE background, VALUE rb_palette) { glong i, len; GdkColor *palette; len = RARRAY_LEN(rb_palette); if (!(len == 0 || len == 8 || len == 16 || len == 24)) { char *inspect; inspect = RVAL2CSTR(rb_palette); rb_raise(rb_eArgError, "palette size must be 0, 8, 16 or 24: %s", inspect); } palette = ALLOCA_N(GdkColor, len); for (i = 0; i < len; i++) { GdkColor *color; color = RVAL2GDKCOLOR(RARRAY_PTR(rb_palette)[i]); palette[i] = *color; } vte_terminal_set_colors(_SELF(self), RVAL2GDKCOLOR(foreground), RVAL2GDKCOLOR(background), palette, len); return self; } static VALUE rg_set_default_colors(VALUE self) { vte_terminal_set_default_colors(_SELF(self)); return self; } static VALUE rg_set_background_image(VALUE self, VALUE image_or_path) { if (RVAL2CBOOL(rb_obj_is_kind_of(image_or_path, rb_cString))) { vte_terminal_set_background_image_file(_SELF(self), RVAL2CSTR(image_or_path)); } else { vte_terminal_set_background_image(_SELF(self), RVAL2GDKPIXBUF(image_or_path)); } return self; } static VALUE rg_set_background_tint_color(VALUE self, VALUE color) { vte_terminal_set_background_tint_color(_SELF(self), RVAL2GDKCOLOR(color)); return self; } static VALUE rg_set_background_saturation(VALUE self, VALUE saturation) { vte_terminal_set_background_saturation(_SELF(self), NUM2DBL(saturation)); return self; } static VALUE rg_set_background_transparent(VALUE self, VALUE transparent) { vte_terminal_set_background_transparent(_SELF(self), RVAL2CBOOL(transparent)); return self; } static VALUE rg_set_cursor_blinks(VALUE self, VALUE blink) { VteTerminalCursorBlinkMode mode; mode = RVAL2CBOOL(blink) ? VTE_CURSOR_BLINK_ON : VTE_CURSOR_BLINK_OFF; vte_terminal_set_cursor_blink_mode(_SELF(self), mode); return self; } static VALUE rg_set_cursor_blink_mode(VALUE self, VALUE rb_mode) { VteTerminalCursorBlinkMode mode; mode = RVAL2VTETERMINALCURSORBLINKMODE(rb_mode); vte_terminal_set_cursor_blink_mode(_SELF(self), mode); return self; } static VALUE rg_cursor_blink_mode(VALUE self) { VteTerminalCursorBlinkMode mode; mode = vte_terminal_get_cursor_blink_mode(_SELF(self)); return VTETERMINALCURSORBLINKMODE2RVAL(mode); } static VALUE rg_set_cursor_shape(VALUE self, VALUE rb_shape) { VteTerminalCursorShape shape; shape = RVAL2VTETERMINALCURSORSHAPE(rb_shape); vte_terminal_set_cursor_shape(_SELF(self), shape); return self; } static VALUE rg_cursor_shape(VALUE self) { VteTerminalCursorShape shape; shape = vte_terminal_get_cursor_shape(_SELF(self)); return VTETERMINALCURSORSHAPE2RVAL(shape); } static VALUE rg_child_exit_status(VALUE self) { return INT2NUM(vte_terminal_get_child_exit_status(_SELF(self))); } static VALUE rg_set_scrollback_lines(VALUE self, VALUE lines) { vte_terminal_set_scrollback_lines(_SELF(self), NUM2LONG(lines)); return self; } static VALUE rg_im_append_menuitems(VALUE self, VALUE menushell) { vte_terminal_im_append_menuitems(_SELF(self), RVAL2GTKMENUSHELL(menushell)); return self; } static VALUE rg_set_font(VALUE self, VALUE desc_or_name) { if (rb_obj_is_kind_of(desc_or_name, rb_cString)) { vte_terminal_set_font_from_string(_SELF(self), RVAL2CSTR(desc_or_name)); } else { vte_terminal_set_font(_SELF(self), RVAL2PANGOFONTDESCRIPTION(desc_or_name)); } return self; } static VALUE rg_font(VALUE self) { PangoFontDescription *font_desc; font_desc = (PangoFontDescription *)vte_terminal_get_font(_SELF(self)); return PANGOFONTDESCRIPTION2RVAL(font_desc); } static VALUE rg_set_allow_bold(VALUE self, VALUE allow_bold) { vte_terminal_set_allow_bold(_SELF(self), RVAL2CBOOL(allow_bold)); return self; } static VALUE rg_allow_bold_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_allow_bold(_SELF(self))); } static VALUE rg_has_selection_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_has_selection(_SELF(self))); } static VALUE rg_set_word_chars(VALUE self, VALUE word_chars) { vte_terminal_set_word_chars(_SELF(self), RVAL2CSTR_ACCEPT_NIL(word_chars)); return self; } static VALUE rg_word_char_p(VALUE self, VALUE c) { return CBOOL2RVAL(vte_terminal_is_word_char(_SELF(self), NUM2UINT(c))); } static VALUE rg_set_backspace_binding(VALUE self, VALUE binding) { vte_terminal_set_backspace_binding(_SELF(self), RVAL2VTETERMINALERASEBINDING(binding)); return self; } static VALUE rg_set_delete_binding(VALUE self, VALUE binding) { vte_terminal_set_delete_binding(_SELF(self), RVAL2VTETERMINALERASEBINDING(binding)); return self; } static VALUE rg_mouse_autohide_p(VALUE self) { return CBOOL2RVAL(vte_terminal_get_mouse_autohide(_SELF(self))); } static VALUE rg_set_mouse_autohide(VALUE self, VALUE setting) { vte_terminal_set_mouse_autohide(_SELF(self), RVAL2CBOOL(setting)); return self; } static VALUE rg_reset(VALUE self, VALUE full, VALUE clear_history) { vte_terminal_reset(_SELF(self), RVAL2CBOOL(full), RVAL2CBOOL(clear_history)); return self; } static gboolean term_is_selected_cb(VteTerminal *terminal, glong column, glong row, gpointer data) { gboolean result = TRUE; VALUE callback = (VALUE)data; if (!NIL_P(callback)) { VALUE rb_result; rb_result = rb_funcall(callback, id_call, 3, GOBJ2RVAL(terminal), LONG2NUM(column), LONG2NUM(row)); result = RVAL2CBOOL(rb_result); } return result; } static VALUE rg_get_text(int argc, VALUE *argv, VALUE self) { VALUE get_attrs, include_trailing_spaces, proc, rb_text; GArray *attrs = NULL; char *text; rb_scan_args(argc, argv, "02&", &get_attrs, &include_trailing_spaces, &proc); if (get_attrs != Qfalse) attrs = g_array_new(FALSE, TRUE, sizeof(VteCharAttributes)); if (RVAL2CBOOL(include_trailing_spaces)) { text = vte_terminal_get_text_include_trailing_spaces( _SELF(self), term_is_selected_cb, (gpointer)proc, attrs); } else { text = vte_terminal_get_text(_SELF(self), term_is_selected_cb, (gpointer)proc, attrs); } rb_text = CSTR2RVAL(text); free(text); if (attrs) { VALUE rb_attrs; rb_attrs = attrary2rval(attrs); g_array_free(attrs, TRUE); return rb_ary_new3(2, rb_text, rb_attrs); } else { return rb_text; } } static VALUE rg_get_text_range(int argc, VALUE *argv, VALUE self) { VALUE start_row, start_col, end_row, end_col, get_attrs, proc, rb_text; GArray *attrs = NULL; char *text; rb_scan_args(argc, argv, "41&", &start_row, &start_col, &end_row, &end_col, &get_attrs, &proc); if (get_attrs != Qfalse) attrs = g_array_new(FALSE, TRUE, sizeof(VteCharAttributes)); text = vte_terminal_get_text_range(_SELF(self), NUM2LONG(start_row), NUM2LONG(start_col), NUM2LONG(end_row), NUM2LONG(end_col), term_is_selected_cb, (gpointer)proc, attrs); rb_text = CSTR2RVAL(text); free(text); if (attrs) { VALUE rb_attrs; rb_attrs = attrary2rval(attrs); g_array_free(attrs, TRUE); return rb_ary_new3(2, rb_text, rb_attrs); } else { return rb_text; } } static VALUE rg_cursor_position(VALUE self) { glong column, row; vte_terminal_get_cursor_position(_SELF(self), &column, &row); return rb_ary_new3(2, LONG2NUM(column), LONG2NUM(row)); } static VALUE rg_match_clear_all(VALUE self) { vte_terminal_match_clear_all(_SELF(self)); return self; } static VALUE rg_match_add(VALUE self, VALUE match) { return INT2NUM(vte_terminal_match_add(_SELF(self), RVAL2CSTR(match))); } static VALUE rg_match_set_cursor(VALUE self, VALUE tag, VALUE cursor) { if (NIL_P(cursor) || RVAL2GTYPE(cursor) == GDK_TYPE_CURSOR) { vte_terminal_match_set_cursor(_SELF(self), NUM2INT(tag), RVAL2GDKCURSOR(cursor)); } else if (RVAL2GTYPE(cursor) == GDK_TYPE_CURSOR_TYPE) { vte_terminal_match_set_cursor_type(_SELF(self), NUM2INT(tag), RVAL2GDKCURSORTYPE(cursor)); } else { vte_terminal_match_set_cursor_name(_SELF(self), NUM2INT(tag), RVAL2CSTR(cursor)); } return self; } static VALUE rg_match_remove(VALUE self, VALUE tag) { vte_terminal_match_remove(_SELF(self), NUM2INT(tag)); return self; } static VALUE rg_match_check(VALUE self, VALUE column, VALUE row) { char *string; int tag; string = vte_terminal_match_check(_SELF(self), NUM2LONG(column), NUM2LONG(row), &tag); if (string) { VALUE rb_string; rb_string = CSTR2RVAL(string); free(string); return rb_ary_new3(2, rb_string, INT2NUM(tag)); } else { return Qnil; } } static VALUE rg_default_emulation(VALUE self) { return CSTR2RVAL(vte_terminal_get_default_emulation(_SELF(self))); } static VALUE rg_status_line(VALUE self) { return CSTR2RVAL(vte_terminal_get_status_line(_SELF(self))); } static VALUE rg_adjustment(VALUE self) { return GOBJ2RVAL(vte_terminal_get_adjustment(_SELF(self))); } static VALUE rg_char_width(VALUE self) { return LONG2NUM(vte_terminal_get_char_width(_SELF(self))); } static VALUE rg_char_height(VALUE self) { return LONG2NUM(vte_terminal_get_char_height(_SELF(self))); } static VALUE rg_row_count(VALUE self) { return LONG2NUM(vte_terminal_get_row_count(_SELF(self))); } static VALUE rg_column_count(VALUE self) { return LONG2NUM(vte_terminal_get_column_count(_SELF(self))); } static VALUE rg_window_title(VALUE self) { return CSTR2RVAL(vte_terminal_get_window_title(_SELF(self))); } static VALUE rg_icon_title(VALUE self) { return CSTR2RVAL(vte_terminal_get_icon_title(_SELF(self))); } static VALUE rg_pty_new(VALUE self, VALUE flags) { VtePty *result; GError *error = NULL; result = vte_terminal_pty_new(_SELF(self), RVAL2VTEPTYFLAGS(flags), &error); if (error) RAISE_GERROR(error); return GOBJ2RVAL(result); } static VALUE rg_search_find_next(VALUE self) { gboolean result; result = vte_terminal_search_find_next(_SELF(self)); return CBOOL2RVAL(result); } static VALUE rg_search_find_previous(VALUE self) { gboolean result; result = vte_terminal_search_find_previous(_SELF(self)); return CBOOL2RVAL(result); } static VALUE rg_search_get_wrap_around_p(VALUE self) { gboolean result; result = vte_terminal_search_get_wrap_around(_SELF(self)); return CBOOL2RVAL(result); } static VALUE rg_search_set_wrap_around(VALUE self, VALUE wrap_around) { vte_terminal_search_set_wrap_around(_SELF(self), RVAL2CBOOL(wrap_around)); return self; } static VALUE rg_select_all(VALUE self) { vte_terminal_select_all(_SELF(self)); return self; } static VALUE rg_select_none(VALUE self) { vte_terminal_select_none(_SELF(self)); return self; } static VALUE rg_set_opacity(VALUE self, VALUE opacity) { vte_terminal_set_opacity(_SELF(self), NUM2UINT(opacity)); return self; } static VALUE rg_watch_child(VALUE self, VALUE child_pid) { vte_terminal_watch_child(_SELF(self), NUM2INT(child_pid)); return self; } static VALUE rg_write_contents(int argc, VALUE *argv, VALUE self) { VALUE stream, flags, rb_cancellable; GCancellable *cancellable; gboolean result; GError *error = NULL; rb_scan_args(argc, argv, "21", &stream, &flags, &rb_cancellable); cancellable = NIL_P(rb_cancellable) ? NULL : RVAL2GCANCELLABLE(rb_cancellable); result = vte_terminal_write_contents(_SELF(self), RVAL2GOUTPUTSTREAM(stream), RVAL2VTETERMINALWRITEFLAGS(flags), cancellable, &error); if (error) RAISE_GERROR(error); return CBOOL2RVAL(result); } void Init_vte_terminal(VALUE mVte) { VALUE RG_TARGET_NAMESPACE; id_new = rb_intern("new"); id_call = rb_intern("call"); RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_TERMINAL, "Terminal", mVte); G_DEF_CLASS(VTE_TYPE_TERMINAL_ERASE_BINDING, "EraseBinding", RG_TARGET_NAMESPACE); G_DEF_CLASS(VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE, "CursorBlinkMode", RG_TARGET_NAMESPACE); G_DEF_CLASS(VTE_TYPE_TERMINAL_CURSOR_SHAPE, "CursorShape", RG_TARGET_NAMESPACE); G_DEF_CLASS(VTE_TYPE_TERMINAL_WRITE_FLAGS, "WriteFlags", RG_TARGET_NAMESPACE); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(fork_command, -1); RG_DEF_METHOD(feed, 1); RG_DEF_METHOD(feed_child, 1); RG_DEF_METHOD(feed_child_binary, 1); RG_DEF_METHOD(copy_clipboard, 0); RG_DEF_METHOD(paste_clipboard, 0); RG_DEF_METHOD(copy_primary, 0); RG_DEF_METHOD(paste_primary, 0); RG_DEF_METHOD(set_size, 2); RG_DEF_METHOD(set_audible_bell, 1); RG_DEF_METHOD_P(audible_bell, 0); RG_DEF_METHOD(set_visible_bell, 1); RG_DEF_METHOD_P(visible_bell, 0); RG_DEF_METHOD(set_scroll_background, 1); RG_DEF_METHOD(set_scroll_on_output, 1); RG_DEF_METHOD(set_scroll_on_keystroke, 1); RG_DEF_METHOD(set_color_dim, 1); RG_DEF_METHOD(set_color_bold, 1); RG_DEF_METHOD(set_color_foreground, 1); RG_DEF_METHOD(set_color_background, 1); RG_DEF_METHOD(set_color_cursor, 1); RG_DEF_METHOD(set_color_highlight, 1); RG_DEF_METHOD(set_colors, 3); RG_DEF_METHOD(set_default_colors, 0); RG_DEF_METHOD(set_background_image, 1); RG_DEF_METHOD(set_background_tint_color, 1); RG_DEF_METHOD(set_background_saturation, 1); RG_DEF_METHOD(set_background_transparent, 1); RG_DEF_METHOD(set_cursor_blinks, 1); RG_DEF_METHOD(set_cursor_blink_mode, 1); RG_DEF_METHOD(cursor_blink_mode, 0); RG_DEF_METHOD(set_cursor_shape, 1); RG_DEF_METHOD(cursor_shape, 0); RG_DEF_METHOD(child_exit_status, 0); RG_DEF_METHOD(set_scrollback_lines, 1); RG_DEF_METHOD(im_append_menuitems, 1); RG_DEF_METHOD(set_font, 1); RG_DEF_METHOD(font, 0); RG_DEF_METHOD(set_allow_bold, 1); RG_DEF_METHOD_P(allow_bold, 0); RG_DEF_METHOD_P(has_selection, 0); RG_DEF_ALIAS("have_selection?", "has_selection?"); RG_DEF_METHOD(set_word_chars, 1); RG_DEF_METHOD_P(word_char, 1); RG_DEF_METHOD(set_backspace_binding, 1); RG_DEF_METHOD(set_delete_binding, 1); RG_DEF_METHOD_P(mouse_autohide, 0); RG_DEF_METHOD(set_mouse_autohide, 1); RG_DEF_METHOD(reset, 2); RG_DEF_METHOD(get_text, -1); RG_DEF_METHOD(get_text_range, -1); RG_DEF_METHOD(cursor_position, 0); RG_DEF_METHOD(match_clear_all, 0); RG_DEF_METHOD(match_add, 1); RG_DEF_METHOD(match_set_cursor, 2); RG_DEF_METHOD(match_remove, 1); RG_DEF_METHOD(match_check, 2); RG_DEF_METHOD(default_emulation, 0); RG_DEF_METHOD(status_line, 0); RG_DEF_METHOD(adjustment, 0); RG_DEF_METHOD(char_width, 0); RG_DEF_METHOD(char_height, 0); RG_DEF_METHOD(row_count, 0); RG_DEF_METHOD(column_count, 0); RG_DEF_METHOD(window_title, 0); RG_DEF_METHOD(icon_title, 0); RG_DEF_METHOD(pty_new, 1); RG_DEF_METHOD(search_find_next, 0); RG_DEF_METHOD(search_find_previous, 0); RG_DEF_METHOD_P(search_get_wrap_around, 0); RG_DEF_METHOD(search_set_wrap_around, 1); RG_DEF_ALIAS("search_wrap_around=", "search_set_wrap_around"); RG_DEF_METHOD(select_all, 0); RG_DEF_METHOD(select_none, 0); RG_DEF_METHOD(set_opacity, 1); RG_DEF_METHOD(watch_child, 1); RG_DEF_METHOD(write_contents, -1); } �������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/rbvtepty.c������������������������������������������������������0000644�0001750�0001750�00000005321�11701304107�017164� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte3private.h" #define RG_TARGET_NAMESPACE cPty #define _SELF(s) (RVAL2VTEPTY(s)) static VALUE rg_initialize(VALUE self, VALUE flags_or_fd) { VtePty *pty = NULL; GError *error = NULL; if (TYPE(flags_or_fd) == T_FIXNUM) { pty = vte_pty_new_foreign(NUM2INT(flags_or_fd), &error); } else { pty = vte_pty_new(RVAL2VTEPTYFLAGS(flags_or_fd), &error); } if (error) RAISE_GERROR(error); G_INITIALIZE(self, pty); return Qnil; } static VALUE rg_child_setup(VALUE self) { vte_pty_child_setup(_SELF(self)); return self; } static VALUE rg_close(VALUE self) { vte_pty_close(_SELF(self)); return self; } static VALUE rg_size(VALUE self) { int rows, columns; gboolean result; GError *error = NULL; result = vte_pty_get_size(_SELF(self), &rows, &columns, &error); if (error) RAISE_GERROR(error); return rb_ary_new3(2, INT2NUM(rows), INT2NUM(columns)); } static VALUE rg_set_size(VALUE self, VALUE rows, VALUE columns) { gboolean result; GError *error = NULL; result = vte_pty_set_size(_SELF(self), NUM2INT(rows), NUM2INT(columns), &error); if (error) RAISE_GERROR(error); return self; } static VALUE rg_set_utf8(VALUE self, VALUE utf8) { gboolean result; GError *error = NULL; result = vte_pty_set_utf8(_SELF(self), RVAL2CBOOL(utf8), &error); if (error) RAISE_GERROR(error); return self; } void Init_vte_pty(VALUE mVte) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_PTY, "Pty", mVte); G_DEF_CLASS(VTE_TYPE_PTY_ERROR, "Error", RG_TARGET_NAMESPACE); G_DEF_CLASS(VTE_TYPE_PTY_FLAGS, "Flags", RG_TARGET_NAMESPACE); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(child_setup, 0); RG_DEF_METHOD(close, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(set_size, 2); RG_DEF_METHOD(set_utf8, 1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/extconf.rb������������������������������������������������������0000644�0001750�0001750�00000003442�12002536277�017150� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin extconf.rb for Ruby/VTE extention library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "vte3" package_id = "vte-2.90" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end setup_win32(module_name, base_dir) unless required_pkg_config_package([package_id, 0, 26, 0], :debian => "libvte-2.90-dev", :redhat => "vte3-devel") exit(false) end ["glib2", "gio2", "atk", "pango", "gdk3", "gtk3"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end vte_headers = ["vte/vte.h"] have_type("VteTerminalCursorBlinkMode", vte_headers) unless have_macro("VTE_CHECK_VERSION", vte_headers) make_version_header("VTE", package_id, ".") end create_pkg_config_file("Ruby/VTE3", package_id) $defs << "-DRUBY_VTE3_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/rbvte3conversions.h���������������������������������������������0000644�0001750�0001750�00000003740�11701304107�021013� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBVTE3CONVERSIONS_H__ #define __RBVTE3CONVERSIONS_H__ #define RVAL2VTEPTY(o) (VTE_PTY(RVAL2GOBJ(o))) #define RVAL2VTETERMINAL(o) (VTE_TERMINAL(RVAL2GOBJ(o))) #define RVAL2VTETERMINALCURSORBLINKMODE(o) (RVAL2GENUM(o, VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE)) #define VTETERMINALCURSORBLINKMODE2RVAL(o) (GENUM2RVAL(o, VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE)) #define RVAL2VTETERMINALCURSORSHAPE(o) (RVAL2GENUM(o, VTE_TYPE_TERMINAL_CURSOR_SHAPE)) #define VTETERMINALCURSORSHAPE2RVAL(o) (GENUM2RVAL(o, VTE_TYPE_TERMINAL_CURSOR_SHAPE)) #define RVAL2VTETERMINALERASEBINDING(o) (RVAL2GENUM(o, VTE_TYPE_TERMINAL_ERASE_BINDING)) #define VTETERMINALERASEBINDING2RVAL(o) (GENUM2RVAL(o, VTE_TYPE_TERMINAL_ERASE_BINDING)) #define RVAL2VTETERMINALWRITEFLAGS(o) (RVAL2GENUM(o, VTE_TYPE_TERMINAL_WRITE_FLAGS)) #define VTETERMINALWRITEFLAGS2RVAL(o) (GENUM2RVAL(o, VTE_TYPE_TERMINAL_WRITE_FLAGS)) #define RVAL2VTEPTYFLAGS(o) (RVAL2GFLAGS(o, VTE_TYPE_PTY_FLAGS)) #define VTEPTYFLAGS2RVAL(o) (GFLAGS2RVAL(o, VTE_TYPE_PTY_FLAGS)) #endif /* __RBVTE3CONVERSIONS_H__ */ ��������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/rbvteterminalaccessible.c���������������������������������������0000644�0001750�0001750�00000002511�11701304107�022177� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte3private.h" #define RG_TARGET_NAMESPACE cTerminalAccessible static VALUE rg_initialize(VALUE self, VALUE terminal) { G_INITIALIZE(self, vte_terminal_accessible_new(RVAL2VTETERMINAL(terminal))); return Qnil; } void Init_vte_access(VALUE mVte) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_TERMINAL_ACCESSIBLE, "TerminalAccessible", mVte); RG_DEF_METHOD(initialize, 1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/rbvte3private.h�������������������������������������������������0000664�0001750�0001750�00000001113�11740310343�020111� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef __RBVTE3PRIVATE_H__ #define __RBVTE3PRIVATE_H__ #include <vte/vte.h> #include <vte/vteaccess.h> #include <vte/reaper.h> #include <ruby.h> #include <rbgio2.h> #include <rbpango.h> #include <rbgdk3.h> #include <rbgtk3.h> #include "rbvte3conversions.h" #ifndef VTE_CHECK_VERSION # include "rbvteversion.h" #endif G_GNUC_INTERNAL void Init_vte_access(VALUE mVte); G_GNUC_INTERNAL void Init_vte_reaper(VALUE mVte); G_GNUC_INTERNAL void Init_vte_terminal(VALUE mVte); G_GNUC_INTERNAL void Init_vte_charattributes(VALUE mVte); G_GNUC_INTERNAL void Init_vte_pty(VALUE mVte); #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/rbvtecharattributes.c�������������������������������������������0000644�0001750�0001750�00000004542�11701304107�021400� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte3private.h" #define RG_TARGET_NAMESPACE cCharAttributes static ID id_row, id_column, id_fore, id_back, id_underline, id_strikethrough; static VALUE rg_initialize(VALUE self, VALUE row, VALUE column, VALUE fore, VALUE back, VALUE underline, VALUE strikethrough) { rb_ivar_set(self, id_row, row); rb_ivar_set(self, id_column, column); rb_ivar_set(self, id_fore, fore); rb_ivar_set(self, id_back, back); rb_ivar_set(self, id_underline, underline); rb_ivar_set(self, id_strikethrough, strikethrough); return Qnil; } static VALUE rg_underline_p(VALUE self) { return rb_ivar_get(self, id_underline); } static VALUE rg_strikethrough_p(VALUE self) { return rb_ivar_get(self, id_strikethrough); } void Init_vte_charattributes(VALUE mVte) { VALUE RG_TARGET_NAMESPACE; id_row = rb_intern("@row"); id_column = rb_intern("@column"); id_fore = rb_intern("@fore"); id_back = rb_intern("@back"); id_underline = rb_intern("@underline"); id_strikethrough = rb_intern("@strikethrough"); RG_TARGET_NAMESPACE = rb_define_class_under(mVte, "CharAttributes", rb_cObject); RG_DEF_METHOD(initialize, 6); RG_DEF_ATTR("row", TRUE, FALSE, TRUE); RG_DEF_ATTR("column", TRUE, FALSE, TRUE); RG_DEF_ATTR("fore", TRUE, FALSE, TRUE); RG_DEF_ATTR("back", TRUE, FALSE, TRUE); RG_DEF_ALIAS("foreground", "fore"); RG_DEF_ALIAS("background", "back"); RG_DEF_METHOD_P(underline, 0); RG_DEF_METHOD_P(strikethrough, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/rbvte.c���������������������������������������������������������0000664�0001750�0001750�00000003170�11740310343�016433� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte3private.h" #define RG_TARGET_NAMESPACE mVte void Init_vte3(void); void Init_vte3(void) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = rb_define_module("Vte"); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(VTE_MAJOR_VERSION), INT2FIX(VTE_MINOR_VERSION), INT2FIX(VTE_MICRO_VERSION))); G_DEF_CLASS(VTE_TYPE_TERMINAL_ANTI_ALIAS, "TerminalAntiAlias", RG_TARGET_NAMESPACE); Init_vte_access(RG_TARGET_NAMESPACE); Init_vte_reaper(RG_TARGET_NAMESPACE); Init_vte_terminal(RG_TARGET_NAMESPACE); Init_vte_charattributes(RG_TARGET_NAMESPACE); Init_vte_pty(RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/rbvtereaper.c���������������������������������������������������0000664�0001750�0001750�00000002267�11740310343�017640� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbvte3private.h" #define RG_TARGET_NAMESPACE cReaper static VALUE rg_s_get(G_GNUC_UNUSED VALUE self) { return GOBJ2RVAL(vte_reaper_get()); } void Init_vte_reaper(VALUE mVte) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(VTE_TYPE_REAPER, "Reaper", mVte); RG_DEF_SMETHOD(get, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/ext/vte3/depend����������������������������������������������������������0000644�0001750�0001750�00000000245�12064346475�016344� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-vte3.pc $(pkgconfigdir); \ fi �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/COPYING.LIB��������������������������������������������������������������0000644�0001750�0001750�00000063642�12257552170�015146� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/lib/���������������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�014225� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/lib/vte3.rb��������������������������������������������������������������0000644�0001750�0001750�00000000074�11701304107�015434� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������require "gtk3" require "vte3.so" require "vte3/deprecated" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/lib/vte3/����������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�015106� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/lib/vte3/deprecated.rb���������������������������������������������������0000644�0001750�0001750�00000003542�11701304107�017537� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������module Vte extend GLib::Deprecatable define_deprecated_const :TerminalEraseBinding, 'Vte::Terminal::EraseBinding' define_deprecated_const :TerminalCursorBlinkMode, 'Vte::Terminal::CursorBlinkMode' define_deprecated_const :TerminalCursorShape, 'Vte::Terminal::CursorShape' class Terminal extend GLib::Deprecatable define_deprecated_method :match_set_cursor_type, :match_set_cursor define_deprecated_method :fork_pty, :raise => "Use 'Vte::Pty#fork'." define_deprecated_method :using_xft?, :warn => "Don't use this method." do |_self| false end define_deprecated_method :padding, :warn => "Use 'inner-border' style property." do |_self| [0, 0] end define_deprecated_method :char_descent, :warn => "Don't use this method." do |_self| 0 end define_deprecated_method :char_ascent, :warn => "Don't use this method." do |_self| 0 end define_deprecated_method_by_hash_args :fork_command, 'command, argv, envv, directory, lastlog, utmp, wtmp', ':pty_flags => :default, :working_directory => <current>, :argv => <user_shell>, :envv => nil, :spawn_flags => :child_inherits_stdin' do |_self, command, argv, envv, directory, lastlog = true, utmp = true, wtmp = true| pty_flags = [!lastlog && :no_lastlog, !utmp && :no_utmp, !wtmp && :no_wtmp].select{|f| f} argv = command && [command, *argv] [{:pty_flags => pty_flags, :working_directory => directory, :argv => argv, :envv => envv}] end alias :__set_font__ :set_font private :__set_font__ def set_font(*args) if args.size == 1 params = args.first else raise GLib::DeprecatedError.new("#{caller[0]}: '#{self.class}#set_font(desc_or_name, antialias)' style has been deprecated. Use '#{self.class}#set_font(desc_or_name)' style.") end __set_font__(params) end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/sample/������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552170�014754� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/sample/multiterm.rb������������������������������������������������������0000755�0001750�0001750�00000005120�11701304107�017310� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin multiterm.rb - Ruby/VTE sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: multiterm.rb,v 1.2 2006/06/17 13:27:51 mutoh Exp $ =end require "vte3" class MultiTerm def initialize @terminals = [] init_window add_terminal end def run @window.show_all @notebook.get_nth_page(@notebook.page).grab_focus end private def init_window @window = Gtk::Window.new("MultiTerm sample") @window.signal_connect("destroy") do |widget| Gtk.main_quit end init_notebook @window.add(@notebook) end def init_notebook @notebook = Gtk::Notebook.new @last_page_index = nil @notebook.signal_connect_after("switch-page") do |widget, page, i| max_page_index = widget.n_pages - 1 if max_page_index > 0 and i == max_page_index widget.page = @last_page_index end end @notebook.signal_connect("switch-page") do |widget, page, i| @last_page_index ||= i terminal = widget.get_nth_page(i) if terminal.respond_to?(:window_title) @last_page_index = i update_window_title(terminal.window_title) end end @notebook.tab_reorderable = true if @notebook.respond_to?(:tab_reorderable=) @notebook.scrollable = true init_new_tab_label dummy = Gtk::EventBox.new @notebook.append_page(dummy, @new_tab_label) end def init_new_tab_label @new_tab_label = Gtk::EventBox.new @new_tab_label.signal_connect("button-press-event") do |widget, event| add_terminal @notebook.page = @last_page_index true end # @new_tab_label.set_size_request(30, -1) image = Gtk::Image.new(Gtk::Stock::NEW, Gtk::IconSize::MENU) image.show @new_tab_label.add(image) @new_tab_label end def destroy @window.destroy end def add_terminal terminal = Vte::Terminal.new terminal.signal_connect("child-exited") do |widget| @notebook.remove_page(@notebook.page_num(widget)) @terminals.delete(widget) destroy if @terminals.empty? end terminal.signal_connect("window-title-changed") do |widget| @notebook.set_tab_label_text(widget, widget.window_title) update_window_title(widget.window_title) end terminal.set_font("Monospace 14") terminal.fork_command terminal.show last = @notebook.n_pages @notebook.insert_page(last - 1, terminal) @terminals << terminal end def update_window_title(title) @window.title = title if title end end multi_term = MultiTerm.new multi_term.run Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/sample/terminal.rb�������������������������������������������������������0000755�0001750�0001750�00000001224�12257552170�017116� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin terminal.rb - Ruby/VTE sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: terminal.rb,v 1.2 2006/06/17 13:27:51 mutoh Exp $ =end require "vte3" window = Gtk::Window.new("Terminal sample") window.signal_connect("destroy"){Gtk.main_quit} terminal = Vte::Terminal.new terminal.set_font("Monospace 16") terminal.signal_connect("child-exited") do |widget| Gtk.main_quit end terminal.signal_connect("window-title-changed") do |widget| window.title = terminal.window_title end terminal.fork_command window.add(terminal) window.show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/README.md����������������������������������������������������������������0000644�0001750�0001750�00000000752�12257552170�014756� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Ruby/VTE3 Ruby/VTE3 is a Ruby binding of VTE for use with GTK3. ## Requirements * Ruby/GTK3 in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [VTE](https://live.gnome.org/Terminal/VTE) ## Install gem install vte3 ## License Copyright (c) 2002-2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ## Project Website http://ruby-gnome2.sourceforge.jp/ ����������������������ruby-gnome2-all-2.1.0/vte3/extconf.rb���������������������������������������������������������������0000644�0001750�0001750�00000002223�11701304107�015451� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "vte3" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/vte3/Rakefile�����������������������������������������������������������������0000644�0001750�0001750�00000002414�12257553772�015152� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require 'gnome2-raketask' package = GNOME2Package.new do |_package| _package.summary = "Ruby/VTE is a Ruby binding of VTE." _package.description = "Ruby/VTE is a Ruby binding of VTE." _package.dependency.gem.runtime = ["gtk3"] _package.win32.packages = [] _package.win32.dependencies = [] _package.win32.build_dependencies = [ "glib2", "atk", "pango", "gdk_pixbuf2", "gdk3", ] _package.win32.build_packages = [ # { # :name => "ncurses", # :download_base_url => "http://ftp.gnu.org/pub/gnu/ncurses", # :label => "ncurses", # :version => "5.9", # :configure_args => [ # "--enable-sp-funcs", # "--enable-term-driver", # "--with-shared", # "--without-normal", # "--without-progs", # "--without-tests", # ], # :patches => [ # "ncurses-5.9-support-mingw32.diff", # "ncurses-5.9-add-missing-exe.diff", # ], # }, # { # :name => "vte", # :download_site => :gnome, # :label => "vte", # :version => "0.34.2", # :configure_args => [], # :compression_method => "xz", # } ] _package.post_install_message = "This library is experimental." end package.define_tasks ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/Rakefile����������������������������������������������������������������������0000644�0001750�0001750�00000026707�12257664725�014305� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- require "pathname" require "tmpdir" require "open-uri" task :default => :test def version @version ||= ENV["VERSION"] || guess_version end def guess_version versions = {} File.open("glib2/ext/glib2/rbglib.h") do |rbglib_h| rbglib_h.each_line do |line| if /#define\s+RBGLIB_([A-Z]+)_VERSION\s+(\d+)/ =~ line versions[$1.downcase] = $2.to_i end end end ["major", "minor", "micro"].collect {|type| versions[type]}.compact.join(".") end def dist_dir(base_name, _version=nil) _version ||= version "#{base_name}-#{_version}" end def archive_name(base_name, _version=nil) dist_dir(base_name, _version) + ".tar.gz" end @needless_paths = [".svn", ".test-result", ".gdb_history", "mkmf.log", "*.o", "*.so", "pkg", "vendor", "tmp"] def package(base_name, paths, needless_paths=nil) _dist_dir = dist_dir(base_name) rm_rf(_dist_dir) mkdir_p(_dist_dir) cp_r(paths, _dist_dir, :preserve => true) needless_paths ||= @needless_paths Dir.glob("#{_dist_dir}/**/{#{needless_paths.join(',')}}") do |needless_path| rm_rf(needless_path) end sh("tar", "cvfz", archive_name(base_name), _dist_dir) ensure rm_rf(_dist_dir) if _dist_dir end def download(url, local_path=nil) local_path ||= File.basename(url) open(url) do |remote_file| File.open(local_path, "wb") do |local_file| local_file.print(remote_file.read) end end local_path end def change_environment_variable(variables) original_variables = {} variables.each do |key, value| next if ENV[key] original_variables[key] = ENV[key] ENV[key] = value end begin yield ensure original_variables.each do |key, value| ENV[key] = value end end end desc "configure all packages" task :configure do ruby("extconf.rb") end file "Makefile" do task(:configure).invoke end desc "build all packages" task :build => ["Makefile"] do sh("make") end desc "clean all packages" task :clean do sh("make", "clean") if File.exist?("Makefile") end desc "more clean all packages" task :distclean do sh("make", "distclean") if File.exist?("Makefile") end desc "run tests for all packages" task :test => [:build] do ruby("run-test.rb") end gtk2_base_name = "ruby-gtk2" gtk3_base_name = "ruby-gtk3" gnome2_base_name = "ruby-gnome2-all" gtk2_packages = [ "glib2", "gobject-introspection", "gio2", "atk", "pango", "gdk_pixbuf2", "gtk2", ] gtk3_packages = gtk2_packages - ["gtk2"] + ["gdk3", "gtk3"] gnome2_packages = gtk2_packages + gtk3_packages + [ "goocanvas", "gstreamer", "gtksourceview2", "poppler", "rsvg2", "vte", "vte3", "cairo-gobject", "gtksourceview3", "clutter", "clutter-gtk", "clutter-gstreamer", "webkit-gtk", "webkit-gtk2", ] gnome2_packages = gnome2_packages.uniq namespace :dist do base_files = ["AUTHORS", "COPYING.LIB", "NEWS", "README", "Rakefile", "exec_make.rb", "extconf.rb", "run-test.rb"] desc "make Ruby/GTK2 package" task :gtk2 do package(gtk2_base_name, base_files + gtk2_packages) end desc "make Ruby/GTK3 package" task :gtk3 do package(gtk3_base_name, base_files + gtk3_packages) end desc "make Ruby/GNOME2 package" task :gnome2 do package(gnome2_base_name, base_files + gnome2_packages) end ruby_versions = ["1.9.3-p484", "2.0.0-p353", "2.1.0"] namespace :test do ruby_base_url = "ftp://ftp.ruby-lang.org/pub/ruby" ruby_versions.each do |ruby_version| base_dir = "tmp/dist-test-#{version}/#{ruby_version}" directory base_dir prefix = Pathname.new(base_dir) + "local" ruby_tar_bz2_base = "ruby-#{ruby_version}.tar.bz2" file "#{base_dir}/#{ruby_tar_bz2_base}" => base_dir do generation = ruby_version.scan(/\A\d\.\d/)[0] ruby_tar_bz2_url = "#{ruby_base_url}/#{generation}/#{ruby_tar_bz2_base}" Dir.chdir(base_dir) do download(ruby_tar_bz2_url) end end ruby_path = "#{prefix}/bin/ruby" expanded_ruby_path = File.expand_path(ruby_path) file ruby_path => "#{base_dir}/#{ruby_tar_bz2_base}" do expanded_prefix = prefix.expand_path Dir.chdir(base_dir) do sh("tar", "xvf", ruby_tar_bz2_base) Dir.chdir(File.basename(ruby_tar_bz2_base, ".tar.bz2")) do sh("./configure", "--prefix=#{expanded_prefix}") sh("make", "-j8") sh("make", "install-nodoc") end end end rubygems_tgz_base = "rubygems-2.1.11.tgz" rubygems_tgz = "#{base_dir}/#{rubygems_tgz_base}" file rubygems_tgz => base_dir do rubygems_url_base = "http://production.cf.rubygems.org/rubygems" Dir.chdir(base_dir) do download("#{rubygems_url_base}/#{rubygems_tgz_base}") end end gem_path = "#{prefix}/bin/gem" expanded_gem_path = File.expand_path(gem_path) file gem_path => [ruby_path, rubygems_tgz] do Dir.chdir(base_dir) do sh("tar", "xvf", rubygems_tgz_base) Dir.chdir(File.basename(rubygems_tgz_base, ".tgz")) do sh(expanded_ruby_path, "setup.rb") end end end packages = { "gtk2" => { :archive_name => archive_name(gtk2_base_name), :packages => gtk2_packages, }, "gtk3" => { :archive_name => archive_name(gtk3_base_name), :packages => gtk3_packages, }, "gnome2" => { :archive_name => archive_name(gnome2_base_name), :packages => gnome2_packages, }, } namespace "ruby-#{ruby_version}" do packages.each do |name, attributes| namespace name do tar_gz = File.expand_path(attributes[:archive_name]) task :prepare => ["dist:#{name}", gem_path] do Dir.chdir(base_dir) do sh("tar", "xvf", tar_gz) end if /cairo/ !~ `#{expanded_gem_path} list cairo` sh(expanded_gem_path, "install", "cairo") end end attributes[:packages].each do |sub_package_name| task sub_package_name => :prepare do Dir.chdir(base_dir) do package_base_dir = File.basename(tar_gz, ".tar.gz") rm_rf(sub_package_name) sh("cp", "-a", "#{package_base_dir}/#{sub_package_name}", sub_package_name) Dir.chdir(sub_package_name) do if File.exist?("extconf.rb") sh(expanded_ruby_path, "extconf.rb") sh("make", "-j8") sh("make", "install") end end rm_rf(sub_package_name) end end end end end packages.each do |name, attributes| test_tasks = attributes[:packages].collect do |sub_package_name| "dist:test:ruby-#{ruby_version}:#{name}:#{sub_package_name}" end task name => test_tasks end end test_tasks = packages.collect do |name, attributes| "dist:test:ruby-#{ruby_version}:#{name}" end task "ruby-#{ruby_version}" => test_tasks end end test_tasks = ruby_versions.collect do |ruby_version| "dist:test:ruby-#{ruby_version}" end desc "run packages test" task :test => test_tasks end desc "make all packages" task :dist => ["dist:gtk2", "dist:gtk3", "dist:gnome2"] directory "misc" file "misc/release.rb" => "misc" do |task| release_rb = "https://raw.github.com/clear-code/cutter/master/misc/release.rb" open(release_rb) do |remote_release_rb| File.open(task.name, "w") do |local_release_rb| local_release_rb.print(remote_release_rb.read) end end end desc "release Ruby-GNOME2 packages" task :release => ["misc/release.rb", :dist] do sf_user_name = ENV["SF_USER"] || ENV["USER"] project_id = "ruby-gnome2" project_name = "Ruby-GNOME 2" package_name = "ruby-gnome2" release_name = "ruby-gnome2-#{version}" package_base_names = [gtk2_base_name, gtk3_base_name, gnome2_base_name] archive_names = package_base_names.collect do |base_name| archive_name(base_name) end ruby("misc/release.rb", sf_user_name, project_id, project_name, package_name, release_name, "README:1", "NEWS", *archive_names) end namespace :gem do desc "build all gems" task :build do gnome2_packages.each do |package| Dir.chdir(package) do ruby("-S", "rake", "gem") end end end desc "push all gems" task :push do gnome2_packages.each do |package| ruby("-S", "gem", "push", *Dir.glob(File.join(package, "pkg", "*-#{version}.gem"))) end end desc "install all gems" task :install do gnome2_packages.each do |package| ruby("-S", "gem", "install", "--user-install", *Dir.glob(File.join(package, "pkg", "*-#{version}.gem"))) end end desc "uninstall all gems" task :uninstall do gnome2_packages.each do |package| ruby("-S", "gem", "uninstall", "--version", version, package) end end namespace :win32 do win32_unsupported_packages = [ "goocanvas", "vte", "vte3", "webkit-gtk", "webkit-gtk2", ] win32_gnome2_packages = gnome2_packages - win32_unsupported_packages namespace :build do desc "build all Windows binaries" task :vendor do win32_gnome2_packages.each do |package| Dir.chdir(package) do ruby("-S", "rake", "native:build", "win32:build") end end end desc "build all Windows bindings" task :ext do change_environment_variable("MAKE" => "make debugflags=") do win32_gnome2_packages.each do |package| Dir.chdir(package) do tasks = [ "cross", "win32:builder:build:prepare:pkg_config", "native", "gem", ] ruby("-S", "rake", "RUBY_CC_VERSION=1.9.3:2.0.0:2.1.0", *tasks) end end end end desc "build GSettings schemas for all Windows binaries" task :schema do Dir.mktmpdir do |dir| win32_gnome2_packages.each do |package| gschema_xml_glob = File.join(package, "vendor", "local", "share", "glib-2.0", "schemas", "*.gschema.xml") Dir.glob(gschema_xml_glob).each do |schema| cp(schema, dir) end end sh("glib-compile-schemas", "--targetdir", "glib2/vendor/local/share/glib-2.0/schemas", dir) end end end desc "build all Windows gems" task :build => [ "gem:win32:build:vendor", "gem:win32:build:schema", "gem:win32:build:ext", ] desc "clean all Windows gems build" task :clean do win32_gnome2_packages.each do |package| rm_rf(File.join(package, "tmp")) end end desc "download DLL for Windows all gems" task :download do win32_gnome2_packages.each do |package| Dir.chdir(package) do ruby("-S", "rake", "win32:download") end end end desc "push all Windows gems" task :push do win32_gnome2_packages.each do |package| ruby("-S", "gem", "push", *Dir.glob(File.join(package, "pkg", "*-#{version}-x86-mingw32.gem"))) end end end end desc "tag the current release" task :tag do sh("git", "tag", "-a", version, "-m", "release #{version}!!!") end ���������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665516�016274� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/COPYING.LIB�������������������������������������������������0000644�0001750�0001750�00000063642�12147676243�017744� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/lib/��������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�017037� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/lib/clutter-gst.rb������������������������������������������0000644�0001750�0001750�00000004327�12257552167�021647� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "clutter" require "gst" base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) module ClutterGst LOG_DOMAIN = "Clutter-GStreamer" GLib::Log.set_log_domain(LOG_DOMAIN) class << self def const_missing(name) init if const_defined?(name) const_get(name) else super end end def init(argv=[]) loader = Loader.new(self, argv) loader.load("ClutterGst") class << self remove_method(:init) remove_method(:const_missing) end end end class Loader < GObjectIntrospection::Loader class InitError < StandardError end def initialize(base_module, init_arguments) super(base_module) @init_arguments = init_arguments end private def pre_load(repository, namespace) init = repository.find(namespace, "init") arguments = [ 1 + @init_arguments.size, [$0] + @init_arguments, ] error, argc, argv = init.invoke(:arguments => arguments) @init_arguments.replace(argv) if error.to_i <= 0 raise InitError, "failed to initialize Clutter-GStreamer: #{error.name}" end end def post_load(repository, namespace) end end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/sample/�����������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�017552� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/sample/media-actions-pause.png������������������������������0000644�0001750�0001750�00000005430�12257552167�024112� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���0���1���œ^*"���sRGB�®Îé���bKGD�ÿ�ÿ�ÿ ½§“��� pHYs�� �� �šœ���tIMEÛ2Þ@\_�� ˜IDAThÞ­ZËŽ]W]õØ{ŸÄNHâ¼ ‰P"DœC1‡B™�s|�s`ñŒ0 $ Ê„!RÃ$(Û}o÷={1سÏé‹ívbËêvß{wíªZµjU�Àçë×OûG�Üðo�‡ÍkÀc�.àg`ëÀ»à‹�€›�ìSN¹Dò#�ïm^{BD"y³:úi‚4¸`ïf/?p9|ã›/þÚ̯Ì÷tªHØï÷¿ûío~ÿ3‹�0Ï3�ÀÝ ‡[/}çÛ?K)½Dòìï/ó|øç^}íû7>¹A7³|íÚW¯¹û×T5LÓtáèä~¿Ç4MßðS3;53œœœì„€œ3ó¦iúžˆ0¥¹°­ÝnGá…ž¿ö·¿¾ñ†Ç!ª¯\yT~ôÃCU/tè­›7å•_½Â?ü�\¾l€@M»1FÌsF Á�àá‡ÁË?xYî¿téBvrÎøÅ/.ï¿ÿE•)&xˆíÂ)%\½z*sàúõëH) �xˆÇ „`–I–úJ)ʳÏ>‡|ðb0#¥�PU„èÓ4ÁJ*�"ãÝÿ¼sÇL˜®<òØêg1¢ :RJÈ9/†ˆ~ðÑû½Vú˲~kfÆ“aeGEc„»;¥_” ÓØïwwtÀÍÀáB$‘R Øf 9@®jûýníÀÿÉUPÔ„1FzŒqV "ÀíjŒ$ ’ý3�C6Ÿ !”÷l.ORÃ};["(ÊKU¬d ÆU^Eéδ†EHàºbŒÈ92¾›5¼{;ƒªÂŠ+c%šr¡ËÇ�LjÆÁ^Âåôö_ÞuO[ÛéEcD¯ä»v¢C¨žC,Á:¡u•ð®›oo B+â"ud¡UYÞ9¬0àmBG2�pìòÄE°Jc™¨)S*}�Z_áÚ vâ¡"„²J`Ï€PŽ}æ.T)¾Ñ¨ „@O)QÕœq òŽ:¡Õe³lj ¥Tj òÈò¹<Øàmí”Ë/E/ªè4:ò+‡r'7Éù’ãÆxª4ºÒÑ!GAŸTŒßÉΚ\T1Dxªàš®pÜ H6w(8æÛ˜ÎÝ#°“M½”3ÏÛ!×N© cª4:óБ_ïôÚÈ­Ýth³Ó-ë÷íó¡h¡¼ˆ-âœyÚ±ÌÖ0U ¹&£‘7˜)kz@£ÓcˆØfäÌžW–6ŒVöÊNÞõ Y"·éE1ˆ8@’8ÙŸŽV.C´µë kh XJ „bŠ<›÷ÈÈ«”i‘dÅkzzÍP“ÆK#[óݘ'û›K;&ª•áê·´,´F)rŽÜZX(ƈ[;)CÚØ±¥(J,%PÿJZÉ�¼î!BUÖÔDÖ?뉓E¹nm5ÜJÎç@LF-d9Ôb*.¨h ¤qÀâ…km" UEš5— ˆ3 U…ŽªR¹­ôlŠÊ,äŠítU ¥‘…H3§ÙÖúA¯®áêJ?JJO!¦¦03ĸöšTµ¢ŒK¦YtÎó|@Î3sFÎÌóŒ+< Ö�˜Üœ1DzJÁ ólPÓŽ!mE* ¥É ôبjàeÕ‚KÍ€ÌTUØ ½öûœžvÍ? 7‘ª™75˜•¼h!s£l5„È„yO%þ&zdJ_ÑsPUäL” Ø‚õú>UºíÐ'À¬ÊB-ÓîÆ=Ä�75…š­‘B©\7”œ3ò<·IlrÔ&ˆò ÛÚÐDæ5Ó²¨Ê6PQJ`†«ðÕ%3åž w“ÞÈÌ-»Ù’ÚaŒ›ó\¾Î3rý¾u^+û�Wƒ›!D§ˆr™‘3½¦_6Ð[¦¼VvìMR³s¸ÂÍ`n9ÆHO)Á-ÀìtåÀn vh4t¨µZ1fÙ8Ð ´\x%Û¹¥Ðì£åAРj †Øp9B¨P«ÔƒY…—Cцlö÷›9‚{½l>R ™ÃF;¢È"çWïi dÛ„hËvð"Ì ÞÚgUÒŠ‘ìü\d°@„è8`ÀÌÒDu€Äb§Þ¹qz…ä:h¥.§´BÐÜR¢Çéî,ÅeUHÕCë÷…¸ô‡ ¡ÆBR±©¦H1RT8®JbŒ032“ jÍQ…0çе+vÚe' w/k•²5S˜íbÑ'¬z©Dxl…Ÿkf9·™3¹ iï“*R!„Û,·dUÄfF3-J)Á,Ôù°À©î~„�µfB zBîaÅ,C:„L­Ë’âl…PµCÂ\D3´9À‚Œr×€ÐÖ*nÖ ¹ëíÆ@Íÿ¡¶¸ÐH‡uMsB$·Î‰HWŸÛ”!f)`ÊÈBŠC…ÛÒ`jZ#Ë¹Š¶†›zñŒÜÒÈZa•F6χ„ܹ52_j (WA7ƒÚE È Ø+îµRJp÷�3/C­O›UÛìJ@ÈË,Ðׂ›FãAeë�gÎ…FÕ± ¯ªË¾)"¥"ËRllt])Û=À§)Ñ]i­s™ÄZcé·¬dÑšQèYÅæ'ˆ l¶„ÜÌ,Žª#ª M­MU6i!‹¬·^kÊ”j'nÍ¥h®–­}¡Ô9`‡H+âPv­ØÖ@Ù åÞ–YCúB¶I¬La ¹A4šù8h•ÖùxSã‡Õà‰¥9÷ƒc×õcr>°ŠËh±:Lî°*Š¡0f‚ÃÜûÁëmKïjb}[6µR‚©ž{B<pÎ,lóùÍ®èØ ³j²–i+ >Mû  "ƒ´A“ç.æ˜ÙïÏ:,ƒF¥QwŽšªmæ‚òÙ@£VK\=gh£ä(É[g¶!5ôNìîðZ„Ì�5ož¨p½v©²¢4Å&°<%³s8„�™‹ö:¼d.’¹/‰›öj66?3Õ*Ý1¦¥‘iOmÁ™®Và"y‰>ó¹­°¦¨¥i-› w„hª4sˆYr“Ó«Ë‚¥x[ðšmjõ2‘Õ Ä>cªjÇZŠÓ‘­ðzù;ΰZÅœ‡ÂÏc—ž¦ !̇CÁp‡PYN°YÛ\—c h“Ó)Eh•ÓññÇwGV„ú2k|ÆUfÖÝþ’…)N°àÜ>àˆ1ò Zí�ׯÿ»¸[íU[¤rËÊ_ê“ÿ®§Ü0M c¢©ŠªÊn·Ã_õÈpqççggg4317Ê\Ï1D@„f†ÓÓ=ÿü—?mÐÝÙ:==¥ªŠ©J‘.yæ©gÞ¼qã“÷H>4÷ôËVšÈ[÷ÝÿÃá0µubc!�rß4Ýpó¿|n>æ{´#�>zú©§ßHÎùs"‚·ßyû¾7ßúÇ“"rO¿ìB¾þâ·þ5ÏsRÕ€›«a¸”sNªzöÚë¯~ ro¿CR¿òåçß}âñ'v$!$•ä"üý‚ÿoàLDnÈ£!©�.‹ˆ}Fv²ˆÜø-¤µ¢ jR����IEND®B`‚����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/sample/media-actions-start.png������������������������������0000644�0001750�0001750�00000005754�12257552167�024143� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���)���0���Œ¹S¥���sRGB�®Îé���bKGD�ÿ�ÿ�ÿ ½§“��� pHYs�� �� �šœ���tIMEÛ1GI å�� lIDATXÃÍ™kp×™†ßïôe¦5Ó#Í[èf HÂDÙdŒ@Ø‘ÀÅN¼&…°6l*ÙZmœ”WÅû#ŽS¹Vâ®dXgãª1]LBðj7©Ø©dÙ2f/Æ‹(Ùº A£‘4Ó=}ΗÝ3#q $Áà©’zÔÓ5ýœ÷{¿Ki�b�jh��Œ÷ØKP@ �ñà\î½™hk_qß’%M_cà&&&²�*ä¸ïÈŠÅ‹Ò4Í»‰ø_ÏŸ_¥˜ùÌädF�7Røaf©”Âçþ***]ܰhçª;VnP @U°  �`f|üã÷òî]?å¶¶¶E†¡?þá®5¿Z²¤© €`QàÙãÉ·ÞÒ¡iZróæ-dš&­[» <88÷<÷ÁºÚÚ„išgR©ó9�vàUïFAb2“†ãäÐÔ¸„Vw®áúúz:Ö×÷AÃÐ×ÝrKý¼á³#ÿ'¥´+¸×ïâÂÌ ÙÜ Fdž¡é‚Ö¯ïÆ®gw¡ëÃ]U¦iþmGç/ÿÅš[‚¤º5ð+]W%sNRI03r¹,òž +laÍš»(y{’GGF¢™Lfc]]íâh4:06vn<ðª Ê_H)AD "H)‘s|Øõ·ÒêÕk¸¹¹ÇúŽ5åóùîE‹6¦'Ò‡r¹œº—¼ÖõU\é"?’Žã`ôÜ0ò^žV¬h¥;žÅý÷?+++Ûв¢å·--ËÖ†a-¶öZ–¬Ë*y)Xf†ëæàæèšU+ï ö¶•œžL‡ÆÎÞS]3?™H懇G ˆÀêº@@ ©$7×u0¿ªš:;:¹µµ}}Çd2™îÅ ‹–¹9ç¿2SSy"*ÔÖ�D"äóù?Ò4ÍDý-uBˆ9 ¾b H%1“�ª©®¡{ï½–ÖNŸ>½0VûLUUÕ¸çyžç¡Pȶ,+kš¦Ìf³¨««ÃäääÕA–——'æÏ¯*Bf,<ÏŠÉs¥7ïÂq€Ëno¡Ýù!H)éwÞ¾«¼¢|eUÕÍS§„å¦iš±X,?88( ±±©TêCVUU%â‰x%7oÞÇÉA*Y íÕ‚2nÞ“Ë!¯ÄÊö•ÜÙщý'掎®­­«í …B§3Ó˲•••†RjzhhÉdÃÃׇ¬¯¯ODíHÉÍmã:P¬@$@DD q•°ða³Ù03UVΣ»?zjjkèÔ©“ÕJ©OWÎKh¦aždfYQQQQ[[ëêºî ]²¡¡1ašzàCºù”â`AÑ9ªŠ �1Gy!òÒƒë:Pбô¶÷Ñê5k8‰ÐÉ“ýmžôîŠÅl!„þ†¦iÃ0Ê,X ò�ÐÝÝþþþRŒÅìâ �üáC\0€ÆÜó ¿k9YœŸ‡Ò¦Mò3Ïü˜W­ZµÈó¼¯D"áQ;ÒPVV¦[–U³nݺºõë×k½½½Ø°aCIÉd2™p]·ƒ™“›Ú‚|Þ+.†X\N=A—ð­¸äâ�ø6RŠbvŒººÖá¶¥·áÔ©Ó•çñM¦ê–E§ ÃH477+Ó4óGe�ÐÚÛÚSÓ™¥”éå¡”ºrÒàò‰%fyÌPÌPR"çf15•ë¹hjXB]]]\S]¾¾¾¤RãÝ ·c±ÿD"†ÂN&“8r䈣utv$R©ñ9¬dB€A@�ˆK(Æ`Vð<‰¼çÂusÈç]xž)=H¥ÀJ!Ÿw19•†¶héÒfºçî!=1=Ñby6;³QJïh"Q9bF´µµUè¶mCâÏjsß°˜xÎg +H1ƒ•3ƒ™/èPDÃÿ.^;žƒ“(•ãË_þ{ܺp!¶mÛz33vßtÓÍ ³Ù“™£ºµ¡‰Ò,à+àø)D~"1Äð…#Ò !fÍ£³È~×b”ÀÌPJA×5ÄìrXá2¤'Ó¼}û6>ü*Y–u<Û0tCÓ¢ìyÞ¨nÇlhºMÓæfw!Û…ðG%Q€+Õ‹F]Åà€—"€d.¶YfF4E4�>p`?mݾ•4¡É²²È÷>±áþe2“3;RÊÁÇ{Lê¶mCÓ4ˆ@ ?kEPû_úÌ‚ èfCra8c_G àˆAìŸÓuÑH‚ÿ÷«Øµk'½yìÍœþ{ccÓSímw¼=22ŒP(4òðÃOÀ“O> =B×õ9J *‚‚Di ü[ò1]hæ9¡ef! …aèΟå­[ÿŽ?)å+Íï{ÿw[ZVô…C!95•I†‘îééQ�ðôÓO£§§³”,Ýœ„(…]J(uŸÞ_D +@g{Ý0`&¤”¼gïsô“Ÿì€®ëÓ‰Då7ÿ®çó? 1³ `hãÆùÝ»wÛÓÓ�¤®Ch¥ä!\ÜêJ€³JÏ,Ra²e3 t‚¡›�€—_~ {ö>OoL%‰éìXóOwvŒŸ8#,Ë]»vmºpïM›6]Ô»uÛŽA×D1éðkVXK°¢'Š>¥ÀÏ~‰a0 !вŸ·oÿG:{ö,tÝxñ#뺟\¾¼uØÐuOO뺞Z½zµ€ÞÞ^tww_rÀÐc¶xR”œÅ\ÌÞbí#€ ƒ0‘àÙÉ# „¿¨™™Þ³÷9úÅ/ö³iš£ .|â«ý?Þzë´©”rœmy‹{èÐ!>|+V¬¸, �èQ; ¡éÅìF±(«âsZáùF)å_Ç�” Ô&04M@Jɽ½/Ò¿õ¾HçÆÇÇkjkŸyèÁ-;—·,Ÿápx̲¬‰êêj¼öÚkH&“W5™ë¶mC×D± Ï)¼¤ Xø½œ|µü÷0AÓ4º"Âë¯áþó)“Iöí_|äKOݶdé´‚R©ÔŒišçª««%�œ8qWýŒ£ !üpž,(FB€$CÏJ¿§û%%]Ó166†ç÷þ+<¨,Ë:ÑÞÖþÄç>÷…WÇ p‰h8 ÍÙ”ýc�@�¡ ˆÀ“ŠÙŸÌƒÁ—˜@Ä�Bh°L¡PÙl–÷ì¿ûÏßÒôôô@SSÓÖ/=òèX¬Ü ‡B¡Q�i"âl6 ˲þäGZRh¥Äap`ž=nV¸ ш �xåÐ+¼óÙ”sr˜7oÞ¶o}ã;Ûâñ„€˜9KD#�T¡àÿ9€EH´‚'•‚”ªØ ÃDy¬º¦ã­·NcÏ Ïã7ŽzѨýêÝýØ×ï»oÃqf3sžˆÎ !¦®õ^�¤ ˆÀ“ФôŠpV¸ çϧø…}{ñúëGÈ“Þÿ/»}Ù÷ÿæ³=Ãá°ÇÌa"cæ4©BÒÍÿ®¤&fyR1bv9ÊcþÆÃË¿y‰÷íÛKRITUUû‰Ç¿¶£Ð˜˜9GDCDÁ¤È|Má.Jœ‚'ožW�üÆ›Gég?߇3N<ÿå_Þ»á;ím+‡˜¹,Ø29/„˜œ ÷n�– ƒ²�CCƒü¾=túô)]ÿ]gÇê§xàSojBSÌlBÈ wÞÞ­×,%u¼ô›_ãÀý ¢l}ý‚Ç¿øÈ£?gf-P+ODïÑuÿw‰€…š®kØ¿ÿg™ÊDåÞO}ò¯~ÐÐИ`‘à<¥ßMß] RÔÖÔ¾D£­uåÖv­;€)fíõ í%·•RMD¤�Hf6‚A(`HáÞå.R2¨m€FDy�)"š¸Q¡½¤’Ì\ ÁÌ"Jª¾g�à÷>#Àwé®����IEND®B`‚��������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/sample/video-sink-navigation.rb�����������������������������0000755�0001750�0001750�00000006135�12257552167�024314� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter-gst/examples/video-sink-navigation.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # The original header: # video-sink.c - A small example around the videotestsrc ! capsfilter ! # navigationtest ! videoconvert ! cluttersink pipeline. # # Copyright (C) 2007,2008 OpenedHand # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # NOTE: This sample code is for libclutter-gst (a library by C) 2.0.2. require "clutter-gst" stage = Clutter::Stage.new stage.user_resizable = true stage.signal_connect("destroy") do Clutter.main_quit end # Make a timeline timeline = Clutter::Timeline.new(1000) timeline.loop = true # We need to set certain props on the target texture currently for # efficient/correct playback onto the texture (which sucks a bit) texture = Clutter::Texture.new # NOTE: Because warning is given, I comment out. #texture.set_property("disable-slicing", true) texture.signal_connect("size-change") do |texture, width, height| stage = texture.stage next if stage.nil? # go out of the block if stage is nil stage_width, stage_height = stage.size new_height = (height * stage_width) / width if new_height <= stage_height new_width = stage_width new_x = 0 new_y = (stage_height - new_height) / 2 else new_width = (width * stage_height) / height new_height = stage_height new_x = (stage_width - new_width) / 2 new_y = 0 end texture.set_position(new_x, new_y) texture.set_size(new_width, new_height) end # Set up pipeline pipeline = Gst::Pipeline.new("pipeline") src = Gst::ElementFactory.make("videotestsrc") filter = Gst.parse_launch("capsfilter caps=video/x-raw,pixel-aspect-ratio=1/4") test = Gst::ElementFactory.make("navigationtest") colorspace = Gst::ElementFactory.make("videoconvert") sink = ClutterGst::VideoSink.new(texture) # We can try other patterns # src.pattern = 10 pipeline << src << filter << test << colorspace << sink src >> filter >> test >> colorspace >> sink pipeline.play # Resize with the window constraint = Clutter::BindConstraint.new(stage, :size, 0.0) texture.constraints = constraint # Rotate a bit texture.set_pivot_point(0.5, 0.5) texture.set_rotation_angle(:z_axis, 45.0) # start the timeline timeline.start stage.add_child(texture) # texture.opacity = 0x11 stage.show Clutter.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/sample/video-sink.rb����������������������������������������0000755�0001750�0001750�00000005335�12257552167�022160� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter-gst/examples/video-sink.c. # It is licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # The original header: # video-sink.c - A small example around the videotestsrc ! warptv ! # videoconvert ! cluttersink pipeline. # # Copyright (C) 2007,2008 OpenedHand # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # NOTE: This sample code is for libclutter-gst (a library by C) 2.0.2. require "clutter-gst" stage = Clutter::Stage.new stage.signal_connect("destroy") do Clutter.main_quit end # Make a timeline timeline = Clutter::Timeline.new(1000) timeline.loop = true # We need to set certain props on the target texture currently for # efficient/correct playback onto the texture (which sucks a bit) texture = Clutter::Texture.new # NOTE: Because warning is given, I comment out. #texture.set_property("disable-slicing", true) texture.signal_connect("size-change") do |widget, width, height| stage = widget.stage next if stage.nil? # go out of the block if stage is nil stage_width, stage_height = stage.size new_height = (height * stage_width) / width if new_height <= stage_height new_width = stage_width new_x = 0 new_y = (stage_height - new_height) / 2 else new_width = (width * stage_height) / height new_height = stage_height new_x = (stage_width - new_width) / 2 new_y = 0 end widget.set_position(new_x, new_y) widget.set_size(new_width, new_height) end # Set up pipeline pipeline = Gst::Pipeline.new("pipeline") src = Gst::ElementFactory.make("videotestsrc") warp = Gst::ElementFactory.make("warptv") colorspace = Gst::ElementFactory.make("videoconvert") sink = ClutterGst::VideoSink.new(texture) # We can try other patterns # src.pattern = 10 pipeline << src << warp << colorspace << sink src >> warp >> colorspace >> sink pipeline.play # start the timeline timeline.start stage.add_child(texture) # texture.opacity = 0x11 stage.show Clutter.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/sample/video-player.rb��������������������������������������0000755�0001750�0001750�00000025410�12257552167�022504� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This sample code is a port of clutter-gst/examples/video-player.c. The # image files used in this sample code are copied from clutter-gst/examples. # They are licensed under the terms of the GNU Lesser General Public # License, version 2.1 or (at your option) later. # # The original header: # video-player.c - A simple video player with an OSD. # # Copyright (C) 2007,2008 OpenedHand # Copyright (C) 2013 Collabora # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # NOTE: This sample code is for libclutter-gst (a library by C) 2.0.2. require "optparse" require "clutter-gst" SEEK_H = 14 SEEK_W = 440 GST_PLAY_FLAG_VIS = (1 << 3) class VideoApp attr_accessor :stage attr_accessor :vtexture attr_accessor :control, :control_bg, :control_label attr_accessor :control_play, :control_pause attr_accessor :control_seek1, :control_seek2, :control_seekbar attr_accessor :controls_showing, :paused, :mouse_in_window attr_accessor :controls_timeout def initialize @controls_showing = false @paused = false @mouse_in_window = false @controls_timeout = 0 end end opt_fullscreen = false opt_loop = false parser = OptionParser.new parser.on("-f", "--[no-]fullscreen", "Start the player in fullscreen", "(#{opt_fullscreen})") do |boolean| opt_fullscreen = boolean end parser.on("-l", "--[no-]loop", "Start the video again once reached EOS", "(#{opt_loop})") do |boolean| opt_loop = boolean end parser.parse! def controls_timeout_cb(app) app.controls_timeout = 0 show_controls(app, false) false end def actor_animate(actor, mode, duration, first_property, *args) actor.save_easing_state actor.easing_mode = mode actor.easing_duration = duration actor.set_property(first_property, args.first) end def show_controls(app, vis) return if app.control.nil? if vis == true && app.controls_showing == true if app.controls_timeout == 0 app.controls_timeout = GLib::Timeout.add_seconds(5) do controls_timeout_cb(app) end end return end if vis == true && app.controls_showing == false app.controls_showing = true app.stage.show_cursor actor_animate(app.control, :ease_out_quint, 250, "opacity", 224) return end if vis == false && app.controls_showing == true app.controls_showing = false if app.mouse_in_window app.stage.hide_cursor end actor_animate(app.control, :ease_out_quint, 250, "opacity", 0) return end end def toggle_pause_state(app) return if app.vtexture.nil? if app.paused app.vtexture.playing = true app.paused = false app.control_play.hide app.control_pause.show else app.vtexture.playing = false app.paused = true app.control_pause.hide app.control_play.show end end def position_controls(app, controls) stage_width, stage_height = app.stage.size bg_width, bg_height = app.control.size x = ((stage_width - bg_width) / 2).floor y = stage_height - bg_height - 28 controls.set_position(x, y) end def new_rectangle_with_color(color) actor = Clutter::Actor.new actor.background_color = color actor end stage_color = Clutter::Color.new(0, 0, 0, 0) control_color1 = Clutter::Color.new(73, 74, 77, 0xee) control_color2 = Clutter::Color.new(0xcc, 0xcc, 0xcc, 0xff) if ARGV.length < 1 puts "Usage: #{$0} [OPTIONS] <video file> - A simple video player" exit(false) end stage = Clutter::Stage.new stage.background_color = Clutter::Color.new(0, 0, 0, 0) stage.set_size(768, 576) stage.set_minimum_size(640, 480) stage.fullscreen = true if opt_fullscreen app = VideoApp.new app.stage = stage app.vtexture = ClutterGst::VideoTexture.new raise "failed to create vtexture" if app.vtexture.nil? # By default ClutterGst seeks to the nearest key frame (faster). However # it has the weird effect that when you click on the progress bar, the fill # goes to the key frame position that can be quite far from where you # clicked. Using the ACCURATE flag tells playbin2 to seek to the actual # frame app.vtexture.seek_flags = :accurate app.vtexture.signal_connect("eos") do |media, app| if opt_loop media.progress = 0.0 media.playing = true end end stage.signal_connect("allocation-changed") do |stage, box, flags| position_controls(app, app.control) show_controls(app, true) end stage.signal_connect("destroy") do Clutter.main_quit end # Handle it ourselves so can scale up for fullscreen better app.vtexture.signal_connect_after("size-change") do |texture, base_width, base_height| stage_width, stage_height = stage.size # base_width and base_height are the actual dimensions of the buffers before # taking the pixel aspect ratio into account. We need to get the actual # size of the texture to display frame_width, frame_height = texture.size new_height = (frame_height * stage_width) / frame_width if new_height <= stage_height new_width = stage_width new_x = 0 new_y = (stage_height - new_height) / 2 else new_width = (frame_width * stage_height) / frame_height new_height = stage_height new_x = (stage_width - new_width) / 2 new_y = 0 end texture.set_position(new_x, new_y) texture.set_size(new_width, new_height) end # Load up out video texture app.vtexture.filename = ARGV[0] # Set up things so that a visualisation is played if there's no video pipe = app.vtexture.pipeline raise "Unable to get gstreamer pipeline!" unless pipe # TODO: want to not require Gst.init # prepare Gst's methods (e.g. iterate_sinks) Gst.init iter = pipe.iterate_sinks raise "Unable to iterate over sinks!" unless iter playsink = nil while (value = iter.next)[0] == :ok playsink = value[1].value sink_name = playsink.name # unused end goomsource = Gst::ElementFactory.make("goom", "source") raise "Unable to create goom visualiser!" unless goomsource # TODO: warnings occurred #playsink_flags = playsink.flags.value #playsink_flags |= GST_PLAY_FLAG_VIS playsink.vis_plugin = goomsource #playsink.flags = playsink_flags # Create the control UI app.control = Clutter::Actor.new app.control_bg = Clutter::Texture.new app.control_bg.from_file = File.expand_path("vid-panel.png", File.dirname(__FILE__)) app.control_play = Clutter::Texture.new app.control_play.from_file = File.expand_path("media-actions-start.png", File.dirname(__FILE__)) app.control_pause = Clutter::Texture.new app.control_pause.from_file = File.expand_path("media-actions-pause.png", File.dirname(__FILE__)) app.control_seek1 = new_rectangle_with_color(control_color1) app.control_seek2 = new_rectangle_with_color(control_color2) app.control_seekbar = new_rectangle_with_color(control_color1) app.control_seekbar.opacity = 0x99 app.control_label = Clutter::Text.new app.control_label.font_name = "Sans Bold 14" # TODO: segfault #app.control_label.text = File.basename(ARGV[0]) stage.title = File.basename(ARGV[0]) # substitutes for label text app.control_label.color = control_color1 app.control_play.hide app.control.add_child(app.control_bg) app.control.add_child(app.control_play) app.control.add_child(app.control_pause) app.control.add_child(app.control_seek1) app.control.add_child(app.control_seek2) app.control.add_child(app.control_seekbar) app.control.add_child(app.control_label) app.control.opacity = 0xee app.control_play.set_position(22, 31) app.control_pause.set_position(18, 31) app.control_seek1.set_size(SEEK_W + 4, SEEK_H + 4) app.control_seek1.set_position(80, 57) app.control_seek2.set_size(SEEK_W, SEEK_H) app.control_seek2.set_position(82, 59) app.control_seekbar.set_size(0, SEEK_H) app.control_seekbar.set_position(82, 59) app.control_label.set_position(82, 29) # Add control UI to stage stage.add_child(app.vtexture) stage.add_child(app.control) position_controls(app, app.control) stage.hide_cursor actor_animate(app.control, :ease_out_quint, 1000, "opacity", 0) # Hook up other events stage.signal_connect("event") do |stage, event| handled = false case event.type when Clutter::EventType::MOTION show_controls(app, true) handled = true when Clutter::EventType::BUTTON_PRESS if app.controls_showing actor = stage.get_actor_at_pos(:all, event.x, event.y) if actor == app.control_pause || actor == app.control_play toggle_pause_state(app) elsif actor == app.control_seek1 || actor == app.control_seek2 || actor == app.control_seekbar x, y = app.control_seekbar.transformed_position dist = event.x - x def clamp(x, low, high) if x > high high elsif x < low low else x end end dist = clamp(dist, 0, SEEK_W) progress = 1.0 * dist / SEEK_W app.vtexture.progress == progress end end handled = true when Clutter::EventType::KEY_PRESS animation = nil case event.key_symbol when Clutter::Keys::KEY_d if app.vtexture app.stage.remove_child(app.vtexture) app.vtexture = nil end if app.control app.stage.remove_child(app.control) app.control = nil end when Clutter::Keys::KEY_q, Clutter::Keys::KEY_Escape app.stage.destroy when Clutter::Keys::KEY_e if app.vtexture app.vtexture .set_pivot_point(0.5, 0) animation = actor_animate(app.vtexture, :linear, 500, "rotation-angle-y", 360.0) animation.signal_connect_after("transitions-completed") do if app.vtexture app.vtexture.set_rotation_angle(:y_axis, 0.0) end end handled = true end else toggle_pause_state(app) handled = true end when Clutter::EventType::ENTER app.mouse_in_window = true app.stage.cursor_visible = app.controls_showing when Clutter::EventType::LEAVE app.mouse_in_window = false app.stage.show_cursor end handled end app.vtexture.signal_connect("notify::progress") do |video_texture, pspec| progress = video_texture.progress app.control_seekbar.set_size(progress * SEEK_W, SEEK_H) end app.vtexture.playing = true stage.show Clutter.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/sample/vid-panel.png����������������������������������������0000644�0001750�0001750�00000124326�12257552167�022147� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR��0���l���t"ˆÊ���sRGB�®Îé���bKGD�ÿ�ÿ�ÿ ½§“��� pHYs�� �� �šœ���tIMEÛ V"¶™���tEXtComment�Created with The GIMPïd%n�� �IDATxÚì½KÌmërTcž}îÛv|åW!&†(<중ð–E?âÑ Ð!"tô=D D‚D‡=$$ˆ£H)„8(¶¯m¢hX !‡Døqî®Ac~U5F͵Ï='Ž„ÿ’î=¯ý¯­9¿ù}U£Æ#âíõöz{½½Þ^o¯·×Ûëíõöz{½½Þ^o¯·×Ûëíõöz{½½Þ^o¯·×Ûëíõöz{½½Þ^o¯·×Ûëíõöz{½½Þ^o¯·×Ûëíõöz{½½Þ^o¯·×Ûëíõöz{½½Þ^o¯·×Ûëíõöz{½½Þ^o¯·×Ûëíõöz{½½Þ^ÿo¾ðà÷ó7Àçx{½½Þ^o¯·×ÛëíõÙ_”3üíõöz{½½Þ^o¯·×ÛëÿÛ¯/ù+WDèÿ ÿû›öz÷ë}ƒûýÿÂïûÇ~ï òý>þ8>þø]¼{÷.È·¢ìíõöz{½½>ï Ÿs‹¿ÛàÓW?ü¹pm#ó.ŸÒlŸb}Nù Þ`þˆˆ”¿ï?Î\ˆ$Á"ˆˆ‹ xŸy¼2@É�¸¿?ÇùMÔoAý÷8Ÿ€ð0ïÔ~>7î/Œû÷‚çJÿt#÷g ÆuÝŸ‰d\ý¯@dÐÿžˆ ëßG;yß½¶Û›qÅýÛ¨"âüs½ÎçŽõßë:­¿Çy÷o­ÔŸ#ŸüÚ'ñ«¿öI|òÍoò¿ûoú/üóàŸüí§¾Ð«Íõ–¿î"ás=*ÿóÿò¿âoÿ-ÿäŸüÉŸúïÿú_ÿè£ë÷¼{÷ÑY†ó~³ÈÞ^o¯ßX¯o]Whçÿ™t2>}Jʽú“Z;>kóXïƒû�˜Gïùþ÷Æ„ÏñyŸŸ«6·½íÉQÐÿ?§Ö6±ß×JNÈõ{çð¸ßf>Ëü ùìçÏâñ‰ž›ÿýÆu•žŸ®7íý{íp Üô{=ˆÙÓ—ü©xy¼ð´±d.žï|ìëþköµ“¯/?\=nñ½ŽöǨC¼îM­çŸ{r¯Çz+Ni$D&ûhº^æz>†˜ÏYïÏó|@ ~.ä‹PŽèZku7s'(OX8g›®7ùluî‘øMçùœïtÖgÜE_]ó^_@0ë3íÕ6Eë³D‰þ.ÁS›°ë¸X;‰ˆ+ü”Õø¨jê;Î�Ÿ|òÍøæû÷õÿ_úùßõ»~çEį‚&Ï;T=›¿žBæsíÈßøÆÏþ+_þòÿ­¯~åË™Éëÿ…ʯXâËMÿõ_×-ÒÍAwè†ó9ÅŸmîç§ý,¿ÅÁõ¡ú>Öúâw¬ ª7–W¿“Þ®úfÇé ÖwêMª6ª¾~³1ëõÄiú­Î¦¼¯¹opu%2pï ²v0>¦+¬.nw8z©Èˆëªu¸®¤­=;‡Ãµ"ù,ç²%^ÜùËñìôç{èaëEÏ!Ý*eDz[©ÿ ·®K—ÞôÃ>« ¨ï!Ÿ|ÑUcÖØ)pêƒá@ï©úq¨kèÑÃj¹9÷´ßCFwê}àPד¿?Îç—zÁ~{ÿ¾^_û(ߘÞgùî`¯y_2xbl½&¤080ÄÊ\§^É^¨¨g©ëMØ?¿ú,R»õAs«žÛyPܨÇy&{mÙ¶‰�òü!Ÿƒ&Ù^07¬¸ógà:ןRWõš=¿3tÿ¢–ÏF¥®“,‘.à÷>»WMøí:ëh­SHhëXþß�84Ô†úl×Å_þå_Á/ýÒ_ýÏþÜOÿÌøÏüþú?ˆ/Âåýù«1ü›^Àü‰?ñ§þ©ßüßõ}ík_efây@ÊFˆøìò§ïŒº­¾ºâeÆÏø;ägdS|v¬!‹§H—6ætr£A¿ØÜž¾SeóPÙn?À1no¾‘g1ÖÆÀµYÞ²U`«šFoœ¾É…AË~°'"rEµ‹]gðágÍP xB½è:Äl:Œ‚šï÷»b YB¯ÅºÍs÷Á¹Àoù}¥ëÔk�ûú½g¯«NO:§FPh0}/­Z{”µ~þ©› ¬XˆëÅmßÏ)½˜ÑÎÎ>½ˆ˜‹’§x€]Ï^áð¢Çﯠˆ½[þ!X›Œ¸àß}hJÇ/ßø’ ÌOÙ'ê÷ê!oŸáŒU8Ϧ¿F:˜Nø >ÜÃ<±,àqÚµíbcßh r€Í½ÙOütõ,õF(EUÄÆ¹üèRŦŸ¢ô¥P&m5ÐIÐY›¯¯úœHÊŸ×qÍzVö}Ñ‚L MÖ¨¬®–l ‘õ<×UÒ%Ï'¬¡Å›63À]0]ZS¯zF÷ß—ËùU¿Ë°R7 =”7QÔaÏÀ^%3Á¼ ÁB€ïß?ñæ/ÿþöŸøí×uEf~rŠ˜oþ2,`~úg~&øþKñ…/~ó_ýMßñµól¨ÌSÑ×!Úñ„”§y4Ïfø>.9´Ÿå½ÙìªV7¦ûï¯ëÌ]Ï‚»Ö±ôa¹ Ñ:ØÉ:Œ¼òmpÕñáô‚UZô¦ ·÷ó’ñ~Ÿ«»ôiú)‹_@íøž›p(ìÉ×põ‹„Aä„/èú—ögöÆÐ?#Å‹¦*l®© õ¸î6¦6ÿûž‚ ÷LüêF –ÚÈR .¼øÂX¾áðáÁlƒíq6ÓÌ3î£;Œ`Þ›1¼!’¬Îµ7™û‚ÜxLÍŽïéx£0ë×w¾¯Ç=ùŽèGêînYÅëé2{—ªN‘:M¸Ÿ¦µ¦ìL”£v»û_g»®ûrn0CŠ(ßT°ÆMynŠŽyzÝ(úbêêï·[m?íèìùÅõ¡¢l£º•×þ6ëéÜ�54L¿Qå%ÔÍÓÎ�±çg…O†PèsRoqyƒÒÝ8òäõ]Î? òųNRá3ŽIÞûi¾Ã\kH¡º÷™ºK×ã|V ×ÙÃhoa¿ç1öÛã*¬Ñ{_Ù£FmÍ®àG´{ýÇ£ ë•Xç_íyðæ’‚¶DÚÝX ‚Tç¥ëƒt9|±÷îKßä5 +eÏCÒ…^Ç༧UW/qÌwYgP8.ø°G�Á¿ü¿ÿüðüÈ÷žÿúÉùß7?PÈ|êëzõ/öç~.þîßñ;â‹_Ê÷ßþm_ýCA$"y®-yo+<Ý×]ŒG'3ÈS”ð>�"î¿’<0Dâþ¬iðjö죦Å~j×eÎbæÒÂ:“è¼wæ‚ÔaÓË:² ¡È{$û‰Çù}IíØ¿û=É<6åÉ 4|¨d>q§zwòÉL˜.ʤÐíŸR½dÍ‚ioÄþ™:Ä‹°Æ<×’y®û<ü$©Má/÷•È› wVrs¾ßýþlÒXÍœy Öý¨Ù:e¤w„”¾~Ðy6;ž3Ч@¹ÿ[zs)Ÿ¥î!“RlÕ ‰s8°Þ?Ï)ú”qoF 2ñI='ó¾vq¾û¬ÏóÌéHMGb½™³‹žï¬E<ÑùeœäùgR�• =] ÚÚOÖ¨GW!§{&}<+Î;Èç)å4Rïö$×uWM0¹wôP‹UV³‘\ßeþüWo ö,œ‡Ðf®âµ'úSh—}ÎÓɱÆ5¼¹¹?“¬ýºþåå]ë²×l5+µ¦¹¦=÷Ì¥+¡ïŒ½º�ç¬ûXïɾ¶þA-îdo8ûÍŒ»fõÏz ñÚÛí+0äCuº÷KÛ;Sƒ¦œúI­óçîÖ#Ÿ”ßwÖ4jR@O4séÅ Ö3NêHgVʹ…àý]©ë|Á9Øx§A=„²Ïß_#íè=K&¾û»¿‹?ÿ³?÷—þÈþ÷þÀ¾ð…o‹ˆ¯DÄ#â ‡'óQŒréS_=—ŸþFü•ÿó¿þ¯ýüÚW¾||ôQHÕÄX]µ>Ø€@æ»×«zu:AP´¹+rۨ˜¦¾±»¸0’Ûl,xp ¹`nÚ˜ک¶mØ Ž>¼÷¬òÅ—£w‚Wu¸i3ž~š’ÂÎæ&FÎH,Ø6”û!0r}&Áðg‚°‰¡2úÃ@ÀJÔÁ >IkvÝ(©­Mý®èûS(tã ¼sæ„Ãকp¤‚óÂȶŠö„gîõ N:GŸÎêô:°6‹2ÇV…O(ø.úàc ì zµõŽÐÄÌþm}Èø¯»V]Ë:”zåÐà!#úÓN{^ÈççNƒ„¬ÓiÎÇÀ÷ Ó“?T!Ükih¥ãži#[r’ ¬Hzнd?£ŒDωušô:¢‰éóÑ-œiTQ‘ä5xªÏÛÏøA~®A“/è�kŸq¤Æ¶‹Ý+º,HÅéE|ß]3énøŠ¬îä³.û{©u•ë™Ô}‡ó×y§l]>ö/#\Í/ôŒ‘qæ=Q }ÖvqËir1²ºŒ³îû¿ëèÜ阘ñ½¶EWúâ>æoý­¿åǾïûó/ýøÿ—?ÿ)*‡ÏWÀüè?ü~Ûßñƒ?ø+_ùò—©ŒŒžBwZV±ç¥|ÊÔ×%„©Šç†àSŠ· úÂð9ËÕÍ W<Æ/þ´8#‹càUÐBU´ £Ó¸†x~¸-¾Ö+ö7pÆè™rpÍa6]Ø/ç!vÖÞ'<ÄÝg]†Bò ‹yH†”Š.EB½ïs:#´„ͨyéÁsº„³Áp€‚”y¡Ô$JUEèJ&m„ÚïÂ)Þj<R¿É’&,®E_;µQßÁˆ…á#œ"¯:Ö<‡®ŽT“×Ü?è8‡¦ÍÌÏA¤k\c'áHtÃA>ø«nzŽþÊŸ*î|†ãÁÒêö_Ù·âk¸W÷ØšK‘¤½R ç -š/yun+¯ |Mˆ§Qƒè°P+ëÏR†#ʉéuDç‹Z-ë˜BXgp0R'¹eÂÑ\@G‹¦Xë=^Gë mÊ(£._ö=²LA�!åûtrqz=có…¢¢¤ÛG˦ǯȼuíÚ~rÝ‹BŽíõ“)ŒüZþ×â¸áB‹OÕn̪AïK¯þ¸JÐ×OKigŸþOøT2£Òg ]ïøwý?ôcí¯ýò7þìÿø“qM„>æñ¹ÿŸÿóÿâW¾òå—LDëÞ¯™ÖùÍ×ñˆ„O>H¢ý(¢.äuÃÝÂÙ—Rn€ó;!PWU£× ôBª~”„ÔŠžÅ¦;ð‚Ñmʵc@8ôÎïÂÌ»ƒÔ½~œõL^¼!x膳uúçç 8dŽšÎy ã|péP¦ DÁÏë:B4ö®lãéäT®‘Òˆ}~ÖGõpy! {ÈüðDD/=l•3`:û_–⥛wUÄ™3kÇ+•]2€+RTU‚ÃÒãYL¦€RtwRqßÓÔBÿb )2Hìç&dnŽuÿ…!Zj•Kö÷(ô¹ÑûØèèUS¼Aš·Ñª¿^†-`=­ÂpÙÀ‡*B–Ýê ªÐ€Oží VûÚƒ’F÷U^œÂt+M’£É*äî¦)änÇç|xU\³.8{뵎lÛÁëãæa]X×¢”KWïUEϸzoÓ5I"pe(¨Ñè펜ުؠáÂažÉ¼hâæÀÀw„*ÔNÞ½ý]«JqM¤_ãËMÞ[ß*²®ÂíÙÐóé‰rBø)«éQNåÐ83ÜAíÃñ [Ÿ}UöïÅÀ|Á暨Ükä}î&Œ¾Ö{L¢•\`FÖúÄÅ_üÅ_Äß÷#¿ówGÄ/GÄ_?ý•ˆøÕËyÿ S6ÌòÿD|ãg¾ñï|éK_üÃdbnôü[gw=w!…:ÜÚܶ˜.TÑÅy+ñ˜'Wåž]fWìù Á«}AzH!`¾€S9Í­ŸáR ²„ÏtëÛ¦pwÊC ³»Q©*ãE×uª• 'qÍçG7™µ´ê:€òp'}l$s]E´Bæà ‘mäá5R‘¡ç³r÷3{-Í©k‚‘pފοIç"€ôâ…|9•›ÛÅéø ÞXÄ¡`öú×ÓÌkñF©êÞ¼´…ðŽuÐÁEô­ç …[ÐäºÃ#;oo¾Å«C›CМgêiõQo0DÂ@žV»Qã(ê5dÕáÈU:Œá5éÏq)£ôÞm@Ÿr«höžF漟®ÛKŒ»¢\VçY¡hÚ.9ÑÞShøôÀô©hòá+…¢g,1ëŸÂû.—°ýÕü=ú{§ñ•Ÿ (yäÙØxK‘0}¯«ÎÜ$ß8MPôHÄ8Uç÷%¼|LõÁ×ÏŽµD¬‘‹oTëú~¦Ð#Œ>šs'Eæû¬¡Œ^ÍÞ@þ4·JR÷¢§l½×} -8ê ä«5KÄâÜ®gj–/_0ä}Aá*7ޤÔïm®ŽìiÇÓ §Ÿ=›â×U{çº'ñ]_ÿ:ÿØý£ÿÍù©ïˆˆ¯©uqb>ȇù("â~á‹ßý{þžø—þàü/¾ðÅ[¸€ÀSû¤o<ý¶¯‘‹Ý@úìpKX#ü—éT}!7~·Ï:0þTK¯ÍÁ‡ R ïј¦(.‚¢Áõ Ðå­J/nˆUø ›5Ò³_E¥=Q‘ÎDÉ`{RˆL0FºYúFñ”eÏ%¤ÝÑH\µ³Æêø_(§”Nx%ÛŒÚFq.ò'Y±6°¿bš_Œn«reÅ`Þýø)æŠWì¹5^ðP�²p”D®îÆËá5\òþ\_Ë­±8=f�·èóåTvÆØ”u:ãšÆc^+Í—øÊOJØ]�¼=t K!ŒsykPPÏk+ ª³%ã‚´½¤…†Á*»¼ÎðzðV>À@à]œd >èRÁE1æÒ “ÎWc,•^!ëa‡³ÞÁ*ȀŹuŒW Âëy²ÒœDFWÓaºé Ù{¸ˆ]a]Hº¢ñùËgµýaó/áh ž4cï/|Óv6)#€Â½{2y¦ßƒ® ìµ±Gj† ï±ŸN0ð÷ßÿ½ï>ùäúÚŸþþÔϲYñ¦Hz‰ÀôÇù©Ÿú~×w~3‰§toOæÉ@À.èžþè8ˆ/YÓæ+yö1ê…2ÆaÎÅÀS9G—J z±âgNEæ²®žââÜÔ}èÈÀv y`bž¶ 4.s=Y—âJ}lðÔc¢) ÛÃo^Õxi™¨ø®ŠV‹W)÷óù`óìêƒIx+T& <È¡aЯ8yöõâÈÝ«A¼$·pþÅÓ»­Àmo¶¾'¦¨Ž‘_7ðÝΦ/x}[ÇVÏÃ5Ÿû>@ç—(„¿æ£cz¸Cl~�u|B7ý{48Þ<˜Ð&ÃÈÁÑ&lxÁÃRÂ-K=ß9Õ£J:õë¨g[‹1ã‰íφ]p-¿{L¶«ÒRêŽ$ã/¼˜‹6ù¶eý»pÁ"p¾*é÷’}íÿb=ŒƒLfnö[ðñÂÒáU*¦”X]ºO–¨4vp¤òzÕ´}êÞîÊéÝ•HSs\¯íKÓ¼L…ÞÁö;Ñ[ßðjJ¿U¦2¾ ! ûxkµãº?ʈýQT¿rR~õÌžµ›ánCÐEŽF0~á/þ¥øûÿÁàGÏÛþRDü_g¤ô+q;ù~3ÆÁ—ÀüéÿþÏ|ßwÿ-¿é_fÒ­• ÍMÆ”H«n¼ÚbúŒºŒµ¯$ɤ/�ìU%Dß1ìžâ23.šÆÝYÆ›€±¹:o³„m.d¸Ýt'‚áYìÐ5x>­ŽºŒÚDI7÷ 5ò€Ó`Ìì)LnM½M<w6_õ‡øÜÊåO\<ÝÇtäec³ ¶‰ `¾y¶UuöJÄwÎ'eæ-&ƒç`žÑŽøøp#Ýâð@i8¤¯Q%¹øW2ª‘9þM$­)²«p°ZT ÌéhòóÁ²]tPŽ*m®<,ôsÉS€¸ŠL¡ZZŽË*/·ÈäÂ(¿8£“!fèžXþ%ü 6¡ ð„@p¢fiŽä‹g:t݉·ËÞ;Ìp0ZaåE=wt…Û³<7…Œ4.Ònm¼„cCéÖZæ ˆŽæª…À|/0Ý̬Ön“àžˆ˜Þ¤s‹öA e¬•¹LÝý€l]Ͻ¯äݱà¤gt -jÛo ëG$éÁ«}˜l£G¼£bô/ùRƒ;ÄÖ`íÓ@ž± ²›.ô­_ôøCÐÖY³U®V´ëå†ã‡tZ´æåÐ8‹åÐ2¾Ò“,E9¢·nx@Éýú׿ÎïùÞïÿG~ü¿úñÿZÐuì} 1ï"">ùUþÌ\ä’êf™@oÆ,”Wˈk‹ÍT·B:”K—Ýn“žê¢(žZä(9ÑñèÔºÃ:…ÓE§žÏ½/º²Éq•œaÊ…fy›‰‹A »ÕIýÅÛz›ÈÐÁˆ äêã”G"J †t |ðê÷M^ÆËåF‹êÁSs¥ý^E´®¯™ÑjPÓ=%p&…Æ|«‘XQŧðÂsVÞ3¬sœ‡&‡'E¶ýˆ)YÊíQ6¬yñ<Ù‡»ÈT×xÊÈÒ}§´ ÖûV—¡žÅHPQ#‘² Ç%#û^fD\ô©òZÛ ο É{6?nЗAÐ>Z>eŽïŒ¶ä}Tøþ~&p XT@žMvøgÑÄÙ₽,ÊË‹GdÓÃÏ۔чË]t¶ýHîÒÆ«2ú5Äú)äÛJ-†ÝðRâ—td#ÎýLÉç˜^í´˾b„#¸y1ÀËŠ‰A9qäÐÛm °Ö‹¬Qõð)acöA3ÎïˆxÊ8ÍÊA+9$ØÍ"PÎe[T#‚ïêHúÈäz=W;ÄÕcGµ¯Ð ‚ Õ£þf@HæË£zyòfI·0Yû¹oæ�^ã¯ä 2È8«Ë¢#PF¼Iå<Ñ…鿦î`,H|8µã“O~-~ô÷þCkD|{ŒCï+ƒ»¾,ï""¾ç{¿ã;#x¾MYB.½¦à…L>ƒ¹Ê[>Ÿƒ¹”1Ogeôš]˸Yû(hª™ÌÃn•¦vô 7é¤Ç7cˆÈÔ®]I}—Áþ<Et óbÀepu»!ÎÄàcâýp;lTÃä Z–Èlr9TŽÇƒûÓ¤AÑ쎴ƒÒù)3ÌFmŒÀí""Ý_¥ „:®ˆåZ™6Zò÷mg8¯æIÙ¤äžÖZ(¢àrc­5pœm³ºÏ4³«~À–úåUNI!S³¿ ãu‰2Á)°7J§z(­« ,qd…8ñ¶›*cÅÒˆßí* ˜¯H`R]A¤²&>'‹0÷”ð»2µ„!£TÙÇØô.œsýtÐåï-UñáÈ%ï6 —ΔUUƒ}ˆbÒŽ{T”¬¤š¢€aD s­)][w8c~Jã9t±ý¦"æxp$Çâ)<bè­ÝÀ`Ö‘rìÎþ:ÄjH£•ög!8 s,.¦©ÛkŠR\Ô8­É¸ÿXÊ”Bzu?%ʘò:T†.ÿÝŒ;jO!#ó Ê÷‘6Ü©„¢‹RàŠéj§eÎs'VY݉ˆíZÌpC8†ð�cЗ6êœr¦Ñ´R‰ZhæåÀŽÌVL9Ÿ Ï ¹íç<V!:ž’ SÎMâQ^ãtIgh‰5¾ëëßYâ¢o;c£úß'«‰ˆàGö'ÿÜ?÷íßö•ßÇû*+Åoü`ÈúŠ,kgõ¼p½ð¶û©<9»>¾¢8Å~È›„ ®îòŠ-ÉfEâFÙ=]â‡Å8×Yco±™|fp`£) ÷óÆ"@;wçé±â$i;ÍlŒÎ*uÉ‹|Q•\xä"Š.ObF’«|äˆÅ(Ø›œçÌHídzoְΠ<õÝ!mR©÷gg^S`“üôpòæÓa12–‰¤{÷ñ¶ŒÀx6² ‘|-]ƒ± Ù ÍâûÏ)W¢ ¡]«|†È@!ÀzšDîüšM–§ù§ài9°•U«»‡Ëu¹fbž4-.D¹G»E8ˆLˆqåŒÚ(Èv¬b㡵ÚÌ÷Õ›éÜ V¬õ'äË9üÂD(y#ù MÖ¦ÝîB…ˆTB*\jÅÏt[ çšKÅ•ÎK"½>|œgM‹‡;ñð+ÂFãÚET¢;£ÍL1§1KJðæñÝ(ÕHÿ7g°Iè–é’&$÷º1!.5•Q ^ð¦dö¶0t•b°¹gäæv©;úëèž[Z¨bóãwïøƒ?øCÿøÿÏÿø;Çï7_ 1ƒÀ|~DŠrL£ØçþR™·ÖŸÒ5^Ü×giâÛG¿Áu®·é–vª9±Uªf”äˆjï 5¶iÈ|¼VRa‹gŇEH3OäsDr¢ôT"dC± +‘ÙöŸy͵‚òÚ»J(Œ^¶Ü'·ö´É²ŠRs¾ÿ<KY Gv˜^=·½?†°£™éú|÷LÞ£Š:ür€ëš‘bJ^²szI9­ ^‹4ÒåðPa¤ºSÖeÞ#™û׎[iR0¨3Vêìšî°ÊIó3˜OÜ(nˆöÂ|wK@®ú@dÕµ~ aÌmt+/ÊXì^3ÙbŠò€2··:™õ3gô›®(©n¹Î×=^d˜\3¸”‡’èûRAÈ"ÇÊ“’î7^†à)*@;ˆkÌÅÌFQÚ3{‹Õà!cÅ9ÌgѦ¿Ó­ ?�“²I‡„߇H†?wŠFÊï".¥‚ÙO%5ö¸¯�� �IDAT²ç•3Vÿ>Ì},t,µ´HCç.1P¼ºH› sQë)þUv>íïRùÕG>œÅì28‡ðÉ´m’ËXÎCh£ˆ0B±—eT2{Z&º ¬ÄìÁš\ÜPSýX.í]§ „>Aåi&Xž{rMÃÕ×ëæ)m˜‘×ù!æÙoF‚ÿ(|IA"µ8.úD5aCÈ¿æ2û\åIÙîÒø«ˆœ‚ðÄóF( í¥PV™ÄÿðßˈøÚA]ÔæWÏ¿kNÅõîÝ»¿IYºèÖßa\•0ûë‚þœg·$Á§iålNÙã Ì&ù ÖdÐ gJ˜BÛõ©òPèñÐ4‡Ùxc†Çüé\¼3&«…æ´:Y·vÞJ(oƒÅ¥.âÞdË{ ç½°õþ”ÐÇ%IW”¢³Œ„O©Ô=þ#¥#Ê•/óÛ!ucŸù|rFNÛíµ=0B²f  yá}:ߺöÑÇb— «À+¯Š”°îÙ›o{í gΨ•”¢[‹®|òËÏÄ¥£¡v~’©ät=ŸžbMSý…øÚÔ&–¡Þ8Ê‹râýÃËvgÅè½·gXpz¾Ö–p/;E7¸1Á’ic Ѝp:7zc %!ÎsÌÚz­½÷plÝ3ÌVÍçÄÅ-ÜûÐqÖÙ³¿þÜV䣛Çý€ }"¡mÞ‰RG9 ™Æ?QÆÉÉöPâiˆUDã Aî§óèÄ·iÉ…ë9Û\±˜„]̾Xsê\×k$ÅçÇ„Zl§iE`á _K‹HÉ@Sehó•”÷ÔyVÔMgñõ^œè=Ûggd!3 Ƽ†Jå˜;!‰A)–áõA™—kÍø}”ýsŒ(D¬0×ïû¿ï{â·ý¶ú-qg$}E<aÔæŠ¼{÷ñ»+LþBÐ<IÏ%%¾B"eî+'c8:ßr—ÏfÓ ß6 ¡vÚXÖ1Þ¨ºÍ‚%(Ï#a)ší2jùбz›ö1007˜wB¬ÉábæçƒÆÃC¾ràéXyH&A&›Oä@¦, í€Qï“7Mÿ“Ýᥭ„ð…¼¦˜JL¶IÄú,së“>ãWó¯<Œûá˸ÿLØÇæn@‹Š\³½œÔ]E{Ž&Y­Øiã”8U:¿Âë8„Ëúà Üsùȃž„yùÌdb¸ ©j¨x‘Ó±aåt9üŒVU—t ôÎÈãÌ ½—5ßѬ¼$õöŸ=ê#S<W!º/<%Ó‡‹‹áÅYs+–†Òú‹/ÕÄÓµYêx´7xáõâÀSgeŠ\)´º`®µ.ˆ~ñ¼†3â¹Oz-ÙH›Ïš-BH/ÐiLð‰ÌH…è;šZÌâ„.`ÞþòßÔ¥×Ædñ(?‡ç‚ÚüC‚ëpÍ;ñ|b¾÷¹ŒÇLÖø# ÂGWš‚eøØÎ#~,6RÆKÁ{ 7°Ö™š¥0JD¥¸OD»3O‚¶"OrâW‹ŽåªÉÀåPc.ºƒ-9ù©*¤½{ðO×A”ššÞК@;,²Sîæ©¿úÕ¯|ñ._>ÿûRDüßG9ýÑ!ùÆ» @ä‚êƒÖy§ÜØ€ò¸ìÞÃuí}±Rôßç=Re¬Ò½'½èE 3MFÜrÁ#©B£ú`丑‚±Oº¬J6„!ÜBœ3WJÎеÐF@r£s”+Ô÷ÌéÈ2e~ºÆO·õúÕ›Y 9áX£­ïN¾@Uœ¥�Íê’+‡Ú7Ž z€ZÎG p”8aM ©Lˆc§.dx~SXD£™B±iç`µr$$0Mè4f„,+ìl55Åyà ԈûVLœQÎMXOá� *uÚ4 [• /ÆZ[rä=2®³É¼ï‘“UþN ;ß3ànž½.â~ž.ä©gTØ`Cf3«€$<ö %ïuÃ3e6.jÛ ½àß ‹ä2áÃzÎ#Dù“ãì+ÏJ'j‡¨é(±2ÛX� 8¤A£†Y×ê³±¨ƒ‡<ûèeî*Ê#›X„Û•ôŒpçf5»TÓåEå® ×HÍ‹¢§ªlFi4žJo÷o©±Z€"«ò¼'—dìÝðܦ ˲ÅC‚M35¹´EÙŒ·’Æ~Ø9Rèn @óU2xL%@B ?ÄÍO)=s‹SåÇ}yÎJ b9"—ÉM2à¡Lµ 0ÿ£"r§pNÙ6(ÞÆÙ%Csp¢0Ý´ºð (Êe›t+pö¯/}ñ‹ÄåK1IÕ_ˆˆ©w×ò/ û<Èoظ$ºÈpø Úi2Äë")Ö Õç bUËG’tfº¹È3/Ñ»hêòvÌe~ï\M@êÅÞ~²[Ðß¶$yº˜z¾Ú¼íëR2]!Öö¼pr%ÒÜÐJ¶¼+‰ÜæFT`ê.‰”0fDLÓ×uÖ”›ˆqñvr%©:‡ªœ+–äš“)ÒNF^¼ç1—Ë Z¨rï[ÕwFUÚícº‡â.Ör„ݹÛæZ2PiÞ1R`Å”¿ƒGIgΫ—Õ3­ÊööpCu´A‘Ä·z &ïÎ>(iæ]©´þ\γڙ«íA²3~�±©±¿§[Ð%³ÃÔråX–ç@ñÙ¡¿4ÛdŸ£GKlò2èBÙðè&ÁÒÕQ¹z#¸<`¤H"Wê¯X¤D£¸Ÿ–¨îNN[æw4¤ù°Œ-À¹>…t†D’4/#ùû­ü 2ÚbŸ ˆucL9t™ ÉÎæ»uöY!0À͹IŽ ½?d‚!æ“étöþäüœî“Ó¶Êl…T=Þø[)ùJõ ‚‹ûa¯„E Öx¹“¤§hP…ÚìÝ}¡ù~k­ÃtŒùL”-»wµŸÔí>ÖˆdÝ 3!ëïã†L1²™3ýjJÈ»?þHŠ–/žÿ½抈÷×u¹\¯7,ˑё¡†3NÂGÏ”¦?‡æŸ4ƒæ¼‘‰^žbFä1«ÛÓ –áB¦WªF|mGÜÃ{P8XŽYpX·ÇÈðàP‰+„J3›,,*0‚¦¡¢Kuc5×"—%fÎÝŲÊs~ÊŸ3'Kí–¨–Ö1(Z¿vîD[é¸ÔjkzÖ*a†HåʈB‡*3•zU™V-G¬¼(§ª*ýcrŠÂC'¦Wõ“BIœØzM“&sqpÔ¦\x’c””’¹nûþæZQPQvgVˆg.ï“›#âÙ:1°ét¶ÃöÂFUBkl:¼3åQ]mLȳCÖAÜp{5-`¯!]Ëý̘7%½˜ëñ®\Šõ»(šð˃ÎñAÕ"<ŒÀ¼=Œ+€1òD“ÐïªáRéqAçy´%øV„¥-™µÌ‘÷RTxê_Å!%LY£&ÜÁ>Ì<ÆAŠæÂ+°Ð9 éb %ô\%Ï3¬di¶¹$4‚ ŸN¡G=èÏÊ‚ðXЈf©1Óz˰{+Þ'~Óã:ÓùHáWž;„s®d“h3ý¤x©5¡ø ºlU»ÙjË Ép£rFà]ˆ„AÛ®„¤¬šðAOzáÂPŠZv“2ªf¼ÄÍK"]ýt Õ®ë£S°|,ÈËÎFÂ;*ž‚æhöîîF9%­Jˆ ö…"8m§"¦ÊâÇð¸ GA‘@¦d0t§ÛdVÉR«òv¬j}9â*¬'¬{ý+ÃI…<Jš€Œ×hNØf73åÎÙÓB!ÆUTM}Aô(iþ!FNã”(ý+¨ÜRêk¼"¼Ÿ§zºÍ¨àH9TºHI‡9.›Ð¢t&rOe¡üüùët…ÄŒt8Ù¦<9ó_‘©\Æ úù)ãȳU£Íêo?0i6Í#A;iKq·XŸcRšÖœÞ€X.'·GÃY?pó0O`G{2D¿ÿq�½”£N-®Ïç”ÁÅQ9ªkTÔÍìQâpÉÄ×$Åé—Ëɸ»˜O˘µåÈWÃdõÐÂnÜÆ`¯Ö-Õ+ʬ*Àöj/‘Ý#8Ÿ®<Š ¢‚"¾£ƒ!óÌÓ@:åÍØËB]¶5ÊÄÆ÷25o®`Ø[‡a²mL Ÿ¶ª~k� ž3uœÞ)á[jKBH£,ŸsIøC°}| ~$š îR±Š4õÔ @ŒŸ™®»ö§‚n²ÓØcà»Ä—é:Tc?Z¡GU©”=ÃáŽöª²¥¸5gÉë!ž~†ÄØËú¤ULr]SãèбøI8m ¶ zÓ«æÝB_Ð$Þè‘Ær8ÌlSœP8’.»”Ëæ±möÔºâJ¤‚©‘PWÅ{AÌpIÜžU>˜ßž\KvxØÛøX)¹ÊÎ'NÏÇÐÒ jf7„¬˜"ÇW%kîÄPÐâˆqé„$»6÷d±²Òú”¨†Ív€Æ€‡ËRýt-¶*—¯Â´TQ£.†&Õ†€ÀZìÝðô +UØ•¢ªŠIÃsòÌ¡7¤©x÷FëFƒHt¸ÜöÉ©çBZ³©œ0¼ÆWFnÖÀ@ÌÊêñÔÆ]‰è”ÍN4?“Ä‹sn´NrÊó¸aäö-Ç™Çdzr5…TÌWV猇R'tÄ\‰÷éü:µ<GËßÙÏ]ûj0-?Íøž¢v|1eu…IE0‡�çyÖw‘i×H¶¼FÊ>¿Æ!„ %.âÚ|rAúž¹£e‘‡(ŸšQ„#1áNÁ8êÃ…ì|z"QøG:Ž–&ÊóÄ 4büàTDA²±”_%þ[ÃÅ“ýÈFÒ°ñK™ˆšmÆÙ,‹¡™Wa’jå×Há°^«áÔ}{çÌ…¬Ý\ã™>ÁlümrÒÄò<¦†ËºÑ½´,y˜G*´xxØï6 ìõŠðTXGa}¹�ãhq}LC[J£V!£EL¼FtŠ"ÁKÝóèÁa]ýÕŸqOš ê Ù°”å>hÖÍÙ¤|¦9ôâ”,‰©}IƒÊÕßäü–Œ•~+îœkÈHº;žo¸ÒÖìVPö¼È˜ís ©Wµ²¦Ò0% Å YF Å.O æK‘-£Å;–ʪ6÷–Hí…㎒ŒWfUj"ÖD­Ac,‡\öÞ9òô˜ :CŠ\çîv O„C@ä" Tg\½0f›“Ñÿe7®tŠñh˜ÃrÏ{§N—ÁÚp¿îª4ñÉ-M¡ɆJrA…?ÕE!ÄñŸ'—‹ª<c„©÷DÒbãZB}‘ĹZ­qËP.‡Ûf¬m©[¹wD›Ñ»‡}*òÙ×µš;ä3,hnÂÐÖ?ܨ²‹jçGégMqÆEHQ,jb¼U4’DÀ&Éω%ÿ"1UAºþlš²2Ì€QÝuûóu‘´ÅÃ>8{ÎM¬g˜b û0ûë0Y.!‘süJŠë„Z›kT)(U53©^fâ‘4ª&ÉskÑBŠÑàuï'be K@+ýû B“Ç÷¸Ë„“ÏÖMhô›×$³€óùƇ*Ïs;æ²éϬø¯Ì½?Å´r^º^d»õ´Mתæ®ÞóÓ‹\ˆJ0«ÙÚëS…&÷¹^üOˆ«½Ôñ¶È|©QÛëïÑÈY¼áÞ-%¡#› ÓEFê—„„Å¥Ì Ç„jˆDãå0ÅKŽÀ9ôÆ˾¹lþÃÇNôÍ€:îêHŸ…v¡‘â±r¤Þ„J?ñvP3¨S°•5Ò›™òXef¼<?(sû³aŒFª»ÎáúPF8ÊSipÀL#…”ƒ†P-ý¹²<j¦+c!§Æ{±DᆌéÔø¡PîMd\©Àä“.•‡×Bg*X®I~¸8/&rqªâÅHÅÿùð=(Ñ’™BÉÜ2c¬²`ˆ‘§S‹m ׿Cœb%gÇ:1ŒœY»B ŸÆ‚ëDVÊМ(,>âiJQäÉç‘ú¦zv¦î^n™Õvƒ u½E#uãš;œ¬î]ˆgÌ£É'4…ÚBźŸÓŒgÚ¡¹í4YYѤͣ(2x¯fxÎUyÊȈEHòð«®7ï*7ø›gï§ò³”“Àm›¯{$ì÷î<hù¦kp91¦ð€ÉøW·Dr螤ȷ…ÓÖäm‘ËgX>„xIß ZsôÄÚL9_§0¨¯44%§—g°E#]¬q&•7bàŒAµwÖUÐL2+¿«ÍBRÞèäJ-©4B( é{<áMÒÏ[iõÎOˆ+Å�qŒN¡r i÷£UÈÄ»±gã6­¬ ϬÐÌ7mÒLH“…9ÁN6¤´§[Ó~•cé!Uï5¨Òùù /lõ†vË9¡dIšæéñ’D/¨”.#LlÊt/ËaAއÇÿ¡=(ì,à)VKÊØ(%—ŽÅ‘q¯£:®TGãÕIô†®#8ðAð„¹%¢LQt^‘òRD¢Éxnb¥SÎÉêô…øM訂°t“Ժ̟ÖóaéÀaòÿT鵎I4“JºïV¥T¸^<e°71?»£-ËûP/U-ž…ÎØ„\Ë²Š‘Ôc¸nÃ÷tµ‰†]SH—Ww¦ã•sœ½5—pEZ0fjr|óܸ¤¢\ýè„r  “ËKM©ö Ùñ؉±‹q0j_ ¸—Î3›çº:ñ¢&| âeWüI+ïÔ}9œ¤o¦o6‚šQ¢¡kí†þ{t ?\ 攥\½ÂÔUã¹BéøˆQA÷È~ ÜXjŒ£À:Ï­Z©‚ƒAŽ”}Öb‹KäۂטlL§žÅbó_IÎ A7TËìnP=‰ˆ±E(ç^Ü[Ú½OdseÂBXóQK+¢[yN¨¶1ã8³ãð=.v.W‘¯‚·çòQ×UãýâT*‰1ê›CÑCÿú®a# Ž‘à&i7ô£fDaŒp#8CfÁ¡rj15sŸÚDm¾7Fž¢ÑàøéäA±ë° E%­ÓMüFå«„_në:0ů"îpS …“€,Î&ÕT)/•ÇŸîFÒ-›lwñá Å.3+Í| Ûo¨RgÎc“Mï4º@I½8†e"',«ôèPµe|8ÞÚ#?uŽùK·"ã\©ðdºÙsyõ®(ËëæVȨñYÅÏ2Ïö¸«.X#šärKsÍëÏVÜ…^ÿ)ÒXÍ•RE l@¨_§à<Qnr&¸d½å«¢Q R¯,R.e?3})\û CÚhØ;a¨W‹¥CT9:Šbu…Ì8ÎÎÃÓ€ð­ø^õœ¸F@ÅlóVSžÑÕåßÍVcy¨HX®r(Ä!Ø¡R+qÅdQ­ú/3EƲc@²"“¦Ähµ§ÃMË¿*øHl/ŽO󳯕+?3ò;N ´KŸÙyR€\>¾ñÂÙUbi!ƒçÈùÞærͧ XÃ:»T‹( TæM3a°¤gˆA8M\í+Ý<åÐ(6€Úk ¦¾¢pa£7Go[Nnþmx¦Ê÷×)|Ré‘9\W4¡ÚY^+Xã£8LZäµÚ<&kƒ,¨¿ÏîMŒ*ZûЄü^ØU1¹y±O7ÃFe˱fr9éªC§NCç œÇÕ<îo±›‘[€Öbqcº]˱Iš±äÉgƒî¹&éµS“’séã.ã"uU©#5“Iº>>LäÜτ¦¢°@Í’¢6øSÞÐ:í᜵… i)†N#4?+–pª8ü«¦_²pL®t>K:/ŒXî br©ÜÚ{©1õ³ÐýUºÐûþuÓ®âs¬”aþKPo£•¥¥Ü«AQ¯)0~ ±¼Qê¨Á‚¨(Šô}üƒ¸¤Ÿ’«•ï;åöìÆ“ò¢bsGb…LjaîÛ#ü4¥¬YÈ# £Ëåº|¬ósÖøxöÄË$nšœÆÈ4¢ú ìÅã×TEº¤ôO!Pê{-yNA|Km—†³Q\E\·B+¥ •ùbyûT%ÖXb‚r´U¯¤.š$œÐTsTÇìéb I‰.6³ÒlË(5¡…­¹‚Ë÷³Å™¡‡·*g %ÿý‰‘R£ ‰O-%þ‹\_MNÚ˜-DÄñ O"¦ŸÑö»Òñ`À¸…„”gCŒa#®sÞ{£ls÷xåµá5ÎeðVŒ¯†§ò†0ÖuŽ«3W>‚ÝÌ%K/·C6‰l/¹« TdV,rç–ZJ¬sÅuEÈ…úPæÊF:M9é¼{Ÿ5~Y©È£;»u¹‘âSíZHhj³ÐID–V´ ůˆ¢&Ï –QN#fzÒllgá)_‹&ƒx5ÔîwCÍȨ “2MQæÜ˜-¶&@{V•¹ïPÆ/²¦xMÛäŒ)£t:èaêÆs:%M¾‰‰ x;¤¬ÏŸ!EVÅ5¦…†Ô`™ü¡?F«ï -Íê:ú™à)ÞÎAÑŠq×lnîjÞý´:wÎGÿîÎ*@s“™,b«TƒÔ=[<;”Ðo~7~ô"³ÄsÕIùAaYP‚3=PMÊcÈ [Œ» v4œ¢¹›3fOɱ*>Ì3 n¯µãBz}½¿ ›gRì!Ë¡%�ä)C!¡£«ºî›–Í¡KéÚëÌQ¸Æå1Aµ5Qçy³VØHPÿ®£N+µ+i²~3m%oDV9wZŸexУ=ªÎã“ãƒ/T[‡¿U·‚fŠåó¢Íi)]}?â‡Ç¼4‡CÉâ«÷åÃÆ1¶ µŽÐ•°þl=-É1 õ÷TŽÜë‚åÀçÄm†…O DÛåè0hç(ÆE‘«{>˜ºâ7ÉÙ1Ã’,Úæs]=²@|±í†9zô_Ì|OnVÇæÛ1^)w ò·Ê/iÀb<$ ít²>ãQ)!,̲×jN–ú¼ t^+YPê=Q©Ú§­j~‰:£.r[KûÒLÿe¬57æö¸Ì‹B=NsÒÄU)èÁ7a$ÞT·eJH™È”<;F¤Â¡éÕ³Y¤¨k²¥¯Ré_rÈ]kÖx<‹&Ìx³Bë:!=eleÈÉHÊ+ñu ë´ ¸æ–¥’…ã-q„“õÄ…´8[)]#¯!ÍÒŠ¢=f$€r½û;×ìð; \ÒZ¿ƒú<dú>y(Œ åwʵïÆëxvºR4hq'j8†[ #M.ûÆNVž–A§ð­*Ý7æ¹ `qU´c¦8z‹¿)EB©½^˾æ–ÖbÇ%ª´îÛtîéÕ^c§kžšéCݲÃcâõ=A^͇¤û9Qó¨ò’DoŠý9 NÈX9?2V¬õê…„C:AÕ©ª©áh¥R-Ä¥\CO‹ŽãhF\îâ!›ó´ì6£Á0ÅO;ûZ�©6j|$Fxi¨X“\¡>@”ÑRˆbsÆ×ª<n‡l*¯DS­ÑŠ-ó9„y9›y׿.U~woN='†Î±Uö«ó¯Ù¦BMá6É}ðJ&†¦Àj> Ôs#$m­-Yh}(_áõÃê®ôa.%Ì6™ ݬ<¶rGk›ü˜÷gŒ%ÛDHÕ)>¨yÃ>×L1Âà ъÍÍÈQ9a;K^r˜ّʧ›Œ'†‹@—¹A )Öá4¡9´J÷@°;Ew¤tašeTl*8{ÎZìñ„9«ì\Ò„E›ï8Œ,Øuë?ç2b”ûyàÞVV¨…EºtW³Êãр햔†Ì"%b±\o—™0ã[*g§Óšc¥ Gs!x|~.nþ¾ÀÖBèoÒ(®æ„Q¬ ÆáûVÕàB“!~C-¬˜á}ŒôX6”Qƒu£fKQD*±®93S·BˆÓTk ¥©½‰[!‡ÝÆ¿;ÄHÑJ([°!r_98•Á©ÈªFfb†8>3"û·æ·äøtUNÈ!oÅÊò¥ÂìM>í9õº‚åaqŸصWK•ÑÔ~Qq› FNlC7 r 4"£, MÂ>ó̰•›½R¬·S½r¤œÔ¼S(€‰èõCÝÕøƒ ±¾W6—ì×\äçˆsŽTžTý™œ"Ì"V#«£Ð§Û~Üîï-IãÏB­+ø’I‚gÃåŸq.`b<@ æz’èATç!DÒn–ˆ—ÎïK* 2‚y|µ^êÔg•'G» Ö<º ušç.sõšÕC‚â\™+é¦dtbí~šó Äfv".ò©, |14 %¡Ú5¢[ß+$ZŽÃ ÁßåÜÌ*3áöù{3b[[Ñó ׸øŸ,·ÏŒ‡£°´†•µÕå„c#+Ú#©ÁÐîÏ­ö[‚û3ñŒq¥ÌÛ'„O” D¥*Þ¨¡™9ŠrP·!ÂJHå©T@/„í÷ u¤6oœç®œ<Û`2GÓî®EÆ[×n?4TXVÉÍ ýKg¥¾‚–˜k]ÈðL¦®É×|Ôƒ×B?Œ«À‘¡$¥xùÜE0ø~™ÀÎVó@ZK®W±ºnÆ (Ü0ù¦FŽŒÌ; J¬Íwqø,1gü*&‚ÆÙ2Z{?z„MjñžJ8\ÆÀBžoÕ!Ý5\Ó¤ Þñ‚TAÑ¡iÉÖX!‘¥ÛýUˆºwÙ a_ûVu Ôú‘)¡k¬IsZaIV•€ÂtI‘G‘AZÌE“ÿ+]} û"5kÚÓ´Q¿§që:îa~8Xdž{‚Ò.ïsÖ… I†Î¬çšÝÇÐüÂù„~>× ±·(‹53sñ)¨¯ë—L™±ÙÜ·‚KLÆF¾¨DªKˆbaЉûØB�� �IDATã%›¹“t¡«1Ü}ø…f¡ãºÄ÷Ä%›¼êÁÉ~hKÓçÍ$Û¨á%‰Û µSj: )ë.„Š5É'PO¸6–hüÆòfUJ÷20e´I‘_<¡ŠBaheè—€FœÔˆ4†Ž`‰ËMÒ¹°‡Ãßÿô>Ø=”3@ú¨È<\Õø/ ¡B,uX‹„<šê«é4çàË#QÞæJýDÊÚÓ»a펹.Úø¸VWò%®–MðkcH¸w‹:³ž¼q‚ SShp„Ì<g4ažkÝë”]§ÞQCʬfáþU—ìõŒ\'°°MG7ÆFxƒ—Œ]ÕÞ‘J9vÌÇ4ŽbB Å„â9„Ë”%/žâÒL9¸’®Œ¬dî¸Z}âa§#KM¢÷Ë»cž&‹ËÁ<8c{A‹ã;»ð#¹/àd¦«y O"Fl/1ˆær½•Næv±°õ¥  h½à”< I¯y.8~í3)M°ú ¡£p&ø¶‘LæÚ½û:c›Ó¸‡<(ûÕ=[P/ÊZ‡8–aÜڥαf¦|†²a[¸Úª80eÒ´ó3¦{P ’èCÔJ !à ,Õ@FšKh6É¿›KQLÅ™¨ñfÿ=´h_¢À ÛÔO)`š'`Ðër#Ý*› Ëƒ¯xŒPäbªUÍ"!IIm£Ä>›á|Å’¤j¬xáÙܾ?sÙÞ‡ÌåcFd¥¶J•;Ëæ\ÛH_ú9§dÎÐr€ÌqU˜ízüj¶ÅŠºgöóv |vä*ˆ°hùPƒ¯—öñ°ƒóÚÔN=X4 Òø*4 g<èjå8ê[«¹œ¾Ú¶W¶J¥KvQŠX¾SxvV)¼ÆWd…ä™ÇÇ9дñ4˜Qº&•yÏ%KCc4ŽH1Ë”0Tê·&ÇŠþ º°ÎáVP­ú€aœ.ŒîÝt‘iéÔqˆø 0L{ØÈa# XªŒ ߣ~WPrÙ0£Œv¦Ó¹á\n‹z¹þ%y×ÑY†xæp{ÞhÊbŨӯ€6{"YÖ4iõô„ÒMófü›‹8¯Äj˜úerˆàaVóŠ[w8ßDÃsQÙg)<,jØúì]lõ­l¹¯æÙÞ/&¸"gF(o(Åöƒ"ó†eÎmÕLåŸA,Ú+ÃÍxÓdhf^„rF‹ÒàÞ<°Ï|GˆßDý ãÐ(ñ¹’Èã5FSg'0@,£Lå^‘æŒ T-�¹ÊeAÐ Äd|%ލŸãçÕ×ÖÌm S8äó¼Qó°ùË cE G$iQàv”=.¤Æ*Ÿù˜©ú¿ë 3 ” !ya¦JW¸ÄÖF&±|-ÄXL¡0øçè(†ñüU7¯GsM'2}LŽ ÅÄÁÖ¼îOâñÑã¶kxJ’O2c³"°Æ|V±=‡ó·<=TÎBÜñ4@œwk’�9›ëSd¨‚"@6ê‡3µAJáåLü Ö¹SŸjÜSÕþÔ1ž,/bãÛ¡ö!mwO’=òëM}ùDìâчKÖî`‰9iÊ|hˆé¶]—r¶2‡¼c¦&d~“2¾•C•<Z·«t†­¡H®!¦$fTEÙ8Í%8å`“Œ•qÞ…€ìc•�9¸s$Ž}A»"ÃŒÊÔn~ˆž‡›—zàAüaRHÐE±Ïªö 9™bõ̶AbC(qWbH–EB#Á«ô„¢¬[ÉÃTI:›±l²v¸'ΌţsëÆ9…{"½$)ÞcãZ®Ïû8» ô F&öúÂѱœµ©•s¾˜ ƒ¥Ö‹‚”H%Ó¹FZ¸½²{,ÕŽõ¨Âjþ:; &›uÜkÞøD0žJÐÍN$ªj\‘ë9-ëE¸`a<XÎʈEÂ…sû°hEeHÃK•¹k<‰¬¸&Û˜‚†f’õ- ˜¦¸9P*¯AfÐÓý<C¥:¤0fÆîÙït#£å¹fêȉ/¨÷’Í9ÅEÍN‹Ë ï—ÕI­ŒF5!’<5 Ñ௿âMYö%ŸÎ’âLKÞ‡–¼MN‡çmðõà~ˆ5WWù;ÑZLõ²Ñ³É-ÅDÖ…äÛ8%Í‹žþ]²HésDãf´•÷5ì~cõèg $µÐZî±²‰]-õ R'×u[˜7šSr]ÇÕØûÜXïëéD-õݦ>2%SÆÜÔɘHÔe ±%è‰&ÓÁ8õ€qr° IÕj2¨»˜*ý22¯‘ß·©äðÏâùç‚ñK͇4+UòÊT+bÆ*,hÃ.iPBxW],qqw.)Hi¾?¡¼èÍšð¼ØÆjRÔê}ñªÑܦ›Æ3·©6>'®ÕŠÌ^“){17á4†?a÷J,æëÍ"×TÉÃt4&Dúo2rA$sn+À±ë¨ ”+³ á9uõs85E$¸p]ÂlÔÎ@ÈO2=`<Nj+ž&\×û5²\Æn1c»Ç6…žð+¥M*–W”¸&ƒšOÆöÕ˜~RÈÛ£»z\YE×„âªøà¶/ÙãÅÉWZìûm§këˆ=¥Î5Ô9ÀrÆgC`ê†ßr'ª1ƒTåbW8²(©À¯Gĵ]EiÜaŠyñЏx÷@l^B¸)Å[K! ¡1_Éñ:A_ê‰0 ¹äŒP_€yŒ@mb”œ Q…Õ±æãPGPÈè¤+q„º"Ïóã‘°ä 1‹Åi‚˜½ qw6‹™ƒÙáæx wùýœIñá9-Š" Sì”kÍÞéÜ  ­±»$Épe<G†Å8|•«ó“h›Ò$ÿ΂agBMú8wçÔ´8…éÕ Ï¤®`9›zdÔ$w%6^œ96–Äö„»e j…‰ƒ¸NAUß=ÕÔ‹05aÖhç¢Cö±9IÔ„ª;=ëøþåƒúé8 ½ ‘Ï0"Å02R妿hØj“ë «5‚~óÈdïrÍApUN<ÉÍa®ÅE××XCHa<ììT§,Þ“¼ãÅèoö‡eë*#‡žÄKˆmd¸”Ðbð8â†�Öþ‘M¨tE¨Œþ„Ô•¼*àx1¹®‰Oè<ƒ*¸†d®6î#­ßKè ^¼SµÏjÂSøYi‰×q÷æ•S 6ß#›;Ù Ñ1aƒ =fjgVÍ/%h§Ó¸hM:Vke‰ØÙ±nj\‰ð× j1›¾"Àƒ¦;®¼£Zþ­á»Æ9œuSˆd7ÙKåF?,Ž$°]èÚá÷ ç+|†×5–Óe0#8±˜ækZäa-¥Ô,¢³XRKXˆìV6¶ŽHX’p3 »ÊW)jw¦QrróLCü*ΆˆM›Å&Ü‹!éü P —³š¹ätëùZ€n\G”Üf\Œž‹ùŸÜ«.~´{$< B”-Æ94Þ`¼J 5BÕù˜R )÷STÕ]JȨ½oÌѰ8ËYƒYQçßÞÔÝ»Áºgã;pù&¨,=zŒ²$<NŠ—Âàzö,ÄGEÈ(« Ç4è0CܨúoáÎÖ<Å ¥HOåì ™v¤ÍrÄ(×ú¥ €ã”¬c†³î …þ `!¥æ:%ÁlPоZ!—£5\­MBXì…+yÆ"ifðt£jïpé²ÔöúþFXd…;4Y@­¦aªÈe¸Øf›òY°žQëò•Ìa¦š´g˜aKNxM¶*<-êµ¹×KÌ@·W¸HÌâÀ ‡bøY!jÖÞÿ$Æ¡‰­mÇ�Q¿ šŸ G|é�Ì›)0Iìͽ2£Uoš¹xs!…ÌÃì’ùà†Ä¶AöwSŠ6Ê'÷Ê>Ér<Vžµ¸V9Ï û9Ìþ-éγêѯMsôüR»�ï(Ïľ–é\ÿ÷œßÅe΋ÏFÉ_êrl`zË5ü #¤£ŒPR”T¹ pÜ@8"™[‚ýqYóOת å4¯ƒk ó2LºIþƒúóC°M±jo{ê!ïNnJyª@bæs¦z—-ï‹~O5@|"äàBŒ¿°âU*ÞsGJÎ Æ�)­‹–Ù4îZŸVk$¬ÚVÿ ˆ¿ÙŒ·Șó™œ\½Y$Zªx&Ë 1ÖÊþ $ýyø6ñ ™%[h©úBzn6†'‘Ùøî)@ñ¶ ò™(Ù1hÒœñ1ÉW!’R¨6Š¥iÎú¥´û¤TÝþJ K† h qqÖb}TUÜJQ{Á(Ñ—bfnû6©PTò‡“†Bôûå$€7TÊ,ŸFHœœ6†gœ¹íó, y›LPx{4¨Ç¡”[¦»4sTO¥Nz¹€þl¤;ÃŽ"Ê/ØfŒ8ªm€ÆÂb—ÁYøx¾¥ßñ©½¢š’"CëMvmN$·¡šØrÄ" /~J‘p'rezW¡Rá¹>ÊÒÀGÈ(¼904õûß §O"L2Ƥ®ÖT©o”{ÓYs«Hµ³sÔ™âÏ4¦29×XŒâ¸.ò€•NŸ¶Ì$W윪/"2AäÕKÄù*¢<¤–±•Rñ¹4Hï:+CÙÀ\óïžÇÏ&ÓI­&ÙRï1µ+ÞŠ*u°$«ÁÉ\jf?”Ä9ä…¬Dy�ÚCF U 6IŒOi¢˜»[Ú+¶ŸVÜðàÂXÞ—:ÁÒ¸ ¥�P½ÊB³0 Þ]³tЇŽ9Åžï"VT÷¼^¬É›xÊŒäeó]óXI68ÎPI3ÅÕ‰¿jhÐñEÚFÕÿ®ƒ5!æXBÖnGäœÂOЇ0CB߸ûnaø)å¡1a ¡Fü„<Ð"õ,*&2Fµì”*¼±ºOk¸Ò @j6V„”U…½É!lcPÃ0hª®5ay@ý¬Ë!a‘+êGTÏYJŽPL‡;¡¦é£”å‡)Y&³+Ÿ±B,Fí>·ýU+…ìÛ~*J\ÌÉc2Õ]¸ßä §<ÈÍíNY¤¨ƒ²m8i¡¦aÅÞ §ù͈‚¦ÇErÿ-œST?˜!€« ã9A;Û,íDh¤8¥ß£Äëµd×Ä;c ý{u©”‰n'ë«¿(RµIHS·VN” ÉšôG]SÁ¥¼hu`=wã ?EÎ�i\0F?âñu?—ÜÛE¡„™T¤N/díl¾šOºe\D“l&­µ.¥E\ k‰èfƒ©Üî{ÇØßZFÍ‘m^—[²—*åªÞWÅ2Õüi¬ŽÃ!åê\SÕ 7©‘øË:²h€éÑ3!ZPóûA`$Í“C§îÙ«ñZ\ßEPûlUpˆÊÊ ¾ÀòªTb±J•çñmMÕ<Î@[™iZøž¸éB]„ÓŽ z„šFÉLÓ²:¦¸´YÈ><L°"Ö31 ‚ìÌïËr›·Še<8nkÿRâ"‡ÒhÕ‘×:M•¹ï;cРˡ3ňª”·¡àlƹH Äeލ•B›¥ÞÉWÖPˆNÂs]‹â_‰T5&?ÅT? Y£Zè¿@#ÔãÉ’¢µ¨uO’äMŒ:‡‚× rPfhAw¸-E8\‰ò–ïCÍÜgñP#Α¦òrurnf,(ŸïºîûrÂ&%n¾Vù™0ÆKÝ"àÕ¹X%"»ÖÓMcJº1<Þ-•È%¹oÅAÈhAí n¿Ó=‰öº£O ŽŠ:�÷œÜ£ÈJ ýœ1‰i\S" H¼A‹#–Ëîñ‰‘æfrM½4¦2mrŸ)9­Ì=X­8 Þ!ͳˆ'æ|ĸõ9Ed‰Ep|“�Œ ¨¼%[]ÀÊV/-\K’³Gè̉EÇ2pÖ&´|'yúP7§Ñ”2̘/=7OFbüœÌ"‹eV'6v=sWŽÚœ94Õ™AHI).¼r¥¬ Ï⑬éÜ’êw`IÁýÇ&ÙoÂáØ*HØŠ8ÃÏ0—œÉ½ð ´ûÔ±…º8Ž›4Ìc¢gѧ/QGC›ì«é ùä ¥KbËé0Äøl*n'š*)p|-bäª\dJÂf.Å2žB*<È%÷œÁÑá»rUÔóEîKR'1ÀLî(hA¹P2\ 7ƒ‚6”šR»%ã­°CÇ4ý|ß$ô÷I=NGÝa¥j™ž.ë‡)q=qž>”c®óDzE_Ï—m,œà@MÇJýä“;aʼnäEoÀîãËP‰S9±ºÙQ_‡cÑÜ6*é“H¬~Èá|é÷ê\Z!jb'ëÏrîÔª’Ä®EjÀeÿÜYqg?IO.IÍ/×dVáK±ž˜ï4†îØxê "2±G-iæ£XÜÈeÕ& BêŸÉS}yŠ”›ºÝ>Mt§$p+Ù]U—pwIJaX–Šœ¸‚˱*Í@3-hC`A§¡11zä¹¼÷¥rÚõg{˜´q1˵[›SI¥‡&W´ÍÊžD§Ö5’ÎCSþ›Žá)b b£Á«<M>GónæÚ_é9gýÏ4iK8aG;–kùhB¨” n ߌ®'û–IÓÈf%äLfŒƒ–9ËŠÒéo5À wœß«IÝà#£Ãæ‚ 4¹kŽ”@61+I˜ƒ¯Ël½ú…F³“n§ój¨·i˜ •Ž“Žžå®Æ-ÿGëJ:1­¯íeã'KH¡p{tÔ(åa3#̲\6Á±ºª“b˜´¸Vx&OÆPv((Ä^{ÖeXðY=´— b'9V”T!- 8;ü+Z…¦¡VÏ{ßQ²ú!¶GtW¾—’w)è]¬"¦ÿ½â§é¨3\ö¨-8çÀ:hè(± q>îô<^´B‹"¯ßÙ:jÀÕï9BŒ…’aûSß Ayš#A-4È×=jzÎËS=Ú"C¨VÞ‰ª¶z¹ ©ƒTa<.„w42îe§ç6+A7m|ð&Ø®ªTCÁÞûÅâÂ)hXñþ†s&j'ÉÈøÉdwJD)œ§ù^j¹THTŠŠ‰‚ÄÍù‚øÄct(r€s€ /CSr® :t£×1BžšÁ\1ñ+ØsFÚõÐCä=,Œˆ¹H¾:‚vj„6`›‘2ãì<³\±B3Mú‚ÓrbI°l,4_/åÜül#¤–kΡý$4ŽepÛ#E–‰‡™íݯŒ”öü[ÜFÕ×b*XI`VbAáÝ4æ„õÝEÇífH!¸^Ð n¼¥3ÑËÙáCXÄ@ðÐøzµêrV#Y-™:Ü•².”+Ä)\ kÊœ˜,ãÚ´QÚȳ…¨J–T³¹ã /]Ò8fF5až@í©‚ñmqB®Sü€™Ê7WÉ{ùýôœV\5S#åpD˨Ís~Ȥø½T�œ2¢¤ÞÜd<QµQmÞÃWÂÈÚј®øˆ=Ë[bqYªæŠuÏͽG—ô͘i ]ç%Mx¦˜æôœ\ÕŒ!®´*›žpOsõú8^U¬dz&+¢S`L~æöEÊI;×:‰·º“Ó1‰Íó«‘Nª©`¬h ÉÉÁ ÉÃ%Äx¾XÊpÚwÅ"Aã@òãrîöÐû§¹?ô’Jä…[_(W…­~IîXTq…·ÂŸ]C¯Ñ©îƒe]mü‰¥$ùølœšÃí²&¸]ÖU‰¶ÂÅ!š+MUà>7C%ÑF9…fÀV W²¼Š–'š’Û¿ªö9gD¤þ °ä¢W(ñtW>±a÷ˆ #À3?…³×tÃL;£o®å%~SlK”ü̆¼ïh'ëç(å+ÔÈ.‘˜ o³ü¸Ú0‹'ë%ÕhLkÝóó×)¢”4\ˆDJ…2_3ÓŒyHÚ®ÉXÒO5Býžñ? ‰úÍ ·A9ÂCÐÔÚÆSšÔî¥*«¤›Ù7M¾Þñ ñÊe“½1SÍê(¹f7ÐNŸ3º™X !^ilh9Í’ZÈ–ëˆ\3ÿ°.Ò\msñS”à}iš´ægÝF^f^_›ûáPäÉ)ÇO5µJeýƒ3[×�Åž¹£Í—Hí¾rAÑK1avç˜l×\×H§-[ú» �‚ÌQ:¨˜~&…¤q|‰¸Ð±ìlÊ®‡„ù-NWŽñ•ÑXܹk\ƒï{¨Èƒ„_Škª¡“â{"Ò[{B¸îELàf/«kP1 QÄi^vsD5í¦ÉžRòjfbÌÕrçOé(¼Qdi¨¸Ç‹hB°’r¥nh°éò!†S«Ñy )#L‚wsþðŠïÆCòݨ±äã,_‘qÞËÐq÷ÝÏ{rž¦ߨõFÇ/è¤�8@úþÕ^-¢\²À×ñ^ÊmÒb>ÄÜ™ƒ )/+ü«Sw˜{}£ü¼}RÈ¡îÎÑMSôÄñzÉó€@r¯¶ñ¬¼¹PôögQÕ'=§ÎÙ¯1Ry¨oÛ4ݶÔúP³Lº¡î·æÀ2ƒ£Í»·{¬—•$;ÐZWnÆ“‘Å ¦ã–Ä¿g¥&¯†™˜…d+XÈÌý2r Îvu{— 9T ª¾9ñIn¬Óçï€dwðÅp<Üó$Ò‘¨Å'¡ø- wÁƒ.ÁámXüƒžuâFIø„2–««JlŸhÙÊÈXÜRj•«Ð…=Cg³13]h8§¶á–5#4!E-zt yT2âàûÆnŠÐ]RËÁžÞ¤Øx¹eéârŠ9„n UnóvœK4ãC‰ÂVÍ“‹»Fg, ÈÄe´ß‡jù‚ljy@æ® qÎùŠ+W¬ˆ$?§p]�ûmPKVÒÝZiõ~0ΦɱñWÿªPwØBJüºQ”~JV{ sCÚQ¢Ž²g2ÚÆ|v™‰mBÑ·ÚpLüFú¹áj l¤äû:—½»¿3G—Y%ö{“2‚R¸ú ‰§Žwì°fG‹!?­ÕE ¤p³8ºøá>iÓÅ1×`NBÕ{b8IQ'I3´•\MrçìyuÒƒî‘ð±jO*‰3\‚¯çi»Ð“&èèq[óãòÑr)Ì9(/Õôîø�‘æ1ÃÒ!êº.rÄB|¤„£#T˜—W£CQò8û™˜ŽPoŸ‡ÂVK—Ù•ÞΜhŸÑżæbÕªK®éíÅ?ã’V5$Ú!³¡ÿê"Ê#  W5·n²®;Ðhd»²¶ÎGÏUMïufSLj=†z±ù#Pvº¨{¤û7!°Ìß&#Cîþ|Ô°cnU™U èÑ<1û|D+•C\® ÉØØuXF¸Õ=[ÌÑÐk™%Ó¸(Úuº?J†ÏÇžÞ¯ËtW4>¨Î¸)a™Å;²c…òDj֟κ‘¾I"E úÓ¶uýR|kÌ‘V|4a3u4^Y»¢·ŠåHm¿“1Ê3. ÷Ó„½ôH '—šJì5˜ç=.±�h?ªHḨ«h"'~ ½Ž|$· ÛÊ¡»Í°$mꬮÿv\Ku¿çŒ æå¾)jÃ'¹†˜tRÜ»ûvVÒ½~é¶ücï†kš]·9uêgcAˆõ­[$J'¼ðs‚ÞôÅ[„¡'J³õ…Œ ÆŒ"‡T,2þYã‹g!JM»+jmÍ¢ÔLq`WŸò|>S'ǪIËVX´Y…{dµ1jŒRR‚ŽC”)ºv´ÇoŒf£­7eJdÖœs¯—¥FpÈ©i Zá ʬº” týŒ>•àj8½€t{â{ƽø³q`tÜ�šßÈ »÷TY˜¦ëÀd¢ª‡®ŒÅjX«…K¡!keœ¦ÆÞ{ØËt™aÂ2bî{%Útõyèos¦Ý’šB®Êò90Çå.*£V®TòÊÿèÙvÈH(½3 A@J&žcù­ôˆ1’!^ª¾» ØÁ}S¤w^:H(ô =¾½«ñNdÍñ'i*z6ï¥âðÖ—žÎ•þ:ÄìŽcqKýŸ!LŽw¦ïHì­ó8ÈP^²ÿ#Ço+p5¹z]ýáìó=®ˆ•4L™{oçv³¿_ÿrŽÄ`È’·½¶±®/Ûµ<}ã> õÐÕŸyzeêô5ÍiÀájT*vg2iöÜXKƒ½qK(’w›†^‡¿Òi2D?-3o%ªqXÄ•¹\Îé¼G-¾Œl<ÐGÒ‰ì0¥Ž%P ™6(Š7I¹ÆŒøaéÖÒ´qøis(†p׆pÌ~DG1A²%ñ¶–ŽÈR‘óÎ^†Î¤D@„yÿ(q6Œ3;Ì•À®º…ÚÌÚ•çfH+®}ìõK÷*òŒ“_Gê>CÇ“…“¸aN�…ún©™Ñïó.¼Û‡º©ºB@!?óñÙ!çzqÝ(Ž:-$ˆØ£š½(JÃ(î\†T„p}vÒ;rEƸÎग़bÊÁxM0YýŒjû¹*ü²KçЀžÁ‰±Š$©N£â.ÁãÝŒeÁ /´fIµ ±Ñ»2Ή)ÐLÍ鉎›—.ÚϹӣM!ä�Ÿ½OBÕËí¬¤ôàŒØ—†s O7Æ‘ún£Ëh¯‰‘>j‘§jyÞDþ®'¬`¹%îÂYmòr‚1§úÕ5HQ¶µ‚­äü*a6¤éjØ7‰­}j8NGª™M×V¨+z,ÑsF-sH覡Á{B`ËXùþœœãMTB¡!Þ!ü±!üÖŠôëtsƼ³š(÷¬BF›O&QóR¢?Ëâº"©èD}*ñ7Œïfš�ÆB–¼´Èöÿkò%cŠ.§ˆ,ïõ¿Ø'…&çöâjßË ³BÝ&Lb8y#ˆ=Øä 5dHîD§4™^±!Ï;�� �IDAT.µlªsµ@bø‹7(ñõ4ʦ(Gz«ÇWKj÷±R,³Â.˜n_‘Ñëz“}M1ÚHÀ!õÇAê«ÑÒø¾Pɪÿ˜“ée‘r; ´±úT•Ú³\ïd\¥0óÄàro‹ XÃP•~JF˜.¿ñRî}7J0³DLèþ]ÒR¸† šTÒý’¿g›ï ¶\¹&9þsùÀ�r b_J°Zv/&m®À&úR ¥=5ÿwøt„¬Öê+ŠÛܶ3:<†-ªú‹C55d ÄË•5ß7‹_aQçÖ‚w¶S0â}#némg mÐ+£\™²r¯àMwú8qïŠþ<g—ZØe(îl|>fùþùx"”W:{XIÓæ¤—ɽáéÝíc/*/%úb_ùe!˜ç�OÈá3¼ žƒhÞJ©%J 剙â‡4 Å(¬x ´k1×1{!ÞÛšj*Ä«§ˆ×wN§¡:HYɸAç)‘ÕðÊÁçjµßDZu°B©…±Õ¾PÛ,œoG™ûc•…”=DF ¨ä±9Úöi°-\]f|'óüõÙSÌ uüCÐ÷¯rÃm¢1'*!*EØ]ioß—QËÕ^£ƒT’/âÁ;)ÃNäØTLÀ –aŸüÒ,’ê_Û;ê%œ:Š5F‘¡Ï=Êp"öÎ.ÓMÔzÝbù`·$ÚÝŸçzOFç ‘áÞ95ȵ‡-Þ‰ŽrmÔ΃$ùÊ‹–uËèSHìXX•gõûS‚Óú.qóÍ|<®( Õé9½ñêu¯Ãíàñ ±3gðþCo/–í捻|@ÉÅg¯Ä¢Ÿ|&¦çxxÙ_ÆCPè^yÔ®EàGó{°Ð¼¥*QÖ¾˜¸h°™nŠ ‘66¥î sRG®¸öó0ùAJäswX‡öHÖd銒d#óŠ<7Šåšq ø”p±gÞbàWêidDûnÆ8o7ŒñUó56)1g^?±ècŸ®ÒÑ÷¹Fã¥¨Ðæ êmâ¼)#uAÇ…®ƒŒ˜,ÙΔB’íL‘Y«5ÞUL¨F<•'ÝEr\õ¼#£;†IR‰œ±FtÞV�ädñ°N“.,ª@‹æÖ¸ÉZ*µÞ^H.¤I}aá†iÝ#÷.&ͺhJ!~I&žærqNœƒdmìô‘µ«S–QcÌžÑnÇ)kÎ<*ŽRM\NýÞŽ7E׿hŽŠŽ*éf%¦‚áÌùEÅ™@{uŽQó¼èŸ»I¼—›š¤­ü´»Acb„OÕ{zf¤sT#JéK@ú¼­R9::rÀ#kÂT1N2׈bÐý©Æ!|ˆ¬†«@_û_p¨RÖër`ß4åvÁ‹±aϵq‡Sürš«ÆR@· AqB—Õ(¡pšÞî 92{Ò-B<›4aîß5KÉxÒ|$•Û˜Ò±¾_û]Ѱ uÿF8ˆñ­90J¾å%¼IZ5¬1×ýüh®„)Vê"c=€ëCÃIi:€&'Ô¹ÖÎé¹:vV„Œ5…CZž)Uù{åKöô9ßE´¿)c˜> ¶ƒ¶ÌË@*4W0šdf¼aFd-Ós ô¨G“¤+ZaØzÃHôÂCÎÆèj*åõQ䆵‚ÕÀT¡‚9ª0º™¾` D# ¹XÓ¶a—Î:)b:Á-Êv;!…››=…&:Ç‹0ÆQ…¹b†ÆÅÇÓëÁ È“Y3f%.ÿ˜¥·Œ1Ò£D˜OH,1I™‡Q2€:>bÔ^Uxe,U!”|½x)©mÓO9¤ 9dÃáhƒ)ðÝä BnÖø•2^ Ø=TîÞNX‡!9|.^x\‚#‹ˆÛäPZþvÈ8²¹oä¦î„¨tߣ°„^ŸªLÁ@‹2RÞÚeŠmÛÊ'I™!Ýfv”óÑ£9ûðÂ#Ó¨.JÊAh¨áYûõ•²¾ŒS£ u‡Š^ãή‰è Œã¥Á9ó”¹µ9\2V¥Ï¤Þ[ØÝÈ|õZÛÜhŒéF\ÿiRäÆ5\”R1EuÔ¨"—ßü€™`|¶Ä`²‰ùÂKÌŽú‘¦U½š^ñÊ",ò CìJzT®—y.[îÿ³ ME2—>§ i¤ŸJ”ÓYµÊP;)Ùf©°QŒW²ÒÜ´ûâžg+wW:öK¢Ó5oQ™Ë|•”M‡¬¡M‰ònPÊËe†–±ÃSÂ%ºƒ§ó@êB¨a›£‰ª?Kš´Àúš7¦4©A‘)oSBE•PäK`È¿HíäÇ{"3µ?› ÚmÖ ’) (ž’X7׺ç©ìб‚©HÅH¬ï�ã<p)%Zmg.ÌsÐa!˜®Œ* úÚ+VÕ&ÐýAƒÚ8±Ÿ/¸Ã±yT¾«røl]M§Bò®:™˜®¸’r~dšŠ<,kq´ÒŽísâ]“çLå~©$M‚žÎkLÛkD’ í9P ª[3†—"…Yð¨`²Ï1,[Dzx,R ­Ôö¹Ù‹ç°ºD~‹Û¦*R"ihH¥5Xn¦*$ÍE3HêX ÂÈÍ1­äÌnÊÙqóýs%ǧp¯”“2~ZAY{m©{„8 1¤ˆ•Öæ¸º³ Žzvຜ*øŽY‹Ùùk›ŽUˆárX¾\XX¢y<‰iê\uÛä'y T”R}6\áðÙ¤®»Ëw¡F—)…]Å2v*…7×xU )÷L”_N¢´ü?°£LÌÊH¸}ShVAS ÖfLº*-ùÙÓ.K—NH ºì7¦#ßúo.rÓ=σ%Rð©9žçv–Å’ó©R™ä•Ëë@ŠÄÕk0Û¸nRRKi›‹iák\µ¸Â“R0»Ï„° –°ª8Âò‘–Ìb‹Mÿ] Žâ P&~Ò!Ëk¨9<ÆŸ œF¨I`çz· £¸¢R_壸�ö îÅpBpÙºÀ­8¿…,Ë4÷æ¬1;xæu©NJ–Óx±’sú>C<p*å«t¸”}¢œ²xŽ47_rÙuÓI⥣@õc¹Ï~¶†O0ˆÞ Â[ !‹®ï‹ˆK%Dò–ªRÆ'õl$Eeái•j‘TþŠðr:)%Cf•Ôb|ùo@ˆˆÅ ò»à\žÏ€)иdãA9`Üo©=N+Á{J%|çkXr¹½lâjH€øjÅQšì¸3–¼�PR|—´1lÙY=플Š�AÕ\¢Šâ¬.7?•¼9¹‰³>8ë° –Sq,ï‹•¦ir‡íÛ†CÎ5‡[Ž–ý¼ð L%5g¥ã™†K9fxð ÛPÑMy*tO–°ÏðTgSô6¼ËQ€JÆ`„úÅÇ+Ý™Y}‹Æ,q8Õ*ðhÄøØ»¢-2Õ/è3˨gƒ ")ºÿü‰–vúýħ3…ø¢¨®ÜÐp•ånß•&Û¦Ntæ÷r}ã*¸ºÂ­Þ/)2%ïCÜf)ÆW9°}hk©¯ôdY.gIx†L,s¶%\VYþC¶{rQV–EE¨­·ñãy"w}¿4Ø6–‡†H¨‘ðy ¤*ˆ^¢z<ñÏ¢ä"‰·À’ŽoÎ̃Ø$Ý4›usƒ6¹æ›Á—îç7ãAÁë÷õHá2ÐJEjßJh*(jœJ_Iл¿ßtGEH8‡r“ fé€gqñ¨¾Üé5·' ­Síï•“i³aëB{,Q˜> Îå^<ðsÙ˜ˆ²M}à¡›ðýœ¢ FÚtP”ˆ¢G=hìÅñÒ€ _m=ñ؋ڗɜ} 4ÒfýÌÕÉÐZ”E#fêd —y“^ìëˆN`Æo*OQ ˆþ½aÖ!dÏx¤oëZOt3„™©ÍXɬ s%¦ÃêM‹eÕÐnºþÑ*Ç[tÕ&¿+þ²ÜÐéãZ˲jŸù\Aš)‚:!2Ú1½ž_$áNðp¦RïCq±ÄËÈ¡˜Ï¦ã²m°¨Øe3@p{A5Þ̶Ҹ<MPÎùìŠÌ çéCù™H%`]ËlhU½C”eLÅÄSÁ’£Ø.æÕ+fÙâW¬¸(‡,I8Æ;f†V)°lüÍåAÕã Ѿ۲Òr(¿ âjb3Íb{¸B-ÿ‰b|D¸Ñ“úÀ ÜB›K¤Y'ʂنd£ù¯ ”)NG:,üTÛ(*eаIM¾•äg1뇜QšeÍh.£»&»)t+i*â£d³ÔÔdÿ ƒ5Ë=ݼ‚:·Îö+³ˆáRÚxz?…·\G!—µa$'zP. &´22mT2ŽÄc¦y‘a£@‡â3$ ÍF5p.† ƒ˜Œ¡P£k%3-I:UE€éS4#± jˆÏ3I•ÿšq¨‰í|Cš"uç¿¶Y™)ùTÝ…–r&Ä42•¥;Wn—þl¬†…Xô³Z 7Â%SIªÙ!H§¡~Gs .wkiòEcøà¦ÄD(w*³Ñ7å$F7t4.‹§NA~¹zTæ3Y{%ÔgôQ^]s'KB½xµ¤úeÕ?S~Šîø@~(ÏÇ3‡šx+ŽÍ}›„£ìZ.—Ù‘ˆèׯÆùô<‘#›^Whˆé …Ts¿¢ü›—«› KжNòXTs0»ëY®H‚:3®ƒ4I8–hå30±HµbÕRIÀŠ ´aOwÏhÞ‚†dYÂðÿÓÞÙþìš^e}­kï™vèŒÚªUbŒÒTE>ó/¢ð/~ÿ‰~ ñ‹/ Z_‚ˆ^cR$†(h[_¬ R? ۙݙéžÙkùá>ϵ~Ǻ®gÏn…Hë}%O¦³»çyî羯ë<×¹ÖqüV©YH˜J⪗¼ßÃËUDÙhÍ9Yà tPòð% C;ÄÛž ºœrÃÆìÒM‡·ÈÖ•KÝÿ)9 }Úz曳‹@ „O ¬ÑΑOj(`JT{-_ÀΞ*阈!@øÖB0¡‡X{ŠÖID¸hû·˜2ÏŒ˜“6{3œì›j©‚žK(îa…n!³¬ºÀ;+äø–60ܲÀy¤ŽŽêª™:ëtfv‘ •kƲ­&D89ÜsèRù¶6®ï‘æDÙ<@@ØÝE*`¦w£#Ð&.,pÑŠºwÒ•’&ì& 瞣ãiA’f‚_¯ÅÞÕ•D‚Yå-ß}Xᣊâêöx*.âד֡œ4±6 “Ný}‹Dƒà„¡e#<æ¨ >+3CÔ=å#p7O|Ȧt“M=˜µ›Ï!Ve±µ;eûý¶AÖ-å¾Þš±ÀÆZ\šÑH,âNiÎõøhÔEpbíÈäÖGYß/ÃÈvû{qêú*»F]À¶¸O¶£s¹âàÿÜBAÓŒ:̄ϡ÷‰Ã–šIA|ky£³Ï¨GË ÿ9éIy?p (ùtº¦ê_ÌFí6»o<7rý€ý°sR8([œutê-R‡88[ìTª£Jd&tBí&FÝX±DP-€Œ ÛdÐ-RMC:õZB8lÃEÔøóÎXÆ .g/ž+aYRs£ŒKÏ1ZÙšÔç·°.œÊëûÈ„lŽÃ @c%sÒê•ãæ×¡¾GÒ5ÝT3; ïgÐö)-ÐJð¦v¹ ¢°Èã„6…Ýpˆ-«ï‰¾|( ìՋ C—q7dm"µÝ�r4öÐ!Ñý“ܯö4,ª£ElgKK'EÊ 9ófZ®ßlñ‡)œ±õ->Ff^Bh‡YH#GNg‘+ØÍ€ücÈ©ÁXCmú.®²ÝŽtvÅÑQ &FN½àm¾éXÌéÝ!‰c”±tŽ:Ú ò-\OŒ$ˆÜ*CöÊ…ƒ¯Ô¡ªeÇaS¦çÅ©ßqFÐ]ã%z®¡ÙJ;Þ+„šìܤ¼´‘Ð=¨î[{„tÅ›®Î­ÁÀÁn¯ÿËE_ºËÛɶî4ÙäoÅìäÿN§×¥u³#„&cšT˜e\=ˆYªÎ–eŠõµUã¸ã]º+Þ'Þ,<‚w<…7G«Oe1:Ù;œö¶ö¥ºÉ®Í>GÇœlï¿êÍó1†[6?û€á_¶z3H<Å,c™"²RÀU3ŽE¶„°]):çÿfê¤� hï\lyt~0@#دF7uÒæëlOuç˜i•šYªøȧ9BªèÔaµÊ þ³SF ¥=&¶î‹­ŽØÔIRóoTí¦ŒÆ$¨.Çi‚„ECJ²÷¦™pxì'UÜ8àd^'ø¦ïÆÕQ–Åîó©”ÙÑ=x\A™BhÃ)ÛL ЩN» ñ2î¾ØãÀç‘2íqÈ`aA—{¬ Û3�o$ë"¶ƒ”àÄQôL°ÿ&lû‡5ŒË]¯ÑpHŸÄÉ¥ MF&”°uA“‘JP¤MY:}Mv^¼G†Õ ÅXº;Ž °5•öҞÝèËûàáÉ\ÐW“ä`†Ü1Oæ4+j‰IØiâ0°?3u7êÚÕï?16vIyÖîGææPdŽÔzwŠÌ]ù?Øë9@jz÷•Rо K›‚ïä¢1Q2µœy¸Ëé¦3ù"‡°�k 9FÔ›@˜µY\&š?íärÜä63DÔ.kÆ@F8­éñ7ÖúÒ#š«VÓA?÷^ŸÌÕ¹›Ü¤#%¬˜ØŠGÏ: d9q38™ëñ‹Î’'`Q]Ÿ4”HTlÛì~Òp” JvÕámî<ÜNK>`T`p®hw$%U”L�~F¢ë`ÊÃêf�µcÅ<·çèCØÛ›åt;Aë,К‘Òá“Úz£Á÷Myd³Zn(fÚ…BN“‡çé¡ &eo­‹VœžøÌíÒùÄS# µÙ¢š,“W“ÔO 9…Ô°­a BÌ’ðO€(©“7¿ÈÁûX…å†ô‰SekOjrˆ5Sáu|§ÊMà#q•0A ´+"Ñ�Ò‚‡6É;Òº\Ø,Ìæ3Û©Ýä8f�ƒÕ„û"Ô”ÝÿØ'ÉÃUÐë†1ƒ’Œ«›è®‚dfÐ °[¶®`ÎÌ{,ly¿â´é©8;;㥊˜Y„u!%g+ê¹Þy‘"ïÔ¯¡£F×ø³©ž0 íuÖEÀMjt3ÿ¼A|­ÄOjÓ“À¹�Š(˜ŸÍ4ûÔà‘ƒEZw8• clH,·ŽüÁ%:&»CÍ vÞ™ä 91œˆÔ}”u{O)JIÐûàŤ ~<Tè˜bfÍŒT°+ŠìHAiÛ÷Sj´L3¤RÆ+Òi³¦èƒ±a£ZQF j…=Fu:É<%„Ù7†ÖlÚ½+6åÅD¼k2˜3‹�¶:‘h[0 …ʰ<ÈßÀxfë&²EE.‹¶ÉRR`Ž‚�“ãÖŽÒƒùƒã]ã(8j9õ{¿Ž&H–p4:c"±QºcôÝakÌQ÷°%¦¤¡¥D Z®~óvL¥º¼‘ä䢸ޕ/G O½-ûÛ-ìñ@B*Z°ôÝ‘Éá¹r2@g¤wx8÷‰jζâήqm*g@k”`zòÐÇ©¥ ¸l&!D9R£…zWFGŸjy²'—!Æ\ßÀX] KtX'½Ã4C;ŸJfÓ£a†´í:NyÕ”`áeÌÖε ;D}ž&HwsÚ)U%ZvUB9R‘¾§u( s—jŽ‘*Ëzdá}ʤý½ÖcØì’¤c­èÉjt>U6I±†Ì+C‡QÉÅA£’ë™D·)�çÜ‹`›è(¶94ëÅÓÉXùvXçHº @I÷øb†:œ­ó@;ä õžó·¨—‚{+§;ÍÛ@‘-(¿‰ê­¬öD¤tsÄra0¹[bç 5¤ÙtäÜ6¯Éyh)ÕcÆZûÀd©½'à¤T8;æ"”Ç!ƒÇÞbÑëã0.VêZ®£L”{JB{+#„ÅÂȆ:¸[Ç+ÀÈó"f¤Ç[ÑlòÐÄâe۬΅¤§zã5|X?E¿…w)’*J¢Žº3rÏÚñÜzÓo0“ƒz°R¥¸­_}Ê®ÂÕ¢8ÝJL‹%;¡‚ëtßhh¶â¼Úö!)³û¿õGuç\­¡Ò–Gwc?ðÑÅ*¶ £Åi‹“Ñú¼ÂTã“(àÍ6<oš¿ãúnâäcmhÇù$1%7ji6­ôöRó4lÍÂÙ"ɽHpîD‹·–JBùÒf• U·DZ“Œ³[Î[ê~Mr‰Û£]l­«Ù]Fp´Êí¸u€G dÅ>˜²+x²W·Î±6Óa EÀdRd˜IcæF‰(‰Ð¹ø€p%uCÒ&6Ø^ÇúAÍn^Ä’›ÍËrÚÒNçíÀ>—²ócN³gƒ9!!±ffùLˆ¶¶‚…ØÖÞP»Åô“l 5w¬ôZU£.œ3r@ ìŠÍURÂeT8"d—YµöŽc9®ª1úb‹‹}%gvŒ ÐF=dõv˜puœÚÁ é ¥-F8{]­L¸ÃÕá壃Ʈ�ú%ªUn7âÔƒm‹p­¯[ä~$>;8ú¶‹êÈfÿ°#vê÷ÚØT¯´îk„žaÁ>Às”KG<Èqÿ©ñùa³ùØz5?i&µF¸êн¸æh} ÚîCÄgš’#ÏÇ…nê¤p|pÿô¥ ³¹IÕ®*Q.ÚnÑ(oÒß±ÝZ¤‹Ð¸Ó6Ëâø­Sl ZeøáÔú@§Ö¹ÉM=”Ýåâ�ºšvôޱ‡ÿÏMô5§ÿM¤¦C‡_…gÝÍžczoÐɈ0anˆód)ô9¬“ˆ+Ì pSp"µr9“ÎÏ' ÄrD°"¥v…?ÙpÁIxYš]øÈ𹹄–…¤[…VãÕM; Àضü‹K ¢íÑ×fDѱˆ†îaŒó £ 6ß§Zò n$OÙŒ ä–#Ïh?Ò|{îÂ%eÅê· 5uxnÞ??…ŽÝ­ó:±xè&ñÜD%”ú‚-w¼dOÑtÐÝ(À€Nר‚Lý«S€gÍ]3œŸ%²J ªxv—´Nt÷s,÷HÐ9`g9=J\_øï^¦ — @‡‹W%|¯B:0\Ó{-“Vž_w„uJFZÒëaçgQB:mê–] —¢´M$V7I7¦Éø®t5}_]ì€4I&A½6¥h5‡níî#,“ÏÏ*ü¢ ¨¦B¹“‰Ú*“ËრâF0fŽ,¸IJŸ‡™/Ë…ÄÅdÏB—*»ñ©{c(?vÍ „^cò~Û¢ŒEI%O—©Â}T¥ÒfĨfÆŒâä&;2˜Îñ;>[…b½"×BÔw:±ÂIÐÅgȘ«Óv¹´¡•eÏ%ôRÅÇÔù` 8=ùóTq˜R é\’©@H¾ZÈNñ¢åHoFÊp&EgÙÄm̤ê,* ݈,7Õ"1¤,•ÇbÆk@Tr¤¡¸×îß@·¡ŒPjÅ4l­LˆºŸ‡e1éàqéð"V£Yãh%Ô]~ 1>s`t¬@œ•DköK]µS7]Vª5ÌìàæÛ1Ò?ÖGÑ|ì=Ã2À“D£ÖbL‡83êäâài®?ktåz–Ü]‡“ØÝN ¹×ãôÏÃDAúp³”@Àæ”D¹‰:pS»YÞhìI¢=…üN0ã il^.Dkº+8Á™§Žmš´´*ž£cèJpe’#ÓA⟃ËÓ 5]\ýD×ë3½¡4`Y.iE†BÊë ±"à}70,ýŽ"f3Šz4µ^r�“n}dry\»”#p¶Þï ìw¤Sçxöd{héˆ{”³/}èú8övw\…ò6¢w:Þ† Ÿ›‡=<RzœÉÞ-K‡ç<ôÃ7_f¶© Š„P%ˆ±j»nýkçk)ỎÐ17Ww�6Tîù’¾š-l£«Æ?š Ó  Æ Ÿ¼úUk!C|àbÊqÞ>rWŽ6ì¶ ‹WëªaõÐTVÈë칤ù aÞÌÓ5,µžÈ5²iEÅ­‘LZöŠŒ×"¢ ™ÁZÙºtþJ/œ¢´Í4yO{”‡˜]ß§ópQÉGÄéq3í1^å°Xcü…/'‹±±,¬B>�+±`³ê˜«{Í; ¼¬É†L*×ßdœD@}·L(Ö lýCØ›æ;¤^'/w°^Ÿðn^v'7†™B{¬Ìg]Š3�öìTãÛ,3Ùuã@eˆ‘3 7$Ä–›c’Ëf!Ýç-4'xÍÌg§‰âÏ¥ëóØâõNuŽ�/%¹vAº»F ÓEÆ6§„V|è›ÐYvao}ʼsKãƒ6¨Xb×ýpdke’PŒ1Ù?W£!‡Ó N®¢¸Ö>q{Ø{Šë3’÷Gæäá%†U6Qh–¿c5œ‡Ü€è1î)ýþNç*ZµìF5¡ é!–èýñÙ)Y[bú¨\OÌ:€ÔÞ”¤R÷¾Y*Ôud»Ó„ nÖÚRÓ.=4Ûð9z˜Çô_w®Ü:�6E:tÌPQ‚°3 “JÛ+ÁÖÎæ`6C¡è󨌠š׿{ÈÜׇUþoœÞ›übãæqˆIÛžŠ‘Ç|™ñäÍÝó«” §Á#» ïm†‰…0©2FFjŸA3³O:caÒ6&QÔüXóýaA,UøÀH“Ï#9˜š "­Ù”+!³µ¦¢î, á"û¦_ÅÄ �� �IDATN4³NX=Êü{´»Æšî)vðühÄzeÏ«/Ò”iYÀ|L¡ñÅ,ò ëÛ¶;4a&ž´°íHÛás‡AHØdƈÏü:–†ª%ŠÆ9Э^‹À!!¾§Å¹8OÄìGw†zCw1ÒívûsuæÕÈ(0N>ƒ[ÍçøÅbÍ¡'©¸ K#A@zžÝq8'-£$OÇÇZ•Í Y¢TÚ]ë•�#ÆÈßUÛšáâ¤Û†zY§‹p¶ºeû#pl7²Hè„<ÁR¥Þª-üŸÔì]´býà,¶ãlX™}Oê¡XvlÝ4Œ®dº-K@ñê©ï=è</ÇÞäK·˜ëÞêïÛ¡Ö=*>jÜ…íT0ý;)YÛÄH-Ê.A½e‹ÔkªL'ø>ý\{u®©€.òÅÃf/q:ÖÏwß}÷t¹ÔÀé¡É )×ÉfjàÜ´ïI²kŒ s-Ù)ÎYk`ƒiRîMÐÑ©„{!$0cÌÑ|�ƒ¼~¾ÓÉ“=Nžàs0¦÷â…À¯>¤„¬Ùž'î“£³Ã%JŒ{ÛMÙ%FÏqÂoMJ敦À-B­«´I{½GM N††‰¦!UÇ‚Ÿ­ì›”bqÓ;t-Aw\‰ô3ƒ-ÇÄûœ©„ßìnJB¸¼[­JMÜëËe6Úî»}]5_¦1øt£"mÌâ[C‰ñ’¹A†BIìö·×ñ,i{6 ~+-­Ž~‚ÇÍT¦PYå}ª€Xke…<MÂå¨%!8±îOGßÚu¤—Ù‘Ͱ0Õó0SVÎÒß„ƒ”—(½ÎJÏòÄ0©.•Λ2:LÕdó‚bu5¤wâ!ÏËþ~Q¢èÖ¦( #W %%#©Zëð~Ö„%„AÓL¦ê5²Eú”xÇHæAÁ§]v<k·ïÒ-¯ÑHö(*I‘¦æítîçjÜcû8w(«X½YÜù|¯õ=KÑiœzaJ":¯u¯ö½Ü£àpp°¼sáLDÖVì<ü%Hôûþ …Êa{Rt‡M× µr¡ÓDbTà©wöœ~þ´8§®ã8Èñë(xDÕ6å^¤ûpÿãéÓ§yÙr™ÙãGÙ³gïÊå â¦VÜ^Çâ„{®ž»t^²`݇üb›ªËxè–Ôp¿# <’ÖX\8ÈÖ;—›VÏ‚R"Ž)Á{.uO`X¨a-a†ÛSÉŠô} 2AÔSRpSeiÃLå4 ÃqÂÁt2‹�âÕbj¸zB]Û µÛ‚£e¥äMð+N©¿S]Ïh†Ñ»m”‡(ØyN¸GµjoúîFd»«Ö‚°>”Kj˜ùQÂAçh²ÛàÕw%î†;ì™ãÂáŠ1ºs|ºKæ'—_¶uÚj¸£¼7éˆ Ãér2ì"8´Z £€©Ôƒ‹âÜžJÒe:=¸;6BM›`½ž©Œ¶c/L¸#áÖŃ–5±è‘†X™p™ˆ0€&'E›ˆÌ}_l¬ºwüƒÅ—ë=CA’Ö¶ee~sœN`.}”©|9Öàæðdø68§O™ÀÖsõôèÞÁ*šŽæù,û½„—Ýé§-?—Cª‹Ïv‡"=b½®SáÈTåvHš½[ßJ<Ž^ÿB2«è8ë¤ïîZ´[µî%wd™&ìX›NÌcO¦JlÄW­fAÐ’Ä-LÑHx>�‹Ÿqã¸]èã0Mý2™ «©Æn.¾ŠôÁ}y*˜½»Xo½õ¦=P¸ÈMùø¿~æWüÿ‘G1BŒ‰Ç^ 37ÇN”C`—¨°8.òeMÂ*!ik³<6í+d†Y<Z¯¹Pô,¢|:i\ÒlO"7T¾”GVBƒ¬nHǨÈ]­@pÜü~Y7¯&ɺß2zÔ~û°Ö#UÙæj;å,\€MÀÚ-J´u{á0I¾.eK&ÂÀ ñ …aI-´ð/R:29Zûp@ŠóÚ=øž*ôëQ›W±,IÅÖêzÈÓ¡¢ðTFøz˜82>Ü5Äšäæd–rz ¤Õe‚ÝÁ´]ìùz€CÀ‹n'ƒ3Çz9�Œ¦–©²Ç왢MËÆÌ¸9ˆ57ÚÅ'âLePœ¨ËŽÑÚÎæ’¾’W÷¡9.¾&|¡Ž2<§·Øƒ½0F´ë¹7cwbª“&áw\Œ¯ô†×oë‡RhèÝtN»K‹AP'”ê¨yj–`Ï7Â!“ÍÀ.:ûÀN½›Ù3ÐÄ·N©G|αŸ1í»qd ‘ÞJ&”yôÅ“@\`ÝkOÀfX³¡hq HoEÔI®9PÝ™XâudUµƒ†:œ8Y‡“$Z0’�ò…ÞÞ Cày8ÚŽÄk<^ j,òq@ÅŽS¨‰Ù<›Û’¯ õÓQ¦vãÆ2ʈ"æ’ý9¡³úÎÓ§ù«¿úÙ/Ž¢%.º1öø}Óïùç™ñíiî•}óTnmß!SK˜FÆ¢'`G~¬ tYæüì›r…`q®VdÔlÃF"y”:jᯠmÖ‚·ô%7Ø6|ds6ÉêVÉ´Í‘Y¦JÏù:3boSQÜr—LÐ*wû©ÉÇž¹fà¦ÉÒE±[ãhöhyµŽµùÈ ãd é’ d"¾´a\nµ]T±(œâÊC~–8¤Å 1±›Ò GD•pEÅÌp1$Ì}Šnêyîâ´–}¯Q¤jÌÇ`BÄHPRx»7VçÌJ…¹žÏÞ˜·Z(Q¬P·Æó³/]C‚™/ÚÆýŒ3qŽ*!p£1Áþ›k¢÷ûN\SMŠ¢Î…²²#g½¾Nè�¾­£9FÝ,ؤMHا±Úž9˜*íÖæƒQ}2¾½§îy¦˜"°Dú«p!muÓ›oŸyôˆ{/º$› 4ÐtafÑ~h'²ñ]¸Å :ŠÖ£:w?4++S>s†×ÞŠç, '(|®C>ÿX©ì²»|«Æ×±ÎÉÖiý“†ÔÉ¿ìØ2OP2£JŠW|(Û)±{P™INÏ”æ¡m*;»§aI¢'LwÈþ}CØ>YõAht7ñ‰dñ,z÷Ö2îùŸÿÓ°gÏÞybMF¡E2ÔdoöÒÏþìÏ=•DJ±¬º º“Ðvöƒ‘€ÖDQÞJ¼{®TAë°±B‰g¢ÂÄqSNügÐà¥iCÌí®AjCܹ4Mƒ’8UìJ•ñÚF7kÛ¡ÚwÂÕlè ¤•åú{ËébÎ$½�FÐò|7Tjä2vܨPCú°,ª/á¤i{Ú!¤† ÔN£0Øx}Ø]ù3@ÝŸýÖü¦}ºàÆÌŒ‘bá ¼!ï 5Î¥ä)X›HyÕüúÛ?Ûk¾AzÛÇÈÖÛÛ.,ܾg½èMžãêœC¨i“¼¬l¯Ûä蘇uÖýì!pÕQ ©ð_ \×ÂÄ=:J`om¥øTxÚéä=WVtÑöž—vlX×1žUœŠwèža;9µLr}ŽèZ¯o§„žYØm*p„úÙ%L€}&‡í6¹Ýzãv(܂փš’v‡: ™Á©d-¹‰c4Å'³Š$ÁQèój¦‘ ·ÛvjY@á®pgͬâ–çH?ŽõÌày#ÈFî¾Az+j¬FAér¤SwR#çîd;>”Ãí<žj®³ócO RJÒQ4{}Û3¯];è‚vÏ{V]‘>_ƒØ7³oÿsúž<yòº™½ef¯›ÙçÌì×Íì™Ùo˜ÙÌìM3ûÒc3{çKo¿c/½ü¸£¡8«D†}ºKO9Yi~¼Òg+ Õ®f´j 8iN1ûtd)x#gœÐ¬èHràÆ4©‹­êZ š ~×L V–åÑÑÞcÐáÂêˆb,ؘ6½8ÌI‰ÍƒpX×5§½£RBÉÊmµÛÅéÐ-V³Hg‰‚±ÚÕR=úáó¢É¡X¼-•jggGˆ«æjgžÛX<¼ø´(¹r>µHu,HR䥎 »›ƒÝ¨ØE.ï"Ô^…mÔ ÞA m1£Ì®j9SgÀhp\Â8w&mµÙÊeÚë3Æœ=pÊéÏ`ÏÏ7~¿t/É6¤jÓÄÆŸ¼ÝRÉ@ÕÔXtÑFˆsop;¹vå¡8ã Ý�,²­áÑÖÿ&öV¡É¢[HÐSàN)L-½!7õ6ÌEŸRà5m‰šûCsäŒ àÏ÷ÙìèÎÃdÊcß„TÝQ”„¶Ï‘§£cu�váAê~énvWªî¹è<<Å¡(á“¢ËK Úeöž›}v…I'ïû«Â}£¹¥Ñ¥†nhT„ Oªz.£º#fmĨ5ÚÛ9·7扪ƒ”õûÖ>(HŒå ¾²†<AM7yËIV€9/ˆç. ùþ†`L–ÜáY]»¼f·H¢c•™ƒZwo¯õõ7Þ°'Ož¼…±Ñ³õõîú§t`Ž~ðC/ìïÿ­Ý>†ð”ȳVÞgÄIØ]#TE<7ì2Lô­€ëðó²Ç^{ñJ¦ß®@E·è×]-§>iš•r„ؤbüvÂËb”¤Ìê³ÒìÅ)SÓ¬C)†Ööï(w ¢ì—×ßà.pèæ-l0{È*q–u9 ;ŠÁè¸òØ|]lBQHâpŒ{²|íK`õÎ wÁm“T½)¹fJvþ¼qV¿¨tçN§¾9*G`õ÷“Q™Žº'"å=ª‘”wšoïåÛ¿Ó†K´›XHEF‰$éZr¨û-–ËM9>)a³¾�¤ëï'©Ât° ¸éäö÷ûxMaêL(u®ÏÚ-j4uâE¦R=£ S V,}Fôˆ.otTÇF ót‚õg³u^ál»BBtH½–ôJPΊýËè´Ã>÷é=JÌ‘Òíª h­·7›oaíF ëàLãs¿Ÿ®Y8@õ’†7Cƒ 3¥<©>R)¿²Ž®Nžƒ¶»G¸ßI¯-;{ÂNÏqsj&Cx¤ÛÚ_ö¸9È ¾Ý'>œE=v"íµÖü®¹Ö·Ìugâ>YÅ|XiÏ2o ¢HÓj,Ë£¾nߎ­ý,í× `l`í¾i£Ð áMÕ*1{Di†¢DËx²=™ê>ã°=jÏ‹[Q²ÖÇ@Mc¿·½»ìñéÝý8"Kâcÿo‡\À,õå¿ù¹ý£xyw|킦GHföèŸøÙ_3{ôZZø!sªs«Ç„êª|Oš“ZµŸ±Ú¬®A_‡Mq‘nŽÂGKŠB"‰,ðQ™› yÉNq­§‹þ™c|½µ%ô<NÙ²ÁMåZNûŸjTûÑ“ÓL²r¼†ÜïèjéA�*ã³ù­Óh’ºázýÕå§Ïpœ´‡”“$âS7ë^|E)47A‚Ð8(ð:þ¥Ðl[´ «ó€¼Ž&ªõŠ×È žˆ ­_ÇH”Ú˜:"H!§s\¢«š{ï{¦‚IóÜ#›@B:­6¨ÏÇý&B^ï™É±³–̂ѫ´G"µ�ÐDàÝc1Žî´Î '\Ѧ]!hÌaÂOöO»ø}¨Á˜#r·»Ù°ç…;m ®ŽÅÝ9& ÏÅì�¶ æowòð3jt¤t«“€/yC*u.WþÓxcŠ`]à’ÇÀ/`ôºøX1ø-:ÜÖ<´ÒPÊÏc‡etª¬ïÙÙE¦ ¿ò„ëEhp:yÚuÜÉû¨`sVùq›µž[K€cs­ ©Ý¿©w‘NÐPpæÁÀPz°‘Ù-TOËÅœêÌÚ»†ŠT7©û1”E¸ä1½ùÅ'ößþgþš™½ß̾dfo˜Ùÿ^c£___Ÿ7³'fö¶™½³Ÿ­ã»¾óϳ{ºoÌ4U}‰Ð9'¨æ¦@N±yC¼¶Õ1bëRÒ¦š ¨ Á…šuƒÇ® QÈôÉŽ€¦Dt¼îBÜôF¯sŒDªm«Î$!Ú‘×ä»sâc´s´@ÙSÂЛàËÆÎ2IЖŒ(n—È:…á ƒ?¡$2'‰E˜õº%4ÌÝP'$ç~ñÞ«À,‡ˆ Ò€-~} ¢;’\×C¹;$Š'éÅ¿“ÅÝTP;Ͻë›~V `ï¶wj»ÞТ•-‚PœáÛ^ly[ØYÀ}Õ†­ÛTèŠìD†f¶dŽÕÏ1ætðOÒo.”14·œ0I· ܸö ôÉÀ/¤D”ˆ¼A1‘µÅî�ùB˜¦BiÜÒüuåiÑÑy[9€†1™tFe8‡CXjdåì²’n,M”H–!OÖÿlŽ<,—˜Š מåÒ,³€Ìn]<i 1Kú4ó|h‘=dkúê¹ Õ –X7ÛÜ‘´ìÃp€µpÛô5ó :™L(Žì§ÝEjÉZÔ(Gã) ,±$b¾Y0­¶¸?œï9ó€0a0ØÒ­¹g6ŽûÓ�oMß.7eìäÀAdPƒ£x†É‰²AR70P“÷Ö&w[b2Ðãßê ‚V£íÜŽ#â'~ìSföêzgÞY_Oñõî%=^ùÙç~óso=yòä—>ðüQK;‚¯eƒÞ6ÂD¨WÞù$ÉÙ*ÿ Qw,ëÞæ ŽÂ+Ìô|X-ùLÓ%ãz›MHæpŒ�Ŭz®¼%·ÉÛ¦;s¿`wkÜOtК2åp ]TõÉÊ!¦êÔngŠ1~^]0]p‚â²Ý&unj zö&fÓiD§ TO)º¨¡¦¨fˇœÌ Ði²²Ua §6 åÙ!Ÿms7Q\õ8¦O\MHmá•¡»[tÈ{0ày(xÈ‘Q‰ò¹¼±á£Pt¦ècÛrÁ©©~,»cˆXˆ±¬Å4Zœû¶×‡8±æÿu¿¬±ùdY@C0@tή#&L¹!yê’Ý4SuH8­ âšøU[�Êü—zp»òžÚ6…‡¨Ý 2Ã=¦Íãyð Sòy}†žCŸFÑÐpB‰eºå 3áš¡<YÕ‘Ò ±jwcGÖVŽ‹Së!â^vU÷2 í’rTºÉíVGåd#u.‘K&P×眧@ÇM Î*ø ꦜq¯¡ÂmÛ:vó³JécÝFÁÕ!¿+äq›²‹I½™°ÿýFõ1Ê)3°yH¸¾Òÿ(ÃÄ‹—V¿_9Ð`‘·°ÿùÙÏúþÀ~j'³xùþ7u0æëí{lfï3³/þôOÿ‹O¿ü¾W¾e¿*ýl´¬RZû’1Öþ¡›úþ‡ùLŠrð]Ñya“ŽÅ!v:;ÆÁ@윓#“çüŽ¦ËæJ ´x»;›y⊧٠"u¹0ˆM )ø`6ºÙjdQçv^ÉSNôŒ€c‡»Ò\ŸH‹Ì¬âxßWN‰:còÑÎ6I®E5~0ž*H~ΑfÜŽìb§q‹ömµ ë'ð-Ë8=V—Ñ»kæ~eåîÝO¦=Çë:àÆ?ØMO¤Ÿ„ÑW¿¢ùE§¸iÎFBÝ»S<ЍºšÉœ\:4Þ»œ~õÎÍ3„ .;þ)7—KÇ}täôÿxNq»ŠÕíblê•;F“g´Ž´i÷«%f®›è \Âr¶í[ËpzÕé¢ÐîQž0±ÖF¡¢›xuըḉÓ_:ÉDä?º´ÎǰÍNù—í8DÈT+8(åéEPö¤M"\ LS·¢Ù>çÄÁèê3ÞÊN¸å;ƒmâ§÷[GScŠ.ow}ÎÄV{Áíßž={׿û»þ¾þúëo­"å­5&úür ýÆúúü+½½;1 †p3{í#ù“o~Ó7}øÏº³yíg§PÍítÖoðì˽±Z^—8±ýæØpôÁsãÆÍ¢ í80ÔvtžnOnV­7Pò0awˆ ]°€oC*â:'v�€ÚªÍ®TJHVÿËÑs{ZÄiÅ«ì´èP¬óÕ$fânK0€]ƒÄ:r?¥‹°|µÀ‚v*'p�ÎÚ€ç¼�~Ûè¶´Vewö0.}îÏÅS>¨‰bVËd�9^ßpÂØVô›‚‘:L«13LRl-ø˜o£WÔJê¨ÝÚ šÌò³�jð4HUÒ. =;OÓ‡Šeú¹+½8'"ïÄE–ûÓ6ë³]`£á€§B>{j‰â¨ìZ¨GÌQ:£%{ÚCËþM¨ûÔoÉ›‹5öïÑöh7>ÞÏ.ôäe•õuà&VWÉüaI}ËȜ⚟BŠöîL›¥¬Ã©ÏˆÓ Qøœþß“¸`HA‰.9™FíÁߎ»vZ–ËY+~Ÿë iPK˜þŽfÝiÑzš´5 h©d›íäÂøñ¡Uuh uä\¯ph\Ý  Ï¹\4 1<­¼À®h7þvø»ûû¿ðéOòÖª÷Î긼¹Š˜/,+õ“UØ|i/afùh¼ÿ™Ÿù—ÿí¥—^úÄ·ü©oý¯Ã¹_œ¼qÖIþJO[_ÐUÞÑv6ד½Üx¥·ñ§òȰ�ÓýBa7*jtÒÏ]wŠGMrL¶¼ÂAUYð‘à/œpn§ª:íœËá²í�Tå^éȳ3%{ÎÀøð“-iÁÑ…_–ç”x10;Ôò¿+nï{•5"Ž#ÇȹøŸYBì¼IšS½~:ñšy‘Î+KÇ[è*÷Eàu‹°lÍìWáMÎïûžÎ«Pü|Þ¶ëCjvËÃ…w#¶O«€„ux/Y±Åwè½²HÌnBÈ!À‹ÄɽùŒ#IÏþÁ’4y³!|tœV}€7¡ ÈR`ŽÍ‡'ãÙ¢òN~O»èFºTs1wãŒÝþ·:2“­i Tq"<DÝ—½>¹q Í.Vk*©Ú{3Š ¯3ØýWU|@çѨþ¸]ß‘X#S)ËWá%ˆ^TÖ‰ÑÝvÓÜUh,;‘áÌ´<aÅä|î÷aÖŽUP,gÍᵆ—ǹŒŽî uâÄÉÁXV`‚ž"2ô©My¹ØÂý ÀïcJÆß¹jÖn¥_—»v­›GEœ»µ5»ÑóÙ�£ˆã3ÇÚ,û†·Nö¥—Ùý³ýÂÇ?þ±|Q¼¼± —×W³ ˜§p!UÃríøÔ§>ùùW^yåß}ôô;}ŧ€¸ò“çé�õÁ¸ eÝÆFúÁÊ)¸# 껸k ¼ê}B½yе¥¶W…þhá‚è[9:ˆ©v„»ë¨lÏ͇(MÝž&íðµÓH…‚(�ýb¼¶ßƒ#EacK›ƒ3£ÛŠð(9ç QÜD` `Ë‹B›=’’zÄcÚ- ?[™áz»€.†—Þº7;ïS½Ï÷Í84%ƼµÉD±�=vkßÃ�YóÝED¤EõXFŠkuxêž´óFïÝ-énBžõd†ôÛ§:‚Ô|Œq¤C:iWx–]‡,悲zfÌmD `ƒ÷ mL²HîÀÍc¢Ëë#¼ÜcO†'Âú‘}™f"ì09Ý›v>�ø}Ž¿ ûßràt$t|KÑwôM'« ûù:tLÆn§›Ú»9¢IãZýЋÇg_:u¥]—]%Þ‡1·~’ÀA‡RGùÔš}œ>V5³œ5Í0éÉúêßú°Ê}ò‹ÉÕZäb3±Ž†eOÃa9oÑOèW†2jÊq1çtÓfDM <ì*ÏC†ù—_z)ÿÑ?üŸýþïÿ;? ÑîSt^ÞX…Ë.^ÞÄè¨40Æ#¼›\Ç'?ùï?÷Ú«ßð¹ß÷û?ø¡W¾îÕ®.âé b¬…³ê ÊuL26ÛôQ­‚0š«àþb³¡ Æ·*ÝCœ}rªÍÁß'W ãUbÒ8n½Qä{t¹F/â):2ÀéYcv6Í&o:,Ž$\b–}ú¡Ên½AYÓ‘jë.èòDQÉJ¬íÏ^scŠ <K%Sf‚;Ò:åÑ‹‚¯"ª‚êX3ø¹1¨Šú9uy(¥Qêç±ÇùØæÝý©Î:~b#ÜOLÌñEÁ烳©cŸÜ˜±¤ÏÍl—÷d:ÉP`òR ŽDC¢9Fº™Ù)á6Çžžè’Ö–‹‚«Cîè8ã© í.,¦º·@}F†kèv�ÑPöxÇAà ®c§DLçÞQÊ­¥‡}›äIŸ[æ‡÷Ås4úÿ»ÙZødÄpgîœéÁÅW[7}4šì.ð\wÍ”†è©ê]:Lj_˜>eKq[‰‹ÛMt ±HI­¯_Fw—iÒ4òåRB[½×ê¿l.ÚFÕ¹ ¥5+hòmza¡íªkÀÄPîB(–!…¶fî™âAä£ó–$Ôk&À*0ÜòÍ·Þô¿ñ}ß÷ôŸþÈO®äÝUÀ¼ef_ÅË´Mƒ£ÍºõÏGföòô~ÀÌ~—™û{ÿWàÃð?z”™Ý'oU1Ó']ÔÜ~Ò8 Ír§·ð°q™Añ 3R]0¶þN·sq5D`>]3œ9%Ìf·Œ ÝìØÌîqò™ÅŸO†4:åÁ±¹Àå|3YT[±uâ ]4窔Ùþ™Užt8]hù¹ ÓAòq¦—ßö´ÕO/mVqØé»±%΀Ǚò ÖAèP¸q™uFwŽá”47·<caNŽ‹ókñ‡…‹Ëé&÷AÖà?{4$ jŸÊü±Rúù=ÕÍv†WzAVÑè³A`#<‘ã¨!ÆÒ$¯'……Y^³#:… Ñi��ñIDATEw:A YæõNޱ¬_Ž‘'Ã.ÈälÐ…5usÚ¨ï)Ï÷ѳÈã†ù]ósëj Mݾé¬:Î, ˜ÆFc_M�æ Ô/SÑe 'Ÿ¯cc8ñ@a…RŸ‡K]€Ò× ÓïÏ %ŽXtDOsÅÐ8Q["ÉAj?³äˆ^‘×ÏÁð-¯ê0¡žÐ4JWh„êŸéó8xÿŸÿýWþGüÕ¿ò—þæ:…Ñqôæ*^^_ì—ýµ‹ŽNŒ¡€yd7¸Ý+(b~·™}Ãÿ“ùñoü½JÏðì^70¨–]Û!)¾Ã¯V£,s'®qÑ ŒÜÙ+¬p¥Ì,‡Ñ=9/r~f‹Ö¹HœÃÚby`¦>*Tæ9¼‘¦.‡3¢Û£ãf¬Œlô5‡î‚ehù0g¯…ÌŽº(öçÓˆo;ÒíRž¥ÂŸb±‘…Róa€äd³tÀÞ\¾ÛkúVcaZ/•@|̸zá´ÁÙ£eŸ¡Ppu!²VÅMËθ+/H5§Ýç½­ÉÃŒÁ6ÄÕé–GœH$(ŸÁ¶¦ÎÖC•*ÊOÕ±P3–â:tIŸ9PZXæ¹ê;ƒá¨òéJ"h’vuZ¶]IÎðÃ$Àm;rt,á"ÀvÁ)”cð0éeô3ÒÝJÆHd /ë5m Mb°íñ_@¡Ç-7nr=#Î'ú kõ1¦A@Ý‘><o§gýÌŠ\ñã¶zO™B ¢FÇ×s³nÍ ©¸ý-¨¼ÙI…¯Ý¶d¯àÜ]à~5œ‡)jml§ŽÁnÎ2‰æÎb`½öC¤3B‡¿ò…žsÄ)êoWÞмø»mýW?Ã.¼¦/òwOžo¼ñºüc?ô‹?õS?ù !»xyÅËVáòù1>ÚâÝg6£Ó.º0Qļjf¯­"æ•oû¶oûÖïùž¿ø×?òÑo¶Gglþù3ÐJÖþzøìá¨x©¼šÙ(*ïÉûØOä1NR¦ÅsOh†n¹„TIÚ­ìýJu}¢'>ãdkÝrY'ýÊHÙmkiC™Ñ˜X¢uĆùÜ 0³<CD×âRH^ÙÔÍNÕRÚ%”T¢¾$åóWœ-2N=˜“•BдÑY2™WË<Óƒ¡B®übtŸšMŠ1œŒhcÆ.–L´ßºwMfî ˜â}Šnz >m›rÎÎJ›€8wl N^ t9qŻȗ0/ñ8N›2Õ§Þ§T·ÓgþàZ¿E¤%Så€à ¡C˜´W,TpîðÄz><ôÊž8°+FÎC]ë4Ïÿó«þæ%�ᢻڸúÿòb{ [úÜõÁø¿óó~÷ó†Ÿù¼ <ßãç?ï=yÞÏ~Þë~à¾xÏõÒ©þ¢?ê·ùÊL{ôèQÇá¿üKŸ±ýÐýø§?õÉ_{úô)3޶`÷íÕ]Ù¢ÝÏÃyô:œGïP¼û¼w×Qļ˜WÍìëÝýë3ó‘™}ý÷~ï_þî~èÃì£â#ßüÚ«¯Ù+¯|½ôÒKv<:TD*ó iâ_ÞìÊHÑŠr4ímr®dL3>q ’VÀ¼pz<TUÚ)I›ú¥ÓãÊ9ïé¿`“·ïç=üwæ¸y=KÛj„FŸÇð?g†‹(y4›NNy¿xl =ô1ßG»mð:‰né;ïzâ Xàx)§vÂÒ®fLvN}˜7ƒÌOð‰Áb¸’AS_sfžäI$o<Þ&/ôlÙ|¯ÕÚ†aÓ¼âê°¸>M"®y_=—[¤¿ÀÛð^δûu¿î× ,ï¾ó޽õö[öÆë¯Û/ÿÒö+¿ò™û ?ÿó¿ù™Ïü—_\Í]¸¼ ÁîÛ½1 v^ž®ÿ6æSùP³w/-MÌûW³GJ¯­¯W×ÿ¬¿óòúo­?;ð½^`¼_÷ë~ݯûu¿î×ïôºå=öò—Q´º.ïZÃê¶h÷ :0OÖŸ½9:/qõ3?ç…íjÉжá و߬. C×פ”Ü ˜ûu¿î×ýº_÷ëk·€Ù¶è™*ͺá-kËô2Û.=‹—Ëëñ{¼¸gãÏÒZ|³[@o­æýv9½ßº óغãÏ)Rqä~ݯûu¿î×ýº_¿C¯°ç+ÅË.`X¼°³ÿùöúÚÁ,^òË)`fƒô®J„|¨€yß*`væxÆìÞ¹_÷ë~ݯûu¿¾®|âÆFñÂîËÛøzë¢pyÇм|%EÝI;øñ%|½o|mÝÌ£QÀ/ð3ïEÌýº_÷ë~ݯûõÕW¼Ð£É ›»ˆÙ_O­íÔ,\Þ³xùr ÅÈ#1³¨yl:BzdghÞ½€¹_÷ë~ݯûu¿¾ö ˜-7™˜ýõ.þùîø»/ìür ˜ýOGs `™__N÷å~ݯûu¿î×ýº__ýÅÍì°y6¾fÇå…_iAáãëxÎ×,|î×ýº_÷ë~ݯûõµ]ÀL÷òüʯ´pù¿-`*fv§eŠvý·ðçݯûu¿î×ýº_÷ëwnsUÈÌ¢æ+*Z~« ˜«ïåvSp¿î×ýº_÷ë~ݯÿ? ™çýó·´èøù=ïÎýº_÷ë~ݯûõÕW üvýýûu¿î×ýº_÷ë~ݯ¯½ëÿ�ÄÁiÎtdð����IEND®B`‚����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/README.md���������������������������������������������������0000644�0001750�0001750�00000001456�12147676243�017556� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Ruby/ClutterGStreamer Ruby/ClutterGStreamer is a Ruby binding of Clutter-GStreamer. ## Requirements * Ruby/Clutter and Ruby/GStreamer in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [Clutter-GStreamer](http://blogs.gnome.org/clutter/) ## Install gem install clutter-gstreamer ## License Copyright (c) 2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ### Exceptions Ruby scripts and image files in sample/ are ported and copied from Clutter. Headers in samples/*.rb describes that the location of the original file of the Ruby script and image files. The original files are licensed under the LGPL v2.1 or later. ## Project Website http://ruby-gnome2.sourceforge.jp/ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/Rakefile����������������������������������������������������0000644�0001750�0001750�00000004236�12257552167�017743� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $LOAD_PATH.unshift("./../glib2/lib") require "gnome2/rake/package-task" package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/ClutterGStreamer is a Ruby binding of Clutter-GStreamer." package.description = "Ruby/ClutterGStreamer is a Ruby binding of Clutter-GStreamer." package.dependency.gem.runtime = ["clutter", "gstreamer"] package.dependency.gem.development = ["test-unit-notify"] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = [ "glib2", "gdk_pixbuf2", "atk", "pango", "gobject-introspection", "clutter", "gstreamer", ] package.windows.gobject_introspection_dependencies = [ "atk", "pango", "clutter", "gstreamer", ] package.external_packages = [ { :name => "clutter-gst", :download_site => :gnome, :label => "Clutter-GStreamer", :version => "2.0.8", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :built_file => "bin/libclutter-gst-2.0-0.dll", }, } ] end package_task.define Rake::Task["native:clutter-gstreamer:i386-mingw32"].prerequisites.clear namespace :dependency do desc "Install depenencies" task :install do # TODO: Install gir1.2-clutter-gst-1.0 on Debian. end end task :build => "dependency:install" ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/test/�������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�017250� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/test/clutter-gstreamer-test-utils.rb������������������������0000644�0001750�0001750�00000001537�12147676243�025367� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "test-unit" require "test/unit/notify" module ClutterGStreamerTestUtils end �����������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/test/run-test.rb��������������������������������������������0000755�0001750�0001750�00000004265�12257552167�021370� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA have_make = system("which make > /dev/null") ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject") gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection") clutter_base = File.join(ruby_gnome2_base, "clutter") gstreamer_base = File.join(ruby_gnome2_base, "gstreamer") clutter_gstreamer_base = File.join(ruby_gnome2_base, "clutter-gstreamer") modules = [ [glib_base, "glib2"], [cairo_gobject_base, "cairo-gobject"], [gobject_introspection_base, "gobject-introspection"], [clutter_base, "clutter"], [gstreamer_base, "gstreamer"], [clutter_gstreamer_base, "clutter-gst"], ] modules.each do |target, module_name| if File.exist?(File.join(target, "Makefile")) and have_make `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require "glib-test-init" $VERBOSE = false # TODO: remove me $LOAD_PATH.unshift(File.join(gobject_introspection_base, "test")) require "gobject-introspection-test-utils" $LOAD_PATH.unshift(File.join(clutter_base, "test")) require "clutter-test-utils" require "clutter-gst" exit Test::Unit::AutoRunner.run(true) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/clutter-gstreamer/test/test-clutter-gst.rb������������������������������������0000644�0001750�0001750�00000001613�12257552167�023030� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class ClutterGstTest < Test::Unit::TestCase def test_init assert_nothing_raised do ClutterGst.init end end end ���������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665517�015030� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/��������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�015602� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/��������������������������������������������������0000755�0001750�0001750�00000000000�12123512153�020007� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/gdk_pixbuf2.def�����������������������������������0000644�0001750�0001750�00000000032�11701304107�022665� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXPORTS Init_gdk_pixbuf2 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf2private.h����������������������������0000644�0001750�0001750�00000002607�11701304107�024225� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGDK_PIXBUF2PRIVATE_H__ #define __RBGDK_PIXBUF2PRIVATE_H__ #include "rbgdk-pixbuf.h" G_GNUC_INTERNAL void Init_gdk_pixbuf_animation(VALUE mGLib); G_GNUC_INTERNAL void Init_gdk_pixbuf_animation_iter(VALUE mGLib); G_GNUC_INTERNAL void Init_gdk_pixbuf_format(VALUE mGLib); G_GNUC_INTERNAL void Init_gdk_pixbuf_loader(VALUE mGLib); #if RBGDK_PIXBUF_CHECK_VERSION(2,8,0) G_GNUC_INTERNAL void Init_gdk_pixbuf_simpleanim(VALUE mGLib); #endif G_GNUC_INTERNAL void Init_gdk_pixdata(VALUE mGLib); #endif /* __RBGDK_PIXBUF2PRIVATE_H__ */ �������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/extconf.rb����������������������������������������0000644�0001750�0001750�00000003607�12123512153�022010� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin extconf.rb for Ruby/GdkPixbuf2 extention library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "gdk_pixbuf2" package_id = "gdk-pixbuf-2.0" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end ["glib2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id, :debian => "libgdk-pixbuf2.0-dev", :redhat => "gtk2-devel", :fedora => "gdk-pixbuf2-devel", :homebrew => "gdk-pixbuf", :macports => "gdk-pixbuf2") exit(false) end have_func("gdk_pixbuf_set_option", "gdk-pixbuf/gdk-pixbuf.h") do |src| "#define GDK_PIXBUF_ENABLE_BACKEND\n#{src}" end create_pkg_config_file("Ruby/GdkPixbuf2", package_id, nil, "ruby-gdk-pixbuf2.pc") create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end �������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbufsimpleanim.c��������������������������0000644�0001750�0001750�00000003326�11701304107�024621� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 the ruby-gnome2 project * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk-pixbuf2private.h" #if RBGDK_PIXBUF_CHECK_VERSION(2,8,0) #define RG_TARGET_NAMESPACE cPixbufSimpleAnim #define _SELF(s) (RVAL2GDKPIXBUFSIMPLEANIM(s)) static VALUE rg_initialize(VALUE self, VALUE width, VALUE height, VALUE rate) { GdkPixbufSimpleAnim* ret = gdk_pixbuf_simple_anim_new(NUM2INT(width), NUM2INT(height), NUM2DBL(rate)); G_INITIALIZE(self, ret); return Qnil; } static VALUE rg_add_frame(VALUE self, VALUE pixbuf) { gdk_pixbuf_simple_anim_add_frame(_SELF(self), RVAL2GDKPIXBUF(pixbuf)); return self; } #endif void Init_gdk_pixbuf_simpleanim(VALUE mGdk) { #if RBGDK_PIXBUF_CHECK_VERSION(2,8,0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PIXBUF_SIMPLE_ANIM, "PixbufSimpleAnim", mGdk); RG_DEF_METHOD(initialize, 3); RG_DEF_METHOD(add_frame, 1); #endif } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf2conversions.h������������������������0000644�0001750�0001750�00000004275�11701304107�025126� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGDK_PIXBUF2CONVERSIONS_H__ #define __RBGDK_PIXBUF2CONVERSIONS_H__ #define RVAL2GDKPIXBUF(o) (GDK_PIXBUF(RVAL2GOBJ(o))) #define RVAL2GDKPIXBUFANIMATION(o) (GDK_PIXBUF_ANIMATION(RVAL2GOBJ(o))) #define RVAL2GDKPIXBUFANIMATIONITER(o) (GDK_PIXBUF_ANIMATION_ITER(RVAL2GOBJ(o))) #define RVAL2GDKPIXBUFLOADER(o) (GDK_PIXBUF_LOADER(RVAL2GOBJ(o))) #define RVAL2GDKPIXBUFSIMPLEANIM(o) (GDK_PIXBUF_SIMPLE_ANIM(RVAL2GOBJ(o))) #define RVAL2GDKPIXBUFFORMAT(o) ((GdkPixbufFormat*)RVAL2BOXED(o, GDK_TYPE_PIXBUF_FORMAT)) #define GDKPIXBUFFORMAT2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_PIXBUF_FORMAT)) #define RVAL2GDKPIXDATA(o) ((GdkPixdata*)RVAL2BOXED(o, GDK_TYPE_PIXDATA)) #define GDKPIXDATA2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_PIXDATA)) #define RVAL2GDKCOLORSPACE(o) (RVAL2GENUM(o, GDK_TYPE_COLORSPACE)) #define GDKCOLORSPACE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_COLORSPACE)) #define RVAL2GDKINTERPTYPE(o) (RVAL2GENUM(o, GDK_TYPE_INTERP_TYPE)) #define GDKINTERPTYPE2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_INTERP_TYPE)) #define RVAL2GDKPIXBUFROTATION(o) (RVAL2GENUM(o, GDK_TYPE_PIXBUF_ROTATION)) #define GDKPIXBUFROTATION2RVAL(o) (GENUM2RVAL(o, GDK_TYPE_PIXBUF_ROTATION)) #endif /* __RBGDK_PIXBUF2CONVERSIONS_H__ */ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf.h������������������������������������0000644�0001750�0001750�00000003020�11701304107�022536� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGDK_PIXBUF_H__ #define __RBGDK_PIXBUF_H__ #define GDK_PIXBUF_ENABLE_BACKEND #include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixdata.h> #include "rbgobject.h" #include "rbgdk-pixbuf2conversions.h" extern GType gdk_pixbuf_format_get_type(void); #define RBGDK_PIXBUF_CHECK_VERSION(major,minor,micro) \ (GDK_PIXBUF_MAJOR > (major) || \ (GDK_PIXBUF_MAJOR == (major) && GDK_PIXBUF_MINOR > (minor)) || \ (GDK_PIXBUF_MAJOR == (major) && GDK_PIXBUF_MINOR == (minor) && \ GDK_PIXBUF_MICRO >= (micro))) #define GDK_TYPE_PIXBUF_FORMAT (gdk_pixbuf_format_get_type()) #endif /* __RBGDK_PIXBUF_H__ */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbufanimationiter.c�����������������������0000644�0001750�0001750�00000004376�11701304107�025334� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk-pixbuf2private.h" #define RG_TARGET_NAMESPACE cPixbufAnimationIter #define _SELF(i) (RVAL2GDKPIXBUFANIMATIONITER(i)) static VALUE rg_advance(int argc, VALUE *argv, VALUE self) { VALUE current_time_sec, current_time_usec; GTimeVal current_time; rb_scan_args(argc, argv, "02", ¤t_time_sec, ¤t_time_usec); if (NIL_P(current_time_sec)) return CBOOL2RVAL(gdk_pixbuf_animation_iter_advance(_SELF(self), NULL)); current_time.tv_sec = NUM2LONG(current_time_sec); current_time.tv_usec = NIL_P(current_time_usec) ? 0 : NUM2LONG(current_time_usec); return CBOOL2RVAL(gdk_pixbuf_animation_iter_advance(_SELF(self), ¤t_time)); } static VALUE rg_delay_time(VALUE self) { return INT2NUM(gdk_pixbuf_animation_iter_get_delay_time(_SELF(self))); } static VALUE rg_on_currently_loading_frame_p(VALUE self) { return CBOOL2RVAL(gdk_pixbuf_animation_iter_on_currently_loading_frame(_SELF(self))); } static VALUE rg_pixbuf(VALUE self) { return GOBJ2RVAL(gdk_pixbuf_animation_iter_get_pixbuf(_SELF(self))); } void Init_gdk_pixbuf_animation_iter(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PIXBUF_ANIMATION_ITER, "PixbufAnimationIter", mGdk); RG_DEF_METHOD(advance, -1); RG_DEF_METHOD(delay_time, 0); RG_DEF_METHOD_P(on_currently_loading_frame, 0); RG_DEF_METHOD(pixbuf, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf-loader.c�����������������������������0000644�0001750�0001750�00000010372�11701304107�024005� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * Copyright (C) 2003 Geoff Youngs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk-pixbuf2private.h" #define RG_TARGET_NAMESPACE cPixbufLoader #define _SELF(s) RVAL2GDKPIXBUFLOADER(s) /****************************************************/ /* File opening */ /* Image Data in Memory */ static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { GdkPixbufLoader* loader; GError* error = NULL; VALUE arg1, is_mime_type; rb_scan_args(argc, argv, "02", &arg1, &is_mime_type); if (NIL_P(arg1)) { loader = gdk_pixbuf_loader_new(); } else { if (is_mime_type == Qtrue) { #if RBGDK_PIXBUF_CHECK_VERSION(2,4,0) loader = gdk_pixbuf_loader_new_with_mime_type(RVAL2CSTR(arg1), &error); #else rb_warning("Not supported GTK+-2.0/2.2."); loader = gdk_pixbuf_loader_new(); #endif } else { /* Default behavior */ loader = gdk_pixbuf_loader_new_with_type(RVAL2CSTR(arg1), &error); } if(error) RAISE_GERROR(error); } G_INITIALIZE(self, loader); return Qnil; } #if RBGDK_PIXBUF_CHECK_VERSION(2,2,0) static VALUE rg_format(VALUE self) { GdkPixbufFormat* format = gdk_pixbuf_loader_get_format(_SELF(self)); return GDKPIXBUFFORMAT2RVAL(format); } #endif static VALUE rg_write(VALUE self, VALUE data) { GError *error = NULL; StringValue(data); if (!gdk_pixbuf_loader_write(_SELF(self), (const guchar *)RSTRING_PTR(data), RSTRING_LEN(data), &error)) RAISE_GERROR(error); return Qtrue; } static VALUE rg_last_write(VALUE self, VALUE data) { GError *error = NULL; StringValue(data); if (!gdk_pixbuf_loader_write(_SELF(self), (const guchar *)RSTRING_PTR(data), RSTRING_LEN(data), &error)) RAISE_GERROR(error); if (!gdk_pixbuf_loader_close(_SELF(self), &error)) RAISE_GERROR(error); return Qtrue; } #if RBGDK_PIXBUF_CHECK_VERSION(2,2,0) static VALUE rg_set_size(VALUE self, VALUE width, VALUE height) { gdk_pixbuf_loader_set_size(_SELF(self), NUM2INT(width), NUM2INT(height)); return self; } #endif static VALUE rg_close(VALUE self) { GError *error = NULL; gboolean res; res = gdk_pixbuf_loader_close(_SELF(self), &error); if(error) RAISE_GERROR(error); return CBOOL2RVAL(res); } /****************************************************/ /* Creating image */ static VALUE rg_pixbuf(VALUE self) { return GOBJ2RVAL(gdk_pixbuf_loader_get_pixbuf(_SELF(self))); } /* Creating animation */ static VALUE rg_animation(VALUE self) { return GOBJ2RVAL(gdk_pixbuf_loader_get_animation(_SELF(self))); } void Init_gdk_pixbuf_loader(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE; /* initialize it */ RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PIXBUF_LOADER, "PixbufLoader", mGdk); /* * File Loading, Image Data in Memory */ RG_DEF_METHOD(initialize, -1); rb_undef_method(RG_TARGET_NAMESPACE, "dup"); #if RBGDK_PIXBUF_CHECK_VERSION(2,2,0) RG_DEF_METHOD(format, 0); #endif RG_DEF_METHOD(write, 1); RG_DEF_METHOD(last_write, 1); #if RBGDK_PIXBUF_CHECK_VERSION(2,2,0) RG_DEF_METHOD(set_size, 2); #endif RG_DEF_METHOD(close, 0); RG_DEF_METHOD(pixbuf, 0); RG_DEF_METHOD(animation, 0); }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbufanimation.c���������������������������0000644�0001750�0001750�00000005137�11701304107�024444� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk-pixbuf2private.h" #define RG_TARGET_NAMESPACE cPixbufAnimation #define _SELF(s) (RVAL2GDKPIXBUFANIMATION(s)) static VALUE rg_initialize(VALUE self, VALUE filename) { GdkPixbufAnimation* ret; GError* error = NULL; ret = gdk_pixbuf_animation_new_from_file(RVAL2CSTR(filename), &error); if (ret == NULL) RAISE_GERROR(error); G_INITIALIZE(self, ret); return Qnil; } static VALUE rg_width(VALUE self) { return INT2NUM(gdk_pixbuf_animation_get_width(_SELF(self))); } static VALUE rg_height(VALUE self) { return INT2NUM(gdk_pixbuf_animation_get_height(_SELF(self))); } static VALUE rg_get_iter(int argc, VALUE *argv, VALUE self) { VALUE start_time_sec, start_time_usec; GTimeVal start_time; rb_scan_args(argc, argv, "02", &start_time_sec, &start_time_usec); if (NIL_P(start_time_sec)) return GOBJ2RVAL(gdk_pixbuf_animation_get_iter(_SELF(self), NULL)); start_time.tv_sec = NUM2LONG(start_time_sec); start_time.tv_usec = NIL_P(start_time_usec) ? 0 : NUM2LONG(start_time_usec); return GOBJ2RVAL(gdk_pixbuf_animation_get_iter(_SELF(self), &start_time)); } static VALUE rg_static_image_p(VALUE self) { return CBOOL2RVAL(gdk_pixbuf_animation_is_static_image(_SELF(self))); } static VALUE rg_static_image(VALUE self) { return GOBJ2RVAL(gdk_pixbuf_animation_get_static_image(_SELF(self))); } void Init_gdk_pixbuf_animation(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PIXBUF_ANIMATION, "PixbufAnimation", mGdk); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(get_iter, -1); RG_DEF_METHOD_P(static_image, 0); RG_DEF_METHOD(static_image, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf-format.c�����������������������������0000664�0001750�0001750�00000011146�11740310343�024033� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk-pixbuf2private.h" #if RBGDK_PIXBUF_CHECK_VERSION(2,2,0) #ifdef HAVE_GDK_PIXBUF_GDK_PIXBUF_IO_H #include <gdk-pixbuf/gdk-pixbuf-io.h> #endif #define RG_TARGET_NAMESPACE cPixbufFormat #define _SELF(r) (RVAL2GDKPIXBUFFORMAT(r)) /**********************************/ static GdkPixbufFormat* format_copy(const GdkPixbufFormat* val) { GdkPixbufFormat* new_val; g_return_val_if_fail (val != NULL, NULL); new_val = g_new(GdkPixbufFormat, 1); *new_val = *val; return new_val; } GType gdk_pixbuf_format_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkPixbufFormat", (GBoxedCopyFunc)format_copy, (GBoxedFreeFunc)g_free); return our_type; } /**********************************/ /* Move to rbgdk-pixbuf.c gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf, const gchar *key, const gchar *value); GSList* gdk_pixbuf_get_formats (void); */ static VALUE rg_name(VALUE self) { return CSTR2RVAL_FREE(gdk_pixbuf_format_get_name(_SELF(self))); } static VALUE rg_description(VALUE self) { return CSTR2RVAL_FREE(gdk_pixbuf_format_get_description(_SELF(self))); } static VALUE rg_mime_types(VALUE self) { gint i = 0; gchar** mime_types = gdk_pixbuf_format_get_mime_types(_SELF(self)); VALUE array = rb_ary_new(); while(mime_types[i]){ rb_ary_push(array, CSTR2RVAL(mime_types[i])); i++; } g_strfreev(mime_types); return array; } static VALUE rg_extensions(VALUE self) { gint i = 0; gchar** extensions = gdk_pixbuf_format_get_extensions(_SELF(self)); VALUE array = rb_ary_new(); while(extensions[i]){ rb_ary_push(array, CSTR2RVAL(extensions[i])); i++; } g_strfreev(extensions); return array; } static VALUE rg_writable_p(VALUE self) { return CBOOL2RVAL(gdk_pixbuf_format_is_writable(_SELF(self))); } /* Structure */ static VALUE rg_domain(VALUE self) { return CSTR2RVAL(_SELF(self)->domain); } static VALUE rg_signature(VALUE self) { GdkPixbufModulePattern* signature = _SELF(self)->signature; VALUE array = rb_ary_new(); int i = 0; while(signature[i].prefix){ rb_ary_push(array, rb_ary_new3(3, CSTR2RVAL((const char*)signature[i].prefix), CSTR2RVAL((const char*)signature[i].mask), INT2NUM(signature[i].relevance))); i++; } return array; } #endif #if RBGDK_PIXBUF_CHECK_VERSION(2,6,0) static VALUE rg_scalable_p(VALUE self) { return CBOOL2RVAL(gdk_pixbuf_format_is_scalable(_SELF(self))); } static VALUE rg_disabled_p(VALUE self) { return CBOOL2RVAL(gdk_pixbuf_format_is_disabled(_SELF(self))); } static VALUE rg_set_disabled(VALUE self, VALUE disabled) { gdk_pixbuf_format_set_disabled(_SELF(self), RVAL2CBOOL(disabled)); return self; } static VALUE rg_license(VALUE self) { return CSTR2RVAL(gdk_pixbuf_format_get_license(_SELF(self))); } #endif void Init_gdk_pixbuf_format(VALUE mGdk) { #if RBGDK_PIXBUF_CHECK_VERSION(2,2,0) VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PIXBUF_FORMAT, "PixbufFormat", mGdk); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(description, 0); RG_DEF_METHOD(mime_types, 0); RG_DEF_METHOD(extensions, 0); RG_DEF_METHOD_P(writable, 0); RG_DEF_METHOD(domain, 0); RG_DEF_METHOD(signature, 0); #if RBGDK_PIXBUF_CHECK_VERSION(2,6,0) RG_DEF_METHOD_P(scalable, 0); RG_DEF_METHOD_P(disabled, 0); RG_DEF_METHOD(set_disabled, 1); RG_DEF_METHOD(license, 0); #endif #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/depend��������������������������������������������0000644�0001750�0001750�00000000527�12064346475�021215� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install-so: install-headers install-headers: $(INSTALL_DATA) $(srcdir)/rbgdk-pixbuf.h $(RUBYARCHDIR) $(INSTALL_DATA) $(srcdir)/rbgdk-pixbuf2conversions.h $(RUBYARCHDIR) install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-gdk-pixbuf2.pc $(pkgconfigdir); \ fi �������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixdata.c�����������������������������������0000644�0001750�0001750�00000015154�11701304107�022701� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002,2003 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk-pixbuf2private.h" #define GDK_TYPE_PIXDATA (gdk_pixdata_get_type()) #define RG_TARGET_NAMESPACE cPixdata #define _SELF(s) (RVAL2GDKPIXDATA(s)) static ID id_pixdata; /*****************************************/ static GdkPixdata * gdk_pixdata_copy(const GdkPixdata* src) { GdkPixdata* data; g_return_val_if_fail (src != NULL, NULL); data = g_new(GdkPixdata, 1); *data = *src; return data; } static GType gdk_pixdata_get_type(void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GdkPixdata", (GBoxedCopyFunc)gdk_pixdata_copy, (GBoxedFreeFunc)g_free); return our_type; } /*****************************************/ static VALUE rg_s_from_pixbuf(G_GNUC_UNUSED VALUE self, VALUE pixbuf, VALUE use_rle) { GdkPixdata pixdata; gpointer rle_data = gdk_pixdata_from_pixbuf(&pixdata, RVAL2GDKPIXBUF(pixbuf), RVAL2CBOOL(use_rle)); VALUE ret = GDKPIXDATA2RVAL(&pixdata); if (use_rle){ /* need to manage the returned value */ rb_ivar_set(ret, id_pixdata, Data_Wrap_Struct(rb_cData, NULL, g_free, rle_data)); } return ret; } static VALUE rg_to_pixbuf(VALUE self, VALUE copy_pixels) { GError* error = NULL; GdkPixbuf* ret = gdk_pixbuf_from_pixdata(_SELF(self), RVAL2CBOOL(copy_pixels), &error); if (error) RAISE_GERROR(error); return GOBJ2RVAL(ret); } static VALUE rg_serialize(VALUE self) { guint stream_length; guint i; guint8* ret = gdk_pixdata_serialize(_SELF(self), &stream_length); VALUE ary = rb_ary_new2(stream_length); for (i = 0; i < stream_length; i++) { rb_ary_push(ary, UINT2NUM(ret[i])); } return ary; } static VALUE rg_s_deserialize(VALUE self, VALUE rbstream) { GdkPixdata pixdata; long n; guint8 *stream = RVAL2GUINT8S(rbstream, n); GError *error = NULL; /* TODO: Should we really be creating a new array here? As far as I can tell, the data is copied. */ if (!gdk_pixdata_deserialize(&pixdata, n, stream, &error)) RAISE_GERROR(error); /* need to manage the returned value */ rb_ivar_set(self, id_pixdata, Data_Wrap_Struct(rb_cData, NULL, g_free, stream)); return GDKPIXDATA2RVAL(&pixdata); } static VALUE rg_to_csource(VALUE self, VALUE name, VALUE dump_type) { GString* str = gdk_pixdata_to_csource(_SELF(self), RVAL2CSTR(name), FIX2INT(dump_type)); VALUE ret = CSTR2RVAL(str->str); g_string_free(str, TRUE); return ret; } /* GdkPixdata */ static VALUE rg_magic(VALUE self) { return UINT2NUM(_SELF(self)->magic); } static VALUE rg_length(VALUE self) { gint32 length = _SELF(self)->length; if(length > 0) length -= GDK_PIXDATA_HEADER_LENGTH; return INT2NUM(length); } static VALUE rg_pixdata_type(VALUE self) { return UINT2NUM(_SELF(self)->pixdata_type); } static VALUE rg_rowstride(VALUE self) { return INT2NUM(_SELF(self)->rowstride); } static VALUE rg_width(VALUE self) { return INT2NUM(_SELF(self)->width); } static VALUE rg_height(VALUE self) { return INT2NUM(_SELF(self)->height); } static VALUE rg_pixel_data(VALUE self) { gint i; guint8* ret = _SELF(self)->pixel_data; gint32 length = _SELF(self)->length - GDK_PIXDATA_HEADER_LENGTH; VALUE ary = rb_ary_new2(length); for (i = 0; i < length; i++) { rb_ary_push(ary, UINT2NUM(ret[i])); } return ary; } void Init_gdk_pixdata(VALUE mGdk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PIXDATA, "Pixdata", mGdk); id_pixdata = rb_intern("pixdata"); RG_DEF_SMETHOD(from_pixbuf, 2); RG_DEF_SMETHOD(deserialize, 1); RG_DEF_METHOD(to_pixbuf, 1); RG_DEF_METHOD(serialize, 0); RG_DEF_METHOD(to_csource, 2); RG_DEF_METHOD(magic, 0); RG_DEF_METHOD(length, 0); RG_DEF_METHOD(pixdata_type, 0); RG_DEF_METHOD(rowstride, 0); RG_DEF_METHOD(width, 0); RG_DEF_METHOD(height, 0); RG_DEF_METHOD(pixel_data, 0); rb_define_const(RG_TARGET_NAMESPACE, "PIXBUF_MAGIC_NUMBER", INT2NUM(GDK_PIXBUF_MAGIC_NUMBER)); rb_define_const(RG_TARGET_NAMESPACE, "HEADER_LENGTH", INT2NUM(GDK_PIXDATA_HEADER_LENGTH)); /* GdkPixdataType */ rb_define_const(RG_TARGET_NAMESPACE, "COLOR_TYPE_RGB", INT2FIX(GDK_PIXDATA_COLOR_TYPE_RGB)); rb_define_const(RG_TARGET_NAMESPACE, "COLOR_TYPE_RGBA", INT2FIX(GDK_PIXDATA_COLOR_TYPE_RGBA)); rb_define_const(RG_TARGET_NAMESPACE, "COLOR_TYPE_MASK", INT2FIX(GDK_PIXDATA_COLOR_TYPE_MASK)); rb_define_const(RG_TARGET_NAMESPACE, "SAMPLE_WIDTH_8", INT2FIX(GDK_PIXDATA_SAMPLE_WIDTH_8)); rb_define_const(RG_TARGET_NAMESPACE, "SAMPLE_WIDTH_MASK", INT2FIX(GDK_PIXDATA_SAMPLE_WIDTH_MASK)); rb_define_const(RG_TARGET_NAMESPACE, "ENCODING_RAW", INT2FIX(GDK_PIXDATA_ENCODING_RAW)); rb_define_const(RG_TARGET_NAMESPACE, "ENCODING_RLE", INT2FIX(GDK_PIXDATA_ENCODING_RLE)); rb_define_const(RG_TARGET_NAMESPACE, "ENCODING_MASK", INT2FIX(GDK_PIXDATA_ENCODING_MASK)); /* GdkPixdataDumpType */ rb_define_const(RG_TARGET_NAMESPACE, "DUMP_PIXDATA_STREAM", INT2FIX(GDK_PIXDATA_DUMP_PIXDATA_STREAM)); rb_define_const(RG_TARGET_NAMESPACE, "DUMP_PIXDATA_STRUCT", INT2FIX(GDK_PIXDATA_DUMP_PIXDATA_STRUCT)); rb_define_const(RG_TARGET_NAMESPACE, "DUMP_MACROS", INT2FIX(GDK_PIXDATA_DUMP_MACROS)); rb_define_const(RG_TARGET_NAMESPACE, "DUMP_GTYPES", INT2FIX(GDK_PIXDATA_DUMP_GTYPES)); rb_define_const(RG_TARGET_NAMESPACE, "DUMP_CTYPES", INT2FIX(GDK_PIXDATA_DUMP_CTYPES)); rb_define_const(RG_TARGET_NAMESPACE, "DUMP_STATIC", INT2FIX(GDK_PIXDATA_DUMP_STATIC)); rb_define_const(RG_TARGET_NAMESPACE, "DUMP_CONST", INT2FIX(GDK_PIXDATA_DUMP_CONST)); rb_define_const(RG_TARGET_NAMESPACE, "DUMP_RLE_DECODER", INT2FIX(GDK_PIXDATA_DUMP_RLE_DECODER)); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/ext/gdk_pixbuf2/rbgdk-pixbuf.c������������������������������������0000644�0001750�0001750�00000060746�12123512153�022554� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2002-2004 Masao Mutoh * Copyright (C) 2000 Yasushi Shoji * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgdk-pixbuf2private.h" #include <string.h> #define RG_TARGET_NAMESPACE cPixbuf #define _SELF(s) RVAL2GDKPIXBUF(s) #define NOMEM_ERROR(error) g_set_error(error,\ GDK_PIXBUF_ERROR,\ GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,\ "Insufficient memory to load image file"); static ID id_pixdata; /****************************************************/ /* The GdkPixbuf Structure */ static int pixels_size(GdkPixbuf *pixbuf) { int height, width, rowstride, n_channels, bits_per_sample; height = gdk_pixbuf_get_height(pixbuf); width = gdk_pixbuf_get_width(pixbuf); rowstride = gdk_pixbuf_get_rowstride(pixbuf); n_channels = gdk_pixbuf_get_n_channels(pixbuf); bits_per_sample = gdk_pixbuf_get_bits_per_sample(pixbuf); return ((height - 1) * rowstride + width * ((n_channels * bits_per_sample + 7) / 8)); } static VALUE get_pixels(VALUE self) { GdkPixbuf *pixbuf = _SELF(self); int size; size = pixels_size(pixbuf); return rb_str_new((const char *)gdk_pixbuf_get_pixels(pixbuf), size); } static VALUE rg_operator_set_pixels(VALUE self, VALUE pixels) { GdkPixbuf *pixbuf = _SELF(self); int size; int arg_size; size = pixels_size(pixbuf); StringValue(pixels); arg_size = RSTRING_LEN(pixels); if (arg_size != size) rb_raise(rb_eRangeError, "Pixels are %i bytes, %i bytes supplied.", size, arg_size); /* The user currently cannot get a pointer to the actual * pixels, the data is copied to a String. */ memcpy(gdk_pixbuf_get_pixels(pixbuf), RSTRING_PTR(pixels), MIN(RSTRING_LEN(pixels), size)); return pixels; } static VALUE rg_get_option(VALUE self, VALUE key) { const gchar* ret = gdk_pixbuf_get_option(_SELF(self), RVAL2CSTR(key)); return ret ? CSTR2RVAL(ret) : Qnil; } /****************************************************/ /* File opening */ /* Image Data in Memory */ static GdkPixbuf * pixbuf_initialize_by_hash(VALUE self, VALUE arg, GError **error) { GdkPixbuf *buf = NULL; VALUE rb_colorspace, rb_has_alpha, rb_bits_per_sample, rb_width, rb_height, rb_data, rb_rowstride, rb_xpm, rb_inline, rb_copy_pixels, rb_src_pixbuf, rb_src_x, rb_src_y, rb_file, rb_scale_width, rb_scale_height, rb_preserve_aspect_ratio; rbg_scan_options(arg, "colorspace", &rb_colorspace, "has_alpha", &rb_has_alpha, "bits_per_sample", &rb_bits_per_sample, "width", &rb_width, "height", &rb_height, "data", &rb_data, "rowstride", &rb_rowstride, "xpm", &rb_xpm, "inline", &rb_inline, "copy_pixels", &rb_copy_pixels, "src_pixbuf", &rb_src_pixbuf, "src_x", &rb_src_x, "src_y", &rb_src_y, "file", &rb_file, "scale_width", &rb_scale_width, "scale_height", &rb_scale_height, "preserve_aspect_ratio", &rb_preserve_aspect_ratio, NULL); if (!NIL_P(rb_data)) { buf = gdk_pixbuf_new_from_data((const guchar*)RVAL2CSTR(rb_data), NIL_P(rb_colorspace) ? GDK_COLORSPACE_RGB : RVAL2GDKCOLORSPACE(rb_colorspace), RVAL2CBOOL(rb_has_alpha), NIL_P(rb_bits_per_sample) ? 8 : NUM2INT(rb_bits_per_sample), NUM2INT(rb_width), NUM2INT(rb_height), NUM2INT(rb_rowstride), NULL, NULL); if (buf == NULL) NOMEM_ERROR(error); // Save a reference to the string because the pixbuf doesn't copy it. G_RELATIVE(self, rb_data); } else if (!NIL_P(rb_xpm)) { const gchar **data = RVAL2STRV(rb_xpm); buf = gdk_pixbuf_new_from_xpm_data(data); g_free(data); if (buf == NULL) NOMEM_ERROR(error); } else if (!NIL_P(rb_inline)) { /* TODO: Is this really up to the caller to decide? */ long n; guint8 *data = RVAL2GUINT8S(rb_inline, n); buf = gdk_pixbuf_new_from_inline(n, data, RVAL2CBOOL(rb_copy_pixels), error); /* need to manage the returned value */ rb_ivar_set(self, id_pixdata, Data_Wrap_Struct(rb_cData, NULL, g_free, data)); } else if (!NIL_P(rb_src_pixbuf)) { buf = gdk_pixbuf_new_subpixbuf(_SELF(rb_src_pixbuf), NUM2INT(rb_src_x), NUM2INT(rb_src_y), NUM2INT(rb_width), NUM2INT(rb_height)); if (buf == NULL) NOMEM_ERROR(error); } else if (!NIL_P(rb_file)) { if (!NIL_P(rb_width)) { #if RBGDK_PIXBUF_CHECK_VERSION(2,4,0) buf = gdk_pixbuf_new_from_file_at_size(RVAL2CSTR(rb_file), NUM2INT(rb_width), NUM2INT(rb_height), error); #else rb_warning("Sizing on load not supported in GTK+ < 2.4.0"); buf = gdk_pixbuf_new_from_file(RVAL2CSTR(rb_file), error); #endif } else if (!NIL_P(rb_scale_width)) { #if RBGDK_PIXBUF_CHECK_VERSION(2,6,0) int width = NUM2INT(rb_scale_width); int height = NUM2INT(rb_scale_height); #if !RBGDK_PIXBUF_CHECK_VERSION(2,8,0) if (width < 0 || height < 0) rb_warning("For scaling on load, a negative value for width or height are not supported in GTK+ < 2.8.0"); #endif buf = gdk_pixbuf_new_from_file_at_scale(RVAL2CSTR(rb_file), width, height, NIL_P(rb_preserve_aspect_ratio) ? TRUE : RVAL2CBOOL(rb_preserve_aspect_ratio), error); #else rb_warning("Scaling on load not supported in GTK+ < 2.6.0"); buf = gdk_pixbuf_new_from_file(RVAL2CSTR(rb_file), error); #endif } else { buf = gdk_pixbuf_new_from_file(RVAL2CSTR(rb_file), error); } } else { buf = gdk_pixbuf_new(NIL_P(rb_colorspace) ? GDK_COLORSPACE_RGB : RVAL2GDKCOLORSPACE(rb_colorspace), RVAL2CBOOL(rb_has_alpha), NIL_P(rb_bits_per_sample) ? 8 : NUM2INT(rb_bits_per_sample), NUM2INT(rb_width), NUM2INT(rb_height)); if (buf == NULL) NOMEM_ERROR(error); } return buf; } /* TODO: make deprecated */ static GdkPixbuf * pixbuf_initialize(VALUE self, int argc, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6, VALUE arg7, GError **error) { GdkPixbuf* buf; if (argc == 7){ buf = gdk_pixbuf_new_from_data((const guchar*)RVAL2CSTR(arg1), RVAL2GDKCOLORSPACE(arg2), RVAL2CBOOL(arg3), NUM2INT(arg4), NUM2INT(arg5), NUM2INT(arg6), NUM2INT(arg7), NULL, NULL); if (buf == NULL) NOMEM_ERROR(error); // Save a reference to the string because the pixbuf doesn't copy it. G_RELATIVE(self, arg1); } else if (argc == 5){ if (rb_obj_is_kind_of(arg1, GTYPE2CLASS(GDK_TYPE_PIXBUF))){ buf = gdk_pixbuf_new_subpixbuf(_SELF(arg1), NUM2INT(arg2), NUM2INT(arg3), NUM2INT(arg4), NUM2INT(arg5)); if (buf == NULL) NOMEM_ERROR(error); } else if (rb_obj_is_kind_of(arg1, GTYPE2CLASS(GDK_TYPE_COLORSPACE))){ buf = gdk_pixbuf_new(RVAL2GDKCOLORSPACE(arg1), RVAL2CBOOL(arg2), NUM2INT(arg3), NUM2INT(arg4), NUM2INT(arg5)); if (buf == NULL) NOMEM_ERROR(error); } else { rb_raise(rb_eArgError, "Wrong type of 1st argument or wrong number of arguments"); } } else if (argc == 4) { #if RBGDK_PIXBUF_CHECK_VERSION(2,6,0) int width = NUM2INT(arg2); int height = NUM2INT(arg3); #if ! RBGDK_PIXBUF_CHECK_VERSION(2,8,0) if (width < 0 || height < 0) rb_warning("For scaling on load, a negative value for width or height are not supported in GTK+ < 2.8.0"); #endif buf = gdk_pixbuf_new_from_file_at_scale(RVAL2CSTR(arg1), width, height, RVAL2CBOOL(arg4), error); #else rb_warning("Scaling on load not supported in GTK+ < 2.6.0"); buf = gdk_pixbuf_new_from_file(RVAL2CSTR(arg1), error); #endif } else if (argc == 3) { #if RBGDK_PIXBUF_CHECK_VERSION(2,4,0) buf = gdk_pixbuf_new_from_file_at_size(RVAL2CSTR(arg1), NUM2INT(arg2), NUM2INT(arg3), error); #else rb_warning("Sizing on load not supported in GTK+ < 2.4.0"); buf = gdk_pixbuf_new_from_file(RVAL2CSTR(arg1), error); #endif } else if (argc == 2) { /* TODO: Is this really up to the caller to decide? */ gboolean copy_pixels = RVAL2CBOOL(arg2); long n; guint8 *data = RVAL2GUINT8S(arg1, n); buf = gdk_pixbuf_new_from_inline(n, data, copy_pixels, error); /* need to manage the returned value */ rb_ivar_set(self, id_pixdata, Data_Wrap_Struct(rb_cData, NULL, g_free, data)); } else if (argc == 1){ if (TYPE(arg1) == T_STRING) { buf = gdk_pixbuf_new_from_file(RVAL2CSTR(arg1), error); } else if (TYPE(arg1) == T_ARRAY) { const gchar **data = RVAL2STRV(arg1); buf = gdk_pixbuf_new_from_xpm_data(data); g_free(data); if (buf == NULL) NOMEM_ERROR(error); } else if (TYPE(arg1) == T_HASH) { buf = pixbuf_initialize_by_hash(self, arg1, error); } else { rb_raise(rb_eArgError, "Wrong type of 1st argument or wrong number of arguments"); } } else { rb_raise(rb_eArgError, "Wrong number of arguments"); } return buf; } static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE arg1, arg2, arg3, arg4, arg5, arg6, arg7; GdkPixbuf *buf; GError *error = NULL; rb_scan_args(argc, argv, "16", &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7); buf = pixbuf_initialize(self, argc, arg1, arg2, arg3, arg4, arg5, arg6, arg7, &error); if (buf == NULL) { rb_gc(); g_error_free(error); error = NULL; buf = pixbuf_initialize(self, argc, arg1, arg2, arg3, arg4, arg5, arg6, arg7, &error); } if (error || !buf) RAISE_GERROR(error); G_INITIALIZE(self, buf); return Qnil; } static VALUE rg_dup(VALUE self) { VALUE ret; GdkPixbuf* dest = gdk_pixbuf_copy(_SELF(self)); if (dest == NULL) return Qnil; ret = GOBJ2RVAL(dest); g_object_unref(dest); return ret; } #if RBGDK_PIXBUF_CHECK_VERSION(2,4,0) static VALUE rg_s_get_file_info(G_GNUC_UNUSED VALUE self, VALUE filename) { gint width, height; GdkPixbufFormat* format = gdk_pixbuf_get_file_info(RVAL2CSTR(filename), &width, &height); return format ? rb_ary_new3(3, GDKPIXBUFFORMAT2RVAL(format), INT2NUM(width), INT2NUM(height)) : Qnil; } #endif static VALUE save_to(VALUE self, const gchar *filename, const gchar *type, VALUE options) { VALUE result = self; GError *error = NULL; gchar **keys = NULL; gchar **values = NULL; if (!NIL_P(options)) { VALUE ary, key, value; ID to_s; gint len, i; Check_Type(options, T_HASH); to_s = rb_intern("to_s"); ary = rb_funcall(options, rb_intern("to_a"), 0); len = RARRAY_LEN(ary); keys = ALLOCA_N(gchar *, len + 1); values = ALLOCA_N(gchar *, len + 1); for (i = 0; i < len; i++) { key = RARRAY_PTR(RARRAY_PTR(ary)[i])[0]; if (SYMBOL_P(key)) { const char *const_key; const_key = rb_id2name(SYM2ID(key)); keys[i] = (gchar *)const_key; } else { keys[i] = (gchar *)RVAL2CSTR(key); } value = rb_funcall(RARRAY_PTR(RARRAY_PTR(ary)[i])[1], to_s, 0); values[i] = (gchar *)RVAL2CSTR(value); } keys[len] = NULL; values[len] = NULL; } if (filename) { gdk_pixbuf_savev(_SELF(self), filename, type, keys, values, &error); } #if RBGDK_PIXBUF_CHECK_VERSION(2,4,0) else { gchar *buffer; gsize buffer_size; if (gdk_pixbuf_save_to_bufferv(_SELF(self), &buffer, &buffer_size, type, keys, values, &error)) result = rb_str_new(buffer, buffer_size); } #endif if (error) RAISE_GERROR(error); return result; } /****************************************************/ /* File saving */ static VALUE rg_save(int argc, VALUE *argv, VALUE self) { VALUE filename, type, options; rb_scan_args(argc, argv, "21", &filename, &type, &options); return save_to(self, RVAL2CSTR(filename), RVAL2CSTR(type), options); } #if RBGDK_PIXBUF_CHECK_VERSION(2,4,0) /* XXX gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf, GdkPixbufSaveFunc save_func, gpointer user_data, const char *type, char **option_keys, char **option_values, GError **error); */ static VALUE rg_save_to_buffer(int argc, VALUE *argv, VALUE self) { VALUE type, options; rb_scan_args(argc, argv, "11", &type, &options); return save_to(self, NULL, RVAL2CSTR(type), options); } #endif /****************************************************/ /* Scaling */ static VALUE rg_scale(int argc, VALUE *argv, VALUE self) { GdkPixbuf* dest; VALUE dest_width, dest_height, interp_type, ret; GdkInterpType type = GDK_INTERP_BILINEAR; rb_scan_args(argc, argv, "21", &dest_width, &dest_height, &interp_type); if (!NIL_P(interp_type)) type = RVAL2GDKINTERPTYPE(interp_type); dest = gdk_pixbuf_scale_simple(_SELF(self), NUM2INT(dest_width), NUM2INT(dest_height), type); if (dest == NULL) return Qnil; ret = GOBJ2RVAL(dest); g_object_unref(dest); return ret; } static VALUE rg_scale_bang(int argc, VALUE *argv, VALUE self) { GdkInterpType type = GDK_INTERP_BILINEAR; VALUE src, src_x, src_y, src_width, src_height; VALUE offset_x, offset_y, scale_x, scale_y, interp_type; rb_scan_args(argc, argv, "91", &src, &src_x, &src_y, &src_width, &src_height, &offset_x, &offset_y, &scale_x, &scale_y, &interp_type); if (!NIL_P(interp_type)) type = RVAL2GDKINTERPTYPE(interp_type); gdk_pixbuf_scale(_SELF(src), _SELF(self), NUM2INT(src_x), NUM2INT(src_y), NUM2INT(src_width), NUM2INT(src_height), NUM2DBL(offset_x), NUM2DBL(offset_y), NUM2DBL(scale_x), NUM2DBL(scale_y), type); return self; } static VALUE rg_composite(VALUE self, VALUE dest_width, VALUE dest_height, VALUE interp_type, VALUE overall_alpha, VALUE check_size, VALUE color1, VALUE color2) { GdkPixbuf* dest; VALUE ret; GdkInterpType type = GDK_INTERP_BILINEAR; if (!NIL_P(interp_type)) type = RVAL2GDKINTERPTYPE(interp_type); dest = gdk_pixbuf_composite_color_simple( _SELF(self), NUM2INT(dest_width), NUM2INT(dest_height), type, NUM2INT(overall_alpha), NUM2INT(check_size), NUM2UINT(color1), NUM2UINT(color2)); if (dest == NULL) return Qnil; ret = GOBJ2RVAL(dest); g_object_unref(dest); return ret; } static VALUE rg_composite_bang(int argc, VALUE *argv, VALUE self) { VALUE ret; VALUE args[16]; GdkInterpType interp_type = GDK_INTERP_BILINEAR; rb_scan_args(argc, argv, "97", &args[0], &args[1], &args[2], &args[3], &args[4], &args[5], &args[6], &args[7], &args[8], &args[9], &args[10], &args[11], &args[12], &args[13], &args[14], &args[15]); switch (argc) { case 11: if (!NIL_P(args[9])) interp_type = RVAL2GDKINTERPTYPE(args[9]); gdk_pixbuf_composite(_SELF(args[0]), _SELF(self), NUM2INT(args[1]), NUM2INT(args[2]), NUM2INT(args[3]), NUM2INT(args[4]), NUM2DBL(args[5]), NUM2DBL(args[6]), NUM2DBL(args[7]), NUM2DBL(args[8]), interp_type, NUM2INT(args[10])); ret = self; break; case 16: if (!NIL_P(args[9])) interp_type = RVAL2GDKINTERPTYPE(args[9]); gdk_pixbuf_composite_color(_SELF(args[0]), _SELF(self), NUM2INT(args[1]), NUM2INT(args[2]), NUM2INT(args[3]), NUM2INT(args[4]), NUM2DBL(args[5]), NUM2DBL(args[6]), NUM2DBL(args[7]), NUM2DBL(args[8]), interp_type, NUM2INT(args[10]), NUM2INT(args[11]), NUM2INT(args[12]), NUM2INT(args[13]), NUM2UINT(args[14]), NUM2UINT(args[15])); ret = self; break; default: rb_raise(rb_eArgError, "Wrong number of arguments: %d", argc); break; } return ret; } #if RBGDK_PIXBUF_CHECK_VERSION(2,6,0) static VALUE rg_rotate(VALUE self, VALUE angle) { VALUE ret; GdkPixbuf* dest = gdk_pixbuf_rotate_simple(_SELF(self), RVAL2GDKPIXBUFROTATION(angle)); if (dest == NULL) return Qnil; ret = GOBJ2RVAL(dest); g_object_unref(dest); return ret; } static VALUE rg_flip(VALUE self, VALUE horizontal) { VALUE ret; GdkPixbuf* dest = gdk_pixbuf_flip(_SELF(self), RVAL2CBOOL(horizontal)); if (dest == NULL) return Qnil; ret = GOBJ2RVAL(dest); g_object_unref(dest); return ret; } #endif static VALUE rg_add_alpha(VALUE self, VALUE substitute_color, VALUE r, VALUE g, VALUE b) { VALUE ret; GdkPixbuf* dest = gdk_pixbuf_add_alpha(_SELF(self), RVAL2CBOOL(substitute_color), FIX2INT(r), FIX2INT(g), FIX2INT(b)); if (dest == NULL) return Qnil; ret = GOBJ2RVAL(dest); g_object_unref(dest); return ret; } static VALUE rg_copy_area(VALUE self, VALUE src_x, VALUE src_y, VALUE width, VALUE height, VALUE dest, VALUE dest_x, VALUE dest_y) { gdk_pixbuf_copy_area(_SELF(self), NUM2INT(src_x), NUM2INT(src_y), NUM2INT(width), NUM2INT(height), _SELF(dest), NUM2INT(dest_x), NUM2INT(dest_y)); return dest; } static VALUE rg_saturate_and_pixelate(VALUE self, VALUE staturation, VALUE pixelate) { GdkPixbuf* dest = gdk_pixbuf_copy(_SELF(self)); gdk_pixbuf_saturate_and_pixelate(_SELF(self), dest, NUM2DBL(staturation), RVAL2CBOOL(pixelate)); return GOBJ2RVAL(dest); } static VALUE rg_fill_bang(VALUE self, VALUE pixel) { gdk_pixbuf_fill(_SELF(self), NUM2UINT(pixel)); return self; } /* From Module Interface */ #if RBGDK_PIXBUF_CHECK_VERSION(2,2,0) static VALUE rg_s_formats(G_GNUC_UNUSED VALUE self) { return GSLIST2ARY2(gdk_pixbuf_get_formats(), GDK_TYPE_PIXBUF_FORMAT); } #ifdef HAVE_GDK_PIXBUF_SET_OPTION static VALUE rg_set_option(VALUE self, VALUE key, VALUE value) { return CBOOL2RVAL(gdk_pixbuf_set_option(_SELF(self), RVAL2CSTR(key), RVAL2CSTR(value))); } #else static VALUE rg_set_option(G_GNUC_UNUSED VALUE self, G_GNUC_UNUSED VALUE key, G_GNUC_UNUSED VALUE value) { rb_warning("not supported in this version of GTK+"); return Qfalse; } #endif #endif extern void Init_gdk_pixbuf2(void); void Init_gdk_pixbuf2(void) { VALUE mGdk = rb_define_module("Gdk"); VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GDK_TYPE_PIXBUF, "Pixbuf", mGdk); id_pixdata = rb_intern("pixdata"); /* gdk_rgb_init();*/ /* initialize it anyway */ /* * Initialization and Versions */ /* Removed. This crashes Ruby/GTK on Windows + GTK+-2.4.x. Pointed out by Laurent. #ifdef HAVE_GDK_PIXBUF_VERSION rb_define_const(RG_TARGET_NAMESPACE, "VERSION", CSTR2RVAL(gdk_pixbuf_version)); #endif */ rb_define_const(RG_TARGET_NAMESPACE, "MAJOR", INT2FIX(GDK_PIXBUF_MAJOR)); rb_define_const(RG_TARGET_NAMESPACE, "MINOR", INT2FIX(GDK_PIXBUF_MINOR)); rb_define_const(RG_TARGET_NAMESPACE, "MICRO", INT2FIX(GDK_PIXBUF_MICRO)); /* * The GdkPixbuf Structure */ G_REPLACE_GET_PROPERTY(RG_TARGET_NAMESPACE, "pixels", get_pixels, 0); RG_DEF_METHOD_OPERATOR("pixels=", set_pixels, 1); RG_DEF_METHOD(get_option, 1); /* GdkPixbufError */ G_DEF_ERROR(GDK_PIXBUF_ERROR, "PixbufError", mGdk, rb_eRuntimeError, GDK_TYPE_PIXBUF_ERROR); /* GdkColorspace */ G_DEF_CLASS(GDK_TYPE_COLORSPACE, "ColorSpace", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_COLORSPACE, "GDK_"); /* GdkPixbufAlphaMode */ G_DEF_CLASS(GDK_TYPE_PIXBUF_ALPHA_MODE, "AlphaMode", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_PIXBUF_ALPHA_MODE, "GDK_PIXBUF_"); /* * File Loading, Image Data in Memory */ RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(dup, 0); #if RBGDK_PIXBUF_CHECK_VERSION(2,4,0) RG_DEF_SMETHOD(get_file_info, 1); #endif /* * File saving */ RG_DEF_METHOD(save, -1); #if RBGDK_PIXBUF_CHECK_VERSION(2,4,0) RG_DEF_METHOD(save_to_buffer, -1); #endif /* * Scaling */ RG_DEF_METHOD(scale, -1); RG_DEF_METHOD_BANG(scale, -1); RG_DEF_METHOD(composite, 7); RG_DEF_METHOD_BANG(composite, -1); #if RBGDK_PIXBUF_CHECK_VERSION(2,6,0) RG_DEF_METHOD(rotate, 1); RG_DEF_METHOD(flip, 1); #endif /* GdkInterpType */ G_DEF_CLASS(GDK_TYPE_INTERP_TYPE, "InterpType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_INTERP_TYPE, "GDK_"); #if RBGDK_PIXBUF_CHECK_VERSION(2,6,0) /* GdkPixbufRotation */ G_DEF_CLASS(GDK_TYPE_PIXBUF_ROTATION, "GdkPixbufRotation", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GDK_TYPE_PIXBUF_ROTATION, "GDK_PIXBUF_"); #endif /* * Utilities */ RG_DEF_METHOD(add_alpha, 4); RG_DEF_METHOD(copy_area, 7); RG_DEF_METHOD(saturate_and_pixelate, 2); RG_DEF_METHOD_BANG(fill, 1); /* * Module Interface */ #if RBGDK_PIXBUF_CHECK_VERSION(2,2,0) RG_DEF_SMETHOD(formats, 0); RG_DEF_METHOD(set_option, 2); #endif Init_gdk_pixbuf_animation(mGdk); Init_gdk_pixbuf_animation_iter(mGdk); #if RBGDK_PIXBUF_CHECK_VERSION(2,8,0) Init_gdk_pixbuf_simpleanim(mGdk); #endif Init_gdk_pixdata(mGdk); Init_gdk_pixbuf_loader(mGdk); Init_gdk_pixbuf_format(mGdk); } ��������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/README������������������������������������������������������������0000644�0001750�0001750�00000001240�12257552167�015701� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ruby/GdkPixbuf2 =============== Ruby/GdkPixbuf2 is a Ruby binding of GdkPixbuf-2.x. Requirements ------------ Ruby: http://www.ruby-lang.org/ GTK+: http://www.gtk.org/ Ruby/GLib2, Ruby/GTK2: http://ruby-gnome2.sourceforge.net/ Install ------- 0. install ruby-1.9.x or later, GTK+, Ruby/GLib2 and Ruby/GTK2. 1. ruby extconf.rb 2. make 3. su 4. make install Copying ------- Copyright (c) 2002-2005 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/COPYING.LIB�������������������������������������������������������0000644�0001750�0001750�00000063642�12257552167�016477� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/lib/��������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�015572� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/lib/1.8/����������������������������������������������������������0000755�0001750�0001750�00000000000�12257665514�016101� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/lib/gdk_pixbuf2.rb������������������������������������������������0000644�0001750�0001750�00000002247�12257552167�020330� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������require 'glib2' base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) if vendor_dir.exist? require "cairo" end begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/gdk_pixbuf2.so" rescue LoadError require "gdk_pixbuf2.so" end if vendor_dir.exist? begin require "gobject-introspection" vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) rescue LoadError end end module Gdk class PixbufLoader def self.open(type = nil, mime_type = false) loader = Gdk::PixbufLoader.new(type, mime_type) if block_given? begin yield(loader) ensure loader.close end end loader end end class Pixbuf LOG_DOMAIN = "GdkPixbuf" class << self def cairo_available? if Gdk.respond_to?(:cairo_available?) Gdk.cairo_available? else false end end end end end GLib::Log.set_log_domain(Gdk::Pixbuf::LOG_DOMAIN) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/lib/1.9/����������������������������������������������������������0000755�0001750�0001750�00000000000�12257665514�016102� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/�����������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�016263� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/save.rb����������������������������������������������������0000644�0001750�0001750�00000001032�11701304107�017542� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin save.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: save.rb,v 1.5 2006/06/17 14:38:08 mutoh Exp $ =end require 'gdk_pixbuf2' from = ARGV[0] to = ARGV[1] if ! from or ! to puts "ruby #{$0} from_file to_file" exit(1) end src = Gdk::Pixbuf.new(from) dst = src.scale(300, 300, Gdk::Pixbuf::INTERP_HYPER) # This doesn't work .... #dst.save(to, "jpeg", {:quality => 100}) dst.save(to, "png") ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/simpleanim.rb����������������������������������������������0000644�0001750�0001750�00000001625�11701304107�020752� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin simpleanim.rb - Ruby/GdkPixbuf sample script for Gdk::PixbufSimpleAnim. Inspired by http://mail.gnome.org/archives/gtk-perl-list/2005-September/msg00110.html Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: simpleanim.rb,v 1.2 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' $stdout.sync = true simple_anim = Gdk::PixbufSimpleAnim.new(64, 64, 24) store_pixels = [] print 'generating frames' for red in 0 .. 126 store_pixels << pixels = ([ 4*(63-red).abs, 0, 0 ] * (64*64)).pack('C*') pixbuf = Gdk::Pixbuf.new(pixels, Gdk::Pixbuf::COLORSPACE_RGB, false, 8, 64, 64, 64*3) simple_anim.add_frame(pixbuf) print '.' end puts 'done' window = Gtk::Window.new image = Gtk::Image.new(simple_anim) window.add(image) window.show_all window.signal_connect('destroy') { Gtk.main_quit } Gtk.main �����������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/utils.rb���������������������������������������������������0000644�0001750�0001750�00000001670�11701304107�017754� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin utils.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: utils.rb,v 1.4 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' filename = ARGV[0] unless filename puts "ruby #{$0} filename" exit(1) end src = Gdk::Pixbuf.new(filename) vbox = Gtk::VBox.new dst = src.add_alpha(true, 0, 0, 0) vbox.pack_start(Gtk::Image.new(dst)) dst = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, true, 8, src.width + 20, src.height + 30) src.copy_area(0, 0, src.width / 2, src.height / 2, dst, 10, 20) vbox.pack_start(Gtk::Image.new(dst)) dst = src.saturate_and_pixelate(0.3, true) vbox.pack_start(Gtk::Image.new(dst)) dst = src.fill!(0xff000099) #RGBA vbox.pack_start(Gtk::Image.new(dst)) w = Gtk::Window.new.add(vbox) w.signal_connect('delete-event') do Gtk.main_quit end w.show_all Gtk.main ������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/rotate.rb��������������������������������������������������0000644�0001750�0001750�00000001502�11701304107�020104� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin rotate.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: rotate.rb,v 1.3 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' filename = ARGV[0] unless filename puts "ruby #{$0} filename" exit(1) end if str = Gtk.check_version(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" puts str exit end vbox = Gtk::VBox.new src = Gdk::Pixbuf.new(filename) vbox.add(Gtk::Image.new(src)) dst = src.rotate(Gdk::Pixbuf::ROTATE_COUNTERCLOCKWISE) vbox.add(Gtk::Image.new(dst)) dst2 = src.rotate(Gdk::Pixbuf::ROTATE_UPSIDEDOWN) vbox.add(Gtk::Image.new(dst2)) window = Gtk::Window.new window.signal_connect('delete-event') do Gtk.main_quit end window.add(vbox).show_all Gtk.main ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/pixdata.rb�������������������������������������������������0000644�0001750�0001750�00000001573�11701304107�020250� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin pixdata.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: pixdata.rb,v 1.2 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' r_xpm = [ "10 10 3 1", " c None", ". c #FE0B0B", "+ c #FFFFFF", "+.......++", "+.. ..+", "+.. ..+", "+.. ...+", "+.......++", "+.....++++", "+..++..+++", "+..++...++", "+..+++...+", "+..++++..+"] pixbuf = Gdk::Pixbuf.new(r_xpm) pixdata = Gdk::Pixdata.from_pixbuf(pixbuf, false) #Serialize data p data = pixdata.serialize #Deserialize data pixdata = Gdk::Pixdata.deserialize(data) pixbuf2 = pixdata.to_pixbuf(false) dst = pixbuf2.scale(300, 300, Gdk::Pixbuf::INTERP_HYPER) Gtk::Window.new.add(Gtk::Image.new(dst)).show_all Gtk.main �������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/flip.rb����������������������������������������������������0000644�0001750�0001750�00000001431�11701304107�017541� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin flip.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2005,2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: flip.rb,v 1.3 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' filename = ARGV[0] unless filename puts "ruby #{$0} filename" exit(1) end if str = Gtk.check_version(2, 6, 0) puts "This sample requires GTK+ 2.6.0 or later" puts str exit end vbox = Gtk::VBox.new src = Gdk::Pixbuf.new(filename) vbox.add(Gtk::Image.new(src)) # Horizontal dst = src.flip(true) vbox.add(Gtk::Image.new(dst)) # Vertical dst2 = src.flip(false) vbox.add(Gtk::Image.new(dst2)) window = Gtk::Window.new window.signal_connect('delete-event') do Gtk.main_quit end window.add(vbox).show_all Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/loader.rb��������������������������������������������������0000644�0001750�0001750�00000000706�11701304107�020061� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin loader.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2003,2006: Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: loader.rb,v 1.3 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' loader = Gdk::PixbufLoader.new File.open("gnome-foot.png","rb") { |f| loader.last_write(f.read) } pixbuf = loader.pixbuf Gtk::Window.new.add(Gtk::Image.new(pixbuf)).show_all Gtk.main ����������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/anim.rb����������������������������������������������������0000644�0001750�0001750�00000001341�11701304107�017533� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin anim.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: anim.rb,v 1.5 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' w = Gtk::Window.new w.signal_connect('delete-event') do Gtk.main_quit end box = Gtk::VBox.new src = Gdk::PixbufAnimation.new("floppybuddy.gif") box.pack_start(Gtk::Image.new(src)) p src.width p src.height p src.static_image? static_image = src.static_image box.pack_start(Gtk::Image.new(static_image)) iter = src.get_iter p iter.advance p iter.delay_time p iter.on_currently_loading_frame? box.pack_start(Gtk::Image.new(iter.pixbuf)) w.add(box) w.show_all Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/floppybuddy.gif��������������������������������������������0000644�0001750�0001750�00000012140�11701304107�021311� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89aP�F�÷€����  !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~�ãã‚‚‚ƒƒƒ„„„………†††‡‡‡ˆˆˆ‰‰‰ŠŠŠ‹‹‹ŒŒŒŽŽŽ‘‘‘’’’“““”””•••–––———˜˜˜™™™ššš›››œœœžžžŸŸŸ   ¡¡¡¢¢¢£££¤¤¤¥¥¥¦¦¦ÿ��¨¨¨ÿÿ=v{ÿ«««¬¬¬­­­®®®¯¯¯°°°±±±²²²³³³´´´µµµ¶¶¶···¸¸¸¹¹¹ººº»»»¼¼¼½½½¾¾¾¿¿¿¸ÂÙÁÁÁÂÂÂÃÃÃÄÄÄÅÅÅÆÆÆÇÇÇÈÈÈÉÉÉÊÊÊËËËÌÌÌÍÍÍÎÎÎÏÏÏÐÐÐÑÑÑÒÒÒÓÓÓÔÔÔÕÕÕÖÖÖ×××ØØØÙÙÙÚÚÚÛÛÛÜÜÜÝÝÝÞÞÞßßßàààáááâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿ!ÿ NETSCAPE2.0è�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó¦H� ‹þŠ2hJ§2rD)@*0£.µšª©O®[µvDÙ•@ª³Xsjjõé×¶lÅ6$æÙ«wÓÒ5¨”mW¯)»ÆÝ9- ½Í¢Í{ø,ÒEgúu8ìÎÇ Ó5|’®b¼‹Œ¼ô­S¯C£J%ˆx3è«|C¿f ™´ÐÛ¸Ic¨¹qhº»q}vmÛB—N­•êÀÏÐóþ-½8çª(U/g»ysêûÖ_þ9¼qáÙµã^?¸9yó³ßï‹>²döëí§¾|pÞó§_Mª6Ó~ÏÁ‡ÖÏ•‡vé(á„Þ„`‚.ä}õ W!*IøØ…¾õçІ£9gßNÀ´èâ‹À�ðÇúAÈškhq¨áƒ®8SŒ)ÁãŒ5ÚHg¡f>�$JBÊH£L:×àƒmÜh:‰QIeŠô!I‘–6 $˜0JY$dH¢X‘™'u¹¦“mŠ©Ah긑š*…9åž|j’šB¾è昉aéÑ€x&Úbˆ„âÄåe1aJ„Yzi… véiŠš–J¢§¦¦:*©”©¸êA*=äÒ«°žª­´ç®¹ê𔕽ò,B¼k$±ÃKªO9Ūl}<ëWL%‹*QÉMËÖi¯.WÚ~H¡†šS•;R¸Âáçìvç‘®»Õ¶;îm_2xn~)Á.÷ïµÉåkn¼2zk0Áõê À.9,oÄ[.ºÏf¬ñÆwìñÇ#�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó&΃EE4eS™Fž„ª@ªTL}ZÅ 4©TƒI»bÍš’ëPª �vèX¢(ÍúDËÀÕµj7)Ö©V«U©¨{×nªµ÷*ýÛ4ëYºóR{÷êáœ5Á*ʹ³âÁ ãµ,š�h‚q ¶|PJ¨|…’]üx'ÊФsW¾Z÷êË_Sí¬•øÞ™­'[Ö}˜uä«[[Eì%ìØÄ_Où|9s¬ûÏ¥.PøðìÚasÇí½¹sƒ†ÛSW¹½¦ýú¼Æo8yèý’•gÞuhà`ë ´ŸwÔ%¤V€"h röY·]„ìÉ—Öƒ¨ñvÜNÀ„(âˆÀ�ðÇÇ–àd”‘Ö`]&øáL%¦Db‰'¦\~ rуx™vÚŒ�ÔˆÒ&¢x!†ÿAjµFd("™ã’6èãDP¾8%JU’˜¤Ž¨q¤E[¢V`‘`)æ•êÁ×eH_Úø¦’qÊy&[kÞx'™¥éQŠGú)"}y~åš`1Uh!…;)ZÞ„”NèNŽfê’¤šv*i„Ú÷éI+¤Ҩšñhꥄ¨–Š«¨Vk‡³Žêjª±*t뎵¶Ê¬›æ*+Od!UÜ_½’D–lÆvÕ§²5†`u]Ñ6”kØŽ4­µ²¡è-·M¡œ²Ôf—Ò·Žyfb²«’¸¢˜nWâJ5ï¹Ó¢æвµù•cøÂ$¯Kì~͵n›­° 7ìðÃG,±T�!þ’This GIF file was assembled by CDavis with GIF Construction Set from: Alchemy Mindworks Inc. P.O. Box 500 Beeton, Ontario L0G 1A0 CANADA. �!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó¦H� ‹þŠ2hJ§2rD)@*0£.µšª©O®[µvDÙ•@ª³Xsjjõé×¶lÅ6$æÙ«wÓÒ5¨”mW¯)»ÆÝ9- ½Í¢Í{ø,ÒEgúu8ìÎÇ Ó5|’®b¼‹Œ¼ô­S¯C£J%ˆx3è«|C¿f ™´ÐÛ¸Ic¨¹qhº»q}vmÛB—N­•êÀÏÐóþ-½8çª(U/g»ysêûÖ_þ9¼qáÙµã^?¸9yó³ßï‹>²döëí§¾|pÞó§_Mª6Ó~ÏÁ‡ÖÏ•‡vé(á„Þ„`‚.ä}õ W!*IøØ…¾õçІ£9gßNÀ´èâ‹À�ðÇúAÈškhq¨áƒ®8SŒ)ÁãŒ5ÚHg¡f>�$JBÊH£L:×àƒmÜh:‰QIeŠô!I‘–6 $˜0JY$dH¢X‘™'u¹¦“mŠ©Ah긑š*…9åž|j’šB¾è昉aéÑ€x&Úbˆ„âÄåe1aJ„Yzi… véiŠš–J¢§¦¦:*©”©¸êA*=äÒ«°žª­´ç®¹ê𔕽ò,B¼k$±ÃKªO9Ūl}<ëWL%‹*QÉMËÖi¯.WÚ~H¡†šS•;R¸Âáçìvç‘®»Õ¶;îm_2xn~)Á.÷ïµÉåkn¼2zk0Áõê À.9,oÄ[.ºÏf¬ñÆwìñÇ#�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó&΃EE4eS™Fž„ª@ªTL}ZÅ 4©TƒI»bÍš’ëPª �vèX¢(ÍúDËÀÕµj7)Ö©V«U©¨{×nªµ÷*ýÛ4ëYºóR{÷êáœ5Á*ʹ³âÁ ãµ,š�h‚q ¶|PJ¨|…’]üx'ÊФsW¾Z÷êË_Sí¬•øÞ™­'[Ö}˜uä«[[Eì%ìØÄ_Où|9s¬ûÏ¥.PøðìÚasÇí½¹sƒ†ÛSW¹½¦ýú¼Æo8yèý’•gÞuhà`ë ´ŸwÔ%¤V€"h röY·]„ìÉ—Öƒ¨ñvÜNÀ„(âˆÀ�ðÇÇ–àd”‘Ö`]&øáL%¦Db‰'¦\~ rуx™vÚŒ�ÔˆÒ&¢x!†ÿAjµFd("™ã’6èãDP¾8%JU’˜¤Ž¨q¤E[¢V`‘`)æ•êÁ×eH_Úø¦’qÊy&[kÞx'™¥éQŠGú)"}y~åš`1Uh!…;)ZÞ„”NèNŽfê’¤šv*i„Ú÷éI+¤Ҩšñhꥄ¨–Š«¨Vk‡³Žêjª±*t뎵¶Ê¬›æ*+Od!UÜ_½’D–lÆvÕ§²5†`u]Ñ6”kØŽ4­µ²¡è-·M¡œ²Ôf—Ò·Žyfb²«’¸¢˜nWâJ5ï¹Ó¢æвµù•cøÂ$¯Kì~͵n›­° 7ìðÃG,±T�!þThis space for rent...�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó¦H� ‹þŠ2hJ§2rD)@*0£.µšª©O®[µvDÙ•@ª³Xsjjõé×¶lÅ6$æÙ«wÓÒ5¨”mW¯)»ÆÝ9- ½Í¢Í{ø,ÒEgúu8ìÎÇ Ó5|’®b¼‹Œ¼ô­S¯C£J%ˆx3è«|C¿f ™´ÐÛ¸Ic¨¹qhº»q}vmÛB—N­•êÀÏÐóþ-½8çª(U/g»ysêûÖ_þ9¼qáÙµã^?¸9yó³ßï‹>²döëí§¾|pÞó§_Mª6Ó~ÏÁ‡ÖÏ•‡vé(á„Þ„`‚.ä}õ W!*IøØ…¾õçІ£9gßNÀ´èâ‹À�ðÇúAÈškhq¨áƒ®8SŒ)ÁãŒ5ÚHg¡f>�$JBÊH£L:×àƒmÜh:‰QIeŠô!I‘–6 $˜0JY$dH¢X‘™'u¹¦“mŠ©Ah긑š*…9åž|j’šB¾è昉aéÑ€x&Úbˆ„âÄåe1aJ„Yzi… véiŠš–J¢§¦¦:*©”©¸êA*=äÒ«°žª­´ç®¹ê𔕽ò,B¼k$±ÃKªO9Ūl}<ëWL%‹*QÉMËÖi¯.WÚ~H¡†šS•;R¸Âáçìvç‘®»Õ¶;îm_2xn~)Á.÷ïµÉåkn¼2zk0Áõê À.9,oÄ[.ºÏf¬ñÆwìñÇ#�!ù �€�,����L�>�ü� H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²dA�(Sª\Ér¥É…�NjI“æÌ— cÊ JÏž@ƒöü©ó&΃EE4eS™Fž„ª@ªTL}ZÅ 4©TƒI»bÍš’ëPª �vèX¢(ÍúDËÀÕµj7)Ö©V«U©¨{×nªµ÷*ýÛ4ëYºóR{÷êáœ5Á*ʹ³âÁ ãµ,š�h‚q ¶|PJ¨|…’]üx'ÊФsW¾Z÷êË_Sí¬•øÞ™­'[Ö}˜uä«[[Eì%ìØÄ_Où|9s¬ûÏ¥.PøðìÚasÇí½¹sƒ†ÛSW¹½¦ýú¼Æo8yèý’•gÞuhà`ë ´ŸwÔ%¤V€"h röY·]„ìÉ—Öƒ¨ñvÜNÀ„(âˆÀ�ðÇÇ–àd”‘Ö`]&øáL%¦Db‰'¦\~ rуx™vÚŒ�ÔˆÒ&¢x!†ÿAjµFd("™ã’6èãDP¾8%JU’˜¤Ž¨q¤E[¢V`‘`)æ•êÁ×eH_Úø¦’qÊy&[kÞx'™¥éQŠGú)"}y~åš`1Uh!…;)ZÞ„”NèNŽfê’¤šv*i„Ú÷éI+¤Ҩšñhꥄ¨–Š«¨Vk‡³Žêjª±*t뎵¶Ê¬›æ*+Od!UÜ_½’D–lÆvÕ§²5†`u]Ñ6”kØŽ4­µ²¡è-·M¡œ²Ôf—Ò·Žyfb²«’¸¢˜nWâJ5ï¹Ó¢æвµù•cøÂ$¯Kì~͵n›­° 7ìðÃG,±T�!þïThis GIF file was assembled with GIF Construction Set from: Alchemy Mindworks Inc. P.O. Box 500 Beeton, Ontario L0G 1A0 CANADA. This comment block will not appear in files created with a registered version of GIF Construction Set�;��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/scale.rb���������������������������������������������������0000644�0001750�0001750�00000001771�11701304107�017705� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin scale.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: scale.rb,v 1.10 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' filename = ARGV[0] unless filename puts "ruby #{$0} filename" exit(1) end vbox = Gtk::VBox.new src = Gdk::Pixbuf.new(filename) vbox.add(Gtk::Image.new(src)) dst = src.scale(200, 200, Gdk::Pixbuf::INTERP_NEAREST) dst.scale!(src, 60, 60, 90, 90, -50, 50, 6, 3) vbox.add(Gtk::Image.new(dst)) dst2 = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, true, 8, 200, 200) dst2.scale!(src, 0, 0, 100, 100, 0, 0, 1.5, 1.5) vbox.add(Gtk::Image.new(dst2)) dst3 = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, true, 8, 200, 200) dst3.scale!(src, 0, 0, 200, 200, 0, 0, 5, 3, Gdk::Pixbuf::INTERP_HYPER) vbox.add(Gtk::Image.new(dst3)) window = Gtk::Window.new window.signal_connect('delete-event') do Gtk.main_quit end window.add(vbox).show_all Gtk.main �������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/format.rb��������������������������������������������������0000644�0001750�0001750�00000001753�11701304107�020106� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin format.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: format.rb,v 1.4 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' if str = Gtk.check_version(2, 2, 0) puts "This sample requires GTK+ 2.2.0 or later" puts str exit end filename = ARGV[0] unless filename puts "ruby #{$0} filename" exit(1) end puts fileinfo = Gdk::Pixbuf.get_file_info(filename)[0] puts "name = #{fileinfo.name}" puts "description = #{fileinfo.description}" puts "mime_types = #{fileinfo.mime_types.inspect}" puts "extensions = #{fileinfo.extensions.inspect}" puts "writable = #{fileinfo.writable?}" puts "domain = #{fileinfo.domain}" puts "signature = #{fileinfo.signature.inspect}" if Gtk.check_version?(2, 6, 0) puts "Since 2.6 --- " puts "scalable = #{fileinfo.scalable?}" puts "disabled = #{fileinfo.disabled?}" puts "license = #{fileinfo.license.inspect}" end ���������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/inline.rb��������������������������������������������������0000644�0001750�0001750�00000002105�11701304107�020064� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin inline.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2004-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: inline.rb,v 1.2 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' pixbuf = Gdk::Pixbuf.new("gnome-foot.png") #pixbuf = Gdk::Pixbuf.new(ARGV[0]) # Create Gdk::Pixbuf from pixels(String). pixbuf2 = Gdk::Pixbuf.new(pixbuf.pixels, Gdk::Pixbuf::COLORSPACE_RGB, true, pixbuf.bits_per_sample, pixbuf.width, pixbuf.height, pixbuf.rowstride) # Create Gdk::Pixbuf from an array of numbers # which created by Gdk::Pixdata#serialize. pixdata = Gdk::Pixdata.from_pixbuf(pixbuf, false) data = pixdata.serialize pixbuf3 = Gdk::Pixbuf.new(data, false) # Create Gdk::Pixbuf from Gdk::Pixbuf. pixbuf4 = Gdk::Pixbuf.new(pixbuf, 10, 10, 20, 20) vbox = Gtk::VBox.new vbox.add(Gtk::Image.new(pixbuf)) vbox.add(Gtk::Image.new(pixbuf2)) vbox.add(Gtk::Image.new(pixbuf3)) vbox.add(Gtk::Image.new(pixbuf4)) Gtk::Window.new.add(vbox).show_all Gtk.main �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/gnome-foot.png���������������������������������������������0000644�0001750�0001750�00000005544�11701304107�021053� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR���/���0���§#â���gAMA�† 1è–_�� IDATxÚíYkl×y=wfvvf¹»Ü—ø¶)Q¢‡®Ūl#H¬¨qd×mT i›4N A †´(Šnì� šþ‹]Ë l´µì<ä§â8vÜ*–#%RDY$MJæŠÏå>¸»Ü÷Ìì¼·?2T ·€,‹T\À0»³çžïÜs¿ ¼_ï×e»/ýׇ Ýóµ»oß>Ð:qj¼Àýþ…^Ú·o߉¡¡m÷Xíæ—pöd åWMËjoô1Wð[â?kll,°cûСT*5â:6ÑM‹•$eW2þo�bï ð¿xù¥ÑÉ3§ò“Ç}ò3ºÿÆõü›¯}õ–xgô¥­PUÕÑjI´3&–cïò�¸ß+øûÆwM&â rÕ¿%vì£{vÝ€ïéîú”$+Œ¥µQ)à˜:ÚšN•¶Æ˜–ýU�¿OðdçΑ/ËR³7ODzHKR"ÉxôûÉDb›ªëƒ–!ÍzKéÏAHˆiY�0  ïíR»’ºÜedLU©ó(fàyêQŠ–¤ôïûàݵr‘]] Cj6ѪU!É”¶J-Ë€€a�³å>—­Áå奂�‹JŠ‚zµ‚|q “ççˆEï0Ÿyúçæm{©¦µA=åJ™|¶ã¬7xx#™¿l«ÔuSÛ6Ð}Wz6˜™#gÞ˜%r[%-¹M²«¥ƒ–i|¢Zov,e ˜|óŸçQÀpÀ"�zÕÀ}åÃ_¼ëówÔª•âñ_Ÿ¬hšÚU®ÔvycŠª­­ àѦ¬¤Y†|´)ÉB&_‚ã¸Ä; àq�Õ«¶ßtÓMb¹\^”¥–÷ÄcÏŽŒØ& ÁG�Ô}F+�îå8nÿu;·ÿhdhp6ÒZbæe�w7Û%5¿ÿ“· 3 3Ôjµ`*Íá-ñ賎û¤n˜�xÊw€�-�8pàÀéh$Rwmcg.›#««…\½Ùšm´d몂g ¬•Kdjê,ÍJ(”*Û}–ïðk_z�úâÏ~º'žHýíµ×^sk¤£#¥È-¦­Èdzü7vq5_ÏVONžKçÄøÔÌF8Î%5¯*²¸­'ö¹QcŽþêÎ]X„iÙÃ�žõõëÞ÷Ío„<øýëGG¿ïŒÞÐV”Ë4PŠ¥…y°ŒäÃz[¾®Öl}¶Ñ”Nj†™¿Òƽ$ó¯O¾‘?õÛñ)ž#»³…"Ñ �::Bâͪ¦Ï?ôàƒ±OìûøK× îiTËðAªDZõ*ÄpÍz0 m[”6–V 1YQ¿ àO|¹mªÏKO½ø_·gìƒÿ^ªÔ†|Ÿ6<JÛ{÷îíØ÷ñ[ÖÓÛ󇦮AWUšžž Z[¡Õê±-„åž_¢ƒ½ R\«Ò|©B,ÇÐ¥à/%òõ¯ß+&S)í§?å5JiÖó¼–a~dÙökÏ?ÿÜýÃÃ#¦È-È­:YLŸC«^%Íz”RO$`êáàôÄ42Ù²«eâ÷ÈÓ� ›Å<33=ýÍ­[·þ}³¶úØ£ó?öø?Î-eu=OýÁ#¸¿¯ï+ŽmžâÂòò+‹°-,Ç‘Žpº¦]ÓŒÇH_w ÇÇ'×5®û»9ÁìᇾwCW*ñmÓÐ#µµר–¯ëÙ’<448°€5<<|<—³l›– +¨UÊ`–D¢QpG]Ç ÒD2‰JµŠÅ•<$Y¹˜2�Ô6­aŸxâpu'ÀóŽ€Î-­ X®†cÑð?ˆ¢pw,ù Òr±€Å¹4ÕÕ6 ð<µ,“0 ÏóÐn+¨V*ôìôyœ™z“x…o‘G|ð›ãógÎNåÂ<{¸+ÿÂj©J.,­ Úhaë@ï®T"±€&šõ14ª,An«Ð4XÉd’´šuÌÎ/’ó1y~†yqšð �m37)娩³÷'bQÏ0ÌÏi†É –D‰D’‚¦¡¡\ÈB… šÖ*5Äã1œ9;A³…UrjâmJ y‹< �þÀ¿i7 <k´äoøLÝ`@7¬çD!([¦N’½4(ˆ°-¢ˆC[1sþ<òÅ5;y–ê¿cÛÐ0àQ�GÿÖÉ»Ñÿ¥|ÞóÓâ�¿¶§ Gz뵪ËNETŠy˜†ÏóÀ³ ¦gçà·ö3P@€€=üÃÇ?”ÚÒuÝ)K-” ùåñññ=u$ ÀÚ¨M þËÖüŠª†u]3µ¶Ì b®ëRÏs‰¢(t9·JJ•ú:‹/û2™à�À‘gŸ¾iûжGú®ùièımPÏõRïýûo½ùÇÿyüô½�¤ ?I@znAn·U…Rt˜†NÃÑN(R“6 Ô›õONm�ÿ`~ø·¿u_߇wíz™òq×¶‰çºTn5`èÇA­Þ`‹åê„ ?e˜ÖAå6<�³Z«ç®èq¶e!à‰(ŠðÛÔ—Èì[¤ÓéÄbz&¤*R]½�Y[Íö-Z.®"[(a>“ƒiÙŸðÄ¥âûoå²¹‰ë¯Ù#vD�P0Ƕ‰`Y®ëooÌÃÏ<—WšÕ'oûØ-_n˱LƒºA±œYA¦P„iÙ�òì͘˜¹óK˯êºF M%‘αM,Ë¢§+…Á¾"ƒýä¸å—~yâŸ^=ùú3,ÇÑžAÒOV³×u±V­_\Ùwâ>ïzVY©TÕ?øÀŽ/ÏlË$ŽãÀ²,DÂ!ù�M%c¡î-‰”¤¨¯™–ýV0íù¥ÌÌŸÿåçìélV+T‘%drLÌ\€ãº�0ày?m¸lÐ’•Úøë'ÇFGîL%“4D2IEMÀ £ÔëM‰F>ûéOÝy3Šõ¨·°ã׳ݽý}±X|wo_oÿÊü,µl ¶ãbi¥�ãúå�uSÜÆ/#[(=948ðÇ `zz{a[aY᎞GPIg,¾íÚí#ð úúûHu¡^-CmËà¸�Š¥]XÉ_äÀÄ;ñú+™{¿˜>¾¶V™WU ¶mƒåX0, Ï£4ÚC<‘ЪW©®©`Yº¦"³Fni¥|¹•e̤Pk´Ößû� ï$>\é|Þr=×NÆ"·«í6  C�JY¦Ç’b!ǶÈZ±@MC#Å\†VË«¤V)cöÂ=vjªn¬çüïøÌ»› Þ[«5ò‚ ìòÜVI’a[xŽƒØÑA¢qD¢1†×¶‰ ŠXYZ�¥ Éd2ôÔÙÌgrç[�óçAWåfD/Wk3Çý‘G½„iZ„eâyxž'�ˆe™„BD1D8–%kkeL›%ÇOOÂõ<øáí²æ^-ðÔõ¼FµÞœ$ 1-;Ñ”dhªF$©EmS'–eQ]Ó‰m0Mƒ,g2xýó8vê,Õ~7ð|Æ/çjf£Š0Ö½%ñÏÑŽÐ^Â0l8$Òî-I° ƒ(J=j;.–²«XÈäˆaZëÞÊbMoÖåÛ;M©C| ð-Q®8΂<‚< ‰‚<e†ú^N}Æßôg8ÞE�DÜ à»~Ž×|F=ÿq}??àvnÿ®þh³ŠñAõû7"ÛtûŸW|/?ç ­÷ø·CÀ—ñ󽽞ó߯÷ë*Öø À樕ÇF����IEND®B`‚������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/xpm.rb�����������������������������������������������������0000644�0001750�0001750�00000001407�11701304107�017416� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin xpm.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: xpm.rb,v 1.5 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' r_xpm = [ "10 10 3 1", " c None", ". c #FE0B0B", "+ c #FFFFFF", "+.......++", "+.. ..+", "+.. ..+", "+.. ...+", "+.......++", "+.....++++", "+..++..+++", "+..++...++", "+..+++...+", "+..++++..+"] w = Gtk::Window.new w.signal_connect('delete-event') do Gtk.main_quit end src = Gdk::Pixbuf.new(r_xpm) dst = src.scale(300, 300, Gdk::Pixbuf::INTERP_HYPER) w.add(Gtk::Image.new(dst)) w.show_all Gtk.main ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/sample/composite.rb�����������������������������������������������0000644�0001750�0001750�00000002142�11701304107�020611� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin composite.rb - Ruby/GdkPixbuf sample script. Copyright (c) 2002-2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: composite.rb,v 1.6 2006/06/17 14:38:08 mutoh Exp $ =end require 'gtk2' filename = ARGV[0] unless filename puts "ruby #{$0} filename" exit(1) end src = Gdk::Pixbuf.new(filename) vbox = Gtk::VBox.new dst = src.composite(100, 100, Gdk::Pixbuf::INTERP_HYPER, 200, 32, 0xFF0000, 0x00FF00) vbox.pack_start(Gtk::Image.new(dst)) dst = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, true, 8, 200, 200) dst.composite!(src, 0, 0, 200, 200, 0, 0, 1.8, 1.8, Gdk::Pixbuf::INTERP_HYPER, 200) vbox.pack_start(Gtk::Image.new(dst)) dst = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, true, 8, 200, 200) dst.composite!(src, 10, 10, 180, 180, 15, 15, 3, 2, Gdk::Pixbuf::INTERP_BILINEAR, 200, 100, 100, 16, 0x999999, 0xdddddd) vbox.pack_start(Gtk::Image.new(dst)) window = Gtk::Window.new.add(vbox) window.signal_connect('delete-event') do Gtk.main_quit end window.show_all Gtk.main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/extconf.rb��������������������������������������������������������0000644�0001750�0001750�00000002232�11701304107�016774� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "gdk_pixbuf2" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gdk_pixbuf2/Rakefile����������������������������������������������������������0000644�0001750�0001750�00000001677�12257664725�016510� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require "gnome2/rake/package-task" package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/GdkPixbuf2 is a Ruby binding of GdkPixbuf-2.x." package.description = "Ruby/GdkPixbuf2 is a Ruby binding of GdkPixbuf-2.x." package.dependency.gem.runtime = ["glib2"] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = [ "glib2", "gobject-introspection", ] package.external_packages = [ { :name => "gdk-pixbuf", :download_site => :gnome, :label => "gdk-pixbuf", :version => "2.30.2", :compression_method => "xz", :windows => { :configure_args => [ "--with-included-loaders", "--enable-introspection", ], :build_concurrently => false, :built_file => "bin/libgdk_pixbuf-2.0-0.dll", }, } ] end package_task.define �����������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665516�015333� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/ext/������������������������������������������������������������0000755�0001750�0001750�00000000000�12077252561�016123� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/ext/cairo-gobject/����������������������������������������������0000755�0001750�0001750�00000000000�12257552167�020640� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/ext/cairo-gobject/rb-cairo-gobject.h����������������������������0000644�0001750�0001750�00000002525�12077252561�024121� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef RB_CAIRO_GOBJECT_H #define RB_CAIRO_GOBJECT_H #include <ruby.h> #include <rbgobject.h> #include <glib-enum-types.h> #include <cairo-gobject.h> #ifndef CAIRO_GOBJECT_TYPE_HINT_METRICS # define CAIRO_GOBJECT_TYPE_HINT_METRICS CAIRO_GOBJECT_TYPE_HNT_METRICS #endif #ifndef CAIRO_GOBJECT_TYPE_TEXT_CLUSTER_FLAGS # define CAIRO_GOBJECT_TYPE_TEXT_CLUSTER_FLAGS cairo_gobject_text_cluster_flags_get_type () #endif #include <rb_cairo.h> extern void Init_cairo_gobject(void); #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/ext/cairo-gobject/rb-cairo-gobject.c����������������������������0000644�0001750�0001750�00000016764�12077252561�024126� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-cairo-gobject.h" #define RG_TARGET_NAMESPACE rb_mCairoGObject #define DEFINE_CONVERSION(prefix, gtype, rb_klass, RVAL2CR, CR2RVAL) \ static gpointer \ prefix ## _robj2instance(VALUE rb_object, \ G_GNUC_UNUSED gpointer user_data) \ { \ VALUE rb_boxed; \ \ rb_boxed = rb_iv_get(rb_object, "gboxed"); \ if (NIL_P(rb_boxed)) { \ gpointer cr_object = RVAL2CR(rb_object); \ rb_boxed = rbgobj_make_boxed_default(cr_object, gtype); \ rb_iv_set(rb_object, "gboxed", rb_boxed); \ } \ \ return rbgobj_boxed_get_default(rb_boxed, gtype); \ } \ \ static VALUE \ prefix ## _instance2robj(gpointer cr_object, \ G_GNUC_UNUSED gpointer user_data) \ { \ return CR2RVAL(cr_object); \ } \ \ static void \ define_ ## prefix ## _conversion(void) \ { \ RGConvertTable table; \ \ memset(&table, 0, sizeof(RGConvertTable)); \ table.type = gtype; \ table.klass = rb_klass; \ table.robj2instance = prefix ## _robj2instance; \ table.instance2robj = prefix ## _instance2robj; \ \ RG_DEF_CONVERSION(&table); \ } DEFINE_CONVERSION(context, CAIRO_GOBJECT_TYPE_CONTEXT, rb_cCairo_Context, RVAL2CRCONTEXT, CRCONTEXT2RVAL) DEFINE_CONVERSION(device, CAIRO_GOBJECT_TYPE_DEVICE, rb_cCairo_Device, RVAL2CRDEVICE, CRDEVICE2RVAL) DEFINE_CONVERSION(pattern, CAIRO_GOBJECT_TYPE_PATTERN, rb_cCairo_Pattern, RVAL2CRPATTERN, CRPATTERN2RVAL) DEFINE_CONVERSION(surface, CAIRO_GOBJECT_TYPE_SURFACE, rb_cCairo_Surface, RVAL2CRSURFACE, CRSURFACE2RVAL) DEFINE_CONVERSION(scaled_font, CAIRO_GOBJECT_TYPE_SCALED_FONT, rb_cCairo_ScaledFont, RVAL2CRSCALEDFONT, CRSCALEDFONT2RVAL) DEFINE_CONVERSION(font_face, CAIRO_GOBJECT_TYPE_FONT_FACE, rb_cCairo_FontFace, RVAL2CRFONTFACE, CRFONTFACE2RVAL) DEFINE_CONVERSION(font_options, CAIRO_GOBJECT_TYPE_FONT_OPTIONS, rb_cCairo_FontOptions, RVAL2CRFONTOPTIONS, CRFONTOPTIONS2RVAL) DEFINE_CONVERSION(region, CAIRO_GOBJECT_TYPE_REGION, rb_cCairo_Region, RVAL2CRREGION, CRREGION2RVAL) void Init_cairo_gobject(void) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = rb_define_module("CairoGObject"); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(CAIRO_VERSION_MAJOR), INT2FIX(CAIRO_VERSION_MINOR), INT2FIX(CAIRO_VERSION_MICRO))); define_context_conversion(); define_device_conversion(); define_pattern_conversion(); define_surface_conversion(); define_scaled_font_conversion(); define_font_face_conversion(); define_font_options_conversion(); define_region_conversion(); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_STATUS, "Status", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_CONTENT, "Content", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_OPERATOR, "Operator", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_ANTIALIAS, "Antialias", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FILL_RULE, "FillRule", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_LINE_CAP, "LineCap", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_LINE_JOIN, "LineJoin", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_TEXT_CLUSTER_FLAGS, "TextClusterFlags", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FONT_SLANT, "FontSlant", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FONT_WEIGHT, "FontWeight", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_SUBPIXEL_ORDER, "SubpixelOrder", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_HINT_STYLE, "HintStyle", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_HINT_METRICS, "HintMetrics", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FONT_TYPE, "FontType", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_PATH_DATA_TYPE, "PathDataType", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_DEVICE_TYPE, "DeviceType", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_SURFACE_TYPE, "SurfaceType", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FORMAT, "Format", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_PATTERN_TYPE, "PatternType", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_EXTEND, "Extend", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FILTER, "Filter", RG_TARGET_NAMESPACE); G_DEF_CLASS(CAIRO_GOBJECT_TYPE_REGION_OVERLAP, "RegionOverlap", RG_TARGET_NAMESPACE); } ������������ruby-gnome2-all-2.1.0/cairo-gobject/ext/cairo-gobject/extconf.rb������������������������������������0000755�0001750�0001750�00000005632�12257552167�022644� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "pathname" source_dir = Pathname(__FILE__).dirname base_dir = source_dir.parent.parent.expand_path top_dir = base_dir.parent.expand_path top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + "lib" version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + "lib" end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "cairo_gobject" package_id = "cairo-gobject" begin require "mkmf-gnome2" rescue LoadError require "rubygems" gem "glib2" require "mkmf-gnome2" end ["glib2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end rcairo_options = {} rcairo_source_dir_names = ["rcairo"] if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM rcairo_source_dir_names.unshift("rcairo.win32") end rcairo_source_dir_names.each do |rcairo_source_dir_name| rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name if rcairo_source_dir.exist? rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s break end end unless check_cairo(rcairo_options) exit(false) end setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id, :debian => "libcairo-gobject2", :fedora => "cairo-gobject-devel") exit(false) end create_pkg_config_file("Ruby/CairoGObject", package_id, ruby_gnome2_version, "ruby-cairo-gobject.pc") ensure_objs $defs << "-DRUBY_CAIRO_GOBJECT_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/COPYING.LIB�����������������������������������������������������0000644�0001750�0001750�00000063642�12077252561�016776� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/lib/������������������������������������������������������������0000755�0001750�0001750�00000000000�12077252561�016071� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/lib/cairo-gobject.rb��������������������������������������������0000644�0001750�0001750�00000002035�12077252561�021126� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "cairo" require "glib2" begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/cairo_gobject.so" rescue LoadError require "cairo_gobject.so" end module CairoGObject LOG_DOMAIN = "CairoGObject" GLib::Log.set_log_domain(LOG_DOMAIN) end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/README.md�������������������������������������������������������0000644�0001750�0001750�00000001061�12077252561�016600� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Ruby/CairoGObject Ruby/CairoGObject is a Ruby binding of cairo-gobject. ## Requirements * Ruby/GLib2 in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [rcairo](https://github.com/rcairo/rcairo) * [cairo](http://cairographics.org/) GObject binding ## Install gem install cairo-gobject ## License Copyright (c) 2012-2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ## Project Website http://ruby-gnome2.sourceforge.jp/ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/extconf.rb������������������������������������������������������0000755�0001750�0001750�00000004027�12077252561�017324� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "pathname" require "mkmf" require "rbconfig" require "fileutils" module_name = "cairo_gobject" package = "cairo-gobject" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' if RbConfig.respond_to?(:ruby) ruby = RbConfig.ruby else ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) end build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" unless system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) exit(false) end create_makefile(module_name) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/Rakefile��������������������������������������������������������0000644�0001750�0001750�00000002520�12077252561�016767� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- # # Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $LOAD_PATH.unshift("./../glib2/lib") require "gnome2-raketask" package = GNOME2Package.new do |_package| _package.summary = "Ruby/CairoGObject is a Ruby binding of cairo-gobject." _package.description = "Ruby/CairoGObject is a Ruby binding of cairo-gobject." _package.dependency.gem.runtime = ["cairo", "glib2"] _package.dependency.gem.development = ["test-unit-notify"] _package.win32.packages = [] _package.win32.dependencies = [] _package.win32.build_dependencies = ["cairo", "glib2"] _package.win32.build_packages = [] end package.define_tasks ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/�����������������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�016307� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairoantialias.rb�������������������������������������0000644�0001750�0001750�00000001710�12257552167�022655� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCaitoAntialias < Test::Unit::TestCase def test_cairo_antialias assert_nothing_raised do CairoGObject::Antialias.new(CairoGObject::Antialias::DEFAULT) end end end ��������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairohintmetrics.rb�����������������������������������0000644�0001750�0001750�00000001705�12257552167�023245� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoHintMetrics < Test::Unit::TestCase def test_cairo_hint_metrics assert_nothing_raised do CairoGObject::HintMetrics.new(Cairo::HintMetrics::ON) end end end �����������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairopatterntype.rb�����������������������������������0000644�0001750�0001750�00000001720�12257552167�023270� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoPatternType < Test::Unit::TestCase def test_caito_pattern_type assert_nothing_raised do CairoGObject::PatternType.new(CairoGObject::PatternType::LINEAR) end end end ������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairolinecap.rb���������������������������������������0000644�0001750�0001750�00000001662�12257552167�022331� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestLineCap < Test::Unit::TestCase def test_cairo_linecap assert_nothing_raised do CairoGObject::LineCap.new(Cairo::LineCap::ROUND) end end end ������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairostatus.rb����������������������������������������0000644�0001750�0001750�00000001674�12257552167�022244� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoStatus < Test::Unit::TestCase def test_cairo_status assert_nothing_raised do CairoGObject::Status.new(CairoGObject::Status::SUCCESS) end end end ��������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/cairo-gobject-test-utils.rb��������������������������������0000644�0001750�0001750�00000001533�12077252561�023454� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "test-unit" require "test/unit/notify" module CairoGObjectTestUtils end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairoimagesurface.rb����������������������������������0000644�0001750�0001750�00000001712�12257552167�023345� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoImageSurface < Test::Unit::TestCase def test_cairo_image_surface assert_nothing_raised do Cairo::ImageSurface.new(Cairo::Format::ARGB32, 290, 200) end end end ������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairofontslant.rb�������������������������������������0000644�0001750�0001750�00000001701�12257552167�022720� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoFontSlant < Test::Unit::TestCase def test_cairo_font_slant assert_nothing_raised do CairoGObject::FontSlant.new(Cairo::FontSlant::NORMAL) end end end ���������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairofilter.rb����������������������������������������0000644�0001750�0001750�00000001666�12257552167�022207� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoFilter < Test::Unit::TestCase def test_cairo_filter assert_nothing_raised do CairoGObject::Filter.new(Cairo::Filter::GAUSSIAN) end end end ��������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairolinejoin.rb��������������������������������������0000644�0001750�0001750�00000001673�12257552167�022527� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoLineJoin < Test::Unit::TestCase def test_cairo_linejoin assert_nothing_raised do CairoGObject::LineJoin.new(Cairo::LineJoin::ROUND) end end end ���������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairotextclusterflags.rb������������������������������0000644�0001750�0001750�00000001747�12257552167�024325� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoTextClusterFlags < Test::Unit::TestCase def test_cairo_text_clutter_flags assert_nothing_raised do CairoGObject::TextClusterFlags.new(CairoGObject::TextClusterFlags::BACKWARD) end end end �������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairosubpixelorder.rb���������������������������������0000644�0001750�0001750�00000001722�12257552167�023602� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoSubpixelOrder < Test::Unit::TestCase def test_cairo_subpixel_order assert_nothing_raised do CairoGObject::SubpixelOrder.new(Cairo::SubpixelOrder::DEFAULT) end end end ����������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairohintstyle.rb�������������������������������������0000644�0001750�0001750�00000001700�12257552167�022732� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoHintStyle < Test::Unit::TestCase def test_cairo_hintstyle assert_nothing_raised do CairoGObject::HintStyle.new(Cairo::HintStyle::MEDIUM) end end end ����������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairofillrule.rb��������������������������������������0000644�0001750�0001750�00000001705�12257552167�022532� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoFullRule < Test::Unit::TestCase def test_cairo_fill_rule assert_nothing_raised do CairoGObject::FillRule.new(CairoGObject::FillRule::WINDING) end end end �����������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairofonttype.rb��������������������������������������0000644�0001750�0001750�00000001700�12257552167�022557� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoFontType < Test::Unit::TestCase def test_caito_font_type assert_nothing_raised do CairoGObject::FontType.new(CairoGObject::FontType::FT) end end end ����������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairoextend.rb����������������������������������������0000644�0001750�0001750�00000001673�12257552167�022207� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoExtend < Test::Unit::TestCase def test_cairo_extend assert_nothing_raised do CairoGObject::Extend.new(CairoGObject::Extend::REPEAT) end end end ���������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairoregionoverlap.rb���������������������������������0000644�0001750�0001750�00000001716�12257552167�023572� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoRegionOverlap < Test::Unit::TestCase def test_cairo_regin_overlap assert_nothing_raised do CairoGObject::RegionOverlap.new(Cairo::RegionOverlap::PART) end end end ��������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/run-test.rb������������������������������������������������0000755�0001750�0001750�00000003466�12077252561�020424� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection") cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject") modules = [ [glib_base, "glib2"], [gobject_introspection_base, "gobject-introspection"], [cairo_gobject_base, "cairo-gobject"], ] modules.each do |target, module_name| if system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require "glib-test-init" $LOAD_PATH.unshift(File.join(gobject_introspection_base, "test")) require "gobject-introspection-test-utils" $LOAD_PATH.unshift(File.join(cairo_gobject_base, "test")) require "cairo-gobject-test-utils" require "cairo-gobject" exit Test::Unit::AutoRunner.run(true) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairofontweight.rb������������������������������������0000644�0001750�0001750�00000001703�12257552167�023070� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCaitoFontWeight < Test::Unit::TestCase def test_cairo_font_weight assert_nothing_raised do CairoGObject::FontWeight.new(Cairo::FontWeight::BOLD) end end end �������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairoregion.rb����������������������������������������0000644�0001750�0001750�00000001626�12257552167�022201� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoRegion < Test::Unit::TestCase def test_cairo_region assert_nothing_raised do Cairo::Region.new end end end ����������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairodevicetype.rb������������������������������������0000644�0001750�0001750�00000001710�12257552167�023051� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoDeviceType < Test::Unit::TestCase def test_cairo_device_type assert_nothing_raised do CairoGObject::DeviceType.new(CairoGObject::DeviceType::GL) end end end ��������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairocontent.rb���������������������������������������0000644�0001750�0001750�00000001676�12257552167�022375� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoContent < Test::Unit::TestCase def test_cairo_content assert_nothing_raised do CairoGObject::Content.new(CairoGObject::Content::COLOR) end end end ������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairopathdatatype.rb����������������������������������0000644�0001750�0001750�00000001717�12257552167�023407� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoPathDataType < Test::Unit::TestCase def test_cairo_path_data_type assert_nothing_raised do CairoGObject::PathDataType.new(Cairo::PathDataType::LINE_TO) end end end �������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairooperator.rb��������������������������������������0000644�0001750�0001750�00000001672�12257552167�022552� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoOperator < Test::Unit::TestCase def test_cairo_operator assert_nothing_raised do CairoGObject::Operator.new(Cairo::Operator::OVER) end end end ����������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairoformat.rb����������������������������������������0000644�0001750�0001750�00000001663�12257552167�022207� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoFormat < Test::Unit::TestCase def test_cairo_format assert_nothing_raised do CairoGObject::Format.new(Cairo::Format::RGB24) end end end �����������������������������������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairocontext.rb���������������������������������������0000644�0001750�0001750�00000001753�12257552167�022403� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoContext < Test::Unit::TestCase def test_cairo_context assert_nothing_raised do surface = Cairo::ImageSurface.new(Cairo::Format::ARGB32, 290, 200) Cairo::Context.new(surface) end end end ���������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairosurfacetype.rb�����������������������������������0000644�0001750�0001750�00000001717�12257552167�023251� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoSurfaceType < Test::Unit::TestCase def test_cairo_surface_type assert_nothing_raised do CairoGObject::SurfaceType.new(CairoGObject::SurfaceType::IMAGE) end end end �������������������������������������������������ruby-gnome2-all-2.1.0/cairo-gobject/test/test_cairoscaledfont.rb������������������������������������0000644�0001750�0001750�00000002371�12257552167�023036� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCairoScaledFont < Test::Unit::TestCase def setup surface = Cairo::ImageSurface.new(Cairo::Format::ARGB32, 290, 200) context = Cairo::Context.new(surface) @font_face = context.font_face @font_matrix = Cairo::Matrix.identity @scale = Cairo::Matrix.scale(0.5, 1.0) @font_option = Cairo::FontOptions.new end def test_cairo_scaled_font assert_nothing_raised do Cairo::ScaledFont.new(@font_face, @font_matrix, @scale, @font_option) end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/���������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665517�015607� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/�����������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�016361� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/��������������������������������������������0000755�0001750�0001750�00000000000�12257552170�021360� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/gtksourceview2.def��������������������������0000644�0001750�0001750�00000000035�11701304107�025005� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXPORTS Init_gtksourceview2 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourceprintcompositor.c����������������0000644�0001750�0001750�00000013333�11701304107�027241� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" #ifdef HAVE_GTK_SOURCE_PRINT_COMPOSITOR_GET_TYPE /* Module: Gtk::SourcePrintCompositor */ #define RG_TARGET_NAMESPACE cSourcePrintCompositor #define _SELF(self) (GTK_SOURCE_PRINT_COMPOSITOR(RVAL2GOBJ(self))) #define RVAL2UNIT(o) (RVAL2GENUM(o, GTK_TYPE_UNIT)) /* * Class method: new(buffer) * buffer: a Gtk::SourceBuffer or Gtk::SourceView object. * * Creates a new print compositor to print buffer. * * Returns: the new print compositor object. */ static VALUE rg_initialize(VALUE self, VALUE val) { if (rb_obj_is_kind_of (val, GTYPE2CLASS (GTK_TYPE_SOURCE_BUFFER))) { G_INITIALIZE(self, gtk_source_print_compositor_new (GTK_SOURCE_BUFFER (RVAL2GOBJ (val)))); } else if (rb_obj_is_kind_of (val, GTYPE2CLASS (GTK_TYPE_SOURCE_VIEW))) { G_INITIALIZE(self, gtk_source_print_compositor_new_from_view (GTK_SOURCE_VIEW (RVAL2GOBJ (val)))); } else { rb_raise (rb_eArgError, "invalid argument %s (expect Gtk::SourceBuffer or Gtk::SourceView)", rb_class2name (CLASS_OF (val))); } return Qnil; } static VALUE rg_get_top_margin(VALUE self, VALUE unit) { return DBL2NUM(gtk_source_print_compositor_get_top_margin(_SELF(self), RVAL2UNIT (unit))); } static VALUE rg_set_top_margin(VALUE self, VALUE top, VALUE unit) { gtk_source_print_compositor_set_top_margin(_SELF(self), NUM2DBL(top), RVAL2UNIT (unit)); return self; } static VALUE rg_get_bottom_margin(VALUE self, VALUE unit) { return DBL2NUM(gtk_source_print_compositor_get_bottom_margin(_SELF(self), RVAL2UNIT (unit))); } static VALUE rg_set_bottom_margin(VALUE self, VALUE bottom, VALUE unit) { gtk_source_print_compositor_set_bottom_margin(_SELF(self), NUM2DBL(bottom), RVAL2UNIT (unit)); return self; } static VALUE rg_get_left_margin(VALUE self, VALUE unit) { return DBL2NUM(gtk_source_print_compositor_get_left_margin(_SELF(self), RVAL2UNIT (unit))); } static VALUE rg_set_left_margin(VALUE self, VALUE left, VALUE unit) { gtk_source_print_compositor_set_left_margin(_SELF(self), NUM2DBL(left), RVAL2UNIT (unit)); return self; } static VALUE rg_get_right_margin(VALUE self, VALUE unit) { return DBL2NUM(gtk_source_print_compositor_get_right_margin(_SELF(self), RVAL2UNIT (unit))); } static VALUE rg_set_right_margin(VALUE self, VALUE right, VALUE unit) { gtk_source_print_compositor_set_right_margin(_SELF(self), NUM2DBL(right), RVAL2UNIT (unit)); return self; } static VALUE rg_set_header_format(VALUE self, VALUE separator, VALUE left, VALUE center, VALUE right) { gtk_source_print_compositor_set_header_format(_SELF(self), RVAL2CBOOL(separator), RVAL2CSTR(left), RVAL2CSTR(center), RVAL2CSTR(right)); return self; } static VALUE rg_set_footer_format(VALUE self, VALUE separator, VALUE left, VALUE center, VALUE right) { gtk_source_print_compositor_set_footer_format(_SELF(self), RVAL2CBOOL(separator), RVAL2CSTR(left), RVAL2CSTR(center), RVAL2CSTR(right)); return self; } static VALUE rg_paginate(VALUE self, VALUE context) { return CBOOL2RVAL (gtk_source_print_compositor_paginate (_SELF (self), GTK_PRINT_CONTEXT (RVAL2GOBJ (context)))); } static VALUE rg_pagination_progress(VALUE self) { return DBL2NUM (gtk_source_print_compositor_get_pagination_progress (_SELF (self))); } static VALUE rg_draw_page(VALUE self, VALUE context, VALUE page_nr) { gtk_source_print_compositor_draw_page (_SELF (self), GTK_PRINT_CONTEXT (RVAL2GOBJ (context)), NUM2INT (page_nr)); return self; } #endif /* HAVE_GTK_SOURCE_PRINT_COMPOSITOR_GET_TYPE */ void Init_gtk_sourceprintcompositor(VALUE mGtk) { #ifdef HAVE_GTK_SOURCE_PRINT_COMPOSITOR_GET_TYPE VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(GTK_TYPE_SOURCE_PRINT_COMPOSITOR, "SourcePrintCompositor", mGtk); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(get_top_margin, 1); RG_DEF_METHOD(set_top_margin, 2); RG_DEF_METHOD(get_bottom_margin, 1); RG_DEF_METHOD(set_bottom_margin, 2); RG_DEF_METHOD(get_left_margin, 1); RG_DEF_METHOD(set_left_margin, 2); RG_DEF_METHOD(get_right_margin, 1); RG_DEF_METHOD(set_right_margin, 2); RG_DEF_METHOD(set_header_format, 4); RG_DEF_METHOD(set_footer_format, 4); RG_DEF_METHOD(paginate, 1); RG_DEF_METHOD(pagination_progress, 0); RG_DEF_METHOD(draw_page, 2); G_DEF_SETTERS(RG_TARGET_NAMESPACE); #endif /* HAVE_GTK_SOURCE_PRINT_COMPOSITOR_GET_TYPE */ } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourcestyle.c��������������������������0000644�0001750�0001750�00000002464�11701304107�025131� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" /* Module: Gtk::SourceStyle */ #define RG_TARGET_NAMESPACE cSourceStyle #define _SELF(self) (GTK_SOURCE_STYLE(RVAL2GOBJ(self))) static VALUE rg_copy(VALUE self) { return GOBJ2RVAL (gtk_source_style_copy (_SELF (self))); } void Init_gtk_sourcestyle (VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_TYPE_SOURCE_STYLE, "SourceStyle", mGtk); RG_DEF_METHOD(copy, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourcemain.c���������������������������0000644�0001750�0001750�00000002637�12257552170�024733� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" void Init_gtksourceview2 (void) { Init_gtk_sourceview (mGtk); Init_gtk_sourcebuffer (mGtk); Init_gtk_sourceiter (mGtk); Init_gtk_sourcelanguage (mGtk); Init_gtk_sourcelanguagemanager (mGtk); Init_gtk_sourcemark (mGtk); Init_gtk_sourceprintcompositor (mGtk); Init_gtk_sourcestyle (mGtk); Init_gtk_sourcestylescheme (mGtk); Init_gtk_sourcestyleschememanager (mGtk); } �������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourcemark.c���������������������������0000644�0001750�0001750�00000005231�11701304107�024716� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" #ifdef HAVE_GTK_SOURCE_MARK_GET_TYPE /* Class: Gtk::SourceMark * A source mark. */ #define RG_TARGET_NAMESPACE cSourceMark #define _SELF(self) (GTK_SOURCE_MARK(RVAL2GOBJ(self))) /* Class method: new(name, category) * name: mark name (string) * category: marker category (string) * * Returns: a newly created Gtk::SourceMark object. */ static VALUE rg_initialize(VALUE self, VALUE name, VALUE category) { G_INITIALIZE (self, gtk_source_mark_new (RVAL2CSTR(name), RVAL2CSTR(category))); return Qnil; } /* Method: next(category=nil) * category: the category (string), or nil. * * Returns: the next Gtk::SourceMark after the mark. */ static VALUE rg_next(int argc, VALUE *argv, VALUE self) { VALUE category; rb_scan_args (argc, argv, "01", &category); return GOBJ2RVAL (gtk_source_mark_next (_SELF (self), NIL_P (category) ? NULL : RVAL2CSTR(category))); } /* Method: prev(category=nil) * category: the category (string), or nil. * * Returns: the previous Gtk::SourceMark before the mark. */ static VALUE rg_prev(int argc, VALUE *argv, VALUE self) { VALUE category; rb_scan_args (argc, argv, "01", &category); return GOBJ2RVAL (gtk_source_mark_prev (_SELF (self), NIL_P (category) ? NULL : RVAL2CSTR(category))); } #endif /* HAVE_GTK_SOURCE_MARK_GET_TYPE */ void Init_gtk_sourcemark (VALUE mGtk) { #ifdef HAVE_GTK_SOURCE_MARK_GET_TYPE VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_TYPE_SOURCE_MARK, "SourceMark", mGtk); RG_DEF_METHOD(initialize, 2); RG_DEF_METHOD(next, -1); RG_DEF_METHOD(prev, -1); G_DEF_SETTERS (RG_TARGET_NAMESPACE); #endif /* HAVE_GTK_SOURCE_MARK_GET_TYPE */ } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourcemain.h���������������������������0000644�0001750�0001750�00000005032�12257552170�024730� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBGTKSOURCEVIEWMAIN_H_ #define __RBGTKSOURCEVIEWMAIN_H_ #include <gtksourceview/gtksourcebuffer.h> #include <gtksourceview/gtksourceiter.h> #include <gtksourceview/gtksourcelanguage.h> #include <gtksourceview/gtksourcelanguagemanager.h> #include <gtksourceview/gtksourcemark.h> #include <gtksourceview/gtksourceprintcompositor.h> #include <gtksourceview/gtksourcestyle.h> #include <gtksourceview/gtksourcestylescheme.h> #include <gtksourceview/gtksourcestyleschememanager.h> #include <gtksourceview/gtksourceview.h> #include <gtksourceview/gtksourceview-typebuiltins.h> #include "ruby.h" #include "rbgtk.h" #include "rbgtksourceview2version.h" #undef RG_DEF_METHOD #define RG_DEF_METHOD(method, argc) \ rb_define_method(RG_TARGET_NAMESPACE, #method, rg_ ## method, argc) #undef RG_DEF_SMETHOD #define RG_DEF_SMETHOD(method, argc) \ rb_define_singleton_method(RG_TARGET_NAMESPACE, #method, rg_s_ ## method, argc) extern void Init_gtksourceview2 (void); G_GNUC_INTERNAL void Init_gtk_sourceview (VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_sourcebuffer (VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_sourceiter (VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_sourcelanguage (VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_sourcelanguagemanager (VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_sourcemark (VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_sourceprintcompositor (VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_sourcestyle (VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_sourcestylescheme (VALUE mGtk); G_GNUC_INTERNAL void Init_gtk_sourcestyleschememanager (VALUE mGtk); #endif /* __RBGTKSOURCEVIEWMAIN_H_ */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourceview.c���������������������������0000644�0001750�0001750�00000014277�11701304107�024750� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" /* Class: Gtk::SourceView * A view on a source. */ #define RG_TARGET_NAMESPACE cSourceView #define _SELF(self) (GTK_SOURCE_VIEW(RVAL2GOBJ(self))) /* * Class method: new(buffer=nil) * buffer: a Gtk::SourceBuffer object. * * Creates a new Gtk::SourceView. If buffer is not provided or nil, an empty * buffer will be created for you. Note that one buffer can be shared among * many widgets. * * Returns: a newly created Gtk::SourceView object. */ static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE buffer; GtkWidget *widget; rb_scan_args(argc, argv, "01", &buffer); if (NIL_P(buffer)) widget = gtk_source_view_new(); else widget = gtk_source_view_new_with_buffer(RVAL2GOBJ(buffer)); RBGTK_INITIALIZE(self, widget); return self; } #ifdef HAVE_GTK_SOURCE_MARK_GET_TYPE /* * Method: set_mark_category_pixbuf(category, pixbuf) * category: a category (as a string). * pixbuf: a Gdk::Pixbuf object. * * Associates a given pixbuf with a given category. * * Returns: self. */ static VALUE rg_set_mark_category_pixbuf(VALUE self, VALUE category, VALUE pixbuf) { gtk_source_view_set_mark_category_pixbuf(_SELF(self), RVAL2CSTR(category), GDK_PIXBUF(RVAL2GOBJ(pixbuf))); return self; } /* * Method: get_mark_category_pixbuf(category) * category: a category (as a string). * * Gets the pixbuf which is associated with the given category. * * Returns: a Gdk::Pixbuf object if found, or nil if not found. */ static VALUE rg_get_mark_category_pixbuf(VALUE self, VALUE category) { GdkPixbuf *pixbuf; pixbuf = gtk_source_view_get_mark_category_pixbuf(_SELF(self), RVAL2CSTR(category)); return GOBJ2RVAL(pixbuf); } /* * Method: set_mark_category_priority(category, priority) * category: a category (as a string). * priority: a priority (int). * * Associates a given priority with a given category. * * Returns: self. */ static VALUE rg_set_mark_category_priority(VALUE self, VALUE category, VALUE priority) { gtk_source_view_set_mark_category_priority(_SELF (self), RVAL2CSTR(category), NUM2INT(priority)); return self; } /* * Method: get_mark_category_priority(category) * category: a category (as a string). * * Gets the priority which is associated with the given category. * * Returns: the priority if found, or 0 if not found. */ static VALUE rg_get_mark_category_priority(VALUE self, VALUE category) { gint priority; priority = gtk_source_view_get_mark_category_priority(_SELF(self), RVAL2CSTR(category)); return INT2NUM(priority); } #endif /* HAVE_GTK_SOURCE_MARK_GET_TYPE */ #ifdef HAVE_GTK_SOURCE_VIEW_GET_MARK_CATEGORY_BACKGROUND /* * Method: get_mark_category_background(category) * category: a category (as a string). * * Gets the background color which is associated with the given category. * * Returns: a Gdk::Color object if found, or nil if not found. */ static VALUE rg_get_mark_category_background(VALUE self, VALUE category) { GdkColor color; gtk_source_view_get_mark_category_background(_SELF (self), RVAL2CSTR(category), &color); return GDKCOLOR2RVAL(&color); } /* * Method: set_mark_category_background(category, color) * category: a category (as a string). * color: a Gdk::Color. * * Sets given background color for mark category. If color is NULL, * the background color is unset. * * Returns: self. */ static VALUE rg_set_mark_category_background(VALUE self, VALUE category, VALUE color) { gtk_source_view_set_mark_category_background(_SELF (self), RVAL2CSTR (category), RVAL2GDKCOLOR((color))); return self; } # endif /* HAVE_GTK_SOURCE_VIEW_GET_MARK_CATEGORY_BACKGROUND */ void Init_gtk_sourceview (VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_TYPE_SOURCE_VIEW, "SourceView", mGtk); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(GTKSOURCEVIEW2_MAJOR_VERSION), INT2FIX(GTKSOURCEVIEW2_MINOR_VERSION), INT2FIX(GTKSOURCEVIEW2_MICRO_VERSION))); RG_DEF_METHOD(initialize, -1); #ifdef HAVE_GTK_SOURCE_MARK_GET_TYPE RG_DEF_METHOD(get_mark_category_pixbuf, 1); RG_DEF_METHOD(set_mark_category_pixbuf, 2); RG_DEF_METHOD(get_mark_category_priority, 1); RG_DEF_METHOD(set_mark_category_priority, 2); #endif #ifdef HAVE_GTK_SOURCE_VIEW_GET_MARK_CATEGORY_BACKGROUND RG_DEF_METHOD(get_mark_category_background, 1); RG_DEF_METHOD(set_mark_category_background, 2); #endif G_DEF_SETTERS (RG_TARGET_NAMESPACE); G_DEF_CLASS(GTK_TYPE_SOURCE_SMART_HOME_END_TYPE, "SmartHomeEndType", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_SOURCE_SMART_HOME_END_TYPE, "GTK_SOURCE_"); #ifdef HAVE_GTK_SOURCE_VIEW_GET_MARK_CATEGORY_BACKGROUND G_DEF_CLASS(GTK_TYPE_SOURCE_DRAW_SPACES_FLAGS, "DrawSpacesFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_SOURCE_DRAW_SPACES_FLAGS, "GTK_SOURCE_"); #endif } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/extconf.rb����������������������������������0000644�0001750�0001750�00000005206�12257552170�023356� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin extconf.rb for Ruby/GtkSourceView2 extension library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "gtksourceview2" package_id = "gtksourceview-2.0" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end ["glib2", "atk", "pango", "gdk_pixbuf2", "gtk2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end rcairo_options = {} rcairo_source_dir_names = ["rcairo"] if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM rcairo_source_dir_names.unshift("rcairo.win32") end rcairo_source_dir_names.each do |rcairo_source_dir_name| rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name if rcairo_source_dir.exist? rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s break end end unless check_cairo(rcairo_options) exit(false) end setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id, :debian => "libgtksourceview2.0-dev", :redhat => "gtksourceview2-devel", :homebrew => "gtksourceview", :macports => "gtksourceview2") exit(false) end # 2.2 have_func('gtk_source_mark_get_type', "gtksourceview/gtksourcemark.h") have_func('gtk_source_print_compositor_get_type', "gtksourceview/gtksourceprintcompositor.h") # 2.4 have_func('gtk_source_view_get_mark_category_background', "gtksourceview/gtksourceview.h") have_func('gtk_source_language_manager_guess_language', "gtksourceview/gtksourcelanguagemanager.h") make_version_header("GTKSOURCEVIEW2", package_id, ".") create_pkg_config_file("Ruby/GtkSourceView2", package_id) $defs << "-DRUBY_GTKSOURCEVIEW2_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourcelanguage.c�����������������������0000644�0001750�0001750�00000006344�11701304107�025555� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" /* Class: Gtk::SourceLanguage * Source language. */ #define RG_TARGET_NAMESPACE cSourceLanguage #define _SELF(self) (GTK_SOURCE_LANGUAGE(RVAL2GOBJ(self))) /* Method: get_metadata(name) * name: the metadata property name (string) * Returns: the localized metadata for the given name. */ static VALUE rg_get_metadata(VALUE self, VALUE name) { return CSTR2RVAL (gtk_source_language_get_metadata (_SELF (self), RVAL2CSTR(name))); } /* Method: mime_types * Returns: a list of mime types for the given language, as an array of strings. */ static VALUE rg_mime_types(VALUE self) { VALUE ary; char **types = gtk_source_language_get_mime_types (_SELF (self)); if (!types) return Qnil; ary = rb_ary_new(); while (*types){ rb_ary_push(ary, CSTR2RVAL(*types)); types++; } return ary; } /* Method: globs * Returns: a list of globs for the given language, as an array of strings. */ static VALUE rg_globs(VALUE self) { VALUE ary; char **globs = gtk_source_language_get_globs (_SELF (self)); if (!globs) return Qnil; ary = rb_ary_new(); while (*globs){ rb_ary_push(ary, CSTR2RVAL(*globs)); globs++; } return ary; } /* Method: get_style_name(style_id) * style_id: the style id (string) * Returns: the localized style name of the given id. */ static VALUE rg_get_style_name(VALUE self, VALUE style_id) { return CSTR2RVAL (gtk_source_language_get_style_name (_SELF (self), RVAL2CSTR(style_id))); } /* Method: style_id * Returns: the styles defined by the language. */ static VALUE rg_style_ids(VALUE self) { VALUE ary; gchar **ids = gtk_source_language_get_style_ids (_SELF (self)); if (!ids) return Qnil; ary = rb_ary_new(); while (*ids){ rb_ary_push(ary, CSTR2RVAL(*ids)); ids++; } return ary; } void Init_gtk_sourcelanguage (VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_TYPE_SOURCE_LANGUAGE, "SourceLanguage", mGtk); RG_DEF_METHOD(get_metadata, 1); RG_DEF_METHOD(mime_types, 0); RG_DEF_METHOD(globs, 0); RG_DEF_METHOD(get_style_name, 1); RG_DEF_METHOD(style_ids, 0); G_DEF_SETTERS (RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourcestylescheme.c��������������������0000644�0001750�0001750�00000004076�11701304107�026317� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2005 Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" /* Module: Gtk::SourceStyleScheme */ #define RG_TARGET_NAMESPACE cSourceStyleScheme #define _SELF(self) (GTK_SOURCE_STYLE_SCHEME(RVAL2GOBJ(self))) /* Method: authors * * Returns: a list of authors for the given style scheme. */ static VALUE rg_authors(VALUE self) { VALUE ary; const gchar * const * authors = gtk_source_style_scheme_get_authors (_SELF (self)); if (!authors) return Qnil; ary = rb_ary_new(); while (*authors){ rb_ary_push(ary, CSTR2RVAL(*authors)); authors++; } return ary; } /* Method: get_style(style_id) * style_name: the name of a style. * * Gets the tag associated with the given style_name in the style scheme. * * Returns: Gtk::SourceStyle */ static VALUE rg_get_style(VALUE self, VALUE style_name) { return GOBJ2RVAL(gtk_source_style_scheme_get_style(_SELF(self), RVAL2CSTR(style_name))); } void Init_gtk_sourcestylescheme (VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_TYPE_SOURCE_STYLE_SCHEME, "SourceStyleScheme", mGtk); RG_DEF_METHOD(authors, 0); RG_DEF_METHOD(get_style, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourcelanguagemanager.c����������������0000644�0001750�0001750�00000012466�11701304107�027112� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" /* Class: Gtk::SourceLanguageManager * A class to manage source language. */ #define RG_TARGET_NAMESPACE cSourceLanguageManager #define _SELF(self) (GTK_SOURCE_LANGUAGE_MANAGER(RVAL2GOBJ(self))) /* Class method: new * Returns: a newly created Gtk::SourceLanguageManager object. */ static VALUE rg_initialize(VALUE self) { G_INITIALIZE (self, gtk_source_language_manager_new ()); return Qnil; } /* Class method: default * * Gets the default language manager. * * Returns: a Gtk::SourceLanguageManager */ static VALUE rg_s_default(VALUE self) { GtkSourceLanguageManager* slm = gtk_source_language_manager_get_default(); GType gtype = G_TYPE_FROM_INSTANCE(slm); gchar *gtypename = (gchar *) g_type_name (gtype); if (strncmp (gtypename, "Gtk", 3) == 0) gtypename += 3; if (!rb_const_defined_at (mGtk, rb_intern (gtypename))) G_DEF_CLASS (gtype, gtypename, mGtk); return GOBJ2RVAL(slm); } /* Method: set_search_path(dirs) * dirs: language file directory path * * Sets the language files directories for the given language manager. * * Returns: self. */ static VALUE rg_set_search_path(VALUE self, VALUE dirs) { gchar** gdirs = (gchar**)NULL; gint i; if (! NIL_P(dirs)){ Check_Type(dirs, T_ARRAY); i = RARRAY_LEN(dirs); gdirs = ALLOCA_N(gchar*, i + 1); for (i = 0; i < i; i++) { if (TYPE(RARRAY_PTR(dirs)[i]) == T_STRING) { gdirs[i] = RVAL2CSTR(RARRAY_PTR(dirs)[i]); } else { gdirs[i] = ""; } } gdirs[i] = (gchar*)NULL; } gtk_source_language_manager_set_search_path (_SELF (self), gdirs); return self; } /* Method: search_path * Returns: a list of language files directories (strings) for the given * language manager. */ static VALUE rg_search_path(VALUE self) { VALUE ary; const gchar * const * dirs = gtk_source_language_manager_get_search_path (_SELF (self)); if (!dirs) return Qnil; ary = rb_ary_new(); while (*dirs){ rb_ary_push(ary, CSTR2RVAL(*dirs)); dirs++; } return ary; } /* Method: language_ids * Returns: a list of languages ids for the given language manager */ static VALUE rg_language_ids(VALUE self) { VALUE ary; const gchar * const * ids = gtk_source_language_manager_get_language_ids (_SELF (self)); if (!ids) return Qnil; ary = rb_ary_new(); while (*ids){ rb_ary_push(ary, CSTR2RVAL(*ids)); ids++; } return ary; } /* * Method: get_language(id) * id: a language id (as a string). * * Gets the Gtk::SourceLanguage which is associated with the given id * in the language manager. * * Returns: a Gtk::SourceLanguage, or nil if there is no language associated * with the given id. */ static VALUE rg_get_language(VALUE self, VALUE id) { return GOBJ2RVAL (gtk_source_language_manager_get_language (_SELF (self), RVAL2CSTR (id))); } #ifdef HAVE_GTK_SOURCE_LANGUAGE_MANAGER_GUESS_LANGUAGE /* * Method: guess_language(filename, content_type) * filename: a file name (as a string), or nil. * content_type: content type (as a string), or nil. * * Guesses the Gtk::SourceLanguage for the given file name and content type. * * Returns: a Gtk::SourceLanguage, or nil if there is no language associated * with the given filename or content_type. */ static VALUE rg_guess_language(VALUE self, VALUE filename, VALUE content_type) { return GOBJ2RVAL (gtk_source_language_manager_guess_language (_SELF (self), NIL_P(filename) ? NULL : RVAL2CSTR (filename), NIL_P(content_type) ? NULL : RVAL2CSTR (content_type))); } #endif /* HAVE_GTK_SOURCE_LANGUAGE_MANAGER_GUESS_LANGUAGE */ void Init_gtk_sourcelanguagemanager (VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_TYPE_SOURCE_LANGUAGE_MANAGER, "SourceLanguageManager", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_search_path, 1); RG_DEF_METHOD(search_path, 0); RG_DEF_METHOD(language_ids, 0); RG_DEF_METHOD(get_language, 1); #ifdef HAVE_GTK_SOURCE_LANGUAGE_MANAGER_GUESS_LANGUAGE RG_DEF_METHOD(guess_language, 2); #endif RG_DEF_SMETHOD(default, 0); G_DEF_SETTERS (RG_TARGET_NAMESPACE); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourceiter.c���������������������������0000644�0001750�0001750�00000010271�11701304107�024727� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" #define RG_TARGET_NAMESPACE cTextIter #define _SELF(s) ((GtkTextIter*)RVAL2BOXED(s, GTK_TYPE_TEXT_ITER)) #define ITR2RVAL(i) (BOXED2RVAL(i, GTK_TYPE_TEXT_ITER)) /* Method: forward_search(str, flags, limit) * str: the search string (string) * flags: flags affecting the search (Gtk::SourceSearchFlags) * limit: location of last possible match start, or NULL for start of buffer * Returns: locations of start and end of match. */ static VALUE rg_forward_search(int argc, VALUE *argv, VALUE self) { GtkTextIter m_start, m_end; VALUE str, flags, limit; VALUE ret = Qnil; rb_scan_args (argc, argv, "21", &str, &flags, &limit); if (rb_obj_is_kind_of (flags, GTYPE2CLASS (GTK_TYPE_SOURCE_SEARCH_FLAGS))) { if (gtk_source_iter_forward_search (_SELF (self), RVAL2CSTR (str), RVAL2GFLAGS (flags, GTK_TYPE_SOURCE_SEARCH_FLAGS), &m_start, &m_end, NIL_P (limit) ? NULL : _SELF (limit))) ret = rb_ary_new3 (2, ITR2RVAL (&m_start), ITR2RVAL (&m_end)); } else if (rb_obj_is_kind_of (flags, GTYPE2CLASS (GTK_TYPE_TEXT_SEARCH_FLAGS))) { if (gtk_text_iter_forward_search (_SELF (self), RVAL2CSTR (str), RVAL2GFLAGS (flags, GTK_TYPE_TEXT_SEARCH_FLAGS), &m_start, &m_end, NIL_P (limit) ? NULL : _SELF (limit))) ret = rb_ary_new3 (2, ITR2RVAL (&m_start), ITR2RVAL (&m_end)); } return ret; } /* Method: backward_search(str, flags, limit) * str: the search string (string) * flags: flags affecting the search (Gtk::SourceSearchFlags) * limit: location of last possible match end, or NULL for end of buffer * Returns: locations of start and end of match. */ static VALUE rg_backward_search(int argc, VALUE *argv, VALUE self) { GtkTextIter m_start, m_end; VALUE str, flags, limit; VALUE ret = Qnil; rb_scan_args (argc, argv, "21", &str, &flags, &limit); if (rb_obj_is_kind_of (flags, GTYPE2CLASS (GTK_TYPE_SOURCE_SEARCH_FLAGS))) { if (gtk_source_iter_backward_search (_SELF (self), RVAL2CSTR (str), RVAL2GFLAGS (flags, GTK_TYPE_SOURCE_SEARCH_FLAGS), &m_start, &m_end, NIL_P (limit) ? NULL : _SELF (limit))) ret = rb_ary_new3 (2, ITR2RVAL (&m_start), ITR2RVAL (&m_end)); } else if (rb_obj_is_kind_of (flags, GTYPE2CLASS (GTK_TYPE_TEXT_SEARCH_FLAGS))) { if (gtk_text_iter_backward_search (_SELF (self), RVAL2CSTR (str), RVAL2GFLAGS (flags, GTK_TYPE_TEXT_SEARCH_FLAGS), &m_start, &m_end, NIL_P (limit) ? NULL : _SELF (limit))) ret = rb_ary_new3 (2, ITR2RVAL (&m_start), ITR2RVAL (&m_end)); } return ret; } void Init_gtk_sourceiter (VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = GTYPE2CLASS (GTK_TYPE_TEXT_ITER); /* * They are override original Gtk::TextIter#[for|back]ward_search */ RG_DEF_METHOD(forward_search, -1); RG_DEF_METHOD(backward_search, -1); G_DEF_CLASS(GTK_TYPE_SOURCE_SEARCH_FLAGS, "SourceSearchFlags", RG_TARGET_NAMESPACE); G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_SOURCE_SEARCH_FLAGS, "GTK_"); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourcestyleschememanager.c�������������0000644�0001750�0001750�00000013236�11701304107�027650� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" /* Class: Gtk::SourceStyleSchemeManager * A class to manage source style scheme. */ #define RG_TARGET_NAMESPACE cSourceStyleSchemeManager #define _SELF(self) (GTK_SOURCE_STYLE_SCHEME_MANAGER(RVAL2GOBJ(self))) /* Class method: new * Returns: a newly created Gtk::SourceStyleSchemeManager object. */ static VALUE rg_initialize(VALUE self) { G_INITIALIZE (self, gtk_source_style_scheme_manager_new ()); return Qnil; } /* Class method: default * * Gets the default style scheme manager. * * Returns: a Gtk::SourceStyleSchemeManager */ static VALUE rg_s_default(VALUE self) { GtkSourceStyleSchemeManager* sssm = gtk_source_style_scheme_manager_get_default(); GType gtype = G_TYPE_FROM_INSTANCE(sssm); gchar *gtypename = (gchar *) g_type_name (gtype); if (strncmp (gtypename, "Gtk", 3) == 0) gtypename += 3; if (!rb_const_defined_at (mGtk, rb_intern (gtypename))) G_DEF_CLASS (gtype, gtypename, mGtk); return GOBJ2RVAL(sssm); } /* Method: set_search_path(dirs) * dirs: style scheme file directory path * * Sets the style scheme files directories for the given style scheme manager. * * Returns: self. */ static VALUE rg_set_search_path(VALUE self, VALUE dirs) { gchar** gdirs = (gchar**)NULL; gint i; if (! NIL_P(dirs)){ Check_Type(dirs, T_ARRAY); i = RARRAY_LEN(dirs); gdirs = ALLOCA_N(gchar*, i + 1); for (i = 0; i < i; i++) { if (TYPE(RARRAY_PTR(dirs)[i]) == T_STRING) { gdirs[i] = RVAL2CSTR(RARRAY_PTR(dirs)[i]); } else { gdirs[i] = ""; } } gdirs[i] = (gchar*)NULL; } gtk_source_style_scheme_manager_set_search_path (_SELF (self), gdirs); return self; } /* Method: append_search_path(path) * path: additional style scheme file directory path (string) * * Appends the style scheme files directory for the given style scheme manager. * * Returns: self. */ static VALUE rg_append_search_path(VALUE self, VALUE path) { gtk_source_style_scheme_manager_append_search_path (_SELF (self), RVAL2CSTR(path)); return self; } /* Method: prepend_search_path(path) * path: additional style scheme file directory path (string) * * Prepend the style scheme files directory for the given style scheme manager. * * Returns: self. */ static VALUE rg_prepend_search_path(VALUE self, VALUE path) { gtk_source_style_scheme_manager_prepend_search_path (_SELF (self), RVAL2CSTR(path)); return self; } /* Method: get_search_path * Returns: a list of style scheme files directories (strings) for the given * style scheme manager. */ static VALUE rg_search_path(VALUE self) { VALUE ary; const gchar * const * dirs = gtk_source_style_scheme_manager_get_search_path (_SELF (self)); if (!dirs) return Qnil; ary = rb_ary_new(); while (*dirs){ rb_ary_push(ary, CSTR2RVAL(*dirs)); dirs++; } return ary; } /* Method: scheme_ids * Returns: a list of style scheme ids for the given style scheme manager */ static VALUE rg_scheme_ids(VALUE self) { VALUE ary; const gchar * const * ids = gtk_source_style_scheme_manager_get_scheme_ids (_SELF (self)); if (!ids) return Qnil; ary = rb_ary_new(); while (*ids){ rb_ary_push(ary, CSTR2RVAL(*ids)); ids++; } return ary; } /* * Method: scheme(scheme_id) * scheme_id: a style scheme id (as a string). * * Gets the Gtk::SourceStyleScheme which is associated with the given id * in the style scheme manager. * * Returns: a Gtk::SourceStyleScheme, or nil if there is no style scheme * associated with the given id. */ static VALUE rg_get_scheme(VALUE self, VALUE scheme_id) { return GOBJ2RVAL (gtk_source_style_scheme_manager_get_scheme (_SELF (self), RVAL2CSTR (scheme_id))); } /* * Method: force_rescan * * Forces all style schemes to be reloaded the next time the * Gtk::SourceStyleSchemeManager is accessed. * * Returns: self. */ static VALUE rg_force_rescan(VALUE self) { gtk_source_style_scheme_manager_force_rescan(_SELF (self)); return self; } void Init_gtk_sourcestyleschememanager (VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_TYPE_SOURCE_STYLE_SCHEME_MANAGER, "SourceStyleSchemeManager", mGtk); RG_DEF_METHOD(initialize, 0); RG_DEF_METHOD(set_search_path, 1); RG_DEF_METHOD(append_search_path, 1); RG_DEF_METHOD(prepend_search_path, 1); RG_DEF_METHOD(search_path, 0); RG_DEF_METHOD(scheme_ids, 0); RG_DEF_METHOD(get_scheme, 1); RG_DEF_METHOD(force_rescan, 0); RG_DEF_SMETHOD(default, 0); G_DEF_SETTERS (RG_TARGET_NAMESPACE); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/depend��������������������������������������0000644�0001750�0001750�00000000260�12064346475�022545� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-gtksourceview2.pc $(pkgconfigdir); \ fi ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/ext/gtksourceview2/rbgtksourcebuffer.c�������������������������0000644�0001750�0001750�00000025261�11701304107�025242� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2004,2005 Ruby-GNOME2 Project Team * Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbgtksourcemain.h" #define RG_TARGET_NAMESPACE cSourceBuffer /* Class: Gtk::SourceBuffer * Text buffer object for Gtk::SourceView. */ #define _SELF(self) (GTK_SOURCE_BUFFER(RVAL2GOBJ(self))) #define RVAL2ITR(i) ((GtkTextIter*)RVAL2BOXED(i, GTK_TYPE_TEXT_ITER)) /* * Class method: new(obj=nil) * obj: either a Gtk::TextTagTable, a Gtk::SourceLanguage, or nil. * * Creates a new source buffer. If a Gtk::SourceTagTable is provided, the * buffer will use it, otherwise it will create a new one. * * If a Gtk::SourceLanguage object is given, the buffer will be created * using highlightings patterns in this language. This is equivalent to * creating a new source buffer with the default tag table and then setting * the 'language' property. * * Returns: a newly created Gtk::SourceBuffer object. */ static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE val; rb_scan_args (argc, argv, "01", &val); if (NIL_P (val)) { G_INITIALIZE (self, gtk_source_buffer_new (NULL)); } else if (rb_obj_is_kind_of (val, GTYPE2CLASS (GTK_TYPE_TEXT_TAG_TABLE))) { G_INITIALIZE (self, gtk_source_buffer_new (GTK_TEXT_TAG_TABLE (RVAL2GOBJ (val)))); } else if (rb_obj_is_kind_of (val, GTYPE2CLASS (GTK_TYPE_SOURCE_LANGUAGE))) { G_INITIALIZE (self, gtk_source_buffer_new_with_language (GTK_SOURCE_LANGUAGE (RVAL2GOBJ (val)))); } else { rb_raise (rb_eArgError, "invalid argument %s (expect nil, Gtk::TextTagTable or Gtk::SourceLanguage)", rb_class2name (CLASS_OF (val))); } return Qnil; } /* * Method: redo! * * Redoes the last undo operation. Use Gtk::SourceBuffer#can_redo? to check * whether a call to this function will have any effect. * * Returns: self. */ static VALUE rg_redo_bang(VALUE self) { gtk_source_buffer_redo (_SELF (self)); return self; } /* * Method: undo! * * Undoes the last user action which modified the buffer. * Use Gtk::SourceBuffer#can_undo? to check whether a call to this function * will have any effect. * * Actions are defined as groups of operations between a call to * Gtk::TextBuffer#begin_user_action and Gtk::TextBuffer#end_user_action, * or sequences of similar edits (inserts or deletes) on the same line. * * Returns: self. */ static VALUE rg_undo_bang(VALUE self) { gtk_source_buffer_undo (_SELF (self)); return self; } /* * Method: begin_not_undoable_action * Method: begin_not_undoable_action { ... } * * Marks the beginning of a not undoable action on the buffer, disabling the * undo manager. * * If a block is given, the block is called after marking the beginning * of a not undoable action on the buffer. * At the end of the block, marks the end of a not undoable action on the * buffer. When the last not undoable block is finished, the list of undo * actions is cleared and the undo manager is re-enabled. * * Returns: self */ static VALUE rg_begin_not_undoable_action(VALUE self) { gtk_source_buffer_begin_not_undoable_action (_SELF (self)); if (rb_block_given_p()) { VALUE block = rb_block_proc (); rb_funcall (block, rb_intern ("call"), 0); gtk_source_buffer_end_not_undoable_action (_SELF (self)); } return self; } /* * Method: end_not_undoable_action * * Marks the end of a not undoable action on the buffer. * When the last not undoable block is finished, the list of undo * actions is cleared and the undo manager is re-enabled. * * Returns: self */ static VALUE rg_end_not_undoable_action(VALUE self) { gtk_source_buffer_end_not_undoable_action (_SELF (self)); return self; } /* * Method: not_undoable_action { ... } * * Marks the beginning of a not undoable action on the buffer, disabling the * undo manager, then calls the provided block of code. * * At the end of the block, marks the end of a not undoable action on the * buffer. When the last not undoable block is finished, the list of undo * actions is cleared and the undo manager is re-enabled. * * ((*Deprecated*)). Use Gtk::SourceView#begin_not_undoable_action{ ... } instead. * * Returns: the return value of the provided block. */ static VALUE rg_not_undoable_action(VALUE self) { VALUE block, ret; block = rb_block_proc (); gtk_source_buffer_begin_not_undoable_action (_SELF (self)); ret = rb_funcall (block, rb_intern ("call"), 0); gtk_source_buffer_end_not_undoable_action (_SELF (self)); return ret; } #ifdef HAVE_GTK_SOURCE_MARK_GET_TYPE /* * Method: create_source_mark(name=nil, category, where) * name: the name of the mark. * type: a string defining the mark type. * where: a location to place the mark, as a Gtk::TreeIter object. * * Creates a mark in the buffer of the given type. A mark is semantically * very similar to a Gtk::TextMark, except it has a type which is used by the * Gtk::SourceView object displaying the buffer to show a pixmap on the left * margin, at the line the mark is in. Because of this, a mark is generally * associated to a line and not a character position. Marks are also * accessible through a position or range in the buffer. * * Marks are implemented using Gtk::TextMark, so all characteristics and * restrictions to marks apply to marks too. These includes life cycle issues * and "mark-set" and "mark-deleted" signal emissions. * * Like a Gtk::TextMark, a Gtk::SourceMark can be anonymous if the passed * name is nil. * * Marks always have left gravity and are moved to the beginning of the line * when the user deletes the line they were in. Also, if the user deletes a * region of text which contained lines with marks, those are deleted. * * Typical uses for a mark are bookmarks, breakpoints, current executing * instruction indication in a source file, etc.. * * Returns: a new Gtk::SourceMark object, owned by the buffer. */ static VALUE rg_create_source_mark(int argc, VALUE *argv, VALUE self) { VALUE name, category, where; if (argc == 2) rb_scan_args (argc, argv, "21", &where, &category, &name); else rb_scan_args (argc, argv, "30", &name, &category, &where); return GOBJ2RVAL (gtk_source_buffer_create_source_mark (_SELF (self), RVAL2CSTR (name), RVAL2CSTR (category), RVAL2ITR (where))); } static VALUE rg_get_source_marks_at_line(int argc, VALUE *argv, VALUE self) { GSList *list, *p; VALUE line, category; VALUE ary; rb_scan_args (argc, argv, "11", &line, &category); list = gtk_source_buffer_get_source_marks_at_line (_SELF (self), NUM2INT (line), NIL_P (category) ? NULL : RVAL2CSTR (category)); ary = rb_ary_new (); p = (GSList *) list; while (p) { rb_ary_push (ary, GOBJ2RVAL (p->data)); p = g_slist_next (p); } return ary; } static VALUE rg_get_source_marks_at_iter(int argc, VALUE *argv, VALUE self) { GSList *list, *p; VALUE iter, category; VALUE ary; rb_scan_args (argc, argv, "11", &iter, &category); list = gtk_source_buffer_get_source_marks_at_iter (_SELF (self), RVAL2ITR (iter), NIL_P (category) ? NULL : RVAL2CSTR (category)); ary = rb_ary_new (); p = (GSList *) list; while (p) { rb_ary_push (ary, GOBJ2RVAL (p->data)); p = g_slist_next (p); } return ary; } static VALUE rg_remove_source_marks(int argc, VALUE *argv, VALUE self) { VALUE start, end, category; rb_scan_args (argc, argv, "21", &start, &end, &category); gtk_source_buffer_remove_source_marks (_SELF (self), RVAL2ITR (start), RVAL2ITR (end), NIL_P (category) ? NULL : RVAL2CSTR (category)); return self; } static VALUE rg_forward_iter_to_source_mark(int argc, VALUE *argv, VALUE self) { VALUE iter, category; rb_scan_args (argc, argv, "11", &iter, &category); return CBOOL2RVAL (gtk_source_buffer_forward_iter_to_source_mark (_SELF (self), RVAL2ITR (iter), NIL_P (category) ? NULL : RVAL2CSTR (category))); } static VALUE rg_backward_iter_to_source_mark(int argc, VALUE *argv, VALUE self) { VALUE iter, category; rb_scan_args (argc, argv, "11", &iter, &category); return CBOOL2RVAL (gtk_source_buffer_backward_iter_to_source_mark (_SELF (self), RVAL2ITR (iter), NIL_P (category) ? NULL : RVAL2CSTR (category))); } #endif /* HAVE_GTK_SOURCE_MARK_GET_TYPE */ static VALUE rg_ensure_highlight(VALUE self, VALUE start, VALUE end) { gtk_source_buffer_ensure_highlight (_SELF (self), RVAL2ITR (start), RVAL2ITR (end)); return self; } void Init_gtk_sourcebuffer (VALUE mGtk) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_TYPE_SOURCE_BUFFER, "SourceBuffer", mGtk); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD_BANG(redo, 0); RG_DEF_METHOD_BANG(undo, 0); RG_DEF_METHOD(begin_not_undoable_action, 0); RG_DEF_METHOD(end_not_undoable_action, 0); RG_DEF_METHOD(not_undoable_action, 0); RG_DEF_ALIAS("non_undoable_action", "not_undoable_action"); #ifdef HAVE_GTK_SOURCE_MARK_GET_TYPE RG_DEF_METHOD(create_source_mark, -1); RG_DEF_METHOD(get_source_marks_at_line, -1); RG_DEF_METHOD(get_source_marks_at_iter, -1); RG_DEF_METHOD(remove_source_marks, -1); RG_DEF_METHOD(forward_iter_to_source_mark, -1); RG_DEF_METHOD(backward_iter_to_source_mark, -1); #endif RG_DEF_METHOD(ensure_highlight, 2); G_DEF_SETTERS (RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/README���������������������������������������������������������0000644�0001750�0001750�00000001335�12257552170�016457� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ruby/GtkSourceView2 =================== Ruby/GtkSourceView2 is a Ruby binding of gtksourceview-2.x. Requirements ------------ Ruby: http://www.ruby-lang.org/ Ruby-GNOME2: http://ruby-gnome2.sourceforge.jp/ GtkSourceView: ftp://ftp.gnome.org/pub/GNOME/sources/gtksourceview Install ------- 0. install ruby 1.9.x or newer, GtkSourceView 2.0.0 or newer, Ruby/GTK2. 1. ruby extconf.rb 2. make 3. su 4. make install Copying ------- Copyright (c) 2008 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/COPYING.LIB����������������������������������������������������0000644�0001750�0001750�00000063642�12257552170�017250� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/lib/�����������������������������������������������������������0000755�0001750�0001750�00000000000�12137115065�016336� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/lib/gtksourceview2.rb������������������������������������������0000644�0001750�0001750�00000000765�12137115065�021656� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin gtksourceview2.rb Copyright (c) 2008-2011 Ruby-GNOME2 Project Team This program is licensed under the same licence as Ruby-GNOME2. =end require 'gtk2' base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, micro, = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/gtksourceview2.so" rescue LoadError require "gtksourceview2.so" end �����������ruby-gnome2-all-2.1.0/gtksourceview2/sample/��������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�017042� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/sample/sourcelanguagemanager.rb��������������������������������0000644�0001750�0001750�00000000710�11701304107�023724� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin sourcelanguagesmanager.rb - Ruby/GtkSourceView sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: sourcelanguagesmanager.rb,v 1.3 2007/06/03 02:11:07 mutoh Exp $ =end require 'gtksourceview2' s = Gtk::SourceLanguageManager.new s.language_ids.each do |v| puts v end s.search_path.each do |v| puts v end puts s.get_language("html").name ��������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/sample/test.rb�������������������������������������������������0000644�0001750�0001750�00000001424�11701304107�020347� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby =begin test.rb - Ruby/GtkSourceView2 sample script. Copyright (c) 2006 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: test.rb,v 1.4 2007/06/03 02:11:07 mutoh Exp $ =end require 'gtksourceview2' w = Gtk::Window.new w.signal_connect("delete-event"){Gtk::main_quit} view = Gtk::SourceView.new w.add(Gtk::ScrolledWindow.new.add(view)) view.show_line_numbers = true view.insert_spaces_instead_of_tabs = true view.indent_width = 4 view.show_right_margin = true view.right_margin_position = 80 lang = Gtk::SourceLanguageManager.new.get_language('ruby') view.buffer.language = lang view.buffer.highlight_syntax = true view.buffer.highlight_matching_brackets = true w.set_default_size(450,300) w.show_all Gtk.main ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/extconf.rb�����������������������������������������������������0000644�0001750�0001750�00000002235�11701304107�017556� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "gtksourceview2" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/Rakefile�������������������������������������������������������0000644�0001750�0001750�00000000705�12147676243�017252� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- $LOAD_PATH.unshift("./../glib2/lib") require 'gnome2-raketask' package = GNOME2Package.new do |_package| _package.summary = "Ruby/GtkSourceView2 is a Ruby binding of gtksourceview-2.x." _package.description = "Ruby/GtkSourceView2 is a Ruby binding of gtksourceview-2.x." _package.dependency.gem.runtime = ["gtk2"] _package.win32.packages = ["gtksourceview"] _package.win32.dependencies = ["libxml2"] end package.define_tasks �����������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/test/����������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�016540� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/test/test_source_view.rb���������������������������������������0000644�0001750�0001750�00000001046�11701304107�022457� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- coding: utf-8 -*- class TestSourceView < Test::Unit::TestCase def test_mark_category_background view = Gtk::SourceView.new red_rgb = [65535, 0, 0] red_color = Gdk::Color.parse("red") assert_not_equal(red_rgb, view.get_mark_category_background("XXX").to_a) view.set_mark_category_background("XXX", red_color) assert_equal(red_rgb, view.get_mark_category_background("XXX").to_a) view.set_mark_category_background("XXX", nil) assert_not_equal(red_rgb, view.get_mark_category_background("XXX").to_a) end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gtksourceview2/test/run-test.rb�����������������������������������������������0000755�0001750�0001750�00000002145�11701304107�020653� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") atk_base = File.join(ruby_gnome2_base, "atk") pango_base = File.join(ruby_gnome2_base, "pango") gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2") gtk_base = File.join(ruby_gnome2_base, "gtk2") gtk_source_view2_base = File.join(ruby_gnome2_base, "gtksourceview2") $LOAD_PATH.unshift(glib_base) require 'test/glib-test-init' [glib_base, atk_base, pango_base, gdk_pixbuf_base, gtk_base, gtk_source_view2_base].each do |target| if system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(1) end $LOAD_PATH.unshift(File.join(target, "ext", File.basename(target))) $LOAD_PATH.unshift(File.join(target, "src")) $LOAD_PATH.unshift(File.join(target, "src", "lib")) $LOAD_PATH.unshift(File.join(target)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(gtk_base, "test")) require 'gtk-test-utils' require 'gtksourceview2' exit Test::Unit::AutoRunner.run(true) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/����������������������������������������������������������������������0000755�0001750�0001750�00000000000�12257665517�014305� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/������������������������������������������������������������������0000755�0001750�0001750�00000000000�11701304107�015057� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/����������������������������������������������������������0000755�0001750�0001750�00000000000�12257552170�016554� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-font-info.c�������������������������������������0000644�0001750�0001750�00000003316�12257552170�022625� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cFontInfo static VALUE RG_TARGET_NAMESPACE; static ID id_valid; static VALUE rg_initialize(VALUE self, VALUE document) { G_INITIALIZE(self, poppler_font_info_new(RVAL2POPPLERDOCUMENT(document))); return Qnil; } static VALUE rg_scan(VALUE self, VALUE n_pages) { VALUE rb_iter = Qnil; PopplerFontsIter *iter; if (poppler_font_info_scan(RVAL2FONTINFO(self), NUM2INT(n_pages), &iter)) { rb_iter = POPPLERFONTSITER2RVAL(iter); rb_ivar_set(rb_iter, id_valid, Qtrue); poppler_fonts_iter_free(iter); } return rb_iter; } void Init_poppler_font_info(VALUE mPoppler) { id_valid = rb_intern("valid?"); RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_FONT_INFO, "FontInfo", mPoppler); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(scan, 1); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-choice-field.c����������������������������������0000644�0001750�0001750�00000006744�12257552170�023251� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cChoiceField #define _SELF(obj) RVAL2POPPLERFORMFIELD(obj) static VALUE RG_TARGET_NAMESPACE; static VALUE rg_type(VALUE self) { return POPPLERFORMCHOICETYPE2RVAL(poppler_form_field_choice_get_choice_type(_SELF(self))); } static VALUE rg_editable_p(VALUE self) { return CBOOL2RVAL(poppler_form_field_choice_is_editable(_SELF(self))); } static VALUE rg_select_multiple_p(VALUE self) { return CBOOL2RVAL(poppler_form_field_choice_can_select_multiple(_SELF(self))); } static VALUE rg_spell_check_p(VALUE self) { return CBOOL2RVAL(poppler_form_field_choice_do_spell_check(_SELF(self))); } static VALUE rg_commit_on_change_p(VALUE self) { return CBOOL2RVAL(poppler_form_field_choice_commit_on_change(_SELF(self))); } static VALUE rg_n_items(VALUE self) { return INT2NUM(poppler_form_field_choice_get_n_items(_SELF(self))); } static VALUE rg_operator_choice_field_get_item(VALUE self, VALUE index) { return CSTR2RVAL(poppler_form_field_choice_get_item(_SELF(self), NUM2INT(index))); } static VALUE rg_selected_p(VALUE self, VALUE index) { return CBOOL2RVAL(poppler_form_field_choice_is_item_selected(_SELF(self), NUM2INT(index))); } static VALUE rg_select(VALUE self, VALUE index) { poppler_form_field_choice_select_item(_SELF(self), NUM2INT(index)); return Qnil; } static VALUE rg_unselect_all(VALUE self) { poppler_form_field_choice_unselect_all(_SELF(self)); return Qnil; } static VALUE rg_toggle(VALUE self, VALUE index) { poppler_form_field_choice_toggle_item(_SELF(self), NUM2INT(index)); return Qnil; } static VALUE rg_set_text(VALUE self, VALUE text) { poppler_form_field_choice_set_text(_SELF(self), RVAL2CSTR_ACCEPT_NIL(text)); return Qnil; } static VALUE rg_text(VALUE self) { return CSTR2RVAL(poppler_form_field_choice_get_text(_SELF(self))); } void Init_poppler_choice_field(VALUE mPoppler, VALUE cFormField) { RG_TARGET_NAMESPACE = rb_define_class_under(mPoppler, "ChoiceField", cFormField); RG_DEF_METHOD(type, 0); RG_DEF_METHOD_P(editable, 0); RG_DEF_METHOD_P(select_multiple, 0); RG_DEF_METHOD_P(spell_check, 0); RG_DEF_METHOD_P(commit_on_change, 0); RG_DEF_METHOD(n_items, 0); RG_DEF_METHOD_OPERATOR("[]", choice_field_get_item, 1); RG_DEF_METHOD_P(selected, 1); RG_DEF_METHOD(select, 1); RG_DEF_METHOD(unselect_all, 0); RG_DEF_METHOD(toggle, 1); RG_DEF_METHOD(text, 0); RG_DEF_METHOD(set_text, 1); } ����������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-attachment.c������������������������������������0000664�0001750�0001750�00000006252�11740310343�023050� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cAttachment #define SELF(self) (RVAL2POPPLERATTACHMENT(self)) static ID id_call; static gboolean attachment_save_func(const gchar *buf, gsize count, gpointer data, G_GNUC_UNUSED GError **error) { VALUE result; VALUE callback = (VALUE)data; result = rb_funcall(callback, id_call, 1, rb_str_new(buf, count)); return RVAL2CBOOL(result); } static VALUE rg_save(int argc, VALUE *argv, VALUE self) { VALUE filename; gboolean result; GError *error = NULL; rb_scan_args(argc, argv, "01", &filename); if (NIL_P(filename)) { if (rb_block_given_p()) { gpointer user_data = (gpointer)rb_block_proc(); result = poppler_attachment_save_to_callback(SELF(self), attachment_save_func, user_data, &error); } else { rb_raise(rb_eArgError, "must provide filename or block"); } } else { result = poppler_attachment_save(SELF(self), RVAL2CSTR(filename), &error); } if (error) RAISE_GERROR(error); return CBOOL2RVAL(result); } static VALUE rg_name(VALUE self) { return CSTR2RVAL(SELF(self)->name); } static VALUE rg_description(VALUE self) { return CSTR2RVAL(SELF(self)->description); } static VALUE rg_size(VALUE self) { return INT2NUM(SELF(self)->size); } static VALUE rg_mtime(VALUE self) { return rb_time_new(SELF(self)->mtime, 0); } static VALUE rg_ctime(VALUE self) { return rb_time_new(SELF(self)->ctime, 0); } static VALUE rg_checksum(VALUE self) { GString *checksum; checksum = SELF(self)->checksum; return rb_str_new(checksum->str, checksum->len); } void Init_poppler_attachment(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE; id_call = rb_intern("call"); RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_ATTACHMENT, "Attachment", mPoppler); RG_DEF_METHOD(save, -1); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(description, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(mtime, 0); RG_DEF_METHOD(ctime, 0); RG_DEF_METHOD(checksum, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-ps-file.c���������������������������������������0000644�0001750�0001750�00000004011�12257552170�022256� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cPSFile /* Export to ps */ static VALUE rg_initialize(VALUE self, VALUE document, VALUE filename, VALUE first_page, VALUE n_pages) { PopplerPSFile *ps_file; ps_file = poppler_ps_file_new(RVAL2POPPLERDOCUMENT(document), RVAL2CSTR(filename), NUM2INT(first_page), NUM2INT(n_pages)); if (!ps_file) rb_raise(rb_eRuntimeError, "can't create Poppler::PSFile"); G_INITIALIZE(self, ps_file); return Qnil; } static VALUE rg_set_paper_size(VALUE self, VALUE width, VALUE height) { poppler_ps_file_set_paper_size(RVAL2POPPLERPSFILE(self), NUM2DBL(width), NUM2DBL(height)); return Qnil; } static VALUE rg_set_duplex(VALUE self, VALUE duplex) { poppler_ps_file_set_duplex(RVAL2POPPLERPSFILE(self), RVAL2CBOOL(duplex)); return Qnil; } void Init_poppler_ps_file(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_PS_FILE, "PSFile", mPoppler); /* Export to ps */ RG_DEF_METHOD(initialize, 4); RG_DEF_METHOD(set_paper_size, 2); RG_DEF_METHOD(set_duplex, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-annotation-free-text.c��������������������������0000644�0001750�0001750�00000003035�12257552170�024777� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2008-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cAnnotationFreeText #define SELF(self) (RVAL2POPPLERANNOTFREETEXT(self)) static VALUE rg_quadding(VALUE self) { return POPPLERANNOTFREETEXTQUADDING2RVAL(poppler_annot_free_text_get_quadding(SELF(self))); } static VALUE rg_callout_line(VALUE self) { return POPPLERANNOTCALLOUTLINE2RVAL(poppler_annot_free_text_get_callout_line(SELF(self))); } void Init_poppler_annotation_free_text(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_ANNOT_FREE_TEXT, "AnnotationFreeText", mPoppler); RG_DEF_METHOD(quadding, 0); RG_DEF_METHOD(callout_line, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-text-field.c������������������������������������0000644�0001750�0001750�00000004632�12257552170�022775� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cTextField #define _SELF(obj) RVAL2POPPLERFORMFIELD(obj) static VALUE RG_TARGET_NAMESPACE; static VALUE rg_type(VALUE self) { return POPPLERFORMTEXTTYPE2RVAL(poppler_form_field_text_get_text_type(_SELF(self))); } static VALUE rg_text(VALUE self) { return CSTR2RVAL(poppler_form_field_text_get_text(_SELF(self))); } static VALUE rg_set_text(VALUE self, VALUE text) { poppler_form_field_text_set_text(_SELF(self), RVAL2CSTR_ACCEPT_NIL(text)); return Qnil; } static VALUE rg_max_length(VALUE self) { return INT2NUM(poppler_form_field_text_get_max_len(_SELF(self))); } static VALUE rg_spell_check_p(VALUE self) { return CBOOL2RVAL(poppler_form_field_text_do_spell_check(_SELF(self))); } static VALUE rg_scroll_p(VALUE self) { return CBOOL2RVAL(poppler_form_field_text_do_scroll(_SELF(self))); } static VALUE rg_rich_text_p(VALUE self) { return CBOOL2RVAL(poppler_form_field_text_is_rich_text(_SELF(self))); } static VALUE rg_password_p(VALUE self) { return CBOOL2RVAL(poppler_form_field_text_is_password(_SELF(self))); } void Init_poppler_text_field(VALUE mPoppler, VALUE cFormField) { RG_TARGET_NAMESPACE = rb_define_class_under(mPoppler, "TextField", cFormField); RG_DEF_METHOD(type, 0); RG_DEF_METHOD(text, 0); RG_DEF_METHOD(set_text, 1); RG_DEF_METHOD(max_length, 0); RG_DEF_METHOD_P(spell_check, 0); RG_DEF_METHOD_P(scroll, 0); RG_DEF_METHOD_P(rich_text, 0); RG_DEF_METHOD_P(password, 0); } ������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler.h�����������������������������������������������0000644�0001750�0001750�00000003640�12257552170�020735� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBPOPPLER_H__ #define __RBPOPPLER_H__ #include <ruby.h> #include <rbglib.h> #include <rbgobject.h> #include <poppler.h> #ifndef POPPLER_MAJOR_VERSION # include "rbpopplerversion.h" #endif #include "rbpopplerconversions.h" #ifndef POPPLER_TYPE_INDEX_ITER # define POPPLER_TYPE_INDEX_ITER (poppler_index_iter_get_type ()) #endif #ifndef POPPLER_TYPE_FONTS_ITER # define POPPLER_TYPE_FONTS_ITER (poppler_fonts_iter_get_type ()) #endif #ifndef POPPLER_TYPE_DEST extern GType poppler_dest_get_type (void) G_GNUC_CONST; # define POPPLER_TYPE_DEST (poppler_dest_get_type ()) # define RB_POPPLER_TYPE_DEST_NOT_DEFINED #endif #include <rb_cairo.h> #ifdef POPPLER_TYPE_COLOR extern PopplerColor *rb_poppler_ruby_object_to_color(VALUE color); extern VALUE rb_poppler_ruby_object_from_color_with_free(PopplerColor *color); #endif extern VALUE rb_poppler_ruby_object_from_form_field(PopplerFormField *field); extern VALUE rb_poppler_ruby_object_from_action(PopplerAction *action); extern PopplerAction *rb_poppler_action_from_ruby_object(VALUE action); #endif ������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler.c�����������������������������������������������0000644�0001750�0001750�00000010562�12257552170�020731� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" extern void Init_poppler(void); #define RG_TARGET_NAMESPACE mPoppler static VALUE rg_s_backend(G_GNUC_UNUSED VALUE self) { return POPPLERBACKEND2RVAL(poppler_get_backend()); } static VALUE rg_s_version(G_GNUC_UNUSED VALUE self) { return CSTR2RVAL(poppler_get_version()); } static VALUE rg_s_cairo_available_p(G_GNUC_UNUSED VALUE self) { return Qtrue; } void Init_poppler(void) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = rb_define_module("Poppler"); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(POPPLER_MAJOR_VERSION), INT2FIX(POPPLER_MINOR_VERSION), INT2FIX(POPPLER_MICRO_VERSION))); G_DEF_CLASS(POPPLER_TYPE_ERROR, "Error", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_ORIENTATION, "Orientation", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_PAGE_TRANSITION_TYPE, "PageTransitionType", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_PAGE_TRANSITION_ALIGNMENT, "PageTransitionAlignment", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_PAGE_TRANSITION_DIRECTION, "PageTransitionDirection", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_SELECTION_STYLE, "SelectionStyle", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_FORM_BUTTON_TYPE, "FormButtonType", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_FORM_TEXT_TYPE, "FormTextType", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_FORM_CHOICE_TYPE, "FormChoiceType", RG_TARGET_NAMESPACE); G_RENAME_NICK("3D", "TYPE_3D"); G_DEF_CLASS(POPPLER_TYPE_ANNOT_TYPE, "AnnotationType", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_ANNOT_FLAG, "AnnotationFlag", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_ANNOT_MARKUP_REPLY_TYPE, "AnnotationMarkupReplyType", RG_TARGET_NAMESPACE); G_RENAME_NICK("3D", "TYPE_3D"); G_DEF_CLASS(POPPLER_TYPE_ANNOT_EXTERNAL_DATA_TYPE, "AnnotationExternalDataType", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_ANNOT_TEXT_STATE, "AnnotationTextState", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_ANNOT_FREE_TEXT_QUADDING, "AnnotationFreeTextQuadding", RG_TARGET_NAMESPACE); G_DEF_CLASS(POPPLER_TYPE_BACKEND, "Backend", RG_TARGET_NAMESPACE); RG_DEF_SMETHOD(backend, 0); RG_DEF_SMETHOD(version, 0); RG_DEF_SMETHOD_P(cairo_available, 0); Init_poppler_index_iter(RG_TARGET_NAMESPACE); Init_poppler_font_info(RG_TARGET_NAMESPACE); Init_poppler_document(RG_TARGET_NAMESPACE); Init_poppler_fonts_iter(RG_TARGET_NAMESPACE); Init_poppler_ps_file(RG_TARGET_NAMESPACE); Init_poppler_rectangle(RG_TARGET_NAMESPACE); Init_poppler_page(RG_TARGET_NAMESPACE); Init_poppler_color(RG_TARGET_NAMESPACE); Init_poppler_link_mapping(RG_TARGET_NAMESPACE); Init_poppler_page_transition(RG_TARGET_NAMESPACE); Init_poppler_image_mapping(RG_TARGET_NAMESPACE); Init_poppler_form_field_mapping(RG_TARGET_NAMESPACE); Init_poppler_annotation_mapping(RG_TARGET_NAMESPACE); Init_poppler_attachment(RG_TARGET_NAMESPACE); Init_poppler_action(RG_TARGET_NAMESPACE); Init_poppler_annotation(RG_TARGET_NAMESPACE); Init_poppler_annotation_markup(RG_TARGET_NAMESPACE); Init_poppler_annotation_text(RG_TARGET_NAMESPACE); Init_poppler_annotation_free_text(RG_TARGET_NAMESPACE); Init_poppler_annotation_callout_line(RG_TARGET_NAMESPACE); Init_poppler_form_field(RG_TARGET_NAMESPACE); } ����������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-link-mapping.c����������������������������������0000644�0001750�0001750�00000003427�12257552170�023317� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cLinkMapping void rectangle_set(PopplerRectangle *rect, VALUE rb_rect) { *rect = *(RVAL2POPPLERRECTANGLE(rb_rect)); } DEF_ACCESSOR_WITH_SETTER(link_mapping, area, RVAL2POPPLERLINKMAPPING, RECT_ENTITY2RVAL, RECT_ENTITY_SET) DEF_ACCESSOR(link_mapping, action, RVAL2POPPLERLINKMAPPING, POPPLERACTION2RVAL, RVAL2POPPLERACTION) void Init_poppler_link_mapping(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_LINK_MAPPING, "LinkMapping", mPoppler); rbg_define_method(RG_TARGET_NAMESPACE, "area", link_mapping_get_area, 0); rbg_define_method(RG_TARGET_NAMESPACE, "action", link_mapping_get_action, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_area", link_mapping_set_area, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_action", link_mapping_set_action, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-page-transition.c�������������������������������0000644�0001750�0001750�00000006141�12257552170�024031� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cPageTransition DEF_ACCESSOR(page_trans, type, RVAL2POPPLERPAGETRANSITION, RVAL2POPPLERPAGETRANSITIONTYPE, POPPLERPAGETRANSITIONTYPE2RVAL) DEF_ACCESSOR(page_trans, alignment, RVAL2POPPLERPAGETRANSITION, RVAL2POPPLERPAGETRANSITIONALIGNMENT, POPPLERPAGETRANSITIONALIGNMENT2RVAL) DEF_ACCESSOR(page_trans, direction, RVAL2POPPLERPAGETRANSITION, RVAL2POPPLERPAGETRANSITIONDIRECTION, POPPLERPAGETRANSITIONDIRECTION2RVAL) DEF_ACCESSOR(page_trans, duration, RVAL2POPPLERPAGETRANSITION, NUM2INT, INT2NUM) DEF_ACCESSOR(page_trans, angle, RVAL2POPPLERPAGETRANSITION, NUM2INT, INT2NUM) DEF_ACCESSOR(page_trans, scale, RVAL2POPPLERPAGETRANSITION, NUM2DBL, rb_float_new) DEF_ACCESSOR(page_trans, rectangular, RVAL2POPPLERPAGETRANSITION, RVAL2CBOOL, CBOOL2RVAL) void Init_poppler_page_transition(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_PAGE_TRANSITION, "PageTransition", mPoppler); rbg_define_method(RG_TARGET_NAMESPACE, "type", page_trans_get_type, 0); rbg_define_method(RG_TARGET_NAMESPACE, "alignment", page_trans_get_alignment, 0); rbg_define_method(RG_TARGET_NAMESPACE, "direction", page_trans_get_direction, 0); rbg_define_method(RG_TARGET_NAMESPACE, "duration", page_trans_get_duration, 0); rbg_define_method(RG_TARGET_NAMESPACE, "angle", page_trans_get_angle, 0); rbg_define_method(RG_TARGET_NAMESPACE, "scale", page_trans_get_scale, 0); rbg_define_method(RG_TARGET_NAMESPACE, "rectangular", page_trans_get_rectangular, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_type", page_trans_set_type, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_alignment", page_trans_set_alignment, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_direction", page_trans_set_direction, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_duration", page_trans_set_duration, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_angle", page_trans_set_angle, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_scale", page_trans_set_scale, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_rectangular", page_trans_set_rectangular, 1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-page.c������������������������������������������0000644�0001750�0001750�00000021343�12257552170�021642� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006-2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cPage #define SELF(self) (RVAL2POPPLERPAGE(self)) static VALUE cRectangle; static VALUE cPSFile; static VALUE page_render(VALUE self, VALUE cairo) { poppler_page_render(SELF(self), RVAL2CRCONTEXT(cairo)); return Qnil; } static VALUE page_render_to_ps(VALUE self, VALUE ps_file) { poppler_page_render_to_ps(SELF(self), RVAL2POPPLERPSFILE(ps_file)); return Qnil; } static VALUE rg_render(VALUE self, VALUE ps_file_or_cairo) { if (RVAL2CBOOL(rb_obj_is_kind_of(ps_file_or_cairo, cPSFile))) { return page_render_to_ps(self, ps_file_or_cairo); } else { return page_render(self, ps_file_or_cairo); } } static VALUE page_render_for_printing(VALUE self, VALUE cairo) { poppler_page_render_for_printing(SELF(self), RVAL2CRCONTEXT(cairo)); return Qnil; } static VALUE rg_render_for_printing(VALUE self, VALUE cairo) { return page_render_for_printing(self, cairo); } static VALUE page_render_selection(VALUE self, VALUE cairo, VALUE selection, VALUE rb_old_selection, VALUE style, VALUE glyph_color, VALUE background_color) { PopplerRectangle *old_selection = NULL; if (!NIL_P(rb_old_selection)) old_selection = RVAL2POPPLERRECTANGLE(rb_old_selection); poppler_page_render_selection(SELF(self), RVAL2CRCONTEXT(cairo), RVAL2POPPLERRECTANGLE(selection), old_selection, RVAL2POPPLERSELECTIONSTYLE(style), RVAL2POPPLERCOLOR(glyph_color), RVAL2POPPLERCOLOR(background_color)); return Qnil; } static VALUE rg_render_selection(VALUE self, VALUE cairo, VALUE selection, VALUE old_selection, VALUE style, VALUE glyph_color, VALUE background_color) { return page_render_selection(self, cairo, selection, old_selection, style, glyph_color, background_color); } static VALUE rg_size(VALUE self) { double width, height; poppler_page_get_size(SELF(self), &width, &height); return rb_ary_new3(2, rb_float_new(width), rb_float_new(height)); } static VALUE rg_index(VALUE self) { return INT2NUM(poppler_page_get_index(SELF(self))); } static VALUE rg_duration(VALUE self) { return rb_float_new(poppler_page_get_duration(SELF(self))); } static VALUE rg_transition(VALUE self) { return POPPLERPAGETRANSITION2RVAL(poppler_page_get_transition(SELF(self))); } static VALUE rg_thumbnail(VALUE self) { return CRSURFACE2RVAL(poppler_page_get_thumbnail(SELF(self))); } static VALUE rg_thumbnail_size(VALUE self) { int width, height; if (poppler_page_get_thumbnail_size(SELF(self), &width, &height)) return rb_ary_new3(2, INT2NUM(width), INT2NUM(height)); else return Qnil; } static VALUE rg_find_text(VALUE self, VALUE text) { return GLIST2ARY2F(poppler_page_find_text(SELF(self), RVAL2CSTR(text)), POPPLER_TYPE_RECTANGLE); } static VALUE rg_get_text(int argc, VALUE *argv, VALUE self) { gchar *text; PopplerSelectionStyle style = POPPLER_SELECTION_GLYPH; VALUE rb_text, arg1, arg2, rb_rect; PopplerPage *page; rb_scan_args(argc, argv, "02", &arg1, &arg2); page = SELF(self); rb_rect = Qnil; if (!NIL_P(arg1)) { if (RTEST(rb_obj_is_kind_of(arg1, cRectangle))) { rb_rect = arg1; } else { rb_raise(rb_eArgError, "wrong first arrument. selection rectangle is expected."); } if (!NIL_P(arg2)) { style = RVAL2POPPLERSELECTIONSTYLE(arg2); } } if (NIL_P(rb_rect)) { #if POPPLER_CHECK_VERSION(0, 15, 0) text = poppler_page_get_text(page); #else PopplerRectangle rect; double width, height; rect.x1 = 0; rect.y1 = 0; poppler_page_get_size(page, &width, &height); rect.x2 = width; rect.y2 = height; text = poppler_page_get_text(page, style, &rect); #endif } else { PopplerRectangle *rect; rect = RVAL2POPPLERRECTANGLE(rb_rect); #if POPPLER_CHECK_VERSION(0, 15, 0) text = poppler_page_get_selected_text(page, style, rect); #else text = poppler_page_get_text(page, style, rect); #endif } rb_text = CSTR2RVAL(text); g_free(text); return rb_text; } #if POPPLER_CHECK_VERSION(0, 16, 0) static VALUE rg_text_layout(VALUE self) { PopplerRectangle *rectangles; guint n_rectangles; if (poppler_page_get_text_layout(SELF(self), &rectangles, &n_rectangles)) { VALUE *rb_list, *p; VALUE ary; guint i; rb_list = p = ALLOC_N(VALUE, n_rectangles); for (i = 0; i < n_rectangles; i++, p++) { *p = POPPLERRECTANGLE2RVAL(&rectangles[i]); } ary = rb_ary_new4(n_rectangles, rb_list); free(rb_list); free(rectangles); return ary; } else { return Qnil; } } #endif static VALUE rg_get_selection_region(VALUE self, VALUE scale, VALUE style, VALUE selection) { return GLIST2ARY2F(poppler_page_get_selection_region(SELF(self), NUM2DBL(scale), RVAL2POPPLERSELECTIONSTYLE(style), RVAL2POPPLERRECTANGLE(selection)), POPPLER_TYPE_RECTANGLE); } static VALUE rg_link_mapping(VALUE self) { return GLIST2ARY2F(poppler_page_get_link_mapping(SELF(self)), POPPLER_TYPE_LINK_MAPPING); } static VALUE rg_image_mapping(VALUE self) { VALUE mappings; GList *image_mapping, *node; mappings = rb_ary_new(); image_mapping = poppler_page_get_image_mapping(SELF(self)); for (node = image_mapping; node; node = g_list_next(node)) { PopplerImageMapping *image_mapping; VALUE mapping; image_mapping = node->data; mapping = POPPLERIMAGEMAPPING2RVAL(image_mapping); rb_iv_set(mapping, "@page", self); } poppler_page_free_image_mapping(image_mapping); return mappings; } static VALUE rg_get_image(VALUE self, VALUE image_id) { return CRSURFACE2RVAL(poppler_page_get_image(SELF(self), NUM2INT(image_id))); } static VALUE rg_form_field_mapping(VALUE self) { return GLIST2ARY2F(poppler_page_get_form_field_mapping(SELF(self)), POPPLER_TYPE_FORM_FIELD_MAPPING); } static VALUE rg_annotation_mapping(VALUE self) { return GLIST2ARY2F(poppler_page_get_annot_mapping(SELF(self)), POPPLER_TYPE_ANNOT_MAPPING); } static VALUE rg_crop_box(VALUE self) { PopplerRectangle rect; poppler_page_get_crop_box(SELF(self), &rect); return POPPLERRECTANGLE2RVAL(&rect); } void Init_poppler_page(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_PAGE, "Page", mPoppler); cRectangle = rb_const_get(mPoppler, rb_intern("Rectangle")); cPSFile = rb_const_get(mPoppler, rb_intern("PSFile")); RG_DEF_METHOD(render, 1); RG_DEF_METHOD(render_for_printing, 1); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(index, 0); RG_DEF_METHOD(duration, 0); RG_DEF_METHOD(transition, 0); RG_DEF_METHOD(thumbnail, 0); RG_DEF_METHOD(thumbnail_size, 0); RG_DEF_METHOD(find_text, 1); RG_DEF_METHOD(get_text, -1); #if POPPLER_CHECK_VERSION(0, 16, 0) RG_DEF_METHOD(text_layout, 0); #endif RG_DEF_METHOD(get_selection_region, 3); RG_DEF_METHOD(link_mapping, 0); RG_DEF_METHOD(image_mapping, 0); RG_DEF_METHOD(get_image, 1); RG_DEF_METHOD(form_field_mapping, 0); RG_DEF_METHOD(annotation_mapping, 0); RG_DEF_METHOD(render_selection, 6); RG_DEF_METHOD(crop_box, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/extconf.rb������������������������������������������������0000644�0001750�0001750�00000004504�12257552170�020552� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������=begin extconf.rb for Ruby/Poppler extention library =end require 'pathname' base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path top_dir = base_dir.parent top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + 'lib' version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib' end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "poppler" package_id = "poppler-glib" begin require 'mkmf-gnome2' rescue LoadError require 'rubygems' gem 'glib2' require 'mkmf-gnome2' end ["glib2", "atk", "pango", "gdk_pixbuf2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end rcairo_options = {} rcairo_source_dir_names = ["rcairo"] if /mingw|cygwin|mswin/ =~ RUBY_PLATFORM rcairo_source_dir_names.unshift("rcairo.win32") end rcairo_source_dir_names.each do |rcairo_source_dir_name| rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name if rcairo_source_dir.exist? rcairo_options[:rcairo_source_dir] = rcairo_source_dir.to_s break end end unless check_cairo(rcairo_options) exit(false) end setup_win32(module_name, base_dir) unless required_pkg_config_package([package_id, 0, 12, 0], :debian => "libpoppler-glib-dev", :redhat => "poppler-glib-devel", # :homebrew => "poppler", # need --with-glib option :macports => "poppler") exit(false) end unless have_macro("POPPLER_MAJOR_VERSION", ["poppler.h"]) make_version_header("POPPLER", package_id, ".") end create_pkg_config_file("Ruby/Poppler", package_id) $defs << " -DRUBY_POPPLER_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-annotation-callout-line.c�����������������������0000644�0001750�0001750�00000011526�12257552170�025470� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2008-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cAnnotation static VALUE rg_initialize(VALUE self, VALUE multiline, VALUE x1, VALUE y1, VALUE x2, VALUE y2, VALUE x3, VALUE y3) { PopplerAnnotCalloutLine *line; line = poppler_annot_callout_line_new(); line->multiline = RVAL2CBOOL(multiline); line->x1 = NUM2DBL(x1); line->y1 = NUM2DBL(y1); line->x2 = NUM2DBL(x2); line->y2 = NUM2DBL(y2); line->x3 = NUM2DBL(x3); line->y3 = NUM2DBL(y3); G_INITIALIZE(self, line); return Qnil; } DEF_ACCESSOR(annot_callout_line, multiline, RVAL2POPPLERANNOTCALLOUTLINE, CBOOL2RVAL, RVAL2CBOOL) DEF_ACCESSOR(annot_callout_line, x1, RVAL2POPPLERANNOTCALLOUTLINE, rb_float_new, NUM2DBL) DEF_ACCESSOR(annot_callout_line, y1, RVAL2POPPLERANNOTCALLOUTLINE, rb_float_new, NUM2DBL) DEF_ACCESSOR(annot_callout_line, x2, RVAL2POPPLERANNOTCALLOUTLINE, rb_float_new, NUM2DBL) DEF_ACCESSOR(annot_callout_line, y2, RVAL2POPPLERANNOTCALLOUTLINE, rb_float_new, NUM2DBL) DEF_ACCESSOR(annot_callout_line, x3, RVAL2POPPLERANNOTCALLOUTLINE, rb_float_new, NUM2DBL) DEF_ACCESSOR(annot_callout_line, y3, RVAL2POPPLERANNOTCALLOUTLINE, rb_float_new, NUM2DBL) static VALUE rg_to_a(VALUE self) { PopplerAnnotCalloutLine *line; line = RVAL2POPPLERANNOTCALLOUTLINE(self); return rb_ary_new3(7, CBOOL2RVAL(line->multiline), rb_float_new(line->x1), rb_float_new(line->y1), rb_float_new(line->x2), rb_float_new(line->y2), rb_float_new(line->x3), rb_float_new(line->y3)); } static VALUE rg_inspect(VALUE self) { VALUE inspected; gchar *info; PopplerAnnotCalloutLine *line; line = RVAL2POPPLERANNOTCALLOUTLINE(self); inspected = rb_call_super(0, NULL); rb_str_resize(inspected, RSTRING_LEN(inspected) - 1); info = g_strdup_printf(": [%s, %g, %g, %g, %g, %g, %g]>", line->multiline ? "true" : "false", line->x1, line->y1, line->x2, line->y2, line->x3, line->y3); rb_str_cat2(inspected, info); g_free(info); return inspected; } void Init_poppler_annotation_callout_line(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_ANNOT_CALLOUT_LINE, "AnnotationCalloutLine", mPoppler); RG_DEF_METHOD(initialize, 7); rbg_define_method(RG_TARGET_NAMESPACE, "multiline?", annot_callout_line_get_multiline, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_multiline", annot_callout_line_set_multiline, 1); rbg_define_method(RG_TARGET_NAMESPACE, "x1", annot_callout_line_get_x1, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_x1", annot_callout_line_set_x1, 1); rbg_define_method(RG_TARGET_NAMESPACE, "y1", annot_callout_line_get_y1, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_y1", annot_callout_line_set_y1, 1); rbg_define_method(RG_TARGET_NAMESPACE, "x2", annot_callout_line_get_x2, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_x2", annot_callout_line_set_x2, 2); rbg_define_method(RG_TARGET_NAMESPACE, "y2", annot_callout_line_get_y2, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_y2", annot_callout_line_set_y2, 2); rbg_define_method(RG_TARGET_NAMESPACE, "x3", annot_callout_line_get_x3, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_x3", annot_callout_line_set_x3, 3); rbg_define_method(RG_TARGET_NAMESPACE, "y3", annot_callout_line_get_y3, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_y3", annot_callout_line_set_y3, 3); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD(inspect, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-rectangle.c�������������������������������������0000644�0001750�0001750�00000006373�12124610262�022666� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006-2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cRectangle static VALUE RG_TARGET_NAMESPACE; static VALUE rg_initialize(VALUE self, VALUE x1, VALUE y1, VALUE x2, VALUE y2) { PopplerRectangle rectangle; rectangle.x1 = NUM2DBL(x1); rectangle.y1 = NUM2DBL(y1); rectangle.x2 = NUM2DBL(x2); rectangle.y2 = NUM2DBL(y2); G_INITIALIZE(self, g_boxed_copy(POPPLER_TYPE_RECTANGLE, &rectangle)); return Qnil; } DEF_ACCESSOR(rectangle, x1, RVAL2POPPLERRECTANGLE, rb_float_new, NUM2DBL) DEF_ACCESSOR(rectangle, y1, RVAL2POPPLERRECTANGLE, rb_float_new, NUM2DBL) DEF_ACCESSOR(rectangle, x2, RVAL2POPPLERRECTANGLE, rb_float_new, NUM2DBL) DEF_ACCESSOR(rectangle, y2, RVAL2POPPLERRECTANGLE, rb_float_new, NUM2DBL) static VALUE rg_to_a(VALUE self) { PopplerRectangle *rectangle = RVAL2POPPLERRECTANGLE(self); return rb_ary_new3(4, rb_float_new(rectangle->x1), rb_float_new(rectangle->y1), rb_float_new(rectangle->x2), rb_float_new(rectangle->y2)); } static VALUE rg_inspect(VALUE self) { VALUE inspected; gchar *points; PopplerRectangle *rectangle; rectangle = RVAL2POPPLERRECTANGLE(self); inspected = rb_call_super(0, NULL); rb_str_resize(inspected, RSTRING_LEN(inspected) - 1); points = g_strdup_printf(": [%g, %g, %g, %g]>", rectangle->x1, rectangle->y1, rectangle->x2, rectangle->y2); rb_str_cat2(inspected, points); g_free(points); return inspected; } void Init_poppler_rectangle(VALUE mPoppler) { RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_RECTANGLE, "Rectangle", mPoppler); RG_DEF_METHOD(initialize, 4); rbg_define_method(RG_TARGET_NAMESPACE, "x1", rectangle_get_x1, 0); rbg_define_method(RG_TARGET_NAMESPACE, "y1", rectangle_get_y1, 0); rbg_define_method(RG_TARGET_NAMESPACE, "x2", rectangle_get_x2, 0); rbg_define_method(RG_TARGET_NAMESPACE, "y2", rectangle_get_y2, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_x1", rectangle_set_x1, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_y1", rectangle_set_y1, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_x2", rectangle_set_x2, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_y2", rectangle_set_y2, 1); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD(inspect, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-fonts-iter.c������������������������������������0000644�0001750�0001750�00000006205�12257552170�023020� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cFontsIter #define CHECK_FITER_IS_VALID(iter) do { \ if (!RVAL2CBOOL(rg_valid_p(iter))) \ return Qnil; \ } while (0) static ID id_valid; static VALUE rg_valid_p(VALUE self) { return rb_ivar_get(self, id_valid); } static VALUE rg_name(VALUE self) { CHECK_FITER_IS_VALID(self); return CSTR2RVAL(poppler_fonts_iter_get_name(RVAL2POPPLERFONTSITER(self))); } static VALUE rg_full_name(VALUE self) { CHECK_FITER_IS_VALID(self); return CSTR2RVAL(poppler_fonts_iter_get_full_name(RVAL2POPPLERFONTSITER(self))); } static VALUE rg_file_name(VALUE self) { CHECK_FITER_IS_VALID(self); return CSTR2RVAL(poppler_fonts_iter_get_file_name(RVAL2POPPLERFONTSITER(self))); } static VALUE rg_font_type(VALUE self) { CHECK_FITER_IS_VALID(self); return POPPLERFONTTYPE2RVAL(poppler_fonts_iter_get_font_type(RVAL2POPPLERFONTSITER(self))); } static VALUE rg_embedded_p(VALUE self) { CHECK_FITER_IS_VALID(self); return CBOOL2RVAL(poppler_fonts_iter_is_embedded(RVAL2POPPLERFONTSITER(self))); } static VALUE rg_subset_p(VALUE self) { CHECK_FITER_IS_VALID(self); return CBOOL2RVAL(poppler_fonts_iter_is_subset(RVAL2POPPLERFONTSITER(self))); } static VALUE rg_next(VALUE self) { if (poppler_fonts_iter_next(RVAL2POPPLERFONTSITER(self))) { return Qtrue; } else { rb_ivar_set(self, id_valid, Qfalse); return Qfalse; } } static VALUE rg_each(VALUE self) { PopplerFontsIter *iter; CHECK_FITER_IS_VALID(self); iter = RVAL2POPPLERFONTSITER(self); do { rb_yield(self); } while (poppler_fonts_iter_next(iter)); rb_ivar_set(self, id_valid, Qfalse); return self; } void Init_poppler_fonts_iter(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE; id_valid = rb_intern("valid?"); RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_FONTS_ITER, "FontsIter", mPoppler); rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(full_name, 0); RG_DEF_METHOD(file_name, 0); RG_DEF_METHOD(font_type, 0); RG_DEF_METHOD_P(embedded, 0); RG_DEF_METHOD_P(subset, 0); RG_DEF_METHOD(next, 0); RG_DEF_METHOD_P(valid, 0); RG_DEF_METHOD(each, 0); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-form-field.c������������������������������������0000664�0001750�0001750�00000006176�11740310343�022751� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cFormField #define _SELF(obj) RVAL2POPPLERFORMFIELD(obj) static VALUE cButtonField, cTextField, cChoiceField; static VALUE cUnknownField, cSignatureField; VALUE rb_poppler_ruby_object_from_form_field(PopplerFormField *field) { VALUE obj; obj = rbgobj_ruby_object_from_instance2(field, FALSE); if (NIL_P(obj)) { switch (poppler_form_field_get_field_type(field)) { case POPPLER_FORM_FIELD_UNKNOWN: obj = rbgobj_create_object(cUnknownField); break; case POPPLER_FORM_FIELD_BUTTON: obj = rbgobj_create_object(cButtonField); break; case POPPLER_FORM_FIELD_TEXT: obj = rbgobj_create_object(cTextField); break; case POPPLER_FORM_FIELD_CHOICE: obj = rbgobj_create_object(cChoiceField); break; case POPPLER_FORM_FIELD_SIGNATURE: obj = rbgobj_create_object(cSignatureField); break; } g_object_ref(field); G_INITIALIZE(obj, (gpointer)field); } return obj; } static VALUE rg_id(VALUE self) { return INT2NUM(poppler_form_field_get_id(_SELF(self))); } static VALUE rg_font_size(VALUE self) { return rb_float_new(poppler_form_field_get_font_size(_SELF(self))); } static VALUE rg_read_only_p(VALUE self) { return CBOOL2RVAL(poppler_form_field_is_read_only(_SELF(self))); } void Init_poppler_form_field(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_FORM_FIELD, "FormField", mPoppler); cUnknownField = rb_define_class_under(mPoppler, "UnknownField", RG_TARGET_NAMESPACE); cSignatureField = rb_define_class_under(mPoppler, "SignatureField", RG_TARGET_NAMESPACE); RG_DEF_METHOD(id, 0); RG_DEF_METHOD(font_size, 0); RG_DEF_METHOD_P(read_only, 0); Init_poppler_button_field(mPoppler, RG_TARGET_NAMESPACE); Init_poppler_text_field(mPoppler, RG_TARGET_NAMESPACE); Init_poppler_choice_field(mPoppler, RG_TARGET_NAMESPACE); cButtonField = rb_const_get(mPoppler, rb_intern("ButtonField")); cTextField = rb_const_get(mPoppler, rb_intern("TextField")); cChoiceField = rb_const_get(mPoppler, rb_intern("ChoiceField")); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-index-iter.c������������������������������������0000644�0001750�0001750�00000006412�12257552170�022776� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cIndexIter static VALUE RG_TARGET_NAMESPACE; static ID id_valid; /* Interface for getting the Index of a poppler_document */ #define CHECK_IITER_IS_VALID(iter) do { \ if (!RVAL2CBOOL(rg_valid_p(iter))) \ return Qnil; \ } while (0) static VALUE rg_valid_p(VALUE self) { return rb_ivar_get(self, id_valid); } static VALUE rg_initialize(VALUE self, VALUE document) { PopplerIndexIter *iter; iter = poppler_index_iter_new(RVAL2POPPLERDOCUMENT(document)); G_INITIALIZE(self, iter); poppler_index_iter_free(iter); rb_ivar_set(self, id_valid, CBOOL2RVAL(iter)); return Qnil; } static VALUE rg_child(VALUE self) { PopplerIndexIter *child; VALUE rb_child; CHECK_IITER_IS_VALID(self); child = poppler_index_iter_get_child(RVAL2POPPLERINDEXITER(self)); rb_child = POPPLERINDEXITER2RVAL(child); rb_ivar_set(rb_child, id_valid, CBOOL2RVAL(child)); poppler_index_iter_free(child); return rb_child; } static VALUE rg_open_p(VALUE self) { CHECK_IITER_IS_VALID(self); return CBOOL2RVAL(poppler_index_iter_is_open(RVAL2POPPLERINDEXITER(self))); } #ifndef HAVE_TYPE_POPPLERACTIONANY static VALUE rg_action(VALUE self) { CHECK_IITER_IS_VALID(self); return POPPLERACTION2RVAL(poppler_index_iter_get_action(RVAL2POPPLERINDEXITER(self))); } #endif static VALUE rg_next(VALUE self) { if (poppler_index_iter_next(RVAL2POPPLERINDEXITER(self))) { return Qtrue; } else { rb_ivar_set(self, id_valid, Qfalse); return Qfalse; } } static VALUE rg_each(VALUE self) { PopplerIndexIter *iter; CHECK_IITER_IS_VALID(self); iter = RVAL2POPPLERINDEXITER(self); do { rb_yield(self); } while (poppler_index_iter_next(iter)); rb_ivar_set(self, id_valid, Qfalse); return self; } void Init_poppler_index_iter(VALUE mPoppler) { id_valid = rb_intern("valid?"); RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_INDEX_ITER, "IndexIter", mPoppler); /* Interface for getting the Index of a poppler_document */ rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable); RG_DEF_METHOD(initialize, 1); RG_DEF_METHOD(child, 0); RG_DEF_METHOD_P(open, 0); #ifndef HAVE_TYPE_POPPLERACTIONANY RG_DEF_METHOD(action, 0); #endif RG_DEF_METHOD(next, 0); RG_DEF_METHOD_P(valid, 0); RG_DEF_METHOD(each, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-action.c����������������������������������������0000644�0001750�0001750�00000033022�12257552170�022200� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" /* PopplerAction */ static VALUE rb_cPopplerAction; static VALUE rb_cPopplerActionDest; static VALUE rb_cPopplerActionAny; static VALUE rb_cPopplerActionUnknown; static VALUE rb_cPopplerActionGotoDest; static VALUE rb_cPopplerActionGotoRemote; static VALUE rb_cPopplerActionLaunch; static VALUE rb_cPopplerActionURI; static VALUE rb_cPopplerActionNamed; static VALUE rb_cPopplerActionMovie; static VALUE rb_cPopplerActionRendition; static VALUE rb_cPopplerActionOCGState; static VALUE rb_cPopplerActionJavaScript; #define DEFINE_ACTION_TYPE(type_lower_case, type_upper_case) \ static GType \ rb_poppler_action_ ## type_lower_case ## _get_type(void) \ { \ static GType type = 0; \ if (type == 0) { \ type = g_boxed_type_register_static("PopplerAction" # type_upper_case, \ (GBoxedCopyFunc)poppler_action_copy, \ (GBoxedFreeFunc)poppler_action_free); \ } \ return type; \ } DEFINE_ACTION_TYPE(any, Any) DEFINE_ACTION_TYPE(unknown, Unknown) DEFINE_ACTION_TYPE(goto_dest, GotoDest) DEFINE_ACTION_TYPE(goto_remote, GotoRemote) DEFINE_ACTION_TYPE(launch, Launch) DEFINE_ACTION_TYPE(uri, URI) DEFINE_ACTION_TYPE(named, Named) DEFINE_ACTION_TYPE(movie, Movie) DEFINE_ACTION_TYPE(rendition, Rendition) DEFINE_ACTION_TYPE(ocg_state, OCGState) DEFINE_ACTION_TYPE(javascript, JavaScript) #define POPPLER_ACTION_TYPE_ANY (rb_poppler_action_any_get_type()) #define POPPLER_ACTION_TYPE_UNKNOWN (rb_poppler_action_unknown_get_type()) #define POPPLER_ACTION_TYPE_GOTO_DEST (rb_poppler_action_goto_dest_get_type()) #define POPPLER_ACTION_TYPE_GOTO_REMOTE (rb_poppler_action_goto_remote_get_type()) #define POPPLER_ACTION_TYPE_LAUNCH (rb_poppler_action_launch_get_type()) #define POPPLER_ACTION_TYPE_URI (rb_poppler_action_uri_get_type()) #define POPPLER_ACTION_TYPE_NAMED (rb_poppler_action_named_get_type()) #define POPPLER_ACTION_TYPE_MOVIE (rb_poppler_action_movie_get_type()) #define POPPLER_ACTION_TYPE_RENDITION (rb_poppler_action_rendition_get_type()) #define POPPLER_ACTION_TYPE_OCG_STATE (rb_poppler_action_ocg_state_get_type()) #define POPPLER_ACTION_TYPE_JAVASCRIPT (rb_poppler_action_javascript_get_type()) static GType rb_poppler_action_type_to_gtype(PopplerActionType action_type) { GType gtype = POPPLER_ACTION_TYPE_ANY; switch (action_type) { case POPPLER_ACTION_NONE: break; case POPPLER_ACTION_UNKNOWN: gtype = POPPLER_ACTION_TYPE_UNKNOWN; break; case POPPLER_ACTION_GOTO_DEST: gtype = POPPLER_ACTION_TYPE_GOTO_DEST; break; case POPPLER_ACTION_GOTO_REMOTE: gtype = POPPLER_ACTION_TYPE_GOTO_REMOTE; break; case POPPLER_ACTION_LAUNCH: gtype = POPPLER_ACTION_TYPE_LAUNCH; break; case POPPLER_ACTION_URI: gtype = POPPLER_ACTION_TYPE_URI; break; case POPPLER_ACTION_NAMED: gtype = POPPLER_ACTION_TYPE_NAMED; break; #if POPPLER_CHECK_VERSION(0, 14, 0) case POPPLER_ACTION_MOVIE: gtype = POPPLER_ACTION_TYPE_MOVIE; break; case POPPLER_ACTION_RENDITION: gtype = POPPLER_ACTION_TYPE_RENDITION; break; case POPPLER_ACTION_OCG_STATE: gtype = POPPLER_ACTION_TYPE_OCG_STATE; break; #endif #if POPPLER_CHECK_VERSION(0, 18, 0) case POPPLER_ACTION_JAVASCRIPT: gtype = POPPLER_ACTION_TYPE_JAVASCRIPT; break; #endif default: break; } return gtype; } static GType rb_poppler_action_to_gtype(VALUE action) { VALUE klass; GType type = POPPLER_ACTION_TYPE_ANY; klass = rb_obj_class(action); if (klass == rb_cPopplerActionAny) { type = POPPLER_ACTION_TYPE_ANY; } else if (klass == rb_cPopplerActionUnknown) { type = POPPLER_ACTION_TYPE_UNKNOWN; } else if (klass == rb_cPopplerActionGotoDest) { type = POPPLER_ACTION_TYPE_GOTO_DEST; } else if (klass == rb_cPopplerActionGotoRemote) { type = POPPLER_ACTION_TYPE_GOTO_REMOTE; } else if (klass == rb_cPopplerActionLaunch) { type = POPPLER_ACTION_TYPE_LAUNCH; } else if (klass == rb_cPopplerActionURI) { type = POPPLER_ACTION_TYPE_URI; } else if (klass == rb_cPopplerActionNamed) { type = POPPLER_ACTION_TYPE_NAMED; #if POPPLER_CHECK_VERSION(0, 14, 0) } else if (klass == rb_cPopplerActionMovie) { type = POPPLER_ACTION_TYPE_MOVIE; } else if (klass == rb_cPopplerActionRendition) { type = POPPLER_ACTION_TYPE_RENDITION; } else if (klass == rb_cPopplerActionOCGState) { type = POPPLER_ACTION_TYPE_OCG_STATE; #endif #if POPPLER_CHECK_VERSION(0, 18, 0) } else if (klass == rb_cPopplerActionJavaScript) { type = POPPLER_ACTION_TYPE_JAVASCRIPT; #endif } else { rb_raise(rb_eArgError, "Not action object: %s", RBG_INSPECT(action)); } return type; } VALUE rb_poppler_ruby_object_from_action(PopplerAction *action) { return BOXED2RVAL(action, rb_poppler_action_type_to_gtype(action->any.type)); } PopplerAction * rb_poppler_action_from_ruby_object(VALUE action) { return RVAL2BOXED(action, rb_poppler_action_to_gtype(action)); } #define ACTION_ATTR_STR(type, name) \ static VALUE \ action_ ## type ## _ ## name (VALUE self) \ { \ return CSTR2RVAL(RVAL2POPPLERACTION(self)->type.name); \ } #define ACTION_ATTR_DEST(type, name) \ static VALUE \ action_ ## type ## _ ## name (VALUE self) \ { \ return POPPLERDEST2RVAL(RVAL2POPPLERACTION(self)->type.name); \ } #define DEFINE_ACCESSOR(prefix, target, name) \ rbg_define_method(target, G_STRINGIFY(name), prefix ## _ ## name, 0); #define DEFINE_ACTION_ACCESSOR(target, type, name) \ DEFINE_ACCESSOR(action_ ## type, target, name) /* PopplerActionAny */ static VALUE action_any_type(VALUE self) { return POPPLERACTIONTYPE2RVAL(RVAL2POPPLERACTION(self)->type); } ACTION_ATTR_STR(any, title); /* PopplerActionGotoDest */ ACTION_ATTR_DEST(goto_dest, dest); /* PopplerActionGotoRemote */ ACTION_ATTR_STR(goto_remote, file_name); ACTION_ATTR_DEST(goto_remote, dest); /* PopplerActionLaunch */ ACTION_ATTR_STR(launch, file_name); ACTION_ATTR_STR(launch, params); /* PopplerActionURI */ ACTION_ATTR_STR(uri, uri); /* PopplerActionNamed */ ACTION_ATTR_STR(named, named_dest); #if POPPLER_CHECK_VERSION(0, 14, 0) /* PopplerActionMovie */ ACTION_ATTR_DEST(movie, movie); /* PopplerActionRendition */ ACTION_ATTR_DEST(rendition, media); /* PopplerActionOCGState */ ACTION_ATTR_DEST(ocg_state, state_list); #endif #if POPPLER_CHECK_VERSION(0, 18, 0) /* PopplerActionJavascript */ ACTION_ATTR_STR(javascript, script); #endif /* PopplerDest */ #ifdef RB_POPPLER_TYPE_DEST_NOT_DEFINED GType poppler_dest_get_type (void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static("PopplerDest", (GBoxedCopyFunc)poppler_dest_copy, (GBoxedFreeFunc)poppler_dest_free); return our_type; } #endif static VALUE dest_get_type(VALUE self) { return POPPLERDESTTYPE2RVAL(RVAL2POPPLERDEST(self)->type); } #define DEST_ATTR_INT(name) \ static VALUE \ dest_ ## name (VALUE self) \ { \ return INT2NUM(RVAL2POPPLERDEST(self)->name); \ } #define DEST_ATTR_UINT(name) \ static VALUE \ dest_ ## name (VALUE self) \ { \ return UINT2NUM(RVAL2POPPLERDEST(self)->name); \ } #define DEST_ATTR_DOUBLE(name) \ static VALUE \ dest_ ## name (VALUE self) \ { \ return rb_float_new(RVAL2POPPLERDEST(self)->name); \ } #define DEST_ATTR_STR(name) \ static VALUE \ dest_ ## name (VALUE self) \ { \ return CSTR2RVAL(RVAL2POPPLERDEST(self)->name); \ } #define DEFINE_DEST_ACCESSOR(target, name) \ DEFINE_ACCESSOR(dest, target, name) DEST_ATTR_INT(page_num) DEST_ATTR_DOUBLE(left) DEST_ATTR_DOUBLE(bottom) DEST_ATTR_DOUBLE(right) DEST_ATTR_DOUBLE(top) DEST_ATTR_DOUBLE(zoom) DEST_ATTR_STR(named_dest) DEST_ATTR_UINT(change_left) DEST_ATTR_UINT(change_top) DEST_ATTR_UINT(change_zoom) void Init_poppler_action(VALUE mPoppler) { rb_cPopplerAction = G_DEF_CLASS(POPPLER_TYPE_ACTION, "Action", mPoppler); rb_cPopplerActionAny = rb_define_class_under(mPoppler, "ActionAny", rb_cPopplerAction); rbg_define_method(rb_cPopplerActionAny, "type", action_any_type, 0); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionAny, any, title); rb_cPopplerActionUnknown = rb_define_class_under(mPoppler, "ActionUnknown", rb_cPopplerAction); rb_cPopplerActionGotoDest = rb_define_class_under(mPoppler, "ActionGotoDest", rb_cPopplerActionAny); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionGotoDest, goto_dest, dest); rb_cPopplerActionGotoRemote = rb_define_class_under(mPoppler, "ActionGotoRemote", rb_cPopplerActionAny); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionGotoRemote, goto_remote, file_name); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionGotoRemote, goto_remote, dest); rb_cPopplerActionLaunch = rb_define_class_under(mPoppler, "ActionLaunch", rb_cPopplerActionAny); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionLaunch, launch, file_name); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionLaunch, launch, params); rb_cPopplerActionURI = rb_define_class_under(mPoppler, "ActionURI", rb_cPopplerActionAny); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionURI, uri, uri); rb_cPopplerActionNamed = rb_define_class_under(mPoppler, "ActionNamed", rb_cPopplerActionAny); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionNamed, named, named_dest); #if POPPLER_CHECK_VERSION(0, 14, 0) rb_cPopplerActionMovie = rb_define_class_under(mPoppler, "ActionMovie", rb_cPopplerActionAny); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionMovie, movie, movie); rb_cPopplerActionRendition = rb_define_class_under(mPoppler, "ActionRendtion", rb_cPopplerActionAny); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionRendition, rendition, media); rb_cPopplerActionOCGState = rb_define_class_under(mPoppler, "ActionOCGState", rb_cPopplerActionAny); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionOCGState, ocg_state, state_list); #endif #if POPPLER_CHECK_VERSION(0, 18, 0) rb_cPopplerActionJavaScript = rb_define_class_under(mPoppler, "ActionJavaScript", rb_cPopplerActionAny); DEFINE_ACTION_ACCESSOR(rb_cPopplerActionJavaScript, javascript, script); #endif G_DEF_CLASS(POPPLER_TYPE_ACTION_TYPE, "ActionType", mPoppler); G_DEF_CLASS(POPPLER_TYPE_DEST_TYPE, "DestType", mPoppler); rb_cPopplerActionDest = G_DEF_CLASS(POPPLER_TYPE_DEST, "Dest", mPoppler); rbg_define_method(rb_cPopplerActionDest, "type", dest_get_type, 0); DEFINE_DEST_ACCESSOR(rb_cPopplerActionDest, page_num); DEFINE_DEST_ACCESSOR(rb_cPopplerActionDest, left); DEFINE_DEST_ACCESSOR(rb_cPopplerActionDest, bottom); DEFINE_DEST_ACCESSOR(rb_cPopplerActionDest, right); DEFINE_DEST_ACCESSOR(rb_cPopplerActionDest, top); DEFINE_DEST_ACCESSOR(rb_cPopplerActionDest, zoom); DEFINE_DEST_ACCESSOR(rb_cPopplerActionDest, named_dest); DEFINE_DEST_ACCESSOR(rb_cPopplerActionDest, change_left); DEFINE_DEST_ACCESSOR(rb_cPopplerActionDest, change_top); DEFINE_DEST_ACCESSOR(rb_cPopplerActionDest, change_zoom); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-form-field-mapping.c����������������������������0000644�0001750�0001750�00000003462�12257552170�024405� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cFormFieldMapping DEF_ACCESSOR_WITH_SETTER(form_field_mapping, area, RVAL2POPPLERFORMFIELDMAPPING, RECT_ENTITY2RVAL, RECT_ENTITY_SET) DEF_ACCESSOR(form_field_mapping, field, RVAL2POPPLERFORMFIELDMAPPING, POPPLERFORMFIELD2RVAL, RVAL2POPPLERFORMFIELD) void Init_poppler_form_field_mapping(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_FORM_FIELD_MAPPING, "FormFieldMapping", mPoppler); rbg_define_method(RG_TARGET_NAMESPACE, "area", form_field_mapping_get_area, 0); rbg_define_method(RG_TARGET_NAMESPACE, "field", form_field_mapping_get_field, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_area", form_field_mapping_set_area, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_field", form_field_mapping_set_field, 1); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-button-field.c����������������������������������0000644�0001750�0001750�00000003273�12257552170�023324� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cButtonField #define _SELF(obj) RVAL2POPPLERFORMFIELD(obj) static VALUE RG_TARGET_NAMESPACE; static VALUE rg_type(VALUE self) { return POPPLERFORMBUTTONTYPE2RVAL(poppler_form_field_button_get_button_type(_SELF(self))); } static VALUE rg_active_p(VALUE self) { return CBOOL2RVAL(poppler_form_field_button_get_state(_SELF(self))); } static VALUE rg_set_active(VALUE self, VALUE state) { poppler_form_field_button_set_state(_SELF(self), RVAL2CBOOL(state)); return Qnil; } void Init_poppler_button_field(VALUE mPoppler, VALUE cFormField) { RG_TARGET_NAMESPACE = rb_define_class_under(mPoppler, "ButtonField", cFormField); RG_DEF_METHOD(type, 0); RG_DEF_METHOD_P(active, 0); RG_DEF_METHOD(set_active, 1); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-annotation-markup.c�����������������������������0000644�0001750�0001750�00000005242�12257552170�024375� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2008-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cAnnotationMarkup #define SELF(self) (RVAL2POPPLERANNOTMARKUP(self)) static ID id_new; static VALUE rb_cDate; static VALUE rg_label(VALUE self) { return CSTR2RVAL_FREE(poppler_annot_markup_get_label(SELF(self))); } static VALUE rg_popup_is_open_p(VALUE self) { return CBOOL2RVAL(poppler_annot_markup_get_popup_is_open(SELF(self))); } static VALUE rg_opacity(VALUE self) { return rb_float_new(poppler_annot_markup_get_opacity(SELF(self))); } static VALUE rg_date(VALUE self) { GDate *date; VALUE rb_date; date = poppler_annot_markup_get_date(SELF(self)); rb_date = rb_funcall(rb_cDate, id_new, 3, UINT2NUM(g_date_get_year(date)), UINT2NUM(g_date_get_month(date)), UINT2NUM(g_date_get_day(date))); g_date_free(date); return rb_date; } static VALUE rg_subject(VALUE self) { return CSTR2RVAL_FREE(poppler_annot_markup_get_subject(SELF(self))); } static VALUE rg_reply_to(VALUE self) { return POPPLERANNOTMARKUPREPLYTYPE2RVAL(poppler_annot_markup_get_reply_to(SELF(self))); } static VALUE rg_external_data(VALUE self) { return POPPLERANNOTEXTERNALDATATYPE2RVAL(poppler_annot_markup_get_external_data(SELF(self))); } void Init_poppler_annotation_markup(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE; id_new = rb_intern("new"); rb_cDate = rb_const_get(rb_cObject, rb_intern("Date")); RG_TARGET_NAMESPACE= G_DEF_CLASS(POPPLER_TYPE_ANNOT_MARKUP, "AnnotationMarkup", mPoppler); RG_DEF_METHOD(label, 0); RG_DEF_METHOD_P(popup_is_open, 0); RG_DEF_METHOD(opacity, 0); RG_DEF_METHOD(date, 0); RG_DEF_METHOD(subject, 0); RG_DEF_METHOD(reply_to, 0); RG_DEF_METHOD(external_data, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-annotation-text.c�������������������������������0000644�0001750�0001750�00000003114�12257552170�024056� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2008-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cAnnotationText #define SELF(self) (RVAL2POPPLERANNOTTEXT(self)) static VALUE rg_open_p(VALUE self) { return CBOOL2RVAL(poppler_annot_text_get_is_open(SELF(self))); } static VALUE rg_icon(VALUE self) { return CSTR2RVAL_FREE(poppler_annot_text_get_icon(SELF(self))); } static VALUE rg_state(VALUE self) { return POPPLERANNOTTEXTSTATE2RVAL(poppler_annot_text_get_state(SELF(self))); } void Init_poppler_annotation_text(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_ANNOT_TEXT, "AnnotationText", mPoppler); RG_DEF_METHOD_P(open, 0); RG_DEF_METHOD(icon, 0); RG_DEF_METHOD(state, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-annotation.c������������������������������������0000644�0001750�0001750�00000003734�11701304107�023070� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cAnnotation #define SELF(self) (RVAL2POPPLERANNOT(self)) static VALUE rg_type(VALUE self) { return POPPLERANNOTTYPE2RVAL(poppler_annot_get_annot_type(SELF(self))); } static VALUE rg_contents(VALUE self) { return CSTR2RVAL_FREE(poppler_annot_get_contents(SELF(self))); } static VALUE rg_name(VALUE self) { return CSTR2RVAL_FREE(poppler_annot_get_name(SELF(self))); } static VALUE rg_modified(VALUE self) { return CSTR2RVAL_FREE(poppler_annot_get_modified(SELF(self))); } static VALUE rg_flags(VALUE self) { return POPPLERANNOTFLAG2RVAL(poppler_annot_get_flags(SELF(self))); } static VALUE rg_color(VALUE self) { return POPPLERCOLOR2RVAL_FREE(poppler_annot_get_color(SELF(self))); } void Init_poppler_annotation(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_ANNOT, "Annotation", mPoppler); RG_DEF_METHOD(type, 0); RG_DEF_METHOD(contents, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(modified, 0); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(color, 0); } ������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-private.h���������������������������������������0000644�0001750�0001750�00000007507�12257552170�022413� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef __RBPOPPLER_PRIVATE_H__ #define __RBPOPPLER_PRIVATE_H__ #include "rbpoppler.h" #define RVAL2GDKPIXBUF(o) (GDK_PIXBUF(RVAL2GOBJ(o))) G_GNUC_INTERNAL void Init_poppler_index_iter(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_font_info(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_document(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_fonts_iter(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_ps_file(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_rectangle(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_page(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_color(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_link_mapping(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_page_transition(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_image_mapping(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_form_field_mapping(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_annotation_mapping(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_attachment(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_action(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_annotation(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_annotation_markup(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_annotation_text(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_annotation_free_text(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_annotation_callout_line(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_form_field(VALUE mPoppler); G_GNUC_INTERNAL void Init_poppler_button_field(VALUE mPoppler, VALUE cFormField); G_GNUC_INTERNAL void Init_poppler_text_field(VALUE mPoppler, VALUE cFormField); G_GNUC_INTERNAL void Init_poppler_choice_field(VALUE mPoppler, VALUE cFormField); G_GNUC_INTERNAL void rectangle_set(PopplerRectangle *rect, VALUE rb_rect); #define RECT_ENTITY2RVAL(rect) POPPLERRECTANGLE2RVAL(&(rect)) #define RECT_ENTITY_SET(rect, rb_rect) rectangle_set(&(rect), rb_rect) #define DEF_READER(prefix, name, member, self_to_c, member_to_rb) \ static VALUE \ prefix ## _get_ ## name(VALUE self) \ { \ return member_to_rb((self_to_c(self))->member); \ } #define DEF_WRITER(prefix, name, member, self_to_c, value_to_c) \ static VALUE \ prefix ## _set_ ## name(VALUE self, VALUE value) \ { \ (self_to_c(self))->member = value_to_c(value); \ return Qnil; \ } #define DEF_WRITER_WITH_SETTER(prefix, name, member, \ self_to_c, value_setter) \ static VALUE \ prefix ## _set_ ## name(VALUE self, VALUE value) \ { \ value_setter((self_to_c(self))->member, value); \ return Qnil; \ } #define DEF_ACCESSOR(prefix, member, self_to_c, member_to_rb, value_to_c) \ DEF_READER(prefix, member, member, self_to_c, member_to_rb) \ DEF_WRITER(prefix, member, member, self_to_c, value_to_c) \ #define DEF_ACCESSOR_WITH_SETTER(prefix, member, self_to_c, \ member_to_rb, value_setter) \ DEF_READER(prefix, member, member, self_to_c, member_to_rb) \ DEF_WRITER_WITH_SETTER(prefix, member, member, self_to_c, value_setter) #define DEF_ACCESSOR_WITH_NAME(prefix, name, member, self_to_c, \ member_to_rb, value_to_c) \ DEF_READER(prefix, name, member, self_to_c, member_to_rb) \ DEF_WRITER(prefix, name, member, self_to_c, value_to_c) #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-image-mapping.c���������������������������������0000644�0001750�0001750�00000003614�12257552170�023442� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cImageMapping DEF_ACCESSOR_WITH_SETTER(image_mapping, area, RVAL2POPPLERIMAGEMAPPING, RECT_ENTITY2RVAL, RECT_ENTITY_SET) DEF_ACCESSOR(image_mapping, image_id, RVAL2POPPLERIMAGEMAPPING, INT2NUM, NUM2INT) static VALUE rg_image(VALUE self) { return rb_funcall(rb_iv_get(self, "@page"), rb_intern("get_image"), 1, INT2NUM(RVAL2POPPLERIMAGEMAPPING(self)->image_id)); } void Init_poppler_image_mapping(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_IMAGE_MAPPING, "ImageMapping", mPoppler); rbg_define_method(RG_TARGET_NAMESPACE, "area", image_mapping_get_area, 0); rbg_define_method(RG_TARGET_NAMESPACE, "image_id", image_mapping_get_image_id, 0); RG_DEF_METHOD(image, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_area", image_mapping_set_area, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_image_id", image_mapping_set_image_id, 1); } ��������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/poppler.def�����������������������������������������������0000644�0001750�0001750�00000000031�11701304107�020673� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXPORTS Init_poppler �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpopplerconversions.h������������������������������������0000644�0001750�0001750�00000020125�12257552170�023223� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __RBPOPPLERCONVERSIONS_H__ #define __RBPOPPLERCONVERSIONS_H__ #define POPPLERANNOT2RVAL(o) (GOBJ2RVAL(o)) #define POPPLERFORMFIELD2RVAL(o) (rb_poppler_ruby_object_from_form_field(o)) #define RVAL2POPPLERACTION(o) (rb_poppler_action_from_ruby_object(o)) #define POPPLERACTION2RVAL(o) (rb_poppler_ruby_object_from_action(o)) #define RVAL2POPPLERCOLOR(o) (rb_poppler_ruby_object_to_color(o)) #define POPPLERCOLOR2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_COLOR)) #define POPPLERCOLOR2RVAL_FREE(o) (rb_poppler_ruby_object_from_color_with_free(o)) #define RVAL2POPPLERANNOT(o) (POPPLER_ANNOT(RVAL2GOBJ(o))) #define RVAL2POPPLERANNOTFREETEXT(o) (POPPLER_ANNOT_FREE_TEXT(RVAL2GOBJ(o))) #define RVAL2POPPLERANNOTMARKUP(o) (POPPLER_ANNOT_MARKUP(RVAL2GOBJ(o))) #define RVAL2POPPLERANNOTTEXT(o) (POPPLER_ANNOT_TEXT(RVAL2GOBJ(o))) #define RVAL2POPPLERATTACHMENT(o) (POPPLER_ATTACHMENT(RVAL2GOBJ(o))) #define RVAL2POPPLERDOCUMENT(o) (POPPLER_DOCUMENT(RVAL2GOBJ(o))) #define RVAL2POPPLERFORMFIELD(o) (POPPLER_FORM_FIELD(RVAL2GOBJ(o))) #define RVAL2POPPLERPAGE(o) (POPPLER_PAGE(RVAL2GOBJ(o))) #define RVAL2POPPLERANNOTCALLOUTLINE(o) ((PopplerAnnotCalloutLine*)RVAL2BOXED(o, POPPLER_TYPE_ANNOT_CALLOUT_LINE)) #define POPPLERANNOTCALLOUTLINE2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_ANNOT_CALLOUT_LINE)) #define RVAL2POPPLERANNOTMAPPING(o) ((PopplerAnnotMapping*)RVAL2BOXED(o, POPPLER_TYPE_ANNOT_MAPPING)) #define POPPLERANNOTMAPPING2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_ANNOT_MAPPING)) #define RVAL2POPPLERDEST(o) ((PopplerDest*)RVAL2BOXED(o, POPPLER_TYPE_DEST)) #define POPPLERDEST2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_DEST)) #define RVAL2FONTINFO(o) ((PopplerFontInfo*)RVAL2BOXED(o, POPPLER_TYPE_FONT_INFO)) #define FONTINFO2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_FONT_INFO)) #define RVAL2POPPLERFONTSITER(o) ((PopplerFontsIter*)RVAL2BOXED(o, POPPLER_TYPE_FONTS_ITER)) #define POPPLERFONTSITER2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_FONTS_ITER)) #define RVAL2POPPLERFORMFIELDMAPPING(o) ((PopplerFormFieldMapping*)RVAL2BOXED(o, POPPLER_TYPE_FORM_FIELD_MAPPING)) #define POPPLERFORMFIELDMAPPING2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_FORM_FIELD_MAPPING)) #define RVAL2POPPLERIMAGEMAPPING(o) ((PopplerImageMapping*)RVAL2BOXED(o, POPPLER_TYPE_IMAGE_MAPPING)) #define POPPLERIMAGEMAPPING2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_IMAGE_MAPPING)) #define RVAL2POPPLERINDEXITER(o) ((PopplerIndexIter*)RVAL2BOXED(o, POPPLER_TYPE_INDEX_ITER)) #define POPPLERINDEXITER2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_INDEX_ITER)) #define RVAL2POPPLERLINKMAPPING(o) ((PopplerLinkMapping*)RVAL2BOXED(o, POPPLER_TYPE_LINK_MAPPING)) #define POPPLERLINKMAPPING2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_LINK_MAPPING)) #define RVAL2POPPLERPAGETRANSITION(o) ((PopplerPageTransition*)RVAL2BOXED(o, POPPLER_TYPE_PAGE_TRANSITION)) #define POPPLERPAGETRANSITION2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_PAGE_TRANSITION)) #define RVAL2POPPLERPSFILE(o) ((PopplerPSFile*)RVAL2BOXED(o, POPPLER_TYPE_PS_FILE)) #define POPPLERPSFILE2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_PS_FILE)) #define RVAL2POPPLERRECTANGLE(o) ((PopplerRectangle*)RVAL2BOXED(o, POPPLER_TYPE_RECTANGLE)) #define POPPLERRECTANGLE2RVAL(o) (BOXED2RVAL(o, POPPLER_TYPE_RECTANGLE)) #define RVAL2POPPLERACTIONTYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_ACTION_TYPE)) #define POPPLERACTIONTYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_ACTION_TYPE)) #define RVAL2POPPLERANNOTEXTERNALDATATYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_ANNOT_EXTERNAL_DATA_TYPE)) #define POPPLERANNOTEXTERNALDATATYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_ANNOT_EXTERNAL_DATA_TYPE)) #define RVAL2POPPLERANNOTFLAG(o) (RVAL2GENUM(o, POPPLER_TYPE_ANNOT_FLAG)) #define POPPLERANNOTFLAG2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_ANNOT_FLAG)) #define RVAL2POPPLERANNOTFREETEXTQUADDING(o) (RVAL2GENUM(o, POPPLER_TYPE_ANNOT_FREE_TEXT_QUADDING)) #define POPPLERANNOTFREETEXTQUADDING2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_ANNOT_FREE_TEXT_QUADDING)) #define RVAL2POPPLERANNOTMARKUPREPLYTYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_ANNOT_MARKUP_REPLY_TYPE)) #define POPPLERANNOTMARKUPREPLYTYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_ANNOT_MARKUP_REPLY_TYPE)) #define RVAL2POPPLERANNOTTEXTICON(o) (RVAL2GENUM(o, POPPLER_TYPE_ANNOT_TEXT_ICON)) #define POPPLERANNOTTEXTICON2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_ANNOT_TEXT_ICON)) #define RVAL2POPPLERANNOTTEXTSTATE(o) (RVAL2GENUM(o, POPPLER_TYPE_ANNOT_TEXT_STATE)) #define POPPLERANNOTTEXTSTATE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_ANNOT_TEXT_STATE)) #define RVAL2POPPLERANNOTTYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_ANNOT_TYPE)) #define POPPLERANNOTTYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_ANNOT_TYPE)) #define RVAL2POPPLERBACKEND(o) (RVAL2GENUM(o, POPPLER_TYPE_BACKEND)) #define POPPLERBACKEND2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_BACKEND)) #define RVAL2POPPLERDESTTYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_DEST_TYPE)) #define POPPLERDESTTYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_DEST_TYPE)) #define RVAL2POPPLERFONTTYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_FONT_TYPE)) #define POPPLERFONTTYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_FONT_TYPE)) #define RVAL2POPPLERFORMBUTTONTYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_FORM_BUTTON_TYPE)) #define POPPLERFORMBUTTONTYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_FORM_BUTTON_TYPE)) #define RVAL2POPPLERFORMCHOICETYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_FORM_CHOICE_TYPE)) #define POPPLERFORMCHOICETYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_FORM_CHOICE_TYPE)) #define RVAL2POPPLERFORMFIELDTYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_FORM_FIELD_TYPE)) #define POPPLERFORMFIELDTYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_FORM_FIELD_TYPE)) #define RVAL2POPPLERFORMTEXTTYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_FORM_TEXT_TYPE)) #define POPPLERFORMTEXTTYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_FORM_TEXT_TYPE)) #define RVAL2POPPLERPAGETRANSITIONALIGNMENT(o) (RVAL2GENUM(o, POPPLER_TYPE_PAGE_TRANSITION_ALIGNMENT)) #define POPPLERPAGETRANSITIONALIGNMENT2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_PAGE_TRANSITION_ALIGNMENT)) #define RVAL2POPPLERPAGETRANSITIONDIRECTION(o) (RVAL2GENUM(o, POPPLER_TYPE_PAGE_TRANSITION_DIRECTION)) #define POPPLERPAGETRANSITIONDIRECTION2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_PAGE_TRANSITION_DIRECTION)) #define RVAL2POPPLERPAGETRANSITIONTYPE(o) (RVAL2GENUM(o, POPPLER_TYPE_PAGE_TRANSITION_TYPE)) #define POPPLERPAGETRANSITIONTYPE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_PAGE_TRANSITION_TYPE)) #define RVAL2POPPLERSELECTIONSTYLE(o) (RVAL2GENUM(o, POPPLER_TYPE_SELECTION_STYLE)) #define POPPLERSELECTIONSTYLE2RVAL(o) (GENUM2RVAL(o, POPPLER_TYPE_SELECTION_STYLE)) #endif /* __RBPOPPLERCONVERSIONS_H__ */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/depend����������������������������������������������������0000644�0001750�0001750�00000000247�12064346475�017746� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-poppler.pc $(pkgconfigdir); \ fi ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-document.c��������������������������������������0000664�0001750�0001750�00000014444�11740310343�022540� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011 Ruby-GNOME2 Project Team * Copyright (C) 2006 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cDocument static ID id_new, id_pdf_data_p, id_ensure_uri; static VALUE cIndexIter; static VALUE cFontInfo; static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { PopplerDocument *document = NULL; GError *error = NULL; VALUE uri_or_data, rb_password; const char *password; rb_scan_args(argc, argv, "11", &uri_or_data, &rb_password); password = RVAL2CSTR_ACCEPT_NIL(rb_password); if (RVAL2CBOOL(rb_funcall(self, id_pdf_data_p, 1, uri_or_data))) { document = poppler_document_new_from_data(RSTRING_PTR(uri_or_data), RSTRING_LEN(uri_or_data), password, &error); } if (!document && !error) { uri_or_data = rb_funcall(self, id_ensure_uri, 1, uri_or_data); document = poppler_document_new_from_file(RVAL2CSTR(uri_or_data), password, &error); } if (error) RAISE_GERROR(error); G_INITIALIZE(self, document); return Qnil; } static VALUE rg_save(VALUE self, VALUE uri) { gboolean result; GError *error = NULL; uri = rb_funcall(self, id_ensure_uri, 1, uri); result = poppler_document_save(RVAL2POPPLERDOCUMENT(self), RVAL2CSTR(uri), &error); if (error) RAISE_GERROR(error); return CBOOL2RVAL(result); } static VALUE rg_save_a_copy(VALUE self, VALUE uri) { gboolean result; GError *error = NULL; uri = rb_funcall(self, id_ensure_uri, 1, uri); result = poppler_document_save_a_copy(RVAL2POPPLERDOCUMENT(self), RVAL2CSTR(uri), &error); if (error) RAISE_GERROR(error); return CBOOL2RVAL(result); } static VALUE rg_n_pages(VALUE self) { return INT2NUM(poppler_document_get_n_pages(RVAL2POPPLERDOCUMENT(self))); } static VALUE rg_get_page(VALUE self, VALUE index_or_label) { VALUE rb_page; PopplerPage *page; if (RVAL2CBOOL(rb_obj_is_kind_of(index_or_label, rb_cInteger))) { page = poppler_document_get_page(RVAL2POPPLERDOCUMENT(self), NUM2INT(index_or_label)); } else if (RVAL2CBOOL(rb_obj_is_kind_of(index_or_label, rb_cString))) { page = poppler_document_get_page_by_label(RVAL2POPPLERDOCUMENT(self), RVAL2CSTR(index_or_label)); } else { VALUE inspect; inspect = rb_inspect(index_or_label); rb_raise(rb_eArgError, "%s must be Integer or String", RVAL2CSTR(inspect)); } rb_page = GOBJ2RVAL(page); if (page) g_object_unref(page); return rb_page; } static VALUE rg_has_attachments_p(VALUE self) { return CBOOL2RVAL(poppler_document_has_attachments(RVAL2POPPLERDOCUMENT(self))); } static VALUE rg_attachments(VALUE self) { return GLIST2ARYF(poppler_document_get_attachments(RVAL2POPPLERDOCUMENT(self))); } static VALUE rg_find_dest(VALUE self, VALUE link_name) { PopplerDest *dest; dest = poppler_document_find_dest(RVAL2POPPLERDOCUMENT(self), RVAL2CSTR(link_name)); return POPPLERDEST2RVAL(dest); } static VALUE rg_get_form_field(VALUE self, VALUE id) { return GOBJ2RVAL(poppler_document_get_form_field(RVAL2POPPLERDOCUMENT(self), NUM2INT(id))); } static VALUE rg_each(VALUE self) { PopplerDocument *document; int i, n_pages; document = RVAL2POPPLERDOCUMENT(self); n_pages = poppler_document_get_n_pages(document); for (i = 0; i < n_pages; i++) { PopplerPage *page; VALUE rb_page; page = poppler_document_get_page(document, i); rb_page = GOBJ2RVAL(page); if (page) g_object_unref(page); rb_yield(rb_page); } return self; } static VALUE rg_index_iter(VALUE self) { return rb_funcall(cIndexIter, id_new, 1, self); } static VALUE rg_font_info(VALUE self) { return rb_funcall(cFontInfo, id_new, 1, self); } void Init_poppler_document(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE; cIndexIter = rb_const_get(mPoppler, rb_intern("IndexIter")); cFontInfo = rb_const_get(mPoppler, rb_intern("FontInfo")); id_new = rb_intern("new"); id_pdf_data_p = rb_intern("pdf_data?"); id_ensure_uri = rb_intern("ensure_uri"); RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_DOCUMENT, "Document", mPoppler); G_DEF_CLASS(POPPLER_TYPE_PAGE_LAYOUT, "PageLayout", mPoppler); G_DEF_CLASS(POPPLER_TYPE_PAGE_MODE, "PageMode", mPoppler); G_DEF_CLASS(POPPLER_TYPE_FONT_TYPE, "FontType", mPoppler); G_DEF_CLASS(POPPLER_TYPE_VIEWER_PREFERENCES, "ViewerPreferences", mPoppler); G_DEF_CLASS(POPPLER_TYPE_PERMISSIONS, "Permissions", mPoppler); rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable); RG_DEF_METHOD(initialize, -1); RG_DEF_METHOD(save, 1); RG_DEF_METHOD(save_a_copy, 1); RG_DEF_METHOD(n_pages, 0); RG_DEF_ALIAS("size", "n_pages"); RG_DEF_METHOD(get_page, 1); RG_DEF_ALIAS("[]", "get_page"); RG_DEF_METHOD_P(has_attachments, 0); RG_DEF_ALIAS("have_attachments?", "has_attachments?"); RG_DEF_METHOD(attachments, 0); RG_DEF_METHOD(find_dest, 1); RG_DEF_ALIAS("get_destination", "find_dest"); RG_DEF_METHOD(get_form_field, 1); RG_DEF_METHOD(each, 0); RG_DEF_ALIAS("pages", "to_a"); RG_DEF_METHOD(index_iter, 0); RG_DEF_METHOD(font_info, 0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-annotation-mapping.c����������������������������0000644�0001750�0001750�00000004541�12257552170�024532� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2006-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE cAnnotationMapping static VALUE rg_initialize(int argc, VALUE *argv, VALUE self) { VALUE area, annotation; PopplerAnnotMapping *mapping; rb_scan_args(argc, argv, "02", &area, &annotation); mapping = poppler_annot_mapping_new(); mapping->area = *RVAL2POPPLERRECTANGLE(area); mapping->annot = RVAL2POPPLERANNOT(annotation); G_INITIALIZE(self, mapping); return Qnil; } DEF_ACCESSOR_WITH_SETTER(annot_mapping, area, RVAL2POPPLERANNOTMAPPING, RECT_ENTITY2RVAL, RECT_ENTITY_SET) DEF_READER(annot_mapping, annotation, annot, RVAL2POPPLERANNOTMAPPING, POPPLERANNOT2RVAL) static VALUE rg_set_annotation(VALUE self, VALUE annotation) { PopplerAnnotMapping *mapping; mapping = RVAL2POPPLERANNOTMAPPING(self); if (mapping->annot) g_object_unref(mapping->annot); mapping->annot = RVAL2POPPLERANNOT(annotation); return Qnil; } void Init_poppler_annotation_mapping(VALUE mPoppler) { VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_ANNOT_MAPPING, "AnnotationMapping", mPoppler); RG_DEF_METHOD(initialize, -1); rbg_define_method(RG_TARGET_NAMESPACE, "area", annot_mapping_get_area, 0); rbg_define_method(RG_TARGET_NAMESPACE, "annotation", annot_mapping_get_annotation, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_area", annot_mapping_set_area, 1); RG_DEF_METHOD(set_annotation, 1); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/ext/poppler/rbpoppler-color.c�����������������������������������������0000644�0001750�0001750�00000006226�12124610262�022035� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2011-2013 Ruby-GNOME2 Project Team * Copyright (C) 2006-2008 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rbpoppler-private.h" #define RG_TARGET_NAMESPACE rb_cPopplerColor #ifdef POPPLER_TYPE_COLOR VALUE RG_TARGET_NAMESPACE; PopplerColor * rb_poppler_ruby_object_to_color(VALUE color) { return RVAL2BOXED(color, POPPLER_TYPE_COLOR); } VALUE rb_poppler_ruby_object_from_color_with_free(PopplerColor *color) { VALUE rb_color; rb_color = POPPLERCOLOR2RVAL(color); g_free(color); return rb_color; } static VALUE rg_initialize(VALUE self, VALUE red, VALUE green, VALUE blue) { PopplerColor color; color.red = NUM2UINT(red); color.green = NUM2UINT(green); color.blue = NUM2UINT(blue); G_INITIALIZE(self, g_boxed_copy(POPPLER_TYPE_COLOR, &color)); return Qnil; } DEF_ACCESSOR(color, red, RVAL2POPPLERCOLOR, UINT2NUM, NUM2UINT) DEF_ACCESSOR(color, green, RVAL2POPPLERCOLOR, UINT2NUM, NUM2UINT) DEF_ACCESSOR(color, blue, RVAL2POPPLERCOLOR, UINT2NUM, NUM2UINT) static VALUE rg_to_a(VALUE self) { PopplerColor *color; color = RVAL2POPPLERCOLOR(self); return rb_ary_new3(3, UINT2NUM(color->red), UINT2NUM(color->green), UINT2NUM(color->blue)); } static VALUE rg_inspect(VALUE self) { VALUE inspected; gchar *rgb; PopplerColor *color; color = RVAL2POPPLERCOLOR(self); inspected = rb_call_super(0, NULL); rb_str_resize(inspected, RSTRING_LEN(inspected) - 1); rgb = g_strdup_printf(": [%u, %u, %u]>", color->red, color->green, color->blue); rb_str_cat2(inspected, rgb); g_free(rgb); return inspected; } #endif void Init_poppler_color(VALUE mPoppler) { #ifdef POPPLER_TYPE_COLOR RG_TARGET_NAMESPACE = G_DEF_CLASS(POPPLER_TYPE_COLOR, "Color", mPoppler); RG_DEF_METHOD(initialize, 3); rbg_define_method(RG_TARGET_NAMESPACE, "red", color_get_red, 0); rbg_define_method(RG_TARGET_NAMESPACE, "green", color_get_green, 0); rbg_define_method(RG_TARGET_NAMESPACE, "blue", color_get_blue, 0); rbg_define_method(RG_TARGET_NAMESPACE, "set_red", color_set_red, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_green", color_set_green, 1); rbg_define_method(RG_TARGET_NAMESPACE, "set_blue", color_set_blue, 1); RG_DEF_METHOD(to_a, 0); RG_DEF_METHOD(inspect, 0); #endif } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/README����������������������������������������������������������������0000644�0001750�0001750�00000001406�12257552170�015154� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ruby/Poppler ============ Ruby/Poppler is a Ruby binding of poppler-glib. Requirements ------------ Ruby: http://www.ruby-lang.org/ poppler-glib [*]: http://poppler.freedesktop.org/ Ruby/GLib2: http://ruby-gnome2.sourceforge.net/ cairo/rcairo: http://cairographics.org/ (optional) [*]: 0.12.0 or later is requried. Install ------- 0. install ruby and poppler-glib. 1. ruby extconf.rb 2. make 3. su 4. make install Copying ------- Copyright (c) 2002-2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. Project Website --------------- http://ruby-gnome2.sourceforge.jp/ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/COPYING.LIB�����������������������������������������������������������0000644�0001750�0001750�00000063642�12257552170�015746� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/lib/������������������������������������������������������������������0000755�0001750�0001750�00000000000�12137115065�015034� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/lib/poppler.rb��������������������������������������������������������0000644�0001750�0001750�00000005150�12137115065�017043� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright(C) 2006-2009 Ruby-GNOME2 Project. # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 2.1 of the License. # # Foobar 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 Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Foobar. If not, see <http://www.gnu.org/licenses/>. require "tempfile" require "date" require "glib2" require "gdk_pixbuf2" begin require "gtk2" rescue LoadError rescue if defined?(Gtk::InitError) and $!.class == Gtk::InitError # ignore else raise end end begin require "cairo" rescue LoadError end base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, micro, = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/poppler.so" rescue LoadError require "poppler.so" end module Poppler LOG_DOMAIN = "Poppler" VERSION = version.split(".").collect {|x| x.to_i} class Document private def pdf_data?(data) /\A%PDF-1\.\d/ =~ data end def ensure_uri(uri) if pdf_data?(uri) @pdf = Tempfile.new("ruby-poppler-pdf") @pdf.binmode @pdf.print(uri) @pdf.close uri = @pdf.path end if GLib.path_is_absolute?(uri) GLib.filename_to_uri(uri) elsif /\A[a-zA-Z][a-zA-Z\d\-+.]*:/.match(uri) uri else GLib.filename_to_uri(File.expand_path(uri)) end end end if defined?(TextField) class TextField def multiline? type == FormTextType::MULTILINE end def file_select? type == FormTextType::FILE_SELECT end def normal? type == FormTextType::NORMAL end end end if defined?(ChoiceField) class ChoiceField def combo? type == FormChioceType::COMBO end def list? type == FormChoiceType::LIST end end end end if Poppler.cairo_available? module Cairo class Context def render_poppler_page(page, *args, &block) page.render(self, *args, &block) end def render_poppler_page_selection(page, *args, &block) page.render_selection(self, *args, &block) end end end end GLib::Log.set_log_domain(Poppler::LOG_DOMAIN) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/sample/���������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552170�015554� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/sample/pdf2svg.rb�����������������������������������������������������0000755�0001750�0001750�00000000745�11701304107�017451� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require "poppler" if ARGV.size < 1 puts "usage: #{$0} input.pdf" exit(-1) end input, = ARGV output = input.sub(/\..+$/, ".svg") output = "#{output}.svg" if input == output doc = Poppler::Document.new(input) width, height = doc.pages[0].size Cairo::SVGSurface.new(output, width, height) do |surface| surface.restrict_to_version("1_2") context = Cairo::Context.new(surface) doc.each do |page| page.render(context) context.show_page end end ���������������������������ruby-gnome2-all-2.1.0/poppler/sample/pdf2text.rb����������������������������������������������������0000755�0001750�0001750�00000000400�11701304107�017622� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require "poppler" if ARGV.size < 1 puts "usage: #{$0} input.pdf" exit(-1) end input = ARGV.shift input_uri = "file://#{File.expand_path(input)}" doc = Poppler::Document.new(input_uri) doc.each do |page| puts page.get_text end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/sample/pdf2.rb��������������������������������������������������������0000755�0001750�0001750�00000006561�12257552170�016747� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require "tempfile" require "optparse" require "poppler" require "gdk_pixbuf2" page = 0 scale = 1.0 rotate = 0 parser = OptionParser.new parser.banner = <<-BANNER Usage: #{parser.program_name} INPUT.PDF OUTPUT [options] #{parser.program_name} coverts the target page in INPUT.PDF to an image file. Many popular image formats such as PNG and JPEG are supported. You can specify output image format by OUTPUT file extension. For example, the following comand generates PNG file: % #{$0} INPUT.PDF OUTPUT.png BANNER parser.on("--page=PAGE", Integer, "Use PAGE as the target page", "(0-origin)", "[#{page}]") do |value| page = value.to_i end parser.on("--scale=RATIO", Float, "Scale the target page in INPUT.PDF RATIO times larger in OUTPUT", "[#{scale}]") do |value| scale = value.to_f end parser.on("--rotate=DEGREE", Integer, "Rotate the target page in INPUT.PDF DEGREE degrees clockwise in OUTPUT", "(available values: 0...360)", "[#{rotate}]") do |value| rotate = value.to_i % 360 end rest_args = parser.parse! if rest_args.size != 2 puts(parser.help) exit(false) end input, output = rest_args ext_name = File.extname(output)[1..-1] if ext_name output_type = ext_name.downcase output_type = "jpeg" if /jpg/ =~ output_type else output_type = "png" end def compute_size(width, height, rotate) width = width.to_f height = height.to_f radius = 0 unless rotate.zero? radius = rotate / 180.0 * Math::PI if (90 < rotate and rotate < 180) or (270 < rotate and rotate < 360) radius -= Math::PI / 2 end end inner_angle1 = Math.atan(width / height) inner_angle2 = Math.atan(height / width) diagonal = Math.sqrt(width ** 2 + height ** 2) angle1 = radius + inner_angle1 angle2 = radius + inner_angle2 bottom1 = diagonal * Math.cos(angle1) length1 = (bottom1 * Math.tan(angle1)).abs.to_i bottom2 = diagonal * Math.cos(angle2) length2 = (bottom2 * Math.tan(angle2)).abs.to_i if (0 <= rotate and rotate <= 90) or (180 <= rotate and rotate <= 270) [length1, length2] else [length2, length1] end end def to_pixbuf_with_cairo(input, page_number, scale, rotate) doc = Poppler::Document.new(input) page = doc[page_number] width, height = page.size.collect {|x| x * scale} surface_width, surface_height = compute_size(width, height, rotate) surface = Cairo::ImageSurface.new(Cairo::FORMAT_ARGB32, surface_width, surface_height) cr = Cairo::Context.new(surface) half_width = surface_width / 2.0 half_height = surface_height / 2.0 cr.translate(half_width, half_height) cr.rotate(rotate / 180.0 * Math::PI) cr.translate(-half_width, -half_height) cr.translate((surface_width - width) / 2.0, (surface_height - height) / 2.0) cr.set_source_rgb(1, 1, 1) cr.rectangle(0, 0, width, height) cr.fill cr.scale(scale, scale) cr.render_poppler_page(page) temp = Tempfile.new("pdf2") cr.target.write_to_png(temp.path) cr.target.finish Gdk::Pixbuf.new(temp.path) end unless Poppler.cairo_available? puts "cairo isn't available." exit(false) end pixbuf = to_pixbuf_with_cairo(input, page, scale, rotate) if pixbuf.nil? puts "Is it a PDF file?: #{input}" exit(-1) end puts "saving to #{output}(#{pixbuf.width}x#{pixbuf.height})..." pixbuf.save(output, output_type) �����������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/sample/pdfcrop.rb�����������������������������������������������������0000755�0001750�0001750�00000001325�11701304107�017526� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require "poppler" if ARGV.size != 2 puts "usage: #{$0} input.pdf output.pdf" exit(-1) end input, output = ARGV doc = Poppler::Document.new(input) width, height = doc.pages[0].size x_margin = width * 0.1 y_margin = height * 0.1 croped_width = width - (2 * x_margin) croped_height = height - (2 * y_margin) Cairo::PDFSurface.new(output, croped_width, croped_height) do |surface| context = Cairo::Context.new(surface) doc.each do |page| width, height = page.size context.save do context.translate(-x_margin, -y_margin) context.rectangle(x_margin, y_margin, croped_width, croped_height) context.clip page.render(context) context.show_page end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/sample/number-pdf.rb��������������������������������������������������0000755�0001750�0001750�00000001563�11701304107�020134� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'poppler' input = ARGV.first output = input.sub(/\.pdf$/, "-numbered.pdf") doc = Poppler::Document.new(input) first_page = doc[0] Cairo::PDFSurface.new(output, *first_page.size) do |surface| context = Cairo::Context.new(surface) doc.each_with_index do |page, i| width, height = page.size surface.set_size(width, height) context.save do context.render_poppler_page(page) end context.save do layout = context.create_pango_layout layout.text = i.to_s layout.width = width * Pango::SCALE layout.alignment = Pango::Layout::ALIGN_CENTER layout.font_description = Pango::FontDescription.new("Sans 288") context.move_to(0, (height - layout.pixel_size[1]) / 2.0) context.set_source_rgba(0.1, 0.1, 0.1, 0.5) context.show_pango_layout(layout) end context.show_page end end ���������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/sample/pdfdiv.rb������������������������������������������������������0000755�0001750�0001750�00000001352�11701304107�017345� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require "poppler" if ARGV.size != 2 puts "usage: #{$0} input.pdf output.pdf" exit(-1) end input, output = ARGV doc = Poppler::Document.new(input) width, height = doc.pages[0].size Cairo::PDFSurface.new(output, width / 2, height) do |surface| context = Cairo::Context.new(surface) doc.each do |page| width, height = page.size half_width = width / 2 context.save do context.rectangle(0, 0, half_width, height) context.clip page.render(context) context.show_page end context.save do context.translate(-half_width, 0) context.rectangle(half_width, 0, half_width, height) context.clip page.render(context) context.show_page end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/extconf.rb������������������������������������������������������������0000644�0001750�0001750�00000002226�11701304107�016254� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby require 'pathname' require 'mkmf' require 'rbconfig' require 'fileutils' package = "poppler" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false) create_makefile(package) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/Rakefile��������������������������������������������������������������0000644�0001750�0001750�00000004564�12257552170�015751� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- # # Copyright (C) 2010-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $LOAD_PATH.unshift("./../glib2/lib") require 'gnome2-raketask' package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/Poppler is a Ruby binding of poppler-glib." package.description = "Ruby/Poppler is a Ruby binding of poppler-glib." package.dependency.gem.runtime = [["cairo", ">= 1.12.8"], "gdk_pixbuf2"] package.win32.packages = [] package.win32.dependencies = [] package.windows.build_dependencies = [ "glib2", "gobject-introspection", "pango", "gdk_pixbuf2", ] package.windows.gobject_introspection_dependencies = [ "gdk_pixbuf2", ] package.external_packages = [ { :name => "libjpeg", :base_name => "jpeg-9", :archive_base_name => "jpegsrc.v9.tar.gz", :download_base_url => "http://www.ijg.org/files", :label => "libjpeg", :windows => { :configure_args => [], :built_file => "bin/libjpeg-9.dll", }, }, { :name => "sqlite-autoconf", :download_base_url => "http://www.sqlite.org/2013", :label => "SQLite", :version => "3080200", :compression_method => "gz", :windows => { :configure_args => [], :built_file => "bin/libsqlite3-0.dll", }, }, { :name => "poppler", :download_base_url => "http://poppler.freedesktop.org", :label => "Poppler", :version => "0.24.4", :compression_method => "xz", :windows => { :configure_args => [ "--enable-introspection", ], :built_file => "bin/libpoppler-glib-8.dll", }, }, ] end package_task.define ��������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/test/�����������������������������������������������������������������0000755�0001750�0001750�00000000000�12257552170�015252� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/test/test_document.rb�������������������������������������������������0000644�0001750�0001750�00000002336�11701304107�020444� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestDocument < Test::Unit::TestCase def test_save saved_pdf = File.join(tmp_dir, "saved.pdf") FileUtils.rm_f(saved_pdf) document = Poppler::Document.new(form_pdf) find_first_text_field(document).text = "XXX" assert(document.save(saved_pdf)) assert(File.exist?(saved_pdf)) only_poppler_version(0, 8, 2) reread_document = Poppler::Document.new(saved_pdf) assert_equal("XXX", find_first_text_field(reread_document).text) end def test_save_a_copy only_poppler_version(0, 7, 2) copied_pdf = File.join(tmp_dir, "copied.pdf") FileUtils.rm_f(copied_pdf) document = Poppler::Document.new(form_pdf) first_text_field = find_first_text_field(document) default_text = first_text_field.text first_text_field.text = "XXX" assert(document.save_a_copy(copied_pdf)) assert(File.exist?(copied_pdf)) reread_document = Poppler::Document.new(copied_pdf) assert_equal(default_text, find_first_text_field(reread_document).text) end private def find_first_text_field(document) document.each do |page| page.form_field_mapping.each do |mapping| field = mapping.field return field if field.is_a?(Poppler::TextField) end end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/test/poppler-test-utils.rb��������������������������������������������0000644�0001750�0001750�00000002303�12126557022�021365� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������require 'open-uri' require 'fileutils' module PopplerTestUtils def ensure_dir(dir) FileUtils.mkdir_p(dir) dir end def test_dir File.expand_path(File.dirname(__FILE__)) end def fixtures_dir ensure_dir(File.join(test_dir, "fixtures")) end def tmp_dir ensure_dir(File.join(test_dir, "tmp")) end def form_pdf file = File.join(fixtures_dir, "form.pdf") return file if File.exist?(file) pdf = open("http://www.irs.gov/pub/irs-pdf/fw9.pdf").read File.open(file, "wb") do |output| output.print(pdf) end file end def image_pdf File.join(fixtures_dir, "image.pdf") end def image_png File.join(fixtures_dir, "image.png") end def later_version?(major, minor, micro=nil) micro ||= 0 (Poppler::BUILD_VERSION <=> [major, minor, micro]) >= 0 end def only_poppler_version(major, minor, micro=nil) micro ||= 0 unless later_version?(major, minor, micro) omit("Require Poppler >= #{major}.#{minor}.#{micro}") end end def only_old_poppler_version(major, minor, micro=nil) micro ||= 0 if later_version?(major, minor, micro) omit("Require Poppler < #{major}.#{minor}.#{micro}") end end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/test/test_page.rb�����������������������������������������������������0000644�0001750�0001750�00000003443�12257552170�017556� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestPage < Test::Unit::TestCase def test_get_image omit("We don't have PDF that has image...") document = Poppler::Document.new(image_pdf) page, mapping = find_first_image_mapping(document) assert_kind_of(Cairo::ImageSurface, page.get_image(mapping.image_id)) assert_kind_of(Cairo::ImageSurface, mapping.image) end def test_selection_region document = Poppler::Document.new(form_pdf) page = document[0] rectangle = Poppler::Rectangle.new(0, 0, *page.size) region = page.get_selection_region(0.5, :word, rectangle) if later_version?(0, 7, 2) assert_kind_of(Poppler::Rectangle, region[0]) else assert_kind_of(Gdk::Region, region) end end def test_annotation_mapping only_poppler_version(0, 7, 2) document = Poppler::Document.new(form_pdf) page = document[0] assert_equal([Poppler::AnnotationMapping], page.annotation_mapping.collect {|mapping| mapping.class}.uniq) mapping = page.annotation_mapping[0] assert_kind_of(Poppler::Rectangle, mapping.area) assert_kind_of(Poppler::Annotation, mapping.annotation) end def test_render only_poppler_version(0, 20, 0) document = Poppler::Document.new(image_pdf) page = document[0] png = StringIO.new png.set_encoding("ASCII-8BIT") Cairo::ImageSurface.new(:argb32, *page.size) do |surface| Cairo::Context.new(surface) do |context| page.render(context) end surface.write_to_png(png) end File.open(image_png, "rb") do |image| # TODO: support image diff assert_equal(image.read, png.string) end end private def find_first_image_mapping(document) document.each do |page| page.image_mapping.each do |mapping| return [page, mapping] end end nil end end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/test/run-test.rb������������������������������������������������������0000755�0001750�0001750�00000001756�12257552170�017374� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby base_dir = File.expand_path(File.join(File.dirname(__FILE__), "..")) have_make = system("which make > /dev/null") glib_dir = File.expand_path(File.join(base_dir, "..", "glib2")) gdk_pixbuf_dir = File.expand_path(File.join(base_dir, "..", "gdk_pixbuf2")) pango_dir = File.join(File.join(base_dir, ".." , "pango")) gtk_dir = File.expand_path(File.join(base_dir, "..", "gtk2")) $LOAD_PATH.unshift(File.join(glib_dir, "test")) require 'glib-test-init' [[gtk_dir, "gtk2"], [gdk_pixbuf_dir, "gdk_pixbuf2"], [pango_dir, "pango"], [glib_dir, "glib2"], [base_dir, "poppler"]].each do |dir, module_name| if have_make system("cd #{dir.dump} && make > /dev/null") or exit(false) end $LOAD_PATH.unshift(File.join(dir, "ext", module_name)) $LOAD_PATH.unshift(File.join(dir, "lib")) end require "poppler" $LOAD_PATH.unshift(File.join(base_dir, "test")) require 'poppler-test-utils' class Test::Unit::TestCase include PopplerTestUtils end exit Test::Unit::AutoRunner.run(true) ������������������ruby-gnome2-all-2.1.0/poppler/test/fixtures/��������������������������������������������������������0000755�0001750�0001750�00000000000�12257552170�017123� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/test/fixtures/image.pdf�����������������������������������������������0000644�0001750�0001750�00000022223�11701304107�020665� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������%PDF-1.4 %µí®û 2 0 obj << /Length 3 0 R /Filter /FlateDecode /Type /XObject /Subtype /Form /BBox [ 0 0 300 300 ] >> stream xœ���� endstream endobj 3 0 obj 10 endobj 4 0 obj << /Length 5 0 R /Type /XObject /Subtype /Image /Width 80 /Height 80 /ColorSpace /DeviceGray /BitsPerComponent 8 /Filter /FlateDecode >> stream xœÝ˜LÔeÇ¿ß;î¸ãç ..„âÀ;Àp10V¡-±”('4s9[Áµ$éÊ5œÍÌ-¶V,HC I+A3¹tX ÙPY0@Y à�ïŒDî×·ïóýy÷ýõ<—ýÕûîy>ŸçÅóûù|¾öÿ•6>÷ÅšÚÊÜhÕA‹ÜÖá$(ÝØ§¾oš¶´w™`å>Rcµ!)-)6°Æxd‘3'ÜšºK.Ây!›¯Ié$‚õ&: ßtÃGµ™²²U÷ú¼OÐy9cl£8]cèò pD+:ïK®ÑùHªBó®F#ã²\£+‰TÍsËb^2De-*2Ó£«psFRA…þG1ÎS¨ˆÓìüÝçÉ@Õ|«ËcÁ¼˜7–¬È{c 8 ƒî„5ñ­ºµÀX'\[RÇHúMÊÉ_x|«&Êú³·œ¡Ø½Úí,yÎñ÷øf»©¹Xá|Ÿ+â°óŒßx<YØÃ­Ç30¦Š»7’¦Ì»ÅøMg‘…Lnú¿‹�ÆαY‡¹ÇÛ`¨ÙÞz«© T,ÄyÂ.—Kì�7‚R³ž%PƧ„“w:‚ÃŽ2®®bP2õQ÷Û´1GлYœiCñ£QàGsïþ½‰îÑ,(ØM´WdÐúzO$Èá2ínb®´Ò3[l.2¨‹¯­Üë_Ïú·»ÇâäpúAÊ㜎ü½›ž²©tÆ]øŒ†s,_âpeò“¶Àòw݇~­”£®Þ/²ä¶°Æ«La>ØtþÃÒ®–3ä÷ßùi«Ò>‰b_„?!KxÉ A\Ë”ñ¶}öHžò®3œcxþrPÄ×Ú¦árÎxx8ì of'ù¨@oJ6¯µX,iÉÆ(¤pà–×-úW*>üª÷ÊèäìÜÜìÌèÅ®úíkà<Us®kµÙUgøýÁiµs 4"ȧ}‡¸»7íê™ñˆi@ &pçåÙÁ,ƒ*áµ~Ñ;ËËÛn„ðÔeà¢r¿B—"ª¦äa@¾OaT瞺>¾Ÿz´ÕÿpOG+fÓZÓÃÀߨw¦a4R6(Qb; ‚ãÒõ} ë ŽHž=‚†#ì±p†e £Ñâ¤NÃR~EÅÁ‚*Jšã^Tœë!8~ço@è^Ü�òh‡ Q¥ Ä¥%Ÿ÷§p1ݨ¸¥=(‹›w·X‰”b½Šˆ›*C;jÇ‘hþ«…ˆ  çù6†aWp»ÂPqü¬9[ÓCHvaÛÅó‹b!R“2n²Z ê•hóõ–P?l”Hõ­ö<)¾)*Eö.uìCºÜR”¦ùûwßD¶JÞ¦Þ.s “Ö˜j]—‘d@àG¤xÝ7q¢­õâ-Çò¨½Rå©Þ’èàúàyßÜ-ðÎ8.^Y¨ªj‚↻¥ðÛV…¼ùuœ1Ólª…óâ{…¼?ùèew°éu8+V.þ¥¨ ~^¼å¼˜Sž¿+Š1áï f¢�‡%‰bµ:ælèO×Ac^J%NÏÓLo@«ÀP/›¡I³_$x†Ë5xRsp­+ G&T'„#&|ƒÍŸ bý6hfÎJ׊M#d5¬âÚeò^Žè82ùo„�=‡ÐŸ9 ðZÅ„Á{(ÔûUSú›<ι~W …g}-óœøÆÊB,#ÕöËR8w#J()ÙEÃK„{{¡ã ”ÐONñÏ6^wqŸ—n¶åÇÜÒ[ö¶ N.¬Nô}Tb†Ù�ÞÉcš endstream endobj 5 0 obj 1340 endobj 6 0 obj << /Length 7 0 R /Type /XObject /Subtype /Image /Width 80 /Height 80 /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /FlateDecode /SMask 4 0 R >> stream xœíœw\SWÇo ì!B€ŠBŪˆ¢BWѶR±ê‹£¯Z¨úª]H 6ÈF,"ŠPQ´Z\Q´´ ÙìMXò>÷„Ä0_Û2úÇû|~?!¹÷ä~ï9çyžsÏ1ìÿöûgY‰ôÓ–-÷IßfÚŸ°Ö*ÞÂ"ÅÎ.ÛÉ)ÕÖ¶Dšì«K{kibh@‘•%aˆª¤ä"&Æ{í©¢±xq__ßä^ä˜X_^^ô²e´©jn¡óçg9R|õj}aasUUcYyÍóçH¤P}}QÑCÃôÇ'ûzû­NOÙ½ÛG[ÛWG'ÄØø¦£ãûœ•æèjdD–”ôQS»wêTCþ«žææÞ–Ö\-¸š[º›šÙQúúdiéØ5ã ò>ö:22POÏOW—"#CÂ0wy¹@}½4{ûÑϺ¼Õ&@~Ñ¢ :[\Œ«¨¨_……ý*(�x{Ñm×M�Î(s F£§’’§²ò%;»;?þxÇÙ9yÓ&š²2UQ1ùóÏG:1m×._--7"ñÆêÕ ­¿þÚ¯û÷ûuïO-¿üª¿~„a&&7Œ%ÚÚz*+ùhhüßQ^ÞÅdrKKÛ~û-ßßß…HŒþè£aL6éë@}}7BªA]||SJ ®Ÿ~ê×åËÌS}|< ÂgÍšpÄ4{&ERò¥»;tAó­[Í©©ÉÉÕQQîrrìÌÌA§ô1a I– "RþÅõaa¸BCûÒ¯³gß)8¸òÄ 8%ÂìÃI€äÛ=—ï]ÅÅé‹Õ×úùUS©Ìƒ‹æÍ{%+ûRL,\NÎSE9?>lÐYq«V¥$áÝ|Α#µ$®䩿‡8‡WÙÙU¬^]±bEÕ¶m5'OÖ|÷Ýs†%m°?ñ6lð×Ñ%nÞ<tdž52€ ò`ýzÖL‡²¥Kÿ’z î Ã^A_^j*\]…O¿DÓР`Ø +ÑÖæìßÏ9x×þý,{ûJ+«R}ýbyù"QÑB Á‹²yóØi3gBH_1N° ǰØåËÁ ¹Eá‹<””ÒîF†×ÞÚÚT ‰\“ò%KJ¦O/"û/à 0,òeå¼èháfúì3²´T<†¯¢"ËÆ†µys•…E¹ž^‰œ\1zÿÍ@•HJ¾Y¼8LJЦ®~yÝxùçs À…Áý|L¥þòÍ7^òòTE…8‹wá/;;û¬Ál ×#.Ž__¥Ù Ãܤ¥!n6xöl2p_p$‘X***|â°z¹ø }½¾>úxÀf9‘4ÌÀ ñŋβ²¶ßæâC7nå�Þà9s�ê9†•aX¹*0ì ;ƒaþººƒZ>khà‡F{ù{«M 7I‰ûTWl|,lÁ|Š”0¶ää4ݸQÍòó ÒÓóÖ˜*Òð‚ª¤3ñ)†UaSH, »‹òÞK›6 7 žr¤tC*‡SÕÁ›YC|Å8Á‚…Ï ÒÒb×EF–mßþRJꥄD„žâVfe  60p%ïaÃ8|U#Þó™ôÊ•ÂÍ–ffÂMø ðž‚É@Å0ð×î?^ššÚ9==ö·ß–YZ¾…F`, ÈÈ<öð–C¡¸Â ǰZ «ã«@ øàÆÀEßÿ,tsFW)Œ4è\i©$këñƒÅW˜´t±†F!ßå‚.£÷¯íÛ'8 †´ŸŽ6 ÏF¾š .c˜‹ˆH˜±ñ v÷»S$ôiÍ{Ú¼„Ú _hœ0®¼ÁsÀ«ät¹iø­–¾¼}›ð‘ç>4q%ncX3†µ`X+êâP|0˼ˆ Ôì#/wà½#4xãa¨ª¬«ˆˆŸî´4Ò{-µþŽ…Î5Gôp 3qH–’º`e%|äÃÓ§½ÕT)(àv`îA"#—,Úl^l,ðf`XƒÐx*ɉ�+*ê««Ãd0Æ *uß>ðAçLL²N´Ä kaMš„‘@¨é[lµ“`½Š"-£:à Wvƒ4CM-ëèÑ¡ßÈÎ|w,A5 "ä(\EñžÍ<v`¬`3ÿíË1W11˜ S¦À"ý!™,ø´"‡î¥¦JEᯖ¯44Jo:~Â�+ý8+K<Å31OUÕk{÷Žô½!s }Ðìh"€Í/s–H ™?7ÃÉi¬`+rrhêjžŠŠ™2¼¼®lßkUð<Ñ»w މ1_êB \Gc¯ )ù«çAAöY“šzçûS‡ö÷:cV˜ÃFN†µ \¥(òòIë×)Ï®îúÜMJêÞÃåör¹Üªª?þxFDäüºwn?óÀ-MäµÚ/ŒXªâ”>zÞ(-ÿOËŽ&ùO×uEÓœ…üÒ+‘½sЛ‘¼mÛØ>ŠìËΦMU;gjÚ˜ŸÏ}SÒž›Û|ûvÑñãî@¤®šG— ^´]×à‡Ö2`N‘Ë–þý HÝkO›:–!Pî=?ÞÒ²¯°ðï·?È€ÈwšÖ…•+ë¯]«Žf:Tjm''cIQñüòå‚#!z&X¯†5; %‡ð)Üü1¹†×‘‘‘f¦"†èëß<|°0=}LZj¹Ñ¾~º:1sç–ÙÛ(*þ!*Z€Ò p¿0aa~  È);v$­_µxQ–“Ó>†¦Ò÷ƒt¸“4Í©^²²Ï ƒâ-0‘Ã|†BIìò¿¾ „’ììG £Ë;w&®]fjabÂS”ù"x2L`üä<Å~; Ã’Ñ:®‚¿0ÐSØ[Sý϶7ð±¿wÒÆ^**^ꪰôÓÕ…`G›ªî©Œ?·Q•”àSxÓÿ]m-ŠYå©©ã�7ŒÁíõÑР°_øK›j”²‚kr%мO yyôÛÎÎA³ôCŒ Á§‘ÀÁª«G˜™%ÚØ\±·‡Qú …ò$$äé¹s¹QQÏãârcb~õòÊpv¾òÅ®ó+Vx))Á)ýƒfÏ75~“W`©{wy(LñFy`=?ÁóGùù(ƒ >Ê:}:fÉ/UeˆÅ~::±kÖÜ:uª8-­®  •Íæ66ött¼íîõ‚ººz;;{¹½ÜÞŽŽžöö¶ŠŠê§Ï^…‡Ó׬ñQUu“”ôŸ1#ë辑¾t¬ ÒHHѳ ECHƒý?ø`XÞ¾>DäXèXÃYzzwOž¬zø°»¥"80ö´µ÷´¶õ´¢­´ hÝÝ ÝõõÝuuݵµ] šš®êê.§ nNY éK66nâ⾚š m\yñ­¥Ka4‚›ŠG× ‘»`µjè‘ RXŒù˜Œp@¬…E^\\Ge•H]wM ®êênÒÅbáb2»ªª:++;+*p•—w–•u––v–”€¸oÞðvOÚ_¿¾¹oEZú¬‘Ѹò‚ÑéôäO?…èOUVöRU9;gNæ±cï ý¢­¦&FΟÿ[@@KAÁ; ¤¬Œ[ZÊéß*(èøã\¯_w¼zÕ‘Ÿß‘—×þò%®ßoÿí·ö/š?¾bgç"&–ë;x 9âçãG²N9ggg ¿ÓÑ1|áBÈ7¼³ëîÝliuââ±�biÏÏoç±�Ÿ¥ýùó6PnnÛ³gmOŸ¶1mOžàzü¸õÑ£Ö‡q=xP ‹¯èåc¿ý5˰w 6˜M°(#£¢ÈÈöÒzñb0bi˃­99­¿þÚrÿ>.þæWËÝ»-wî´dg·Ü¾ÝrëVsV3))@W×]^~R6µÚ±Å[CÝ•HL_¿¾.3SÐ#mµ y·—Ç£Ò’•j¾y³ù矛33qed4߸ќžÞ|ýzóµkM ´´¦«WÙ±±ázz0q†î7«ÁíMÛ³ÇCA*/ÛÁ¡!#£¿Sx ;°�Ÿ¥éúõ~ÄÒ”šŠëÊÞ&`ãåËÉÉ—.á¢Ó/^±ÃÂÎMŸŽ6x¿i\-ÕÞžª0Å]Rò‘“S\?Ÿ¥éÆ \ò\¹Ò˜’‚KÀÂÃA, II¸.\h8W||C\\CllCL –-ežž¾ŠŠpŸG_>­]Þº•¦®æ&*šëì ×/è‘á;%)©11±Q(‚4DG7DE5DF6DDÔŸ;‡+<üÝî'oÓ38¸>(èéîÝ$ ƒEÓ„Á 60 ‹‹ßܰGà³ð@bcëQÔ#–úÈÈz €Xø¸uÁÁuAAuu¸üýëüüê|}qùøÔy{×Òhµ^^,—h}}È{Ol__ì s²ç «ëdKXX(4´.$¤@±�ˆ€ÅǧÄg©õô¬¥RqyxÔº»×R(¸Èä7·W×Z—š3gî­[G;kh81°`t;;o©¾òòE'N  >Þ#£€É¸ÜÜjHí™3 ©íb×|ÿ=®ï¾«ùöÛšÓ§kNUÿç?ùöö’’žªÊל0Þø­ÎˆˆdY[×Àõ…Âgy×#¨SúA,ËÉ“Àª9q¢æøñêcǪ¿ù¦ÚÙ—“Sõ×_W=Z}äÈ«;‚ ÓˆY5q…F…çÏ{©ªzÉÈ”;†ƒwÊ?T ±TC€x,'NàfÄÂ9z”sè{ï^–½=kçNö¾}ð'o¿úÀêýû«9ÿú×K[ÛP|?·zåD†!X(AÒ˜bfÆ ‹�±pœœ8�‚X _ªæüûßœ¯¾ÂÅc9p�×þýì]»*ÍÍK¦M+’(°"á²2ÓÊŠ³{7ÇÁ³kç‹/ØööÏ׬ñ“‘%ðkk:}\v±Gä55·Ìؼy�P á Ná@gíÝËÙ³‡½gçË/q >û“OÊ,(/&x• •HK3W¯†8Ÿ|Rµyó33Š˜EFzvâ A#ÌÌ<¥¥‹wî„�‹ƒô.Ô)l8æóÏÙŸ}†ëÓOÙ;v°·oǵukå’%¥ÊÊoDDÞ )Àà="+×ÕeÛØXZÒuuÁâ,~õо‰íYž͜魠P Xx8;;ë“OØÛ¶áÚº•½e {ófÖ¦M,[[ÖÆì™+W–kj–ˆˆ”í'SŒ!%Å04 •u ˜1ãê¾q 1’QU”UUY[¶°ø lÂÞ°½~=^B³n®µkY̶¶f[Y±@kÖ0ÍÍ+ttx'ƒéø*Czë,ÞvÉ”)ñk,'·²×[]=�\Êdz¬­Y|ÖêÕ¬U«X––¬•+q­XÁ²°`-_ŽËÜœõÑGUsæ”ËÈ”e|(añJMÊÐvL ªI KJÏž•´Åf‚½ÓP œ=“&#SÁ17g.[Æ\º”µd @±/f™™áZ´ˆõá‡L‰ ÓаRI©\D¤|HYްJQ©I t«ˆˆ·¦fŒ…Å<‡|‹øÈŒ*&öÚØ˜ebÂZ¸µ`ÓØ˜9>®yó˜s粌Œp2õô*••y¤#¨ýû Ü>ÀTEŨeKJVM®E˜}è&"òP[›9gsölæ¬YÌ™3Y }}�dΘÁœ>©­]¥ PI$[G$\Jô•"¸Ã�–‘ž93ÕÞîŸV‡0kL®4yyæ´i¸�¤¥ÅÔÔdNÊTU­’—¯"‡G *»ªD݈bûNÓ¾ðñê<Ò$OÕaíW77OeåP˜ƒââU²²L�Á ))¦˜“@`äbW(U‰vÜÜQÙU°¡á?–ùSÖ×GòÕÐpECñ}ДvT¡Ý(˜T%¥[_EúÇÿv†¾u+xÑkB€ì4´* `S¬¦fŠPEÄ(–———M"ÅYX„À­ö›>=m—]n´ï8S¾³„}45΢ÜoØR·ê‘•Ã`Â^ùôÓÿùEùññ‘f¦ž ~º:°(ƒôƒ,%E‘‘ñÑÒôÓ™¶`AÅ„Dgp¡!FFÐÅ?J7´ ®í*R•³È§GoÿòŽg á+Η¬­ÓnÿðÃ?¿ûîîY§N]°²"¡rF˜Ç(M•1h4ª‚‚?êâAPµ#¨˹‰‘¦¦£ï*†Î›~ÌWS3ýË/Ë®]k,.înl|ÛÝ õ½}‹«·—[_Ëɉ,)Ùõð‚…/\èF$^ÂVÂ…WBâipð(ÍÂ$KK…ÏšÅúùæÛ–Ö·--o››ßoCCo}}ommoMM/‡ÓËb1SRhŠŠ¡Æó&†÷UPMMŒòÞÑëy[Æ ˜¼ââ£GŸDXåŸ8ÑóâEOnnϳg= FÏ“'=õ<|Ø““Ósÿ~Ͻ{=wï}ÿ½‡„¬×&†ìš5®bb—ÐlmNƒj!!vOÙ¹c”6ƒôõ!)>~¼+9¹ëÒ¥®‹»:}|¸$R§«kg``WttWTTWHÈ#]]ðóž*ŠÆ›¾s§Ÿî47TpÕ0°ÊwXýK<Á_zö1&(YF†‚J;©ÔN2™{èP»™Y«ŠJ«„D«ŒL›¶vǺu\GÇöeË ºËÉ&¬];a¼`ÏCB🌡ÒÍ‘ª:yÕ¿-èV¤¢ê¬s ¾ˆ‹ÚZŽßº~bb°¾æîÝÛnjÚ&!цjöâ•‹ à••ý=áÜDò‚E›™¹IŠŸE‰GËÈâÕyÖ ò�±AsfeúrPSÉÛ6¸ËÉ%ÉË·,ZÔ®¥ÕN ´¬œ¨Ý·ð &~}ÑÇ`D,2…@CG8ƒ YÛ†ŽI‚‘ˆEN&~ÕŠËöö .û–Ó_i<““ë�¨LZ ._ͨ^ÔMB⼕åÃòìþ‰¡s Ih¸6 )gïÊQ,öÀW÷šºº»¼¼›˜¨—º:xfˆY­WˆÔ9PàÈøïwt“—{g“vŸ54€šŒpÚvͰ=UžiD¢zW**ÍD}×9œºø*C¿ïðPPxš8Y°<ËØ»7`út7QÑD4h¹C4”‚˯Ég£ðÍââ©{ `ðD §[±ãöÛÀ?e ¶¶!F÷Æ E.w`׌Î"¬žá°¯ƒ„³o`µÌ$Zz@@¬¹9ÌD†=þ«h<õ ’áèi^¸éð±lm±ÌKEÅ ý©r8®Þôvˆ¸èÉ?ªi31†=Ù|ÃÄ—«Ÿùhh@ +ó[hžv‡3ŠºQ·^Be힊S¢/þç ãa ¨/¬µòÕÔ a˜7†ÝDDÞ‡´=§½‚ü6þŸiÜ;yr²iÞË�9ûë¯é›6z©ªº‰‰‘Qíåôø‹…ÂVczðžƒaq¨žœ,-í£­yiófÆûýÿ({D9e¾$tþ|¼èTR’B ø¢ÓE ºˆƒQ‡BâD‘‘ ž3'fùò‡ãücÀ °B:=ÆÒ’¦¥nb4{¦¦EVÎULÜGS3ÄÈÞ‰03Íõõ×Äø¿)úÐØ endstream endobj 7 0 obj 5808 endobj 8 0 obj << /Length 9 0 R /BBox [0 0 80 80] /XStep 80 /YStep 80 /PatternType 1 /TilingType 1 /PaintType 1 /Matrix [ 0.375 -0.375 0.375 0.375 120 270 ] /Resources << /XObject << /res6 6 0 R >> >> >> stream q 80 0 0 80 0 0 cm /res6 Do Q endstream endobj 9 0 obj 31 endobj 10 0 obj << /Length 11 0 R /Filter /FlateDecode /Type /XObject /Subtype /Form /BBox [ 0 0 300 300 ] >> stream xœ+TÐH,)I-ÊSH.VÐ/J-¶P(NÎSÐO4PH/Vàå245P060PÈ“ ^˜Ñ0~²²4^®@^.�ÿbD endstream endobj 11 0 obj 70 endobj 12 0 obj << /Type /Page /Parent 1 0 R /MediaBox [ 0 0 300 300 ] /Contents [ 2 0 R 10 0 R ] /Group << /Type /Group /S /Transparency /CS /DeviceRGB >> >> endobj 1 0 obj << /Type /Pages /Kids [ 12 0 R ] /Count 1 /Resources << /ExtGState << /a0 << /CA 1 /ca 1 >> >> /Pattern << /res8 8 0 R >> >> >> endobj 13 0 obj << /Creator (cairo 1.4.14 (http://cairographics.org)) /Producer (cairo 1.4.14 (http://cairographics.org)) >> endobj 14 0 obj << /Type /Catalog /Pages 1 0 R >> endobj xref 0 15 0000000000 65535 f 0000008582 00000 n 0000000017 00000 n 0000000174 00000 n 0000000198 00000 n 0000001741 00000 n 0000001767 00000 n 0000007794 00000 n 0000007820 00000 n 0000008110 00000 n 0000008134 00000 n 0000008353 00000 n 0000008378 00000 n 0000008776 00000 n 0000008909 00000 n trailer << /Size 15 /Root 14 0 R /Info 13 0 R >> startxref 8967 %%EOF �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/test/fixtures/image.png�����������������������������������������������0000644�0001750�0001750�00000100002�12257552170�020704� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‰PNG  ��� IHDR��,��,���y}Žu���bKGD�ÿ�ÿ�ÿ ½§“�� �IDATxœì½yXW¾Çý­ê^éFh$ì±ÃjÔÄŒ!£#fMÌÜŒ‰qIÌŒNf&™Ü›÷N’k¿Ï¼š¨£‚’¸£1›&Ÿhp#qÁ DvY„n¶^ë¼ÐÝ6ˆ"æ|ž§ž:]UõéªþÕ©ªSçP( …B¡P( …B¡P( …B¡P( …B¡P( …B¡P( …B¡P( …B¹—áÝí  Œ\!ÌÕÈG펙ÉÞʶCÍ=ͧƒŽÍBÖoå^„½Û@™ü¸y³`CHpzciuIÌo~û©Íh,Û:qb˜ç<éñ1O½¯Pœ–ø¦•¿¯T®_íï/½Õ2÷îÝKO  eàù$eÆÓ!!İiéø¹œ[¿ž¤EF¾îúûJ¹ü¿> µ”mØ@ZóóÉ‘%K¸¿ý¡·ånÜ-§Œdh ‹Ò/ôçò^~ ²ͯ½†šù¿Eõ¾}„‰Jàãǵ‚ŽŽ·§B&#+WB.—œë¾]·cðOååU©AA‡HƒB¡Üëè�vµ\ú¯2€Täß�Y-•6œØ¹Ó �Öj6f¤ %�9Ç0d½ÚïÊæ |]Ë8ôòËñÂBv¯Õh¾ÛºrϬY Ïu¬’û$ ±…B¹GaVI$eÕ�1�d@vLK| �ˆNÇ®‹+«R b€låóÛ>™1c&Ðy£~ã˜1ÿ›ªTÚÏ-YBôû÷“¼Œ ²6 À²>6Ößs%iZmXO+§ür¡—„”þ@ Å·Ù�öhä1_/>yf�|œ-Z­~r�v�gø|3ý§ùÿüç�XôS\üÿÎà8žßåË gÎ $(Éï¼#dÛ[wz®äµ¢¢Ë:Ž£ åÎ8üúë>©ÉHœ<ßsú‰… ½þ&Uœ¸õAÝÇ3{Æõ7Bû>Ÿßü3@ª�R"–%?+¤ð½÷ȵ:�3Ô. åÌ®)M\ôÚæ <§§Ç<ðÛƒ�×à¼\¬Èe€œHšBQ³eìØ1wk›)#z6£ô ¢Ó±;Ο—Ê-€Øbî(?c® ÀÚÛÿ®¥ÚõtcÓ5:/m�*�œÊG'M]ð±gyó)#°(·ÅÎiÓîo,)Znm6=-‹Õrb1›y–¶6++Ô2|~‘Tí{D® ÌäÉåÕÏíÛç辌5uÆÃúú—ÂT8ÇãµZTªÏ¥2Ù»Ë+*ôžóžÐ%ñ¿Ï”Ä­X±‚0 C†Æ”2œ¡‹Ò+éZí‡^vûÂ'OùkµŒÈϬ·7x àåàI¯Ç•óçQxüxkKMÍ)EDÈß–žÍÍö\Îé·Þ >•ž¾‹eo¡·"[ìë·UáBžp·ÏÚñðÃ6–—ýÁÒÖö H(”0|Õn·ërù>ŸÀÀOåæêoØ@Ê/°(·dµï¨‚¸°ðè¸_©+—ƒ‘ÉÀÈd`e2÷gžLF.O&C‹¡?îØn¿|âÄ…±‹ÏIx㫽­çÚ±cÞ{-<­¼Z¥%„§Šˆ€øÙg!7œ\Ž«¥¥ä§}ûZ–,[xòÌ'CáN~Ðw·(7%=Jû(‰ô‘øÐPðXà8€0„�Äy…Ö­L�x)½‘<“ JL}úƒÞH²Y,ë2vå¤÷p™�'Þ~kêW^-žljQǬ”χtæL}}Á‹!R© ™0‰{i¡¨©úÊÜGL&Åúú£Cô5P†4`Qz$]«}JQS«›¨Ñ0 �p�Œ3(y-w™0â,Ë¿à%´76ÎÈÙ¸1æ…)S]Zjñ\OÉžLÅ?__Vü$€ÑpVù9öòòÎuŠÅ�Ë„€ –’‚ºüü)ÓŽÓßÔÕ]Ò/…rס‹r»““¥ùùŸOçñÔ^|þµ©nŸI·2Cˆ³Ìãó‘’‘J•·çãi¿ ÛÿÁÐáZ׳÷'65GÞðƳÍ{e%¬……�Ë‚õñé ˆ<TÈÙ¹#ôX{{Æ ”aÿno�eøa,+{"¸½=JƲ€@Ðy)Èq€ÃâptÖ¢\Óœç3ÎùX‡Ãý?à8Ä?ÿ<Ä*UâÁ¥K¥ÇÅ=¾,/¯ió“$íGóãïÇM^¹ ކ´öl%%¿ò !°ÕÕÁnµq`€>=üAkX”x”SÌæ09!€ÙÜx¦³†\;ïiÁ9Í}Ëã³»öÅqðІ22btÉãV,YòÕ} 3íeß|g<ljÎu{>ò,; ðÃÃamjÂÎ7ßl KL\_^^5¨_eØA¥ %©©¢’ƒ×Mâ8ÎË;³¤££³¶Ä0îà ÇKDWP#Î�æ Z Ô±±h74Dœûâ3þ³Ÿ}~tn”6¸ÈÐð`¤è< »-@‡D‚‹••8œ™Y£‰‰Y´0;ûøP}'”á X”.Ä^½:ÖG¯_®õˆ ЬÚÚ@àhh�:::ƒë—gàÂõñ¤[M‹á8NšŒ‹»vOݺukÚ©ô¿›7çHn!$a‘Ã!®Ø�Õ�ò†»Äç·°Ls«B¶F3FûòâÜÜñ×B&ÐvX”.¤†‡þylyź8tÞâ<Æ®r—é F¡�/$¼�/0¬³MãÑN‹u¶Ýâ9§|ù%²7oÞøZiék®uïNN–ò„ÂÀÖÚÚ ›­ƒ…Õ&–($å‹O2 ý·AnЀEéš�ÿ­³jë^ÄÁévãçñSO§Ñ\Tryg#S²ÕbÁöÙ³ó‚“’Æõô…Ò´¯!Jø "Dç½g4טé6Í5ë1 hÛ¾\CˆÑÎdêp ÍÍàŒFð�8¬VI¸JEAÊmC›5PÜ€Yc±2R\JÎéî›ß� �,�$�¼È»ÍËફÁðxî&¬³ÙƒÃY®ÊÉO(Ì|hËÛ*RF84`QºÂ0v 3�qc�ÈìõJå÷|…ì$C!çp(¬&S<±˜ã”6»O(€ �2¡°óé Éän³Å9Ûh±‡º’dmÛv‰/“½½5E¹}hÀ¢¸a�’&“Õ¶44@åœæª]]�HFšò»eÿ£Ó¹û¾"„0Ÿ>ñ„’´´•Õ×ÏÌ«­momïûÃò@£|}¡L;Ÿv«—/sõuug}ãâ–.>uªî®ˆRF,4`Qºà`Hy€\¯]�å�ã™î¬�ÀÙOU“sÈÛ;oÞ: If7³U•ú˜¢ââ†e5|‰—™³Ûõ|©<7öÅ)Ù)i‡,Ý×M¡ô X”.0Î_¸ñ�ëùÎ p"//{oÿï|âgt…�¾ºa¦‚‚Ú\Ê/ ú„†Ò¯°°œz C×§J�†Š²‡ºÏŸ>uªjÏüùŠîÓ)”Á€,J^ÍÊjèðVüPƒ®Íâ�ÖÖÒ¾Ô3íÖ¦ÈȤªªÆpâ»Ò÷•Ê´ÍQQ7[.…2ÐWsî!Ì”+W"…cf²·²íPccsOóé c³Õëòž‹i¨¼R3®·,–(no°_¸à?'4Tœ,àmSû¿8gÕ*AâÊUR¿˜˜‰WÏf?3]"Í?ÜÔ4¨ýTB˜)†+‘ÚÆ—2r 5¬Λ7 6„§7VW—D?÷ü§6£±lëĉ]2&óäû Åi‰oZù*¥rÝjé­–9vÑ+ÿÔK¥«pý²P�à?<l4þ. ¨hßã„™ú«ÐP†éç~ÄýII˜÷ÍPutô·¨T)ƒî[Z]ó›ßöè›ó”Ë÷}¥r}o¾{÷î¥'n e(ø$eÆÓ!!İiéø¹ü¸nI‹Œ|Ýõ÷•rù}j)Û°´æç“#K–pkï»oyoË]œ¸Q 0Ù�ÂÄ@¬�±�¤ í�icYÒG¬{ö{M i«¯'ŸÌNÑoKH ßsë×÷êû÷  ?ô¶Ü áá7ô!H~ÐÖG.ïå*+ÑüÚk¨™ÿ[\ùòKŠD¥�ðñc‰ZAGÇÛÓF!“‘ÆU« —ËÁ8l7tz§ëv,¼^UuÆîï÷ׯáj‹åêúÅóU†ã€¼<ØþïÿÀåä@d6#êɧüÍ u3‡Â·zß¾›û®\ ¹\pv®ûrºûþ©¼¼*5(hâ`l3…BAçî¹ô‡2€Täß�Y-•6œØ¹Ó �Öj6f¤ %�9Ç0d½Z}eó„ ¾®ezùåø a!»×j4ßm ]¹gÖ¬.OüVɽßLÚ*µ, vgm˳³¶ÕóïOjÞy‡l‰Š"i‰ƒá»Z.ýWß|ýúèë“0ÐÛM¡P:aVI$eÕ�1�d@2¦N]�tfh^-WU;ÓÂd+ŸßöÉŒ3Î×ÇŒùßT¥Ò~nɢ߿Ÿü´s'Y`Yëï¹’MÚˆÇVÊ¥9ä@LΠeõZ€ddDܼ6(虡òÝ1-ñ%ßʾøæedô蛦Նõ´rÊ݇ÞláÌ5*ÒØÚ:é'�õ<æë?UV½ �B¡ÄVZª›HˆÀ à{>ßlþã¢ì³û�@±mÛAEņéB!«’HÀÚíPQÑѼʓY1‡ššÝ¹ÿ2›*^}ú×;x£F}QHˆåGBä9‡8ÁE€œæñÚ/zy•_ N›¶ê¯ÏÏýxß…Áö½èôýsEÕ_oÇW¹mÛ‹üŠŠTO_¿ñãásƒï¡ÆÆfNÇfeeÑþâ)”äðë¯û¤FDü%#qò|Bˆ»³½óæ‰ÿ&Uœ¸õAÝÇ3s×z!ìû|~óÏ�©H9@ŠX–ü¬PÂ÷Þ#kÔê Ü¢¯´:wB‚zwr²ú«¹sv'$¨É=ióôí²M z –/…BvLž<i]PÐk›'LèÒ óÃhíüƒ�×à¼|ªÈe€œHšBQ³eìØ1wk›ï„]SšØ“ozÌ¿½}‰Ð³Ê…èt쾂 L&!€Øbî(?c® ÀÚÛÿ®¥ÚõtcÓ5�;�€ �'‚òÑII ^8vìÌ o~Ÿ!:»ãüy©Üb ¬ïÔ/;1ì|)=CÖcç´i÷_+)Zfi6ýZ$«e>>Äj6ó,mmVV(¬ax¼b©Ú÷ˆ\˜É“Ë«{ê~xFñ°¾þ¥p�•�Îñx­•ês©LöîòŠ ½ç¼'tIüï³�$%q+V¬ ÎÞ†ŒÓ¦ÝßXR´ÜÚlzZ$«å>>Äâòj>¿è^ò¥Ü°FéZí‡^vûÂ'O©µZÆËϬ·7x àåàI¯Ç•óçQxüxkkmíIyxð{KÏæf{.çøÛ ÉIÝ’Á2Œ·Ð[‘-öõÛª¿p!Ow½¯>ìxøáGËËþ`ik{P$J¾Àj·Ûõ"¹ü e`àç‹rsõ7là úúkµŒ¨ß–ššSŠˆ¿u÷=ýÖ[Á§ÒÓwõÇW —ïó üt(|)½CÖaµï¨‚¸°ðè¸_©tg£q%zp}ve¥ae2´»}›½"+ëÂØÅ‹ç$¼ñÆÕÞÖsíØ1ï=‹žV^­‰ÒÂSED@üì³N.ÇÕÒRrqïÞ–‡e Ožù¤·å …/#—ƒçôýqÇvûå'Ô÷§}ûZ– ª/åö ÍF�éQÚDI¤Ä‡†‚DzîŒËL÷$¦®±³,Rz#2y&;:aÊèÓ|ðF’ÍbY—±+'ý&YjN¼ýÖÔ¯¼Z<ÙÔ¢ŽX)ŸÙÌ™úú‚/C¤RA3a¿p‘èZeÕÜGZZêëÞ5_2à¥ôFDòL6(1¡ß¾Ò|ã^Z(jª¾2÷“iP|)· XÜt­ö)EM­n¢FøÒÃ3€;£²ç˜ñLhêJ#Oäˆ_ðÚgälÜó”)‡¿.-íÒãgÉžLÅ?__Vü$€Ñ€;½­¼¼3XˆÅ�Ë„€ >{6ôyyS¦sÜéoêê¬w†þú2çNÚ*è·¯½¼¼sÝ|ÃRRP—Ÿ?eºÃ1 ¾”¾AÖ0fwr²´1?ÿóé<žÚË•a¸¡váª}Ïž?n€Çç#"%"•**oÏÇÓæ„GüãÛúz³k]\ÌÞŸØÔyÃÀ6ì°, ÖÇ�À°,|"#‘³sgȱööŒ!ñíö¹'_rßß„†íÿÆ`è¸-ßÊÊ®¾„€áñ Šˆ@ÎΡåKé;´‹äaŒ©¬ìÉàöö(ËBag­‰ã�‡Äáè¬U8îTZŒs gÙ5ë,ƒã0öùç!V©.]z8=.îñeyyM›Ÿœ é8š?nò6<!p44 ý³Ï`+)ü•W�B`Óëa·Z ¦³ë÷;ÂXVö„ÛW èÙ×5Í9t÷ež.ßøë¾‡<}ÛûèK­®v«(_Jß¡5¬aÌ4BÒ¦˜ÍarB�³¹K ƒñ».ÿœÓÜ÷{<>»Ë¿¨hxGFŒ.9p`ÜŠ%K¾º/a¦½ôÛƒïŒç8‘À¹nϧ1že‡Á�~x8¬×®aç›o6…%&.//¯ßG ÙØÅ—ãœ¡¡ï¾îÚÇÁ7*Ên¾e}õmjp_Jß¡k˜R’š**9xpÝ$Žñà¼Ü1›A:::k ãþ1èù2ÑY&?hB:“Ë«ccÑnhˆ8÷Ågüg?ûüèÜ(mp‘¡á!ÀHq½+®Dª .VVâpff&&fÑÂììãÃÕ×´˜aèKé4` Sb¯^;J¯_>ÆãwÄ�?Þ¶6†8Ü5/ÆuÏÇó‡ ûXÝ~à Ç!pÒd\ܵ{êÖ­[ÓN©ý¿óSÉ­3„ä",t8ÄÕ�[   @>Ãp|~Ç%–inUÈÖhÆh_^œ›ûïôõÑë—k{óíè蓯;hu÷Mÿðë°ysŽäÖBò9}k�T;}/ñùíƒäKé´Ö0%5<ôÏcË+ÖÅîôïî4ðÎr—é F¡�/4<­¼À@°Î6JŒG»%ÖsË‘¿oÎnÙ²ñµÒÒ×\ëÞœ,•…µµA6[ËX9‰X)­‡@R¾øÔ©AIÕÜoßðxà–¾žíÓ ¾üÙ›7ßàË [¾°ÚÄ¥Â0˜¾”þAÖ0em€ÿÖÇkë^Ä?ÖÛùA3~~?õø àúá:”z6¼´Z,Ø6{öO!IIã{z­e¨Xà¿uÖ�øò4šëÊÃ×U¶Z,Ø>{v^pRÒ¸»éKé´‹äa aC„è¼fwuGì™vËsškÏ®‹‰Á€¶íÛáhh�1Á™Lî±Ãh×Ü Îh�gµJÃUª»z,ðÈ—ëîk4Âa4‚xø:¬VÉÝö¥ôÚ¬aB�fÅÊHqýGêœî¾ÜÀ�À‚Î\ �ònór�¸êj0<ž» €«‰ƒÃY®ÌÉO(Ì|hËÛ*v¡¯¾�Þèƒ/ǹ}«†/¥ÿЀ5La�Ðùƒä<Æ� Øë•Êïy Ù)–0ÎáPXM¦±ÄbŽUÚì>¡�‚�È„ÂΧe&“» “«½Ëq¨+)Á÷Û¶]âËdïÁp—oÕ0Œ¸µ/_!;ÉFèô's\_}³†‹/¥_Ѐ5 a�’&—×´46Båœæªm\�HFšò»eÿ£Ó¹û‚"„0Ÿ>ñ„’´´•Õ×ÏÌ«­}ÂÞÚ:Î÷‡ä Fùú2B™ v>íV+*._æêëêÎúÆÅ-]|êTÝ]uÂ�$M&«mih¸ßÙöÖÖñ#Á—ÒhÀ¦8RÞ ×k@9Àø…G¦{þxÀÙoS“sÈÛ;oÞº6›A.r5U•ú˜ÂââX–eýù/3±ÛëxRyNì‹S²SÒYº¯ûn0¾@“Ìnfª*õ1EÅÅ1 Ëjø/3g·ëùRyîpò¥ô°†)„Ã…«�7`=ßq�œ———½·ÿw>kv…�¾ºa¦‚‚ÚÜ;†áp¾'_àD·ïktÃÞ—Ò?è“’aŠ$,ì‡z C×§c*�eºÏŸ>uªjÏüùŠîÓG ^aa9=ù**Êê>ÿH÷¥ô°†)¯fe5tx+~¨A×Çûq�kiiU§Ó¹÷ݦÈȤªªÆpâ»ÒUJeêæ¨¨€›-w¸r+_[KûÒ›ù¾¯T¦D_Jÿ ¯æ „fÊ•+‘Â13Ù[Ùv¨±±¹§ùtбYÈêuyÏÅÇ4T^©™?×[øJ··GØ/\ð&,Øë?øü-ajÿç¬Z%H\¹JªŽ‰™t%;û™éRiþᦦAí·i¨}ç„†Š“¼Íž¾~11¯žÍ~fºdˆ| W"µŒ/¥ïÐÖ�ñãæÍ‚ !ÁéÕÕ%ÑÏ=ÿ©Íh,Û:qb— ÂÅÇ<ù¾BqZâ›V¾J©\·Úß_z«eŽ]ôÊ?õRéÅ*\¿L�øO�¿ó/,ùòqÂLýUh(ÿt Üùs¸?) Ï8êõí*UʽäPT´ÏÓ×qîGÜŸ”„yßUGGoiuIÌo~Û£oz|ÌS.ß÷•Êõ½ùî¢\ŽÊ |’2ãéŒbØ´‰tü\H~\·Ž¤EF¾îúûJ¹ü¿> µ”mØ@ZóóÉ‘%K¸µ÷Ý·¼·å® žºQ 0Ù�ÂÄ®§‰ï�H;@ÚX–´ÅÅëž=Ä^SCÚêëÉ'))úm !#Éw]ppb¿}gï¹õë{õý{PÐz[î†ððú¤ÜáˆDSÛšñW¯ŽaFkö”–”V»==Ó`(þø±DmGYÅîY„HÙŠ ˜‹‹aQ©p5ÿ§Ì#-­¹žËÑl–GçpGƪä@M[QKkòX€uÕ<\í”ÜÔ׃+(� Ÿ8–••?zéPcÓù‘â{Äh¬NÔ´µ´ÎìïåãGÎll:7ؾ%ÅÅ7÷-*‚E¥Â•üŸ¾íÍ÷pS“15(hâ!“©×„Ê€ ØäÒÊ�R dµTÚpbçN/�X¨Ù˜ J€”�äÃõjõ•Í&øº–qèå—ã7„…ì^«Ñ|·!4tåžY³º<[åíýßéA[¥³ÖÁÄî¬}X�bvÖ>Ú�bþýïIÍ»ï’-QQ$-""qDúʽßì“ï;ï ªïj¹ô_}óõ룯OÂ@o7…r3˜UIY5@ �ÙŒ©S��ÑéØÕbqU5:Ó¤d+ŸßöÉŒ3ιnjùßT¥Ò~nɢ߿Ÿü´s'Y`Yëï¹’4­öW+åÒœœ?“óGlõø�’uqóÚ  gF²ï&mÄc.ß ÃÌwÇ´Ä—<|+ûâ›—‘q³ýÖÓÊ)ס—„ĬQ£"­­“~PÏc¾þSeÕÛ�!Jl¥¥º‰„Ì�¾çóÍöØè?.Ê>»�Û¶-TTl˜.²*‰¬ÝõøñÍ«<™s¨©Ù ïPcãåWŸþõÞ¨Q_üLˆåGBä9‡8ÁE€œæñÚ/zy•_ N›¶ê¯ÏÏýxß…‘ì›ÙØTáò-&¾¾®¨úëíø*·m{‘_Q‘êéë7~<|cbzÚ¿Í:ŽÍÊÊ¢ýÅS—ï¿î“ñ—ŒÄÉó !îÛ-{çÍÿM$ª8 p낺g<æ®BØ÷ùüæŸRr€±,ùY¡ …ï½GÖ¨Õ¸EŸe't:þÖI“üw''«¿š;7`wB‚š Ñ“§»å»;!A}·}»lÓÂ…^ƒåK¡ÜvLž<i]PÐk›'LèÒÀñÃhíüƒ�×༜¨Èe€œHšBQ³eìØ1wk›ï„_šï®)MìÉ7=æßÞ‹¾wÝï¢Ó±û $0™„P�bsˆ¹£üŒý¹‚koÿ»z”j×ÓM Ô�ì�l�*�œÊG'%-xáØ±3ƒ¼ù}æ—è»ãüy©Üb ¬ïÔ/;1ì|‡;4`õ“Ӧݭ¤h™¥Ùôk‘X¬–ùø«Ù̳´µYY¡°†áñŠ¥jß#rM`&O.¯î©;Þ5uÆÃúú—ÂT8ÇãµZTªÏ¥2Ù»Ë+*ôžóžÐ%ñ¿Ï”Ä­X±‚8{+2~‰¾%E˭ͦ§Eb±ZîãC,._ –áó‹î%ß‘ Xý ]«ýÐËn_øàäÉ"µVËxùùõöO¡�¼¼à`4éõ¸rþ< om­­=)~oéÙÜlÏåû/!9©[2X†ñz+²Å¾~[õ.äé®÷]‡?ühcyÙ,mmŠ„B ÃXív»^$—¡ ü|Qn®þ† ¤¾æë¯Õ2¢^|[jjN)"BþÖÝ÷ô[oŸJOßÕ_\¾Ï'0ðÓ¡ðIЀÕGVûŽ*ˆ Ž{ðAð•Jw2¦[rW–V&C‹¡¹Û·Ù+²².Œ]¼xNÂoôÚHðÚ±cÞ{-<­¼Z¥%„§Šˆ€øÙg!7œ\Ž«¥¥äâÞ½-,Ëž<óIoË£¾ïËÈåà9}ܱÝ~ùĉõýiß¾†%ƒê;Ò Íú@z”öQé#ñ¡¡à±¬;1Ó=©§kì,‹”ÞˆLžÉŽN˜2úôë·?%�� �IDAT¼‘d³XÖeìÊI¿IÖ–o¿5õÀ+¯O6µ¨ã�VÊçC6s&„¾¾à‹Å©TÐL˜ÀÄ/\$ºVY5÷‘–Åúú£Ôwˆ|=Ê€—ÒÉ3Ù Ä„~ûJ{ð{i¡¨©úÊÜGL¦Añ‰Ð€u›¤kµO)jju5Æ•.܆=jwÙ™*ÝU–"~ÁKholœ‘³qcÌ S¦þº´´K˜%{2ÿ|}Yñ“�FîÔì¶òòÎX °,@X‘á³gCŸ—7e:Çþ¦®nÀz+ ¾·çËpœ;i«<  ß¾öòòÎuvó KIA]~þ”éÇ€úŽThÀº v''Kóó?ŸÎ㩽\‡ζ®³1ñøìy°�<>))©TQy{>ž6'<âßÖ×›]ëzàböþĦæÈÞˆµÙ`¯¨€µ°`Y°>>��†eቜ;C޵·gPßAðíö¹'_rßß„†íÿÆ`è¸-ßÊÊ®¾„€áñ Šˆ@ÎΡå;’¡]$ߦ²²'ƒÛÛ£d, …µgº,âptžewj)Æ9†³ìšÏ•b ‡±Ï?±J•xpéÒÃéqq/ËËkÚüäIÇÑüøûq“~£¡íŸ}[I 䯼›^»ÕJÀ0¸þb-õ½=ŒeeO¸}‚ž}]ÓœCw_Öééò¿î{ÈÓ·½¾„Øêê`·Ú¸òÉÐÖm0´)fs˜œÀlîrÆe<Ç®Ë!ç4÷ýÏî2ÇÁ/*Þ‘£K·bÉ’¯îK˜i/ýöà;ã9N$p®Ûó©ˆgÙa0€ëµkØùæ›Ma‰‰KãËË«¨oßy”]|9Îúîë®}q|£¢¡ìæ[ÖWߦ¦÷ÉÐ€Õ %©©¢’ƒ×Mâ8Îê¿Ù ÒÑÑy6e÷Á  çË&g™xà„�êØX´"Î}ñÿÙÏ>?:7J\dhxH0Rtî î5 C"ÁÅÊJÎ̬ÑÄÄ,Z˜}œú_WÐb†¡ïH‡¬^ˆ½zuì(½~ùãŠ:æ¶6†8Ü5ÆuÄóÀ†Ç}n<Ãqœ4wힺuëÖ´Sjÿ¯ÃüTGrë !ù„ q5ÀÖ¨Ï0\Ÿßq‰eš[²5š1Ú—çæþ›úöß×G¯_®íÍ·££O¾î ÕÝ7ýÃ¯ÃæÍ9’[gÉ#DXäô­Píô½Äç· ’ïH‡¶Ãê…ÔðÐ?-¯X¸Ó¡»Æ®r—é F¡�/4<­¼À@°Î6;ŒG;ÖsË‘¿oÎnÙ²ñµÒÒ×\ëÞœ,•…µµA6[ËX9‰X)­‡@R¾øÔ©AI]L}oÓ7$¼¸¥¯gû´‚/¿DöæÍ7øò„ÂÀV§/¬6±D©0 ¦ïH‡¬^Xà¿õñÚº—qãÁ{;8ãçñSO¯Ñ�®ÙÙÀÒ³!¢ÕbÁ¶Ù³ IJßÓkCÅ/ÍwM€ÿÖYàËÓh®*_WÙj±`ûìÙyÁIIãî¦ïH‡&¡èÆÑyíìJ?噆ÊsškÖc:1ж}; F#8“É=vàš›Áàà¬Vi¸JuW÷É/Í—?@¾\w_££ÄÃ×aµJî¶ïH‡6k¸`ÖX¬Œ×Zçt÷ÍÑF��t¦¤R�w›—ÀUWƒáñÜÄ]üÎreNxBaæC[¶Ø†P± Ô÷ºCO¾�Þèƒ/ǹ}«†ï½� X½À� ó�å<Æ� Øë•Êïy Ù)–0ÎáPXM¦±ÄbŽUÚì>¡�‚�È„ÂΧG&“»M«ýËq¨+)Á÷Û¶]âËdïÁpwo]üÒ|Á0vàÖ¾|…ì$C¡Ó7žXÌq}õÍ.¾#°n4¹¼¦¥±*ç4×Ù÷@ê4êÔ”ß-ûŸÎÝ7!„ùô‰'”¤¥%¨¬¾~f^míöÖÖq¾?ü Ôh0Ê×—Êd°óùh·ZQqù2W_WwÖ7.néâS§ê“_¤¯LVÛÒÐp'¾³í­­ãG‚ï½� X½à`Hy€\?û�å�ã™îy0€³£&ç·wÞ¼um6ƒ\äjª*õ1…Åű,Ëúó%^fb·×ñ¤òœØ§d§¤²t_÷Ý€úöÝh’ÙÍl@U¥>¦¨¸8†aY _âeæìv=_*ÏN¾#°zp¸pàÆ¬ç;€óòò²÷öÿÎ'BÍΡÀW7ÌTP0P›{ÇüÒ|ç{òå�Ntû¾Fç0ì}G:ô‰E/HÂÂ~¨Ú8t}Z¤ÐXQ6¡ûüéS§ªöÌŸ¯è>}¤ðKóõ ËéÉW ÀPQöP÷ùGºïH‡¬^x5+«¡Ã[ñC º>îŽXKKû«:ÎýnŠŒ\Aªªj '¾+]¥T¦nŽŠ ¸Ùr‡+Ô÷º¯­¥}éÍ|ßW*ÓF¢ïHçž|5‡ÂL¹r%òQ8f&{+Û566÷4Ÿ:6 Y½.ï¹ø˜†Ê+5óÇázK[)€âööû… þÏ„{ýŸ¿%LíÿâœU«‰+WIÕ11“®dg?3]*Í?ÜÔtyÀäz€ú®ïœÐPq²€·ÙÓ×/&fâÕ³ÙÏL— ‘¯áJä£öñÉÜs5¬7ol No¬®.‰~îùOmFcÙÖ‰»dÔý(>æÉ÷ŠÓß´òUJåºÕþþÒ[-sì¢Wþ©—J/Váúeƒ�ÀxØhüaÉ—fê¯BCþ¥KàΟÃýIIxîÀP¿¨¨o?P©R¨ïÈõ (*Úçéë8÷#îOJ¼o„ª££‡Æ·´º$æ7¿íÑ7=>æ)—ïûJåúÞ|÷Q.GÊmðIÊŒ§3BBˆaÓ&Òñs!ùqÝ:’ùºëï+åòÿú(4ÔR¶aiÍÏ'G–,áÖÞwßòÞ–»&8xêFÀd@l¸ž6½ í�icYÒG¬{ö{M i«¯'Ÿ¤¤è·%$„Pßáë».88±ß¾³‡Î÷Üúõ½úþ=(è½-wCxø }Žî¹H›hj[3þêÕ1ìáÃhÍ>ƒÒ’Òj·§g Å?–¨í(«Ø=‹)[Qsq1,*®æÿ”y¤¥5×s9:€ÍÂõÎÒŽUÉš¶¢–Öä±�ë:»Úí¸!¨¯WP�6:??p,++;~ôҡƦóÔwxú1«“5-E-­3ûã{ùøÑŸ3›Î ¶oIqñÍ}‹Š`Q©p%ÿ§o{ó=ÜÔdL šxÈdê5aeÐìrée�©È¿²Z*m8±s§�¬ ÔlÌH%@J�rŽaÈzµúÊæ |]Ë8ôòËñÂBv¯Õh¾ÛºrϬY]ž­òöþït ­Òyæ�bwž-�1;ÏÆm�1ÿþ÷¤æÝwÉ–¨(’‘H}G€¯ÜûÍ>ù¾óΠú®–KÿÕ7_¿>úú$ ôvSnf•DRV @6$cêÔ�@t:vµX\UδáÅ�ÙÊç·}2cÆL óÆæÆ1cþ7U©´Ÿ[²„è÷ï'?íÜIÖXÖÇÆú{®$M«ýÕJ¹4ç#çAdrÔVƒÚ�,€¬“ˆ›×=C}GŽï&mÄc.ß ÃÌwÇ´Ä—<|+ûâ›—‘q³ýÖÓʇ#÷Ü%á¬Q£"­­“~PÏc¾þSeÕÛ�!Jl¥¥º‰„Ì�¾çóÍöØè?.Ê>»�Û¶-TTl˜.²*‰¬ÝõøñÍ«<™s¨©ÙîPcãåWŸþõÞ¨Q_üLˆåGBä9‡8ÁE€œæñÚ/zy•_ N›¶ê¯ÏÏýxßê;r|3›*\¾…ÃÄ÷¢Ó÷ÏU½_å¶m/ò+*R=}ýƇoLLOû·Y§Ó±YYY¤ç­  ‡_Ý'5"â/‰“çBÜ·öΛ'þ›HTqàÖ uÏxÌ}V$„°ïóùÍ?¤ å�)bYò³BA ß{¬Q«3p‹¾ÃNètü­“&ùïNNV5wnÀî„5¢'1Ô·“ÁöÝ ¾Û¾]¶iáB¯Áò¥ vLž<i]PÐk›'LèÒàïÃhíüƒ�×à¬^Wä2@Î$M¡¨Ù2v옻µÍwõíä^õÝ5塉=ù¦Ç<ðÛ{Ѹ‡¢,ÑéØ}˜LB(�±9ÄÜQ~Æþ\Aµ·ÿ]=Jµë鯦j�v�6��N 壓’¼pìØ™AÞü>C}ï}ßçÏKå‹``}§.xáØ‰aç{»Œø€µsÚ´û¯•-³4›~-‹Õ2b5›y–¶6++Ö0<^±Tí{D® ÌäÉåÕ=uO»F£ÎxX_ÿR8€J�çx¼V‹Jõ¹T&{wyE…ÞsÞº$þ÷Y�’’¸+VçÛûCõ½÷}KŠ–[›MO‹ÄbµÜLJX\¾A-ÃçÝK¾}eD¬t­öC/»}დ'‹ÔZ-ãåçÖÛ<…ðò‚ƒaФ×ãÊùó(<~¼µµ¶ö¤<<ø½¥gs³=—süí¿„ä¤nÉ`Æ[è­ÈûúmÕ_¸§»Þ—v<üð£åe°´µ=( % _`µÛíz‘\þ…20ðóE¹¹ú6úRß~úúkµŒ¨ß–ššSŠˆ¿u÷=ýÖ[Á§ÒÓwõÇW —ïó üt(|ûÈ X«}GÄ……GÇ=ø øJ¥;¹Ó-Ù+k +“¡ÅЀÜíÛìYYÆ.^<'á7zm4wíØ1ï=‹žV^­‰ÒÂSED@üì³N.ÇÕÒRrqïÞ–‡e Ožù¤·åQ_ê{§¾Œ\žÓ÷ÇÛí—OœPߟöíkaX2¨¾ýeD6kHÒþ#J"}$>4<–ugäeºåÀse‘Ò‘É3ÙÑ SFŸþàƒ7’l˺Œ]9é7Ébrâí·¦xåÕâɦuÀJù|Èf΄Ð×|±"• š ˜ø…‹D×*«æ>ÒÒ¢8P_”úRßAñõ(�^JoD$Ïdƒúí+íÁ7¢¦ê+s1™Å÷Nq+]«}JQS«›¨Ñ0®ôá àθ빓ÝegêpWYˆø/¡½±qFÎÆ1/L™røëÒÒ.=B–ìÉTüóõeÅO ¸S•ÛÊË;&±`Y€°"!Âgφ>/oÊtŽ;ýM]Ý€½½O}©oO¾ ǹ“¶Êúík//ï\g7ß°”ÔåçO™îp ¨ï2¢Öîädic~þçÓy<µ—+/pÃÙÇuv"Ÿ=w>Àãó‘’‘J•·çãisÂ#þñm}½Ùµ®.fïOlj޼á Q› öŠ X –ëã�`X>‘‘ÈÙ¹3äX{{õ¥¾wìÛísO¾ä&¾¿ ÛÿÁÐq[¾••]} ÃãAœ;BÊw Q]$›ÊÊž no’±, vžU飈ÃÑyÖq8Ü©–çβk>WÊ)pÆ>ÿ<Ä*UâÁ¥K§ÇÅ=¾,/¯ió“$GóãïÇMúß!ކ´öl%%¿ò @lz=ìV+!�Ãàú‹¦Ô—úö„±¬ì ·¯@г¯kšsèîË:=]¾ñ×}yú¶÷Ñ—[]ìV7P¾ÁˆªaM#$mŠÙ&'0›»œϱëòÀ9Í}?Àã³»Ìqð‹Š†wdÄè’Æ­X²ä«ûfÚK¿=øÎxŽ œëö|:áYv à‡‡Ãzív¾ùfSXbâÒøòò*êK}{ãQB6vñå8gh軯»öÅqðŠ†²›oY_}›šÜw 1«$5UTrðàºI'âÁY6›A:::Ï. ãÞÙ�z¾Œp–‰Ç'„� PÇÆ¢ÝÐqî‹ÏøÏ~öùѹQÚà"CÃC €‘¢ó‹ê¾“9� .VVâpff&&fÑÂììãÔ—úÞ _WÐb†¡ï@1bVìÕ«cGéõËÇx|Ï Ð¹sÛÚ@àhhpŸ™×=Ï ûÝ�†ã8i2.îÚ=uëÖ­i§Ôþ_‡ù©ŽäÖBò :âj€­P Ÿa¸>¿ãË4·*dk4c´//ÎÍý7õ¥¾·ëë£×/×öæÛÑÑ'_wÐêî›þá×aóæÉ­3„ä",rúÖ�¨vú^âóÛ Éw 1í°RÃCÿ<¶¼b]àNî»Ê]¦3 …¼ÐPð´ZðÁ:Û°0íZXÏA.Gþ¾}8»eËÆ×JK_s­{wr²T"6ÖÖÙl,cå$b¥´IùâS§%•/õ¥¾=ú†„€÷À·ôõlŸVðå—ÈÞ¼ù_žPØêô…Õ&–(†Áô(FLÀZà¿õñÚº—qãμÎøùAüÔSàk4€kÇ:z6̳Z,Ø6{öO!IIã{zía¨ ¾÷¶ïš�ÿ­³À—§Ñ\T¾®²ÕbÁöÙ³ó‚“’ÆÝMßbÄ$¡à1lˆ×°®tLži™<§¹æa=¦ƒmÛ·ÃÑÐ�b4‚3™Üc‡Ñ®¹œÑ�Îj•†«Twõ»¡¾÷¶/€|¹î¾F#F#ˆ‡¯Ãj•ÜmßbD4k �³Æbe¤¸¾ÓÝ7 �XЙ¢I@Þm^�W] †Çs?"v=w8Ë•99à …™mÙbBÅ.PßëÔ�ðF|9Îí[5 |’°�€@çã<Æ� Øë•Êïy Ù)–0ÎáPXM¦±ÄbŽUÚì>¡�‚�È„ÂΧ)&“»‹«=Ëq¨+)Á÷Û¶]âËdïÁpw/å©ï½í †±·öå+d'¾ñÄbŽë«oÖpñ FDÀb�’&—×´46Båœæ:]�HFšò»eÿ£Ó¹û "„0Ÿ>ñ„’´´•Õ×ÏÌ«­}ÂÞÚ:Î÷‡ä Fùú2B™ v>íV+*._æêëêÎúÆÅ-]|êTÝ]uB}¾2YmKCÃøÎ¶·¶Ž ¾ɈX�à`Hy€\?�å�ã™î¹sÀÙ¯O“sÈÛ;oÞº6›A.r5U•ú˜ÂââX–eýù/3±ÛëxRyNì‹S²SÒYº¯ûn@}©¯çü=ùM2»™ ¨ªÔÇÇ0,«áK¼ÌœÝ®çKå¹ÃÉw 1‹p¸pàÆ,ñ˜î�8///{oÿï|BÒì |uÃLµ¹w õíä^õe8œïÉ—8Ñíûð÷(FÌ“IXØõA‡®OOT�+Ê&tŸ?}êTÕžùóݧ¨ï½íë–Ó“¯€¡¢ì¡îótßbĬW³²:¼?Ô ëãß8€µ´´¿ªÓéÜ.›"#WªªÉïJW)•©›£¢n¶Üá õýåúÚZÚ—ÞÌ÷}¥2m$úƒúj!„™råJä£pÌLöV¶jllîi>tl²z]Þsñ1 •WjæÃõ¯R�Åííö üŸ öú>K˜ÚÿÅ9«V W®’ªcb&]ÉÎ~fºTš¸©éò€Éõ�õ¥¾ÀÀùÎ ' x›=}ýbb&^=›ýÌtÉù®D>jßaÍ›7 Öß÷á'ÉÉäÌÊ•äï ·uâÄ0Ïy>Šyò}…âô¾£*V)•ëWûûK{[æÿ'•þ»)ÄèL!nÈw�ù …þþ¤íÙg‰eåJb;z”8êꈩªŠ|:{¶ù•*…úRß‘êk=rÄíûÙOÜußÇÆ>áò}_©ÜЛïÞ!ÊåØ/>I™ñtFH1lÚD:~.$?®[GÒ"#_wý}¥\þ_…†ZÊ6l ­ùùäÈ’%ÜÚûî[ÞÛr×OÝ(˜lÝv²+x@ÚÒÆ²¤-.ŽX÷ì!öšÒV_O>IIÑoKH¡¾Ôw¸ø® Nì·ïì¡ó=·~=Ùù†‡ï_ºûþ=(è½-wCxø }ö…A‹x‰¦¶5ã¯^Ã>ŒÖì3(-)!­v{z¦ÁPüñc‰Ú޲ŠÝ³‘²0âRájþO™GZZs=—£Ø,\ï<ì¨ÑX•¨i+jiM °®–®v,nêëÁ€Ž†ÀÏËÊÊŽ½t¨±é<õ¥¾ÃÁ÷ˆÑX¨i)jiÙßËÇþœÙØtn°}KJJH‹Í¶)Ó`(Þ5}êsiÅžY„HÙÊJ˜ oÛ÷pS“15(hâ!“©×„C†`?K(H5@þ ÕRiÉ;½�`m fc&@*Rs CÖ«ÕW6O˜àëZÆ¡—_Žß²{­Fó݆ÐЕ{fÍêò„d•·÷§ m•γ»óìdˆÙyvjˆù÷¿'5ï¾K¶DE‘´ˆˆDêK}‡¯ÜûÍ>ù¾óΠú®–KÿÕß 7ñý»ÆÿxϾ> ½Ýw³J")«ˆ ›�’1uê� :»Z,®ªFgíb€låóÛ>™1c&�B˜cÆüoªRi?·d ÑïßO~Ú¹“¬ °¬õ÷\IšVû«•riÎGÎ/ÕäÜÉVl�H@ÖIÄÍkƒ‚ž¡¾Ôw¸únÒF<æò½0Ì|wLK|É÷ò¶|/&úýûI^FÆÍöoXO+¿ƒvI8kÔ¨Hck뤟�Ôó˜¯ÿTYõ6�D…[i©n"!3€ïù|³=6ú‹²Ïî�Ŷm ¦ …¬J"k·C=~<FEGó*OfÅjjvçJ;ÔØxùÕ§½ƒ7jÔ?bù‘yŽÃ!Î#Dp §y¼ö‹^^å×BƒÓ¦­úëós?ÞwúRßáê›ÙØTáò-¾¦ÖÖI¾®¨úkO¾'»ù*·m{‘_Q‘êéë7~<|cbzÚ¿Í:ŽÍÊÊ"=oÅrøõ×}R#"þ’‘8y>!Ä}9¾wÞ<ñßD¢Š“�·^ ¨ûxÆcî³!„}ŸÏoþ U�)HË’Ÿ RøÞ{dZ[ôáuB§ão4Éwr²ú«¹sv'$¨É=™ ¾PßõÝ N¾'.ôêÍ÷ÒM|W«Õ»0‚úàs³còäIë‚‚^Û<aB—pFkç¸gu³ —r i EÍ–±cÇÜ­m¾¨o'Ô÷ÞðÝ5塉kƒ‚þØÝ7=æß¸¹oí@øx´#:»¯ @“I 6‡˜;ÊÏØŸ+(°öö¿«G©v=ÝØ´@ ÀÀ ÀI |tRÒ‚Ž;3ÐÛ{§P_ê{3FªïŽóç¥r‹EÐWß5£|2žj¼öR¾—G'M}ñ…c'îØwÀÖÎiÓî¿VR´ÌÒlúµH,VË||ˆÕlæYÚÚ¬¬PXÃðxÅRµï¹&0“'—W÷Ô]ë:ãa}ýKá�*œãñZ-*ÕçR™ìÝåzÏyOè’øßgHJâV¬XAœo³Ô—úÞk¾%E¿·6›æ ¤¯U¥úB"“½ÓÝwï¼y¼KÓWß XéZí‡^vûÂ'O©µZÆËϬ·7x àåàI¯Ç•óçQxüxkkmíIyxð{KÏæf{.çøÛ ÉIÝ’Á2Œ·Ð[‘-öõÛª¿p!Ow½o3ìxøáGËËþ`ik{P$J¾Àj·Ûõ"¹ü e`àç‹rsõ7là�C}©ï½æ+²ÛŽ›<Yä¯Õ2¢›ùž;‡Âï¾km©©9¥ ý¿%99g=—sú­·‚O¥§ïrù*ü¶VçÜè{írÙrskÛ8‘P(_`qØíu¹|ŸO`à§½ùÞqÀZí;ª .,<:îÁÁW*Ýý3Ý:ÿweñ`e2´»}›½"+ëÂØÅ‹ç$¼ñF¯È®;æ½gÑÂÓÊ«5QZBxªˆˆŸ}¢qãÀÉå¸ZZJ.îÝÛÂò°láÉ3Ÿô¶<êK}©o§olhXtü¸q½ú2r9x2L†œÛ±Ý~ùĉ “^}õ×ã_{­æN}¯””’¼/÷µ0,¹¥ï=qHÒþ#J"}$>4<–ug¨eºå„se‘Ò‘É3ÙÑ SFŸþàƒ7’l˺Œ]9é7Éêqâí·¦xåÕâɦuÀJù|Èf΄Ð×|±"• š ˜ø…‹D×*«æ>ÒÒ¢8P_ôNܨ/õ¥¾]=]y½”ÞˆHžÉ%&ŒÎZ¹ò/·ë;ÉÃWÚÝ÷¡ LÜK EMÕWæ>b2ÝÔ·ß+]«}JQS«›¨Ñ0 �p\gN)OiwÙ™JÛU–"~ÁKholœ‘³qcÌ S¦þº´´K‰%{2ÿ|}Yñ“�FîÔݶòòÎ/W,X ¬HˆðÙ³¡ÏË›2ãNSW7`o³S_êK};´º’¶Êúík//ï\g7ß°”ÔåçOyÌn?s ¾¾¼ûv÷+`íNN–6æç>ÇS{¹2Ò7DcW´&Ÿ=¿ €Çç#"%"•**oÏÇÓæ„GüãÛúz³k]\ÌÞŸØÔyÓ6ì°, ÖǧóËeYøDF"gçÎcííýñ£¾Ô÷àûÙtÏ¿GßnŸ{ò%7ñýMhØþo †Oß„¦æÈž|++»ú†Çƒ*"¹;w„öäÛ¯.’MeeO··GÉX ;Ï2ÎtJÄáèŒÂ‡;õãÃYvÍçJÁŽÃØçŸ‡X¥J<¸téáô¸¸Ç—åå5m~r‚¤ãh~üý¸IOƒ„ÀÑЀöÏ>ƒ­¤òfs™º�� �IDATW^M¯‡Ýj%`\ñ²¿P_ê{Où–—Ïno–±, ôìëšæºû²NO—oüußCž¾íGóãÆôÁ—[]ìVדo¿jXÓI›b6‡É Ìæ.™ñ»ªËÎiîëcÏî2ÇÁ/*Þ‘£K·bÉ’¯îK˜i/ýöà;ã9N$p®Ûó)gÙa0€ëµkØùæ›Ma‰‰KãËË«úãG}©ï=íËq»ørœ34ôÝ×]ûâ8øFECÙÍ·ìÛƒïÞ¶oX¬MMØùæ›MÁÓ^[v¹²û¶÷9`•¤¦ŠJ\7‰ãD<8«‡f3HGGg´e·¼§Xig™x|„�êØX´"Î}ñÿÙÏ>?:7J\dhxH0Rçw—æ�tH$¸XY‰Ã™™5š˜˜E ³³÷ÕúR_êÛw_WÐbÈ7 >fñ¢SgÿÙÓö÷9`Å^½:v”^¿|ŒÇz S¶­ ¤¡ކ÷™Šq]#{ŠÃ㺿ÛÂp'MÆÅ]»§nݺ5í”Úÿë0?Õ‘Ü:CH>!ÂB‡C\ °µ�ª�ä3 WÀçw\b™æV…lfŒöåŹ¹ÿî«õ¥¾¿_½~¹¶7ߎŽ>ùºƒVwßô¿›7çHn!$aQO¾<^Ç%ëö]”ssß>·ÃJ ýóØòŠuq€;]¶kì*w™Î0` ðBCÁÓjÁ ëlÓÁx´ó`=¹ùûöáì–-_+-}͵îÝÉÉR‰PØX[d³u°Œ•“ˆ•Òz$å‹O”Ô¶Ô—úÞK¾iᡊ/¯Xßgßðxà–¾žíÓ ¾üg6oÞôÇÒRw/¤»““¥<¡0°½¦æ>‹ÝÌÀj‹¼å <¡´ìv}û°Öøo}¼¶îåÀänç `üü ~ê)ð5À%êl€çÙPÍj±`ÛìÙ?…$%ïé5€¡‚úRß{ÉwM€ÿÖYàËÓh®*_WÙj±`ûìÙyÁIIãÒ·Ïi¾x "D絤+=‘gš"Ïi®yXéÄ`@Ûöíp44€àL&÷Øa4‚kng4‚€³Z¥á*Õ]MEF}©ï½äË _®»¯Ñ‡Ñâáë°Z%íÛ§f `ÖX¬ŒÔCÊ9Ý}󬀀)‹�äÝæå�pÕÕ`x<÷#S×#a‡³\™“žP˜ùЖ-¶;¶ì'Ô÷ºõ½7|W÷ÁWÀ}ðå8·oUN¡ðð@ûö¹8€NÎc �™€½^©üž§b #à…ÕdK,æX¥Íî €L(ì|º`2¹Û|¸Ú·°‡º’|¿mÛ%¾Lö ƒr)ÛP_ê{Où2Œ¸¹oÒû¤@!ÿž!ŒÐápxÛL¦8b1ÇõÇW(“ýß@ûö)`1�I“ËkZ¡rNsEç �©Ó¨SS~·ìbt:wß9„æÓ'žP’–– ²úú™yµµOØ[[Çùþðƒ<P£Á(__F(“ÁÎç£ÝjEÅåË\}]ÝY߸¸¥‹Oª@×>C}©ï=ç+“Õ¶44ôè[¯V§¥,[öÿÜÊ÷§ÚÚ'½øêêÎŽ$ß>×° )o‚ëÑ™�(¿ðÈtOY�pösÓäòöΛ·®Íf‹BMU¥>¦°¸8–eY¾ÄËLìö:žTžûâ”ì”´C–îë¾P_êë9ÿH÷åRv3_ßÈÈM·ã 4ɸöÿ¿½óoâZóÿwf$Ù’,Yr‘en886.¡„B~æRÒÜgó¤Q’° !÷¦ìÞ»—ÝEûlH€¥˜0=‚y’›\¸€.v¨¶Á½›d![¶lÕ9¿?, Ùp…óy=3gÎÇšygæœ3çEHù ml^~þ`0L°P*næíöj‘TöÛà·FŸé*ßX„Ç¥ € °Äc¹ཽ½ííý½³Å ÎùÉðý+åä<h±º êÛõ½;}Í÷ðåÞ«ã¾õÎÏut³ï×àK""Îk…BÖ­ J�úÒ¢am×ß0nœr÷oÈÛ.ï+P_êëI_÷õŽˆÈ¨ Ûú*�Ü*-ÞvýÞæûÀk~zzm³¯ü|%Z7‡Æ¬¥¡i¾F£qos}TÔR^^©;y¢p™B±vSLLð½¶Û[¡¾Ô×µîãâkö•gÜÍ×ÜÐôþ]|+t'O~©P$÷߇zùù÷ ƒkËnV¾1·{žJä75 ´_ºôZD¨÷ÿ6G¨‚ÞzuÙ2áØ¥Ë¤ªÁƒGÞ<{öµ‰RivšÁPÒiwÂŒ¾y3êy8&'ù*L‡õúº»­§†MGz»Û£¾Ô÷Iñµ]º¤z5<\œ$ä6…½5ãËßÀÁƒGTœ;ûÚDI×ûv:©©©ÜRéåR´¤Ôv %¥¶ '�ò@rƒ‚ˆiæLbYº”ØŽ%Žšb,/'ßN›fþJ©œÚUeûmÓ&áêÐ÷$%‘3K—’ÿS«ù”#"<×ù:að‹_Êå¿~à_ºL¡X½<(HÚÞ6©/õíqß/¾¸«ïÆÄ¸éí{]¥rûZqûî>½K}»Œ5‘‘¡ë„B£­´+­v3@š�bbYbŠ'ÖÝ»‰½²’˜´Z²gêÔê-cÆ„uE¹öLôòް0¢[¿ž4_Ï%¿­ZE’£¢>rý~©Löo_‡‡[ŠÖ¬!ÙÙäȼyüʶ·Ý¡¡ã¨/õí ¾ë¢¢>öðýäa|W…†Ž}hßi]çÛ=DršÁPŸr"¯¡aN"Àº*ð\ý:ÜhµàsrÀÆÆBže}ŠŽ½vXo¸øˆå¿ƒ±FÓŠ¡ƒØ´44ž=ƒÂ‚Òh·o8¤ÓåóÂØèæ¢Ò]S‘²¥¥0ççâT¢"ûê¡# ™žÛÑ�l:nv´¾¾<)DmÊkhL¢¾Ô·Ç| IƒÍ¶þN—¿sâ¸AæÂÒÝS‘²ee0çåÁ¢T¢2ûêáö|Ô×ßH Q7ä54Nîov¶Û—pœOÉñ£×é :Û·=é=Ÿ?Þ¼y¾V¡x~“PØt-²®ñnØ6äå?rÚ”ü¶f ®=bÙï@°Ž¦FU �ožGÃÅ‹(¸|ùVì§Ÿ�m^Ñ¢X»ÝWd0Àqéj÷ìAÆ·ßVJƒû¥º¶qøÝwÖD„í’©Õ_¾t÷”)î’?Þ¬\«•ËÿB}©owùòM­|/]rûÖ^/üÐí{ñ"j÷ìAæ·ßVJ‚ûíkëë£:vßuZùŸ;䛟ïöÍ\½Ä^ÔWãIŽŽŽX*“f| ËÎga»Çí¥ :€¤d•D\·²ÿ׺¨(Ì2‰¤è†së²cܸ·€h4ìr±¸üZÒhç$E 0í™4i2ÐR±¹nРÿ^«PØ/Ì›Gªü‘\ݾ¬ ¶¬Ž‹ jãûOÔ—úöß¹sïë»>zà .ßK÷ñý¥ë}Ûå‘Ò|¹8¬××=÷—Å[ÕGêuB,¿"Ëp8ÄY„¯�äWŽkºâí]|+<4yü²¿¼>ã›ý—:c¿wcŠ¿T}cãÈ«�´óÃÊÊÀ@‘Hb+,ÔŒ Dhð‹@`¶ÇÅ~8çì¹ý� ß²åmai隉"«”HÀÚíP  ÿØX®ìTúàÆ:w®´Ãz}Éü—_ÙÆùûԷ«}ð=õ¾‡ô†R_ëÝ|/{{—t‡opR£¤Œ´+)IõýŒÁ»ÆŒQ‘ÔÔN Ží‘öÑG~küdÇØQoBÜ㩳f‰?óò*=ð«…šo&½à¾JBØ/‚ºë�)H1@òX–\—ËIî矓*ÕÜgì0êK}»Š{ùžœ=ÛÛå»ö}—«T;ÑŽï®1cT=áKñ`Û¨Q#Wõï¿hÓ°a­:ÀmŒ~ã À×:o¯ËR‹�I–Ë+7'&ê©2? Ô·…ÇÙweÿþÞÍ÷À½}«úª/ð#ŽöVˆFÃîÏÉ‘ÀhAˆÍaææâ3ößçäXÛûÛåþÊ/ë o«�ØØ�”8%÷›0áí7;ÓÅÅ`¨/õ½+üýv¼¤¿õÎ]|KúM˜ðVoôí(}>`m?þ©[y ,uÆW¼Äb•Ÿ±šÍœÅd²²"Q%ÃqùRUÀ™:ä'“ݸÛp­+ÔªÏVk߉PàÇ5Z”Êï¤>>ÿµ°´´ÚsÝ“š ‚_ÒL˜À/Y²„8ßfï6¨ïãï«/ÈûWkñÕ_%o5[m}¥~? ýýovØW¡H•Êd‹Ûú¦ÎšÅ]Ó阞ò}PútÀÚ½ÑÛnŸý̨Q^ªèhÆ;0¬¯/8¹ðö†ƒa`¨®ÆÍ‹‘{üxccUÕ)YdèçïŸË<ë¹ã‹? ËX»yË0¾"_ùYq@`Jõ¥KYšÛc›aÛ³Ï>¯/.úÀb2=ã%IÐj·Û«½d²}ŠïædfVßQ@êK}Ð×ËnŸ=¤=ß {âDccUÕ)EXØgó22ÎÝÏW˜r#ãNß[%E ͦ!^"‘¡Åa·×t§ïÃÐgÖò�ÿœøˆÈØøgž@¡pöÏ´üߕŃõñAƒ®™[·ØKÓÓ/%Îûê˜?®ho?·ŽóÝ=gö¯ŠŠÊ˜hB8åÀÏœ ¯!CÀËd¨(,$WRSX fŸ:³§½íQ_ê{/ß¸ðˆØ„!C:ìkÔÕâ7§ïÈùó_ºhQå£úÞ,($W÷w½ïÃÒ'kþ7ÄDÿ5F"}.!<˺3Ô2mr¹§Îy/…/¢’&³ýÆŒî÷ëW_}<Áf±¬Ú±3cÃ=²zœ\ü§qÞ›Ÿ?ÊØ ŠX©@�ŸÉ“! €@,†—R õ°aLÂì9^·ÊÊg<×Ð ? Õ¥¾Ô·;|½=|Ó—-ûd‚ÍbYõïÊØž~_ß‘÷óÞõ¾BŸ X¢£_’WViF¨Õ �<ß2D†3™£ç—ìž'ävÚmB AÂÛï I¯Ÿ”±nÝà7GNû¡°°Õ‰»ÉÿþÑ‚üôÜ©»mÅÅ-“X °,@X/"§MCuVÖè‰<ÿëßjj:ímvêK}Èwß¾Nõ}Áá8s@«-î,ßG¥O¬]IIR}vöw9NåíÊH ´ºê¸Ói{d£E›/Ÿ�à œ:^JeLÖîoÆ¿9ð¯?kµf×¾ž¾röDZ†º¨Ð¶…°Ù`/-…57`Y°~~��†eá…ŒíÛÃŽ55í ¾Ô·ƒ¾{'r\PwøŽ1ÔEÝñÆò}}ŸBf'úv<DrOb,*z1´©)Ƈe‘¨å*ãL§DŽ– ‡;õãœÂ9ïZÏ•‚ <Ä×_‡X©{ðý÷Ó6ÄÇÿnAV–aÓ‹Ã$ÍG³žÂ=^¶$ŽÚZ4íÝ [Adï½[u5ìV+!�Ãàö‹¦Ô—úÞú¢¢é¡MM±ÝáÛt4;aPûv}êk<!É£Íæ!€ÙÜê*ÄxN]·ËÎeîú�ŸÝó<À˜XøF ìWpàÀ%óæ}?`Ìd{áÏÿs(Ï{ ûölðœwètDFÂzë¶ú©!bìØ÷Š‹Ë©/õmç Y×]¾Eâ«Á€íŸ~j?f~bQIYgøv}&`¬]ëUpðઑ<ïÅÁùŒo6ƒ47·\]Æy¸Ïmµsžx|á„�ª¸84éj^Ø·W0sïwGgÄD‡æéj‡ËFŠÛo±»p%žl–Hp¥¬ i‡Uªž3ûìÙãÔ—ú>¾Á ƒçÎ9}îïáÛYô™€WQ‘è_]½pÇÿ™Z¾\“ ¤¶ŽÚZ÷•ŠqÕ x~Ñðxîos�0<‘£peç®q)))ɧUA?D*dÖè² å:â�[ @6Ãð9Aó5–©k”û¬PŠ~wnfæeêK};êëW]½0º|³ñÊ»‹ï5ŽkÎáX·ïœŒÎóí,úL?¬µ‘áL,.]¸Óe»¦®ùVËŒ\.<\t4¸°>>`œýY\ýZXÏL†ìýûqnóæu‹ ¹ö½+)I*‰BôUUým¶f–±ò±Bª…PR<÷ôé.IåK}oßäÈð?$—®îß³›7¯ÿ°°ðƒ¶¾†ÊÊ»™a¬¼Dä+Ñq"iQWùv}&`­ Jù]UÍ»!¸óËìÈÎBüÒK¨Õ€ó eœð<;æY-l™6íjØ„ CïöÚCwA}©ïãäÛY<Òˆ£Ý ǰa"´<úÒy¦)ò\æZ‡õXNt:˜¶n…£¶¤¾¼Ñèž:êëÁ×Õ¯¯€·Z¥‘Jeþo¨/õ}œ|;‹>Ñ­�Ì ‹•‘âö—è\î®,Ôа %e‘€¬Íº<�þÆ 0çn*v5 ;œóeàD¢CÃ7o¶u£b+¨ïm‡ÇÕwy7ú2"QZOúv&}"`�8€–/Œ÷˜À!À®U(~áä>§YÂy‡Cn5‰Å§°ÙýÂôà#µ´Æ-}\<ú·°<š‚ü²eË5ÏçÐõì£<õ}¼}Ùv|k¾§rÙ)–0B‡Ãák3Æ÷Ô–-×D>>ÿÛÓ¾EŸX @’e²Ê½Jç2×Õè@jÔªµSÿeÁ ÖhÜcB˜o§OW††þEZí䬪ªéöÆÆ!çÏËBÔjø0"Ø4Y­(-)áµ55çâãߟ{útMˆ:¡¾O¶¯V¥Jžº`ÁŸÛñ}ÑÞØøLÀùó²~j5üœ¾�&§¯®¦æþññïõ´ogÒ'�8Rl�†ÛW# `#£6x~¹�à×Çàüd¥ÎšµÊdÓɼ"uyYõàÜüü8–eƒo3±Ûk8©,#î­Ñg§&¶´ÝwO@}o_ž!E÷ò ˆŠZßQ_±M\vC{=??ŽaµP*n&v{P*ËüÖè3½Å·³è3‹ð¸TðC–x,w�¼···½½¿w¶Ô9?¹�¾¿c¥œÞ“¹ˆú¶ð¸úò<.w¢ïuôrß΢ϴH""Îk…BÖ­'J�úÒ¢am×ß0nœr÷oÈÛ.ï+P_êëɆq㔞9ŸTúLÀšŸž^Ûì+?_‰ÖÍ¿ñ�kihš¯ÑhÜ.룢–òòJÝÉ…Ëе›bb‚ïµÝÞ õ¥¾®u¾º+—û¬ïÉÖQçl@l�iÈf€|éë»qãÓO½¶Z­:}`øpÞôÓOÄQ«'¹ûö‘-‰‰%k"#'vuù!LÚ¼yQ)C^OŽŽŽ¸×zh\Çè}¡¾O®ï2_ß .ß¿ ë_Ê#’ššÊ}!•^.mó%r ?�$7(ˆ˜fÎ$–¥K‰íèQ⨩!Æòròí´i比ʩ]U¶ß6m®°qOR9³t)ù?µšO1¢ÕAýuÂà¿”Ëý*À¿t™B±zyP´½mRß^èûÅwõݘ7½³}¯ßÛ·¹+})ÄšÈÈÐuB¡ÑÖæKv¥Õnv^¥L,KLññĺ{7±WV“VKöLZ½e̘°®(מ©“^ÞFtëדæë¹ä·U«HrTÔG®ß/•ÉþíëðpKÑš5¤1;›™7_9`ÀÂö¶»"4tõí¾ë¢¢>öðýäqòí­ô™Ñ\¤ õI!!'òæ$¬«ÂÒÕÅ !€V >'ll,„àYÖ§èøÑk‡õ†‹]®±FÓŠ¡ƒØ´44ž=ƒÂ‚Òh·o8¤ÓåóÂØèæ¢Ò]S‘²¥¥0ççâT¢"ûê¡# ™žÛÑ�l:n–v´¾¾<)DmÊkhL¢¾½È·°4Ølëétù;'Žd.,Ý=…)[Vs^,J%*³¯îtßìl·/á¸.óí­ô¹€�iFcÅX¥òx–ÃñÏA</”ãvëã1e�½ŒR‰ÚÜ\¤o߇ÝñåaƒáFg–G°nµõó"uUUȼuëVâgŸ}°ó§Ÿì㬶ÿ‰­7>l6Ã^] CVÎWJúõ_t°ªª �¿ûnƒ~¹Ð[üÁ´€€§ß=:Ó5.wš±áüh__s6Ï¥¾=ã+dñáp«­¿ÛW¯wû>g±Þö­ª‚!+ ÿ(.®ßÅWàí½pZ@`̾2_s6鸯>7'·më_J‘±T&Íø —ÏþvÛi3@t�IÈ*‰¸neÿþ¯uQQ˜eIÑ çþÖdǸqo�ÑhØåbqù ´¤ ÏHŠ@`Ú3iÒd ¥"wÝ Aÿ½V¡°_˜7Tÿø#¹º};YlYÔÆ÷Ÿ¨oö;·S|ézß^KŸ¼ÃrqX¯¯{î/‹·ªŽÔë„X~#D–ápˆ³^ȯ×tÅÛ»øVxhòøey}Æ7û/uUY¦øûGÕ76޼ @Ë1?ü¡¬|1� ‰$¶ÂBÍB„f�¿f{\ì‡sΞÛ�ò-[Þ––®™(±J‰¬ÝÕСðåÊN¥>l¨sç†;¬×—Ìù•mœ¿ÿ>êÛý¾Æøžê$ßk„Xïæ{ÙÛ»¤;|)ÝÀIF2rdЮ¤$Õ÷3fï3FERS»%(§}ô‘ßÚ?Ù1vÔ„wõCê¬Yâϼ¼JOüj¡°æ›I/¸¯Š„öK î:@ÊR <–%×år’ûùçd…Jµ÷i§¾=ï{rölo—ïÚô]®RíÄø¦ŒÔ]¾”'˜m£F\Õ¿ÿ¢MƵêð·16úƒ�_ë|œ(H @.$Y.¯Üœ˜8¨§Êü(<‰¾+û÷ÿðn¾îí[ÕW}{’>3âho…h4ìþœ ŒF䀨fn.>cÿ}N޵½¿]î¯Üù²Þð¶ €€ @)€SBaq¿ Þ~óر3]\ü†úvÜw…¿ßŽ—ô·Þ¹‹oI¿ Þê¾½°’íãÇ?u« o¥ÎøŠ—X¬òñó#V³™³˜LVV$ªd8._ª 8"S‡âd²wžv…ZµãÙjí;‘�Ê�\à¸F‹RùÔÇç¿––V{®{R3AðK:€ ø%K–çÛûÝÆ“è«/ÈûWkñÕ_%o5[m}¥~? ýýovØW¡H•Êd‹Ûú¦ÎšÅ]Ó阞òí+ЀõlˆŽÞèm·Ï~fÔ(/Ut4ãÖל\x{ÃÁ00TWãæÅ‹È=~¼±±ªê”,2ôó÷ÏežõÜÎñÅŸ„e¬Ý¼ƒe_‘¯ü¬8 0¥úÒ¥,Íí±Ü°íÙgŸ×}`1™žñ‰$Œ@hµÛíÕ^2Ù>EHÈws23«ï( õ}d_/»}öö|/\@î‰UU§aaŸÍËÈ8w?_yp`ÊŒ;}o•-47š†x‰D„‡Ý^Ó¾} °åþ9ñ‘±ñÏ<BáìŸi3ø?çœg}|Р«EæÖ-öÒôôK‰sç¾:æã+ÚÛÏ­cÇ|wÏ™ý«¢¢2&šN9p Ä3gÂkÈð2* É•ÔÔ–Â٧Îìio{Ô·ã¾qá± C†tØ×¨«ÅoNß‘óç¿2tÑ¢ÊGõ½YPH®îïzß¾mqx�6ÄDÿ5F"}.!<˺3ò2mr¹§Îy/…/¢’&³ýÆŒî÷ëW_}<Áf±¬Ú±3cÃ=²˜œ\ü§qÞ›Ÿ?ÊØ ŠX©@�ŸÉ“! €@,†—R õ°aLÂì9^·ÊÊg<×Ð ? Õ¥¾=ãëí᛾lÙ'l˪ÿSƆôôûú޼Ÿïð®÷í‹Ð€ÕA6DG¿$¯¬ÒŒP«�x¾¥÷1!-¯QxÀîygêp×¼,$ o¿ƒ&½~Rƺuƒß=:ÍÕÛÙEÁîCò¿´ ÿE�ý�wªr[qqËÉ#, ÖK„ÈiÓP•5z"Ïÿú·ššêÛK|÷íëTߎ3´ÚâÎòí«Ð€Õv%%IõÙÙßMä8•·+/Ðê*ëNî<À]?{ì�'`àÔ©ðR*c²v3þÕÈýY«5»öõô•³?Ž5ÔE…¶-„Í{i)¬¹¹�Ë‚õó�0, ¿¨(dlßv¬©iõ}hß½9.¨;|Çê¢îxcù¾¾O!³}û2}fˆäžÄXTôbhSSŒË"QËUÕ™N‰8-Kwª%Æ9…sÞµž+x‰¯¿±R9öàûï§mˆÿÝ‚¬,æ‡Išf'<…{Œ¬HµµhÚ»¶‚ÈÞ{ ¶êjØ­VB�†Áík©oǨ/*šÚÔÛ¾MG³õ°o_†Þau€ñ„$6›#d„�fs««.ã9u=8—¹ë?<~vÏó<cbá5°_ÁC–Ì›÷ý€1“í…?üÏ¡<ï%tîÛ³UÄsÞ¡ÓA ë­[Øþ駆ˆ±cßO(..§¾Îó„¬ë.ߢñˆ€Õ`ÀöO?5„Ž3?±¨¤¬3|û24`µCÁÚµ^®Éó^œuf3HssËÕ”aœ×½û<F8ç‰ÇN@ Š‹C“®và…}{3÷~wtFLthž®v¸`¤hù‚ÚÔ<€f‰WÊÊvèP¥zðà9³Ïž=N}Oßà„Ásçœ>÷÷ÎðíëЀÕq‰þÕÕ yW Ðr0›L µµpÔÖº¯ÌŒ«ÄóÀ†G=G›žáy„Œ…+;wKIII>­ ú!"Py$³F–Mˆ(×áß�Ø*�å�²†£& ��“IDATÏš¯±L]£Üg…zPô»s33/S߇÷õ«®^ݾY„xåÝÅ÷Ç5çp¬ÛwNFçùöuh?¬vXþÇÄâÒUñ€;=¸kêšoµœaÀÈåàÂÃÁEGƒ ëãÆÙÇÕ‡õüÈdÈÞ¿ç6o^·¨°p‘kß»’’¤‘(D_UÕßfkf+/+¤Z%ÅsOŸî’T¾OšordøŠKWw‡ïÙÍ›×XXøA[_Ceå�‹ÝÌ0V^"ò•è8‘´¨«|û:4`µÃÊà ”ßUÕ¼‚;ÞŽàL` Ä/½Z 8`ÆÙáг#¢ÕbÁ–iÓ®†M˜0ôn¯ytÔ÷ñöíëô™4_=ǰa"´<;»R¡x¦eò\æZ‡õXNt:˜¶n…£¶¤¾¼Ñèž:êëÁ×Õ¯¯€·Z¥‘Je~'Ô÷ñöíëÐn ÷�Ì ‹•‘âöAë\î®Õа�µY—À߸†ãÜMã®&p‡s¾,#œHthøæÍ¶nTlœ軼}‘(­'}hÀjp�-(ï1€C€]«PüÂÉ}N³„ò‡Üj4&‹9Na³û…èÀG$ji}2[úôxôçay5øeË–kŸÏ¡ëÙª‹'Í—mÇ·Fá{J —b #t8¾6£1áa|OmÙrMäãó¿=íÛסë>0�I–É*ôz(Ë\WßK�©Q«ÖNý—ÿ1X£qDa¾>]Aúiµ“³ªª¦Û‡œ?/ Q«áÀˆ||`Ðdµ¢´¤„×ÖÔœ ˆîéÓ5="ê„ú¶öÕªTÉS,øs;¾/ÚŸ 8^ÖO­†ŸÓ×!ÀäôÕÕÔüÃ?>þ½žö} « )6�Ãí«/P 0‘Q<f�pŽcdp~²RgÍZe²éd^‘º¼¬zpn~~˲A‰·™Øí5œT–÷Öè³S“[Úî»'xÒ|y†ÝË7 *j}G}Å6ApÙ mìõüü8†aÔB©¸™Øí5B©,sð[£Ïôß¾ Xí@x\ª�ø¡�ëùN„ཽ½ííý½³E¨ÎùÉðý+åätVq™'Í—çq¹}¯£—ûöuh‹E;H""Îk…BÖ­EJ�úÒ¢am×ß0nœr÷oÈ»¹˜õí€ï”)}Ö·¯CV;ÌOO¯mö•Ÿ¯Dëæîx€µ44Í×h4îÿáú¨¨%¤¼¼RwòDá2…bí¦˜˜à{m··B}Ûõ­Ð]¹Üg})O�[G Ÿ² <@�±¤ ›ò¥¯ïÆO?õÚjµêôáÃyÓO?G­žäîÛG¶$&–¬‰ŒœØÕå#„0ióæE¥ Ix=9::â^ëi q“÷…úÞö]æë»Áåû·a=ãK¡<©©©ÜRéåÒ6µ '�ò@rƒ‚ˆiæLbYº”ØŽ%Žšb,/'ßN›fþJ©œÚUeûmÓ&áêÐ÷$%‘3K—’ÿS«ù”#ZÄ_' ~ñK¹üׯüK—)«—IÛÛfŸðýâ‹»únLŒ›ÞÙ¾×ïíÛÜ•¾ÊC±&22tPh´µ9¨]iÄ›WeËS|<±îÞM압ĤՒ=S§Vo3&¬+ʵgꤗw„…Ýúõ¤ùz.ùmÕ*’õ‘ë÷Ke²û:<ÜR´f iÌÎ&GæÍãW°°½í® ×W|×EE}ìáûÉãäKi ­¡ƒ¤ õI!!'òæ$¬«‚ÖÕoÇ !€V >'ll,„àYÖ§èøÑk‡õ†‹]®±FÓŠ¡ƒØ´44ž=ƒÂ‚Òh·o8¤ÓåóÂØèæ¢Ò]S‘²¥¥0ççâT¢"ûê¡# ™žÛÑ�l:nw´¾¾<)DmÊkhLêÕ¾……¤Áf[H§Ëß9qÜ saéî)„HÙ²2˜óò`Q*Q™}õp§ûfg»} Çu™/¥54`=�iFcÅX¥òx–ÃñÏA</”ãv«ã1e�½ŒR‰ÚÜ\¤o߇ÝñåaƒáFg–G°nµõó"uUUȼuëVâgŸ}°ó§Ÿì㬶ÿ‰­7>l6Ã^] CVÎWJúõ_t°ªª �¿ûnƒ~¹Ð[üÁ´€€§ß=:Ó5yš±áüh__s6Ïí-¾B·Úú»}õz·ïsëmߪ*²²ðââJñ]|ÞÞ §ÆÜá+ó5g“ŽûêssqrÛ¶.ñ¥P:…äè舥2iÆ×�¹ì¬ë°{<>˜¢H:@VIÄu+û÷­‹ŠÂ,“HŠn8÷· ;Æ{�ˆFÃ.‹Ëo %Mz>@RÓžI“&-×ë úïµ …ý¼y¤úÇÉÕíÛÉÊà`Ë길 6¾ÿôXùÎÛ)¾¿t½/¥ ôë!8¬××=÷—Å[ÕGêuB,¿"Ëp8ÄY„¯�äWŽkºâí]|+<4yü²¿¼>ã›ý—ºª,Süý£êG^ å˜þPV¾�ŠD[a¡f!B3€_³=.öÃ9gÏí�ù–-o KK×L‰X¥DÖn‡jèPøÇÆre§Ò6Ô¹sáÖëKæ¿üÊ6Îß_oð5vÀ÷T'ù^#Äz7ßËÞÞ%ÝáK¡t:'5AÊÈ‘A»’’TßϘ¼kÌIMí–‹AÚGù­8ð“cG½AqW·¤Îš%þÌË«ôÀ¯ k¾™ô‚û.€Â~)Ô]H9@Š’Dzäº\Nr?ÿœ¬P©và>Ýz£ïÉÙ³½]¾kÐw¹Jµà›2rdPwùR(O ÛF¹ªÿE›† kÕÁqclô¾ÖùøT€\H²\^¹91qPO•ùQØ6jÔÈ•ýûx7ß÷ö­ê«¾O"tÄÑ> ÑhØý99"ȱ9ÌÜ\|Æþûœk{»Ü_¹óe½ám�;�€R�§„Ââ~&¼ýæ±cgº¸øÌ£ø®ð÷Ûñ’þÖ;wñ-é7aÂ[½Ñ—rwhÀêcl?þ©[y ,uÆW¼Äb•Ÿ±šÍœÅd²²"Q%ÃqùRUÀ™:ä'“ݸÛp¼+ÔªÏVk߉PàÇ5Z”Êï¤>>ÿµ°´´ÚsÝ“š ‚_ÒL˜À/Y²„8G+è6¶ÿ”¾ ï_­uÆW[|•¼Õl´õ•úü,ô÷¿Ùa_…"U*“-në›:kwM§czÊ—rhÀêClˆŽÞèm·Ï~fÔ(/Ut4ãÖל\x{ÃÁ00TWãæÅ‹È=~¼±±ªê”,2ôó÷ÏežõÜÎñÅŸ„e¬Ý¼ƒe_‘¯ü¬8 0¥úÒ¥,Íí±ë°íÙgŸ×}`1™žñ‰$Œ@hµÛíÕ^2Ù>EHÈws23«ï(`øzÙí³‡´ç{árOœhl¬ª:¥ ûl^FƹûùʃSndÜé{«¤h¡¹Ñ4ÄK$’@ ´8ìöšîô¥´ X}„åþ9ñ‘±ñÏ<BáNnÀ´IvÀ9çY4èj‘¹u‹½4=ýRâܹ¯ŽùøãŠöösëØ1ßÝsfÿª¨¨Œ‰&„SñÌ™ð2¼L†ŠÂBr%5µå°`ö©3{ÚÛÞ£øÆ…GÄ& Òa_£®¿9}GΟÿÊÐE‹*Õ÷fA!¹º¿ë})ƒ¶tô6ÄDÿ5F"}.!<˺33mr๧Îy/…/¢’&³ýÆŒî÷ëW_}<Áf±¬Ú±3cÃ=²¶œ\ü§qÞ›Ÿ?ÊØ ŠX©@�ŸÉ“! €@,†—R õ°aLÂì9^·ÊÊg<×Ð ? Õí-¾Þ¾éË–}2Áf±¬ú÷?elHO¿¯ïÈûùïz_JÇ¡«—³!:ú%ye•f„Z͸ҥ3pf(ZÄŒg‚OWZuB AÂÛï I¯Ÿ”±nÝà7GNsõîvQ°ûüï-È@?ÀšÝV\Ü,Äb€eBÀz‰9mª³²FOäù_ÿVSSÒk}÷íëTߎ3´ÚâÎò¥<4`õbv%%IõÙÙßMä8•·+ã0Ðê®Â.ÝyB»~ö<¹ �N ÀÀ©Sá¥TÆdíþfü«‘ÿú³Vkvíëé+gk¨‹ m[› öÒRXss–ëç�`X~QQÈØ¾=ìXSÓŽNôÝ;‘ズÃwŒ¡.êŽ7–ïëû2;Ñ—òàÐ!’{1Æ¢¢C›šb|X‰Zî"œé£ˆÃÑ’¡Åáp§–bœS8ç]ë¹RNç‘øúë+•c¾ÿ~Ú†øøß-ÈÊ2lzq˜¤ùhvÂS¸ÇˆŽ„ÀQ[‹¦½{a+(€ì½÷�B`«®†Ýj%`‰–ú¢¢é¡MM±ÝáÛt4;aPûRz‡Õ‹OHòh³9BF`6·ºË`<§®Ç!ç2w}ÇÏîyžG`L,|£ö+8p`È’yó¾0f²½ðçƒÿ9”罄Î}{¶ÆxÎ;t:"#a½u Û?ýÔ1vìû ÅÅåáû<!ëºË·èA|#"`5°ýÓO ¡ãÇÌO,*)ë _ʃCV/¥`íZ¯‚ƒWäy/Î:³¤¹¹åîaœ×ùû<69ç‰Ç MHK²uU\štµ/ìÛ+˜¹÷»£3b¢CótµÃå�#EËÑö$æ4K$¸RV†´C‡*Ճϙ}öìñ'Å78aðÜ9§Ïý½3|) X½”¸ŠŠDÿêê…ƒ<Î#h9yM&ÚZ8jkÝw"Œ«ÎÇóD†G½N›œáy„Œ…+;wKIII>­ ú!"Py$³F–Mˆ(×áß�Ø*�å�²†Ïš¯±L]£Üg…zPô»s33/w¦¯_uõÂèðÍ"Ä+ï.¾×8®9‡cݾs2:Ï—òpÐ~X½”µ‘áL,.]¸Ó¡»Ó¢;ç[-g0r9¸ðppÑÑàBBÀúø€qöWrõ[b=?2²÷ïǹ͛×-*,\äÚ÷®¤$©D$ ÑWUõ·ÙšYÆÊKÄ ©BIñÜÓ§»$uqrdøŠKWw‡ïÙÍ›×XXøA[_Ceå�‹ÝÌ0V^"ò•è8‘´¨«|) X½”•ÁA)¿«ªy7wž¬9¡™À@ˆ_z µpž°Œ³ƒ¥gÇK«Å‚-Ó¦] ›0aèÝ^ké.ž4_ÊÃAÓ|õR8† ¡å™Ý•úÅ3 •ç2×:¬Çr¢ÓÁ´u+µµ õõàF÷ÔQ_¾®|}=8�¼Õ*T*{ôXxÒ|)íÖÐ !�³Âbe¤¸}’:—»+ƒõ�t�,�¤�ä�dmÖåð7n€á8wW�W“¿Ã9_–‘N$:4|óf[7*¶‚�ÌònôeD¢´žô¥<<4`õRÀ´œ¼Ç�v­Bñ '÷9ÍFÈ;r«Ñ˜H,æ8…Íî ?�‘¨¥µÍhléÃäщåyÔà—-[® ||>‡®g«jØv|k¾§rÙ)–0B‡Ãák3Æ÷Ô–-×D>>ÿÛÓ¾”‡ƒ¬^d™¬²A¯‡Ò¹Ìu·q 5jÕÚ©ÿ²à?k4î± !Ì·Ó§+HCCÿ"­vrVUÕt{cã€óçe!j5ü‘욬V”–”ðÚššsññïÏ=}º¦GD´ç«U©’§.Xðçv|_´76>pþ¼¬ŸZ ?§¯C €Éé««©ù‡|ü{=íKyxhÀê¥8Rl�†Ûw@1ÀFFmð<yÀ9n“ÁùÉJ5k•ɦ“y9Dêò²êÁ¹ùùq,Ë $Þfb·×pRYFÜ[£ÏNM>li»ïž€gHѽ|¢¢ÖwÔWl—ÝÐÆ^ÏÏcF-”Š›‰Ý^#”Ê2¿5úLoñ¥<4`õRK�?`=ßq�¼···½½¿w¶€Õ9?¹�¾¿c¥œœÎ*î#Ãó¸Ü‰¾×ÑË})m)é¥H""Îk…BÖ­cJ�úÒ¢am×ß0nœr÷oÈ»¹˜ÆCùN™Òg}) X½”ùééµÍ¾òó•hݼ°–†¦ùÆýÝ­ŠZBÊË+u'O.S(ÖnЉ ¾×v{+á[¡»r¹ÏúR([G Ÿ² <@�±¤ ›ò¥¯ïÆO?õÚjµêôáÃyÓO?G­žäîÛG¶$&–¬‰ŒœØÕå#„0ióæE¥ Ix=9::â^ëi qÅ ûr?ße¾¾\¾Ö3¾ å>¤¦¦r_H¥—KÛœÄF€œ�È�É "¦™3‰eéRb;z”8jjˆ±¼œ|;mšù+¥rjW•í·M›„«ClÜ“”DÎ|ñù?µšO1¢UÐÚ˜7ýK¹üׯüK—)«—IÛÛf{¾×ïíÛÜ•¾ ¥¬‰Œ ]'mmNbWÚôfç]ˆ‰e‰)>žXwï&öÊJbÒjÉž©S«·ŒsÇuÁž©“^ÞFtëדæë¹ä·U«Èº¨¨]¿_*“}òux¸¥hÍÒ˜MŽÌ›Ç¯0`a{Û]:®7úRzt´†^NšÁPŸr"¯¡aN"Àº*¤]ý”ÜhµàsrÀÆÆBže}ŠŽ½vXo¸ØÙåk4­ZQ1ˆMKCãÙ3(,,$ 6ÛúC:]þΉã™ KwO!DÊ–•Áœ—‹R‰Ê쫇44fznG°é¸=ÞÑúúò¤µ)¯¡1©C¾ÙÙn_Âq]æKéЀÕH3+Æ*•dzŽây¡·[K)€èõ`”JÔææ"}ûv8ìŽ/ 7:³<€²øp¸ÕÖß‹ÔUU!S¯¿•øÙgìüé'ûsëÿÄÖŸ 6›a¯ª‚!+ ÿ(.®÷ë¿è`UU�~÷Ý„ýr·÷Âi1oŽéw=ÍØp~´ÌלMø±õÕçæâä¶m]âK¡P‚äè舥2iÆ×�¹ì¬Û±{<.™¢H:@VIÄu+û÷­‹ŠÂ,“HŠn8÷· ;Æ{�ˆFÃ.‹Ëo %-|>@RÓžI“&-õë úïµ …ýÂܹ¤úÇÉÕíÛÉÊà`Ë길 6¾ÿÔß_ºÞ—ÒK wX}ˆÃz}ÝsY¼Uíp¤^'Äò!² ‡CœEˆð @~带+ÞÞÅ·ÂC“Ç/ûËë3¾Ù©«Ê2Åß?ÊØØ8ò*�-Çüð‡²òÅ�0P$’Ø 5#šœÌö¸Øçœ=·�ä[¶¼-,-]3Q$b• X»ª¡CáË•J|ØPçÎýwX¯/™ÿò+Û8ÿ}×±ÞÍ÷²·wIwøR(”Gä¤F#H92hWR’êû3‚w£"©©ÝrJûè#¿µ~²cì¨7!î꥓³g{æåUz à× …5ßLzÁ}×Ca¿ê®¤ Å�ÉcYr].'¹ŸN–«T;qŸîm}SFŽ ê._ …ò˜²mÔ¨‘+û÷ÿpÓ°a­:tnŒ~ã�À×:ËR‹�I–Ë«6'&ê©2SútÄQÊA4vNŽF£r@l37Ÿ±ÿ>'ÇÚÞß®ð÷Ûñ’þÖ;*�v�6�¥�N …%ý&LxëÍcÇÎtqñ)}°(bûøñOé òþÕZg|ÕK,Vùø)y«Ù"°˜LVV$ªd8._ª 8"õ øYèïónïP«v<[­}'@€ ×hQ(R¥2Ùâ…¥¥Õžë¦ÎšÅ]ÓéL˜À/Y²„8Gg <áЀEi— ÑѽìöÙCFòREG3Þ`}}ÁÉ倷7 Cu5n^¸€Ü'«ªN)ÂÂ>›—‘qÎs;Ç–±vó–a|E¾ò³òàÀ”—²4·ÇêögŸ}þVIÑBs£iˆ—H$@hqØí5^2Ù>EHÈws23«ï( å‰,Ê}YàŸ›0d …;™Ó&¹çœg}|`ÔÕâ·­[ì¥éé—FΟÿÊÐE‹*ÛÛÏ­cÇ|wÏ™ý«¢¢2&šN9p Ä3gÂkÈð2n’«ûSX fŸ:³§½íQOh åžlˆ‰þkŒDú\Bx88–ug\fÚ&1uMóÞ _D%MfûÝ/}Ù²O&Ø,–Uÿþ§Œ ééwÍRsrñŸÆxo~þHcƒ*`¥|&O†( �±^J%ÔÇ1 ³çxÝ*+Ÿñ\Cƒü€V{´[þ ”^ X”»²!:ú%ye•f„Z͸ÒÃ3pfdZ-Æ3¡©+<!…„ áíwФ×OÊØ·oð›£G§¹z³»(Ø}Hþ÷ä¿ àNEo+.n Žb1À²�!`½Dˆœ6 ÕYY£_p8ÎÐj‹»õŸBéqhÀ¢ÜÁ®¤$©>;{ïDŽ òveXZÝE¹ÓÃ;˜ëgÏ`F�pN /¥2&k÷7ã_ø×ŸµZ³k_O_9ûãC]Ôo,Ûl°—–š› °,X??��òð‹z ™Û·‡kjÚѵÿ Joƒ‘L¹ƒú¢¢é¡MM±>, ˆD-wMÎtYÄáhÉHãp¸Si1Î)œó®õ\)¶ÀóH|ýuˆ•ʱß?mC|üïde6½8LÒt4;aî1’$!pÔÖ¢iï^Ø {ï=€ت«a·Z ÆãÅiÊã½Ã¢ÜÁó„¬m6GÈÌæVwUŒçÔõøç\æ®ßòøÙ=Ï󌉅oÔÀ~ Y2oÞ÷ÆL¶ý|ð?‡ò¼—йoÏV Ïy‡NAD¬¶ú©!tü˜ù‰E%e]ô/ ôRhÀ¢´¢`íZ¯‚ƒWäy/Î:+³¤¹¹ån‰aœ÷5÷yLtÎ�FHKryU\štµ/ìÛ+˜¹÷»£3b¢CótµÃå�#EËÙ6hñ�š%\)+CÚ¡C•Á ƒçÎ9}îïÝó¡ô&hÀ¢´"®¢"ѯºza´GÜ`€–`e2ÔÖÂQ[ë¾ób\u\ž õXmÃó9 Wvî—’’’|ZôCD òHf.,‹¯<‡C|`«�”ÈfþÇ5çpl]£Üg…zPô»s22/wë?…Òk ý°(­HŽ ÿCBqéêxÀþÝÞ9ßj9À‘ËÁ…‡ƒ‹ŽÖÇŒ³–«Ÿëù‘ɽ?ÎnÞ¼þÃÂÂ\ûÞ•”$•ˆD!†ÊÊ»™a¬¼Dä+Ñq"iÑÜÓ§iªf X”Ö¬ Jù]UÍ»!¸38u$€1¿ôj5à PŒ³C©gGS«Å‚-Ó¦] ›0aèÝ^ã¡PîMóEiǰa"´Ô¸RÝx¦Ýò\æZ‡õXNt:˜¶n…£¶¤¾¼Ñèž:êëÁ×Õ¯¯€·Z¥‘J%=)†vk ¸!�³Übe¤¸”œËÝ•ßz�:��R�r�²6ëò�ø7Àpœ»ëƒ«‹ƒÃ9_–‘F$J¾y³­)}°(­`‡s Þc �‡�{Â÷”@.;ÅFèp8|mFc±˜ã6»_8€þ�|D¢–ÖE£±¥Ï–G-–çQSP€S[¶\ùøü/t´jŠÒqhÀ¢¸a�’,“U6èõP:—¹î®.D«R%O]°àσ5÷ØW„æÛéÓ¤¡¡‘V;9«ªêE{cã3çÏËú©Õð `D>>p0Y­(-)áu55ÿðoîéÓ5="Jé³Ð€EiÏ"€0ܾ»"�Š& *j½g°�ç8Uç'+uÖ¬U&›N&¶ ‚Ënhc¯ççÇ1 £JÅÍÄn¯Je™ƒß}fjòaKÛ}S(íA¥<Ë�?`=ßyq�¼···½½¿w¶øÕ9?×|ÇJ99U\Êm¡¡´Bq^+šx´n TЗ k»þ†qã”»§L‘ws1)O(4`QZ1?=½¶ÙW~¾­»3Ĭ¥¡i¾F£q3룢–òò ݕ˅Ëе›bb‚ïµ] …Bé¶Ž>e@x€8�bH@6d™¯ï†O?õÚjµêô߆ çM?ýDµz’»oÙ’˜X²&2rbO—ŸB¡<A¤¦¦r_H¥—KÛ-#@N�ä€\ "¦™3‰eéRb;z”8jjˆ±¼œ|;mZóWJåÔžv P(Ok"#C× …F[› åJßì¼ë2±,1ÅÇëîÝÄ^YILZ-Ù3ujõ–1cî“ByTèh ”»’f0Ô'…„œÈkh˜“°® xW¿,7„�Z-øìl°±±‚pœOÑñ£×ë {¤ð”ǰ(÷$Íh¬+SÏ"Žây¡·[i)€èõ`”JèssqrÛ68ìŽ/ 7z¤à”Ç:Z¥]’££#+oîS6˜ž €­Gkh�p ÀE‰¸ž÷óŸ÷ÉÍ›wö¿¢P°(B£Ñ°QÇ?][Zú®£®îÿ1MMab‡CÊhà¸f"Ý÷ þvìâEk‡Ìù¨®§ËKy<¡‹òÀœÔh…‡û{ùú©w«¢‚÷“Oj™ßÿžŽkE¡P( …B¡P( …B¡P( …B¡P( …B¡P( …B¡P( å âÿÎÌÅ% àK|����IEND®B`‚������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/test/test_color.rb����������������������������������������������������0000644�0001750�0001750�00000001462�11701304107�017743� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestColor < Test::Unit::TestCase def test_initialize only_poppler_version(0, 7, 2) rose = Poppler::Color.new(65535, 0, 32639) assert_equal([65535, 0, 32639], [rose.red, rose.green, rose.blue]) assert_equal([65535, 0, 32639], rose.to_a) end def test_accessor only_poppler_version(0, 7, 2) white = Poppler::Color.new(65535, 65535, 65535) red = white.dup red.green = 0 red.blue = 0 assert_equal([65535, 65535, 65535], [white.red, white.green, white.blue]) assert_equal([65535, 0, 0], [red.red, red.green, red.blue]) end def test_inspect only_poppler_version(0, 7, 2) color = Poppler::Color.new(0, 32767, 65535) rgb = '[0, 32767, 65535]' assert_match(/\A#<Poppler::Color:.*: #{Regexp.escape(rgb)}>\z/, color.inspect) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/poppler/test/test_constants.rb������������������������������������������������0000644�0001750�0001750�00000001752�11701304107�020643� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestConstants < Test::Unit::TestCase def test_annotation if later_version?(0, 7, 2) assertion = :assert_const_defined else assertion = :assert_not_const_defined end send(assertion, Poppler, :AnnotationType) if assertion == :assert_const_defined assert_equal("3d", Poppler::AnnotationType::TYPE_3D.nick) end send(assertion, Poppler, :AnnotationFlag) send(assertion, Poppler, :AnnotationMarkupReplyType) send(assertion, Poppler, :AnnotationExternalDataType) if assertion == :assert_const_defined assert_equal("3d", Poppler::AnnotationExternalDataType::TYPE_3D.nick) end if later_version?(0, 9, 0) assert_not_const_defined(Poppler, :AnnotationTextIcon) else send(assertion, Poppler, :AnnotationTextIcon) end send(assertion, Poppler, :AnnotationTextState) send(assertion, Poppler, :AnnotationFreeTextQuadding) end def test_permissions assert_const_defined(Poppler, :Permissions) end end ����������������������ruby-gnome2-all-2.1.0/poppler/test/test_annotation.rb�����������������������������������������������0000644�0001750�0001750�00000005100�11701304107�020770� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class TestAnnotation < Test::Unit::TestCase def test_type only_poppler_version(0, 7, 2) assert_kind_of(Poppler::AnnotationType, annotation.type) end def test_contents only_poppler_version(0, 7, 2) assert_nil(annotation.contents) end def test_name only_poppler_version(0, 7, 2) assert_nil(annotation.name) end def test_modified only_poppler_version(0, 7, 2) assert_nil(annotation.modified) end def test_flags only_poppler_version(0, 7, 2) assert_kind_of(Poppler::AnnotationFlag, annotation.flags) end def test_color only_poppler_version(0, 7, 2) assert_nil(annotation.color) end def test_markup only_poppler_version(0, 7, 2) # We don't have a PDF that has annotation markup... assert_method_defined(Poppler::AnnotationMarkup, :label) assert_method_defined(Poppler::AnnotationMarkup, :popup_is_open?) assert_method_defined(Poppler::AnnotationMarkup, :opacity) assert_method_defined(Poppler::AnnotationMarkup, :date) assert_method_defined(Poppler::AnnotationMarkup, :subject) assert_method_defined(Poppler::AnnotationMarkup, :reply_to) assert_method_defined(Poppler::AnnotationMarkup, :external_data) end def test_text only_poppler_version(0, 7, 2) # We don't have a PDF that has annotation text... assert_method_defined(Poppler::AnnotationText, :open?) assert_method_defined(Poppler::AnnotationText, :icon) assert_method_defined(Poppler::AnnotationText, :state) end def test_free_text only_poppler_version(0, 7, 2) # We don't have a PDF that has annotation free text... assert_method_defined(Poppler::AnnotationFreeText, :quadding) assert_method_defined(Poppler::AnnotationFreeText, :callout_line) end def test_callout_line only_poppler_version(0, 7, 2) callout_line = Poppler::AnnotationCalloutLine.new(true, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6) assert(callout_line.multiline?) assert_equal(1.1, callout_line.x1) assert_equal(2.2, callout_line.y1) assert_equal(3.3, callout_line.x2) assert_equal(4.4, callout_line.y2) assert_equal(5.5, callout_line.x3) assert_equal(6.6, callout_line.y3) assert_equal([true, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6], callout_line.to_a) end private def annotation document = Poppler::Document.new(form_pdf) page = document[0] page.annotation_mapping[0].annotation end def assert_method_defined(object, method) assert_send([object, :method_defined?, method]) end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/NEWS��������������������������������������������������������������������������0000644�0001750�0001750�00000301121�12257665242�013314� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- RD -*- = NEWS == Ruby-GNOME2 2.1.0: 2013-12-29 Ruby 2.1.0 support release! === Changes ==== All * Improvements * Set license information to gem. * Fixes * [windows] Added missing binaries for Ruby 2.1.0. [GitHub#123] [Patch by Masafumi Yokoyama] ==== Ruby/GDK3 * Improvements * [windows] Bundled hicolor-icon-theme. It may fix a problem that Windows theme is not applied. [ruby-gnome2-devel-en] [Reported by Regis d'Aubarede] === Thanks * Masafumi Yokoyama * Regis d'Aubarede == Ruby-GNOME2 2.0.3: 2013-12-29 It is RC release for 2.1.0. === Changes ==== All * Improvements * Removed Ruby 1.8 from supported Ruby in READMEs. [GitHub#166] [Reported by Markus Heiler] [Patch by Masafumi Yokoyama] * Supported Ruby 2.1.0. [GitHub#181] [cosmo0920][Masafumi Yokoyama] * Made rcairo optional to required because we dropped old GTK+ that doesn't use cairo. (Cairo isn't used library such as GLib doesn't require rcairo. But Ruby/GLib2 requires rcairo on Windows because it uses zlib bundled in rcairo.) [GitHub#193] [cosmo0920] * Updated LGPL 2.1 files. [GitHub#196] [Reported by ktdreyer] * Supported tests on Travis CI. [Masafumi Yokoyama][cosmo0920] * Supported rake-compiler 0.9.1. ==== Ruby/GLib2 * Improvements * Set UTF-8 encoding to exception message. * Added GLib::GetText.bindtextdomain. * Dropped GLib < 2.12 because CentOS 5 has GLib 2.12.3. [GitHub#190] [cosmo0920] * Added GValue#to_s. * [windows] Updated bundled GLib to 2.38.2 from 2.36.2. ==== Ruby/GObjectIntrospection * Improvements * Supported GList return type. * Supported freeing UTF-8 return type. * Supported freeing array return type. * Supported NULL as array return value. * Supported freeing GObject return value. * Supported freeing structure return value. * Supported NULL character for gint8 array. * Fixes * Fixed type conversion from VALUE to GType. [GitHub#186] [Patch by Hiroyuki Tanaka] ==== Ruby/ATK * Improvements * Dropped ATK < 1.12 support because CentOS 5 has GTK+ 1.12.2. [GitHub#191] [cosmo0920] * [windows] Updated bundled ATK to 2.10.0 from 2.8.0. ==== Ruby/Pango * Improvements * Supported cairo 1.6. [GitHub#172] [Patch by Grant Schoep] * Dropped Pango < 1.14 support because CentOS 5 has GTK+ 1.14.9. [GitHub#192] [cosmo0920] * Added Pango::Layout#height=. [GitHub#210] [Patch by Vasily Fedoseyev] * Added Pango::Layout#ellipsized?. [GitHub#210] [Patch by Vasily Fedoseyev] * [windows] Updated bundled Pango to 1.36.1 from 1.34.1. ==== Ruby/GdkPixbuf2 * Improvements * [windows] Added rcairo dependency on Windows for using libpng and zlib bundled in rcairo. * [windows] Updated bundled gdk-pixbuf to 2.30.2 from 2.28.1. ==== Ruby/GTK2 * Improvements * Dropped GTK+ < 2.10 support because CentOS 5 has GTK+ 2.10.4. [GitHub#182] [Patch by cosmo0920] * [windows] Updated bundled GTK+ to 2.24.22 from 2.24.18. ==== Ruby/GDK3 * Improvements * [test] Made more stable. [GitHub#178] [Reported by mtasaka] * Added Gdk::Device#ungrab. [cosmo0920] * Added Gdk::DeviceManager. [cosmo0920] * Added Gdk::Device#get_position. [cosmo0920] * Added Gdk::Device#warp. [cosmo0920] * Added Gdk::Device#grab. [cosmo0920] * Added Gdk::Window#get_device_position. [cosmo0920] * [windows] Updated bundled GTK+ to 3.10.6 from 3.8.2. ==== Ruby/GTK3 * Improvements * [sample] Updated for GTK+ 3. [Masafumi Yokoyama] * Removed Gtk::BindingSet#add_path. * Added Gtk.show_uri. * Fixes * Fixed a bug that Gtk::ActionGroup#add_radio_actions always fails. [ruby-gnome2-devel-ja] [Reported by S. Kitagawa] ==== Ruby/GStreamer * Improvements * Supported calling module functions of Gst module such as Gst.version before calling Gst.init. * Added Gst::Registry#plugins. * Added Gst::Registry#get_features. * Added Gst::ElementFactory#long_name. * Added Gst::ElementFactory#klass. * Added Gst::ElementFactory#author. * Added Gst::ElementFactory#static_pad_templates. * Added Gst::Caps#structures. * Added Gst::Structure#fields. * Gst::Element#flags returns flag object instead of raw integer value. Use Gst::Element#flags_raw for raw integer value. * Gst::PluginFeature#rank returns Gst::Rank instead of raw integer value. Use Gst::PluginFeature#rank for raw integer value. * Supported GstValueList. * [windows] Updated bundled GStreamer to 1.2.1 from 1.0.7. ==== Ruby/Clutter * Improvements * [sample] Updated for Clutter 1.12 or later. [Patch by Kentaro Fukuchi] * [windows] Updated bundled Clutter to 1.16.2 from 1.14.4. ==== Ruby/ClutterGStreamer * Improvements * [sample] Added. [Masafumi Yokoyama] * Fixed a typo in sample. [Reported by Toyo Abe] * [windows] Updated bundled Clutter-GStreamer to 2.0.8 from 2.0.2. ==== Ruby/Poppler * Improvements * Dropped Popper < 0.12 because CentOS has Poppler 0.12.4. [GitHub#212] [cosmo0920] * [windows] Bundled Poppler 0.24.4. ==== Ruby/RSVG * Improvements * [windows] Bundled librsvg 2.40.1. ==== Ruby/GtkSourceView3 * Improvements * Supported auto GtkSourceView install on OS X. [GitHub#177] [Masafumi Yokoyama] * [windows] Updated bundled GtkSourceView to 3.10.1 from 3.8.1. ==== Ruby/GooCanvas * Improvements * [sample] Followed changes caused by migrating to Ruby/GObjectIntrospection. [Masafumi Yokoyama] * Updated FSF address. [GitHub#201] [Reported by ktdreyer] * Fixes * Fixed wrong dependency. [ruby-gnomde2-devel-ja] [Reported by Masafumi Yokoyama] === Thanks * Kentaro Fukuchi * S. Kitagawa * Markus Heiler * Masafumi Yokoyama * Grant Schoep * Toyo Abe * mtasaka * cosmo0920 * Hiroyuki Tanaka * ktdreyer == Ruby-GNOME2 2.0.2: 2013-05-26 Windows XP re-supportted release! === Changes ==== Ruby/GLib2 * Improvements * Added rbgutil_key_equal() convenient function. It is used for comparing key that may be String or Symbol. ==== Ruby/Pango * Improvements * [windows] Forced to disable uniscribe backend of HarfBuzz. [ruby-list:49412] [Reported by Masafumi Yokoyama] * Don't define Pango::CairoFcFontMap and Pango::CairoWin32FontMap because they may cause crash on OS X. [shocker-ja:1119] [Reported by znz] * Updated samples. [GitHub#164] [Patch by Kentaro Fukuchi] * Fixes * Fixed wrong index access in Pango::GlyphString#glyphs. [ruby-gnome2-devel-ja] [Reported by Kentaro Fukuchi] === Thanks * Kentaro Fukuchi * Masafumi Yokoyama * znz == Ruby-GNOME2 2.0.1: 2013-05-25 Ruby 1.8 support is dropped release! === Changes ==== All * Improvements * Dropped Ruby 1.8 support. * Updated bundled binaries versions for Windows. ==== Ruby/Pango * Improvements * Added Pango::CairoFontMap.set_default. * Enabled fontconfig font on Windows. * Defined Pango::CairoFcFontMap on init if it is available. * Defined Pango::CairoWin32FontMap on init if it is available. ==== Ruby/GTK3 * Improvements * Added Gtk::Image#set_from_icon_set. [GitHub#150] [Patch by Detlef Reichl] * Added Gtk::Image#set_from_stock. [GitHub#150] [Patch by Detlef Reichl] * Added Gtk::Image#set_from_gicon. [GitHub#150] [Patch by Detlef Reichl] * Updated samples. [GitHUb#151] [Patch by Detlef Reichl] * Fixes * Fixed a GC related crash bug. [ruby-gnome2-devel-en] [Reported by Detlef Reichl] ==== Ruby/GObjectIntrospection * Improvements * Supported ownership transfer for some input argument types. (Struct and Object) * Supported "(out caller-allocates)" for boxed object. [ruby-gnome2-devel-ja] [Reported by Kentaro Fukuchi] * Supported gpointer in/out. [ruby-gnome2-devel-ja] [Reported by NAKAJIMA Takashi] * Fixes * Fixed missing argument. [GitHub#154] [Reported by Masafumi Yokoyama] ==== RubyGStreamer * Improvements * Supported methods that call callback [ruby-gnome2-devel-ja] [Reported by NAKAJIMA Takashi] * Updated samples. [GitHub#156][GitHub#159][GitHub#160][GitHub#161] [Patch by NAKAJIMA Takashi] * Supported Gst::Bus#set_handler. [ruby-gnome2-devel-ja] [Reported by NAKAJIMA Takashi] * Supported Gst::Controller [ruby-gnome2-devel-ja] [Suggested by NAKAJIMA Takashi] * Stopped to require Gst.init. * Fixes * Fixed out of index access bug. ==== Ruby/GooCanvas * Improvements * Migrated to Ruby/GObjectIntrospection based bindings. * Stopped to require Goo.init. * Fixes * Updated samples. [GitHub#152][GitHub#153][GitHub#155][GitHub#157] [Patch by Masafumi Yokoyama] ==== Ruby/Clutter * Improvements * Stopped to require Clutter.init. * Fixes * Fixed broken samples. [ruby-gnome2-devel-ja] [Patch by Kentaro Fukuchi] ==== Ruby/ClutterGtk * Improvements * Stopped to require ClutterGtk.init. ==== Ruby/ClutterGStreamer * Added. ==== Ruby/WebKitGtk * Improvements * Stopped to require WebKitGtk.init. ==== Ruby/WebKitGtk2 * Improvements * Stopped to require WebKitGtk2.init. === Thanks * Detlef Reichl * NAKAJIMA Takashi * Masafumi Yokoyama * Kentaro Fukuchi == Ruby-GNOME2 2.0.0: 2013-04-29 GObject Introspection based bindings on Windows support release! === Changes ==== NEWS * Fixes * Fixed a typo. [Reported by Masafumi Yokoyama] * FIxed a typo. [Reported by Toyo Abe] ==== Ruby/GLib2 * Improvements * Moved lib/gnome2-*.rb files to lib/gnome2/ directory. * Supported GLib 2.34. [Reported by OBATA Akio] ==== Ruby/GdkPixbuf2 * Fixes * [windows] Fixed PNG can't be handled problem. [ruby-gnoem2-devel-ja] [Reported by Masafumi Yokoyama] ==== Ruby/GDK3 * Improvements * [windows] Removed needless Greybird theme. [ruby-gnome2-devel-en] [Reported by Regis d'Aubarede] * Added Gdk::Window#create_cairo_context [ruby-gnome2-devel-en] [Reported by Detlef Reichl] ==== Ruby/GTK3 * Improvements * Updated samples. [GitHub #140][GitHub #141][GitHub #144] [Patch by Simon Arnaud] [GitHub #142][GitHub #143][GitHub #145][GitHub #146][GitHub #148] [Patch by Detlef Reichl] ==== Ruby/GObjectIntrospection * Improvements * [windows] Supported! ==== Ruby/GStreamer * Improvements * Supported GStreamer 1.0! * Migrated to GObject Introspection bindings! * Dropped GStreamer 0.10 support. ==== Ruby/Clutter * Improvements * [windows] Supported! ==== Ruby/ClutterGTK * Improvements * [windows] Supported! === Thanks * Masafumi Yokoyama * Toyo Abe * OBATA Akio * Regis d'Aubarede * Detlef Reichl * Simon Arnaud == Ruby-GNOME2 1.2.6: 2013-04-02 Broken Ruby/Poppler fix release! === Changes ==== Ruby/GLib2 * Improvements * Removed deprecated GLib::Completion. * Removed deprecated g_source_get_current_time() use. * [windows] Updated bundled GLib to 3.8.0. * [windows] Updated bundled glib-networking to 3.8.0. * [windows] Updated bundled GnuTLS to 3.1.10. ==== Ruby/ATK * Improvements * [windows] Updated bundled ATK to 2.8.0. ==== Ruby/GdkPixbuf2 * Improvements * [windows] Updated bundled gdk-pixbuf to 2.28.0. ==== Ruby/Pango * Improvements * [windows] Updated bundled Pango to 1.34.0. ==== Ruby/GDK3 * Improvements * [windows] Updated bundled GTK+ to 3.8.0. ==== Ruby/Poppler * Fixes * Fixed a bug that Poppler::Page#render is broken. [SF.net#184] [Reported by HARUYAMA Seigo] ==== Ruby/GooCanvas * Improvements * Added a Ruby/GObjectIntrospection based sample. [GitHub #139] [Patch by Masafumi Yokoyama] === Thanks * Masafumi Yokoyama * HARUYAMA Seigo == Ruby-GNOME2 1.2.5: 2013-03-28 Crash bug fix release! === Changes ==== All * Fixes * Fixed crash bugs. [GitHub #138] [Reported by Takuma Nakajima] === Thanks * Takuma Nakajima == Ruby-GNOME2 1.2.4: 2013-03-24 Ruby/WebKitGtk2 addition release! === Changes ==== All * Improvements * Start mswin64 support. (But it is not completed yet.) [GitHub #135] [Patch by usa] ==== Ruby/GLib2 * Improvements * Reduce needless GBoxed object copy. ==== Ruby/GdkPixbuf2 * Fixes * Fix build error by a typo. ==== Ruby/GtkSourceView2 * Improvements * Support auto RPM install on CentOS 6. ==== Ruby/GObjectIntrospection * Improvements * Add method name to arguments validation failure message. * Support specific version loading. ==== Ruby/GTK3 * Improvements * [windows] Add gschemas.compiled. [ruby-talk:406026] [Reported by Regis d'Aubarede] ==== Ruby/WebKitGtk2 * New! [GitHub #136] [Patch by eumario] === Thanks * usa * Regis d'Aubarede * eumario == Ruby-GNOME2 1.2.3: 2013-03-17 Clean up release! === Changes ==== Ruby/GTK2 * Remove needless signale handlers restore. ==== Ruby/GTK3 * Remove needless signale handlers restore. == Ruby-GNOME2 1.2.2: 2013-03-11 Ruby 2.0.0 support release! === Changes ==== Ruby/GLib2 * Improvements * Supported test on Ruby 2.0.0. [GitHub #134] [Reported by mtasaka] ==== Ruby/Poppler * Improvements * Removed deprecated GDK support. ==== Ruby/GDK3 * Improvements * Supported Ruby 2.0.0. [GitHub#129] [Reported by TOMITA Masahiro] ==== Ruby/GObjectIntrospection * Improvements * Supported not GType based flags. * Supported not GType based enum. * Supported custom callback function. * Supported .h install. * Supported .pc install. * More Rubyish method names are used. * Stopped to raise exception when there are two or more out parameters. * Added Loader.start_callback_dispatch_thread(). * Supported arguments validation. * Stopped to use array for just one return value. * Supported Enumerator. * Hide constructor methods. ==== Ruby/GtkSourceView3 * Fixes * Fixed wrong deb package name. ==== Ruby/Clutter * Fixes * Fixed wrong initialized check. * Stopped to override Clutter.init unexpectedly. ==== Ruby/ClutterGTK * Fixes * Fixed wrong initialized check. ==== Ruby/WebKitGTK * Fixes * Fixed wrong initialized check. === Thanks * Vincent Carmona (for unreleased GObjectIntrospection based GStreamer bindings) * TOMITA Masahiro * NAKAJIMA Takashi (for unreleased GObjectIntrospection based GStreamer bindings) * mtasaka == Ruby-GNOME2 1.2.1: 2013-01-30 GTK+ 3 support on Mac OS X release! === Changes ==== Ruby/GLib2 * Improvements * Supported custom sudo prompt on auto native package install. [GitHub:126] [Suggested by Yorick Peterse] * Started to support JRuby. (It is not completed yet.) [GitHub:125] [Reported by vpereira] * Accepted unsigned long int size GType. * Removed DL support. * Don't call deprecated g_type_init() for GLib >= 2.35.1. ==== Ruby/GTK2 * Fixes * Fixed a memory leak related Gtk::TreeIter. [GitHub:128] [Patch by Toshiaki Asai] ==== Ruby/GTK3 * Fixes * Fixed a memory leak related Gtk::TreeIter. [GitHub:128] [Patch by Toshiaki Asai] * Fixed a crash bug caused by symbol conflict with Ruby/GDK3 on Mac OS X. [GitHub:127] [Reported by Sergio Campama] [Helped by Watson] ==== Ruby/GDK3 * Improvements * [windows] Bundled Greybird theme. [Suggested by Regis d'Aubarede] ==== Ruby/GooCanvas * Improvements * Added Goo::Canvas#get_items_at [GitHub:124] [Patch by David Maciejak] ==== Ruby/WebKitGTK * Added ==== Ruby/GtkSourceView3 * Improvements * Supported Windows. === Thanks * David Maciejak * Yorick Peterse * vpereira * Toshiaki Asai * Sergio Campama * Watson * Regis d'Aubarede == Ruby-GNOME2 1.2.0: 2013-01-24 GTK+ 3 support release! === Changes ==== All * Added ruby-gtk3 package. Here is a list: * Ruby/GLib2 * Ruby/ATK * Ruby/Pango * Ruby/GdkPixbuf2 * Ruby/GDK3 * Ruby/GTK3 ==== Ruby/GLib2 * Improvements * Supported custom VALUE <-> GBoxed conversion * Supported VALUE <-> GBoxed conversion by RVAL2GOBJ * Added GLib::Source::REMOVE * Added GLib::Source::CONTINUE * Added rbgobj_make_boxed_raw() * Added GLib::Value for internal use * [windows] Updated to the latest GLib: 2.28.8-1 -> 2.34.3 * Changes * Removed deprecated GLib::Win32.get_package_installation_directory * Removed deprecated GLib::Win32.get_package_installation_subdirectory * Added user_data to RGConvertTable callbacks * rbgobj_convert_define() copies passed RGConvertTable * Removed deprecated G_DEF_FUNDAMENTAL. Use RG_DEF_CONVERSION instead ==== Ruby/GIO2 * Improvements * Installed headers ==== Ruby/ATK * Improvements * [windows] Updated to the latest ATK: 1.32.0 -> 2.6.0 ==== Ruby/Pango * Improvements * [windows] Updated to the latest Pango: 1.28.3 -> 1.32.6 ==== Ruby/GdkPixbuf2 * Improvements * [windows] Updated to the latest gdk-pixbuf: 2.24.0 -> 2.26.5 ==== Ruby/GTK2 * Improvements * Removed needless not copy flag from Allocation * [windows] Updated to the latest GTK+ 2: 2.24.8 -> 2.24.14 ==== Ruby/GDK3 * Improvements * [windows] Supported: 3.6.4 ==== Ruby/GTK3 * Improvements * Removed needless not copy flag from Allocation * [windows] Supported: 3.6.4 ==== Ruby/GObjectIntrospection * Improvements * Supported over loaded method * Supported over loaded constructor * Supported GBoxed object * Supported char * * Supported GInterface * Supported CallableInfo * Supported may be null * Supported union object * Supported not GBoxed struct * Supported out parameter * Supported C array * Added "?" suffix to predicate method name * Supported SourceFunc callback * Supported GValue * Added GObjectIntrospection::Loader.register_boxed_class_converter * Supported inout parameter * Supported binary data array * Changes * ArgInfo#[] -> ArgInfo#get_arg ==== Ruby/CairoGObject * Added ==== Ruby/Clutter * Added ==== Ruby/ClutterGtk * Added == Ruby-GNOME2 1.1.9: 2012-12-29 This is a experimental GObjectIntrospection support release. === Changes ==== Ruby/GLib2 * Improvements * Renamed G_DEF_CLASS4 to G_DEF_CLASS_WITH_PARENT. G_DEF_CLASS4 is still usable but it is deprecated. ==== Ruby/GObjectIntrospection * Added. It is still experimental. == Ruby-GNOME2 1.1.8: 2012-12-19 This is a bug fix release for Ruby 2.0.0. === Changes ==== All * Fixes * Fixed a bug that *.so isn't installed with Ruby 2.0.0. == Ruby-GNOME2 1.1.7: 2012-12-10 This is a package for Windows fix release. === Changes ==== Ruby/GTK2 * Fixes * Bundled GTK+ 2.24.8-1 instead of GTK+ 2.24.10-1. [Reported by Mahoro Shimura] === Thanks * Mahoro Shimura == Ruby-GNOME2 1.1.6: 2012-12-02 This is Ruby 2.0.0 support release! === Changes ==== All * Fixes * Fixed install error on Ruby 2.0.0. [ruby-gnome2-devel-en] Recent Ruby: 'depend' files must be changed [Reported by Carlo E. Prelz] ==== Ruby/GLib2 * Improvements * Improved portability a bit. '$,' is used instead of rb_output_fs. [GktHub:#117] [Reported by Marvin Gülker] ==== Ruby/GIO2 * Fixes * Fixed a crash bug on i386. [Reported by TAKATSU Tomonari] ==== Ruby/GTK2 * Improvements * Added Gtk::TreeModel#iter_root. [GitHub:121] [Patch by dmaciejak] * Added Gtk::TreeModel#iter_next. [GitHub:121] [Patch by dmaciejak] ==== Ruby/GdkPixbuf2 * Fixes * Fixed build errors with old gdk-pixbuf. ==== Ruby/Poppler * Improvements * Added missing required Poppler version. [Suggested by Grant Schoep] [ruby-gnome2-devel-en] poppler, build fails, incorrect required_pkg_config_package? * Fixes * Fixed a wrong package name on Red Hat and Fedora. [Reported by Grant Schoep] [ruby-gnome2-devel-en] poppler, build fails, incorrect required_pkg_config_package? * Changes * Disabled auto Poppler install for Homebrew. It requires --with-glib option but auto install with --with-glib option isn't supported yet. ==== Ruby/GooCanvas * Improvements * Added Goo::Canvas#update. [GitHub:119] [Patch by dmaciejak] * Added Goo::Canvas#request_update. [GitHub:119] [Patch by dmaciejak] * Added Goo::Canvas#convert_from_pixels. [GitHub:123] [Patch by dmaciejak] * Added Goo::Canvas#convert_to_pixels. [GitHub:123] [Patch by dmaciejak] * Added Goo::Canvas#get_item_at. [GitHub:123] [Patch by dmaciejak] * Added Goo::Canvas#bounds. [GitHub:123] [Patch by dmaciejak] ==== Ruby/GStreamer * Improvements * Don't pass -h and --help to GStreamer. [GitHub:#118] [Reported by dmaciejak] === Thanks * TAKATSU Tomonari * dmaciejak * Grant Schoep * Carlo E. Prelz * Marvin Gülker == Ruby-GNOME2 1.1.5: 2012-08-29 This is a network support improvement release! === Changes ==== Ruby/GLib2 * Improvements * windows: Bundled glib-networking. ==== Ruby/GIO2 * Improvements * Added Gio::TlsCertificate. * Added Gio::TlsCertificateFlags. ==== Ruby/GTK2 * Improvements * Added Gtk.show_uri. * Fixes * Gtk::TreeStore#reorder: Fixed wrong the number of reorder values check. [SF.net#3561748] [Reported by Nounou] === Thanks * Nounou == Ruby-GNOME2 1.1.4: 2012-07-21 This is a easy to install release! === Changes ==== All * Improvements * Supported automatic required native packages install. ==== Ruby/GLib2 * Improvements * mkenums: Supported "/* < flags > */" tag. * mkenums: Supported two or more upper case characters such as "IO". * Before: GIOStatus -> g_iostatus * After: GIOStatus -> g_io_status * GIOCondition: Changed to GLib::Boxed object from integer. * GLib::Source#attach doesn't require context. * Fixes * Fixed wrong type conversion for GIOCondition. ==== Ruby/GIO2 * Improvements * Gio::Socket#create_source: Supported callback. * Fixes * Fixed return values. * Fixed wrong type conversions. ==== Ruby/GTK2 * Improvements * Re-supported GTK+ 2.10.0. [GitHub:115] [Patch by Grant Schoep] * Fixes * Fixed a typo in test script. [GitHub:109] [Reported by kimura wataru] ==== Ruby/GStreamer * Fixes * Fixed a test failure with GStreamer 0.10.36. [GitHub:111] [Reported by mtasaka] === Thanks * kimura wataru * mtasaka * Grant Schoep == Ruby-GNOME2 1.1.3: 2012-04-08 This is a bug fix release of 1.1.2. === Changes ==== Ruby/GLib2 * Improvements * Added required Ruby version into gemspec. * [GitHub#106] glib-mkenums.rb supported macro lines in header. This change is required for building with GLib 2.31.20. [Reported by mtasaka] * [GitHub#107] Supported tests on PPC. [Reported by mtasaka] * Fixes * Fixed handler_id type. ==== Ruby/GTK2 * Improvements * Added Gtk::TreeViewColumn#set_sort_column_id and Gtk::TreeViewColumn#sort_column_id= for GTK+ < 2.18. [ruby-gnome2-devel-en] Gtk::TreeViewColumn [Reported by grant schoep] * Added Gtk::InfoBar. * Added Gtk::MessageType. * Added Gtk::ResponseType. * Fixes * Fixed build failure with GTK+ < 2.12. [ruby-gnome2-devel-en] compile problems gtk2, ruby-gnome2-all-1.1.2 [Reported by grant schoep] * Fixed require failure with GTK+ < 2.14. [ruby-gnome2-devel-en] NameError: undefined method `color_selection' for class `Gtk::ColorSelectionDialog' [Reported by grant schoep] ==== Ruby/Poppler * Improvements * [GitHub#97] Added Poppler::Page#text_layout. [Patch by Andrey Kutejko] * [SF.net#3495948] Removed needless poppler-cairo check. [Reported by Pino Toscano] * Fixes * [GitHub#96] Fixed valid state of child index iterator. [Patch by Andrey Kutejko] * [GitHub#97] Fixed parameter check of Poppler::Page#get_text. [Patch by Andrey Kutejko] ==== Ruby/VTE * Fixes * Fixed build failure with VTE < 0.24. ==== Ruby/GStreamer * Improvements * Added Gst::Element#seek_simple. * Fixes * [GitHub#95] Fixed async test. [Reported by mtasaka] === Thanks * mtasaka * grant schoep * Andrey Kutejko * Pino Toscano == Ruby-GNOME2 1.1.2: 2012-01-15 This is a bug fix release of 1.1.1. === Changes ==== Ruby/GLib2 * Fixes * [GitHub#94] install missing header files. [Reported by mtasaka] ==== Ruby/Pango * Fixes * [GitHub#94] install a missing header file. [Reported by mtasaka] ==== Ruby/GdkPixbuf2 * Fixes * [GitHub#94] install missing header files. [Reported by mtasaka] === Thanks * mtasaka == Ruby-GNOME2 1.1.1: 2012-01-14 This is a bug fix release of 1.1.0. === Changes ==== Ruby/GLib2 * Fixes * [ruby-list:48587] Re: [ANN] Ruby-GNOME2 1.1.0 fix wrong parent class for GLib::IOChannelWin32Socket. [Reported by ashbb] ==== Ruby/GTK2 * Fixes * Fixed a bug that Gtk::ActionGroup#add_radio_actions always fail. ==== Ruby/GStreamer * Improvements * [win32] Supported FLAC. === Thanks * ashbb == Ruby-GNOME2 1.1.0: 2012-01-05 This is a source cleanup release. === Changes ==== Ruby/GLib2 * Improvements * [GitHub#65] Supported GLib 2.31. [Reported by mtasaka] * Supported comparing between GLib::Enum/GLib::Flags and Symbol. * Fixes * [GitHub#1] Fix GLib::Spawn regression. [Patch by Geoff Youngs] * Plugged memory leaks. * Fixed a crash by GC on Ruby 1.9. * Changes * Remove optional Ruby-GetText-Package dependency. ==== Ruby/GTK2 * Improvements * [ruby-gnome2-devel-en] FileChooserDialog raising warnings on Windows: Added hicolor-icon-theme into gem on Windows. [Suggested by Nikolai Weibull] * Fixes * Fixed a crash by GC. * Plugged memory leaks. * Fixed Gdk::GC#colormap= uses wrong value. * Fixed Gtk::TextBuffer#serialize uses wrong value. ==== Ruby/Pango * Fixes * Plugged memory leaks. ==== Ruby/GdkPixbuf * Improvements * Gdk::Pixbuf.new supports hash argument. * Fixes * Plugged memory leaks. ==== Ruby/GStreamer * Improvements * Supported Windows gem. * Improved memory management. * Fixes * [GitHub#86] Gstreamer: test_caps test fails. [Reported by mtasaka] * [GitHub#87] GStreamer: test_span test fails. [Reported by mtasaka] * [GitHub#87] GStreamer: test_create_clock test fails. [Reported by mtasaka] * [GitHub#89] GStreamer: test_fraction_range_new test fails. [Reported by mtasaka] * [GitHub#91] GStreamer: test_state "sometimes" fails. [Reported by mtasaka] ==== Ruby/Poppler * Fixes * Fixed a wrong conversion in Poppler::Document#find_dest. [Reported by Chloé Desoutter] === Thanks * Geoff Youngs * mtasaka * Chloé Desoutter * Nikolai Weibull == Ruby-GNOME2 1.0.3: 2011-09-19 This is a bug fix release of 1.0.2. === Changes ==== Ruby/GLib2 * Fixes * [#3411234] Supported RubyGems 1.8.6. [Tobias Pfeiffer, Kouhei Sutou] === Thanks * Tobias Pfeiffer == Ruby-GNOME2 1.0.2: 2011-09-18 This is a bug fix release of 1.0.1. === Changes ==== Ruby/GLib2 * Fixes * [#3411204] Supported RubyGems 1.8.6. [Tobias Pfeiffer, Kouhei Sutou] ==== Ruby/GTK2 * Fixes * Fixed the default theme on Windows. [ashbb, Kouhei Sutou] === Thanks * Tobias Pfeiffer * ashbb == Ruby-GNOME2 1.0.1: 2011-09-18 This is a bug fix release of 1.0.0. === Changes ==== Ruby/GLib2 * Improvements * GLib::IOChannel.open supports Windows. [OBATA Akio, Kouhei Sutou] * Added RVAL2STRV_FREE(), CSTRFILENAME2RVAL(), RVAL2STRV, STRV2RVAL(), G_REPLACE_SET_PROPERTY(), G_REPLACE_GET_PROPERTY() and G_REPLACE_ACTION(). [Nikolai Weibull] * Fixes * GLib::IOChannelWin32Socket.new uses raw socket handle not file descriptor. [NAKAMURA Usaku, Kouhei Sutou] ==== Ruby/GTK2 * Fixes * [#3383158] removed non LANG=C characters to be buildable on LANG=C environment. [Antonio Terceiro, Kouhei Sutou] * Fixed Gtk::FileFilter#add_custom crash. [Jeff Moore, Kouhei Sutou] * Fixed initialization order. [ashbb, Kouhei Sutou] ==== Ruby/GooCanvas * Improvements * Supported binary bundled gem. [HAYASHI Kentaro] ==== Ruby/GtkSourceView2 * Fixes * Fixed bundled binary directory path on Windows. [HAYASHI Kentaro] ==== Ruby/GtkMozEmbed * Deprecated. === Thanks * Antonio Terceiro * OBATA Akio * NAKAMURA Usaku * HAYASHI Kentaro * Jeff Moore * ashbb * Nikolai Weibull == Ruby-GNOME2 1.0.0: 2011-07-13 This is the first major release!!! === Changes ==== Document * Fixes * updated deprecated list in README. [Michal Suchanek, Kouhei Sutou] ==== Ruby/GLib2 * Improvements * bind g_io_channel_win32_new_socket() as GLib::IOChannelWin32Socket. [Kouhei Sutou] * Fixes * [#3312572] added missing parentheses. [Evan Phoenix] === Thanks * Evan Phoenix * Michal Suchanek == Ruby-GNOME2 0.90.9: 2011-06-11 NOTE: 0.90.x releases are for 1.0.0 major release. This is the last release of 0.90.x series. The next release will be 1.0.0! === Changes ==== All * Fixes * Fix a bug in version numbers. [Grant Schoep, Vincent Carmona] * Support 'bundle install' . ==== Ruby/GLib2 * Improvements * Support GLib::IOChannel.new(fd) and GLib::IOChannel#fd on Windows. * GLib::IOChannel#write returns written byte not self. [backward incompatible] ==== Ruby/GTK2 * Fixes * fix misc/bindings.rb sample (ruby 1.9). [Vincent Carmona] * [#3305589] fix Gtk::Window#add_accel_group misses a reference to accel group. [Piotr Korzuszek, Kouhei Sutou] * Support cairo related samples in Ruby 1.9. [Jon, Kouhei Sutou] ==== Ruby/GStreamer * Improvements * add Gst::Registry.update method. [Vincent Carmona] ==== Ruby/VTE * Fixes * [#3199587] fix pc install. [OBATA Akio, Kouhei Sutou] ==== Ruby/Poppler * Fixes * [#3292118] don't run needless tests. [Mamoru Tasaka, Kouhei Sutou] ==== Ruby/GtkSourceView2 * Improvements * support Windows. [S.Kitagawa] === Thanks * OBATA Akio * Grant Schoep * Mamoru Tasaka * Piotr Korzuszek * S.Kitagawa * Jon == Ruby-GNOME2 0.90.8: 2011-03-04 NOTE: 0.90.x releases are for 1.0.0 major release. A bug fix release of 0.90.7. === Changes ==== All * Fixes * 'make distclean' does not removed pkg-config files. ==== Ruby/GLib2 * Fixes * fix non-gem rcairo detection. [#3178228] [OBATA Akio, Kouhei Sutou] ==== Ruby/Atk * Fixes * fix 'make distclean' cleans needed a file. [Vincent Carmona] ==== Ruby/Pango * Fixes * fix 'make distclean' cleans needed a file. [Vincent Carmona] ==== Ruby/GTK2 * Fixes * fix require order. [id:kenhys] * [#3046538] fix crash by GC at exit. [Vincent Carmona, Kouhei Sutou] * gtk-demo samples with ruby 1.9 (excepted cairo ones). [Vincent Carmona] ==== Ruby/GooCanvas * Fixes * fix pc install. [#3178294] [OBATA Akio, Kouhei Sutou] ==== Ruby/GStreamer * Improvements * improve missing message. [Vincent Carmona] * add Gst::InstallPlugins. [Vincent Carmona, Kouhei Sutou] * Fixes * fix pc install. [#3178294] [OBATA Akio, Kouhei Sutou] * don't use rbgprivate.h. [#3188442] [Mamoru Tasaka, Kouhei Sutou] ==== Ruby/GtkMozEmbed * Fixes * fix pc install. [#3178294] [OBATA Akio, Kouhei Sutou] ==== Ruby/GtkSourceView2 * Fixes * fix pc install. [#3178294] [OBATA Akio, Kouhei Sutou] === Thanks * OBATA Akio * Vincent Carmona * id:kenhys * Mamoru Tasaka == Ruby-GNOME2 0.90.7: 2011-02-02 NOTE: 0.90.x releases are for 1.0.0 major release. A package fix release of 0.90.6. === Changes ==== Ruby/GLib2 * Improvements * force remove "-Wl,--no-undefined" linker option because Ruby-GNOME2 packages doesn't support the option. [Dobai-Pataky Bálint, Kouhei Sutou] ==== Ruby/GTK2 * Improvements * use "MS-Windows" GTK+ theme by default on Windows. [ashbb, Kouhei Sutou] === Thanks * ashbb * Dobai-Pataky Bálint == Ruby-GNOME2 0.90.6: 2011-01-29 NOTE: 0.90.x releases are for 1.0.0 major release. Removed deprecated packages. All supported packages support RubyGems. All supported packages except Ruby/VTE, Ruby/GStreamer and Ruby/GtkMozEmbed support also Windows binary bundled gem. === Changes ==== All * remove all deprecated packages. [Masaaki Aoyagi] * all supported packages support RubyGems. [Masaaki Aoyagi] ==== Ruby/GLib2 * Imrpovements * add gnome2-raketask.rb that is a utility library to define Rake tasks for Ruby-GNOME2 packages. [Masaaki Aoyagi, Kouhei Sutou] * Fixes * fix GType conversion. [Kouhei Sutou] * fix rcairo installed by RubyGems detection. [Masaaki Aoyagi] ==== Ruby/GIO2 * Improvements * support GIO 2.26. [Nikolai Weibull] ==== Ruby/GStreamer * Improvements * add Gst::MissingURISourceMessage. [Vincent Carmona, Kouhei Sutou] * support RubyGems. [Masaaki Aoyagi] ==== Ruby/Pango * Fixes * rename Pango::LayoutIter#at_last_line! to at_last_line? because at_last_line is a predicate method. (at_last_line! still exists for backward compatibility.) [mrkn, Kouhei Sutou] ==== Ruby/GtkMozEmbed * Improvements * support RubyGems. [Masaaki Aoyagi] * Fixes * support "2.0b7" style module version. #3141244 [reandr, Kouhei Sutou] ==== Ruby/GooCanvas * Improvements * support RubyGems. [Masaaki Aoyagi] ==== Ruby/GtkSourceView2 * Improvements * support RubyGems. [Masaaki Aoyagi] ==== Ruby/VTE * Improvements * support RubyGems. [Masaaki Aoyagi] === Thanks * Vincent Carmona * mrkn * reandr * Nikolai Weibull * Masaaki Aoyagi == Ruby-GNOME2 0.90.5: 2010-10-28 NOTE: 0.90.x releases are for 1.0.0 major release. A build system improvements release. === Changes ==== All * Improvements * add --with-pkg-config-dir option to extconf.rb for *.pc. ==== Ruby/GLib2 * Improvements * glib-mkenums.rb can work with Ruby 1.9 on LANG=C. [Kouhei Sutou] * Bug fixes * fix pkg-config gem dependency. [Kouhei Sutou] == Ruby-GNOME2 0.90.4: 2010-10-24 NOTE: 0.90.x releases are for 1.0.0 major release. A bug fix release of 0.90.3. === Changes ==== Ruby/GLib2 * Bug fixes * add missing '*' for String type conversion. [#3093789] [tmtms, Kouhei Sutou] ==== Ruby/GIO2 * Bug fixes * Remove needless cairo dependency. [OBATA Akio, Kouhei Sutou] ==== Ruby/Libglade2 * Improvements * Don't install *.pc by default. [OBATA Akio, Kouhei Sutou] === Thanks * OBATA Akio * tmtms == Ruby-GNOME2 0.90.3: 2010-10-23 NOTE: 0.90.x releases are for 1.0.0 major release. * Support String encoding in Ruby 1.9. * RVAL2CSTR2 and CSTR2RVAL2 are deprecated. * Ruby/GIO2 is imported as an experimental library. === Changes ==== All * Support String encoding. [Guillaume Cottenceau, Neil Roberts, Kouhei Sutou] * Don't install *.pc by default. Set pkgconfigdir make varialbe like 'make pkgconfigdir=/usr/lib/pkgconfig'. ==== Ruby/GLib2 * Improvements: * declare argument types. [Nobuyoshi Nakada, Kouhei Sutou] ==== Ruby/GIO2 * Imported as an experimental library. [Nikolai Weibull] ==== Ruby/GTK2 * Improvements: * keep backward compatibility around GDK key symbols introduced at GTK+ 2.20. "[ruby-gnome2-devel-en] Constants names change in Gdk::KeyVal" [Vincent Carmona] * move gdk-pixbuf and cairo related methods from Ruby/GdkPixbuf2. "[ruby-gnome2-devel-en] gtk2 dependency to gdkpixbuf2" [Andrea Dallera, Kouhei Sutou] * Bug fixes: * fix GType conversion in Gtk::ItemFactory.new on 64bit platform. [Grant McLean, Steve Wills, Kouhei Sutou] ==== Ruby/GdkPixbuf2 * Improvements: * move gdk-pixbuf and cairo related methods to Ruby/GTK2. "[ruby-gnome2-devel-en] gtk2 dependency to gdkpixbuf2" [Andrea Dallera, Kouhei Sutou] * change .pc filename from ruby-gdkpixbuf2 to ruby-gdk-pixbuf2. ==== Ruby/RSVG2 * Bug fixes: * add missing libcroco dependency on Windows. [U.Nakamura, Kouhei Sutou] ==== Ruby/Poppler * Improvements: * support Popper 0.15.0. [#3079667] [Mamoru Tasaka, Kouhei Sutou] * Bug fixes: * add missing libjpeg dependency on Windows. [U.Nakamura, Kouhei Sutou] * fix installed Ruby/GLib2 gem can't be detected. [kdmsnr, Kouhei Sutou] === Thanks * U.Nakamura * kdmsnr * Mamoru Tasaka * Guillaume Cottenceau * Vincent Carmona * Grant McLean * Steve Wills * Andrea Dallera * Nobuyoshi Nakada * Neil Roberts == Ruby-GNOME2 0.90.2: 2010-09-26 NOTE: 0.90.x releases are for 1.0.0 major release. A RubyGems package fix release. === Changes ==== All * fix path. [kimura wataru, Kouhei Sutou] ==== Ruby/GTK2 * Bug fixes: * fix gtk2/base.rb is missing in gem. [S.Kitagawa, Kouhei Sutou] ==== Ruby/GIO2 * Bug fixes: * fix a typo in .pc name. [#3075619] [O01eg, Kouhei Sutou] ==== Ruby/RSVG2 * Bug fixes: * also check rb_cairo.h availability. [#3075617] [O01eg, Kouhei Sutou] === Thanks * S.Kitagawa * O01eg * kimura wataru == Ruby-GNOME2 0.90.1: 2010-09-23 NOTE: 0.90.x releases are for 1.0.0 major release. A install bug fix release of 0.90.0. === Changes ==== Ruby/ATK * Bug fixes: * fix .pc install path. [OBATA Akio, Kouhei Sutou] ==== Ruby/GTK2 * Bug fixes: * fix .pc install path. [OBATA Akio, Kouhei Sutou] ==== Ruby/Pango * Bug fixes: * fix .pc install path. [OBATA Akio, Kouhei Sutou] ==== Ruby/Poppler * Bug fixes: * fix .pc install path. [OBATA Akio, Kouhei Sutou] ==== Ruby/RSVG * Bug fixes: * fix .pc install path. [OBATA Akio, Kouhei Sutou] === Thanks * OBATA Akio == Ruby-GNOME2 0.90.0: 2010-09-23 NOTE: 0.90.x releases are for 1.0.0 major release. RubyGems support! === Changes ==== Ruby/GTK2 * Bug fixes: * [ruby-gnome2-devel-en] Gtk 2.20, Gtk::Builder and 'name' add Gtk::Buildable#builder_name/set_builder_name. [Simon Arnaud, Kouhei Sutou] === Thanks * Simon Arnaud == Ruby-GNOME2 0.19.4: 2011-04-17 NOTE: 0.19.x releases are development series. This release has many bug fixes and some improvements. The fixed bugs include a memory leak bug on GC. If your application live long time, you should upgrade. === Changes ==== Ruby/GLib2 * Bug fixes: * fixed type_register on Ruby 1.9. [Simon Arnaud, Kouhei Sutou] * fixed memory leak in GC. [Kouhei Sutou] ==== Ruby/GTK2 * Bug fixes: * [#2865895] support GdkWindow's cursor property. NOTE: GTK+ 2.18.0 is unsupported version. [Guillaume Cottenceau, Mamoru Tasaka] * Gtk::MenuItem.new accepts nil as a label. [Kazuhiro NISHIYAMA, Kouhei Sutou] * fixed wrong conversion in Gtk::TreePath#<=>. [Takeuchi Yusuke, Kouhei Sutou] * fix Gtk::RecentInfo#application_info's double free bug. [Kouhei Sutou] * Improvements: * Gdk::Window#invalidate accepts nil as 'area' argument. It means 'invalidates whole window'. [Hiroyuki Ito] * Gtk::Clipbord#request_text sets UTF-8 encoding in Ruby 1.9. [Rg Rg, Kouhei Sutou] * add Gtk::TreePath#==. [Takeuchi Yusuke, Kouhei Sutou] ==== Ruby/Pango * Improvements: * add Pango::Gravity. [Hiroyuki Ito, Kouhei Sutou] ==== Ruby/GdkPixbuf * add Gdk::Pixbuf#pixels=. [Michal Suchanek] ==== Ruby/GStreamer * Bug fixes: * [#2920997] fix argument type. [Johan Kiviniemi] * [#2924886] implement Gst::MessageTag#parse. [Vincent Carmona] ==== Ruby/GtkMozEmbed * Bug Fixes: * [#2924766] fix -Wl,-rpath syntax. [OBATA Akio] * [#2925285] Gtk::MozEmbed#chrome_mask fails. [tobi, Kouhei Sutou] * support XULRunner 1.9.2. [OBATA Akio] === Thanks * Guillaume Cottenceau * Mamoru Tasaka * Michal Suchanek * Simon Arnaud * Kazuhiro NISHIYAMA * Johan Kiviniemi * OBATA Akio * Hiroyuki Ito * Rg Rg * Vincent Carmona * tobi * Takeuchi Yusuke == Ruby-GNOME2 0.19.3: 2009-09-24 NOTE: 0.19.x releases are development series. This release is a bug fix release of 0.19.2. === Changes ==== Ruby/GLib2 * Bug fix: * really fix 'empty $(vendorarchdir) related build problem on CentOS 5.3 x86_64.' [Simon Arnaud, Kouhei Sutou] === Thanks * Simon Arnaud == Ruby-GNOME2 0.19.2: 2009-09-23 NOTE: 0.19.x releases are development series. This release is a bug fix release of 0.19.1. === Changes ==== Ruby/GLib2 * Bug fixes: * empty $(vendorarchdir) related build problem on CentOS 5.3 x86_64. [Toshiyuki Suzumura, Kouhei Sutou] * [#2862022] fix multi thread blocking with Ruby 1.8.6-p368 or later and 1.8.7-p173 or later. [Roy Wright, Andrea Dallera, Kouhei Sutou] * [Debian #502262] work Ruby thread with GTK+. [Johan Walles, Kouhei Sutou] ==== Ruby/GTK2 * Bug fixes: * [#2679744] fix a typo: Gtk::Widget#set_scroll_adjustment -> Gtk::Widget#set_scroll_adjustments. [Kentaro Fukuchi, Kouhei Sutou] ==== Ruby/GtkMozEmbed * Bug fixes: * fix .pc detection. [OBATA Akio, Kouhei Sutou] === Thanks * OBATA Akio * Toshiyuki Suzumura * Roy Wright * Andrea Dallera * Johan Walles * Kentaro Fukuchi == Ruby-GNOME2 0.19.1: 2009-07-26 NOTE: 0.19.x releases are development series. This release is a bug fix release of 0.19.0. === Changes ==== Ruby/GTK2 * use RUBYARCHDIR [OBATA Akio] * #2814953: install missing headers [Mamoru Tasaka] ==== Ruby/GLib2 * Bug fixes: * avoid object allocation while GC [OBATA Akio, Kouhei Sutou] * use RUBYARCHDIR [OBATA Akio] * mkmf-gnome2.rb add "-I$(vendorarchdir)" to $CPPFLAGS. [OBATA Akio, Kouhei Sutou] ==== Ruby/ATK * use RUBYARCHDIR [OBATA Akio] ==== Ruby/Pango * use RUBYARCHDIR [OBATA Akio] * use gem version rcairo as fallback [OBATA Akio] ==== Ruby/Libart * use RUBYARCHDIR [OBATA Akio] ==== Ruby/GdkPixbuf * use gem version rcairo as fallback [OBATA Akio] ==== Ruby/GnomePrint * install rblibgnomeprintversion.h [OBATA Akio, Kouhei Sutou] ==== Ruby/GtkMozEmbeded * fix header generation error caused by missing file [OBATA Akio] ==== Ruby/VTE * support VTE 0.20 [Kouhei Sutou] ==== Ruby/PanelApplet * #2815036: re-support Ruby 1.8.6. [Mamoru Tasaka, Kouhei Sutou] ==== Ruby/Libglade2 * Debian#519786: fix GC related SEGV when a widget in glade is removed by hand. [Arnaud Cornet, Kouhei Sutou] === Thanks * OBATA Akio * Mamoru Tasaka * Arnaud Cornet == Ruby-GNOME2 0.19.0: 2009-05-29 NOTE: 0.19.x releases are development series. This release supports new versions of panel-applet and xulrunner and fixes various bugs including some GC issues === Changes Ruby/GLib2: * add 'const' to name argument of rbgerr_define_gerror() [Nikolai Weibull, Kouhei Sutou] * Bug fixes: * #2420281: Failed to build [troels knak-nielsen, Kouhei Sutou] * #2493874: glib/rbglib_maincontext.c error in "RUBY_UBF_IO" [boo, Kouhei Sutou] * wrong priority conversion in GLib::Timeout.add and GLib::Timeout.add_seconds. [Nikolai Weibull] * fixed limits of basic types [Pascal Terjan] Ruby/GTK2: * Bug fixes: * fixed initialize function is deleted. [kimura wataru, Kouhei Sutou] * checked GTK_FILE_SYSTEM_ERROR availability. GTK+ 2.15.x doesn't have it. [Kouhei Sutou] * fixed GC problems. [Kouhei Sutou] * #2195432: Gtk::RCStyle.set_color_flags wrong conversion [Jesse van den Kieboom, Kouhei Sutou] * #2318481: gtkselectiondata_set Drag and Drop API problem [dave foster, Kouhei Sutou] * #2420281: Failed to build [troels knak-nielsen, Kouhei Sutou] Ruby/Pango: * added Pango::Attribute#start_index= and Pango::Attribute#end_index=. [Geoff Youngs, Kouhei Sutou] Ruby/Poppler: * removed 0.6.x support. 0.8.0 or later is required. [Kouhei Sutou] Ruby/RSVG2: * fixed broken cairo integration. [James Healy, Kouhei Sutou] Ruby/PanelApplet: * #2466921: fixed build failure with libpanel-applet >= 2.25 [Mamoru Tasaka, Kouhei Sutou] * fixed incomplete install. [Pascal Terjan, Kouhei Sutou] Ruby/GtkMozEmbed: * supported XULRunner 1.9.0. [Arnaud Cornet, Kouhei Sutou] Ruby/GNOME2: * supported MinGW. [id:luna_8bit, Kouhei Sutou] Ruby/Bonobo2: * moved Bonobo.setup_x_error_handler to Ruby/BonoboUI2. [id:luna_8bit, Kouhei Sutou] Ruby/BonoboUI2: * moved Bonobo.setup_x_error_handler from Ruby/Bonobo2. [id:luna_8bit, Kouhei Sutou] Ruby/GnomeVFS: * format security error. [Pascal Terjan] === Thanks * kimura wataru * Philipp Götzinger * Andrew S. Townley * Jesse van den Kieboom * James Healy * dave foster * troels knak-nielsen * boo * Geoff Youngs * Arnaud Cornet * id:luna_8bit == Ruby-GNOME2 0.18.0: 2008-09-30 This release fixes some memory leak bugs and has new experimental packages. === Changes Ruby/GLib2: * mkmf-gnome2.rb: add check_cairo. [Kouhei Sutou] * fixed memory leaks. [Kouhei Sutou] * [#2110165] Gdk::Pixbuf memory leak * install glib-enum-types.h. [Andy Spencer] * [#2106938] Install glib-enum-types.h Ruby/GTK2: * add GTK+ 2.12 related bindings. [Guillaume Cottenceau] * fixed initialize order. [Kouhei Sutou] * [#2113491] Incorrect initialize order (compiling with mingw) Ruby/GooCanvas [NEW][EXPERIMENTAL]: * added. [Kouhei Sutou] Ruby/Pango: * fixed memory leaks. [Kouhei Sutou] Ruby/GtkSourceView2 [NEW][EXPERIMENTAL]: * add. [yselkowitz] === Thanks * OBATA Akio * James Healy * Ricky Zheng * Guillaume Cottenceau * Ricky Zheng == Ruby-GNOME2 0.17.0: 2008-09-07 === Release notes * This Release supports Ruby 1.8.7 and has many bug fixes and new bound functions. === Main changes Ruby/GLib: * [#2060606] Crash when removing ruby applet from gnome panel with 0.7rc1 [Kouhei Sutou] Ruby/GTK: * [#2025651] FTBFS with gtk+ 2.13.5 [Cesare Tirabassi, Kouhei Sutou] * [#2043970] Segfaults on 64-bit Linux [Neil Roberts, Kouhei Sutou] Ruby/Pango: * [#2043970] Pango::FontDescription#weight= seg fault [Kouhei Sutou] Many other changes, GC bugs, Segfault fixes. See corresponding ChangeLog for detailed information on changes and contributors. === Thanks Special thanks for your contributions to: (list in no particular order) * Neil Roberts * Cesare Tirabassi * Arnaud Cornet == Ruby-GNOME2 0.17.0-rc1: 2008-06-06 === Release notes * This Release Candidate seems to be pretty stable. Please give us feedback if you encounter any problems. * The win32 bindings will be released later and will be considered as EXPERIMENTAL The changes marked with 2 stars (**) may currently not work on win32 platforms. === Main changes Ruby/GLib: * Bound functions defined since 2.14 and 2.16. * Improved main loop polling. ** * Improved callback handling from non Ruby thread. ** This changes breaks API. Sjoerd, you need to call rbgutil_start_callback_dispatch_thread() in your GStreamer bindings. Sorry. * Supported convenience GEnum and GFlags notation. e.g.: GLib::UTF8.normalize(utf8, GLib::NormalizeMode::NFD) -> GLib::UTF8.normalize(utf8, :nfd) key_file.load_from_data(data, GLib::KeyFile::KEEP_COMMENTS | GLib::KeyFile::KEEP_TRANSLATIONS) -> key_file.load_from_data(data, [:keep_contents, :keep_translations]) * Fixed locale dependent constant name computation. [#1901843] [Kouhei Sutou] Ruby/GTK: * partially support new symbols in 2.12 (Gtk::RecentAction, Gtk::TextBuffer, Gdk::Display, Gtk::TreeViewColumn, Gtk::Stock, Gtk::Widget, Gtk::ScaleButton, Gtk::TreeView, Gtk::VolumneButton, Gtk::Tooptip and Gtk::TextMark only). * [#2025651] FTBFS with gtk+ 2.13.5 [Cesare Tirabassi, Kouhei Sutou] * [#2043970] Segfaults on 64-bit Linux [Neil Roberts, Kouhei Sutou] Ruby/GStreamer: * Worked with GStreamer >= 0.10.x but isn't completed yet. Ruby/Poppler: * Supported poppler-glib 0.6.x and 0.8.0. [Kouhei Sutou] Ruby-GNOME2: * Ruby-GNOME2 can be built with ruby 1.9.0 but doesn't work well without [ruby-dev:34104] patch. * Some extconf.rb improvements Many other changes, GC bugs, Segfault fixes. See corresponding ChangeLog for detailed information on changes and contributors. === Thanks Special thanks for your contributions to: (list in no particular order) * Kazuhiro NISHIYAMA * Kouhei Sutou * Kero van Gelder * Masahiro Sakai * Detlef Reichl * Guillaume Cottenceau * Masahiro Sakai * Mikael Hallendal * Carlo E. Prelz * Sjoerd Simons * Juergen Mangler * Dirk von Schmieden * Mathieu Blondel * Joseph Method * Masayuki Yamaguchi And also special thanks to all other contributors not listed above! == Ruby-GNOME2 0.16.0: 2006-12-30 Ruby-GNOME2: * Fixed serious bugs (depends on GC) * Support GTK+-2.10 and the latest version of each libraries. * Don't include Ruby/GStreamer and Ruby/Libgda. We cancel to support Ruby/GStreamer and Ruby/Libgda. * Cancel to support ruby-1.6.x and GTK+-2.4 or earlier. Ruby/GLib: * Support GLib+-2.10 APIs. [Kouhei Sutou, Masao Mutoh] * Fix segfaults related GC with signal handlers. [Guillaume Cottenceau, Kouhei Sutou] * Add functions for Unicode Manipulation [Kouhei Sutou] GLib::Unicode, GLib::UTF8, GLib::UTF16, GLib::UCS4, GLib::UniChar * Add Key-value file parser [Masao Mutoh] GLib::KeyFile * Add Bookmark file parser [Masao Mutoh] GLib::BookmarkFile * Add Win32 compatibility functions [Masao Mutoh] GLib::Win32 * Add glib-mkenums.rb [Kouhei Sutou, Masao Mutoh] * Other improvement and fix bugs.[Kouhei Sutou, Masao Mutoh] Ruby/ATK: * Support ATK-1.12 APIs. [Masao Mutoh] Ruby/Pango: * Support Pango-1.2, 1.4 APIs [Masao Mutoh] * Fix some bugs. [Masao Mutoh] Ruby/GdkPixbuf: * Move Cairo::Context#set_source_pixbuf from Ruby/GTK.[Kouhei Sutou] You can use the methods unless X server. Ruby/GTK: * Support GTK+-2.10. [Pascal Terjan, Kouhei Sutou, Masao Mutoh] Gtk::PrintUnixDialog, Gtk::PageSetupUnixDialog, Gtk::Print*, Gtk::PageSet Gtk::LinkButton, Gtk::Recent*, Gtk::Assistant, Gtk::StatusIcon * Other improvement and fix bugs [Sjoerd Simons, Kouhei Sutou, Masao Mutoh] Ruby/GNOME: * None. Ruby/GnomeCanvas: * Fixed a bug and trivial improvement. [Masao Mutoh] Ruby/Libglade: * Fixed some bugs and trivial improvement. [Kouhei Sutou, Masao Mutoh] Ruby/Libart: * a trivial improvement. [Kouhei Sutou] Ruby/GConf: * Sample code cleanup. [Masao Mutoh] Ruby/GnomeVFS: * None. Ruby/GtkHtml2: * None. Ruby/GtkGLExt: * None. Ruby/PanelApplet: * None. Deprecated (Use Gtk::StatusIcon in Ruby/GTK+) Ruby/GtkSourceView: * Support gtksourceview-1.8. Some improvements. [Kouhei Sutou, Masao Mutoh] Ruby/GnomePrint: * None. Ruby/GnomePrintUI: * a trivial improvement. [Kouhei Sutou] Ruby/RSVG: * Added a sample [Kouhei Sutou] * Improved, fixed bugs [Kouhei Sutou] Ruby/GtkMozEmbed: * a trivial improvement. [Masao Mutoh] Ruby/Poppler: * Improved, fixed bugs [Kouhei Sutou] Ruby/VTE: * None. Ruby/GStreamer: * Canceled. Ruby/Libgda: * Canceled. == Ruby-GNOME2-0.15.0: 2006-07-01 Ruby/GLib: * Improve signal handlers with pthread ruby(--enable-pthread). [Sjoerd Simons] * Added new fundamental object for other bindings. [Sjoerd Simons] * GLib::Source#remove -> GLib::Soruce.remove [Kouhei Sutou] * Added new macros (GLIST2ARYF, GLIST2ARY2F, GSLIST2ARYF, GLIST2ARY2F, G_PROTECT_CALLBACK) [Masao Mutoh] * Added GLib.win32_locale, GLib, win32_locale_filename_from_utf8 [Kouhei Sutou] * Improve memory management [Kouhei Sutou, Sjoerd Simons, Masahiro Sakai, Masao Mutoh] * Other improvement and fix bugs. [Sjoerd Simons, Joao Pedrosa, Kouhei Sutou, Masahiro Sakai, Masao Mutoh] Ruby/ATK: * Improved cygwin support. [Masao Mutoh] * Fix a bug. [Masahiro Sakai] Ruby/Pango: * Fix some bugs. [Laurent Sansonetti, Masao Mutoh] * Added Pango::Layout#markup=, Pango::AttrAbsoluteSize [Masao Mutoh] Ruby/GdkPixbuf: * Fix a bug. [NISHI Takao] * Code cleanup [Masao Mutoh] Ruby/GTK: * Improve signal handlers. [Masahiro Sakai] * Added Gtk::Widget#set_widget, #set_requisition. [Daniel Chokola] * Added Gtk::Dialog#get_response. [Masao Mutoh] * Other improvement and fix bugs [Mario Steele, Tilman Sauerbeck, Geoff Youngs, Masahiro Sakai, Kouhei Sutou, Masao Mutoh] Ruby/GNOME: * Follow Ruby/GLib2 change(GRClosure). [Kouhei Sutou] Ruby/GnomeCanvas: * Code cleanup [Kouhei Sutou, Masao Mutoh] Ruby/Libglade: * Fixed some bugs and trivial improvement. [Masao Mutoh] Ruby/Libart: * None. Ruby/GConf: * Sample code cleanup. [Masao Mutoh] Ruby/GStreamer: * Sample code cleanup. [Masao Mutoh] Ruby/GnomeVFS: * Improved and fixed bugs. [Masahiro Sakai, Masao Mutoh] Ruby/GtkHtml2: * Sample code cleanup. [Masao Mutoh] Ruby/GtkGLExt: * Improved and fixed bugs. [Kouhei Sutou, Masao Mutoh] Ruby/Libgda: * Fix build against 1.3.x branch (libgda-2.x). [Laurent Sansonetti] Ruby/PanelApplet: * Fixed a bug [Patch #1431855] Ruby/GtkSourceView: * Sample code cleanup. [Masao Mutoh] Ruby/GnomePrint: * Added Gnome::Print::BINDING_VERSION. Code cleanup [Kouhei Sutou] Ruby/GnomePrintUI: * Added Gnome::PrintUI::BINDING_VERSION. [Kouhei Sutou] * Sample code cleanup. [Masao Mutoh] Ruby/RSVG: * Added RSVG::BINDING_VERSION, RBRSVG_MAJOR_VERSION, RBRSVG_MINOR_VERSION, RBRSVG_MICRO_VERSION. [Kouhei Sutou] * Supported 2.14. * Improved, fixed bugs [Kouhei Sutou, Masao Mutoh] Ruby/GtkMozEmbed: * Improved, fixed bugs [Mirko Maischberger, Masao Mutoh] Ruby/Poppler [NEW] [EXPERIMENTAL]: * Added [Kouhei Sutou] Ruby/VTE [NEW]: * Added [Kouhei Sutou] == Ruby-GNOME2 0.14.1: 2005-11-06 Ruby/GLib: * Fix memory leaks. [Masao Mutoh] Ruby/ATK: * None. Ruby/Pango: * Fix some bugs. [Masao Mutoh] Ruby/GdkPixbuf: * None. Ruby/GTK: * Improve memory management. [Masao Mutoh] Ruby/GNOME: * None. Ruby/GnomeCanvas: * None. Ruby/Libglade: * None. Ruby/Libart: * None. Ruby/GConf: * None. Ruby/GStreamer: * None. Ruby/GnomeVFS: * None. Ruby/GtkHtml2: * None. Ruby/GtkGLExt: * None. Ruby/Libgda: * None. Ruby/PanelApplet: * None. Ruby/GtkSourceView: * None. Ruby/GnomePrint: * None. Ruby/GnomePrintUI: * None. Ruby/RSVG: * None. Ruby/GtkMozEmbed: * None. == Ruby-GNOME2 0.14.0: 2005-10-16 Ruby/GLib: * Fix segfault related on GC. [Masao Mutoh] * Support Ruby-GetText-Pacakge(Include pseudo GetText module). [Masao Mutoh] * Add and completed: [Masao Mutoh] * Glib::Shell, GLib::Completion, GLib::Timer, sample/shell.rb, completion.rb, timer.rb. * Add some methods, improved, fixed bugs: [Pascal Terjan, Sven Herzberg, Masao Mutoh] * GLib, GLib::Object, GLib::MetaInterface, GLib::Enum, GLib::Flags, PKGConfig, extconf.rb, mkmf-gnome2.rb Ruby/ATK: * Support ATK-1.10. [Masao Mutoh] * Add Atk::BUILD_VERSION. [Masao Mutoh] * Add some methods, improved, fixed bugs: [Masao Mutoh] * Atk, Atk::Relation, Atk::RelationSet, Atk::StreamableContent, Atk::Text::Attribute, Atk::Util * Add and completed: [Masao Mutoh] * Atk::Util::KeyEventType Ruby/Pango: * Support Pango-1.10 and cairo [Kouhei Sutou, Masao Mutoh] * Add Pango::BUILD_VERSION. [Masao Mutoh] * Add some methods, improved, fixed bugs: [Kouhei Sutou, Masao Mutoh] * Pango, Pango::Layout, Pango::LayoutLine, Pango::LayoutIter, Pango::Language, Pango::Font, Pango::GlyphItem, Pango::GlyphString, Pango::Context, Pango::Analysis, Pango::Item * Add and completed: [Masao Mutoh] * Pango::ScriptIter, Pango::Script, Pango::(.*)FontMap, Pango::(.*)Face, Pango::(.*)Family, Pango::XFont, Pango::FT2Font, sample/script.rb, break.rb, item.rb, layout.rb * Add classes: [Kouhei Sutou, Masao Mutoh] * Pango::Engine, Pango::EngineShape, Pango::EngineLang Cairo::Context, Pango::CairoFcFont, Pango::CairoFont, Pango::CairoWin32Font, Pango::CairoFontMap * Rename class name: [Masao Mutoh] * Pango::FontSet -> Pango::Fontset, Pango::FontSetSimple -> Pango::FontsetSimple. Ruby/GdkPixbuf: * Support GTK+-2.8. [Guillaume Cottenceau] * Add some methods, improved, fixed bugs: [Kouhei Sutou, Guillaume Cottenceau] * Gdk::Pixbuf * Add and completed: [Guillaume Cottenceau] * Gdk::PixbufSimpleAnim, sample/simpleanim.rb Ruby/GTK: * Support GTK+-2.8. [Guillaume Cottenceau, Masao Mutoh] * Support cairo. [Kouhei Sutou, Masao Mutoh] * Add Gtk::BUILD_VERSION. [Masao Mutoh] * Add some methods, improve, fix bugs: [Guillaume Cottenceau, Masao Mutoh] * Gdk, Gdk::Drawable, Gdk::Display, Gdk::Drawable, Gdk::Cursor, Gdk::Window, Gdk::Screen, Gtk::Action, Gtk::Dialog, Gtk::Drag, Gtk::EntryCompletion, Gtk::FileChooser, Gtk::IconView, Gtk::Image, Gtk::Menubar, Gtk::MenuShell, Gtk::ScrolledWindow, Gtk::SizeGroup, Gtk::Stock, Gtk::TextBuffer, Gtk::TextIter, Gtk::ToolButton, Gtk::TreeRowReference, Gtk::TreeView, Gtk::TreeViewColumn, Gtk::Window, sample/gtk-demo/*.rb * Add: [Guillaume Cottenceau, Kouhei Sutou] * Cairo::Context, Gdk::EventGrabBroken, sample/gtk-demo/cairo_*.rb, sample/misc/rgtk+cairo.rb Ruby/GNOME [Masao Mutoh]: * Support libgnome/libgnomeui-2.12. * Add Gnome::BUILD_VERSION. * Add some methods, improve, fix bugs: * Gnome, Gnome::Util, Gnome::URL, Gnome::Help, Gnome::App, Gnome::Client * Add: Gnome::GConf, Gnome::Sound, Gnome::Trigger * sample/gnome-trigger.rb, sample/gnome-sound.rb Ruby/GnomeCanvas: * Support libgnomecanvas-2.12. [Pascal Terjan, Masao Mutoh] * Add Gnome::Canvas::BUILD_VERSION. [Masao Mutoh] * Add some methods, improve, fix bugs: [Kouhei Sutoh, Pascal Terjan, Masao Mutoh] * Gnome::CanvasItem, Gnome::CanvasPathDef, Gnome::Canvas. * Add: Gnome::CanvasBuf. [Masao Mutoh] Ruby/Libglade [Masao Mutoh]: * Support libglade-2.12. * Add GladeXML::BUILD_VERSION. * Add some methods, improve, fix bugs: bin/ruby-glade-create-template, sample/l10n_*.rb, GladeXML Ruby/Libart [Masao Mutoh]: * Add Art::BUILD_VERSION. * Add: Art::Uta. Ruby/GConf: * Support Cygwin. [Yaakov Selkowitz] * Add GConf::BUILD_VERSION. [Masao Mutoh] Ruby/GStreamer: * Support on Ruby-1.9. [Laurent Sansonetti] * Add Gst::BUILD_VERSION. [Masao Mutoh] * Fix bugs, improve, add some methods: [Masao Mutoh] * Gst::Element Ruby/GnomeVFS: * Support Cygwin. [Yaakov Selkowitz] * Add GnomeVFS::BUILD_VERSION. [Masao Mutoh] * Fix bugs, improve, add some methods: [Masao Mutoh] * GnomeVFS Ruby/GtkHtml2 [Masao Mutoh]: * Add Gtk::HtmlContext::BUILD_VERSION. Ruby/GtkGLExt: * Added Gtk::GL::BUILD_VERSION. [Masao Mutoh] * Fix bugs, improve, add some methods: [Kouhei Sutou] * Gdk::Pixmap Ruby/Libgda: * Support Cygwin. [Yaakov Selkowitz] * Add Gda::BUILD_VERSION. [Masao Mutoh] Ruby/PanelApplet [Masao Mutoh]: * Add PanelApplet::BUILD_VERSION. Ruby/GtkSourceView [Masao Mutoh]: * Support GtkSourcView-1.4. * Add Gtk::SourceView::BUILD_VERSION. * Fix bugs, Improve, Add some methods: * Gtk::SourceView, Gtk::SourceBuffer, Gtk::SourceTag, Gtk::SourceTagStyleMask * Add and completed: * Gtk::SourceStyleScheme, Gtk::SourcePrintJob Ruby/GnomePrint [Kouhei Sutou]: * Support libgnomeprint-2.12. * Add Gnome::Print::BUILD_VERSION * Fix bugs, Improve, Add some methods: * Gnome::PrintContext * Add: sample/gp-pac.rb Ruby/GnomePrintUI [Kouhei Sutou]: * Support libgnomeprintui-2.12. * Add: * Gnome::PrintUI::BUILD_VERSION, Gnome::FontSelection, Gnome::FontPreview, Gnome::FontDialog, Gnome::PrintContentSelector Ruby/RSVG [Kouhei Sutou]: * Support rsvg-2.12. * Add RSVG::BUILD_VERSION Ruby/GtkMozEmbed [NEW]: * Merged. [Mirko Maischberber] * Add Gtk::MozEmbed::BUILD_VERSION [Masao Mutoh] == Ruby-GNOME2 0.13.0: 2005-07-31 Ruby/GLib: * Fixed GCC 4.0 warnings [Masao Mutoh] * Added and completed: [Masao Mutoh] * GLib:PollFD, GLib::Source, GLib::MainLoop, GLib::IOChannel, GLib::Idle, GLib::ChildWatch * Added some methods, improved, fixed bugs: [Vincent Isambart, Masao Mutoh] * PKGConfig, extconf.rb, * Added: [Masao Mutoh] * GLib::MainContext, sample/iochannel.rb, idle.rb, timeout.rb, timeout2.rb, tests/test-iochannel.*, runner.rb, Ruby/ATK: * None. Ruby/Pango: * Fixed GCC 4.0 warnings [Masao Mutoh] * Support x86_64 [Masao Mutoh] * Pango::Layout * Added some methods, improved, fixed bugs: [Mirko Maischberger, Pascal Terjan, Masao Mutoh] * sample/parse.rb, Pango::LayoutLine, Pango::Coverage, Pango::LayoutIter, Pango::FontFamily, Pango::Attriterator Ruby/GdkPixbuf: * Fixed GCC 4.0 warnings [Masao Mutoh] * Fixed bugs, Improved: [Mirko Maischberger, Masao Mutoh] * sample/*.rb Ruby/GTK: * Support x86_64 [Kouhei Sutou, Masao Mutoh] * Gdk::Atom, Gtk::ItemFactory, Gtk::Widget, Gtk::Drag, Gtk::SizeGroup * Fixed GCC 4.0 warnings [Masao Mutoh] * Fixed bugs, Improved, Added some methods: [Hiroyuki Ikezoe, KATO Kazuyoshi, Pascal Terjan, Kouhei Sutou, Mirko Maischberger, Masao Mutoh] * Gtk::ActionGroup, Gtk::IconTheme, Gtk::RC, Gtk::TreeModel, Gdk::TimeCoord, Gdk::Window, Gtk::CellView, Gtk::ToolButton, Gtk::MenuToolButton, Gdk, Gdk::Display, Gdk::GC, Gdk::PangoAttrEmbossed, Gdk::Drawable, Gtk::Window, sample/gtk-demo/main.rb, sample/misc/*.rb, sample/testgtk/*.rb. * Added: [KATO Kazuyoshi, Masao Mutoh] * sample/gtk-demo/hypertext.rb, sample/misc/colorselection.rb Ruby/GNOME [Mirko Maischberger]: * sh-bang (!#) normalization * sample/test-gnome/*.rb Ruby/GnomeCanvas [Kouhei Sutou]: * Support x86_64, Improved. [Kouhei Sutou] * Gnome::CanvasPathDef Ruby/Libglade: * None. Ruby/Libart: * Added [Kouhei Sutou] * Art::DRect, Art::IRect * Fixed bugs, Improved, Added some methods: [Kouhei Sutou, Masao Mutoh] * Art::Affine, Art::BPath. Art::Canvas Ruby/GConf: * None. Ruby/GStreamer: * Fixed GCC 4.0 warnings [Masao Mutoh] * Added: [Laurent Sansonetti] * Gst::XOverLay, sample/video-player.rb, * Fixed bugs, Improved, Added some methods: [Laurent Sansonetti] * Gst::Caps, Gst::Pad, Gst::Element, Gst::TagSetter Ruby/GnomeVFS [Masao Mutoh]: * Fixed bugs, Improved, Added some methods: GnomeVFS::File Ruby/GtkHtml2: * None. Ruby/GtkGLExt: * None. Ruby/Libgda: * None. Ruby/PanelApplet [Masao Mutoh]: * Check libpanel-applet version(2.6 or later): extconf.rb Ruby/GtkSourceView [Masao Mutoh]: * None. Ruby/GnomePrint: * Fixed GCC 4.0 warnings [Masao Mutoh] * Fixed bugs, Improved, Added some methods. [Kouhei Sutou] * Gnome::PrintContext, Gnome::PrintJob, Gnome::PrintConfig, Gnome::PrintUnit, Gnome::PrintPaper, src/lib/gnomeprint2.rb, sample/to_file.rb Ruby/GnomePrintUI: * Fixed GCC 4.0 warnings [Masao Mutoh] * Fixed bugs, Improved, Added some methods. [Kouhei Sutou] * Gnome::PaperSelector, Gnome::PrintUnitSelector, Gnome::PrintPreview, Gnome::PrintDialog, Gnome::PrintConfigDialog, sample/dialog.rb, Ruby/RSVG: * Fixed GCC 4.0 warnings [Masao Mutoh] * Fixed bugs, Improved, Added some methods. [Kouhei Sutou] == Ruby-GNOME2 0.12.0: 2005-03-06 Ruby/GLib: * Support GLib-2.6.x. [Masao, Mutoh] * Support MS VC++. [Masao, Mutoh] * Fix bugs, Improved, Added some methods. [KATO Kazuyoshi, Masao Mutoh] * PKGConfig, rbgobj_lookup_class(). * Added: [Masao, Mutoh] * GLib::Threads, src/lib/pkg-config.rb, sample/spawn.rb. Ruby/ATK [Dafydd Harries, Vincent Isambart, Masao Mutoh]: * Support MS VC++. * Fix bugs, Improved, Added some methods. * Follow Ruby/GLib changes. Ruby/Pango [Masao Mutoh]: * Support Pango-1.8.x. * Support MS VC++. * Follow Ruby/GLib changes. * Added and completed: * Pango::Renderer, Pango::Matrix, Pango::AttrStrikethroughColor, Pango::AttrUnderlineColor, Pango::GlyphItem * Added some methods, improved, fixed bugs: [Matthew Berg] * Pango::Context, Pango::AttList, Pango::Attribute, Pango::Layout, Pango, Pango::AttrSize, Pango::LogAttr, Pango::Item, Pango::Analysis, Pango::Font, Pango::FontDescription, Pango::FontFace, Pango::FontSet, Pango::AttrList, Pango::AttrIterator, Pango::Rectangle, Pango::Layout, Pango::LayoutLine, Pango::LayoutIter, Pango::GlyphInfo * Added * Pango::FcFont, Pango::XftFont, Pango::FontFcFontMap, Pango::XftFontMap. * Renamed, Moved * Pango::FontFamily#list_faces -> #faces. Ruby/GdkPixbuf [leon breedt, Masao Mutoh]: * Support GTK+-2.6.x. * Follow Ruby/GLib changes. * Fixed bugs, Improved, Added some methods for GTK+-2.6.x: * Gdk::PixbufAnimationIter, Gdk::Pixbuf, Gdk::PixbufLoader, Gdk::PixbufFormat Ruby/GTK: * Support Ruby-1.9.x. * Support Pango-1.8.x. * Support GTK+-2.6.x. * Support MS VC++. * Follow Ruby/GLib changes. * Improve to support gthread. * Added and completed for GTK+-2.6.x: [Darren Willis, * Gtk::CellRendererProgress, Gtk::ScrollStep, Gtk::IconView, Gtk::CellRendererCombo, Gtk::AboutDialog, Gdk::PangoRenderer, Gtk::CellView, Gtk::MenuToolButton, Gtk::FileChooserButton, Gdk::EventChange, Gdk::X11 * Fixed bugs, Improved, Added some methods for GTK+-2.6.x: [Mirko Maischberger, Joao Pedrosa, KATO Kazuyoshi, Masao Mutoh] * Gtk, Gtk::CellLayout, Gtk::RadioToolButton, Gtk::ToggleToolButton, Gtk::Stock, Gtk::Image, Gtk::Label, Gtk::Progressbar, Gtk::EntryCompletion, Gtk::TextBuffer, Gtk::FileFilter, Gtk::FileChooser, Gtk::Menu, Gtk::CellRenderer, Gtk::TreeView, Gtk::TextView, Gtk::TextBuffer, Gtk::Drag, Gtk::ToolItem, Gtk::ActionGroup, Gtk::Action, Gtk::ComboBox, Gtk::Combo, Gtk::IconTheme, Gtk::SelectionData, Gtk::TargetList, Gtk::ListStore, Gtk::Window, Gtk::ToggleAction, Gtk::MessageDialog, Gdk::Region, Gdk::Window, Gtk::Clipboard, Gtk::Settings, Gtk::TreeModel, Gtk::ModelFilter, Gtk::TreeViewColumn, Gtk::Widget, Gdk::Pango, Gdk::Display, Gdk::Drawable, Gtk::RadioAction, Gdk::Screen, Gtk::TextBuffer, Gdk::Threads, sample/gtk-demo/*.rb, sample/misc/threads.rb, pangorenderer.rb * Added: [KATO Kazuyoshi, Darren Willis, Masao, Mutoh] * sample/misc/tree_progress.rb, misc_button.rb, aboutdialog.rb, aboutdialog2.rb, sample/gtk-demo/clipboard.rb, entry_completion.rb, expander.rb, iconview.rb Ruby/GNOME [Masao Mutoh]: * Follow Ruby/GLib changes. Ruby/GnomeCanvas [Masao Mutoh]: * Follow Ruby/GLib changes. Ruby/Libglade [Masao Mutoh]: * Follow Ruby/GLib changes. * Support MS VC++. * Improved. Ruby/Libart [KATO Kazuyoshi, Masao Mutoh]: * Follow Ruby/GLib changes. Ruby/GConf [Masao Mutoh]: * Follow Ruby/GLib changes. * Fixed bugs, Improved. * Deprecated: * GConf::Client.new Ruby/GStreamer: * Follow Ruby/GLib changes. [Masao Mutoh] * Added and completed: [Jack Paul, Masao Mutoh, Laurent Sansonetti] * Gst::TypeFindFactory, Gst::MediaInfoError, Gst::Tag, Gst::RegistryPool, Gst::TagSetter * Fixed bugs, Improved, Added some methods: [Jack Paul, Max Nickel, Masao Mutoh, Laurent Sansonetti] * Gst::Plugin, Gst::PluginFeature, Gst::Caps, Gst::Structure, Gst::Xml, Gst::Thread, Gst::Scheduler, Gst::SchedulerFactory, Gst::MediaInfo, sample/gst-inspect.rb Ruby/GnomeVFS [Masao Mutoh]: * Follow Ruby/GLib changes. * Fixed bugs, Improved. Ruby/GtkHtml2 [Masao Mutoh]: * Follow Ruby/GLib changes. Ruby/GtkGLExt [Masao Mutoh]: * Follow Ruby/GLib changes. Ruby/Libgda: * Support 1.1.99 * Follow Ruby/GLib changes. [Masao Mutoh] * Fixed bugs, Improved, Added some methods: [Laurent Sansonetti] Gda::DataModel, Gda::Provider, Gda::Quarklist, Gda::Connection * Renamed, Moved [Laurent Sansonetti] * Gda::DataModel#editable? => #updatable? * #editing? => changed? * #begin_edit => #begin_update * #cancel_edit => #cancel_update * #end_edit => #end_update Ruby/PanelApplet [Neil Stevens, Masao Mutoh]: * Follow Ruby/GLib changes. * Added some methods Ruby/GtkSourceView [Masao Mutoh]: * Follow Ruby/GLib changes. * Added some methods Ruby/GnomePrint: * Follow Ruby/GLib changes. [Masao Mutoh, Kouhei Sutou] * Fixed bugs, Improved, Added some methods. [Kouhei Sutou] Ruby/GnomePrintUI: * Follow Ruby/GLib changes. [Masao Mutoh, Kouhei Sutou] * Fixed bugs, Improved, Added some methods. [Kouhei Sutou] Ruby/RSVG: * Follow Ruby/GLib changes. [Masao Mutoh, Kouhei Sutou] * Fixed bugs, Improved, Added some methods. [Kouhei Sutou] == Ruby-GNOME2 0.11.0: 2004-11-14 Ruby/GLib [Kouhei Sutou, Vincent Isambart, Masao Mutoh]: * Fix bugs, Improved, Added some methods. Ruby/ATK [Vincent Isambart, Masao Mutoh]: * Support ATK+-1.7.x. * Fixed bugs, Improved, Added some methods. Ruby/Pango [Geoff Youngs, Vincent Isambart, Masao Mutoh]: * Improved, Fix bugs. Ruby/GdkPixbuf [Geoff Youngs, Masao Mutoh]: * Support GTK+-2.4.x. * Fixed bugs, Improved, Added some methods. Ruby/GTK [Geoff Youngs, Vincent Isambart, Masao Mutoh]: * Fixed bugs, Improved, Added some methods. Ruby/GNOME [Masao Mutoh]: * Improved. Ruby/GnomeCanvas [Masao Mutoh]: * Fixed bugs, Improved, Added some methods. Ruby/Libglade [Masao Mutoh]: * Improved. Ruby/Libart [Vincent Isambart, Masao Mutoh]: * Improved to support ruby-1.7.x or later. * Changed: [Masao Mutoh] * Art::Canvas::Color.new -> Art::Canvas.color. * Art::Vpath::Dash -> Art::VpathDash. Ruby/GConf [Masao Mutoh]: * Improved. Ruby/GStreamer [Masao Mutoh]: * Improved. Ruby/GnomeVFS [Masao Mutoh]: * Improved. Ruby/GtkHtml2 [Masao Mutoh]: * Improved. Ruby/GtkGLExt [Vincent Isambart]: * Improved. Ruby/Libgda: * None. Ruby/PanelApplet: * None. Ruby/GtkSourceView [Vincent Isambart, Masao Mutoh]: * Fixed bugs. Ruby/GnomePrint [NEW]: * Added. [Kouhei Sutou] Ruby/GnomePrintUI [NEW: Alpha release]: * Added. [Kouhei Sutou] Ruby/RSVG [NEW: Alpha release]: * Added. [Kouhei Sutou] == Ruby-GNOME2 0.10.1: 2004-08-16 Ruby/GdkPixbuf [Masao Mutoh]: - Fix bugs. Ruby/GTK [Masao Mutoh]: - Support GTK+-2.0.x again. Ruby/GtkSourceView [Masao Mutoh]: - Fix bugs. == Ruby-GNOME2 0.10.0: 2004-08-09 Ruby/GLib [Masao Mutoh]: * Added: [Kazuhiro NISHIYAMA, Masao, Mutoh] * GLib::Spawn, sample/utils.rb, sample/type-register2.rb * Added some methods, improved, fixed bugs: [Laurent Sansonetti, Pascal Terjan, Masao Mutoh] * GLib, GLib::Object, GLib::Log, glib2.rb, Ruby/ATK [Masao Mutoh]: * None. Ruby/Pango [Masao Mutoh]: * Fix bugs. Ruby/GdkPixbuf [Masao Mutoh]: * Removed version information. Ruby/GTK: * Support GTK+-2.4.x. * Added: [Seiya Nishizawa, Masao, Mutoh] * Gtk::ToolButton, Gtk::ToolItem, Gtk::ToggleToolButton, Gtk::SeperatorToolItem, Gtk::ComboBox, Gtk::ComboBoxEntry, Gtk::Expander, Gtk::ColorButton, Gtk::FontButton, Gtk::FileChooserWidget, Gtk::FileChooser, Gtk::FileFilter, Gtk::FileChooserDialog, Gtk::Action, Gtk::ToggleAction, Gtk::IconInfo, Gtk::IconTheme, Gtk::UIManager, Gtk::RadioAction, Gtk::CellLayout, Gtk::ActionGroup, sample/misc/entrycompletion.c, filechooser.rb, combobox.rb, expander.rb, color_font_button.rb, uimanager.rb, uimanager2.rb, uimanager2.xml * Improved, fixed bugs: [Geoff Youngs, Vincent Isambart, Kazuhiro NISHIYAMA, Masao Mutoh] * Gtk::Style, Gtk::Widget, Gtk::TextView, Gtk::Container, Gdk::EventClient, Gtk::Dialog, Gtk::Entry, Gdk::Selection, Gtk::Drag, Gdk, Gdk::Atom, Gtk::Editable, Gtk::Stock, Gtk::TextIter, Gtk::TextMark, Gtk::Style, sample/misc/dialog2.rb, entry.rb, settings.rb, * Renamed, Moved: [Masao Mutoh] * Gtk::EventCrossing::CrossingMode to Gtk::EventCrossing::Mode, Gdk::SettingAction to Gdk::EventSetting::Action Gdk::Input.set_extension_events to Gdk::Device. * Deperecated: [Masao Mutoh] * Gtk::Combo, Gtk::OptionMenu since GTK+-2.4. Ruby/GNOME: * None. Ruby/GnomeCanvas: * None. Ruby/Libglade: * Added: [Masao Mutoh] * sample/l10n*, makemo.rb, sample/po/*. * Added methods: [Masao Mutoh] * GladeXML#get_tooltips. * Improved, fixed bugs: [Masao Mutoh] * GladeXML, bin/ruby-glade-create-template Ruby/Libart: * None. Ruby/GConf: * Added some methods, Improved, fixed bugs: [Giovanni Corriga, Pascal Terjan, Kazuhiro NISHIYAMA, Masao Mutoh] * GConf::Client * Deprecated: [Masao Mutoh] * GConf::Client.new. Use GConf::Client.default instead. Ruby/GStreamer: * Requires GStreamer-0.8.x or later. * Added: [Laurent Sansonetti] * Gst::Clock, Gst::Scheduler * Added methods, improved, Fixed bugs: [Laurent Sansonetti] * Gst::Element, Gst::Bin, Gst::Caps, Gst::Structure, * Removed: [Laurent Sansonetti] * Gst::Autoplug, Gst::AutoplugFactory, Gst::Type, Gst::TypeFactory, Gst::TypeFind Gst.set_debug, Ruby/GnomeVFS: * Fixed bugs: [Pascal Terjan, Giovanni Corriga, Masao Mutoh] Ruby/GtkHtml2: * None. Ruby/GtkGLExt: * Fixed bugs: [Vincent Isambart] Ruby/Libgda: * Added methods, fixed bugs: [Laurent Sansonetti] * Gda::Command, Gda::Connection * Removed: [Laurent Sansonetti] * Gda::Export Ruby/PanelApplet [NEW]: * Added. [Jamis Buck, Masao Mutoh] Ruby/GtkSourceView [NEW]: - Added. [Laurent Sansonetti] = GNOME2 0.9.1: 2004-03-14 Ruby/GLib [Masao Mutoh]: * Fix a compilation problem on MinGW. Ruby/ATK [Masao Mutoh]: * Fix a compilation problem on MinGW. * Improved extconf.rb Ruby/Pango [Masao Mutoh]: * Improved extconf.rb Ruby/GTK [Masao Mutoh]: * Fix a compilation problem on MinGW. * Fix a bug of Gtk::Combo. * Improved extconf.rb Ruby/GConf [Kazuhiro NISHIYAMA]: * Fix bugs. Ruby/Libgda [Laurent Sansonetti]: * Support libgda-1.0.3(stable branch). = Ruby-GNOME2 0.9.0: 2004-03-07 Ruby/GLib: * Improved, fixed bugs: [Kenichi Komiya, Vincent Isambart, Masao Mutoh] * GLib::Object, GLib::Param::Flags, mkmf-gnome2.rb, sample/type-register.rb * Added new macros: [Masao Mutoh] * G_DEF_CLASS3() Ruby/ATK [NEW]: * Added and compeleted: [Masao Mutoh] * Atk::Action, Atk::Document, Atk::GObjectAccessible, Atk::NoOpObject, Atk::NoOpObjectFactory, Atk::Value, Atk::Component, Atk::Image, Atk::HyperText, Atk::HyperLink, Atk::EditableText, Atk::Implementor, Atk::Object, Atk::Relation, Atk::Registry, Atk::ObjectFactory, Atk::State, Atk::StateSet, Atk::EditableText, Atk::Table * Added: [Masao Mutoh] * Atk::Util, Atk::Component, Atk::Selection, Atk::Text Ruby/GdkPixbuf: * None. Ruby/Pango: * None. Ruby/GTK: * Completed: [Masao Mutoh] * Added and completed: [Masao Mutoh] * Added: [Kenichi Komiya, Masao, Mutoh] * Gtk::TextAppearance, sample/misc/bindings.rb, properties.rb, style_property.rb, settings.rb * Added some methods, improved, fixed bugs: [Kenichi Komiya, Masahiro Sakai, Vincent Isambart, Dafydd Harries, Masao Mutoh] * Gdk::Window, Gtk::SizeGroup, Gtk::Object, Gtk::BindingSet, Gtk::TextTagTable, Gtk::TextTag, Gdk::Colormap, Gtk::TreeViewColumn, Gtk::TextIter, Gtk::SpinButton, Gtk::Allocation, Gtk::TextView, Gtk::TextBuffer, Gtk::Widget, Gtk::Container, Gtk::Setting, Gtk::TreePath, Gtk::TreeIter, Gdk::Display, Gtk::TextAttributes, Gdk::Property, Gdk::Keymap, Gdk::Pixmap, Gdk::Drawable, Gdk::Screen, Gdk::Event, Gdk::EventExpose, Gdk::Selection, Gdk::GC, sample/gtk-demo/main.rb, stock_browser.rb, list_store.rb, tree_store.rb, sample/testgtk/notebook.rb, sample/misc/label.rb, toolbar.rb, extconf.rb * Removed: [Masao Mutoh] * Gtk::Object#activate_binding * Use Gtk::Object#bindings_activate insted. * Gtk::TextAttribute#copy * Use GLib::Boxed#copy instead. * Gdk::EventKey#string, #length. * makedefconst.rb * Deperecated: [Masao Mutoh] * Gtk::TextBuffer#insert_with_tags, #insert_pixbuf, #insert_child_anchor. They will be removed until 1.0.0. Use Gtk::TextBuffer#insert instead. Ruby/GNOME: * Fixed bugs: [Masao Mutoh] * Gnome::Program Ruby/GnomeCanvas: * Added: [Masao Mutoh] * Gnome::CanvasShape, Gnome::CanvasRE, Gnome::CanvasClipgroup * Fixed bugs: [Vincent Isambart, Masao Mutoh] * extconf.rb, sample/canvas-curve.rb Ruby/Libglade: * Added: [Masao Mutoh] * sample/custom.[rb|glade] * Added methods: [Archit Baweja, Masao Mutoh] * GladeXML#widget_names, #filename, #[], #require, #provide * Improved, fixed bugs: [Masao Mutoh] * bin/ruby-glade-create-template Ruby/Libart: * Improved: [Masao Mutoh] * extconf.rb Ruby/GConf: * None. Ruby/GStreamer: * Added some methods, improved, fixed bugs: [Laurent Sansonetti] * Gst, Gst::Bin, Gst::Pad, Gst::PadTemplate, Gst::Type, Gst::Element sample/gst-inspect.rb, media-type2.rb Ruby/GnomeVFS: * Added some methods, improved, fixed bugs: [Masahiro Sakai, Masao Mutoh] * GnomeVFS::FileInfo, Gnome::VFS::File, GnomeVFS::ProtocolError, GnomeVFS::NoMasterBrowserError Ruby/GtkHtml2: * Added some methods, fixed bugs: [Vincent Isambart, Masao Mutoh] * Gtk::HtmlView, Gtk::HtmlStream, extconf.rb Ruby/GtkGLExt: * Added some methods, improved, fixed bugs: [Vincent Isambart, Masao Mutoh] * Gdk::GLDrawable, sample/*.rb Ruby/Libgda: * Added: [Laurent Sansonetti] GeometricPoint, Gda::Money, Gdak::Time * Added some methods, improved, fixed bugs: [Nikolai Weibull, Laurent Sansonetti] * Gda::Error, Gda::ParameterList, Gda::Provider, Gda::DataSource, Gda::Connection, Gda::Parameter, Gda::Command, Gda::Row, Gda::Value, Gda::DataModel, Gda::ModelList, Gda::FieldAttributes tests/*.rb, src/lib/libgda.rb == Ruby-GNOME2 0.8.1: 2003-11-23 Ruby/GTK: * Fixed compilation problems for GTK+-2.0.x. [Masao Mutoh] * Fixed some bugs. [Masahiro Sakai, Masao Mutoh] * Added Gtk::Tree* methods for GTK+-2.2.x. [Matthew Berg] Ruby/GtkHtml2: * Fixed compilation problems for libgtkhtml-2.4.1 [Masahiro Sakai] Ruby/Libgda: * Fixed a bug [Laurent Sansonetti] *Notice* Ruby/Libgda needs libgda-1.0.2(not released yet) or later. == Ruby-GNOME2 0.8.0: 2003-11-16 Ruby/GLib: * Provide methods for creating GObject from ruby side. Now you can create your own signals and properties: [Masahiro, Sakai] * GLib::MetaInterface, GLib::Instantiatable, GLib::Signal * Added some methods, improved and Fixed some bugs: [Masahiro Sakai, Masao Mutoh] * GLib::Closure, GLib, GLib::Instantiatable, GLib::Object, mkmf-gnome2.rb * Added new macros: [Masao Mutoh] * G_RENAME_NICK() * Added: [Masahiro, Sakai] * sample/type-register.rb, tests/*.rb Ruby/GdkPixbuf: * Added some methods, improved and Fixed some bugs: [KATO Kazuyoshi, Masao Mutoh] * Gdk::Pixbuf Ruby/Pango: * rbpango.h is installed with glib/gtk2 headers. * Added new methods: [Masao Mutoh] * Pango::Layout * Added: [Masao Mutoh] * PangoLogAttr, PangoAnalysis Ruby/GTK: * Completed: [Masao Mutoh] * Gdk::Geometry, Gdk::Event*, Gdk::Pixbuf, Gdk::Drawable, Gdk::DragContext, Gdk::Selection, Gdk::RGB, Gdk::GC, Gdk::Atom, Gdk::Image, Gdk::Colormap, Gdk::Keyval, Gdk::Screen, Gdk::Visual, Gdk::Window, Gdk::Display, Gdk * Added and completed: [Masao Mutoh] * Gdk::Property, Gdk::Keymap, Gdk::TimeCoord, * Added some methods, improved, fixed bugs: [Matthew Berg, Martin Povolny, KATO Kazuyoshi, Laurent Sansonetti, Masahiro Sakai, Masao Mutoh] * Gtk::AccelGroup, Gtk::Accelmap, Gtk::Clipboard, Gtk::Notebook, Gtk::Drag, Gtk::Menu, Gtk::Stock, Gtk::Style, Gtk::ListStore, Gtk::TreeStore, Gtk::Widget, Gtk::TextBuffer, Gtk::TreePath, Gtk::TreeRowReference * Added: [KATO Kazuyoshi] * sample/gtk-demo/changedisplay.rb, sample/gtk-demo/pixbufs.rb. * Removed: [Masao Mutoh] * Gtk::Clipboard#owner * Gdk::Span * Gdk::Region#eql?, #&, #-, #| Ruby/GNOME: * Added some methods, improved, fixed bugs: [Masao Mutoh] * Gnome::AppHelper, Gnome::DruidPageStandard * Apply Enum/Flags. [Masao Mutoh] Ruby/GnomeCanvas: * None. Ruby/Libglade: * None. Ruby/Libart: * None. Ruby/GConf: * None. Ruby/GStreamer: * Update maintainer's e-mail address [Laurent Sansonetti] Ruby/GnomeVFS: * None. Ruby/GtkHtml2: * Added and completed: [Masao Mutoh] * Gtk::HtmlContext, Gtk::HtmlBoxTable, Gtk::HtmlBoxTableRowGroup, * Completed: [Masao Mutoh] * Gtk::HtmlView * Added: [Masao Mutoh] * Gtk::HtmlBox, Gtk::HtmlBoxBlock, Gtk::HtmlBoxTableCaption, Gtk::HtmlBoxText, Gtk::BoxRoot, Gtk::BoxForm, Gtk::HtmlParser, Gtk::HtmlEmbedded, Gtk::HtmlBoxEmbedded Ruby/GtkGLExt: * None. Ruby/Libgda [NEW]: * Added and compeleted: [Laurent Sansonetti] * Gda, Gda::Client, Gda::Command, Gda::Provider, Gda::DataSource, Gda::Connection, Gda::DataModelArray, Gda::DataModelHash, Gda::DataModelList, Gda::Error, Gda::Export, Gda::FieldAttributes, Gda::Parameter, Gda::ParameterList, Gda::QuarkList, Gda::Row, Gda::Select, Gda::Table, Gda::Transaction * Added * Gda::DataModel sample/*.rb, tests/*.rb == Ruby-GNOME2 0.7.0: 2003-09-07 The whole Ruby-GNOME2: * Enum/Flags support. Enum/Flags constants are defined as classes. [Masahiro Sakai, Vincent Isambart, Masao Mutoh] * Improve extconf.rb. [Masao Mutoh] If the libraries are not found, they're ignored. And you can specify to target libraries. Ruby/GLib: * Improved and Fixed some bugs. [Masahiro Sakai, Masao Mutoh] * GLib::Type, GLib::Boxed, mkmf_gnome2.rb * Added lib/glib2.rb and improve to support Win32 platform. [TAMURA.KENICHI, Masahiro Sakai] * Added new class: [Masahiro Sakai] * GLib::Enum, GLib::Flags * Added new macros: [Masahiro Sakai] * RVAL2GENUM(), RVAL2GFLAGS(), GENUM2RVAL(), GFLAGS2RVAL(). * Removed some methods. [Masahiro Sakai] * GLib::Param#value_defaults? * Define GLib::BINDING_VERSION * Apply Enum/Flags. [Masahiro Sakai] * Follow extconf.rb changes. [Masao Mutoh] Ruby/GdkPixbuf: * Apply Enum/Flags. [Masahiro Sakai, Masao Mutoh] * Follow extconf.rb changes. [Masao Mutoh] Ruby/Pango: * Improved and Fixed some bugs: [Vincent Isambart, Masahiro Sakai, Masao Mutoh] * Pango::Font, sample/*.rb, extconf.rb * Added new methods: [Masahiro Sakai] * Pango::Language, Pango::FontMap, Pango::FontFamily, Pango::Context, Pango::FontDescription, * Apply Enum/Flags. [Masahiro Sakai, Masao Mutoh] * Follow extconf.rb changes. [Masao Mutoh] Ruby/GTK: * Follow Ruby/GLib changes. [Masahiro Sakai, Masao Mutoh] * Added some methods, improved, fixed bugs: [Martin Povoln, KATO Kazuyoshi, Masahiro Sakai, Masao Mutoh] * Gdk::Atom, Gdk::Input, Gdk::DragContext, Gdk::Event, Gdk::GC, Gdk, Gtk::Label, Gtk::TreeIter, Gtk::TreeView, Gtk::IconSize, gdk-demo/*.rb, extconf.rb * Added: [KATO Kazuyoshi] * Gdk::DisplayManager, gtk-demo.rb * Apply Enum/Flags. [Masahiro Sakai, Masao Mutoh] * Follow extconf.rb changes. [Masao Mutoh] Ruby/GNOME: * Follow extconf.rb changes. [Masao Mutoh] * Fix bugs. [Masahiro Sakai] Ruby/GnomeCanvas: * Follow extconf.rb changes. [Masao Mutoh] * Improve extconf.rb. [Masahiro Sakai] * Fix a sample. [Vincent Isambart] Ruby/Libglade: * Add a 'after' parameter to GladeXML.connect. It allows to connect signal_connect_after(). [Soila Jani] * Fix bugs: [Masao Mutoh] Ruby/Libart: * Follow extconf.rb changes. [Masao Mutoh] Ruby/GConf: * Apply Enum/Flags. [Masao Mutoh] * Follow extconf.rb changes. [Masao Mutoh] Ruby/GStreamer: * Improved and Fixed some bugs. [Laurent Sansonetti] * Gst, Gst::MediaInfo, Gst::Second, Gst::MediaType, sample/media-type.rb * Added some methods: [Laurent Sansonetti] * Gst::Bin, Gst::Registry, Gst::MediaInfoTrack * Added: [Laurent Sansonetti] * Gst::XML, Gst::ClockEntry, sample/xml-ogg-player.rb * Win32 support. [Masahiro Sakai] * Follow extconf.rb changes. [Masao Mutoh] Ruby/GnomeVFS: * Follow extconf.rb changes. [Masao Mutoh] Ruby/GtkHtml2: * Added: [Martin Povoln, Masao Mutoh] * Gtk::HtmlStream, lib/gtkhtml2.rb * Removed methods: [Martin Povoln] * Gtk::HtmlView#set_html * Follow extconf.rb changes. [Masao Mutoh] Ruby/GtkGLExt [NEW]: * Added and completed. [Vincent Isambart] * Gdk::GLConfig, Gdk::GLContext, Gdk::GLDrawable, Gdk::GLPixmap, Gdk::GLWindow, Gdk::Window, Gdk::Pixmap, Gtk::GL, Gtk::Widget * Added. [Vincent Isambart] * Gdk::GL, sample/*.rb * Follow extconf.rb changes. [Masao Mutoh] * Win32 support. [Masahiro Sakai] == Ruby-GNOME2 0.6.0: 2003-08-09 Ruby/GLib: * mkmf-gnome2.rb,rbglib.h, rbgobject.h, rbgutil.h are installed to site-ruby directories. The other libraries which depends on Ruby/GLib can compile in any directotires. [Masahiro Sakai, Masao Mutoh] * Support ruby-1.8.0 [Masao Mutoh] * Added new macros: [Geoff Youngs, Masao Mutoh] * CBOOL2RVAL/RVAL2CBOOL, G_DEF_CONSTANTS, G_RENAME_CONSTANT * Improved and Fixed some bugs. [Masahiro Sakai] * GLib::Object, GLib::Type, GLib::Closure, GLib::Signal, * Added some methods: [Masahiro Sakai] * GLib::Param, GLib::Param::*, GLib::Boxed, GLib::Signal, GLib::Pointer * Removed some methods. [Masahiro Sakai] * GLib::Param::*#default, #default_value Ruby/GdkPixbuf: * Follow Ruby/GLib changes. [Masao Mutoh] * Separate Gdk::Pixbuf#scale to #scale and #scale!, #composite to #composite and #composite!. [Masao Mutoh] Ruby/Pango: * Follow Ruby/GLib changes. [Masao Mutoh] Ruby/GTK: * Follow Ruby/GLib changes. [Sakai, Masahiro, Masao Mutoh] * rbgtk.h are installed to site-ruby directories. The other libraries which depends on Ruby/GTK can compile in any directotires. [Masao Mutoh] * Completed: [Geoff Youngs, Masao Mutoh] * Gtk::Clipboard, Gtk::Menu, Gtk::Notebook, Gtk::Socket, Gtk::Plug, Gtk::FileSelection, Gtk::ListStore, Gtk::TreeStore, Gtk::TreeModel, Gtk::TextView, Gtk::Notebook, Gtk::ColorSelection, Gtk::Style, Gtk::ItemFactory, Gtk::Invisible, Gtk::TreeSortable, Gtk::TreeView, Gtk::TreeSelection, Gtk::TreePath, Gtk::TreeViewColumn, Gtk::Drag, Gtk::TextTag, Gtk module * Added and completed. * Gtk::TreeDragSource, Gtk::TreeDragDest, * Added some methods, improved, fixed bugs: [Geoff Youngs, Masahiro Sakai, Masao Mutoh] * Gdk::Window, Gdk::Drawable, Gdk::EventProperty, Gdk module, Gtk::Object, Gtk::Editable, Gtk::TreeModel, Gtk module, Gtk::TextBuffer, Gtk::IMContext, Gtk::Menu * Added: [Geoff Youngs, Masao Mutoh] * Gtk::BingindSet, Gdk::Display, Gdk::Screen * Removed: [Masao Mutoh] * Gtk::Socket#xwindow, Gtk::Menu#set_path, Gtk::Notebook#popup_disable/enable, Gtk::ItemFactory.add_foreign Gtk::TreeSortable#sort_func=, Gtk::TreePath#to_s Ruby/GNOME: * Follow Ruby/GLib changes. [Masao Mutoh] * Add Gnome::PixmapEntry#set_preview. [Masao Mutoh] Ruby/GnomeCanvas: * Follow Ruby/GLib changes. [Masao Mutoh] Ruby/Libglade: * Follow Ruby/GLib changes. [Masao Mutoh] Ruby/Libart: * Follow Ruby/GLib changes. [Masao Mutoh] Ruby/GConf: * Fix a bug [744158] [Masao Mutoh] Ruby/GStreamer [NEW]: * Merged with Ruby-GStreamer project. [Laurent Sansonetti] * Version informations are also merged. * Completed: [Laurent Sansonetti] * Gst, Gst::Autoplug, Gst::Cpu, Gst::Format, Gst::Object, Gst::PadTemplate, Gst::Pipeline, Gst::PluginFeature, Gst::QueryType, Gst::Type * Added and completed. [Laurent Sansonetti] * Gst::AutoplugFactory, Gst::EventMask, Gsk::EventSeek, Gst::EventSegmentSeek, Gst::EventSize, Gst::Parse, Gst::SystemClock, Gst::Thread,Gst::MediaInfo, Gst::MediaInfoStream, Gst::MediaInfoTrack * Added some methods, improved, fixed bugs: [Laurent Sansonetti] * Gst::Caps, Gst::Clock, Gst::Plugin, Gst::Pad, Gst::Element, * Added: [Nikolai :: lone-star :: Weibull, Laurent Sansonetti] * sample/media-type.rb, gst-inspect.rb, mediap-type2.rb Ruby/GnomeVFS [NEW]: * Initial release. [Nikolai :: lone-star :: Weibull] * Completed: [Nikolai :: lone-star :: Weibull] * GnomeVFS module, GnomeVFS::Directory, GnomeVFS::Monitor, GnomeVFS::FileInfo, GnomeVFS::Error * Added: [Nikolai :: lone-star :: Weibull] * GnomeVFS::File, GnomeVFS::URI Ruby/GtkHtml2 [NEW]: * Initial release. [Martin Povoln] * Added: [Martin Povoln] * Gtk::HtmlDocument, Gtk::HtmlView == Ruby-GNOME2 0.5.0: 2003-05-24 Ruby/GLib: * Fixed warning for ruby-1.8.1. [Masao Mutoh] * Fixed some bugs, Added methods and improved: [Masahiro Sakai] * GLib::Object, GLib::ParamSpec, GLib::Signal, GLib::Type, GLib::Instantiatable, GLib::MetaInterface, GLib::Param::String * Added: [Geoff Youngs, Masao Mutoh] Ruby/GdkPixbuf: * Fixed a bug. [Geoff Youngs] Ruby/Pango: * Some constants were moved. [Masao Mutoh] * Moved Pango::Attribute::UNDERLINE_* to Pango::AttrUnderline::*. * Moved Pango::Attribute::SCALE_* to Pango::AttrScale::*. Ruby/GTK: * Completed: [Masao Mutoh] Gtk::AccelGroup, Gtk::Style, Gtk::Selection * Added some methods, improved: [Stephen Lewis, Masahiro Sakai, Masao Mutoh] * Gtk::TextBuffer, Gtk::TextIter, Gtk::TreeIter, Gtk::ListStore, Gtk::TreeStore, Gtk, Gtk::HandleBox, Gtk::Frame, Gtk::Container, Gtk::Table, Gdk::Input, Gtk::Widget, Gtk::Allocation, Gtk::RC, Gtk::ItemFactory, Gtk::Toolbar, Gtk::Window, Gtk::CellEditable, Gtk::Accessible, sample/misc/*.rb * Added and completed. [Nikolai :: lone-star :: Weibull, Masao Mutoh] * Gtk::RcStyle, Gtk::TargetList, Gtk::TreeSortable, Gtk::TreeModelSort, Gtk::IMContext, Gtk::IMContextSimple, Gtk::IMMulticontext * Added: [Masao Mutoh] * Gtk::Settings * Renamed some methods. [Masao Mutoh] * Gtk::Table, Gtk::Widget * Removed: [Masao Mutoh] * Gtk::Object#user_data, #user_data=, #set_user_data. Deprecated properties of Gtk::ProgressBar. Gtk::Requisition. Use [width, height] instead. Gtk::Widget#set_requisition, *_event, Gtk::Widget::NO_PARENT. Gtk::SelectionData.remove_all. Use Gtk::Selection.remove_all instead. Ruby/GNOME: * Cygwin support [Masahiro Sakai] * sample/test-gnome/color-picker.rb: Follow Ruby/GTK changes.[Masao Mutoh] Ruby/GnomeCanvas: * sample/canvas-primitives.rb: Follow Ruby/GTK changes.[Masao Mutoh] Ruby/Libglade: * Fix a bug of bin/ruby-glade-create-template. [Masao Mutoh] Ruby/Libart: * None Ruby/GConf: - Added GConf::MetaInfo. [Nikolai :: lone-star :: Weibull] - Fixed a bug [Masao Mutoh] == Ruby-GNOME2 0.4.0: 2003-03-23 The whole Ruby-GNOME2: * Add mkmf-gnome2.rb for sub/optional libraries. [Masahiro Sakai] Ruby/GLib: * Win32 platform support(Cygwin, Mingw32) [Masahiro Sakai] * Support mkmf-gnome2.rb [Masahiro Sakai] * Added some methods. [KUBO Takehiro, Masahiro Sakai] * Fix some bugs and improvement. [Masahiro Sakai, Masao Mutoh] Ruby/GdkPixbuf: * Win32 platform support(Cygwin, Mingw32) [Masahiro Sakai] * Support mkmf-gnome2.rb [Masahiro Sakai] * Fix some bugs and improvement. [Masahiro Sakai] Ruby/Pango: * Win32 platform support(Cygwin, Mingw32) [Masahiro Sakai] * Support mkmf-gnome2.rb [Masahiro Sakai] * Added a method(Pango.pixels) [Masao Mutoh] * Fix some bugs and improvement. [Masahiro Sakai] Ruby/GTK: * Win32 platform support(Cygwin, Mingw32) [Masahiro Sakai] * Support mkmf-gnome2.rb [Masahiro Sakai] * Multi-threading support. [Masao Mutoh] * Added some methods, improved: [Kazuo Saito, Geoff Youngs, KATO Kazuyoshi, Masahiro Sakai, Masao Mutoh] * Gtk::Toolbar, Gtk::ItemFactory, Gdk::Region, Gtk::AccelGroup, Gtk::AccelMap, Gtk::TextIter, Gtk::TextTagTable, Gtk::TreeModel, Gtk::TreeSelection, Gtk::Clipboard, Gtk::Box, Gdk::RGB, Gtk::AccelGroupEntry, Gdk::Window, Gtk::SeparatorMenuItem, Gtk::TreePath, Gtk::TreeView, Gtk::Combo, Gdk::Threads, Gtk::TreeIter, Gdk::Event, Gtk::Drag, * Added: [Kazuo Saito, KATO Kazuyoshi, Masao Mutoh] * sample/gtk-demo/*.rb, sample/misc/threads.rb * Removed: [Masao Mutoh] * Gtk::Toolbar#insert_item/widget/element, Gtk::Toolbar#prepend_item/widget/element, Gtk::Toolbar#append_item/widget/element. * Use Gtk::Toolbar#insert, prepend, append instead. Gtk::Combo#list, button, popup, popwin, set_item_string, Ruby/GNOME: * Support mkmf-gnome2.rb [Masahiro Sakai] Ruby/GnomeCanvas: * Support mkmf-gnome2.rb [Masahiro Sakai] Ruby/Libglade: * Support mkmf-gnome2.rb [Masahiro Sakai] * Improved: [Masao Mutoh] * bin/ruby-glade-create-template Ruby/Libart: * Support mkmf-gnome2.rb [Masahiro Sakai] * Fix some bugs and improvement. [Masahiro Sakai] Ruby/GConf: * Support mkmf-gnome2.rb [Masahiro Sakai] Misc: * Project website is moving from http://ruby-gnome2.sourceforge.net/ to http://ruby-gnome2.sourceforge.jp/. == Ruby-GNOME2 0.3.0: 2003-02-09 Ruby/GLib: * Miscellaneous bugfixes and some improvement internal. [Masahiro Sakai, Masao Mutoh] Ruby/GTK: * Miscellaneous bugfixes and some improvement internal. [Masao Mutoh] * Support GTK+-2.2.x. [KUBO Takehiro] * DnD enhancement. [Geoff Youngs, Masao Mutoh] * Require Ruby/Pango. [Masao Mutoh] * Completed: * Gdk::Drawable, Gdk::Rectangle, Gdk::Region, Gtk::AccelGroup, Gtk::Accelerator, Gtk::AccelGroupEntry, Gtk::AccelKey * Added and completed: * Gdk::Pango::Embossed, Gdk::Pango::Stipple, Gdk::Span * Added some methods, improved: * Gtk::Widget, Gtk::Calender, Gdk::GC, Gtk::Drag, Gtk::SelectionData, Gtk::RadioMenuItem,Gdk::Pixmap * Added: * sample/misc/dnd.rb, dndtreeview.rb, dnd.rb * Removed: * Gtk::AccelGroup#connect_by_path(use Gtk::AccelGroup#connect instead). Ruby/GdkPixbuf: * Added GdkPixbufLoader. [Geoff Youngs] Ruby/GNOME: * None. Ruby/GnomeCanvas: * Warning fixes for samples. [Masao Mutoh] Ruby/Libglade: * Added a sample(sample/treview.[glade|rb]). [Masao Mutoh] Ruby/Libart: * Added Art::Affine, Art::Bpath, Art::Canvas, Art::SVP, Art::Vpath [Tom Payne] * Added samples(sample/rose.rb, testlibart2.rb). [Tom Payne] Ruby/GConf: * None. Ruby/Pango(NEW): * Initial release. [Geoff Youngs, Masao Mutoh] * Added and completed: * Pango::Rectangle, Pango::FontDescription, Pango::FontMetrics, Pango::FontFace, Pango::Fontset, Pango::FontsetSimple, Pango::Attribute, Pango::AttrString, Pango::AttrLanguage, Pango::AttrColor, Pango::AttrInt, Pango::AttrFloat, Pango::AttrBool Pango::AttrFontDesc, Pango::AttrShape, Pango::AttrFamily, Pango::AttrStyle, Pango::AttrVariant, Pango::AttrStretch, Pango::AttrWeight, Pango::AttrSize, Pango::AttrForeground, Pango::AttrBackground, Pango::AttrStrikethrough, Pango::AttrUnderline, Pango::AttrScale, Pango::AttrRise, Pango::Color, Pango::Language, Pango::AttrList, Pango::AttrIterator, Pango::TabArray * Added: * Pango::Context, Pango::Item, Pango::ClyphString, Pango::Font, Pango::FontFamily, Pango::FontMap, Pango::Layout, Pango::LayoutIter, Pango::LayoutLine, sample/attribute.rb, gdk_layout.rb, label.rb, parse.rb. Misc * Project website http://ruby-gnome2.sourceforge.net/ * Ruby/GTK Tutorial http://ruby-gnome2.sourceforge.net/tut/toc.htm * Ruby-GNOME2 reference manual(This project has just started). http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=Ruby-GNOME2 == Ruby-GNOME2 0.2: 2002-12-28 Ruby/GLib: * Some bugfixes and some improvement internal. Ruby/GTK: * Some bugfixes and some improvement internal. * Require Ruby/GdkPixbuf. * Completed: * Gtk::TextIter, Gtk::Label, Gtk::Tooltips, Gtk::Viewport. * Added and completed: * Gtk::TextAttributes, Gtk::IconFactroy, Gtk::IconSet, Gtk::IconSource, Gtk::IconSize, Gtk::Accelerator, Gtk::AccelKey, Gtk::AccelGroupEntry, Gtk::SizeGroup, * Added some methods, improved: * Gtk module, Gtk::TextBuffer, Gtk::*MenuItem, Gtk::*Button, Gtk::ItemFactory, Gtk::Widget, Gtk::TreeViewColumn, Gtk::Notebook, Gtk::Image, Gtk::AccelLabel, Gtk::Invisible, Gtk::Dialog, Gtk::TreePath, Gdk::Keyval sample/misc/*button.rb, stock.rb sample/testgtk/savedposition.rb * Added: * Gtk::Clipboard, Gtk::AccelGroup, Gtk::AccelMap sample/misc/button2.rb, label.rb, dialog.rb, dialog2.rb, treeview.rb * Removed: * Gdk::Bitmap(use Gdk::Pixmap(depth = 1) instead) Ruby/GdkPixbuf: * Follow Ruby/GLib changes. * Add Gdk::Pixdata. Ruby/GNOME: * Follow Ruby/GLib changes. * Fix problems which Ruby/GNOME can't work with Ruby/GdkPixbuf. * Code cleanup. * Remove Bonobo codes(Move to Ruby/Bonobo). Ruby/GnomeCanvas: * Follow Ruby/GLib changes. * Follow Ruby 1.8.0pre1, 1.6.8. Ruby/Libglade: * Follow Ruby/GLib changes. * Add bin/ruby-glade-create-template(Create .rb from .glade) * Add sample/treeview* * Improve the behavior to work when handlers aren't undefined not to occur signal_proc.arity error. Ruby/Libart: * Follow Ruby/GLib changes. Ruby/GConf: * Follow Ruby/GLib changes. Misc: * Project website: http://ruby-gnome2.sourceforge.net/ * Ruby/GTK Tutorial: http://ruby-gnome2.sourceforge.net/tut/toc.htm * Ruby-GNOME2 reference manual(This project has just started). http://rwiki.jin.gr.jp/cgi-bin/rw-cgi.rb?cmd=view;name=Ruby-GNOME2 == Ruby-GNOME2 0.1: 2002-11-23 Initial release. * Ruby/GLib * Ruby/GTK * Ruby/GdkPixbuf * Ruby/GNOME * Ruby/GnomeCanvas * Ruby/Libglade * Ruby/Libart * Ruby/GConf �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/��������������������������������������������������������0000755�0001750�0001750�00000000000�12257665516�017136� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/patches/������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�020562� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/patches/cross-g-ir-scanner.diff�������������������������0000644�0001750�0001750�00000002333�12137115064�025015� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������diff --git a/giscanner/dumper.py b/giscanner/dumper.py index d95ea6b..84a7afc 100644 --- a/giscanner/dumper.py +++ b/giscanner/dumper.py @@ -157,8 +157,9 @@ class DumpCompiler(object): else: o_path = self._generate_tempfile(tmpdir, '.o') + os.name = 'nt' if os.name == 'nt': - ext = 'exe' + ext = '.exe' else: ext = '' @@ -257,10 +258,7 @@ class DumpCompiler(object): else: args.extend(['-o', output]) if libtool: - if os.name == 'nt': - args.append('-export-all-symbols') - else: - args.append('-export-dynamic') + args.append('-export-dynamic') cflags = os.environ.get('CFLAGS', '') for cflag in cflags.split(): @@ -354,6 +352,8 @@ class DumpCompiler(object): if self._pkgconfig_msvc_flags == '': if library.endswith(".la"): # explicitly specified libtool library args.append(library) + elif library.startswith("lib") and library.endswith("-0"): + args.append('-l' + library[3:-2]) else: args.append('-l' + library) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/patches/0001-Support-external-g-ir-scanner.patch��������0000644�0001750�0001750�00000026130�12257552167�027742� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������From be397a8f143edc9808035f78c60159bb9aeedca2 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou <kou@clear-code.com> Date: Sun, 7 Apr 2013 18:51:45 +0900 Subject: [PATCH] Support external g-ir-scanner With this change, you can build binaries for Windows on Debian GNU/Linux. Run configure with the following options: % ./configure \ --host=i686-w64-mingw32 \ --with-g-ir-scanner=/usr/bin/g-ir-scanner \ --disable-tests --- Makefile-gir.am | 29 +++++++++++++---------- Makefile-giscanner.am | 6 +++++ Makefile-tools.am | 15 +++++++++++- Makefile.am | 5 +++- common.mk | 9 ++++--- configure.ac | 54 ++++++++++++++++++++++++++++++++---------- tests/Makefile.am | 2 ++ tests/offsets/Makefile.am | 6 +++++ tests/repository/Makefile.am | 2 ++ tests/scanner/Makefile.am | 4 ++++ 10 files changed, 103 insertions(+), 29 deletions(-) diff --git a/Makefile-gir.am b/Makefile-gir.am index 2b39e54..63b2f2b 100644 --- a/Makefile-gir.am +++ b/Makefile-gir.am @@ -27,18 +27,18 @@ CLEANFILES += gir/cairo-1.0.gir EXTRA_DIST += gir/cairo-1.0.gir.in # Doesn't seem to work to do gir/%.typelib =( -gir/cairo-1.0.typelib: g-ir-compiler -gir/DBus-1.0.typelib: g-ir-compiler -gir/DBusGLib-1.0.typelib: g-ir-compiler -gir/fontconfig-2.0.typelib: g-ir-compiler -gir/freetype2-2.0.typelib: g-ir-compiler -gir/GL-1.0.typelib: g-ir-compiler -gir/libxml2-2.0.typelib: g-ir-compiler -gir/xft-2.0.typelib: g-ir-compiler -gir/xlib-2.0.typelib: g-ir-compiler -gir/xfixes-4.0.typelib: g-ir-compiler -gir/xrandr-1.3.typelib: g-ir-compiler -gir/win32-1.0.typelib: g-ir-compiler +gir/cairo-1.0.typelib: g-ir-compiler$(EXEEXT) +gir/DBus-1.0.typelib: g-ir-compiler$(EXEEXT) +gir/DBusGLib-1.0.typelib: g-ir-compiler$(EXEEXT) +gir/fontconfig-2.0.typelib: g-ir-compiler$(EXEEXT) +gir/freetype2-2.0.typelib: g-ir-compiler$(EXEEXT) +gir/GL-1.0.typelib: g-ir-compiler$(EXEEXT) +gir/libxml2-2.0.typelib: g-ir-compiler$(EXEEXT) +gir/xft-2.0.typelib: g-ir-compiler$(EXEEXT) +gir/xlib-2.0.typelib: g-ir-compiler$(EXEEXT) +gir/xfixes-4.0.typelib: g-ir-compiler$(EXEEXT) +gir/xrandr-1.3.typelib: g-ir-compiler$(EXEEXT) +gir/win32-1.0.typelib: g-ir-compiler$(EXEEXT) # glib with source (to enable documentation) if WITH_GLIBSRC @@ -91,7 +91,12 @@ endif BUILT_GIRSOURCES += GLib-2.0.gir -GLib-2.0.gir: g-ir-scanner g-ir-compiler$(EXEEXT) +if BUILD_SCANNER +G_IR_SCANNER_DEPENDENCY = g-ir-scanner +else +G_IR_SCANNER_DEPENDENCY = +endif +GLib-2.0.gir: $(G_IR_SCANNER_DEPENDENCY) g-ir-compiler$(EXEEXT) gir/DBusGLib-1.0.typelib: GObject-2.0.gir diff --git a/Makefile-giscanner.am b/Makefile-giscanner.am index e8def0e..4c1d21e 100644 --- a/Makefile-giscanner.am +++ b/Makefile-giscanner.am @@ -1,17 +1,21 @@ ## Process this file with automake to produce Makefile.in +if BUILD_SCANNER BUILT_SOURCES += \ scannerparser.c \ scannerparser.h \ scannerlexer.c \ scannerlexer.h +endif AM_YFLAGS = -d -t # Why do I have to do this automake? scannerlexer.h: scannerlexer.c +if BUILD_SCANNER noinst_LTLIBRARIES += libgiscanner.la +endif libgiscanner_la_SOURCES = \ giscanner/sourcescanner.c \ @@ -25,7 +29,9 @@ libgiscanner_la_CFLAGS = $(GOBJECT_CFLAGS) $(GIO_CFLAGS) # Python module pkgpyexecdir = $(pkglibdir)/giscanner +if BUILD_SCANNER pkgpyexec_LTLIBRARIES = _giscanner.la +endif pkgpyexec_PYTHON = \ giscanner/__init__.py \ giscanner/annotationmain.py \ diff --git a/Makefile-tools.am b/Makefile-tools.am index 34d2a25..87c3a1f 100644 --- a/Makefile-tools.am +++ b/Makefile-tools.am @@ -1,5 +1,8 @@ bin_PROGRAMS += g-ir-compiler g-ir-generate + +if BUILD_SCANNER bin_SCRIPTS += g-ir-scanner g-ir-annotation-tool +endif if BUILD_DOCTOOL bin_SCRIPTS += g-ir-doc-tool @@ -12,6 +15,7 @@ EXTRA_DIST += \ TOOL_SUBSTITUTIONS = sed -e s,@libdir\@,$(libdir), -e s,@datarootdir\@,$(datarootdir), -e s,@PYTHON\@,$(PYTHON), +if BUILD_SCANNER g-ir-scanner: tools/g-ir-scanner.in _giscanner.la Makefile $(AM_V_GEN) $(TOOL_SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@ @chmod a+x $@ @@ -19,10 +23,13 @@ g-ir-scanner: tools/g-ir-scanner.in _giscanner.la Makefile g-ir-annotation-tool: tools/g-ir-annotation-tool.in _giscanner.la Makefile $(AM_V_GEN) $(TOOL_SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@ @chmod a+x $@ +endif +if BUILD_DOCTOOL g-ir-doc-tool: tools/g-ir-doc-tool.in _giscanner.la Makefile $(AM_V_GEN) $(TOOL_SUBSTITUTIONS) $< > $@.tmp && mv $@.tmp $@ @chmod a+x $@ +endif g_ir_compiler_SOURCES = tools/compiler.c g_ir_compiler_CPPFLAGS = -DGIREPO_DEFAULT_SEARCH_PATH="\"$(libdir)\"" \ @@ -46,4 +53,10 @@ GCOVSOURCES = \ $(g_ir_compiler_SOURCES) \ $(g_ir_generate_SOURCES) -CLEANFILES += g-ir-scanner g-ir-annotation-tool g-ir-doc-tool +if BUILD_SCANNER +CLEANFILES += g-ir-scanner g-ir-annotation-tool +endif + +if BUILD_DOCTOOL +CLEANFILES += g-ir-doc-tool +endif diff --git a/Makefile.am b/Makefile.am index 736f3ad..08014bc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,8 +33,11 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc man_MANS += \ docs/g-ir-compiler.1 \ - docs/g-ir-generate.1 \ + docs/g-ir-generate.1 +if BUILD_SCANNER +man_MANS += \ docs/g-ir-scanner.1 +endif pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gobject-introspection-1.0.pc gobject-introspection-no-export-1.0.pc diff --git a/common.mk b/common.mk index 28b73c7..15552fa 100644 --- a/common.mk +++ b/common.mk @@ -9,11 +9,14 @@ INTROSPECTION_SCANNER = \ env PATH=.libs:$(PATH) \ LPATH=.libs \ - CC="$(CC)" \ + CC="$(CC)" +if BUILD_SCANNER +INTROSPECTION_SCANNER += \ PYTHONPATH=$(top_builddir):$(top_srcdir) \ UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \ - UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \ - $(top_builddir)/g-ir-scanner + UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) +endif +INTROSPECTION_SCANNER += $(G_IR_SCANNER) INTROSPECTION_SCANNER_ARGS = \ --verbose \ diff --git a/configure.ac b/configure.ac index 3537af1..604b164 100644 --- a/configure.ac +++ b/configure.ac @@ -246,19 +246,42 @@ AC_FUNC_STRTOD AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull]) AC_CHECK_FUNCS([backtrace backtrace_symbols]) -# Python -AM_PATH_PYTHON([2.6]) -case "$host" in -*-*-mingw*) - # Change backslashes to forward slashes in pyexecdir to avoid - # quoting issues - pyexecdir=`echo $pyexecdir | tr '\\\\' '/'` - ;; +AC_ARG_WITH(g_ir_scanner, + AS_HELP_STRING([--with-g-ir-scanner], + [Use existing g-ir-scanner instead of building. @<:@default=no@:>@]), + [], + [with_g_ir_scanner=no]) +case "x${with_g_ir_scanner}" in +xyes) + AC_PATH_PROG(G_IR_SCANNER, + [g-ir-scanner], + [AC_MSG_ERROR([g-ir-scanner not found.])]) + build_g_ir_scanner=no + ;; +xno) + # Python + AM_PATH_PYTHON([2.6]) + case "$host" in + *-*-mingw*) + # Change backslashes to forward slashes in pyexecdir to avoid + # quoting issues + pyexecdir=`echo $pyexecdir | tr '\\\\' '/'` + ;; + esac + AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found])) + if test "x$os_win32" = "xyes"; then + AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.])) + fi + G_IR_SCANNER="\$(top_builddir)/g-ir-scanner" + build_g_ir_scanner=yes + ;; +*) + G_IR_SCANNER="${with_g_ir_scanner}" + build_g_ir_scanner=no + ;; esac -AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found])) -if test "x$os_win32" = "xyes"; then - AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.])) -fi +AC_SUBST(G_IR_SCANNER) +AM_CONDITIONAL(BUILD_SCANNER, test x${build_g_ir_scanner} = xyes) dnl Not enabled by default until 3.6 cycle when we can propose mako as dnl an external dependency @@ -310,6 +333,13 @@ fi AC_SUBST(EXTRA_LINK_FLAGS) +AC_ARG_ENABLE(tests, + [AS_HELP_STRING([--disable-tests], + [disable tests])], + [], + [enable_tests=yes]) +AM_CONDITIONAL(ENABLE_TESTS, test x"$enable_tests" = xyes) + AC_CONFIG_FILES([ Makefile m4/Makefile diff --git a/tests/Makefile.am b/tests/Makefile.am index b4985b9..5c9db00 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,7 +16,9 @@ tests_DATA = \ gimarshallingtests.c \ gimarshallingtests.h +if ENABLE_TESTS check_LTLIBRARIES = libeverything-1.0.la libgimarshallingtests-1.0.la +endif libeverything_1_0_la_SOURCES = everything.c libgimarshallingtests_1_0_la_SOURCES = gimarshallingtests.c diff --git a/tests/offsets/Makefile.am b/tests/offsets/Makefile.am index 4f03830..053bd93 100644 --- a/tests/offsets/Makefile.am +++ b/tests/offsets/Makefile.am @@ -11,7 +11,9 @@ check_PROGRAMS = ############################################################ +if ENABLE_TESTS check_LTLIBRARIES += liboffsets.la +endif liboffsets_la_SOURCES = \ offsets.h \ @@ -32,7 +34,9 @@ CLEANFILES += Offsets-1.0.gir Offsets-1.0.typelib ############################################################ +if ENABLE_TESTS check_PROGRAMS += gitestoffsets +endif nodist_gitestoffsets_SOURCES = gitestoffsets.c gitestoffsets_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository @@ -42,8 +46,10 @@ gitestoffsets.c: gen-gitestoffsets offsets.h $(AM_V_GEN) $(PYTHON) $(srcdir)/gen-gitestoffsets $(srcdir)/offsets.h > $@ || ( rm -f $@ && false ) EXTRA_DIST += gen-gitestoffsets +if ENABLE_TESTS BUILT_SOURCES += gitestoffsets.c CLEANFILES += gitestoffsets.c +endif ############################################################ diff --git a/tests/repository/Makefile.am b/tests/repository/Makefile.am index 96afb89..0553a8b 100644 --- a/tests/repository/Makefile.am +++ b/tests/repository/Makefile.am @@ -2,7 +2,9 @@ AM_CFLAGS = $(GOBJECT_CFLAGS) AM_LDFLAGS = -module -avoid-version LIBS = $(GOBJECT_LIBS) +if ENABLE_TESTS check_PROGRAMS = gitestrepo gitestthrows gitypelibtest +endif gitestrepo_SOURCES = $(srcdir)/gitestrepo.c gitestrepo_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am index 31487a6..65c02fa 100644 --- a/tests/scanner/Makefile.am +++ b/tests/scanner/Makefile.am @@ -5,6 +5,7 @@ include $(top_srcdir)/Makefile.introspection INTROSPECTION_SCANNER_ARGS += --warn-all +if ENABLE_TESTS check_LTLIBRARIES = \ libsletter.la \ libutility.la \ @@ -13,6 +14,7 @@ check_LTLIBRARIES = \ libregress.la \ libwarnlib.la \ $(NULL) +endif AM_CPPFLAGS = -I$(top_srcdir)/girepository AM_CFLAGS = $(GIO_CFLAGS) $(GOBJECT_CFLAGS) $(GTHREAD_CFLAGS) @@ -126,7 +128,9 @@ GetType_1_0_gir_SCANNERFLAGS = --c-include="gettype.h" --identifier-prefix=GetTy GIRS += GetType-1.0.gir if !OS_WIN32 +if ENABLE_TESTS check_PROGRAMS = barapp +endif barapp_SOURCES = $(srcdir)/barapp.c $(srcdir)/barapp.h barapp_LDADD = $(top_builddir)/libgirepository-1.0.la -- 1.7.10.4 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/����������������������������������������������������0000755�0001750�0001750�00000000000�12067770242�017726� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/������������������������������0000755�0001750�0001750�00000000000�12257552167�024246� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-union-info.c������������0000644�0001750�0001750�00000011762�12121311640�027453� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIUnionInfo #define SELF(self) (RVAL2GI_UNION_INFO(self)) GType gi_union_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIUnionInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_n_fields(VALUE self) { GIUnionInfo *info; info = SELF(self); return INT2NUM(g_union_info_get_n_fields(info)); } static VALUE rg_get_field(VALUE self, VALUE rb_n) { GIUnionInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_union_info_get_field(info, n)); } static VALUE rg_get_field_value(VALUE self, VALUE rb_union, VALUE rb_n) { GIUnionInfo *info; gint n; GIFieldInfo *field_info; GType gtype; VALUE rb_value; info = SELF(self); n = NUM2INT(rb_n); field_info = g_union_info_get_field(info, n); gtype = g_registered_type_info_get_g_type(info); rb_value = rb_gi_field_info_get_field_raw(field_info, RVAL2BOXED(rb_union, gtype)); g_base_info_unref(field_info); return rb_value; } static VALUE rg_set_field_value(VALUE self, VALUE rb_union, VALUE rb_n, VALUE rb_value) { GIUnionInfo *info; gint n; GIFieldInfo *field_info; GType gtype; info = SELF(self); n = NUM2INT(rb_n); field_info = g_union_info_get_field(info, n); gtype = g_registered_type_info_get_g_type(info); rb_gi_field_info_set_field_raw(field_info, RVAL2BOXED(rb_union, gtype), rb_value); /* TODO: use rb_ensure() to unref field_info. */ g_base_info_unref(field_info); return Qnil; } static VALUE rg_n_methods(VALUE self) { GIUnionInfo *info; info = SELF(self); return INT2NUM(g_union_info_get_n_methods(info)); } static VALUE rg_get_method(VALUE self, VALUE rb_n_or_name) { GIUnionInfo *info; GIFunctionInfo *function_info; info = SELF(self); if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) { gint n; n = NUM2INT(rb_n_or_name); function_info = g_union_info_get_method(info, n); } else { const gchar *name; name = RVAL2CSTR(rb_n_or_name); function_info = g_union_info_find_method(info, name); } return GI_BASE_INFO2RVAL_WITH_UNREF(function_info); } static VALUE rg_discriminated_p(VALUE self) { GIUnionInfo *info; info = SELF(self); return CBOOL2RVAL(g_union_info_is_discriminated(info)); } static VALUE rg_discriminator_offset(VALUE self) { GIUnionInfo *info; info = SELF(self); return INT2NUM(g_union_info_get_discriminator_offset(info)); } static VALUE rg_discriminator_type(VALUE self) { GIUnionInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_union_info_get_discriminator_type(info)); } static VALUE rg_get_discriminator(VALUE self, VALUE rb_n) { GIUnionInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_union_info_get_discriminator(info, n)); } static VALUE rg_size(VALUE self) { GIUnionInfo *info; info = SELF(self); return ULONG2NUM(g_union_info_get_size(info)); } static VALUE rg_alignment(VALUE self) { GIUnionInfo *info; info = SELF(self); return ULONG2NUM(g_union_info_get_alignment(info)); } void rb_gi_union_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_UNION_INFO, "UnionInfo", rb_mGI, rb_cGIRegisteredTypeInfo); RG_DEF_METHOD(n_fields, 0); RG_DEF_METHOD(get_field, 1); RG_DEF_METHOD(get_field_value, 2); RG_DEF_METHOD(set_field_value, 3); RG_DEF_METHOD(n_methods, 0); RG_DEF_METHOD(get_method, 1); RG_DEF_METHOD_P(discriminated, 0); RG_DEF_METHOD(discriminator_offset, 0); RG_DEF_METHOD(discriminator_type, 0); RG_DEF_METHOD(get_discriminator, 1); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(alignment, 0); } ��������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-argument.c��������������0000644�0001750�0001750�00000131167�12257552167�027243� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" static VALUE rb_cGLibValue = Qnil; static void array_c_to_ruby(const gchar **elements, GITypeInfo *type_info, VALUE rb_array) { gint n_elements; gboolean fixed_size_p; gboolean zero_terminated_p; if (!elements) { return; } n_elements = g_type_info_get_array_length(type_info); fixed_size_p = g_type_info_get_array_fixed_size(type_info); zero_terminated_p = g_type_info_is_zero_terminated(type_info); if (n_elements != -1) { gint i; for (i = 0; i < n_elements; i++) { rb_ary_push(rb_array, CSTR2RVAL(elements[i])); } } else if (zero_terminated_p) { for (; *elements; elements++) { rb_ary_push(rb_array, CSTR2RVAL(*elements)); } } else { rb_raise(rb_eNotImpError, "TODO: GIArgument(array)[c] -> Ruby: " "zero-terminated: %s " "fixed-size: %s " "length: %d", zero_terminated_p ? "true" : "false", fixed_size_p ? "true" : "false", n_elements); } } static VALUE array_to_ruby(gpointer array, GITypeInfo *type_info) { VALUE rb_array; GIArrayType array_type; gint n_elements; array_type = g_type_info_get_array_type(type_info); n_elements = g_type_info_get_array_length(type_info); if (n_elements == -1) { rb_array = rb_ary_new(); } else { rb_array = rb_ary_new2(n_elements); } switch (array_type) { case GI_ARRAY_TYPE_C: array_c_to_ruby(array, type_info, rb_array); break; case GI_ARRAY_TYPE_ARRAY: rb_raise(rb_eNotImpError, "TODO: GIArgument(array)[array] -> Ruby"); break; case GI_ARRAY_TYPE_PTR_ARRAY: rb_raise(rb_eNotImpError, "TODO: GIArgument(array)[ptr-array] -> Ruby"); break; case GI_ARRAY_TYPE_BYTE_ARRAY: rb_raise(rb_eNotImpError, "TODO: GIArgument(array)[byte-array] -> Ruby"); break; default: g_assert_not_reached(); break; } return rb_array; } static VALUE interface_to_ruby(GIArgument *argument, GITypeInfo *type_info) { VALUE rb_interface; GIBaseInfo *interface_info; GIInfoType interface_type; GType gtype; interface_info = g_type_info_get_interface(type_info); interface_type = g_base_info_get_type(interface_info); gtype = g_registered_type_info_get_g_type(interface_info); switch (interface_type) { case GI_INFO_TYPE_INVALID: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[invalid] -> Ruby"); break; case GI_INFO_TYPE_FUNCTION: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[function] -> Ruby"); break; case GI_INFO_TYPE_CALLBACK: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[callback] -> Ruby"); break; case GI_INFO_TYPE_STRUCT: rb_interface = BOXED2RVAL(argument->v_pointer, gtype); break; case GI_INFO_TYPE_BOXED: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[boxed] -> Ruby"); break; case GI_INFO_TYPE_ENUM: if (gtype == G_TYPE_NONE) { rb_interface = INT2NUM(argument->v_int32); } else { rb_interface = GENUM2RVAL(argument->v_int32, gtype); } break; case GI_INFO_TYPE_FLAGS: if (gtype == G_TYPE_NONE) { rb_interface = INT2NUM(argument->v_int32); } else { rb_interface = GFLAGS2RVAL(argument->v_int32, gtype); } break; case GI_INFO_TYPE_OBJECT: rb_interface = GOBJ2RVAL(argument->v_pointer); break; case GI_INFO_TYPE_INTERFACE: rb_interface = GOBJ2RVAL(argument->v_pointer); break; case GI_INFO_TYPE_CONSTANT: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[constant] -> Ruby"); break; case GI_INFO_TYPE_INVALID_0: g_assert_not_reached(); break; case GI_INFO_TYPE_UNION: rb_interface = BOXED2RVAL(argument->v_pointer, gtype); break; case GI_INFO_TYPE_VALUE: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[value] -> Ruby"); break; case GI_INFO_TYPE_SIGNAL: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[signal] -> Ruby"); break; case GI_INFO_TYPE_VFUNC: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[vfunc] -> Ruby"); break; case GI_INFO_TYPE_PROPERTY: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[property] -> Ruby"); break; case GI_INFO_TYPE_FIELD: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[field] -> Ruby"); break; case GI_INFO_TYPE_ARG: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[arg] -> Ruby"); break; case GI_INFO_TYPE_TYPE: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[type] -> Ruby"); break; case GI_INFO_TYPE_UNRESOLVED: rb_raise(rb_eNotImpError, "TODO: GIArgument(interface)[unresolved] -> Ruby"); break; default: g_assert_not_reached(); break; } g_base_info_unref(interface_info); return rb_interface; } VALUE rb_gi_argument_to_ruby(GIArgument *argument, GITypeInfo *type_info) { VALUE rb_argument = Qnil; GITypeTag type_tag; type_tag = g_type_info_get_tag(type_info); switch (type_tag) { case GI_TYPE_TAG_VOID: if (g_type_info_is_pointer(type_info)) { rb_argument = ULONG2NUM(GPOINTER_TO_UINT(argument->v_pointer)); } else { rb_argument = Qnil; } break; case GI_TYPE_TAG_BOOLEAN: rb_argument = CBOOL2RVAL(argument->v_boolean); break; case GI_TYPE_TAG_INT8: rb_argument = INT2NUM(argument->v_int8); break; case GI_TYPE_TAG_UINT8: rb_argument = UINT2NUM(argument->v_uint8); break; case GI_TYPE_TAG_INT16: rb_argument = INT2NUM(argument->v_int16); break; case GI_TYPE_TAG_UINT16: rb_argument = UINT2NUM(argument->v_uint16); break; case GI_TYPE_TAG_INT32: rb_argument = INT2NUM(argument->v_int32); break; case GI_TYPE_TAG_UINT32: rb_argument = UINT2NUM(argument->v_uint32); break; case GI_TYPE_TAG_INT64: rb_argument = LONG2NUM(argument->v_int64); break; case GI_TYPE_TAG_UINT64: rb_argument = ULONG2NUM(argument->v_uint64); break; case GI_TYPE_TAG_FLOAT: rb_argument = DBL2NUM(argument->v_float); break; case GI_TYPE_TAG_DOUBLE: rb_argument = DBL2NUM(argument->v_double); break; case GI_TYPE_TAG_GTYPE: rb_argument = rbgobj_gtype_new(argument->v_size); break; case GI_TYPE_TAG_UTF8: rb_argument = CSTR2RVAL(argument->v_string); break; case GI_TYPE_TAG_FILENAME: /* TODO: set encoding */ rb_argument = CSTR2RVAL(argument->v_string); break; case GI_TYPE_TAG_ARRAY: rb_argument = array_to_ruby(argument->v_pointer, type_info); break; case GI_TYPE_TAG_INTERFACE: rb_argument = interface_to_ruby(argument, type_info); break; case GI_TYPE_TAG_GLIST: rb_argument = GOBJGLIST2RVAL(argument->v_pointer); break; case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: rb_raise(rb_eNotImpError, "TODO: GIArgument(%s) -> Ruby", g_type_tag_to_string(type_tag)); break; case GI_TYPE_TAG_ERROR: rb_argument = GERROR2RVAL(argument->v_pointer); break; case GI_TYPE_TAG_UNICHAR: rb_raise(rb_eNotImpError, "TODO: GIArgument(%s) -> Ruby", g_type_tag_to_string(type_tag)); break; default: g_assert_not_reached(); break; } return rb_argument; } static void rb_gi_out_argument_init_interface(GIArgument *argument, GIArgInfo *arg_info, GITypeInfo *type_info) { GIBaseInfo *interface_info; GIInfoType interface_type; if (!g_arg_info_is_caller_allocates(arg_info)) { argument->v_pointer = ALLOC(gpointer); return; } interface_info = g_type_info_get_interface(type_info); interface_type = g_base_info_get_type(interface_info); switch (interface_type) { case GI_INFO_TYPE_INVALID: case GI_INFO_TYPE_FUNCTION: case GI_INFO_TYPE_CALLBACK: rb_raise(rb_eNotImpError, "TODO: allocates GIArgument(interface)[%s] for output", g_info_type_to_string(interface_type)); break; case GI_INFO_TYPE_STRUCT: { gsize struct_size; struct_size = g_struct_info_get_size(interface_info); argument->v_pointer = xmalloc(struct_size); memset(argument->v_pointer, 0, struct_size); } break; case GI_INFO_TYPE_BOXED: case GI_INFO_TYPE_ENUM: case GI_INFO_TYPE_FLAGS: case GI_INFO_TYPE_OBJECT: case GI_INFO_TYPE_INTERFACE: case GI_INFO_TYPE_CONSTANT: case GI_INFO_TYPE_INVALID_0: case GI_INFO_TYPE_UNION: case GI_INFO_TYPE_VALUE: case GI_INFO_TYPE_SIGNAL: case GI_INFO_TYPE_VFUNC: case GI_INFO_TYPE_PROPERTY: case GI_INFO_TYPE_FIELD: case GI_INFO_TYPE_ARG: case GI_INFO_TYPE_TYPE: case GI_INFO_TYPE_UNRESOLVED: rb_raise(rb_eNotImpError, "TODO: allocates GIArgument(interface)[%s] for output", g_info_type_to_string(interface_type)); break; default: g_assert_not_reached(); break; } g_base_info_unref(interface_info); } void rb_gi_out_argument_init(GIArgument *argument, GIArgInfo *arg_info) { GITypeInfo type_info; GITypeTag type_tag; memset(argument, 0, sizeof(GIArgument)); g_arg_info_load_type(arg_info, &type_info); type_tag = g_type_info_get_tag(&type_info); switch (type_tag) { case GI_TYPE_TAG_VOID: break; case GI_TYPE_TAG_BOOLEAN: argument->v_pointer = ALLOC(gboolean); break; case GI_TYPE_TAG_INT8: argument->v_pointer = ALLOC(gint8); break; case GI_TYPE_TAG_UINT8: argument->v_pointer = ALLOC(guint8); break; case GI_TYPE_TAG_INT16: argument->v_pointer = ALLOC(gint16); break; case GI_TYPE_TAG_UINT16: argument->v_pointer = ALLOC(guint16); break; case GI_TYPE_TAG_INT32: argument->v_pointer = ALLOC(gint32); break; case GI_TYPE_TAG_UINT32: argument->v_pointer = ALLOC(guint32); break; case GI_TYPE_TAG_INT64: argument->v_pointer = ALLOC(gint64); break; case GI_TYPE_TAG_UINT64: argument->v_pointer = ALLOC(guint64); break; case GI_TYPE_TAG_FLOAT: argument->v_pointer = ALLOC(gfloat); break; case GI_TYPE_TAG_DOUBLE: argument->v_pointer = ALLOC(gdouble); break; case GI_TYPE_TAG_GTYPE: argument->v_pointer = ALLOC(GType); break; case GI_TYPE_TAG_UTF8: case GI_TYPE_TAG_FILENAME: argument->v_pointer = ALLOC(gchar *); break; case GI_TYPE_TAG_ARRAY: argument->v_pointer = ALLOC(gpointer); break; case GI_TYPE_TAG_INTERFACE: rb_gi_out_argument_init_interface(argument, arg_info, &type_info); break; case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: argument->v_pointer = ALLOC(gpointer); break; case GI_TYPE_TAG_ERROR: argument->v_pointer = ALLOC(GError *); memset(argument->v_pointer, 0, sizeof(GError *)); break; case GI_TYPE_TAG_UNICHAR: argument->v_pointer = ALLOC(gunichar); break; default: g_assert_not_reached(); break; } } VALUE rb_gi_out_argument_to_ruby(GIArgument *argument, GIArgInfo *arg_info) { GIArgument normalized_argument; GITypeInfo type_info; GITypeTag type_tag; memset(&normalized_argument, 0, sizeof(GIArgument)); g_arg_info_load_type(arg_info, &type_info); type_tag = g_type_info_get_tag(&type_info); switch (type_tag) { case GI_TYPE_TAG_VOID: break; case GI_TYPE_TAG_BOOLEAN: normalized_argument.v_boolean = *((gboolean *)(argument->v_pointer)); break; case GI_TYPE_TAG_INT8: normalized_argument.v_int8 = *((gint8 *)(argument->v_pointer)); break; case GI_TYPE_TAG_UINT8: normalized_argument.v_uint8 = *((guint8 *)(argument->v_pointer)); break; case GI_TYPE_TAG_INT16: normalized_argument.v_int16 = *((gint16 *)(argument->v_pointer)); break; case GI_TYPE_TAG_UINT16: normalized_argument.v_uint16 = *((guint16 *)(argument->v_pointer)); break; case GI_TYPE_TAG_INT32: normalized_argument.v_int32 = *((gint32 *)(argument->v_pointer)); break; case GI_TYPE_TAG_UINT32: normalized_argument.v_uint32 = *((guint32 *)(argument->v_pointer)); break; case GI_TYPE_TAG_INT64: normalized_argument.v_int64 = *((gint64 *)(argument->v_pointer)); break; case GI_TYPE_TAG_UINT64: normalized_argument.v_uint64 = *((guint64 *)(argument->v_pointer)); break; case GI_TYPE_TAG_FLOAT: normalized_argument.v_float = *((gfloat *)(argument->v_pointer)); break; case GI_TYPE_TAG_DOUBLE: normalized_argument.v_double = *((gdouble *)(argument->v_pointer)); break; case GI_TYPE_TAG_GTYPE: normalized_argument.v_size = *((GType *)(argument->v_pointer)); break; case GI_TYPE_TAG_UTF8: case GI_TYPE_TAG_FILENAME: normalized_argument.v_string = *((gchar **)(argument->v_pointer)); break; case GI_TYPE_TAG_ARRAY: case GI_TYPE_TAG_INTERFACE: case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: if (g_arg_info_is_caller_allocates(arg_info)) { normalized_argument.v_pointer = argument->v_pointer; } else { normalized_argument.v_pointer = *((gpointer *)(argument->v_pointer)); } break; case GI_TYPE_TAG_ERROR: normalized_argument.v_pointer = *((GError **)(argument->v_pointer)); break; case GI_TYPE_TAG_UNICHAR: normalized_argument.v_uint32 = *((guint32 *)(argument->v_pointer)); break; default: g_assert_not_reached(); break; } return rb_gi_argument_to_ruby(&normalized_argument, &type_info); } void rb_gi_out_argument_fin(GIArgument *argument, GIArgInfo *arg_info) { GITypeInfo type_info; if (g_arg_info_get_direction(arg_info) != GI_DIRECTION_OUT) { return; } g_arg_info_load_type(arg_info, &type_info); xfree(argument->v_pointer); } static void rb_gi_return_argument_free_container(GIArgument *argument, GITypeInfo *type_info) { GITypeTag type_tag; type_tag = g_type_info_get_tag(type_info); rb_raise(rb_eNotImpError, "TODO: free GIArgument(%s) as container", g_type_tag_to_string(type_tag)); } static void rb_gi_return_argument_free_everything_array(GIArgument *argument, GITypeInfo *type_info) { switch (g_type_info_get_array_type(type_info)) { case GI_ARRAY_TYPE_C: g_strfreev(argument->v_pointer); break; case GI_ARRAY_TYPE_ARRAY: g_array_free(argument->v_pointer, TRUE); break; case GI_ARRAY_TYPE_PTR_ARRAY: g_ptr_array_free(argument->v_pointer, TRUE); break; case GI_ARRAY_TYPE_BYTE_ARRAY: g_ptr_array_free(argument->v_pointer, TRUE); break; default: g_assert_not_reached(); break; } } static void rb_gi_return_argument_free_everything_interface(GIArgument *argument, GITypeInfo *type_info) { GIBaseInfo *interface_info; GIInfoType interface_type; interface_info = g_type_info_get_interface(type_info); interface_type = g_base_info_get_type(interface_info); g_base_info_unref(interface_info); switch (interface_type) { case GI_INFO_TYPE_INVALID: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[invalid] everything"); break; case GI_INFO_TYPE_FUNCTION: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[function] everything"); break; case GI_INFO_TYPE_CALLBACK: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[callback] everything"); break; case GI_INFO_TYPE_STRUCT: rbgobj_instance_unref(argument->v_pointer); break; case GI_INFO_TYPE_BOXED: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[boxed] everything"); break; case GI_INFO_TYPE_ENUM: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[enum] everything"); break; case GI_INFO_TYPE_FLAGS: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[flags] everything"); break; case GI_INFO_TYPE_OBJECT: if (argument->v_pointer) { g_object_unref(argument->v_pointer); } break; case GI_INFO_TYPE_INTERFACE: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[interface] everything"); break; case GI_INFO_TYPE_CONSTANT: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[constant] everything"); break; case GI_INFO_TYPE_INVALID_0: g_assert_not_reached(); break; case GI_INFO_TYPE_UNION: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[union] everything"); break; case GI_INFO_TYPE_VALUE: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[value] everything"); break; case GI_INFO_TYPE_SIGNAL: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[signal] everything"); break; case GI_INFO_TYPE_VFUNC: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[vfunc] everything"); break; case GI_INFO_TYPE_PROPERTY: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[property] everything"); break; case GI_INFO_TYPE_FIELD: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[field] everything"); break; case GI_INFO_TYPE_ARG: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[arg] everything"); break; case GI_INFO_TYPE_TYPE: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[type] everything"); break; case GI_INFO_TYPE_UNRESOLVED: rb_raise(rb_eNotImpError, "TODO: free GIArgument(interface)[unresolved] everything"); break; default: g_assert_not_reached(); break; } } static void rb_gi_return_argument_free_everything(GIArgument *argument, GITypeInfo *type_info) { GITypeTag type_tag; type_tag = g_type_info_get_tag(type_info); switch (type_tag) { case GI_TYPE_TAG_VOID: case GI_TYPE_TAG_BOOLEAN: case GI_TYPE_TAG_INT8: case GI_TYPE_TAG_UINT8: case GI_TYPE_TAG_INT16: case GI_TYPE_TAG_UINT16: case GI_TYPE_TAG_INT32: case GI_TYPE_TAG_UINT32: case GI_TYPE_TAG_INT64: case GI_TYPE_TAG_UINT64: case GI_TYPE_TAG_FLOAT: case GI_TYPE_TAG_DOUBLE: case GI_TYPE_TAG_GTYPE: rb_raise(rb_eNotImpError, "TODO: free GIArgument(%s) everything", g_type_tag_to_string(type_tag)); break; case GI_TYPE_TAG_UTF8: g_free(argument->v_string); break; case GI_TYPE_TAG_FILENAME: rb_raise(rb_eNotImpError, "TODO: free GIArgument(%s) everything", g_type_tag_to_string(type_tag)); break; case GI_TYPE_TAG_ARRAY: rb_gi_return_argument_free_everything_array(argument, type_info); break; case GI_TYPE_TAG_INTERFACE: rb_gi_return_argument_free_everything_interface(argument, type_info); break; case GI_TYPE_TAG_GLIST: g_list_foreach(argument->v_pointer, (GFunc)g_object_unref, NULL); g_list_free(argument->v_pointer); break; case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: case GI_TYPE_TAG_ERROR: case GI_TYPE_TAG_UNICHAR: rb_raise(rb_eNotImpError, "TODO: free GIArgument(%s) everything", g_type_tag_to_string(type_tag)); break; default: g_assert_not_reached(); break; } } VALUE rb_gi_return_argument_to_ruby(GIArgument *argument, GICallableInfo *callable_info) { VALUE rb_argument; gboolean may_return_null; GITypeInfo return_value_info; may_return_null = g_callable_info_may_return_null(callable_info); if (may_return_null && !argument->v_pointer) { return Qnil; } g_callable_info_load_return_type(callable_info, &return_value_info); rb_argument = rb_gi_argument_to_ruby(argument, &return_value_info); switch (g_callable_info_get_caller_owns(callable_info)) { case GI_TRANSFER_NOTHING: break; case GI_TRANSFER_CONTAINER: rb_gi_return_argument_free_container(argument, &return_value_info); break; case GI_TRANSFER_EVERYTHING: rb_gi_return_argument_free_everything(argument, &return_value_info); break; default: g_assert_not_reached(); break; } return rb_argument; } static void rb_gi_argument_from_ruby_array_c(GIArgument *argument, G_GNUC_UNUSED GITypeInfo *type_info, GITypeInfo *element_type_info, VALUE rb_argument) { GITypeTag element_type_tag; element_type_tag = g_type_info_get_tag(element_type_info); switch (element_type_tag) { case GI_TYPE_TAG_VOID: case GI_TYPE_TAG_BOOLEAN: rb_raise(rb_eNotImpError, "TODO: Ruby -> GIArgument(array)[%s]", g_type_tag_to_string(element_type_tag)); break; case GI_TYPE_TAG_INT8: case GI_TYPE_TAG_UINT8: argument->v_pointer = RSTRING_PTR(rb_argument); break; case GI_TYPE_TAG_INT16: case GI_TYPE_TAG_UINT16: case GI_TYPE_TAG_INT32: case GI_TYPE_TAG_UINT32: case GI_TYPE_TAG_INT64: case GI_TYPE_TAG_UINT64: case GI_TYPE_TAG_FLOAT: case GI_TYPE_TAG_DOUBLE: case GI_TYPE_TAG_GTYPE: rb_raise(rb_eNotImpError, "TODO: Ruby -> GIArgument(array)[%s]", g_type_tag_to_string(element_type_tag)); break; case GI_TYPE_TAG_UTF8: case GI_TYPE_TAG_FILENAME: argument->v_pointer = RVAL2STRV(rb_argument); break; case GI_TYPE_TAG_ARRAY: case GI_TYPE_TAG_INTERFACE: case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: case GI_TYPE_TAG_ERROR: case GI_TYPE_TAG_UNICHAR: rb_raise(rb_eNotImpError, "TODO: Ruby -> GIArgument(array)[%s]", g_type_tag_to_string(element_type_tag)); break; default: g_assert_not_reached(); break; } } static void rb_gi_argument_from_ruby_array(GIArgument *argument, GITypeInfo *type_info, VALUE rb_argument) { GIArrayType array_type; GITypeInfo *element_type_info; array_type = g_type_info_get_array_type(type_info); element_type_info = g_type_info_get_param_type(type_info, 0); switch (array_type) { case GI_ARRAY_TYPE_C: rb_gi_argument_from_ruby_array_c(argument, type_info, element_type_info, rb_argument); break; case GI_ARRAY_TYPE_ARRAY: case GI_ARRAY_TYPE_PTR_ARRAY: case GI_ARRAY_TYPE_BYTE_ARRAY: /* TODO */ break; default: g_assert_not_reached(); break; } g_base_info_unref(element_type_info); } static void rb_gi_argument_from_ruby_interface(GIArgument *argument, GITypeInfo *type_info, VALUE rb_argument) { GIBaseInfo *interface_info; GIInfoType interface_type; GType gtype; interface_info = g_type_info_get_interface(type_info); interface_type = g_base_info_get_type(interface_info); gtype = g_registered_type_info_get_g_type(interface_info); switch (interface_type) { case GI_INFO_TYPE_INVALID: case GI_INFO_TYPE_FUNCTION: case GI_INFO_TYPE_CALLBACK: rb_raise(rb_eNotImpError, "TODO: Ruby -> GIArgument(interface)[%s]: <%s>", g_info_type_to_string(interface_type), g_base_info_get_name(interface_info)); break; case GI_INFO_TYPE_STRUCT: if (gtype == G_TYPE_VALUE) { GValue *gvalue; gvalue = ALLOC(GValue); memset(gvalue, 0, sizeof(GValue)); if (rb_obj_is_kind_of(rb_argument, rb_cGLibValue)) { GValue *source_gvalue; source_gvalue = RVAL2BOXED(rb_argument, G_TYPE_VALUE); g_value_init(gvalue, source_gvalue->g_type); g_value_copy(source_gvalue, gvalue); } else { rbgobj_initialize_gvalue(gvalue, rb_argument); } argument->v_pointer = gvalue; } else { argument->v_pointer = RVAL2BOXED(rb_argument, gtype); } break; case GI_INFO_TYPE_BOXED: rb_raise(rb_eNotImpError, "TODO: Ruby -> GIArgument(interface)[%s]: <%s>", g_info_type_to_string(interface_type), g_base_info_get_name(interface_info)); break; case GI_INFO_TYPE_ENUM: if (gtype == G_TYPE_NONE) { argument->v_int32 = NUM2INT(rb_argument); } else { argument->v_int32 = RVAL2GENUM(rb_argument, gtype); } break; case GI_INFO_TYPE_FLAGS: if (gtype == G_TYPE_NONE) { argument->v_int32 = NUM2INT(rb_argument); } else { argument->v_int32 = RVAL2GFLAGS(rb_argument, gtype); } break; case GI_INFO_TYPE_OBJECT: case GI_INFO_TYPE_INTERFACE: argument->v_pointer = RVAL2GOBJ(rb_argument); break; case GI_INFO_TYPE_CONSTANT: rb_raise(rb_eNotImpError, "TODO: Ruby -> GIArgument(interface)[%s]: <%s>", g_info_type_to_string(interface_type), g_base_info_get_name(interface_info)); break; case GI_INFO_TYPE_INVALID_0: g_assert_not_reached(); break; case GI_INFO_TYPE_UNION: case GI_INFO_TYPE_VALUE: case GI_INFO_TYPE_SIGNAL: case GI_INFO_TYPE_VFUNC: case GI_INFO_TYPE_PROPERTY: case GI_INFO_TYPE_FIELD: case GI_INFO_TYPE_ARG: case GI_INFO_TYPE_TYPE: case GI_INFO_TYPE_UNRESOLVED: default: rb_raise(rb_eNotImpError, "TODO: Ruby -> GIArgument(interface)[%s]: <%s>", g_info_type_to_string(interface_type), g_base_info_get_name(interface_info)); break; } g_base_info_unref(interface_info); } GIArgument * rb_gi_value_argument_from_ruby(GIArgument *argument, GITypeInfo *type_info, VALUE rb_argument) { GITypeTag type_tag; memset(argument, 0, sizeof(GIArgument)); type_tag = g_type_info_get_tag(type_info); switch (type_tag) { case GI_TYPE_TAG_VOID: if (g_type_info_is_pointer(type_info)) { argument->v_pointer = GUINT_TO_POINTER(NUM2ULONG(rb_argument)); } break; case GI_TYPE_TAG_BOOLEAN: argument->v_boolean = RVAL2CBOOL(rb_argument); break; case GI_TYPE_TAG_INT8: argument->v_int8 = NUM2INT(rb_argument); break; case GI_TYPE_TAG_UINT8: argument->v_uint8 = NUM2UINT(rb_argument); break; case GI_TYPE_TAG_INT16: argument->v_int16 = NUM2INT(rb_argument); break; case GI_TYPE_TAG_UINT16: argument->v_uint16 = NUM2UINT(rb_argument); break; case GI_TYPE_TAG_INT32: argument->v_int32 = NUM2INT(rb_argument); break; case GI_TYPE_TAG_UINT32: argument->v_uint32 = NUM2UINT(rb_argument); break; case GI_TYPE_TAG_INT64: argument->v_int64 = NUM2LONG(rb_argument); break; case GI_TYPE_TAG_UINT64: argument->v_uint64 = NUM2ULONG(rb_argument); break; case GI_TYPE_TAG_FLOAT: argument->v_float = NUM2DBL(rb_argument); break; case GI_TYPE_TAG_DOUBLE: argument->v_double = NUM2DBL(rb_argument); break; case GI_TYPE_TAG_GTYPE: /* TODO: support GLib::Type and String as GType name. */ argument->v_size = NUM2ULONG(rb_argument); break; case GI_TYPE_TAG_UTF8: /* TODO: support UTF-8 convert like rb_argument.encode("UTF-8"). */ argument->v_string = (gchar *)RVAL2CSTR(rb_argument); break; case GI_TYPE_TAG_FILENAME: argument->v_string = (gchar *)RVAL2CSTR(rb_argument); break; case GI_TYPE_TAG_ARRAY: rb_gi_argument_from_ruby_array(argument, type_info, rb_argument); break; case GI_TYPE_TAG_INTERFACE: rb_gi_argument_from_ruby_interface(argument, type_info, rb_argument); break; case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: case GI_TYPE_TAG_ERROR: case GI_TYPE_TAG_UNICHAR: rb_raise(rb_eNotImpError, "TODO: Ruby -> GIArgument(%s)", g_type_tag_to_string(type_tag)); break; default: g_assert_not_reached(); break; } return argument; } static void rb_gi_inout_argument_from_ruby(GIArgument *argument, G_GNUC_UNUSED GIArgInfo *arg_info, GITypeInfo *type_info, VALUE rb_argument) { GIArgument in_argument; GITypeTag type_tag; rb_gi_value_argument_from_ruby(&in_argument, type_info, rb_argument); type_tag = g_type_info_get_tag(type_info); switch (type_tag) { case GI_TYPE_TAG_VOID: break; case GI_TYPE_TAG_BOOLEAN: argument->v_pointer = ALLOC(gboolean); *((gboolean *)argument->v_pointer) = in_argument.v_boolean; break; case GI_TYPE_TAG_INT8: argument->v_pointer = ALLOC(gint8); *((gint8 *)argument->v_pointer) = in_argument.v_int8; break; case GI_TYPE_TAG_UINT8: argument->v_pointer = ALLOC(guint8); *((guint8 *)argument->v_pointer) = in_argument.v_uint8; break; case GI_TYPE_TAG_INT16: argument->v_pointer = ALLOC(gint16); *((gint16 *)argument->v_pointer) = in_argument.v_int16; break; case GI_TYPE_TAG_UINT16: argument->v_pointer = ALLOC(guint16); *((guint16 *)argument->v_pointer) = in_argument.v_uint16; break; case GI_TYPE_TAG_INT32: argument->v_pointer = ALLOC(gint32); *((gint32 *)argument->v_pointer) = in_argument.v_int32; break; case GI_TYPE_TAG_UINT32: argument->v_pointer = ALLOC(guint32); *((guint32 *)argument->v_pointer) = in_argument.v_uint32; break; case GI_TYPE_TAG_INT64: argument->v_pointer = ALLOC(gint64); *((gint64 *)argument->v_pointer) = in_argument.v_int64; break; case GI_TYPE_TAG_UINT64: argument->v_pointer = ALLOC(guint64); *((guint64 *)argument->v_pointer) = in_argument.v_uint64; break; case GI_TYPE_TAG_FLOAT: argument->v_pointer = ALLOC(gfloat); *((gfloat *)argument->v_pointer) = in_argument.v_float; break; case GI_TYPE_TAG_DOUBLE: argument->v_pointer = ALLOC(gdouble); *((gdouble *)argument->v_pointer) = in_argument.v_double; break; case GI_TYPE_TAG_GTYPE: argument->v_pointer = ALLOC(gsize); *((gsize *)argument->v_pointer) = in_argument.v_size; break; case GI_TYPE_TAG_UTF8: case GI_TYPE_TAG_FILENAME: argument->v_pointer = ALLOC(gchar *); *((gchar **)argument->v_pointer) = in_argument.v_string; break; case GI_TYPE_TAG_ARRAY: case GI_TYPE_TAG_INTERFACE: case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: argument->v_pointer = ALLOC(gpointer); *((gpointer *)argument->v_pointer) = in_argument.v_pointer; break; case GI_TYPE_TAG_ERROR: argument->v_pointer = ALLOC(GError *); *((GError **)argument->v_pointer) = in_argument.v_pointer; break; case GI_TYPE_TAG_UNICHAR: argument->v_pointer = ALLOC(gunichar); *((gunichar *)argument->v_pointer) = in_argument.v_uint32; break; default: g_assert_not_reached(); break; } } static void rb_gi_in_argument_transfer_interface(GIArgument *argument, G_GNUC_UNUSED GITransfer transfer, GITypeInfo *type_info, G_GNUC_UNUSED VALUE rb_argument) { GIBaseInfo *interface_info; GIInfoType interface_type; G_GNUC_UNUSED GType gtype; interface_info = g_type_info_get_interface(type_info); interface_type = g_base_info_get_type(interface_info); gtype = g_registered_type_info_get_g_type(interface_info); g_base_info_unref(interface_info); switch (interface_type) { case GI_INFO_TYPE_INVALID: case GI_INFO_TYPE_FUNCTION: case GI_INFO_TYPE_CALLBACK: rb_raise(rb_eNotImpError, "TODO: in transfer (interface) [%s]", g_info_type_to_string(interface_type)); break; case GI_INFO_TYPE_STRUCT: rbgobj_boxed_unown(rb_argument); break; case GI_INFO_TYPE_BOXED: case GI_INFO_TYPE_ENUM: case GI_INFO_TYPE_FLAGS: rb_raise(rb_eNotImpError, "TODO: in transfer (interface) [%s]", g_info_type_to_string(interface_type)); break; case GI_INFO_TYPE_OBJECT: g_object_ref(argument->v_pointer); break; case GI_INFO_TYPE_INTERFACE: case GI_INFO_TYPE_CONSTANT: rb_raise(rb_eNotImpError, "TODO: in transfer (interface) [%s]", g_info_type_to_string(interface_type)); break; case GI_INFO_TYPE_INVALID_0: g_assert_not_reached(); break; case GI_INFO_TYPE_UNION: case GI_INFO_TYPE_VALUE: case GI_INFO_TYPE_SIGNAL: case GI_INFO_TYPE_VFUNC: case GI_INFO_TYPE_PROPERTY: case GI_INFO_TYPE_FIELD: case GI_INFO_TYPE_ARG: case GI_INFO_TYPE_TYPE: case GI_INFO_TYPE_UNRESOLVED: rb_raise(rb_eNotImpError, "TODO: in transfer (interface) [%s]", g_info_type_to_string(interface_type)); break; default: g_assert_not_reached(); break; } } static void rb_gi_in_argument_transfer(GIArgument *argument, GITransfer transfer, GITypeInfo *type_info, VALUE rb_argument) { GITypeTag type_tag; if (transfer == GI_TRANSFER_NOTHING) { return; } type_tag = g_type_info_get_tag(type_info); switch (type_tag) { case GI_TYPE_TAG_VOID: case GI_TYPE_TAG_BOOLEAN: case GI_TYPE_TAG_INT8: case GI_TYPE_TAG_UINT8: case GI_TYPE_TAG_INT16: case GI_TYPE_TAG_UINT16: case GI_TYPE_TAG_INT32: case GI_TYPE_TAG_UINT32: case GI_TYPE_TAG_INT64: case GI_TYPE_TAG_UINT64: case GI_TYPE_TAG_FLOAT: case GI_TYPE_TAG_DOUBLE: case GI_TYPE_TAG_GTYPE: break; case GI_TYPE_TAG_UTF8: case GI_TYPE_TAG_FILENAME: case GI_TYPE_TAG_ARRAY: rb_raise(rb_eNotImpError, "TODO: in transfer (%s)", g_type_tag_to_string(type_tag)); break; case GI_TYPE_TAG_INTERFACE: rb_gi_in_argument_transfer_interface(argument, transfer, type_info, rb_argument); break; case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: case GI_TYPE_TAG_ERROR: case GI_TYPE_TAG_UNICHAR: rb_raise(rb_eNotImpError, "TODO: in transfer (%s)", g_type_tag_to_string(type_tag)); default: g_assert_not_reached(); break; } } GIArgument * rb_gi_in_argument_from_ruby(GIArgument *argument, GIArgInfo *arg_info, VALUE rb_argument) { GITypeInfo type_info; if (g_arg_info_may_be_null(arg_info) && NIL_P(rb_argument)) { memset(argument, 0, sizeof(GIArgument)); return argument; } g_arg_info_load_type(arg_info, &type_info); if (g_arg_info_get_direction(arg_info) == GI_DIRECTION_INOUT) { rb_gi_inout_argument_from_ruby(argument, arg_info, &type_info, rb_argument); } else { rb_gi_value_argument_from_ruby(argument, &type_info, rb_argument); rb_gi_in_argument_transfer(argument, g_arg_info_get_ownership_transfer(arg_info), &type_info, rb_argument); } return argument; } static void rb_gi_value_argument_free_array(GIArgument *argument, GITypeInfo *type_info) { GIArrayType array_type; array_type = g_type_info_get_array_type(type_info); switch (array_type) { case GI_ARRAY_TYPE_C: g_free(argument->v_pointer); break; case GI_ARRAY_TYPE_ARRAY: case GI_ARRAY_TYPE_PTR_ARRAY: case GI_ARRAY_TYPE_BYTE_ARRAY: break; default: g_assert_not_reached(); break; } } static void rb_gi_value_argument_free_interface(GIArgument *argument, GITypeInfo *type_info) { GIBaseInfo *interface_info; GIInfoType interface_type; interface_info = g_type_info_get_interface(type_info); interface_type = g_base_info_get_type(interface_info); if (interface_type == GI_INFO_TYPE_STRUCT) { GType gtype; gtype = g_registered_type_info_get_g_type(interface_info); if (gtype == G_TYPE_VALUE) { GValue *gvalue = argument->v_pointer; g_value_unset(gvalue); xfree(argument->v_pointer); } } g_base_info_unref(interface_info); } void rb_gi_value_argument_free(GIArgument *argument, GITypeInfo *type_info) { GITypeTag type_tag; type_tag = g_type_info_get_tag(type_info); switch (type_tag) { case GI_TYPE_TAG_VOID: case GI_TYPE_TAG_BOOLEAN: case GI_TYPE_TAG_INT8: case GI_TYPE_TAG_UINT8: case GI_TYPE_TAG_INT16: case GI_TYPE_TAG_UINT16: case GI_TYPE_TAG_INT32: case GI_TYPE_TAG_UINT32: case GI_TYPE_TAG_INT64: case GI_TYPE_TAG_UINT64: case GI_TYPE_TAG_FLOAT: case GI_TYPE_TAG_DOUBLE: case GI_TYPE_TAG_GTYPE: case GI_TYPE_TAG_UTF8: case GI_TYPE_TAG_FILENAME: break; case GI_TYPE_TAG_ARRAY: rb_gi_value_argument_free_array(argument, type_info); break; case GI_TYPE_TAG_INTERFACE: rb_gi_value_argument_free_interface(argument, type_info); break; case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: case GI_TYPE_TAG_ERROR: case GI_TYPE_TAG_UNICHAR: break; default: g_assert_not_reached(); break; } } static void rb_gi_inout_argument_free(GIArgument *argument, GITypeInfo *type_info) { GIArgument in_argument; GITypeTag type_tag; memset(&in_argument, 0, sizeof(GIArgument)); type_tag = g_type_info_get_tag(type_info); switch (type_tag) { case GI_TYPE_TAG_VOID: break; case GI_TYPE_TAG_BOOLEAN: in_argument.v_boolean = *((gboolean *)(argument->v_pointer)); break; case GI_TYPE_TAG_INT8: in_argument.v_int8 = *((gint8 *)(argument->v_pointer)); break; case GI_TYPE_TAG_UINT8: /* TODO!!! */ in_argument.v_uint8 = *((guint8 *)(argument->v_pointer)); argument->v_pointer = ALLOC(guint8); *((guint8 *)argument->v_pointer) = in_argument.v_uint8; break; case GI_TYPE_TAG_INT16: in_argument.v_int16 = *((gint16 *)(argument->v_pointer)); argument->v_pointer = ALLOC(gint16); *((gint16 *)argument->v_pointer) = in_argument.v_int16; break; case GI_TYPE_TAG_UINT16: in_argument.v_uint16 = *((guint16 *)(argument->v_pointer)); argument->v_pointer = ALLOC(guint16); *((guint16 *)argument->v_pointer) = in_argument.v_uint16; break; case GI_TYPE_TAG_INT32: in_argument.v_int32 = *((gint32 *)(argument->v_pointer)); argument->v_pointer = ALLOC(gint32); *((gint32 *)argument->v_pointer) = in_argument.v_int32; break; case GI_TYPE_TAG_UINT32: in_argument.v_uint32 = *((guint32 *)(argument->v_pointer)); argument->v_pointer = ALLOC(guint32); *((guint32 *)argument->v_pointer) = in_argument.v_uint32; break; case GI_TYPE_TAG_INT64: in_argument.v_int64 = *((gint64 *)(argument->v_pointer)); argument->v_pointer = ALLOC(gint64); *((gint64 *)argument->v_pointer) = in_argument.v_int64; break; case GI_TYPE_TAG_UINT64: in_argument.v_uint64 = *((guint64 *)(argument->v_pointer)); argument->v_pointer = ALLOC(guint64); *((guint64 *)argument->v_pointer) = in_argument.v_uint64; break; case GI_TYPE_TAG_FLOAT: in_argument.v_float = *((gfloat *)(argument->v_pointer)); argument->v_pointer = ALLOC(gfloat); *((gfloat *)argument->v_pointer) = in_argument.v_float; break; case GI_TYPE_TAG_DOUBLE: in_argument.v_double = *((gdouble *)(argument->v_pointer)); argument->v_pointer = ALLOC(gdouble); *((gdouble *)argument->v_pointer) = in_argument.v_double; break; case GI_TYPE_TAG_GTYPE: in_argument.v_size = *((gsize *)(argument->v_pointer)); break; case GI_TYPE_TAG_UTF8: case GI_TYPE_TAG_FILENAME: in_argument.v_string = *((gchar **)(argument->v_pointer)); break; case GI_TYPE_TAG_ARRAY: case GI_TYPE_TAG_INTERFACE: case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: in_argument.v_pointer = *((gpointer *)(argument->v_pointer)); break; case GI_TYPE_TAG_ERROR: in_argument.v_pointer = *((GError **)(argument->v_pointer)); break; case GI_TYPE_TAG_UNICHAR: in_argument.v_uint32 = *((gunichar *)(argument->v_pointer)); break; default: g_assert_not_reached(); break; } rb_gi_value_argument_free(&in_argument, type_info); xfree(argument->v_pointer); } void rb_gi_in_argument_free(GIArgument *argument, GIArgInfo *arg_info) { GITypeInfo type_info; g_arg_info_load_type(arg_info, &type_info); if (g_arg_info_get_direction(arg_info) == GI_DIRECTION_INOUT) { rb_gi_inout_argument_free(argument, &type_info); } else { rb_gi_value_argument_free(argument, &type_info); } } void rb_gi_argument_init(void) { rb_cGLibValue = rb_const_get(mGLib, rb_intern("Value")); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-callback-info.c���������0000644�0001750�0001750�00000003106�12121311640�030050� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGICallbackInfo #define SELF(self) RVAL2GI_BASE_INFO(self) GType gi_callback_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GICallbackInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } void rb_gi_callback_info_init(VALUE rb_mGI, VALUE rb_cGICallableInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_CALLBACK_INFO, "CallbackInfo", rb_mGI, rb_cGICallableInfo); (void)RG_TARGET_NAMESPACE; /* suppress a warning. */ } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-method-info.c�����������0000644�0001750�0001750�00000005077�12142464343�027621� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIMethodInfo #define SELF(self) RVAL2GI_FUNCTION_INFO(self) GType gi_method_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIMethodInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_invoke(VALUE self, VALUE rb_options) { GIFunctionInfo *info; GICallableInfo *callable_info; GIArgument return_value; VALUE rb_out_args; VALUE rb_return_value; info = SELF(self); /* TODO: use rb_protect */ rb_out_args = rb_gi_function_info_invoke_raw(info, rb_options, &return_value); callable_info = (GICallableInfo *)info; rb_return_value = GI_RETURN_ARGUMENT2RVAL(&return_value, callable_info); if (NIL_P(rb_out_args)) { return rb_return_value; } else { GITypeInfo return_value_info; g_callable_info_load_return_type(callable_info, &return_value_info); if (g_type_info_get_tag(&return_value_info) != GI_TYPE_TAG_VOID) { rb_ary_unshift(rb_out_args, rb_return_value); } if (RARRAY_LEN(rb_out_args) == 1) { return RARRAY_PTR(rb_out_args)[0]; } else { return rb_out_args; } } } void rb_gi_method_info_init(VALUE rb_mGI, VALUE rb_cGIFunctionInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_METHOD_INFO, "MethodInfo", rb_mGI, rb_cGIFunctionInfo); RG_DEF_METHOD(invoke, 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-registered-type-info.c��0000644�0001750�0001750�00000004745�12121311640�031442� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIRegisteredTypeInfo #define SELF(self) (RVAL2GI_REGISTERED_TYPE_INFO(self)) GType gi_registered_type_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIRegisteredTypeInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_type_name(VALUE self) { GIRegisteredTypeInfo *info; info = SELF(self); return CSTR2RVAL(g_registered_type_info_get_type_name(info)); } static VALUE rg_type_init(VALUE self) { GIRegisteredTypeInfo *info; info = SELF(self); return CSTR2RVAL(g_registered_type_info_get_type_init(info)); } static VALUE rg_gtype(VALUE self) { GIRegisteredTypeInfo *info; info = SELF(self); return rbgobj_gtype_new(g_registered_type_info_get_g_type(info)); } void rb_gi_registered_type_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_REGISTERED_TYPE_INFO, "RegisteredTypeInfo", rb_mGI, rb_cGIBaseInfo); RG_DEF_METHOD(type_name, 0); RG_DEF_METHOD(type_init, 0); RG_DEF_METHOD(gtype, 0); rb_gi_struct_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_boxed_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_enum_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_object_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_interface_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_union_info_init(rb_mGI, RG_TARGET_NAMESPACE); } ���������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-conversions.h�����������0000644�0001750�0001750�00000013414�12142464343�027757� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef RB_GI_CONVERSIONS_H #define RB_GI_CONVERSIONS_H #define RVAL2GI_REPOSITORY(rb_object) (G_IREPOSITORY(RVAL2GOBJ(rb_object))) #define RVAL2GI_REPOSITORY_LOAD_FLAGS(rb_flags) \ (RVAL2GFLAGS(rb_flags, G_TYPE_I_REPOSITORY_LOAD_FLAGS)) #define GI_BASE_INFO2RVAL(info) \ (rb_gi_base_info_to_ruby((GIBaseInfo *)(info))) #define GI_BASE_INFO2RVAL_WITH_UNREF(info) \ (rb_gi_base_info_to_ruby_with_unref((GIBaseInfo *)(info))) #define RVAL2GI_BASE_INFO(rb_object) (rb_gi_base_info_from_ruby(rb_object)) #define GI_ARGUMENT2RVAL(argument, type_info) \ (rb_gi_argument_to_ruby((argument), (type_info))) #define GI_OUT_ARGUMENT2RVAL(argument, arg_info) \ (rb_gi_out_argument_to_ruby((argument), (arg_info))) #define GI_RETURN_ARGUMENT2RVAL(argument, callable_info) \ (rb_gi_return_argument_to_ruby((argument), (callable_info))) #define RVAL2GI_VALUE_ARGUMENT(argument, type_info, rb_argument) \ (rb_gi_value_argument_from_ruby((argument), (type_info), (rb_argument))) #define RVAL2GI_IN_ARGUMENT(argument, arg_info, rb_argument) \ (rb_gi_in_argument_from_ruby((argument), (arg_info), (rb_argument))) #define RVAL2GI_REGISTERED_TYPE_INFO(rb_object) \ ((GIRegisteredTypeInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_FUNCTION_INFO(rb_object) \ ((GIFunctionInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_STRUCT_INFO(rb_object) \ ((GIStructInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_ENUM_INFO(rb_object) \ ((GIEnumInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_OBJECT_INFO(rb_object) \ ((GIObjectInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_INTERFACE_INFO(rb_object) \ ((GIInterfaceInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_CONSTANT_INFO(rb_object) \ ((GIConstantInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_UNION_INFO(rb_object) \ ((GIUnionInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_VALUE_INFO(rb_object) \ ((GIValueInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_ARG_INFO(rb_object) \ ((GIArgInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_FIELD_INFO(rb_object) \ ((GIFieldInfo *)RVAL2GI_BASE_INFO(rb_object)) #define RVAL2GI_TYPE_INFO(rb_object) \ ((GITypeInfo *)RVAL2GI_BASE_INFO(rb_object)) #define GI_INFO_TYPE2RVAL(type) (GENUM2RVAL(type, G_TYPE_I_INFO_TYPE)) #define GI_TRANSFER2RVAL(transfer) (GENUM2RVAL(transfer, G_TYPE_I_TRANSFER)) #define GI_DIRECTION2RVAL(direction) (GENUM2RVAL(direction, G_TYPE_I_DIRECTION)) #define GI_SCOPE_TYPE2RVAL(scope) (GENUM2RVAL(scope, G_TYPE_I_SCOPE_TYPE)) #define RVAL2GI_TYPE_TAG(rb_tag) (RVAL2GENUM(rb_tag, G_TYPE_I_TYPE_TAG)) #define GI_TYPE_TAG2RVAL(tag) (GENUM2RVAL(tag, G_TYPE_I_TYPE_TAG)) #define GI_ARRAY_TYPE2RVAL(type) (rb_gi_array_type_to_ruby(type)) #define GI_FUNCTION_INFO_FLAGS2RVAL(tag) \ (GFLAGS2RVAL(tag, G_TYPE_I_FUNCTION_INFO_FLAGS)) #define GI_SIGNAL_FLAGS2RVAL(tag) \ (GFLAGS2RVAL(tag, G_TYPE_SIGNAL_FLAGS)) #define GI_VFUNC_INFO_FLAGS2RVAL(tag) \ (GFLAGS2RVAL(tag, G_TYPE_IV_FUNC_INFO_FLAGS)) #define GI_FIELD_INFO_FLAGS2RVAL(tag) \ (GFLAGS2RVAL(tag, G_TYPE_I_FIELD_INFO_FLAGS)) VALUE rb_gi_base_info_to_ruby (GIBaseInfo *info); VALUE rb_gi_base_info_to_ruby_with_unref(GIBaseInfo *info); GIBaseInfo *rb_gi_base_info_from_ruby (VALUE rb_info); VALUE rb_gi_argument_to_ruby (GIArgument *argument, GITypeInfo *type_info); void rb_gi_out_argument_init (GIArgument *argument, GIArgInfo *arg_info); VALUE rb_gi_out_argument_to_ruby (GIArgument *argument, GIArgInfo *arg_info); void rb_gi_out_argument_fin (GIArgument *argument, GIArgInfo *arg_info); VALUE rb_gi_return_argument_to_ruby (GIArgument *argument, GICallableInfo *callable_info); GIArgument *rb_gi_value_argument_from_ruby (GIArgument *argument, GITypeInfo *type_info, VALUE rb_argument); GIArgument *rb_gi_in_argument_from_ruby (GIArgument *argument, GIArgInfo *arg_info, VALUE rb_argument); void rb_gi_value_argument_free (GIArgument *argument, GITypeInfo *type_info); void rb_gi_in_argument_free (GIArgument *argument, GIArgInfo *arg_info); VALUE rb_gi_array_type_to_ruby (GIArrayType type); #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/gobject_introspection.def�����0000644�0001750�0001750�00000000137�12137115064�031310� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXPORTS Init_gobject_introspection rb_gi_callback_data_free rb_gi_callback_register_finder ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-repository.c������������0000644�0001750�0001750�00000010473�12121311640�027607� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIRepository #define SELF(self) RVAL2GI_REPOSITORY(self) static VALUE rg_s_default(G_GNUC_UNUSED VALUE klass) { return GOBJ2RVAL(g_irepository_get_default()); } static VALUE rg_require(int argc, VALUE *argv, VALUE self) { VALUE rb_namespace, rb_version, rb_flags; const gchar *namespace_, *version; GIRepositoryLoadFlags flags = 0; GError *error = NULL; rb_scan_args(argc, argv, "12", &rb_namespace, &rb_version, &rb_flags); namespace_ = RVAL2CSTR(rb_namespace); version = RVAL2CSTR_ACCEPT_NIL(rb_version); if (!NIL_P(rb_flags)) { flags = RVAL2GI_REPOSITORY_LOAD_FLAGS(rb_flags); } g_irepository_require(SELF(self), namespace_, version, flags, &error); if (error) { RG_RAISE_ERROR(error); } return Qnil; } static VALUE rg_get_dependencies(VALUE self, VALUE rb_namespace) { GIRepository *repository; const gchar *namespace_; VALUE rb_dependencies; gchar **dependencies; gint i; repository = SELF(self); namespace_ = RVAL2CSTR(rb_namespace); dependencies = g_irepository_get_dependencies(repository, namespace_); rb_dependencies = rb_ary_new(); for (i = 0; dependencies[i]; i++) { rb_ary_push(rb_dependencies, CSTR2RVAL(dependencies[i])); } g_strfreev(dependencies); return rb_dependencies; } static VALUE rg_loaded_namespaces(VALUE self) { GIRepository *repository; VALUE rb_namespaces; gchar **namespaces; gint i; repository = SELF(self); namespaces = g_irepository_get_loaded_namespaces(repository); rb_namespaces = rb_ary_new(); for (i = 0; namespaces[i]; i++) { rb_ary_push(rb_namespaces, CSTR2RVAL(namespaces[i])); } g_strfreev(namespaces); return rb_namespaces; } static VALUE rg_get_n_infos(VALUE self, VALUE rb_namespace) { const gchar *namespace_; gint n_infos; namespace_ = RVAL2CSTR(rb_namespace); n_infos = g_irepository_get_n_infos(SELF(self), namespace_); return INT2NUM(n_infos); } static VALUE rg_get_info(VALUE self, VALUE rb_namespace, VALUE rb_n) { GIRepository *repository; const gchar *namespace_; gint n; GIBaseInfo *info; repository = SELF(self); namespace_ = RVAL2CSTR(rb_namespace); n = NUM2INT(rb_n); info = g_irepository_get_info(repository, namespace_, n); return GI_BASE_INFO2RVAL_WITH_UNREF(info); } static VALUE rg_find(int argc, VALUE *argv, VALUE self) { GIBaseInfo *info; if (argc == 1) { VALUE rb_gtype; GType gtype; rb_gtype = argv[0]; gtype = NUM2UINT(rb_gtype); info = g_irepository_find_by_gtype(SELF(self), gtype); } else { VALUE rb_namespace, rb_name; const gchar *namespace_, *name; rb_scan_args(argc, argv, "2", &rb_namespace, &rb_name); namespace_ = RVAL2CSTR(rb_namespace); name = RVAL2CSTR(rb_name); info = g_irepository_find_by_name(SELF(self), namespace_, name); } return GI_BASE_INFO2RVAL(info); } void rb_gi_repository_init(VALUE rb_mGI) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IREPOSITORY, "Repository", rb_mGI); RG_DEF_SMETHOD(default, 0); RG_DEF_METHOD(require, -1); RG_DEF_METHOD(get_dependencies, 1); RG_DEF_METHOD(loaded_namespaces, 0); RG_DEF_METHOD(get_n_infos, 1); RG_DEF_METHOD(get_info, 2); RG_DEF_METHOD(find, -1); G_DEF_CLASS(G_TYPE_I_REPOSITORY_LOAD_FLAGS, "RepositoryLoadFlags", rb_mGI); G_DEF_CLASS(G_TYPE_I_REPOSITORY_ERROR, "RepositoryError", rb_mGI); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-struct-info.c�����������0000644�0001750�0001750�00000011374�12257552167�027673� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIStructInfo #define SELF(self) (RVAL2GI_STRUCT_INFO(self)) GType gi_struct_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIStructInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_n_fields(VALUE self) { GIStructInfo *info; info = SELF(self); return INT2NUM(g_struct_info_get_n_fields(info)); } static VALUE rg_get_field(VALUE self, VALUE rb_n) { GIStructInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_struct_info_get_field(info, n)); } static VALUE rg_get_field_value(VALUE self, VALUE rb_struct, VALUE rb_n) { GIStructInfo *info; gint n; GIFieldInfo *field_info; VALUE rb_value; gpointer instance; info = SELF(self); n = NUM2INT(rb_n); field_info = g_struct_info_get_field(info, n); if (rb_respond_to(rb_struct, rb_intern("gtype"))) { VALUE rb_gtype; GType gtype; rb_gtype = rb_funcall(rb_struct, rb_intern("gtype"), 0); gtype = NUM2ULONG(rb_funcall(rb_gtype, rb_intern("to_i"), 0)); instance = RVAL2BOXED(rb_struct, gtype); } else { Data_Get_Struct(rb_struct, void, instance); } rb_value = rb_gi_field_info_get_field_raw(field_info, instance); g_base_info_unref(field_info); return rb_value; } static VALUE rg_set_field_value(VALUE self, VALUE rb_struct, VALUE rb_n, VALUE rb_value) { GIStructInfo *info; gint n; GIFieldInfo *field_info; GType gtype; info = SELF(self); n = NUM2INT(rb_n); field_info = g_struct_info_get_field(info, n); gtype = g_registered_type_info_get_g_type(info); rb_gi_field_info_set_field_raw(field_info, RVAL2BOXED(rb_struct, gtype), rb_value); /* TODO: use rb_ensure() to unref field_info. */ g_base_info_unref(field_info); return Qnil; } static VALUE rg_n_methods(VALUE self) { GIStructInfo *info; info = SELF(self); return INT2NUM(g_struct_info_get_n_methods(info)); } static VALUE rg_get_method(VALUE self, VALUE rb_n_or_name) { GIStructInfo *info; GIFunctionInfo *function_info; info = SELF(self); if (RB_TYPE_P(rb_n_or_name, RUBY_T_FIXNUM)) { gint n; n = NUM2INT(rb_n_or_name); function_info = g_struct_info_get_method(info, n); } else { const gchar *name; name = RVAL2CSTR(rb_n_or_name); function_info = g_struct_info_find_method(info, name); } return GI_BASE_INFO2RVAL_WITH_UNREF(function_info); } static VALUE rg_size(VALUE self) { GIStructInfo *info; info = SELF(self); return UINT2NUM(g_struct_info_get_size(info)); } static VALUE rg_alignment(VALUE self) { GIStructInfo *info; info = SELF(self); return UINT2NUM(g_struct_info_get_alignment(info)); } static VALUE rg_gtype_struct_p(VALUE self) { GIStructInfo *info; info = SELF(self); return CBOOL2RVAL(g_struct_info_is_gtype_struct(info)); } static VALUE rg_foreign_p(VALUE self) { GIStructInfo *info; info = SELF(self); return CBOOL2RVAL(g_struct_info_is_foreign(info)); } void rb_gi_struct_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_STRUCT_INFO, "StructInfo", rb_mGI, rb_cGIRegisteredTypeInfo); RG_DEF_METHOD(n_fields, 0); RG_DEF_METHOD(get_field, 1); RG_DEF_METHOD(get_field_value, 2); RG_DEF_METHOD(set_field_value, 3); RG_DEF_METHOD(n_methods, 0); RG_DEF_METHOD(get_method, 1); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(alignment, 0); RG_DEF_METHOD_P(gtype_struct, 0); RG_DEF_METHOD_P(foreign, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gobject-introspection.h����0000644�0001750�0001750�00000003306�12121311640�031310� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef RB_GOBJECT_INTROSPECTION_H #define RB_GOBJECT_INTROSPECTION_H #include <ruby.h> #include <rbgobject.h> #include <girepository.h> typedef gpointer (*RBGICallbackFinderFunc)(GIArgInfo *info); typedef struct { GIArgInfo arg_info; GIScopeType scope_type; GIDirection direction; gboolean callback_p; gboolean closure_p; gboolean destroy_p; gboolean inout_argv_p; gint in_arg_index; gint closure_in_arg_index; gint destroy_in_arg_index; gint rb_arg_index; gint out_arg_index; gint inout_argc_arg_index; } RBGIArgMetadata; typedef struct { RBGIArgMetadata *metadata; VALUE rb_gc_guard_key; VALUE rb_callback; } RBGICallbackData; void rb_gi_callback_register_finder (RBGICallbackFinderFunc finder); void rb_gi_callback_data_free (RBGICallbackData *callback_data); #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-signal-info.c�����������0000644�0001750�0001750�00000004121�12121311640�027567� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGISignalInfo #define SELF(self) RVAL2GI_BASE_INFO(self) GType gi_signal_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GISignalInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_flags(VALUE self) { GISignalInfo *info; info = SELF(self); return GI_SIGNAL_FLAGS2RVAL(g_signal_info_get_flags(info)); } static VALUE rg_class_closure(VALUE self) { GISignalInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_signal_info_get_class_closure(info)); } static VALUE rg_true_stops_emit_p(VALUE self) { GISignalInfo *info; info = SELF(self); return CBOOL2RVAL(g_signal_info_true_stops_emit(info)); } void rb_gi_signal_info_init(VALUE rb_mGI, VALUE rb_cGICallableInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_SIGNAL_INFO, "SignalInfo", rb_mGI, rb_cGICallableInfo); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(class_closure, 0); RG_DEF_METHOD_P(true_stops_emit, 0); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-flags-info.c������������0000644�0001750�0001750�00000003005�12121311640�027406� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIFlagsInfo GType gi_flags_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIFlagsInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } void rb_gi_flags_info_init(VALUE rb_mGI, VALUE rb_cGIEnumInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_FLAGS_INFO, "FlagsInfo", rb_mGI, rb_cGIEnumInfo); /* Suppress a warning. */ (void)RG_TARGET_NAMESPACE; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-property-info.c���������0000644�0001750�0001750�00000004120�12121311640�030175� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIPropertyInfo #define SELF(self) RVAL2GI_BASE_INFO(self) GType gi_property_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIPropertyInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_flags(VALUE self) { GIPropertyInfo *info; info = SELF(self); return INT2NUM(g_property_info_get_flags(info)); } static VALUE rg_type(VALUE self) { GIPropertyInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_property_info_get_type(info)); } static VALUE rg_ownership_transfer(VALUE self) { GIPropertyInfo *info; info = SELF(self); return GI_TRANSFER2RVAL(g_property_info_get_ownership_transfer(info)); } void rb_gi_property_info_init(VALUE rb_mGI, VALUE rb_cGICallableInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_PROPERTY_INFO, "PropertyInfo", rb_mGI, rb_cGICallableInfo); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(type, 0); RG_DEF_METHOD(ownership_transfer, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-types.h�����������������0000644�0001750�0001750�00000006523�12067770242�026562� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef RB_GI_TYPES_H #define RB_GI_TYPES_H #define GI_TYPE_CALLABLE_INFO (gi_callable_info_get_type()) #define GI_TYPE_FUNCTION_INFO (gi_function_info_get_type()) #define GI_TYPE_METHOD_INFO (gi_method_info_get_type()) #define GI_TYPE_CONSTRUCTOR_INFO (gi_constructor_info_get_type()) #define GI_TYPE_CALLBACK_INFO (gi_callback_info_get_type()) #define GI_TYPE_REGISTERED_TYPE_INFO (gi_registered_type_info_get_type()) #define GI_TYPE_STRUCT_INFO (gi_struct_info_get_type()) #define GI_TYPE_BOXED_INFO (gi_boxed_info_get_type()) #define GI_TYPE_ENUM_INFO (gi_enum_info_get_type()) #define GI_TYPE_FLAGS_INFO (gi_flags_info_get_type()) #define GI_TYPE_OBJECT_INFO (gi_object_info_get_type()) #define GI_TYPE_INTERFACE_INFO (gi_interface_info_get_type()) #define GI_TYPE_CONSTANT_INFO (gi_constant_info_get_type()) #define GI_TYPE_UNION_INFO (gi_union_info_get_type()) #define GI_TYPE_VALUE_INFO (gi_value_info_get_type()) #define GI_TYPE_SIGNAL_INFO (gi_signal_info_get_type()) #define GI_TYPE_VFUNC_INFO (gi_vfunc_info_get_type()) #define GI_TYPE_PROPERTY_INFO (gi_property_info_get_type()) #define GI_TYPE_FIELD_INFO (gi_field_info_get_type()) #define GI_TYPE_ARG_INFO (gi_arg_info_get_type()) #define GI_TYPE_TYPE_INFO (gi_type_info_get_type()) #define GI_TYPE_UNRESOLVED_INFO (gi_unresolved_info_get_type()) GType gi_callable_info_get_type (void); GType gi_function_info_get_type (void); GType gi_method_info_get_type (void); GType gi_constructor_info_get_type (void); GType gi_callback_info_get_type (void); GType gi_registered_type_info_get_type (void); GType gi_struct_info_get_type (void); GType gi_boxed_info_get_type (void); GType gi_enum_info_get_type (void); GType gi_flags_info_get_type (void); GType gi_object_info_get_type (void); GType gi_interface_info_get_type (void); GType gi_constant_info_get_type (void); GType gi_union_info_get_type (void); GType gi_value_info_get_type (void); GType gi_signal_info_get_type (void); GType gi_vfunc_info_get_type (void); GType gi_property_info_get_type (void); GType gi_field_info_get_type (void); GType gi_arg_info_get_type (void); GType gi_type_info_get_type (void); GType gi_unresolved_info_get_type (void); #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-unresolved-info.c�������0000644�0001750�0001750�00000003052�12121311640�030502� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TUNRESOLVEDET_NAMESPACE rb_cGIUnresolvedInfo GType gi_unresolved_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIUnresolvedInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } void rb_gi_unresolved_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_UNRESOLVED_INFO, "UnresolvedInfo", rb_mGI, rb_cGIBaseInfo); (void)RG_TARGET_NAMESPACE; /* suppress a warning. */ } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-boxed-info.c������������0000644�0001750�0001750�00000003103�12121311640�027412� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIBoxedInfo #define SELF(self) (RVAL2GI_BOXED_INFO(self)) GType gi_boxed_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIBoxedInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } void rb_gi_boxed_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_BOXED_INFO, "BoxedInfo", rb_mGI, rb_cGIRegisteredTypeInfo); (void)RG_TARGET_NAMESPACE; /* suppress a warning. */ } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-value-info.c������������0000644�0001750�0001750�00000003234�12121311640�027432� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIValueInfo #define SELF(self) (RVAL2GI_VALUE_INFO(self)) GType gi_value_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIValueInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_value(VALUE self) { GIValueInfo *info; info = SELF(self); return LONG2NUM(g_value_info_get_value(info)); } void rb_gi_value_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_VALUE_INFO, "ValueInfo", rb_mGI, rb_cGIBaseInfo); RG_DEF_METHOD(value, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/extconf.rb��������������������0000755�0001750�0001750�00000006150�12142464343�026235� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2012-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "pathname" source_dir = Pathname(__FILE__).dirname base_dir = source_dir.parent.parent.expand_path top_dir = base_dir.parent.expand_path top_build_dir = Pathname(".").parent.parent.parent.expand_path mkmf_gnome2_dir = top_dir + "glib2" + "lib" version_suffix = "" unless mkmf_gnome2_dir.exist? if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s version_suffix = $1 mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + "lib" end end $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s) module_name = "gobject_introspection" package_id = "gobject-introspection-1.0" begin require "mkmf-gnome2" rescue LoadError require "rubygems" gem "glib2" require "mkmf-gnome2" end ["glib2"].each do |package| directory = "#{package}#{version_suffix}" build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}" add_depend_package(package, "#{directory}/ext/#{package}", top_dir.to_s, :top_build_dir => top_build_dir.to_s, :target_build_dir => build_dir) end setup_win32(module_name, base_dir) unless required_pkg_config_package(package_id, :debian => "libgirepository1.0-dev", :fedora => "gobject-introspection-devel", :homebrew => "gobject-introspection", :macports => "gobject-introspection") exit(false) end make_version_header("GI", package_id, ".") gi_headers = ["girepository.h"] have_func("g_interface_info_find_signal", gi_headers) enum_type_prefix = "gobject-introspection-enum-types" include_paths = PKGConfig.cflags_only_I(package_id) headers = include_paths.split.inject([]) do |result, path| result + Dir.glob(File.join(path.sub(/^-I/, ""), "gi{repository,types}.h")) end glib_mkenums(enum_type_prefix, headers, "G_TYPE_", ["girepository.h"]) create_pkg_config_file("Ruby/GObjectIntrospection", package_id, ruby_gnome2_version, "ruby-gobject-introspection.pc") ensure_objs $defs << "-DRUBY_GOBJECT_INTROSPECTION_COMPILATION" create_makefile(module_name) pkg_config_dir = with_config("pkg-config-dir") if pkg_config_dir.is_a?(String) File.open("Makefile", "ab") do |makefile| makefile.puts makefile.puts("pkgconfigdir=#{pkg_config_dir}") end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gobject-introspection.c����0000644�0001750�0001750�00000003066�12121311640�031306� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_mGObjectIntrospection void Init_gobject_introspection(void) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = rb_define_module("GObjectIntrospection"); rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION", rb_ary_new3(3, INT2FIX(GI_MAJOR_VERSION), INT2FIX(GI_MINOR_VERSION), INT2FIX(GI_MICRO_VERSION))); rb_gi_argument_init(); rb_gi_type_tag_init(RG_TARGET_NAMESPACE); rb_gi_base_info_init(RG_TARGET_NAMESPACE); rb_gi_repository_init(RG_TARGET_NAMESPACE); rb_gi_loader_init(RG_TARGET_NAMESPACE); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-function-info.c���������0000644�0001750�0001750�00000055055�12147676243�030200� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #ifdef HAVE_RUBY_THREAD_H # include <ruby/thread.h> # define RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_TYPE void * # define RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_VALUE NULL #else # define rb_thread_call_without_gvl(func, func_data, ubf, ubf_data) \ rb_thread_blocking_region(func, func_data, ubf, ubf_data) # define RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_TYPE VALUE # define RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_VALUE Qnil #endif #define RG_TARGET_NAMESPACE rb_cGIFunctionInfo #define SELF(self) RVAL2GI_FUNCTION_INFO(self) static VALUE RG_TARGET_NAMESPACE; static VALUE rb_cGLibError; static const char *callbacks_key = "gi_callbacks"; static GPtrArray *callback_finders; GType gi_function_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIFunctionInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_symbol(VALUE self) { GIFunctionInfo *info; info = SELF(self); return CSTR2RVAL(g_function_info_get_symbol(info)); } static VALUE rg_flags(VALUE self) { GIFunctionInfo *info; info = SELF(self); return GI_FUNCTION_INFO_FLAGS2RVAL(g_function_info_get_flags(info)); } static VALUE rg_property(VALUE self) { GIFunctionInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL(g_function_info_get_property(info)); } static VALUE rg_vfunc(VALUE self) { GIFunctionInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL(g_function_info_get_vfunc(info)); } static void allocate_arguments(GICallableInfo *info, GArray *in_args, GArray *out_args, GPtrArray *args_metadata) { gint i, n_args; gint rb_arg_index = 0; n_args = g_callable_info_get_n_args(info); for (i = 0; i < n_args; i++) { GIArgument argument; RBGIArgMetadata *metadata; GIArgInfo *arg_info; GIDirection direction; memset(&argument, 0, sizeof(GIArgument)); metadata = ALLOC(RBGIArgMetadata); arg_info = &(metadata->arg_info); g_callable_info_load_arg(info, i, arg_info); metadata->scope_type = g_arg_info_get_scope(arg_info); metadata->direction = g_arg_info_get_direction(arg_info); metadata->callback_p = (metadata->scope_type != GI_SCOPE_TYPE_INVALID); metadata->closure_p = FALSE; metadata->destroy_p = FALSE; metadata->inout_argv_p = FALSE; metadata->in_arg_index = -1; metadata->closure_in_arg_index = -1; metadata->destroy_in_arg_index = -1; metadata->rb_arg_index = -1; metadata->out_arg_index = -1; metadata->inout_argc_arg_index = -1; direction = metadata->direction; if (direction == GI_DIRECTION_IN || direction == GI_DIRECTION_INOUT) { metadata->in_arg_index = in_args->len; g_array_append_val(in_args, argument); metadata->rb_arg_index = rb_arg_index++; } if (direction == GI_DIRECTION_OUT || direction == GI_DIRECTION_INOUT) { metadata->out_arg_index = out_args->len; g_array_append_val(out_args, argument); } g_ptr_array_add(args_metadata, metadata); } } static void fill_metadata_inout_argv(GPtrArray *args_metadata) { guint i; gint inout_argc_arg_index = -1; for (i = 0; i < args_metadata->len; i++) { RBGIArgMetadata *metadata; GIArgInfo *arg_info; const gchar *name; metadata = g_ptr_array_index(args_metadata, i); if (metadata->direction != GI_DIRECTION_INOUT) { continue; } arg_info = &(metadata->arg_info); name = g_base_info_get_name(arg_info); if (strcmp(name, "argc") == 0) { inout_argc_arg_index = i; } else if (strcmp(name, "argv") == 0) { metadata->inout_argv_p = TRUE; metadata->inout_argc_arg_index = inout_argc_arg_index; } } } static void fill_metadata_callback(GPtrArray *args_metadata) { guint i; for (i = 0; i < args_metadata->len; i++) { RBGIArgMetadata *metadata; GIArgInfo *arg_info; gint closure_index; gint destroy_index; metadata = g_ptr_array_index(args_metadata, i); if (!metadata->callback_p) { continue; } arg_info = &(metadata->arg_info); closure_index = g_arg_info_get_closure(arg_info); if (closure_index != -1) { RBGIArgMetadata *closure_metadata; closure_metadata = g_ptr_array_index(args_metadata, closure_index); closure_metadata->closure_p = TRUE; metadata->closure_in_arg_index = closure_metadata->in_arg_index; closure_metadata->rb_arg_index = -1; } destroy_index = g_arg_info_get_destroy(arg_info); if (destroy_index != -1) { RBGIArgMetadata *destroy_metadata; destroy_metadata = g_ptr_array_index(args_metadata, destroy_index); destroy_metadata->destroy_p = TRUE; metadata->destroy_in_arg_index = destroy_metadata->in_arg_index; destroy_metadata->rb_arg_index = -1; } } } static void fill_metadata(GPtrArray *args_metadata) { fill_metadata_inout_argv(args_metadata); fill_metadata_callback(args_metadata); } static void callback_data_guard_from_gc(RBGICallbackData *callback_data) { VALUE rb_callbacks; rb_callbacks = rb_iv_get(RG_TARGET_NAMESPACE, callbacks_key); callback_data->rb_gc_guard_key = rb_class_new_instance(0, NULL, rb_cObject); rb_hash_aset(rb_callbacks, callback_data->rb_gc_guard_key, callback_data->rb_callback); } static void callback_data_unguard_from_gc(RBGICallbackData *callback_data) { VALUE rb_callbacks; rb_callbacks = rb_iv_get(RG_TARGET_NAMESPACE, callbacks_key); rb_hash_delete(rb_callbacks, callback_data->rb_gc_guard_key); } void rb_gi_callback_data_free(RBGICallbackData *callback_data) { callback_data_unguard_from_gc(callback_data); xfree(callback_data->metadata); xfree(callback_data); } static void destroy_notify(gpointer data) { RBGICallbackData *callback_data = data; rb_gi_callback_data_free(callback_data); } static gpointer find_callback_function(GIArgInfo *info) { guint i; gpointer callback = NULL; for (i = 0; i < callback_finders->len; i++) { RBGICallbackFinderFunc finder = g_ptr_array_index(callback_finders, i); callback = finder(info); if (callback) { break; } } return callback; } void rb_gi_callback_register_finder(RBGICallbackFinderFunc finder) { g_ptr_array_add(callback_finders, finder); } static gboolean source_func_p(GIArgInfo *info) { GITypeInfo type_info; GIBaseInfo *interface_info; GICallableInfo *callback_info; GITypeInfo return_type_info; GIArgInfo first_arg_info; GITypeInfo first_arg_type_info; g_arg_info_load_type(info, &type_info); if (g_type_info_get_tag(&type_info) != GI_TYPE_TAG_INTERFACE) { return FALSE; } interface_info = g_type_info_get_interface(&type_info); if (g_base_info_get_type(interface_info) != GI_INFO_TYPE_CALLBACK) { g_base_info_unref(interface_info); return FALSE; } callback_info = (GICallableInfo *)interface_info; g_callable_info_load_return_type(callback_info, &return_type_info); if (g_type_info_get_tag(&return_type_info) != GI_TYPE_TAG_BOOLEAN) { g_base_info_unref(interface_info); return FALSE; } if (g_callable_info_get_n_args(interface_info) != 1) { g_base_info_unref(interface_info); return FALSE; } g_callable_info_load_arg(interface_info, 0, &first_arg_info); g_arg_info_load_type(&first_arg_info, &first_arg_type_info); if (g_type_info_get_tag(&first_arg_type_info) != GI_TYPE_TAG_VOID) { g_base_info_unref(interface_info); return FALSE; } g_base_info_unref(interface_info); return TRUE; } static gboolean source_func_callback(gpointer user_data) { RBGICallbackData *callback_data = user_data; VALUE rb_keep; ID id_call; CONST_ID(id_call, "call"); rb_keep = rb_funcall(callback_data->rb_callback, id_call, 0); if (callback_data->metadata->scope_type == GI_SCOPE_TYPE_ASYNC) { rb_gi_callback_data_free(callback_data); } return RVAL2CBOOL(rb_keep); } static gpointer source_func_callback_finder(GIArgInfo *arg_info) { if (!source_func_p(arg_info)) { return NULL; } return source_func_callback; } static void in_callback_argument_from_ruby(RBGIArgMetadata *metadata, GArray *in_args) { gpointer callback; GIArgInfo *arg_info; GIArgument *callback_argument; arg_info = &(metadata->arg_info); callback = find_callback_function(arg_info); if (!callback) { GITypeInfo type_info; GIBaseInfo *interface_info; VALUE rb_type_name; g_arg_info_load_type(arg_info, &type_info); interface_info = g_type_info_get_interface(&type_info); rb_type_name = CSTR2RVAL(g_base_info_get_name(interface_info)); g_base_info_unref(interface_info); rb_raise(rb_eNotImpError, "TODO: <%s>(%s) callback is not supported yet.", RVAL2CSTR(rb_type_name), g_base_info_get_name(arg_info)); } callback_argument = &(g_array_index(in_args, GIArgument, metadata->in_arg_index)); callback_argument->v_pointer = callback; if (metadata->closure_in_arg_index != -1) { RBGICallbackData *callback_data; GIArgument *closure_argument; callback_data = ALLOC(RBGICallbackData); callback_data->metadata = metadata; callback_data->rb_callback = rb_block_proc(); callback_data_guard_from_gc(callback_data); closure_argument = &(g_array_index(in_args, GIArgument, metadata->closure_in_arg_index)); closure_argument->v_pointer = callback_data; } if (metadata->destroy_in_arg_index != -1) { GIArgument *destroy_argument; destroy_argument = &(g_array_index(in_args, GIArgument, metadata->destroy_in_arg_index)); destroy_argument->v_pointer = destroy_notify; } } static void in_argument_from_ruby(RBGIArgMetadata *metadata, VALUE rb_arguments, GArray *in_args) { if (metadata->rb_arg_index == -1) { return; } if (metadata->callback_p) { in_callback_argument_from_ruby(metadata, in_args); } else { GIArgument *argument; VALUE rb_argument = Qnil; if (RARRAY_LEN(rb_arguments) > metadata->rb_arg_index) { rb_argument = RARRAY_PTR(rb_arguments)[metadata->rb_arg_index]; } argument = &(g_array_index(in_args, GIArgument, metadata->in_arg_index)); RVAL2GI_IN_ARGUMENT(argument, &(metadata->arg_info), rb_argument); } } static void out_argument_from_ruby(RBGIArgMetadata *metadata, GArray *out_args) { GIArgument *argument; argument = &(g_array_index(out_args, GIArgument, metadata->out_arg_index)); rb_gi_out_argument_init(argument, &(metadata->arg_info)); } static void arg_metadata_free(gpointer data) { RBGIArgMetadata *metadata = data; if (metadata->scope_type == GI_SCOPE_TYPE_ASYNC || metadata->scope_type == GI_SCOPE_TYPE_NOTIFIED) { return; } xfree(metadata); } static void arguments_from_ruby(GICallableInfo *info, VALUE rb_arguments, GArray *in_args, GArray *out_args, GPtrArray *args_metadata) { gint i, n_args; allocate_arguments(info, in_args, out_args, args_metadata); fill_metadata(args_metadata); n_args = g_callable_info_get_n_args(info); for (i = 0; i < n_args; i++) { RBGIArgMetadata *metadata; metadata = g_ptr_array_index(args_metadata, i); if (metadata->in_arg_index != -1) { in_argument_from_ruby(metadata, rb_arguments, in_args); } else { out_argument_from_ruby(metadata, out_args); } } } static VALUE inout_argv_argument_to_ruby(GArray *in_args, RBGIArgMetadata *metadata) { GIArgument *inout_argc_argument; GIArgument *inout_argv_argument; gint i, argc; gchar **argv; VALUE rb_argv_argument; inout_argc_argument = &g_array_index(in_args, GIArgument, metadata->inout_argc_arg_index); inout_argv_argument = &g_array_index(in_args, GIArgument, metadata->in_arg_index); argc = *((gint *)(inout_argc_argument->v_pointer)); argv = *((gchar ***)(inout_argv_argument->v_pointer)); rb_argv_argument = rb_ary_new2(argc); for (i = 0; i < argc; i++) { rb_ary_push(rb_argv_argument, CSTR2RVAL(argv[i])); } return rb_argv_argument; } static VALUE out_arguments_to_ruby(GICallableInfo *callable_info, GArray *in_args, GArray *out_args, GPtrArray *args_metadata) { gint i, n_args; VALUE rb_out_args; rb_out_args = rb_ary_new(); n_args = g_callable_info_get_n_args(callable_info); for (i = 0; i < n_args; i++) { RBGIArgMetadata *metadata; GIArgument *argument = NULL; VALUE rb_argument; metadata = g_ptr_array_index(args_metadata, i); switch (metadata->direction) { case GI_DIRECTION_IN: break; case GI_DIRECTION_OUT: argument = &g_array_index(out_args, GIArgument, metadata->out_arg_index); break; case GI_DIRECTION_INOUT: argument = &g_array_index(in_args, GIArgument, metadata->in_arg_index); break; default: g_assert_not_reached(); break; } if (!argument) { continue; } if (metadata->inout_argv_p) { rb_argument = inout_argv_argument_to_ruby(in_args, metadata); } else { rb_argument = GI_OUT_ARGUMENT2RVAL(argument, &(metadata->arg_info)); } rb_ary_push(rb_out_args, rb_argument); } if (RARRAY_LEN(rb_out_args) == 0) { return Qnil; } else { return rb_out_args; } } static void arguments_init(GArray **in_args, GArray **out_args, GPtrArray **args_metadata) { *in_args = g_array_new(FALSE, FALSE, sizeof(GIArgument)); *out_args = g_array_new(FALSE, FALSE, sizeof(GIArgument)); *args_metadata = g_ptr_array_new_with_free_func(arg_metadata_free); } static void arguments_free(GArray *in_args, GArray *out_args, GPtrArray *args_metadata) { guint i; for (i = 0; i < args_metadata->len; i++) { RBGIArgMetadata *metadata; gint in_arg_index; metadata = g_ptr_array_index(args_metadata, i); if (metadata->direction == GI_DIRECTION_IN || metadata->direction == GI_DIRECTION_INOUT) { in_arg_index = metadata->in_arg_index; if (in_arg_index != -1) { GIArgument *argument; argument = &(g_array_index(in_args, GIArgument, in_arg_index)); rb_gi_in_argument_free(argument, &(metadata->arg_info)); } } else { GIArgument *argument; argument = &(g_array_index(out_args, GIArgument, metadata->out_arg_index)); rb_gi_out_argument_fin(argument, &(metadata->arg_info)); } } g_array_unref(in_args); g_array_unref(out_args); g_ptr_array_unref(args_metadata); } typedef struct { GIFunctionInfo *info; GArray *in_args; GArray *out_args; GIArgument *return_value; GError **error; gboolean succeeded; } InvokeData; static void rb_gi_function_info_invoke_raw_call(InvokeData *data) { data->succeeded = g_function_info_invoke(data->info, (GIArgument *)(data->in_args->data), data->in_args->len, (GIArgument *)(data->out_args->data), data->out_args->len, data->return_value, data->error); } static RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_TYPE rb_gi_function_info_invoke_raw_call_without_gvl_body(void *user_data) { InvokeData *data = (InvokeData *)user_data; rb_gi_function_info_invoke_raw_call(data); return RB_THREAD_CALL_WITHOUT_GVL_FUNC_RETURN_VALUE; } static gboolean gobject_based_p(GIBaseInfo *info) { GIBaseInfo *container_info; GIRegisteredTypeInfo *registered_type_info; container_info = g_base_info_get_container(info); if (g_base_info_get_type(container_info) != GI_INFO_TYPE_STRUCT) { return TRUE; } registered_type_info = (GIRegisteredTypeInfo *)container_info; if (g_registered_type_info_get_type_init(registered_type_info)) { return TRUE; } return FALSE; } VALUE rb_gi_function_info_invoke_raw(GIFunctionInfo *info, VALUE rb_options, GIArgument *return_value) { GICallableInfo *callable_info; GIArgument receiver; GArray *in_args, *out_args; GPtrArray *args_metadata; VALUE rb_out_args = Qnil; gboolean succeeded; GError *error = NULL; gboolean unlock_gvl = FALSE; VALUE rb_receiver, rb_arguments, rb_unlock_gvl; if (RB_TYPE_P(rb_options, RUBY_T_ARRAY)) { rb_receiver = Qnil; rb_arguments = rb_options; rb_unlock_gvl = Qnil; } else if (NIL_P(rb_options)) { rb_receiver = Qnil; rb_arguments = rb_ary_new(); rb_unlock_gvl = Qnil; } else { rb_options = rbg_check_hash_type(rb_options); rbg_scan_options(rb_options, "receiver", &rb_receiver, "arguments", &rb_arguments, "unlock_gvl", &rb_unlock_gvl, NULL); } if (NIL_P(rb_receiver)) { receiver.v_pointer = NULL; } else { if (gobject_based_p((GIBaseInfo *)info)) { receiver.v_pointer = RVAL2GOBJ(rb_receiver); } else { receiver.v_pointer = DATA_PTR(rb_receiver); } } rb_arguments = rbg_to_array(rb_arguments); if (!NIL_P(rb_unlock_gvl) && RVAL2CBOOL(rb_unlock_gvl)) { unlock_gvl = TRUE; } callable_info = (GICallableInfo *)info; arguments_init(&in_args, &out_args, &args_metadata); if (receiver.v_pointer) { g_array_append_val(in_args, receiver); } arguments_from_ruby(callable_info, rb_arguments, in_args, out_args, args_metadata); { InvokeData data; data.info = info; data.in_args = in_args; data.out_args = out_args; data.return_value = return_value; data.error = &error; if (unlock_gvl) { rb_thread_call_without_gvl( rb_gi_function_info_invoke_raw_call_without_gvl_body, &data, NULL, NULL); } else { rb_gi_function_info_invoke_raw_call(&data); } succeeded = data.succeeded; } if (succeeded) { rb_out_args = out_arguments_to_ruby(callable_info, in_args, out_args, args_metadata); } arguments_free(in_args, out_args, args_metadata); if (!succeeded) { RG_RAISE_ERROR(error); } if (!NIL_P(rb_out_args) && RARRAY_LEN(rb_out_args) == 1) { VALUE rb_out_arg; rb_out_arg = RARRAY_PTR(rb_out_args)[0]; if (rb_obj_is_kind_of(rb_out_arg, rb_cGLibError)) { rb_exc_raise(rb_out_arg); } } return rb_out_args; } static VALUE rg_invoke(VALUE self, VALUE rb_options) { GIFunctionInfo *info; GICallableInfo *callable_info; GIArgument return_value; VALUE rb_out_args; VALUE rb_return_value; info = SELF(self); /* TODO: use rb_protect() */ rb_out_args = rb_gi_function_info_invoke_raw(info, rb_options, &return_value); callable_info = (GICallableInfo *)info; rb_return_value = GI_RETURN_ARGUMENT2RVAL(&return_value, callable_info); if (NIL_P(rb_out_args)) { return rb_return_value; } else { GITypeInfo return_value_info; g_callable_info_load_return_type(callable_info, &return_value_info); if (g_type_info_get_tag(&return_value_info) != GI_TYPE_TAG_VOID) { rb_ary_unshift(rb_out_args, rb_return_value); } if (RARRAY_LEN(rb_out_args) == 1) { return RARRAY_PTR(rb_out_args)[0]; } else { return rb_out_args; } } } void rb_gi_function_info_init(VALUE rb_mGI, VALUE rb_cGICallableInfo) { rb_cGLibError = rb_const_get(mGLib, rb_intern("Error")); RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_FUNCTION_INFO, "FunctionInfo", rb_mGI, rb_cGICallableInfo); rb_iv_set(RG_TARGET_NAMESPACE, callbacks_key, rb_hash_new()); callback_finders = g_ptr_array_new(); rb_gi_callback_register_finder(source_func_callback_finder); RG_DEF_METHOD(symbol, 0); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(property, 0); RG_DEF_METHOD(vfunc, 0); RG_DEF_METHOD(invoke, 1); G_DEF_CLASS(G_TYPE_I_FUNCTION_INFO_FLAGS, "FunctionInfoFlags", rb_mGI); rb_gi_method_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_constructor_info_init(rb_mGI, RG_TARGET_NAMESPACE); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-field-info.c������������0000644�0001750�0001750�00000007512�12142464343�027420� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIFieldInfo #define SELF(self) (RVAL2GI_FIELD_INFO(self)) GType gi_field_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIFieldInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_flags(VALUE self) { GIFieldInfo *info; info = SELF(self); return GI_FIELD_INFO_FLAGS2RVAL(g_field_info_get_flags(info)); } static VALUE rg_size(VALUE self) { GIFieldInfo *info; info = SELF(self); return INT2NUM(g_field_info_get_size(info)); } static VALUE rg_offset(VALUE self) { GIFieldInfo *info; info = SELF(self); return INT2NUM(g_field_info_get_offset(info)); } static VALUE rg_type(VALUE self) { GIFieldInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_field_info_get_type(info)); } VALUE rb_gi_field_info_get_field_raw(GIFieldInfo *info, gpointer memory) { GIArgument argument; GITypeInfo *type_info; VALUE rb_field_value; if (!g_field_info_get_field(info, memory, &argument)) { rb_raise(rb_eArgError, "failed to get field value"); } type_info = g_field_info_get_type(info); rb_field_value = GI_ARGUMENT2RVAL(&argument, type_info); g_base_info_unref(type_info); return rb_field_value; } void rb_gi_field_info_set_field_raw(GIFieldInfo *info, gpointer memory, VALUE rb_field_value) { GIArgument field_value; GITypeInfo *type_info; gboolean succeeded; type_info = g_field_info_get_type(info); RVAL2GI_VALUE_ARGUMENT(&field_value, type_info, rb_field_value); succeeded = g_field_info_set_field(info, memory, &field_value); rb_gi_value_argument_free(&field_value, type_info); g_base_info_unref(type_info); if (!succeeded) { rb_raise(rb_eArgError, "failed to set field value"); } } static VALUE rg_get_field(VALUE self, VALUE rb_memory) { GIFieldInfo *info; gpointer memory; info = SELF(self); memory = GUINT_TO_POINTER(NUM2ULONG(rb_memory)); return rb_gi_field_info_get_field_raw(info, memory); } static VALUE rg_set_field(VALUE self, VALUE rb_memory, VALUE rb_field_value) { GIFieldInfo *info; gpointer memory; info = SELF(self); memory = GUINT_TO_POINTER(NUM2ULONG(rb_memory)); rb_gi_field_info_set_field_raw(info, memory, rb_field_value); return Qnil; } void rb_gi_field_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_FIELD_INFO, "FieldInfo", rb_mGI, rb_cGIBaseInfo); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(size, 0); RG_DEF_METHOD(offset, 0); RG_DEF_METHOD(type, 0); RG_DEF_METHOD(get_field, 1); RG_DEF_METHOD(set_field, 2); G_DEF_CLASS(G_TYPE_I_FIELD_INFO_FLAGS, "FieldInfoFlags", rb_mGI); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-object-info.c�����������0000644�0001750�0001750�00000017172�12121311640�027572� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIObjectInfo #define SELF(self) (RVAL2GI_OBJECT_INFO(self)) GType gi_object_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIObjectInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_type_name(VALUE self) { GIObjectInfo *info; info = SELF(self); return CSTR2RVAL(g_object_info_get_type_name(info)); } static VALUE rg_type_init(VALUE self) { GIObjectInfo *info; info = SELF(self); return CSTR2RVAL(g_object_info_get_type_init(info)); } static VALUE rg_abstract_p(VALUE self) { GIObjectInfo *info; info = SELF(self); return CBOOL2RVAL(g_object_info_get_abstract(info)); } static VALUE rg_fundamental_p(VALUE self) { GIObjectInfo *info; info = SELF(self); return CBOOL2RVAL(g_object_info_get_fundamental(info)); } static VALUE rg_parent(VALUE self) { GIObjectInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_parent(info)); } static VALUE rg_n_interfaces(VALUE self) { GIObjectInfo *info; info = SELF(self); return INT2NUM(g_object_info_get_n_interfaces(info)); } static VALUE rg_get_interface(VALUE self, VALUE rb_n) { GIObjectInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_interface(info, n)); } static VALUE rg_n_fields(VALUE self) { GIObjectInfo *info; info = SELF(self); return INT2NUM(g_object_info_get_n_fields(info)); } static VALUE rg_get_field(VALUE self, VALUE rb_n) { GIObjectInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_field(info, n)); } static VALUE rg_get_field_value(VALUE self, VALUE rb_object, VALUE rb_n) { GIObjectInfo *info; gint n; GIFieldInfo *field_info; VALUE rb_value; info = SELF(self); n = NUM2INT(rb_n); field_info = g_object_info_get_field(info, n); rb_value = rb_gi_field_info_get_field_raw(field_info, RVAL2GOBJ(rb_object)); g_base_info_unref(field_info); return rb_value; } static VALUE rg_set_field_value(VALUE self, VALUE rb_object, VALUE rb_n, VALUE rb_value) { GIObjectInfo *info; gint n; GIFieldInfo *field_info; info = SELF(self); n = NUM2INT(rb_n); field_info = g_object_info_get_field(info, n); rb_gi_field_info_set_field_raw(field_info, RVAL2GOBJ(rb_object), rb_value); /* TODO: use rb_ensure() to unref field_info. */ g_base_info_unref(field_info); return Qnil; } static VALUE rg_n_properties(VALUE self) { GIObjectInfo *info; info = SELF(self); return INT2NUM(g_object_info_get_n_properties(info)); } static VALUE rg_get_property(VALUE self, VALUE rb_n) { GIObjectInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_property(info, n)); } static VALUE rg_n_methods(VALUE self) { GIObjectInfo *info; info = SELF(self); return INT2NUM(g_object_info_get_n_methods(info)); } static VALUE rg_get_method(VALUE self, VALUE rb_n_or_name) { GIObjectInfo *info; GIFunctionInfo *function_info; info = SELF(self); if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) { gint n; n = NUM2INT(rb_n_or_name); function_info = g_object_info_get_method(info, n); } else { const gchar *name; name = RVAL2CSTR(rb_n_or_name); function_info = g_object_info_find_method(info, name); } return GI_BASE_INFO2RVAL_WITH_UNREF(function_info); } static VALUE rg_n_signals(VALUE self) { GIObjectInfo *info; info = SELF(self); return INT2NUM(g_object_info_get_n_signals(info)); } static VALUE rg_get_signal(VALUE self, VALUE rb_n) { GIObjectInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_signal(info, n)); } static VALUE rg_n_vfuncs(VALUE self) { GIObjectInfo *info; info = SELF(self); return INT2NUM(g_object_info_get_n_vfuncs(info)); } static VALUE rg_get_vfunc(VALUE self, VALUE rb_n_or_name) { GIObjectInfo *info; GIVFuncInfo *vfunc_info; info = SELF(self); if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) { gint n; n = NUM2INT(rb_n_or_name); vfunc_info = g_object_info_get_vfunc(info, n); } else { const gchar *name; name = RVAL2CSTR(rb_n_or_name); vfunc_info = g_object_info_find_vfunc(info, name); } return GI_BASE_INFO2RVAL_WITH_UNREF(vfunc_info); } static VALUE rg_n_constants(VALUE self) { GIObjectInfo *info; info = SELF(self); return INT2NUM(g_object_info_get_n_constants(info)); } static VALUE rg_get_constant(VALUE self, VALUE rb_n) { GIObjectInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_object_info_get_constant(info, n)); } static VALUE rg_unref_function(VALUE self) { GIObjectInfo *info; info = SELF(self); return CSTR2RVAL(g_object_info_get_unref_function(info)); } static VALUE rg_ref_function(VALUE self) { GIObjectInfo *info; info = SELF(self); return CSTR2RVAL(g_object_info_get_ref_function(info)); } static VALUE rg_set_value_function(VALUE self) { GIObjectInfo *info; info = SELF(self); return CSTR2RVAL(g_object_info_get_set_value_function(info)); } static VALUE rg_get_value_function(VALUE self) { GIObjectInfo *info; info = SELF(self); return CSTR2RVAL(g_object_info_get_get_value_function(info)); } void rb_gi_object_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_OBJECT_INFO, "ObjectInfo", rb_mGI, rb_cGIRegisteredTypeInfo); RG_DEF_METHOD(type_name, 0); RG_DEF_METHOD(type_init, 0); RG_DEF_METHOD_P(abstract, 0); RG_DEF_METHOD_P(fundamental, 0); RG_DEF_METHOD(parent, 0); RG_DEF_METHOD(n_interfaces, 0); RG_DEF_METHOD(get_interface, 1); RG_DEF_METHOD(n_fields, 0); RG_DEF_METHOD(get_field, 1); RG_DEF_METHOD(get_field_value, 2); RG_DEF_METHOD(set_field_value, 3); RG_DEF_METHOD(n_properties, 0); RG_DEF_METHOD(get_property, 1); RG_DEF_METHOD(n_methods, 0); RG_DEF_METHOD(get_method, 1); RG_DEF_METHOD(n_signals, 0); RG_DEF_METHOD(get_signal, 1); RG_DEF_METHOD(n_vfuncs, 0); RG_DEF_METHOD(get_vfunc, 1); RG_DEF_METHOD(n_constants, 0); RG_DEF_METHOD(get_constant, 1); RG_DEF_METHOD(unref_function, 0); RG_DEF_METHOD(ref_function, 0); RG_DEF_METHOD(set_value_function, 0); RG_DEF_METHOD(get_value_function, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-constant-info.c���������0000644�0001750�0001750�00000004234�12121311640�030150� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIConstantInfo #define SELF(self) (RVAL2GI_CONSTANT_INFO(self)) GType gi_constant_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIConstantInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_type(VALUE self) { GIConstantInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_constant_info_get_type(info)); } static VALUE rg_value(VALUE self) { GIConstantInfo *info; GIArgument value; gint value_size; GITypeInfo *type_info; VALUE rb_value; info = SELF(self); type_info = g_constant_info_get_type(info); value_size = g_constant_info_get_value(info, &value); rb_value = GI_ARGUMENT2RVAL(&value, type_info); g_base_info_unref(type_info); g_constant_info_free_value(info, &value); return rb_value; } void rb_gi_constant_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_CONSTANT_INFO, "ConstantInfo", rb_mGI, rb_cGIBaseInfo); RG_DEF_METHOD(type, 0); RG_DEF_METHOD(value, 0); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-private.h���������������0000644�0001750�0001750�00000011036�12142464343�027057� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef RB_GI_PRIVATE_H #define RB_GI_PRIVATE_H #include <ruby.h> #include <rbgobject.h> #include <glib-enum-types.h> #include <girffi.h> #include "gobject-introspection-enum-types.h" #include "rbgiversion.h" #include "rb-gi-types.h" #include "rb-gi-conversions.h" #include "rb-gobject-introspection.h" #ifndef RB_TYPE_P # define RB_TYPE_P(object, type) (TYPE(object) == type) #endif extern void Init_gobject_introspection(void); void rb_gi_argument_init (void); void rb_gi_type_tag_init (VALUE rb_mGI); void rb_gi_base_info_init (VALUE rb_mGI); void rb_gi_callable_info_init (VALUE rb_mGI, VALUE rb_cGIBaseInfo); void rb_gi_function_info_init (VALUE rb_mGI, VALUE rb_cGICallableInfo); void rb_gi_method_info_init (VALUE rb_mGI, VALUE rb_cGIFunctionInfo); void rb_gi_constructor_info_init (VALUE rb_mGI, VALUE rb_cGIFunctionInfo); void rb_gi_callback_info_init (VALUE rb_mGI, VALUE rb_cGICallableInfo); void rb_gi_registered_type_info_init (VALUE rb_mGI, VALUE rb_cGIBaseInfo); void rb_gi_struct_info_init (VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo); void rb_gi_boxed_info_init (VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo); void rb_gi_enum_info_init (VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo); void rb_gi_flags_info_init (VALUE rb_mGI, VALUE rb_cGIEnumInfo); void rb_gi_object_info_init (VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo); void rb_gi_interface_info_init (VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo); void rb_gi_constant_info_init (VALUE rb_mGI, VALUE rb_cGIBaseInfo); void rb_gi_union_info_init (VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo); void rb_gi_value_info_init (VALUE rb_mGI, VALUE rb_cGIBaseInfo); void rb_gi_signal_info_init (VALUE rb_mGI, VALUE rb_cGICallableInfo); void rb_gi_vfunc_info_init (VALUE rb_mGI, VALUE rb_cGICallableInfo); void rb_gi_property_info_init (VALUE rb_mGI, VALUE rb_cGIBaseInfo); void rb_gi_field_info_init (VALUE rb_mGI, VALUE rb_cGIBaseInfo); void rb_gi_arg_info_init (VALUE rb_mGI, VALUE rb_cGIBaseInfo); void rb_gi_type_info_init (VALUE rb_mGI, VALUE rb_cGIBaseInfo); void rb_gi_unresolved_info_init (VALUE rb_mGI, VALUE rb_cGIBaseInfo); void rb_gi_repository_init (VALUE rb_mGI); void rb_gi_loader_init (VALUE rb_mGI); VALUE rb_gi_function_info_invoke_raw (GIFunctionInfo *info, VALUE rb_options, GIArgument *return_value); VALUE rb_gi_field_info_get_field_raw (GIFieldInfo *info, gpointer memory); void rb_gi_field_info_set_field_raw (GIFieldInfo *info, gpointer memory, VALUE rb_field_value); #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-arg-info.c��������������0000644�0001750�0001750�00000006665�12121311640�027102� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIArgInfo #define SELF(self) (RVAL2GI_ARG_INFO(self)) GType gi_arg_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIArgInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_direction(VALUE self) { GIArgInfo *info; info = SELF(self); return GI_DIRECTION2RVAL(g_arg_info_get_direction(info)); } static VALUE rg_caller_allocates_p(VALUE self) { GIArgInfo *info; info = SELF(self); return CBOOL2RVAL(g_arg_info_is_caller_allocates(info)); } static VALUE rg_return_value_p(VALUE self) { GIArgInfo *info; info = SELF(self); return CBOOL2RVAL(g_arg_info_is_return_value(info)); } static VALUE rg_optional_p(VALUE self) { GIArgInfo *info; info = SELF(self); return CBOOL2RVAL(g_arg_info_is_optional(info)); } static VALUE rg_may_be_null_p(VALUE self) { GIArgInfo *info; info = SELF(self); return CBOOL2RVAL(g_arg_info_may_be_null(info)); } static VALUE rg_ownership_transfer(VALUE self) { GIArgInfo *info; info = SELF(self); return GI_TRANSFER2RVAL(g_arg_info_get_ownership_transfer(info)); } static VALUE rg_scope(VALUE self) { GIArgInfo *info; info = SELF(self); return GI_SCOPE_TYPE2RVAL(g_arg_info_get_scope(info)); } static VALUE rg_closure(VALUE self) { GIArgInfo *info; info = SELF(self); return INT2NUM(g_arg_info_get_closure(info)); } static VALUE rg_destroy(VALUE self) { GIArgInfo *info; info = SELF(self); return INT2NUM(g_arg_info_get_destroy(info)); } static VALUE rg_type(VALUE self) { GIArgInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_arg_info_get_type(info)); } void rb_gi_arg_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_ARG_INFO, "ArgInfo", rb_mGI, rb_cGIBaseInfo); RG_DEF_METHOD(direction, 0); RG_DEF_METHOD_P(caller_allocates, 0); RG_DEF_METHOD_P(return_value, 0); RG_DEF_METHOD_P(optional, 0); RG_DEF_METHOD_P(may_be_null, 0); RG_DEF_METHOD(ownership_transfer, 0); RG_DEF_METHOD(scope, 0); RG_DEF_METHOD(closure, 0); RG_DEF_METHOD(destroy, 0); RG_DEF_METHOD(type, 0); G_DEF_CLASS(G_TYPE_I_DIRECTION, "Direction", rb_mGI); G_DEF_CLASS(G_TYPE_I_SCOPE_TYPE, "ScopeType", rb_mGI); G_DEF_CLASS(G_TYPE_I_TRANSFER, "Transfer", rb_mGI); } ���������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-type-info.c�������������0000644�0001750�0001750�00000006457�12121311640�027311� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGITypeInfo #define SELF(self) (RVAL2GI_TYPE_INFO(self)) GType gi_type_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GITypeInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } VALUE rb_gi_array_type_to_ruby(GIArrayType type) { if (type == (GIArrayType)-1) { return Qnil; } else { return GENUM2RVAL(type, G_TYPE_I_ARRAY_TYPE); } } static VALUE rg_pointer_p(VALUE self) { GITypeInfo *info; info = SELF(self); return CBOOL2RVAL(g_type_info_is_pointer(info)); } static VALUE rg_tag(VALUE self) { GITypeInfo *info; info = SELF(self); return GI_TYPE_TAG2RVAL(g_type_info_get_tag(info)); } static VALUE rg_get_param_type(VALUE self, VALUE rb_n) { GITypeInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_type_info_get_param_type(info, n)); } static VALUE rg_interface(VALUE self) { GITypeInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_type_info_get_interface(info)); } static VALUE rg_array_length(VALUE self) { GITypeInfo *info; info = SELF(self); return INT2NUM(g_type_info_get_array_length(info)); } static VALUE rg_array_fixed_size(VALUE self) { GITypeInfo *info; info = SELF(self); return INT2NUM(g_type_info_get_array_fixed_size(info)); } static VALUE rg_zero_terminated_p(VALUE self) { GITypeInfo *info; info = SELF(self); return CBOOL2RVAL(g_type_info_is_zero_terminated(info)); } static VALUE rg_array_type(VALUE self) { GITypeInfo *info; info = SELF(self); return GI_ARRAY_TYPE2RVAL(g_type_info_get_array_type(info)); } void rb_gi_type_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_TYPE_INFO, "TypeInfo", rb_mGI, rb_cGIBaseInfo); RG_DEF_METHOD_P(pointer, 0); RG_DEF_METHOD(tag, 0); RG_DEF_METHOD(get_param_type, 1); RG_DEF_METHOD(interface, 0); RG_DEF_METHOD(array_length, 0); RG_DEF_METHOD(array_fixed_size, 0); RG_DEF_METHOD_P(zero_terminated, 0); RG_DEF_METHOD(array_type, 0); rb_undef_method(RG_TARGET_NAMESPACE, "name"); G_DEF_CLASS(G_TYPE_I_ARRAY_TYPE, "ArrayType", rb_mGI); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/depend������������������������0000644�0001750�0001750�00000000451�12121311640�025403� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install-so: install-headers install-headers: $(INSTALL_DATA) $(srcdir)/rb-gobject-introspection.h $(RUBYARCHDIR) install: install-pc install-pc: if test -n "$(pkgconfigdir)"; then \ $(MAKEDIRS) $(pkgconfigdir); \ $(INSTALL_DATA) ruby-gobject-introspection.pc $(pkgconfigdir);\ fi �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-constructor-info.c������0000644�0001750�0001750�00000007726�12142464343�030731� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIConstructorInfo #define SELF(self) RVAL2GI_FUNCTION_INFO(self) GType gi_constructor_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIConstructorInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static void initialize_receiver(VALUE receiver, GITypeInfo *info, GIArgument *value) { GIBaseInfo *interface_info; GIInfoType interface_type; if (g_type_info_get_tag(info) != GI_TYPE_TAG_INTERFACE) { rb_raise(rb_eRuntimeError, "TODO: returned value isn't interface"); } interface_info = g_type_info_get_interface(info); interface_type = g_base_info_get_type(interface_info); g_base_info_unref(interface_info); switch (interface_type) { case GI_INFO_TYPE_OBJECT: g_object_ref_sink(value->v_pointer); G_INITIALIZE(receiver, value->v_pointer); break; case GI_INFO_TYPE_STRUCT: G_INITIALIZE(receiver, value->v_pointer); break; case GI_INFO_TYPE_INVALID: case GI_INFO_TYPE_FUNCTION: case GI_INFO_TYPE_CALLBACK: case GI_INFO_TYPE_BOXED: case GI_INFO_TYPE_ENUM: case GI_INFO_TYPE_FLAGS: case GI_INFO_TYPE_INTERFACE: case GI_INFO_TYPE_CONSTANT: case GI_INFO_TYPE_INVALID_0: case GI_INFO_TYPE_UNION: case GI_INFO_TYPE_VALUE: case GI_INFO_TYPE_SIGNAL: case GI_INFO_TYPE_VFUNC: case GI_INFO_TYPE_PROPERTY: case GI_INFO_TYPE_FIELD: case GI_INFO_TYPE_ARG: case GI_INFO_TYPE_TYPE: case GI_INFO_TYPE_UNRESOLVED: default: rb_raise(rb_eRuntimeError, "TODO: returned value isn't object or struct"); break; } } static VALUE rg_invoke(VALUE self, VALUE rb_options) { GIFunctionInfo *info; GICallableInfo *callable_info; VALUE receiver; GIArgument return_value; GITypeInfo return_value_info; info = SELF(self); callable_info = (GICallableInfo *)info; rb_options = rbg_to_hash(rb_options); receiver = rb_hash_delete(rb_options, ID2SYM(rb_intern("receiver"))); if (NIL_P(receiver)) { receiver = rb_hash_delete(rb_options, rb_str_new_cstr("receiver")); } if (NIL_P(receiver)) { rb_raise(rb_eArgError, "receiver is missing: %s", RBG_INSPECT(rb_options)); } /* TODO: use rb_protect */ rb_gi_function_info_invoke_raw(info, rb_options, &return_value); g_callable_info_load_return_type(callable_info, &return_value_info); initialize_receiver(receiver, &return_value_info, &return_value); return receiver; } void rb_gi_constructor_info_init(VALUE rb_mGI, VALUE rb_cGIFunctionInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_CONSTRUCTOR_INFO, "ConstructorInfo", rb_mGI, rb_cGIFunctionInfo); RG_DEF_METHOD(invoke, 1); } ������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-base-info.c�������������0000644�0001750�0001750�00000012414�12121311640�027230� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIBaseInfo #define SELF(self) RVAL2GI_BASE_INFO(self) VALUE rb_gi_base_info_to_ruby(GIBaseInfo *info) { GType g_type; GIInfoType info_type; if (!info) { return Qnil; } info_type = g_base_info_get_type(info); switch (info_type) { case GI_INFO_TYPE_INVALID: g_type = GI_TYPE_BASE_INFO; break; case GI_INFO_TYPE_FUNCTION: { GIFunctionInfoFlags flags; flags = g_function_info_get_flags((GIFunctionInfo *)info); if (flags & GI_FUNCTION_IS_METHOD) { g_type = GI_TYPE_METHOD_INFO; } else if (flags & GI_FUNCTION_IS_CONSTRUCTOR) { g_type = GI_TYPE_CONSTRUCTOR_INFO; } else { g_type = GI_TYPE_FUNCTION_INFO; } } break; case GI_INFO_TYPE_CALLBACK: g_type = GI_TYPE_CALLBACK_INFO; break; case GI_INFO_TYPE_STRUCT: g_type = GI_TYPE_STRUCT_INFO; break; case GI_INFO_TYPE_BOXED: g_type = GI_TYPE_BOXED_INFO; break; case GI_INFO_TYPE_ENUM: g_type = GI_TYPE_ENUM_INFO; break; case GI_INFO_TYPE_FLAGS: g_type = GI_TYPE_FLAGS_INFO; break; case GI_INFO_TYPE_OBJECT: g_type = GI_TYPE_OBJECT_INFO; break; case GI_INFO_TYPE_INTERFACE: g_type = GI_TYPE_INTERFACE_INFO; break; case GI_INFO_TYPE_CONSTANT: g_type = GI_TYPE_CONSTANT_INFO; break; case GI_INFO_TYPE_INVALID_0: g_type = GI_TYPE_BASE_INFO; break; case GI_INFO_TYPE_UNION: g_type = GI_TYPE_UNION_INFO; break; case GI_INFO_TYPE_VALUE: g_type = GI_TYPE_VALUE_INFO; break; case GI_INFO_TYPE_SIGNAL: g_type = GI_TYPE_SIGNAL_INFO; break; case GI_INFO_TYPE_VFUNC: g_type = GI_TYPE_VFUNC_INFO; break; case GI_INFO_TYPE_PROPERTY: g_type = GI_TYPE_PROPERTY_INFO; break; case GI_INFO_TYPE_FIELD: g_type = GI_TYPE_FIELD_INFO; break; case GI_INFO_TYPE_ARG: g_type = GI_TYPE_ARG_INFO; break; case GI_INFO_TYPE_TYPE: g_type = GI_TYPE_TYPE_INFO; break; case GI_INFO_TYPE_UNRESOLVED: g_type = GI_TYPE_UNRESOLVED_INFO; break; default: g_type = GI_TYPE_BASE_INFO; break; } return BOXED2RVAL(info, g_type); } VALUE rb_gi_base_info_to_ruby_with_unref(GIBaseInfo *info) { VALUE rb_info; rb_info = rb_gi_base_info_to_ruby(info); if (!NIL_P(rb_info)) { g_base_info_unref(info); } return rb_info; } GIBaseInfo * rb_gi_base_info_from_ruby(VALUE rb_info) { return RVAL2BOXED(rb_info, GI_TYPE_BASE_INFO); } static VALUE rg_type(VALUE self) { GIBaseInfo *info; info = SELF(self); return GI_INFO_TYPE2RVAL(g_base_info_get_type(info)); } static VALUE rg_name(VALUE self) { GIBaseInfo *info; info = SELF(self); return CSTR2RVAL(g_base_info_get_name(info)); } static VALUE rg_namespace(VALUE self) { GIBaseInfo *info; info = SELF(self); return CSTR2RVAL(g_base_info_get_namespace(info)); } static VALUE rg_operator_aref(VALUE self, VALUE name) { GIBaseInfo *info; info = SELF(self); return CSTR2RVAL(g_base_info_get_attribute(info, RVAL2CSTR(name))); } static VALUE rg_each(VALUE self) { GIAttributeIter iter = {0, }; GIBaseInfo *info; gchar *name, *value; RETURN_ENUMERATOR(self, 0, NULL); info = SELF(self); while (g_base_info_iterate_attributes(info, &iter, &name, &value)) { VALUE rb_name, rb_value; rb_name = CSTR2RVAL(name); rb_value = CSTR2RVAL(value); rb_yield(rb_ary_new3(2, rb_name, rb_value)); } return Qnil; } void rb_gi_base_info_init(VALUE rb_mGI) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(GI_TYPE_BASE_INFO, "BaseInfo", rb_mGI); rb_include_module(RG_TARGET_NAMESPACE, rb_mEnumerable); RG_DEF_METHOD(type, 0); RG_DEF_METHOD(name, 0); RG_DEF_METHOD(namespace, 0); RG_DEF_METHOD_OPERATOR("[]", aref, 1); RG_DEF_METHOD(each, 0); G_DEF_CLASS(G_TYPE_I_INFO_TYPE, "InfoType", rb_mGI); rb_gi_callable_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_registered_type_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_constant_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_value_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_property_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_field_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_arg_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_type_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_unresolved_info_init(rb_mGI, RG_TARGET_NAMESPACE); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-loader.c����������������0000644�0001750�0001750�00000011500�12257552167�026653� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012-2013 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGILoader static const gchar *boxed_class_converters_name = "@@boxed_class_converters"; static VALUE rg_s_define_class(int argc, VALUE *argv, G_GNUC_UNUSED VALUE klass) { VALUE rb_gtype, rb_name, rb_module; VALUE rb_options, rb_parent; GType gtype; rb_scan_args(argc, argv, "31", &rb_gtype, &rb_name, &rb_module, &rb_options); rbg_scan_options(rb_options, "parent", &rb_parent, NULL); gtype = NUM2ULONG(rb_to_int(rb_gtype)); return G_DEF_CLASS_WITH_PARENT(gtype, RVAL2CSTR(rb_name), rb_module, rb_parent); } static VALUE rg_s_define_interface(G_GNUC_UNUSED VALUE klass, VALUE rb_gtype, VALUE rb_name, VALUE rb_module) { GType gtype; gtype = NUM2ULONG(rb_to_int(rb_gtype)); return G_DEF_INTERFACE(gtype, RVAL2CSTR(rb_name), rb_module); } static VALUE struct_alloc(VALUE klass) { VALUE rb_size; size_t size; gpointer instance; rb_size = rb_iv_get(klass, "@size"); size = NUM2ULONG(rb_size); instance = xmalloc(size); memset(instance, 0, size); return Data_Wrap_Struct(klass, NULL, xfree, instance); } static VALUE rg_s_define_struct(int argc, VALUE *argv, G_GNUC_UNUSED VALUE klass) { VALUE rb_size, rb_name, rb_module; VALUE rb_options, rb_parent; VALUE rb_class; rb_scan_args(argc, argv, "31", &rb_size, &rb_name, &rb_module, &rb_options); rbg_scan_options(rb_options, "parent", &rb_parent, NULL); rb_size = rb_to_int(rb_size); if (NIL_P(rb_parent)) { rb_parent = rb_cObject; } rb_class = rb_define_class_under(rb_module, RVAL2CSTR(rb_name), rb_parent); rb_iv_set(rb_class, "@size", rb_size); rb_define_alloc_func(rb_class, struct_alloc); return rb_class; } typedef struct { GType type; VALUE rb_converters; VALUE rb_converter; } BoxedInstance2RObjData; static void boxed_class_converter_free(gpointer user_data) { BoxedInstance2RObjData *data = user_data; rb_ary_delete(data->rb_converters, data->rb_converter); g_free(data); } static VALUE boxed_instance2robj(gpointer instance, gpointer user_data) { BoxedInstance2RObjData *data = user_data; VALUE default_rb_instance; VALUE klass; gint flags = 0; ID id_call; default_rb_instance = rbgobj_make_boxed_default(instance, data->type); CONST_ID(id_call, "call"); klass = rb_funcall(data->rb_converter, id_call, 1, default_rb_instance); return rbgobj_make_boxed_raw(instance, data->type, klass, flags); } static VALUE rg_s_register_boxed_class_converter(VALUE klass, VALUE rb_gtype) { RGConvertTable table; BoxedInstance2RObjData *data; ID id_to_i; VALUE boxed_class_converters; memset(&table, 0, sizeof(RGConvertTable)); CONST_ID(id_to_i, "to_i"); table.type = NUM2ULONG(rb_funcall(rb_gtype, id_to_i, 0)); table.klass = Qnil; table.instance2robj = boxed_instance2robj; data = g_new(BoxedInstance2RObjData, 1); data->type = table.type; data->rb_converter = rb_block_proc(); boxed_class_converters = rb_cv_get(klass, boxed_class_converters_name); rb_ary_push(boxed_class_converters, data->rb_converter); table.user_data = data; table.notify = boxed_class_converter_free; rbgobj_convert_define(&table); return Qnil; } static VALUE rg_s_start_callback_dispatch_thread(G_GNUC_UNUSED VALUE klass) { rbgutil_start_callback_dispatch_thread(); return Qnil; } void rb_gi_loader_init(VALUE rb_mGI) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = rb_define_class_under(rb_mGI, "Loader", rb_cObject); rb_cv_set(RG_TARGET_NAMESPACE, boxed_class_converters_name, rb_ary_new()); RG_DEF_SMETHOD(define_class, -1); RG_DEF_SMETHOD(define_interface, 3); RG_DEF_SMETHOD(define_struct, -1); RG_DEF_SMETHOD(register_boxed_class_converter, 1); RG_DEF_SMETHOD(start_callback_dispatch_thread, 0); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-callable-info.c���������0000644�0001750�0001750�00000005441�12121311640�030057� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGICallableInfo #define SELF(self) ((GICallableInfo *)(RVAL2GI_BASE_INFO(self))) GType gi_callable_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GICallableInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_return_type(VALUE self) { GICallableInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL(g_callable_info_get_return_type(info)); } static VALUE rg_caller_owns(VALUE self) { GICallableInfo *info; info = SELF(self); return GI_TRANSFER2RVAL(g_callable_info_get_caller_owns(info)); } static VALUE rg_may_return_null_p(VALUE self) { GICallableInfo *info; info = SELF(self); return CBOOL2RVAL(g_callable_info_may_return_null(info)); } static VALUE rg_n_args(VALUE self) { GICallableInfo *info; info = SELF(self); return INT2NUM(g_callable_info_get_n_args(info)); } static VALUE rg_get_arg(VALUE self, VALUE rb_n) { GICallableInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_callable_info_get_arg(info, n)); } void rb_gi_callable_info_init(VALUE rb_mGI, VALUE rb_cGIBaseInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_CALLABLE_INFO, "CallableInfo", rb_mGI, rb_cGIBaseInfo); RG_DEF_METHOD(return_type, 0); RG_DEF_METHOD(caller_owns, 0); RG_DEF_METHOD_P(may_return_null, 0); RG_DEF_METHOD(n_args, 0); RG_DEF_METHOD(get_arg, 1); rb_gi_function_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_callback_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_signal_info_init(rb_mGI, RG_TARGET_NAMESPACE); rb_gi_vfunc_info_init(rb_mGI, RG_TARGET_NAMESPACE); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-interface-info.c��������0000644�0001750�0001750�00000012652�12121311640�030262� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIInterfaceInfo #define SELF(self) (RVAL2GI_INTERFACE_INFO(self)) GType gi_interface_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIInterfaceInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_n_prerequisites(VALUE self) { GIInterfaceInfo *info; info = SELF(self); return INT2NUM(g_interface_info_get_n_prerequisites(info)); } static VALUE rg_get_prerequisite(VALUE self, VALUE rb_n) { GIInterfaceInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_interface_info_get_prerequisite(info, n)); } static VALUE rg_n_properties(VALUE self) { GIInterfaceInfo *info; info = SELF(self); return INT2NUM(g_interface_info_get_n_properties(info)); } static VALUE rg_get_property(VALUE self, VALUE rb_n) { GIInterfaceInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_interface_info_get_property(info, n)); } static VALUE rg_n_methods(VALUE self) { GIInterfaceInfo *info; info = SELF(self); return INT2NUM(g_interface_info_get_n_methods(info)); } static VALUE rg_get_method(VALUE self, VALUE rb_n_or_name) { GIInterfaceInfo *info; GIFunctionInfo *function_info; info = SELF(self); if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) { gint n; n = NUM2INT(rb_n_or_name); function_info = g_interface_info_get_method(info, n); } else { const char *name; name = RVAL2CSTR(rb_n_or_name); function_info = g_interface_info_find_method(info, name); } return GI_BASE_INFO2RVAL_WITH_UNREF(function_info); } static VALUE rg_n_signals(VALUE self) { GIInterfaceInfo *info; info = SELF(self); return INT2NUM(g_interface_info_get_n_signals(info)); } static VALUE rg_get_signal(VALUE self, VALUE rb_n_or_name) { GIInterfaceInfo *info; GISignalInfo *signal_info; info = SELF(self); if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) { gint n; n = NUM2INT(rb_n_or_name); signal_info = g_interface_info_get_signal(info, n); } else { #ifdef HAVE_G_INTERFACE_INFO_FIND_SIGNAL const char *name; name = RVAL2CSTR(rb_n_or_name); signal_info = g_interface_info_find_signal(info, name); #else rb_raise(rb_eArgError, "g_interface_info_find_signal() is defined " "since GObjectIntrospection 1.34"); #endif } return GI_BASE_INFO2RVAL_WITH_UNREF(signal_info); } static VALUE rg_n_vfuncs(VALUE self) { GIInterfaceInfo *info; info = SELF(self); return INT2NUM(g_interface_info_get_n_vfuncs(info)); } static VALUE rg_get_vfunc(VALUE self, VALUE rb_n_or_name) { GIInterfaceInfo *info; GIVFuncInfo *vfunc_info; info = SELF(self); if (RB_TYPE_P(rb_n_or_name, T_FIXNUM)) { gint n; n = NUM2INT(rb_n_or_name); vfunc_info = g_interface_info_get_vfunc(info, n); } else { const gchar *name; name = RVAL2CSTR(rb_n_or_name); vfunc_info = g_interface_info_find_vfunc(info, name); } return GI_BASE_INFO2RVAL_WITH_UNREF(vfunc_info); } static VALUE rg_n_constants(VALUE self) { GIInterfaceInfo *info; info = SELF(self); return INT2NUM(g_interface_info_get_n_constants(info)); } static VALUE rg_get_constant(VALUE self, VALUE rb_n) { GIInterfaceInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_interface_info_get_constant(info, n)); } static VALUE rg_iface_struct(VALUE self) { GIInterfaceInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_interface_info_get_iface_struct(info)); } void rb_gi_interface_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_INTERFACE_INFO, "InterfaceInfo", rb_mGI, rb_cGIRegisteredTypeInfo); RG_DEF_METHOD(n_prerequisites, 0); RG_DEF_METHOD(get_prerequisite, 1); RG_DEF_METHOD(n_properties, 0); RG_DEF_METHOD(get_property, 1); RG_DEF_METHOD(n_methods, 0); RG_DEF_METHOD(get_method, 1); RG_DEF_METHOD(n_signals, 0); RG_DEF_METHOD(get_signal, 1); RG_DEF_METHOD(n_vfuncs, 0); RG_DEF_METHOD(get_vfunc, 1); RG_DEF_METHOD(n_constants, 0); RG_DEF_METHOD(get_constant, 1); RG_DEF_METHOD(iface_struct, 0); } ��������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-enum-info.c�������������0000644�0001750�0001750�00000006707�12121311640�027272� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIEnumInfo #define SELF(self) (RVAL2GI_ENUM_INFO(self)) GType gi_enum_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIEnumInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_n_values(VALUE self) { GIEnumInfo *info; info = SELF(self); return INT2NUM(g_enum_info_get_n_values(info)); } static VALUE rg_get_value(VALUE self, VALUE rb_n) { GIEnumInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_enum_info_get_value(info, n)); } static VALUE rg_values(VALUE self) { GIEnumInfo *info; gint i, n; VALUE rb_values; info = SELF(self); rb_values = rb_ary_new(); n = g_enum_info_get_n_values(info); for (i = 0; i < n; i++) { GIValueInfo *value_info; value_info = g_enum_info_get_value(info, i); rb_ary_push(rb_values, GI_BASE_INFO2RVAL_WITH_UNREF(value_info)); } return rb_values; } static VALUE rg_n_methods(VALUE self) { GIEnumInfo *info; info = SELF(self); return INT2NUM(g_enum_info_get_n_methods(info)); } static VALUE rg_get_method(VALUE self, VALUE rb_n) { GIEnumInfo *info; gint n; info = SELF(self); n = NUM2INT(rb_n); return GI_BASE_INFO2RVAL_WITH_UNREF(g_enum_info_get_method(info, n)); } static VALUE rg_methods(VALUE self) { GIEnumInfo *info; gint i, n; VALUE rb_methods; info = SELF(self); rb_methods = rb_ary_new(); n = g_enum_info_get_n_methods(info); for (i = 0; i < n; i++) { GIFunctionInfo *function_info; function_info = g_enum_info_get_method(info, i); rb_ary_push(rb_methods, GI_BASE_INFO2RVAL_WITH_UNREF(function_info)); } return rb_methods; } static VALUE rg_storage_type(VALUE self) { GIEnumInfo *info; info = SELF(self); return GI_TYPE_TAG2RVAL(g_enum_info_get_storage_type(info)); } void rb_gi_enum_info_init(VALUE rb_mGI, VALUE rb_cGIRegisteredTypeInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_ENUM_INFO, "EnumInfo", rb_mGI, rb_cGIRegisteredTypeInfo); RG_DEF_METHOD(n_values, 0); RG_DEF_METHOD(get_value, 1); RG_DEF_METHOD(values, 0); RG_DEF_METHOD(n_methods, 0); RG_DEF_METHOD(get_method, 1); RG_DEF_METHOD(methods, 0); RG_DEF_METHOD(storage_type, 0); rb_gi_flags_info_init(rb_mGI, RG_TARGET_NAMESPACE); } ���������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-vfunc-info.c������������0000644�0001750�0001750�00000004553�12121311640�027444� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGIVFuncInfo #define SELF(self) RVAL2GI_BASE_INFO(self) GType gi_vfunc_info_get_type(void) { static GType type = 0; if (type == 0) { type = g_boxed_type_register_static("GIVFuncInfo", (GBoxedCopyFunc)g_base_info_ref, (GBoxedFreeFunc)g_base_info_unref); } return type; } static VALUE rg_flags(VALUE self) { GIVFuncInfo *info; info = SELF(self); return GI_VFUNC_INFO_FLAGS2RVAL(g_vfunc_info_get_flags(info)); } static VALUE rg_offset(VALUE self) { GIVFuncInfo *info; info = SELF(self); return INT2NUM(g_vfunc_info_get_offset(info)); } static VALUE rg_signal(VALUE self) { GIVFuncInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_vfunc_info_get_signal(info)); } static VALUE rg_invoker(VALUE self) { GIVFuncInfo *info; info = SELF(self); return GI_BASE_INFO2RVAL_WITH_UNREF(g_vfunc_info_get_invoker(info)); } void rb_gi_vfunc_info_init(VALUE rb_mGI, VALUE rb_cGICallableInfo) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS_WITH_PARENT(GI_TYPE_VFUNC_INFO, "VFuncInfo", rb_mGI, rb_cGICallableInfo); rb_define_const(RG_TARGET_NAMESPACE, "UNKNOWN_OFFSET", INT2NUM(0xFFFF)); RG_DEF_METHOD(flags, 0); RG_DEF_METHOD(offset, 0); RG_DEF_METHOD(signal, 0); RG_DEF_METHOD(invoker, 0); G_DEF_CLASS(G_TYPE_IV_FUNC_INFO_FLAGS, "VFuncInfoFlags", rb_mGI); } �����������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/ext/gobject-introspection/rb-gi-type-tag.c��������������0000644�0001750�0001750�00000002423�12121311640�027116� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2012 Ruby-GNOME2 Project Team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include "rb-gi-private.h" #define RG_TARGET_NAMESPACE rb_cGITypeTag #define SELF(self) (RVAL2GI_TYPE_TAG(self)) static VALUE rg_to_s(VALUE self) { GITypeTag tag; tag = SELF(self); return CSTR2RVAL(g_type_tag_to_string(tag)); } void rb_gi_type_tag_init(VALUE rb_mGI) { VALUE RG_TARGET_NAMESPACE; RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_I_TYPE_TAG, "TypeTag", rb_mGI); RG_DEF_METHOD(to_s, 0); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/COPYING.LIB���������������������������������������������0000644�0001750�0001750�00000063642�12067770242�020601� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! ����������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/lib/����������������������������������������������������0000755�0001750�0001750�00000000000�12147676243�017701� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection.rb����������������������������0000644�0001750�0001750�00000003610�12147676243�024541� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "glib2" module GObjectIntrospection class << self def prepend_typelib_path(path) GLib.prepend_path_to_environment_variable(path, "GI_TYPELIB_PATH") end end end base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) begin major, minor, _ = RUBY_VERSION.split(/\./) require "#{major}.#{minor}/gobject_introspection.so" rescue LoadError require "gobject_introspection.so" end vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) module GObjectIntrospection LOG_DOMAIN = "GObjectIntrospection" end GLib::Log.set_log_domain(GObjectIntrospection::LOG_DOMAIN) require "gobject-introspection/repository" require "gobject-introspection/callable-info" require "gobject-introspection/object-info" require "gobject-introspection/interface-info" require "gobject-introspection/struct-info" require "gobject-introspection/boxed-info" require "gobject-introspection/union-info" require "gobject-introspection/loader" ������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection/������������������������������0000755�0001750�0001750�00000000000�12147676243�024214� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection/interface-info.rb�������������0000644�0001750�0001750�00000002217�12077252562�027430� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gobject-introspection/collection-reader" module GObjectIntrospection class InterfaceInfo extend CollectionReader alias_method :__methods__, :methods collection_reader("prerequisites") collection_reader("properties") collection_reader("methods") collection_reader("signals") collection_reader("vfuncs") collection_reader("constants") end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection/union-info.rb�����������������0000644�0001750�0001750�00000001774�12077252562�026627� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gobject-introspection/collection-reader" module GObjectIntrospection class UnionInfo extend CollectionReader alias_method :__methods__, :methods collection_reader("fields") collection_reader("methods") end end ����ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection/object-info.rb����������������0000644�0001750�0001750�00000002251�12067770242�026733� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gobject-introspection/collection-reader" module GObjectIntrospection class ObjectInfo extend CollectionReader alias_method :__methods__, :methods collection_reader("interfaces") collection_reader("fields") collection_reader("properties") collection_reader("methods") collection_reader("signals") collection_reader("vfuncs") collection_reader("constants") end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection/boxed-info.rb�����������������0000644�0001750�0001750�00000001774�12147676243�026604� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gobject-introspection/collection-reader" module GObjectIntrospection class BoxedInfo extend CollectionReader alias_method :__methods__, :methods collection_reader("fields") collection_reader("methods") end end ����ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection/loader.rb���������������������0000644�0001750�0001750�00000026037�12147676243�026017� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module GObjectIntrospection class Loader class << self def load(namespace, base_module, options={}) loader = new(base_module) loader.version = options[:version] loader.load(namespace) end end attr_accessor :version def initialize(base_module) @base_module = base_module @version = nil end def load(namespace) repository = Repository.default repository.require(namespace, @version) pre_load(repository, namespace) repository.each(namespace) do |info| load_info(info) end post_load(repository, namespace) end private def pre_load(repository, namespace) end def post_load(repository, namespace) end def load_info(info) case info when FunctionInfo load_function_info(info) when StructInfo load_struct_info(info) when BoxedInfo load_boxed_info(info) when FlagsInfo load_flags_info(info) when EnumInfo load_enum_info(info) when ObjectInfo load_object_info(info) when InterfaceInfo load_interface_info(info) when ConstantInfo load_constant_info(info) when UnionInfo load_union_info(info) end end def load_function_info(info) name = rubyish_method_name(info) define_module_function(@base_module, name, info) end def define_module_function(target_module, name, function_info) unlock_gvl = should_unlock_gvl?(function_info, target_module) validate = lambda do |arguments| method_name = "#{target_module}\#.#{name}" validate_arguments(function_info, method_name, arguments) end target_module.module_eval do define_method(name) do |*arguments, &block| validate.call(arguments, &block) function_info.invoke({ :arguments => arguments, :unlock_gvl => unlock_gvl, }, &block) end module_function(name) end end def define_struct(info, options={}) if info.gtype == GLib::Type::NONE klass = self.class.define_struct(info.size, info.name, @base_module, :parent => options[:parent]) else klass = self.class.define_class(info.gtype, info.name, @base_module, :parent => options[:parent]) end load_fields(info, klass) load_methods(info, klass) end def load_struct_info(info) return if info.gtype_struct? define_struct(info) end def define_boxed(info) klass = self.class.define_class(info.gtype, info.name, @base_module) # TODO # load_fields(info, klass) # load_methods(info, klass) end def load_boxed_info(info) define_boxed(info) end def load_enum_value(value_info, enum_module) enum_module.const_set(value_info.name.upcase, value_info.value) end def load_enum_info(info) if info.gtype == GLib::Type::NONE enum_module = Module.new info.values.each do |value_info| load_enum_value(value_info, enum_module) end @base_module.const_set(info.name, enum_module) else self.class.define_class(info.gtype, info.name, @base_module) end end def load_flag_value(value_info, flags_module) flags_module.const_set(value_info.name.upcase, value_info.value) end def load_flags_info(info) if info.gtype == GLib::Type::NONE flags_module = Module.new info.values.each do |value_info| load_flag_value(value_info, flags_module) end @base_module.const_set(info.name, flags_module) else self.class.define_class(info.gtype, info.name, @base_module) end end def load_object_info(info) klass = self.class.define_class(info.gtype, info.name, @base_module) load_fields(info, klass) load_methods(info, klass) end def load_fields(info, klass) info.n_fields.times do |i| field_info = info.get_field(i) load_field(info, i, field_info, klass) end end def load_field(info, i, field_info, klass) name = field_info.name flags = field_info.flags if flags.readable? klass.__send__(:define_method, name) do || info.get_field_value(self, i) end end if flags.writable? klass.__send__(:define_method, "#{name}=") do |value| info.set_field_value(self, i, value) end end end def load_methods(info, klass) grouped_methods = info.methods.group_by do |method_info| method_info.class end grouped_methods.each do |method_info_class, method_infos| next if method_infos.empty? case method_infos.first when ConstructorInfo load_constructor_infos(method_infos, klass) when MethodInfo load_method_infos(method_infos, klass) when FunctionInfo load_function_infos(method_infos, klass) else raise "TODO: #{method_info_class}" end end end def load_constructor_infos(infos, klass) return if infos.empty? validate = lambda do |info, method_name, arguments| validate_arguments(info, "#{klass}\##{method_name}", arguments) end infos.each do |info| name = "initialize_#{info.name}" unlock_gvl = should_unlock_gvl?(info, klass) klass.__send__(:define_method, name) do |*arguments, &block| validate.call(info, name, arguments, &block) info.invoke({ :receiver => self, :arguments => arguments, :unlock_gvl => unlock_gvl, }, &block) end klass.__send__(:private, name) end find_info = lambda do |arguments| find_suitable_callable_info(infos, arguments) end klass.__send__(:define_method, "initialize") do |*arguments, &block| info = find_info.call(arguments, &block) __send__("initialize_#{info.name}", *arguments, &block) end end def validate_arguments(info, method_name, arguments) n_in_args = info.n_in_args n_required_in_args = info.n_required_in_args return if (n_required_in_args..n_in_args).cover?(arguments.size) detail = "#{arguments.size} for " if n_in_args == n_required_in_args detail << "#{info.n_in_args}" else detail << "#{info.n_required_in_args}..#{info.n_in_args}" end message = "#{method_name}: wrong number of arguments (#{detail})" raise ArgumentError, message end def find_suitable_callable_info(infos, arguments) min_n_args = nil max_n_args = nil infos.each do |info| if arguments.size == info.n_in_args return info end n_in_args = info.n_in_args min_n_args = [min_n_args || n_in_args, n_in_args].min max_n_args = [max_n_args || n_in_args, n_in_args].max end detail = "#{arguments.size} for #{min_n_args}" if min_n_args < max_n_args detail << "..#{max_n_args}" end raise ArgumentError, "wrong number of arguments (#{detail})" end def rubyish_method_name(function_info) name = function_info.name return_type = function_info.return_type if return_type.tag == GObjectIntrospection::TypeTag::BOOLEAN case name when /\A(?:is|get_is|get)_/ "#{$POSTMATCH}?" when /\A(?:has|use)_/ "#{name}?" else name end elsif /\Aget_/ =~ name and function_info.n_in_args.zero? $POSTMATCH else case name when "to_string" "to_s" when "foreach" "each" else name end end end def should_unlock_gvl?(function_info, klass) false end def load_method_infos(infos, klass) infos.each do |info| method_name = rubyish_method_name(info) load_method_info(info, klass, method_name) if /\Aset_/ =~ method_name and info.n_args == 1 klass.__send__(:alias_method, "#{$POSTMATCH}=", method_name) end end end def load_method_info(info, klass, method_name) unlock_gvl = should_unlock_gvl?(info, klass) validate = lambda do |arguments| validate_arguments(info, "#{klass}\##{method_name}", arguments) end klass.__send__(:define_method, method_name) do |*arguments, &block| validate.call(arguments, &block) if block.nil? and info.require_callback? Enumerator.new(self, method_name, *arguments) else info.invoke({ :receiver => self, :arguments => arguments, :unlock_gvl => unlock_gvl, }, &block) end end end def load_function_infos(infos, klass) infos.each do |info| name = rubyish_method_name(info) next if name == "new" next if name == "alloc" unlock_gvl = should_unlock_gvl?(info, klass) validate = lambda do |arguments| validate_arguments(info, "#{klass}.#{name}", arguments) end singleton_class = (class << klass; self; end) singleton_class.__send__(:define_method, name) do |*arguments, &block| validate.call(arguments, &block) if block.nil? and info.require_callback? Enumerator.new(self, name, *arguments) else info.invoke({ :arguments => arguments, :unlock_gvl => unlock_gvl, }, &block) end end end end def load_interface_info(info) interface_module = self.class.define_interface(info.gtype, info.name, @base_module) load_methods(info, interface_module) end def load_constant_info(info) @base_module.const_set(info.name, info.value) end def load_union_info(info) klass = self.class.define_class(info.gtype, info.name, @base_module) load_fields(info, klass) load_methods(info, klass) end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection/callable-info.rb��������������0000644�0001750�0001750�00000004506�12121311640�027211� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gobject-introspection/collection-reader" module GObjectIntrospection class CallableInfo extend CollectionReader collection_reader("args") def in_args callback_indexes = [] closure_indexes = [] destroy_indexes = [] args.each_with_index do |arg, i| next if arg.scope == ScopeType::INVALID callback_indexes << i closure_index = arg.closure closure_indexes << closure_index if closure_index != -1 destroy_index = arg.destroy destroy_indexes << destroy_index if destroy_index != -1 end args.find_all.with_index do |arg, i| case arg.direction when Direction::IN, Direction::INOUT if callback_indexes.include?(i) false elsif closure_indexes.include?(i) false elsif destroy_indexes.include?(i) false else true end else false end end end def required_in_args in_args.reject do |arg| arg.may_be_null? end end def n_in_args in_args.size end def n_required_in_args required_in_args.size end def require_callback? args.any? do |arg| arg.direction == Direction::IN and arg.scope != ScopeType::INVALID end end def out_args args.find_all do |arg| case arg.direction when Direction::OUT, Direction::INOUT true else false end end end def n_out_args out_args.size end end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection/repository.rb�����������������0000644�0001750�0001750�00000002130�12067770242�026747� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module GObjectIntrospection class Repository include Enumerable def each(*namespaces) if namespaces.empty? namespaces = loaded_namespaces end namespaces.each do |namespace| get_n_infos(namespace).times do |i| yield(get_info(namespace, i)) end end end end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection/collection-reader.rb����������0000644�0001750�0001750�00000002256�12067770242�030134� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA module GObjectIntrospection module CollectionReader def collection_reader(name) n_getter = "n_#{name}" if name.end_with?("ies") singular = name.sub(/ies\z/, "y") else singular = name.sub(/s\z/, "") end getter = "get_#{singular}" define_method(name) do send(n_getter).times.collect do |i| send(getter, i) end end end end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/lib/gobject-introspection/struct-info.rb����������������0000644�0001750�0001750�00000001775�12067770242�027023� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "gobject-introspection/collection-reader" module GObjectIntrospection class StructInfo extend CollectionReader alias_method :__methods__, :methods collection_reader("fields") collection_reader("methods") end end ���ruby-gnome2-all-2.1.0/gobject-introspection/README.md�����������������������������������������������0000644�0001750�0001750�00000001055�12077252562�020407� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Ruby/GObjectIntrospection Ruby/GObjectIntrospection is a Ruby binding of GObject Introspect. ## Requirements * Ruby/GLib2 in [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) * [GObject Introspection](http://live.gnome.org/GObjectIntrospection) ## Install gem install gobject-introspection ## License Copyright (c) 2013 Ruby-GNOME2 Project Team This program is free software. You can distribute/modify this program under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. ## Project Website http://ruby-gnome2.sourceforge.jp/ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/extconf.rb����������������������������������������������0000755�0001750�0001750�00000004047�12067770242�021131� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "pathname" require "mkmf" require "rbconfig" require "fileutils" module_name = "gobject_introspection" package = "gobject-introspection" base_dir = Pathname(__FILE__).dirname.expand_path ext_dir = base_dir + "ext" + package mkmf_gnome2_dir = base_dir + 'lib' if RbConfig.respond_to?(:ruby) ruby = RbConfig.ruby else ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG["EXEEXT"]) end build_dir = Pathname("ext") + package FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist? extconf_rb_path = ext_dir + "extconf.rb" unless system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) exit(false) end create_makefile(module_name) FileUtils.mv("Makefile", "Makefile.lib") File.open("Makefile", "w") do |makefile| makefile.puts(<<-EOM) all: (cd ext/#{package} && $(MAKE)) $(MAKE) -f Makefile.lib install: (cd ext/#{package} && $(MAKE) install) $(MAKE) -f Makefile.lib install site-install: (cd ext/#{package} && $(MAKE) site-install) $(MAKE) -f Makefile.lib site-install clean: (cd ext/#{package} && $(MAKE) clean) $(MAKE) -f Makefile.lib clean distclean: (cd ext/#{package} && $(MAKE) distclean) $(MAKE) -f Makefile.lib distclean @rm -f Makefile.lib EOM end �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/Rakefile������������������������������������������������0000644�0001750�0001750�00000007420�12257552167�020603� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- ruby -*- # # Copyright (C) 2012-2013 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA $LOAD_PATH.unshift("./../glib2/lib") require "gnome2/rake/package-task" package_task = GNOME2::Rake::PackageTask.new do |package| package.summary = "Ruby/GObjectIntrospection is a Ruby binding of GObjectIntrospection." package.description = "Ruby/GObjectIntrospection is a Ruby binding of GObjectIntrospection." package.dependency.gem.runtime = ["glib2"] package.dependency.gem.development = [["test-unit", ">= 2"]] package.windows.packages = [] package.windows.dependencies = [] package.windows.build_dependencies = ["glib2"] package.external_packages = [ { :name => "glib", :download_site => :gnome, :label => "GLib", :version => "2.38.2", :compression_method => "xz", :windows => { :build => false, }, :native => { :build => true, :need_autoreconf => true, :built_file => "lib/libglib-2.0.so", }, }, { :name => "gobject-introspection", :download_site => :gnome, :label => "gobject-introspection", :version => "1.38.0", :compression_method => "xz", :windows => { :configure_args => [ "--with-g-ir-scanner=#{package.native.absolute_binary_dir}/bin/g-ir-scanner", "--disable-tests", ], :patches => [ "0001-Support-external-g-ir-scanner.patch", ], :need_autoreconf => true, :built_file => "bin/libgirepository-1.0-1.dll", }, :native => { :build => true, :patches => [ # "cross-compilable-g-ir-scanner.diff", ], :built_file => "bin/g-ir-scanner", } }, ] end package_task.define namespace :native do namespace :"gobject-introspection" do desc "Make g-ir-scanner workable for Windows on non Windows" task :cross do g_ir_scanner_dir = package_task.native.absolute_binary_dir g_ir_scanner_dir += "lib/gobject-introspection/giscanner" Dir.chdir(g_ir_scanner_dir.to_s) do patch = "#{package_task.package.patches_dir}/cross-g-ir-scanner.diff" sh("patch -p2 < #{patch}") end end end namespace :builder do task :after => "native:gobject-introspection:cross" end end namespace :win32 do namespace :"gobject-introspection" do desc "Use native tools" task :cross do pkg_config_dir = package_task.windows.absolute_binary_dir + "lib/pkgconfig" pc_path = pkg_config_dir + "gobject-introspection-1.0.pc" original_pc = pc_path.read new_pc = "" new_pc << "native_prefix=#{package_task.native.absolute_binary_dir}\n" new_pc << "native_bindir=${native_prefix}/bin\n" original_pc.each_line do |line| case line when /\Ag_ir_(scanner|compiler)=/ new_pc << line.gsub(/\${bindir}/, "${native_bindir}") else new_pc << line end end pc_path.open("w") do |pc_file| pc_file.write(new_pc) end end end namespace :builder do task :after => "win32:gobject-introspection:cross" end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/���������������������������������������������������0000755�0001750�0001750�00000000000�12257552167�020112� 5����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-type-info.rb����������������������������������0000644�0001750�0001750�00000003543�12067770242�023326� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestTypeInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") @function_info = @repository.find("GObject", "signal_list_ids") @info = @function_info.return_type end def test_pointer? assert_true(@info.pointer?) end def test_tag assert_kind_of(GObjectIntrospection::TypeTag, @info.tag) end def test_param_type assert_kind_of(GObjectIntrospection::TypeInfo, @info.get_param_type(0)) end def test_interface function_info = @repository.find("GObject", "type_class_ref") info = function_info.return_type assert_kind_of(GObjectIntrospection::StructInfo, info.interface) end def test_array_length assert_equal(1, @info.array_length) end def test_array_fixed_size assert_equal(-1, @info.array_fixed_size) end def test_zero_terminated? assert_false(@info.zero_terminated?) end def test_array_type assert_equal(GObjectIntrospection::ArrayType::C, @info.array_type) end end �������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-union-info.rb���������������������������������0000644�0001750�0001750�00000001546�12067770242�023476� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestUnionInfo < Test::Unit::TestCase def setup # TODO: find UnionInfo end end ����������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-interface-info.rb�����������������������������0000644�0001750�0001750�00000005420�12067770242�024301� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestInterfaceInfo < Test::Unit::TestCase include GObjectIntrospectionTestUtils def setup @repository = GObjectIntrospection::Repository.default @repository.require("Gio") @info = @repository.find("Gio", "TlsServerConnection") end def test_n_prerequisites assert_equal(1, @info.n_prerequisites) end def test_prerequisite assert_kind_of(GObjectIntrospection::ObjectInfo, @info.get_prerequisite(0)) end def test_n_properties assert_equal(1, @info.n_properties) end def test_propertiy assert_kind_of(GObjectIntrospection::PropertyInfo, @info.get_property(0)) end def test_n_methods assert_equal(1, @info.n_methods) end def test_get_method_n assert_kind_of(GObjectIntrospection::FunctionInfo, @info.get_method(0)) end def test_get_method_name assert_kind_of(GObjectIntrospection::FunctionInfo, @info.get_method("new")) end def test_n_signals info = @repository.find("Gio", "Volume") assert_equal(2, info.n_signals) end def test_get_signal_n info = @repository.find("Gio", "Volume") assert_kind_of(GObjectIntrospection::SignalInfo, info.get_signal(0)) end def test_get_signal_name require_version(1, 34, 0) info = @repository.find("Gio", "Volume") assert_kind_of(GObjectIntrospection::FunctionInfo, info.get_signal("changed")) end def test_n_vfuncs info = @repository.find("Gio", "Volume") assert_operator(0, :<, info.n_vfuncs) end def test_get_vfunc_n info = @repository.find("Gio", "Volume") assert_kind_of(GObjectIntrospection::VFuncInfo, info.get_vfunc(0)) end def test_get_vfunc_name info = @repository.find("Gio", "Volume") assert_kind_of(GObjectIntrospection::VFuncInfo, info.get_vfunc("can_eject")) end def test_iface_struct assert_kind_of(GObjectIntrospection::StructInfo, @info.iface_struct) end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-enum-info.rb����������������������������������0000644�0001750�0001750�00000003342�12067770242�023306� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestEnumInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("Gio") @info = @repository.find("Gio", "ResourceError") end def test_n_values assert_equal(2, @info.n_values) end def test_value assert_kind_of(GObjectIntrospection::ValueInfo, @info.get_value(0)) end def test_values assert_equal([GObjectIntrospection::ValueInfo] * @info.n_values, @info.values.collect(&:class)) end def test_n_methods assert_equal(1, @info.n_methods) end def test_method assert_kind_of(GObjectIntrospection::FunctionInfo, @info.get_method(0)) end def test_methods assert_equal([GObjectIntrospection::FunctionInfo] * @info.n_methods, @info.methods.collect(&:class)) end def test_storage_type assert_equal(GObjectIntrospection::TypeTag::UINT32, @info.storage_type) end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-arg-info.rb�����������������������������������0000644�0001750�0001750�00000003566�12077252562�023124� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestArgInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") @callable_info = @repository.find("GObject", "signal_name") @info = @callable_info.get_arg(0) end def test_direction assert_equal(GObjectIntrospection::Direction::IN, @info.direction) end def test_caller_allocate? assert_false(@info.caller_allocates?) end def test_return_value? assert_false(@info.return_value?) end def test_optional? assert_false(@info.optional?) end def test_may_be_null? assert_false(@info.may_be_null?) end def test_ownership_transfer assert_equal(GObjectIntrospection::Transfer::NOTHING, @info.ownership_transfer) end def test_scope assert_equal(GObjectIntrospection::ScopeType::INVALID, @info.scope) end def test_closure assert_equal(-1, @info.closure) end def test_destroy assert_equal(-1, @info.destroy) end def test_type assert_kind_of(GObjectIntrospection::TypeInfo, @info.type) end end ������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-repository.rb���������������������������������0000644�0001750�0001750�00000003545�12067770242�023635� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestRepository < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") @repository.require("Gio") end def test_get_n_infos assert_kind_of(Integer, @repository.get_n_infos("GObject")) end def test_get_info assert_kind_of(GObjectIntrospection::BaseInfo, @repository.get_info("GObject", 0)) end def test_get_dependencies assert_equal(["GLib-2.0", "GObject-2.0"].sort, @repository.get_dependencies("Gio").sort) end def test_loaded_namespaces assert_equal(["GLib", "GObject", "Gio"].sort, @repository.loaded_namespaces.sort) end def test_enumerable namespaces = @repository.collect do |info| info.namespace end assert_equal(["GLib", "GObject", "Gio"].sort, namespaces.uniq.sort) end def test_find_by_gtype info = @repository.find(GLib::Object.gtype) assert_equal("Object", info.name) end def test_find_by_name info = @repository.find("GObject", "Object") assert_equal("Object", info.name) end end �����������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-type-tag.rb�����������������������������������0000644�0001750�0001750�00000002155�12067770242�023144� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestTypeTag < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") @function_info = @repository.find("GObject", "signal_list_ids") @type_info = @function_info.return_type @tag = @type_info.tag end def test_to_s assert_equal("array", @tag.to_s) end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-loader.rb�������������������������������������0000644�0001750�0001750�00000002255�12067770242�022661� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestLoaderInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("Gio") @info = @repository.find("Gio", "Application") @sandbox = Module.new end def test_define_class gtype = @info.gtype GObjectIntrospection::Loader.define_class(gtype, "Application", @sandbox) assert_equal(gtype, @sandbox::Application.gtype) end end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-struct-info.rb��������������������������������0000644�0001750�0001750�00000003112�12067770242�023661� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestStructInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") @info = @repository.find("GObject", "Value") end def test_n_fields assert_equal(2, @info.n_fields) end def test_get_field assert_kind_of(GObjectIntrospection::FieldInfo, @info.get_field(0)) end def test_n_methods assert_equal(62, @info.n_methods) end def test_get_method assert_kind_of(GObjectIntrospection::FunctionInfo, @info.get_method(0)) end def test_size assert_equal(24, @info.size) end def test_alignment assert_equal(8, @info.alignment) end def test_gtype_struct? assert_false(@info.gtype_struct?) end def test_foreign? assert_false(@info.foreign?) end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-flags-info.rb���������������������������������0000644�0001750�0001750�00000002064�12067770242�023436� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestFlagsInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") end def test_class assert_kind_of(GObjectIntrospection::FlagsInfo, @repository.find("GObject", "SignalFlags")) end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-registered-type-info.rb�����������������������0000644�0001750�0001750�00000002342�12067770242�025455� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestRegisteredTypeInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") @info = @repository.find("GObject", "TypePlugin") end def test_type_name assert_equal("GTypePlugin", @info.type_name) end def test_type_init assert_equal("g_type_plugin_get_type", @info.type_init) end def test_gtype assert_equal(GLib::Type.new("GTypePlugin"), @info.gtype) end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-property-info.rb������������������������������0000644�0001750�0001750�00000002513�12067770242�024225� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestPropertyInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("Gio") @object_info = @repository.find("Gio", "Application") @info = @object_info.get_property(0) end def test_flags assert_equal(GLib::Param::WRITABLE, @info.flags) end def test_type assert_kind_of(GObjectIntrospection::TypeInfo, @info.type) end def test_ownership_transfer assert_equal(GObjectIntrospection::Transfer::NOTHING, @info.ownership_transfer) end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-constant-info.rb������������������������������0000644�0001750�0001750�00000001776�12067770242�024204� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestConstantInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") # TODO: find ConstantInfo # @info = @repository.find("GObject", "Object") end end ��ruby-gnome2-all-2.1.0/gobject-introspection/test/run-test.rb����������������������������������������0000755�0001750�0001750�00000003164�12067770242�022222� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..") ruby_gnome2_base = File.expand_path(ruby_gnome2_base) glib_base = File.join(ruby_gnome2_base, "glib2") gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection") modules = [ [glib_base, "glib2"], [gobject_introspection_base, "gobject-introspection"] ] modules.each do |target, module_name| if system("which make > /dev/null") `make -C #{target.dump} > /dev/null` or exit(false) end $LOAD_PATH.unshift(File.join(target, "ext", module_name)) $LOAD_PATH.unshift(File.join(target, "lib")) end $LOAD_PATH.unshift(File.join(glib_base, "test")) require "glib-test-init" $LOAD_PATH.unshift(File.join(gobject_introspection_base, "test")) require "gobject-introspection-test-utils" require "gobject-introspection" exit Test::Unit::AutoRunner.run(true) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-function-info.rb������������������������������0000644�0001750�0001750�00000002536�12257552167�024200� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestFunctionInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") @info = @repository.find("GObject", "signal_name") end def test_symbol assert_equal("g_signal_name", @info.symbol) end def test_flags assert_equal(GObjectIntrospection::FunctionInfoFlags.new(0), @info.flags) end def test_invoke # TODO: "#invoke" expects Array. We should confirm specification. #assert_equal("notify", @info.invoke(1)) assert_equal("notify", @info.invoke([1])) end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-callable-info.rb������������������������������0000644�0001750�0001750�00000002777�12077252562�024115� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCallableInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") @info = @repository.find("GObject", "signal_name") end def test_return_type assert_kind_of(GObjectIntrospection::TypeInfo, @info.return_type) end def test_caller_owns assert_equal(GObjectIntrospection::Transfer::NOTHING, @info.caller_owns) end def test_may_return_null? assert_false(@info.may_return_null?) end def test_n_args assert_equal(1, @info.n_args) end def test_get_arg assert_equal("signal_id", @info.get_arg(0).name) end def test_args assert_equal(["signal_id"], @info.args.collect(&:name)) end end �ruby-gnome2-all-2.1.0/gobject-introspection/test/test-base-info.rb����������������������������������0000644�0001750�0001750�00000002141�12067770242�023250� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestBaseInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") @info = @repository.find("GObject", "Object") end def test_name assert_equal("Object", @info.name) end def test_namespace assert_equal("GObject", @info.namespace) end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-callback-info.rb������������������������������0000644�0001750�0001750�00000002130�12067770242�024070� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestCallbackInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("Gio") @info = @repository.find("Gio", "AsyncReadyCallback") end def test_name assert_equal(GObjectIntrospection::Transfer::NOTHING, @info.caller_owns) end end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/gobject-introspection-test-utils.rb����������������0000644�0001750�0001750�00000002067�12067770242�027065� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "test-unit" require "test/unit/notify" module GObjectIntrospectionTestUtils def require_version(major, minor, micro) if (GObjectIntrospection::BUILD_VERSION <=> [major, minor, micro]) < 0 omit("require GObjectIntrospection #{major}.#{minor}.#{micro} or later.") end end end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-field-type.rb���������������������������������0000644�0001750�0001750�00000002534�12067770242�023455� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestFieldInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("Gio") @object_info = @repository.find("Gio", "FileOutputStream") @info = @object_info.get_field(0) end def test_flags assert_equal(GObjectIntrospection::FieldInfoFlags::READABLE, @info.flags) end def test_size assert_equal(0, @info.size) end def test_offset assert_equal(0, @info.offset) end def test_type assert_kind_of(GObjectIntrospection::TypeInfo, @info.type) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-vfunc-info.rb���������������������������������0000644�0001750�0001750�00000002543�12067770242�023465� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestVFuncInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("Gio") @object_info = @repository.find("Gio", "FileOutputStream") @info = @object_info.get_vfunc(0) end def test_flags assert_equal(GObjectIntrospection::VFuncInfoFlags.new, @info.flags) end def test_offset assert_equal(GObjectIntrospection::VFuncInfo::UNKNOWN_OFFSET, @info.offset) end def test_signal assert_nil(@info.signal) end def test_invoker assert_nil(@info.invoker) end end �������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-signal-info.rb��������������������������������0000644�0001750�0001750�00000002376�12067770242�023625� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestSignalInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("Gio") @object_info = @repository.find("Gio", "Application") @info = @object_info.get_signal(0) end def test_flags assert_equal(GLib::SignalFlags::RUN_CLEANUP, @info.flags) end def test_class_closure assert_nil(@info.class_closure) end def test_true_stops_emit? assert_false(@info.true_stops_emit?) end end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-object-info.rb��������������������������������0000644�0001750�0001750�00000006446�12067770242�023620� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestObjectInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("Gio") @info = @repository.find("Gio", "FileOutputStream") end def test_type_name assert_equal("GFileOutputStream", @info.type_name) end def test_type_init assert_equal("g_file_output_stream_get_type", @info.type_init) end def test_abstract? assert_false(@info.abstract?) end def test_fundamental? assert_false(@info.fundamental?) end def test_parent assert_equal("OutputStream", @info.parent.name) end def test_n_interfaces assert_equal(1, @info.n_interfaces) end def test_get_interface assert_kind_of(GObjectIntrospection::InterfaceInfo, @info.get_interface(0)) end def test_n_fields assert_equal(2, @info.n_fields) end def test_get_field assert_kind_of(GObjectIntrospection::FieldInfo, @info.get_field(0)) end def test_n_properties info = @repository.find("Gio", "BufferedOutputStream") assert_equal(2, info.n_properties) end def test_get_property info = @repository.find("Gio", "BufferedOutputStream") assert_kind_of(GObjectIntrospection::PropertyInfo, info.get_property(0)) end def test_n_methods assert_equal(4, @info.n_methods) end def test_get_method_n assert_kind_of(GObjectIntrospection::FunctionInfo, @info.get_method(0)) end def test_get_method_name assert_kind_of(GObjectIntrospection::FunctionInfo, @info.get_method("get_etag")) end def test_n_signals info = @repository.find("Gio", "Application") assert_equal(5, info.n_signals) end def test_get_signal info = @repository.find("Gio", "Application") assert_kind_of(GObjectIntrospection::SignalInfo, info.get_signal(0)) end def test_n_vfuncs assert_equal(9, @info.n_vfuncs) end def test_get_vfunc_n assert_kind_of(GObjectIntrospection::VFuncInfo, @info.get_vfunc(0)) end def test_get_vfunc_name assert_kind_of(GObjectIntrospection::VFuncInfo, @info.get_vfunc("can_seek")) end def test_n_constants assert_equal(0, @info.n_constants) end def test_unref_function assert_nil(@info.unref_function) end def test_ref_function assert_nil(@info.ref_function) end def test_set_value_function assert_nil(@info.set_value_function) end def test_get_value_function assert_nil(@info.get_value_function) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-boxed-info.rb���������������������������������0000644�0001750�0001750�00000001546�12067770242�023447� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestBoxedInfo < Test::Unit::TestCase def setup # TODO: find BoxedInfo end end ����������������������������������������������������������������������������������������������������������������������������������������������������������ruby-gnome2-all-2.1.0/gobject-introspection/test/test-value-info.rb���������������������������������0000644�0001750�0001750�00000002104�12067770242�023451� 0����������������������������������������������������������������������������������������������������ustar �kou�����������������������������kou��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2012 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA class TestValueInfo < Test::Unit::TestCase def setup @repository = GObjectIntrospection::Repository.default @repository.require("GObject") @flags_info = @repository.find("GObject", "SignalFlags") @info = @flags_info.get_value(0) end def test_value assert_equal(1, @info.value) end end ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������