Changeset 5611
- Timestamp:
- Nov 27, 2005, 9:22:01 PM (21 years ago)
- Location:
- trunk/Ohana/src/kapa
- Files:
-
- 11 edited
-
graph/DrawObjects.c (modified) (1 diff)
-
graph/DrawRotString.c (modified) (7 diffs)
-
graph/PSRotFont.c (modified) (11 diffs)
-
graph/RotFont.c (modified) (8 diffs)
-
graph/bDrawRotFont.c (modified) (7 diffs)
-
include/alphabet.h (modified) (2 diffs)
-
include/bDraw.h (modified) (1 diff)
-
include/prototypes.h (modified) (1 diff)
-
include/structures.h (modified) (2 diffs)
-
setup/MakeColormap.c (modified) (4 diffs)
-
setup/TopWindow.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kapa/graph/DrawObjects.c
r4769 r5611 27 27 int DrawObjectN (Layout *layout, Gobjects *object) { 28 28 29 static unsignedchar dash[2] = {5,10};30 static unsignedchar dot[2] = {3,3};29 static char dash[2] = {5,10}; 30 static char dot[2] = {3,3}; 31 31 int lweight; 32 32 -
trunk/Ohana/src/kapa/graph/DrawRotString.c
r5610 r5611 1 1 # include "Ximage.h" 2 # include "alphabet.h" 3 2 3 # define NROTCHARS 256 4 4 # define XPROC(x,y) (scale*(cs*((x) - x0) - sn*((y) - y0)) + X0) 5 5 # define YPROC(x,y) (scale*(cs*((y) - y0) + sn*((x) - x0)) + Y0) … … 8 8 int DrawRotText (int x, int y, char *string, int pos, double angle) { 9 9 10 char *c, *bitmap, basefont[64]; 10 unsigned char *bitmap; 11 char *currentname, basename[64], *c; 11 12 int i, dy, dx, N, X, Y, code; 12 int dX, Xoff, dY, Yoff, YoffBase, basesize; 13 double cs, sn; 13 int dX, Xoff, dY, Yoff, YoffBase; 14 int currentsize, basesize; 15 double cs, sn, currentscale; 16 RotFont *currentfont; 17 18 currentname = GetRotFont (¤tsize); 19 currentfont = GetRotFontData (¤tscale); 20 strcpy (basename, currentname); 21 basesize = currentsize; 14 22 15 23 /* strip leading whitespace */ … … 21 29 sn = sin(angle*RAD_DEG); 22 30 dX = RotStrlen (c); 23 dY = activefont[65].ascent;31 dY = currentfont[65].ascent; 24 32 25 33 /* apply appropriate offset */ … … 39 47 code = FALSE; 40 48 41 strcpy (basefont, currentname);42 basesize = currentsize;43 44 49 YoffBase = Yoff; 45 50 /* draw characters one-by-one */ 46 51 for (i = 0; i < strlen(c); i++) { 47 52 N = (int)(c[i]); 48 if ((N < 0) || (N >= NROT )) continue;53 if ((N < 0) || (N >= NROTCHARS)) continue; 49 54 50 55 /* check for special characters */ … … 52 57 if (N == 94) { 53 58 SetRotFont (currentname, (int)(0.8*currentsize)); 54 Yoff -= 0.5*activescale*dY; 59 currentfont = GetRotFontData (¤tscale); 60 Yoff -= 0.5*currentscale*dY; 55 61 continue; 56 62 } 57 63 if (N == 95) { 58 64 SetRotFont (currentname, (int)(0.8*currentsize)); 59 Yoff += 0.5*activescale*dY; 65 currentfont = GetRotFontData (¤tscale); 66 Yoff += 0.5*currentscale*dY; 60 67 continue; 61 68 } 62 69 if (N == 124) { 63 70 SetRotFont (currentname, basesize); 71 currentfont = GetRotFontData (¤tscale); 64 72 Yoff = YoffBase; 65 73 continue; … … 72 80 if (c[i+1] == 'h') { 73 81 SetRotFont ("helvetica", currentsize); 82 currentfont = GetRotFontData (¤tscale); 74 83 } 75 84 if (c[i+1] == 't') { 76 85 SetRotFont ("times", currentsize); 86 currentfont = GetRotFontData (¤tscale); 77 87 } 78 88 if (c[i+1] == 'c') { 79 89 SetRotFont ("courier", currentsize); 90 currentfont = GetRotFontData (¤tscale); 80 91 } 81 92 if (c[i+1] == 's') { 82 93 SetRotFont ("symbol", currentsize); 94 currentfont = GetRotFontData (¤tscale); 83 95 } 84 96 i++; … … 88 100 code = FALSE; 89 101 90 bitmap = activefont[N].bits;91 dx = activefont[N].dx;92 dy = activefont[N].dy;93 X = x + (int)(Xoff*cs - Yoff*sn) + (int)( activescale*activefont[N].ascent*sn);94 Y = y + (int)(Xoff*sn + Yoff*cs) - (int)( activescale*activefont[N].ascent*cs);95 DrawRotBitmap (X, Y, dx, dy, bitmap, TRUE, angle, activescale);96 Xoff += 1 + (int)( activescale*dx + 0.5);102 bitmap = currentfont[N].bits; 103 dx = currentfont[N].dx; 104 dy = currentfont[N].dy; 105 X = x + (int)(Xoff*cs - Yoff*sn) + (int)(currentscale*currentfont[N].ascent*sn); 106 Y = y + (int)(Xoff*sn + Yoff*cs) - (int)(currentscale*currentfont[N].ascent*cs); 107 DrawRotBitmap (X, Y, dx, dy, bitmap, TRUE, angle, currentscale); 108 Xoff += 1 + (int)(currentscale*dx + 0.5); 97 109 } 98 SetRotFont (base font, basesize);110 SetRotFont (basename, basesize); 99 111 return (TRUE); 100 112 } 101 113 102 int DrawRotBitmap (int x, int y, int dx, int dy, char *bitmap, int mode, double angle, double scale) {114 int DrawRotBitmap (int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale) { 103 115 104 116 int ii, jj, byte_line, byte, bit, flag; -
trunk/Ohana/src/kapa/graph/PSRotFont.c
r5610 r5611 1 1 # include "Ximage.h" 2 # include "alphabet.h"2 # define NROTCHARS 256 3 3 4 4 /* writes commands to print string at location and angle using … … 6 6 void PSRotText (FILE *f, int x, int y, char *string, int pos, double angle) { 7 7 8 char *c, *segment, base font[64];8 char *c, *segment, basename[64], *currentname; 9 9 int i, N, code; 10 10 int dX, dY, Xoff, Yoff, X, Y, Nseg, NSEG, YoffBase; 11 double cs, sn, fscale; 12 int basesize; 13 11 double cs, sn, fscale, currentscale; 12 int basesize, currentsize; 13 RotFont *currentfont; 14 15 currentname = GetRotFont (¤tsize); 16 currentfont = GetRotFontData (¤tscale); 17 strcpy (basename, currentname); 18 basesize = currentsize; 19 14 20 /* strip off leading whitespace */ 15 21 for (c = string; (*c == ' ') || (*c == '\t'); c++); … … 24 30 if (!strcmp (currentname, "symbol")) fscale = 1.2; 25 31 dX = fscale*RotStrlen (c); 26 dY = activefont[65].ascent;32 dY = currentfont[65].ascent; 27 33 28 34 /* apply appropriate offset */ … … 44 50 Y = y - Xoff*sn + Yoff*cs; 45 51 46 basesize = currentsize; 47 strcpy (basefont, currentname); 48 49 PSSetFont (f, currentsize); 52 PSSetFont (f, currentname, currentsize); 50 53 fprintf (f, "gsave\n"); 51 54 fprintf (f, " %d %d moveto %f rotate\n", X, Y, -angle); … … 61 64 for (i = 0; i < strlen (c); i++) { 62 65 N = (int)(c[i]); 63 if ((N < 0) || (N >= NROT )) continue;66 if ((N < 0) || (N >= NROTCHARS)) continue; 64 67 65 68 /* check for special characters */ … … 69 72 PSDumpRotSegment (f, segment, &Nseg); 70 73 SetRotFont (currentname, (int)(0.8*currentsize)); 71 Yoff = 0.75*activescale*dY; 74 currentfont = GetRotFontData (¤tscale); 75 Yoff = 0.75*currentscale*dY; 72 76 fprintf (f, "0 %d rmoveto\n", Yoff); 73 77 YoffBase += Yoff; 74 PSSetFont (f, current size);78 PSSetFont (f, currentname, currentsize); 75 79 continue; 76 80 } … … 79 83 PSDumpRotSegment (f, segment, &Nseg); 80 84 SetRotFont (currentname, (int)(0.8*currentsize)); 81 Yoff = -0.5*activescale*dY; 85 currentfont = GetRotFontData (¤tscale); 86 Yoff = -0.5*currentscale*dY; 82 87 fprintf (f, "0 %d rmoveto\n", Yoff); 83 88 YoffBase += Yoff; 84 PSSetFont (f, current size);89 PSSetFont (f, currentname, currentsize); 85 90 continue; 86 91 } … … 89 94 PSDumpRotSegment (f, segment, &Nseg); 90 95 SetRotFont (currentname, basesize); 96 currentfont = GetRotFontData (¤tscale); 91 97 fprintf (f, "0 %d rmoveto\n", -YoffBase); 92 98 YoffBase = 0; 93 PSSetFont (f, current size);99 PSSetFont (f, currentname, currentsize); 94 100 continue; 95 101 } … … 118 124 if (c[i+1] == 'h') { 119 125 SetRotFont ("helvetica", currentsize); 120 PSSetFont (f, currentsize); 126 currentfont = GetRotFontData (¤tscale); 127 PSSetFont (f, currentname, currentsize); 121 128 } 122 129 if (c[i+1] == 't') { 123 130 SetRotFont ("times", currentsize); 124 PSSetFont (f, currentsize); 131 currentfont = GetRotFontData (¤tscale); 132 PSSetFont (f, currentname, currentsize); 125 133 } 126 134 if (c[i+1] == 'c') { 127 135 SetRotFont ("courier", currentsize); 128 PSSetFont (f, currentsize); 136 currentfont = GetRotFontData (¤tscale); 137 PSSetFont (f, currentname, currentsize); 129 138 } 130 139 if (c[i+1] == 's') { 131 140 SetRotFont ("symbol", currentsize); 132 PSSetFont (f, currentsize); 141 currentfont = GetRotFontData (¤tscale); 142 PSSetFont (f, currentname, currentsize); 133 143 } 134 144 i++; … … 144 154 fprintf (f, "stroke grestore\n"); 145 155 free (segment); 146 SetRotFont (base font, basesize);156 SetRotFont (basename, basesize); 147 157 } 148 158 … … 154 164 } 155 165 156 void PSSetFont (FILE *f, int size) {157 if (!strcmp ( currentname, "times"))166 void PSSetFont (FILE *f, char *name, int size) { 167 if (!strcmp (name, "times")) 158 168 fprintf (f, "/Times-Roman findfont %d scalefont setfont\n", size); 159 if (!strcmp ( currentname, "helvetica"))169 if (!strcmp (name, "helvetica")) 160 170 fprintf (f, "/Helvetica findfont %d scalefont setfont\n", size); 161 if (!strcmp ( currentname, "courier"))171 if (!strcmp (name, "courier")) 162 172 fprintf (f, "/Courier findfont %d scalefont setfont\n", size); 163 if (!strcmp ( currentname, "symbol"))173 if (!strcmp (name, "symbol")) 164 174 fprintf (f, "/Symbol findfont %d scalefont setfont\n", size); 165 175 } -
trunk/Ohana/src/kapa/graph/RotFont.c
r5610 r5611 1 1 # include "Ximage.h" 2 2 # include "alphabet.h" 3 # define NROT 2564 3 4 static int Nrotfonts; 5 static FontSet *RotFonts; 6 7 static char currentname[64]; 8 static int currentsize; 9 static double currentscale; 10 static RotFont *currentfont; 11 5 12 void InitRotFonts () { 6 13 … … 9 16 Nhardwired = sizeof (HardwiredFonts) / sizeof (FontSet); 10 17 11 N allfonts = Nhardwired;12 ALLOCATE ( AllFonts, FontSet, Nallfonts);18 Nrotfonts = Nhardwired; 19 ALLOCATE (RotFonts, FontSet, Nrotfonts); 13 20 14 21 for (i = 0; i < Nhardwired; i++) { 15 AllFonts[i] = HardwiredFonts[i];22 RotFonts[i] = HardwiredFonts[i]; 16 23 } 17 24 18 activefont = AllFonts[DEFFONT].font;19 activescale = 1.0;20 strcpy (currentname, AllFonts[DEFFONT].name);21 currentsize = AllFonts[DEFFONT].size;25 currentfont = RotFonts[DEFFONT].font; 26 currentscale = 1.0; 27 strcpy (currentname, RotFonts[DEFFONT].name); 28 currentsize = RotFonts[DEFFONT].size; 22 29 } 23 30 … … 29 36 dsize = 10000; 30 37 bsize = 10000; 31 for (i = 0; i < N allfonts; i++) {32 if (!strcasecmp ( AllFonts[i].name, name)) {38 for (i = 0; i < Nrotfonts; i++) { 39 if (!strcasecmp (RotFonts[i].name, name)) { 33 40 good = i; 34 nsize = abs ( AllFonts[i].size - size);41 nsize = abs (RotFonts[i].size - size); 35 42 if (nsize < dsize) { 36 43 match = i; 37 44 dsize = nsize; 38 45 } 39 msize = AllFonts[i].size - size;46 msize = RotFonts[i].size - size; 40 47 if ((msize < bsize) && (msize >= 0)) { 41 48 bigger = i; … … 48 55 if (bigger != -1) match = bigger; 49 56 if (match != -1) { 50 activefont = AllFonts[match].font;51 activescale = (double) size / AllFonts[match].size;57 currentfont = RotFonts[match].font; 58 currentscale = (double) size / RotFonts[match].size; 52 59 currentsize = size; 53 60 strcpy (currentname, name); … … 67 74 } 68 75 76 RotFont *GetRotFontData (double *scale) { 77 *scale = currentscale; 78 return (currentfont); 79 } 80 69 81 int RotStrlen (char *c) { 70 82 … … 72 84 double scale; 73 85 74 scale = activescale;86 scale = currentscale; 75 87 76 88 /* find string length */ … … 94 106 } 95 107 if (N == 124) { /* normal-script */ 96 scale = activescale;108 scale = currentscale; 97 109 continue; 98 110 } … … 107 119 } 108 120 code = FALSE; 109 dX += scale* activefont[N].dx + 1;121 dX += scale*currentfont[N].dx + 1; 110 122 } 111 123 return (dX); -
trunk/Ohana/src/kapa/graph/bDrawRotFont.c
r5610 r5611 1 1 # include "Ximage.h" 2 2 # include "bDraw.h" 3 # include "alphabet.h" 4 3 4 # define NROTCHARS 256 5 5 # define XPROC(x,y) (scale*(cs*((x) - x0) - sn*((y) - y0)) + X0) 6 6 # define YPROC(x,y) (scale*(cs*((y) - y0) + sn*((x) - x0)) + Y0) … … 12 12 int bDrawRotText (int x, int y, char *string, int pos, double angle) { 13 13 14 char *c, *bitmap, basefont[64]; 14 unsigned char *bitmap; 15 char *currentname, basename[64], *c; 15 16 int i, dy, dx, N, X, Y, code; 16 int dX, Xoff, dY, Yoff, YoffBase, basesize; 17 double cs, sn; 18 19 // return (TRUE); 17 int dX, Xoff, dY, Yoff, YoffBase; 18 int currentsize, basesize; 19 double cs, sn, currentscale; 20 RotFont *currentfont; 21 20 22 white = GetColorByName ("white"); 21 23 black = GetColorByName ("black"); 24 25 currentname = GetRotFont (¤tsize); 26 currentfont = GetRotFontData (¤tscale); 27 strcpy (basename, currentname); 28 basesize = currentsize; 22 29 23 30 /* strip leading whitespace */ … … 29 36 sn = sin(angle*RAD_DEG); 30 37 dX = RotStrlen (c); 31 dY = activefont[65].ascent;38 dY = currentfont[65].ascent; 32 39 33 40 /* apply appropriate offset */ … … 47 54 code = FALSE; 48 55 49 strcpy (basefont, currentname);50 basesize = currentsize;51 52 56 YoffBase = Yoff; 53 57 /* draw characters one-by-one */ 54 58 for (i = 0; i < strlen(c); i++) { 55 59 N = (int)(c[i]); 56 if ((N < 0) || (N >= NROT )) continue;60 if ((N < 0) || (N >= NROTCHARS)) continue; 57 61 58 62 /* check for special characters */ … … 60 64 if (N == 94) { 61 65 SetRotFont (currentname, (int)(0.8*currentsize)); 62 Yoff -= 0.5*activescale*dY; 66 currentfont = GetRotFontData (¤tscale); 67 Yoff -= 0.5*currentscale*dY; 63 68 continue; 64 69 } 65 70 if (N == 95) { 66 71 SetRotFont (currentname, (int)(0.8*currentsize)); 67 Yoff += 0.5*activescale*dY; 72 currentfont = GetRotFontData (¤tscale); 73 Yoff += 0.5*currentscale*dY; 68 74 continue; 69 75 } 70 76 if (N == 124) { 71 77 SetRotFont (currentname, basesize); 78 currentfont = GetRotFontData (¤tscale); 72 79 Yoff = YoffBase; 73 80 continue; … … 80 87 if (c[i+1] == 'h') { 81 88 SetRotFont ("helvetica", currentsize); 89 currentfont = GetRotFontData (¤tscale); 82 90 } 83 91 if (c[i+1] == 't') { 84 92 SetRotFont ("times", currentsize); 93 currentfont = GetRotFontData (¤tscale); 85 94 } 86 95 if (c[i+1] == 'c') { 87 96 SetRotFont ("courier", currentsize); 97 currentfont = GetRotFontData (¤tscale); 88 98 } 89 99 if (c[i+1] == 's') { 90 100 SetRotFont ("symbol", currentsize); 101 currentfont = GetRotFontData (¤tscale); 91 102 } 92 103 i++; … … 96 107 code = FALSE; 97 108 98 bitmap = activefont[N].bits;99 dx = activefont[N].dx;100 dy = activefont[N].dy;101 X = x + (int)(Xoff*cs - Yoff*sn) + (int)( activescale*activefont[N].ascent*sn);102 Y = y + (int)(Xoff*sn + Yoff*cs) - (int)( activescale*activefont[N].ascent*cs);103 bDrawRotBitmap (X, Y, dx, dy, bitmap, TRUE, angle, activescale);104 Xoff += 1 + (int)( activescale*dx + 0.5);109 bitmap = currentfont[N].bits; 110 dx = currentfont[N].dx; 111 dy = currentfont[N].dy; 112 X = x + (int)(Xoff*cs - Yoff*sn) + (int)(currentscale*currentfont[N].ascent*sn); 113 Y = y + (int)(Xoff*sn + Yoff*cs) - (int)(currentscale*currentfont[N].ascent*cs); 114 bDrawRotBitmap (X, Y, dx, dy, bitmap, TRUE, angle, currentscale); 115 Xoff += 1 + (int)(currentscale*dx + 0.5); 105 116 } 106 SetRotFont (base font, basesize);117 SetRotFont (basename, basesize); 107 118 return (TRUE); 108 119 } 109 120 110 int bDrawRotBitmap (int x, int y, int dx, int dy, char *bitmap, int mode, double angle, double scale) {121 int bDrawRotBitmap (int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale) { 111 122 112 123 int ii, jj, byte_line, byte, bit, flag; -
trunk/Ohana/src/kapa/include/alphabet.h
r5610 r5611 1 typedef struct {2 int dx, dy, ascent;3 char *bits;4 } RotFont;5 6 typedef struct {7 RotFont *font;8 char name[64];9 int size;10 } FontSet;11 12 1 # include "../rotfont/times8.h" 13 2 # include "../rotfont/times12.h" … … 62 51 63 52 /* put these as static in RotFont.c with accessor functions */ 64 int Nallfonts;65 FontSet *AllFonts;66 RotFont *activefont;67 double activescale;68 69 char currentname[64];70 int currentsize;71 53 # define NROT 256 -
trunk/Ohana/src/kapa/include/bDraw.h
r5610 r5611 39 39 void bDrawTriFill (int x1, int y1, int x2, int y2, int x3, int y3); 40 40 int bDrawRotText (int x, int y, char *string, int pos, double angle); 41 int bDrawRotBitmap (int x, int y, int dx, int dy, char *bitmap, int mode, double angle, double scale);41 int bDrawRotBitmap (int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale); -
trunk/Ohana/src/kapa/include/prototypes.h
r4769 r5611 64 64 int remove_argument PROTO((int, int *, char **)); 65 65 66 RotFont *GetRotFontData (double *scale); 66 67 int SetRotFont PROTO((char *name, int size)); 67 68 void InitRotFonts PROTO(()); 68 69 int DrawRotText PROTO((int x, int y, char *string, int pos, double angle)); 69 int DrawRotBitmap PROTO((int x, int y, int dx, int dy, char *bitmap, int mode, double angle, double scale));70 int DrawRotBitmap PROTO((int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale)); 70 71 char *GetRotFont PROTO((int *size)); 71 72 int RotStrlen PROTO((char *c)); 72 73 void PSRotText PROTO((FILE *f, int x, int y, char *string, int pos, double angle)); 73 74 void PSDumpRotSegment PROTO((FILE *f, char *segment, int *Nseg)); 74 void PSSetFont PROTO((FILE *f, int size));75 void PSSetFont PROTO((FILE *f, char *name, int size)); 75 76 void MakeGC (); 76 77 -
trunk/Ohana/src/kapa/include/structures.h
r4769 r5611 56 56 int width; 57 57 int height; 58 char*bits;58 unsigned char *bits; 59 59 } Icon; 60 60 … … 111 111 } Axis; 112 112 113 typedef struct { 114 int dx, dy, ascent; 115 unsigned char *bits; 116 } RotFont; 117 118 typedef struct { 119 RotFont *font; 120 char name[64]; 121 int size; 122 } FontSet; 113 123 114 124 /******** Here we define the Layout struct specific to this program *******/ -
trunk/Ohana/src/kapa/setup/MakeColormap.c
r5610 r5611 9 9 */ 10 10 11 /* the three columns here are : (opihi name) : (X11 name) : (PostScript coordinate) */ 11 12 # define NGRAPHCOLORS 23 12 static char GRAPHCOLORS[NGRAPHCOLORS][ 2][15] = {13 {"black", "0.00 0.00 0.00"},14 {"white", "1.00 1.00 1.00"},15 {"red", "1.00 0.00 0.00"},16 {"pink", "1.00 0.75 0.80"},17 {"orange", "1.00 0.65 0.00"},18 {"yellow", "1.00 1.00 0.00"},19 {"wheat", "0.96 0.87 0.70"},20 {"gold", "1.00 0.84 0.00"},21 {"green", "0.00 1.00 0.00"},22 {"darkgreen", "0.00 0.40 0.00"},23 {"blue", "0.00 0.00 1.00"},24 {"skyblue", "0.53 0.81 0.92"},25 {"indigo", "0.56 0.16 0.87"},26 {"violet", "1.00 0.00 0.00"},27 {"grey10", "0.10 0.10 0.10"},28 {"grey20", "0.20 0.20 0.20"},29 {"grey30", "0.30 0.30 0.30"},30 {"grey40", "0.40 0.40 0.40"},31 {"grey50", "0.50 0.50 0.50"},32 {"grey60", "0.60 0.60 0.60"},33 {"grey70", "0.70 0.70 0.70"},34 {"grey80", "0.80 0.80 0.80"},35 {"grey90", "0.90 0.90 0.90"}};13 static char GRAPHCOLORS[NGRAPHCOLORS][3][16] = { 14 {"black", "black", "0.00 0.00 0.00"}, 15 {"white", "white", "1.00 1.00 1.00"}, 16 {"red", "red", "1.00 0.00 0.00"}, 17 {"pink", "pink", "1.00 0.75 0.80"}, 18 {"orange", "orange", "1.00 0.65 0.00"}, 19 {"yellow", "yellow", "1.00 1.00 0.00"}, 20 {"wheat", "wheat", "0.96 0.87 0.70"}, 21 {"gold", "gold", "1.00 0.84 0.00"}, 22 {"green", "green", "0.00 1.00 0.00"}, 23 {"darkgreen", "darkgreen", "0.00 0.40 0.00"}, 24 {"blue", "blue", "0.00 0.00 1.00"}, 25 {"skyblue", "skyblue", "0.53 0.81 0.92"}, 26 {"indigo", "mediumpurple", "0.57 0.44 0.86"}, 27 {"violet", "darkviolet", "0.58 0.00 0.88"}, 28 {"grey10", "grey10", "0.10 0.10 0.10"}, 29 {"grey20", "grey20", "0.20 0.20 0.20"}, 30 {"grey30", "grey30", "0.30 0.30 0.30"}, 31 {"grey40", "grey40", "0.40 0.40 0.40"}, 32 {"grey50", "grey50", "0.50 0.50 0.50"}, 33 {"grey60", "grey60", "0.60 0.60 0.60"}, 34 {"grey70", "grey70", "0.70 0.70 0.70"}, 35 {"grey80", "grey80", "0.80 0.80 0.80"}, 36 {"grey90", "grey90", "0.90 0.90 0.90"}}; 36 37 37 38 int GetColormapSize () { … … 40 41 41 42 char *GetRGBString (int N) { 42 return (GRAPHCOLORS[N][ 1]);43 return (GRAPHCOLORS[N][2]); 43 44 } 44 45 … … 53 54 /* define the palette */ 54 55 for (i = 0; i < NGRAPHCOLORS; i++) { 55 sscanf (GRAPHCOLORS[i][ 1], "%f %f %f", &red, &green, &blue);56 sscanf (GRAPHCOLORS[i][2], "%f %f %f", &red, &green, &blue); 56 57 palette[i].red = (0xff * red); 57 58 palette[i].green = (0xff * green); … … 70 71 71 72 for (i = 0; i < NGRAPHCOLORS; i++) { 72 temp_name = XGetDefault (graphic.display, argv[0], GRAPHCOLORS[i][0]); 73 graphic.color[i] = GetColor (graphic.display, (temp_name == (char *) NULL ? GRAPHCOLORS[i][0] : temp_name), graphic.colormap, graphic.fore); 73 temp_name = XGetDefault (graphic.display, argv[0], GRAPHCOLORS[i][1]); 74 graphic.color[i] = GetColor (graphic.display, 75 (temp_name == (char *) NULL ? GRAPHCOLORS[i][1] : temp_name), 76 graphic.colormap, graphic.fore); 74 77 } 75 78 } -
trunk/Ohana/src/kapa/setup/TopWindow.c
r4769 r5611 11 11 MakeGC (); 12 12 13 icon[0].pixmap = XCreateBitmapFromData (graphic.display, graphic.window, icon[0].bits, icon[0].width, icon[0].height);13 icon[0].pixmap = XCreateBitmapFromData (graphic.display, graphic.window, (char *) icon[0].bits, icon[0].width, icon[0].height); 14 14 15 15 MakeCursor (DEFAULT_CURSOR);
Note:
See TracChangeset
for help on using the changeset viewer.
