[poppler] poppler/poppler: TextOutputDev.cc, 1.6.2.1, 1.6.2.2 TextOutputDev.h, 1.3.2.1, 1.3.2.2

Kristian Hogsberg krh at freedesktop.org
Sat Aug 6 05:07:49 EST 2005


Update of /cvs/poppler/poppler/poppler
In directory gabe:/tmp/cvs-serv18080/poppler

Modified Files:
      Tag: POPPLER_0_4_X
	TextOutputDev.cc TextOutputDev.h 
Log Message:
2005-08-05  Kristian Høgsberg  <krh at redhat.com>

        * glib/poppler-page.cc:
        * glib/poppler-page.h:
        * poppler/TextOutputDev.cc:
        * poppler/TextOutputDev.h: Propagate selection colors to the glib API.



Index: TextOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/TextOutputDev.cc,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -d -r1.6.2.1 -r1.6.2.2
--- TextOutputDev.cc	29 Jul 2005 05:57:59 -0000	1.6.2.1
+++ TextOutputDev.cc	5 Aug 2005 19:07:47 -0000	1.6.2.2
@@ -29,7 +29,6 @@
 #include "GlobalParams.h"
 #include "UnicodeMap.h"
 #include "UnicodeTypeTable.h"
-#include "GfxState.h"
 #include "TextOutputDev.h"
 #include "Page.h"
 
@@ -3195,8 +3194,8 @@
   TextSelectionPainter(TextPage *page,
 		       double scale,
 		       OutputDev *out,
-		       GfxColor &box_color,
-		       GfxColor &glyph_color);
+		       GfxColor *box_color,
+		       GfxColor *glyph_color);
   ~TextSelectionPainter();
 
   virtual void visitBlock (TextBlock *block,
@@ -3214,15 +3213,15 @@
 
 private:
   OutputDev *out;
-  GfxColor box_color, glyph_color;
+  GfxColor *box_color, *glyph_color;
   GfxState *state;
 };
 
 TextSelectionPainter::TextSelectionPainter(TextPage *page,
 					   double scale,
 					   OutputDev *out,
-					   GfxColor &box_color,
-					   GfxColor &glyph_color)
+					   GfxColor *box_color,
+					   GfxColor *glyph_color)
   : TextSelectionVisitor(page),
     out(out),
     box_color(box_color),
@@ -3256,7 +3255,7 @@
   double x1, y1, x2, y2, margin;
   int i;
 
-  state->setFillColor(&box_color);
+  state->setFillColor(box_color);
   out->updateFillColor(state);
 
   margin = (line->yMax - line->yMin) / 8;
@@ -3281,7 +3280,7 @@
   GooString *string;
   int i;
 
-  state->setFillColor(&glyph_color);
+  state->setFillColor(glyph_color);
   out->updateFillColor(state);
   state->setFont(word->font->gfxFont, word->fontSize);
   out->updateFont(state);
@@ -3510,10 +3509,9 @@
 
 void TextPage::drawSelection(OutputDev *out,
 			     double scale,
-			     PDFRectangle *selection)
+			     PDFRectangle *selection,
+			     GfxColor *glyph_color, GfxColor *box_color)
 {
-  GfxColor box_color = { 0x7c / 255.0, 0x99 / 255.0, 0xad / 255.0 };
-  GfxColor glyph_color = { 1.0, 1.0, 1.0 };
   TextSelectionPainter painter(this, scale, out, box_color, glyph_color);
 
   visitSelection(&painter, selection);
@@ -4082,8 +4080,9 @@
 
 void TextOutputDev::drawSelection(OutputDev *out,
 				  double scale,
-				  PDFRectangle *selection) {
-  text->drawSelection(out, scale, selection);
+				  PDFRectangle *selection,
+				  GfxColor *glyph_color, GfxColor *box_color) {
+  text->drawSelection(out, scale, selection, glyph_color, box_color);
 }
 
 GooList *TextOutputDev::getSelectionRegion(PDFRectangle *selection,

Index: TextOutputDev.h
===================================================================
RCS file: /cvs/poppler/poppler/poppler/TextOutputDev.h,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- TextOutputDev.h	29 Jul 2005 05:57:59 -0000	1.3.2.1
+++ TextOutputDev.h	5 Aug 2005 19:07:47 -0000	1.3.2.2
@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include "goo/gtypes.h"
 #include "GfxFont.h"
+#include "GfxState.h"
 #include "OutputDev.h"
 
 class GooString;
@@ -424,7 +425,8 @@
 
   void drawSelection(OutputDev *out,
 		     double scale,
-		     PDFRectangle *selection);
+		     PDFRectangle *selection,
+		     GfxColor *glyph_color, GfxColor *box_color);
 
   GooList *getSelectionRegion(PDFRectangle *selection, double scale);
 
@@ -584,7 +586,8 @@
 		      double *xMin, double *yMin,
 		      double *xMax, double *yMax);
 
-  void drawSelection(OutputDev *out, double scale, PDFRectangle *selection);
+  void drawSelection(OutputDev *out, double scale, PDFRectangle *selection,
+		     GfxColor *glyph_color, GfxColor *box_color);
 
   GooList *getSelectionRegion(PDFRectangle *selection, double scale);
 



More information about the poppler mailing list