1 /*
2  * mape - C4 Landscape.txt editor
3  *
4  * Copyright (c) 2005-2009, Armin Burgmeier
5  *
6  * Distributed under the terms of the ISC license; see accompanying file
7  * "COPYING" for details.
8  *
9  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
10  * See accompanying file "TRADEMARK" for details.
11  *
12  * To redistribute this file separately, substitute the full license texts
13  * for the above references.
14  */
15 
16 #ifndef INC_MAPE_MATERIAL_MAP_H
17 #define INC_MAPE_MATERIAL_MAP_H
18 
19 #include <glib-object.h>
20 
21 #include "mape/group.h"
22 #include "mape/texture.h"
23 
24 G_BEGIN_DECLS
25 
26 #define MAPE_TYPE_MATERIAL_MAP                 (mape_material_map_get_type())
27 #define MAPE_MATERIAL_MAP(obj)                 (G_TYPE_CHECK_INSTANCE_CAST((obj), MAPE_TYPE_MATERIAL_MAP, MapeMaterialMap))
28 #define MAPE_MATERIAL_MAP_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST((klass), MAPE_TYPE_MATERIAL_MAP, MapeMaterialMapClass))
29 #define MAPE_IS_MATERIAL_MAP(obj)              (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAPE_TYPE_MATERIAL_MAP))
30 #define MAPE_IS_MATERIAL_MAP_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE((klass), MAPE_TYPE_MATERIAL_MAP))
31 #define MAPE_MATERIAL_MAP_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS((obj), MAPE_TYPE_MATERIAL_MAP, MapeMaterialMapClass))
32 
33 #define MAPE_TYPE_MATERIAL                     (mape_material_get_type())
34 
35 typedef struct _MapeMaterial MapeMaterial;
36 
37 typedef struct _MapeMaterialMap MapeMaterialMap;
38 typedef struct _MapeMaterialMapClass MapeMaterialMapClass;
39 
40 /**
41  * MapeMaterialMapError:
42  * @MAPE_MATERIAL_MAP_ERROR_LOAD: An error occured when loading a material map.
43  *
44  * These errors are from the MAPE_MATERIAL_MAP_ERROR error domain. They can
45  * occur when operating on material maps.
46  */
47 typedef enum _MapeMaterialMapError {
48   MAPE_MATERIAL_MAP_ERROR_LOAD
49 } MapeMaterialMapError;
50 
51 /**
52  * MapeMaterialMapClass:
53  *
54  * This structure does not contain any public fields.
55  */
56 struct _MapeMaterialMapClass {
57   /*< private >*/
58   GObjectClass parent_class;
59 };
60 
61 /**
62  * MapeMaterialMap:
63  *
64  * #MapeMaterialMap is an opaque data type. You should only access it via the
65  * public API functions.
66  */
67 struct _MapeMaterialMap {
68   /*< private >*/
69   GObject parent;
70 };
71 
72 GType
73 mape_material_get_type(void) G_GNUC_CONST;
74 
75 GType
76 mape_material_map_get_type(void) G_GNUC_CONST;
77 
78 MapeMaterialMap*
79 mape_material_map_new(void);
80 
81 gboolean
82 mape_material_map_load(MapeMaterialMap* map,
83                        MapeGroup* from,
84                        GError** error);
85 
86 guint
87 mape_material_map_get_material_count(MapeMaterialMap* map);
88 
89 void
90 mape_material_map_set_default_textures(MapeMaterialMap* matmap,
91                                        MapeTextureMap* texmap);
92 
93 const MapeMaterial*
94 mape_material_map_get_material(MapeMaterialMap* map,
95                                guint index);
96 
97 MapeMaterial*
98 mape_material_map_get_material_by_name(MapeMaterialMap* map,
99                                        const gchar* name);
100 
101 const gchar*
102 mape_material_get_name(const MapeMaterial* material);
103 
104 const gchar*
105 mape_material_get_texture_overlay(const MapeMaterial* material);
106 
107 G_END_DECLS
108 
109 #endif /* INC_MAPE_MATERIAL_MAP_H */
110 
111 /* vim:set et sw=2 ts=2: */
112