Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
dvimisc.c File Reference
#include <config.h>
#include "mdvi.h"
+ Include dependency graph for dvimisc.c:

Go to the source code of this file.

Functions

void mdvi_set_color (DviContext *dvi, Ulong fg, Ulong bg)
 
void mdvi_push_color (DviContext *dvi, Ulong fg, Ulong bg)
 
void mdvi_pop_color (DviContext *dvi)
 
void mdvi_reset_color (DviContext *dvi)
 

Function Documentation

void mdvi_pop_color ( DviContext dvi)

Definition at line 46 of file dvimisc.c.

47 {
48  Ulong fg, bg;
49 
50  if(dvi->color_top == 0)
51  return;
52  dvi->color_top--;
53  fg = dvi->color_stack[dvi->color_top].fg;
54  bg = dvi->color_stack[dvi->color_top].bg;
55  mdvi_set_color(dvi, fg, bg);
56 }
void mdvi_push_color ( DviContext dvi,
Ulong  fg,
Ulong  bg 
)

Definition at line 33 of file dvimisc.c.

34 {
35  if(dvi->color_top == dvi->color_size) {
36  dvi->color_size += 32;
38  dvi->color_size * sizeof(DviColorPair));
39  }
40  dvi->color_stack[dvi->color_top].fg = dvi->curr_fg;
41  dvi->color_stack[dvi->color_top].bg = dvi->curr_bg;
42  dvi->color_top++;
43  mdvi_set_color(dvi, fg, bg);
44 }
void mdvi_reset_color ( DviContext dvi)

Definition at line 58 of file dvimisc.c.

59 {
60  dvi->color_top = 0;
61  mdvi_set_color(dvi, dvi->params.fg, dvi->params.bg);
62 }
void mdvi_set_color ( DviContext dvi,
Ulong  fg,
Ulong  bg 
)

Definition at line 22 of file dvimisc.c.

23 {
24  if(dvi->curr_fg != fg || dvi->curr_bg != bg) {
25  DEBUG((DBG_DEVICE, "setting color to (%lu,%lu)\n", fg, bg));
26  if(dvi->device.set_color)
27  dvi->device.set_color(dvi->device.device_data, fg, bg);
28  dvi->curr_fg = fg;
29  dvi->curr_bg = bg;
30  }
31 }