#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "TMath.h"
Classes | |
struct | RotatedTextItemTemplate_t |
struct | StyleTemplate_t |
Macros | |
#define | _XVERTEXT_INCLUDED_ |
#define | BCENTRE 8 |
#define | BLEFT 7 |
#define | BRIGHT 9 |
#define | CACHE_BITMAPS |
#define | CACHE_SIZE_LIMIT 0 |
#define | DEBUG_PRINT1(a) if (gRotatedDebug) printf (a) |
#define | DEBUG_PRINT2(a, b) if (gRotatedDebug) printf (a, b) |
#define | DEBUG_PRINT3(a, b, c) if (gRotatedDebug) printf (a, b, c) |
#define | DEBUG_PRINT4(a, b, c, d) if (gRotatedDebug) printf (a, b, c, d) |
#define | DEBUG_PRINT5(a, b, c, d, e) if (gRotatedDebug) printf (a, b, c, d, e) |
#define | M_PI 3.14159265358979323846 |
#define | MCENTRE 5 |
#define | MLEFT 4 |
#define | MRIGHT 6 |
#define | NONE 0 |
#define | TCENTRE 2 |
#define | TLEFT 1 |
#define | TRIGHT 3 |
#define | XV_COPYRIGHT "xvertext routines Copyright (c) 1993 Alan Richardson" |
#define | XV_VERSION 5.0 |
Typedefs | |
typedef struct RotatedTextItemTemplate_t | RotatedTextItem_t |
Functions | |
static XImage * | MakeXImage (Display *dpy, int w, int h) |
Create an XImage structure and allocate memory for it. | |
char * | my_strdup (const char *str) |
Routine to mimic ‘strdup()’ (some machines don't have it) | |
char * | my_strtok (char *str1, const char *str2) |
Routine to replace ‘strtok’ : this one returns a zero length string if it encounters two consecutive delimiters. | |
static void | XRotAddToLinkedList (Display *dpy, RotatedTextItem_t *item) |
Adds a text item to the end of the cache, removing as many items from the front as required to keep cache size below limit. | |
static RotatedTextItem_t * | XRotCreateTextItem (Display *dpy, XFontStruct *font, float angle, char *text, int align) |
Create a rotated text item. | |
int | XRotDrawAlignedImageString (Display *dpy, XFontStruct *font, float angle, Drawable drawable, GC gc, int x, int y, char *text, int align) |
A front end to XRotPaintAlignedString: -does alignment, paints background. | |
int | XRotDrawAlignedString (Display *dpy, XFontStruct *font, float angle, Drawable drawable, GC gc, int x, int y, char *text, int align) |
A front end to XRotPaintAlignedString: -does alignment, no background. | |
static int | XRotDrawHorizontalString (Display *dpy, XFontStruct *font, Drawable drawable, GC gc, int x, int y, char *text, int align, int bg) |
Draw a horizontal string in a quick fashion. | |
int | XRotDrawImageString (Display *dpy, XFontStruct *font, float angle, Drawable drawable, GC gc, int x, int y, char *str) |
A front end to XRotPaintAlignedString: -no alignment, paints background. | |
int | XRotDrawString (Display *dpy, XFontStruct *font, float angle, Drawable drawable, GC gc, int x, int y, char *str) |
A front end to XRotPaintAlignedString: -no alignment, no background. | |
static void | XRotFreeTextItem (Display *dpy, RotatedTextItem_t *item) |
Free the resources used by a text item. | |
static XImage * | XRotMagnifyImage (Display *dpy, XImage *ximage) |
Magnify an XImage using bilinear interpolation. | |
static int | XRotPaintAlignedString (Display *dpy, XFontStruct *font, float angle, Drawable drawable, GC gc, int x, int y, char *text, int align, int bg) |
Aligns and paints a rotated string. | |
static RotatedTextItem_t * | XRotRetrieveFromCache (Display *dpy, XFontStruct *font, float angle, char *text, int align) |
Query cache for a match with this font/text/angle/alignment request, otherwise arrange for its creation. | |
void | XRotSetBoundingBoxPad (int p) |
Set the padding used when calculating bounding boxes. | |
void | XRotSetMagnification (float m) |
Set the font magnification factor for all subsequent operations. | |
XPoint * | XRotTextExtents (Display *, XFontStruct *font, float angle, int x, int y, char *text, int align) |
Calculate the bounding box some text will have when painted. | |
float | XRotVersion (char *str, int n) |
Return version/copyright information. | |
Variables | |
static RotatedTextItem_t * | gFirstTextItem = nullptr |
static int | gRotatedDebug =0 |
static struct StyleTemplate_t | gRotStyle |
#define _XVERTEXT_INCLUDED_ |
Definition at line 5 of file Rotated.cxx.
#define BCENTRE 8 |
Definition at line 60 of file Rotated.cxx.
#define BLEFT 7 |
Definition at line 59 of file Rotated.cxx.
#define BRIGHT 9 |
Definition at line 61 of file Rotated.cxx.
#define CACHE_BITMAPS |
Definition at line 82 of file Rotated.cxx.
#define CACHE_SIZE_LIMIT 0 |
Definition at line 75 of file Rotated.cxx.
#define DEBUG_PRINT1 | ( | a | ) | if (gRotatedDebug) printf (a) |
Definition at line 96 of file Rotated.cxx.
#define DEBUG_PRINT2 | ( | a, | |
b | |||
) | if (gRotatedDebug) printf (a, b) |
Definition at line 97 of file Rotated.cxx.
Definition at line 98 of file Rotated.cxx.
Definition at line 99 of file Rotated.cxx.
Definition at line 100 of file Rotated.cxx.
#define M_PI 3.14159265358979323846 |
Definition at line 105 of file Rotated.cxx.
#define MCENTRE 5 |
Definition at line 57 of file Rotated.cxx.
#define MLEFT 4 |
Definition at line 56 of file Rotated.cxx.
#define MRIGHT 6 |
Definition at line 58 of file Rotated.cxx.
#define NONE 0 |
Definition at line 52 of file Rotated.cxx.
#define TCENTRE 2 |
Definition at line 54 of file Rotated.cxx.
#define TLEFT 1 |
Definition at line 53 of file Rotated.cxx.
#define TRIGHT 3 |
Definition at line 55 of file Rotated.cxx.
#define XV_COPYRIGHT "xvertext routines Copyright (c) 1993 Alan Richardson" |
Definition at line 45 of file Rotated.cxx.
#define XV_VERSION 5.0 |
Definition at line 44 of file Rotated.cxx.
typedef struct RotatedTextItemTemplate_t RotatedTextItem_t |
Create an XImage structure and allocate memory for it.
Definition at line 260 of file Rotated.cxx.
char * my_strdup | ( | const char * | str | ) |
Routine to mimic ‘strdup()’ (some machines don't have it)
Definition at line 176 of file Rotated.cxx.
char * my_strtok | ( | char * | str1, |
const char * | str2 | ||
) |
Routine to replace ‘strtok’ : this one returns a zero length string if it encounters two consecutive delimiters.
Definition at line 190 of file Rotated.cxx.
|
static |
Adds a text item to the end of the cache, removing as many items from the front as required to keep cache size below limit.
Definition at line 1104 of file Rotated.cxx.
|
static |
Create a rotated text item.
Definition at line 791 of file Rotated.cxx.
int XRotDrawAlignedImageString | ( | Display * | dpy, |
XFontStruct * | font, | ||
float | angle, | ||
Drawable | drawable, | ||
GC | gc, | ||
int | x, | ||
int | y, | ||
char * | text, | ||
int | align | ||
) |
A front end to XRotPaintAlignedString: -does alignment, paints background.
Definition at line 316 of file Rotated.cxx.
int XRotDrawAlignedString | ( | Display * | dpy, |
XFontStruct * | font, | ||
float | angle, | ||
Drawable | drawable, | ||
GC | gc, | ||
int | x, | ||
int | y, | ||
char * | text, | ||
int | align | ||
) |
A front end to XRotPaintAlignedString: -does alignment, no background.
Definition at line 305 of file Rotated.cxx.
|
static |
Draw a horizontal string in a quick fashion.
Definition at line 553 of file Rotated.cxx.
int XRotDrawImageString | ( | Display * | dpy, |
XFontStruct * | font, | ||
float | angle, | ||
Drawable | drawable, | ||
GC | gc, | ||
int | x, | ||
int | y, | ||
char * | str | ||
) |
A front end to XRotPaintAlignedString: -no alignment, paints background.
Definition at line 294 of file Rotated.cxx.
int XRotDrawString | ( | Display * | dpy, |
XFontStruct * | font, | ||
float | angle, | ||
Drawable | drawable, | ||
GC | gc, | ||
int | x, | ||
int | y, | ||
char * | str | ||
) |
A front end to XRotPaintAlignedString: -no alignment, no background.
Definition at line 283 of file Rotated.cxx.
|
static |
Free the resources used by a text item.
Definition at line 1206 of file Rotated.cxx.
Magnify an XImage using bilinear interpolation.
Definition at line 1229 of file Rotated.cxx.
|
static |
Aligns and paints a rotated string.
Definition at line 327 of file Rotated.cxx.
|
static |
Query cache for a match with this font/text/angle/alignment request, otherwise arrange for its creation.
Definition at line 652 of file Rotated.cxx.
void XRotSetBoundingBoxPad | ( | int | p | ) |
Set the padding used when calculating bounding boxes.
Definition at line 251 of file Rotated.cxx.
void XRotSetMagnification | ( | float | m | ) |
Set the font magnification factor for all subsequent operations.
Definition at line 242 of file Rotated.cxx.
XPoint * XRotTextExtents | ( | Display * | , |
XFontStruct * | font, | ||
float | angle, | ||
int | x, | ||
int | y, | ||
char * | text, | ||
int | align | ||
) |
Calculate the bounding box some text will have when painted.
Definition at line 1335 of file Rotated.cxx.
float XRotVersion | ( | char * | str, |
int | n | ||
) |
Return version/copyright information.
Definition at line 232 of file Rotated.cxx.
|
static |
Definition at line 139 of file Rotated.cxx.
|
static |
Definition at line 93 of file Rotated.cxx.
|
static |