Gimp::UI
Gimp::UI
ウィジェット等、ユーザーインターフェース部分が実装されている。 require 'gimpui' して使って下さい。
Module hierarchy
Class hierarchy
- Gtk::Widget?
- Gimp::UI::Button
- Gimp::UI::ChainButton
- Gimp::UI::ColorButton
- Gimp::UI::ImageMenu
- Gimp::UI::DrawableMenu
- Gimp::UI::ChannelMenu
- Gimp::UI::BrushSelectWidget
- Gimp::UI::PatternSelectWidget
- Gimp::UI::GradientSelectWidget
- Gimp::UI::QueryBox
- Gimp::UI::RandomSeed
- Gimp::UI::Coordinates
- Gimp::UI::MemSizeEntry
- Gimp::UI::PixmapButton
- Gimp::UI::FileSelection
- Gimp::UI::PathEditor
- Gimp::UI::Pixmap
- Gimp::UI::SizeEntry
- Gimp::UI::UnitMenu
- Gimp::UI::Dialog
Constants:
Gimp::UI::EXPORT_CAN_HANDLE_RGB
Gimp::UI::EXPORT_CAN_HANDLE_GRAY
Gimp::UI::EXPORT_CAN_HANDLE_INDEXED
Gimp::UI::EXPORT_CAN_HANDLE_ALPHA
Gimp::UI::EXPORT_CAN_HANDLE_LAYERS
Gimp::UI::EXPORT_CAN_HANDLE_LAYERS_AS_ANIMATION
Gimp::UI::EXPORT_NEEDS_ALPHA
- Gimp::UI::export_imageのcapabilitiesには、これらのビット和を指定する。
Gimp::UI::EXPORT_CANCEL
Gimp::UI::EXPORT_IGNORE
Gimp::UI::EXPORT_EXPORT
- export_imageの返り値。
Module Functions:
Gimp::UI::init(prog_name, preview = false)
-
初期化
- prog_name
- The name of the plug-in which will be passed as argv[0] to gtk_init(). It's a convention to use the name of the executable and _not_ the PDB procedure name or something.
- preview
- true if the plug-in has some kind of preview in it's UI. Note that passing TRUE is recommended also if one of the used GIMP Library widgets contains a preview (like the Gimp::UI::ImageMenu.
Gimp::UI::export_image(image, drawable, format_name, capabilities)
-
format_name: The (short) name of the image_format (e.g. JPEG or GIF). capabilities: What can the image_format do?
Takes an image and a drawable to be saved together with a description of the capabilities of the image_format. If the type of image doesn't match the capabilities of the format a dialog is opened that informs the user that the image has to be exported and offers to do the necessary conversions.
If the user chooses to export the image, a copy is created. This copy is then converted, the image_ID and drawable_ID are changed to point to the new image and the procedure returns EXPORT_EXPORT. The save_plugin has to take care of deleting the created image using #delete() when it has saved it.
If the user chooses to Ignore the export problem, the image_ID and drawable_ID is not altered, EXPORT_IGNORE is returned and the save_plugin should try to save the original image. If the user chooses Cancel, EXPORT_CANCEL is returned and the save_plugin should quit itself with status #STATUS_CANCEL.
Returns: An enum of #GimpExportReturnType describing the user_action.
capabilitiesはEXPORT_CAN_HANDLE_RGB, EXPORT_CAN_HANDLE_GRAY, EXPORT_CAN_HANDLE_INDEXED, EXPORT_CAN_HANDLE_ALPHA, EXPORT_CAN_HANDLE_LAYERS, EXPORT_CAN_HANDLE_LAYERS_AS_ANIMATION, EXPORT_CAN_HANDLE_NEEDS_ALPHA のビット和です。 返り値は、EXPORT_CANCEL, EXPORT_IGNORE, EXPORT_EXPORTのいずれかです。
Gimp::UI::spin_button_new(value, lower, upper, step_increment, page_increment, page_size, climb_rate, digits)
-
value: The initial value of the spinbutton. lower: The lower boundary. upper: The uppper boundary. step_increment: The spinbutton's step increment. page_increment: The spinbutton's page increment (mouse button 2). page_size: The spinbutton's page size. climb_rate: The spinbutton's climb rate. digits: The spinbutton's number of decimal digits.
This function is a shortcut for Gtk::Adjustment::new() and a subsequent Gtk::SpinButton::new() and does some more initialisation stuff like setting a standard minimun horizontal size.
Gimp::UI::scale_entry_new(table, column, row, text, scale_usize, spinbutton_usize, value, lower, upper, step_increment, page_increment, digits, constrain, unconstrained_lower, unconstrained_upper, help_data)
-
table: The Gtk::Table? the widgets will be attached to. column: The column to start with. row: The row to attach the widgets. text: The text for the Gtk::Label? which will appear
left of the ((<Gtk::HScale>)).
scale_usize: The minimum horizontal size of the Gtk::HScale?). spinbutton_usize: The minimum horizontal size of the Gtk::SpinButton?. value: The initial value. lower: The lower boundary. upper: The upper boundary. step_increment: The step increment. page_increment: The page increment. digits: The number of decimal digits. constrain: true if the range of possible values of the
((<Gtk::SpinButton>)) should be the same as of the ((<Gtk::HScale>)).
unconstrained_lower: The spinbutton's lower boundary
if constrain == false.
unconstrained_upper: The spinbutton's upper boundary
if constrain == false.
tooltip: A tooltip message for the scale and the spinbutton. help_data: The widgets' help_data (see Help::set_help_data()).
This function creates a Gtk::Label?, a Gtk::HScale? and a Gtk::SpinButton? and attaches them to a 3-column Gtk::Table.
Note that if you pass a tooltip or help_data to this function you'll have to initialize GIMP's help system with Help::init() before using it.
Returns: The Gtk::SpinButton?'s Gtk::Adjustment?.
引数が多いので注意。 label, scale, scale_adj, spinbutton, spinbutton_adjの5つの特異メソッドが 定義されたGtk::Adjustmentを返します。
Gimp::UI::table_attach_aligned(table, column, row, label_text, xalign, yalign, widget, colspan, left_align)
-
table: The Gtk::Table? the widgets will be attached to. column: The column to start with. row: The row to attach the eidgets. label_text: The text for the Gtk::Label? which will be attached left
of the widget.
xalign: The horizontal alignment of the Gtk::Label. yalign: The vertival alignment of the Gtk::Label. widget: The Gtk::Widget to attach right of the label. colspan: The number of columns the widget will use. left_align: true if the widget should be left-aligned.
Note that the label_text can be nil and that the widget will be attached starting at (column + 1) in this case, too.
Keyword(s):
References:[Gimp::UI] [Gimp-Ruby::Reference Manual]