From: <sun...@us...> - 2004-03-23 16:00:00
|
Update of /cvsroot/crystal/CS/include/ivideo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21721/include/ivideo Modified Files: custcursor.h Log Message: Eric Sunshine made the following changes: -*- Upgraded the iCursor documentation and interface so that it uses the term "transparency" rather than "alpha" (since "alpha" was misleading), and also indicates the range of transparency values and their meanings. Also cleaned up some other anomalies in the interface. -*- Fixed a potential crasher in csRenderMeshHolderMultiple::GetUnusedMeshes() where it blindly accessed element zero of the renderMeshes[] array without checking if the array contained any elements. Index: custcursor.h =================================================================== RCS file: /cvsroot/crystal/CS/include/ivideo/custcursor.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- custcursor.h 14 Jan 2004 15:21:40 -0000 1.2 +++ custcursor.h 23 Mar 2004 15:49:31 -0000 1.3 @@ -1,4 +1,6 @@ /* + Copyright (C)2003 by Neil Mosafi + 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 @@ -32,68 +34,73 @@ * This interface is used to access the custom cursor plugin, which * handles processing for displaying pixmaps as cursors. Any number * of cursors can be set, indexed by key strings, along with - * hotspots, and alpha transparency. Supports both static - * csSimplePixmap cursors and csAnimatedPixmap cursors. + * hotspots, and transparency. Supports any static iImage. */ struct iCursor : public iBase { /** * Must be called before custom cursors will be displayed. If you want to - * use software emulation mode on all platforms, set the forceEmulation + * use software emulation mode on all platforms, set the ForceEmulation * argument to true. */ - virtual bool Setup (iGraphics3D *, bool forceEmulation = false) = 0; + virtual bool Setup (iGraphics3D *, bool ForceEmulation = false) = 0; - /// Load cursor settings from a config file in VFS - virtual bool ParseConfigFile (const char *iFile) = 0; + /// Load cursor settings from a configuration file in VFS + virtual bool ParseConfigFile (const char *) = 0; /** - * Adds or replaces a cursor called name. Currently you can only register - * an iImage - a simple pixmap will then be created for use in emulation mode + * Adds or replaces a cursor called name. Currently you can only register an + * iImage - a simple pixmap will then be created for use in emulation mode. + * The 'transparency' can range from 0 (completely opaque) to 255 (completely + * transparent). */ virtual void SetCursor (const char *name, iImage *image, csRGBcolor keycolor, - csPoint hotspot = csPoint (0,0), uint8 alpha = 0, + csPoint hotspot = csPoint (0,0), + uint8 transparency = 0, csRGBcolor fg = csRGBcolor (255,255,255), csRGBcolor bg = csRGBcolor (0,0,0)) = 0; /// Sets the hotspot (center) of the specified cursor on the pixmap. - virtual void SetHotspot (const char *name, csPoint hotspot) = 0; + virtual void SetHotSpot (const char *name, csPoint hotspot) = 0; /** - * Sets the alpha transparency of the specified cursor. This will only - * work if the OS supports this, or you are in emulation mode + * Sets the transparency of the specified cursor. The 'transparency' + * can range from 0 (completely opaque) to 255 (completely transparent) This + * will only work if the video driver supports transparency for cursors, or + * the cursor is being emulated. */ - virtual void SetAlpha (const char *name, uint8 alpha) = 0; + virtual void SetTransparency(const char *name, uint8 transparancy) = 0; /// Set key colour of the specified cursor. - virtual void SetKeyColor (const char *name, csRGBcolor col) = 0; + virtual void SetKeyColor (const char *name, csRGBcolor) = 0; /** * Set the foreground and background colors of the cursor. These will only - * be used when in OS mode on systems which only support monochrome cursors + * be used for graphics drivers which support only monochrome cursors. */ virtual void SetColor (const char *name, csRGBcolor fg, csRGBcolor bg) = 0; /** - * Get cursor image of the specified cursor - * Returns a reference to NULL if there is no cursor with this name. This - * getter safely can be used to check if a cursor is defined or not without - * switching + * Get cursor image of the specified cursor. The returned reference is + * invalid -- check with csRef<>::IsValid() -- if the cursor is not + * registered. This getter safely can be used to check if a cursor is + * defined or not without switching cursors. */ - virtual const csRef<iImage> GetCursorImage (const char *name) const = 0; + virtual csRef<iImage> GetCursorImage (const char *name) const = 0; /** * Get the hotspot (center) of the specified cursor on the pixmap. * Returns default 0,0 if there is no cursor with this name */ - virtual csPoint GetHotspot (const char *name) const = 0; + virtual csPoint GetHotSpot (const char *name) const = 0; /** - * Get the alpha transparency of the specified cursor. - * Returns default 0 if there is no cursor with this name + * Get the transparency of the specified cursor. Transparency can range from + * 0 (completely opaque) to 255 (completely transparent). Returns default 0 + * if there is no cursor with this name. */ - virtual uint8 GetAlpha (const char *name) const = 0; + virtual uint8 GetTransparency (const char *name) const = 0; /** * Get key colour of the specified cursor. @@ -102,16 +109,16 @@ virtual csRGBcolor GetKeyColor (const char *name) const = 0; /** - * Get the foreground color of the cursor. These will only be used when - * in OS mode on systems which only support monochrome cursors - * Returns default 255,255,255 if there is no cursor with this name + * Get the foreground color of the cursor. These will only + * be used for graphics drivers which support only monochrome cursors. + * Returns default 255,255,255 if there is no cursor with this name. */ virtual csRGBcolor GetFGColor (const char *name) const = 0; /** - * Get the background color of the cursor. These will only be used when - * in OS mode on systems which only support monochrome cursors - * Returns default 0,0,0 if there is no cursor with this name + * Get the background color of the cursor. These will only + * be used for graphics drivers which support only monochrome cursors. + * Returns default 0,0,0 if there is no cursor with this name. */ virtual csRGBcolor GetBGColor (const char *name) const = 0; |