~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to extern/bFTGL/include/FTLibrary.h

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef     __FTLibrary__
 
2
#define     __FTLibrary__
 
3
 
 
4
#include <ft2build.h>
 
5
#include FT_FREETYPE_H
 
6
//#include FT_CACHE_H
 
7
 
 
8
#include "FTGL.h"
 
9
 
 
10
 
 
11
/**
 
12
 * FTLibrary class is the global accessor for the Freetype library.
 
13
 *
 
14
 * This class encapsulates the Freetype Library. This is a singleton class
 
15
 * and ensures that only one FT_Library is in existence at any one time.
 
16
 * All constructors are private therefore clients cannot create or
 
17
 * instantiate this class themselves and must access it's methods via the
 
18
 * static <code>FTLibrary::Instance()</code> function.
 
19
 *
 
20
 * Just because this class returns a valid <code>FTLibrary</code> object
 
21
 * doesn't mean that the Freetype Library has been successfully initialised.
 
22
 * Clients should check for errors. You can initialse the library AND check
 
23
 * for errors using the following code...
 
24
 * <code>err = FTLibrary::Instance().Error();</code>
 
25
 *
 
26
 * @see "Freetype 2 Documentation"
 
27
 *
 
28
 */
 
29
class FTGL_EXPORT FTLibrary
 
30
{
 
31
    public:
 
32
        /**
 
33
         * Global acces point to the single FTLibrary object.
 
34
         * 
 
35
         * @return  The global <code>FTLibrary</code> object.
 
36
         */
 
37
        static FTLibrary& Instance();
 
38
 
 
39
        /**
 
40
         * Gets a pointer to the native Freetype library.
 
41
         * 
 
42
         * @return A handle to a FreeType library instance. 
 
43
         */
 
44
        const FT_Library* const GetLibrary() const { return library;}
 
45
        
 
46
        /**
 
47
         * Queries the library for errors.
 
48
         *
 
49
         * @return  The current error code.
 
50
         */
 
51
        FT_Error Error() const { return err;}
 
52
        
 
53
        /**
 
54
         * Destructor
 
55
         *
 
56
         * Disposes of the Freetype library
 
57
         */
 
58
        ~FTLibrary();
 
59
        
 
60
    private:
 
61
        /**
 
62
         * Default constructors.
 
63
         *
 
64
         * Made private to stop clients creating there own FTLibrary
 
65
         * objects.
 
66
         */
 
67
        FTLibrary();
 
68
        FTLibrary( const FT_Library&){}
 
69
        FTLibrary& operator=( const FT_Library&) { return *this; }
 
70
        
 
71
        /**
 
72
         * Initialises the Freetype library
 
73
         *
 
74
         * Even though this function indicates success via the return value,
 
75
         * clients can't see this so must check the error codes. This function
 
76
         * is only ever called by the default c_stor
 
77
         *
 
78
         * @return  <code>true</code> if the Freetype library was
 
79
         *          successfully initialised, <code>false</code>
 
80
         *          otherwise.
 
81
         */
 
82
        bool Initialise();
 
83
        
 
84
        /**
 
85
         * Freetype library handle.
 
86
         */
 
87
        FT_Library* library;
 
88
//      FTC_Manager* manager;
 
89
 
 
90
        /**
 
91
         * Current error code. Zero means no error.
 
92
         */
 
93
        FT_Error err;
 
94
        
 
95
};
 
96
 
 
97
#endif  //  __FTLibrary__