wg_resources.h

00001 // wg_resources.h
00002 //
00003 // wgui resources
00004 //
00005 //
00006 // Copyright (c) 2002-2004 Rob Wiskow
00007 // rob-dev@boxedchaos.com
00008 //
00009 // This library is free software; you can redistribute it and/or
00010 // modify it under the terms of the GNU Lesser General Public
00011 // License as published by the Free Software Foundation; either
00012 // version 2.1 of the License, or (at your option) any later version.
00013 //
00014 // This library is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017 // Lesser General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU Lesser General Public
00020 // License along with this library; if not, write to the Free Software
00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00022 //
00023 
00024 
00025 #ifndef _WG_RESOURCES_H_
00026 #define _WG_RESOURCES_H_
00027 
00028 #include "SDL.h"
00029 #include "wg_resource_handle.h"
00030 #include "wg_color.h"
00031 
00032 
00033 namespace wGui
00034 {
00035 
00037 enum EwgResourceId {
00038 // Bitmaps
00039      WGRES_UP_ARROW_BITMAP = 1,
00040      WGRES_DOWN_ARROW_BITMAP,
00041      WGRES_LEFT_ARROW_BITMAP,
00042      WGRES_RIGHT_ARROW_BITMAP,
00043      WGRES_X_BITMAP,
00044      WGRES_MAXIMIZE_UNMAXED_BITMAP,
00045      WGRES_MAXIMIZE_MAXED_BITMAP,
00046      WGRES_MINIMIZE_BITMAP,
00047 
00048 // Strings
00049      WGRES_WGUI_STRING,
00050      WGRES_VERSION_STRING,
00051 
00052 // Cursors
00053      WGRES_POINTER_CURSOR,
00054      WGRES_IBEAM_CURSOR,
00055      WGRES_WAIT_CURSOR,
00056      WGRES_MOVE_CURSOR,
00057      WGRES_ZOOM_CURSOR
00058 };
00059 
00060 
00061 // Since the internal resources will probably be used fairly frequently,
00062 // we cheat a little and keep a clone of any that have been instantiated for the lifetime for the program
00063 //static std::set<CResourceHandle> wgInternalResourcePool;
00064 
00065 
00067 
00068 class CwgBitmapResourceHandle : public CBitmapResourceHandle
00069 {
00070 public:
00073      CwgBitmapResourceHandle(EwgResourceId resId);
00074 
00075 private:
00076      SDL_Surface* DrawBitmap(CRGBColor Data[], int iDataLength, int iWidth, int iHeight) const;
00077 };
00078 
00079 
00081 
00082 class CwgStringResourceHandle : public CStringResourceHandle
00083 {
00084 public:
00087      CwgStringResourceHandle(EwgResourceId resId);
00088 };
00089 
00090 
00092 
00093 class CwgCursorResourceHandle : public CCursorResourceHandle
00094 {
00095 public:
00098      CwgCursorResourceHandle(EwgResourceId resId);
00099 
00100 private:
00101      enum ECursorDataMask {
00102           O, // empty
00103           M, // masked
00104           D, // data
00105           X // data and mask
00106      };
00107 
00108      SDL_Cursor* CreateCursor(const char DataIn[], int iDataLength, int iWidth, int iHeight, int iXHotSpot, int iYHotSpot) const;
00109 };
00110 
00111 }
00112 
00113 #endif  // _WG_RESOURCES_H_
00114 

Generated on Wed May 16 23:11:26 2007 for wGui by  doxygen 1.5.1