Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions
printplugin.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PluginInstance

Defines

#define MIME_TYPES_HANDLED   "application/x-print-unix-nsplugin:.pnt:Demo Print Plugin for Unix/Linux"
#define PLUGIN_NAME   "Demo Print Plugin for unix/linux"
#define PLUGIN_DESCRIPTION   "The demo print plugin for unix."

Typedefs

typedef struct _PluginInstance PluginInstance

Functions

NPMIMEType dupMimeType (NPMIMEType type)
void printScreenMessage (PluginInstance *This)
void printEPSMessage (PluginInstance *This, FILE *output, NPWindow window)

Class Documentation

struct _PluginInstance

Definition at line 80 of file nullplugin.h.

Collaboration diagram for _PluginInstance:
Class Members
int action
unsigned int depth
GtkWidget * dialogBox
NPBool exists
uint32 height
NPP instance
char * message
uint16 mode
char * pluginsFileUrl
NPBool pluginsHidden
char * pluginsPageUrl
char * pluginsPrintMessage
NPMIMEType type
uint32 width
uint32 x
uint32 y

Define Documentation

#define MIME_TYPES_HANDLED   "application/x-print-unix-nsplugin:.pnt:Demo Print Plugin for Unix/Linux"

Definition at line 42 of file printplugin.h.

#define PLUGIN_DESCRIPTION   "The demo print plugin for unix."

Definition at line 44 of file printplugin.h.

#define PLUGIN_NAME   "Demo Print Plugin for unix/linux"

Definition at line 43 of file printplugin.h.


Typedef Documentation


Function Documentation

Definition at line 191 of file nullplugin.c.

{
    NPMIMEType mimetype = NPN_MemAlloc(strlen(type)+1);
    if (mimetype)
        strcpy(mimetype, type);
    return(mimetype);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void printEPSMessage ( PluginInstance This,
FILE output,
NPWindow  window 
)

Definition at line 150 of file printplugin.c.

{
    char *string;
    int x,y,h,w;
    
    if (!output)
      return;

    fprintf(output, "%%!PS-Adobe-3.0 EPSF-3.0\n");
    fprintf(output, "%%%%BoundingBox: 0 0 %d %d\n", window.width, window.height);
    fprintf(output, "%%%%EndComments\n");
    fprintf(output, "gsave\n");

    w = 3 * window.width  / 4;
    h =     window.height / 2;
    x = (window.width - w)/2; /* center */
    y = h/2;

    /* draw a rectangle */
    fprintf(output, "newpath\n");
    fprintf(output, "%d %d moveto 0 %d rlineto %d 0 rlineto 0 %d rlineto\n",
            x, y, h, w, -h);
    fprintf(output, "closepath\n");
    fprintf(output, "stroke\n");

    /* draw a string */
    string = This->pluginsPrintMessage;
    if (string && *string)
    {
        fprintf(output, "/Times-Roman findfont 300 scalefont setfont\n");
        fprintf(output, "%d %d moveto\n", x + window.width/10, window.height / 2);
        fprintf(output, "(%s) show\n",string);
    }

    fprintf(output,"grestore\n");
    fprintf(output,"%%%%EOF\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 142 of file printplugin.c.

Here is the call graph for this function:

Here is the caller graph for this function: