Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 91 lines (77 sloc) 2.651 kb
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
1 /***********************************************************************
2 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
b8219ec @lylejohnson Updated copyright notice for all SWIG interface files
lylejohnson authored
3 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * For further information please contact the author by e-mail
a934547 @lylejohnson Replaced e-mail address "lyle@users.sourceforge.net" with
lylejohnson authored
20 * at "lyle@lylejohnson.name".
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
21 ***********************************************************************/
22
23
24 /// IRIS RGB icon
25 class FXRGBIcon : public FXIcon {
26 protected:
27 FXRGBIcon(){}
28 public:
29 %extend {
30 static VALUE fileExt() {
31 return rb_str_new2(FXRGBIcon::fileExt);
32 }
33
34 static VALUE mimeType() {
35 return rb_str_new2(FXRGBIcon::mimeType);
36 }
37 }
38 public:
39
40 /// Construct icon from memory stream formatted in IRIS-RGB format
41 %extend {
42 FXRGBIcon(FXApp* a,const void *pix=NULL,FXColor clr=0,FXuint opts=0,FXint w=1,FXint h=1){
43 return new FXRbRGBIcon(a,pix,clr,opts,w,h);
44 }
45 }
46
47 /// Destroy icon
48 virtual ~FXRGBIcon();
49 };
50
51
52 DECLARE_FXOBJECT_VIRTUALS(FXRGBIcon)
53 DECLARE_FXID_VIRTUALS(FXRGBIcon)
54 DECLARE_FXDRAWABLE_VIRTUALS(FXRGBIcon)
55 DECLARE_FXIMAGE_VIRTUALS(FXRGBIcon)
56
57
58 %inline %{
59 /**
60 * Load an RGB (SGI IRIS RGB) file from a stream.
61 * Upon successful return, the pixel array and size are returned.
62 * If an error occurred, the pixel array is set to NULL.
63 */
64 VALUE fxloadRGB(FXStream& store){
65 FXColor* data;
66 FXint width;
67 FXint height;
68 if(fxloadRGB(store,data,width,height)){
69 VALUE ary=rb_ary_new();
70 rb_ary_push(ary,FXRbMakeColorArray(data,width,height));
71 FXFREE(&data);
72 rb_ary_push(ary,to_ruby(width));
73 rb_ary_push(ary,to_ruby(height));
74 return ary;
75 }
76 else{
77 return Qnil;
78 }
79 }
80 %}
81
82
83 /// Save an RGB file to a stream
84 bool fxsaveRGB(FXStream& store,const FXColor *PIXELS,FXint width,FXint height);
85
86 /**
87 * Check if stream contains a bitmap, return TRUE if so.
88 */
89 bool fxcheckRGB(FXStream& store);
90
Something went wrong with that request. Please try again.