]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - include/ieclass.h
transfer from internal tree r5311 branches/1.4-gpl
[xonotic/netradiant.git] / include / ieclass.h
1 /*\r
2 Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.\r
4 \r
5 This file is part of GtkRadiant.\r
6 \r
7 GtkRadiant is free software; you can redistribute it and/or modify\r
8 it under the terms of the GNU General Public License as published by\r
9 the Free Software Foundation; either version 2 of the License, or\r
10 (at your option) any later version.\r
11 \r
12 GtkRadiant is distributed in the hope that it will be useful,\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15 GNU General Public License for more details.\r
16 \r
17 You should have received a copy of the GNU General Public License\r
18 along with GtkRadiant; if not, write to the Free Software\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
20 */\r
21 \r
22 /*! \file ieclass.h\r
23     \brief entity files loader API\r
24     this describes the APIs involved when loading entity description files\r
25     (initially, .def and .fgd)\r
26 */\r
27 \r
28 #ifndef _IECLASS_H_\r
29 #define _IECLASS_H_\r
30 \r
31 #define ECLASS_MAJOR "eclass"\r
32 \r
33 typedef void (* PFN_ECLASS_SCANFILE) (char *filename);\r
34 typedef const char*       (* PFN_ECLASS_GETEXTENSION)     ();\r
35 \r
36 struct _EClassTable\r
37 {\r
38   int m_nSize;\r
39   PFN_ECLASS_SCANFILE m_pfnScanFile;\r
40   PFN_ECLASS_GETEXTENSION       m_pfnGetExtension;\r
41 };\r
42 \r
43 #ifdef USE_ECLASSTABLE_DEFINE\r
44 #ifndef __ECLASSTABLENAME\r
45 #define __ECLASSTABLENAME g_EClassTable\r
46 #endif\r
47 #define EClass_ScanFile __ECLASSTABLENAME.m_pfnEClass_ScanFile\r
48 #define EClass_GetExtension __ECLASSTABLENAME.m_pfnEClass_GetExtension\r
49 #endif\r
50 \r
51 #define ECLASSMANAGER_MAJOR "eclassmanager"\r
52 \r
53 typedef void (* PFN_ECLASS_INSERTALPHABETIZED) (eclass_t *e);\r
54 typedef eclass_t** (* PFN_GET_ECLASS_E) ();\r
55 typedef void (* PFN_SET_ECLASS_FOUND) (qboolean);\r
56 typedef qboolean (* PFN_GET_PARSING_SINGLE) ();\r
57 typedef eclass_t* (* PFN_ECLASS_CREATE) (const char *name, float col1, float col2, float col3, const vec3_t *mins, const vec3_t *maxs, const char *comments);\r
58 typedef eclass_t* (* PFN_ECLASS_FORNAME) (const char* name, qboolean has_brushes);\r
59 \r
60 struct _EClassManagerTable\r
61 {\r
62   int m_nSize;\r
63   PFN_ECLASS_INSERTALPHABETIZED m_pfnEclass_InsertAlphabetized;\r
64   PFN_GET_ECLASS_E m_pfnGet_Eclass_E;\r
65   PFN_SET_ECLASS_FOUND m_pfnSet_Eclass_Found;\r
66   PFN_GET_PARSING_SINGLE m_pfnGet_Parsing_Single;\r
67   PFN_ECLASS_CREATE m_pfnEClass_Create;\r
68   PFN_ECLASS_FORNAME m_pfnEclass_ForName;\r
69 };\r
70 \r
71 #ifdef USE_ECLASSMANAGER_DEFINE\r
72 #ifndef __ECLASSMANAGERTABLENAME\r
73 #define __ECLASSMANAGERTABLENAME g_EClassManagerTable\r
74 #endif\r
75 #define Eclass_InsertAlphabetized __ECLASSMANAGERTABLENAME.m_pfnEclass_InsertAlphabetized\r
76 #define Get_Eclass_E __ECLASSMANAGERTABLENAME.m_pfnGet_Eclass_E\r
77 #define Set_Eclass_Found __ECLASSMANAGERTABLENAME.m_pfnSet_Eclass_Found\r
78 #define Get_Parsing_Single __ECLASSMANAGERTABLENAME.m_pfnGet_Parsing_Single\r
79 #define EClass_Create __ECLASSMANAGERTABLENAME.m_pfnEClass_Create\r
80 #define Eclass_ForName __ECLASSMANAGERTABLENAME.m_pfnEclass_ForName\r
81 #endif\r
82 \r
83 #endif\r
84 \r