gtk3 0.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +32 -0
- data/ext/gtk3/conversions.c +34 -0
- data/ext/gtk3/depend +11 -0
- data/ext/gtk3/extconf.rb +108 -0
- data/ext/gtk3/gtk3.def +10 -0
- data/ext/gtk3/init.c +38 -0
- data/ext/gtk3/rbgdkdisplay.c +39 -0
- data/ext/gtk3/rbgdkdragcontext.c +108 -0
- data/ext/gtk3/rbgdkevent.c +38 -0
- data/ext/gtk3/rbgdkscreen.c +61 -0
- data/ext/gtk3/rbgtk.c +625 -0
- data/ext/gtk3/rbgtk3.h +57 -0
- data/ext/gtk3/rbgtk3conversions.h +347 -0
- data/ext/gtk3/rbgtk3private.h +282 -0
- data/ext/gtk3/rbgtk3util.c +67 -0
- data/ext/gtk3/rbgtk3util.h +32 -0
- data/ext/gtk3/rbgtkaboutdialog.c +117 -0
- data/ext/gtk3/rbgtkaccelerator.c +78 -0
- data/ext/gtk3/rbgtkaccelgroup.c +199 -0
- data/ext/gtk3/rbgtkaccelgroupentry.c +93 -0
- data/ext/gtk3/rbgtkaccelkey.c +119 -0
- data/ext/gtk3/rbgtkaccellabel.c +55 -0
- data/ext/gtk3/rbgtkaccelmap.c +135 -0
- data/ext/gtk3/rbgtkaccessible.c +56 -0
- data/ext/gtk3/rbgtkaction.c +205 -0
- data/ext/gtk3/rbgtkactiongroup.c +466 -0
- data/ext/gtk3/rbgtkactivatable.c +30 -0
- data/ext/gtk3/rbgtkadjustment.c +98 -0
- data/ext/gtk3/rbgtkalignment.c +75 -0
- data/ext/gtk3/rbgtkallocation.c +166 -0
- data/ext/gtk3/rbgtkappchooser.c +47 -0
- data/ext/gtk3/rbgtkappchooserbutton.c +70 -0
- data/ext/gtk3/rbgtkappchooserdialog.c +68 -0
- data/ext/gtk3/rbgtkappchooserwidget.c +40 -0
- data/ext/gtk3/rbgtkapplication.c +69 -0
- data/ext/gtk3/rbgtkarrow.c +56 -0
- data/ext/gtk3/rbgtkaspectframe.c +56 -0
- data/ext/gtk3/rbgtkassistant.c +218 -0
- data/ext/gtk3/rbgtkbin.c +42 -0
- data/ext/gtk3/rbgtkbindingset.c +164 -0
- data/ext/gtk3/rbgtkborder.c +119 -0
- data/ext/gtk3/rbgtkbox.c +146 -0
- data/ext/gtk3/rbgtkbuildable.c +96 -0
- data/ext/gtk3/rbgtkbuilder.c +166 -0
- data/ext/gtk3/rbgtkbutton.c +93 -0
- data/ext/gtk3/rbgtkbuttonbox.c +87 -0
- data/ext/gtk3/rbgtkcalendar.c +118 -0
- data/ext/gtk3/rbgtkcelleditable.c +57 -0
- data/ext/gtk3/rbgtkcelllayout.c +144 -0
- data/ext/gtk3/rbgtkcellrenderer.c +116 -0
- data/ext/gtk3/rbgtkcellrendereraccel.c +41 -0
- data/ext/gtk3/rbgtkcellrenderercombo.c +38 -0
- data/ext/gtk3/rbgtkcellrendererpixbuf.c +41 -0
- data/ext/gtk3/rbgtkcellrendererprogress.c +38 -0
- data/ext/gtk3/rbgtkcellrendererspin.c +39 -0
- data/ext/gtk3/rbgtkcellrendererspinner.c +38 -0
- data/ext/gtk3/rbgtkcellrenderertext.c +48 -0
- data/ext/gtk3/rbgtkcellrenderertoggle.c +39 -0
- data/ext/gtk3/rbgtkcellview.c +109 -0
- data/ext/gtk3/rbgtkcheckbutton.c +64 -0
- data/ext/gtk3/rbgtkcheckmenuitem.c +64 -0
- data/ext/gtk3/rbgtkclipboard.c +389 -0
- data/ext/gtk3/rbgtkcolorbutton.c +49 -0
- data/ext/gtk3/rbgtkcolorselection.c +219 -0
- data/ext/gtk3/rbgtkcolorselectiondialog.c +56 -0
- data/ext/gtk3/rbgtkcombobox.c +147 -0
- data/ext/gtk3/rbgtkcomboboxtext.c +138 -0
- data/ext/gtk3/rbgtkconst.c +79 -0
- data/ext/gtk3/rbgtkcontainer.c +784 -0
- data/ext/gtk3/rbgtkcssprovider.c +110 -0
- data/ext/gtk3/rbgtkdialog.c +186 -0
- data/ext/gtk3/rbgtkdrag.c +93 -0
- data/ext/gtk3/rbgtkdrawingarea.c +42 -0
- data/ext/gtk3/rbgtkeditable.c +149 -0
- data/ext/gtk3/rbgtkentry.c +198 -0
- data/ext/gtk3/rbgtkentrybuffer.c +87 -0
- data/ext/gtk3/rbgtkentrycompletion.c +122 -0
- data/ext/gtk3/rbgtkeventbox.c +42 -0
- data/ext/gtk3/rbgtkexpander.c +49 -0
- data/ext/gtk3/rbgtkfilechooser.c +384 -0
- data/ext/gtk3/rbgtkfilechooserbutton.c +50 -0
- data/ext/gtk3/rbgtkfilechooserdialog.c +62 -0
- data/ext/gtk3/rbgtkfilechooserwidget.c +40 -0
- data/ext/gtk3/rbgtkfilefilter.c +128 -0
- data/ext/gtk3/rbgtkfilesystemerror.c +48 -0
- data/ext/gtk3/rbgtkfixed.c +61 -0
- data/ext/gtk3/rbgtkfontbutton.c +49 -0
- data/ext/gtk3/rbgtkfontchooser.c +78 -0
- data/ext/gtk3/rbgtkfontchooserdialog.c +56 -0
- data/ext/gtk3/rbgtkfontchooserwidget.c +45 -0
- data/ext/gtk3/rbgtkframe.c +69 -0
- data/ext/gtk3/rbgtkgrid.c +105 -0
- data/ext/gtk3/rbgtkhandlebox.c +45 -0
- data/ext/gtk3/rbgtkhsv.c +102 -0
- data/ext/gtk3/rbgtkiconfactory.c +85 -0
- data/ext/gtk3/rbgtkiconinfo.c +115 -0
- data/ext/gtk3/rbgtkiconset.c +84 -0
- data/ext/gtk3/rbgtkiconsize.c +91 -0
- data/ext/gtk3/rbgtkiconsource.c +184 -0
- data/ext/gtk3/rbgtkicontheme.c +268 -0
- data/ext/gtk3/rbgtkiconview.c +270 -0
- data/ext/gtk3/rbgtkimage.c +96 -0
- data/ext/gtk3/rbgtkimagemenuitem.c +67 -0
- data/ext/gtk3/rbgtkimcontext.c +133 -0
- data/ext/gtk3/rbgtkimcontextsimple.c +69 -0
- data/ext/gtk3/rbgtkimmulticontext.c +48 -0
- data/ext/gtk3/rbgtkinfobar.c +121 -0
- data/ext/gtk3/rbgtkinvisible.c +49 -0
- data/ext/gtk3/rbgtklabel.c +139 -0
- data/ext/gtk3/rbgtklayout.c +93 -0
- data/ext/gtk3/rbgtklinkbutton.c +55 -0
- data/ext/gtk3/rbgtkliststore.c +408 -0
- data/ext/gtk3/rbgtklockbutton.c +50 -0
- data/ext/gtk3/rbgtkmenu.c +168 -0
- data/ext/gtk3/rbgtkmenubar.c +43 -0
- data/ext/gtk3/rbgtkmenuitem.c +95 -0
- data/ext/gtk3/rbgtkmenushell.c +106 -0
- data/ext/gtk3/rbgtkmenutoolbutton.c +81 -0
- data/ext/gtk3/rbgtkmessagedialog.c +74 -0
- data/ext/gtk3/rbgtkmisc.c +70 -0
- data/ext/gtk3/rbgtknotebook.c +383 -0
- data/ext/gtk3/rbgtknumerableicon.c +50 -0
- data/ext/gtk3/rbgtkorientable.c +27 -0
- data/ext/gtk3/rbgtkoverlay.c +53 -0
- data/ext/gtk3/rbgtkpagesetup.c +195 -0
- data/ext/gtk3/rbgtkpagesetupunixdialog.c +94 -0
- data/ext/gtk3/rbgtkpaned.c +114 -0
- data/ext/gtk3/rbgtkpapersize.c +179 -0
- data/ext/gtk3/rbgtkplug.c +85 -0
- data/ext/gtk3/rbgtkprintcontext.c +125 -0
- data/ext/gtk3/rbgtkprinter.c +155 -0
- data/ext/gtk3/rbgtkprintjob.c +148 -0
- data/ext/gtk3/rbgtkprintoperation.c +149 -0
- data/ext/gtk3/rbgtkprintoperationpreview.c +59 -0
- data/ext/gtk3/rbgtkprintsettings.c +807 -0
- data/ext/gtk3/rbgtkprintunixdialog.c +90 -0
- data/ext/gtk3/rbgtkprogressbar.c +72 -0
- data/ext/gtk3/rbgtkradioaction.c +122 -0
- data/ext/gtk3/rbgtkradiobutton.c +89 -0
- data/ext/gtk3/rbgtkradiomenuitem.c +147 -0
- data/ext/gtk3/rbgtkradiotoolbutton.c +131 -0
- data/ext/gtk3/rbgtkrange.c +68 -0
- data/ext/gtk3/rbgtkrecentaction.c +64 -0
- data/ext/gtk3/rbgtkrecentchooser.c +198 -0
- data/ext/gtk3/rbgtkrecentchooserdialog.c +66 -0
- data/ext/gtk3/rbgtkrecentchoosermenu.c +50 -0
- data/ext/gtk3/rbgtkrecentchooserwidget.c +48 -0
- data/ext/gtk3/rbgtkrecentdata.c +187 -0
- data/ext/gtk3/rbgtkrecentfilter.c +169 -0
- data/ext/gtk3/rbgtkrecentfilterinfo.c +200 -0
- data/ext/gtk3/rbgtkrecentinfo.c +213 -0
- data/ext/gtk3/rbgtkrecentmanager.c +134 -0
- data/ext/gtk3/rbgtkscale.c +97 -0
- data/ext/gtk3/rbgtkscalebutton.c +84 -0
- data/ext/gtk3/rbgtkscrollable.c +31 -0
- data/ext/gtk3/rbgtkscrollbar.c +52 -0
- data/ext/gtk3/rbgtkscrolledwindow.c +122 -0
- data/ext/gtk3/rbgtkselection.c +168 -0
- data/ext/gtk3/rbgtkselectiondata.c +282 -0
- data/ext/gtk3/rbgtkseparator.c +44 -0
- data/ext/gtk3/rbgtkseparatormenuitem.c +39 -0
- data/ext/gtk3/rbgtkseparatortoolitem.c +38 -0
- data/ext/gtk3/rbgtksettings.c +229 -0
- data/ext/gtk3/rbgtksizegroup.c +66 -0
- data/ext/gtk3/rbgtksocket.c +82 -0
- data/ext/gtk3/rbgtkspinbutton.c +132 -0
- data/ext/gtk3/rbgtkspinner.c +55 -0
- data/ext/gtk3/rbgtkstatusbar.c +77 -0
- data/ext/gtk3/rbgtkstatusicon.c +122 -0
- data/ext/gtk3/rbgtkstock.c +213 -0
- data/ext/gtk3/rbgtkstylecontext.c +411 -0
- data/ext/gtk3/rbgtkstyleproperties.c +119 -0
- data/ext/gtk3/rbgtkstyleprovider.c +68 -0
- data/ext/gtk3/rbgtkswitch.c +40 -0
- data/ext/gtk3/rbgtktable.c +190 -0
- data/ext/gtk3/rbgtktargetlist.c +125 -0
- data/ext/gtk3/rbgtktearoffmenuitem.c +41 -0
- data/ext/gtk3/rbgtktextappearance.c +236 -0
- data/ext/gtk3/rbgtktextattributes.c +326 -0
- data/ext/gtk3/rbgtktextbuffer.c +899 -0
- data/ext/gtk3/rbgtktextchildanchor.c +56 -0
- data/ext/gtk3/rbgtktextiter.c +732 -0
- data/ext/gtk3/rbgtktextmark.c +71 -0
- data/ext/gtk3/rbgtktexttag.c +68 -0
- data/ext/gtk3/rbgtktexttagtable.c +96 -0
- data/ext/gtk3/rbgtktextview.c +336 -0
- data/ext/gtk3/rbgtkthemingengine.c +257 -0
- data/ext/gtk3/rbgtktoggleaction.c +61 -0
- data/ext/gtk3/rbgtktogglebutton.c +87 -0
- data/ext/gtk3/rbgtktoggletoolbutton.c +61 -0
- data/ext/gtk3/rbgtktoolbar.c +118 -0
- data/ext/gtk3/rbgtktoolbutton.c +66 -0
- data/ext/gtk3/rbgtktoolitem.c +200 -0
- data/ext/gtk3/rbgtktoolitemgroup.c +70 -0
- data/ext/gtk3/rbgtktoolshell.c +96 -0
- data/ext/gtk3/rbgtktooltip.c +100 -0
- data/ext/gtk3/rbgtktreedragdest.c +28 -0
- data/ext/gtk3/rbgtktreedragsource.c +28 -0
- data/ext/gtk3/rbgtktreeiter.c +258 -0
- data/ext/gtk3/rbgtktreemodel.c +236 -0
- data/ext/gtk3/rbgtktreemodelfilter.c +197 -0
- data/ext/gtk3/rbgtktreemodelsort.c +111 -0
- data/ext/gtk3/rbgtktreepath.c +191 -0
- data/ext/gtk3/rbgtktreerowreference.c +140 -0
- data/ext/gtk3/rbgtktreeselection.c +205 -0
- data/ext/gtk3/rbgtktreesortable.c +122 -0
- data/ext/gtk3/rbgtktreestore.c +330 -0
- data/ext/gtk3/rbgtktreeview.c +715 -0
- data/ext/gtk3/rbgtktreeviewcolumn.c +256 -0
- data/ext/gtk3/rbgtkuimanager.c +189 -0
- data/ext/gtk3/rbgtkviewport.c +44 -0
- data/ext/gtk3/rbgtkvolumebutton.c +41 -0
- data/ext/gtk3/rbgtkwidget.c +1564 -0
- data/ext/gtk3/rbgtkwidgetpath.c +229 -0
- data/ext/gtk3/rbgtkwindow.c +557 -0
- data/ext/gtk3/rbgtkwindowgroup.c +80 -0
- data/extconf.rb +49 -0
- data/lib/gtk3.rb +10 -0
- data/lib/gtk3/base.rb +67 -0
- data/lib/gtk3/deprecated.rb +1001 -0
- data/sample/gtk-demo/README +7 -0
- data/sample/gtk-demo/alphatest.png +0 -0
- data/sample/gtk-demo/apple-red.png +0 -0
- data/sample/gtk-demo/appwindow.rb +233 -0
- data/sample/gtk-demo/background.jpg +0 -0
- data/sample/gtk-demo/builder.rb +51 -0
- data/sample/gtk-demo/button_box.rb +84 -0
- data/sample/gtk-demo/cairo-arc-negative.rb +41 -0
- data/sample/gtk-demo/cairo-arc.rb +41 -0
- data/sample/gtk-demo/cairo-clip-image.rb +51 -0
- data/sample/gtk-demo/cairo-clip-rectangle.rb +35 -0
- data/sample/gtk-demo/cairo-clip.rb +35 -0
- data/sample/gtk-demo/cairo-curve-rectangle.rb +76 -0
- data/sample/gtk-demo/cairo-curve-to.rb +43 -0
- data/sample/gtk-demo/cairo-dash.rb +39 -0
- data/sample/gtk-demo/cairo-fill-and-stroke.rb +32 -0
- data/sample/gtk-demo/cairo-fill-and-stroke2.rb +38 -0
- data/sample/gtk-demo/cairo-gradient.rb +35 -0
- data/sample/gtk-demo/cairo-image-pattern.rb +39 -0
- data/sample/gtk-demo/cairo-image.rb +49 -0
- data/sample/gtk-demo/cairo-line-cap.rb +53 -0
- data/sample/gtk-demo/cairo-line-join.rb +41 -0
- data/sample/gtk-demo/cairo-long-lines.rb +41 -0
- data/sample/gtk-demo/cairo-operator.rb +83 -0
- data/sample/gtk-demo/cairo-path.rb +28 -0
- data/sample/gtk-demo/cairo-pattern-fill.rb +88 -0
- data/sample/gtk-demo/cairo-self-intersect.rb +32 -0
- data/sample/gtk-demo/cairo-text-align-center.rb +45 -0
- data/sample/gtk-demo/cairo-text-extents.rb +46 -0
- data/sample/gtk-demo/cairo-text.rb +43 -0
- data/sample/gtk-demo/changedisplay.rb +408 -0
- data/sample/gtk-demo/clipboard.rb +72 -0
- data/sample/gtk-demo/colorsel.rb +84 -0
- data/sample/gtk-demo/common.rb +88 -0
- data/sample/gtk-demo/demo.ui +258 -0
- data/sample/gtk-demo/dialog.rb +137 -0
- data/sample/gtk-demo/drawingarea.rb +226 -0
- data/sample/gtk-demo/editable_cells.rb +172 -0
- data/sample/gtk-demo/entry_completion.rb +63 -0
- data/sample/gtk-demo/expander.rb +40 -0
- data/sample/gtk-demo/floppybuddy.gif +0 -0
- data/sample/gtk-demo/gnome-applets.png +0 -0
- data/sample/gtk-demo/gnome-calendar.png +0 -0
- data/sample/gtk-demo/gnome-foot.png +0 -0
- data/sample/gtk-demo/gnome-fs-directory.png +0 -0
- data/sample/gtk-demo/gnome-fs-regular.png +0 -0
- data/sample/gtk-demo/gnome-gimp.png +0 -0
- data/sample/gtk-demo/gnome-gmush.png +0 -0
- data/sample/gtk-demo/gnome-gsame.png +0 -0
- data/sample/gtk-demo/gnu-keys.png +0 -0
- data/sample/gtk-demo/gtk-logo-rgb.gif +0 -0
- data/sample/gtk-demo/hypertext.rb +211 -0
- data/sample/gtk-demo/iconview.rb +109 -0
- data/sample/gtk-demo/images.rb +197 -0
- data/sample/gtk-demo/item_factory.rb +94 -0
- data/sample/gtk-demo/list_store.rb +138 -0
- data/sample/gtk-demo/main.rb +382 -0
- data/sample/gtk-demo/menus.rb +172 -0
- data/sample/gtk-demo/panes.rb +156 -0
- data/sample/gtk-demo/pixbufs.rb +176 -0
- data/sample/gtk-demo/printing.rb +128 -0
- data/sample/gtk-demo/rotated_text.rb +84 -0
- data/sample/gtk-demo/ruby-gnome2-logo.png +0 -0
- data/sample/gtk-demo/sizegroup.rb +118 -0
- data/sample/gtk-demo/stock_browser.rb +235 -0
- data/sample/gtk-demo/textview.rb +436 -0
- data/sample/gtk-demo/tree_store.rb +270 -0
- data/sample/misc/aboutdialog.rb +42 -0
- data/sample/misc/aboutdialog2.rb +42 -0
- data/sample/misc/alpha-demo.rb +70 -0
- data/sample/misc/assistant.rb +347 -0
- data/sample/misc/bindings.rb +107 -0
- data/sample/misc/button.rb +69 -0
- data/sample/misc/button2.rb +28 -0
- data/sample/misc/buttonbox.rb +93 -0
- data/sample/misc/cairo-pong.rb +215 -0
- data/sample/misc/calendar.rb +66 -0
- data/sample/misc/checkbutton.rb +46 -0
- data/sample/misc/colorselection.rb +25 -0
- data/sample/misc/combo_check.rb +71 -0
- data/sample/misc/combobox.rb +86 -0
- data/sample/misc/composited-windows.rb +113 -0
- data/sample/misc/cursor.rb +32 -0
- data/sample/misc/dialog.rb +44 -0
- data/sample/misc/dialog2.rb +39 -0
- data/sample/misc/dnd.rb +64 -0
- data/sample/misc/dndtreeview.rb +56 -0
- data/sample/misc/drag-move.rb +131 -0
- data/sample/misc/drawing.rb +90 -0
- data/sample/misc/entry.rb +34 -0
- data/sample/misc/entrycompletion.rb +33 -0
- data/sample/misc/expander.rb +27 -0
- data/sample/misc/filechooser.rb +41 -0
- data/sample/misc/frame.rb +69 -0
- data/sample/misc/gdkscreen.rb +32 -0
- data/sample/misc/gnome-logo-icon.png +0 -0
- data/sample/misc/helloworld.rb +35 -0
- data/sample/misc/iconview.rb +38 -0
- data/sample/misc/image.rb +42 -0
- data/sample/misc/itemfactory.rb +73 -0
- data/sample/misc/itemfactory2.rb +74 -0
- data/sample/misc/keyboard_grab.rb +29 -0
- data/sample/misc/label.rb +33 -0
- data/sample/misc/linkbutton.rb +42 -0
- data/sample/misc/listview.rb +92 -0
- data/sample/misc/menu.rb +81 -0
- data/sample/misc/misc_button.rb +49 -0
- data/sample/misc/mouse-gesture.rb +465 -0
- data/sample/misc/pangorenderer.rb +66 -0
- data/sample/misc/pointer_grab.rb +34 -0
- data/sample/misc/print.rb +247 -0
- data/sample/misc/properties.rb +85 -0
- data/sample/misc/radiobutton.rb +47 -0
- data/sample/misc/recentchooserdialog.rb +52 -0
- data/sample/misc/rgtk+cairo.rb +42 -0
- data/sample/misc/scalebutton.rb +19 -0
- data/sample/misc/settings.rb +41 -0
- data/sample/misc/statusicon.rb +123 -0
- data/sample/misc/stock.rb +36 -0
- data/sample/misc/style_property.rb +67 -0
- data/sample/misc/style_property.rc +19 -0
- data/sample/misc/t-gtkplug.rb +58 -0
- data/sample/misc/t-gtksocket.rb +65 -0
- data/sample/misc/test.xpm +92 -0
- data/sample/misc/textbuffer_serialize.rb +130 -0
- data/sample/misc/threads.rb +72 -0
- data/sample/misc/to_drawable.rb +42 -0
- data/sample/misc/togglebutton.rb +34 -0
- data/sample/misc/toolbar.rb +55 -0
- data/sample/misc/tooltips.rb +204 -0
- data/sample/misc/tree_combo.rb +79 -0
- data/sample/misc/tree_progress.rb +63 -0
- data/sample/misc/treemodelfilter.rb +49 -0
- data/sample/misc/treeview.rb +71 -0
- data/sample/misc/uimanager.rb +148 -0
- data/sample/misc/uimanager2.rb +91 -0
- data/sample/misc/uimanager2.xml +36 -0
- data/sample/misc/window.rb +24 -0
- data/sample/misc/xbm_cursor.rb +43 -0
- data/sample/testgtk/3DRings.xpm +116 -0
- data/sample/testgtk/FilesQueue.xpm +98 -0
- data/sample/testgtk/Modeller.xpm +117 -0
- data/sample/testgtk/README +14 -0
- data/sample/testgtk/button.rb +124 -0
- data/sample/testgtk/buttonbox.rb +100 -0
- data/sample/testgtk/check-n.xpm +21 -0
- data/sample/testgtk/check-y.xpm +21 -0
- data/sample/testgtk/checkbutton.rb +67 -0
- data/sample/testgtk/circles.xbm +46 -0
- data/sample/testgtk/colorselect.rb +33 -0
- data/sample/testgtk/dialog.rb +48 -0
- data/sample/testgtk/entry.rb +73 -0
- data/sample/testgtk/filesel.rb +65 -0
- data/sample/testgtk/fontselection.rb +56 -0
- data/sample/testgtk/labels.rb +74 -0
- data/sample/testgtk/layout.rb +108 -0
- data/sample/testgtk/marble.xpm +408 -0
- data/sample/testgtk/menu.rb +79 -0
- data/sample/testgtk/notebook.rb +280 -0
- data/sample/testgtk/pixmap.rb +58 -0
- data/sample/testgtk/progressbar.rb +173 -0
- data/sample/testgtk/radiobutton.rb +61 -0
- data/sample/testgtk/range.rb +65 -0
- data/sample/testgtk/reparent.rb +91 -0
- data/sample/testgtk/sample.rb +80 -0
- data/sample/testgtk/savedposition.rb +87 -0
- data/sample/testgtk/scrolledwindow.rb +67 -0
- data/sample/testgtk/shapedwindow.rb +99 -0
- data/sample/testgtk/spinbutton.rb +181 -0
- data/sample/testgtk/statusbar.rb +89 -0
- data/sample/testgtk/test.xpm +92 -0
- data/sample/testgtk/testgtk.rb +176 -0
- data/sample/testgtk/testgtkrc +146 -0
- data/sample/testgtk/testgtkrc2 +21 -0
- data/sample/testgtk/togglebutton.rb +53 -0
- data/sample/testgtk/toolbar.rb +82 -0
- data/sample/testgtk/tooltips.rb +41 -0
- data/sample/testgtk/wmhints.rb +40 -0
- data/test/gtk-test-utils.rb +15 -0
- data/test/run-test.rb +32 -0
- data/test/test_gc.rb +25 -0
- data/test/test_gdk.rb +18 -0
- data/test/test_gdk_color.rb +10 -0
- data/test/test_gdk_display.rb +37 -0
- data/test/test_gdk_event.rb +11 -0
- data/test/test_gdk_gc.rb +7 -0
- data/test/test_gdk_keymap.rb +8 -0
- data/test/test_gdk_pango.rb +9 -0
- data/test/test_gdk_selection_data.rb +17 -0
- data/test/test_gdk_window.rb +29 -0
- data/test/test_gdk_window_attribute.rb +9 -0
- data/test/test_gtk_about_dialog.rb +14 -0
- data/test/test_gtk_buildable.rb +66 -0
- data/test/test_gtk_builder.rb +188 -0
- data/test/test_gtk_entry.rb +18 -0
- data/test/test_gtk_icon_theme.rb +30 -0
- data/test/test_gtk_image.rb +8 -0
- data/test/test_gtk_list_store.rb +65 -0
- data/test/test_gtk_menu_item.rb +13 -0
- data/test/test_gtk_rc_style.rb +14 -0
- data/test/test_gtk_tree_path.rb +20 -0
- data/test/test_gtk_unix_print.rb +14 -0
- data/test/test_gtk_widget.rb +32 -0
- metadata +553 -94
- data/LICENSE +0 -19
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
=begin
|
3
|
+
dialog.rb - Ruby/GTK2 sample script.
|
4
|
+
|
5
|
+
Copyright (c) 2002-2006 Ruby-GNOME2 Project Team
|
6
|
+
This program is licenced under the same licence as Ruby-GNOME2.
|
7
|
+
|
8
|
+
$Id: dialog.rb,v 1.6 2006/06/17 13:18:12 mutoh Exp $
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'gtk3'
|
12
|
+
|
13
|
+
window = Gtk::Window.new("Gtk::Dialog sample")
|
14
|
+
button = Gtk::Button.new("Create Dialog")
|
15
|
+
button.signal_connect("clicked") do
|
16
|
+
dialog = Gtk::Dialog.new
|
17
|
+
dialog.title = "Gtk::Dialog Sample"
|
18
|
+
dialog.transient_for = window
|
19
|
+
dialog.set_default_size(300, 300)
|
20
|
+
dialog.vbox.add(Gtk::Label.new("Gtk::Dialog Sample"))
|
21
|
+
|
22
|
+
|
23
|
+
dialog.add_button("OK", Gtk::Dialog::RESPONSE_OK)
|
24
|
+
dialog.add_button(Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL)
|
25
|
+
dialog.add_button(Gtk::Stock::CLOSE, Gtk::Dialog::RESPONSE_CLOSE)
|
26
|
+
dialog.set_default_response(Gtk::Dialog::RESPONSE_CANCEL)
|
27
|
+
|
28
|
+
dialog.signal_connect("response") do |widget, response|
|
29
|
+
case response
|
30
|
+
when Gtk::Dialog::RESPONSE_OK
|
31
|
+
p "OK"
|
32
|
+
when Gtk::Dialog::RESPONSE_CANCEL
|
33
|
+
p "Cancel"
|
34
|
+
when Gtk::Dialog::RESPONSE_CLOSE
|
35
|
+
p "Close"
|
36
|
+
dialog.destroy
|
37
|
+
end
|
38
|
+
end
|
39
|
+
dialog.show_all
|
40
|
+
end
|
41
|
+
|
42
|
+
window.add(button).show_all.signal_connect("destroy"){Gtk.main_quit}
|
43
|
+
|
44
|
+
Gtk.main
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
=begin
|
3
|
+
dialog2.rb - Ruby/GTK2 sample script.
|
4
|
+
|
5
|
+
Copyright (c) 2002-2006 Ruby-GNOME2 Project Team
|
6
|
+
This program is licenced under the same licence as Ruby-GNOME2.
|
7
|
+
|
8
|
+
$Id: dialog2.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'gtk3'
|
12
|
+
|
13
|
+
window = Gtk::Window.new("Gtk::Dialog sample2")
|
14
|
+
button = Gtk::Button.new("Create Dialog")
|
15
|
+
button.signal_connect("clicked") do
|
16
|
+
dialog = Gtk::Dialog.new("Gtk::Dialog Sample 2", window,
|
17
|
+
Gtk::Dialog::MODAL|Gtk::Dialog::NO_SEPARATOR,
|
18
|
+
[Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK],
|
19
|
+
[Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL])
|
20
|
+
dialog.vbox.add(Gtk::Label.new("Gtk::Dialog Sample 2"))
|
21
|
+
dialog.set_default_size(300, 300)
|
22
|
+
dialog.vbox.show_all
|
23
|
+
result = dialog.run
|
24
|
+
case result
|
25
|
+
when Gtk::Dialog::RESPONSE_OK
|
26
|
+
p "OK"
|
27
|
+
when Gtk::Dialog::RESPONSE_CANCEL
|
28
|
+
p "Cancel"
|
29
|
+
end
|
30
|
+
dialog.destroy
|
31
|
+
end
|
32
|
+
|
33
|
+
window.add(button).show_all.signal_connect("destroy"){Gtk.main_quit}
|
34
|
+
|
35
|
+
Gtk.main
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
data/sample/misc/dnd.rb
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
=begin
|
2
|
+
dnd.rb - Drag and Drop sample script.
|
3
|
+
|
4
|
+
Copyright (C) 2002-2006 Masao Mutoh
|
5
|
+
This program is licenced under the same licence as Ruby-GNOME2.
|
6
|
+
|
7
|
+
$Date: 2006/06/17 13:18:12 $
|
8
|
+
$Id: dnd.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'gtk3'
|
12
|
+
|
13
|
+
class SrcWindow < Gtk::Window
|
14
|
+
def initialize
|
15
|
+
super("Source Window")
|
16
|
+
@label = Gtk::Label.new("Drag here!")
|
17
|
+
add(@label)
|
18
|
+
set_default_size(100, 100)
|
19
|
+
drag_source_set(Gdk::Window::ModifierType::BUTTON1_MASK |
|
20
|
+
Gdk::Window::ModifierType::BUTTON2_MASK,
|
21
|
+
[["test", Gtk::Drag::TargetFlags::SAME_APP, 12345]],
|
22
|
+
Gdk::DragContext::Action::COPY |
|
23
|
+
Gdk::DragContext::Action::MOVE)
|
24
|
+
signal_connect("drag_data_get") do |widget, context, selection_data, info, time|
|
25
|
+
# selection_data.set("text/uri-list", 8, "hoge.txt")
|
26
|
+
selection_data.set(Gdk::Selection::TYPE_STRING, "hoge.txt")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
class DestWindow < Gtk::Window
|
33
|
+
def initialize
|
34
|
+
super("Dest Window")
|
35
|
+
|
36
|
+
@label = Gtk::Label.new("Drop here!")
|
37
|
+
add(@label)
|
38
|
+
set_default_size(100, 100)
|
39
|
+
drag_dest_set(Gtk::Drag::DestDefaults::MOTION | Gtk::Drag::DestDefaults::HIGHLIGHT,
|
40
|
+
[["test", :same_app, 12345]],
|
41
|
+
Gdk::DragContext::Action::COPY|Gdk::DragContext::Action::MOVE)
|
42
|
+
|
43
|
+
signal_connect("drag-data-received") do |w, dc, x, y, selectiondata, info, time|
|
44
|
+
dc.targets.each do |target|
|
45
|
+
if target.name == "test" ||
|
46
|
+
selectiondata.type == Gdk::Selection::TYPE_STRING
|
47
|
+
puts selectiondata.data
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
signal_connect("drag-drop") do |w, dc, x, y, time|
|
52
|
+
w.drag_get_data(dc, dc.targets[0], time)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
win1 = SrcWindow.new
|
58
|
+
win2 = DestWindow.new
|
59
|
+
|
60
|
+
win1.show_all.signal_connect("destroy"){Gtk.main_quit}
|
61
|
+
win2.show_all.signal_connect("destroy"){Gtk.main_quit}
|
62
|
+
|
63
|
+
Gtk.main
|
64
|
+
|
@@ -0,0 +1,56 @@
|
|
1
|
+
=begin
|
2
|
+
dndtreeview.rb - Drag and Drop sample script.
|
3
|
+
|
4
|
+
Copyright (C) 2003-2006 Masao Mutoh
|
5
|
+
This program is licenced under the same licence as Ruby-GNOME2.
|
6
|
+
|
7
|
+
$Date: 2006/06/17 13:18:12 $
|
8
|
+
$Id: dndtreeview.rb,v 1.3 2006/06/17 13:18:12 mutoh Exp $
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'gtk3'
|
12
|
+
|
13
|
+
class TestWindow < Gtk::Window
|
14
|
+
attr_reader :list
|
15
|
+
|
16
|
+
TARGET_TABLE = [["GTK_TREE_MODEL_ROW", 0, 0]]
|
17
|
+
|
18
|
+
def initialize()
|
19
|
+
super("Drag and Drop Gtk::TreeView")
|
20
|
+
|
21
|
+
set_default_size(300,128)
|
22
|
+
signal_connect("destroy") { Gtk.main_quit }
|
23
|
+
|
24
|
+
data = [["Hello", "KON-NI-CHIWA"],
|
25
|
+
["Goodbye", "SAYO-NARA"],
|
26
|
+
["Good morning", "OHA-YO-GOZAI-MASU"],
|
27
|
+
["Good evening", "KON-BAN-WA"]]
|
28
|
+
|
29
|
+
model = Gtk::ListStore.new(String, String)
|
30
|
+
view = Gtk::TreeView.new(model)
|
31
|
+
renderer = Gtk::CellRendererText.new
|
32
|
+
col1 = Gtk::TreeViewColumn.new("Data", renderer, {:text => 0})
|
33
|
+
col2 = Gtk::TreeViewColumn.new("Data", renderer, {:text => 1})
|
34
|
+
view.append_column(col1)
|
35
|
+
view.append_column(col2)
|
36
|
+
|
37
|
+
data.each do |v1, v2|
|
38
|
+
iter = model.append
|
39
|
+
iter.set_value(0, v1)
|
40
|
+
iter.set_value(1, v2)
|
41
|
+
end
|
42
|
+
|
43
|
+
view.enable_model_drag_source(Gdk::Window::ModifierType::BUTTON1_MASK,
|
44
|
+
TARGET_TABLE,
|
45
|
+
Gdk::DragContext::Action::COPY|Gdk::DragContext::Action::MOVE)
|
46
|
+
view.enable_model_drag_dest(TARGET_TABLE,
|
47
|
+
Gdk::DragContext::Action::COPY|Gdk::DragContext::Action::MOVE)
|
48
|
+
|
49
|
+
add(view)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
win = TestWindow.new.show_all
|
54
|
+
|
55
|
+
Gtk.main
|
56
|
+
|
@@ -0,0 +1,131 @@
|
|
1
|
+
=begin
|
2
|
+
drag-move.rb - Move widget by drag sample script.
|
3
|
+
|
4
|
+
Copyright (C) 2006 Kouhei Sutou
|
5
|
+
This program is licenced under the same licence as Ruby-GNOME2.
|
6
|
+
|
7
|
+
$Date: 2006/06/17 13:18:12 $
|
8
|
+
$Id: drag-move.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'gtk3'
|
12
|
+
|
13
|
+
class DraggableWidget < Gtk::EventBox
|
14
|
+
def initialize
|
15
|
+
super
|
16
|
+
set_visible_window(false)
|
17
|
+
@dragging = false
|
18
|
+
@drag_button = 1
|
19
|
+
set_button_press_event
|
20
|
+
set_button_release_event
|
21
|
+
set_motion_notify_event
|
22
|
+
end
|
23
|
+
|
24
|
+
def layout
|
25
|
+
parent
|
26
|
+
end
|
27
|
+
|
28
|
+
def move(x, y)
|
29
|
+
if layout
|
30
|
+
layout.move(self, x, y)
|
31
|
+
true
|
32
|
+
else
|
33
|
+
false
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def dragging?
|
38
|
+
@dragging
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
def set_button_press_event
|
43
|
+
signal_connect("button_press_event") do |widget, event|
|
44
|
+
if event.button == @drag_button
|
45
|
+
Gtk.grab_add(widget)
|
46
|
+
x, y, w, h = widget.allocation.to_a
|
47
|
+
drag_start(x, y, event.x_root, event.y_root)
|
48
|
+
else
|
49
|
+
false
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def set_motion_notify_event
|
55
|
+
signal_connect("motion_notify_event") do |widget, event|
|
56
|
+
if dragging?
|
57
|
+
drag_motion(event.x_root, event.y_root)
|
58
|
+
else
|
59
|
+
false
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def set_button_release_event
|
65
|
+
signal_connect("button_release_event") do |widget, event|
|
66
|
+
if event.button == @drag_button
|
67
|
+
Gtk.grab_remove(widget)
|
68
|
+
drag_end
|
69
|
+
else
|
70
|
+
false
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def set_drag_move_position_event
|
76
|
+
signal_connect("drag_move_position") do |widget, x, y|
|
77
|
+
if layout
|
78
|
+
layout.move(widget, x, y)
|
79
|
+
true
|
80
|
+
else
|
81
|
+
false
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def drag_start(x, y, base_x, base_y)
|
87
|
+
@dragging = true
|
88
|
+
@drag_x = x
|
89
|
+
@drag_y = y
|
90
|
+
@drag_base_x = base_x
|
91
|
+
@drag_base_y = base_y
|
92
|
+
true
|
93
|
+
end
|
94
|
+
|
95
|
+
def drag_motion(base_x, base_y)
|
96
|
+
delta_x = base_x - @drag_base_x
|
97
|
+
delta_y = base_y - @drag_base_y
|
98
|
+
if delta_x != 0 and delta_y != 0
|
99
|
+
move(@drag_x + delta_x, @drag_y + delta_y)
|
100
|
+
else
|
101
|
+
false
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def drag_end
|
106
|
+
@dragging = false
|
107
|
+
true
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
window = Gtk::Window.new("Draggable Widget sample")
|
112
|
+
window.signal_connect("destroy"){Gtk.main_quit}
|
113
|
+
|
114
|
+
layout = Gtk::Layout.new
|
115
|
+
|
116
|
+
draggable_widget = DraggableWidget.new
|
117
|
+
draggable_widget.set_size_request(50, 50)
|
118
|
+
layout.put(draggable_widget, 75, 75)
|
119
|
+
|
120
|
+
draggable_widget.signal_connect("expose_event") do |widget, event|
|
121
|
+
x, y, w, h = widget.allocation.to_a
|
122
|
+
fg = Gdk::GC.new(widget.window)
|
123
|
+
widget.window.draw_arc(fg, true, x, y, w, h, 0 * 64, 360 * 64)
|
124
|
+
false
|
125
|
+
end
|
126
|
+
|
127
|
+
window.add(layout)
|
128
|
+
|
129
|
+
window.show_all
|
130
|
+
|
131
|
+
Gtk.main
|
@@ -0,0 +1,90 @@
|
|
1
|
+
=begin
|
2
|
+
drawing.rb - Gtk::Drawing sample script.
|
3
|
+
|
4
|
+
Copyright (c) 2002-2006 Ruby-GNOME2 Project Team
|
5
|
+
This program is licenced under the same licence as Ruby-GNOME2.
|
6
|
+
|
7
|
+
$Id: drawing.rb,v 1.7 2006/06/17 13:18:12 mutoh Exp $
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'gtk3'
|
11
|
+
|
12
|
+
class Canvas < Gtk::DrawingArea
|
13
|
+
def initialize
|
14
|
+
super
|
15
|
+
signal_connect("expose_event") { |w,e| expose_event(w,e) }
|
16
|
+
signal_connect("configure_event") { |w, e| configure_event(w,e) }
|
17
|
+
@buffer = nil
|
18
|
+
@bgc = nil
|
19
|
+
end
|
20
|
+
|
21
|
+
def expose_event(w,e)
|
22
|
+
unless @buffer.nil?
|
23
|
+
rec = e.area
|
24
|
+
w.window.draw_drawable(@bgc, @buffer, rec.x, rec.y,
|
25
|
+
rec.x, rec.y, rec.width, rec.height)
|
26
|
+
end
|
27
|
+
false
|
28
|
+
end
|
29
|
+
|
30
|
+
def clear(b = @buffer)
|
31
|
+
return if b.nil?
|
32
|
+
|
33
|
+
g = b.size
|
34
|
+
@bgc = self.style.bg_gc(self.state) if @bgc.nil?
|
35
|
+
if (g[0] > 0 && g[1] > 0)
|
36
|
+
b.draw_rectangle(@bgc, true, 0,0, g[0], g[1])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def configure_event(w,e)
|
41
|
+
g = w.window.geometry
|
42
|
+
if (g[2] > 0 && g[3] > 0)
|
43
|
+
b = Gdk::Pixmap::new(w.window, g[2], g[3], -1)
|
44
|
+
clear(b)
|
45
|
+
if not @buffer.nil?
|
46
|
+
g = @buffer.size
|
47
|
+
b.draw_drawable(@bgc, @buffer, 0, 0, 0, 0, g[0], g[1])
|
48
|
+
end
|
49
|
+
@buffer = b
|
50
|
+
end
|
51
|
+
true
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
class A < Canvas
|
56
|
+
def initialize
|
57
|
+
super
|
58
|
+
signal_connect("button_press_event") { |w,e| pressed(w,e) }
|
59
|
+
set_events(Gdk::Event::BUTTON_PRESS_MASK)
|
60
|
+
end
|
61
|
+
|
62
|
+
def pressed(widget, ev)
|
63
|
+
if not @last.nil?
|
64
|
+
@buffer.draw_line(widget.style.fg_gc(widget.state),
|
65
|
+
@last.x, @last.y, ev.x, ev.y)
|
66
|
+
|
67
|
+
x1,x2 = if (@last.x < ev.x)
|
68
|
+
then [@last.x, ev.x]
|
69
|
+
else [ev.x, @last.x]
|
70
|
+
end
|
71
|
+
y1,y2 = if (@last.y < ev.y)
|
72
|
+
then [@last.y, ev.y]
|
73
|
+
else [ev.y, @last.y]
|
74
|
+
end
|
75
|
+
widget.queue_draw_area(x1, y1, x2 - x1 + 1, y2 - y1 + 1)
|
76
|
+
end
|
77
|
+
@last = nil
|
78
|
+
@last = ev
|
79
|
+
true
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
window = Gtk::Window.new("drawing test")
|
84
|
+
window.signal_connect("destroy") { Gtk.main_quit }
|
85
|
+
|
86
|
+
canvas = A.new
|
87
|
+
window.add(canvas)
|
88
|
+
|
89
|
+
window.show_all
|
90
|
+
Gtk::main
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
=begin
|
3
|
+
entry.rb - Ruby/GTK2 sample script.
|
4
|
+
|
5
|
+
Copyright (c) 2002-2006 Ruby-GNOME2 Project Team
|
6
|
+
This program is licenced under the same licence as Ruby-GNOME2.
|
7
|
+
|
8
|
+
$Id: entry.rb,v 1.9 2006/06/17 13:18:12 mutoh Exp $
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'gtk3'
|
12
|
+
|
13
|
+
window = Gtk::Window.new("entry")
|
14
|
+
window.border_width = 0
|
15
|
+
|
16
|
+
box1 = Gtk::Box.new(:vertical, 10)
|
17
|
+
window.add(box1)
|
18
|
+
|
19
|
+
entry = Gtk::Entry.new
|
20
|
+
|
21
|
+
box1.add(entry)
|
22
|
+
box1.add(Gtk::Separator.new(:horizontal))
|
23
|
+
|
24
|
+
button = Gtk::Button.new(:label => "close")
|
25
|
+
button.signal_connect("clicked") do
|
26
|
+
Gtk.main_quit
|
27
|
+
end
|
28
|
+
box1.add(button)
|
29
|
+
|
30
|
+
window.show_all
|
31
|
+
|
32
|
+
entry.text = "hello world"
|
33
|
+
|
34
|
+
Gtk.main
|