This file is indexed.

/usr/include/flatzebra/PixmapArray.h is in libflatzebra-dev 0.1.6-2.

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
/*  $Id: PixmapArray.h,v 1.5 2012/07/08 02:57:14 sarrazip Exp $
    PixmapArray.h - Object containing an array of Pixmaps.

    flatzebra - Generic 2D Game Engine library
    Copyright (C) 1999-2012 Pierre Sarrazin <http://sarrazip.com/>

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

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

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
*/

#ifndef _H_PixmapArray
#define _H_PixmapArray

#include <flatzebra/Couple.h>

#include <SDL.h>
#include <SDL_image.h>

#include <vector>


namespace flatzebra {


class PixmapArray
/*  Object containing an array of Pixmaps.
*/
{
public:

    /*  Creates a pixmap array.
        This object is the owner of the pixmaps, and the destructor will
        take care of freeing them.
        The argument is ignored.
        setArrayElement() will grow the internal vector as needed.
    */
    PixmapArray(size_t = 0);

    /*  Calls freeImages().
    */
    ~PixmapArray();

    /*  Destroys the images and frees the resources taken by the pixmaps.
    */
    void freeImages();

    /*  Returns the pixmap of the image at index 'i' of the
        arrays given to the constructor of this object.
        'i' must be lower than the value returned by getNumImages().
    */
    SDL_Surface *getImage(size_t i) const;
    size_t getNumImages() const;

    /*  'image' must not be null.
    */
    void setArrayElement(size_t i, SDL_Surface *image);

    /*  Sets or gets the size in pixels of the images in the pixmap array.
        All images in the array are assumed to be of the same size.
        Neither size.x nor size.y are allowed to be zero.
    */
    void setImageSize(Couple size);
    Couple getImageSize() const;

private:

    std::vector<SDL_Surface *> images;
    Couple imageSize;  // size in pixels of the images; all assumed same size


    /*  Forbidden operations:
    */
    PixmapArray(const PixmapArray &x);
    PixmapArray &operator = (const PixmapArray &x);

};


/*  INLINE METHODS
*/

inline SDL_Surface *
PixmapArray::getImage(size_t i) const { return images[i]; }
inline size_t
PixmapArray::getNumImages() const { return images.size(); }
inline Couple
PixmapArray::getImageSize() const { return imageSize; }


}  // namespace flatzebra


#endif  /* _H_PixmapArray */