Back to index

tetex-bin  3.0
Public Member Functions | Private Attributes
GfxResources Class Reference

#include <Gfx.h>

Collaboration diagram for GfxResources:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GfxResources (XRef *xref, Dict *resDict, GfxResources *nextA)
 ~GfxResources ()
GfxFontlookupFont (char *name)
GBool lookupXObject (char *name, Object *obj)
GBool lookupXObjectNF (char *name, Object *obj)
void lookupColorSpace (char *name, Object *obj)
GfxPatternlookupPattern (char *name)
GfxShadinglookupShading (char *name)
GBool lookupGState (char *name, Object *obj)
GfxResourcesgetNext ()

Private Attributes

GfxFontDictfonts
Object xObjDict
Object colorSpaceDict
Object patternDict
Object shadingDict
Object gStateDict
GfxResourcesnext

Detailed Description

Definition at line 72 of file Gfx.h.


Constructor & Destructor Documentation

GfxResources::GfxResources ( XRef xref,
Dict resDict,
GfxResources nextA 
)

Definition at line 235 of file Gfx.cc.

                                                                         {
  Object obj1, obj2;
  Ref r;

  if (resDict) {

    // build font dictionary
    fonts = NULL;
    resDict->lookupNF("Font", &obj1);
    if (obj1.isRef()) {
      obj1.fetch(xref, &obj2);
      if (obj2.isDict()) {
       r = obj1.getRef();
       fonts = new GfxFontDict(xref, &r, obj2.getDict());
      }
      obj2.free();
    } else if (obj1.isDict()) {
      fonts = new GfxFontDict(xref, NULL, obj1.getDict());
    }
    obj1.free();

    // get XObject dictionary
    resDict->lookup("XObject", &xObjDict);

    // get color space dictionary
    resDict->lookup("ColorSpace", &colorSpaceDict);

    // get pattern dictionary
    resDict->lookup("Pattern", &patternDict);

    // get shading dictionary
    resDict->lookup("Shading", &shadingDict);

    // get graphics state parameter dictionary
    resDict->lookup("ExtGState", &gStateDict);

  } else {
    fonts = NULL;
    xObjDict.initNull();
    colorSpaceDict.initNull();
    patternDict.initNull();
    shadingDict.initNull();
    gStateDict.initNull();
  }

  next = nextA;
}

Here is the call graph for this function:

Definition at line 283 of file Gfx.cc.

Here is the call graph for this function:


Member Function Documentation

Definition at line 86 of file Gfx.h.

{ return next; }

Here is the caller graph for this function:

void GfxResources::lookupColorSpace ( char *  name,
Object obj 
)

Definition at line 336 of file Gfx.cc.

                                                           {
  GfxResources *resPtr;

  for (resPtr = this; resPtr; resPtr = resPtr->next) {
    if (resPtr->colorSpaceDict.isDict()) {
      if (!resPtr->colorSpaceDict.dictLookup(name, obj)->isNull()) {
       return;
      }
      obj->free();
    }
  }
  obj->initNull();
}

Here is the call graph for this function:

Here is the caller graph for this function:

GfxFont * GfxResources::lookupFont ( char *  name)

Definition at line 294 of file Gfx.cc.

                                            {
  GfxFont *font;
  GfxResources *resPtr;

  for (resPtr = this; resPtr; resPtr = resPtr->next) {
    if (resPtr->fonts) {
      if ((font = resPtr->fonts->lookup(name)))
       return font;
    }
  }
  error(-1, "Unknown font tag '%s'", name);
  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

GBool GfxResources::lookupGState ( char *  name,
Object obj 
)

Definition at line 388 of file Gfx.cc.

                                                        {
  GfxResources *resPtr;

  for (resPtr = this; resPtr; resPtr = resPtr->next) {
    if (resPtr->gStateDict.isDict()) {
      if (!resPtr->gStateDict.dictLookup(name, obj)->isNull()) {
       return gTrue;
      }
      obj->free();
    }
  }
  error(-1, "ExtGState '%s' is unknown", name);
  return gFalse;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 350 of file Gfx.cc.

                                                  {
  GfxResources *resPtr;
  GfxPattern *pattern;
  Object obj;

  for (resPtr = this; resPtr; resPtr = resPtr->next) {
    if (resPtr->patternDict.isDict()) {
      if (!resPtr->patternDict.dictLookup(name, &obj)->isNull()) {
       pattern = GfxPattern::parse(&obj);
       obj.free();
       return pattern;
      }
      obj.free();
    }
  }
  error(-1, "Unknown pattern '%s'", name);
  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 369 of file Gfx.cc.

                                                  {
  GfxResources *resPtr;
  GfxShading *shading;
  Object obj;

  for (resPtr = this; resPtr; resPtr = resPtr->next) {
    if (resPtr->shadingDict.isDict()) {
      if (!resPtr->shadingDict.dictLookup(name, &obj)->isNull()) {
       shading = GfxShading::parse(&obj);
       obj.free();
       return shading;
      }
      obj.free();
    }
  }
  error(-1, "Unknown shading '%s'", name);
  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

GBool GfxResources::lookupXObject ( char *  name,
Object obj 
)

Definition at line 308 of file Gfx.cc.

                                                         {
  GfxResources *resPtr;

  for (resPtr = this; resPtr; resPtr = resPtr->next) {
    if (resPtr->xObjDict.isDict()) {
      if (!resPtr->xObjDict.dictLookup(name, obj)->isNull())
       return gTrue;
      obj->free();
    }
  }
  error(-1, "XObject '%s' is unknown", name);
  return gFalse;
}

Here is the call graph for this function:

Here is the caller graph for this function:

GBool GfxResources::lookupXObjectNF ( char *  name,
Object obj 
)

Definition at line 322 of file Gfx.cc.

                                                           {
  GfxResources *resPtr;

  for (resPtr = this; resPtr; resPtr = resPtr->next) {
    if (resPtr->xObjDict.isDict()) {
      if (!resPtr->xObjDict.dictLookupNF(name, obj)->isNull())
       return gTrue;
      obj->free();
    }
  }
  error(-1, "XObject '%s' is unknown", name);
  return gFalse;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 92 of file Gfx.h.

Definition at line 90 of file Gfx.h.

Definition at line 95 of file Gfx.h.

Definition at line 96 of file Gfx.h.

Definition at line 93 of file Gfx.h.

Definition at line 94 of file Gfx.h.

Definition at line 91 of file Gfx.h.


The documentation for this class was generated from the following files: