summaryrefslogtreecommitdiffstats
path: root/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-19 19:03:33 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-19 19:03:33 +0000
commite69e8b1d09fb579316595b4e6a850e717358a8b1 (patch)
treea24fc20865f65772f530d16177520190594ffdd2 /kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
parenteecec9afb81fdebb0f22e9da22635874c403f854 (diff)
downloadtdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.tar.gz
tdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.zip
TQt4 port kdegraphics
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1237557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp')
-rw-r--r--kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
index d18c7801..a45a9112 100644
--- a/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
+++ b/kviewshell/plugins/djvu/libdjvu/DjVuToPS.cpp
@@ -456,12 +456,12 @@ store_doc_setup(ByteStream &str)
write(str,
"%% -- procs for foreground layer\n"
"/g {gsave 0 0 0 0 5 index 5 index setcachedevice\n"
- " true [1 0 0 1 0 0] 5 4 roll imagemask grestore\n"
+ " true [1 0 0 1 0 0] 5 4 roll imagetqmask grestore\n"
"} bind def\n"
"/gn {gsave 0 0 0 0 6 index 6 index setcachedevice\n"
" true [1 0 0 1 0 0] 3 2 roll 5 1 roll \n"
" { 1 sub 0 index 2 add 1 index 1 add roll\n"
- " } imagemask grestore pop \n"
+ " } imagetqmask grestore pop \n"
"} bind def\n"
"/c {setcolor rmoveto glyphshow} bind def\n"
"/s {rmoveto glyphshow} bind def\n"
@@ -953,14 +953,14 @@ print_fg_2layer(ByteStream &str,
if (options.get_color())
{
write(str,"/%d %d %d %f %f %f c\n",
- blit->shapeno,
+ blit->tqshapeno,
blit->left-currentx, blit->bottom-currenty,
ramp[p.r]/255.0, ramp[p.g]/255.0, ramp[p.b]/255.0);
}
else
{
write(str,"/%d %d %d %f c\n",
- blit->shapeno,
+ blit->tqshapeno,
blit->left-currentx, blit->bottom-currenty,
ramp[GRAY(p.r, p.g, p.b)]/255.0);
}
@@ -968,7 +968,7 @@ print_fg_2layer(ByteStream &str,
else
{
write(str,"/%d %d %d s\n",
- blit->shapeno,
+ blit->tqshapeno,
blit->left-currentx, blit->bottom-currenty);
}
currentx = blit->left;
@@ -1047,8 +1047,8 @@ print_fg_3layer(ByteStream &str,
{
JB2Blit *blit = jb2->get_blit(current_blit);
GRect rect2(blit->left, blit->bottom,
- jb2->get_shape(blit->shapeno).bits->columns(),
- jb2->get_shape(blit->shapeno).bits->rows());
+ jb2->get_tqshape(blit->tqshapeno).bits->columns(),
+ jb2->get_tqshape(blit->tqshapeno).bits->rows());
if (rect2.intersect(rect1,rect2))
break;
}
@@ -1087,12 +1087,12 @@ print_fg_3layer(ByteStream &str,
{
JB2Blit *blit = jb2->get_blit(current_blit);
GRect rect2(blit->left, blit->bottom,
- jb2->get_shape(blit->shapeno).bits->columns(),
- jb2->get_shape(blit->shapeno).bits->rows());
+ jb2->get_tqshape(blit->tqshapeno).bits->columns(),
+ jb2->get_tqshape(blit->tqshapeno).bits->rows());
if (rect2.intersect(rect1,rect2))
{
write(str,"/%d %d %d s\n",
- blit->shapeno,
+ blit->tqshapeno,
blit->left-currentx, blit->bottom-currenty);
currentx = blit->left;
currenty = blit->bottom;
@@ -1113,27 +1113,27 @@ print_fg(ByteStream &str,
GP<JB2Image> jb2=dimg->get_fgjb();
if (! jb2) return;
int num_blits = jb2->get_blit_count();
- int num_shapes = jb2->get_shape_count();
- unsigned char *dict_shapes = 0;
+ int num_tqshapes = jb2->get_tqshape_count();
+ unsigned char *dict_tqshapes = 0;
unsigned char *blit_list = 0;
- GPBuffer<unsigned char> gdict_shapes(dict_shapes,num_shapes);
+ GPBuffer<unsigned char> gdict_tqshapes(dict_tqshapes,num_tqshapes);
GPBuffer<unsigned char> gblit_list(blit_list,num_blits);
- for(int i=0; i<num_shapes; i++)
+ for(int i=0; i<num_tqshapes; i++)
{
- dict_shapes[i]=0;
+ dict_tqshapes[i]=0;
}
for(int current_blit=0; current_blit<num_blits; current_blit++)
{
JB2Blit *blit = jb2->get_blit(current_blit);
- JB2Shape *shape = & jb2->get_shape(blit->shapeno);
+ JB2Shape *tqshape = & jb2->get_tqshape(blit->tqshapeno);
blit_list[current_blit] = 0;
- if (! shape->bits)
+ if (! tqshape->bits)
continue;
GRect rect2(blit->left, blit->bottom,
- shape->bits->columns(), shape->bits->rows());
+ tqshape->bits->columns(), tqshape->bits->rows());
if (rect2.intersect(rect2, prn_rect))
{
- dict_shapes[blit->shapeno] = 1;
+ dict_tqshapes[blit->tqshapeno] = 1;
blit_list[current_blit] = 1;
}
}
@@ -1152,13 +1152,13 @@ print_fg(ByteStream &str,
"0 1 1 {Encoding exch /.notdef put} for \n"
"CharStrings begin\n"
"/.notdef {} def\n",
- num_shapes+1);
- for(int current_shape=0; current_shape<num_shapes; current_shape++)
+ num_tqshapes+1);
+ for(int current_tqshape=0; current_tqshape<num_tqshapes; current_tqshape++)
{
- if (dict_shapes[current_shape])
+ if (dict_tqshapes[current_tqshape])
{
- JB2Shape *shape = & jb2->get_shape(current_shape);
- GP<GBitmap> bitmap = shape->bits;
+ JB2Shape *tqshape = & jb2->get_tqshape(current_tqshape);
+ GP<GBitmap> bitmap = tqshape->bits;
int rows = bitmap->rows();
int columns = bitmap->columns();
int nbytes = (columns+7)/8*rows+1;
@@ -1173,29 +1173,29 @@ print_fg(ByteStream &str,
GPBuffer<unsigned char> gs_start(s_start,nbytes);
unsigned char *s_ascii;
GPBuffer<unsigned char> gs_ascii(s_ascii,nbytes*2);
- write(str,"/%d {",current_shape);
+ write(str,"/%d {",current_tqshape);
unsigned char *s = s_start;
for(int current_row=0; current_row<rows; current_row++)
{
unsigned char * row_bits = (*bitmap)[current_row];
unsigned char acc = 0;
- unsigned char mask = 0;
+ unsigned char tqmask = 0;
for(int current_col=0; current_col<columns; current_col++)
{
- if (mask == 0)
- mask = 0x80;
+ if (tqmask == 0)
+ tqmask = 0x80;
if (row_bits[current_col])
- acc |= mask;
- mask >>= 1;
- if (mask == 0)
+ acc |= tqmask;
+ tqmask >>= 1;
+ if (tqmask == 0)
{
*s=acc;
s++;
- acc = mask = 0;
+ acc = tqmask = 0;
}
}
- if (mask != 0)
+ if (tqmask != 0)
{
*s=acc;
s++;
@@ -1584,16 +1584,16 @@ print_image_lev1(ByteStream &str,
{
unsigned char *pix = (*bm)[y];
unsigned char acc = 0;
- unsigned char mask = 0;
+ unsigned char tqmask = 0;
char *data;
for (int x=grectBand.width(); x>0; x--, pix++)
{
- if (mask == 0)
- mask = 0x80;
+ if (tqmask == 0)
+ tqmask = 0x80;
if (! *pix)
- acc |= mask;
- mask >>= 1;
- if (mask == 0)
+ acc |= tqmask;
+ tqmask >>= 1;
+ if (tqmask == 0)
{
data = bin2hex[acc];
acc = 0;
@@ -1607,7 +1607,7 @@ print_image_lev1(ByteStream &str,
}
}
}
- if (mask != 0)
+ if (tqmask != 0)
{
data = bin2hex[acc];
*buf_ptr++ = data[0];
@@ -1942,8 +1942,8 @@ print_txt_sub(DjVuTXT &txt, DjVuTXT::Zone &zone,
default:
separator = 0; break;
}
- // Zone children
- if (zone.children.isempty())
+ // Zone tqchildren
+ if (zone.tqchildren.isempty())
{
const char *data = (const char*)txt.textUTF8 + zone.text_start;
int length = zone.text_length;
@@ -1968,8 +1968,8 @@ print_txt_sub(DjVuTXT &txt, DjVuTXT::Zone &zone,
message.format("%d F\n",zone.rect.ymax-zone.rect.ymin);
out.write((const char*)message,message.length());
}
- for (GPosition pos=zone.children; pos; ++pos)
- print_txt_sub(txt, zone.children[pos], out,lastx,lasty);
+ for (GPosition pos=zone.tqchildren; pos; ++pos)
+ print_txt_sub(txt, zone.tqchildren[pos], out,lastx,lasty);
}
}
@@ -2230,10 +2230,10 @@ create(void)
void
DjVuToPS::DecodePort::
notify_file_flags_changed(const DjVuFile *source,
- long set_mask, long clr_mask)
+ long set_tqmask, long clr_tqmask)
{
// WARNING! This function is called from another thread
- if (set_mask & (DjVuFile::DECODE_OK |
+ if (set_tqmask & (DjVuFile::DECODE_OK |
DjVuFile::DECODE_FAILED |
DjVuFile::DECODE_STOPPED ))
{