ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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:

Go to the source code of this file.

Macros

#define _XVERTEXT_INCLUDED_
 
#define XV_VERSION   5.0
 
#define XV_COPYRIGHT   "xvertext routines Copyright (c) 1993 Alan Richardson"
 
#define NONE   0
 
#define TLEFT   1
 
#define TCENTRE   2
 
#define TRIGHT   3
 
#define MLEFT   4
 
#define MCENTRE   5
 
#define MRIGHT   6
 
#define BLEFT   7
 
#define BCENTRE   8
 
#define BRIGHT   9
 
#define CACHE_SIZE_LIMIT   0
 
#define CACHE_BITMAPS
 
#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
 

Typedefs

typedef struct
RotatedTextItemTemplate_t 
RotatedTextItem_t
 

Functions

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...
 
float XRotVersion (char *str, int n)
 Return version/copyright information. More...
 
void XRotSetMagnification (float m)
 Set the font magnification factor for all subsequent operations. More...
 
void XRotSetBoundingBoxPad (int p)
 Set the padding used when calculating bounding boxes. 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...
 
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 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...
 
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...
 
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...
 
static XImage * MakeXImage (Display *dpy, int w, int h)
 Create an XImage structure and allocate memory for it. 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 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...
 
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...
 
static RotatedTextItem_tXRotCreateTextItem (Display *dpy, XFontStruct *font, float angle, char *text, int align)
 Create a rotated text item. 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 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...
 

Variables

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

Macro Definition Documentation

#define _XVERTEXT_INCLUDED_

Definition at line 5 of file Rotated.cxx.

#define BCENTRE   8
#define BLEFT   7
#define BRIGHT   9

Definition at line 61 of file Rotated.cxx.

Referenced by XRotDrawHorizontalString(), XRotPaintAlignedString(), and XRotTextExtents().

#define CACHE_BITMAPS

Definition at line 82 of file Rotated.cxx.

#define CACHE_SIZE_LIMIT   0

Definition at line 75 of file Rotated.cxx.

Referenced by XRotAddToLinkedList().

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

Definition at line 97 of file Rotated.cxx.

Referenced by XRotAddToLinkedList().

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

Definition at line 98 of file Rotated.cxx.

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

Definition at line 99 of file Rotated.cxx.

Referenced by XRotAddToLinkedList().

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

Definition at line 100 of file Rotated.cxx.

Referenced by XRotAddToLinkedList().

#define M_PI   3.14159265358979323846

Definition at line 105 of file Rotated.cxx.

Referenced by AnalyticalIntegral(), ROOT::Math::bigaussian_pdf(), ROOT::Math::breitwigner_cdf(), ROOT::Math::breitwigner_cdf_c(), ROOT::Math::breitwigner_pdf(), ROOT::Math::cauchy_cdf(), ROOT::Math::cauchy_cdf_c(), ROOT::Math::cauchy_pdf(), ROOT::Math::cauchy_quantile(), ROOT::Math::cauchy_quantile_c(), city_distance(), ROOT::Math::gv_detail::convert(), ROOT::Math::gv_detail::correctByPi(), ROOT::Math::crystalball_cdf(), ROOT::Math::crystalball_cdf_c(), ROOT::Math::crystalball_integral(), ROOT::Math::crystalball_pdf(), ROOT::Math::VectorUtil::DeltaPhi(), ROOT::Math::gaussian_pdf(), GaussPdf(), ROOT::Minuit2::GaussianModelFunction::GetGradient(), TKDE::GetRAMISE(), ROOT::Math::GoFTest::GetSigmaN(), gsl_poly_complex_solve_cubic(), gsl_poly_complex_solve_quartic(), ROOT::Math::lognormal_pdf(), ROOT::Math::normal_pdf(), TGeoToOCC::OCC_EllTube(), TGeoToOCC::OCC_Hype(), TGeoToOCC::OCC_Pgon(), TGeoToOCC::OCC_SimpleShape(), TGeoToOCC::OCC_Sphere(), ROOT::Minuit2::GaussFunction::operator()(), ROOT::Minuit2::GaussRandomGen::operator()(), ROOT::Minuit2::GaussianModelFunction::operator()(), ROOT::Math::RotationX::operator*(), ROOT::Math::RotationY::operator*(), ROOT::Math::RotationZ::operator*(), ROOT::Math::VectorUtil::Phi_0_2pi(), ROOT::Math::VectorUtil::Phi_mpi_pi(), ROOT::Math::Cylindrical3D< T >::pi(), ROOT::Math::CylindricalEta3D< T >::pi(), ROOT::Math::Polar2D< T >::pi(), ROOT::Math::Polar3D< T >::pi(), ROOT::Math::PtEtaPhiE4D< ScalarType >::pi(), ROOT::Math::PtEtaPhiM4D< ScalarType >::pi(), ROOT::Math::RotationZYX::Pi(), ROOT::Math::EulerAngles::Pi(), ROOT::Math::RotationX::Rectify(), ROOT::Math::RotationY::Rectify(), ROOT::Math::RotationZ::Rectify(), TKDE::SetKernel(), TKDE::SetKernelSigmas2(), ROOT::Math::tdistribution_pdf(), XRotCreateTextItem(), XRotPaintAlignedString(), and XRotTextExtents().

#define MCENTRE   5
#define MLEFT   4
#define MRIGHT   6

Definition at line 58 of file Rotated.cxx.

Referenced by XRotDrawHorizontalString(), XRotPaintAlignedString(), and XRotTextExtents().

#define NONE   0
#define TCENTRE   2
#define TLEFT   1
#define TRIGHT   3

Definition at line 55 of file Rotated.cxx.

Referenced by XRotDrawHorizontalString(), XRotPaintAlignedString(), and XRotTextExtents().

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

Definition at line 45 of file Rotated.cxx.

Referenced by XRotVersion().

#define XV_VERSION   5.0

Definition at line 44 of file Rotated.cxx.

Referenced by XRotVersion().

Typedef Documentation

typedef struct RotatedTextItemTemplate_t RotatedTextItem_t

Function Documentation

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.

Referenced by XRotCreateTextItem(), and XRotMagnifyImage().

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.

Referenced by XRotCreateTextItem(), XRotDrawHorizontalString(), XRotRetrieveFromCache(), and XRotTextExtents().

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.

Referenced by XRotCreateTextItem(), XRotDrawHorizontalString(), and XRotTextExtents().

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.

Referenced by XRotRetrieveFromCache().

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.

Referenced by XRotRetrieveFromCache().

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.

Referenced by TGX11::DrawText().

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.

Referenced by TGX11::DrawText().

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.

Referenced by XRotPaintAlignedString().

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.

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.

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.

Referenced by XRotAddToLinkedList(), and XRotPaintAlignedString().

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

Magnify an XImage using bilinear interpolation.

Definition at line 1244 of file Rotated.cxx.

Referenced by XRotCreateTextItem().

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.

Referenced by XRotDrawAlignedImageString(), XRotDrawAlignedString(), XRotDrawImageString(), and XRotDrawString().

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.

Referenced by XRotPaintAlignedString().

void XRotSetBoundingBoxPad ( int  p)

Set the padding used when calculating bounding boxes.

Definition at line 257 of file Rotated.cxx.

void XRotSetMagnification ( float  m)

Set the font magnification factor for all subsequent operations.

Definition at line 248 of file Rotated.cxx.

Referenced by TGX11::DrawText(), and TGX11::GetTextExtent().

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.

Referenced by TGX11::GetTextExtent().

float XRotVersion ( char *  str,
int  n 
)

Return version/copyright information.

Definition at line 238 of file Rotated.cxx.

Variable Documentation

RotatedTextItem_t* gFirstTextItem =0
static

Definition at line 139 of file Rotated.cxx.

Referenced by XRotAddToLinkedList(), and XRotRetrieveFromCache().

int gRotatedDebug =0
static

Definition at line 93 of file Rotated.cxx.

struct StyleTemplate_t gRotStyle
static