/* Window defintions. 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_SFWindow_h #define __ServicesFoundation_SFWindow_h 1 #include #include #include #include /* Opaque type for a window reference. */ typedef struct SFWindow *SFWindowRef; /* Common window levels. */ enum _SFWindowLevel { kSFNormalWindowLevel = 10, kSFFloatingWindowLevel = 11, kSFDockWindowLevel = 12, kSFPopupMenuWindowLevel = 13, kSFMainMenuWindowLevel = 14 }; typedef enum _SFWindowLevel SFWindowLevel; /* Bitmap masks to determine certain window styles. */ enum _SFWindowStyleMask { kSFBorderlessWindowMask = 0x01, kSFTitledWindowMask = 0x02, kSFClosableWindowMask = 0x04, kSFMiniaturizableWindowMask = 0x08, kSFResizableWindowMask = 0x10, kSFNotTransparentWindowMask = 0x20, kSFNoShadowWindowMask = 0x40 }; typedef enum _SFWindowStyleMask SFWindowStyleMask; /* Gets the frame rectangle for content rectangle RECT in a window of type STYLE_MASK. */ SF_EXTERN GFRect SFWindowFrameRectForContentRect (GFRect rect, SFWindowStyleMask style_mask); /* Gets the content rectangle for frame rectangle RECT in a window of type STYLE_MASK. */ SF_EXTERN GFRect SFWindowContentRectForFrameRect (GFRect rect, SFWindowStyleMask style_mask); /* Returns the minimum frame width needed for TITLE in a window of type STYLE_MASK. */ SF_EXTERN float SFWindowMinFrameWidthWithTitle (char *title, SFWindowStyleMask style_mask); /* Creates a new window at window level LEVEL with and window style as indicated in STYPE_MASK mask. RECT is the frame rectangle of the window. A reference to the window is returned. */ SF_EXTERN SFWindowRef SFWindowCreate (GFRect rect, SFWindowStyleMask style_mask, char *title, SFWindowLevel level); /* Return a reference to content image for WINDOW. */ SF_EXTERN GFImageRef SFWindowContentImage (SFWindowRef window); /* Decrease map counter for WINDOW and makes it visible if it drops to zero. ??? SFWindowMap instead??? */ SF_EXTERN void SFWindowShow (SFWindowRef window); /* Update region RECT in window. */ SF_EXTERN void SFWindowUpdateRegion (SFWindowRef window, GFRect rect); /* Create a tracking area in window. */ SF_EXTERN SFTrackingAreaRef SFWindowAddTrackingArea (SFWindowRef window, GFRect rect, unsigned int event_mask, void *user_data); #endif /* SFWindow.h */