Logo ROOT   6.08/07
Reference Guide
Macros | Typedefs | Functions | Variables
Rotated.cxx File Reference
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "TMath.h"
Include dependency graph for Rotated.cxx:

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. More...
 
static char * my_strdup (char *str)
 Routine to mimic `strdup()' (some machines don't have it) More...
 
static char * my_strtok (char *str1, char *str2)
 Routine to replace `strtok' : this one returns a zero length string if it encounters two consecutive delimiters. More...
 
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. More...
 
static RotatedTextItem_tXRotCreateTextItem (Display *dpy, XFontStruct *font, float angle, char *text, int align)
 Create a rotated text item. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
static void XRotFreeTextItem (Display *dpy, RotatedTextItem_t *item)
 Free the resources used by a text item. More...
 
static XImage * XRotMagnifyImage (Display *dpy, XImage *ximage)
 Magnify an XImage using bilinear interpolation. More...
 
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. More...
 
static RotatedTextItem_tXRotRetrieveFromCache (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. More...
 
void XRotSetBoundingBoxPad (int p)
 Set the padding used when calculating bounding boxes. More...
 
void XRotSetMagnification (float m)
 Set the font magnification factor for all subsequent operations. More...
 
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. More...
 
float XRotVersion (char *str, int n)
 Return version/copyright information. More...
 

Variables

static RotatedTextItem_tgFirstTextItem =0
 
static int gRotatedDebug =0
 
static struct StyleTemplate_t gRotStyle
 

Macro Definition Documentation

◆ _XVERTEXT_INCLUDED_

#define _XVERTEXT_INCLUDED_

Definition at line 5 of file Rotated.cxx.

◆ BCENTRE

#define BCENTRE   8

Definition at line 60 of file Rotated.cxx.

◆ BLEFT

#define BLEFT   7

Definition at line 59 of file Rotated.cxx.

◆ BRIGHT

#define BRIGHT   9

Definition at line 61 of file Rotated.cxx.

◆ CACHE_BITMAPS

#define CACHE_BITMAPS

Definition at line 82 of file Rotated.cxx.

◆ CACHE_SIZE_LIMIT

#define CACHE_SIZE_LIMIT   0

Definition at line 75 of file Rotated.cxx.

◆ DEBUG_PRINT1

#define DEBUG_PRINT1 (   a)    if (gRotatedDebug) printf (a)

Definition at line 96 of file Rotated.cxx.

◆ DEBUG_PRINT2

#define DEBUG_PRINT2 (   a,
  b 
)    if (gRotatedDebug) printf (a, b)

Definition at line 97 of file Rotated.cxx.

◆ DEBUG_PRINT3

#define DEBUG_PRINT3 (   a,
  b,
  c 
)    if (gRotatedDebug) printf (a, b, c)

Definition at line 98 of file Rotated.cxx.

◆ DEBUG_PRINT4

#define DEBUG_PRINT4 (   a,
  b,
  c,
 
)    if (gRotatedDebug) printf (a, b, c, d)

Definition at line 99 of file Rotated.cxx.

◆ DEBUG_PRINT5

#define DEBUG_PRINT5 (   a,
  b,
  c,
  d,
  e 
)    if (gRotatedDebug) printf (a, b, c, d, e)

Definition at line 100 of file Rotated.cxx.

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 105 of file Rotated.cxx.

◆ MCENTRE

#define MCENTRE   5

Definition at line 57 of file Rotated.cxx.

◆ MLEFT

#define MLEFT   4

Definition at line 56 of file Rotated.cxx.

◆ MRIGHT

#define MRIGHT   6

Definition at line 58 of file Rotated.cxx.

◆ NONE

#define NONE   0

Definition at line 52 of file Rotated.cxx.

◆ TCENTRE

#define TCENTRE   2

Definition at line 54 of file Rotated.cxx.

◆ TLEFT

#define TLEFT   1

Definition at line 53 of file Rotated.cxx.

◆ TRIGHT

#define TRIGHT   3

Definition at line 55 of file Rotated.cxx.

◆ XV_COPYRIGHT

#define XV_COPYRIGHT   "xvertext routines Copyright (c) 1993 Alan Richardson"

Definition at line 45 of file Rotated.cxx.

◆ XV_VERSION

#define XV_VERSION   5.0

Definition at line 44 of file Rotated.cxx.

Typedef Documentation

◆ RotatedTextItem_t

typedef struct RotatedTextItemTemplate_t RotatedTextItem_t

Function Documentation

◆ MakeXImage()

static XImage * MakeXImage ( Display *  dpy,
int  w,
int  h 
)
static

Create an XImage structure and allocate memory for it.

Definition at line 266 of file Rotated.cxx.

◆ my_strdup()

static char * my_strdup ( char *  str)
static

Routine to mimic `strdup()' (some machines don't have it)

Definition at line 179 of file Rotated.cxx.

◆ my_strtok()

static char * my_strtok ( char *  str1,
char *  str2 
)
static

Routine to replace `strtok' : this one returns a zero length string if it encounters two consecutive delimiters.

Definition at line 195 of file Rotated.cxx.

◆ XRotAddToLinkedList()

static void XRotAddToLinkedList ( Display *  dpy,
RotatedTextItem_t item 
)
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 1118 of file Rotated.cxx.

◆ XRotCreateTextItem()

static RotatedTextItem_t * XRotCreateTextItem ( Display *  dpy,
XFontStruct *  font,
float  angle,
char *  text,
int  align 
)
static

Create a rotated text item.

Definition at line 804 of file Rotated.cxx.

◆ XRotDrawAlignedImageString()

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 325 of file Rotated.cxx.

◆ XRotDrawAlignedString()

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 314 of file Rotated.cxx.

◆ XRotDrawHorizontalString()

static int XRotDrawHorizontalString ( Display *  dpy,
XFontStruct *  font,
Drawable  drawable,
GC  gc,
int  x,
int  y,
char *  text,
int  align,
int  bg 
)
static

Draw a horizontal string in a quick fashion.

Definition at line 567 of file Rotated.cxx.

◆ XRotDrawImageString()

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 303 of file Rotated.cxx.

◆ XRotDrawString()

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 292 of file Rotated.cxx.

◆ XRotFreeTextItem()

static void XRotFreeTextItem ( Display *  dpy,
RotatedTextItem_t item 
)
static

Free the resources used by a text item.

Definition at line 1221 of file Rotated.cxx.

◆ XRotMagnifyImage()

static XImage * XRotMagnifyImage ( Display *  dpy,
XImage *  ximage 
)
static

Magnify an XImage using bilinear interpolation.

Definition at line 1244 of file Rotated.cxx.

◆ XRotPaintAlignedString()

static int XRotPaintAlignedString ( Display *  dpy,
XFontStruct *  font,
float  angle,
Drawable  drawable,
GC  gc,
int  x,
int  y,
char *  text,
int  align,
int  bg 
)
static

Aligns and paints a rotated string.

Definition at line 336 of file Rotated.cxx.

◆ XRotRetrieveFromCache()

static RotatedTextItem_t * XRotRetrieveFromCache ( Display *  dpy,
XFontStruct *  font,
float  angle,
char *  text,
int  align 
)
static

Query cache for a match with this font/text/angle/alignment request, otherwise arrange for its creation.

Definition at line 664 of file Rotated.cxx.

◆ XRotSetBoundingBoxPad()

void XRotSetBoundingBoxPad ( int  p)

Set the padding used when calculating bounding boxes.

Definition at line 257 of file Rotated.cxx.

◆ XRotSetMagnification()

void XRotSetMagnification ( float  m)

Set the font magnification factor for all subsequent operations.

Definition at line 248 of file Rotated.cxx.

◆ XRotTextExtents()

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 1350 of file Rotated.cxx.

◆ XRotVersion()

float XRotVersion ( char *  str,
int  n 
)

Return version/copyright information.

Definition at line 238 of file Rotated.cxx.

Variable Documentation

◆ gFirstTextItem

RotatedTextItem_t* gFirstTextItem =0
static

Definition at line 139 of file Rotated.cxx.

◆ gRotatedDebug

int gRotatedDebug =0
static

Definition at line 93 of file Rotated.cxx.

◆ gRotStyle

struct StyleTemplate_t gRotStyle
static
Initial value:
={
1.,
0
}