Exemple #1
0
        public Manager(Library library, uint maxFaces, uint maxSizes, ulong maxBytes, FaceRequester requester, IntPtr requestData)
        {
            if (library == null)
                throw new ArgumentNullException("library");

            IntPtr mgrRef;
            Error err = FT.FTC_Manager_New(library.Reference, maxFaces, maxSizes, maxBytes, requester, requestData, out mgrRef);

            if (err != Error.Ok)
                throw new FreeTypeException(err);

            Reference = mgrRef;

            this.parentLibrary = library;
            library.AddChildManager(this);
        }
Exemple #2
0
        public Manager(Library library, uint maxFaces, uint maxSizes, ulong maxBytes, FaceRequester requester, IntPtr requestData)
        {
            if (library == null)
            {
                throw new ArgumentNullException("library");
            }

            IntPtr mgrRef;
            Error  err = FT.FTC_Manager_New(library.Reference, maxFaces, maxSizes, maxBytes, requester, requestData, out mgrRef);

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }

            Reference = mgrRef;

            this.parentLibrary = library;
            library.AddChildManager(this);
        }
Exemple #3
0
        //private bool disposed;

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the Manager class.
        /// </summary>
        /// <param name="library">The parent FreeType library handle to use.</param>
        /// <param name="maxFaces">
        /// Maximum number of opened <see cref="Face"/> objects managed by this cache instance. Use 0 for defaults.
        /// </param>
        /// <param name="maxSizes">
        /// Maximum number of opened <see cref="FTSize"/> objects managed by this cache instance. Use 0 for defaults.
        /// </param>
        /// <param name="maxBytes">
        /// Maximum number of bytes to use for cached data nodes. Use 0 for defaults. Note that this value does not
        /// account for managed <see cref="Face"/> and <see cref="FTSize"/> objects.
        /// </param>
        /// <param name="requester">
        /// An application-provided callback used to translate face IDs into real <see cref="Face"/> objects.
        /// </param>
        /// <param name="requestData">
        /// A generic pointer that is passed to the requester each time it is called (see <see cref="FaceRequester"/>).
        /// </param>
        public Manager(Library library, uint maxFaces, uint maxSizes, ulong maxBytes, FaceRequester requester, IntPtr requestData)
            : base(NewManager(library, maxFaces, maxSizes, maxBytes, requester, requestData))
        {
            parentLibrary = library;
            library.AddChildManager(this);
        }
Exemple #4
0
        private static IntPtr NewManager(Library library, uint maxFaces, uint maxSizes, ulong maxBytes, FaceRequester requester, IntPtr requestData)
        {
            if (library == null)
            {
                throw new ArgumentNullException(nameof(library));
            }

            Error err = FT.FTC_Manager_New(library.Reference, maxFaces, maxSizes, maxBytes, requester, requestData, out var mgrRef);

            if (err != Error.Ok)
            {
                throw new FreeTypeException(err);
            }

            return(mgrRef);
        }
Exemple #5
0
 internal static extern Error FTC_Manager_New(IntPtr library, uint max_faces, uint max_sizes, ulong maxBytes, FaceRequester requester, IntPtr req_data, out IntPtr amanager);
 internal static extern Error FTC_Manager_New(IntPtr library, uint max_faces, uint max_sizes, ulong maxBytes, FaceRequester requester, IntPtr req_data, out IntPtr amanager);