This file is indexed.

/usr/include/crystalspace-2.0/iengine/material.h is in libcrystalspace-dev 2.0+dfsg-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*
    Copyright (C) 2000 by Jorrit Tyberghein

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library 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
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __CS_IENGINE_MATERIAL_H__
#define __CS_IENGINE_MATERIAL_H__

#include "csutil/scf.h"
#include "iutil/strset.h"
#include "ivideo/shader/shader.h"

/**\file
 * Material interfaces
 */
/**
 * \addtogroup engine3d_textures
 * @{ */


struct iMaterial;
struct iTextureManager;
struct iTextureWrapper;
struct iObject;

/**
 * A material wrapper is an engine-level object that wraps around an actual
 * material (iMaterial). Every material in the engine is represented by a 
 * material wrapper, which keeps the pointer to the material and its name, and 
 * possibly the base material object.
 *
 * Main creators of instances implementing this interface:
 * - iEngine::CreateMaterial()
 * - iMaterialList::NewMaterial()
 *
 * Main ways to get pointers to this interface:
 * - iEngine::FindMaterial()
 * - iMaterialList::Get()
 * - iMaterialList::FindByName()
 * - iLoaderContext::FindMaterial()
 * - iLoaderContext::FindNamedMaterial()
 * - iMeshObject::GetMaterialWrapper()
 * - Various state interfaces for mesh objects.
 *
 * Main users of this interface:
 * - iEngine
 * - Mesh objects
 */
struct iMaterialWrapper : public virtual iBase
{
  SCF_INTERFACE (iMaterialWrapper, 0, 0, 5);

  /// Get the iObject for this material.
  virtual iObject *QueryObject() = 0;

  /**
   * Change the base material. Note: The changes will not be visible until
   * you re-register the material.
   */
  virtual void SetMaterial (iMaterial* material) = 0;
  /// Get the original material.
  virtual iMaterial* GetMaterial () = 0;

  /**
   * Visit this material. This should be called by the engine right
   * before using the material. It will call Visit() on all textures
   * that are used.
   */
  virtual void Visit () = 0;

  /**
   * Return true if it is needed to call Visit().
   */
  virtual bool IsVisitRequired () const = 0;
};

/**
 * This interface represents the engine part of the material definition.
 * Using this interface you will be able to access the original texture
 * wrappers that were used to create the material. If you have something
 * that implements iMaterial you can query for iMaterialEngine.
 * So this interface basically augments iMaterial with engine specific
 * features.
 *
 * Main ways to get pointers to this interface:
 *   - scfQueryInterface<iMaterialEngine>() from iMaterial
 */
struct iMaterialEngine : public virtual iBase
{
  SCF_INTERFACE (iMaterialEngine, 2, 0, 0);

  /**
   * Get the base texture from the material.
   */
  virtual iTextureWrapper *GetTextureWrapper () = 0;

  /**
   * Get a texture by name.
   */
  virtual iTextureWrapper* GetTextureWrapper (CS::ShaderVarStringID name) = 0;

  /**
   * Visit all textures.
   */
  virtual void Visit () = 0;

  /**
   * Return true if it is needed to call Visit().
   */
  virtual bool IsVisitRequired () const = 0;
};

/**
 * This class represents a list of materials.
 *
 * Main ways to get pointers to this interface:
 *   - iEngine::GetMaterialList()
 *
 * Main users of this interface:
 *   - iEngine
 */
struct iMaterialList : public virtual iBase
{
  SCF_INTERFACE (iMaterialList, 2, 0, 0);

  /// Create a new material.
  virtual iMaterialWrapper* NewMaterial (iMaterial* material,
  	const char* name) = 0;

  /// Create a new material, don't add it to the engine list.
  virtual csPtr<iMaterialWrapper> CreateMaterial (iMaterial* material,
  	const char* name) = 0;

  /// Return the number of materials in this list
  virtual int GetCount () const = 0;

  /// Return a material by index
  virtual iMaterialWrapper *Get (int n) const = 0;

  /// Add a material
  virtual int Add (iMaterialWrapper *obj) = 0;

  /// Remove a material
  virtual bool Remove (iMaterialWrapper *obj) = 0;

  /// Remove the nth material
  virtual bool Remove (int n) = 0;

  /// Remove all materials
  virtual void RemoveAll () = 0;

  /// Find a material and return its index
  virtual int Find (iMaterialWrapper *obj) const = 0;

  /// Find a material by name
  virtual iMaterialWrapper *FindByName (const char *Name) const = 0;
};

/** @} */

#endif // __CS_IENGINE_MATERIAL_H__