home *** CD-ROM | disk | FTP | other *** search
- /*
- IconLib.c - routines over and above RISC_OSLib and DeskLib.
- */
- /*
-
- ##### # #
- # # # # #
- # # #
- # ## #### #### # ## ####
- # # # # # # # # # #
- # # # # # ### # # # #
- # # # # # # # # # #
- # ### # # # #### ##### ### ####
-
- -----------------------------------------------------------------------------
-
- This is source for use with the 'DeskLib' Wimp C programming library for
- Risc OS. I currently use v1.04 of DeskLib. This source is FreeWare, which
- means you can use it to write commercial applications, but you may not charge
- *in any way* for the distribution of this source. I (Tim Browse) retain
- all copyright on this source.
-
- This source is provided 'as is' and I offer no guarantees that is useful,
- bug-free, commented, that it will compile, or even that it exists.
-
- If it breaks in half, you own both pieces.
-
- All source © Tim Browse 1993
-
- -----------------------------------------------------------------------------
-
- */
-
- /* ANSI includes */
- #include "stdlib.h"
-
- /* DeskLib includes */
- #include "DeskLib.Wimp.h"
-
- #include "IconLib.h"
-
- void IconLib_DisposeIndData(icon_data *data, icon_flags flags)
- {
- /* make sure this icon is indirected - exit quietly if not */
- if ((data == NULL) || (!flags.data.indirected))
- return;
-
- /* it's indirected - free the data */
- switch (ICON_TYPE(flags.value))
- {
- case TXT_ONLY:
- case TXT_AND_SPR:
-
- /* Free text buffer */
- free(data->indirecttext.buffer);
-
- /* Free validation string, if there is one */
- if ((data->indirecttext.validstring != NULL) &&
- (data->indirecttext.validstring != (char *) 0xffffffff))
- free(data->indirecttext.validstring);
- break;
-
- case SPR_ONLY:
- if (data->indirectsprite.nameisname)
- free((void *) data->indirectsprite.name);
- break;
- }
- }
-