Changeset 13394
- Timestamp:
- May 15, 2007, 5:42:03 PM (19 years ago)
- Location:
- branches/kapa-mods-2007-05/Ohana/src
- Files:
-
- 16 edited
-
kapa2/src/CheckPipe.c (modified) (1 diff)
-
kapa2/src/Image.c (modified) (3 diffs)
-
kapa2/src/LoadFrame.c (modified) (1 diff)
-
kapa2/src/Refresh.c (modified) (1 diff)
-
kapa2/src/SetImageSize.c (modified) (2 diffs)
-
opihi/cmd.data/close.c (modified) (1 diff)
-
opihi/dimm/dimm.c.in (modified) (1 diff)
-
opihi/dvo/dvo.c.in (modified) (1 diff)
-
opihi/include/display.h (modified) (1 diff)
-
opihi/lib.data/open_kapa.c (modified) (3 diffs)
-
opihi/lib.data/style_args.c (modified) (1 diff)
-
opihi/mana/mana.c.in (modified) (1 diff)
-
opihi/mana/opihi.c (modified) (1 diff)
-
opihi/pantasks/pantasks.c.in (modified) (1 diff)
-
opihi/pantasks/pantasks_client.c.in (modified) (1 diff)
-
opihi/pantasks/pantasks_server.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/CheckPipe.c
r13391 r13394 22 22 if (sock == -1) return (TRUE); 23 23 close (InitSocket); /* stop listening on this socket */ 24 fcntl (sock, F_SETFL, O_NONBLOCK); 24 25 } 25 26 -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Image.c
r13344 r13394 106 106 image[0].picture.dx, image[0].picture.dy); 107 107 108 XPutImage (graphic[0].display, graphic[0].window, graphic[0].gc,109 image[0].cmapbar.pix, 0, 0,110 image[0].cmapbar.x, image[0].cmapbar.y,111 image[0].cmapbar.dx, image[0].cmapbar.dy);112 113 CrossHairs (graphic, image);114 115 108 for (i = 0; i < NOVERLAYS; i++) { 116 109 if (image[0].overlay[i].active) { … … 122 115 # endif 123 116 124 // XXX make this optional?a 125 if (1) { 117 if (image[0].location) { 118 XPutImage (graphic[0].display, graphic[0].window, graphic[0].gc, 119 image[0].cmapbar.pix, 0, 0, 120 image[0].cmapbar.x, image[0].cmapbar.y, 121 image[0].cmapbar.dx, image[0].cmapbar.dy); 122 123 CrossHairs (graphic, image); 124 126 125 /* erase everything below zoom box, then draw */ 127 126 XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back); … … 139 138 DrawButton (graphic, &image[0].overlay_button[i]); 140 139 } 140 StatusBox (graphic, image); 141 141 } 142 143 StatusBox (graphic, image);144 142 145 143 FlushDisplay (graphic[0].display); -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/LoadFrame.c
r13344 r13394 62 62 } 63 63 64 SetGraphSize (section); 64 65 if (USE_XWINDOW) DrawFrame (graph); 65 66 FlushDisplay (); -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/Refresh.c
r13320 r13394 21 21 for (i = 0; i < Nsection; i++) { 22 22 section = GetSectionByNumber (i); 23 DrawImage (section->image); 23 24 DrawGraph (section->graph); 24 DrawImage (section->image);25 25 } 26 26 -
branches/kapa-mods-2007-05/Ohana/src/kapa2/src/SetImageSize.c
r13320 r13394 7 7 void SetImageSize (Section *section) { 8 8 9 int Xs, Ys, Xe, Ye, dX, dY; 9 10 KapaImageWidget *image; 10 11 Graphic *graphic; … … 16 17 graphic = GetGraphic (); 17 18 18 image[0].cmapbar.dx = graphic[0].dx - 2*PAD1; 19 image[0].cmapbar.dy = COLORPAD; 20 image[0].cmapbar.x = PAD1; 21 image[0].cmapbar.y = PAD1; 19 /* the image is placed within the graphic window in region specified by section */ 20 Xs = graphic[0].dx * section[0].x; 21 Ys = graphic[0].dy * (1 - section[0].y - section[0].dy); 22 dX = graphic[0].dx * section[0].dx; 23 dY = graphic[0].dy * section[0].dy; 22 24 23 image[0].zoom.dx = ZOOM_X; 24 image[0].zoom.dy = ZOOM_Y; 25 image[0].zoom.x = graphic[0].dx - PAD1 - ZOOM_X; 26 image[0].zoom.y = image[0].cmapbar.y + image[0].cmapbar.dy + PAD2; 25 // XXX make this user-setable 26 image[0].location = 0; 27 27 28 image[0].picture.dx = image[0].zoom.x - 2*PAD1 - 25; 29 image[0].picture.dy = graphic[0].dy - 2*PAD1 - PAD2 - COLORPAD - 25; 30 image[0].picture.x = PAD1 + 25; 31 image[0].picture.y = PAD1 + PAD2 + COLORPAD; 28 switch (image[0].location) { 29 case 0: 30 image[0].picture.dx = dX - 2*PAD1; 31 image[0].picture.dy = dY - 2*PAD1; 32 image[0].picture.x = Xs + PAD1; 33 image[0].picture.y = Ys + PAD1; 34 if (USE_XWINDOW) CreatePicture (image, graphic); 35 Remap (graphic, image, &image[0].matrix); 36 return; 32 37 33 /** everything below is tied in x-dir to the zoom box **/ 34 image[0].text_x = image[0].zoom.x; 35 image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD2; 38 case 4: 39 image[0].picture.dx = dX - 2*PAD1 - ZOOM_X; 40 image[0].picture.dy = dY - 2*PAD1 - PAD2 - COLORPAD - 25; 41 image[0].picture.x = Xs + PAD1; 42 image[0].picture.y = Ys + PAD1 + PAD2 + COLORPAD; 36 43 37 /* image[0].PS_button.y = graphic[0].dy - BUTTON_HEIGHT - PAD1; */ 38 image[0].PS_button.x = image[0].zoom.x + 5; 39 image[0].PS_button.y = 2*ZOOM_Y; 44 image[0].cmapbar.dx = dX - 2*PAD1; 45 image[0].cmapbar.dy = COLORPAD; 46 image[0].cmapbar.x = Xs + PAD1; 47 image[0].cmapbar.y = Ys + PAD1; 40 48 41 /** everything below is tied to the PS_button in y-dir **/ 42 image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1; 43 image[0].grey_button.y = image[0].PS_button.y; 49 // XXX zoom should scale somewhat with the image (with a min and a max) 50 image[0].zoom.dx = ZOOM_X; 51 image[0].zoom.dy = ZOOM_Y; 52 image[0].zoom.x = Xs + dX - PAD1 - ZOOM_X; 53 image[0].zoom.y = Ys + PAD1 + PAD2 + COLORPAD; 44 54 45 image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1; 46 image[0].rainbow_button.y = image[0].PS_button.y; 55 /** everything below is tied in x-dir to the zoom box **/ 56 image[0].text_x = image[0].zoom.x; 57 image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD2; 47 58 48 image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1; 49 image[0].puns_button.y = image[0].PS_button.y; 59 /* image[0].PS_button.y = graphic[0].dy - BUTTON_HEIGHT - PAD1; */ 60 image[0].PS_button.x = image[0].zoom.x + 5; 61 image[0].PS_button.y = Ys + 2*ZOOM_Y; 50 62 51 image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1; 52 image[0].recenter_button.y = image[0].PS_button.y; 63 /** everything below is tied to the PS_button in y-dir **/ 64 image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1; 65 image[0].grey_button.y = image[0].PS_button.y; 53 66 54 image[0].overlay_button[0].x = image[0].zoom.x + 5; 55 image[0].overlay_button[0].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 67 image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1; 68 image[0].rainbow_button.y = image[0].PS_button.y; 69 70 image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1; 71 image[0].puns_button.y = image[0].PS_button.y; 72 73 image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1; 74 image[0].recenter_button.y = image[0].PS_button.y; 75 76 image[0].overlay_button[0].x = image[0].zoom.x + 5; 77 image[0].overlay_button[0].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 56 78 57 image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;58 image[0].overlay_button[1].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;79 image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1; 80 image[0].overlay_button[1].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 59 81 60 image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;61 image[0].overlay_button[2].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;82 image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1; 83 image[0].overlay_button[2].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 62 84 63 image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;64 image[0].overlay_button[3].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1;85 image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1; 86 image[0].overlay_button[3].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 65 87 66 image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1; 67 image[0].hms_button.y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 88 image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1; 89 image[0].hms_button.y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 90 break; 91 92 default: 93 image[0].picture.dx = dX - 2*PAD1 - ZOOM_X; 94 image[0].picture.dy = dY - 2*PAD1 - PAD2 - COLORPAD - 25; 95 image[0].picture.x = Xs + PAD1; 96 image[0].picture.y = Ys + PAD1 + PAD2 + COLORPAD; 97 98 image[0].cmapbar.dx = dX - 2*PAD1; 99 image[0].cmapbar.dy = COLORPAD; 100 image[0].cmapbar.x = Xs + PAD1; 101 image[0].cmapbar.y = Ys + PAD1; 102 103 // XXX zoom should scale somewhat with the image (with a min and a max) 104 image[0].zoom.dx = ZOOM_X; 105 image[0].zoom.dy = ZOOM_Y; 106 image[0].zoom.x = Xs + dX - PAD1 - ZOOM_X; 107 image[0].zoom.y = Ys + PAD1 + PAD2 + COLORPAD; 108 109 /** everything below is tied in x-dir to the zoom box **/ 110 image[0].text_x = image[0].zoom.x; 111 image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD2; 112 113 /* image[0].PS_button.y = graphic[0].dy - BUTTON_HEIGHT - PAD1; */ 114 image[0].PS_button.x = image[0].zoom.x + 5; 115 image[0].PS_button.y = Ys + 2*ZOOM_Y; 116 117 /** everything below is tied to the PS_button in y-dir **/ 118 image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1; 119 image[0].grey_button.y = image[0].PS_button.y; 120 121 image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1; 122 image[0].rainbow_button.y = image[0].PS_button.y; 123 124 image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1; 125 image[0].puns_button.y = image[0].PS_button.y; 126 127 image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1; 128 image[0].recenter_button.y = image[0].PS_button.y; 129 130 image[0].overlay_button[0].x = image[0].zoom.x + 5; 131 image[0].overlay_button[0].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 132 133 image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1; 134 image[0].overlay_button[1].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 135 136 image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1; 137 image[0].overlay_button[2].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 138 139 image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1; 140 image[0].overlay_button[3].y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 141 142 image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1; 143 image[0].hms_button.y = image[0].PS_button.y - BUTTON_HEIGHT - PAD1; 144 break; 145 } 68 146 69 147 if (USE_XWINDOW) { -
branches/kapa-mods-2007-05/Ohana/src/opihi/cmd.data/close.c
r13391 r13394 15 15 16 16 if (!GetGraph (NULL, &kapa, name)) return (FALSE); 17 18 close_kapa (name); 17 19 FREE (name); 18 19 // close_kapa (name);20 20 21 21 return (TRUE); -
branches/kapa-mods-2007-05/Ohana/src/opihi/dimm/dimm.c.in
r12280 r13394 50 50 /* add program-dependent exit functions here */ 51 51 void cleanup () { 52 QuitImage (); 53 QuitGraph (); 52 QuitKapa (); 54 53 return; 55 54 } -
branches/kapa-mods-2007-05/Ohana/src/opihi/dvo/dvo.c.in
r12280 r13394 55 55 /* add program-dependent exit functions here */ 56 56 void cleanup () { 57 QuitImage (); 58 QuitGraph (); 57 QuitKapa (); 59 58 return; 60 59 } -
branches/kapa-mods-2007-05/Ohana/src/opihi/include/display.h
r13391 r13394 34 34 int SelectOverlay PROTO((char *name, int *number)); 35 35 36 void QuitKapa (); 36 37 void InitKapa (); 37 38 int open_kapa (int entry); 39 int close_kapa (char *name); 38 40 int AddKapaDevice (char *name); 39 41 int DelKapaDevice (char *name); -
branches/kapa-mods-2007-05/Ohana/src/opihi/lib.data/open_kapa.c
r13391 r13394 50 50 N = FindKapaDevice (name); 51 51 if (N == -1) return (FALSE); 52 52 53 if (Socket[N] != -1) close (Socket[N]); 53 54 free (Device[N]); 54 55 for (i = N; i < Ndevice - 1; i++) { 55 Device[N] = Device[N+1]; 56 Socket[N] = Socket[N+1]; 57 } 56 Device[i] = Device[i+1]; 57 Socket[i] = Socket[i+1]; 58 } 59 60 if (N == Active) { 61 Active = -1; 62 } 63 58 64 Ndevice --; 59 65 REALLOCATE (Device, char *, Ndevice); 60 66 REALLOCATE (Socket, int, Ndevice); 67 61 68 return (TRUE); 62 69 } … … 66 73 67 74 int i; 75 76 if (name == NULL) return (-1); 68 77 69 78 for (i = 0; i < Ndevice; i++) { … … 255 264 *range = Xrange; 256 265 } 266 267 int close_kapa (char *name) { 268 269 int N; 270 271 N = FindKapaDevice (name); 272 if (N == -1) { 273 if (Active < 0) return (FALSE); 274 name = Device[Active]; 275 } 276 DelKapaDevice (name); 277 return (TRUE); 278 } 279 280 void QuitKapa () { 281 282 int i; 283 284 for (i = 0; i < Ndevice; i++) { 285 if (Socket[i] != -1) close (Socket[i]); 286 if (Device[i] != NULL) free (Device[i]); 287 } 288 REALLOCATE (Socket, int, 1); 289 REALLOCATE (Device, char *, 1); 290 291 Ndevice = 0; 292 Active = -1; 293 } -
branches/kapa-mods-2007-05/Ohana/src/opihi/lib.data/style_args.c
r13391 r13394 13 13 remove_argument (N, argc, argv); 14 14 } 15 if (!GetGraph ( &graphmode, kapa, name)) return (FALSE);15 if (!GetGraph (graphmode, kapa, name)) return (FALSE); 16 16 FREE (name); 17 17 -
branches/kapa-mods-2007-05/Ohana/src/opihi/mana/mana.c.in
r13344 r13394 51 51 /* add program-dependent exit functions here */ 52 52 void cleanup () { 53 // QuitImage (); 54 // QuitGraph (); 53 QuitKapa (); 55 54 return; 56 55 } -
branches/kapa-mods-2007-05/Ohana/src/opihi/mana/opihi.c
r10647 r13394 64 64 /* add program-dependent exit functions here */ 65 65 void cleanup () { 66 /* -libdisplay 67 QuitImage (); 68 QuitGraph (); */ 66 QuitKapa (); 69 67 return; 70 68 } -
branches/kapa-mods-2007-05/Ohana/src/opihi/pantasks/pantasks.c.in
r12280 r13394 64 64 /* add program-dependent exit functions here */ 65 65 void cleanup () { 66 QuitImage (); 67 QuitGraph (); 66 QuitKapa (); 68 67 QuitController (); 69 68 return; -
branches/kapa-mods-2007-05/Ohana/src/opihi/pantasks/pantasks_client.c.in
r12280 r13394 54 54 /* add program-dependent exit functions here */ 55 55 void cleanup () { 56 QuitImage (); 57 QuitGraph (); 56 QuitKapa (); 58 57 return; 59 58 } -
branches/kapa-mods-2007-05/Ohana/src/opihi/pantasks/pantasks_server.c
r11890 r13394 74 74 /* add program-dependent exit functions here */ 75 75 void cleanup () { 76 // QuitImage (); 77 // QuitGraph (); 78 // QuitController (); 76 QuitKapa (); 77 QuitController (); 79 78 return; 80 79 }
Note:
See TracChangeset
for help on using the changeset viewer.
