Hi
what would you say to following patch? (or something similar)
It makes plucker honor default foreground color (set with e.g. Khroma),
if Force default text colors in On.

My favourite combination for reading at night is black background &
green foreground, for sunny outside black background & white foreground.


-- 
 -----------------------------------------------------------
| Radovan Garab�k http://melkor.dnp.fmph.uniba.sk/~garabik/ |
| __..--^^^--..__    garabik @ melkor.dnp.fmph.uniba.sk     |
 -----------------------------------------------------------
Antivirus alert: file .signature infected by signature virus.
Hi! I'm a signature virus! Copy me into your signature file to help me spread!
diff -ur plucker/viewer/paragraph.c plucker.new/viewer/paragraph.c
--- plucker/viewer/paragraph.c  2004-04-14 19:16:08.000000000 +0200
+++ plucker.new/viewer/paragraph.c      2004-04-18 22:56:27.000000000 +0200
@@ -542,14 +542,15 @@
 static void ForceDefaultColor
        (
        TextContext* tContext,
        )
 {
     if ( tContext != NULL && Prefs()->forceDefaultColors &&
          1 < Prefs()->screenDepth ) {
-        tContext->foreColor.r   = 0;
-        tContext->foreColor.g   = 0;
-        tContext->foreColor.b   = inAnchor ? 255 : 0;
+        tContext->foreColor = GetDeviceForeColors();
+        if (inAnchor) {
+            tContext->foreColor.b   = 255-tContext->foreColor.b;
+        };
         SetForeColor( tContext );
         multiline.ForeColor = true;
     }
diff -ur plucker/viewer/screen.c plucker.new/viewer/screen.c
--- plucker/viewer/screen.c     2004-04-14 19:15:31.000000000 +0200
+++ plucker.new/viewer/screen.c 2004-04-18 22:58:20.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * $Id: screen.c,v 1.46 2004/03/20 01:57:30 prussar Exp $
+ * $Id: screen.c,v 1.45 2004/02/01 11:26:33 nordstrom Exp $
  *
  * Viewer - a part of Plucker, the free off-line HTML viewer for PalmOS
  * Copyright (c) 1998-2002, Mark Ian Lillywhite and Michael Nordstrom
@@ -49,6 +49,10 @@
 static Boolean forceDefaultScreen = false;
 static UInt8*  windowPtr          = NULL;
 
+RGBColorType GetDeviceForeColors( void )
+{
+    return deviceForeColors;
+} 
 
 
 /* Set screen bit depth for PalmOS3 */
@@ -276,7 +281,13 @@
    use the good APIs */
 void SaveDrawState_OS35( void )
 {
+    RGBColorType rgb;       
+
     WinPushDrawState();
+
+/* assign default device color for later use when drawing text */
+    WinSetColors( 0, &rgb, 0, 0 );  
+    deviceForeColors = rgb;
 }
 
 
diff -ur plucker/viewer/screen.h plucker.new/viewer/screen.h
--- plucker/viewer/screen.h     2004-04-14 19:15:31.000000000 +0200
+++ plucker.new/viewer/screen.h 2004-04-18 22:40:41.000000000 +0200
@@ -28,6 +28,8 @@
 
 #include "viewer.h"
 
+extern RGBColorType GetDeviceForeColors( void ) SCREEN_SECTION; 
+
 
 /* Set screen bit depth for PalmOS3 */
 extern void SetScreenModeOS3( void ) SCREEN_SECTION;

Reply via email to