diff --git a/.gitignore b/.gitignore index e5e14d5b6..9be37c3da 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,12 @@ out.pdf out.svg .pomo node_modules +deps/ +npm-debug.log package-lock.json # Vim cruft *.swp *.un~ +deps/ npm-debug.log diff --git a/.npmignore b/.npmignore new file mode 100644 index 000000000..acdcedf90 --- /dev/null +++ b/.npmignore @@ -0,0 +1,7 @@ +testing +build +benchmarks +examples +support +test +deps diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 000000000..05730e8bd --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,21 @@ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE" + ], + "windowsSdkVersion": "10.0.18362.0", + "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "msvc-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..4b8990287 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "*.rh": "cpp" + } +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index b27549962..7dce02e91 100644 --- a/Readme.md +++ b/Readme.md @@ -97,7 +97,7 @@ This project is an implementation of the Web Canvas API and implements that API ### createCanvas() > ```ts -> createCanvas(width: number, height: number, type?: 'PDF'|'SVG') => Canvas +> createCanvas(width: number, height: number, type?: 'fbdev'|'pdf'|'svg') => Canvas > ``` Creates a Canvas instance. This method works in both Node.js and Web browsers, where there is no Canvas constructor. (See `browser.js` for the implementation that runs in browsers.) diff --git a/binding.gyp b/binding.gyp index 777032c0b..8728adb22 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,222 +1,21 @@ { - 'conditions': [ - ['OS=="win"', { - 'variables': { - 'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle - 'with_jpeg%': 'false', - 'with_gif%': 'false', - 'with_rsvg%': 'false', - 'variables': { # Nest jpeg_root to evaluate it before with_jpeg - 'jpeg_root%': '= 12 ? hr - 12 : hr + + ctx.fillStyle = 'black' + + // write Hours + { + const x = getX(hr * (Math.PI / 6) + (Math.PI / 360) * min + (Math.PI / 21600) * sec) + const y = getY(hr * (Math.PI / 6) + (Math.PI / 360) * min + (Math.PI / 21600) * sec) + ctx.lineWidth = 14 + ctx.beginPath() + ctx.moveTo(x * -20, y * -20) + ctx.lineTo(x * 80, y * 80) + ctx.stroke() + } + + // write Minutes + { + const x = getX((Math.PI / 30) * min + (Math.PI / 1800) * sec) + const y = getY((Math.PI / 30) * min + (Math.PI / 1800) * sec) + + ctx.lineWidth = 10 + ctx.beginPath() + ctx.moveTo(x * -28, y * -28) + ctx.lineTo(x * 112, y * 112) + ctx.stroke() + } + + // Write seconds + var x = getX(sec * Math.PI / 30) + var y = getY(sec * Math.PI / 30) + ctx.strokeStyle = '#D40000' + ctx.fillStyle = '#D40000' + ctx.lineWidth = 6 + ctx.beginPath() + ctx.moveTo(x * -30, y * -30) + ctx.lineTo(x * 83, y * 83) + ctx.stroke() + ctx.beginPath() + ctx.arc(0, 0, 10, 0, Math.PI * 2, true) + ctx.fill() + ctx.beginPath() + ctx.arc(x * 95, y * 95, 10, 0, Math.PI * 2, true) + ctx.stroke() + ctx.fillStyle = '#555' + ctx.arc(0, 0, 3, 0, Math.PI * 2, true) + ctx.fill() + + ctx.restore() +} + +setInterval(function () { + clock(ctx) +}, 1000) diff --git a/examples/grayscale-image.js b/examples/grayscale-image.js index ce3ffa06c..16578ea48 100644 --- a/examples/grayscale-image.js +++ b/examples/grayscale-image.js @@ -1,3 +1,7 @@ +/** + * Passing grayscale image through canvas. Image should remain a gray square. + * If image is distorted with lines, then grayscale images are being distorted. + */ const fs = require('fs') const path = require('path') const Canvas = require('..') diff --git a/examples/simple_fbdev.js b/examples/simple_fbdev.js new file mode 100755 index 000000000..588138451 --- /dev/null +++ b/examples/simple_fbdev.js @@ -0,0 +1,40 @@ +#!/usr/bin/env node + +/** +* Module dependencies. +*/ + +const fs = require('fs') +const { join } = require('path') + +const { backends: { FBDevBackend }, Canvas } = require('..') + +const squareSize = 100 + +var device = process.argv[2] + +var backend = new FBDevBackend(device) +var canvas = new Canvas(backend) +var ctx = canvas.getContext('2d') + +var offsetX = canvas.width - squareSize +var offsetY = canvas.height - squareSize + +ctx.fillStyle = '#FF0000' +ctx.fillRect(0, 0, squareSize, squareSize) + +ctx.fillStyle = '#00FF00' +ctx.fillRect(offsetX, 0, squareSize, squareSize) + +ctx.fillStyle = '#0000FF' +ctx.fillRect(0, offsetY, squareSize, squareSize) + +ctx.fillStyle = '#FFFFFF' +ctx.fillRect(offsetX, offsetY, squareSize, squareSize) + +console.log('Width: ' + canvas.width + ', Height: ' + canvas.height + ', ' + + 'Pixel format: ' + ctx.pixelFormat) + +var outPath = join(__dirname, 'rectangle.png') + +canvas.createPNGStream().pipe(fs.createWriteStream(outPath)) diff --git a/examples/simple_x11.js b/examples/simple_x11.js new file mode 100755 index 000000000..680c9200f --- /dev/null +++ b/examples/simple_x11.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node + +/** +* Module dependencies. +*/ + +const { backends: { XlibBackend }, Canvas } = require('..') + +var backend = new XlibBackend(800, 600) +var canvas = new Canvas(backend) +var ctx = canvas.getContext('2d') + +console.log('Width: ' + canvas.width + ', Height: ' + canvas.height) + +ctx.fillStyle = '#00FF00' +ctx.fillRect(50, 50, 100, 100) + +setTimeout(function () {}, 10000) + +// var outPath = __dirname + '/rectangle.png'; +// canvas.createPNGStream().pipe(fs.createWriteStream(outPath)); diff --git a/lib/DOMMatrix.js b/lib/DOMMatrix.js index 379c78c7a..17a54f82e 100644 --- a/lib/DOMMatrix.js +++ b/lib/DOMMatrix.js @@ -4,7 +4,7 @@ const util = require('util') // DOMMatrix per https://drafts.fxtf.org/geometry/#DOMMatrix -function DOMPoint(x, y, z, w) { +function DOMPoint (x, y, z, w) { if (!(this instanceof DOMPoint)) { throw new TypeError("Class constructors cannot be invoked without 'new'") } @@ -22,15 +22,15 @@ function DOMPoint(x, y, z, w) { } // Constants to index into _values (col-major) -const M11 = 0, M12 = 1, M13 = 2, M14 = 3 -const M21 = 4, M22 = 5, M23 = 6, M24 = 7 -const M31 = 8, M32 = 9, M33 = 10, M34 = 11 -const M41 = 12, M42 = 13, M43 = 14, M44 = 15 +const M11 = 0; const M12 = 1; const M13 = 2; const M14 = 3 +const M21 = 4; const M22 = 5; const M23 = 6; const M24 = 7 +const M31 = 8; const M32 = 9; const M33 = 10; const M34 = 11 +const M41 = 12; const M42 = 13; const M43 = 14; const M44 = 15 const DEGREE_PER_RAD = 180 / Math.PI const RAD_PER_DEGREE = Math.PI / 180 -function parseMatrix(init) { +function parseMatrix (init) { var parsed = init.replace(/matrix\(/, '') parsed = parsed.split(/,/, 7) // 6 + 1 to handle too many params if (parsed.length !== 6) throw new Error(`Failed to parse ${init}`) @@ -43,14 +43,14 @@ function parseMatrix(init) { ] } -function parseMatrix3d(init) { +function parseMatrix3d (init) { var parsed = init.replace(/matrix3d\(/, '') parsed = parsed.split(/,/, 17) // 16 + 1 to handle too many params if (parsed.length !== 16) throw new Error(`Failed to parse ${init}`) return parsed.map(parseFloat) } -function parseTransform(tform) { +function parseTransform (tform) { var type = tform.split(/\(/, 1)[0] switch (type) { case 'matrix': @@ -161,15 +161,15 @@ DOMMatrix.prototype[util.inspect.custom || 'inspect'] = function (depth, options } DOMMatrix.prototype.toString = function () { - return this.is2D ? - `matrix(${this.a}, ${this.b}, ${this.c}, ${this.d}, ${this.e}, ${this.f})` : - `matrix3d(${this._values.join(', ')})` + return this.is2D + ? `matrix(${this.a}, ${this.b}, ${this.c}, ${this.d}, ${this.e}, ${this.f})` + : `matrix3d(${this._values.join(', ')})` } /** * Checks that `value` is a number and sets the value. */ -function setNumber2D(receiver, index, value) { +function setNumber2D (receiver, index, value) { if (typeof value !== 'number') throw new TypeError('Expected number') return receiver._values[index] = value } @@ -178,7 +178,7 @@ function setNumber2D(receiver, index, value) { * Checks that `value` is a number, sets `_is2D = false` if necessary and sets * the value. */ -function setNumber3D(receiver, index, value) { +function setNumber3D (receiver, index, value) { if (typeof value !== 'number') throw new TypeError('Expected number') if (index === M33 || index === M44) { if (value !== 1) receiver._is2D = false @@ -187,31 +187,31 @@ function setNumber3D(receiver, index, value) { } Object.defineProperties(DOMMatrix.prototype, { - m11: {get: function () { return this._values[M11] }, set: function (v) { return setNumber2D(this, M11, v) }}, - m12: {get: function () { return this._values[M12] }, set: function (v) { return setNumber2D(this, M12, v) }}, - m13: {get: function () { return this._values[M13] }, set: function (v) { return setNumber3D(this, M13, v) }}, - m14: {get: function () { return this._values[M14] }, set: function (v) { return setNumber3D(this, M14, v) }}, - m21: {get: function () { return this._values[M21] }, set: function (v) { return setNumber2D(this, M21, v) }}, - m22: {get: function () { return this._values[M22] }, set: function (v) { return setNumber2D(this, M22, v) }}, - m23: {get: function () { return this._values[M23] }, set: function (v) { return setNumber3D(this, M23, v) }}, - m24: {get: function () { return this._values[M24] }, set: function (v) { return setNumber3D(this, M24, v) }}, - m31: {get: function () { return this._values[M31] }, set: function (v) { return setNumber3D(this, M31, v) }}, - m32: {get: function () { return this._values[M32] }, set: function (v) { return setNumber3D(this, M32, v) }}, - m33: {get: function () { return this._values[M33] }, set: function (v) { return setNumber3D(this, M33, v) }}, - m34: {get: function () { return this._values[M34] }, set: function (v) { return setNumber3D(this, M34, v) }}, - m41: {get: function () { return this._values[M41] }, set: function (v) { return setNumber2D(this, M41, v) }}, - m42: {get: function () { return this._values[M42] }, set: function (v) { return setNumber2D(this, M42, v) }}, - m43: {get: function () { return this._values[M43] }, set: function (v) { return setNumber3D(this, M43, v) }}, - m44: {get: function () { return this._values[M44] }, set: function (v) { return setNumber3D(this, M44, v) }}, - - a: {get: function () { return this.m11 }, set: function (v) { return this.m11 = v }}, - b: {get: function () { return this.m12 }, set: function (v) { return this.m12 = v }}, - c: {get: function () { return this.m21 }, set: function (v) { return this.m21 = v }}, - d: {get: function () { return this.m22 }, set: function (v) { return this.m22 = v }}, - e: {get: function () { return this.m41 }, set: function (v) { return this.m41 = v }}, - f: {get: function () { return this.m42 }, set: function (v) { return this.m42 = v }}, - - is2D: {get: function () { return this._is2D }}, // read-only + m11: { get: function () { return this._values[M11] }, set: function (v) { return setNumber2D(this, M11, v) } }, + m12: { get: function () { return this._values[M12] }, set: function (v) { return setNumber2D(this, M12, v) } }, + m13: { get: function () { return this._values[M13] }, set: function (v) { return setNumber3D(this, M13, v) } }, + m14: { get: function () { return this._values[M14] }, set: function (v) { return setNumber3D(this, M14, v) } }, + m21: { get: function () { return this._values[M21] }, set: function (v) { return setNumber2D(this, M21, v) } }, + m22: { get: function () { return this._values[M22] }, set: function (v) { return setNumber2D(this, M22, v) } }, + m23: { get: function () { return this._values[M23] }, set: function (v) { return setNumber3D(this, M23, v) } }, + m24: { get: function () { return this._values[M24] }, set: function (v) { return setNumber3D(this, M24, v) } }, + m31: { get: function () { return this._values[M31] }, set: function (v) { return setNumber3D(this, M31, v) } }, + m32: { get: function () { return this._values[M32] }, set: function (v) { return setNumber3D(this, M32, v) } }, + m33: { get: function () { return this._values[M33] }, set: function (v) { return setNumber3D(this, M33, v) } }, + m34: { get: function () { return this._values[M34] }, set: function (v) { return setNumber3D(this, M34, v) } }, + m41: { get: function () { return this._values[M41] }, set: function (v) { return setNumber2D(this, M41, v) } }, + m42: { get: function () { return this._values[M42] }, set: function (v) { return setNumber2D(this, M42, v) } }, + m43: { get: function () { return this._values[M43] }, set: function (v) { return setNumber3D(this, M43, v) } }, + m44: { get: function () { return this._values[M44] }, set: function (v) { return setNumber3D(this, M44, v) } }, + + a: { get: function () { return this.m11 }, set: function (v) { return this.m11 = v } }, + b: { get: function () { return this.m12 }, set: function (v) { return this.m12 = v } }, + c: { get: function () { return this.m21 }, set: function (v) { return this.m21 = v } }, + d: { get: function () { return this.m22 }, set: function (v) { return this.m22 = v } }, + e: { get: function () { return this.m41 }, set: function (v) { return this.m41 = v } }, + f: { get: function () { return this.m42 }, set: function (v) { return this.m42 = v } }, + + is2D: { get: function () { return this._is2D } }, // read-only isIdentity: { get: function () { @@ -229,7 +229,7 @@ Object.defineProperties(DOMMatrix.prototype, { * @param {Float64Array} values Value to assign to `_values`. This is assigned * without copying (okay because all usages are followed by a multiply). */ -function newInstance(values) { +function newInstance (values) { var instance = Object.create(DOMMatrix.prototype) instance.constructor = DOMMatrix instance._is2D = true @@ -237,7 +237,7 @@ function newInstance(values) { return instance } -function multiply(A, B) { +function multiply (A, B) { var dest = new Float64Array(16) for (var i = 0; i < 4; i++) { for (var j = 0; j < 4; j++) { @@ -386,10 +386,10 @@ DOMMatrix.prototype.rotateAxisAngleSelf = function (x, y, z, angle) { // NB: This is the generic transform. If the axis is a major axis, there are // faster transforms. this._values = multiply([ - tx * x + c, tx * y + s * z, tx * z - s * y, 0, - tx * y - s * z, ty * y + c, ty * z + s * x, 0, - tx * z + s * y, ty * z - s * x, t * z * z + c, 0, - 0, 0, 0, 1 + tx * x + c, tx * y + s * z, tx * z - s * y, 0, + tx * y - s * z, ty * y + c, ty * z + s * x, 0, + tx * z + s * y, ty * z - s * x, t * z * z + c, 0, + 0, 0, 0, 1 ], this._values) if (x !== 0 || y !== 0) this._is2D = false return this @@ -606,4 +606,4 @@ DOMMatrix.prototype.toFloat64Array = function () { return this._values.slice(0) } -module.exports = {DOMMatrix, DOMPoint} +module.exports = { DOMMatrix, DOMPoint } diff --git a/lib/bindings.js b/lib/bindings.js index c0afc9841..95ee914f3 100644 --- a/lib/bindings.js +++ b/lib/bindings.js @@ -1,3 +1,3 @@ -'use strict'; +'use strict' -module.exports = require('../build/Release/canvas.node'); +module.exports = require('../build/Release/canvas.node') diff --git a/lib/canvas.js b/lib/canvas.js index 18b47364d..fd34ee5f8 100644 --- a/lib/canvas.js +++ b/lib/canvas.js @@ -1,4 +1,4 @@ -'use strict'; +'use strict' /*! * Canvas @@ -21,18 +21,18 @@ Canvas.prototype[util.inspect.custom || 'inspect'] = function () { } Canvas.prototype.getContext = function (contextType, contextAttributes) { - if ('2d' == contextType) { - var ctx = this._context2d || (this._context2d = new Context2d(this, contextAttributes)); - this.context = ctx; - ctx.canvas = this; - return ctx; + if (contextType == '2d') { + var ctx = this._context2d || (this._context2d = new Context2d(this, contextAttributes)) + this.context = ctx + ctx.canvas = this + return ctx } -}; +} Canvas.prototype.pngStream = -Canvas.prototype.createPNGStream = function(options){ - return new PNGStream(this, options); -}; +Canvas.prototype.createPNGStream = function (options) { + return new PNGStream(this, options) +} Canvas.prototype.pdfStream = Canvas.prototype.createPDFStream = function(options){ @@ -40,11 +40,23 @@ Canvas.prototype.createPDFStream = function(options){ }; Canvas.prototype.jpegStream = -Canvas.prototype.createJPEGStream = function(options){ - return new JPEGStream(this, options); -}; +Canvas.prototype.createJPEGStream = function (options) { + return new JPEGStream(this, options) +} -Canvas.prototype.toDataURL = function(a1, a2, a3){ +/** + * Returns a data URI. Pass a function for async operation (non-standard). + * + * @param {"image/png"|"image/jpeg"} [type="image/png"] Type. + * @param {Object|Number} [encoderOptions] A number between 0 and 1 indicating + * image quality if the requested type is image/jpeg (standard), or an options + * object for image encoding (see documentation for Canvas#toBuffer) + * (non-standard). + * @param {Function} [fn] Callback for asynchronous operation (non-standard). + * @return {String} data URL if synchronous (callback omitted) + * @api public + */ +Canvas.prototype.toDataURL = function (a1, a2, a3) { // valid arg patterns (args -> [type, opts, fn]): // [] -> ['image/png', null, null] // [qual] -> ['image/png', null, null] @@ -63,51 +75,51 @@ Canvas.prototype.toDataURL = function(a1, a2, a3){ // ['image/jpeg', opts] -> ['image/jpeg', opts, fn] // ['image/jpeg', qual] -> ['image/jpeg', {quality: qual}, fn] - var type = 'image/png'; - var opts = {}; - var fn; + var type = 'image/png' + var opts = {} + var fn - if ('function' === typeof a1) { - fn = a1; + if (typeof a1 === 'function') { + fn = a1 } else { - if ('string' === typeof a1 && FORMATS.includes(a1.toLowerCase())) { - type = a1.toLowerCase(); + if (typeof a1 === 'string' && FORMATS.includes(a1.toLowerCase())) { + type = a1.toLowerCase() } - if ('function' === typeof a2) { - fn = a2; + if (typeof a2 === 'function') { + fn = a2 } else { - if ('object' === typeof a2) { - opts = a2; - } else if ('number' === typeof a2) { - opts = {quality: Math.max(0, Math.min(1, a2))}; + if (typeof a2 === 'object') { + opts = a2 + } else if (typeof a2 === 'number') { + opts = { quality: Math.max(0, Math.min(1, a2)) } } - if ('function' === typeof a3) { - fn = a3; + if (typeof a3 === 'function') { + fn = a3 } else if (undefined !== a3) { - throw new TypeError(typeof a3 + ' is not a function'); + throw new TypeError(typeof a3 + ' is not a function') } } } if (this.width === 0 || this.height === 0) { // Per spec, if the bitmap has no pixels, return this string: - var str = "data:,"; + var str = 'data:,' if (fn) { - setTimeout(() => fn(null, str)); - return; + setTimeout(() => fn(null, str)) + return } else { - return str; + return str } } if (fn) { this.toBuffer((err, buf) => { - if (err) return fn(err); - fn(null, `data:${type};base64,${buf.toString('base64')}`); + if (err) return fn(err) + fn(null, `data:${type};base64,${buf.toString('base64')}`) }, type, opts) } else { return `data:${type};base64,${this.toBuffer(type, opts).toString('base64')}` } -}; +} diff --git a/lib/image.js b/lib/image.js index 2788a5d93..a09bcc8e0 100644 --- a/lib/image.js +++ b/lib/image.js @@ -1,4 +1,4 @@ -'use strict'; +'use strict' /*! * Canvas - Image @@ -30,14 +30,14 @@ Object.defineProperty(Image.prototype, 'src', { * @param {String|Buffer} val filename, buffer, data URI, URL * @api public */ - set(val) { + set (val) { if (typeof val === 'string') { if (/^\s*data:/.test(val)) { // data: URI const commaI = val.indexOf(',') // 'base64' must come before the comma const isBase64 = val.lastIndexOf('base64', commaI) !== -1 const content = val.slice(commaI + 1) - setSource(this, Buffer.from(content, isBase64 ? 'base64' : 'utf8'), val); + setSource(this, Buffer.from(content, isBase64 ? 'base64' : 'utf8'), val) } else if (/^\s*https?:\/\//.test(val)) { // remote URL const onerror = err => { if (typeof this.onerror === 'function') { @@ -59,20 +59,20 @@ Object.defineProperty(Image.prototype, 'src', { setSource(this, data) }) } else { // local file path assumed - setSource(this, val); + setSource(this, val) } } else if (Buffer.isBuffer(val)) { - setSource(this, val); + setSource(this, val) } }, - get() { + get () { // TODO https://github.com/Automattic/node-canvas/issues/118 - return getSource(this); + return getSource(this) }, configurable: true -}); +}) // TODO || is for Node.js pre-v6.6.0 Image.prototype[util.inspect.custom || 'inspect'] = function(){ diff --git a/lib/jpegstream.js b/lib/jpegstream.js index a057d8983..4064613c9 100644 --- a/lib/jpegstream.js +++ b/lib/jpegstream.js @@ -1,4 +1,4 @@ -'use strict'; +'use strict' /*! * Canvas - JPEGStream @@ -9,37 +9,37 @@ var Readable = require('stream').Readable; var util = require('util'); -var JPEGStream = module.exports = function JPEGStream(canvas, options) { +var JPEGStream = module.exports = function JPEGStream (canvas, options) { if (!(this instanceof JPEGStream)) { - throw new TypeError("Class constructors cannot be invoked without 'new'"); + throw new TypeError("Class constructors cannot be invoked without 'new'") } if (canvas.streamJPEGSync === undefined) { - throw new Error("node-canvas was built without JPEG support."); + throw new Error('node-canvas was built without JPEG support.') } - Readable.call(this); + Readable.call(this) - this.options = options; - this.canvas = canvas; -}; + this.options = options + this.canvas = canvas +} -util.inherits(JPEGStream, Readable); +util.inherits(JPEGStream, Readable) -function noop() {} +function noop () {} -JPEGStream.prototype._read = function _read() { +JPEGStream.prototype._read = function _read () { // For now we're not controlling the c++ code's data emission, so we only // call canvas.streamJPEGSync once and let it emit data at will. - this._read = noop; - var self = this; - self.canvas.streamJPEGSync(this.options, function(err, chunk){ + this._read = noop + var self = this + self.canvas.streamJPEGSync(this.options, function (err, chunk) { if (err) { - self.emit('error', err); + self.emit('error', err) } else if (chunk) { - self.push(chunk); + self.push(chunk) } else { - self.push(null); + self.push(null) } - }); -}; + }) +} diff --git a/lib/parse-font.js b/lib/parse-font.js index ce03529e0..43454e3e9 100644 --- a/lib/parse-font.js +++ b/lib/parse-font.js @@ -5,11 +5,16 @@ */ const weights = 'bold|bolder|lighter|[1-9]00' - , styles = 'italic|oblique' - , variants = 'small-caps' - , stretches = 'ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded' - , units = 'px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q' - , string = '\'([^\']+)\'|"([^"]+)"|[\\w\\s-]+' + +const styles = 'italic|oblique' + +const variants = 'small-caps' + +const stretches = 'ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded' + +const units = 'px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q' + +const string = '\'([^\']+)\'|"([^"]+)"|[\\w\\s-]+' // [ [ <‘font-style’> || || <‘font-weight’> || <‘font-stretch’> ]? // <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ] @@ -19,8 +24,8 @@ const styleRe = new RegExp('(' + styles + ') +', 'i') const variantRe = new RegExp('(' + variants + ') +', 'i') const stretchRe = new RegExp('(' + stretches + ') +', 'i') const sizeFamilyRe = new RegExp( - '([\\d\\.]+)(' + units + ') *' - + '((?:' + string + ')( *, *(?:' + string + '))*)') + '([\\d\\.]+)(' + units + ') *' + + '((?:' + string + ')( *, *(?:' + string + '))*)') /** * Cache font parsing. diff --git a/lib/pdfstream.js b/lib/pdfstream.js index 6aeec53d7..9547c5625 100644 --- a/lib/pdfstream.js +++ b/lib/pdfstream.js @@ -1,4 +1,4 @@ -'use strict'; +'use strict' /*! * Canvas - PDFStream @@ -7,33 +7,33 @@ var Readable = require('stream').Readable; var util = require('util'); -var PDFStream = module.exports = function PDFStream(canvas, options) { +var PDFStream = module.exports = function PDFStream (canvas, options) { if (!(this instanceof PDFStream)) { - throw new TypeError("Class constructors cannot be invoked without 'new'"); + throw new TypeError("Class constructors cannot be invoked without 'new'") } - Readable.call(this); + Readable.call(this) this.canvas = canvas; this.options = options; }; -util.inherits(PDFStream, Readable); +util.inherits(PDFStream, Readable) -function noop() {} +function noop () {} -PDFStream.prototype._read = function _read() { +PDFStream.prototype._read = function _read () { // For now we're not controlling the c++ code's data emission, so we only // call canvas.streamPDFSync once and let it emit data at will. - this._read = noop; - var self = this; - self.canvas.streamPDFSync(function(err, chunk, len){ + this._read = noop + var self = this + self.canvas.streamPDFSync(function (err, chunk, len) { if (err) { - self.emit('error', err); + self.emit('error', err) } else if (len) { - self.push(chunk); + self.push(chunk) } else { - self.push(null); + self.push(null) } }, this.options); }; diff --git a/lib/pngstream.js b/lib/pngstream.js index 021bb7fd9..8e6f7f909 100644 --- a/lib/pngstream.js +++ b/lib/pngstream.js @@ -1,4 +1,4 @@ -'use strict'; +'use strict' /*! * Canvas - PNGStream @@ -9,38 +9,38 @@ var Readable = require('stream').Readable; var util = require('util'); -var PNGStream = module.exports = function PNGStream(canvas, options) { +var PNGStream = module.exports = function PNGStream (canvas, options) { if (!(this instanceof PNGStream)) { - throw new TypeError("Class constructors cannot be invoked without 'new'"); + throw new TypeError("Class constructors cannot be invoked without 'new'") } - Readable.call(this); + Readable.call(this) if (options && options.palette instanceof Uint8ClampedArray && options.palette.length % 4 !== 0) { - throw new Error("Palette length must be a multiple of 4."); + throw new Error('Palette length must be a multiple of 4.') } - this.canvas = canvas; - this.options = options || {}; -}; + this.canvas = canvas + this.options = options || {} +} -util.inherits(PNGStream, Readable); +util.inherits(PNGStream, Readable) -function noop() {} +function noop () {} -PNGStream.prototype._read = function _read() { +PNGStream.prototype._read = function _read () { // For now we're not controlling the c++ code's data emission, so we only // call canvas.streamPNGSync once and let it emit data at will. - this._read = noop; - var self = this; - self.canvas.streamPNGSync(function(err, chunk, len){ + this._read = noop + var self = this + self.canvas.streamPNGSync(function (err, chunk, len) { if (err) { - self.emit('error', err); + self.emit('error', err) } else if (len) { - self.push(chunk); + self.push(chunk) } else { - self.push(null); + self.push(null) } - }, self.options); -}; + }, self.options) +} diff --git a/package.json b/package.json index 78b31f82b..22d434158 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,13 @@ "homepage": "https://github.com/Automattic/node-canvas", "repository": "git://github.com/Automattic/node-canvas.git", "scripts": { - "prebenchmark": "node-gyp build", + "build": "node-pre-gyp build", + "prebenchmark": "npm run build", "benchmark": "node benchmarks/run.js", "lint": "standard examples/*.js test/server.js test/public/*.js benchmarks/run.js lib/context2d.js util/has_lib.js browser.js index.js", + "pretest": "npm run lint && npm run build", "test": "mocha test/*.test.js", - "pretest-server": "node-gyp build", + "pretest-server": "npm run build", "test-server": "node test/server.js", "install": "node-pre-gyp install --fallback-to-build", "dtslint": "dtslint types" @@ -48,18 +50,19 @@ ], "types": "types/index.d.ts", "dependencies": { - "nan": "^2.14.0", + "nan": "^2.14.2", "node-pre-gyp": "^0.15.0", - "simple-get": "^3.0.3" + "simple-get": "^4.0.0" }, "devDependencies": { - "@types/node": "^10.12.18", + "@types/node": "^14.14.2", "assert-rejects": "^1.0.0", - "dtslint": "^0.5.3", - "express": "^4.16.3", - "mocha": "^5.2.0", - "pixelmatch": "^4.0.2", - "standard": "^12.0.1" + "dtslint": "^4.0.4", + "express": "^4.17.1", + "mocha": "^8.2.0", + "pixelmatch": "^5.2.1", + "standard": "^15.0.0", + "typescript": "^4.0.3" }, "engines": { "node": ">=6" diff --git a/shared.gypi b/shared.gypi new file mode 100644 index 000000000..808b249b5 --- /dev/null +++ b/shared.gypi @@ -0,0 +1,249 @@ +{ + 'conditions': + [ + ['OS=="win"', { + 'variables': + { + 'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle + 'with_jpeg%': 'false', + 'with_gif%': 'false', + 'with_rsvg%': 'false', + 'variables': { # Nest jpeg_root to evaluate it before with_jpeg + 'jpeg_root%': ' target) { @@ -14,5 +21,12 @@ void Backends::Initialize(Local target) { PdfBackend::Initialize(obj); SvgBackend::Initialize(obj); + #ifdef HAS_FBDEV + FBDevBackend::Initialize(obj); + #endif + #ifdef HAS_X11 + XlibBackend::Initialize(obj); + #endif + Nan::Set(target, Nan::New("Backends").ToLocalChecked(), obj).Check(); } diff --git a/src/Backends.h b/src/Backends.h index dbea053ce..f6c48b960 100644 --- a/src/Backends.h +++ b/src/Backends.h @@ -1,9 +1,9 @@ #pragma once -#include "backend/Backend.h" #include #include + class Backends : public Nan::ObjectWrap { public: static void Initialize(v8::Local target); diff --git a/src/Canvas.cc b/src/Canvas.cc index 17d6d828d..5ac403981 100644 --- a/src/Canvas.cc +++ b/src/Canvas.cc @@ -30,6 +30,13 @@ #include "backend/PdfBackend.h" #include "backend/SvgBackend.h" +#ifdef HAS_FBDEV +#include "backend/FBDevBackend.h" +#endif +#ifdef HAS_X11 +#include "backend/XlibBackend.h" +#endif + #define GENERIC_FACE_ERROR \ "The second argument to registerFont is required, and should be an object " \ "with at least a family (string) and optionally weight (string/number) " \ @@ -91,7 +98,7 @@ Canvas::Initialize(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target) { */ NAN_METHOD(Canvas::New) { - if (!info.IsConstructCall()) { + if (!info.IsConstructCall()) { return Nan::ThrowTypeError("Class constructors cannot be invoked without 'new'"); } @@ -106,8 +113,31 @@ NAN_METHOD(Canvas::New) { backend = new PdfBackend(width, height); else if (0 == strcmp("svg", *Nan::Utf8String(info[2]))) backend = new SvgBackend(width, height); +#ifdef HAS_FBDEV + else if (0 == strcmp("fbdev", *Nan::Utf8String(info[2]))) { + if (info[3]->IsString()) { + if(info[4]->IsBoolean()) { + if(info[5]->IsBoolean()) + backend = new FBDevBackend(width, height, *Nan::Utf8String(info[3]), + Nan::To(info[4]).FromMaybe(0), Nan::To(info[5]).FromMaybe(0)); + else + backend = new FBDevBackend(width, height, *Nan::Utf8String(info[3]), + Nan::To(info[4]).FromMaybe(0)); + } + else + backend = new FBDevBackend(width, height, *Nan::Utf8String(info[3])); + } + else + backend = new FBDevBackend(width, height); + } +#endif +#ifdef HAS_X11 + else if (0 == strcmp("xlib", *Nan::Utf8String(info[2]))) { + backend = new XlibBackend(width, height); + } +#endif else - backend = new ImageBackend(width, height); + return Nan::ThrowRangeError("Unknown canvas type"); } else backend = new ImageBackend(width, height); @@ -115,7 +145,14 @@ NAN_METHOD(Canvas::New) { else if (info[0]->IsObject()) { if (Nan::New(ImageBackend::constructor)->HasInstance(info[0]) || Nan::New(PdfBackend::constructor)->HasInstance(info[0]) || - Nan::New(SvgBackend::constructor)->HasInstance(info[0])) { + Nan::New(SvgBackend::constructor)->HasInstance(info[0]) +#ifdef HAS_FBDEV + || Nan::New(FBDevBackend::constructor)->HasInstance(info[0]) +#endif +#ifdef HAS_X11 + || Nan::New(XlibBackend::constructor)->HasInstance(info[0]) +#endif + ) { backend = Nan::ObjectWrap::Unwrap(Nan::To(info[0]).ToLocalChecked()); }else{ return Nan::ThrowTypeError("Invalid arguments"); @@ -503,7 +540,14 @@ NAN_METHOD(Canvas::ToBuffer) { // Async JPEG if (info[0]->IsFunction() && info[1]->StrictEquals(jpegStr)) { - JpegClosure* closure = new JpegClosure(canvas); + JpegClosure* closure; + try { + closure = new JpegClosure(canvas); + } catch (cairo_status_t ex) { + Nan::ThrowError(Canvas::Error(ex)); + return; + } + parseJPEGArgs(info[2], *closure); canvas->Ref(); @@ -779,8 +823,8 @@ Canvas::Canvas(Backend* backend) : ObjectWrap() { Canvas::~Canvas() { if (_backend != NULL) { - delete _backend; - } + delete _backend; + } } /* @@ -895,8 +939,6 @@ Canvas::resurface(Local canvas) { Nan::HandleScope scope; Local context; - backend()->recreateSurface(); - // Reset context context = Nan::Get(canvas, Nan::New("context").ToLocalChecked()).ToLocalChecked(); if (!context->IsUndefined()) { diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index dba80662b..987f35947 100644 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -423,6 +423,9 @@ Context2d::fill(bool preserve) { ? shadow(cairo_fill) : cairo_fill(_context); } + + // Notify backend that the Cairo surface has got a painting operation + canvas()->backend()->onPaint(); } /* @@ -477,6 +480,9 @@ Context2d::stroke(bool preserve) { ? shadow(cairo_stroke) : cairo_stroke(_context); } + + // Notify backend that the Cairo surface has got a painting operation + canvas()->backend()->onPaint(); } /* @@ -763,12 +769,15 @@ NAN_METHOD(Context2d::AddPage) { return Nan::ThrowError("only PDF canvases support .addPage()"); } cairo_show_page(context->context()); + int width = Nan::To(info[0]).FromMaybe(0); int height = Nan::To(info[1]).FromMaybe(0); if (width < 1) width = context->canvas()->getWidth(); if (height < 1) height = context->canvas()->getHeight(); cairo_pdf_surface_set_size(context->canvas()->surface(), width, height); - return; + + // Notify backend that the Cairo surface has got a painting operation + context->canvas()->backend()->onPaint(); } /* @@ -958,6 +967,9 @@ NAN_METHOD(Context2d::PutImageData) { , dy , cols , rows); + + // Notify backend that the Cairo surface has got a painting operation + context->canvas()->backend()->onPaint(); } /* @@ -1409,6 +1421,9 @@ NAN_METHOD(Context2d::DrawImage) { cairo_destroy(ctxTemp); cairo_surface_destroy(surfTemp); } + + // Notify backend that the Cairo surface has got a painting operation + context->canvas()->backend()->onPaint(); } /* diff --git a/src/backend/Backend.cc b/src/backend/Backend.cc index a78fecd5c..0dfbfd0be 100644 --- a/src/backend/Backend.cc +++ b/src/backend/Backend.cc @@ -1,10 +1,15 @@ -#include "Backend.h" #include +#include + +#include "Backend.h" + + Backend::Backend(std::string name, int width, int height) : name(name) , width(width) , height(height) + , format(CAIRO_FORMAT_INVALID) {} Backend::~Backend() @@ -30,11 +35,11 @@ void Backend::setCanvas(Canvas* _canvas) } -cairo_surface_t* Backend::recreateSurface() +void Backend::recreateSurface() { this->destroySurface(); - return this->createSurface(); + this->createSurface(); } DLL_PUBLIC cairo_surface_t* Backend::getSurface() { @@ -61,22 +66,32 @@ int Backend::getWidth() { return this->width; } -void Backend::setWidth(int width_) +void Backend::setWidth(int width) { - this->width = width_; - this->recreateSurface(); + this->width = width; + this->recreateSurface(); } int Backend::getHeight() { return this->height; } -void Backend::setHeight(int height_) +void Backend::setHeight(int height) { - this->height = height_; + this->height = height; this->recreateSurface(); } +cairo_format_t Backend::getFormat() +{ + return this->format; +} +void Backend::setFormat(cairo_format_t format) +{ + this->format = format; + this->recreateSurface(); +} + bool Backend::isSurfaceValid(){ bool hadSurface = surface != NULL; bool isValid = true; diff --git a/src/backend/Backend.h b/src/backend/Backend.h index c0c4e1928..7f79cbcca 100644 --- a/src/backend/Backend.h +++ b/src/backend/Backend.h @@ -18,10 +18,16 @@ class Backend : public Nan::ObjectWrap protected: int width; int height; + cairo_format_t format; cairo_surface_t* surface = nullptr; Canvas* canvas = nullptr; - Backend(std::string name, int width, int height); + Backend(std::string name, int width = 0, int height = 0); + + virtual void createSurface() = 0; + virtual void destroySurface(); + virtual void recreateSurface(); + static void init(const Nan::FunctionCallbackInfo &info); static Backend *construct(int width, int height){ return nullptr; } @@ -30,12 +36,7 @@ class Backend : public Nan::ObjectWrap void setCanvas(Canvas* canvas); - virtual cairo_surface_t* createSurface() = 0; - virtual cairo_surface_t* recreateSurface(); - DLL_PUBLIC cairo_surface_t* getSurface(); - virtual void destroySurface(); - DLL_PUBLIC std::string getName(); DLL_PUBLIC int getWidth(); @@ -45,12 +46,13 @@ class Backend : public Nan::ObjectWrap virtual void setHeight(int height); // Overridden by ImageBackend. SVG and PDF thus always return INVALID. - virtual cairo_format_t getFormat() { - return CAIRO_FORMAT_INVALID; - } + virtual cairo_format_t getFormat(); + virtual void setFormat(cairo_format_t format); bool isSurfaceValid(); inline const char* getError(){ return error; } + + virtual void onPaint(){}; }; diff --git a/src/backend/FBDevBackend.cc b/src/backend/FBDevBackend.cc new file mode 100644 index 000000000..fa100df1f --- /dev/null +++ b/src/backend/FBDevBackend.cc @@ -0,0 +1,359 @@ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "FBDevBackend.h" + + +using namespace v8; + + +// switch through bpp and decide on which format for the cairo surface to use +cairo_format_t bits2format(__u32 bits_per_pixel) +{ + switch(bits_per_pixel) + { + case 16: return CAIRO_FORMAT_RGB16_565; + case 24: return CAIRO_FORMAT_RGB24; + case 32: return CAIRO_FORMAT_ARGB32; + + default: + throw FBDevBackendException("Only valid formats are RGB16_565, RGB24 and ARGB32"); + } +} + + +FBDevBackend::FBDevBackend(int width, int height, string deviceName, + bool useDoubleBuffer, bool enableFlipPages) + : ScreenBackend("fbdev", width, height) + , useDoubleBuffer(useDoubleBuffer) + , enableFlipPages(enableFlipPages) +{ + struct fb_var_screeninfo fb_vinfo; + + this->initFbDev(deviceName, &fb_vinfo); + + fb_vinfo.xres = width; + fb_vinfo.yres = height; + + this->FbDevIoctlHelper(FBIOPUT_VSCREENINFO, &fb_vinfo, + "Error setting variable framebuffer information"); +} + +FBDevBackend::FBDevBackend(string deviceName, bool useDoubleBuffer, + bool enableFlipPages) + : ScreenBackend("fbdev") + , useDoubleBuffer(useDoubleBuffer) + , enableFlipPages(enableFlipPages) +{ + struct fb_var_screeninfo fb_vinfo; + + this->initFbDev(deviceName, &fb_vinfo); + + this->width = fb_vinfo.xres; + this->height = fb_vinfo.yres; +} + +FBDevBackend::~FBDevBackend() +{ + this->destroySurface(); + + close(this->fb_fd); +} + + +void FBDevBackend::initFbDev(string deviceName, struct fb_var_screeninfo* fb_vinfo) +{ + // Open the file for reading and writing + this->fb_fd = open(deviceName.c_str(), O_RDWR); + + if(this->fb_fd == -1) + { + std::ostringstream o; + o << "cannot open framebuffer device \"" << deviceName << "\""; + throw FBDevBackendException(o.str()); + } + + this->FbDevIoctlHelper(FBIOGET_VSCREENINFO, fb_vinfo, + "Error reading variable framebuffer information"); + + this->format = bits2format(fb_vinfo->bits_per_pixel); +} + + +void FBDevBackend::FbDevIoctlHelper(unsigned long request, void* data, + string errmsg) +{ + if(ioctl(this->fb_fd, request, data) == -1) + throw FBDevBackendException(errmsg.c_str()); +} + + +void FBDevBackend::createSurface() +{ + assert(!surface); + + struct fb_var_screeninfo fb_vinfo; + + this->FbDevIoctlHelper(FBIOGET_VSCREENINFO, &fb_vinfo, + "Error reading variable framebuffer information"); + + int stride = cairo_format_stride_for_width(format, fb_vinfo.xres); + + // Reset vertical panning + fb_vinfo.yoffset = 0; + ioctl(this->fb_fd, FBIOPAN_DISPLAY, &fb_vinfo); + + bool useFlipPages = false; + + // Check support for double buffering features + if(useDoubleBuffer || fb_vinfo.bits_per_pixel == 24) + { + // Try to use real double buffer inside graphic card memory. If FbDev driver + // don't support to have a virtual framebuffer bigger than the actual one, + // then we'll use a buffer in memory. It's not so efficient and could lead + // to some tearing, but with VSync this should be minimal and at least we'll + // not see screen redraws. + fb_vinfo.yres_virtual = fb_vinfo.yres * 2; + + // Adjust virtual framebuffer width to hold RGB24 Cairo surface in 24 bits + fb_vinfo.xres_virtual = fb_vinfo.bits_per_pixel == 24 + ? ceil(fb_vinfo.xres*4/3) + : fb_vinfo.xres; + + useInMemoryBackBuffer = ioctl(this->fb_fd, FBIOPUT_VSCREENINFO, &fb_vinfo) == -1; + + if(enableFlipPages && !useInMemoryBackBuffer && fb_vinfo.bits_per_pixel != 24) + { + // Try to use page flipping inside graphic card memory. If FbDev driver + // don't support vertical panning, then we'll need to copy data from back + // buffer. It's not so efficient and could lead to some tearing, but with + // VSync this should be minimal and at least we'll not see screen redraws. + fb_vinfo.yoffset = fb_vinfo.yres; + + useFlipPages = ioctl(this->fb_fd, FBIOPAN_DISPLAY, &fb_vinfo) == 0; + } + } + + // Map the device to memory with new virtual framebuffer dimensions and config + this->FbDevIoctlHelper(FBIOGET_FSCREENINFO, &fb_finfo, + "Error reading fixed framebuffer information"); + + this->fb_data = (unsigned char*) mmap(0, fb_finfo.smem_len, + PROT_READ | PROT_WRITE, MAP_SHARED, this->fb_fd, 0); + + if(this->fb_data == MAP_FAILED) + throw FBDevBackendException("Failed to map framebuffer device to memory"); + + // Set pointers of the front and back buffers + front_buffer = this->fb_data; + + if(!useDoubleBuffer && fb_vinfo.bits_per_pixel != 24) + back_buffer = front_buffer; + + else if(useInMemoryBackBuffer) + back_buffer = (unsigned char*)calloc(fb_vinfo.yres, stride); + + else + { + // back buffer in graphic card memory + back_buffer = front_buffer + fb_vinfo.yres * fb_finfo.line_length; + + if(useFlipPages) + { + // Swap front and back buffers since vertical panning checking was + // succesful (so for the graphic card they were already swapped) + front_buffer = back_buffer; + back_buffer = this->fb_data; + + this->flip_surface = cairo_image_surface_create_for_data(this->back_buffer, + format, fb_vinfo.xres, fb_vinfo.yres, stride); + } + } + + // create cairo surface from data + this->surface = cairo_image_surface_create_for_data(this->back_buffer, + format, fb_vinfo.xres, fb_vinfo.yres, stride); +} + +void FBDevBackend::destroySurface() +{ + ScreenBackend::destroySurface(); + + if(useInMemoryBackBuffer && back_buffer) + { + free(back_buffer); + + back_buffer = NULL; + } + + if(this->fb_data) + { + munmap(this->fb_data, fb_finfo.smem_len); + + this->fb_data = NULL; + } + + if(this->flip_surface) + { + cairo_surface_destroy(this->flip_surface); + + this->flip_surface = NULL; + } +} + + +void FBDevBackend::setWidth(int width) +{ + struct fb_var_screeninfo fb_vinfo; + + this->FbDevIoctlHelper(FBIOGET_VSCREENINFO, &fb_vinfo, + "Error reading variable framebuffer information"); + + fb_vinfo.xres = width; + + this->FbDevIoctlHelper(FBIOPUT_VSCREENINFO, &fb_vinfo, + "Error setting variable framebuffer information"); + + ScreenBackend::setWidth(width); +} +void FBDevBackend::setHeight(int height) +{ + struct fb_var_screeninfo fb_vinfo; + + this->FbDevIoctlHelper(FBIOGET_VSCREENINFO, &fb_vinfo, + "Error reading variable framebuffer information"); + + fb_vinfo.yres = height; + + if(useDoubleBuffer) fb_vinfo.yres_virtual = height * 2; + + this->FbDevIoctlHelper(FBIOPUT_VSCREENINFO, &fb_vinfo, + "Error setting variable framebuffer information"); + + ScreenBackend::setHeight(height); +} +void FBDevBackend::setFormat(cairo_format_t format) +{ + struct fb_var_screeninfo fb_vinfo; + + this->FbDevIoctlHelper(FBIOGET_VSCREENINFO, &fb_vinfo, + "Error reading variable framebuffer information"); + + switch(format) + { + case CAIRO_FORMAT_RGB16_565: fb_vinfo.bits_per_pixel = 16; break; + case CAIRO_FORMAT_RGB24: fb_vinfo.bits_per_pixel = 24; break; + case CAIRO_FORMAT_ARGB32: fb_vinfo.bits_per_pixel = 32; break; + + default: + throw FBDevBackendException("Only valid formats are RGB16_565, RGB24 and ARGB32"); + } + + this->FbDevIoctlHelper(FBIOPUT_VSCREENINFO, &fb_vinfo, + "Error setting variable framebuffer information"); + + ScreenBackend::setFormat(format); +} + + +void FBDevBackend::copyBackBuffer(struct fb_var_screeninfo* fb_vinfo) +{ + if(fb_vinfo->bits_per_pixel != 24) + memcpy(front_buffer, back_buffer, fb_vinfo->yres * fb_finfo.line_length); + + else + { + int stride = cairo_format_stride_for_width(format, fb_vinfo->xres); + + for(unsigned int y=0; yyres; y++) + for(unsigned int x=0; xxres; x++) + memcpy(front_buffer + y*fb_finfo.line_length + x*3, + back_buffer + y*stride + x*4 + 1, + 3); + } +} +void FBDevBackend::flipPages(struct fb_var_screeninfo* fb_vinfo) +{ + // Update display panning + fb_vinfo->yoffset = fb_vinfo->yoffset ? 0 : fb_vinfo->yres; + + this->FbDevIoctlHelper(FBIOPAN_DISPLAY, fb_vinfo, + "Error panning the framebuffer display"); + + // Swap front and back surfaces + cairo_surface_t* aux = flip_surface; + flip_surface = surface; + surface = aux; +} + +void FBDevBackend::swapBuffers() +{ + if(!this->surface) return; + + struct fb_var_screeninfo fb_vinfo; + + this->FbDevIoctlHelper(FBIOGET_VSCREENINFO, &fb_vinfo, + "Error reading variable framebuffer information"); + + if(!useDoubleBuffer && fb_vinfo.bits_per_pixel != 24) return; + + if(this->flip_surface) + flipPages(&fb_vinfo); + + else + copyBackBuffer(&fb_vinfo); +} + +void FBDevBackend::waitVSync() +{ + int arg = 0; + + this->FbDevIoctlHelper(FBIO_WAITFORVSYNC, &arg, + "Error waiting for framebuffer VSync"); +} + + +Nan::Persistent FBDevBackend::constructor; + +void FBDevBackend::Initialize(Local target) +{ + Nan::HandleScope scope; + + Local ctor = Nan::New(FBDevBackend::New); + FBDevBackend::constructor.Reset(ctor); + ctor->InstanceTemplate()->SetInternalFieldCount(1); + ctor->SetClassName(Nan::New("FBDevBackend").ToLocalChecked()); + + ScreenBackend::Initialize(ctor); + + Nan::Set(target, + Nan::New("FBDevBackend").ToLocalChecked(), + Nan::GetFunction(ctor).ToLocalChecked()).Check(); +} + +NAN_METHOD(FBDevBackend::New) +{ + string fbDevice = DEFAULT_DEVICE; + if(info[0]->IsString()) fbDevice = *Nan::Utf8String(info[0]); + + bool useDoubleBuffer = false; + if(info[1]->IsBoolean()) useDoubleBuffer = Nan::To(info[1]).FromMaybe(0); + + bool enableFlipPages = false; + if(info[2]->IsBoolean()) enableFlipPages = Nan::To(info[2]).FromMaybe(0); + + FBDevBackend* backend = new FBDevBackend(fbDevice, useDoubleBuffer, + enableFlipPages); + + backend->Wrap(info.This()); + info.GetReturnValue().Set(info.This()); +} diff --git a/src/backend/FBDevBackend.h b/src/backend/FBDevBackend.h new file mode 100644 index 000000000..b316162b5 --- /dev/null +++ b/src/backend/FBDevBackend.h @@ -0,0 +1,73 @@ +#ifndef __FBDEV_BACKEND_H__ +#define __FBDEV_BACKEND_H__ + +#include +#include + +#include +#include + +#include "ScreenBackend.h" + + +using namespace std; + + +const string DEFAULT_DEVICE = "/dev/fb0"; + + +class FBDevBackend : public ScreenBackend +{ + private: + int fb_fd; + struct fb_fix_screeninfo fb_finfo; + unsigned char* fb_data = NULL; + unsigned char* front_buffer; + unsigned char* back_buffer = NULL; + bool useDoubleBuffer; + bool useInMemoryBackBuffer = false; + cairo_surface_t* flip_surface = NULL; + bool enableFlipPages; + + ~FBDevBackend(); + + void initFbDev(string deviceName, struct fb_var_screeninfo* fb_vinfo); + void FbDevIoctlHelper(unsigned long request, void* data, string errmsg); + + void createSurface(); + void destroySurface(); + + void setWidth(int width); + void setHeight(int height); + void setFormat(cairo_format_t format); + + void copyBackBuffer(struct fb_var_screeninfo* fb_vinfo); + void flipPages(struct fb_var_screeninfo* fb_vinfo); + void swapBuffers(); + void waitVSync(); + + public: + FBDevBackend(int width, int height, string deviceName = DEFAULT_DEVICE, + bool useDoubleBuffer = false, bool enableFlipPages = false); + FBDevBackend(string deviceName, bool useDoubleBuffer = false, + bool enableFlipPages = false); + + static Nan::Persistent constructor; + static void Initialize(v8::Local target); + static NAN_METHOD(New); +}; + + +class FBDevBackendException : public std::exception +{ + private: + string err_msg; + + public: + FBDevBackendException(const string msg) : err_msg(msg) {}; + ~FBDevBackendException() throw() {}; + + const char *what() const throw() { return this->err_msg.c_str(); }; +}; + +#endif diff --git a/src/backend/ImageBackend.cc b/src/backend/ImageBackend.cc index d354d92cc..170b2c73b 100644 --- a/src/backend/ImageBackend.cc +++ b/src/backend/ImageBackend.cc @@ -31,20 +31,25 @@ int32_t ImageBackend::approxBytesPerPixel() { } } -cairo_surface_t* ImageBackend::createSurface() { +void ImageBackend::createSurface() +{ assert(!surface); surface = cairo_image_surface_create(format, width, height); assert(surface); Nan::AdjustExternalMemory(approxBytesPerPixel() * width * height); - return surface; } -void ImageBackend::destroySurface() { - if (surface) { - cairo_surface_destroy(surface); - surface = nullptr; - Nan::AdjustExternalMemory(-approxBytesPerPixel() * width * height); - } +void ImageBackend::recreateSurface() +{ + // Re-surface + if (this->surface) { + int old_width = cairo_image_surface_get_width(this->surface); + int old_height = cairo_image_surface_get_height(this->surface); + this->destroySurface(); + Nan::AdjustExternalMemory(-approxBytesPerPixel() * old_width * old_height); + } + + createSurface(); } cairo_format_t ImageBackend::getFormat() { diff --git a/src/backend/ImageBackend.h b/src/backend/ImageBackend.h index f68dacfdb..9d4df5efc 100644 --- a/src/backend/ImageBackend.h +++ b/src/backend/ImageBackend.h @@ -6,8 +6,8 @@ class ImageBackend : public Backend { private: - cairo_surface_t* createSurface(); - void destroySurface(); + void createSurface(); + void recreateSurface(); cairo_format_t format = DEFAULT_FORMAT; public: diff --git a/src/backend/PdfBackend.cc b/src/backend/PdfBackend.cc index d8bd23422..d19565543 100644 --- a/src/backend/PdfBackend.cc +++ b/src/backend/PdfBackend.cc @@ -21,16 +21,14 @@ Backend *PdfBackend::construct(int width, int height){ return new PdfBackend(width, height); } -cairo_surface_t* PdfBackend::createSurface() { +void PdfBackend::createSurface() { if (!_closure) _closure = new PdfSvgClosure(canvas); + surface = cairo_pdf_surface_create_for_stream(PdfSvgClosure::writeVec, _closure, width, height); - return surface; } -cairo_surface_t* PdfBackend::recreateSurface() { +void PdfBackend::recreateSurface() { cairo_pdf_surface_set_size(surface, width, height); - - return surface; } diff --git a/src/backend/PdfBackend.h b/src/backend/PdfBackend.h index 03656f500..15e00b150 100644 --- a/src/backend/PdfBackend.h +++ b/src/backend/PdfBackend.h @@ -7,8 +7,8 @@ class PdfBackend : public Backend { private: - cairo_surface_t* createSurface(); - cairo_surface_t* recreateSurface(); + void createSurface(); + void recreateSurface(); public: PdfSvgClosure* _closure = NULL; diff --git a/src/backend/ScreenBackend.cc b/src/backend/ScreenBackend.cc new file mode 100644 index 000000000..00ff35a3e --- /dev/null +++ b/src/backend/ScreenBackend.cc @@ -0,0 +1,53 @@ +#include "ScreenBackend.h" + + +using Nan::AsyncQueueWorker; +using Nan::AsyncWorker; +using Nan::Callback; + + +class WaitVSync: public AsyncWorker +{ + public: + WaitVSync(Callback* callback, ScreenBackend* backend) + : AsyncWorker(callback, "ScreenBackend:WaitVSync") + , backend(backend) + {} + + void Execute() + { + backend->waitVSync(); + } + + private: + ScreenBackend* backend; +}; + + +ScreenBackend::ScreenBackend(std::string name, int width, int height) + : Backend(name, width, height) +{} + + +NAN_METHOD(ScreenBackend::swapBuffers) +{ + ScreenBackend* backend = Nan::ObjectWrap::Unwrap(info.This()); + + backend->swapBuffers(); +} + +NAN_METHOD(ScreenBackend::waitVSync) +{ + ScreenBackend* backend = Nan::ObjectWrap::Unwrap(info.This()); + + Callback* callback = new Callback(info[0].As()); + + AsyncQueueWorker(new WaitVSync(callback, backend)); +} + + +void ScreenBackend::Initialize(Local ctor) +{ + Nan::SetPrototypeMethod(ctor, "swapBuffers", swapBuffers); + Nan::SetPrototypeMethod(ctor, "waitVSync", waitVSync); +} diff --git a/src/backend/ScreenBackend.h b/src/backend/ScreenBackend.h new file mode 100644 index 000000000..36ec32bea --- /dev/null +++ b/src/backend/ScreenBackend.h @@ -0,0 +1,24 @@ +#pragma once + +#include "Backend.h" + + +using namespace v8; + + +class ScreenBackend : public Backend +{ + friend class WaitVSync; + + private: + virtual void swapBuffers(){}; + virtual void waitVSync(){}; + + static NAN_METHOD(swapBuffers); + static NAN_METHOD(waitVSync); + + protected: + ScreenBackend(std::string name, int width = 0, int height = 0); + + static void Initialize(Local ctor); +}; diff --git a/src/backend/SvgBackend.cc b/src/backend/SvgBackend.cc index 10bf4caa7..da5b8a113 100644 --- a/src/backend/SvgBackend.cc +++ b/src/backend/SvgBackend.cc @@ -25,20 +25,19 @@ Backend *SvgBackend::construct(int width, int height){ return new SvgBackend(width, height); } -cairo_surface_t* SvgBackend::createSurface() { - assert(!_closure); - _closure = new PdfSvgClosure(canvas); +void SvgBackend::createSurface() { + if (!_closure) _closure = new PdfSvgClosure(canvas); + surface = cairo_svg_surface_create_for_stream(PdfSvgClosure::writeVec, _closure, width, height); - return surface; } -cairo_surface_t* SvgBackend::recreateSurface() { +void SvgBackend::recreateSurface() { cairo_surface_finish(surface); delete _closure; _closure = nullptr; cairo_surface_destroy(surface); - return createSurface(); + createSurface(); } diff --git a/src/backend/SvgBackend.h b/src/backend/SvgBackend.h index 6377b438b..e8ab3a80c 100644 --- a/src/backend/SvgBackend.h +++ b/src/backend/SvgBackend.h @@ -7,8 +7,8 @@ class SvgBackend : public Backend { private: - cairo_surface_t* createSurface(); - cairo_surface_t* recreateSurface(); + void createSurface(); + void recreateSurface(); public: PdfSvgClosure* _closure = NULL; diff --git a/src/backend/Win32Backend.cc b/src/backend/Win32Backend.cc new file mode 100644 index 000000000..d4f0b35f4 --- /dev/null +++ b/src/backend/Win32Backend.cc @@ -0,0 +1,146 @@ +#include "Win32Backend.h" + +using namespace v8; + + +UINT style = WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_OVERLAPPED; + + +void adjustWindowRect(LPRECT pRect, int width, int height) +{ + pRect->left = CW_USEDEFAULT; + pRect->top = CW_USEDEFAULT; + pRect->right = width; + pRect->bottom = height; + + if(!AdjustWindowRect(pRect, style, FALSE)) + { + std::ostringstream o; + o << "cannot adjust window rect"; + throw Win32BackendException(o.str()); + }; +} + + +Win32Backend::Win32Backend(int width, int height) + : ScreenBackend("win32", width, height) +{ + RECT rect; + + adjustWindowRect(&rect, width, height); + + this->window = CreateWindow('', '', style, + rect.left, rect.top, rect.right, rect.bottom, + NULL, NULL, NULL, NULL + ); + + if(!this->window) + { + std::ostringstream o; + o << "cannot create the window"; + throw Win32BackendException(o.str()); + }; + + // Disable window close button + IntPtr menuHandle = GetSystemMenu(this->window, FALSE); + + if(EnableMenuItem(menuHandle, SC_CLOSE | SC_MOVE | SC_SIZE, + MF_BYCOMMAND | MF_DISABLED | MF_GRAYED) == -1) + { + std::ostringstream o; + o << "cannot enable menu item"; + throw Win32BackendException(o.str()); + }; + + if(!DestroyMenu(menuHandle)) + { + std::ostringstream o; + o << "cannot destroy menu handler"; + throw Win32BackendException(o.str()); + }; +} + +Win32Backend::~Win32Backend() +{ + if(!DestroyWindow(this->window)) + { + std::ostringstream o; + o << "cannot destroy the window"; + throw Win32BackendException(o.str()); + }; +} + + +void Win32Backend::createSurface() +{ + assert(!surface); + + this->surface = cairo_win32_surface_create(hdc); +} + + +void Win32Backend::setWidth(int width) +{ + RECT rect; + + adjustWindowRect(&rect, width, height); + + if(!SetWindowPos(this->window, HWND_TOP, 0, 0, rect.right, rect.bottom, + SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER)) + { + std::ostringstream o; + o << "cannot set width \"" << width << "\""; + throw Win32BackendException(o.str()); + }; + + ScreenBackend::setWidth(width); +} + +void Win32Backend::setHeight(int height) +{ + RECT rect; + + adjustWindowRect(&rect, width, height); + + if(!SetWindowPos(this->window, HWND_TOP, 0, 0, rect.right, rect.bottom, + SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER)) + { + std::ostringstream o; + o << "cannot set height \"" << height << "\""; + throw Win32BackendException(o.str()); + }; + + ScreenBackend::setHeight(height); +} + + +Nan::Persistent Win32Backend::constructor; + +void Win32Backend::Initialize(Handle target) +{ + Nan::HandleScope scope; + + Local ctor = Nan::New(Win32Backend::New); + Win32Backend::constructor.Reset(ctor); + ctor->InstanceTemplate()->SetInternalFieldCount(1); + ctor->SetClassName(Nan::New("Win32Backend").ToLocalChecked()); + + ScreenBackend::Initialize(ctor); + + Nan::Set(target, + Nan::New("Win32Backend").ToLocalChecked(), + Nan::GetFunction(ctor).ToLocalChecked()).Check(); +} + +NAN_METHOD(Win32Backend::New) +{ + int width = 0; + int height = 0; + if(info[0]->IsNumber()) width = info[0]->Uint32Value(); + if(info[1]->IsNumber()) height = info[1]->Uint32Value(); + + Win32Backend* backend = new Win32Backend(width, height); + + backend->Wrap(info.This()); + info.GetReturnValue().Set(info.This()); +} diff --git a/src/backend/Win32Backend.h b/src/backend/Win32Backend.h new file mode 100644 index 000000000..bec96f1d3 --- /dev/null +++ b/src/backend/Win32Backend.h @@ -0,0 +1,47 @@ +#ifndef __WIN32_BACKEND_H__ +#define __WIN32_BACKEND_H__ + +#include + +#include + +#include "ScreenBackend.h" + + +using namespace std; + + +class Win32Backend : public ScreenBackend +{ + private: + HWND window; + + ~Win32Backend(); + + void createSurface(); + + void setWidth(int width); + void setHeight(int height); + + public: + Win32Backend(int width, int height); + + static Nan::Persistent constructor; + static void Initialize(v8::Handle target); + static NAN_METHOD(New); +}; + + +class Win32BackendException : public std::exception +{ + private: + string err_msg; + + public: + Win32BackendException(const string msg) : err_msg(msg) {}; + ~Win32BackendException() throw() {}; + + const char *what() const throw() { return this->err_msg.c_str(); }; +}; + +#endif diff --git a/src/backend/XlibBackend.cc b/src/backend/XlibBackend.cc new file mode 100644 index 000000000..cd76e19c4 --- /dev/null +++ b/src/backend/XlibBackend.cc @@ -0,0 +1,65 @@ +#include "XlibBackend.h" + + +XlibBackend::XlibBackend(int width, int height, char *display_name) + : ScreenBackend("xlib", width, height) + , xlibBackendPriv(width, height, display_name) +{} + + +void XlibBackend::createSurface() +{ + assert(!surface); + + this->surface = xlibBackendPriv.cairo_surface_create(width, height); +} + + +void XlibBackend::setWidth(int width) +{ + xlibBackendPriv.ResizeWindow(width, this->height); + + ScreenBackend::setWidth(width); +} + +void XlibBackend::setHeight(int height) +{ + xlibBackendPriv.ResizeWindow(this->width, height); + + ScreenBackend::setHeight(height); +} + + +Nan::Persistent XlibBackend::constructor; + +void XlibBackend::Initialize(Local target) +{ + Nan::HandleScope scope; + + Local ctor = Nan::New(XlibBackend::New); + XlibBackend::constructor.Reset(ctor); + ctor->InstanceTemplate()->SetInternalFieldCount(1); + ctor->SetClassName(Nan::New("XlibBackend").ToLocalChecked()); + + ScreenBackend::Initialize(ctor); + + Nan::Set(target, + Nan::New("XlibBackend").ToLocalChecked(), + Nan::GetFunction(ctor).ToLocalChecked()).Check(); +} + +NAN_METHOD(XlibBackend::New) +{ + int width = 0; + int height = 0; + if (info[0]->IsNumber()) width = Nan::To(info[0]).FromMaybe(0); + if (info[1]->IsNumber()) height = Nan::To(info[1]).FromMaybe(0); + + char *display_name = nullptr; + if (info[2]->IsString()) display_name = *Nan::Utf8String(info[2]); + + XlibBackend *backend = new XlibBackend(width, height, display_name); + + backend->Wrap(info.This()); + info.GetReturnValue().Set(info.This()); +} diff --git a/src/backend/XlibBackend.h b/src/backend/XlibBackend.h new file mode 100644 index 000000000..490119506 --- /dev/null +++ b/src/backend/XlibBackend.h @@ -0,0 +1,30 @@ +#ifndef __XLIB_BACKEND_H__ +#define __XLIB_BACKEND_H__ + +#include "ScreenBackend.h" + +#include + +#include "XlibBackendPriv.h" + + +class XlibBackend : public ScreenBackend +{ + private: + XlibBackendPriv xlibBackendPriv; + + void createSurface(); + + void setWidth(int width); + void setHeight(int height); + + public: + XlibBackend(int width, int height, char *display_name = NULL); + + static Nan::Persistent constructor; + static void Initialize(v8::Local target); + static NAN_METHOD(New); +}; + + +#endif diff --git a/src/backend/XlibBackendPriv.cc b/src/backend/XlibBackendPriv.cc new file mode 100644 index 000000000..3648816a1 --- /dev/null +++ b/src/backend/XlibBackendPriv.cc @@ -0,0 +1,95 @@ +#include "XlibBackendPriv.h" + +#include +#include +#include +#include + + +// Extracted from Xm/MwmUtil.h +struct MwmHints { + unsigned long flags; + unsigned long functions; + unsigned long decorations; + long input_mode; + unsigned long status; +}; +enum { + MWM_HINTS_FUNCTIONS = (1L << 0), + MWM_HINTS_DECORATIONS = (1L << 1), + + MWM_FUNC_ALL = (1L << 0), + MWM_FUNC_RESIZE = (1L << 1), + MWM_FUNC_MOVE = (1L << 2), + MWM_FUNC_MINIMIZE = (1L << 3), + MWM_FUNC_MAXIMIZE = (1L << 4), + MWM_FUNC_CLOSE = (1L << 5) +}; + + +// We control the window from code, so we try to prevent windows manager to +// close or resize the window. Doing so correctly, would requires us to capture +// the window manager events in a thread loop and update canvas size, but it's +// not clear if canvas size should change or being scaled/zoomed or if it should +// maintain aspect ratio. + +void configWindow(Display* display, Window window) +{ + struct MwmHints hints; + hints.flags = MWM_HINTS_FUNCTIONS; + hints.functions = MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE; + + Atom wm = XInternAtom(display, "_MOTIF_WM_HINTS", False); + XChangeProperty(display, window, wm, XA_ATOM, 32, PropModeReplace, + (unsigned char*)&hints, 5); +} + +void setSizeHints(Display* display, Window window, int width, int height) +{ + XSizeHints* sh = XAllocSizeHints(); + + sh->flags = PMinSize | PMaxSize; + sh->min_width = sh->max_width = width; + sh->min_height = sh->max_height = height; + + XSetWMNormalHints(display, window, sh); + XFree(sh); +} + + +XlibBackendPriv::XlibBackendPriv(int width, int height, char *display_name) +{ + this->display = XOpenDisplay(display_name); + + if(!this->display) + throw XlibBackendException("Can't open display. Is DISPLAY set?\n"); + + this->window = XCreateSimpleWindow(display, RootWindow(display, 0), 0, 0, + width, height, 0, 0, BlackPixel(display, 0)); + + configWindow(this->display, this->window); + setSizeHints(this->display, this->window, width, height); + + XSelectInput(this->display, this->window, StructureNotifyMask | ExposureMask); + XMapWindow(this->display, this->window); +} + +XlibBackendPriv::~XlibBackendPriv() +{ + XCloseDisplay(this->display); +} + + +cairo_surface_t* XlibBackendPriv::cairo_surface_create(int width, int height) +{ + return cairo_xlib_surface_create(this->display, this->window, + DefaultVisual(display, 0), width, height); +} + + +void XlibBackendPriv::ResizeWindow(int width, int height) +{ + setSizeHints(this->display, this->window, width, height); + + XResizeWindow(this->display, this->window, width, height); +} diff --git a/src/backend/XlibBackendPriv.h b/src/backend/XlibBackendPriv.h new file mode 100644 index 000000000..880017aa7 --- /dev/null +++ b/src/backend/XlibBackendPriv.h @@ -0,0 +1,50 @@ +/** + * Cairo Xlib glue code for `XlibBackend` class + * + * This is needed to fix conflicting declaration between Xlib `GC` (Graphic + * Context) and V8 `GC` (Garbage Collector). This way, all references to Xlib + * are isolated in this class, accesible only by `XlibBackend`. + */ +#pragma once + +#include + +#include +#include + + +using namespace std; + + +// Extracted from `X11/Xlib.h` +struct _XDisplay; +typedef struct _XDisplay Display; + + +class XlibBackendPriv +{ + friend class XlibBackend; + + private: + Display* display = nullptr; + Window window; + + XlibBackendPriv(int width, int height, char *display_name = nullptr); + ~XlibBackendPriv(); + + cairo_surface_t* cairo_surface_create(int width, int height); + + void ResizeWindow(int width, int height); +}; + + +class XlibBackendException : public std::exception { + private: + string err_msg; + + public: + XlibBackendException(const string msg) : err_msg(msg) {}; + ~XlibBackendException() throw() {}; + + const char *what() const throw() { return this->err_msg.c_str(); }; +}; diff --git a/static.gypi b/static.gypi new file mode 100644 index 000000000..858628e8d --- /dev/null +++ b/static.gypi @@ -0,0 +1,57 @@ +{ + 'includes': ['static/locations.gypi'], + 'variables': + { + 'ensure_deps%': ' header file. */ +#define HAVE_BYTESWAP_H 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the `ctime_r' function. */ +#define HAVE_CTIME_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `drand48' function. */ +#define HAVE_DRAND48 1 + +/* Define to 1 if you have the `FcFini' function. */ +#define HAVE_FCFINI 1 + +/* Define to 1 if you have the `FcInit' function. */ +#define HAVE_FCINIT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `feclearexcept' function. */ +#define HAVE_FECLEAREXCEPT 1 + +/* Define to 1 if you have the `fedisableexcept' function. */ +#define HAVE_FEDISABLEEXCEPT 1 + +/* Define to 1 if you have the `feenableexcept' function. */ +#define HAVE_FEENABLEEXCEPT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FENV_H 1 + +/* Define to 1 if you have the `flockfile' function. */ +#define HAVE_FLOCKFILE 1 + +/* Define to 1 if you have the `fork' function. */ +#define HAVE_FORK 1 + +/* Define to 1 if you have the `FT_Get_X11_Font_Format' function. */ +#define HAVE_FT_GET_X11_FONT_FORMAT 1 + +/* Define to 1 if you have the `FT_GlyphSlot_Embolden' function. */ +#define HAVE_FT_GLYPHSLOT_EMBOLDEN 1 + +/* Define to 1 if you have the `FT_GlyphSlot_Oblique' function. */ +#define HAVE_FT_GLYPHSLOT_OBLIQUE 1 + +/* Define to 1 if you have the `FT_Library_SetLcdFilter' function. */ +#define HAVE_FT_LIBRARY_SETLCDFILTER 1 + +/* Define to 1 if you have the `FT_Load_Sfnt_Table' function. */ +#define HAVE_FT_LOAD_SFNT_TABLE 1 + +/* Define to 1 if you have the `funlockfile' function. */ +#define HAVE_FUNLOCKFILE 1 + +/* Whether you have gcov */ +/* #undef HAVE_GCOV */ + +/* Define to 1 if you have the `getline' function. */ +#define HAVE_GETLINE 1 + +/* Enable if your compiler supports the Intel __sync_* atomic primitives */ +#define HAVE_INTEL_ATOMIC_PRIMITIVES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIBGEN_H 1 + +/* Define to 1 if you have the `rt' library (-lrt). */ +#define HAVE_LIBRT 1 + +/* Enable if you have libatomic-ops-dev installed */ +/* #undef HAVE_LIB_ATOMIC_OPS */ + +/* Define to 1 if you have the `link' function. */ +#define HAVE_LINK 1 + +/* Define to 1 if you have the Valgrind lockdep tool */ +/* #undef HAVE_LOCKDEP */ + +/* Define to 1 if you have lzo available */ +/* #undef HAVE_LZO */ + +/* Define to 1 if you have the Valgrind memfault tool */ +/* #undef HAVE_MEMFAULT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to non-zero if your system has mkdir, and to 2 if your version of + mkdir requires a mode parameter */ +#define HAVE_MKDIR 2 + +/* Define to 1 if you have the `mmap' function. */ +#define HAVE_MMAP 1 + +/* Enable if you have MacOS X atomic operations */ +/* #undef HAVE_OS_ATOMIC_OPS */ + +/* Define to 1 if you have the `poppler_page_render' function. */ +/* #undef HAVE_POPPLER_PAGE_RENDER */ + +/* Define to 1 if you have the `raise' function. */ +#define HAVE_RAISE 1 + +/* Define to 1 if you have the `rsvg_pixbuf_from_file' function. */ +/* #undef HAVE_RSVG_PIXBUF_FROM_FILE */ + +/* Define to 1 if you have the `sched_getaffinity' function. */ +#define HAVE_SCHED_GETAFFINITY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SETJMP_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strndup' function. */ +#define HAVE_STRNDUP 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_INT_TYPES_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_POLL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if the system has the type `uint128_t'. */ +/* #undef HAVE_UINT128_T */ + +/* Define to 1 if the system has the type `uint64_t'. */ +#define HAVE_UINT64_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have Valgrind */ +/* #undef HAVE_VALGRIND */ + +/* Define to 1 if you have the `waitpid' function. */ +#define HAVE_WAITPID 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_X11_EXTENSIONS_SHMPROTO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_X11_EXTENSIONS_SHMSTR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_X11_EXTENSIONS_XSHM_H 1 + +/* Define to 1 if you have the `XRenderCreateConicalGradient' function. */ +#define HAVE_XRENDERCREATECONICALGRADIENT 1 + +/* Define to 1 if you have the `XRenderCreateLinearGradient' function. */ +#define HAVE_XRENDERCREATELINEARGRADIENT 1 + +/* Define to 1 if you have the `XRenderCreateRadialGradient' function. */ +#define HAVE_XRENDERCREATERADIALGRADIENT 1 + +/* Define to 1 if you have zlib available */ +#define HAVE_ZLIB 1 + +/* Define to 1 if the system has the type `__uint128_t'. */ +#define HAVE___UINT128_T 1 + +/* Define to 1 if shared memory segments are released deferred. */ +#define IPC_RMID_DEFERRED_RELEASE 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?product=cairo" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME USE_cairo_INSTEAD + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING USE_cairo_version_OR_cairo_version_string_INSTEAD + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME USE_cairo_INSTEAD + +/* Define to the home page for this package. */ +#define PACKAGE_URL "http://cairographics.org/" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION USE_cairo_version_OR_cairo_version_string_INSTEAD + +/* Shared library file extension */ +#define SHARED_LIB_EXT "so" + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Define to the value your compiler uses to support the warn-unused-result + attribute */ +#define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + + +/* Deal with multiple architecture compiles on Mac OS X */ +#ifdef __APPLE_CC__ +#ifdef __BIG_ENDIAN__ +#define WORDS_BIGENDIAN 1 +#define FLOAT_WORDS_BIGENDIAN 1 +#else +/* #undef WORDS_BIGENDIAN */ +/* #undef FLOAT_WORDS_BIGENDIAN */ +#endif +#endif + + +/* Define to 1 if the X Window System is missing or not being used. */ +/* #undef X_DISPLAY_MISSING */ + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif diff --git a/static/custom-include/expat/expat_config.h b/static/custom-include/expat/expat_config.h new file mode 100644 index 000000000..0e661bcea --- /dev/null +++ b/static/custom-include/expat/expat_config.h @@ -0,0 +1,102 @@ +/* expat_config.h. Generated from expat_config.h.in by configure. */ +/* expat_config.h.in. Generated from configure.ac by autoheader. */ + +/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ +#define BYTEORDER 1234 + +/* Define to 1 if you have the `bcopy' function. */ +#define HAVE_BCOPY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "expat-bugs@libexpat.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "expat" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "expat 2.2.0" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "expat" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.2.0" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* whether byteorder is bigendian */ +/* #undef WORDS_BIGENDIAN */ + +/* Define to specify how much context to retain around the current parse + point. */ +#define XML_CONTEXT_BYTES 1024 + +/* Define to make parameter entity parsing functionality available. */ +#define XML_DTD 1 + +/* Define to make XML Namespaces functionality available. */ +#define XML_NS 1 + +/* Define to __FUNCTION__ or "" if `__func__' does not conform to ANSI C. */ +/* #undef __func__ */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/static/custom-include/ffi/ffi.h b/static/custom-include/ffi/ffi.h new file mode 100644 index 000000000..82fcc4593 --- /dev/null +++ b/static/custom-include/ffi/ffi.h @@ -0,0 +1,487 @@ +/* -----------------------------------------------------------------*-C-*- + libffi 3.2.1 - Copyright (c) 2011, 2014 Anthony Green + - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the ``Software''), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +/* ------------------------------------------------------------------- + The basic API is described in the README file. + + The raw API is designed to bypass some of the argument packing + and unpacking on architectures for which it can be avoided. + + The closure API allows interpreted functions to be packaged up + inside a C function pointer, so that they can be called as C functions, + with no understanding on the client side that they are interpreted. + It can also be used in other cases in which it is necessary to package + up a user specified parameter and a function pointer as a single + function pointer. + + The closure API must be implemented in order to get its functionality, + e.g. for use by gij. Routines are provided to emulate the raw API + if the underlying platform doesn't allow faster implementation. + + More details on the raw and cloure API can be found in: + + http://gcc.gnu.org/ml/java/1999-q3/msg00138.html + + and + + http://gcc.gnu.org/ml/java/1999-q3/msg00174.html + -------------------------------------------------------------------- */ + +#ifndef LIBFFI_H +#define LIBFFI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Specify which architecture libffi is configured for. */ +#ifndef X86_64 +#define X86_64 +#endif + +/* ---- System configuration information --------------------------------- */ + +#include + +#ifndef LIBFFI_ASM + +#if defined(_MSC_VER) && !defined(__clang__) +#define __attribute__(X) +#endif + +#include +#include + +/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). + But we can find it either under the correct ANSI name, or under GNU + C's internal name. */ + +#define FFI_64_BIT_MAX 9223372036854775807 + +#ifdef LONG_LONG_MAX +# define FFI_LONG_LONG_MAX LONG_LONG_MAX +#else +# ifdef LLONG_MAX +# define FFI_LONG_LONG_MAX LLONG_MAX +# ifdef _AIX52 /* or newer has C99 LLONG_MAX */ +# undef FFI_64_BIT_MAX +# define FFI_64_BIT_MAX 9223372036854775807LL +# endif /* _AIX52 or newer */ +# else +# ifdef __GNUC__ +# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ +# endif +# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */ +# ifndef __PPC64__ +# if defined (__IBMC__) || defined (__IBMCPP__) +# define FFI_LONG_LONG_MAX LONGLONG_MAX +# endif +# endif /* __PPC64__ */ +# undef FFI_64_BIT_MAX +# define FFI_64_BIT_MAX 9223372036854775807LL +# endif +# endif +#endif + +/* The closure code assumes that this works on pointers, i.e. a size_t */ +/* can hold a pointer. */ + +typedef struct _ffi_type +{ + size_t size; + unsigned short alignment; + unsigned short type; + struct _ffi_type **elements; +} ffi_type; + +#ifndef LIBFFI_HIDE_BASIC_TYPES +#if SCHAR_MAX == 127 +# define ffi_type_uchar ffi_type_uint8 +# define ffi_type_schar ffi_type_sint8 +#else + #error "char size not supported" +#endif + +#if SHRT_MAX == 32767 +# define ffi_type_ushort ffi_type_uint16 +# define ffi_type_sshort ffi_type_sint16 +#elif SHRT_MAX == 2147483647 +# define ffi_type_ushort ffi_type_uint32 +# define ffi_type_sshort ffi_type_sint32 +#else + #error "short size not supported" +#endif + +#if INT_MAX == 32767 +# define ffi_type_uint ffi_type_uint16 +# define ffi_type_sint ffi_type_sint16 +#elif INT_MAX == 2147483647 +# define ffi_type_uint ffi_type_uint32 +# define ffi_type_sint ffi_type_sint32 +#elif INT_MAX == 9223372036854775807 +# define ffi_type_uint ffi_type_uint64 +# define ffi_type_sint ffi_type_sint64 +#else + #error "int size not supported" +#endif + +#if LONG_MAX == 2147483647 +# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX + #error "no 64-bit data type supported" +# endif +#elif LONG_MAX != FFI_64_BIT_MAX + #error "long size not supported" +#endif + +#if LONG_MAX == 2147483647 +# define ffi_type_ulong ffi_type_uint32 +# define ffi_type_slong ffi_type_sint32 +#elif LONG_MAX == FFI_64_BIT_MAX +# define ffi_type_ulong ffi_type_uint64 +# define ffi_type_slong ffi_type_sint64 +#else + #error "long size not supported" +#endif + +/* Need minimal decorations for DLLs to works on Windows. */ +/* GCC has autoimport and autoexport. Rely on Libtool to */ +/* help MSVC export from a DLL, but always declare data */ +/* to be imported for MSVC clients. This costs an extra */ +/* indirection for MSVC clients using the static version */ +/* of the library, but don't worry about that. Besides, */ +/* as a workaround, they can define FFI_BUILDING if they */ +/* *know* they are going to link with the static library. */ +#if defined _MSC_VER && !defined FFI_BUILDING +#define FFI_EXTERN extern __declspec(dllimport) +#else +#define FFI_EXTERN extern +#endif + +/* These are defined in types.c */ +FFI_EXTERN ffi_type ffi_type_void; +FFI_EXTERN ffi_type ffi_type_uint8; +FFI_EXTERN ffi_type ffi_type_sint8; +FFI_EXTERN ffi_type ffi_type_uint16; +FFI_EXTERN ffi_type ffi_type_sint16; +FFI_EXTERN ffi_type ffi_type_uint32; +FFI_EXTERN ffi_type ffi_type_sint32; +FFI_EXTERN ffi_type ffi_type_uint64; +FFI_EXTERN ffi_type ffi_type_sint64; +FFI_EXTERN ffi_type ffi_type_float; +FFI_EXTERN ffi_type ffi_type_double; +FFI_EXTERN ffi_type ffi_type_pointer; + +#if 1 +FFI_EXTERN ffi_type ffi_type_longdouble; +#else +#define ffi_type_longdouble ffi_type_double +#endif + +#ifdef FFI_TARGET_HAS_COMPLEX_TYPE +FFI_EXTERN ffi_type ffi_type_complex_float; +FFI_EXTERN ffi_type ffi_type_complex_double; +#if 1 +FFI_EXTERN ffi_type ffi_type_complex_longdouble; +#else +#define ffi_type_complex_longdouble ffi_type_complex_double +#endif +#endif +#endif /* LIBFFI_HIDE_BASIC_TYPES */ + +typedef enum { + FFI_OK = 0, + FFI_BAD_TYPEDEF, + FFI_BAD_ABI +} ffi_status; + +typedef unsigned FFI_TYPE; + +typedef struct { + ffi_abi abi; + unsigned nargs; + ffi_type **arg_types; + ffi_type *rtype; + unsigned bytes; + unsigned flags; +#ifdef FFI_EXTRA_CIF_FIELDS + FFI_EXTRA_CIF_FIELDS; +#endif +} ffi_cif; + +#if 0 +/* Used to adjust size/alignment of ffi types. */ +void ffi_prep_types (ffi_abi abi); +#endif + +/* Used internally, but overridden by some architectures */ +ffi_status ffi_prep_cif_core(ffi_cif *cif, + ffi_abi abi, + unsigned int isvariadic, + unsigned int nfixedargs, + unsigned int ntotalargs, + ffi_type *rtype, + ffi_type **atypes); + +/* ---- Definitions for the raw API -------------------------------------- */ + +#ifndef FFI_SIZEOF_ARG +# if LONG_MAX == 2147483647 +# define FFI_SIZEOF_ARG 4 +# elif LONG_MAX == FFI_64_BIT_MAX +# define FFI_SIZEOF_ARG 8 +# endif +#endif + +#ifndef FFI_SIZEOF_JAVA_RAW +# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG +#endif + +typedef union { + ffi_sarg sint; + ffi_arg uint; + float flt; + char data[FFI_SIZEOF_ARG]; + void* ptr; +} ffi_raw; + +#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8 +/* This is a special case for mips64/n32 ABI (and perhaps others) where + sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */ +typedef union { + signed int sint; + unsigned int uint; + float flt; + char data[FFI_SIZEOF_JAVA_RAW]; + void* ptr; +} ffi_java_raw; +#else +typedef ffi_raw ffi_java_raw; +#endif + + +void ffi_raw_call (ffi_cif *cif, + void (*fn)(void), + void *rvalue, + ffi_raw *avalue); + +void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); +void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); +size_t ffi_raw_size (ffi_cif *cif); + +/* This is analogous to the raw API, except it uses Java parameter */ +/* packing, even on 64-bit machines. I.e. on 64-bit machines */ +/* longs and doubles are followed by an empty 64-bit word. */ + +void ffi_java_raw_call (ffi_cif *cif, + void (*fn)(void), + void *rvalue, + ffi_java_raw *avalue); + +void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw); +void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args); +size_t ffi_java_raw_size (ffi_cif *cif); + +/* ---- Definitions for closures ----------------------------------------- */ + +#if FFI_CLOSURES + +#ifdef _MSC_VER +__declspec(align(8)) +#endif +typedef struct { +#if 0 + void *trampoline_table; + void *trampoline_table_entry; +#else + char tramp[FFI_TRAMPOLINE_SIZE]; +#endif + ffi_cif *cif; + void (*fun)(ffi_cif*,void*,void**,void*); + void *user_data; +#ifdef __GNUC__ +} ffi_closure __attribute__((aligned (8))); +#else +} ffi_closure; +# ifdef __sgi +# pragma pack 0 +# endif +#endif + +void *ffi_closure_alloc (size_t size, void **code); +void ffi_closure_free (void *); + +ffi_status +ffi_prep_closure (ffi_closure*, + ffi_cif *, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data); + +ffi_status +ffi_prep_closure_loc (ffi_closure*, + ffi_cif *, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void*codeloc); + +#ifdef __sgi +# pragma pack 8 +#endif +typedef struct { +#if 0 + void *trampoline_table; + void *trampoline_table_entry; +#else + char tramp[FFI_TRAMPOLINE_SIZE]; +#endif + ffi_cif *cif; + +#if !FFI_NATIVE_RAW_API + + /* if this is enabled, then a raw closure has the same layout + as a regular closure. We use this to install an intermediate + handler to do the transaltion, void** -> ffi_raw*. */ + + void (*translate_args)(ffi_cif*,void*,void**,void*); + void *this_closure; + +#endif + + void (*fun)(ffi_cif*,void*,ffi_raw*,void*); + void *user_data; + +} ffi_raw_closure; + +typedef struct { +#if 0 + void *trampoline_table; + void *trampoline_table_entry; +#else + char tramp[FFI_TRAMPOLINE_SIZE]; +#endif + + ffi_cif *cif; + +#if !FFI_NATIVE_RAW_API + + /* if this is enabled, then a raw closure has the same layout + as a regular closure. We use this to install an intermediate + handler to do the transaltion, void** -> ffi_raw*. */ + + void (*translate_args)(ffi_cif*,void*,void**,void*); + void *this_closure; + +#endif + + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*); + void *user_data; + +} ffi_java_raw_closure; + +ffi_status +ffi_prep_raw_closure (ffi_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data); + +ffi_status +ffi_prep_raw_closure_loc (ffi_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_raw*,void*), + void *user_data, + void *codeloc); + +ffi_status +ffi_prep_java_raw_closure (ffi_java_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), + void *user_data); + +ffi_status +ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*, + ffi_cif *cif, + void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), + void *user_data, + void *codeloc); + +#endif /* FFI_CLOSURES */ + +/* ---- Public interface definition -------------------------------------- */ + +ffi_status ffi_prep_cif(ffi_cif *cif, + ffi_abi abi, + unsigned int nargs, + ffi_type *rtype, + ffi_type **atypes); + +ffi_status ffi_prep_cif_var(ffi_cif *cif, + ffi_abi abi, + unsigned int nfixedargs, + unsigned int ntotalargs, + ffi_type *rtype, + ffi_type **atypes); + +void ffi_call(ffi_cif *cif, + void (*fn)(void), + void *rvalue, + void **avalue); + +/* Useful for eliminating compiler warnings */ +#define FFI_FN(f) ((void (*)(void))f) + +/* ---- Definitions shared with assembly code ---------------------------- */ + +#endif + +/* If these change, update src/mips/ffitarget.h. */ +#define FFI_TYPE_VOID 0 +#define FFI_TYPE_INT 1 +#define FFI_TYPE_FLOAT 2 +#define FFI_TYPE_DOUBLE 3 +#if 1 +#define FFI_TYPE_LONGDOUBLE 4 +#else +#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE +#endif +#define FFI_TYPE_UINT8 5 +#define FFI_TYPE_SINT8 6 +#define FFI_TYPE_UINT16 7 +#define FFI_TYPE_SINT16 8 +#define FFI_TYPE_UINT32 9 +#define FFI_TYPE_SINT32 10 +#define FFI_TYPE_UINT64 11 +#define FFI_TYPE_SINT64 12 +#define FFI_TYPE_STRUCT 13 +#define FFI_TYPE_POINTER 14 +#define FFI_TYPE_COMPLEX 15 + +/* This should always refer to the last type code (for sanity checks) */ +#define FFI_TYPE_LAST FFI_TYPE_COMPLEX + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/static/custom-include/ffi/fficonfig.h b/static/custom-include/ffi/fficonfig.h new file mode 100644 index 000000000..b1773a79c --- /dev/null +++ b/static/custom-include/ffi/fficonfig.h @@ -0,0 +1,214 @@ +/* fficonfig.h. Generated from fficonfig.h.in by configure. */ +/* fficonfig.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to the flags needed for the .section .eh_frame directive. */ +#define EH_FRAME_FLAGS "a" + +/* Define this if you want extra debugging. */ +/* #undef FFI_DEBUG */ + +/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */ +/* #undef FFI_EXEC_TRAMPOLINE_TABLE */ + +/* Define this if you want to enable pax emulated trampolines */ +/* #undef FFI_MMAP_EXEC_EMUTRAMP_PAX */ + +/* Cannot use malloc on this target, so, we revert to alternative means */ +/* #undef FFI_MMAP_EXEC_WRIT */ + +/* Define this if you do not want support for the raw API. */ +/* #undef FFI_NO_RAW_API */ + +/* Define this if you do not want support for aggregate types. */ +/* #undef FFI_NO_STRUCTS */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#define HAVE_ALLOCA_H 1 + +/* Define if your assembler supports .ascii. */ +#define HAVE_AS_ASCII_PSEUDO_OP 1 + +/* Define if your assembler supports .cfi_* directives. */ +#define HAVE_AS_CFI_PSEUDO_OP 1 + +/* Define if your assembler supports .register. */ +/* #undef HAVE_AS_REGISTER_PSEUDO_OP */ + +/* Define if your assembler and linker support unaligned PC relative relocs. + */ +/* #undef HAVE_AS_SPARC_UA_PCREL */ + +/* Define if your assembler supports .string. */ +#define HAVE_AS_STRING_PSEUDO_OP 1 + +/* Define if your assembler supports unwind section type. */ +#define HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1 + +/* Define if your assembler supports PC relative relocs. */ +#define HAVE_AS_X86_PCREL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if __attribute__((visibility("hidden"))) is supported. */ +#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if you have the long double type and it is bigger than a double */ +#define HAVE_LONG_DOUBLE 1 + +/* Define if you support more than one size of the long double type */ +/* #undef HAVE_LONG_DOUBLE_VARIANT */ + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkostemp' function. */ +#define HAVE_MKOSTEMP 1 + +/* Define to 1 if you have the `mmap' function. */ +#define HAVE_MMAP 1 + +/* Define if mmap with MAP_ANON(YMOUS) works. */ +#define HAVE_MMAP_ANON 1 + +/* Define if mmap of /dev/zero works. */ +#define HAVE_MMAP_DEV_ZERO 1 + +/* Define if read-only mmap of a plain file works. */ +#define HAVE_MMAP_FILE 1 + +/* Define if .eh_frame sections should be read-only. */ +#define HAVE_RO_EH_FRAME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Name of package */ +#define PACKAGE "libffi" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://github.com/atgreen/libffi/issues" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libffi" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libffi 3.2.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libffi" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "3.2.1" + +/* The size of `double', as computed by sizeof. */ +#define SIZEOF_DOUBLE 8 + +/* The size of `long double', as computed by sizeof. */ +#define SIZEOF_LONG_DOUBLE 16 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if symbols are underscored. */ +/* #undef SYMBOL_UNDERSCORE */ + +/* Define this if you are using Purify and want to suppress spurious messages. + */ +/* #undef USING_PURIFY */ + +/* Version number of package */ +#define VERSION "3.2.1" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + + +#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE +#ifdef LIBFFI_ASM +#define FFI_HIDDEN(name) .hidden name +#else +#define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) +#endif +#else +#ifdef LIBFFI_ASM +#define FFI_HIDDEN(name) +#else +#define FFI_HIDDEN +#endif +#endif diff --git a/static/custom-include/fontconfig/config.h b/static/custom-include/fontconfig/config.h new file mode 100644 index 000000000..2fb448159 --- /dev/null +++ b/static/custom-include/fontconfig/config.h @@ -0,0 +1,360 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* The normal alignment of `double', in bytes. */ +#define ALIGNOF_DOUBLE 8 + +/* The normal alignment of `void *', in bytes. */ +#define ALIGNOF_VOID_P 8 + +/* Use libxml2 instead of Expat */ +/* #undef ENABLE_LIBXML2 */ + +/* Additional font directories */ +#define FC_ADD_FONTS "yes" + +/* Architecture prefix to use for cache file names */ +/* #undef FC_ARCHITECTURE */ + +/* System font directory */ +#define FC_DEFAULT_FONTS "/usr/share/fonts" + +/* Define to nothing if C supports flexible array members, and to 1 if it does + not. That way, with a declaration like `struct s { int n; double + d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99 + compilers. When computing the size of such an object, don't use 'sizeof + (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)' + instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with + MSVC and with C++ compilers. */ +#define FLEXIBLE_ARRAY_MEMBER /**/ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +/* #undef HAVE_DOPRNT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fstatfs' function. */ +#define HAVE_FSTATFS 1 + +/* Define to 1 if you have the `fstatvfs' function. */ +#define HAVE_FSTATVFS 1 + +/* FT_Bitmap_Size structure includes y_ppem field */ +#define HAVE_FT_BITMAP_SIZE_Y_PPEM 1 + +/* Define to 1 if you have the `FT_Get_BDF_Property' function. */ +#define HAVE_FT_GET_BDF_PROPERTY 1 + +/* Define to 1 if you have the `FT_Get_Next_Char' function. */ +#define HAVE_FT_GET_NEXT_CHAR 1 + +/* Define to 1 if you have the `FT_Get_PS_Font_Info' function. */ +#define HAVE_FT_GET_PS_FONT_INFO 1 + +/* Define to 1 if you have the `FT_Get_X11_Font_Format' function. */ +#define HAVE_FT_GET_X11_FONT_FORMAT 1 + +/* Define to 1 if you have the `FT_Has_PS_Glyph_Names' function. */ +#define HAVE_FT_HAS_PS_GLYPH_NAMES 1 + +/* Define to 1 if you have the `FT_Select_Size' function. */ +#define HAVE_FT_SELECT_SIZE 1 + +/* Define to 1 if you have the `getexecname' function. */ +/* #undef HAVE_GETEXECNAME */ + +/* Define to 1 if you have the `getopt' function. */ +#define HAVE_GETOPT 1 + +/* Define to 1 if you have the `getopt_long' function. */ +#define HAVE_GETOPT_LONG 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getprogname' function. */ +/* #undef HAVE_GETPROGNAME */ + +/* Have Intel __sync_* atomic primitives */ +#define HAVE_INTEL_ATOMIC_PRIMITIVES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `link' function. */ +#define HAVE_LINK 1 + +/* Define to 1 if you have the `lrand48' function. */ +#define HAVE_LRAND48 1 + +/* Define to 1 if you have the `lstat' function. */ +#define HAVE_LSTAT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkdtemp' function. */ +#define HAVE_MKDTEMP 1 + +/* Define to 1 if you have the `mkostemp' function. */ +#define HAVE_MKOSTEMP 1 + +/* Define to 1 if you have the `mkstemp' function. */ +#define HAVE_MKSTEMP 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the 'posix_fadvise' function. */ +#define HAVE_POSIX_FADVISE 1 + +/* Have POSIX threads */ +#define HAVE_PTHREAD 1 + +/* Have PTHREAD_PRIO_INHERIT. */ +#define HAVE_PTHREAD_PRIO_INHERIT 1 + +/* Define to 1 if you have the `rand' function. */ +#define HAVE_RAND 1 + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the `random_r' function. */ +#define HAVE_RANDOM_R 1 + +/* Define to 1 if you have the `rand_r' function. */ +#define HAVE_RAND_R 1 + +/* Define to 1 if you have the `readlink' function. */ +#define HAVE_READLINK 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SCHED_H */ + +/* Have sched_yield */ +/* #undef HAVE_SCHED_YIELD */ + +/* Have Solaris __machine_*_barrier and atomic_* operations */ +/* #undef HAVE_SOLARIS_ATOMIC_OPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if `d_type' is a member of `struct dirent'. */ +#define HAVE_STRUCT_DIRENT_D_TYPE 1 + +/* Define to 1 if `f_flags' is a member of `struct statfs'. */ +#define HAVE_STRUCT_STATFS_F_FLAGS 1 + +/* Define to 1 if `f_fstypename' is a member of `struct statfs'. */ +/* #undef HAVE_STRUCT_STATFS_F_FSTYPENAME */ + +/* Define to 1 if `f_basetype' is a member of `struct statvfs'. */ +/* #undef HAVE_STRUCT_STATVFS_F_BASETYPE */ + +/* Define to 1 if `f_fstypename' is a member of `struct statvfs'. */ +/* #undef HAVE_STRUCT_STATVFS_F_FSTYPENAME */ + +/* Define to 1 if `st_mtim' is a member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_MTIM 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MOUNT_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STATFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STATVFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_VFS_H 1 + +/* Define to 1 if `usLowerOpticalPointSize' is a member of `TT_OS2'. */ +#define HAVE_TT_OS2_USLOWEROPTICALPOINTSIZE 1 + +/* Define to 1 if `usUpperOpticalPointSize' is a member of `TT_OS2'. */ +#define HAVE_TT_OS2_USUPPEROPTICALPOINTSIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Can use #warning in C files */ +#define HAVE_WARNING_CPP_DIRECTIVE 1 + +/* Use xmlparse.h instead of expat.h */ +/* #undef HAVE_XMLPARSE_H */ + +/* Define to 1 if you have the `XML_SetDoctypeDeclHandler' function. */ +#define HAVE_XML_SETDOCTYPEDECLHANDLER 1 + +/* Define to 1 if you have the `_mktemp_s' function. */ +/* #undef HAVE__MKTEMP_S */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "fontconfig" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=fontconfig" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "fontconfig" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "fontconfig 2.12.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "fontconfig" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.12.1" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* The size of `char', as computed by sizeof. */ +/* #undef SIZEOF_CHAR */ + +/* The size of `int', as computed by sizeof. */ +/* #undef SIZEOF_INT */ + +/* The size of `long', as computed by sizeof. */ +/* #undef SIZEOF_LONG */ + +/* The size of `short', as computed by sizeof. */ +/* #undef SIZEOF_SHORT */ + +/* The size of `void*', as computed by sizeof. */ +/* #undef SIZEOF_VOIDP */ + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Use iconv. */ +#define USE_ICONV 0 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "2.12.1" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +#include "config-fixups.h" diff --git a/static/custom-include/fontconfig/fcalias.h b/static/custom-include/fontconfig/fcalias.h new file mode 100644 index 000000000..06d47ed73 --- /dev/null +++ b/static/custom-include/fontconfig/fcalias.h @@ -0,0 +1,410 @@ +extern __typeof (FcBlanksCreate) IA__FcBlanksCreate __attribute((visibility("hidden"))); +#define FcBlanksCreate IA__FcBlanksCreate +extern __typeof (FcBlanksDestroy) IA__FcBlanksDestroy __attribute((visibility("hidden"))); +#define FcBlanksDestroy IA__FcBlanksDestroy +extern __typeof (FcBlanksAdd) IA__FcBlanksAdd __attribute((visibility("hidden"))); +#define FcBlanksAdd IA__FcBlanksAdd +extern __typeof (FcBlanksIsMember) IA__FcBlanksIsMember __attribute((visibility("hidden"))); +#define FcBlanksIsMember IA__FcBlanksIsMember +extern __typeof (FcCacheCopySet) IA__FcCacheCopySet __attribute((visibility("hidden"))); +#define FcCacheCopySet IA__FcCacheCopySet +extern __typeof (FcCacheNumSubdir) IA__FcCacheNumSubdir __attribute((visibility("hidden"))); +#define FcCacheNumSubdir IA__FcCacheNumSubdir +extern __typeof (FcCacheNumFont) IA__FcCacheNumFont __attribute((visibility("hidden"))); +#define FcCacheNumFont IA__FcCacheNumFont +extern __typeof (FcDirCacheUnlink) IA__FcDirCacheUnlink __attribute((visibility("hidden"))); +#define FcDirCacheUnlink IA__FcDirCacheUnlink +extern __typeof (FcDirCacheValid) IA__FcDirCacheValid __attribute((visibility("hidden"))); +#define FcDirCacheValid IA__FcDirCacheValid +extern __typeof (FcDirCacheClean) IA__FcDirCacheClean __attribute((visibility("hidden"))); +#define FcDirCacheClean IA__FcDirCacheClean +extern __typeof (FcCacheCreateTagFile) IA__FcCacheCreateTagFile __attribute((visibility("hidden"))); +#define FcCacheCreateTagFile IA__FcCacheCreateTagFile +extern __typeof (FcConfigHome) IA__FcConfigHome __attribute((visibility("hidden"))); +#define FcConfigHome IA__FcConfigHome +extern __typeof (FcConfigEnableHome) IA__FcConfigEnableHome __attribute((visibility("hidden"))); +#define FcConfigEnableHome IA__FcConfigEnableHome +extern __typeof (FcConfigFilename) IA__FcConfigFilename __attribute((visibility("hidden"))); +#define FcConfigFilename IA__FcConfigFilename +extern __typeof (FcConfigCreate) IA__FcConfigCreate __attribute((visibility("hidden"))); +#define FcConfigCreate IA__FcConfigCreate +extern __typeof (FcConfigReference) IA__FcConfigReference __attribute((visibility("hidden"))); +#define FcConfigReference IA__FcConfigReference +extern __typeof (FcConfigDestroy) IA__FcConfigDestroy __attribute((visibility("hidden"))); +#define FcConfigDestroy IA__FcConfigDestroy +extern __typeof (FcConfigSetCurrent) IA__FcConfigSetCurrent __attribute((visibility("hidden"))); +#define FcConfigSetCurrent IA__FcConfigSetCurrent +extern __typeof (FcConfigGetCurrent) IA__FcConfigGetCurrent __attribute((visibility("hidden"))); +#define FcConfigGetCurrent IA__FcConfigGetCurrent +extern __typeof (FcConfigUptoDate) IA__FcConfigUptoDate __attribute((visibility("hidden"))); +#define FcConfigUptoDate IA__FcConfigUptoDate +extern __typeof (FcConfigBuildFonts) IA__FcConfigBuildFonts __attribute((visibility("hidden"))); +#define FcConfigBuildFonts IA__FcConfigBuildFonts +extern __typeof (FcConfigGetFontDirs) IA__FcConfigGetFontDirs __attribute((visibility("hidden"))); +#define FcConfigGetFontDirs IA__FcConfigGetFontDirs +extern __typeof (FcConfigGetConfigDirs) IA__FcConfigGetConfigDirs __attribute((visibility("hidden"))); +#define FcConfigGetConfigDirs IA__FcConfigGetConfigDirs +extern __typeof (FcConfigGetConfigFiles) IA__FcConfigGetConfigFiles __attribute((visibility("hidden"))); +#define FcConfigGetConfigFiles IA__FcConfigGetConfigFiles +extern __typeof (FcConfigGetCache) IA__FcConfigGetCache __attribute((visibility("hidden"))); +#define FcConfigGetCache IA__FcConfigGetCache +extern __typeof (FcConfigGetBlanks) IA__FcConfigGetBlanks __attribute((visibility("hidden"))); +#define FcConfigGetBlanks IA__FcConfigGetBlanks +extern __typeof (FcConfigGetCacheDirs) IA__FcConfigGetCacheDirs __attribute((visibility("hidden"))); +#define FcConfigGetCacheDirs IA__FcConfigGetCacheDirs +extern __typeof (FcConfigGetRescanInterval) IA__FcConfigGetRescanInterval __attribute((visibility("hidden"))); +#define FcConfigGetRescanInterval IA__FcConfigGetRescanInterval +extern __typeof (FcConfigSetRescanInterval) IA__FcConfigSetRescanInterval __attribute((visibility("hidden"))); +#define FcConfigSetRescanInterval IA__FcConfigSetRescanInterval +extern __typeof (FcConfigGetFonts) IA__FcConfigGetFonts __attribute((visibility("hidden"))); +#define FcConfigGetFonts IA__FcConfigGetFonts +extern __typeof (FcConfigAppFontAddFile) IA__FcConfigAppFontAddFile __attribute((visibility("hidden"))); +#define FcConfigAppFontAddFile IA__FcConfigAppFontAddFile +extern __typeof (FcConfigAppFontAddDir) IA__FcConfigAppFontAddDir __attribute((visibility("hidden"))); +#define FcConfigAppFontAddDir IA__FcConfigAppFontAddDir +extern __typeof (FcConfigAppFontClear) IA__FcConfigAppFontClear __attribute((visibility("hidden"))); +#define FcConfigAppFontClear IA__FcConfigAppFontClear +extern __typeof (FcConfigSubstituteWithPat) IA__FcConfigSubstituteWithPat __attribute((visibility("hidden"))); +#define FcConfigSubstituteWithPat IA__FcConfigSubstituteWithPat +extern __typeof (FcConfigSubstitute) IA__FcConfigSubstitute __attribute((visibility("hidden"))); +#define FcConfigSubstitute IA__FcConfigSubstitute +extern __typeof (FcConfigGetSysRoot) IA__FcConfigGetSysRoot __attribute((visibility("hidden"))); +#define FcConfigGetSysRoot IA__FcConfigGetSysRoot +extern __typeof (FcConfigSetSysRoot) IA__FcConfigSetSysRoot __attribute((visibility("hidden"))); +#define FcConfigSetSysRoot IA__FcConfigSetSysRoot +extern __typeof (FcCharSetCreate) IA__FcCharSetCreate __attribute((visibility("hidden"))); +#define FcCharSetCreate IA__FcCharSetCreate +extern __typeof (FcCharSetNew) IA__FcCharSetNew __attribute((visibility("hidden"))); +#define FcCharSetNew IA__FcCharSetNew +extern __typeof (FcCharSetDestroy) IA__FcCharSetDestroy __attribute((visibility("hidden"))); +#define FcCharSetDestroy IA__FcCharSetDestroy +extern __typeof (FcCharSetAddChar) IA__FcCharSetAddChar __attribute((visibility("hidden"))); +#define FcCharSetAddChar IA__FcCharSetAddChar +extern __typeof (FcCharSetDelChar) IA__FcCharSetDelChar __attribute((visibility("hidden"))); +#define FcCharSetDelChar IA__FcCharSetDelChar +extern __typeof (FcCharSetCopy) IA__FcCharSetCopy __attribute((visibility("hidden"))); +#define FcCharSetCopy IA__FcCharSetCopy +extern __typeof (FcCharSetEqual) IA__FcCharSetEqual __attribute((visibility("hidden"))); +#define FcCharSetEqual IA__FcCharSetEqual +extern __typeof (FcCharSetIntersect) IA__FcCharSetIntersect __attribute((visibility("hidden"))); +#define FcCharSetIntersect IA__FcCharSetIntersect +extern __typeof (FcCharSetUnion) IA__FcCharSetUnion __attribute((visibility("hidden"))); +#define FcCharSetUnion IA__FcCharSetUnion +extern __typeof (FcCharSetSubtract) IA__FcCharSetSubtract __attribute((visibility("hidden"))); +#define FcCharSetSubtract IA__FcCharSetSubtract +extern __typeof (FcCharSetMerge) IA__FcCharSetMerge __attribute((visibility("hidden"))); +#define FcCharSetMerge IA__FcCharSetMerge +extern __typeof (FcCharSetHasChar) IA__FcCharSetHasChar __attribute((visibility("hidden"))); +#define FcCharSetHasChar IA__FcCharSetHasChar +extern __typeof (FcCharSetCount) IA__FcCharSetCount __attribute((visibility("hidden"))); +#define FcCharSetCount IA__FcCharSetCount +extern __typeof (FcCharSetIntersectCount) IA__FcCharSetIntersectCount __attribute((visibility("hidden"))); +#define FcCharSetIntersectCount IA__FcCharSetIntersectCount +extern __typeof (FcCharSetSubtractCount) IA__FcCharSetSubtractCount __attribute((visibility("hidden"))); +#define FcCharSetSubtractCount IA__FcCharSetSubtractCount +extern __typeof (FcCharSetIsSubset) IA__FcCharSetIsSubset __attribute((visibility("hidden"))); +#define FcCharSetIsSubset IA__FcCharSetIsSubset +extern __typeof (FcCharSetFirstPage) IA__FcCharSetFirstPage __attribute((visibility("hidden"))); +#define FcCharSetFirstPage IA__FcCharSetFirstPage +extern __typeof (FcCharSetNextPage) IA__FcCharSetNextPage __attribute((visibility("hidden"))); +#define FcCharSetNextPage IA__FcCharSetNextPage +extern __typeof (FcCharSetCoverage) IA__FcCharSetCoverage __attribute((visibility("hidden"))); +#define FcCharSetCoverage IA__FcCharSetCoverage +extern __typeof (FcValuePrint) IA__FcValuePrint __attribute((visibility("hidden"))); +#define FcValuePrint IA__FcValuePrint +extern __typeof (FcPatternPrint) IA__FcPatternPrint __attribute((visibility("hidden"))); +#define FcPatternPrint IA__FcPatternPrint +extern __typeof (FcFontSetPrint) IA__FcFontSetPrint __attribute((visibility("hidden"))); +#define FcFontSetPrint IA__FcFontSetPrint +extern __typeof (FcGetDefaultLangs) IA__FcGetDefaultLangs __attribute((visibility("hidden"))); +#define FcGetDefaultLangs IA__FcGetDefaultLangs +extern __typeof (FcDefaultSubstitute) IA__FcDefaultSubstitute __attribute((visibility("hidden"))); +#define FcDefaultSubstitute IA__FcDefaultSubstitute +extern __typeof (FcFileIsDir) IA__FcFileIsDir __attribute((visibility("hidden"))); +#define FcFileIsDir IA__FcFileIsDir +extern __typeof (FcFileScan) IA__FcFileScan __attribute((visibility("hidden"))); +#define FcFileScan IA__FcFileScan +extern __typeof (FcDirScan) IA__FcDirScan __attribute((visibility("hidden"))); +#define FcDirScan IA__FcDirScan +extern __typeof (FcDirSave) IA__FcDirSave __attribute((visibility("hidden"))); +#define FcDirSave IA__FcDirSave +extern __typeof (FcDirCacheLoad) IA__FcDirCacheLoad __attribute((visibility("hidden"))); +#define FcDirCacheLoad IA__FcDirCacheLoad +extern __typeof (FcDirCacheRescan) IA__FcDirCacheRescan __attribute((visibility("hidden"))); +#define FcDirCacheRescan IA__FcDirCacheRescan +extern __typeof (FcDirCacheRead) IA__FcDirCacheRead __attribute((visibility("hidden"))); +#define FcDirCacheRead IA__FcDirCacheRead +extern __typeof (FcDirCacheLoadFile) IA__FcDirCacheLoadFile __attribute((visibility("hidden"))); +#define FcDirCacheLoadFile IA__FcDirCacheLoadFile +extern __typeof (FcDirCacheUnload) IA__FcDirCacheUnload __attribute((visibility("hidden"))); +#define FcDirCacheUnload IA__FcDirCacheUnload +extern __typeof (FcFreeTypeQuery) IA__FcFreeTypeQuery __attribute((visibility("hidden"))); +#define FcFreeTypeQuery IA__FcFreeTypeQuery +extern __typeof (FcFontSetCreate) IA__FcFontSetCreate __attribute((visibility("hidden"))); +#define FcFontSetCreate IA__FcFontSetCreate +extern __typeof (FcFontSetDestroy) IA__FcFontSetDestroy __attribute((visibility("hidden"))); +#define FcFontSetDestroy IA__FcFontSetDestroy +extern __typeof (FcFontSetAdd) IA__FcFontSetAdd __attribute((visibility("hidden"))); +#define FcFontSetAdd IA__FcFontSetAdd +extern __typeof (FcInitLoadConfig) IA__FcInitLoadConfig __attribute((visibility("hidden"))); +#define FcInitLoadConfig IA__FcInitLoadConfig +extern __typeof (FcInitLoadConfigAndFonts) IA__FcInitLoadConfigAndFonts __attribute((visibility("hidden"))); +#define FcInitLoadConfigAndFonts IA__FcInitLoadConfigAndFonts +extern __typeof (FcInit) IA__FcInit __attribute((visibility("hidden"))); +#define FcInit IA__FcInit +extern __typeof (FcFini) IA__FcFini __attribute((visibility("hidden"))); +#define FcFini IA__FcFini +extern __typeof (FcGetVersion) IA__FcGetVersion __attribute((visibility("hidden"))); +#define FcGetVersion IA__FcGetVersion +extern __typeof (FcInitReinitialize) IA__FcInitReinitialize __attribute((visibility("hidden"))); +#define FcInitReinitialize IA__FcInitReinitialize +extern __typeof (FcInitBringUptoDate) IA__FcInitBringUptoDate __attribute((visibility("hidden"))); +#define FcInitBringUptoDate IA__FcInitBringUptoDate +extern __typeof (FcGetLangs) IA__FcGetLangs __attribute((visibility("hidden"))); +#define FcGetLangs IA__FcGetLangs +extern __typeof (FcLangNormalize) IA__FcLangNormalize __attribute((visibility("hidden"))); +#define FcLangNormalize IA__FcLangNormalize +extern __typeof (FcLangGetCharSet) IA__FcLangGetCharSet __attribute((visibility("hidden"))); +#define FcLangGetCharSet IA__FcLangGetCharSet +extern __typeof (FcLangSetCreate) IA__FcLangSetCreate __attribute((visibility("hidden"))); +#define FcLangSetCreate IA__FcLangSetCreate +extern __typeof (FcLangSetDestroy) IA__FcLangSetDestroy __attribute((visibility("hidden"))); +#define FcLangSetDestroy IA__FcLangSetDestroy +extern __typeof (FcLangSetCopy) IA__FcLangSetCopy __attribute((visibility("hidden"))); +#define FcLangSetCopy IA__FcLangSetCopy +extern __typeof (FcLangSetAdd) IA__FcLangSetAdd __attribute((visibility("hidden"))); +#define FcLangSetAdd IA__FcLangSetAdd +extern __typeof (FcLangSetDel) IA__FcLangSetDel __attribute((visibility("hidden"))); +#define FcLangSetDel IA__FcLangSetDel +extern __typeof (FcLangSetHasLang) IA__FcLangSetHasLang __attribute((visibility("hidden"))); +#define FcLangSetHasLang IA__FcLangSetHasLang +extern __typeof (FcLangSetCompare) IA__FcLangSetCompare __attribute((visibility("hidden"))); +#define FcLangSetCompare IA__FcLangSetCompare +extern __typeof (FcLangSetContains) IA__FcLangSetContains __attribute((visibility("hidden"))); +#define FcLangSetContains IA__FcLangSetContains +extern __typeof (FcLangSetEqual) IA__FcLangSetEqual __attribute((visibility("hidden"))); +#define FcLangSetEqual IA__FcLangSetEqual +extern __typeof (FcLangSetHash) IA__FcLangSetHash __attribute((visibility("hidden"))); +#define FcLangSetHash IA__FcLangSetHash +extern __typeof (FcLangSetGetLangs) IA__FcLangSetGetLangs __attribute((visibility("hidden"))); +#define FcLangSetGetLangs IA__FcLangSetGetLangs +extern __typeof (FcLangSetUnion) IA__FcLangSetUnion __attribute((visibility("hidden"))); +#define FcLangSetUnion IA__FcLangSetUnion +extern __typeof (FcLangSetSubtract) IA__FcLangSetSubtract __attribute((visibility("hidden"))); +#define FcLangSetSubtract IA__FcLangSetSubtract +extern __typeof (FcObjectSetCreate) IA__FcObjectSetCreate __attribute((visibility("hidden"))); +#define FcObjectSetCreate IA__FcObjectSetCreate +extern __typeof (FcObjectSetAdd) IA__FcObjectSetAdd __attribute((visibility("hidden"))); +#define FcObjectSetAdd IA__FcObjectSetAdd +extern __typeof (FcObjectSetDestroy) IA__FcObjectSetDestroy __attribute((visibility("hidden"))); +#define FcObjectSetDestroy IA__FcObjectSetDestroy +extern __typeof (FcObjectSetVaBuild) IA__FcObjectSetVaBuild __attribute((visibility("hidden"))); +#define FcObjectSetVaBuild IA__FcObjectSetVaBuild +extern __typeof (FcObjectSetBuild) IA__FcObjectSetBuild __attribute((visibility("hidden"))); +#define FcObjectSetBuild IA__FcObjectSetBuild +extern __typeof (FcFontSetList) IA__FcFontSetList __attribute((visibility("hidden"))); +#define FcFontSetList IA__FcFontSetList +extern __typeof (FcFontList) IA__FcFontList __attribute((visibility("hidden"))); +#define FcFontList IA__FcFontList +extern __typeof (FcAtomicCreate) IA__FcAtomicCreate __attribute((visibility("hidden"))); +#define FcAtomicCreate IA__FcAtomicCreate +extern __typeof (FcAtomicLock) IA__FcAtomicLock __attribute((visibility("hidden"))); +#define FcAtomicLock IA__FcAtomicLock +extern __typeof (FcAtomicNewFile) IA__FcAtomicNewFile __attribute((visibility("hidden"))); +#define FcAtomicNewFile IA__FcAtomicNewFile +extern __typeof (FcAtomicOrigFile) IA__FcAtomicOrigFile __attribute((visibility("hidden"))); +#define FcAtomicOrigFile IA__FcAtomicOrigFile +extern __typeof (FcAtomicReplaceOrig) IA__FcAtomicReplaceOrig __attribute((visibility("hidden"))); +#define FcAtomicReplaceOrig IA__FcAtomicReplaceOrig +extern __typeof (FcAtomicDeleteNew) IA__FcAtomicDeleteNew __attribute((visibility("hidden"))); +#define FcAtomicDeleteNew IA__FcAtomicDeleteNew +extern __typeof (FcAtomicUnlock) IA__FcAtomicUnlock __attribute((visibility("hidden"))); +#define FcAtomicUnlock IA__FcAtomicUnlock +extern __typeof (FcAtomicDestroy) IA__FcAtomicDestroy __attribute((visibility("hidden"))); +#define FcAtomicDestroy IA__FcAtomicDestroy +extern __typeof (FcFontSetMatch) IA__FcFontSetMatch __attribute((visibility("hidden"))); +#define FcFontSetMatch IA__FcFontSetMatch +extern __typeof (FcFontMatch) IA__FcFontMatch __attribute((visibility("hidden"))); +#define FcFontMatch IA__FcFontMatch +extern __typeof (FcFontRenderPrepare) IA__FcFontRenderPrepare __attribute((visibility("hidden"))); +#define FcFontRenderPrepare IA__FcFontRenderPrepare +extern __typeof (FcFontSetSort) IA__FcFontSetSort __attribute((visibility("hidden"))); +#define FcFontSetSort IA__FcFontSetSort +extern __typeof (FcFontSort) IA__FcFontSort __attribute((visibility("hidden"))); +#define FcFontSort IA__FcFontSort +extern __typeof (FcFontSetSortDestroy) IA__FcFontSetSortDestroy __attribute((visibility("hidden"))); +#define FcFontSetSortDestroy IA__FcFontSetSortDestroy +extern __typeof (FcMatrixCopy) IA__FcMatrixCopy __attribute((visibility("hidden"))); +#define FcMatrixCopy IA__FcMatrixCopy +extern __typeof (FcMatrixEqual) IA__FcMatrixEqual __attribute((visibility("hidden"))); +#define FcMatrixEqual IA__FcMatrixEqual +extern __typeof (FcMatrixMultiply) IA__FcMatrixMultiply __attribute((visibility("hidden"))); +#define FcMatrixMultiply IA__FcMatrixMultiply +extern __typeof (FcMatrixRotate) IA__FcMatrixRotate __attribute((visibility("hidden"))); +#define FcMatrixRotate IA__FcMatrixRotate +extern __typeof (FcMatrixScale) IA__FcMatrixScale __attribute((visibility("hidden"))); +#define FcMatrixScale IA__FcMatrixScale +extern __typeof (FcMatrixShear) IA__FcMatrixShear __attribute((visibility("hidden"))); +#define FcMatrixShear IA__FcMatrixShear +extern __typeof (FcNameRegisterObjectTypes) IA__FcNameRegisterObjectTypes __attribute((visibility("hidden"))); +#define FcNameRegisterObjectTypes IA__FcNameRegisterObjectTypes +extern __typeof (FcNameUnregisterObjectTypes) IA__FcNameUnregisterObjectTypes __attribute((visibility("hidden"))); +#define FcNameUnregisterObjectTypes IA__FcNameUnregisterObjectTypes +extern __typeof (FcNameGetObjectType) IA__FcNameGetObjectType __attribute((visibility("hidden"))); +#define FcNameGetObjectType IA__FcNameGetObjectType +extern __typeof (FcNameRegisterConstants) IA__FcNameRegisterConstants __attribute((visibility("hidden"))); +#define FcNameRegisterConstants IA__FcNameRegisterConstants +extern __typeof (FcNameUnregisterConstants) IA__FcNameUnregisterConstants __attribute((visibility("hidden"))); +#define FcNameUnregisterConstants IA__FcNameUnregisterConstants +extern __typeof (FcNameGetConstant) IA__FcNameGetConstant __attribute((visibility("hidden"))); +#define FcNameGetConstant IA__FcNameGetConstant +extern __typeof (FcNameConstant) IA__FcNameConstant __attribute((visibility("hidden"))); +#define FcNameConstant IA__FcNameConstant +extern __typeof (FcNameParse) IA__FcNameParse __attribute((visibility("hidden"))); +#define FcNameParse IA__FcNameParse +extern __typeof (FcNameUnparse) IA__FcNameUnparse __attribute((visibility("hidden"))); +#define FcNameUnparse IA__FcNameUnparse +extern __typeof (FcPatternCreate) IA__FcPatternCreate __attribute((visibility("hidden"))); +#define FcPatternCreate IA__FcPatternCreate +extern __typeof (FcPatternDuplicate) IA__FcPatternDuplicate __attribute((visibility("hidden"))); +#define FcPatternDuplicate IA__FcPatternDuplicate +extern __typeof (FcPatternReference) IA__FcPatternReference __attribute((visibility("hidden"))); +#define FcPatternReference IA__FcPatternReference +extern __typeof (FcPatternFilter) IA__FcPatternFilter __attribute((visibility("hidden"))); +#define FcPatternFilter IA__FcPatternFilter +extern __typeof (FcValueDestroy) IA__FcValueDestroy __attribute((visibility("hidden"))); +#define FcValueDestroy IA__FcValueDestroy +extern __typeof (FcValueEqual) IA__FcValueEqual __attribute((visibility("hidden"))); +#define FcValueEqual IA__FcValueEqual +extern __typeof (FcValueSave) IA__FcValueSave __attribute((visibility("hidden"))); +#define FcValueSave IA__FcValueSave +extern __typeof (FcPatternDestroy) IA__FcPatternDestroy __attribute((visibility("hidden"))); +#define FcPatternDestroy IA__FcPatternDestroy +extern __typeof (FcPatternEqual) IA__FcPatternEqual __attribute((visibility("hidden"))); +#define FcPatternEqual IA__FcPatternEqual +extern __typeof (FcPatternEqualSubset) IA__FcPatternEqualSubset __attribute((visibility("hidden"))); +#define FcPatternEqualSubset IA__FcPatternEqualSubset +extern __typeof (FcPatternHash) IA__FcPatternHash __attribute((visibility("hidden"))); +#define FcPatternHash IA__FcPatternHash +extern __typeof (FcPatternAdd) IA__FcPatternAdd __attribute((visibility("hidden"))); +#define FcPatternAdd IA__FcPatternAdd +extern __typeof (FcPatternAddWeak) IA__FcPatternAddWeak __attribute((visibility("hidden"))); +#define FcPatternAddWeak IA__FcPatternAddWeak +extern __typeof (FcPatternGet) IA__FcPatternGet __attribute((visibility("hidden"))); +#define FcPatternGet IA__FcPatternGet +extern __typeof (FcPatternDel) IA__FcPatternDel __attribute((visibility("hidden"))); +#define FcPatternDel IA__FcPatternDel +extern __typeof (FcPatternRemove) IA__FcPatternRemove __attribute((visibility("hidden"))); +#define FcPatternRemove IA__FcPatternRemove +extern __typeof (FcPatternAddInteger) IA__FcPatternAddInteger __attribute((visibility("hidden"))); +#define FcPatternAddInteger IA__FcPatternAddInteger +extern __typeof (FcPatternAddDouble) IA__FcPatternAddDouble __attribute((visibility("hidden"))); +#define FcPatternAddDouble IA__FcPatternAddDouble +extern __typeof (FcPatternAddString) IA__FcPatternAddString __attribute((visibility("hidden"))); +#define FcPatternAddString IA__FcPatternAddString +extern __typeof (FcPatternAddMatrix) IA__FcPatternAddMatrix __attribute((visibility("hidden"))); +#define FcPatternAddMatrix IA__FcPatternAddMatrix +extern __typeof (FcPatternAddCharSet) IA__FcPatternAddCharSet __attribute((visibility("hidden"))); +#define FcPatternAddCharSet IA__FcPatternAddCharSet +extern __typeof (FcPatternAddBool) IA__FcPatternAddBool __attribute((visibility("hidden"))); +#define FcPatternAddBool IA__FcPatternAddBool +extern __typeof (FcPatternAddLangSet) IA__FcPatternAddLangSet __attribute((visibility("hidden"))); +#define FcPatternAddLangSet IA__FcPatternAddLangSet +extern __typeof (FcPatternAddRange) IA__FcPatternAddRange __attribute((visibility("hidden"))); +#define FcPatternAddRange IA__FcPatternAddRange +extern __typeof (FcPatternGetInteger) IA__FcPatternGetInteger __attribute((visibility("hidden"))); +#define FcPatternGetInteger IA__FcPatternGetInteger +extern __typeof (FcPatternGetDouble) IA__FcPatternGetDouble __attribute((visibility("hidden"))); +#define FcPatternGetDouble IA__FcPatternGetDouble +extern __typeof (FcPatternGetString) IA__FcPatternGetString __attribute((visibility("hidden"))); +#define FcPatternGetString IA__FcPatternGetString +extern __typeof (FcPatternGetMatrix) IA__FcPatternGetMatrix __attribute((visibility("hidden"))); +#define FcPatternGetMatrix IA__FcPatternGetMatrix +extern __typeof (FcPatternGetCharSet) IA__FcPatternGetCharSet __attribute((visibility("hidden"))); +#define FcPatternGetCharSet IA__FcPatternGetCharSet +extern __typeof (FcPatternGetBool) IA__FcPatternGetBool __attribute((visibility("hidden"))); +#define FcPatternGetBool IA__FcPatternGetBool +extern __typeof (FcPatternGetLangSet) IA__FcPatternGetLangSet __attribute((visibility("hidden"))); +#define FcPatternGetLangSet IA__FcPatternGetLangSet +extern __typeof (FcPatternGetRange) IA__FcPatternGetRange __attribute((visibility("hidden"))); +#define FcPatternGetRange IA__FcPatternGetRange +extern __typeof (FcPatternVaBuild) IA__FcPatternVaBuild __attribute((visibility("hidden"))); +#define FcPatternVaBuild IA__FcPatternVaBuild +extern __typeof (FcPatternBuild) IA__FcPatternBuild __attribute((visibility("hidden"))); +#define FcPatternBuild IA__FcPatternBuild +extern __typeof (FcPatternFormat) IA__FcPatternFormat __attribute((visibility("hidden"))); +#define FcPatternFormat IA__FcPatternFormat +extern __typeof (FcRangeCreateDouble) IA__FcRangeCreateDouble __attribute((visibility("hidden"))); +#define FcRangeCreateDouble IA__FcRangeCreateDouble +extern __typeof (FcRangeCreateInteger) IA__FcRangeCreateInteger __attribute((visibility("hidden"))); +#define FcRangeCreateInteger IA__FcRangeCreateInteger +extern __typeof (FcRangeDestroy) IA__FcRangeDestroy __attribute((visibility("hidden"))); +#define FcRangeDestroy IA__FcRangeDestroy +extern __typeof (FcRangeCopy) IA__FcRangeCopy __attribute((visibility("hidden"))); +#define FcRangeCopy IA__FcRangeCopy +extern __typeof (FcRangeGetDouble) IA__FcRangeGetDouble __attribute((visibility("hidden"))); +#define FcRangeGetDouble IA__FcRangeGetDouble +extern __typeof (FcWeightFromOpenType) IA__FcWeightFromOpenType __attribute((visibility("hidden"))); +#define FcWeightFromOpenType IA__FcWeightFromOpenType +extern __typeof (FcWeightToOpenType) IA__FcWeightToOpenType __attribute((visibility("hidden"))); +#define FcWeightToOpenType IA__FcWeightToOpenType +extern __typeof (FcStrCopy) IA__FcStrCopy __attribute((visibility("hidden"))); +#define FcStrCopy IA__FcStrCopy +extern __typeof (FcStrCopyFilename) IA__FcStrCopyFilename __attribute((visibility("hidden"))); +#define FcStrCopyFilename IA__FcStrCopyFilename +extern __typeof (FcStrPlus) IA__FcStrPlus __attribute((visibility("hidden"))); +#define FcStrPlus IA__FcStrPlus +extern __typeof (FcStrFree) IA__FcStrFree __attribute((visibility("hidden"))); +#define FcStrFree IA__FcStrFree +extern __typeof (FcStrDowncase) IA__FcStrDowncase __attribute((visibility("hidden"))); +#define FcStrDowncase IA__FcStrDowncase +extern __typeof (FcStrCmpIgnoreCase) IA__FcStrCmpIgnoreCase __attribute((visibility("hidden"))); +#define FcStrCmpIgnoreCase IA__FcStrCmpIgnoreCase +extern __typeof (FcStrCmp) IA__FcStrCmp __attribute((visibility("hidden"))); +#define FcStrCmp IA__FcStrCmp +extern __typeof (FcStrStrIgnoreCase) IA__FcStrStrIgnoreCase __attribute((visibility("hidden"))); +#define FcStrStrIgnoreCase IA__FcStrStrIgnoreCase +extern __typeof (FcStrStr) IA__FcStrStr __attribute((visibility("hidden"))); +#define FcStrStr IA__FcStrStr +extern __typeof (FcUtf8ToUcs4) IA__FcUtf8ToUcs4 __attribute((visibility("hidden"))); +#define FcUtf8ToUcs4 IA__FcUtf8ToUcs4 +extern __typeof (FcUtf8Len) IA__FcUtf8Len __attribute((visibility("hidden"))); +#define FcUtf8Len IA__FcUtf8Len +extern __typeof (FcUcs4ToUtf8) IA__FcUcs4ToUtf8 __attribute((visibility("hidden"))); +#define FcUcs4ToUtf8 IA__FcUcs4ToUtf8 +extern __typeof (FcUtf16ToUcs4) IA__FcUtf16ToUcs4 __attribute((visibility("hidden"))); +#define FcUtf16ToUcs4 IA__FcUtf16ToUcs4 +extern __typeof (FcUtf16Len) IA__FcUtf16Len __attribute((visibility("hidden"))); +#define FcUtf16Len IA__FcUtf16Len +extern __typeof (FcStrDirname) IA__FcStrDirname __attribute((visibility("hidden"))); +#define FcStrDirname IA__FcStrDirname +extern __typeof (FcStrBasename) IA__FcStrBasename __attribute((visibility("hidden"))); +#define FcStrBasename IA__FcStrBasename +extern __typeof (FcStrSetCreate) IA__FcStrSetCreate __attribute((visibility("hidden"))); +#define FcStrSetCreate IA__FcStrSetCreate +extern __typeof (FcStrSetMember) IA__FcStrSetMember __attribute((visibility("hidden"))); +#define FcStrSetMember IA__FcStrSetMember +extern __typeof (FcStrSetEqual) IA__FcStrSetEqual __attribute((visibility("hidden"))); +#define FcStrSetEqual IA__FcStrSetEqual +extern __typeof (FcStrSetAdd) IA__FcStrSetAdd __attribute((visibility("hidden"))); +#define FcStrSetAdd IA__FcStrSetAdd +extern __typeof (FcStrSetAddFilename) IA__FcStrSetAddFilename __attribute((visibility("hidden"))); +#define FcStrSetAddFilename IA__FcStrSetAddFilename +extern __typeof (FcStrSetDel) IA__FcStrSetDel __attribute((visibility("hidden"))); +#define FcStrSetDel IA__FcStrSetDel +extern __typeof (FcStrSetDestroy) IA__FcStrSetDestroy __attribute((visibility("hidden"))); +#define FcStrSetDestroy IA__FcStrSetDestroy +extern __typeof (FcStrListCreate) IA__FcStrListCreate __attribute((visibility("hidden"))); +#define FcStrListCreate IA__FcStrListCreate +extern __typeof (FcStrListFirst) IA__FcStrListFirst __attribute((visibility("hidden"))); +#define FcStrListFirst IA__FcStrListFirst +extern __typeof (FcStrListNext) IA__FcStrListNext __attribute((visibility("hidden"))); +#define FcStrListNext IA__FcStrListNext +extern __typeof (FcStrListDone) IA__FcStrListDone __attribute((visibility("hidden"))); +#define FcStrListDone IA__FcStrListDone +extern __typeof (FcConfigParseAndLoad) IA__FcConfigParseAndLoad __attribute((visibility("hidden"))); +#define FcConfigParseAndLoad IA__FcConfigParseAndLoad +extern __typeof (FcConfigGetRescanInverval) IA__FcConfigGetRescanInverval __attribute((visibility("hidden"))); +#define FcConfigGetRescanInverval IA__FcConfigGetRescanInverval +extern __typeof (FcConfigSetRescanInverval) IA__FcConfigSetRescanInverval __attribute((visibility("hidden"))); +#define FcConfigSetRescanInverval IA__FcConfigSetRescanInverval diff --git a/static/custom-include/fontconfig/fcaliastail.h b/static/custom-include/fontconfig/fcaliastail.h new file mode 100644 index 000000000..13e5f50b8 --- /dev/null +++ b/static/custom-include/fontconfig/fcaliastail.h @@ -0,0 +1,464 @@ +#if HAVE_GNUC_ATTRIBUTE +#ifdef __fcblanks__ +# undef FcBlanksCreate +extern __typeof (FcBlanksCreate) FcBlanksCreate __attribute((alias("IA__FcBlanksCreate"), visibility("default"))); +# undef FcBlanksDestroy +extern __typeof (FcBlanksDestroy) FcBlanksDestroy __attribute((alias("IA__FcBlanksDestroy"), visibility("default"))); +# undef FcBlanksAdd +extern __typeof (FcBlanksAdd) FcBlanksAdd __attribute((alias("IA__FcBlanksAdd"), visibility("default"))); +# undef FcBlanksIsMember +extern __typeof (FcBlanksIsMember) FcBlanksIsMember __attribute((alias("IA__FcBlanksIsMember"), visibility("default"))); +#endif /* __fcblanks__ */ +#ifdef __fccache__ +# undef FcCacheCopySet +extern __typeof (FcCacheCopySet) FcCacheCopySet __attribute((alias("IA__FcCacheCopySet"), visibility("default"))); +# undef FcCacheNumSubdir +extern __typeof (FcCacheNumSubdir) FcCacheNumSubdir __attribute((alias("IA__FcCacheNumSubdir"), visibility("default"))); +# undef FcCacheNumFont +extern __typeof (FcCacheNumFont) FcCacheNumFont __attribute((alias("IA__FcCacheNumFont"), visibility("default"))); +# undef FcDirCacheUnlink +extern __typeof (FcDirCacheUnlink) FcDirCacheUnlink __attribute((alias("IA__FcDirCacheUnlink"), visibility("default"))); +# undef FcDirCacheValid +extern __typeof (FcDirCacheValid) FcDirCacheValid __attribute((alias("IA__FcDirCacheValid"), visibility("default"))); +# undef FcDirCacheClean +extern __typeof (FcDirCacheClean) FcDirCacheClean __attribute((alias("IA__FcDirCacheClean"), visibility("default"))); +# undef FcCacheCreateTagFile +extern __typeof (FcCacheCreateTagFile) FcCacheCreateTagFile __attribute((alias("IA__FcCacheCreateTagFile"), visibility("default"))); +#endif /* __fccache__ */ +#ifdef __fccfg__ +# undef FcConfigHome +extern __typeof (FcConfigHome) FcConfigHome __attribute((alias("IA__FcConfigHome"), visibility("default"))); +# undef FcConfigEnableHome +extern __typeof (FcConfigEnableHome) FcConfigEnableHome __attribute((alias("IA__FcConfigEnableHome"), visibility("default"))); +# undef FcConfigFilename +extern __typeof (FcConfigFilename) FcConfigFilename __attribute((alias("IA__FcConfigFilename"), visibility("default"))); +# undef FcConfigCreate +extern __typeof (FcConfigCreate) FcConfigCreate __attribute((alias("IA__FcConfigCreate"), visibility("default"))); +# undef FcConfigReference +extern __typeof (FcConfigReference) FcConfigReference __attribute((alias("IA__FcConfigReference"), visibility("default"))); +# undef FcConfigDestroy +extern __typeof (FcConfigDestroy) FcConfigDestroy __attribute((alias("IA__FcConfigDestroy"), visibility("default"))); +# undef FcConfigSetCurrent +extern __typeof (FcConfigSetCurrent) FcConfigSetCurrent __attribute((alias("IA__FcConfigSetCurrent"), visibility("default"))); +# undef FcConfigGetCurrent +extern __typeof (FcConfigGetCurrent) FcConfigGetCurrent __attribute((alias("IA__FcConfigGetCurrent"), visibility("default"))); +# undef FcConfigUptoDate +extern __typeof (FcConfigUptoDate) FcConfigUptoDate __attribute((alias("IA__FcConfigUptoDate"), visibility("default"))); +# undef FcConfigBuildFonts +extern __typeof (FcConfigBuildFonts) FcConfigBuildFonts __attribute((alias("IA__FcConfigBuildFonts"), visibility("default"))); +# undef FcConfigGetFontDirs +extern __typeof (FcConfigGetFontDirs) FcConfigGetFontDirs __attribute((alias("IA__FcConfigGetFontDirs"), visibility("default"))); +# undef FcConfigGetConfigDirs +extern __typeof (FcConfigGetConfigDirs) FcConfigGetConfigDirs __attribute((alias("IA__FcConfigGetConfigDirs"), visibility("default"))); +# undef FcConfigGetConfigFiles +extern __typeof (FcConfigGetConfigFiles) FcConfigGetConfigFiles __attribute((alias("IA__FcConfigGetConfigFiles"), visibility("default"))); +# undef FcConfigGetCache +extern __typeof (FcConfigGetCache) FcConfigGetCache __attribute((alias("IA__FcConfigGetCache"), visibility("default"))); +# undef FcConfigGetBlanks +extern __typeof (FcConfigGetBlanks) FcConfigGetBlanks __attribute((alias("IA__FcConfigGetBlanks"), visibility("default"))); +# undef FcConfigGetCacheDirs +extern __typeof (FcConfigGetCacheDirs) FcConfigGetCacheDirs __attribute((alias("IA__FcConfigGetCacheDirs"), visibility("default"))); +# undef FcConfigGetRescanInterval +extern __typeof (FcConfigGetRescanInterval) FcConfigGetRescanInterval __attribute((alias("IA__FcConfigGetRescanInterval"), visibility("default"))); +# undef FcConfigSetRescanInterval +extern __typeof (FcConfigSetRescanInterval) FcConfigSetRescanInterval __attribute((alias("IA__FcConfigSetRescanInterval"), visibility("default"))); +# undef FcConfigGetFonts +extern __typeof (FcConfigGetFonts) FcConfigGetFonts __attribute((alias("IA__FcConfigGetFonts"), visibility("default"))); +# undef FcConfigAppFontAddFile +extern __typeof (FcConfigAppFontAddFile) FcConfigAppFontAddFile __attribute((alias("IA__FcConfigAppFontAddFile"), visibility("default"))); +# undef FcConfigAppFontAddDir +extern __typeof (FcConfigAppFontAddDir) FcConfigAppFontAddDir __attribute((alias("IA__FcConfigAppFontAddDir"), visibility("default"))); +# undef FcConfigAppFontClear +extern __typeof (FcConfigAppFontClear) FcConfigAppFontClear __attribute((alias("IA__FcConfigAppFontClear"), visibility("default"))); +# undef FcConfigSubstituteWithPat +extern __typeof (FcConfigSubstituteWithPat) FcConfigSubstituteWithPat __attribute((alias("IA__FcConfigSubstituteWithPat"), visibility("default"))); +# undef FcConfigSubstitute +extern __typeof (FcConfigSubstitute) FcConfigSubstitute __attribute((alias("IA__FcConfigSubstitute"), visibility("default"))); +# undef FcConfigGetSysRoot +extern __typeof (FcConfigGetSysRoot) FcConfigGetSysRoot __attribute((alias("IA__FcConfigGetSysRoot"), visibility("default"))); +# undef FcConfigSetSysRoot +extern __typeof (FcConfigSetSysRoot) FcConfigSetSysRoot __attribute((alias("IA__FcConfigSetSysRoot"), visibility("default"))); +#endif /* __fccfg__ */ +#ifdef __fccharset__ +# undef FcCharSetCreate +extern __typeof (FcCharSetCreate) FcCharSetCreate __attribute((alias("IA__FcCharSetCreate"), visibility("default"))); +# undef FcCharSetNew +extern __typeof (FcCharSetNew) FcCharSetNew __attribute((alias("IA__FcCharSetNew"), visibility("default"))); +# undef FcCharSetDestroy +extern __typeof (FcCharSetDestroy) FcCharSetDestroy __attribute((alias("IA__FcCharSetDestroy"), visibility("default"))); +# undef FcCharSetAddChar +extern __typeof (FcCharSetAddChar) FcCharSetAddChar __attribute((alias("IA__FcCharSetAddChar"), visibility("default"))); +# undef FcCharSetDelChar +extern __typeof (FcCharSetDelChar) FcCharSetDelChar __attribute((alias("IA__FcCharSetDelChar"), visibility("default"))); +# undef FcCharSetCopy +extern __typeof (FcCharSetCopy) FcCharSetCopy __attribute((alias("IA__FcCharSetCopy"), visibility("default"))); +# undef FcCharSetEqual +extern __typeof (FcCharSetEqual) FcCharSetEqual __attribute((alias("IA__FcCharSetEqual"), visibility("default"))); +# undef FcCharSetIntersect +extern __typeof (FcCharSetIntersect) FcCharSetIntersect __attribute((alias("IA__FcCharSetIntersect"), visibility("default"))); +# undef FcCharSetUnion +extern __typeof (FcCharSetUnion) FcCharSetUnion __attribute((alias("IA__FcCharSetUnion"), visibility("default"))); +# undef FcCharSetSubtract +extern __typeof (FcCharSetSubtract) FcCharSetSubtract __attribute((alias("IA__FcCharSetSubtract"), visibility("default"))); +# undef FcCharSetMerge +extern __typeof (FcCharSetMerge) FcCharSetMerge __attribute((alias("IA__FcCharSetMerge"), visibility("default"))); +# undef FcCharSetHasChar +extern __typeof (FcCharSetHasChar) FcCharSetHasChar __attribute((alias("IA__FcCharSetHasChar"), visibility("default"))); +# undef FcCharSetCount +extern __typeof (FcCharSetCount) FcCharSetCount __attribute((alias("IA__FcCharSetCount"), visibility("default"))); +# undef FcCharSetIntersectCount +extern __typeof (FcCharSetIntersectCount) FcCharSetIntersectCount __attribute((alias("IA__FcCharSetIntersectCount"), visibility("default"))); +# undef FcCharSetSubtractCount +extern __typeof (FcCharSetSubtractCount) FcCharSetSubtractCount __attribute((alias("IA__FcCharSetSubtractCount"), visibility("default"))); +# undef FcCharSetIsSubset +extern __typeof (FcCharSetIsSubset) FcCharSetIsSubset __attribute((alias("IA__FcCharSetIsSubset"), visibility("default"))); +# undef FcCharSetFirstPage +extern __typeof (FcCharSetFirstPage) FcCharSetFirstPage __attribute((alias("IA__FcCharSetFirstPage"), visibility("default"))); +# undef FcCharSetNextPage +extern __typeof (FcCharSetNextPage) FcCharSetNextPage __attribute((alias("IA__FcCharSetNextPage"), visibility("default"))); +# undef FcCharSetCoverage +extern __typeof (FcCharSetCoverage) FcCharSetCoverage __attribute((alias("IA__FcCharSetCoverage"), visibility("default"))); +#endif /* __fccharset__ */ +#ifdef __fcdbg__ +# undef FcValuePrint +extern __typeof (FcValuePrint) FcValuePrint __attribute((alias("IA__FcValuePrint"), visibility("default"))); +# undef FcPatternPrint +extern __typeof (FcPatternPrint) FcPatternPrint __attribute((alias("IA__FcPatternPrint"), visibility("default"))); +# undef FcFontSetPrint +extern __typeof (FcFontSetPrint) FcFontSetPrint __attribute((alias("IA__FcFontSetPrint"), visibility("default"))); +#endif /* __fcdbg__ */ +#ifdef __fcdefault__ +# undef FcGetDefaultLangs +extern __typeof (FcGetDefaultLangs) FcGetDefaultLangs __attribute((alias("IA__FcGetDefaultLangs"), visibility("default"))); +# undef FcDefaultSubstitute +extern __typeof (FcDefaultSubstitute) FcDefaultSubstitute __attribute((alias("IA__FcDefaultSubstitute"), visibility("default"))); +#endif /* __fcdefault__ */ +#ifdef __fcdir__ +# undef FcFileIsDir +extern __typeof (FcFileIsDir) FcFileIsDir __attribute((alias("IA__FcFileIsDir"), visibility("default"))); +# undef FcFileScan +extern __typeof (FcFileScan) FcFileScan __attribute((alias("IA__FcFileScan"), visibility("default"))); +# undef FcDirScan +extern __typeof (FcDirScan) FcDirScan __attribute((alias("IA__FcDirScan"), visibility("default"))); +# undef FcDirSave +extern __typeof (FcDirSave) FcDirSave __attribute((alias("IA__FcDirSave"), visibility("default"))); +#endif /* __fcdir__ */ +#ifdef __fccache__ +# undef FcDirCacheLoad +extern __typeof (FcDirCacheLoad) FcDirCacheLoad __attribute((alias("IA__FcDirCacheLoad"), visibility("default"))); +#endif /* __fccache__ */ +#ifdef __fcdir__ +# undef FcDirCacheRescan +extern __typeof (FcDirCacheRescan) FcDirCacheRescan __attribute((alias("IA__FcDirCacheRescan"), visibility("default"))); +# undef FcDirCacheRead +extern __typeof (FcDirCacheRead) FcDirCacheRead __attribute((alias("IA__FcDirCacheRead"), visibility("default"))); +#endif /* __fcdir__ */ +#ifdef __fccache__ +# undef FcDirCacheLoadFile +extern __typeof (FcDirCacheLoadFile) FcDirCacheLoadFile __attribute((alias("IA__FcDirCacheLoadFile"), visibility("default"))); +# undef FcDirCacheUnload +extern __typeof (FcDirCacheUnload) FcDirCacheUnload __attribute((alias("IA__FcDirCacheUnload"), visibility("default"))); +#endif /* __fccache__ */ +#ifdef __fcfreetype__ +# undef FcFreeTypeQuery +extern __typeof (FcFreeTypeQuery) FcFreeTypeQuery __attribute((alias("IA__FcFreeTypeQuery"), visibility("default"))); +#endif /* __fcfreetype__ */ +#ifdef __fcfs__ +# undef FcFontSetCreate +extern __typeof (FcFontSetCreate) FcFontSetCreate __attribute((alias("IA__FcFontSetCreate"), visibility("default"))); +# undef FcFontSetDestroy +extern __typeof (FcFontSetDestroy) FcFontSetDestroy __attribute((alias("IA__FcFontSetDestroy"), visibility("default"))); +# undef FcFontSetAdd +extern __typeof (FcFontSetAdd) FcFontSetAdd __attribute((alias("IA__FcFontSetAdd"), visibility("default"))); +#endif /* __fcfs__ */ +#ifdef __fcinit__ +# undef FcInitLoadConfig +extern __typeof (FcInitLoadConfig) FcInitLoadConfig __attribute((alias("IA__FcInitLoadConfig"), visibility("default"))); +# undef FcInitLoadConfigAndFonts +extern __typeof (FcInitLoadConfigAndFonts) FcInitLoadConfigAndFonts __attribute((alias("IA__FcInitLoadConfigAndFonts"), visibility("default"))); +# undef FcInit +extern __typeof (FcInit) FcInit __attribute((alias("IA__FcInit"), visibility("default"))); +# undef FcFini +extern __typeof (FcFini) FcFini __attribute((alias("IA__FcFini"), visibility("default"))); +# undef FcGetVersion +extern __typeof (FcGetVersion) FcGetVersion __attribute((alias("IA__FcGetVersion"), visibility("default"))); +# undef FcInitReinitialize +extern __typeof (FcInitReinitialize) FcInitReinitialize __attribute((alias("IA__FcInitReinitialize"), visibility("default"))); +# undef FcInitBringUptoDate +extern __typeof (FcInitBringUptoDate) FcInitBringUptoDate __attribute((alias("IA__FcInitBringUptoDate"), visibility("default"))); +#endif /* __fcinit__ */ +#ifdef __fclang__ +# undef FcGetLangs +extern __typeof (FcGetLangs) FcGetLangs __attribute((alias("IA__FcGetLangs"), visibility("default"))); +# undef FcLangNormalize +extern __typeof (FcLangNormalize) FcLangNormalize __attribute((alias("IA__FcLangNormalize"), visibility("default"))); +# undef FcLangGetCharSet +extern __typeof (FcLangGetCharSet) FcLangGetCharSet __attribute((alias("IA__FcLangGetCharSet"), visibility("default"))); +# undef FcLangSetCreate +extern __typeof (FcLangSetCreate) FcLangSetCreate __attribute((alias("IA__FcLangSetCreate"), visibility("default"))); +# undef FcLangSetDestroy +extern __typeof (FcLangSetDestroy) FcLangSetDestroy __attribute((alias("IA__FcLangSetDestroy"), visibility("default"))); +# undef FcLangSetCopy +extern __typeof (FcLangSetCopy) FcLangSetCopy __attribute((alias("IA__FcLangSetCopy"), visibility("default"))); +# undef FcLangSetAdd +extern __typeof (FcLangSetAdd) FcLangSetAdd __attribute((alias("IA__FcLangSetAdd"), visibility("default"))); +# undef FcLangSetDel +extern __typeof (FcLangSetDel) FcLangSetDel __attribute((alias("IA__FcLangSetDel"), visibility("default"))); +# undef FcLangSetHasLang +extern __typeof (FcLangSetHasLang) FcLangSetHasLang __attribute((alias("IA__FcLangSetHasLang"), visibility("default"))); +# undef FcLangSetCompare +extern __typeof (FcLangSetCompare) FcLangSetCompare __attribute((alias("IA__FcLangSetCompare"), visibility("default"))); +# undef FcLangSetContains +extern __typeof (FcLangSetContains) FcLangSetContains __attribute((alias("IA__FcLangSetContains"), visibility("default"))); +# undef FcLangSetEqual +extern __typeof (FcLangSetEqual) FcLangSetEqual __attribute((alias("IA__FcLangSetEqual"), visibility("default"))); +# undef FcLangSetHash +extern __typeof (FcLangSetHash) FcLangSetHash __attribute((alias("IA__FcLangSetHash"), visibility("default"))); +# undef FcLangSetGetLangs +extern __typeof (FcLangSetGetLangs) FcLangSetGetLangs __attribute((alias("IA__FcLangSetGetLangs"), visibility("default"))); +# undef FcLangSetUnion +extern __typeof (FcLangSetUnion) FcLangSetUnion __attribute((alias("IA__FcLangSetUnion"), visibility("default"))); +# undef FcLangSetSubtract +extern __typeof (FcLangSetSubtract) FcLangSetSubtract __attribute((alias("IA__FcLangSetSubtract"), visibility("default"))); +#endif /* __fclang__ */ +#ifdef __fclist__ +# undef FcObjectSetCreate +extern __typeof (FcObjectSetCreate) FcObjectSetCreate __attribute((alias("IA__FcObjectSetCreate"), visibility("default"))); +# undef FcObjectSetAdd +extern __typeof (FcObjectSetAdd) FcObjectSetAdd __attribute((alias("IA__FcObjectSetAdd"), visibility("default"))); +# undef FcObjectSetDestroy +extern __typeof (FcObjectSetDestroy) FcObjectSetDestroy __attribute((alias("IA__FcObjectSetDestroy"), visibility("default"))); +# undef FcObjectSetVaBuild +extern __typeof (FcObjectSetVaBuild) FcObjectSetVaBuild __attribute((alias("IA__FcObjectSetVaBuild"), visibility("default"))); +# undef FcObjectSetBuild +extern __typeof (FcObjectSetBuild) FcObjectSetBuild __attribute((alias("IA__FcObjectSetBuild"), visibility("default"))); +# undef FcFontSetList +extern __typeof (FcFontSetList) FcFontSetList __attribute((alias("IA__FcFontSetList"), visibility("default"))); +# undef FcFontList +extern __typeof (FcFontList) FcFontList __attribute((alias("IA__FcFontList"), visibility("default"))); +#endif /* __fclist__ */ +#ifdef __fcatomic__ +# undef FcAtomicCreate +extern __typeof (FcAtomicCreate) FcAtomicCreate __attribute((alias("IA__FcAtomicCreate"), visibility("default"))); +# undef FcAtomicLock +extern __typeof (FcAtomicLock) FcAtomicLock __attribute((alias("IA__FcAtomicLock"), visibility("default"))); +# undef FcAtomicNewFile +extern __typeof (FcAtomicNewFile) FcAtomicNewFile __attribute((alias("IA__FcAtomicNewFile"), visibility("default"))); +# undef FcAtomicOrigFile +extern __typeof (FcAtomicOrigFile) FcAtomicOrigFile __attribute((alias("IA__FcAtomicOrigFile"), visibility("default"))); +# undef FcAtomicReplaceOrig +extern __typeof (FcAtomicReplaceOrig) FcAtomicReplaceOrig __attribute((alias("IA__FcAtomicReplaceOrig"), visibility("default"))); +# undef FcAtomicDeleteNew +extern __typeof (FcAtomicDeleteNew) FcAtomicDeleteNew __attribute((alias("IA__FcAtomicDeleteNew"), visibility("default"))); +# undef FcAtomicUnlock +extern __typeof (FcAtomicUnlock) FcAtomicUnlock __attribute((alias("IA__FcAtomicUnlock"), visibility("default"))); +# undef FcAtomicDestroy +extern __typeof (FcAtomicDestroy) FcAtomicDestroy __attribute((alias("IA__FcAtomicDestroy"), visibility("default"))); +#endif /* __fcatomic__ */ +#ifdef __fcmatch__ +# undef FcFontSetMatch +extern __typeof (FcFontSetMatch) FcFontSetMatch __attribute((alias("IA__FcFontSetMatch"), visibility("default"))); +# undef FcFontMatch +extern __typeof (FcFontMatch) FcFontMatch __attribute((alias("IA__FcFontMatch"), visibility("default"))); +# undef FcFontRenderPrepare +extern __typeof (FcFontRenderPrepare) FcFontRenderPrepare __attribute((alias("IA__FcFontRenderPrepare"), visibility("default"))); +# undef FcFontSetSort +extern __typeof (FcFontSetSort) FcFontSetSort __attribute((alias("IA__FcFontSetSort"), visibility("default"))); +# undef FcFontSort +extern __typeof (FcFontSort) FcFontSort __attribute((alias("IA__FcFontSort"), visibility("default"))); +# undef FcFontSetSortDestroy +extern __typeof (FcFontSetSortDestroy) FcFontSetSortDestroy __attribute((alias("IA__FcFontSetSortDestroy"), visibility("default"))); +#endif /* __fcmatch__ */ +#ifdef __fcmatrix__ +# undef FcMatrixCopy +extern __typeof (FcMatrixCopy) FcMatrixCopy __attribute((alias("IA__FcMatrixCopy"), visibility("default"))); +# undef FcMatrixEqual +extern __typeof (FcMatrixEqual) FcMatrixEqual __attribute((alias("IA__FcMatrixEqual"), visibility("default"))); +# undef FcMatrixMultiply +extern __typeof (FcMatrixMultiply) FcMatrixMultiply __attribute((alias("IA__FcMatrixMultiply"), visibility("default"))); +# undef FcMatrixRotate +extern __typeof (FcMatrixRotate) FcMatrixRotate __attribute((alias("IA__FcMatrixRotate"), visibility("default"))); +# undef FcMatrixScale +extern __typeof (FcMatrixScale) FcMatrixScale __attribute((alias("IA__FcMatrixScale"), visibility("default"))); +# undef FcMatrixShear +extern __typeof (FcMatrixShear) FcMatrixShear __attribute((alias("IA__FcMatrixShear"), visibility("default"))); +#endif /* __fcmatrix__ */ +#ifdef __fcname__ +# undef FcNameRegisterObjectTypes +extern __typeof (FcNameRegisterObjectTypes) FcNameRegisterObjectTypes __attribute((alias("IA__FcNameRegisterObjectTypes"), visibility("default"))); +# undef FcNameUnregisterObjectTypes +extern __typeof (FcNameUnregisterObjectTypes) FcNameUnregisterObjectTypes __attribute((alias("IA__FcNameUnregisterObjectTypes"), visibility("default"))); +# undef FcNameGetObjectType +extern __typeof (FcNameGetObjectType) FcNameGetObjectType __attribute((alias("IA__FcNameGetObjectType"), visibility("default"))); +# undef FcNameRegisterConstants +extern __typeof (FcNameRegisterConstants) FcNameRegisterConstants __attribute((alias("IA__FcNameRegisterConstants"), visibility("default"))); +# undef FcNameUnregisterConstants +extern __typeof (FcNameUnregisterConstants) FcNameUnregisterConstants __attribute((alias("IA__FcNameUnregisterConstants"), visibility("default"))); +# undef FcNameGetConstant +extern __typeof (FcNameGetConstant) FcNameGetConstant __attribute((alias("IA__FcNameGetConstant"), visibility("default"))); +# undef FcNameConstant +extern __typeof (FcNameConstant) FcNameConstant __attribute((alias("IA__FcNameConstant"), visibility("default"))); +# undef FcNameParse +extern __typeof (FcNameParse) FcNameParse __attribute((alias("IA__FcNameParse"), visibility("default"))); +# undef FcNameUnparse +extern __typeof (FcNameUnparse) FcNameUnparse __attribute((alias("IA__FcNameUnparse"), visibility("default"))); +#endif /* __fcname__ */ +#ifdef __fcpat__ +# undef FcPatternCreate +extern __typeof (FcPatternCreate) FcPatternCreate __attribute((alias("IA__FcPatternCreate"), visibility("default"))); +# undef FcPatternDuplicate +extern __typeof (FcPatternDuplicate) FcPatternDuplicate __attribute((alias("IA__FcPatternDuplicate"), visibility("default"))); +# undef FcPatternReference +extern __typeof (FcPatternReference) FcPatternReference __attribute((alias("IA__FcPatternReference"), visibility("default"))); +# undef FcPatternFilter +extern __typeof (FcPatternFilter) FcPatternFilter __attribute((alias("IA__FcPatternFilter"), visibility("default"))); +# undef FcValueDestroy +extern __typeof (FcValueDestroy) FcValueDestroy __attribute((alias("IA__FcValueDestroy"), visibility("default"))); +# undef FcValueEqual +extern __typeof (FcValueEqual) FcValueEqual __attribute((alias("IA__FcValueEqual"), visibility("default"))); +# undef FcValueSave +extern __typeof (FcValueSave) FcValueSave __attribute((alias("IA__FcValueSave"), visibility("default"))); +# undef FcPatternDestroy +extern __typeof (FcPatternDestroy) FcPatternDestroy __attribute((alias("IA__FcPatternDestroy"), visibility("default"))); +# undef FcPatternEqual +extern __typeof (FcPatternEqual) FcPatternEqual __attribute((alias("IA__FcPatternEqual"), visibility("default"))); +# undef FcPatternEqualSubset +extern __typeof (FcPatternEqualSubset) FcPatternEqualSubset __attribute((alias("IA__FcPatternEqualSubset"), visibility("default"))); +# undef FcPatternHash +extern __typeof (FcPatternHash) FcPatternHash __attribute((alias("IA__FcPatternHash"), visibility("default"))); +# undef FcPatternAdd +extern __typeof (FcPatternAdd) FcPatternAdd __attribute((alias("IA__FcPatternAdd"), visibility("default"))); +# undef FcPatternAddWeak +extern __typeof (FcPatternAddWeak) FcPatternAddWeak __attribute((alias("IA__FcPatternAddWeak"), visibility("default"))); +# undef FcPatternGet +extern __typeof (FcPatternGet) FcPatternGet __attribute((alias("IA__FcPatternGet"), visibility("default"))); +# undef FcPatternDel +extern __typeof (FcPatternDel) FcPatternDel __attribute((alias("IA__FcPatternDel"), visibility("default"))); +# undef FcPatternRemove +extern __typeof (FcPatternRemove) FcPatternRemove __attribute((alias("IA__FcPatternRemove"), visibility("default"))); +# undef FcPatternAddInteger +extern __typeof (FcPatternAddInteger) FcPatternAddInteger __attribute((alias("IA__FcPatternAddInteger"), visibility("default"))); +# undef FcPatternAddDouble +extern __typeof (FcPatternAddDouble) FcPatternAddDouble __attribute((alias("IA__FcPatternAddDouble"), visibility("default"))); +# undef FcPatternAddString +extern __typeof (FcPatternAddString) FcPatternAddString __attribute((alias("IA__FcPatternAddString"), visibility("default"))); +# undef FcPatternAddMatrix +extern __typeof (FcPatternAddMatrix) FcPatternAddMatrix __attribute((alias("IA__FcPatternAddMatrix"), visibility("default"))); +# undef FcPatternAddCharSet +extern __typeof (FcPatternAddCharSet) FcPatternAddCharSet __attribute((alias("IA__FcPatternAddCharSet"), visibility("default"))); +# undef FcPatternAddBool +extern __typeof (FcPatternAddBool) FcPatternAddBool __attribute((alias("IA__FcPatternAddBool"), visibility("default"))); +# undef FcPatternAddLangSet +extern __typeof (FcPatternAddLangSet) FcPatternAddLangSet __attribute((alias("IA__FcPatternAddLangSet"), visibility("default"))); +# undef FcPatternAddRange +extern __typeof (FcPatternAddRange) FcPatternAddRange __attribute((alias("IA__FcPatternAddRange"), visibility("default"))); +# undef FcPatternGetInteger +extern __typeof (FcPatternGetInteger) FcPatternGetInteger __attribute((alias("IA__FcPatternGetInteger"), visibility("default"))); +# undef FcPatternGetDouble +extern __typeof (FcPatternGetDouble) FcPatternGetDouble __attribute((alias("IA__FcPatternGetDouble"), visibility("default"))); +# undef FcPatternGetString +extern __typeof (FcPatternGetString) FcPatternGetString __attribute((alias("IA__FcPatternGetString"), visibility("default"))); +# undef FcPatternGetMatrix +extern __typeof (FcPatternGetMatrix) FcPatternGetMatrix __attribute((alias("IA__FcPatternGetMatrix"), visibility("default"))); +# undef FcPatternGetCharSet +extern __typeof (FcPatternGetCharSet) FcPatternGetCharSet __attribute((alias("IA__FcPatternGetCharSet"), visibility("default"))); +# undef FcPatternGetBool +extern __typeof (FcPatternGetBool) FcPatternGetBool __attribute((alias("IA__FcPatternGetBool"), visibility("default"))); +# undef FcPatternGetLangSet +extern __typeof (FcPatternGetLangSet) FcPatternGetLangSet __attribute((alias("IA__FcPatternGetLangSet"), visibility("default"))); +# undef FcPatternGetRange +extern __typeof (FcPatternGetRange) FcPatternGetRange __attribute((alias("IA__FcPatternGetRange"), visibility("default"))); +# undef FcPatternVaBuild +extern __typeof (FcPatternVaBuild) FcPatternVaBuild __attribute((alias("IA__FcPatternVaBuild"), visibility("default"))); +# undef FcPatternBuild +extern __typeof (FcPatternBuild) FcPatternBuild __attribute((alias("IA__FcPatternBuild"), visibility("default"))); +#endif /* __fcpat__ */ +#ifdef __fcformat__ +# undef FcPatternFormat +extern __typeof (FcPatternFormat) FcPatternFormat __attribute((alias("IA__FcPatternFormat"), visibility("default"))); +#endif /* __fcformat__ */ +#ifdef __fcrange__ +# undef FcRangeCreateDouble +extern __typeof (FcRangeCreateDouble) FcRangeCreateDouble __attribute((alias("IA__FcRangeCreateDouble"), visibility("default"))); +# undef FcRangeCreateInteger +extern __typeof (FcRangeCreateInteger) FcRangeCreateInteger __attribute((alias("IA__FcRangeCreateInteger"), visibility("default"))); +# undef FcRangeDestroy +extern __typeof (FcRangeDestroy) FcRangeDestroy __attribute((alias("IA__FcRangeDestroy"), visibility("default"))); +# undef FcRangeCopy +extern __typeof (FcRangeCopy) FcRangeCopy __attribute((alias("IA__FcRangeCopy"), visibility("default"))); +# undef FcRangeGetDouble +extern __typeof (FcRangeGetDouble) FcRangeGetDouble __attribute((alias("IA__FcRangeGetDouble"), visibility("default"))); +#endif /* __fcrange__ */ +#ifdef __fcweight__ +# undef FcWeightFromOpenType +extern __typeof (FcWeightFromOpenType) FcWeightFromOpenType __attribute((alias("IA__FcWeightFromOpenType"), visibility("default"))); +# undef FcWeightToOpenType +extern __typeof (FcWeightToOpenType) FcWeightToOpenType __attribute((alias("IA__FcWeightToOpenType"), visibility("default"))); +#endif /* __fcweight__ */ +#ifdef __fcstr__ +# undef FcStrCopy +extern __typeof (FcStrCopy) FcStrCopy __attribute((alias("IA__FcStrCopy"), visibility("default"))); +# undef FcStrCopyFilename +extern __typeof (FcStrCopyFilename) FcStrCopyFilename __attribute((alias("IA__FcStrCopyFilename"), visibility("default"))); +# undef FcStrPlus +extern __typeof (FcStrPlus) FcStrPlus __attribute((alias("IA__FcStrPlus"), visibility("default"))); +# undef FcStrFree +extern __typeof (FcStrFree) FcStrFree __attribute((alias("IA__FcStrFree"), visibility("default"))); +# undef FcStrDowncase +extern __typeof (FcStrDowncase) FcStrDowncase __attribute((alias("IA__FcStrDowncase"), visibility("default"))); +# undef FcStrCmpIgnoreCase +extern __typeof (FcStrCmpIgnoreCase) FcStrCmpIgnoreCase __attribute((alias("IA__FcStrCmpIgnoreCase"), visibility("default"))); +# undef FcStrCmp +extern __typeof (FcStrCmp) FcStrCmp __attribute((alias("IA__FcStrCmp"), visibility("default"))); +# undef FcStrStrIgnoreCase +extern __typeof (FcStrStrIgnoreCase) FcStrStrIgnoreCase __attribute((alias("IA__FcStrStrIgnoreCase"), visibility("default"))); +# undef FcStrStr +extern __typeof (FcStrStr) FcStrStr __attribute((alias("IA__FcStrStr"), visibility("default"))); +# undef FcUtf8ToUcs4 +extern __typeof (FcUtf8ToUcs4) FcUtf8ToUcs4 __attribute((alias("IA__FcUtf8ToUcs4"), visibility("default"))); +# undef FcUtf8Len +extern __typeof (FcUtf8Len) FcUtf8Len __attribute((alias("IA__FcUtf8Len"), visibility("default"))); +# undef FcUcs4ToUtf8 +extern __typeof (FcUcs4ToUtf8) FcUcs4ToUtf8 __attribute((alias("IA__FcUcs4ToUtf8"), visibility("default"))); +# undef FcUtf16ToUcs4 +extern __typeof (FcUtf16ToUcs4) FcUtf16ToUcs4 __attribute((alias("IA__FcUtf16ToUcs4"), visibility("default"))); +# undef FcUtf16Len +extern __typeof (FcUtf16Len) FcUtf16Len __attribute((alias("IA__FcUtf16Len"), visibility("default"))); +# undef FcStrDirname +extern __typeof (FcStrDirname) FcStrDirname __attribute((alias("IA__FcStrDirname"), visibility("default"))); +# undef FcStrBasename +extern __typeof (FcStrBasename) FcStrBasename __attribute((alias("IA__FcStrBasename"), visibility("default"))); +# undef FcStrSetCreate +extern __typeof (FcStrSetCreate) FcStrSetCreate __attribute((alias("IA__FcStrSetCreate"), visibility("default"))); +# undef FcStrSetMember +extern __typeof (FcStrSetMember) FcStrSetMember __attribute((alias("IA__FcStrSetMember"), visibility("default"))); +# undef FcStrSetEqual +extern __typeof (FcStrSetEqual) FcStrSetEqual __attribute((alias("IA__FcStrSetEqual"), visibility("default"))); +# undef FcStrSetAdd +extern __typeof (FcStrSetAdd) FcStrSetAdd __attribute((alias("IA__FcStrSetAdd"), visibility("default"))); +# undef FcStrSetAddFilename +extern __typeof (FcStrSetAddFilename) FcStrSetAddFilename __attribute((alias("IA__FcStrSetAddFilename"), visibility("default"))); +# undef FcStrSetDel +extern __typeof (FcStrSetDel) FcStrSetDel __attribute((alias("IA__FcStrSetDel"), visibility("default"))); +# undef FcStrSetDestroy +extern __typeof (FcStrSetDestroy) FcStrSetDestroy __attribute((alias("IA__FcStrSetDestroy"), visibility("default"))); +# undef FcStrListCreate +extern __typeof (FcStrListCreate) FcStrListCreate __attribute((alias("IA__FcStrListCreate"), visibility("default"))); +# undef FcStrListFirst +extern __typeof (FcStrListFirst) FcStrListFirst __attribute((alias("IA__FcStrListFirst"), visibility("default"))); +# undef FcStrListNext +extern __typeof (FcStrListNext) FcStrListNext __attribute((alias("IA__FcStrListNext"), visibility("default"))); +# undef FcStrListDone +extern __typeof (FcStrListDone) FcStrListDone __attribute((alias("IA__FcStrListDone"), visibility("default"))); +#endif /* __fcstr__ */ +#ifdef __fcxml__ +# undef FcConfigParseAndLoad +extern __typeof (FcConfigParseAndLoad) FcConfigParseAndLoad __attribute((alias("IA__FcConfigParseAndLoad"), visibility("default"))); +#endif /* __fcxml__ */ +#ifdef __fccfg__ +# undef FcConfigGetRescanInverval +extern __typeof (FcConfigGetRescanInverval) FcConfigGetRescanInverval __attribute((alias("IA__FcConfigGetRescanInverval"), visibility("default"))); +# undef FcConfigSetRescanInverval +extern __typeof (FcConfigSetRescanInverval) FcConfigSetRescanInverval __attribute((alias("IA__FcConfigSetRescanInverval"), visibility("default"))); +#endif /* */ +#endif /* HAVE_GNUC_ATTRIBUTE */ diff --git a/static/custom-include/fontconfig/fcftalias.h b/static/custom-include/fontconfig/fcftalias.h new file mode 100644 index 000000000..884eb4b2e --- /dev/null +++ b/static/custom-include/fontconfig/fcftalias.h @@ -0,0 +1,12 @@ +extern __typeof (FcFreeTypeCharIndex) IA__FcFreeTypeCharIndex __attribute((visibility("hidden"))); +#define FcFreeTypeCharIndex IA__FcFreeTypeCharIndex +extern __typeof (FcFreeTypeCharSetAndSpacing) IA__FcFreeTypeCharSetAndSpacing __attribute((visibility("hidden"))); +#define FcFreeTypeCharSetAndSpacing IA__FcFreeTypeCharSetAndSpacing +extern __typeof (FcFreeTypeCharSet) IA__FcFreeTypeCharSet __attribute((visibility("hidden"))); +#define FcFreeTypeCharSet IA__FcFreeTypeCharSet +extern __typeof (FcPatternGetFTFace) IA__FcPatternGetFTFace __attribute((visibility("hidden"))); +#define FcPatternGetFTFace IA__FcPatternGetFTFace +extern __typeof (FcPatternAddFTFace) IA__FcPatternAddFTFace __attribute((visibility("hidden"))); +#define FcPatternAddFTFace IA__FcPatternAddFTFace +extern __typeof (FcFreeTypeQueryFace) IA__FcFreeTypeQueryFace __attribute((visibility("hidden"))); +#define FcFreeTypeQueryFace IA__FcFreeTypeQueryFace diff --git a/static/custom-include/fontconfig/fcftaliastail.h b/static/custom-include/fontconfig/fcftaliastail.h new file mode 100644 index 000000000..f5a537d9c --- /dev/null +++ b/static/custom-include/fontconfig/fcftaliastail.h @@ -0,0 +1,20 @@ +#if HAVE_GNUC_ATTRIBUTE +#ifdef __fcfreetype__ +# undef FcFreeTypeCharIndex +extern __typeof (FcFreeTypeCharIndex) FcFreeTypeCharIndex __attribute((alias("IA__FcFreeTypeCharIndex"), visibility("default"))); +# undef FcFreeTypeCharSetAndSpacing +extern __typeof (FcFreeTypeCharSetAndSpacing) FcFreeTypeCharSetAndSpacing __attribute((alias("IA__FcFreeTypeCharSetAndSpacing"), visibility("default"))); +# undef FcFreeTypeCharSet +extern __typeof (FcFreeTypeCharSet) FcFreeTypeCharSet __attribute((alias("IA__FcFreeTypeCharSet"), visibility("default"))); +#endif /* __fcfreetype__ */ +#ifdef __fcpat__ +# undef FcPatternGetFTFace +extern __typeof (FcPatternGetFTFace) FcPatternGetFTFace __attribute((alias("IA__FcPatternGetFTFace"), visibility("default"))); +# undef FcPatternAddFTFace +extern __typeof (FcPatternAddFTFace) FcPatternAddFTFace __attribute((alias("IA__FcPatternAddFTFace"), visibility("default"))); +#endif /* __fcpat__ */ +#ifdef __fcfreetype__ +# undef FcFreeTypeQueryFace +extern __typeof (FcFreeTypeQueryFace) FcFreeTypeQueryFace __attribute((alias("IA__FcFreeTypeQueryFace"), visibility("default"))); +#endif /* */ +#endif /* HAVE_GNUC_ATTRIBUTE */ diff --git a/static/custom-include/glib/config.h b/static/custom-include/glib/config.h new file mode 100644 index 000000000..63c826b7a --- /dev/null +++ b/static/custom-include/glib/config.h @@ -0,0 +1,795 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* The normal alignment of `guint32', in bytes. */ +#define ALIGNOF_GUINT32 4 + +/* The normal alignment of `guint64', in bytes. */ +#define ALIGNOF_GUINT64 8 + +/* The normal alignment of `unsigned long', in bytes. */ +#define ALIGNOF_UNSIGNED_LONG 8 + +/* poll doesn't work on devices */ +/* #undef BROKEN_POLL */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Whether to disable memory pools */ +/* #undef DISABLE_MEM_POOLS */ + +/* Whether to enable GC friendliness by default */ +/* #undef ENABLE_GC_FRIENDLY_DEFAULT */ + +/* always defined to indicate that i18n is enabled */ +#define ENABLE_NLS 1 + +/* Define the gettext package to be used */ +#define GETTEXT_PACKAGE "glib20" + +/* Define to the GLIB binary age */ +#define GLIB_BINARY_AGE 5002 + +/* Define to the GLIB interface age */ +#define GLIB_INTERFACE_AGE 2 + +/* Define the location where the catalogs will be installed */ +#define GLIB_LOCALE_DIR "/usr/local/share/locale" + +/* Define to the GLIB major version */ +#define GLIB_MAJOR_VERSION 2 + +/* Define to the GLIB micro version */ +#define GLIB_MICRO_VERSION 2 + +/* Define to the GLIB minor version */ +#define GLIB_MINOR_VERSION 50 + +/* A 'va_copy' style function */ +#define G_VA_COPY va_copy + +/* 'va_lists' cannot be copies as values */ +#define G_VA_COPY_AS_ARRAY 1 + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#define HAVE_ALLOCA_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ATTR_XATTR_H */ + +/* Define to 1 if you have the `bind_textdomain_codeset' function. */ +#define HAVE_BIND_TEXTDOMAIN_CODESET 1 + +/* Define if you have a version of the snprintf function with semantics as + specified by the ISO C99 standard. */ +#define HAVE_C99_SNPRINTF 1 + +/* Define if you have a version of the vsnprintf function with semantics as + specified by the ISO C99 standard. */ +#define HAVE_C99_VSNPRINTF 1 + +/* define to 1 if Carbon is available */ +/* #undef HAVE_CARBON */ + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* define to 1 if Cocoa is available */ +/* #undef HAVE_COCOA */ + +/* Have nl_langinfo (CODESET) */ +#define HAVE_CODESET 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CRT_EXTERNS_H */ + +/* Define if dbus-1 is available */ +/* #undef HAVE_DBUS1 */ + +/* Define to 1 if you have the `dcgettext' function. */ +#define HAVE_DCGETTEXT 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if using dtrace probes. */ +/* #undef HAVE_DTRACE */ + +/* Define to 1 if you have the `endmntent' function. */ +#define HAVE_ENDMNTENT 1 + +/* Define to 1 if you have the `endservent' function. */ +#define HAVE_ENDSERVENT 1 + +/* we have the eventfd(2) system call */ +#define HAVE_EVENTFD 1 + +/* Define to 1 if you have the `fallocate' function. */ +#define HAVE_FALLOCATE 1 + +/* Define if we have FAM */ +/* #undef HAVE_FAM */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_FAM_H */ + +/* Define if we have FAMNoExists in fam */ +/* #undef HAVE_FAM_NO_EXISTS */ + +/* Define to 1 if you have the `fchmod' function. */ +#define HAVE_FCHMOD 1 + +/* Define to 1 if you have the `fchown' function. */ +#define HAVE_FCHOWN 1 + +/* Define to 1 if you have the `fdwalk' function. */ +/* #undef HAVE_FDWALK */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FSTAB_H 1 + +/* Define to 1 if you have the `fsync' function. */ +#define HAVE_FSYNC 1 + +/* we have the futex(2) system call */ +#define HAVE_FUTEX 1 + +/* Define to 1 if you have the `getc_unlocked' function. */ +#define HAVE_GETC_UNLOCKED 1 + +/* Define to 1 if you have the `getfsstat' function. */ +/* #undef HAVE_GETFSSTAT */ + +/* Define to 1 if you have the `getgrgid_r' function. */ +#define HAVE_GETGRGID_R 1 + +/* Define to 1 if you have the `getmntent_r' function. */ +#define HAVE_GETMNTENT_R 1 + +/* Define to 1 if you have the `getprotobyname_r' function. */ +#define HAVE_GETPROTOBYNAME_R 1 + +/* Define to 1 if you have the `getpwuid_r' function. */ +#define HAVE_GETPWUID_R 1 + +/* Define to 1 if you have the `getresuid' function. */ +#define HAVE_GETRESUID 1 + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#define HAVE_GETTEXT 1 + +/* Define to 1 if you have the `getvfsstat' function. */ +/* #undef HAVE_GETVFSSTAT */ + +/* Define to 1 if you have the `gmtime_r' function. */ +#define HAVE_GMTIME_R 1 + +/* define to use system printf */ +#define HAVE_GOOD_PRINTF 1 + +/* Define to 1 if you have the `hasmntopt' function. */ +#define HAVE_HASMNTOPT 1 + +/* Define to 1 if you have the `if_indextoname' function. */ +#define HAVE_IF_INDEXTONAME 1 + +/* Define to 1 if you have the `if_nametoindex' function. */ +#define HAVE_IF_NAMETOINDEX 1 + +/* Define to 1 if you have the `inotify_init1' function. */ +#define HAVE_INOTIFY_INIT1 1 + +/* define to support printing 64-bit integers with format I64 */ +/* #undef HAVE_INT64_AND_I64 */ + +/* Define if you have the 'intmax_t' type in or . */ +#define HAVE_INTMAX_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if exists, doesn't clash with , and + declares uintmax_t. */ +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 + +/* Define if we have struct ip_mreqn */ +#define HAVE_IP_MREQN /**/ + +/* Define to 1 if you have the `issetugid' function. */ +/* #undef HAVE_ISSETUGID */ + +/* Define to 1 if you have the `kevent' function. */ +/* #undef HAVE_KEVENT */ + +/* Define to 1 if you have the `kqueue' function. */ +/* #undef HAVE_KQUEUE */ + +/* Define if you have and nl_langinfo(CODESET). */ +#define HAVE_LANGINFO_CODESET 1 + +/* Have nl_langinfo (_NL_CTYPE_OUTDIGITn_MB) */ +#define HAVE_LANGINFO_OUTDIGIT 1 + +/* Have nl_langinfo (PM_STR) */ +#define HAVE_LANGINFO_TIME 1 + +/* Define to 1 if you have the `lchmod' function. */ +/* #undef HAVE_LCHMOD */ + +/* Define to 1 if you have the `lchown' function. */ +#define HAVE_LCHOWN 1 + +/* Define if your file defines LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define if you have the __libc_enable_secure variable (GNU libc, eglibc) */ +#define HAVE_LIBC_ENABLE_SECURE 1 + +/* Define if libelf is available */ +/* #undef HAVE_LIBELF */ + +/* Define if libmount is available */ +/* #undef HAVE_LIBMOUNT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LINUX_MAGIC_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the `localtime_r' function. */ +#define HAVE_LOCALTIME_R 1 + +/* Define if you have the 'long double' type. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define if you have the 'long long' type. */ +#define HAVE_LONG_LONG 1 + +/* define if system printf can print long long */ +#define HAVE_LONG_LONG_FORMAT 1 + +/* Define to 1 if you have the `lstat' function. */ +#define HAVE_LSTAT 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_MACH_TIME_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the `mbrtowc' function. */ +#define HAVE_MBRTOWC 1 + +/* Define to 1 if you have the `memalign' function. */ +#define HAVE_MEMALIGN 1 + +/* Define to 1 if you have the `memmem' function. */ +#define HAVE_MEMMEM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mmap' function. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MNTENT_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* We have AF_NETLINK sockets */ +#define HAVE_NETLINK 1 + +/* Define to 1 if you have the `newlocale' function. */ +#define HAVE_NEWLOCALE 1 + +/* open option O_DIRECTORY */ +#define HAVE_OPEN_O_DIRECTORY 1 + +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + +/* Define to 1 if you have the `poll' function. */ +#define HAVE_POLL 1 + +/* Define to 1 if you have the `posix_memalign' function. */ +#define HAVE_POSIX_MEMALIGN 1 + +/* Define to 1 if you have the `prlimit' function. */ +#define HAVE_PRLIMIT 1 + +/* Have function pthread_attr_setstacksize */ +#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 + +/* Have function pthread_condattr_setclock */ +#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1 + +/* Have function pthread_cond_timedwait_relative_np */ +/* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */ + +/* Have function pthread_setname_np(const char*) */ +/* #undef HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID */ + +/* Have function pthread_setname_np(pthread_t, const char*) */ +#define HAVE_PTHREAD_SETNAME_NP_WITH_TID 1 + +/* Define to 1 if the system has the type `ptrdiff_t'. */ +#define HAVE_PTRDIFF_T 1 + +/* Define to 1 if you have the `readlink' function. */ +#define HAVE_READLINK 1 + +/* Define to 1 if you have the `recvmmsg' function. */ +#define HAVE_RECVMMSG 1 + +/* Define to 1 if you have the 'res_init' function. */ +#define HAVE_RES_INIT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if libselinux is available */ +#define HAVE_SELINUX 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SELINUX_SELINUX_H 1 + +/* Define to 1 if you have the `sendmmsg' function. */ +#define HAVE_SENDMMSG 1 + +/* Define to 1 if you have the `setenv' function. */ +#define HAVE_SETENV 1 + +/* Define to 1 if you have the `setmntent' function. */ +#define HAVE_SETMNTENT 1 + +/* Define if you have the 'sig_atomic_t' type. */ +#define HAVE_SIG_ATOMIC_T 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `splice' function. */ +#define HAVE_SPLICE 1 + +/* Define to 1 if you have the `statfs' function. */ +#define HAVE_STATFS 1 + +/* Define to 1 if you have the `statvfs' function. */ +#define HAVE_STATVFS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define if exists, doesn't clash with , and declares + uintmax_t. */ +#define HAVE_STDINT_H_WITH_UINTMAX 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `stpcpy' function. */ +#define HAVE_STPCPY 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strerror_r' function. */ +#define HAVE_STRERROR_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Have functions strlcpy and strlcat */ +/* #undef HAVE_STRLCPY */ + +/* Define to 1 if you have the `strncasecmp' function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + +/* Define to 1 if you have the `strtod_l' function. */ +#define HAVE_STRTOD_L 1 + +/* Define to 1 if you have the `strtoll_l' function. */ +#define HAVE_STRTOLL_L 1 + +/* Define to 1 if you have the `strtoull_l' function. */ +#define HAVE_STRTOULL_L 1 + +/* Define to 1 if `d_type' is a member of `struct dirent'. */ +#define HAVE_STRUCT_DIRENT_D_TYPE 1 + +/* Define to 1 if `f_bavail' is a member of `struct statfs'. */ +#define HAVE_STRUCT_STATFS_F_BAVAIL 1 + +/* Define to 1 if `f_fstypename' is a member of `struct statfs'. */ +/* #undef HAVE_STRUCT_STATFS_F_FSTYPENAME */ + +/* Define to 1 if `f_basetype' is a member of `struct statvfs'. */ +/* #undef HAVE_STRUCT_STATVFS_F_BASETYPE */ + +/* Define to 1 if `f_fstypename' is a member of `struct statvfs'. */ +/* #undef HAVE_STRUCT_STATVFS_F_FSTYPENAME */ + +/* Define to 1 if `st_atimensec' is a member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_ATIMENSEC */ + +/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 + +/* Define to 1 if `st_birthtim' is a member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_BIRTHTIM */ + +/* Define to 1 if `st_birthtime' is a member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_BIRTHTIME */ + +/* Define to 1 if `st_birthtimensec' is a member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC */ + +/* Define to 1 if `st_birthtim.tv_nsec' is a member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC */ + +/* Define to 1 if `st_blksize' is a member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 + +/* Define to 1 if `st_blocks' is a member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_BLOCKS 1 + +/* Define to 1 if `st_ctimensec' is a member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_CTIMENSEC */ + +/* Define to 1 if `st_ctim.tv_nsec' is a member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC 1 + +/* Define to 1 if `st_mtimensec' is a member of `struct stat'. */ +/* #undef HAVE_STRUCT_STAT_ST_MTIMENSEC */ + +/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */ +#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 + +/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */ +#define HAVE_STRUCT_TM_TM_GMTOFF 1 + +/* Define to 1 if `__tm_gmtoff' is a member of `struct tm'. */ +/* #undef HAVE_STRUCT_TM___TM_GMTOFF */ + +/* Define to 1 if you have the `symlink' function. */ +#define HAVE_SYMLINK 1 + +/* Define to 1 if you have the `sysctlbyname' function. */ +/* #undef HAVE_SYSCTLBYNAME */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_EVENT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_FILIO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_INOTIFY_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MNTCTL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MNTTAB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MOUNT_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* found fd_set in sys/select.h */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STATFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STATVFS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_VFSTAB_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_VFS_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_VMOUNT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_XATTR_H 1 + +/* Define to 1 if you have the `timegm' function. */ +#define HAVE_TIMEGM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if your printf function family supports positional parameters as + specified by Unix98. */ +#define HAVE_UNIX98_PRINTF 1 + +/* Define to 1 if you have the `unsetenv' function. */ +#define HAVE_UNSETENV 1 + +/* Define to 1 if you have the `uselocale' function. */ +#define HAVE_USELOCALE 1 + +/* Define to 1 if you have the `utimes' function. */ +#define HAVE_UTIMES 1 + +/* Define to 1 if you have the `valloc' function. */ +#define HAVE_VALLOC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_VALUES_H 1 + +/* Define to 1 if you have the `vasprintf' function. */ +#define HAVE_VASPRINTF 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Define if you have the 'wchar_t' type. */ +#define HAVE_WCHAR_T 1 + +/* Define to 1 if you have the `wcrtomb' function. */ +#define HAVE_WCRTOMB 1 + +/* Define to 1 if you have the `wcslen' function. */ +#define HAVE_WCSLEN 1 + +/* Define to 1 if you have the `wcsnlen' function. */ +#define HAVE_WCSNLEN 1 + +/* Define if you have the 'wint_t' type. */ +#define HAVE_WINT_T 1 + +/* Define to 1 if xattr is available */ +#define HAVE_XATTR 1 + +/* Define to 1 if xattr API uses XATTR_NOFOLLOW */ +/* #undef HAVE_XATTR_NOFOLLOW */ + +/* Define to 1 if you have the header file. */ +#define HAVE_XLOCALE_H 1 + +/* Define to 1 if you have the `_NSGetEnviron' function. */ +/* #undef HAVE__NSGETENVIRON */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Define to 1 if `major', `minor', and `makedev' are declared in . + */ +/* #undef MAJOR_IN_MKDEV */ + +/* Define to 1 if `major', `minor', and `makedev' are declared in + . */ +/* #undef MAJOR_IN_SYSMACROS */ + +/* didn't find fd_set */ +/* #undef NO_FD_SET */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=glib" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "glib" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "glib 2.50.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "glib" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.50.2" + +/* define if posix_memalign() can allocate any size */ +#define POSIX_MEMALIGN_WITH_COMPLIANT_ALLOCS 1 + +/* The size of `char', as computed by sizeof. */ +#define SIZEOF_CHAR 1 + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `short', as computed by sizeof. */ +#define SIZEOF_SHORT 2 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* The size of `ssize_t', as computed by sizeof. */ +#define SIZEOF_SSIZE_T 8 + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 8 + +/* The size of `__int64', as computed by sizeof. */ +#define SIZEOF___INT64 0 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Number of arguments to statfs() */ +#define STATFS_ARGS 2 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Use no threads */ +/* #undef THREADS_NONE */ + +/* Use pthreads */ +#define THREADS_POSIX 1 + +/* Use w32 threads */ +/* #undef THREADS_WIN32 */ + +/* Using GNU libiconv */ +/* #undef USE_LIBICONV_GNU */ + +/* Using a native implementation of iconv in a separate library */ +/* #undef USE_LIBICONV_NATIVE */ + +/* Define to use statfs() */ +#define USE_STATFS 1 + +/* Define to use statvfs() */ +/* #undef USE_STATVFS */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* using the system-supplied PCRE library */ +/* #undef USE_SYSTEM_PCRE */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* defines how to decorate public symbols while building */ +#define _GLIB_EXTERN __attribute__((visibility("default"))) extern + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Target the Windows XP API */ +/* #undef _WIN32_WINNT */ + +/* Needed to get declarations for msg_control and msg_controllen on Solaris */ +/* #undef _XOPEN_SOURCE */ + +/* Needed to get declarations for msg_control and msg_controllen on Solaris */ +/* #undef _XOPEN_SOURCE_EXTENDED */ + +/* Needed to get declarations for msg_control and msg_controllen on Solaris */ +#define __EXTENSIONS__ 1 + +/* compiler supports atomic operations */ +/* #undef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to long or long long if and don't define. */ +/* #undef intmax_t */ + +/* Define to empty if the C compiler doesn't support this keyword. */ +/* #undef signed */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/static/custom-include/glib/glibconfig.h b/static/custom-include/glib/glibconfig.h new file mode 100644 index 000000000..33377c3e6 --- /dev/null +++ b/static/custom-include/glib/glibconfig.h @@ -0,0 +1,196 @@ +/* glibconfig.h + * + * This is a generated file. Please modify 'configure.ac' + */ + +#ifndef __GLIBCONFIG_H__ +#define __GLIBCONFIG_H__ + +#include + +#include +#include +#define GLIB_HAVE_ALLOCA_H + +/* Specifies that GLib's g_print*() functions wrap the + * system printf functions. This is useful to know, for example, + * when using glibc's register_printf_function(). + */ +#define GLIB_USING_SYSTEM_PRINTF + +G_BEGIN_DECLS + +#define G_MINFLOAT FLT_MIN +#define G_MAXFLOAT FLT_MAX +#define G_MINDOUBLE DBL_MIN +#define G_MAXDOUBLE DBL_MAX +#define G_MINSHORT SHRT_MIN +#define G_MAXSHORT SHRT_MAX +#define G_MAXUSHORT USHRT_MAX +#define G_MININT INT_MIN +#define G_MAXINT INT_MAX +#define G_MAXUINT UINT_MAX +#define G_MINLONG LONG_MIN +#define G_MAXLONG LONG_MAX +#define G_MAXULONG ULONG_MAX + +typedef signed char gint8; +typedef unsigned char guint8; +typedef signed short gint16; +typedef unsigned short guint16; +#define G_GINT16_MODIFIER "h" +#define G_GINT16_FORMAT "hi" +#define G_GUINT16_FORMAT "hu" +typedef signed int gint32; +typedef unsigned int guint32; +#define G_GINT32_MODIFIER "" +#define G_GINT32_FORMAT "i" +#define G_GUINT32_FORMAT "u" +#define G_HAVE_GINT64 1 /* deprecated, always true */ + +typedef signed long gint64; +typedef unsigned long guint64; + +#define G_GINT64_CONSTANT(val) (val##L) +#define G_GUINT64_CONSTANT(val) (val##UL) +#define G_GINT64_MODIFIER "l" +#define G_GINT64_FORMAT "li" +#define G_GUINT64_FORMAT "lu" + +#define GLIB_SIZEOF_VOID_P 8 +#define GLIB_SIZEOF_LONG 8 +#define GLIB_SIZEOF_SIZE_T 8 +#define GLIB_SIZEOF_SSIZE_T 8 + +typedef signed long gssize; +typedef unsigned long gsize; +#define G_GSIZE_MODIFIER "l" +#define G_GSSIZE_MODIFIER "l" +#define G_GSIZE_FORMAT "lu" +#define G_GSSIZE_FORMAT "li" + +#define G_MAXSIZE G_MAXULONG +#define G_MINSSIZE G_MINLONG +#define G_MAXSSIZE G_MAXLONG + +typedef gint64 goffset; +#define G_MINOFFSET G_MININT64 +#define G_MAXOFFSET G_MAXINT64 + +#define G_GOFFSET_MODIFIER G_GINT64_MODIFIER +#define G_GOFFSET_FORMAT G_GINT64_FORMAT +#define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val) + +#define G_POLLFD_FORMAT "%d" + + +#define GPOINTER_TO_INT(p) ((gint) (glong) (p)) +#define GPOINTER_TO_UINT(p) ((guint) (gulong) (p)) + +#define GINT_TO_POINTER(i) ((gpointer) (glong) (i)) +#define GUINT_TO_POINTER(u) ((gpointer) (gulong) (u)) + +typedef signed long gintptr; +typedef unsigned long guintptr; + +#define G_GINTPTR_MODIFIER "l" +#define G_GINTPTR_FORMAT "li" +#define G_GUINTPTR_FORMAT "lu" +#ifndef G_DISABLE_DEPRECATED +#define g_ATEXIT(proc) (atexit (proc)) +#define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END +#endif + +#define GLIB_MAJOR_VERSION 2 +#define GLIB_MINOR_VERSION 50 +#define GLIB_MICRO_VERSION 2 + +#define G_OS_UNIX + + +#define G_VA_COPY va_copy +#define G_VA_COPY_AS_ARRAY 1 + +#ifndef __cplusplus +# define G_HAVE_ISO_VARARGS 1 +#endif +#ifdef __cplusplus +# define G_HAVE_ISO_VARARGS 1 +#endif + +/* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi + * is passed ISO vararg support is turned off, and there is no work + * around to turn it on, so we unconditionally turn it off. + */ +#if __GNUC__ == 2 && __GNUC_MINOR__ == 95 +# undef G_HAVE_ISO_VARARGS +#endif + +#define G_HAVE_GNUC_VARARGS 1 +#define G_HAVE_GROWING_STACK 0 + +#define G_HAVE_GNUC_VISIBILITY 1 +#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) +#define G_GNUC_INTERNAL __attribute__((visibility("hidden"))) +#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) +#define G_GNUC_INTERNAL __hidden +#elif defined (__GNUC__) && defined (G_HAVE_GNUC_VISIBILITY) +#define G_GNUC_INTERNAL __attribute__((visibility("hidden"))) +#else +#define G_GNUC_INTERNAL +#endif + +#define G_THREADS_ENABLED +#define G_THREADS_IMPL_POSIX + +#define G_ATOMIC_LOCK_FREE + +#define GINT16_TO_LE(val) ((gint16) (val)) +#define GUINT16_TO_LE(val) ((guint16) (val)) +#define GINT16_TO_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val)) +#define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) +#define GINT32_TO_LE(val) ((gint32) (val)) +#define GUINT32_TO_LE(val) ((guint32) (val)) +#define GINT32_TO_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val)) +#define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val)) +#define GINT64_TO_LE(val) ((gint64) (val)) +#define GUINT64_TO_LE(val) ((guint64) (val)) +#define GINT64_TO_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val)) +#define GUINT64_TO_BE(val) (GUINT64_SWAP_LE_BE (val)) +#define GLONG_TO_LE(val) ((glong) GINT64_TO_LE (val)) +#define GULONG_TO_LE(val) ((gulong) GUINT64_TO_LE (val)) +#define GLONG_TO_BE(val) ((glong) GINT64_TO_BE (val)) +#define GULONG_TO_BE(val) ((gulong) GUINT64_TO_BE (val)) +#define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val)) +#define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val)) +#define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val)) +#define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val)) +#define GSIZE_TO_LE(val) ((gsize) GUINT64_TO_LE (val)) +#define GSSIZE_TO_LE(val) ((gssize) GINT64_TO_LE (val)) +#define GSIZE_TO_BE(val) ((gsize) GUINT64_TO_BE (val)) +#define GSSIZE_TO_BE(val) ((gssize) GINT64_TO_BE (val)) +#define G_BYTE_ORDER G_LITTLE_ENDIAN + +#define GLIB_SYSDEF_POLLIN =1 +#define GLIB_SYSDEF_POLLOUT =4 +#define GLIB_SYSDEF_POLLPRI =2 +#define GLIB_SYSDEF_POLLHUP =16 +#define GLIB_SYSDEF_POLLERR =8 +#define GLIB_SYSDEF_POLLNVAL =32 + +#define G_MODULE_SUFFIX "so" + +typedef int GPid; +#define G_PID_FORMAT "i" + +#define GLIB_SYSDEF_AF_UNIX 1 +#define GLIB_SYSDEF_AF_INET 2 +#define GLIB_SYSDEF_AF_INET6 10 + +#define GLIB_SYSDEF_MSG_OOB 1 +#define GLIB_SYSDEF_MSG_PEEK 2 +#define GLIB_SYSDEF_MSG_DONTROUTE 4 + +G_END_DECLS + +#endif /* __GLIBCONFIG_H__ */ diff --git a/static/custom-include/harfbuzz/config.h b/static/custom-include/harfbuzz/config.h new file mode 100644 index 000000000..adbffa9b9 --- /dev/null +++ b/static/custom-include/harfbuzz/config.h @@ -0,0 +1,203 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* The normal alignment of `struct{char;}', in bytes. */ +#define ALIGNOF_STRUCT_CHAR__ 1 + +/* Define to 1 if you have the `atexit' function. */ +#define HAVE_ATEXIT 1 + +/* Have cairo graphics library */ +#define HAVE_CAIRO 1 + +/* Have cairo-ft support in cairo graphics library */ +#define HAVE_CAIRO_FT 1 + +/* Have Core Text backend */ +/* #undef HAVE_CORETEXT */ + +/* Have DirectWrite library */ +/* #undef HAVE_DIRECTWRITE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DWRITE_H */ + +/* Have simple TrueType Layout backend */ +#define HAVE_FALLBACK 1 + +/* Have fontconfig library */ +#define HAVE_FONTCONFIG 1 + +/* Have FreeType 2 library */ +#define HAVE_FREETYPE 1 + +/* Define to 1 if you have the `FT_Get_Var_Blend_Coordinates' function. */ +/* #undef HAVE_FT_GET_VAR_BLEND_COORDINATES */ + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Have glib2 library */ +#define HAVE_GLIB 1 + +/* Have gobject2 library */ +/* #undef HAVE_GOBJECT */ + +/* Have Graphite2 library */ +/* #undef HAVE_GRAPHITE2 */ + +/* Have ICU library */ +#define HAVE_ICU 1 + +/* Use hb-icu Unicode callbacks */ +/* #undef HAVE_ICU_BUILTIN */ + +/* Have Intel __sync_* atomic primitives */ +#define HAVE_INTEL_ATOMIC_PRIMITIVES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isatty' function. */ +#define HAVE_ISATTY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mmap' function. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the `mprotect' function. */ +#define HAVE_MPROTECT 1 + +/* Have native OpenType Layout backend */ +#define HAVE_OT 1 + +/* Have POSIX threads */ +#define HAVE_PTHREAD 1 + +/* Have PTHREAD_PRIO_INHERIT. */ +#define HAVE_PTHREAD_PRIO_INHERIT 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SCHED_H */ + +/* Have sched_yield */ +/* #undef HAVE_SCHED_YIELD */ + +/* Have Solaris __machine_*_barrier and atomic_* operations */ +/* #undef HAVE_SOLARIS_ATOMIC_OPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `sysconf' function. */ +#define HAVE_SYSCONF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Have UCDN Unicode functions */ +#define HAVE_UCDN 1 + +/* Have Uniscribe library */ +/* #undef HAVE_UNISCRIBE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_USP10_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://github.com/behdad/harfbuzz/issues/new" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "HarfBuzz" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "HarfBuzz 1.4.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "harfbuzz" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "http://harfbuzz.org/" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.4.2" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/static/custom-include/jpeg/config.h b/static/custom-include/jpeg/config.h new file mode 100644 index 000000000..4eb5767b0 --- /dev/null +++ b/static/custom-include/jpeg/config.h @@ -0,0 +1,130 @@ +/* config.h. Generated by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Build number */ +#define BUILD "20131027" + +/* Support arithmetic encoding */ +#define C_ARITH_CODING_SUPPORTED 1 + +/* Support arithmetic decoding */ +#define D_ARITH_CODING_SUPPORTED 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_JNI_H */ + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define if your compiler supports prototypes */ +#define HAVE_PROTOTYPES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if the system has the type `unsigned char'. */ +#define HAVE_UNSIGNED_CHAR 1 + +/* Define to 1 if the system has the type `unsigned short'. */ +#define HAVE_UNSIGNED_SHORT 1 + +/* Compiler does not support pointers to undefined structures. */ +/* #undef INCOMPLETE_TYPES_BROKEN */ + +/* How to obtain function inlining. */ +#define INLINE __attribute__((always_inline)) + +/* libjpeg API version */ +#define JPEG_LIB_VERSION 62 + +/* libjpeg-turbo version */ +#define LIBJPEG_TURBO_VERSION 1.2.1 + +/* Define if you have BSD-like bzero and bcopy */ +/* #undef NEED_BSD_STRINGS */ + +/* Define if you need short function names */ +/* #undef NEED_SHORT_EXTERNAL_NAMES */ + +/* Define if you have sys/types.h */ +#define NEED_SYS_TYPES_H 1 + +/* Name of package */ +#define PACKAGE "libjpeg-turbo" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libjpeg-turbo" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libjpeg-turbo 1.2.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libjpeg-turbo" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.1" + +/* Define if shift is unsigned */ +/* #undef RIGHT_SHIFT_IS_UNSIGNED */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "1.2.1" + +/* Use accelerated SIMD routines. */ +/* #undef WITH_SIMD */ + +/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +/* # undef __CHAR_UNSIGNED__ */ +#endif + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ diff --git a/static/custom-include/jpeg/jconfig.h b/static/custom-include/jpeg/jconfig.h new file mode 100644 index 000000000..07676e4e2 --- /dev/null +++ b/static/custom-include/jpeg/jconfig.h @@ -0,0 +1,58 @@ +/* jconfig.h. Generated by configure. */ +/* Version ID for the JPEG library. + * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". + */ +#define JPEG_LIB_VERSION 62 + +/* libjpeg-turbo version */ +#define LIBJPEG_TURBO_VERSION 1.2.1 + +/* Support arithmetic encoding */ +#define C_ARITH_CODING_SUPPORTED 1 + +/* Support arithmetic decoding */ +#define D_ARITH_CODING_SUPPORTED 1 + +/* Compiler supports function prototypes. */ +#define HAVE_PROTOTYPES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Compiler supports 'unsigned char'. */ +#define HAVE_UNSIGNED_CHAR 1 + +/* Compiler supports 'unsigned short'. */ +#define HAVE_UNSIGNED_SHORT 1 + +/* Compiler does not support pointers to unspecified structures. */ +/* #undef INCOMPLETE_TYPES_BROKEN */ + +/* Compiler has rather than standard . */ +/* #undef NEED_BSD_STRINGS */ + +/* Linker requires that global names be unique in first 15 characters. */ +/* #undef NEED_SHORT_EXTERNAL_NAMES */ + +/* Need to include in order to obtain size_t. */ +#define NEED_SYS_TYPES_H 1 + +/* Broken compiler shifts signed values as an unsigned shift. */ +/* #undef RIGHT_SHIFT_IS_UNSIGNED */ + +/* Use accelerated SIMD routines. */ +/* #undef WITH_SIMD */ + +/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +/* # undef __CHAR_UNSIGNED__ */ +#endif + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/static/custom-include/pango/config.h b/static/custom-include/pango/config.h new file mode 100644 index 000000000..abac4d7fc --- /dev/null +++ b/static/custom-include/pango/config.h @@ -0,0 +1,149 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Have usable Cairo library and font backend */ +#define HAVE_CAIRO 1 + +/* Whether Cairo can use FreeType for fonts */ +#define HAVE_CAIRO_FREETYPE 1 + +/* Whether Cairo has PDF support */ +#define HAVE_CAIRO_PDF 1 + +/* Whether Cairo has PNG support */ +#define HAVE_CAIRO_PNG 1 + +/* Whether Cairo has PS support */ +#define HAVE_CAIRO_PS 1 + +/* Whether Cairo can use Quartz for fonts */ +/* #undef HAVE_CAIRO_QUARTZ */ + +/* Whether Cairo can use the Win32 GDI for fonts */ +/* #undef HAVE_CAIRO_WIN32 */ + +/* Whether Cairo has Xlib support */ +#define HAVE_CAIRO_XLIB 1 + +/* Whether CoreText is available on the system */ +/* #undef HAVE_CORE_TEXT */ + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `FcWeightFromOpenType' function. */ +#define HAVE_FCWEIGHTFROMOPENTYPE 1 + +/* Define to 1 if you have the `flockfile' function. */ +#define HAVE_FLOCKFILE 1 + +/* Have FreeType 2 library */ +#define HAVE_FREETYPE 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Whether libthai is available */ +/* #undef HAVE_LIBTHAI */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtok_r' function. */ +#define HAVE_STRTOK_R 1 + +/* Define to 1 if you have the `sysconf' function. */ +#define HAVE_SYSCONF 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Have Xft library */ +/* #undef HAVE_XFT */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "pango" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=pango" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "pango" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "pango 1.40.3" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "pango" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.40.3" + +/* PANGO binary age */ +#define PANGO_BINARY_AGE 4003 + +/* PANGO interface age */ +#define PANGO_INTERFACE_AGE 3 + +/* PANGO major version */ +#define PANGO_VERSION_MAJOR 1 + +/* PANGO micro version */ +#define PANGO_VERSION_MICRO 3 + +/* PANGO minor version */ +#define PANGO_VERSION_MINOR 40 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "1.40.3" + +/* defines how to decorate public symbols while building */ +#define _PANGO_EXTERN __attribute__((visibility("default"))) extern diff --git a/static/custom-include/pixman/config.h b/static/custom-include/pixman/config.h new file mode 100644 index 000000000..a6d2c02ef --- /dev/null +++ b/static/custom-include/pixman/config.h @@ -0,0 +1,174 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether we have alarm() */ +#define HAVE_ALARM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Whether we have feenableexcept() */ +#define HAVE_FEENABLEEXCEPT 1 + +/* Define to 1 if we have */ +#define HAVE_FENV_H 1 + +/* Whether the tool chain supports __float128 */ +#define HAVE_FLOAT128 /**/ + +/* Define to 1 if you have the `getisax' function. */ +/* #undef HAVE_GETISAX */ + +/* Whether we have getpagesize() */ +#define HAVE_GETPAGESIZE 1 + +/* Whether we have gettimeofday() */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `pixman-1' library (-lpixman-1). */ +/* #undef HAVE_LIBPIXMAN_1 */ + +/* Whether we have libpng */ +#define HAVE_LIBPNG 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Whether we have mmap() */ +#define HAVE_MMAP 1 + +/* Whether we have mprotect() */ +#define HAVE_MPROTECT 1 + +/* Whether we have posix_memalign() */ +#define HAVE_POSIX_MEMALIGN 1 + +/* Whether pthread_setspecific() is supported */ +/* #undef HAVE_PTHREAD_SETSPECIFIC */ + +/* Whether we have sigaction() */ +#define HAVE_SIGACTION 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if we have */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "pixman" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "pixman@lists.freedesktop.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "pixman" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "pixman 0.30.2" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "pixman" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.30.2" + +/* enable TIMER_BEGIN/TIMER_END macros */ +/* #undef PIXMAN_TIMERS */ + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* The compiler supported TLS storage class */ +#define TLS __thread + +/* Whether the tool chain supports __attribute__((constructor)) */ +#define TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR /**/ + +/* use ARM IWMMXT compiler intrinsics */ +/* #undef USE_ARM_IWMMXT */ + +/* use ARM NEON assembly optimizations */ +/* #undef USE_ARM_NEON */ + +/* use ARM SIMD assembly optimizations */ +/* #undef USE_ARM_SIMD */ + +/* use GNU-style inline assembler */ +#define USE_GCC_INLINE_ASM 1 + +/* use Loongson Multimedia Instructions */ +/* #undef USE_LOONGSON_MMI */ + +/* use MIPS DSPr2 assembly optimizations */ +/* #undef USE_MIPS_DSPR2 */ + +/* use OpenMP in the test suite */ +#define USE_OPENMP 1 + +/* use SSE2 compiler intrinsics */ +#define USE_SSE2 1 + +/* use VMX compiler intrinsics */ +/* #undef USE_VMX */ + +/* use x86 MMX compiler intrinsics */ +#define USE_X86_MMX 1 + +/* Version number of package */ +#define VERSION "0.30.2" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to sqrt if you do not have the `sqrtf' function. */ +/* #undef sqrtf */ diff --git a/static/custom-include/png/pnglibconf.h b/static/custom-include/png/pnglibconf.h new file mode 100644 index 000000000..e31ff3dec --- /dev/null +++ b/static/custom-include/png/pnglibconf.h @@ -0,0 +1,211 @@ +/* libpng 1.6.6 STANDARD API DEFINITION */ + +/* pnglibconf.h - library build configuration */ + +/* Libpng version 1.6.6 - September 16, 2013 */ + +/* Copyright (c) 1998-2013 Glenn Randers-Pehrson */ + +/* This code is released under the libpng license. */ +/* For conditions of distribution and use, see the disclaimer */ +/* and license in png.h */ + +/* pnglibconf.h */ +/* Machine generated file: DO NOT EDIT */ +/* Derived from: scripts/pnglibconf.dfa */ +#ifndef PNGLCONF_H +#define PNGLCONF_H +/* options */ +#define PNG_16BIT_SUPPORTED +#define PNG_ALIGNED_MEMORY_SUPPORTED +/*#undef PNG_ARM_NEON_API_SUPPORTED*/ +/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/ +#define PNG_BENIGN_ERRORS_SUPPORTED +#define PNG_BENIGN_READ_ERRORS_SUPPORTED +/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/ +#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED +#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED +#define PNG_COLORSPACE_SUPPORTED +#define PNG_CONSOLE_IO_SUPPORTED +#define PNG_CONVERT_tIME_SUPPORTED +#define PNG_EASY_ACCESS_SUPPORTED +/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/ +#define PNG_ERROR_TEXT_SUPPORTED +#define PNG_FIXED_POINT_SUPPORTED +#define PNG_FLOATING_ARITHMETIC_SUPPORTED +#define PNG_FLOATING_POINT_SUPPORTED +#define PNG_FORMAT_AFIRST_SUPPORTED +#define PNG_FORMAT_BGR_SUPPORTED +#define PNG_GAMMA_SUPPORTED +#define PNG_GET_PALETTE_MAX_SUPPORTED +#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +#define PNG_INCH_CONVERSIONS_SUPPORTED +#define PNG_INFO_IMAGE_SUPPORTED +#define PNG_IO_STATE_SUPPORTED +#define PNG_MNG_FEATURES_SUPPORTED +#define PNG_POINTER_INDEXING_SUPPORTED +#define PNG_PROGRESSIVE_READ_SUPPORTED +#define PNG_READ_16BIT_SUPPORTED +#define PNG_READ_ALPHA_MODE_SUPPORTED +#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED +#define PNG_READ_BACKGROUND_SUPPORTED +#define PNG_READ_BGR_SUPPORTED +#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED +#define PNG_READ_COMPOSITE_NODIV_SUPPORTED +#define PNG_READ_COMPRESSED_TEXT_SUPPORTED +#define PNG_READ_EXPAND_16_SUPPORTED +#define PNG_READ_EXPAND_SUPPORTED +#define PNG_READ_FILLER_SUPPORTED +#define PNG_READ_GAMMA_SUPPORTED +#define PNG_READ_GET_PALETTE_MAX_SUPPORTED +#define PNG_READ_GRAY_TO_RGB_SUPPORTED +#define PNG_READ_INTERLACING_SUPPORTED +#define PNG_READ_INT_FUNCTIONS_SUPPORTED +#define PNG_READ_INVERT_ALPHA_SUPPORTED +#define PNG_READ_INVERT_SUPPORTED +#define PNG_READ_OPT_PLTE_SUPPORTED +#define PNG_READ_PACKSWAP_SUPPORTED +#define PNG_READ_PACK_SUPPORTED +#define PNG_READ_QUANTIZE_SUPPORTED +#define PNG_READ_RGB_TO_GRAY_SUPPORTED +#define PNG_READ_SCALE_16_TO_8_SUPPORTED +#define PNG_READ_SHIFT_SUPPORTED +#define PNG_READ_STRIP_16_TO_8_SUPPORTED +#define PNG_READ_STRIP_ALPHA_SUPPORTED +#define PNG_READ_SUPPORTED +#define PNG_READ_SWAP_ALPHA_SUPPORTED +#define PNG_READ_SWAP_SUPPORTED +#define PNG_READ_TEXT_SUPPORTED +#define PNG_READ_TRANSFORMS_SUPPORTED +#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_READ_USER_CHUNKS_SUPPORTED +#define PNG_READ_USER_TRANSFORM_SUPPORTED +#define PNG_READ_bKGD_SUPPORTED +#define PNG_READ_cHRM_SUPPORTED +#define PNG_READ_gAMA_SUPPORTED +#define PNG_READ_hIST_SUPPORTED +#define PNG_READ_iCCP_SUPPORTED +#define PNG_READ_iTXt_SUPPORTED +#define PNG_READ_oFFs_SUPPORTED +#define PNG_READ_pCAL_SUPPORTED +#define PNG_READ_pHYs_SUPPORTED +#define PNG_READ_sBIT_SUPPORTED +#define PNG_READ_sCAL_SUPPORTED +#define PNG_READ_sPLT_SUPPORTED +#define PNG_READ_sRGB_SUPPORTED +#define PNG_READ_tEXt_SUPPORTED +#define PNG_READ_tIME_SUPPORTED +#define PNG_READ_tRNS_SUPPORTED +#define PNG_READ_zTXt_SUPPORTED +/*#undef PNG_SAFE_LIMITS_SUPPORTED*/ +#define PNG_SAVE_INT_32_SUPPORTED +#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_SEQUENTIAL_READ_SUPPORTED +#define PNG_SETJMP_SUPPORTED +#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED +#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED +#define PNG_SET_OPTION_SUPPORTED +#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_SET_USER_LIMITS_SUPPORTED +#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED +#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED +#define PNG_SIMPLIFIED_READ_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_SUPPORTED +#define PNG_STDIO_SUPPORTED +#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_TEXT_SUPPORTED +#define PNG_TIME_RFC1123_SUPPORTED +#define PNG_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_USER_CHUNKS_SUPPORTED +#define PNG_USER_LIMITS_SUPPORTED +#define PNG_USER_MEM_SUPPORTED +#define PNG_USER_TRANSFORM_INFO_SUPPORTED +#define PNG_USER_TRANSFORM_PTR_SUPPORTED +#define PNG_WARNINGS_SUPPORTED +#define PNG_WRITE_16BIT_SUPPORTED +#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED +#define PNG_WRITE_BGR_SUPPORTED +#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED +#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED +#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED +#define PNG_WRITE_FILLER_SUPPORTED +#define PNG_WRITE_FILTER_SUPPORTED +#define PNG_WRITE_FLUSH_SUPPORTED +#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED +#define PNG_WRITE_INTERLACING_SUPPORTED +#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED +#define PNG_WRITE_INVERT_ALPHA_SUPPORTED +#define PNG_WRITE_INVERT_SUPPORTED +#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED +#define PNG_WRITE_PACKSWAP_SUPPORTED +#define PNG_WRITE_PACK_SUPPORTED +#define PNG_WRITE_SHIFT_SUPPORTED +#define PNG_WRITE_SUPPORTED +#define PNG_WRITE_SWAP_ALPHA_SUPPORTED +#define PNG_WRITE_SWAP_SUPPORTED +#define PNG_WRITE_TEXT_SUPPORTED +#define PNG_WRITE_TRANSFORMS_SUPPORTED +#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_WRITE_USER_TRANSFORM_SUPPORTED +#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED +#define PNG_WRITE_bKGD_SUPPORTED +#define PNG_WRITE_cHRM_SUPPORTED +#define PNG_WRITE_gAMA_SUPPORTED +#define PNG_WRITE_hIST_SUPPORTED +#define PNG_WRITE_iCCP_SUPPORTED +#define PNG_WRITE_iTXt_SUPPORTED +#define PNG_WRITE_oFFs_SUPPORTED +#define PNG_WRITE_pCAL_SUPPORTED +#define PNG_WRITE_pHYs_SUPPORTED +#define PNG_WRITE_sBIT_SUPPORTED +#define PNG_WRITE_sCAL_SUPPORTED +#define PNG_WRITE_sPLT_SUPPORTED +#define PNG_WRITE_sRGB_SUPPORTED +#define PNG_WRITE_tEXt_SUPPORTED +#define PNG_WRITE_tIME_SUPPORTED +#define PNG_WRITE_tRNS_SUPPORTED +#define PNG_WRITE_zTXt_SUPPORTED +#define PNG_bKGD_SUPPORTED +#define PNG_cHRM_SUPPORTED +#define PNG_gAMA_SUPPORTED +#define PNG_hIST_SUPPORTED +#define PNG_iCCP_SUPPORTED +#define PNG_iTXt_SUPPORTED +#define PNG_oFFs_SUPPORTED +#define PNG_pCAL_SUPPORTED +#define PNG_pHYs_SUPPORTED +#define PNG_sBIT_SUPPORTED +#define PNG_sCAL_SUPPORTED +#define PNG_sPLT_SUPPORTED +#define PNG_sRGB_SUPPORTED +#define PNG_tEXt_SUPPORTED +#define PNG_tIME_SUPPORTED +#define PNG_tRNS_SUPPORTED +#define PNG_zTXt_SUPPORTED +/* end of options */ +/* settings */ +#define PNG_API_RULE 0 +#define PNG_CALLOC_SUPPORTED +#define PNG_COST_SHIFT 3 +#define PNG_DEFAULT_READ_MACROS 1 +#define PNG_GAMMA_THRESHOLD_FIXED 5000 +#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE +#define PNG_INFLATE_BUF_SIZE 1024 +#define PNG_MAX_GAMMA_8 11 +#define PNG_QUANTIZE_BLUE_BITS 5 +#define PNG_QUANTIZE_GREEN_BITS 5 +#define PNG_QUANTIZE_RED_BITS 5 +#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1) +#define PNG_TEXT_Z_DEFAULT_STRATEGY 0 +#define PNG_WEIGHT_SHIFT 8 +#define PNG_ZBUF_SIZE 8192 +#define PNG_ZLIB_VERNUM 0 /* unknown */ +#define PNG_Z_DEFAULT_COMPRESSION (-1) +#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0 +#define PNG_Z_DEFAULT_STRATEGY 1 +#define PNG_sCAL_PRECISION 5 +#define PNG_sRGB_PROFILE_CHECKS 2 +/* end of settings */ +#endif /* PNGLCONF_H */ diff --git a/static/ensure_deps.sh b/static/ensure_deps.sh new file mode 100755 index 000000000..708fc4f9a --- /dev/null +++ b/static/ensure_deps.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash + +CAIRO_VERSION=1.12.18 +EXPAT_VERSION=2.2.0 +FFI_VERSION=3.2.1 +FONTCONFIG_VERSION=2.12.1 +FREETYPE_VERSION=2.6 +GIFLIB_VERSION=4.2.3 +GLIB_VERSION=2.50.2 +HARFBUZZ_VERSION=1.4.2 +LIBJPEG_VERSION=1.2.1 +LIBPNG_VERSION=1.6.37 +PANGO_VERSION=1.40.3 +PIXMAN_VERSION=0.32.6 +ZLIB_VERSION=1.2.11 + +CAIRO_URL=http://cairographics.org/releases/cairo-$CAIRO_VERSION.tar.xz +EXPAT_URL=https://downloads.sourceforge.net/project/expat/expat/$EXPAT_VERSION/expat-$EXPAT_VERSION.tar.bz2 +FFI_URL=ftp://sourceware.org/pub/libffi/libffi-$FFI_VERSION.tar.gz +FONTCONFIG_URL=https://www.freedesktop.org/software/fontconfig/release/fontconfig-$FONTCONFIG_VERSION.tar.bz2 +FREETYPE_URL=http://download.savannah.gnu.org/releases/freetype/freetype-$FREETYPE_VERSION.tar.gz +GIFLIB_URL=http://sourceforge.net/projects/giflib/files/giflib-4.x/giflib-$GIFLIB_VERSION.tar.gz +GLIB_URL=https://download.gnome.org/sources/glib/2.50/glib-$GLIB_VERSION.tar.xz +HARFBUZZ_URL=https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-$HARFBUZZ_VERSION.tar.bz2 +LIBJPEG_URL=http://downloads.sourceforge.net/project/libjpeg-turbo/$LIBJPEG_VERSION/libjpeg-turbo-$LIBJPEG_VERSION.tar.gz +LIBPNG_URL=http://sourceforge.net/projects/libpng/files/libpng16/$LIBPNG_VERSION/libpng-$LIBPNG_VERSION.tar.xz +PANGO_URL=http://ftp.gnome.org/pub/GNOME/sources/pango/1.40/pango-$PANGO_VERSION.tar.xz +PIXMAN_URL=http://cairographics.org/releases/pixman-$PIXMAN_VERSION.tar.gz +ZLIB_URL=https://sourceforge.net/projects/libpng/files/zlib/$ZLIB_VERSION/zlib-$ZLIB_VERSION.tar.gz + + +DEPS="$(dirname $0)/../deps" + +mkdir -p $DEPS +cd $DEPS + + +fetch() +{ + if [ ! -d $2 ]; then + mkdir -p $2 && + curl -s -L $1 | tar xzf - -C $2 --strip-components=1 || exit $? + fi +} + +fetch_bz2() +{ + if [ ! -d $2 ]; then + mkdir -p $2 && + curl -s -L $1 | tar xjf - -C $2 --strip-components=1 || exit $? + fi +} + +fetch_xz() +{ + if [ ! -d $2 ]; then + mkdir -p $2 && + curl -s -L $1 | tar xJf - -C $2 --strip-components=1 || exit $? + fi +} + + +# TODO Don't modify source code location +if [ ! -d cairo ]; then + fetch_xz $CAIRO_URL cairo && + mv cairo/src cairo/cairo || exit $? +fi + +fetch_bz2 $EXPAT_URL expat && +fetch $FFI_URL ffi && +fetch_bz2 $FONTCONFIG_URL fontconfig && +fetch $FREETYPE_URL freetype && +fetch $GIFLIB_URL giflib && +fetch_xz $GLIB_URL glib && +fetch_bz2 $HARFBUZZ_URL harfbuzz && +fetch $LIBJPEG_URL libjpeg && +fetch_xz $LIBPNG_URL libpng && +fetch_xz $PANGO_URL pango && +fetch $PIXMAN_URL pixman && +fetch $ZLIB_URL zlib || exit $? + + +if [ ! -d "cairo" ] || [ ! -d "expat" ] || [ ! -d "ffi" ] \ +|| [ ! -d "fontconfig" ] || [ ! -d "freetype" ] || [ ! -d "giflib" ] \ +|| [ ! -d "glib" ] || [ ! -d "harfbuzz" ] || [ ! -d "libjpeg" ] \ +|| [ ! -d "libpng" ] || [ ! -d "pango" ] || [ ! -d "pixman" ] \ +|| [ ! -d "zlib" ] ; then + echo false +else + echo true +fi diff --git a/static/expat.gypi b/static/expat.gypi new file mode 100644 index 000000000..46e41a2e0 --- /dev/null +++ b/static/expat.gypi @@ -0,0 +1,22 @@ +{ + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [{ + 'target_name': 'expat', + 'type': 'static_library', + 'include_dirs': [ + '<(expat_root)lib/', + '<(expat_root)xmlwf/', + 'custom-include/expat' + ], + 'defines': ['HAVE_EXPAT_CONFIG_H'], + 'sources': [ + "<(expat_root)lib/xmlparse.c", + "<(expat_root)lib/xmltok.c", + "<(expat_root)lib/xmlrole.c", + "<(expat_root)xmlwf/xmlwf.c", + "<(expat_root)xmlwf/xmlfile.c", + "<(expat_root)xmlwf/codepage.c", + "<(expat_root)xmlwf/unixfilemap.c" + ] + }] +} diff --git a/static/ffi.gypi b/static/ffi.gypi new file mode 100644 index 000000000..3f5552c77 --- /dev/null +++ b/static/ffi.gypi @@ -0,0 +1,24 @@ +{ + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [{ + 'target_name': 'ffi', + 'type': 'static_library', + 'include_dirs': [ + '<(ffi_root)include/', + '<(ffi_root)src/x86', + 'custom-include/ffi' + ], + 'defines': ['HAVE_CONFIG_H'], + 'sources': [ + "<(ffi_root)src/prep_cif.c", + "<(ffi_root)src/types.c", + "<(ffi_root)src/raw_api.c", + "<(ffi_root)src/java_raw_api.c", + "<(ffi_root)src/closures.c", + "<(ffi_root)src/x86/ffi64.c", + "<(ffi_root)src/x86/unix64.S", + "<(ffi_root)src/x86/ffi.c", + "<(ffi_root)src/x86/sysv.S" + ] + }] +} diff --git a/static/fontconfig.gypi b/static/fontconfig.gypi new file mode 100644 index 000000000..0165e566b --- /dev/null +++ b/static/fontconfig.gypi @@ -0,0 +1,53 @@ +{ + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [{ + 'target_name': 'fontconfig', + 'type': 'static_library', + 'include_dirs': [ + '<(fontconfig_root)', + '<(fontconfig_root)src', + 'custom-include/fontconfig', + + '<(expat_root)/lib', + '<(freetype_root)/include', + ], + 'defines': [ + 'HAVE_CONFIG_H', 'FC_CACHEDIR=\"/var/cache/fontconfig\"', + 'FONTCONFIG_PATH=\"/etc/fonts\"' + ], + 'sources': + [ + "<(fontconfig_root)src/fcatomic.c", + "<(fontconfig_root)src/fcblanks.c", + "<(fontconfig_root)src/fccache.c", + "<(fontconfig_root)src/fccfg.c", + "<(fontconfig_root)src/fccharset.c", + "<(fontconfig_root)src/fccompat.c", + "<(fontconfig_root)src/fcdbg.c", + "<(fontconfig_root)src/fcdefault.c", + "<(fontconfig_root)src/fcdir.c", + "<(fontconfig_root)src/fcformat.c", + "<(fontconfig_root)src/fcfreetype.c", + "<(fontconfig_root)src/fcfs.c", + "<(fontconfig_root)src/fcinit.c", + "<(fontconfig_root)src/fclang.c", + "<(fontconfig_root)src/fclist.c", + "<(fontconfig_root)src/fcmatch.c", + "<(fontconfig_root)src/fcmatch.c", + "<(fontconfig_root)src/fcmatrix.c", + "<(fontconfig_root)src/fcname.c", + "<(fontconfig_root)src/fcobjs.c", + "<(fontconfig_root)src/fcpat.c", + "<(fontconfig_root)src/fcrange.c", + "<(fontconfig_root)src/fcserialize.c", + "<(fontconfig_root)src/fcstat.c", + "<(fontconfig_root)src/fcstr.c", + "<(fontconfig_root)src/fcweight.c", + "<(fontconfig_root)src/fcxml.c", + "<(fontconfig_root)src/ftglue.c", + "<(fontconfig_root)src/fcxml.c", + "<(fontconfig_root)src/fcxml.c", + "<(fontconfig_root)src/fcxml.c", + ] + }] +} diff --git a/static/freetype.gypi b/static/freetype.gypi new file mode 100644 index 000000000..1ef111e3c --- /dev/null +++ b/static/freetype.gypi @@ -0,0 +1,241 @@ +{ + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [ + { + 'target_name': 'freetype', + 'type': 'static_library', + 'include_dirs': ['<(freetype_root)include/'], + + 'defines': ['FT2_BUILD_LIBRARY'], + 'sources': [ + #"<(freetype_root)src/autofit/afangles.c", + #"<(freetype_root)src/autofit/afcjk.c", + #"<(freetype_root)src/autofit/afdummy.c", + #"<(freetype_root)src/autofit/afglobal.c", + #"<(freetype_root)src/autofit/afhints.c", + #"<(freetype_root)src/autofit/afindic.c", + #"<(freetype_root)src/autofit/aflatin2.c", + #"<(freetype_root)src/autofit/aflatin.c", + #"<(freetype_root)src/autofit/afloader.c", + #"<(freetype_root)src/autofit/afmodule.c", + #"<(freetype_root)src/autofit/afpic.c", + #"<(freetype_root)src/autofit/afwarp.c", + "<(freetype_root)src/autofit/autofit.c", + + #"<(freetype_root)src/base/basepic.c", + #"<(freetype_root)src/base/ftadvanc.c", + #"<(freetype_root)src/base/ftapi.c", + "<(freetype_root)src/base/ftbase.c", + #"<(freetype_root)src/base/ftbbox.c", + "<(freetype_root)src/base/ftbdf.c", + "<(freetype_root)src/base/ftbitmap.c", + #"<(freetype_root)src/base/ftcalc.c", + #"<(freetype_root)src/base/ftcid.c", + #"<(freetype_root)src/base/ftdbgmem.c", + #"<(freetype_root)src/base/ftdebug.c", + "<(freetype_root)src/base/ftfntfmt.c", + #"<(freetype_root)src/base/ftfstype.c", + #"<(freetype_root)src/base/ftgasp.c", + #"<(freetype_root)src/base/ftgloadr.c", + #"<(freetype_root)src/base/ftglyph.c", + #"<(freetype_root)src/base/ftgxval.c", + "<(freetype_root)src/base/ftinit.c", + "<(freetype_root)src/base/ftlcdfil.c", + #"<(freetype_root)src/base/ftmac.c", + #"<(freetype_root)src/base/ftmm.c", + #"<(freetype_root)src/base/ftobjs.c", + #"<(freetype_root)src/base/ftotval.c", + #"<(freetype_root)src/base/ftoutln.c", + #"<(freetype_root)src/base/ftpatent.c", + #"<(freetype_root)src/base/ftpfr.c", + #"<(freetype_root)src/base/ftpic.c", + #"<(freetype_root)src/base/ftrfork.c", + #"<(freetype_root)src/base/ftsnames.c", + #"<(freetype_root)src/base/ftstream.c", + #"<(freetype_root)src/base/ftstroke.c", + "<(freetype_root)src/base/ftsynth.c", + "<(freetype_root)src/base/ftsystem.c", + #"<(freetype_root)src/base/fttrigon.c", + "<(freetype_root)src/base/fttype1.c", + #"<(freetype_root)src/base/ftutil.c", + #"<(freetype_root)src/base/ftwinfnt.c", + #"<(freetype_root)src/base/ftxf86.c", + #"<(freetype_root)src/base/md5.c", + + "<(freetype_root)src/bdf/bdf.c", + #"<(freetype_root)src/bdf/bdfdrivr.c", + #"<(freetype_root)src/bdf/bdflib.c", + + "<(freetype_root)src/bzip2/ftbzip2.c", + + "<(freetype_root)src/cache/ftcache.c", + #"<(freetype_root)src/cache/ftcbasic.c", + #"<(freetype_root)src/cache/ftccache.c", + #"<(freetype_root)src/cache/ftccmap.c", + #"<(freetype_root)src/cache/ftcglyph.c", + #"<(freetype_root)src/cache/ftcimage.c", + #"<(freetype_root)src/cache/ftcmanag.c", + #"<(freetype_root)src/cache/ftcmru.c", + #"<(freetype_root)src/cache/ftcsbits.c", + + #"<(freetype_root)src/cff/cf2arrst.c", + #"<(freetype_root)src/cff/cf2blues.c", + #"<(freetype_root)src/cff/cf2error.c", + #"<(freetype_root)src/cff/cf2font.c", + #"<(freetype_root)src/cff/cf2ft.c", + #"<(freetype_root)src/cff/cf2hints.c", + #"<(freetype_root)src/cff/cf2intrp.c", + #"<(freetype_root)src/cff/cf2read.c", + #"<(freetype_root)src/cff/cf2stack.c", + "<(freetype_root)src/cff/cff.c", + #"<(freetype_root)src/cff/cffcmap.c", + #"<(freetype_root)src/cff/cffdrivr.c", + #"<(freetype_root)src/cff/cffgload.c", + #"<(freetype_root)src/cff/cffload.c", + #"<(freetype_root)src/cff/cffobjs.c", + #"<(freetype_root)src/cff/cffparse.c", + #"<(freetype_root)src/cff/cffpic.c", + + #"<(freetype_root)src/cid/cidgload.c", + #"<(freetype_root)src/cid/cidload.c", + #"<(freetype_root)src/cid/cidobjs.c", + #"<(freetype_root)src/cid/cidparse.c", + #"<(freetype_root)src/cid/cidriver.c", + "<(freetype_root)src/cid/type1cid.c", + + "<(freetype_root)src/gxvalid/gxvalid.c", + #"<(freetype_root)src/gxvalid/gxvbsln.c", + #"<(freetype_root)src/gxvalid/gxvcommn.c", + #"<(freetype_root)src/gxvalid/gxvfeat.c", + #"<(freetype_root)src/gxvalid/gxvfgen.c", + #"<(freetype_root)src/gxvalid/gxvjust.c", + #"<(freetype_root)src/gxvalid/gxvkern.c", + #"<(freetype_root)src/gxvalid/gxvlcar.c", + #"<(freetype_root)src/gxvalid/gxvmod.c", + #"<(freetype_root)src/gxvalid/gxvmort0.c", + #"<(freetype_root)src/gxvalid/gxvmort1.c", + #"<(freetype_root)src/gxvalid/gxvmort2.c", + #"<(freetype_root)src/gxvalid/gxvmort4.c", + #"<(freetype_root)src/gxvalid/gxvmort5.c", + #"<(freetype_root)src/gxvalid/gxvmort.c", + #"<(freetype_root)src/gxvalid/gxvmorx0.c", + #"<(freetype_root)src/gxvalid/gxvmorx1.c", + #"<(freetype_root)src/gxvalid/gxvmorx2.c", + #"<(freetype_root)src/gxvalid/gxvmorx4.c", + #"<(freetype_root)src/gxvalid/gxvmorx5.c", + #"<(freetype_root)src/gxvalid/gxvmorx.c", + #"<(freetype_root)src/gxvalid/gxvopbd.c", + #"<(freetype_root)src/gxvalid/gxvprop.c", + #"<(freetype_root)src/gxvalid/gxvtrak.c", + + #"<(freetype_root)src/gzip/adler32.c", + "<(freetype_root)src/gzip/ftgzip.c", + #"<(freetype_root)src/gzip/infblock.c", + #"<(freetype_root)src/gzip/infcodes.c", + #"<(freetype_root)src/gzip/inflate.c", + #"<(freetype_root)src/gzip/inftrees.c", + #"<(freetype_root)src/gzip/infutil.c", + #"<(freetype_root)src/gzip/zutil.c", + + "<(freetype_root)src/lzw/ftlzw.c", + #"<(freetype_root)src/lzw/ftzopen.c", + + "<(freetype_root)src/otvalid/otvalid.c", + #"<(freetype_root)src/otvalid/otvbase.c", + #"<(freetype_root)src/otvalid/otvcommn.c", + #"<(freetype_root)src/otvalid/otvgdef.c", + #"<(freetype_root)src/otvalid/otvgpos.c", + #"<(freetype_root)src/otvalid/otvgsub.c", + #"<(freetype_root)src/otvalid/otvjstf.c", + #"<(freetype_root)src/otvalid/otvmath.c", + #"<(freetype_root)src/otvalid/otvmod.c", + + "<(freetype_root)src/pcf/pcf.c", + #"<(freetype_root)src/pcf/pcfdrivr.c", + #"<(freetype_root)src/pcf/pcfread.c", + #"<(freetype_root)src/pcf/pcfutil.c", + + "<(freetype_root)src/pfr/pfr.c", + #"<(freetype_root)src/pfr/pfrcmap.c", + #"<(freetype_root)src/pfr/pfrdrivr.c", + #"<(freetype_root)src/pfr/pfrgload.c", + #"<(freetype_root)src/pfr/pfrload.c", + #"<(freetype_root)src/pfr/pfrobjs.c", + #"<(freetype_root)src/pfr/pfrsbit.c", + + #"<(freetype_root)src/psaux/afmparse.c", + "<(freetype_root)src/psaux/psaux.c", + #"<(freetype_root)src/psaux/psauxmod.c", + #"<(freetype_root)src/psaux/psconv.c", + #"<(freetype_root)src/psaux/psobjs.c", + #"<(freetype_root)src/psaux/t1cmap.c", + #"<(freetype_root)src/psaux/t1decode.c", + + #"<(freetype_root)src/pshinter/pshalgo.c", + #"<(freetype_root)src/pshinter/pshglob.c", + "<(freetype_root)src/pshinter/pshinter.c", + #"<(freetype_root)src/pshinter/pshmod.c", + #"<(freetype_root)src/pshinter/pshpic.c", + #"<(freetype_root)src/pshinter/pshrec.c", + + #"<(freetype_root)src/psnames/psmodule.c", + "<(freetype_root)src/psnames/psnames.c", + #"<(freetype_root)src/psnames/pspic.c", + + #"<(freetype_root)src/raster/ftraster.c", + #"<(freetype_root)src/raster/ftrend1.c", + "<(freetype_root)src/raster/raster.c", + #"<(freetype_root)src/raster/rastpic.c", + + #"<(freetype_root)src/sfnt/pngshim.c", + #"<(freetype_root)src/sfnt/sfdriver.c", + "<(freetype_root)src/sfnt/sfnt.c", + #"<(freetype_root)src/sfnt/sfntpic.c", + #"<(freetype_root)src/sfnt/sfobjs.c", + #"<(freetype_root)src/sfnt/ttbdf.c", + #"<(freetype_root)src/sfnt/ttcmap.c", + #"<(freetype_root)src/sfnt/ttkern.c", + #"<(freetype_root)src/sfnt/ttload.c", + #"<(freetype_root)src/sfnt/ttmtx.c", + #"<(freetype_root)src/sfnt/ttpost.c", + #"<(freetype_root)src/sfnt/ttsbit.c", + + #"<(freetype_root)src/smooth/ftgrays.c", + #"<(freetype_root)src/smooth/ftsmooth.c", + #"<(freetype_root)src/smooth/ftspic.c", + "<(freetype_root)src/smooth/smooth.c", + + "<(freetype_root)src/tools/apinames.c", + "<(freetype_root)src/tools/ftrandom/ftrandom.c", + "<(freetype_root)src/tools/test_afm.c", + "<(freetype_root)src/tools/test_bbox.c", + "<(freetype_root)src/tools/test_trig.c", + + "<(freetype_root)src/truetype/truetype.c", + #"<(freetype_root)src/truetype/ttdriver.c", + #"<(freetype_root)src/truetype/ttgload.c", + #"<(freetype_root)src/truetype/ttgxvar.c", + #"<(freetype_root)src/truetype/ttinterp.c", + #"<(freetype_root)src/truetype/ttobjs.c", + #"<(freetype_root)src/truetype/ttpic.c", + #"<(freetype_root)src/truetype/ttpload.c", + #"<(freetype_root)src/truetype/ttsubpix.c", + + #"<(freetype_root)src/type1/t1afm.c", + #"<(freetype_root)src/type1/t1driver.c", + #"<(freetype_root)src/type1/t1gload.c", + #"<(freetype_root)src/type1/t1load.c", + #"<(freetype_root)src/type1/t1objs.c", + #"<(freetype_root)src/type1/t1parse.c", + "<(freetype_root)src/type1/type1.c", + + #"<(freetype_root)src/type42/t42drivr.c", + #"<(freetype_root)src/type42/t42objs.c", + #"<(freetype_root)src/type42/t42parse.c", + "<(freetype_root)src/type42/type42.c", + + "<(freetype_root)src/winfonts/winfnt.c", + ], + }, + ] +} diff --git a/static/gif.gypi b/static/gif.gypi new file mode 100644 index 000000000..969bd6422 --- /dev/null +++ b/static/gif.gypi @@ -0,0 +1,21 @@ +{ + + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [ + { + 'target_name': 'gif', + 'type': 'static_library', + 'include_dirs': ['<(gif_root)lib/'], + 'libraries': [ + ], + 'sources': [ + "<(gif_root)lib/dgif_lib.c", + "<(gif_root)lib/egif_lib.c", + "<(gif_root)lib/gifalloc.c", + "<(gif_root)lib/gif_err.c", + "<(gif_root)lib/gif_font.c", + "<(gif_root)lib/gif_hash.c", + ], + }, + ] +} diff --git a/static/glib.gypi b/static/glib.gypi new file mode 100644 index 000000000..dd3cf68ca --- /dev/null +++ b/static/glib.gypi @@ -0,0 +1,198 @@ +{ + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [{ + 'target_name': 'glib/libcharset', + 'type': 'static_library', + 'include_dirs': [ + '<(glib_root)', + '<(glib_root)/glib', + '<(glib_root)/glib/libcharset', + 'custom-include/glib' + ], + 'defines': [ + 'HAVE_CONFIG_H', 'LIBDIR=\"/usr/local/lib\"' + ], + 'sources': [ + "<(glib_root)glib/libcharset/localcharset.c", + ] + }, { + 'target_name': 'glib/pcre', + 'type': 'static_library', + 'include_dirs': [ + '<(glib_root)', + '<(glib_root)/glib', + '<(glib_root)/glib/pcre', + 'custom-include/glib' + ], + 'defines': [ + 'HAVE_CONFIG_H', 'LIBDIR=\"/usr/local/lib\"', + 'G_LOG_DOMAIN=\"GLib-GRegex\"', 'HAVE_MEMMOVE', 'SUPPORT_UCP', + 'SUPPORT_UTF', 'SUPPORT_UTF8', 'NEWLINE=-1', + 'MATCH_LIMIT=10000000', 'MATCH_LIMIT_RECURSION=8192', + 'MAX_NAME_SIZE=32', 'MAX_NAME_COUNT=10000', 'MAX_DUPLENGTH=30000', + 'LINK_SIZE=2', 'POSIX_MALLOC_THRESHOLD=10', 'PCRE_STATIC' + ], + 'sources': [ + "<(glib_root)glib/pcre/pcre_byte_order.c", + "<(glib_root)glib/pcre/pcre_chartables.c", + "<(glib_root)glib/pcre/pcre_compile.c", + "<(glib_root)glib/pcre/pcre_config.c", + "<(glib_root)glib/pcre/pcre_dfa_exec.c", + "<(glib_root)glib/pcre/pcre_exec.c", + "<(glib_root)glib/pcre/pcre_fullinfo.c", + "<(glib_root)glib/pcre/pcre_get.c", + "<(glib_root)glib/pcre/pcre_globals.c", + "<(glib_root)glib/pcre/pcre_jit_compile.c", + "<(glib_root)glib/pcre/pcre_newline.c", + "<(glib_root)glib/pcre/pcre_ord2utf8.c", + "<(glib_root)glib/pcre/pcre_string_utils.c", + "<(glib_root)glib/pcre/pcre_study.c", + "<(glib_root)glib/pcre/pcre_tables.c", + "<(glib_root)glib/pcre/pcre_valid_utf8.c", + "<(glib_root)glib/pcre/pcre_version.c", + "<(glib_root)glib/pcre/pcre_xclass.c" + ] + }, { + 'target_name': 'glib', + 'type': 'static_library', + 'include_dirs': [ + '<(glib_root)', + '<(glib_root)/glib', + '<(glib_root)/glib/libcharset', + '<(glib_root)/glib/pcre', + 'custom-include/glib' + ], + 'defines': [ + 'HAVE_CONFIG_H', 'G_LOG_DOMAIN=\"GLib\"', 'G_DISABLE_CAST_CHECKS', + 'GLIB_COMPILATION', 'PCRE_STATIC' + ], + 'dependencies': [ + 'glib/libcharset', + 'glib/pcre' + ], + 'sources': [ + "<(glib_root)glib/deprecated/gallocator.c", + "<(glib_root)glib/deprecated/gcache.c", + "<(glib_root)glib/deprecated/gcompletion.c", + "<(glib_root)glib/deprecated/grel.c", + "<(glib_root)glib/deprecated/gthread-deprecated.c", + "<(glib_root)glib/garray.c", + "<(glib_root)glib/gasyncqueue.c", + "<(glib_root)glib/gatomic.c", + "<(glib_root)glib/gbacktrace.c", + "<(glib_root)glib/gbase64.c", + "<(glib_root)glib/gbitlock.c", + "<(glib_root)glib/gbookmarkfile.c", + "<(glib_root)glib/gbytes.c", + "<(glib_root)glib/gcharset.c", + "<(glib_root)glib/gchecksum.c", + "<(glib_root)glib/gconvert.c", + "<(glib_root)glib/gdataset.c", + "<(glib_root)glib/gdate.c", + "<(glib_root)glib/gdatetime.c", + "<(glib_root)glib/gdir.c", + "<(glib_root)glib/genviron.c", + "<(glib_root)glib/gerror.c", + "<(glib_root)glib/gfileutils.c", + "<(glib_root)glib/ggettext.c", + "<(glib_root)glib/ghash.c", + "<(glib_root)glib/ghmac.c", + "<(glib_root)glib/ghook.c", + "<(glib_root)glib/ghostutils.c", + "<(glib_root)glib/giochannel.c", + "<(glib_root)glib/gkeyfile.c", + "<(glib_root)glib/glib-init.c", + "<(glib_root)glib/glib-private.c", + "<(glib_root)glib/glist.c", + "<(glib_root)glib/gmain.c", + "<(glib_root)glib/gmappedfile.c", + "<(glib_root)glib/gmarkup.c", + "<(glib_root)glib/gmem.c", + "<(glib_root)glib/gmessages.c", + "<(glib_root)glib/gnode.c", + "<(glib_root)glib/goption.c", + "<(glib_root)glib/gpattern.c", + "<(glib_root)glib/gpoll.c", + "<(glib_root)glib/gprimes.c", + "<(glib_root)glib/gqsort.c", + "<(glib_root)glib/gquark.c", + "<(glib_root)glib/gqueue.c", + "<(glib_root)glib/grand.c", + "<(glib_root)glib/gregex.c", + "<(glib_root)glib/gscanner.c", + "<(glib_root)glib/gsequence.c", + "<(glib_root)glib/gshell.c", + "<(glib_root)glib/gslice.c", + "<(glib_root)glib/gslist.c", + "<(glib_root)glib/gstdio.c", + "<(glib_root)glib/gstrfuncs.c", + "<(glib_root)glib/gstring.c", + "<(glib_root)glib/gstdio.c", + "<(glib_root)glib/gstringchunk.c", + "<(glib_root)glib/gtestutils.c", + "<(glib_root)glib/gthread.c", + "<(glib_root)glib/gthreadpool.c", + "<(glib_root)glib/gtimer.c", + "<(glib_root)glib/gtimezone.c", + "<(glib_root)glib/gtranslit.c", + "<(glib_root)glib/gtrashstack.c", + "<(glib_root)glib/gtree.c", + "<(glib_root)glib/guniprop.c", + "<(glib_root)glib/gutf8.c", + "<(glib_root)glib/gunibreak.c", + "<(glib_root)glib/gunicollate.c", + "<(glib_root)glib/gunidecomp.c", + "<(glib_root)glib/gurifuncs.c", + "<(glib_root)glib/gutils.c", + "<(glib_root)glib/gvariant.c", + "<(glib_root)glib/gvariant-core.c", + "<(glib_root)glib/gvariant-parser.c", + "<(glib_root)glib/gvariant-serialiser.c", + "<(glib_root)glib/gvarianttypeinfo.c", + "<(glib_root)glib/gvarianttype.c", + "<(glib_root)glib/gversion.c", + "<(glib_root)glib/gwakeup.c", + "<(glib_root)glib/gprintf.c", + "<(glib_root)glib/glib-unix.c", + "<(glib_root)glib/gthread-posix.c", + "<(glib_root)glib/giounix.c", + "<(glib_root)glib/gspawn.c" + ] + }, { + 'target_name': 'gobject', + 'type': 'static_library', + 'include_dirs': [ + '<(glib_root)', + '<(glib_root)/glib', + '<(glib_root)/gobject', + 'custom-include/glib', + + '<(ffi_root)src/x86', + 'custom-include/ffi' + ], + 'defines': [ + 'HAVE_CONFIG_H', 'G_LOG_DOMAIN=\"GLib-GObject\"', + 'G_DISABLE_CAST_CHECKS', 'GOBJECT_COMPILATION' + ], + 'sources': [ + "<(glib_root)gobject/gatomicarray.c", + "<(glib_root)gobject/gbinding.c", + "<(glib_root)gobject/gboxed.c", + "<(glib_root)gobject/gclosure.c", + "<(glib_root)gobject/genums.c", + "<(glib_root)gobject/gmarshal.c", + "<(glib_root)gobject/gobject.c", + "<(glib_root)gobject/gparam.c", + "<(glib_root)gobject/gparamspecs.c", + "<(glib_root)gobject/gsignal.c", + "<(glib_root)gobject/gsourceclosure.c", + "<(glib_root)gobject/gtype.c", + "<(glib_root)gobject/gtypemodule.c", + "<(glib_root)gobject/gtypeplugin.c", + "<(glib_root)gobject/gvalue.c", + "<(glib_root)gobject/gvaluearray.c", + "<(glib_root)gobject/gvaluetransform.c", + "<(glib_root)gobject/gvaluetypes.c" + ] + }] +} diff --git a/static/harfbuzz.gypi b/static/harfbuzz.gypi new file mode 100644 index 000000000..387fd6f7c --- /dev/null +++ b/static/harfbuzz.gypi @@ -0,0 +1,65 @@ +{ + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [{ + 'target_name': 'hb-ucdn', + 'type': 'static_library', + 'include_dirs': ['<(harfbuzz_root)src/hb-ucdn'], + 'defines': ['HAVE_CONFIG_H'], + 'sources': [ + "<(harfbuzz_root)src/hb-ucdn/ucdn.c" + ] + }, { + 'target_name': 'harfbuzz', + 'type': 'static_library', + 'include_dirs': [ + '<(harfbuzz_root)src', + '<(harfbuzz_root)src/hb-ucdn', + 'custom-include/harfbuzz', + + '<(freetype_root)/include', + '<(glib_root)', + '<(glib_root)/glib', + 'custom-include/glib', + ], + 'dependencies': ['hb-ucdn'], + 'defines': ['HAVE_CONFIG_H'], + 'sources': [ + "<(harfbuzz_root)src/hb-blob.cc", + "<(harfbuzz_root)src/hb-buffer-serialize.cc", + "<(harfbuzz_root)src/hb-buffer.cc", + "<(harfbuzz_root)src/hb-common.cc", + "<(harfbuzz_root)src/hb-face.cc", + "<(harfbuzz_root)src/hb-font.cc", + "<(harfbuzz_root)src/hb-ot-tag.cc", + "<(harfbuzz_root)src/hb-set.cc", + "<(harfbuzz_root)src/hb-shape.cc", + "<(harfbuzz_root)src/hb-shape-plan.cc", + "<(harfbuzz_root)src/hb-shaper.cc", + "<(harfbuzz_root)src/hb-unicode.cc", + "<(harfbuzz_root)src/hb-warning.cc", + "<(harfbuzz_root)src/hb-ot-font.cc", + "<(harfbuzz_root)src/hb-ot-layout.cc", + "<(harfbuzz_root)src/hb-ot-map.cc", + "<(harfbuzz_root)src/hb-ot-math.cc", + "<(harfbuzz_root)src/hb-ot-shape.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-arabic.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-default.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-hangul.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-hebrew.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-indic.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-indic-table.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-myanmar.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-thai.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-tibetan.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-use.cc", + "<(harfbuzz_root)src/hb-ot-shape-complex-use-table.cc", + "<(harfbuzz_root)src/hb-ot-shape-normalize.cc", + "<(harfbuzz_root)src/hb-ot-shape-fallback.cc", + "<(harfbuzz_root)src/hb-ot-var.cc", + "<(harfbuzz_root)src/hb-fallback-shape.cc", + "<(harfbuzz_root)src/hb-glib.cc", + "<(harfbuzz_root)src/hb-ft.cc", + "<(harfbuzz_root)src/hb-ucdn.cc", + ] + }] +} diff --git a/static/jpeg.gypi b/static/jpeg.gypi new file mode 100644 index 000000000..9f2f9f4e2 --- /dev/null +++ b/static/jpeg.gypi @@ -0,0 +1,117 @@ +{ + + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [ + { + 'target_name': 'libjpeg', + 'type': 'static_library', + 'include_dirs': [ + '../static/custom-include/jpeg/', + '<(jpeg_root)', + ], + + 'dependencies': [], + 'defines': [], + 'sources': [ + + #"<(jpeg_root)ansi2knr.c", + #"<(jpeg_root)cdjpeg.c", + #"<(jpeg_root)cjpeg.c", + #"<(jpeg_root)ckconfig.c", + #"<(jpeg_root)djpeg.c", + #"<(jpeg_root)example.c", + + "<(jpeg_root)jsimd_none.c", + + "<(jpeg_root)jaricom.c", + "<(jpeg_root)jcapimin.c", + "<(jpeg_root)jcapistd.c", + "<(jpeg_root)jcarith.c", + "<(jpeg_root)jccoefct.c", + "<(jpeg_root)jccolor.c", + "<(jpeg_root)jcdctmgr.c", + "<(jpeg_root)jchuff.c", + "<(jpeg_root)jchuff.h", + "<(jpeg_root)jcinit.c", + "<(jpeg_root)jcmainct.c", + "<(jpeg_root)jcmarker.c", + "<(jpeg_root)jcmaster.c", + "<(jpeg_root)jcomapi.c", + "../static/custom-include/jpeg/jconfig.h", + "<(jpeg_root)jcparam.c", + "<(jpeg_root)jcphuff.c", + "<(jpeg_root)jcprepct.c", + "<(jpeg_root)jcsample.c", + #"<(jpeg_root)jctrans.c", + "<(jpeg_root)jdapimin.c", + "<(jpeg_root)jdapistd.c", + "<(jpeg_root)jdarith.c", + "<(jpeg_root)jdatadst.c", + "<(jpeg_root)jdatasrc.c", + "<(jpeg_root)jdcoefct.c", + "<(jpeg_root)jdcolor.c", + "<(jpeg_root)jdct.h", + "<(jpeg_root)jddctmgr.c", + "<(jpeg_root)jdhuff.c", + "<(jpeg_root)jdhuff.h", + "<(jpeg_root)jdinput.c", + "<(jpeg_root)jdmainct.c", + "<(jpeg_root)jdmarker.c", + "<(jpeg_root)jdmaster.c", + "<(jpeg_root)jdmerge.c", + "<(jpeg_root)jdphuff.c", + "<(jpeg_root)jdpostct.c", + "<(jpeg_root)jdsample.c", + #"<(jpeg_root)jdtrans.c", + "<(jpeg_root)jerror.c", + "<(jpeg_root)jerror.h", + "<(jpeg_root)jfdctflt.c", + "<(jpeg_root)jfdctfst.c", + "<(jpeg_root)jfdctint.c", + "<(jpeg_root)jidctflt.c", + "<(jpeg_root)jidctfst.c", + "<(jpeg_root)jidctint.c", + "<(jpeg_root)jinclude.h", + + "<(jpeg_root)jidctred.c", + + #"<(jpeg_root)jmemansi.c", + #"<(jpeg_root)jmemdos.c", + #"<(jpeg_root)jmemmac.c", + + "<(jpeg_root)jmemmgr.c", + + #"<(jpeg_root)jmemname.c", + "<(jpeg_root)jmemnobs.c", + #"<(jpeg_root)jpegtran.c", + + "<(jpeg_root)jquant1.c", + "<(jpeg_root)jquant2.c", + + "<(jpeg_root)jmemsys.h", + "<(jpeg_root)jmorecfg.h", + "<(jpeg_root)jpegint.h", + "<(jpeg_root)jpeglib.h", + + "<(jpeg_root)jutils.c", + "<(jpeg_root)jversion.h", + + #"<(jpeg_root)rdbmp.c", + #"<(jpeg_root)rdcolmap.c", + #"<(jpeg_root)rdgif.c", + #"<(jpeg_root)rdjpgcom.c", + #"<(jpeg_root)rdppm.c", + #"<(jpeg_root)rdrle.c", + #"<(jpeg_root)rdswitch.c", + #"<(jpeg_root)rdtarga.c", + #"<(jpeg_root)transupp.c", + #"<(jpeg_root)wrbmp.c", + #"<(jpeg_root)wrgif.c", + #"<(jpeg_root)wrjpgcom.c", + #"<(jpeg_root)wrppm.c", + #"<(jpeg_root)wrrle.c", + #"<(jpeg_root)wrtarga.c", + ], + }, + ] +} diff --git a/static/libpng.gypi b/static/libpng.gypi new file mode 100644 index 000000000..1fd8281f7 --- /dev/null +++ b/static/libpng.gypi @@ -0,0 +1,69 @@ +{ + + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [ + { + 'target_name': 'png', + 'type': 'static_library', + 'include_dirs': [ + '<(libpng_root)', + '../static/custom-include/png/', + '<(zlib_root)', + ], + + 'dependencies': [ + 'zlib.gypi:zlib' + ], + 'defines': [], + 'sources': [ + #"<(libpng_root)arm/arm_init.c", + #"<(libpng_root)contrib/examples/iccfrompng.c", + #"<(libpng_root)contrib/examples/pngpixel.c", + #"<(libpng_root)contrib/examples/pngtopng.c", + #"<(libpng_root)contrib/gregbook/readpng2.c", + #"<(libpng_root)contrib/gregbook/readpng.c", + #"<(libpng_root)contrib/gregbook/readppm.c", + #"<(libpng_root)contrib/gregbook/rpng2-win.c", + #"<(libpng_root)contrib/gregbook/rpng2-x.c", + #"<(libpng_root)contrib/gregbook/rpng-win.c", + #"<(libpng_root)contrib/gregbook/rpng-x.c", + #"<(libpng_root)contrib/gregbook/wpng.c", + #"<(libpng_root)contrib/gregbook/writepng.c", + #"<(libpng_root)contrib/libtests/fakepng.c", + #"<(libpng_root)contrib/libtests/makepng.c", + #"<(libpng_root)contrib/libtests/pngstest.c", + #"<(libpng_root)contrib/libtests/pngunknown.c", + #"<(libpng_root)contrib/libtests/pngvalid.c", + #"<(libpng_root)contrib/libtests/readpng.c", + #"<(libpng_root)contrib/libtests/tarith.c", + #"<(libpng_root)contrib/libtests/timepng.c", + #"<(libpng_root)contrib/pngminus/png2pnm.c", + #"<(libpng_root)contrib/pngminus/pnm2png.c", + #"<(libpng_root)contrib/tools/checksum-icc.c", + #"<(libpng_root)contrib/tools/cvtcolor.c", + #"<(libpng_root)contrib/tools/makesRGB.c", + #"<(libpng_root)contrib/tools/pngfix.c", + #"<(libpng_root)contrib/tools/png-fix-itxt.c", + #"<(libpng_root)contrib/visupng/PngFile.c", + #"<(libpng_root)contrib/visupng/VisualPng.c", + #"<(libpng_root)example.c", + "<(libpng_root)png.c", + "<(libpng_root)pngerror.c", + "<(libpng_root)pngget.c", + "<(libpng_root)pngmem.c", + "<(libpng_root)pngpread.c", + "<(libpng_root)pngread.c", + "<(libpng_root)pngrio.c", + "<(libpng_root)pngrtran.c", + "<(libpng_root)pngrutil.c", + "<(libpng_root)pngset.c", + "<(libpng_root)pngtest.c", + "<(libpng_root)pngtrans.c", + "<(libpng_root)pngwio.c", + "<(libpng_root)pngwrite.c", + "<(libpng_root)pngwtran.c", + "<(libpng_root)pngwutil.c", + ], + }, + ] +} diff --git a/static/locations.gypi b/static/locations.gypi new file mode 100644 index 000000000..03743a3c6 --- /dev/null +++ b/static/locations.gypi @@ -0,0 +1,17 @@ +{ + 'variables': { + 'cairo_root%': "../deps/cairo/", + 'expat_root%': "../deps/expat/", + 'ffi_root%': "../deps/ffi/", + 'fontconfig_root%': "../deps/fontconfig/", + 'freetype_root%': "../deps/freetype/", + 'gif_root%': "../deps/giflib/", + 'glib_root%': "../deps/glib/", + 'harfbuzz_root%': "../deps/harfbuzz/", + 'jpeg_root%': "../deps/libjpeg/", + 'libpng_root%': "../deps/libpng/", + 'pango_root%': "../deps/pango/", + 'pixman_root%': "../deps/pixman/", + 'zlib_root%': "../deps/zlib/", + } +} diff --git a/static/pango.gypi b/static/pango.gypi new file mode 100644 index 000000000..c5782b975 --- /dev/null +++ b/static/pango.gypi @@ -0,0 +1,97 @@ +{ + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [{ + 'target_name': 'pango/mini-fribidi', + 'type': 'static_library', + 'include_dirs': [ + '<(glib_root)', + '<(glib_root)/glib', + 'custom-include/glib', + '<(pango_root)pango/mini-fribidi', + 'custom-include/pango', + ], + 'defines': [ + 'HAVE_CONFIG_H', 'G_DISABLE_CAST_CHECKS', + 'SYSCONFDIR=\"/usr/local/etc\"', 'LIBDIR=\"/usr/local/lib\"' + ], + 'sources': [ + "<(pango_root)pango/mini-fribidi/fribidi.c", + "<(pango_root)pango/mini-fribidi/fribidi_char_type.c", + "<(pango_root)pango/mini-fribidi/fribidi_types.c" + ] + }, { + 'target_name': 'pango', + 'type': 'static_library', + 'include_dirs': [ + '<(pango_root)', + '<(pango_root)pango', + 'custom-include/pango', + '<(cairo_root)cairo', + 'custom-include/cairo', + '<(fontconfig_root)', + '<(freetype_root)/include', + '<(glib_root)', + '<(glib_root)/glib', + 'custom-include/glib', + '<(harfbuzz_root)/src' + ], + 'dependencies': + [ + '../static/cairo.gypi:cairo', + '../static/freetype.gypi:freetype', + '../static/harfbuzz.gypi:harfbuzz', + 'pango/mini-fribidi' + ], + 'defines': [ + 'HAVE_CONFIG_H', 'G_LOG_DOMAIN=\"Pango\"', 'PANGO_ENABLE_BACKEND', + 'PANGO_ENABLE_ENGINE', 'G_DISABLE_CAST_CHECKS', + 'SYSCONFDIR=\"/usr/local/etc\"', 'LIBDIR=\"/usr/local/lib\"' + ], + 'sources': [ + "<(pango_root)pango/break.c", + "<(pango_root)pango/ellipsize.c", + "<(pango_root)pango/fonts.c", + "<(pango_root)pango/glyphstring.c", + "<(pango_root)pango/modules.c", + "<(pango_root)pango/pango-attributes.c", + "<(pango_root)pango/pango-bidi-type.c", + "<(pango_root)pango/pango-color.c", + "<(pango_root)pango/pango-context.c", + "<(pango_root)pango/pango-coverage.c", + "<(pango_root)pango/pango-engine.c", + "<(pango_root)pango/pango-fontmap.c", + "<(pango_root)pango/pango-fontset.c", + "<(pango_root)pango/pango-glyph-item.c", + "<(pango_root)pango/pango-gravity.c", + "<(pango_root)pango/pango-item.c", + "<(pango_root)pango/pango-language.c", + "<(pango_root)pango/pango-layout.c", + "<(pango_root)pango/pango-markup.c", + "<(pango_root)pango/pango-matrix.c", + "<(pango_root)pango/pango-renderer.c", + "<(pango_root)pango/pango-script.c", + "<(pango_root)pango/pango-tabs.c", + "<(pango_root)pango/pango-utils.c", + "<(pango_root)pango/reorder-items.c", + "<(pango_root)pango/shape.c", + "<(pango_root)pango/pango-enum-types.c", + "<(pango_root)pango/pangofc-font.c", + "<(pango_root)pango/pangofc-fontmap.c", + "<(pango_root)pango/pangofc-decoder.c", + "<(pango_root)pango/pangofc-shape.c", + "<(pango_root)pango/pangoft2.c", + "<(pango_root)pango/pangoft2-fontmap.c", + "<(pango_root)pango/pangoft2-render.c", + "<(pango_root)pango/pango-ot-buffer.c", + "<(pango_root)pango/pango-ot-info.c", + "<(pango_root)pango/pango-ot-ruleset.c", + "<(pango_root)pango/pango-ot-tag.c", + "<(pango_root)pango/pangocairo-context.c", + "<(pango_root)pango/pangocairo-font.c", + "<(pango_root)pango/pangocairo-fontmap.c", + "<(pango_root)pango/pangocairo-render.c", + "<(pango_root)pango/pangocairo-fcfont.c", + "<(pango_root)pango/pangocairo-fcfontmap.c", + ] + }] +} diff --git a/static/pixman.gypi b/static/pixman.gypi new file mode 100644 index 000000000..519b0a90b --- /dev/null +++ b/static/pixman.gypi @@ -0,0 +1,54 @@ +{ + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [ + { + 'target_name': 'pixman', + 'type': 'static_library', + 'include_dirs': [ + '../static/custom-include/pixman/', + '<(pixman_root)', + '<(pixman_root)pixman', + ], + 'defines': ['HAVE_CONFIG_H'], + 'sources': [ + "<(pixman_root)pixman/pixman-access-accessors.c", + "<(pixman_root)pixman/pixman-access.c", + "<(pixman_root)pixman/pixman-arm.c", + "<(pixman_root)pixman/pixman-arm-neon.c", + "<(pixman_root)pixman/pixman-arm-simd.c", + "<(pixman_root)pixman/pixman-bits-image.c", + "<(pixman_root)pixman/pixman.c", + "<(pixman_root)pixman/pixman-combine32.c", + "<(pixman_root)pixman/pixman-combine-float.c", + "<(pixman_root)pixman/pixman-conical-gradient.c", + "<(pixman_root)pixman/pixman-edge-accessors.c", + "<(pixman_root)pixman/pixman-edge.c", + "<(pixman_root)pixman/pixman-fast-path.c", + "<(pixman_root)pixman/pixman-filter.c", + "<(pixman_root)pixman/pixman-general.c", + "<(pixman_root)pixman/pixman-glyph.c", + "<(pixman_root)pixman/pixman-gradient-walker.c", + "<(pixman_root)pixman/pixman-image.c", + "<(pixman_root)pixman/pixman-implementation.c", + "<(pixman_root)pixman/pixman-linear-gradient.c", + "<(pixman_root)pixman/pixman-matrix.c", + "<(pixman_root)pixman/pixman-mips.c", + "<(pixman_root)pixman/pixman-mips-dspr2.c", + "<(pixman_root)pixman/pixman-mmx.c", + "<(pixman_root)pixman/pixman-noop.c", + "<(pixman_root)pixman/pixman-ppc.c", + "<(pixman_root)pixman/pixman-radial-gradient.c", + "<(pixman_root)pixman/pixman-region16.c", + "<(pixman_root)pixman/pixman-region32.c", + # "<(pixman_root)pixman/pixman-region.c", + "<(pixman_root)pixman/pixman-solid-fill.c", + "<(pixman_root)pixman/pixman-sse2.c", + "<(pixman_root)pixman/pixman-timer.c", + "<(pixman_root)pixman/pixman-trap.c", + "<(pixman_root)pixman/pixman-utils.c", + # "<(pixman_root)pixman/pixman-vmx.c", + "<(pixman_root)pixman/pixman-x86.c" + ] + } + ] +} diff --git a/static/zlib.gypi b/static/zlib.gypi new file mode 100644 index 000000000..a1df6708e --- /dev/null +++ b/static/zlib.gypi @@ -0,0 +1,54 @@ +{ + 'includes': ['common.gypi', 'locations.gypi'], + 'targets': [ + { + 'target_name': 'zlib', + 'type': 'static_library', + 'include_dirs': ['<(zlib_root)'], + 'sources': [ + "<(zlib_root)adler32.c", + "<(zlib_root)compress.c", + "<(zlib_root)contrib/blast/blast.c", + "<(zlib_root)contrib/infback9/infback9.c", + "<(zlib_root)contrib/infback9/inftree9.c", + "<(zlib_root)contrib/inflate86/inffas86.c", + "<(zlib_root)contrib/masmx64/inffas8664.c", + #"<(zlib_root)contrib/minizip/ioapi.c", + #"<(zlib_root)contrib/minizip/iowin32.c", + #"<(zlib_root)contrib/minizip/miniunz.c", + #"<(zlib_root)contrib/minizip/minizip.c", + #"<(zlib_root)contrib/minizip/mztools.c", + #"<(zlib_root)contrib/minizip/unzip.c", + #"<(zlib_root)contrib/minizip/zip.c", + #"<(zlib_root)contrib/puff/puff.c", + #"<(zlib_root)contrib/puff/pufftest.c", + #"<(zlib_root)contrib/testzlib/testzlib.c", + #"<(zlib_root)contrib/untgz/untgz.c", + "<(zlib_root)crc32.c", + "<(zlib_root)deflate.c", + #"<(zlib_root)examples/enough.c", + #"<(zlib_root)examples/fitblk.c", + #"<(zlib_root)examples/gun.c", + #"<(zlib_root)examples/gzappend.c", + #"<(zlib_root)examples/gzjoin.c", + #"<(zlib_root)examples/gzlog.c", + #"<(zlib_root)examples/zpipe.c", + #"<(zlib_root)examples/zran.c", + "<(zlib_root)gzclose.c", + "<(zlib_root)gzlib.c", + "<(zlib_root)gzread.c", + "<(zlib_root)gzwrite.c", + "<(zlib_root)infback.c", + "<(zlib_root)inffast.c", + "<(zlib_root)inflate.c", + "<(zlib_root)inftrees.c", + #"<(zlib_root)test/example.c", + #"<(zlib_root)test/infcover.c", + #"<(zlib_root)test/minigzip.c", + "<(zlib_root)trees.c", + "<(zlib_root)uncompr.c", + "<(zlib_root)zutil.c", + ], + }, + ] +} diff --git a/test/canvas.test.js b/test/canvas.test.js index b824f8da2..dd59841b5 100644 --- a/test/canvas.test.js +++ b/test/canvas.test.js @@ -21,79 +21,81 @@ describe('Canvas', function () { // afterEach(gc); it('Prototype and ctor are well-shaped, don\'t hit asserts on accessors (GH-803)', function () { - const Canvas = require('../').Canvas; - var c = new Canvas(10, 10); - assert.throws(function () { Canvas.prototype.width; }, /incompatible receiver/); - assert(!c.hasOwnProperty('width')); - assert('width' in c); - assert(Canvas.prototype.hasOwnProperty('width')); - }); + const Canvas = require('../').Canvas + var c = new Canvas(10, 10) + assert.throws(function () { Canvas.prototype.width }, /incompatible receiver/) + assert(!c.hasOwnProperty('width')) + assert('width' in c) + assert(Canvas.prototype.hasOwnProperty('width')) + }) it('.parseFont()', function () { var tests = [ - '20px Arial' - , { size: 20, unit: 'px', family: 'Arial' } - , '20pt Arial' - , { size: 26.666666666666668, unit: 'pt', family: 'Arial' } - , '20.5pt Arial' - , { size: 27.333333333333332, unit: 'pt', family: 'Arial' } - , '20% Arial' - , { size: 20, unit: '%', family: 'Arial' } // TODO I think this is a bad assertion - ZB 23-Jul-2017 - , '20mm Arial' - , { size: 75.59055118110237, unit: 'mm', family: 'Arial' } - , '20px serif' - , { size: 20, unit: 'px', family: 'serif' } - , '20px sans-serif' - , { size: 20, unit: 'px', family: 'sans-serif' } - , '20px monospace' - , { size: 20, unit: 'px', family: 'monospace' } - , '50px Arial, sans-serif' - , { size: 50, unit: 'px', family: 'Arial,sans-serif' } - , 'bold italic 50px Arial, sans-serif' - , { style: 'italic', weight: 'bold', size: 50, unit: 'px', family: 'Arial,sans-serif' } - , '50px Helvetica , Arial, sans-serif' - , { size: 50, unit: 'px', family: 'Helvetica,Arial,sans-serif' } - , '50px "Helvetica Neue", sans-serif' - , { size: 50, unit: 'px', family: 'Helvetica Neue,sans-serif' } - , '50px "Helvetica Neue", "foo bar baz" , sans-serif' - , { size: 50, unit: 'px', family: 'Helvetica Neue,foo bar baz,sans-serif' } - , "50px 'Helvetica Neue'" - , { size: 50, unit: 'px', family: 'Helvetica Neue' } - , 'italic 20px Arial' - , { size: 20, unit: 'px', style: 'italic', family: 'Arial' } - , 'oblique 20px Arial' - , { size: 20, unit: 'px', style: 'oblique', family: 'Arial' } - , 'normal 20px Arial' - , { size: 20, unit: 'px', style: 'normal', family: 'Arial' } - , '300 20px Arial' - , { size: 20, unit: 'px', weight: '300', family: 'Arial' } - , '800 20px Arial' - , { size: 20, unit: 'px', weight: '800', family: 'Arial' } - , 'bolder 20px Arial' - , { size: 20, unit: 'px', weight: 'bolder', family: 'Arial' } - , 'lighter 20px Arial' - , { size: 20, unit: 'px', weight: 'lighter', family: 'Arial' } - , 'normal normal normal 16px Impact' - , { size: 16, unit: 'px', weight: 'normal', family: 'Impact', style: 'normal', variant: 'normal' } - , 'italic small-caps bolder 16px cursive' - , { size: 16, unit: 'px', style: 'italic', variant: 'small-caps', weight: 'bolder', family: 'cursive' } - , '20px "new century schoolbook", serif' - , { size: 20, unit: 'px', family: 'new century schoolbook,serif' } - , '20px "Arial bold 300"' // synthetic case with weight keyword inside family - , { size: 20, unit: 'px', family: 'Arial bold 300', variant: 'normal' } - ]; + '20px Arial', + { size: 20, unit: 'px', family: 'Arial' }, + '20pt Arial', + { size: 26.666666666666668, unit: 'pt', family: 'Arial' }, + '20.5pt Arial', + { size: 27.333333333333332, unit: 'pt', family: 'Arial' }, + '20% Arial', + { size: 20, unit: '%', family: 'Arial' }, // TODO I think this is a bad assertion - ZB 23-Jul-2017 + '20mm Arial', + { size: 75.59055118110237, unit: 'mm', family: 'Arial' }, + '20px serif', + { size: 20, unit: 'px', family: 'serif' }, + '20px sans-serif', + { size: 20, unit: 'px', family: 'sans-serif' }, + '20px monospace', + { size: 20, unit: 'px', family: 'monospace' }, + '50px Arial, sans-serif', + { size: 50, unit: 'px', family: 'Arial,sans-serif' }, + 'bold italic 50px Arial, sans-serif', + { style: 'italic', weight: 'bold', size: 50, unit: 'px', family: 'Arial,sans-serif' }, + '50px Helvetica , Arial, sans-serif', + { size: 50, unit: 'px', family: 'Helvetica,Arial,sans-serif' }, + '50px "Helvetica Neue", sans-serif', + { size: 50, unit: 'px', family: 'Helvetica Neue,sans-serif' }, + '50px "Helvetica Neue", "foo bar baz" , sans-serif', + { size: 50, unit: 'px', family: 'Helvetica Neue,foo bar baz,sans-serif' }, + "50px 'Helvetica Neue'", + { size: 50, unit: 'px', family: 'Helvetica Neue' }, + 'italic 20px Arial', + { size: 20, unit: 'px', style: 'italic', family: 'Arial' }, + 'oblique 20px Arial', + { size: 20, unit: 'px', style: 'oblique', family: 'Arial' }, + 'normal 20px Arial', + { size: 20, unit: 'px', style: 'normal', family: 'Arial' }, + '300 20px Arial', + { size: 20, unit: 'px', weight: '300', family: 'Arial' }, + '800 20px Arial', + { size: 20, unit: 'px', weight: '800', family: 'Arial' }, + 'bolder 20px Arial', + { size: 20, unit: 'px', weight: 'bolder', family: 'Arial' }, + 'lighter 20px Arial', + { size: 20, unit: 'px', weight: 'lighter', family: 'Arial' }, + 'normal normal normal 16px Impact', + { size: 16, unit: 'px', weight: 'normal', family: 'Impact', style: 'normal', variant: 'normal' }, + 'italic small-caps bolder 16px cursive', + { size: 16, unit: 'px', style: 'italic', variant: 'small-caps', weight: 'bolder', family: 'cursive' }, + '20px "new century schoolbook", serif', + { size: 20, unit: 'px', family: 'new century schoolbook,serif' }, + '20px "Arial bold 300"', // synthetic case with weight keyword inside family + { size: 20, unit: 'px', family: 'Arial bold 300', variant: 'normal' } + ] for (var i = 0, len = tests.length; i < len; ++i) { var str = tests[i++] - , expected = tests[i] - , actual = parseFont(str); - if (!expected.style) expected.style = 'normal'; - if (!expected.weight) expected.weight = 'normal'; - if (!expected.stretch) expected.stretch = 'normal'; - if (!expected.variant) expected.variant = 'normal'; + var expected = tests[i] + + var actual = parseFont(str) - assert.deepEqual(actual, expected, 'Failed to parse: ' + str); + if (!expected.style) expected.style = 'normal' + if (!expected.weight) expected.weight = 'normal' + if (!expected.stretch) expected.stretch = 'normal' + if (!expected.variant) expected.variant = 'normal' + + assert.deepEqual(actual, expected, 'Failed to parse: ' + str) } assert.strictEqual(parseFont('Helvetica, sans'), undefined) @@ -101,58 +103,60 @@ describe('Canvas', function () { it('registerFont', function () { // Minimal test to make sure nothing is thrown - registerFont('./examples/pfennigFont/Pfennig.ttf', {family: 'Pfennig'}) - registerFont('./examples/pfennigFont/PfennigBold.ttf', {family: 'Pfennig', weight: 'bold'}) - }); + registerFont('./examples/pfennigFont/Pfennig.ttf', { family: 'Pfennig' }) + registerFont('./examples/pfennigFont/PfennigBold.ttf', { family: 'Pfennig', weight: 'bold' }) + }) it('color serialization', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - ['fillStyle', 'strokeStyle', 'shadowColor'].forEach(function(prop){ - ctx[prop] = '#FFFFFF'; - assert.equal('#ffffff', ctx[prop], prop + ' #FFFFFF -> #ffffff, got ' + ctx[prop]); + var ctx = canvas.getContext('2d'); - ctx[prop] = '#FFF'; - assert.equal('#ffffff', ctx[prop], prop + ' #FFF -> #ffffff, got ' + ctx[prop]); + ['fillStyle', 'strokeStyle', 'shadowColor'].forEach(function (prop) { + ctx[prop] = '#FFFFFF' + assert.equal('#ffffff', ctx[prop], prop + ' #FFFFFF -> #ffffff, got ' + ctx[prop]) - ctx[prop] = 'rgba(128, 200, 128, 1)'; - assert.equal('#80c880', ctx[prop], prop + ' rgba(128, 200, 128, 1) -> #80c880, got ' + ctx[prop]); + ctx[prop] = '#FFF' + assert.equal('#ffffff', ctx[prop], prop + ' #FFF -> #ffffff, got ' + ctx[prop]) - ctx[prop] = 'rgba(128,80,0,0.5)'; - assert.equal('rgba(128, 80, 0, 0.50)', ctx[prop], prop + ' rgba(128,80,0,0.5) -> rgba(128, 80, 0, 0.5), got ' + ctx[prop]); + ctx[prop] = 'rgba(128, 200, 128, 1)' + assert.equal('#80c880', ctx[prop], prop + ' rgba(128, 200, 128, 1) -> #80c880, got ' + ctx[prop]) - ctx[prop] = 'rgba(128,80,0,0.75)'; - assert.equal('rgba(128, 80, 0, 0.75)', ctx[prop], prop + ' rgba(128,80,0,0.75) -> rgba(128, 80, 0, 0.75), got ' + ctx[prop]); + ctx[prop] = 'rgba(128,80,0,0.5)' + assert.equal('rgba(128, 80, 0, 0.50)', ctx[prop], prop + ' rgba(128,80,0,0.5) -> rgba(128, 80, 0, 0.5), got ' + ctx[prop]) - if ('shadowColor' == prop) return; + ctx[prop] = 'rgba(128,80,0,0.75)' + assert.equal('rgba(128, 80, 0, 0.75)', ctx[prop], prop + ' rgba(128,80,0,0.75) -> rgba(128, 80, 0, 0.75), got ' + ctx[prop]) - var grad = ctx.createLinearGradient(0,0,0,150); - ctx[prop] = grad; - assert.strictEqual(grad, ctx[prop], prop + ' pattern getter failed'); - }); - }); + if (prop == 'shadowColor') return + + var grad = ctx.createLinearGradient(0, 0, 0, 150) + ctx[prop] = grad + assert.strictEqual(grad, ctx[prop], prop + ' pattern getter failed') + }) + }) it('color parser', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - ctx.fillStyle = '#ffccaa'; - assert.equal('#ffccaa', ctx.fillStyle); + var ctx = canvas.getContext('2d') - ctx.fillStyle = '#FFCCAA'; - assert.equal('#ffccaa', ctx.fillStyle); + ctx.fillStyle = '#ffccaa' + assert.equal('#ffccaa', ctx.fillStyle) - ctx.fillStyle = '#FCA'; - assert.equal('#ffccaa', ctx.fillStyle); + ctx.fillStyle = '#FFCCAA' + assert.equal('#ffccaa', ctx.fillStyle) - ctx.fillStyle = '#fff'; - ctx.fillStyle = '#FGG'; - assert.equal('#ff0000', ctx.fillStyle); + ctx.fillStyle = '#FCA' + assert.equal('#ffccaa', ctx.fillStyle) - ctx.fillStyle = '#fff'; - ctx.fillStyle = 'afasdfasdf'; - assert.equal('#ffffff', ctx.fillStyle); + ctx.fillStyle = '#fff' + ctx.fillStyle = '#FGG' + assert.equal('#ff0000', ctx.fillStyle) + + ctx.fillStyle = '#fff' + ctx.fillStyle = 'afasdfasdf' + assert.equal('#ffffff', ctx.fillStyle) // #rgba and #rrggbbaa ctx.fillStyle = '#ffccaa80' @@ -164,108 +168,109 @@ describe('Canvas', function () { ctx.fillStyle = '#BEAD' assert.equal('rgba(187, 238, 170, 0.87)', ctx.fillStyle) - ctx.fillStyle = 'rgb(255,255,255)'; - assert.equal('#ffffff', ctx.fillStyle); + ctx.fillStyle = 'rgb(255,255,255)' + assert.equal('#ffffff', ctx.fillStyle) - ctx.fillStyle = 'rgb(0,0,0)'; - assert.equal('#000000', ctx.fillStyle); + ctx.fillStyle = 'rgb(0,0,0)' + assert.equal('#000000', ctx.fillStyle) - ctx.fillStyle = 'rgb( 0 , 0 , 0)'; - assert.equal('#000000', ctx.fillStyle); + ctx.fillStyle = 'rgb( 0 , 0 , 0)' + assert.equal('#000000', ctx.fillStyle) - ctx.fillStyle = 'rgba( 0 , 0 , 0, 1)'; - assert.equal('#000000', ctx.fillStyle); + ctx.fillStyle = 'rgba( 0 , 0 , 0, 1)' + assert.equal('#000000', ctx.fillStyle) - ctx.fillStyle = 'rgba( 255, 200, 90, 0.5)'; - assert.equal('rgba(255, 200, 90, 0.50)', ctx.fillStyle); + ctx.fillStyle = 'rgba( 255, 200, 90, 0.5)' + assert.equal('rgba(255, 200, 90, 0.50)', ctx.fillStyle) - ctx.fillStyle = 'rgba( 255, 200, 90, 0.75)'; - assert.equal('rgba(255, 200, 90, 0.75)', ctx.fillStyle); + ctx.fillStyle = 'rgba( 255, 200, 90, 0.75)' + assert.equal('rgba(255, 200, 90, 0.75)', ctx.fillStyle) - ctx.fillStyle = 'rgba( 255, 200, 90, 0.7555)'; - assert.equal('rgba(255, 200, 90, 0.75)', ctx.fillStyle); + ctx.fillStyle = 'rgba( 255, 200, 90, 0.7555)' + assert.equal('rgba(255, 200, 90, 0.75)', ctx.fillStyle) - ctx.fillStyle = 'rgba( 255, 200, 90, .7555)'; - assert.equal('rgba(255, 200, 90, 0.75)', ctx.fillStyle); + ctx.fillStyle = 'rgba( 255, 200, 90, .7555)' + assert.equal('rgba(255, 200, 90, 0.75)', ctx.fillStyle) - ctx.fillStyle = 'rgb(0, 0, 9000)'; - assert.equal('#0000ff', ctx.fillStyle); + ctx.fillStyle = 'rgb(0, 0, 9000)' + assert.equal('#0000ff', ctx.fillStyle) - ctx.fillStyle = 'rgba(0, 0, 0, 42.42)'; - assert.equal('#000000', ctx.fillStyle); + ctx.fillStyle = 'rgba(0, 0, 0, 42.42)' + assert.equal('#000000', ctx.fillStyle) // hsl / hsla tests - ctx.fillStyle = 'hsl(0, 0%, 0%)'; - assert.equal('#000000', ctx.fillStyle); + ctx.fillStyle = 'hsl(0, 0%, 0%)' + assert.equal('#000000', ctx.fillStyle) - ctx.fillStyle = 'hsl(3600, -10%, -10%)'; - assert.equal('#000000', ctx.fillStyle); + ctx.fillStyle = 'hsl(3600, -10%, -10%)' + assert.equal('#000000', ctx.fillStyle) - ctx.fillStyle = 'hsl(10, 100%, 42%)'; - assert.equal('#d62400', ctx.fillStyle); + ctx.fillStyle = 'hsl(10, 100%, 42%)' + assert.equal('#d62400', ctx.fillStyle) - ctx.fillStyle = 'hsl(370, 120%, 42%)'; - assert.equal('#d62400', ctx.fillStyle); + ctx.fillStyle = 'hsl(370, 120%, 42%)' + assert.equal('#d62400', ctx.fillStyle) - ctx.fillStyle = 'hsl(0, 100%, 100%)'; - assert.equal('#ffffff', ctx.fillStyle); + ctx.fillStyle = 'hsl(0, 100%, 100%)' + assert.equal('#ffffff', ctx.fillStyle) - ctx.fillStyle = 'hsl(0, 150%, 150%)'; - assert.equal('#ffffff', ctx.fillStyle); + ctx.fillStyle = 'hsl(0, 150%, 150%)' + assert.equal('#ffffff', ctx.fillStyle) - ctx.fillStyle = 'hsl(237, 76%, 25%)'; - assert.equal('#0f1470', ctx.fillStyle); + ctx.fillStyle = 'hsl(237, 76%, 25%)' + assert.equal('#0f1470', ctx.fillStyle) - ctx.fillStyle = 'hsl(240, 73%, 25%)'; - assert.equal('#11116e', ctx.fillStyle); + ctx.fillStyle = 'hsl(240, 73%, 25%)' + assert.equal('#11116e', ctx.fillStyle) - ctx.fillStyle = 'hsl(262, 32%, 42%)'; - assert.equal('#62498d', ctx.fillStyle); + ctx.fillStyle = 'hsl(262, 32%, 42%)' + assert.equal('#62498d', ctx.fillStyle) - ctx.fillStyle = 'hsla(0, 0%, 0%, 1)'; - assert.equal('#000000', ctx.fillStyle); + ctx.fillStyle = 'hsla(0, 0%, 0%, 1)' + assert.equal('#000000', ctx.fillStyle) - ctx.fillStyle = 'hsla(0, 100%, 100%, 1)'; - assert.equal('#ffffff', ctx.fillStyle); + ctx.fillStyle = 'hsla(0, 100%, 100%, 1)' + assert.equal('#ffffff', ctx.fillStyle) - ctx.fillStyle = 'hsla(120, 25%, 75%, 0.5)'; - assert.equal('rgba(175, 207, 175, 0.50)', ctx.fillStyle); + ctx.fillStyle = 'hsla(120, 25%, 75%, 0.5)' + assert.equal('rgba(175, 207, 175, 0.50)', ctx.fillStyle) - ctx.fillStyle = 'hsla(240, 75%, 25%, 0.75)'; - assert.equal('rgba(16, 16, 112, 0.75)', ctx.fillStyle); + ctx.fillStyle = 'hsla(240, 75%, 25%, 0.75)' + assert.equal('rgba(16, 16, 112, 0.75)', ctx.fillStyle) - ctx.fillStyle = 'hsla(172.0, 33.00000e0%, 42%, 1)'; - assert.equal('#488e85', ctx.fillStyle); + ctx.fillStyle = 'hsla(172.0, 33.00000e0%, 42%, 1)' + assert.equal('#488e85', ctx.fillStyle) - ctx.fillStyle = 'hsl(124.5, 76.1%, 47.6%)'; - assert.equal('#1dd62b', ctx.fillStyle); + ctx.fillStyle = 'hsl(124.5, 76.1%, 47.6%)' + assert.equal('#1dd62b', ctx.fillStyle) - ctx.fillStyle = 'hsl(1.24e2, 760e-1%, 4.7e1%)'; - assert.equal('#1dd329', ctx.fillStyle); + ctx.fillStyle = 'hsl(1.24e2, 760e-1%, 4.7e1%)' + assert.equal('#1dd329', ctx.fillStyle) // case-insensitive (#235) - ctx.fillStyle = "sILveR"; - assert.equal(ctx.fillStyle, "#c0c0c0"); - }); + ctx.fillStyle = 'sILveR' + assert.equal(ctx.fillStyle, '#c0c0c0') + }) it('Canvas#type', function () { - var canvas = createCanvas(10, 10); - assert.equal(canvas.type, 'image'); - var canvas = createCanvas(10, 10, 'pdf'); - assert.equal(canvas.type, 'pdf'); - var canvas = createCanvas(10, 10, 'svg'); - assert.equal(canvas.type, 'svg'); - var canvas = createCanvas(10, 10, 'hey'); - assert.equal(canvas.type, 'image'); - }); + var canvas = createCanvas(10, 10) + assert.equal(canvas.type, 'image') + var canvas = createCanvas(10, 10, 'pdf') + assert.equal(canvas.type, 'pdf') + var canvas = createCanvas(10, 10, 'svg') + assert.equal(canvas.type, 'svg') + + assert.throws(function () { createCanvas(10, 10, 'hey'); }, /RangeError/); + }) it('Canvas#getContext("2d")', function () { var canvas = createCanvas(200, 300) - , ctx = canvas.getContext('2d'); - assert.ok('object' == typeof ctx); - assert.equal(canvas, ctx.canvas, 'context.canvas is not canvas'); - assert.equal(ctx, canvas.context, 'canvas.context is not context'); + + var ctx = canvas.getContext('2d') + assert.ok(typeof ctx === 'object') + assert.equal(canvas, ctx.canvas, 'context.canvas is not canvas') + assert.equal(ctx, canvas.context, 'canvas.context is not context') const MAX_IMAGE_SIZE = 32767; @@ -280,77 +285,76 @@ describe('Canvas', function () { [Math.pow(2, 30), 0, 3], [Math.pow(2, 30), 1, 3], [Math.pow(2, 32), 0, 1], - [Math.pow(2, 32), 1, 1], + [Math.pow(2, 32), 1, 1] ].forEach(params => { - var width = params[0]; - var height = params[1]; - var errorLevel = params[2]; + var width = params[0] + var height = params[1] + var errorLevel = params[2] - var level = 3; + var level = 3 try { - var canvas = createCanvas(width, height); - level--; + var canvas = createCanvas(width, height) + level-- - var ctx = canvas.getContext('2d'); - level--; + var ctx = canvas.getContext('2d') + level-- - ctx.getImageData(0, 0, 1, 1); - level--; + ctx.getImageData(0, 0, 1, 1) + level-- } catch (err) {} - if (errorLevel !== null) - assert.strictEqual(level, errorLevel); - }); - }); + if (errorLevel !== null) { assert.strictEqual(level, errorLevel) } + }) + }) it('Canvas#getContext("2d", {pixelFormat: string})', function () { - var canvas, context; + var canvas, context // default: - canvas = createCanvas(10, 10); - context = canvas.getContext("2d", {pixelFormat: "RGBA32"}); - assert.equal(context.pixelFormat, "RGBA32"); + canvas = createCanvas(10, 10) + context = canvas.getContext('2d', { pixelFormat: 'RGBA32' }) + assert.equal(context.pixelFormat, 'RGBA32') - canvas = createCanvas(10, 10); - context = canvas.getContext("2d", {pixelFormat: "RGBA32"}); - assert.equal(context.pixelFormat, "RGBA32"); + canvas = createCanvas(10, 10) + context = canvas.getContext('2d', { pixelFormat: 'RGBA32' }) + assert.equal(context.pixelFormat, 'RGBA32') - canvas = createCanvas(10, 10); - context = canvas.getContext("2d", {pixelFormat: "RGB24"}); - assert.equal(context.pixelFormat, "RGB24"); + canvas = createCanvas(10, 10) + context = canvas.getContext('2d', { pixelFormat: 'RGB24' }) + assert.equal(context.pixelFormat, 'RGB24') - canvas = createCanvas(10, 10); - context = canvas.getContext("2d", {pixelFormat: "A8"}); - assert.equal(context.pixelFormat, "A8"); + canvas = createCanvas(10, 10) + context = canvas.getContext('2d', { pixelFormat: 'A8' }) + assert.equal(context.pixelFormat, 'A8') - canvas = createCanvas(10, 10); - context = canvas.getContext("2d", {pixelFormat: "A1"}); - assert.equal(context.pixelFormat, "A1"); + canvas = createCanvas(10, 10) + context = canvas.getContext('2d', { pixelFormat: 'A1' }) + assert.equal(context.pixelFormat, 'A1') - canvas = createCanvas(10, 10); - context = canvas.getContext("2d", {pixelFormat: "RGB16_565"}); - assert.equal(context.pixelFormat, "RGB16_565"); + canvas = createCanvas(10, 10) + context = canvas.getContext('2d', { pixelFormat: 'RGB16_565' }) + assert.equal(context.pixelFormat, 'RGB16_565') // Not tested: RGB30 - }); + }) it('Canvas#getContext("2d", {alpha: boolean})', function () { - var canvas, context; + var canvas, context - canvas = createCanvas(10, 10); - context = canvas.getContext("2d", {alpha: true}); - assert.equal(context.pixelFormat, "RGBA32"); + canvas = createCanvas(10, 10) + context = canvas.getContext('2d', { alpha: true }) + assert.equal(context.pixelFormat, 'RGBA32') - canvas = createCanvas(10, 10); - context = canvas.getContext("2d", {alpha: false}); - assert.equal(context.pixelFormat, "RGB24"); + canvas = createCanvas(10, 10) + context = canvas.getContext('2d', { alpha: false }) + assert.equal(context.pixelFormat, 'RGB24') // alpha takes priority: - canvas = createCanvas(10, 10); - context = canvas.getContext("2d", {pixelFormat: "RGBA32", alpha: false}); - assert.equal(context.pixelFormat, "RGB24"); - }); + canvas = createCanvas(10, 10) + context = canvas.getContext('2d', { pixelFormat: 'RGBA32', alpha: false }) + assert.equal(context.pixelFormat, 'RGB24') + }) it('Canvas#{width,height}=', function () { const canvas = createCanvas(100, 200); @@ -400,39 +404,41 @@ describe('Canvas', function () { myCanvas.width = 120; }); - it('Canvas#stride', function() { - var canvas = createCanvas(24, 10); - assert.ok(canvas.stride >= 24, 'canvas.stride is too short'); - assert.ok(canvas.stride < 1024, 'canvas.stride seems too long'); + it('Canvas#stride', function () { + var canvas = createCanvas(24, 10) + assert.ok(canvas.stride >= 24, 'canvas.stride is too short') + assert.ok(canvas.stride < 1024, 'canvas.stride seems too long') // TODO test stride on other formats - }); + }) it('Canvas#getContext("invalid")', function () { - assert.equal(null, createCanvas(200, 300).getContext('invalid')); - }); + assert.equal(null, createCanvas(200, 300).getContext('invalid')) + }) it('Context2d#patternQuality', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - assert.equal('good', ctx.patternQuality); - ctx.patternQuality = 'best'; - assert.equal('best', ctx.patternQuality); - ctx.patternQuality = 'invalid'; - assert.equal('best', ctx.patternQuality); - }); + var ctx = canvas.getContext('2d') + + assert.equal('good', ctx.patternQuality) + ctx.patternQuality = 'best' + assert.equal('best', ctx.patternQuality) + ctx.patternQuality = 'invalid' + assert.equal('best', ctx.patternQuality) + }) it('Context2d#imageSmoothingEnabled', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - assert.equal(true, ctx.imageSmoothingEnabled); - ctx.imageSmoothingEnabled = false; - assert.equal('good', ctx.patternQuality); - assert.equal(false, ctx.imageSmoothingEnabled); - assert.equal('good', ctx.patternQuality); - }); + var ctx = canvas.getContext('2d') + + assert.equal(true, ctx.imageSmoothingEnabled) + ctx.imageSmoothingEnabled = false + assert.equal('good', ctx.patternQuality) + assert.equal(false, ctx.imageSmoothingEnabled) + assert.equal('good', ctx.patternQuality) + }) it('Context2d#font=', function () { const canvas = createCanvas(200, 200) @@ -448,111 +454,118 @@ describe('Canvas', function () { it('Context2d#lineWidth=', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - - ctx.lineWidth = 10.0; - assert.equal(10, ctx.lineWidth); - ctx.lineWidth = Infinity; - assert.equal(10, ctx.lineWidth); - ctx.lineWidth = -Infinity; - assert.equal(10, ctx.lineWidth); - ctx.lineWidth = -5; - assert.equal(10, ctx.lineWidth); - ctx.lineWidth = 0; - assert.equal(10, ctx.lineWidth); - }); + + var ctx = canvas.getContext('2d') + + ctx.lineWidth = 10.0 + assert.equal(10, ctx.lineWidth) + ctx.lineWidth = Infinity + assert.equal(10, ctx.lineWidth) + ctx.lineWidth = -Infinity + assert.equal(10, ctx.lineWidth) + ctx.lineWidth = -5 + assert.equal(10, ctx.lineWidth) + ctx.lineWidth = 0 + assert.equal(10, ctx.lineWidth) + }) it('Context2d#antiAlias=', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - - assert.equal('default', ctx.antialias); - ctx.antialias = 'none'; - assert.equal('none', ctx.antialias); - ctx.antialias = 'gray'; - assert.equal('gray', ctx.antialias); - ctx.antialias = 'subpixel'; - assert.equal('subpixel', ctx.antialias); - ctx.antialias = 'invalid'; - assert.equal('subpixel', ctx.antialias); - ctx.antialias = 1; - assert.equal('subpixel', ctx.antialias); - }); + + var ctx = canvas.getContext('2d') + + assert.equal('default', ctx.antialias) + ctx.antialias = 'none' + assert.equal('none', ctx.antialias) + ctx.antialias = 'gray' + assert.equal('gray', ctx.antialias) + ctx.antialias = 'subpixel' + assert.equal('subpixel', ctx.antialias) + ctx.antialias = 'invalid' + assert.equal('subpixel', ctx.antialias) + ctx.antialias = 1 + assert.equal('subpixel', ctx.antialias) + }) it('Context2d#lineCap=', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - assert.equal('butt', ctx.lineCap); - ctx.lineCap = 'round'; - assert.equal('round', ctx.lineCap); - }); + var ctx = canvas.getContext('2d') + + assert.equal('butt', ctx.lineCap) + ctx.lineCap = 'round' + assert.equal('round', ctx.lineCap) + }) it('Context2d#lineJoin=', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - assert.equal('miter', ctx.lineJoin); - ctx.lineJoin = 'round'; - assert.equal('round', ctx.lineJoin); - }); + var ctx = canvas.getContext('2d') + + assert.equal('miter', ctx.lineJoin) + ctx.lineJoin = 'round' + assert.equal('round', ctx.lineJoin) + }) it('Context2d#globalAlpha=', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - assert.equal(1, ctx.globalAlpha); + var ctx = canvas.getContext('2d') + + assert.equal(1, ctx.globalAlpha) ctx.globalAlpha = 0.5 - assert.equal(0.5, ctx.globalAlpha); - }); + assert.equal(0.5, ctx.globalAlpha) + }) it('Context2d#isPointInPath()', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - - ctx.rect(5,5,100,100); - ctx.rect(50,100,10,10); - assert.ok(ctx.isPointInPath(10,10)); - assert.ok(ctx.isPointInPath(10,50)); - assert.ok(ctx.isPointInPath(100,100)); - assert.ok(ctx.isPointInPath(105,105)); - assert.ok(!ctx.isPointInPath(106,105)); - assert.ok(!ctx.isPointInPath(150,150)); - - assert.ok(ctx.isPointInPath(50,110)); - assert.ok(ctx.isPointInPath(60,110)); - assert.ok(!ctx.isPointInPath(70,110)); - assert.ok(!ctx.isPointInPath(50,120)); - }); + + var ctx = canvas.getContext('2d') + + ctx.rect(5, 5, 100, 100) + ctx.rect(50, 100, 10, 10) + assert.ok(ctx.isPointInPath(10, 10)) + assert.ok(ctx.isPointInPath(10, 50)) + assert.ok(ctx.isPointInPath(100, 100)) + assert.ok(ctx.isPointInPath(105, 105)) + assert.ok(!ctx.isPointInPath(106, 105)) + assert.ok(!ctx.isPointInPath(150, 150)) + + assert.ok(ctx.isPointInPath(50, 110)) + assert.ok(ctx.isPointInPath(60, 110)) + assert.ok(!ctx.isPointInPath(70, 110)) + assert.ok(!ctx.isPointInPath(50, 120)) + }) it('Context2d#textAlign', function () { - var canvas = createCanvas(200,200) - , ctx = canvas.getContext('2d'); - - assert.equal('start', ctx.textAlign); - ctx.textAlign = 'center'; - assert.equal('center', ctx.textAlign); - ctx.textAlign = 'right'; - assert.equal('right', ctx.textAlign); - ctx.textAlign = 'end'; - assert.equal('end', ctx.textAlign); - ctx.textAlign = 'fail'; - assert.equal('end', ctx.textAlign); - }); + var canvas = createCanvas(200, 200) + + var ctx = canvas.getContext('2d') + + assert.equal('start', ctx.textAlign) + ctx.textAlign = 'center' + assert.equal('center', ctx.textAlign) + ctx.textAlign = 'right' + assert.equal('right', ctx.textAlign) + ctx.textAlign = 'end' + assert.equal('end', ctx.textAlign) + ctx.textAlign = 'fail' + assert.equal('end', ctx.textAlign) + }) describe('#toBuffer', function () { it('Canvas#toBuffer()', function () { - var buf = createCanvas(200,200).toBuffer(); - assert.equal('PNG', buf.slice(1,4).toString()); - }); + var buf = createCanvas(200, 200).toBuffer() + assert.equal('PNG', buf.slice(1, 4).toString()) + }) it('Canvas#toBuffer("image/png")', function () { - var buf = createCanvas(200,200).toBuffer('image/png'); - assert.equal('PNG', buf.slice(1,4).toString()); - }); + var buf = createCanvas(200, 200).toBuffer('image/png') + assert.equal('PNG', buf.slice(1, 4).toString()) + }) it('Canvas#toBuffer("image/png", {resolution: 96})', function () { - const buf = createCanvas(200, 200).toBuffer('image/png', {resolution: 96}); + const buf = createCanvas(200, 200).toBuffer('image/png', { resolution: 96 }) // 3780 ppm ~= 96 ppi let foundpHYs = false; for (let i = 0; i < buf.length - 12; i++) { @@ -575,73 +588,74 @@ describe('Canvas', function () { }) it('Canvas#toBuffer("image/png", {compressionLevel: 5})', function () { - var buf = createCanvas(200,200).toBuffer('image/png', {compressionLevel: 5}); - assert.equal('PNG', buf.slice(1,4).toString()); - }); + var buf = createCanvas(200, 200).toBuffer('image/png', { compressionLevel: 5 }) + assert.equal('PNG', buf.slice(1, 4).toString()) + }) it('Canvas#toBuffer("image/jpeg")', function () { - var buf = createCanvas(200,200).toBuffer('image/jpeg'); - assert.equal(buf[0], 0xff); - assert.equal(buf[1], 0xd8); - assert.equal(buf[buf.byteLength - 2], 0xff); - assert.equal(buf[buf.byteLength - 1], 0xd9); - }); + var buf = createCanvas(200, 200).toBuffer('image/jpeg') + assert.equal(buf[0], 0xff) + assert.equal(buf[1], 0xd8) + assert.equal(buf[buf.byteLength - 2], 0xff) + assert.equal(buf[buf.byteLength - 1], 0xd9) + }) it('Canvas#toBuffer("image/jpeg", {quality: 0.95})', function () { - var buf = createCanvas(200,200).toBuffer('image/jpeg', {quality: 0.95}); - assert.equal(buf[0], 0xff); - assert.equal(buf[1], 0xd8); - assert.equal(buf[buf.byteLength - 2], 0xff); - assert.equal(buf[buf.byteLength - 1], 0xd9); - }); + var buf = createCanvas(200, 200).toBuffer('image/jpeg', { quality: 0.95 }) + assert.equal(buf[0], 0xff) + assert.equal(buf[1], 0xd8) + assert.equal(buf[buf.byteLength - 2], 0xff) + assert.equal(buf[buf.byteLength - 1], 0xd9) + }) it('Canvas#toBuffer(callback)', function (done) { - createCanvas(200, 200).toBuffer(function(err, buf){ - assert.ok(!err); - assert.equal('PNG', buf.slice(1,4).toString()); - done(); - }); - }); + createCanvas(200, 200).toBuffer(function (err, buf) { + assert.ok(!err) + assert.equal('PNG', buf.slice(1, 4).toString()) + done() + }) + }) it('Canvas#toBuffer(callback, "image/jpeg")', function (done) { - createCanvas(200,200).toBuffer(function (err, buf) { - assert.ok(!err); - assert.equal(buf[0], 0xff); - assert.equal(buf[1], 0xd8); - assert.equal(buf[buf.byteLength - 2], 0xff); - assert.equal(buf[buf.byteLength - 1], 0xd9); - done(); - }, 'image/jpeg'); - }); + createCanvas(200, 200).toBuffer(function (err, buf) { + assert.ok(!err) + assert.equal(buf[0], 0xff) + assert.equal(buf[1], 0xd8) + assert.equal(buf[buf.byteLength - 2], 0xff) + assert.equal(buf[buf.byteLength - 1], 0xd9) + done() + }, 'image/jpeg') + }) it('Canvas#toBuffer(callback, "image/jpeg", {quality: 0.95})', function (done) { - createCanvas(200,200).toBuffer(function (err, buf) { - assert.ok(!err); - assert.equal(buf[0], 0xff); - assert.equal(buf[1], 0xd8); - assert.equal(buf[buf.byteLength - 2], 0xff); - assert.equal(buf[buf.byteLength - 1], 0xd9); - done(); - }, 'image/jpeg', {quality: 0.95}); - }); + createCanvas(200, 200).toBuffer(function (err, buf) { + assert.ok(!err) + assert.equal(buf[0], 0xff) + assert.equal(buf[1], 0xd8) + assert.equal(buf[buf.byteLength - 2], 0xff) + assert.equal(buf[buf.byteLength - 1], 0xd9) + done() + }, 'image/jpeg', { quality: 0.95 }) + }) - describe('#toBuffer("raw")', function() { + describe('#toBuffer("raw")', function () { var canvas = createCanvas(11, 10) - , ctx = canvas.getContext('2d'); - ctx.clearRect(0, 0, 11, 10); + var ctx = canvas.getContext('2d') + + ctx.clearRect(0, 0, 11, 10) - ctx.fillStyle = 'rgba(200, 200, 200, 0.505)'; - ctx.fillRect(0, 0, 5, 5); + ctx.fillStyle = 'rgba(200, 200, 200, 0.505)' + ctx.fillRect(0, 0, 5, 5) - ctx.fillStyle = 'red'; - ctx.fillRect(5, 0, 5, 5); + ctx.fillStyle = 'red' + ctx.fillRect(5, 0, 5, 5) - ctx.fillStyle = '#00ff00'; - ctx.fillRect(0, 5, 5, 5); + ctx.fillStyle = '#00ff00' + ctx.fillRect(0, 5, 5, 5) - ctx.fillStyle = 'black'; - ctx.fillRect(5, 5, 4, 5); + ctx.fillStyle = 'black' + ctx.fillRect(5, 5, 4, 5) /** Output: * *****RRRRR- @@ -656,284 +670,291 @@ describe('Canvas', function () { * GGGGGBBBB-- */ - var buf = canvas.toBuffer('raw'); - var stride = canvas.stride; + var buf = canvas.toBuffer('raw') + var stride = canvas.stride - var endianness = os.endianness(); + var endianness = os.endianness() - function assertPixel(u32, x, y, message) { - var expected = '0x' + u32.toString(16); + function assertPixel (u32, x, y, message) { + var expected = '0x' + u32.toString(16) // Buffer doesn't have readUInt32(): it only has readUInt32LE() and // readUInt32BE(). - var px = buf['readUInt32' + endianness](y * stride + x * 4); - var actual = '0x' + px.toString(16); + var px = buf['readUInt32' + endianness](y * stride + x * 4) + var actual = '0x' + px.toString(16) - assert.equal(actual, expected, message); + assert.equal(actual, expected, message) } - it('should have the correct size', function() { - assert.equal(buf.length, stride * 10); - }); - - it('does not premultiply alpha', function() { - assertPixel(0x80646464, 0, 0, 'first semitransparent pixel'); - assertPixel(0x80646464, 4, 4, 'last semitransparent pixel'); - }); - - it('draws red', function() { - assertPixel(0xffff0000, 5, 0, 'first red pixel'); - assertPixel(0xffff0000, 9, 4, 'last red pixel'); - }); - - it('draws green', function() { - assertPixel(0xff00ff00, 0, 5, 'first green pixel'); - assertPixel(0xff00ff00, 4, 9, 'last green pixel'); - }); - - it('draws black', function() { - assertPixel(0xff000000, 5, 5, 'first black pixel'); - assertPixel(0xff000000, 8, 9, 'last black pixel'); - }); - - it('leaves undrawn pixels black, transparent', function() { - assertPixel(0x0, 9, 5, 'first undrawn pixel'); - assertPixel(0x0, 9, 9, 'last undrawn pixel'); - }); - - it('is immutable', function() { - ctx.fillStyle = 'white'; - ctx.fillRect(0, 0, 10, 10); - canvas.toBuffer('raw'); // (side-effect: flushes canvas) - assertPixel(0xffff0000, 5, 0, 'first red pixel'); - }); - }); - }); + it('should have the correct size', function () { + assert.equal(buf.length, stride * 10) + }) + + it('does not premultiply alpha', function () { + assertPixel(0x80646464, 0, 0, 'first semitransparent pixel') + assertPixel(0x80646464, 4, 4, 'last semitransparent pixel') + }) + + it('draws red', function () { + assertPixel(0xffff0000, 5, 0, 'first red pixel') + assertPixel(0xffff0000, 9, 4, 'last red pixel') + }) + + it('draws green', function () { + assertPixel(0xff00ff00, 0, 5, 'first green pixel') + assertPixel(0xff00ff00, 4, 9, 'last green pixel') + }) + + it('draws black', function () { + assertPixel(0xff000000, 5, 5, 'first black pixel') + assertPixel(0xff000000, 8, 9, 'last black pixel') + }) + + it('leaves undrawn pixels black, transparent', function () { + assertPixel(0x0, 9, 5, 'first undrawn pixel') + assertPixel(0x0, 9, 9, 'last undrawn pixel') + }) + + it('is immutable', function () { + ctx.fillStyle = 'white' + ctx.fillRect(0, 0, 10, 10) + canvas.toBuffer('raw') // (side-effect: flushes canvas) + assertPixel(0xffff0000, 5, 0, 'first red pixel') + }) + }) + }) describe('#toDataURL()', function () { var canvas = createCanvas(200, 200) - , ctx = canvas.getContext('2d'); - ctx.fillRect(0,0,100,100); - ctx.fillStyle = 'red'; - ctx.fillRect(100,0,100,100); + var ctx = canvas.getContext('2d') + + ctx.fillRect(0, 0, 100, 100) + ctx.fillStyle = 'red' + ctx.fillRect(100, 0, 100, 100) it('toDataURL() works and defaults to PNG', function () { - assert.ok(canvas.toDataURL().startsWith('data:image/png;base64,')); - }); + assert.ok(canvas.toDataURL().startsWith('data:image/png;base64,')) + }) it('toDataURL(0.5) works and defaults to PNG', function () { - assert.ok(canvas.toDataURL(0.5).startsWith('data:image/png;base64,')); - }); + assert.ok(canvas.toDataURL(0.5).startsWith('data:image/png;base64,')) + }) it('toDataURL(undefined) works and defaults to PNG', function () { - assert.ok(canvas.toDataURL(undefined).startsWith('data:image/png;base64,')); - }); + assert.ok(canvas.toDataURL(undefined).startsWith('data:image/png;base64,')) + }) it('toDataURL("image/png") works', function () { - assert.ok(canvas.toDataURL('image/png').startsWith('data:image/png;base64,')); - }); + assert.ok(canvas.toDataURL('image/png').startsWith('data:image/png;base64,')) + }) it('toDataURL("image/png", 0.5) works', function () { - assert.ok(canvas.toDataURL('image/png').startsWith('data:image/png;base64,')); - }); + assert.ok(canvas.toDataURL('image/png').startsWith('data:image/png;base64,')) + }) it('toDataURL("iMaGe/PNg") works', function () { - assert.ok(canvas.toDataURL('iMaGe/PNg').startsWith('data:image/png;base64,')); - }); + assert.ok(canvas.toDataURL('iMaGe/PNg').startsWith('data:image/png;base64,')) + }) it('toDataURL("image/jpeg") works', function () { - assert.ok(canvas.toDataURL('image/jpeg').startsWith('data:image/jpeg;base64,')); - }); + assert.ok(canvas.toDataURL('image/jpeg').startsWith('data:image/jpeg;base64,')) + }) it('toDataURL(function (err, str) {...}) works and defaults to PNG', function (done) { - createCanvas(200,200).toDataURL(function(err, str){ - assert.ifError(err); - assert.ok(0 === str.indexOf('data:image/png;base64,')); - done(); - }); - }); + createCanvas(200, 200).toDataURL(function (err, str) { + assert.ifError(err) + assert.ok(str.indexOf('data:image/png;base64,') === 0) + done() + }) + }) it('toDataURL(function (err, str) {...}) is async even with no canvas data', function (done) { - createCanvas().toDataURL(function(err, str){ - assert.ifError(err); - assert.ok('data:,' === str); - done(); - }); - }); + createCanvas().toDataURL(function (err, str) { + assert.ifError(err) + assert.ok(str === 'data:,') + done() + }) + }) it('toDataURL(0.5, function (err, str) {...}) works and defaults to PNG', function (done) { - createCanvas(200,200).toDataURL(0.5, function(err, str){ - assert.ifError(err); - assert.ok(0 === str.indexOf('data:image/png;base64,')); - done(); - }); - }); + createCanvas(200, 200).toDataURL(0.5, function (err, str) { + assert.ifError(err) + assert.ok(str.indexOf('data:image/png;base64,') === 0) + done() + }) + }) it('toDataURL(undefined, function (err, str) {...}) works and defaults to PNG', function (done) { - createCanvas(200,200).toDataURL(undefined, function(err, str){ - assert.ifError(err); - assert.ok(0 === str.indexOf('data:image/png;base64,')); - done(); - }); - }); + createCanvas(200, 200).toDataURL(undefined, function (err, str) { + assert.ifError(err) + assert.ok(str.indexOf('data:image/png;base64,') === 0) + done() + }) + }) it('toDataURL("image/png", function (err, str) {...}) works', function (done) { - createCanvas(200,200).toDataURL('image/png', function(err, str){ - assert.ifError(err); - assert.ok(0 === str.indexOf('data:image/png;base64,')); - done(); - }); - }); + createCanvas(200, 200).toDataURL('image/png', function (err, str) { + assert.ifError(err) + assert.ok(str.indexOf('data:image/png;base64,') === 0) + done() + }) + }) it('toDataURL("image/png", 0.5, function (err, str) {...}) works', function (done) { - createCanvas(200,200).toDataURL('image/png', 0.5, function(err, str){ - assert.ifError(err); - assert.ok(0 === str.indexOf('data:image/png;base64,')); - done(); - }); - }); + createCanvas(200, 200).toDataURL('image/png', 0.5, function (err, str) { + assert.ifError(err) + assert.ok(str.indexOf('data:image/png;base64,') === 0) + done() + }) + }) it('toDataURL("image/png", {}) works', function () { - assert.ok(canvas.toDataURL('image/png', {}).startsWith('data:image/png;base64,')); - }); + assert.ok(canvas.toDataURL('image/png', {}).startsWith('data:image/png;base64,')) + }) it('toDataURL("image/jpeg", {}) works', function () { - assert.ok(canvas.toDataURL('image/jpeg', {}).startsWith('data:image/jpeg;base64,')); - }); + assert.ok(canvas.toDataURL('image/jpeg', {}).startsWith('data:image/jpeg;base64,')) + }) it('toDataURL("image/jpeg", function (err, str) {...}) works', function (done) { - createCanvas(200,200).toDataURL('image/jpeg', function(err, str){ - assert.ifError(err); - assert.ok(0 === str.indexOf('data:image/jpeg;base64,')); - done(); - }); - }); + createCanvas(200, 200).toDataURL('image/jpeg', function (err, str) { + assert.ifError(err) + assert.ok(str.indexOf('data:image/jpeg;base64,') === 0) + done() + }) + }) it('toDataURL("iMAge/JPEG", function (err, str) {...}) works', function (done) { - createCanvas(200,200).toDataURL('iMAge/JPEG', function(err, str){ - assert.ifError(err); - assert.ok(0 === str.indexOf('data:image/jpeg;base64,')); - done(); - }); - }); + createCanvas(200, 200).toDataURL('iMAge/JPEG', function (err, str) { + assert.ifError(err) + assert.ok(str.indexOf('data:image/jpeg;base64,') === 0) + done() + }) + }) it('toDataURL("image/jpeg", undefined, function (err, str) {...}) works', function (done) { - createCanvas(200,200).toDataURL('image/jpeg', undefined, function(err, str){ - assert.ifError(err); - assert.ok(0 === str.indexOf('data:image/jpeg;base64,')); - done(); - }); - }); + createCanvas(200, 200).toDataURL('image/jpeg', undefined, function (err, str) { + assert.ifError(err) + assert.ok(str.indexOf('data:image/jpeg;base64,') === 0) + done() + }) + }) it('toDataURL("image/jpeg", 0.5, function (err, str) {...}) works', function (done) { - createCanvas(200,200).toDataURL('image/jpeg', 0.5, function(err, str){ - assert.ifError(err); - assert.ok(0 === str.indexOf('data:image/jpeg;base64,')); - done(); - }); - }); + createCanvas(200, 200).toDataURL('image/jpeg', 0.5, function (err, str) { + assert.ifError(err) + assert.ok(str.indexOf('data:image/jpeg;base64,') === 0) + done() + }) + }) it('toDataURL("image/jpeg", opts, function (err, str) {...}) works', function (done) { - createCanvas(200,200).toDataURL('image/jpeg', {quality: 100}, function(err, str){ - assert.ifError(err); - assert.ok(0 === str.indexOf('data:image/jpeg;base64,')); - done(); - }); - }); - }); + createCanvas(200, 200).toDataURL('image/jpeg', { quality: 100 }, function (err, str) { + assert.ifError(err) + assert.ok(str.indexOf('data:image/jpeg;base64,') === 0) + done() + }) + }) + }) describe('Context2d#createImageData(width, height)', function () { - it("works", function () { + it('works', function () { var canvas = createCanvas(20, 20) - , ctx = canvas.getContext('2d'); - var imageData = ctx.createImageData(2,6); - assert.equal(2, imageData.width); - assert.equal(6, imageData.height); - assert.equal(2 * 6 * 4, imageData.data.length); + var ctx = canvas.getContext('2d') - assert.equal(0, imageData.data[0]); - assert.equal(0, imageData.data[1]); - assert.equal(0, imageData.data[2]); - assert.equal(0, imageData.data[3]); - }); + var imageData = ctx.createImageData(2, 6) + assert.equal(2, imageData.width) + assert.equal(6, imageData.height) + assert.equal(2 * 6 * 4, imageData.data.length) - it("works, A8 format", function () { + assert.equal(0, imageData.data[0]) + assert.equal(0, imageData.data[1]) + assert.equal(0, imageData.data[2]) + assert.equal(0, imageData.data[3]) + }) + + it('works, A8 format', function () { var canvas = createCanvas(20, 20) - , ctx = canvas.getContext('2d', {pixelFormat: "A8"}); - var imageData = ctx.createImageData(2,6); - assert.equal(2, imageData.width); - assert.equal(6, imageData.height); - assert.equal(2 * 6 * 1, imageData.data.length); + var ctx = canvas.getContext('2d', { pixelFormat: 'A8' }) - assert.equal(0, imageData.data[0]); - assert.equal(0, imageData.data[1]); - assert.equal(0, imageData.data[2]); - assert.equal(0, imageData.data[3]); - }); + var imageData = ctx.createImageData(2, 6) + assert.equal(2, imageData.width) + assert.equal(6, imageData.height) + assert.equal(2 * 6 * 1, imageData.data.length) + + assert.equal(0, imageData.data[0]) + assert.equal(0, imageData.data[1]) + assert.equal(0, imageData.data[2]) + assert.equal(0, imageData.data[3]) + }) - it("works, A1 format", function () { + it('works, A1 format', function () { var canvas = createCanvas(20, 20) - , ctx = canvas.getContext('2d', {pixelFormat: "A1"}); - var imageData = ctx.createImageData(2,6); - assert.equal(2, imageData.width); - assert.equal(6, imageData.height); - assert.equal(Math.ceil(2 * 6 / 8), imageData.data.length); + var ctx = canvas.getContext('2d', { pixelFormat: 'A1' }) - assert.equal(0, imageData.data[0]); - assert.equal(0, imageData.data[1]); - }); + var imageData = ctx.createImageData(2, 6) + assert.equal(2, imageData.width) + assert.equal(6, imageData.height) + assert.equal(Math.ceil(2 * 6 / 8), imageData.data.length) + + assert.equal(0, imageData.data[0]) + assert.equal(0, imageData.data[1]) + }) - it("works, RGB24 format", function () { + it('works, RGB24 format', function () { var canvas = createCanvas(20, 20) - , ctx = canvas.getContext('2d', {pixelFormat: "RGB24"}); - var imageData = ctx.createImageData(2,6); - assert.equal(2, imageData.width); - assert.equal(6, imageData.height); - assert.equal(2 * 6 * 4, imageData.data.length); + var ctx = canvas.getContext('2d', { pixelFormat: 'RGB24' }) - assert.equal(0, imageData.data[0]); - assert.equal(0, imageData.data[1]); - assert.equal(0, imageData.data[2]); - assert.equal(0, imageData.data[3]); - }); + var imageData = ctx.createImageData(2, 6) + assert.equal(2, imageData.width) + assert.equal(6, imageData.height) + assert.equal(2 * 6 * 4, imageData.data.length) + + assert.equal(0, imageData.data[0]) + assert.equal(0, imageData.data[1]) + assert.equal(0, imageData.data[2]) + assert.equal(0, imageData.data[3]) + }) - it("works, RGB16_565 format", function () { + it('works, RGB16_565 format', function () { var canvas = createCanvas(20, 20) - , ctx = canvas.getContext('2d', {pixelFormat: "RGB16_565"}); - var imageData = ctx.createImageData(2,6); - assert(imageData.data instanceof Uint16Array); - assert.equal(2, imageData.width); - assert.equal(6, imageData.height); - assert.equal(2 * 6, imageData.data.length); + var ctx = canvas.getContext('2d', { pixelFormat: 'RGB16_565' }) - assert.equal(0, imageData.data[0]); - assert.equal(0, imageData.data[1]); - }); - }); + var imageData = ctx.createImageData(2, 6) + assert(imageData.data instanceof Uint16Array) + assert.equal(2, imageData.width) + assert.equal(6, imageData.height) + assert.equal(2 * 6, imageData.data.length) + + assert.equal(0, imageData.data[0]) + assert.equal(0, imageData.data[1]) + }) + }) describe('Context2d#measureText()', function () { it('Context2d#measureText().width', function () { var canvas = createCanvas(20, 20) - , ctx = canvas.getContext('2d'); - assert.ok(ctx.measureText('foo').width); - assert.ok(ctx.measureText('foo').width != ctx.measureText('foobar').width); - assert.ok(ctx.measureText('foo').width != ctx.measureText(' foo').width); - }); + var ctx = canvas.getContext('2d') + + assert.ok(ctx.measureText('foo').width) + assert.ok(ctx.measureText('foo').width != ctx.measureText('foobar').width) + assert.ok(ctx.measureText('foo').width != ctx.measureText(' foo').width) + }) it('works', function () { var canvas = createCanvas(20, 20) var ctx = canvas.getContext('2d') - ctx.font = "20px Arial" + ctx.font = '20px Arial' - ctx.textBaseline = "alphabetic" - var metrics = ctx.measureText("Alphabet") + ctx.textBaseline = 'alphabetic' + var metrics = ctx.measureText('Alphabet') // Zero if the given baseline is the alphabetic baseline assert.equal(metrics.alphabeticBaseline, 0) // Positive = going up from the baseline @@ -948,8 +969,8 @@ describe('Canvas', function () { assert.ok(metrics.actualBoundingBoxAscent > 0) // On the baseline or slightly above assert.ok(metrics.actualBoundingBoxDescent <= 0) - }); - }); + }) + }) it('Context2d#fillText()', function () { [ @@ -994,29 +1015,30 @@ describe('Canvas', function () { it('Context2d#createImageData(ImageData)', function () { var canvas = createCanvas(20, 20) - , ctx = canvas.getContext('2d'); - var imageData = ctx.createImageData(ctx.createImageData(2, 6)); - assert.equal(2, imageData.width); - assert.equal(6, imageData.height); - assert.equal(2 * 6 * 4, imageData.data.length); - }); + var ctx = canvas.getContext('2d') + + var imageData = ctx.createImageData(ctx.createImageData(2, 6)) + assert.equal(2, imageData.width) + assert.equal(6, imageData.height) + assert.equal(2 * 6 * 4, imageData.data.length) + }) describe('Context2d#getImageData()', function () { - function createTestCanvas(useAlpha, attributes) { - var canvas = createCanvas(3, 6); - var ctx = canvas.getContext('2d', attributes); + function createTestCanvas (useAlpha, attributes) { + var canvas = createCanvas(3, 6) + var ctx = canvas.getContext('2d', attributes) - ctx.fillStyle = useAlpha ? 'rgba(255,0,0,0.25)' : '#f00'; - ctx.fillRect(0,0,1,6); + ctx.fillStyle = useAlpha ? 'rgba(255,0,0,0.25)' : '#f00' + ctx.fillRect(0, 0, 1, 6) - ctx.fillStyle = useAlpha ? 'rgba(0,255,0,0.5)' : '#0f0'; - ctx.fillRect(1,0,1,6); + ctx.fillStyle = useAlpha ? 'rgba(0,255,0,0.5)' : '#0f0' + ctx.fillRect(1, 0, 1, 6) - ctx.fillStyle = useAlpha ? 'rgba(0,0,255,0.75)' : '#00f'; - ctx.fillRect(2,0,1,6); + ctx.fillStyle = useAlpha ? 'rgba(0,0,255,0.75)' : '#00f' + ctx.fillRect(2, 0, 1, 6) - return ctx; + return ctx } it("works, full width, RGBA32", function () { @@ -1182,590 +1204,591 @@ describe('Canvas', function () { }); it('Context2d#createPattern(Canvas)', function () { - var pattern = createCanvas(2,2) - , checkers = pattern.getContext('2d'); + var pattern = createCanvas(2, 2) + + var checkers = pattern.getContext('2d') // white - checkers.fillStyle = '#fff'; - checkers.fillRect(0,0,2,2); + checkers.fillStyle = '#fff' + checkers.fillRect(0, 0, 2, 2) // black - checkers.fillStyle = '#000'; - checkers.fillRect(0,0,1,1); - checkers.fillRect(1,1,1,1); + checkers.fillStyle = '#000' + checkers.fillRect(0, 0, 1, 1) + checkers.fillRect(1, 1, 1, 1) - var imageData = checkers.getImageData(0,0,2,2); - assert.equal(2, imageData.width); - assert.equal(2, imageData.height); - assert.equal(16, imageData.data.length); + var imageData = checkers.getImageData(0, 0, 2, 2) + assert.equal(2, imageData.width) + assert.equal(2, imageData.height) + assert.equal(16, imageData.data.length) // (0,0) black - assert.equal(0, imageData.data[0]); - assert.equal(0, imageData.data[1]); - assert.equal(0, imageData.data[2]); - assert.equal(255, imageData.data[3]); + assert.equal(0, imageData.data[0]) + assert.equal(0, imageData.data[1]) + assert.equal(0, imageData.data[2]) + assert.equal(255, imageData.data[3]) // (1,0) white - assert.equal(255, imageData.data[4]); - assert.equal(255, imageData.data[5]); - assert.equal(255, imageData.data[6]); - assert.equal(255, imageData.data[7]); + assert.equal(255, imageData.data[4]) + assert.equal(255, imageData.data[5]) + assert.equal(255, imageData.data[6]) + assert.equal(255, imageData.data[7]) // (0,1) white - assert.equal(255, imageData.data[8]); - assert.equal(255, imageData.data[9]); - assert.equal(255, imageData.data[10]); - assert.equal(255, imageData.data[11]); + assert.equal(255, imageData.data[8]) + assert.equal(255, imageData.data[9]) + assert.equal(255, imageData.data[10]) + assert.equal(255, imageData.data[11]) // (1,1) black - assert.equal(0, imageData.data[12]); - assert.equal(0, imageData.data[13]); - assert.equal(0, imageData.data[14]); - assert.equal(255, imageData.data[15]); + assert.equal(0, imageData.data[12]) + assert.equal(0, imageData.data[13]) + assert.equal(0, imageData.data[14]) + assert.equal(255, imageData.data[15]) var canvas = createCanvas(20, 20) - , ctx = canvas.getContext('2d') - , pattern = ctx.createPattern(pattern); - - ctx.fillStyle = pattern; - ctx.fillRect(0,0,20,20); - - var imageData = ctx.getImageData(0,0,20,20); - assert.equal(20, imageData.width); - assert.equal(20, imageData.height); - assert.equal(1600, imageData.data.length); - - var i=0, b = true; - while(i { var canvas = createCanvas(20, 20) - , ctx = canvas.getContext('2d') - , pattern = ctx.createPattern(img); - ctx.fillStyle = pattern; - ctx.fillRect(0,0,20,20); + var ctx = canvas.getContext('2d') + + var pattern = ctx.createPattern(img) + + ctx.fillStyle = pattern + ctx.fillRect(0, 0, 20, 20) - var imageData = ctx.getImageData(0,0,20,20); - assert.equal(20, imageData.width); - assert.equal(20, imageData.height); - assert.equal(1600, imageData.data.length); + var imageData = ctx.getImageData(0, 0, 20, 20) + assert.equal(20, imageData.width) + assert.equal(20, imageData.height) + assert.equal(1600, imageData.data.length) - var i=0, b = true; - while (i= 6) - obj[Symbol.toPrimitive] = function () { return 0.89; }; - else - obj.valueOf = function () { return 0.89; }; - ctx.resetTransform(); - testAngle(obj, 0.89); + var obj = Object.create(null) + if (+process.version.match(/\d+/) >= 6) { obj[Symbol.toPrimitive] = function () { return 0.89 } } else { obj.valueOf = function () { return 0.89 } } + ctx.resetTransform() + testAngle(obj, 0.89) // NaN - ctx.resetTransform(); - ctx.rotate(0.91); - testAngle(NaN, 0.91); + ctx.resetTransform() + ctx.rotate(0.91) + testAngle(NaN, 0.91) // Infinite value - ctx.resetTransform(); - ctx.rotate(0.94); - testAngle(-Infinity, 0.94); + ctx.resetTransform() + ctx.rotate(0.94) + testAngle(-Infinity, 0.94) - function testAngle(angle, expected){ - ctx.rotate(angle); + function testAngle (angle, expected) { + ctx.rotate(angle) - var mat = ctx.currentTransform; - var sin = Math.sin(expected); - var cos = Math.cos(expected); + var mat = ctx.currentTransform + var sin = Math.sin(expected) + var cos = Math.cos(expected) - assert.ok(Math.abs(mat.m11 - cos) < Number.EPSILON); - assert.ok(Math.abs(mat.m12 - sin) < Number.EPSILON); - assert.ok(Math.abs(mat.m21 + sin) < Number.EPSILON); - assert.ok(Math.abs(mat.m22 - cos) < Number.EPSILON); + assert.ok(Math.abs(mat.m11 - cos) < Number.EPSILON) + assert.ok(Math.abs(mat.m12 - sin) < Number.EPSILON) + assert.ok(Math.abs(mat.m21 + sin) < Number.EPSILON) + assert.ok(Math.abs(mat.m22 - cos) < Number.EPSILON) } - }); + }) it('Context2d#drawImage()', function () { - var canvas = createCanvas(500, 500); - var ctx = canvas.getContext('2d'); + var canvas = createCanvas(500, 500) + var ctx = canvas.getContext('2d') // Drawing canvas to itself - ctx.fillStyle = 'white'; - ctx.fillRect(0, 0, 500, 500); - ctx.fillStyle = 'black'; - ctx.fillRect(5, 5, 10, 10); - ctx.drawImage(canvas, 20, 20); - - var imgd = ctx.getImageData(0, 0, 500, 500); - var data = imgd.data; - var count = 0; - - for(var i = 0; i < 500 * 500 * 4; i += 4){ - if(data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0) - count++; + ctx.fillStyle = 'white' + ctx.fillRect(0, 0, 500, 500) + ctx.fillStyle = 'black' + ctx.fillRect(5, 5, 10, 10) + ctx.drawImage(canvas, 20, 20) + + var imgd = ctx.getImageData(0, 0, 500, 500) + var data = imgd.data + var count = 0 + + for (var i = 0; i < 500 * 500 * 4; i += 4) { + if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0) { count++ } } - assert.strictEqual(count, 10 * 10 * 2); + assert.strictEqual(count, 10 * 10 * 2) // Drawing zero-width image - ctx.drawImage(canvas, 0, 0, 0, 0, 0, 0, 0, 0); - ctx.drawImage(canvas, 0, 0, 0, 0, 1, 1, 1, 1); - ctx.drawImage(canvas, 1, 1, 1, 1, 0, 0, 0, 0); - ctx.fillStyle = 'white'; - ctx.fillRect(0, 0, 500, 500); - - imgd = ctx.getImageData(0, 0, 500, 500); - data = imgd.data; - count = 0; - - for(i = 0; i < 500 * 500 * 4; i += 4){ - if(data[i] === 255 && data[i + 1] === 255 && data[i + 2] === 255) - count++; + ctx.drawImage(canvas, 0, 0, 0, 0, 0, 0, 0, 0) + ctx.drawImage(canvas, 0, 0, 0, 0, 1, 1, 1, 1) + ctx.drawImage(canvas, 1, 1, 1, 1, 0, 0, 0, 0) + ctx.fillStyle = 'white' + ctx.fillRect(0, 0, 500, 500) + + imgd = ctx.getImageData(0, 0, 500, 500) + data = imgd.data + count = 0 + + for (i = 0; i < 500 * 500 * 4; i += 4) { + if (data[i] === 255 && data[i + 1] === 255 && data[i + 2] === 255) { count++ } } - assert.strictEqual(count, 500 * 500); - }); + assert.strictEqual(count, 500 * 500) + }) it('Context2d#SetFillColor()', function () { - var canvas = createCanvas(2, 2); - var ctx = canvas.getContext('2d'); + var canvas = createCanvas(2, 2) + var ctx = canvas.getContext('2d') - ctx.fillStyle = '#808080'; - ctx.fillRect(0, 0, 2, 2); - var data = ctx.getImageData(0, 0, 2, 2).data; + ctx.fillStyle = '#808080' + ctx.fillRect(0, 0, 2, 2) + var data = ctx.getImageData(0, 0, 2, 2).data data.forEach(function (byte, index) { if (index + 1 & 3) - assert.strictEqual(byte, 128); + assert.strictEqual(byte, 128) else - assert.strictEqual(byte, 255); - }); - }); - -}); + assert.strictEqual(byte, 255) + }) + }) +}) diff --git a/test/dommatrix.test.js b/test/dommatrix.test.js index 8e1571713..e9b715567 100644 --- a/test/dommatrix.test.js +++ b/test/dommatrix.test.js @@ -9,12 +9,12 @@ const assert = require('assert') // This doesn't need to be precise; we're not testing the engine's trig // implementations. const TOLERANCE = 0.001 -function assertApprox(actual, expected, tolerance) { +function assertApprox (actual, expected, tolerance) { if (typeof tolerance !== 'number') tolerance = TOLERANCE assert.ok(expected > actual - tolerance && expected < actual + tolerance, `Expected ${expected} to equal ${actual} +/- ${tolerance}`) } -function assertApproxDeep(actual, expected, tolerance) { +function assertApproxDeep (actual, expected, tolerance) { expected.forEach(function (value, index) { assertApprox(actual[index], value) }) @@ -529,14 +529,14 @@ describe('DOMMatrix', function () { describe('transformPoint', function () { it('works', function () { var x = new DOMMatrix() - var r = x.transformPoint({x: 1, y: 2, z: 3}) + var r = x.transformPoint({ x: 1, y: 2, z: 3 }) assert.strictEqual(r.x, 1) assert.strictEqual(r.y, 2) assert.strictEqual(r.z, 3) assert.strictEqual(r.w, 1) x.rotateSelf(70) - r = x.transformPoint({x: 2, y: 3, z: 4}) + r = x.transformPoint({ x: 2, y: 3, z: 4 }) assertApprox(r.x, -2.13503) assertApprox(r.y, 2.905445) assert.strictEqual(r.z, 4) diff --git a/test/image.test.js b/test/image.test.js index f8d37e465..3a64569c1 100644 --- a/test/image.test.js +++ b/test/image.test.js @@ -6,7 +6,7 @@ * Module dependencies. */ -const {createCanvas, loadImage, rsvgVersion} = require('../'); +const { createCanvas, loadImage, rsvgVersion } = require('../'); const Image = require('../').Image const HAVE_SVG = rsvgVersion !== undefined; @@ -24,12 +24,12 @@ const bmp_dir = `${__dirname}/fixtures/bmp` describe('Image', function () { it('Prototype and ctor are well-shaped, don\'t hit asserts on accessors (GH-803)', function () { - var img = new Image(); - assert.throws(function () { Image.prototype.width; }, /incompatible receiver/); - assert(!img.hasOwnProperty('width')); - assert('width' in img); - assert(Image.prototype.hasOwnProperty('width')); - }); + var img = new Image() + assert.throws(function () { Image.prototype.width }, /incompatible receiver/) + assert(!img.hasOwnProperty('width')) + assert('width' in img) + assert(Image.prototype.hasOwnProperty('width')) + }) it('loads JPEG image', function () { return loadImage(jpg_face).then((img) => { @@ -99,7 +99,7 @@ describe('Image', function () { if (!HAVE_SVG) this.skip(); const base64Enc = fs.readFileSync(svg_tree, 'base64') const dataURL = `data:image/svg+xml;base64,${base64Enc}` - return loadImage(dataURL).then((img) => { + return loadImage(dataURL).then((img) => { assert.strictEqual(img.onerror, null) assert.strictEqual(img.onload, null) assert.strictEqual(img.width, 200) @@ -112,7 +112,7 @@ describe('Image', function () { if (!HAVE_SVG) this.skip(); const utf8Encoded = fs.readFileSync(svg_tree, 'utf8') const dataURL = `data:image/svg+xml;utf8,${utf8Encoded}` - return loadImage(dataURL).then((img) => { + return loadImage(dataURL).then((img) => { assert.strictEqual(img.onerror, null) assert.strictEqual(img.onload, null) assert.strictEqual(img.width, 200) @@ -168,7 +168,7 @@ describe('Image', function () { it('captures errors from libjpeg', function (done) { const img = new Image() img.onerror = err => { - assert.equal(err.message, "JPEG datastream contains no image") + assert.equal(err.message, 'JPEG datastream contains no image') assert.strictEqual(img.complete, true) done() } @@ -229,7 +229,7 @@ describe('Image', function () { }) }) - it('should unbind Image#onload', function() { + it('should unbind Image#onload', function () { return loadImage(png_clock).then((img) => { let onloadCalled = 0 @@ -256,7 +256,7 @@ describe('Image', function () { }) }) - it('should unbind Image#onerror', function() { + it('should unbind Image#onerror', function () { return loadImage(png_clock).then((img) => { let onloadCalled = 0 let onerrorCalled = 0 @@ -313,25 +313,25 @@ describe('Image', function () { }) it('does not contain `source` property', function () { - var keys = Reflect.ownKeys(Image.prototype); - assert.ok(!keys.includes('source')); - assert.ok(!keys.includes('getSource')); - assert.ok(!keys.includes('setSource')); - }); + var keys = Reflect.ownKeys(Image.prototype) + assert.ok(!keys.includes('source')) + assert.ok(!keys.includes('getSource')) + assert.ok(!keys.includes('setSource')) + }) describe('supports BMP', function () { it('parses 1-bit image', function (done) { - let img = new Image(); + let img = new Image() img.onload = () => { - assert.strictEqual(img.width, 111); - assert.strictEqual(img.height, 72); - done(); - }; + assert.strictEqual(img.width, 111) + assert.strictEqual(img.height, 72) + done() + } - img.onerror = err => { throw err; }; - img.src = path.join(bmp_dir, '1-bit.bmp'); - }); + img.onerror = err => { throw err } + img.src = path.join(bmp_dir, '1-bit.bmp') + }) it('parses 4-bit image', function (done) { let img = new Image(); @@ -349,32 +349,32 @@ describe('Image', function () { it('parses 8-bit image'); it('parses 24-bit image', function (done) { - let img = new Image(); + let img = new Image() img.onload = () => { - assert.strictEqual(img.width, 2); - assert.strictEqual(img.height, 2); + assert.strictEqual(img.width, 2) + assert.strictEqual(img.height, 2) testImgd(img, [ 0, 0, 255, 255, 0, 255, 0, 255, 255, 0, 0, 255, - 255, 255, 255, 255, - ]); + 255, 255, 255, 255 + ]) - done(); - }; + done() + } - img.onerror = err => { throw err; }; - img.src = path.join(bmp_dir, '24-bit.bmp'); - }); + img.onerror = err => { throw err } + img.src = path.join(bmp_dir, '24-bit.bmp') + }) it('parses 32-bit image', function (done) { - let img = new Image(); + let img = new Image() img.onload = () => { - assert.strictEqual(img.width, 4); - assert.strictEqual(img.height, 2); + assert.strictEqual(img.width, 4) + assert.strictEqual(img.height, 2) testImgd(img, [ 0, 0, 255, 255, @@ -384,52 +384,52 @@ describe('Image', function () { 0, 0, 255, 127, 0, 255, 0, 127, 255, 0, 0, 127, - 255, 255, 255, 127, - ]); - - done(); - }; + 255, 255, 255, 127 + ]) - img.onerror = err => { throw err; }; - img.src = fs.readFileSync(path.join(bmp_dir, '32-bit.bmp')); // Also tests loading from buffer - }); + done() + } + + img.onerror = err => { throw err } + img.src = fs.readFileSync(path.join(bmp_dir, '32-bit.bmp')) // Also tests loading from buffer + }) it('parses minimal BMP', function (done) { - let img = new Image(); + let img = new Image() img.onload = () => { - assert.strictEqual(img.width, 1); - assert.strictEqual(img.height, 1); + assert.strictEqual(img.width, 1) + assert.strictEqual(img.height, 1) testImgd(img, [ - 255, 0, 0, 255, - ]); - - done(); - }; + 255, 0, 0, 255 + ]) - img.onerror = err => { throw err; }; - img.src = path.join(bmp_dir, 'min.bmp'); - }); + done() + } + + img.onerror = err => { throw err } + img.src = path.join(bmp_dir, 'min.bmp') + }) it('properly handles negative height', function (done) { - let img = new Image(); + let img = new Image() img.onload = () => { - assert.strictEqual(img.width, 1); - assert.strictEqual(img.height, 2); + assert.strictEqual(img.width, 1) + assert.strictEqual(img.height, 2) testImgd(img, [ 255, 0, 0, 255, - 0, 255, 0, 255, - ]); - - done(); - }; + 0, 255, 0, 255 + ]) - img.onerror = err => { throw err; }; - img.src = path.join(bmp_dir, 'negative-height.bmp'); - }); + done() + } + + img.onerror = err => { throw err } + img.src = path.join(bmp_dir, 'negative-height.bmp') + }) it('color palette', function (done) { let img = new Image(); @@ -460,40 +460,40 @@ describe('Image', function () { it('V5 header'); it('catches BMP errors', function (done) { - let img = new Image(); + let img = new Image() img.onload = () => { - throw new Error('Invalid image should not be loaded properly'); - }; + throw new Error('Invalid image should not be loaded properly') + } img.onerror = err => { - let msg = 'Error while processing file header - unexpected end of file'; - assert.strictEqual(err.message, msg); - done(); - }; + let msg = 'Error while processing file header - unexpected end of file' + assert.strictEqual(err.message, msg) + done() + } - img.src = Buffer.from('BM'); - }); + img.src = Buffer.from('BM') + }) it('BMP bomb', function (done) { - let img = new Image(); + let img = new Image() img.onload = () => { - throw new Error('Invalid image should not be loaded properly'); - }; + throw new Error('Invalid image should not be loaded properly') + } img.onerror = err => { - done(); - }; + done() + } - img.src = path.join(bmp_dir, 'bomb.bmp'); - }); + img.src = path.join(bmp_dir, 'bomb.bmp') + }) - function testImgd(img, data){ - let ctx = createCanvas(img.width, img.height).getContext('2d'); - ctx.drawImage(img, 0, 0); - var actualData = ctx.getImageData(0, 0, img.width, img.height).data; - assert.strictEqual(String(actualData), String(data)); + function testImgd (img, data) { + let ctx = createCanvas(img.width, img.height).getContext('2d') + ctx.drawImage(img, 0, 0) + var actualData = ctx.getImageData(0, 0, img.width, img.height).data + assert.strictEqual(String(actualData), String(data)) } - }); + }) }) diff --git a/test/imageData.test.js b/test/imageData.test.js index cfffe9aaf..26acd61f4 100644 --- a/test/imageData.test.js +++ b/test/imageData.test.js @@ -3,14 +3,14 @@ 'use strict' const createImageData = require('../').createImageData -const ImageData = require('../').ImageData; +const ImageData = require('../').ImageData const assert = require('assert') describe('ImageData', function () { it('Prototype and ctor are well-shaped, don\'t hit asserts on accessors (GH-803)', function () { - assert.throws(function () { ImageData.prototype.width; }, /incompatible receiver/); - }); + assert.throws(function () { ImageData.prototype.width }, /incompatible receiver/) + }) it('should throw with invalid numeric arguments', function () { assert.throws(() => { createImageData(0, 0) }, /width is zero/) @@ -33,7 +33,7 @@ describe('ImageData', function () { assert.throws(() => { createImageData(new Uint8ClampedArray(3), 0) }, /source width is zero/) // Note: Some errors thrown by browsers are not thrown by node-canvas // because our ImageData can support different BPPs. - }); + }) it('should construct with Uint8ClampedArray', function () { let data, imageData @@ -51,7 +51,7 @@ describe('ImageData', function () { assert.strictEqual(imageData.height, 4) assert(imageData.data instanceof Uint8ClampedArray) assert.strictEqual(imageData.data.length, 48) - }); + }) it('should construct with Uint16Array', function () { let data = new Uint16Array(2 * 3 * 2) @@ -67,5 +67,5 @@ describe('ImageData', function () { assert.strictEqual(imagedata.height, 4) assert(imagedata.data instanceof Uint16Array) assert.strictEqual(imagedata.data.length, 24) - }); -}); + }) +}) diff --git a/test/public/tests.js b/test/public/tests.js index 31ee6aaca..ef7b5a614 100644 --- a/test/public/tests.js +++ b/test/public/tests.js @@ -585,7 +585,7 @@ tests['createRadialGradient()'] = function (ctx) { ctx.fillRect(0, 0, 150, 150) } -tests['globalAlpha'] = function (ctx) { +tests.globalAlpha = function (ctx) { ctx.globalAlpha = 0.5 ctx.fillStyle = 'rgba(0,0,0,0.5)' ctx.strokeRect(0, 0, 50, 50) @@ -618,7 +618,7 @@ tests['globalAlpha 2'] = function (ctx) { } } -tests['fillStyle'] = function (ctx) { +tests.fillStyle = function (ctx) { for (var i = 0; i < 6; i++) { for (var j = 0; j < 6; j++) { ctx.fillStyle = 'rgb(' + Math.floor(255 - 42.5 * i) + ',' + Math.floor(255 - 42.5 * j) + ',0)' @@ -627,7 +627,7 @@ tests['fillStyle'] = function (ctx) { } } -tests['strokeStyle'] = function (ctx) { +tests.strokeStyle = function (ctx) { for (var i = 0; i < 6; i++) { for (var j = 0; j < 6; j++) { ctx.strokeStyle = 'rgb(0,' + Math.floor(255 - 42.5 * i) + ',' + @@ -662,7 +662,7 @@ tests['floating point coordinates'] = function (ctx) { ctx.stroke() } -tests['lineWidth'] = function (ctx) { +tests.lineWidth = function (ctx) { for (var i = 0; i < 10; i++) { ctx.lineWidth = 1 + i ctx.beginPath() @@ -718,7 +718,7 @@ tests['lineCap default'] = function (ctx) { ctx.stroke() } -tests['lineCap'] = function (ctx) { +tests.lineCap = function (ctx) { ctx.beginPath() ctx.lineWidth = 10.0 ctx.lineCap = 'round' @@ -728,7 +728,7 @@ tests['lineCap'] = function (ctx) { ctx.stroke() } -tests['lineJoin'] = function (ctx) { +tests.lineJoin = function (ctx) { ctx.beginPath() ctx.lineWidth = 10.0 ctx.lineJoin = 'round' @@ -738,7 +738,7 @@ tests['lineJoin'] = function (ctx) { ctx.stroke() } -tests['states'] = function (ctx) { +tests.states = function (ctx) { ctx.save() ctx.rect(50, 50, 100, 100) ctx.stroke() @@ -1325,7 +1325,7 @@ tests['known bug #416'] = function (ctx, done) { img1.src = imageSrc('existing.png') } -tests['shadowBlur'] = function (ctx) { +tests.shadowBlur = function (ctx) { ctx.fillRect(150, 10, 20, 20) ctx.lineTo(20, 5) @@ -1351,7 +1351,7 @@ tests['shadowBlur'] = function (ctx) { ctx.fillRect(150, 150, 20, 20) } -tests['shadowColor'] = function (ctx) { +tests.shadowColor = function (ctx) { ctx.fillRect(150, 10, 20, 20) ctx.lineTo(20, 5) @@ -2249,7 +2249,7 @@ tests['putImageData() png data 3'] = function (ctx, done) { img.src = imageSrc('state.png') } -tests['setLineDash'] = function (ctx) { +tests.setLineDash = function (ctx) { ctx.setLineDash([10, 5, 25, 15]) ctx.lineWidth = 14 @@ -2283,7 +2283,7 @@ tests['setLineDash'] = function (ctx) { line([0, 3, 0, 0], 'green') // should be empty } -tests['lineDashOffset'] = function (ctx) { +tests.lineDashOffset = function (ctx) { ctx.setLineDash([10, 5, 25, 15]) ctx.lineWidth = 4 @@ -2310,7 +2310,7 @@ tests['lineDashOffset'] = function (ctx) { line(60, 'orange') line(-Infinity) line(70, 'purple') - line(void 0) + line() line(80, 'black') line(ctx.lineDashOffset + 10) diff --git a/test/server.js b/test/server.js index d583a7748..8e44e7b38 100644 --- a/test/server.js +++ b/test/server.js @@ -1,7 +1,9 @@ var path = require('path') + var express = require('express') -var Canvas = require('../') +var Canvas = require('..') + var tests = require('./public/tests') var app = express() diff --git a/util/has_lib.js b/util/has_lib.js index 1ede90056..94c2560cf 100644 --- a/util/has_lib.js +++ b/util/has_lib.js @@ -1,6 +1,5 @@ -var query = process.argv[2] +var execSync = require('child_process').execSync var fs = require('fs') -var childProcess = require('child_process') var SYSTEM_PATHS = [ '/lib', @@ -15,6 +14,16 @@ var SYSTEM_PATHS = [ '/usr/lib/aarch64-linux-gnu' ] +function _hasQuery (query) { + try { + // execSync throws on nonzero exit + execSync(query) + return true + } catch (err) { + return false + } +} + /** * Checks for lib using ldconfig if present, or searching SYSTEM_PATHS * otherwise. @@ -23,12 +32,11 @@ var SYSTEM_PATHS = [ */ function hasSystemLib (lib) { var libName = 'lib' + lib + '.+(so|dylib)' - var libNameRegex = new RegExp(libName) // Try using ldconfig on linux systems if (hasLdconfig()) { try { - if (childProcess.execSync('ldconfig -p 2>/dev/null | grep -E "' + libName + '"').length) { + if (execSync('ldconfig -p 2>/dev/null | grep -E "' + libName + '"').length) { return true } } catch (err) { @@ -37,6 +45,8 @@ function hasSystemLib (lib) { } // Try checking common library locations + const libNameRegex = new RegExp(libName) + return SYSTEM_PATHS.some(function (systemPath) { try { var dirListing = fs.readdirSync(systemPath) @@ -57,10 +67,10 @@ function hasLdconfig () { try { // Add /sbin to path as ldconfig is located there on some systems -- e.g. // Debian (and it can still be used by unprivileged users): - childProcess.execSync('export PATH="$PATH:/sbin"') - process.env.PATH = '...' + execSync('export PATH="$PATH:/sbin"') + // process.env.PATH = '...' // execSync throws on nonzero exit - childProcess.execSync('hash ldconfig 2>/dev/null') + execSync('hash ldconfig 2>/dev/null') return true } catch (err) { return false @@ -72,14 +82,8 @@ function hasLdconfig () { * @return Boolean exists */ function hasFreetype () { - try { - if (childProcess.execSync('pkg-config cairo --cflags-only-I 2>/dev/null | grep freetype2').length) { - return true - } - } catch (err) { - // noop - } - return false + return _hasQuery('pkg-config cairo --cflags-only-I 2>/dev/null | ' + + 'grep freetype2') } /** @@ -88,20 +92,23 @@ function hasFreetype () { * @return {boolean} exists */ function hasPkgconfigLib (lib) { - try { - // execSync throws on nonzero exit - childProcess.execSync('pkg-config --exists "' + lib + '" 2>/dev/null') - return true - } catch (err) { - return false - } + return _hasQuery('pkg-config --exists "' + lib + '" 2>/dev/null') } function main (query) { + if (!query) { + for (var libname of ['gif', 'jpeg', 'cairo', 'pango', 'freetype', 'rsvg']) { + if (!main(libname)) return libname + } + + return true + } + switch (query) { + case 'cairo': case 'gif': case 'jpeg': - case 'cairo': + case 'X11': return hasSystemLib(query) case 'pango': return hasPkgconfigLib(query) @@ -114,4 +121,4 @@ function main (query) { } } -process.stdout.write(main(query).toString()) +process.stdout.write(main(process.argv[2]).toString()) diff --git a/util/win_jpeg_lookup.js b/util/win_jpeg_lookup.js index 82869945a..40a1e03cf 100644 --- a/util/win_jpeg_lookup.js +++ b/util/win_jpeg_lookup.js @@ -5,17 +5,17 @@ if (process.arch === 'x64') { paths.unshift('C:/libjpeg-turbo64') } -paths.forEach(function(path){ +paths.forEach(function (path) { if (exists(path)) { process.stdout.write(path) process.exit() } }) -function exists(path) { +function exists (path) { try { return fs.lstatSync(path).isDirectory() - } catch(e) { + } catch (e) { return false } }