/* Public defintions for layers. 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_SFLayer_h #define __ServicesFoundation_SFLayer_h 1 #include #include #include /* Layers are just containers for other layers (sublayers) and surfaces. A layer can never receive an event. */ /* Opaque type for a layer reference. */ typedef struct SFLayer *SFLayerRef; /* Retain a reference to LAYER. */ SF_EXTERN void SFLayerRetain (SFLayerRef layer); /* Release a reference to LAYER. If reference counter drops to zero the layer is destroyed. ?? what about surfaces? */ SF_EXTERN void SFLayerRelease (SFLayerRef layer); /* Get toplevel layer for layer level LEVEL. A reference to the layer is returned. The user is responsible to realse it. */ SF_EXTERN SFLayerRef SFLayerGetToplevel (int level); /* Map a layer - making sublayers and surfaces visible (if their own map counter is zero). */ SF_EXTERN void SFLayerMap (SFLayerRef layer); /* Unmap LAYER - making it (and sublayers) invisible. */ SF_EXTERN void SFLayerUnmap (SFLayerRef layer); /* Create a sublayer to PARENT. RECT specifies the location and size of the new sublayer. Reference to new layer is returned. */ SF_EXTERN SFLayerRef SFLayerCreate (SFLayerRef parent, GFRect rect); /* Insert SURFACE into LAYER at POINT. */ SF_EXTERN void SFLayerInsertSurface (SFLayerRef layer, SFSurfaceRef surface, GFPoint point); /* Same as SFLayerGetToplevel but does not contact the application server to fetch the layer. This should NOT be used by applications. */ SF_EXTERN SFLayerRef SFLayerGetRealToplevel (int level); /* Return size of LAYER. */ SF_EXTERN GFSize SFLayerSize (SFLayerRef layer); /* Move LAYER to (X, Y). */ SF_EXTERN void SFLayerMove (SFLayerRef layer, int x, int y); /* Move layer realtive to current position. */ SF_EXTERN void SFLayerMoveRelative (SFLayerRef layer, int dx, int dy); /* Returns a reference to parent layer to LAYER. */ SF_EXTERN SFLayerRef SFLayerGetParent (SFLayerRef layer); #endif /* SFLayer.h */