/* 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_SXWindowTheme_h #define __ServicesFoundation_SXWIndowTheme_h #include #include #include #include /* Theme element - holds a image pixbuf and information how the pixbuf should be positioned and scaled (???). All parts of the element is not always used. There are two pixbufs: One if the element is active and one if the element is inactive. If the element can only be in one state the active pixbuf is just used. */ struct SXWindowThemeElement { GFImageRef pixbuf_active; GFImageRef pixbuf_inactive; unsigned int position_left :1; unsigned int position_right :1; unsigned int position_center :1; unsigned int scale_tofit :1; unsigned int scale_tile :1; /* This is an offset from the edge of the window. It is only used for left and right positioned elements. If it is right positioned this value is negative. */ int offset; /* ??? state. */ int state; }; typedef struct SXWindowThemeElement *SXWindowThemeElementRef; /* Font element for a theme. Contains information about font family, font style and font size. ??? add color? */ struct SXWindowThemeFont { char *font_family; char *font_style; float font_size; int font_handle; }; /* Titlebar part of a window. */ struct SXWindowThemeTitlebar { /* Height of the titlebar. */ unsigned int height; /* Font used for the title. */ struct SXWindowThemeFont font; /* Opacity value for the titlebar. */ double opacity; /* Elements: bar, close, minimize, maximize. */ struct SXWindowThemeElement element_bar_text; struct SXWindowThemeElement element_bar_nontext; struct SXWindowThemeElement element_bar_trans; struct SXWindowThemeElement element_close; struct SXWindowThemeElement element_minimize; struct SXWindowThemeElement element_maximize; }; /* Resizebar part of a window. */ struct SXWindowThemeResizebar { /* Height of the resizebar. */ unsigned int height; /* Opacity value for the resize bar. */ double opacity; /* Elements: left, right and middle */ struct SXWindowThemeElement element_left; struct SXWindowThemeElement element_right; struct SXWindowThemeElement element_middle; }; struct SXWindowTheme { /* Information about the theme: Name and author. Author should be a string with the format: "NAME ". */ char *name; char *author; /* The title- and resizebar elements. */ struct SXWindowThemeTitlebar titlebar; struct SXWindowThemeResizebar resizebar; }; typedef struct SXWindowTheme *SXWindowThemeRef; /* Functions releated to themes. */ /* Return size needed for frame rectangle for STYLE_MASK. */ SF_EXTERN GFSize SXWindowThemeSizeOfStyle (SFWindowStyleMask style_mask); /* Return a pointer to the current theme. */ SF_EXTERN SXWindowThemeRef SXWindowThemeCurrent (void); /* Create all needed tracking areas for titlebar of WINDOW. */ SF_EXTERN void SXWindowThemeCreateTitlebarAreas (SFWindowRef window); /* ??? */ SF_EXTERN void SXWindowThemeDrawTitlebar (GFImageRef dst_img, bool active, int width, SFWindowStyleMask style_mask, char *title); /* Read a theme from FILE_NAME. Returns a pointer to the new theme - NULL if we fail for some reason. */ SF_EXTERN SXWindowThemeRef SXWindowThemeInitialize (char *file_name); #endif /* SXWindowTheme.h */