1/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 2 3#line 1 "styled-ostream.oo.h" 4/* Abstract output stream for CSS styled text. 5 Copyright (C) 2006 Free Software Foundation, Inc. 6 Written by Bruno Haible <bruno@clisp.org>, 2006. 7 8 This program is free software: you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 3 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 20 21#ifndef _STYLED_OSTREAM_H 22#define _STYLED_OSTREAM_H 23 24#include "ostream.h" 25 26 27/* A styled output stream is an object to which one can feed a sequence of 28 bytes, marking some runs of text as belonging to specific CSS classes, 29 where the rendering of the CSS classes is defined through a CSS (cascading 30 style sheet). */ 31 32#line 33 "styled-ostream.h" 33struct styled_ostream_representation; 34/* styled_ostream_t is defined as a pointer to struct styled_ostream_representation. 35 In C++ mode, we use a smart pointer class. 36 In C mode, we have no other choice than a typedef to the root class type. */ 37#if IS_CPLUSPLUS 38struct styled_ostream_t 39{ 40private: 41 struct styled_ostream_representation *_pointer; 42public: 43 styled_ostream_t () : _pointer (NULL) {} 44 styled_ostream_t (struct styled_ostream_representation *pointer) : _pointer (pointer) {} 45 struct styled_ostream_representation * operator -> () { return _pointer; } 46 operator struct styled_ostream_representation * () { return _pointer; } 47 operator struct any_ostream_representation * () { return (struct any_ostream_representation *) _pointer; } 48 operator void * () { return _pointer; } 49 bool operator == (const void *p) { return _pointer == p; } 50 bool operator != (const void *p) { return _pointer != p; } 51 operator ostream_t () { return (ostream_t) (struct any_ostream_representation *) _pointer; } 52 explicit styled_ostream_t (ostream_t x) : _pointer ((struct styled_ostream_representation *) (void *) x) {} 53}; 54#else 55typedef ostream_t styled_ostream_t; 56#endif 57 58/* Functions that invoke the methods. */ 59extern void styled_ostream_write_mem (styled_ostream_t first_arg, const void *data, size_t len); 60extern void styled_ostream_flush (styled_ostream_t first_arg); 61extern void styled_ostream_free (styled_ostream_t first_arg); 62extern void styled_ostream_begin_use_class (styled_ostream_t first_arg, const char *classname); 63extern void styled_ostream_end_use_class (styled_ostream_t first_arg, const char *classname); 64 65/* Type representing an implementation of styled_ostream_t. */ 66struct styled_ostream_implementation 67{ 68 const typeinfo_t * const *superclasses; 69 size_t superclasses_length; 70 size_t instance_size; 71#define THIS_ARG styled_ostream_t first_arg 72#include "styled_ostream.vt.h" 73#undef THIS_ARG 74}; 75 76/* Public portion of the object pointed to by a styled_ostream_t. */ 77struct styled_ostream_representation_header 78{ 79 const struct styled_ostream_implementation *vtable; 80}; 81 82#if HAVE_INLINE 83 84/* Define the functions that invoke the methods as inline accesses to 85 the styled_ostream_implementation. 86 Use #define to avoid a warning because of extern vs. static. */ 87 88# define styled_ostream_write_mem styled_ostream_write_mem_inline 89static inline void 90styled_ostream_write_mem (styled_ostream_t first_arg, const void *data, size_t len) 91{ 92 const struct styled_ostream_implementation *vtable = 93 ((struct styled_ostream_representation_header *) (struct styled_ostream_representation *) first_arg)->vtable; 94 vtable->write_mem (first_arg,data,len); 95} 96 97# define styled_ostream_flush styled_ostream_flush_inline 98static inline void 99styled_ostream_flush (styled_ostream_t first_arg) 100{ 101 const struct styled_ostream_implementation *vtable = 102 ((struct styled_ostream_representation_header *) (struct styled_ostream_representation *) first_arg)->vtable; 103 vtable->flush (first_arg); 104} 105 106# define styled_ostream_free styled_ostream_free_inline 107static inline void 108styled_ostream_free (styled_ostream_t first_arg) 109{ 110 const struct styled_ostream_implementation *vtable = 111 ((struct styled_ostream_representation_header *) (struct styled_ostream_representation *) first_arg)->vtable; 112 vtable->free (first_arg); 113} 114 115# define styled_ostream_begin_use_class styled_ostream_begin_use_class_inline 116static inline void 117styled_ostream_begin_use_class (styled_ostream_t first_arg, const char *classname) 118{ 119 const struct styled_ostream_implementation *vtable = 120 ((struct styled_ostream_representation_header *) (struct styled_ostream_representation *) first_arg)->vtable; 121 vtable->begin_use_class (first_arg,classname); 122} 123 124# define styled_ostream_end_use_class styled_ostream_end_use_class_inline 125static inline void 126styled_ostream_end_use_class (styled_ostream_t first_arg, const char *classname) 127{ 128 const struct styled_ostream_implementation *vtable = 129 ((struct styled_ostream_representation_header *) (struct styled_ostream_representation *) first_arg)->vtable; 130 vtable->end_use_class (first_arg,classname); 131} 132 133#endif 134 135extern DLL_VARIABLE const typeinfo_t styled_ostream_typeinfo; 136#define styled_ostream_SUPERCLASSES &styled_ostream_typeinfo, ostream_SUPERCLASSES 137#define styled_ostream_SUPERCLASSES_LENGTH (1 + ostream_SUPERCLASSES_LENGTH) 138 139extern DLL_VARIABLE const struct styled_ostream_implementation styled_ostream_vtable; 140 141#line 42 "styled-ostream.oo.h" 142 143 144#endif /* _STYLED_OSTREAM_H */ 145