File: gtext.h

package info (click to toggle)
yorick 2.2.04%2Bdfsg1-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 10,012 kB
  • sloc: ansic: 86,757; sh: 1,697; cpp: 1,309; lisp: 1,234; makefile: 1,050; fortran: 19
file content (43 lines) | stat: -rw-r--r-- 1,789 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * $Id: gtext.h,v 1.1 2005-09-18 22:04:33 dhmunro Exp $
 * Declare GIST text utilities
 */
/* Copyright (c) 2005, The Regents of the University of California.
 * All rights reserved.
 * This file is part of yorick (http://yorick.sourceforge.net).
 * Read the accompanying LICENSE file for details.
 */

#ifndef GTEXT_H
#define GTEXT_H

#include "gist.h"

/* Return t->alignH, t->alignV, guaranteed not TH_NORMAL or TV_NORMAL */
PLUG_API void GtGetAlignment(const GpTextAttribs *t,
                             int *alignH, int *alignV);

/* Get shape of text input to GdText, given a function Width which can
   compute the width of a simple text string (no imbedded \n).  Returns
   largest value of Width for any line, and a line count.
   If gtDoEscapes==1 (default), and Width!=0, the Width function must
   handle the !, ^, and _ escape sequences.
   If Width==0, the default Width function is the number of
   non-escaped characters.  */
typedef GpReal (*WidthFunction)(const char *text, int nChars,
                                const GpTextAttribs *t);
PLUG_API int GtTextShape(const char *text, const GpTextAttribs *t,
                         WidthFunction Width, GpReal *widest);

/* Return the next line of text-- if text[0] is not '\n' and path not
   T_UP or T_DOWN, returns text and a count of the characters in the
   line, nChars (always 1 if T_UP or T_DOWN).  If text is '\0', or '\n'
   with path T_UP or T_DOWN, returns 0.  Otherwise, returns text+1 and
   a count of the number of characters to the next '\n' or '\0'.  */
PLUG_API const char *GtNextLine(const char *text, int *nChars, int path);

/* Use ^ (superscript), _ (subscript), and ! (symbol) escape sequences
   in GpText.  These are on (gtDoEscapes==1) by default.  */
PLUG_API int gtDoEscapes;

#endif