Changeset 29214
- Timestamp:
- Sep 23, 2010, 6:56:30 AM (16 years ago)
- Location:
- branches/eam_branches/ipp-20100823/Ohana/src/kapa2
- Files:
-
- 8 edited
-
include/buttons.h (modified) (12 diffs)
-
include/prototypes.h (modified) (1 diff)
-
include/structures.h (modified) (2 diffs)
-
src/ButtonFunctions.c (modified) (2 diffs)
-
src/CheckButtons.c (modified) (1 diff)
-
src/Image.c (modified) (4 diffs)
-
src/SetImageSize.c (modified) (4 diffs)
-
src/UpdateStatusBox.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/buttons.h
r17419 r29214 1 1 #define PS_width 25 2 2 #define PS_height 25 3 staticchar PS_bits[] = {3 char PS_bits[] = { 4 4 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x81, 0x3f, 0x00, 5 5 0x82, 0x67, 0x60, 0x00, 0x02, 0x26, 0x40, 0x00, 0x02, 0x24, 0x40, 0x00, … … 13 13 #define grey_width 25 14 14 #define grey_height 25 15 staticchar grey_bits[] = {15 char grey_bits[] = { 16 16 0x90, 0x40, 0xf7, 0x01, 0x04, 0xaa, 0xad, 0x01, 0x68, 0xd5, 0xfe, 0x01, 17 17 0x82, 0x28, 0xdb, 0x01, 0x10, 0xd2, 0x75, 0x01, 0x40, 0xad, 0xee, 0x01, … … 25 25 #define rainbow_width 25 26 26 #define rainbow_height 25 27 staticchar rainbow_bits[] = {27 char rainbow_bits[] = { 28 28 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 29 0x00, 0x80, 0xff, 0x00, 0x00, 0x70, 0x00, 0x01, 0x00, 0x0c, 0x7f, 0x00, … … 37 37 #define recenter_width 25 38 38 #define recenter_height 25 39 staticchar recenter_bits[] = {39 char recenter_bits[] = { 40 40 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 41 41 0x80, 0xef, 0x03, 0x00, 0xe0, 0x00, 0x0e, 0x00, 0x30, 0x00, 0x18, 0x00, … … 49 49 #define heat_width 25 50 50 #define heat_height 25 51 staticchar heat_bits[] = {51 char heat_bits[] = { 52 52 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xd8, 0x01, 53 53 0x00, 0x0c, 0x37, 0x00, 0xf8, 0xc9, 0x6f, 0x00, 0x0c, 0xde, 0xf0, 0x00, … … 61 61 #define red_width 25 62 62 #define red_height 25 63 staticchar red_bits[] = {63 char red_bits[] = { 64 64 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xfc, 0x03, 0x00, 65 65 0x20, 0x07, 0x06, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x08, 0x00, … … 73 73 #define green_width 25 74 74 #define green_height 25 75 staticchar green_bits[] = {75 char green_bits[] = { 76 76 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 77 77 0x00, 0x06, 0x04, 0x00, 0x80, 0x03, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, … … 85 85 #define blue_width 25 86 86 #define blue_height 25 87 staticchar blue_bits[] = {87 char blue_bits[] = { 88 88 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xfe, 0x00, 0x00, 89 89 0xc0, 0x83, 0x07, 0x00, 0xc0, 0x00, 0x0c, 0x00, 0x40, 0x00, 0x08, 0x00, … … 97 97 #define yellow_width 25 98 98 #define yellow_height 25 99 staticchar yellow_bits[] = {99 char yellow_bits[] = { 100 100 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x18, 0x00, 101 101 0x80, 0x01, 0x0c, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00, 0x02, 0x02, 0x00, … … 107 107 0x00, 0x30, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 108 108 0x00, 0x00, 0x00, 0x00}; 109 #define hms_width 25110 #define hms_height 25111 static char hms_bits[] = {112 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,113 0x02, 0x00, 0x00, 0x00, 0x02, 0x01, 0xf0, 0x00, 0x1e, 0xef, 0x89, 0x00,114 0x22, 0x11, 0x09, 0x00, 0x22, 0x11, 0x71, 0x00, 0x22, 0x11, 0x81, 0x00,115 0x22, 0x11, 0x89, 0x00, 0x22, 0x01, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00,116 0x1e, 0xc7, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x80, 0x00,117 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00,118 0x40, 0x80, 0x80, 0x00, 0x5c, 0xb8, 0xb8, 0x00, 0x62, 0xc4, 0xc4, 0x00,119 0x42, 0x84, 0x84, 0x00, 0x42, 0x84, 0x84, 0x00, 0x62, 0xc4, 0xc4, 0x00,120 0x5c, 0xb9, 0xb8, 0x00};121 109 #define flipx_width 25 122 110 #define flipx_height 25 123 staticchar flipx_bits[] = {111 char flipx_bits[] = { 124 112 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 125 113 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x80, 0x10, 0x02, 0x00, … … 133 121 #define flipy_width 25 134 122 #define flipy_height 25 135 staticchar flipy_bits[] = {123 char flipy_bits[] = { 136 124 0x00, 0x10, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 137 125 0x00, 0x82, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x80, 0x00, 0x02, 0x00, … … 143 131 0x00, 0x82, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 144 132 0x00, 0x10, 0x00, 0x00 }; 133 #define hms_width 25 134 #define hms_height 12 135 char hms_bits[] = { 136 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 137 0x02, 0x00, 0x00, 0x00, 0x02, 0x01, 0xf0, 0x00, 0x1e, 0xef, 0x89, 0x00, 138 0x22, 0x11, 0x09, 0x00, 0x22, 0x11, 0x71, 0x00, 0x22, 0x11, 0x81, 0x00, 139 0x22, 0x11, 0x89, 0x00, 0x22, 0x01, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00}; 140 #define ddd_width 25 141 #define ddd_height 12 142 char ddd_bits[] = { 143 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 144 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 0x5c, 0xb8, 0xb8, 0x00, 145 0x62, 0xc4, 0xc4, 0x00, 0x42, 0x84, 0x84, 0x00, 0x42, 0x84, 0x84, 0x00, 146 0x62, 0xc4, 0xc4, 0x00, 0x5c, 0xb9, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00}; 147 #define hex_width 25 148 #define hex_height 12 149 char hex_bits[] = { 150 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 151 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf0, 0x00, 0x1e, 0x00, 0x88, 0x00, 152 0x22, 0x00, 0x08, 0x00, 0x22, 0x00, 0x70, 0x00, 0x22, 0x00, 0x80, 0x00, 153 0x22, 0x00, 0x88, 0x00, 0x22, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00}; -
branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/prototypes.h
r27790 r29214 203 203 int RecenterRescale PROTO((Graphic *graphic, KapaImageWidget *image)); 204 204 int ToggleDEG PROTO((Graphic *graphic, KapaImageWidget *image)); 205 int ToggleHEX PROTO((Graphic *graphic, KapaImageWidget *image)); 205 206 int FlipImageX PROTO((Graphic *graphic, KapaImageWidget *image)); 206 207 int FlipImageY PROTO((Graphic *graphic, KapaImageWidget *image)); -
branches/eam_branches/ipp-20100823/Ohana/src/kapa2/include/structures.h
r27790 r29214 186 186 Button recenter_button; 187 187 Button hms_button; /* toggle HMS/DECIMAL mode (DECIMAL_DEG macro) */ 188 Button hex_button; /* toggle HEX / FLOAT mode */ 188 189 Button grey_button; 189 190 Button rainbow_button; … … 199 200 int MovePointer; 200 201 int DecimalDegrees; 202 int HexValue; 201 203 202 204 // double X, Y; /* image pixel at screen center */ -
branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/ButtonFunctions.c
r25757 r29214 1 1 # include "Ximage.h" 2 # include "buttons.h" 2 3 3 4 int PSfunction (Graphic *graphic, KapaImageWidget *image) { … … 103 104 104 105 image[0].DecimalDegrees = image[0].DecimalDegrees ^ TRUE; 106 image[0].hms_button.bitmap = (image[0].DecimalDegrees) ? hms_bits : ddd_bits; 107 StatusBox (graphic, image); 108 DrawButton (graphic, &image[0].hms_button); 109 FlushDisplay (); 110 return (TRUE); 111 } 112 113 int ToggleHEX (Graphic *graphic, KapaImageWidget *image) { 114 115 image[0].HexValue = image[0].HexValue ^ TRUE; 105 116 StatusBox (graphic, image); 106 117 FlushDisplay (); 107 118 return (TRUE); 108 109 119 } 110 120 -
branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/CheckButtons.c
r16810 r29214 25 25 if (InButton (event, &image[0].hms_button)) 26 26 button = &image[0].hms_button; 27 28 if (InButton (event, &image[0].hex_button)) 29 button = &image[0].hex_button; 27 30 28 31 if (InButton (event, &image[0].flipx_button)) -
branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/Image.c
r27435 r29214 70 70 image[0].MovePointer = TRUE; 71 71 image[0].DecimalDegrees = TRUE; 72 image[0].HexValue = FALSE; 73 72 74 ALLOCATE (image[0].picture.data, char, 1); /* allocate so later free will not crash! */ 73 75 ALLOCATE (image[0].cmapbar.data, char, 1); /* allocate so later free will not crash! */ … … 104 106 InitButtonFunc (&image[0].overlay_button[3], Overlay3); 105 107 106 InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits); 108 if (image[0].DecimalDegrees) { 109 InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits); 110 } else { 111 InitButtonSize (&image[0].hms_button, ddd_width, ddd_height, ddd_bits); 112 } 107 113 InitButtonFunc (&image[0].hms_button, ToggleDEG); 114 115 InitButtonSize (&image[0].hex_button, hex_width, hex_height, hex_bits); 116 InitButtonFunc (&image[0].hex_button, ToggleHEX); 108 117 109 118 InitButtonSize (&image[0].flipx_button, flipx_width, flipx_height, flipx_bits); … … 117 126 118 127 void InitButtonSize (Button *button, int width, int height, char *bitmap) { 119 button->dx = BUTTON_WIDTH;120 button->dy = BUTTON_HEIGHT;128 button->dx = width + 2; 129 button->dy = height + 2; 121 130 button->width = width; 122 131 button->height = height; … … 185 194 DrawButton (graphic, &image[0].heat_button); 186 195 DrawButton (graphic, &image[0].hms_button); 196 DrawButton (graphic, &image[0].hex_button); 187 197 188 198 DrawButton (graphic, &image[0].flipx_button); -
branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/SetImageSize.c
r16810 r29214 96 96 image[0].hms_button.y = image[0].overlay_button[0].y; 97 97 98 image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1; 99 image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1; 100 98 101 image[0].PS_button.x = image[0].text_x; 99 102 image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1; … … 175 178 image[0].hms_button.y = image[0].overlay_button[0].y; 176 179 180 image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1; 181 image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1; 182 177 183 image[0].PS_button.x = image[0].text_x; 178 184 image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1; … … 254 260 image[0].hms_button.y = image[0].overlay_button[0].y; 255 261 262 image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1; 263 image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1; 264 256 265 image[0].PS_button.x = image[0].zoom.x; 257 266 image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1; … … 332 341 image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1; 333 342 image[0].hms_button.y = image[0].overlay_button[0].y; 343 344 image[0].hex_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1; 345 image[0].hex_button.y = image[0].overlay_button[0].y + image[0].hms_button.dy + 1; 334 346 335 347 image[0].PS_button.x = image[0].zoom.x; -
branches/eam_branches/ipp-20100823/Ohana/src/kapa2/src/UpdateStatusBox.c
r25757 r29214 43 43 } 44 44 bzero (line, 100); 45 sprintf (line, "%22.3f", z); 45 46 if (image[0].HexValue) { 47 sprintf (line, "%04x", (int) z); 48 } else { 49 sprintf (line, "%22.3f", z); 50 } 46 51 XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 47 52 image[0].text_x + PAD1, image[0].text_y + textpad + PAD1, line, strlen(line));
Note:
See TracChangeset
for help on using the changeset viewer.
