Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 127 lines (118 sloc) 4.298 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
/***********************************************************************
 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * For further information please contact the author by e-mail
 * at "lyle@lylejohnson.name".
 ***********************************************************************/


/// Icon class
class FXIcon : public FXImage {
protected:
  FXID shape; // Shape pixmap
  FXID etch; // Etch pixmap
  FXColor transp; // Transparency color
protected:
  FXIcon(){}
  FXColor guesstransp();
public:
  %extend {
    /**
    * Create an icon with an initial pixel buffer pix, a transparent color clr,
    * and options as in FXImage.
    */
    FXIcon(FXApp* a,const FXColor *PIXELS=NULL,FXColor clr=0,FXuint opts=0,FXint w=1,FXint h=1){
      return new FXRbIcon(a,PIXELS,clr,opts,w,h);
      }
    }

  /// Obtain transparency color
  FXColor getTransparentColor() const;
  
  /// Change transparency color
  void setTransparentColor(FXColor color);
 
  /// Destructor
  virtual ~FXIcon();
  };


DECLARE_FXOBJECT_VIRTUALS(FXIcon)
DECLARE_FXID_VIRTUALS(FXIcon)
DECLARE_FXDRAWABLE_VIRTUALS(FXIcon)
DECLARE_FXIMAGE_VIRTUALS(FXIcon)

%{
static swig_type_info *FXIcon_dynamic_cast(void **ptr) {
    FXIcon **ppIcon = reinterpret_cast<FXIcon **>(ptr);
    FXBMPIcon *pBMPIcon=dynamic_cast<FXBMPIcon*>(*ppIcon);
    if(pBMPIcon){
      *ptr=reinterpret_cast<void*>(pBMPIcon);
      return SWIG_TypeQuery("FXBMPIcon *");
      }
    FXGIFIcon *pGIFIcon=dynamic_cast<FXGIFIcon*>(*ppIcon);
    if(pGIFIcon){
      *ptr=reinterpret_cast<void*>(pGIFIcon);
      return SWIG_TypeQuery("FXGIFIcon *");
      }
    FXICOIcon *pICOIcon=dynamic_cast<FXICOIcon*>(*ppIcon);
    if(pICOIcon){
      *ptr=reinterpret_cast<void*>(pICOIcon);
      return SWIG_TypeQuery("FXICOIcon *");
      }
    FXJPGIcon *pJPGIcon=dynamic_cast<FXJPGIcon*>(*ppIcon);
    if(pJPGIcon){
      *ptr=reinterpret_cast<void*>(pJPGIcon);
      return SWIG_TypeQuery("FXJPGIcon *");
      }
    FXPCXIcon *pPCXIcon=dynamic_cast<FXPCXIcon*>(*ppIcon);
    if(pPCXIcon){
      *ptr=reinterpret_cast<void*>(pPCXIcon);
      return SWIG_TypeQuery("FXPCXIcon *");
      }
    FXPNGIcon *pPNGIcon=dynamic_cast<FXPNGIcon*>(*ppIcon);
    if(pPNGIcon){
      *ptr=reinterpret_cast<void*>(pPNGIcon);
      return SWIG_TypeQuery("FXPNGIcon *");
      }
    FXPPMIcon *pPPMIcon=dynamic_cast<FXPPMIcon*>(*ppIcon);
    if(pPPMIcon){
      *ptr=reinterpret_cast<void*>(pPPMIcon);
      return SWIG_TypeQuery("FXPPMIcon *");
      }
    FXRGBIcon *pRGBIcon=dynamic_cast<FXRGBIcon*>(*ppIcon);
    if(pRGBIcon){
      *ptr=reinterpret_cast<void*>(pRGBIcon);
      return SWIG_TypeQuery("FXRGBIcon *");
      }
    FXTGAIcon *pTGAIcon=dynamic_cast<FXTGAIcon*>(*ppIcon);
    if(pTGAIcon){
      *ptr=reinterpret_cast<void*>(pTGAIcon);
      return SWIG_TypeQuery("FXTGAIcon *");
      }
    FXTIFIcon *pTIFIcon=dynamic_cast<FXTIFIcon*>(*ppIcon);
    if(pTIFIcon){
      *ptr=reinterpret_cast<void*>(pTIFIcon);
      return SWIG_TypeQuery("FXTIFIcon *");
      }
    FXXBMIcon *pXBMIcon=dynamic_cast<FXXBMIcon*>(*ppIcon);
    if(pXBMIcon){
      *ptr=reinterpret_cast<void*>(pXBMIcon);
      return SWIG_TypeQuery("FXXBMIcon *");
      }
    FXXPMIcon *pXPMIcon=dynamic_cast<FXXPMIcon*>(*ppIcon);
    if(pXPMIcon){
      *ptr=reinterpret_cast<void*>(pXPMIcon);
      return SWIG_TypeQuery("FXXPMIcon *");
      }
    return 0;
}
%}

DYNAMIC_CAST(SWIGTYPE_p_FXIcon, FXIcon_dynamic_cast);
Something went wrong with that request. Please try again.