Skip to content

Commit

Permalink
Updated #240: Removed Subtle::Sublet#background= and Subtle::Sublet#f…
Browse files Browse the repository at this point in the history
…oreground=
  • Loading branch information
unexist committed Aug 2, 2011
1 parent 43c333c commit 286670c
Showing 1 changed file with 0 additions and 96 deletions.
96 changes: 0 additions & 96 deletions src/subtlext/sublet.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,102 +259,6 @@ subSubletDataWriter(VALUE self,
return value;
} /* }}} */

/* subSubletForegroundWriter {{{ */
/*
* call-seq: foreground=(string) -> nil
* foreground=(array) -> nil
* foreground=(hash) -> nil
* foreground=(fixnum) -> nil
* foreground=(color) -> nil
*
* Set the foreground color of this Sublet which can be of
* following types:
*
* [String] Any color representation of Xlib is allowed
* [Array] Must be an array with values for red, green and blue
* [Hash] Must be a hash with values for red, green and blue
* [Fixnum] Pixel representation of a color in Xlib
* [Color] Copy color from a Color object
*
* sublet.foreground = "#ff0000"
* => nil
*/

VALUE
subSubletForegroundWriter(VALUE self,
VALUE value)
{
VALUE id = Qnil;

/* Check ruby object */
rb_check_frozen(self);
GET_ATTR(self, "@id", id);

/* Check object type */
if(T_STRING == rb_type(value))
{
SubMessageData data = { { 0, 0, 0, 0, 0 } };

data.l[0] = FIX2INT(id);
data.l[1] = subSharedParseColor(display, RSTRING_PTR(value));

subSharedMessage(display, DefaultRootWindow(display),
"SUBTLE_SUBLET_FOREGROUND", data, 32, True);
}
else rb_raise(rb_eArgError, "Unexpected value-type `%s'",
rb_obj_classname(value));

return value;
} /* }}} */

/* subSubletBackgroundWriter {{{ */
/*
* call-seq: background=(string) -> nil
* background=(array) -> nil
* background=(hash) -> nil
* background=(fixnum) -> nil
* background=(color) -> nil
*
* Set the background color of this Sublet which can be of
* following types:
*
* [String] Any color representation of Xlib is allowed
* [Array] Must be an array with values for red, green and blue
* [Hash] Must be a hash with values for red, green and blue
* [Fixnum] Pixel representation of a color in Xlib
* [Color] Copy color from a Color object
*
* sublet.background = "#ff0000"
* => nil
*/

VALUE
subSubletBackgroundWriter(VALUE self,
VALUE value)
{
VALUE id = Qnil;

/* Check ruby object */
rb_check_frozen(self);
GET_ATTR(self, "@id", id);

/* Check object type */
if(T_STRING == rb_type(value))
{
SubMessageData data = { { 0, 0, 0, 0, 0 } };

data.l[0] = FIX2INT(rb_iv_get(self, "@id"));
data.l[1] = subSharedParseColor(display, RSTRING_PTR(value));

subSharedMessage(display, DefaultRootWindow(display),
"SUBTLE_SUBLET_BACKGROUND", data, 32, True);
}
else rb_raise(rb_eArgError, "Unexpected value-type `%s'",
rb_obj_classname(value));

return value;
} /* }}} */

/* subSubletVisibilityShow {{{ */
/*
* call-seq: show -> nil
Expand Down

0 comments on commit 286670c

Please sign in to comment.