Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 93 lines (81 sloc) 2.76 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 /// ICO icon
25 class FXICOIcon : public FXIcon {
26 protected:
27 FXICOIcon(){}
28 public:
29 %extend {
30 static VALUE fileExt() {
31 return rb_str_new2(FXICOIcon::fileExt);
32 }
33 static VALUE mimeType() {
34 return rb_str_new2(FXICOIcon::mimeType);
35 }
36 }
37 public:
38 %extend {
39 /// Construct icon from memory stream formatted in Microsoft ICO format
40 FXICOIcon(FXApp* a,const void *pix=NULL,FXColor clr=0,FXuint opts=0,FXint w=1,FXint h=1){
41 return new FXRbICOIcon(a,pix,clr,opts,w,h);
42 }
43 }
44
45 /// Destroy icon
46 virtual ~FXICOIcon();
47 };
48
49
50 DECLARE_FXOBJECT_VIRTUALS(FXICOIcon)
51 DECLARE_FXID_VIRTUALS(FXICOIcon)
52 DECLARE_FXDRAWABLE_VIRTUALS(FXICOIcon)
53 DECLARE_FXIMAGE_VIRTUALS(FXICOIcon)
54
55
56 %inline %{
57 /**
58 * Load an ICO (Microsoft icon format) file from a stream.
59 * Upon successful return, the pixel array and size are returned.
60 * If an error occurred, the pixel array is set to NULL.
61 */
62 VALUE fxloadICO(FXStream& store){
63 FXColor* data;
64 FXint width;
65 FXint height;
66 FXint xspot;
67 FXint yspot;
68 if(fxloadICO(store,data,width,height,xspot,yspot)){
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 rb_ary_push(ary,to_ruby(xspot));
75 rb_ary_push(ary,to_ruby(yspot));
76 return ary;
77 }
78 else{
79 return Qnil;
80 }
81 }
82 %}
83
84
85 /// Save a ICO file to a stream
86 bool fxsaveICO(FXStream& store,const FXColor *PIXELS,FXint width,FXint height,FXint xspot=-1,FXint yspot=-1);
87
88 /**
89 * Check if stream contains a ICO, return TRUE if so.
90 */
91 bool fxcheckICO(FXStream& store);
92
Something went wrong with that request. Please try again.