home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 6.6 KB | 219 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: SLIcon.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #ifndef SLICON_H
- #include "SLIcon.h"
- #endif
-
- #ifndef PRICON_H
- #include "PRIcon.h"
- #endif
-
- #ifndef FWODEXCE_H
- #include "FWODExce.h"
- #endif
-
- #ifndef FWSTRMRW_H
- #include "FWStrmRW.h"
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment FWGraphics_Icon
- #endif
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_CreateFromPlatformIcon
- //----------------------------------------------------------------------------------------
-
- FW_HIcon SL_API FW_PrivIcon_CreateFromPlatformIcon(FW_PlatformIcon hIcon,
- FW_PlatformError* error)
- {
- FW_ERR_TRY
- {
- return FW_NEW(FW_CPrivIconRep, (hIcon));
- }
- FW_ERR_CATCH
- return 0;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_CreateFromResource
- //----------------------------------------------------------------------------------------
-
- FW_HIcon SL_API FW_PrivIcon_CreateFromResource(FW_OResourceFile* resourceFile,
- FW_ResourceID resID,
- short size,
- FW_PlatformError* error)
- {
- FW_ERR_TRY
- {
- return FW_NEW(FW_CPrivIconRep, (resourceFile, resID, size));
- }
- FW_ERR_CATCH
- return 0;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_Copy
- //----------------------------------------------------------------------------------------
-
- FW_HIcon SL_API FW_PrivIcon_Copy(FW_HIcon icon, FW_PlatformError* error)
- {
- FW_ERR_TRY
- {
- return FW_NEW(FW_CPrivIconRep, (*icon));
- }
- FW_ERR_CATCH
- return 0;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_Acquire
- //----------------------------------------------------------------------------------------
-
- void SL_API FW_PrivIcon_Acquire(FW_HIcon icon)
- {
- // No try block necessary - Do not throw
- icon->Acquire();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_GetRefCount
- //----------------------------------------------------------------------------------------
-
- long SL_API FW_PrivIcon_GetRefCount(FW_HIcon icon)
- {
- // No try block necessary - Do not throw
- return icon->GetRefCount();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_Release
- //----------------------------------------------------------------------------------------
-
- void SL_API FW_PrivIcon_Release(FW_HIcon icon)
- {
- // No try block necessary - Do not throw
- icon->Release();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_IsEqual
- //----------------------------------------------------------------------------------------
-
- FW_Boolean SL_API FW_PrivIcon_IsEqual(FW_HIcon icon, FW_HIcon icon2)
- {
- // No try block necessary - Do not throw
- return icon->IsEqual(icon2);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_GetPlatformIcon
- //----------------------------------------------------------------------------------------
-
- FW_PlatformIcon SL_API FW_PrivIcon_GetPlatformIcon(FW_HIcon icon)
- {
- // No try block necessary - Do not throw
- return icon->GetPlatformIcon();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_OrphanPlatformIcon
- //----------------------------------------------------------------------------------------
-
- FW_PlatformIcon SL_API FW_PrivIcon_OrphanPlatformIcon(FW_HIcon icon)
- {
- // No try block necessary - Do not throw
- return icon->OrphanPlatformIcon();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_IsPlatformIconOrphan
- //----------------------------------------------------------------------------------------
-
- FW_Boolean SL_API FW_PrivIcon_IsPlatformIconOrphan(FW_HIcon icon)
- {
- // No try block necessary - Do not throw
- return icon->IsPlatformIconOrphan();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_SetPlatformIcon
- //----------------------------------------------------------------------------------------
-
- FW_PlatformError SL_API FW_PrivIcon_SetPlatformIcon(FW_HIcon icon, FW_PlatformIcon newIcon)
- {
- // No try block necessary - Do not throw
- icon->SetPlatformIcon(newIcon);
- return FW_xNoError;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_AdoptPlatformIcon
- //----------------------------------------------------------------------------------------
-
- FW_PlatformError SL_API FW_PrivIcon_AdoptPlatformIcon(FW_HIcon icon, FW_PlatformIcon newIcon)
- {
- // No try block necessary - Do not throw
- icon->AdoptPlatformIcon(newIcon);
- return FW_xNoError;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_GetIconSize
- //----------------------------------------------------------------------------------------
-
- void SL_API FW_PrivIcon_GetIconSize(FW_HIcon icon, FW_SPoint& size)
- {
- // No try block necessary - Do not throw
- icon->GetIconSize(size);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_GetIconSizeGC
- //----------------------------------------------------------------------------------------
-
- void SL_API FW_PrivIcon_GetIconSizeGC(Environment* ev, FW_HIcon icon, FW_SGraphicContext& gc, FW_SPoint& size)
- {
- // No try block necessary - Do not throw
- icon->GetIconSize(ev, gc, size);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_Read
- //----------------------------------------------------------------------------------------
-
- FW_HIcon SL_API FW_PrivIcon_Read(FW_HReadableStream hStream, FW_PlatformError* error)
- {
- FW_ERR_TRY
- {
- FW_CReadableStream stream(hStream);
- return FW_NEW(FW_CPrivIconRep, (stream));
- }
- FW_ERR_CATCH
- return 0;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PrivIcon_Write
- //----------------------------------------------------------------------------------------
-
- void SL_API FW_PrivIcon_Write(FW_HIcon icon, FW_HWritableStream hStream, FW_PlatformError* error)
- {
- FW_ERR_TRY
- {
- FW_CWritableStream stream(hStream);
- icon->Write(stream);
- }
- FW_ERR_CATCH
- }
-
-