Changeset 5700
- Timestamp:
- Dec 5, 2005, 3:55:45 PM (21 years ago)
- Location:
- trunk/Ohana/src/kii
- Files:
-
- 8 added
- 18 edited
-
Makefile (modified) (3 diffs)
-
button/ButtonFunctions.c (modified) (3 diffs)
-
button/PSit.c (modified) (3 diffs)
-
colorbar/SetColormap.c (modified) (3 diffs)
-
event/CheckPipe.c (modified) (2 diffs)
-
include/alphabet.h (added)
-
include/bDraw.h (added)
-
include/constants.h (modified) (1 diff)
-
include/structures.h (modified) (1 diff)
-
overlay/EraseOverlay.c (modified) (1 diff)
-
overlay/LoadOverlay.c (modified) (1 diff)
-
overlay/LoadTickmarks.c (modified) (1 diff)
-
overlay/RotFont.c (added)
-
overlay/bDrawColormap.c (added)
-
overlay/bDrawFrame.c (added)
-
overlay/bDrawFuncs.c (added)
-
overlay/bDrawOverlay.c (added)
-
overlay/bDrawRotFont.c (added)
-
picture/Center.c (modified) (1 diff)
-
picture/JPEGit24.c (modified) (11 diffs)
-
picture/NewPicture.c (modified) (1 diff)
-
picture/Resize.c (modified) (1 diff)
-
setup/CheckVisual.c (modified) (2 diffs)
-
setup/DefineLayout.c (modified) (4 diffs)
-
setup/SetUpWindow.c (modified) (1 diff)
-
setup/Ximage.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kii/Makefile
r5242 r5700 50 50 $(ODIR)/EraseOverlay.$(ARCH).o $(ODIR)/PaintOverlay.$(ARCH).o \ 51 51 $(ODIR)/LoadOverlay.$(ARCH).o $(ODIR)/SaveOverlay.$(ARCH).o \ 52 $(ODIR)/DrawOverlay.$(ARCH).o $(ODIR)/CSaveOverlay.$(ARCH).o \ 53 $(ODIR)/PaintTickmarks.$(ARCH).o $(ODIR)/LoadTickmarks.$(ARCH).o 52 $(ODIR)/DrawOverlay.$(ARCH).o $(ODIR)/CSaveOverlay.$(ARCH).o \ 53 $(ODIR)/PaintTickmarks.$(ARCH).o $(ODIR)/LoadTickmarks.$(ARCH).o \ 54 $(ODIR)/bDrawColormap.$(ARCH).o $(ODIR)/bDrawOverlay.$(ARCH).o \ 55 $(ODIR)/bDrawFuncs.$(ARCH).o $(ODIR)/bDrawRotFont.$(ARCH).o \ 56 $(ODIR)/RotFont.$(ARCH).o 57 54 58 55 59 POBJ = \ … … 57 61 $(PDIR)/NewPicture.$(ARCH).o $(PDIR)/Center.$(ARCH).o \ 58 62 $(PDIR)/PositionPictures.$(ARCH).o $(PDIR)/StatusBox.$(ARCH).o \ 59 $(PDIR)/cursor.$(ARCH).o \60 63 $(PDIR)/CursorOps.$(ARCH).o $(PDIR)/Resize.$(ARCH).o \ 61 64 $(PDIR)/Remap8.$(ARCH).o $(PDIR)/Remap24.$(ARCH).o \ 62 65 $(PDIR)/Remap.$(ARCH).o $(PDIR)/Remap32.$(ARCH).o \ 63 $(PDIR)/Remap16.$(ARCH).o 66 $(PDIR)/Remap16.$(ARCH).o $(PDIR)/JPEGit24.$(ARCH).o \ 67 $(PDIR)/cursor.$(ARCH).o 64 68 65 69 SOBJ = \ … … 75 79 $(SDIR)/LoadFont.$(ARCH).o $(SDIR)/TopWindow.$(ARCH).o \ 76 80 $(SDIR)/MakeColormap.$(ARCH).o $(SDIR)/Ximage.$(ARCH).o \ 77 $(SDIR)/MakeCursor.$(ARCH).o $(SDIR)/CheckVisual.$(ARCH).o 81 $(SDIR)/MakeCursor.$(ARCH).o $(SDIR)/CheckVisual.$(ARCH).o \ 82 $(SDIR)/args.$(ARCH).o 78 83 79 84 ZOBJ = \ -
trunk/Ohana/src/kii/button/ButtonFunctions.c
r2466 r5700 12 12 Remap (graphic, layout, &layout[0].matrix); 13 13 CreateZoom (layout, graphic, 0, 0); 14 Refresh (graphic, layout, 0); 15 XFlush (graphic[0].display); 14 16 return (TRUE); 15 17 } … … 22 24 Remap (graphic, layout, &layout[0].matrix); 23 25 CreateZoom (layout, graphic, 0, 0); 26 Refresh (graphic, layout, 0); 27 XFlush (graphic[0].display); 24 28 return (TRUE); 25 29 } … … 32 36 Remap (graphic, layout, &layout[0].matrix); 33 37 CreateZoom (layout, graphic, 0, 0); 38 Refresh (graphic, layout, 0); 39 XFlush (graphic[0].display); 34 40 return (TRUE); 35 41 } -
trunk/Ohana/src/kii/button/PSit.c
r2466 r5700 27 27 } 28 28 29 if (!USE_XWINDOW) { 30 fprintf (stderr, "PS not working yet\n"); 31 return (TRUE); 32 } 33 29 34 scale = MIN ((500.0/(double)layout[0].picture.dx), (700.0/(double)layout[0].picture.dy)); 30 35 if (!Raw) { … … 63 68 64 69 /******** First we draw the picture itself ********/ 70 /* in !USE_XWINDOW, we'll have to change this to use the JPEG function */ 65 71 switch (graphic[0].Nbits) { 66 72 case 8: … … 107 113 } 108 114 115 void ConvertPixmap (Layout *layout, File *f) { 116 117 /* set up expansions */ 118 expand = expand_in = expand_out = 1.0; 119 if (layout[0].expand == 0) 120 layout[0].expand = 1; 121 if (layout[0].expand > 0) { 122 expand = 1 / (1.0*layout[0].expand); 123 expand_out = layout[0].expand; 124 expand_in = 1; 125 } 126 if (layout[0].expand < 0) { 127 expand = fabs((double)layout[0].expand); 128 expand_out = 1; 129 expand_in = -layout[0].expand; 130 } 131 132 dx = layout[0].picture.dx; 133 dy = layout[0].picture.dy; 134 DX = layout[0].matrix.Naxis[0]; 135 DY = layout[0].matrix.Naxis[1]; 136 137 /* X,Y are the image coordinates of the first image pixel */ 138 X = MAX(0.5*(DX - dx*expand) - layout[0].X, 0); 139 if ((int)X != X) 140 X = (int) X + 1; 141 else 142 X = (int) X; 143 Y = MAX(0.5*(DY - dy*expand) - layout[0].Y, 0); 144 if ((int)Y != Y) 145 Y = (int) Y + 1; 146 else 147 Y = (int) Y; 148 149 /* Rx,Ry are the screen coordinates of the first image pixel */ 150 Rx = (X + layout[0].X - 0.5*DX)/expand + 0.5*dx; 151 Ry = (Y + layout[0].Y - 0.5*DY)/expand + 0.5*dy; 152 153 i_start = MIN (MAX (Rx, 0), dx - expand_out + 1); 154 j_start = MIN (MAX (Ry, 0), dy - expand_out + 1); 155 156 if (layout[0].expand > 0) { 157 i_end = MAX (MIN (i_start + ((int)(expand*(dx-i_start)))/expand, expand_out*(DX-X) + Rx), 0); 158 j_end = MAX (MIN (j_start + ((int)(expand*(dy-j_start)))/expand, expand_out*(DY-Y) + Ry), 0); 159 } else { 160 i_end = MAX (MIN (dx, (DX-X)/expand + Rx), 0); 161 j_end = MAX (MIN (dy, (DY-Y)/expand + Ry), 0); 162 } 163 164 dropback = expand_out - (i_end - i_start) % expand_out; 165 if ((i_end - i_start) % expand_out == 0) dropback = 0; 166 167 /* output line buffer */ 168 ALLOCATE (line_buffer, char, dx); 169 170 in_pix_ref = (unsigned char *) (layout[0].matrix.buffer) + DX*(int)MAX(Y,0) + (int)MAX(X,0); 171 172 /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/ 173 174 Nchar = 255.0; 175 Npix = layout[0].Npixels; 176 frac = Nchar / Npix; 177 178 /**** fill in bottom area ****/ 179 out_pix = line_buffer; 180 for (i = 0; i < dx; i++, out_pix++) { 181 *out_pix = WHITE; 182 } 183 for (j = 0; j < j_start; j++) { 184 for (i = 0; i < dx; i++) { 185 fprintf (f, "%02x", val); 186 if ((Npt % 40) == 0) { 187 fprintf (f, "\n"); 188 } 189 } 190 } 191 192 /*** fill in the image data region ***/ 193 for (j = j_start; j < j_end; j+= expand_out, in_pix_ref += expand_in*DX) { 194 195 /* create one output image line */ 196 in_pix = in_pix_ref; 197 out_pix = line_buffer; 198 199 /**** fill in area to the left of the picture ****/ 200 for (i = 0; i < i_start; i++, out_pix+=3) { 201 *out_pix = WHITE; 202 } 203 204 /*** fill in the picture region ***/ 205 for (i = i_start; i < i_end; i+=expand_out, in_pix+=expand_in) { 206 for (ii = 0; ii < expand_out; ii++, out_pix++) { 207 *out_pix = *in_pix*frac; 208 } 209 } 210 211 /**** fill in area to the right of the picture ****/ 212 for (i = i_end; i < dx; i++, out_pix++) { 213 *out_pix = WHITE; 214 } 215 216 /* write out the image line expand_out times */ 217 for (j = 0; j < expand_out; j++) { 218 for (i = 0; i < dx; i++) { 219 fprintf (f, "%02x", val); 220 if ((Npt % 40) == 0) { 221 fprintf (f, "\n"); 222 } 223 } 224 } 225 } 226 227 /**** fill in top area ****/ 228 out_pix = line_buffer; 229 for (i = 0; i < dx; i++, out_pix++) { 230 *out_pix = WHITE; 231 } 232 for (j = j_end; j < dy; j++) { 233 for (i = 0; i < dx; i++) { 234 fprintf (f, "%02x", val); 235 if ((Npt % 40) == 0) { 236 fprintf (f, "\n"); 237 } 238 } 239 } 240 } 241 109 242 void ConvertPixmap8 (Layout *layout, FILE *f) { 110 243 -
trunk/Ohana/src/kii/colorbar/SetColormap.c
r2466 r5700 1 1 # include "Ximage.h" 2 3 /*** this function uses only private colormaps. it should try the standard colormap 4 first to get better control over the smooth greyscales ***/ 2 5 3 6 int SetColormap (Graphic *graphic, Layout *layout, char *name) { … … 7 10 /* greyscale */ 8 11 if ((!strcmp (name, "grayscale")) || (!strcmp (name, "greyscale"))) { 12 fprintf (stderr, "setting greyscale : %d\n", layout[0].Npixels); 9 13 for (i = 0; i < layout[0].Npixels; i++) { 10 14 layout[0].cmap[i].red = 256*(255 - 255*i/layout[0].Npixels); … … 84 88 85 89 store_colors: 90 if (!USE_XWINDOW) return (TRUE); 86 91 if (graphic[0].visualclass) { 92 fprintf (stderr, "storing colors\n"); 87 93 XStoreColors(graphic[0].display, graphic[0].colormap, layout[0].cmap, layout[0].Npixels); 88 94 } else { 89 95 for (i = 0; i < layout[0].Npixels; i++) { 96 fprintf (stderr, "%04x %04x %04x -> ", layout[0].cmap[i].red, layout[0].cmap[i].green, layout[0].cmap[i].blue); 90 97 if (XAllocColor (graphic[0].display, graphic[0].colormap, &layout[0].cmap[i]) == 0) { 91 98 fprintf (stderr, "error on %d\n", i); 92 99 } 100 fprintf (stderr, "%04x %04x %04x\n", layout[0].cmap[i].red, layout[0].cmap[i].green, layout[0].cmap[i].blue); 93 101 } 94 102 } -
trunk/Ohana/src/kii/event/CheckPipe.c
r5637 r5700 89 89 90 90 if (!strcmp (buffer, "PSIT")) { 91 /** this one needs work : ConvertPixmapN fails for !USE_XWINDOW */ 91 92 status = PSit (graphic, layout, 0); 92 93 write (layout[0].Ximage, "DONE", 4); … … 95 96 96 97 if (!strcmp (buffer, "PSRW")) { 98 /** this one needs work : ConvertPixmapN fails for !USE_XWINDOW */ 97 99 status = PSit (graphic, layout, 1); 98 100 write (layout[0].Ximage, "DONE", 4); -
trunk/Ohana/src/kii/include/constants.h
r3695 r5700 25 25 int DECIMAL_DEG; 26 26 int DEBUG; 27 int USE_XWINDOW; 28 int MAP_WINDOW; 27 29 28 30 # define EVENT_MASK (long) \ -
trunk/Ohana/src/kii/include/structures.h
r2466 r5700 124 124 } Layout; 125 125 126 typedef struct { 127 int dx, dy, ascent; 128 unsigned char *bits; 129 } RotFont; 130 131 typedef struct { 132 RotFont *font; 133 char name[64]; 134 int size; 135 } FontSet; 126 136 127 137 /* this routine is independent of the number of overlays */ -
trunk/Ohana/src/kii/overlay/EraseOverlay.c
r2906 r5700 24 24 } 25 25 26 if (USE_XWINDOW) Refresh (graphic, layout, 0); 27 26 28 fcntl (layout[0].Ximage, F_SETFL, O_NONBLOCK); 27 Refresh (graphic, layout, 0);28 29 return (TRUE); 29 30 } -
trunk/Ohana/src/kii/overlay/LoadOverlay.c
r2466 r5700 88 88 OVERLAY[N] = TRUE; 89 89 /* Refresh (graphic, layout, 0); */ 90 for (i = 0; i < NOVERLAYS; i++) { 91 if (OVERLAY[i]) 92 PaintOverlay (graphic, layout, i); 90 if (USE_XWINDOW) { 91 for (i = 0; i < NOVERLAYS; i++) { 92 if (OVERLAY[i]) 93 PaintOverlay (graphic, layout, i); 94 } 95 PaintTickmarks (graphic, layout); 96 XFlush (graphic[0].display); 93 97 } 94 PaintTickmarks (graphic, layout);95 XFlush (graphic[0].display);96 98 fcntl (layout[0].Ximage, F_SETFL, O_NONBLOCK); 97 99 return (TRUE); -
trunk/Ohana/src/kii/overlay/LoadTickmarks.c
r2466 r5700 55 55 layout[0].tickmarks.Nobjects = Nobjects; 56 56 57 Refresh (graphic, layout, 0); 57 if (USE_XWINDOW) Refresh (graphic, layout, 0); 58 58 59 fcntl (layout[0].Ximage, F_SETFL, O_NONBLOCK); 59 60 return (TRUE); -
trunk/Ohana/src/kii/picture/Center.c
r2906 r5700 21 21 } 22 22 23 Remap (graphic, layout, &layout[0].matrix); 24 Refresh (graphic, layout, 0); 23 if (USE_XWINDOW) { 24 Remap (graphic, layout, &layout[0].matrix); 25 Refresh (graphic, layout, 0); 26 XFlush (graphic[0].display); 27 } 25 28 26 29 fcntl (layout[0].Ximage, F_SETFL, O_NONBLOCK); 27 XFlush (graphic[0].display);28 30 return (TRUE); 29 31 } -
trunk/Ohana/src/kii/picture/JPEGit24.c
r5637 r5700 1 1 # include "Ximage.h" 2 2 # include "jpeglib.h" 3 4 void JPEGit24 (Graphic *graphic, Layout *layout) { 3 # include <png.h> 4 # include "bDraw.h" 5 6 # define WHITE_R 255 7 # define WHITE_G 255 8 # define WHITE_B 255 9 10 int JPEGit24 (Graphic *graphic, Layout *layout) { 5 11 6 12 struct jpeg_compress_struct cinfo; … … 8 14 JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */ 9 15 JSAMPLE *image_buffer; /* Points to data for current line */ 10 11 int i, j, ii, jj; 16 JSAMPLE *line_buffer; /* Points to data for current line */ 17 18 int ii, i, j; 12 19 int i_start, i_end, j_start, j_end; 13 20 int dropback, extra; /* this is a bit of a kludge... */ 14 21 int dx, dy, DX, DY; 22 int status, Nbytes, quality; 23 int expand_in, expand_out; 15 24 double expand, Rx, Ry, X, Y; 16 int expand_in, expand_out; 17 unsigned char *out_pix, *out_pix2, *data; 18 unsigned char *in_pix, *in_pix2; 25 unsigned char *out_pix, *in_pix, *in_pix_ref; 19 26 unsigned char pixel1[256], pixel2[256], pixel3[256]; 20 unsigned char pixvalue1, pixvalue2, pixvalue3; 21 unsigned long white; 22 unsigned char white1, white2, white3; 27 char filename[1024]; 23 28 FILE *f; 24 29 … … 36 41 f = fopen (filename, "w"); 37 42 if (f == (FILE *) NULL) { 38 fprintf (stderr, " failed to open %s for output\n", filename);43 fprintf (stderr, "Kii: failed to open %s for output\n", filename); 39 44 return (TRUE); 40 45 } … … 55 60 jpeg_start_compress (&cinfo, TRUE); 56 61 57 /* output line buffer */58 ALLOCATE (image_buffer, JSAMPLE, 3*layout[0].picture.dx);59 60 62 /** cmap[i].pixel must be defined even if X is not used **/ 61 63 for (i = 0; i < 256; i++) { /* set up pixel array */ 62 pixel1[i] = 0x0000ff & (layout[0].cmap[i].pixel >> 0); 63 pixel2[i] = 0x0000ff & (layout[0].cmap[i].pixel >> 8); 64 pixel3[i] = 0x0000ff & (layout[0].cmap[i].pixel >> 16); 65 } 66 white = layout[0].white; 67 white1 = 0x0000ff & (white >> 0); 68 white2 = 0x0000ff & (white >> 8); 69 white3 = 0x0000ff & (white >> 16); 64 pixel1[i] = layout[0].cmap[i].red >> 8; 65 pixel2[i] = layout[0].cmap[i].green >> 8; 66 pixel3[i] = layout[0].cmap[i].blue >> 8; 67 } 70 68 71 69 expand = expand_in = expand_out = 1.0; … … 85 83 dx = layout[0].picture.dx; 86 84 dy = layout[0].picture.dy; 87 DX = layout[0].matrix[0].Naxis[0]; 88 DY = layout[0].matrix[0].Naxis[1]; 89 extra = 4 - (dx * 3) % 4; /* why is this needed?? */ 85 DX = layout[0].matrix.Naxis[0]; 86 DY = layout[0].matrix.Naxis[1]; 90 87 91 88 /* X,Y are the image coordinates of the first image pixel */ … … 119 116 if ((i_end - i_start) % expand_out == 0) dropback = 0; 120 117 121 out_pix = image_buffer; 122 in_pix = (unsigned char *) (layout[0].matrix[0].buffer) + DX*(int)MAX(Y,0) + (int)MAX(X,0); 118 /* output line buffer */ 119 ALLOCATE (image_buffer, JSAMPLE, 3*dx*dy); 120 ALLOCATE (line_buffer, JSAMPLE, 3*dx); 121 122 in_pix_ref = (unsigned char *) (layout[0].matrix.buffer) + DX*(int)MAX(Y,0) + (int)MAX(X,0); 123 123 124 124 /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/ 125 125 126 /* we write the jpeg image data one row at a time */127 128 126 /**** fill in bottom area ****/ 129 out_pix = image_buffer;127 out_pix = line_buffer; 130 128 for (i = 0; i < dx; i++, out_pix+=3) { 131 129 out_pix[0] = WHITE_R; … … 134 132 } 135 133 for (j = 0; j < j_start; j++) { 136 row_pointer[0] = image_buffer; 137 (void) jpeg_write_scanlines (&cinfo, row_pointer, 1); 134 memcpy (&image_buffer[j*3*dx], line_buffer, 3*dx); 138 135 } 139 136 140 137 /*** fill in the image data region ***/ 141 for (j = j_start; j < j_end; j+= expand_out, in_pix += expand_in*DX) {138 for (j = j_start; j < j_end; j+= expand_out, in_pix_ref += expand_in*DX) { 142 139 143 140 /* create one output image line */ 144 out_pix = image_buffer; 141 in_pix = in_pix_ref; 142 out_pix = line_buffer; 145 143 146 144 /**** fill in area to the left of the picture ****/ … … 152 150 153 151 /*** fill in the picture region ***/ 154 for (i = i_start; i < i_end; i++, in_pix+=expand_in, out_pix+=3) { 155 out_pix[0] = pixel1[*in_pix]; 156 out_pix[1] = pixel2[*in_pix]; 157 out_pix[2] = pixel3[*in_pix]; 152 for (i = i_start; i < i_end; i+=expand_out, in_pix+=expand_in) { 153 for (ii = 0; ii < expand_out; ii++, out_pix+=3) { 154 out_pix[0] = pixel1[*in_pix]; 155 out_pix[1] = pixel2[*in_pix]; 156 out_pix[2] = pixel3[*in_pix]; 157 } 158 158 } 159 159 … … 167 167 /* write out the image line expand_out times */ 168 168 for (i = 0; i < expand_out; i++) { 169 row_pointer[0] = image_buffer; 170 (void) jpeg_write_scanlines (&cinfo, row_pointer, 1); 169 memcpy (&image_buffer[(j + i)*3*dx], line_buffer, 3*dx); 171 170 } 172 171 } 173 172 174 173 /**** fill in top area ****/ 175 out_pix = image_buffer;174 out_pix = line_buffer; 176 175 for (i = 0; i < dx; i++, out_pix+=3) { 177 176 out_pix[0] = WHITE_R; … … 179 178 out_pix[2] = WHITE_B; 180 179 } 181 for (j = 0; j < (dy - j_end); j++) { 182 row_pointer[0] = image_buffer; 180 for (j = j_end; j < dy; j++) { 181 memcpy (&image_buffer[j*3*dx], line_buffer, 3*dx); 182 } 183 184 185 /* I need to write the overlay objects on the jpeg image. 186 if i can write / overwrite data in jpeg buffer, then do it here, 187 otherwise i need to create a temporary image buffer, then write the 188 scanlines to that buffer */ 189 190 { 191 int Npalette; 192 png_color *palette; 193 bDrawColor white, color; 194 bDrawBuffer *buffer; 195 196 palette = MakePNGPalette (&Npalette); 197 198 buffer = bDrawBufferCreate (dx, dy); 199 bDrawSetBuffer (buffer); 200 for (i = 0; i < NOVERLAYS; i++) { 201 if (OVERLAY[i]) bDrawOverlay (layout, i); 202 } 203 204 white = GetColorByName ("white"); 205 for (j = 0; j < dy; j++) { 206 for (i = 0; i < dx; i++) { 207 color = buffer[0].pixels[j][i]; 208 if (color == white) continue; 209 image_buffer[j*3*dx + 3*i + 0] = palette[color].red; 210 image_buffer[j*3*dx + 3*i + 1] = palette[color].green; 211 image_buffer[j*3*dx + 3*i + 2] = palette[color].blue; 212 } 213 } 214 bDrawBufferFree (buffer); 215 } 216 217 for (i = 0; i < dy; i++) { 218 row_pointer[0] = &image_buffer[i*3*dx]; 183 219 (void) jpeg_write_scanlines (&cinfo, row_pointer, 1); 184 220 } … … 190 226 return (TRUE); 191 227 } 192 -
trunk/Ohana/src/kii/picture/NewPicture.c
r2466 r5700 66 66 } 67 67 68 if (!USE_XWINDOW) return (TRUE); 69 68 70 Remap (graphic, layout, &layout[0].matrix); 69 71 (DEBUG) && fprintf (stderr, "remapped image\n"); 70 72 Refresh (graphic, layout, 0); 71 72 73 (DEBUG) && fprintf (stderr, "refreshed\n"); 73 74 XFlush (graphic[0].display); -
trunk/Ohana/src/kii/picture/Resize.c
r2466 r5700 24 24 return (TRUE); 25 25 26 /* graphic[0].dx = MAX(NX, MIN_WIDTH);27 graphic[0].dy = MAX(NY, MIN_HEIGHT); */28 26 graphic[0].dx = MAX(NX, 50); 29 27 graphic[0].dy = MAX(NY, 50); 30 28 31 XResizeWindow (graphic[0].display, graphic[0].window, NX, NY);29 if (USE_XWINDOW) XResizeWindow (graphic[0].display, graphic[0].window, NX, NY); 32 30 33 31 PositionPictures (layout, graphic); 34 CreateColorbar (layout, graphic);35 CreatePicture (layout, graphic);36 Remap (graphic, layout, &layout[0].matrix);37 32 38 XClearWindow (graphic[0].display, graphic[0].window); 39 Refresh (graphic, layout, 1); 33 if (USE_XWINDOW) { 34 CreateColorbar (layout, graphic); 35 CreatePicture (layout, graphic); 36 Remap (graphic, layout, &layout[0].matrix); 37 XClearWindow (graphic[0].display, graphic[0].window); 38 Refresh (graphic, layout, 1); 39 } 40 40 41 41 return (TRUE); -
trunk/Ohana/src/kii/setup/CheckVisual.c
r2890 r5700 1 1 # include "Ximage.h" 2 2 # define NPIXELS 64 3 # define DEBUG 03 # define DEBUG 1 4 4 5 5 /* DirectColor doesn't seem to work, even though it is available: … … 143 143 144 144 if (!def) { 145 if (DEBUG) fprintf (stderr, "allocated private colormap\n"); 145 146 graphic[0].colormap = XCreateColormap (graphic[0].display, RootWindow (graphic[0].display, graphic[0].screen), graphic[0].visual, AllocNone); 146 147 } -
trunk/Ohana/src/kii/setup/DefineLayout.c
r5637 r5700 1 1 # include "Ximage.h" 2 3 static char default_colormap[] = "grayscale"; 2 4 3 5 void DefineLayout (Layout *layout, Graphic *graphic, int argc, char **argv) { … … 5 7 int i, status, N; 6 8 struct sockaddr_un Address; 7 char temp[100] ;9 char temp[100], *temp_name; 8 10 9 11 /** initiate connection with mana **/ … … 29 31 30 32 /* get the display colors */ 31 MakeColormap (graphic, layout, argc, argv); 33 if (USE_XWINDOW) { 34 MakeColormap (graphic, layout, argc, argv); 35 } else { 36 temp_name = default_colormap; 37 if ((N = get_argument (argc, argv, "-cm"))) { 38 remove_argument (N, &argc, argv); 39 temp_name = argv[N]; 40 } 41 layout[0].Npixels = 256; 42 SetColormap (graphic, layout, temp_name); 43 } 32 44 33 45 /** set up a bunch of default things **/ … … 51 63 ALLOCATE (layout[0].zoom.data, char, 1); /* allocate so later free will not crash! */ 52 64 53 CreatePicture (layout, graphic); 54 CreateColorbar (layout, graphic); 55 CreateZoom (layout, graphic, 0, 0); 65 if (USE_XWINDOW) { 66 CreatePicture (layout, graphic); 67 CreateColorbar (layout, graphic); 68 CreateZoom (layout, graphic, 0, 0); 69 } 56 70 } 57 71 -
trunk/Ohana/src/kii/setup/SetUpWindow.c
r2466 r5700 23 23 NameWindow (graphic, "Ki'i"); 24 24 25 if ((N = get_argument (*argc, argv, "-nomap"))) { 26 remove_argument(N, argc, argv); 27 } else { 28 MapWindow (graphic); 29 } 25 if (MAP_WINDOW) MapWindow (graphic); 30 26 } 31 27 -
trunk/Ohana/src/kii/setup/Ximage.c
r5637 r5700 12 12 13 13 if (USE_XWINDOW) SetUpDisplay (&graphic, &argc, argv); 14 if (USE_XWINDOW) SetUpWindow (&graphic, &argc, argv); 14 if (USE_XWINDOW) { 15 SetUpWindow (&graphic, &argc, argv); 16 } else { 17 graphic.x = 10; 18 graphic.y = 10; 19 graphic.dx = 512 + 2*PAD1 + PAD1 + ZOOM_X; 20 graphic.dy = 512 + 2*PAD1 + PAD2 + COLORPAD; 21 } 15 22 16 23 DefineLayout (&layout, &graphic, argc, argv);
Note:
See TracChangeset
for help on using the changeset viewer.
