/* Copyright (C) 2001 Johan Rydberg. All Rights Reserved. This file is part of Crust. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __ServicesFoundation_SFSurface_h #define __ServicesFoundation_SFSurface_h 1 #include #include #include #include /* Common transparency levels for a surface. */ #define kSFSurfaceNotTransparent 1.00 #define kSFSurfaceNormalTransparent 0.70 #define kSFSurfaceTotalTransparent 0.30 /* Opaque type for a reference to a surface. */ typedef struct SFSurface *SFSurfaceRef; /* Opaque type for a reference to a tracking area. */ typedef struct SFTrackingArea *SFTrackingAreaRef; /* Create a new surface. A refernece to the surface is returned upon success - NULL otherwise. OPACITY is the level of transparency the surface will have. See above for definitions of common opacity values. */ SF_EXTERN SFSurfaceRef SFSurfaceCreate (GFSize size, float opacity); /* Retain a reference to SURFACE. */ SF_EXTERN void SFSurfaceRetain (SFSurfaceRef surface); /* Release a reference to SURFACE. */ SF_EXTERN void SFSurfaceRelease (SFSurfaceRef surface); /* Set opacity for SURFACE to OPACITY. */ SF_EXTERN void SFSurfaceSetOpacity (SFSurfaceRef surface, float opacity); /* Set event mask for SURFACE to MASK. */ SF_EXTERN void SFSurfaceSetEventMask (SFSurfaceRef surface, unsigned int mask); /* Decreases the map counter for SURFACE. Makes it visible if counter drops to zero. */ SF_EXTERN void SFSurfaceMap (SFSurfaceRef surface); /* Increases the map counter for SURFACE. Makes it invisible. */ SF_EXTERN void SFSurfaceUnmap (SFSurfaceRef surface); /* Update region coverd by RECT in SURFACE. */ SF_EXTERN void SFSurfaceUpdateRegion (SFSurfaceRef surface, GFRect rect); /* Get graphic context for SURFACE. */ SF_EXTERN GFContextRef SFSurfaceGetContext (SFSurfaceRef surface); /* Return a image for content of SURFACE. */ SF_EXTERN GFImageRef SFSurfaceCreateImageReference (SFSurfaceRef surface); /* Return a image for content of SURFACE. */ SF_EXTERN GFImageRef SFSurfaceContentImage (SFSurfaceRef surface); /* Tracking area functions. */ SF_EXTERN void SFTrackingAreaGrabCursor (SFTrackingAreaRef tracking_area); SF_EXTERN void SFTrackingAreaUngrabCursor (SFTrackingAreaRef tracking_area); SF_EXTERN void *SFTrackingAreaUserData (SFTrackingAreaRef tracking_area); #endif /* SFSurface.h */