Back to index

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

#include <Link.h>

Collaboration diagram for Links:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Links (Object *annots, GString *baseURI)
 ~Links ()
int getNumLinks ()
LinkgetLink (int i)
LinkActionfind (double x, double y)
GBool onLink (double x, double y)

Private Attributes

Link ** links
int numLinks

Detailed Description

Definition at line 383 of file Link.h.


Constructor & Destructor Documentation

Links::Links ( Object annots,
GString baseURI 
)

Definition at line 790 of file Link.cc.

                                             {
  Link *link;
  Object obj1, obj2;
  int size;
  int i;

  links = NULL;
  size = 0;
  numLinks = 0;

  if (annots->isArray()) {
    for (i = 0; i < annots->arrayGetLength(); ++i) {
      if (annots->arrayGet(i, &obj1)->isDict()) {
       if (obj1.dictLookup("Subtype", &obj2)->isName("Link")) {
         link = new Link(obj1.getDict(), baseURI);
         if (link->isOk()) {
           if (numLinks >= size) {
             size += 16;
             links = (Link **)grealloc(links, size * sizeof(Link *));
           }
           links[numLinks++] = link;
         } else {
           delete link;
         }
       }
       obj2.free();
      }
      obj1.free();
    }
  }
}

Here is the call graph for this function:

Definition at line 822 of file Link.cc.

              {
  int i;

  for (i = 0; i < numLinks; ++i)
    delete links[i];
  gfree(links);
}

Here is the call graph for this function:


Member Function Documentation

LinkAction * Links::find ( double  x,
double  y 
)

Definition at line 830 of file Link.cc.

                                          {
  int i;

  for (i = numLinks - 1; i >= 0; --i) {
    if (links[i]->inRect(x, y)) {
      return links[i]->getAction();
    }
  }
  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Link* Links::getLink ( int  i) [inline]

Definition at line 394 of file Link.h.

{ return links[i]; }

Here is the caller graph for this function:

int Links::getNumLinks ( ) [inline]

Definition at line 393 of file Link.h.

{ return numLinks; }

Here is the caller graph for this function:

GBool Links::onLink ( double  x,
double  y 
)

Definition at line 841 of file Link.cc.

                                      {
  int i;

  for (i = 0; i < numLinks; ++i) {
    if (links[i]->inRect(x, y))
      return gTrue;
  }
  return gFalse;
}

Here is the caller graph for this function:


Member Data Documentation

Link** Links::links [private]

Definition at line 405 of file Link.h.

int Links::numLinks [private]

Definition at line 406 of file Link.h.


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