00001 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 00002 00003 /* 00004 * This file is part of The Croco Library 00005 * 00006 * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org> 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of version 2.1 of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 * USA 00021 */ 00022 00023 /* 00024 *$Id: cr-stylesheet.h,v 1.3 2003/05/31 15:04:48 kz Exp $ 00025 */ 00026 00027 #ifndef __CR_STYLESHEET_H__ 00028 #define __CR_STYLESHEET_H__ 00029 00030 #include "cr-utils.h" 00031 #include "cr-statement.h" 00032 00033 /** 00034 *@file 00035 *The declaration of the #CRStyleSheet class. 00036 */ 00037 00038 00039 enum CRStyleOrigin 00040 { 00041 /*Please don't change the order of 00042 *the values enumerated here ... 00043 *New values should be added at the end, 00044 *just before ORIGIN_END. 00045 */ 00046 ORIGIN_UA = 0, 00047 ORIGIN_USER, 00048 ORIGIN_AUTHOR, 00049 00050 /*must always be the last one*/ 00051 NB_ORIGINS 00052 } ; 00053 00054 /** 00055 *An abstraction of a css stylesheet as defined 00056 *by the css2 spec in chapter 4. 00057 */ 00058 struct _CRStyleSheet 00059 { 00060 /**The css statements list*/ 00061 CRStatement *statements ; 00062 00063 enum CRStyleOrigin origin ; 00064 00065 /*the parent import rule, if any.*/ 00066 CRStatement *parent_import_rule ; 00067 00068 /**custom data used by libcroco*/ 00069 gpointer croco_data ; 00070 00071 /** 00072 *custom application data pointer 00073 *Can be used by applications. 00074 */ 00075 gpointer app_data ; 00076 00077 /** 00078 *the reference count of this insance 00079 *Please, don't never ever modify it 00080 *directly. Use cr_stylesheet_ref() 00081 *and cr_stylesheet_unref() instead. 00082 */ 00083 gulong ref_count ; 00084 } ; 00085 00086 CRStyleSheet * 00087 cr_stylesheet_new (CRStatement *a_stmts) ; 00088 00089 void 00090 cr_stylesheet_dump (CRStyleSheet *a_this, FILE *a_fp) ; 00091 00092 void 00093 cr_stylesheet_ref (CRStyleSheet *a_this) ; 00094 00095 gboolean 00096 cr_stylesheet_unref (CRStyleSheet *a_this) ; 00097 00098 void 00099 cr_stylesheet_destroy (CRStyleSheet *a_this) ; 00100 00101 #endif /*__CR_STYLESHEET_H__*/