Commit 8ba62814 authored by Scott Lembcke's avatar Scott Lembcke Committed by Scott Lembcke

Fixed my email address.

2006-08-14  Scott Lembcke <slembcke@cvs.gnome.org>

        * ChangeLog: Fixed my email address.

        * ext/: Merged ids.c and structures.c into definitions.c. Removed
          rbgimpcolorcmyk.c and rbgimpcolorhsv.c.

        * ext/Makefile.am: Changes to reflect changes in ext/. Disabled
          rbgimpcolorspace.c.

        * ext/conversion.c: Removed conversions for the Gimp::HSV and
          Gimp::CMYK classes.

        * ext/rbgimp.*: Minor formating changes. Removed init functions for
          removed/disabled modules.

        * ext/rbgimpconstants.c: Moved the line that defines the
          Gimp::EnumNames module outside the loop. Removed the check for the
          "GIMP_" prefix. Added directory constants.

        * ext/rbgimpdialog.c: Removed the nothing() function. In
          handle_string_types() removed the 'data' variable and replaced it
          with NULL. Removed gettext() calls as it can now be called
          dynamically from Ruby.

        * Changed the way that rb_gimp_main() is used so that plugins that
          don't use an init or quit callback don't define empty callbacks.

        * ext/rub-fu-console.c: Added a gettext() call for the window name.
          Added some commenting and rearranged some code for readability.

        * gimp-lib/rubyfu.rb: Menu items are now registered using
          RubyFu.menu_register(). Added some constants for common RubyFu
          menupaths. Minor readability changes.

        * Added plug-ins/rubyfu_menu.rb to define the Ruby-Fu menu subpaths.

        * Removed plug-ins/coolmetal-logo.rb. It's outlived it's usefulness
          for testing.

        * plug-ins/Makefile.am: Changes to reflect changes in plug-ins/

        * plug-ins/*.rb: Got all non-test plugins gettext ready. Changed all
          to use the new menu registering scheme.

        * plug-ins/runfile.rb: Some fixes were needed due to changes in
          gimp-lib/rubyfu.rb.

        * plug-ins/sphere.rb: Reconverted so that it uses more of the newer
          features.

        * plug-ins/sunset.rb: Changed not to use Context.push/pop. There
          seems to be a bug that prevents custom mode from working correctly
          after the context has been pushed.
parent 43c68e81
2006-08-14 Scott Lembcke <lemb0029@cvs.gnome.org>
2006-08-14 Scott Lembcke <slembcke@cvs.gnome.org>
* ChangeLog: Fixed my email address.
* ext/: Merged ids.c and structures.c into definitions.c. Removed
rbgimpcolorcmyk.c and rbgimpcolorhsv.c.
* ext/Makefile.am: Changes to reflect changes in ext/. Disabled
rbgimpcolorspace.c.
* ext/conversion.c: Removed conversions for the Gimp::HSV and
Gimp::CMYK classes.
* ext/rbgimp.*: Minor formating changes. Removed init functions for
removed/disabled modules.
* ext/rbgimpconstants.c: Moved the line that defines the
Gimp::EnumNames module outside the loop. Removed the check for the
"GIMP_" prefix. Added directory constants.
* ext/rbgimpdialog.c: Removed the nothing() function. In
handle_string_types() removed the 'data' variable and replaced it
with NULL. Removed gettext() calls as it can now be called
dynamically from Ruby.
* Changed the way that rb_gimp_main() is used so that plugins that
don't use an init or quit callback don't define empty callbacks.
* ext/rub-fu-console.c: Added a gettext() call for the window name.
Added some commenting and rearranged some code for readability.
* gimp-lib/rubyfu.rb: Menu items are now registered using
RubyFu.menu_register(). Added some constants for common RubyFu
menupaths. Minor readability changes.
* Added plug-ins/rubyfu_menu.rb to define the Ruby-Fu menu subpaths.
* Removed plug-ins/coolmetal-logo.rb. It's outlived it's usefulness
for testing.
* plug-ins/Makefile.am: Changes to reflect changes in plug-ins/
* plug-ins/*.rb: Got all non-test plugins gettext ready. Changed all
to use the new menu registering scheme.
* plug-ins/runfile.rb: Some fixes were needed due to changes in
gimp-lib/rubyfu.rb.
* plug-ins/sphere.rb: Reconverted so that it uses more of the newer
features.
* plug-ins/sunset.rb: Changed not to use Context.push/pop. There
seems to be a bug that prevents custom mode from working correctly
after the context has been pushed.
2006-08-14 Scott Lembcke <slembcke@cvs.gnome.org>
* gimp-lib/gimp.rb: Renamed bool2int_filter() to ruby2int_filter() and
added support for nil values. Added Drawables to the
......@@ -39,7 +94,7 @@
Minor reformatting and updates to reflect changes in
gimp-lib/pdb.rb.
2006-08-08 Scott Lembcke <lemb0029@gnome.org>
2006-08-08 Scott Lembcke <slembcke@cvs.gnome.org>
* gimp-lib/gimp_oo.rb: Moved OO type class definitions to gimp.rb.
......@@ -86,20 +141,20 @@
* todo.txt: Removed some completed items. Reordered some items
and added a couple of new items.
2006-08-04 Scott Lembcke <lemb0029@gnome.org>
2006-08-04 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/rbgimp.c: Added a Gimp.gettext() method.
* gimp-lib/gimp.rb: Added _() and N_() methods.
2006-08-04 Scott Lembcke <lemb0029@gnome.org>
2006-08-04 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/ruby-fu-dialog.c: Added a '>>' prompt in front of the entry box.
Changed default size for the console window.
* plug-ins/irbconsole.rb: Added a ruby version notification.
2006-08-04 Scott Lembcke <lemb0029@gnome.org>
2006-08-04 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/rbgimpdialog.c: Added a list and multiline text widget. Some
minor simplifications to other parts of the code.
......@@ -108,7 +163,7 @@
* plug-ins/test.rb: Added new widgets to the test dialogs.
2006-08-04 Scott Lembcke <lemb0029@gnome.org>
2006-08-04 Scott Lembcke <slembcke@cvs.gnome.org>
* Added the GPL notification to all source files.
......@@ -136,7 +191,7 @@
* ext/ruby-fu-console.c: Added support file needed by irbconsole.rb
2006-08-03 Scott Lembcke <lemb0029@gnome.org>
2006-08-03 Scott Lembcke <slembcke@cvs.gnome.org>
* gimp-lib/gimp.rb: Now sets $KCODE to UTF8. Removed rubyfu.rb from
list of loaded modules.
......@@ -159,7 +214,7 @@
* ext/rbgimpmain.c: Added Gettext initialization calls.
2006-07-28 Scott Lembcke <lemb0029@gnome.org>
2006-07-28 Scott Lembcke <slembcke@cvs.gnome.org>
* Added plug-ins/irbconsole.rb.
......@@ -171,7 +226,7 @@
version). Added macros that use the minor version number to set
GIMPRUBY_UNSTABLE properly.
2006-07-28 Scott Lembcke <lemb0029@gnome.org>
2006-07-28 Scott Lembcke <slembcke@cvs.gnome.org>
* gimp-lib/gimp_oo.rb: Added the Drawable class and made Layer and
Channel inherit from it.
......@@ -187,7 +242,7 @@
* plug-ins/coolmetal-logo.rb.c: Use ParamDef.FONT instead of
ParamDef.STRING to specify the default font to be used.
2006-07-21 Scott Lembcke <lemb0029@gnome.org>
2006-07-21 Scott Lembcke <slembcke@cvs.gnome.org>
* gimp-lib/rubyfu.rb: Removed some unnecesary code. Clicking 'cancel'
in the dialog will now work correctly. Interactive procedures that
......@@ -200,7 +255,7 @@
* plug-ins/test.rb: Added the new parameter type.
2006-07-21 Scott Lembcke <lemb0029@gnome.org>
2006-07-21 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/rbgimpdialog.c: Changed spacing, padding and alignment of the
widgets. Also fixed some memory leaks where the dialog was not
......@@ -210,7 +265,7 @@
* plug-ins/test.rb: Filled in parameter descriptions for dialog
functions.
2006-07-20 Scott Lembcke <lemb0029@gnome.org>
2006-07-20 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/rbgimpdialog.c: Even more parameter types added.
......@@ -224,14 +279,14 @@
* plug-ins/sphere.rb: Updated to use OO types and new parameter types.
2006-07-19 Scott Lembcke <lemb0029@gnome.org>
2006-07-19 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/rbgimpdialog.c: More parameter types added.
* plug-ins/test.rb: Added more parameter types to the dialog test
procedure.
2006-07-19 Scott Lembcke <lemb0029@gnome.org>
2006-07-19 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/rbgimpdialog.c: More parameter types added.
......@@ -245,7 +300,7 @@
* ext/rbgimpdialog.c: Added missing declaration for mRubyFu.
2006-07-18 Scott Lembcke <lemb0029@gnome.org>
2006-07-18 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/Makefile.am: Added ext/rbgimpdialog.c.
......@@ -259,11 +314,11 @@
* plug-ins/test.rb: Added a procedure to run the dialog.
2006-07-10 Scott Lembcke <lemb0029@gnome.org>
2006-07-10 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/*.c: Style fixes. Swapped stdlib functions for glib ones.
2006-07-08 Scott Lembcke <lemb0029@gnome.org>
2006-07-08 Scott Lembcke <slembcke@cvs.gnome.org>
* Added plug-in/test.rb.
......@@ -280,7 +335,7 @@
* gimp-lib/gimp.rb: Changes in error handling to reflect
gimp-lib/pdb.rb.
2006-07-05 Scott Lembcke <lemb0029@gnome.org>
2006-07-05 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/conversion.c: Finished conversion for parasite parameters.
......@@ -297,7 +352,7 @@
* plug-ins/Makefile.am: Renamed RUBYGIMP_UNSTABLE to GIMPRUBY_UNSTABLE
to match project name. Set its value to 'yes' in configure.in file.
2006-07-01 Scott Lembcke <lemb0029@gnome.org>
2006-07-01 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/ids.c: Added an id for 'flags'.
......@@ -329,7 +384,7 @@
* plug-ins/Makefile.am: Moved hello.rb to the list of test scripts.
Changed a tab to spaces.
2006-06-30 Scott Lembcke <lemb0029@gnome.org>
2006-06-30 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/: Removed all references to array stubs. Arrays are now
converted in place.
......@@ -346,7 +401,7 @@
* ext/: Removed Gimp::ParamRegion structs.
2006-06-27 Scott Lembcke <lemb0029@gnome.org>
2006-06-27 Scott Lembcke <slembcke@cvs.gnome.org>
* gimp-lib/gimp.rb: Added #to_proc to PDB::Procedure.
......@@ -357,7 +412,7 @@
* plug-ins/*: Minor changes to reflect the changes applied to
rubyfu.rb.
2006-06-24 Scott Lembcke <lemb0029@gnome.org>
2006-06-24 Scott Lembcke <slembcke@cvs.gnome.org>
* ext/Makefile.am: Added ext/arraytypes.c.
......
......@@ -16,18 +16,16 @@ lib_LTLIBRARIES = gimpext.la
gimpext_la_SOURCES = \
conversion.c \
ids.c \
definitions.c \
rbgimp.c \
rbgimpcolorcmyk.c \
rbgimpcolorhsv.c \
rbgimpcolorrgb.c \
rbgimpcolorspace.c \
rbgimpconstants.c \
rbgimpdialog.c \
rbgimp.h \
rbgimpmain.c \
rbgimpproceduraldb.c \
structures.c
rbgimpproceduraldb.c
# rbgimpcolorspace.c
gimpext_la_LDFLAGS = -module -avoid-version -shrext $(RUBY_DLEXT) \
$(no_undefined)
......
......@@ -492,56 +492,6 @@ rb2GimpRGB (VALUE color)
return *rb2GimpRGBPtr(color);
}
VALUE
GimpHSV2rb (const GimpHSV *color)
{
GimpHSV *tmp = ALLOC(GimpHSV);
*tmp = *color;
return Data_Wrap_Struct(cGimpHSV, NULL, free, tmp);
}
GimpHSV *
rb2GimpHSVPtr (VALUE color)
{
if (!rb_obj_is_kind_of(color, cGimpHSV))
rb_raise(rb_eTypeError, "Object %s is not a Gimp::HSV", StringValuePtr(color));
GimpHSV *tmp;
Data_Get_Struct(color, GimpHSV, tmp);
return tmp;
}
GimpHSV
rb2GimpHSV (VALUE color)
{
return *rb2GimpHSVPtr(color);
}
VALUE
GimpCMYK2rb (const GimpCMYK *color)
{
GimpCMYK *tmp = ALLOC(GimpCMYK);
*tmp = *color;
return Data_Wrap_Struct(cGimpCMYK, NULL, free, tmp);
}
GimpCMYK *
rb2GimpCMYKPtr (VALUE color)
{
if (!rb_obj_is_kind_of(color, cGimpCMYK))
rb_raise(rb_eTypeError, "Object %s is not a Gimp::CMYK", StringValuePtr(color));
GimpCMYK *tmp;
Data_Get_Struct(color, GimpCMYK, tmp);
return tmp;
}
GimpCMYK
rb2GimpCMYK (VALUE color)
{
return *rb2GimpCMYKPtr(color);
}
VALUE
GimpParasite2rb (GimpParasite leech)
{
......
......@@ -33,9 +33,17 @@ ID id_run_proc;
ID id_call;
ID id_flags;
VALUE sGimpParamDef;
VALUE sGimpParam;
VALUE sGimpPlugInInfo;
VALUE sGimpParamRegion;
VALUE sGimpParasite;
void
Init_ids (void)
Init_definitions (void)
{
/* Define the id's */
id_type = rb_intern("type");
id_name = rb_intern("name");
id_dscr = rb_intern("dscr");
......@@ -46,4 +54,24 @@ Init_ids (void)
id_run_proc = rb_intern("run_proc");
id_call = rb_intern("call");
id_flags = rb_intern("flags");
/* Define the structures */
sGimpParamDef = rb_struct_define("GimpParamDef", "type", "name", "dscr", NULL);
rb_define_const(mGimp, "ParamDef", sGimpParamDef);
sGimpParam = rb_struct_define("GimpParam", "type", "data", NULL);
rb_define_const(mGimp, "Param", sGimpParam);
sGimpPlugInInfo = rb_struct_define("GimpPlugInInfo",
"init_proc",
"quit_proc",
"query_proc",
"run_proc", NULL);
rb_define_const(mGimp, "PlugInInfo", sGimpPlugInInfo);
sGimpParasite = rb_struct_define("GimpParasite",
"name",
"flags",
"data", NULL);
rb_define_const(mGimp, "Parasite", sGimpParasite);
}
......@@ -17,6 +17,8 @@
* 02110-1301, USA.
*/
#include <libintl.h>
#include <ruby.h>
#include <libgimp/gimp.h>
......@@ -139,7 +141,7 @@ rb_gimp_gettext(VALUE self, VALUE rbstr)
void
Init_gimpext (void)
{
mGimp = rb_define_module("Gimp");
mGimp = rb_define_module("Gimp");
rb_define_module_function(mGimp, "getpid", rb_gimp_getpid, 0);
rb_define_module_function(mGimp, "tile_width", rb_gimp_tile_width, 0);
rb_define_module_function(mGimp, "tile_height", rb_gimp_tile_height, 0);
......@@ -158,16 +160,13 @@ Init_gimpext (void)
rb_define_module_function(mGimp, "gettext", rb_gimp_gettext, 1);
Init_structures();
Init_ids();
Init_definitions();
Init_gimpconstants();
Init_gimpmain();
Init_gimpproceduraldb();
Init_gimpcolorrgb();
Init_gimpcolorhsv();
Init_gimpcolorcmyk();
Init_gimpcolorspace();
/*Init_gimpcolorspace();*/
Init_rubyfudialog();
}
......@@ -23,16 +23,27 @@ extern VALUE mGimp;
/* classes */
extern VALUE cGimpRGB;
extern VALUE cGimpHSV;
extern VALUE cGimpCMYK;
/* extern VALUE cGimpHSV;
extern VALUE cGimpCMYK; */
/* structures (structures.c) */
/* structures (definitions.c) */
extern VALUE sGimpParamDef;
extern VALUE sGimpParam;
extern VALUE sGimpPlugInInfo;
extern VALUE sGimpParasite;
extern ID id_type;
extern ID id_name;
extern ID id_dscr;
extern ID id_data;
extern ID id_init_proc;
extern ID id_quit_proc;
extern ID id_query_proc;
extern ID id_run_proc;
extern ID id_call;
extern ID id_flags;
/* Type conversion functions (conversion.c) */
VALUE GimpParam2rb (const GimpParam *param,
......@@ -54,42 +65,18 @@ VALUE GimpRGB2rb (const GimpRGB *color);
GimpRGB *rb2GimpRGBPtr (VALUE color);
GimpRGB rb2GimpRGB (VALUE color);
VALUE GimpHSV2rb (const GimpHSV *color);
GimpHSV *rb2GimpHSVPtr (VALUE color);
GimpHSV rb2GimpHSV (VALUE color);
VALUE GimpCMYK2rb (const GimpCMYK *color);
GimpCMYK *rb2GimpCMYKPtr (VALUE color);
GimpCMYK rb2GimpCMYK (VALUE color);
VALUE GimpParasite2rb (GimpParasite leech);
GimpParasite rb2GimpParasite (VALUE leech);
/* ids (ids.c) */
extern ID id_type;
extern ID id_name;
extern ID id_dscr;
extern ID id_data;
extern ID id_init_proc;
extern ID id_quit_proc;
extern ID id_query_proc;
extern ID id_run_proc;
extern ID id_call;
extern ID id_flags;
/* Init functions */
void Init_structures(void);
void Init_ids(void);
void Init_definitions(void);
void Init_gimpconstants(void);
void Init_gimpmain(void);
void Init_gimpproceduraldb(void);
void Init_gimpcolorrgb(void);
void Init_gimpcolorhsv(void);
void Init_gimpcolorcmyk(void);
void Init_gimpcolorspace(void);
/*void Init_gimpcolorspace(void);*/
void Init_rubyfudialog(void);
/* GIMP-Ruby -- Allows GIMP plugins to be written in Ruby.
* Copyright (C) 2006 Scott Lembcke
*
* 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
* of the License, 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.
*/
#include <ruby.h>
#include <libgimp/gimp.h>
#include "rbgimp.h"
VALUE cGimpCMYK;
static VALUE
rb_gimp_cmyk_alloc (VALUE klass)
{
GimpCMYK *color = ALLOC(GimpCMYK);
return Data_Wrap_Struct(klass, NULL, free, color);
}
static VALUE
rb_gimp_cmyk_initialize (int argc,
VALUE *argv,
VALUE self)
{
volatile VALUE c, m, y, k, a;
rb_scan_args(argc, argv, "05", &c, &m, &y, &k, &a);
GimpCMYK *color;
Data_Get_Struct(self, GimpCMYK, color);
if(argc == 0)
{
color->c = 0.0;
color->m = 0.0;
color->y = 0.0;
color->k = 0.0;
color->a = 1.0;
}
else if(argc == 3)
{
color->c = (gdouble)NUM2DBL(c);
color->m = (gdouble)NUM2DBL(m);
color->y = (gdouble)NUM2DBL(y);
color->k = (gdouble)NUM2DBL(k);
color->a = 1.0;
}
else if(argc == 5)
{
color->c = (gdouble)NUM2DBL(c);
color->m = (gdouble)NUM2DBL(m);
color->y = (gdouble)NUM2DBL(y);
color->k = (gdouble)NUM2DBL(k);
color->a = (gdouble)NUM2DBL(a);
}
else
{
rb_raise(rb_eArgError, "Wrong number of parameters. (0, 4 or 5)");
}
return self;
}
static VALUE
rb_gimp_cmyk_get_c (VALUE self)
{
gdouble result = rb2GimpCMYKPtr(self)->c;
return rb_float_new(result);
}
static VALUE
rb_gimp_cmyk_set_c (VALUE self,
VALUE value)
{
GimpCMYK *color = rb2GimpCMYKPtr(value);
if(rb_obj_is_kind_of(value, rb_cFloat))
{
color->c = (gdouble)NUM2DBL(value);
}
else if(rb_obj_is_kind_of(value, rb_cFixnum))
{
color->c = (gdouble)(NUM2DBL(value)/255.0);
}
else
{
rb_raise(rb_eTypeError, "Argument must be a Float or a Fixnum.");
}
return value;
}
static VALUE
rb_gimp_cmyk_get_m (VALUE self)
{
gdouble result = rb2GimpCMYKPtr(self)->m;
return rb_float_new(result);
}
static VALUE
rb_gimp_cmyk_set_m (VALUE self,
VALUE value)
{
GimpCMYK *color = rb2GimpCMYKPtr(value);
if(rb_obj_is_kind_of(value, rb_cFloat))
{
color->m = (gdouble)NUM2DBL(value);
}
else if(rb_obj_is_kind_of(value, rb_cFixnum))
{
color->m = (gdouble)(NUM2DBL(value)/255.0);
}
else
{
rb_raise(rb_eTypeError, "Argument must be a Float or a Fixnum.");
}
return value;
}
static VALUE
rb_gimp_cmyk_get_y (VALUE self)
{
gdouble result = rb2GimpCMYKPtr(self)->y;
return rb_float_new(result);
}
static VALUE
rb_gimp_cmyk_set_y (VALUE self,
VALUE value)
{
GimpCMYK *color = rb2GimpCMYKPtr(value);
if(rb_obj_is_kind_of(value, rb_cFloat))
{
color->y = (gdouble)NUM2DBL(value);
}
else if(rb_obj_is_kind_of(value, rb_cFixnum))
{
color->y = (gdouble)(NUM2DBL(value)/255.0);
}
else
{
rb_raise(rb_eTypeError, "Argument must be a Float or a Fixnum.");
}
return value;
}
static VALUE
rb_gimp_cmyk_get_k (VALUE self)
{
gdouble result = rb2GimpCMYKPtr(self)->k;
return rb_float_new(result);
}
static VALUE
rb_gimp_cmyk_set_k(VALUE self,
VALUE value)
{
GimpCMYK *color = rb2GimpCMYKPtr(value);
if(rb_obj_is_kind_of(value, rb_cFloat))
{
color->k = (gdouble)NUM2DBL(value);
}
else if(rb_obj_is_kind_of(value, rb_cFixnum))
{
color->k = (gdouble)(NUM2DBL(value)/255.0);
}
else
{
rb_raise(rb_eTypeError, "Argument must be a Float or a Fixnum.");
}
return value;
}
static VALUE
rb_gimp_cmyk_get_a (VALUE self)
{
gdouble result = rb2GimpCMYKPtr(self)->a;
return rb_float_new(result);
}
static VALUE
rb_gimp_cmyk_set_a (VALUE self,
VALUE value)
{
GimpCMYK *color = rb2GimpCMYKPtr(value);
if(rb_obj_is_kind_of(value, rb_cFloat))
{
color->a = (gdouble)NUM2DBL(value);
}
else if(rb_obj_is_kind_of(value, rb_cFixnum))
{
color->a = (gdouble)(NUM2DBL(value)/255.0);
}
else
{
rb_raise(rb_eTypeError, "Argument must be a Float or a Fixnum.");
}
return value;
}
static VALUE
rb_gimp_cmyk_set (VALUE self,
VALUE c,
VALUE m,
VALUE y,
VALUE k)
{
GimpCMYK *color;
Data_Get_Struct(self, GimpCMYK, color);
gimp_cmyk_set(color,
(gdouble)NUM2DBL(c),
(gdouble)NUM2DBL(m),
(gdouble)NUM2DBL(y),
(gdouble)NUM2DBL(k));
return rb_ary_new3(4, c, m, y, k);
}
static VALUE
rb_gimp_cmyka_set (VALUE self,
VALUE c,
VALUE m,
VALUE y,
VALUE k,
VALUE a)
{
GimpCMYK *color;
Data_Get_Struct(self, GimpCMYK, color);
gimp_cmyka_set(color,
(gdouble)NUM2DBL(c),
(gdouble)NUM2DBL(m),
(gdouble)NUM2DBL(y),
(gdouble)NUM2DBL(k),
(gdouble)NUM2DBL(a));
return rb_ary_new3(5, c, m, y, k);
}
static VALUE
rb_gimp_cmyk_get_uchar (VALUE self)
{
guchar c, m, y, k;
gimp_cmyk_get_uchar(rb2GimpCMYKPtr(self), &c, &m, &y, &k);
return rb_ary_new3(4,
INT2NUM(c),
INT2NUM(m),
INT2NUM(y),
INT2NUM(k));
}
static VALUE
rb_gimp_cmyka_get_uchar (VALUE self)
{
guchar c, m, y, k, a;
gimp_cmyka_get_uchar(rb2GimpCMYKPtr(self), &c, &m, &y, &k, &a);
return rb_ary_new3(5,
INT2NUM(c),
INT2NUM(m),
INT2NUM(y),
INT2NUM(k),
INT2NUM(a));
}
static VALUE
rb_gimp_cmyka_set_uchar (VALUE self,
VALUE c,
VALUE m,
VALUE y,
VALUE k,
VALUE a)
{
gimp_cmyka_set_uchar(rb2GimpCMYKPtr(self),
(guchar)NUM2INT(c),
(guchar)NUM2INT(m),
(guchar)NUM2INT(y),
(guchar)NUM2INT(k),