jpayne@69
|
1 /* GRAPHITE2 LICENSING
|
jpayne@69
|
2
|
jpayne@69
|
3 Copyright 2010, SIL International
|
jpayne@69
|
4 All rights reserved.
|
jpayne@69
|
5
|
jpayne@69
|
6 This library is free software; you can redistribute it and/or modify
|
jpayne@69
|
7 it under the terms of the GNU Lesser General Public License as published
|
jpayne@69
|
8 by the Free Software Foundation; either version 2.1 of License, or
|
jpayne@69
|
9 (at your option) any later version.
|
jpayne@69
|
10
|
jpayne@69
|
11 This program is distributed in the hope that it will be useful,
|
jpayne@69
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
jpayne@69
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
jpayne@69
|
14 Lesser General Public License for more details.
|
jpayne@69
|
15
|
jpayne@69
|
16 You should also have received a copy of the GNU Lesser General Public
|
jpayne@69
|
17 License along with this library in the file named "LICENSE".
|
jpayne@69
|
18 If not, write to the Free Software Foundation, 51 Franklin Street,
|
jpayne@69
|
19 Suite 500, Boston, MA 02110-1335, USA or visit their web page on the
|
jpayne@69
|
20 internet at http://www.fsf.org/licenses/lgpl.html.
|
jpayne@69
|
21
|
jpayne@69
|
22 Alternatively, the contents of this file may be used under the terms
|
jpayne@69
|
23 of the Mozilla Public License (http://mozilla.org/MPL) or the GNU
|
jpayne@69
|
24 General Public License, as published by the Free Software Foundation,
|
jpayne@69
|
25 either version 2 of the License or (at your option) any later version.
|
jpayne@69
|
26 */
|
jpayne@69
|
27 #pragma once
|
jpayne@69
|
28
|
jpayne@69
|
29 #include <graphite2/Types.h>
|
jpayne@69
|
30 #include <graphite2/Font.h>
|
jpayne@69
|
31 #include <stdio.h>
|
jpayne@69
|
32
|
jpayne@69
|
33 #ifdef __cplusplus
|
jpayne@69
|
34 extern "C"
|
jpayne@69
|
35 {
|
jpayne@69
|
36 #endif
|
jpayne@69
|
37
|
jpayne@69
|
38 /** deprecated mechanism that doesn't do anything now. */
|
jpayne@69
|
39 typedef enum {
|
jpayne@69
|
40 GRLOG_NONE = 0x0,
|
jpayne@69
|
41 GRLOG_FACE = 0x01,
|
jpayne@69
|
42 GRLOG_SEGMENT = 0x02,
|
jpayne@69
|
43 GRLOG_PASS = 0x04,
|
jpayne@69
|
44 GRLOG_CACHE = 0x08,
|
jpayne@69
|
45
|
jpayne@69
|
46 GRLOG_OPCODE = 0x80,
|
jpayne@69
|
47 GRLOG_ALL = 0xFF
|
jpayne@69
|
48 } GrLogMask;
|
jpayne@69
|
49
|
jpayne@69
|
50 /** Start logging all segment creation and updates on the provided face. This
|
jpayne@69
|
51 * is logged to a JSON file, see "Segment JSON Schema.txt" for a precise
|
jpayne@69
|
52 * definition of the file
|
jpayne@69
|
53 *
|
jpayne@69
|
54 * @return true if the file was successfully created and logging is correctly
|
jpayne@69
|
55 * initialised.
|
jpayne@69
|
56 * @param face the gr_face whose segments you want to log to the given file
|
jpayne@69
|
57 * @param log_path a utf8 encoded file name and path to log to.
|
jpayne@69
|
58 */
|
jpayne@69
|
59 GR2_API bool gr_start_logging(gr_face * face, const char *log_path);
|
jpayne@69
|
60
|
jpayne@69
|
61
|
jpayne@69
|
62 /** Stop logging on the given face. This will close the log file created by
|
jpayne@69
|
63 * gr_start_logging.
|
jpayne@69
|
64 *
|
jpayne@69
|
65 * @param face the gr_face whose segments you want to stop logging
|
jpayne@69
|
66 */
|
jpayne@69
|
67 GR2_API void gr_stop_logging(gr_face * face);
|
jpayne@69
|
68
|
jpayne@69
|
69 /** Start logging to a FILE object.
|
jpayne@69
|
70 * This function is deprecated as of 1.2.0, use the _face versions instead.
|
jpayne@69
|
71 *
|
jpayne@69
|
72 * @return True on success
|
jpayne@69
|
73 * @param logfile FILE reference to output logging to
|
jpayne@69
|
74 * @param mask What aspects of logging to report (ignored)
|
jpayne@69
|
75 */
|
jpayne@69
|
76 GR2_API bool graphite_start_logging(FILE * logFile, GrLogMask mask); //may not do anthing if disabled in the implementation of the engine.
|
jpayne@69
|
77
|
jpayne@69
|
78 /** Stop logging to a FILE object.
|
jpayne@69
|
79 * This function is deprecated as of 1.2.0, use the _face versions instead.
|
jpayne@69
|
80 */
|
jpayne@69
|
81 GR2_API void graphite_stop_logging();
|
jpayne@69
|
82
|
jpayne@69
|
83 #ifdef __cplusplus
|
jpayne@69
|
84 }
|
jpayne@69
|
85 #endif
|