Changeset 16772
- Timestamp:
- Mar 1, 2008, 9:27:04 AM (18 years ago)
- Location:
- branches/eam_branch_20080223/Ohana/src/kapa2
- Files:
-
- 7 edited
-
include/buttons.h (modified) (1 diff)
-
include/prototypes.h (modified) (1 diff)
-
include/structures.h (modified) (1 diff)
-
src/ButtonFunctions.c (modified) (10 diffs)
-
src/CheckButtons.c (modified) (1 diff)
-
src/Image.c (modified) (2 diffs)
-
src/SetImageSize.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080223/Ohana/src/kapa2/include/buttons.h
r16011 r16772 119 119 0x42, 0x84, 0x84, 0x00, 0x42, 0x84, 0x84, 0x00, 0x62, 0xc4, 0xc4, 0x00, 120 120 0x5c, 0xb9, 0xb8, 0x00}; 121 #define flipx_width 25 122 #define flipx_height 25 123 static unsigned char flipx_bits[] = { 124 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 125 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x80, 0x10, 0x02, 0x00, 126 0x40, 0x00, 0x04, 0x00, 0x20, 0x10, 0x08, 0x00, 0x10, 0x10, 0x10, 0x00, 127 0x08, 0x00, 0x20, 0x00, 0x04, 0x10, 0x40, 0x00, 0x02, 0x10, 0x80, 0x00, 128 0x01, 0x00, 0x00, 0x01, 0x02, 0x10, 0x80, 0x00, 0x04, 0x10, 0x40, 0x00, 129 0x08, 0x00, 0x20, 0x00, 0x10, 0x10, 0x10, 0x00, 0x20, 0x10, 0x08, 0x00, 130 0x40, 0x00, 0x04, 0x00, 0x80, 0x10, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, 131 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 132 0x00, 0x10, 0x00, 0x00 }; 133 #define flipy_width 25 134 #define flipy_height 25 135 static unsigned char flipy_bits[] = { 136 0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 137 0x00, 0x82, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x80, 0x00, 0x02, 0x00, 138 0x40, 0x00, 0x04, 0x00, 0x20, 0x00, 0x08, 0x00, 0x10, 0x00, 0x10, 0x00, 139 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 140 0xb7, 0x6d, 0xdb, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 141 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00, 0x08, 0x00, 142 0x40, 0x00, 0x04, 0x00, 0x80, 0x00, 0x02, 0x00, 0x00, 0x01, 0x01, 0x00, 143 0x00, 0x82, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 144 0x00, 0x10, 0x00, 0x00 }; -
branches/eam_branch_20080223/Ohana/src/kapa2/include/prototypes.h
r16632 r16772 195 195 int RecenterRescale PROTO((Graphic *graphic, KapaImageWidget *image)); 196 196 int ToggleDEG PROTO((Graphic *graphic, KapaImageWidget *image)); 197 int FlipImageX PROTO((Graphic *graphic, KapaImageWidget *image)); 198 int FlipImageY PROTO((Graphic *graphic, KapaImageWidget *image)); 197 199 int Overlay0 PROTO((Graphic *graphic, KapaImageWidget *image)); 198 200 int Overlay1 PROTO((Graphic *graphic, KapaImageWidget *image)); -
branches/eam_branch_20080223/Ohana/src/kapa2/include/structures.h
r16632 r16772 180 180 Button heat_button; 181 181 Button overlay_button[NOVERLAYS]; 182 Button flipx_button; 183 Button flipy_button; 182 184 183 185 // location of the status box -
branches/eam_branch_20080223/Ohana/src/kapa2/src/ButtonFunctions.c
r16632 r16772 17 17 CreateWide (graphic, image); 18 18 Refresh (); 19 XFlush (graphic[0].display);20 19 return (TRUE); 21 20 } … … 29 28 CreateWide (graphic, image); 30 29 Refresh (); 31 XFlush (graphic[0].display);32 30 return (TRUE); 33 31 } … … 41 39 CreateWide (graphic, image); 42 40 Refresh (); 43 XFlush (graphic[0].display);44 41 return (TRUE); 45 42 } … … 52 49 Remap (graphic, image); 53 50 Refresh (); 54 FlushDisplay (graphic[0].display);55 51 return (TRUE); 56 52 … … 62 58 Remap (graphic, image); 63 59 Refresh (); 64 FlushDisplay (graphic[0].display);65 60 return (TRUE); 66 61 … … 75 70 Remap (graphic, image); 76 71 Refresh (); 77 FlushDisplay (graphic[0].display);78 72 return (TRUE); 79 73 80 74 } 81 75 76 int FlipImageX (Graphic *graphic, KapaImageWidget *image) { 77 78 image[0].picture.flipx = !image[0].picture.flipx; 79 image[0].zoom.flipx = !image[0].zoom.flipx; 80 image[0].wide.flipx = !image[0].wide.flipx; 81 82 Remap (graphic, image); 83 CreateWide (graphic, image); 84 Refresh (); 85 return (TRUE); 86 } 87 88 int FlipImageY (Graphic *graphic, KapaImageWidget *image) { 89 90 image[0].picture.flipy = !image[0].picture.flipy; 91 image[0].zoom.flipy = !image[0].zoom.flipy; 92 image[0].wide.flipy = !image[0].wide.flipy; 93 94 Remap (graphic, image); 95 CreateWide (graphic, image); 96 Refresh (); 97 return (TRUE); 98 } 99 82 100 int ToggleDEG (Graphic *graphic, KapaImageWidget *image) { 83 101 84 image[0].picture.flipy = !image[0].picture.flipy;85 image[0].zoom.flipy = !image[0].zoom.flipy;86 image[0].wide.flipy = !image[0].wide.flipy;87 102 image[0].DecimalDegrees = image[0].DecimalDegrees ^ TRUE; 88 103 StatusBox (graphic, image); … … 97 112 image[0].overlay[0].active = image[0].overlay[0].active ^ TRUE; 98 113 Refresh (); 99 FlushDisplay (graphic[0].display);100 114 return (TRUE); 101 115 … … 106 120 image[0].overlay[1].active = image[0].overlay[1].active ^ TRUE; 107 121 Refresh (); 108 FlushDisplay (graphic[0].display);109 122 return (TRUE); 110 123 … … 115 128 image[0].overlay[2].active = image[0].overlay[2].active ^ TRUE; 116 129 Refresh (); 117 FlushDisplay (graphic[0].display);118 130 return (TRUE); 119 131 … … 124 136 image[0].overlay[3].active = image[0].overlay[3].active ^ TRUE; 125 137 Refresh (); 126 FlushDisplay (graphic[0].display);127 138 return (TRUE); 128 139 -
branches/eam_branch_20080223/Ohana/src/kapa2/src/CheckButtons.c
r16011 r16772 26 26 button = &image[0].hms_button; 27 27 28 if (InButton (event, &image[0].flipx_button)) 29 button = &image[0].flipx_button; 30 31 if (InButton (event, &image[0].flipy_button)) 32 button = &image[0].flipy_button; 33 28 34 for (i = 0; i < NOVERLAYS; i++) { 29 35 if (InButton (event, &image[0].overlay_button[i])) -
branches/eam_branch_20080223/Ohana/src/kapa2/src/Image.c
r16632 r16772 106 106 InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits); 107 107 InitButtonFunc (&image[0].hms_button, ToggleDEG); 108 109 InitButtonSize (&image[0].flipx_button, flipx_width, flipx_height, flipx_bits); 110 InitButtonFunc (&image[0].flipx_button, FlipImageX); 111 112 InitButtonSize (&image[0].flipy_button, flipy_width, flipy_height, flipy_bits); 113 InitButtonFunc (&image[0].flipy_button, FlipImageY); 108 114 109 115 return (image); … … 175 181 DrawButton (graphic, &image[0].hms_button); 176 182 183 DrawButton (graphic, &image[0].flipx_button); 184 DrawButton (graphic, &image[0].flipy_button); 185 177 186 for (i = 0; i < NOVERLAYS; i++) { 178 187 DrawButton (graphic, &image[0].overlay_button[i]); -
branches/eam_branch_20080223/Ohana/src/kapa2/src/SetImageSize.c
r16632 r16772 26 26 dY = graphic[0].dy * section[0].dy; 27 27 28 textpad = USE_XWINDOW ? graphic[0].font[0].ascent : 10; 29 textdY = 6*textpad + 7*PAD1; 30 WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1); 31 28 32 switch (image[0].location) { 29 case 0: 33 34 case 0: // no zoom / status / wide 30 35 if (section->graph) { 31 36 image[0].picture.x = graph[0].axis[0].fx; … … 43 48 return; 44 49 45 case 1: 46 textpad = USE_XWINDOW ? graphic[0].font[0].ascent : 10; 47 textdY = 6*textpad + 7*PAD1; 48 WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1); 50 case 1: // zoom / status / wide on bottom 49 51 50 52 if (section->graph) { … … 110 112 image[0].recenter_button.y = image[0].PS_button.y; 111 113 114 // add just below 115 image[0].flipx_button.x = image[0].recenter_button.x + image[0].recenter_button.dx + PAD1; 116 image[0].flipx_button.y = image[0].recenter_button.y; 117 118 image[0].flipy_button.x = image[0].hms_button.x + image[0].hms_button.dx + PAD1; 119 image[0].flipy_button.y = image[0].hms_button.y; 120 112 121 // XXX zoom should scale somewhat with the image? (with a min and a max) 113 122 // XXX actually, it is limited by the buttons and status region 114 123 image[0].wide.dx = ZOOM_X; 115 124 image[0].wide.dy = ZOOM_Y; 116 image[0].wide.x = image[0].recenter_button.x + image[0].recenter_button.dx + PAD1; 117 image[0].wide.y = image[0].PS_button.y; 118 break; 119 120 case 3: 121 textpad = USE_XWINDOW ? graphic[0].font[0].ascent : 10; 122 textdY = 6*textpad + 7*PAD1; 123 WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1); 125 image[0].wide.x = image[0].flipx_button.x + image[0].flipx_button.dx + PAD1; 126 image[0].wide.y = image[0].zoom.y; 127 break; 128 129 case 3: // zoom / status / wide on top 124 130 125 131 if (section->graph) { … … 185 191 image[0].recenter_button.y = image[0].PS_button.y; 186 192 193 // add just below 194 image[0].flipx_button.x = image[0].recenter_button.x + image[0].recenter_button.dx + PAD1; 195 image[0].flipx_button.y = image[0].recenter_button.y; 196 197 image[0].flipy_button.x = image[0].hms_button.x + image[0].hms_button.dx + PAD1; 198 image[0].flipy_button.y = image[0].hms_button.y; 199 187 200 // XXX zoom should scale somewhat with the image? (with a min and a max) 188 201 // XXX actually, it is limited by the buttons and status region 189 202 image[0].wide.dx = ZOOM_X; 190 203 image[0].wide.dy = ZOOM_Y; 191 image[0].wide.x = image[0]. PS_button.x;192 image[0].wide.y = image[0]. PS_button.y + BUTTON_HEIGHT + PAD1;193 break; 194 195 case 2: 204 image[0].wide.x = image[0].flipx_button.x + image[0].flipx_button.dx + PAD1; 205 image[0].wide.y = image[0].zoom.y; 206 break; 207 208 case 2: // zoom / status / wide on left 196 209 197 210 if (section->graph) { … … 220 233 221 234 /** everything below is tied in x-dir to the zoom box **/ 222 textpad = USE_XWINDOW ? graphic[0].font[0].ascent : 10;223 235 image[0].text_x = image[0].zoom.x; 224 236 image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD1; … … 258 270 image[0].recenter_button.y = image[0].PS_button.y; 259 271 272 // add just below 273 image[0].flipx_button.x = image[0].PS_button.x; 274 image[0].flipx_button.y = image[0].PS_button.y + BUTTON_HEIGHT + PAD1; 275 276 image[0].flipy_button.x = image[0].flipx_button.x + image[0].flipx_button.dx + PAD1; 277 image[0].flipy_button.y = image[0].flipx_button.y; 278 260 279 // XXX zoom should scale somewhat with the image? (with a min and a max) 261 280 // XXX actually, it is limited by the buttons and status region 262 281 image[0].wide.dx = ZOOM_X; 263 282 image[0].wide.dy = ZOOM_Y; 264 image[0].wide.x = image[0]. recenter_button.x + image[0].recenter_button.dx + PAD1;265 image[0].wide.y = image[0]. PS_button.y;266 break; 267 268 case 4: 283 image[0].wide.x = image[0].flipx_button.x; 284 image[0].wide.y = image[0].flipx_button.y + BUTTON_HEIGHT + PAD1; 285 break; 286 287 case 4: // zoom / status / wide on right 269 288 270 289 if (section->graph) { … … 293 312 294 313 /** everything below is tied in x-dir to the zoom box **/ 295 textpad = USE_XWINDOW ? graphic[0].font[0].ascent : 10;296 314 image[0].text_x = image[0].zoom.x; 297 315 image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD1; … … 331 349 image[0].recenter_button.y = image[0].PS_button.y; 332 350 351 // add just below 352 image[0].flipx_button.x = image[0].zoom.x; 353 image[0].flipx_button.y = image[0].PS_button.y + BUTTON_HEIGHT + PAD1; 354 355 image[0].flipy_button.x = image[0].flipx_button.x + image[0].flipx_button.dx + PAD1; 356 image[0].flipy_button.y = image[0].flipx_button.y; 357 333 358 // XXX zoom should scale somewhat with the image? (with a min and a max) 334 359 // XXX actually, it is limited by the buttons and status region 335 360 image[0].wide.dx = ZOOM_X; 336 361 image[0].wide.dy = ZOOM_Y; 337 image[0].wide.x = image[0]. PS_button.x;338 image[0].wide.y = image[0]. PS_button.y + BUTTON_HEIGHT + PAD1;362 image[0].wide.x = image[0].flipx_button.x; 363 image[0].wide.y = image[0].flipx_button.y + BUTTON_HEIGHT + PAD1; 339 364 break; 340 365
Note:
See TracChangeset
for help on using the changeset viewer.
