Changeset 13331
- Timestamp:
- May 10, 2007, 8:53:53 AM (19 years ago)
- Location:
- trunk/Ohana/src/kapa2
- Files:
-
- 4 added
- 1 deleted
- 8 edited
-
Makefile (modified) (1 diff)
-
include/prototypes.h (modified) (6 diffs)
-
src/ButtonFunctions.c (added)
-
src/CheckPipe.c (modified) (1 diff)
-
src/ConvertPixmap.c (deleted)
-
src/EraseOverlay.c (modified) (1 diff)
-
src/EventLoop.c (modified) (1 diff)
-
src/Image.c (modified) (3 diffs)
-
src/LoadOverlay.c (modified) (2 diffs)
-
src/PSOverlay.c (added)
-
src/PSPixmap.c (added)
-
src/PSimage.c (added)
-
src/PSit.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kapa2/Makefile
r13320 r13331 75 75 $(SRC)/CheckButtons.$(ARCH).o $(SRC)/InvertButton.$(ARCH).o \ 76 76 $(SRC)/UpdatePointer.$(ARCH).o $(SRC)/JPEGit24.$(ARCH).o \ 77 $(SRC)/bDrawOverlay.$(ARCH).o 77 $(SRC)/bDrawOverlay.$(ARCH).o $(SRC)/ButtonFunctions.$(ARCH).o \ 78 $(SRC)/PSimage.$(ARCH).o $(SRC)/PSPixmap.$(ARCH).o \ 79 $(SRC)/PSOverlay.$(ARCH).o 78 80 79 81 OBJ = $(KAPA) -
trunk/Ohana/src/kapa2/include/prototypes.h
r13320 r13331 39 39 40 40 /* EventLoop */ 41 int PScommand PROTO(()); 41 42 int CheckPipe PROTO(()); 42 43 int Reconfig PROTO((XEvent *event)); … … 44 45 45 46 /* CheckPipe */ 46 int PSit PROTO(());47 47 int PNGit PROTO(()); 48 48 int PPMit PROTO(()); … … 84 84 85 85 /* PS drawing utilities */ 86 int PSit PROTO((char *filename, char *pagename, int scaleMode, int pageMode)); 86 87 int PSFrame PROTO((KapaGraphWidget *graph, FILE *f)); 87 88 int PSObjects PROTO((KapaGraphWidget *graph, FILE *f)); … … 95 96 void PSTick PROTO((FILE *f, double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis)); 96 97 void ClipLinePS PROTO((double x0, double y0, double x1, double y1, double X0, double Y1, double X1, double Y0, FILE *f)); 98 int PSimage PROTO((KapaImageWidget *image, FILE *f)); 99 void PSOverlay PROTO((KapaImageWidget *image, int N, FILE *f, int extra)); 100 void PSPixmap8 PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f)); 101 void PSPixmap16 PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f)); 102 void PSPixmap24 PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f)); 103 void PSPixmap32 PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f)); 97 104 98 105 /* kapa bDraw Functions */ … … 110 117 bDrawBuffer *bDrawIt PROTO(()); 111 118 void bDrawGraph PROTO((KapaGraphWidget *graph)); 112 113 # if (0)114 # endif115 119 116 120 /* misc support */ … … 157 161 int InButton PROTO((XButtonEvent *event, Button *button)); 158 162 int InPicture PROTO((XButtonEvent *event, Picture *picture)); 163 164 /* Button Functions */ 165 int greycolors PROTO((Graphic *graphic, KapaImageWidget *image)); 166 int puns PROTO((Graphic *graphic, KapaImageWidget *image)); 167 int rainbow PROTO((Graphic *graphic, KapaImageWidget *image)); 168 int Recenter PROTO((Graphic *graphic, KapaImageWidget *image)); 169 int Rescale PROTO((Graphic *graphic, KapaImageWidget *image)); 170 int RecenterRescale PROTO((Graphic *graphic, KapaImageWidget *image)); 171 int ToggleDEG PROTO((Graphic *graphic, KapaImageWidget *image)); 172 int Overlay0 PROTO((Graphic *graphic, KapaImageWidget *image)); 173 int Overlay1 PROTO((Graphic *graphic, KapaImageWidget *image)); 174 int Overlay2 PROTO((Graphic *graphic, KapaImageWidget *image)); 175 int Overlay3 PROTO((Graphic *graphic, KapaImageWidget *image)); 176 int PSfunction PROTO((Graphic *graphic, KapaImageWidget *image)); -
trunk/Ohana/src/kapa2/src/CheckPipe.c
r13320 r13331 33 33 34 34 if (!strcmp (buffer, "PSIT")) { 35 status = PS it();35 status = PScommand (); 36 36 write (sock, "DONE", 4); 37 37 return (status); -
trunk/Ohana/src/kapa2/src/EraseOverlay.c
r13320 r13331 13 13 image = section->image; 14 14 15 KiiScanCommand (sock, 16, "% d", &N);15 KiiScanCommand (sock, 16, "%*s %d", &N); 16 16 17 17 if (N > NOVERLAYS) { -
trunk/Ohana/src/kapa2/src/EventLoop.c
r13320 r13331 48 48 if (LastEvent (display, Expose, &event)) Refresh (1); 49 49 if (LastEvent (display, MappingNotify, &event)) XRefreshKeyboardMapping ((XMappingEvent *) &event); 50 # if (0)51 50 if (LastEvent (display, MotionNotify, &event)) UpdatePointer (graphic, (XMotionEvent *) &event); 52 51 if (LastEvent (display, ButtonPress, &event)) InterpretPresses (graphic, (XButtonEvent *) &event); 53 52 if (LastEvent (display, KeyPress, &event)) InterpretKeys (graphic, &event); 54 # endif55 53 56 54 /* drop and ignore the following StructureNotifyMask events */ -
trunk/Ohana/src/kapa2/src/Image.c
r13320 r13331 27 27 ALLOCATE (image[0].overlay[i].objects, Object, 1); /* allocate so later free will not crash! */ 28 28 image[0].overlay[i].active = FALSE; 29 image[0].overlay[i].color = graphic[0].overlay_color[ 0];29 image[0].overlay[i].color = graphic[0].overlay_color[i]; 30 30 } 31 31 image[0].matrix.size = 0; /* a flag to show there is no data in the matrix */ … … 39 39 40 40 InitButtonSize (&image[0].PS_button, PS_width, PS_height, PS_bits); 41 InitButtonFunc (&image[0].PS_button, PS it);41 InitButtonFunc (&image[0].PS_button, PSfunction); 42 42 43 43 InitButtonSize (&image[0].grey_button, grey_width, grey_height, grey_bits); 44 //InitButtonFunc (&image[0].grey_button, greycolors);44 InitButtonFunc (&image[0].grey_button, greycolors); 45 45 46 46 InitButtonSize (&image[0].rainbow_button, rainbow_width, rainbow_height, rainbow_bits); 47 //InitButtonFunc (&image[0].rainbow_button, rainbow);47 InitButtonFunc (&image[0].rainbow_button, rainbow); 48 48 49 49 InitButtonSize (&image[0].puns_button, puns_width, puns_height, puns_bits); 50 //InitButtonFunc (&image[0].puns_button, puns);50 InitButtonFunc (&image[0].puns_button, puns); 51 51 52 52 InitButtonSize (&image[0].recenter_button, recenter_width, recenter_height, recenter_bits); 53 //image[0].recenter_button.function_1 = Recenter;54 //image[0].recenter_button.function_2 = RecenterRescale;55 //image[0].recenter_button.function_3 = Rescale;53 image[0].recenter_button.function_1 = Recenter; 54 image[0].recenter_button.function_2 = RecenterRescale; 55 image[0].recenter_button.function_3 = Rescale; 56 56 57 57 InitButtonSize (&image[0].overlay_button[0], red_width, red_height, red_bits); 58 //InitButtonFunc (&image[0].overlay_button[0], Overlay0);58 InitButtonFunc (&image[0].overlay_button[0], Overlay0); 59 59 60 60 InitButtonSize (&image[0].overlay_button[1], green_width, green_height, green_bits); 61 //InitButtonFunc (&image[0].overlay_button[1], Overlay1);61 InitButtonFunc (&image[0].overlay_button[1], Overlay1); 62 62 63 63 InitButtonSize (&image[0].overlay_button[2], blue_width, blue_height, blue_bits); 64 //InitButtonFunc (&image[0].overlay_button[2], Overlay2);64 InitButtonFunc (&image[0].overlay_button[2], Overlay2); 65 65 66 66 InitButtonSize (&image[0].overlay_button[3], yellow_width, yellow_height, yellow_bits); 67 //InitButtonFunc (&image[0].overlay_button[3], Overlay3);67 InitButtonFunc (&image[0].overlay_button[3], Overlay3); 68 68 69 69 InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits); 70 //InitButtonFunc (&image[0].hms_button, ToggleDEG);70 InitButtonFunc (&image[0].hms_button, ToggleDEG); 71 71 72 72 return (image); … … 113 113 CrossHairs (graphic, image); 114 114 115 for (i = 0; i < NOVERLAYS; i++) { 116 if (image[0].overlay[i].active) { 117 PaintOverlay (graphic, image, i); 118 } 119 } 115 120 # if (0) 116 for (i = 0; i < NOVERLAYS; i++) {117 if (OVERLAY[i])118 PaintOverlay (graphic, image, i);119 }120 121 PaintTickmarks (graphic, image); 121 122 # endif -
trunk/Ohana/src/kapa2/src/LoadOverlay.c
r13320 r13331 8 8 double x, y, dx, dy; 9 9 int Nin, bytes, status; 10 int i, N, NOBJECTS, Nobjects, Nstart , done;10 int i, N, NOBJECTS, Nobjects, Nstart; 11 11 Section *section; 12 12 KapaImageWidget *image; … … 19 19 ALLOCATE (buffer, char, 65536); /* space for 512 lines of 128 bytes */ 20 20 bzero (buffer, 65536); 21 done = FALSE;22 21 23 22 KiiScanCommand (sock, 16, "%*s %d", &N); 24 23 Nstart = image[0].overlay[N].Nobjects; 25 24 26 while ( !done) {25 while (1) { 27 26 KiiScanCommand (sock, 16, "%s %d", word, &Nin); 28 27 if (!strcmp (word, "DONE")) break; 29 if (strcmp (word, "NLINES")) { 30 fprintf (stderr, "!"); 31 continue; 32 } 28 if (strcmp (word, "NLINES")) abort(); 33 29 34 30 buff = buffer; -
trunk/Ohana/src/kapa2/src/PSit.c
r13320 r13331 6 6 static Graphic *graphic; 7 7 8 int PS it() {8 int PScommand () { 9 9 10 int i, Nsection, pageMode, scaleMode; 10 int status, scaleMode, pageMode; 11 char filename[1024], pagename[1024]; 12 13 /* expect a line telling the number of bytes and a filename */ 14 KiiScanMessage (sock, "%s %s %d %d", filename, pagename, &scaleMode, &pageMode); 15 status = PSit (filename, pagename, scaleMode, pageMode); 16 return (status); 17 } 18 19 int PSit (char *filename, char *pagename, int scaleMode, int pageMode) { 20 21 int i, Nsection; 11 22 double scale; 12 23 FILE *f; 13 char filename[1024], pagename[1024],*version;24 char *version; 14 25 Section *section; 15 26 16 27 graphic = GetGraphic(); 17 18 /* expect a line telling the number of bytes and a filename */19 KiiScanMessage (sock, "%s %s %d %d", filename, pagename, &scaleMode, &pageMode);20 28 21 29 if (pageMode == KAPA_PS_NEWPAGE) { … … 76 84 } 77 85 86 Nsection = GetNumberOfSections (); 78 87 for (i = 0; i < Nsection; i++) { 79 88 section = GetSectionByNumber (i); … … 85 94 } 86 95 if (section->image) { 87 // PSimage ();96 PSimage (section->image, f); 88 97 } 89 98 }
Note:
See TracChangeset
for help on using the changeset viewer.
